idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
206,845 | protected void initFactoidCorpus() {<NEW_LINE>// question analysis<NEW_LINE>Ontology wordNet = new WordNet();<NEW_LINE>// - dictionaries for term extraction<NEW_LINE>QuestionAnalysis.clearDictionaries();<NEW_LINE>QuestionAnalysis.addDictionary(wordNet);<NEW_LINE>// - ontologies for term expansion<NEW_LINE>QuestionAnalysis.clearOntologies();<NEW_LINE>QuestionAnalysis.addOntology(wordNet);<NEW_LINE>// query generation<NEW_LINE>QueryGeneration.clearQueryGenerators();<NEW_LINE>QueryGeneration.addQueryGenerator(new BagOfWordsG());<NEW_LINE>QueryGeneration.addQueryGenerator(new BagOfTermsG());<NEW_LINE>QueryGeneration<MASK><NEW_LINE>QueryGeneration.addQueryGenerator(new QuestionInterpretationG());<NEW_LINE>QueryGeneration.addQueryGenerator(new QuestionReformulationG());<NEW_LINE>// search<NEW_LINE>// - knowledge miners for unstructured knowledge sources<NEW_LINE>Search.clearKnowledgeMiners();<NEW_LINE>for (String[] indriIndices : IndriKM.getIndriIndices()) Search.addKnowledgeMiner(new IndriKM(indriIndices, false));<NEW_LINE>for (String[] indriServers : IndriKM.getIndriServers()) Search.addKnowledgeMiner(new IndriKM(indriServers, true));<NEW_LINE>// - knowledge annotators for (semi-)structured knowledge sources<NEW_LINE>Search.clearKnowledgeAnnotators();<NEW_LINE>// answer extraction and selection<NEW_LINE>// (the filters are applied in this order)<NEW_LINE>AnswerSelection.clearFilters();<NEW_LINE>// - answer extraction filters<NEW_LINE>AnswerSelection.addFilter(new AnswerTypeFilter());<NEW_LINE>AnswerSelection.addFilter(new AnswerPatternFilter());<NEW_LINE>AnswerSelection.addFilter(new WebDocumentFetcherFilter());<NEW_LINE>AnswerSelection.addFilter(new PredicateExtractionFilter());<NEW_LINE>AnswerSelection.addFilter(new FactoidsFromPredicatesFilter());<NEW_LINE>AnswerSelection.addFilter(new TruncationFilter());<NEW_LINE>// - answer selection filters<NEW_LINE>} | .addQueryGenerator(new PredicateG()); |
886,538 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create schema MyTypeZero as (col1 int, col2 string);\n" + "@public create schema MyTypeOne as (col1 int, col3 string, col4 int);\n" + "@public create schema MyTypeTwo as (col1 int, col4 boolean, col5 short)";<NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>// try predefined<NEW_LINE>env.compileDeploy("@name('predef') @public create variant schema MyVariantPredef as MyTypeZero, MyTypeOne", path);<NEW_LINE>env.assertStatement("predef", statement -> {<NEW_LINE>EventType variantTypePredef = statement.getEventType();<NEW_LINE>assertEquals(Integer.class, variantTypePredef.getPropertyType("col1"));<NEW_LINE>assertEquals(1, variantTypePredef.getPropertyDescriptors().length);<NEW_LINE>});<NEW_LINE>env.compileDeploy("@public insert into MyVariantPredef select * from MyTypeZero", path);<NEW_LINE>env.compileDeploy("@public insert into MyVariantPredef select * from MyTypeOne", path);<NEW_LINE>env.tryInvalidCompile(path, "insert into MyVariantPredef select * from MyTypeTwo", "Selected event type is not a valid event type of the variant stream 'MyVariantPredef' [insert into MyVariantPredef select * from MyTypeTwo]");<NEW_LINE>// try predefined with any<NEW_LINE>String createText = "@name('predef_any') @public create variant schema MyVariantAnyModel as MyTypeZero, MyTypeOne, *";<NEW_LINE>EPStatementObjectModel <MASK><NEW_LINE>assertEquals(createText, model.toEPL());<NEW_LINE>env.compileDeploy(model, path);<NEW_LINE>env.assertStatement("predef_any", statement -> {<NEW_LINE>EventType predefAnyType = statement.getEventType();<NEW_LINE>assertEquals(4, predefAnyType.getPropertyDescriptors().length);<NEW_LINE>assertEquals(Object.class, predefAnyType.getPropertyType("col1"));<NEW_LINE>assertEquals(Object.class, predefAnyType.getPropertyType("col2"));<NEW_LINE>assertEquals(Object.class, predefAnyType.getPropertyType("col3"));<NEW_LINE>assertEquals(Object.class, predefAnyType.getPropertyType("col4"));<NEW_LINE>});<NEW_LINE>// try "any"<NEW_LINE>env.compileDeploy("@name('any') @public create variant schema MyVariantAny as *", path);<NEW_LINE>env.assertStatement("any", statement -> {<NEW_LINE>EventType variantTypeAny = statement.getEventType();<NEW_LINE>assertEquals(0, variantTypeAny.getPropertyDescriptors().length);<NEW_LINE>});<NEW_LINE>env.compileDeploy("insert into MyVariantAny select * from MyTypeZero", path);<NEW_LINE>env.compileDeploy("insert into MyVariantAny select * from MyTypeOne", path);<NEW_LINE>env.compileDeploy("insert into MyVariantAny select * from MyTypeTwo", path);<NEW_LINE>env.undeployAll();<NEW_LINE>} | model = env.eplToModel(createText); |
1,433,675 | private MInvoiceLine[] createInvoiceLines(MRMA rma, MInvoice invoice) {<NEW_LINE>ArrayList<MInvoiceLine> invLineList = new ArrayList<>();<NEW_LINE>MRMALine[] rmaLines = rma.getLines(true);<NEW_LINE>for (MRMALine rmaLine : rmaLines) {<NEW_LINE>if (rmaLine.getM_InOutLine_ID() == 0) {<NEW_LINE>throw new IllegalStateException("No customer return line - RMA = " + rma.getDocumentNo() + <MASK><NEW_LINE>}<NEW_LINE>MInvoiceLine invLine = new MInvoiceLine(invoice);<NEW_LINE>invLine.setRMALine(rmaLine);<NEW_LINE>if (!invLine.save()) {<NEW_LINE>throw new IllegalStateException("Could not create invoice line");<NEW_LINE>}<NEW_LINE>invLineList.add(invLine);<NEW_LINE>}<NEW_LINE>MInvoiceLine[] invLines = new MInvoiceLine[invLineList.size()];<NEW_LINE>invLineList.toArray(invLines);<NEW_LINE>return invLines;<NEW_LINE>} | ", Line = " + rmaLine.getLine()); |
226,154 | private void addFriendsMenu(Menu menu) {<NEW_LINE>final Menu friends_menu = new Menu(menu.getShell(), SWT.DROP_DOWN);<NEW_LINE>MenuItem friends_menu_item = new MenuItem(menu, SWT.CASCADE);<NEW_LINE>friends_menu_item.setMenu(friends_menu);<NEW_LINE>friends_menu_item.setText(MessageText.getString("Views.plugins.azbuddy.title"));<NEW_LINE>friends_menu.addMenuListener(new MenuAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void menuShown(MenuEvent e) {<NEW_LINE>Utils.clearMenu(friends_menu);<NEW_LINE>boolean enabled = plugin.isClassicEnabled();<NEW_LINE>if (enabled) {<NEW_LINE>MenuItem mi = new <MASK><NEW_LINE>mi.setText(MessageText.getString("azbuddy.insert.friend.key"));<NEW_LINE>mi.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent event) {<NEW_LINE>String uri = getFriendURI(!chat.isAnonymous());<NEW_LINE>input_area.append(uri);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mi.setEnabled(!chat.isReadOnly());<NEW_LINE>new MenuItem(friends_menu, SWT.SEPARATOR);<NEW_LINE>mi = new MenuItem(friends_menu, SWT.PUSH);<NEW_LINE>mi.setText(MessageText.getString("azbuddy.view.friends"));<NEW_LINE>mi.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent event) {<NEW_LINE>view.selectClassicTab();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>MenuItem mi = new MenuItem(friends_menu, SWT.PUSH);<NEW_LINE>mi.setText(MessageText.getString("label.enable"));<NEW_LINE>mi.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent event) {<NEW_LINE>plugin.setClassicEnabled(true, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | MenuItem(friends_menu, SWT.PUSH); |
1,348,252 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>binding = DataBindingUtil.inflate(inflater, R.layout.auto_check_in_fragment, container, false);<NEW_LINE>autoCheckInViewModel = ViewModelProviders.of(getActivity(), viewModelFactory).get(AutoCheckInViewModel.class);<NEW_LINE>autoCheckInViewModel.getProgress().observe(this, this::showProgress);<NEW_LINE>autoCheckInViewModel.getError().observe(this, this::showError);<NEW_LINE>autoCheckInViewModel.getTickets().observe(this, (newTickets) -> {<NEW_LINE>ticketsAdapter.setTickets(newTickets);<NEW_LINE>autoCheckInAll();<NEW_LINE>});<NEW_LINE>autoCheckInViewModel.getTicketUpdatedAction().observe(this, (aVoid) -> {<NEW_LINE>autoCheckInAll();<NEW_LINE>});<NEW_LINE>autoCheckInViewModel.loadTickets(eventId);<NEW_LINE>binding.autoCheckInAll.setOnClickListener(v -> {<NEW_LINE>autoCheckInAll(!binding.autoCheckInAllCheckbox.isChecked());<NEW_LINE>});<NEW_LINE>binding.autoCheckInAllCheckbox.setOnClickListener(v -> {<NEW_LINE>// checkbox already checked<NEW_LINE>autoCheckInAll(<MASK><NEW_LINE>});<NEW_LINE>return binding.getRoot();<NEW_LINE>} | binding.autoCheckInAllCheckbox.isChecked()); |
1,413,031 | public static String createDotGraph(Abstraction absStart, boolean printNeighbors) {<NEW_LINE>IdentityHashMap<Abstraction, Integer> absToId = new IdentityHashMap<>();<NEW_LINE>ArrayDeque<Abstraction> workQueue = new ArrayDeque<>();<NEW_LINE>StringBuilder sbNodes = new StringBuilder();<NEW_LINE>StringBuilder sbEdges = new StringBuilder();<NEW_LINE>int idCounter = 0;<NEW_LINE>workQueue.add(absStart);<NEW_LINE>while (!workQueue.isEmpty()) {<NEW_LINE>Abstraction p = workQueue.poll();<NEW_LINE>Integer id = absToId.get(p);<NEW_LINE>if (id == null) {<NEW_LINE>idCounter++;<NEW_LINE>absToId.put(p, idCounter);<NEW_LINE>// escape(p.toString());<NEW_LINE>String absName = String.valueOf(idCounter);<NEW_LINE>logger.info(idCounter + ": " + p);<NEW_LINE>StringBuilder neighbors = new StringBuilder();<NEW_LINE>for (int i = 0; i < p.getNeighborCount(); i++) {<NEW_LINE>neighbors.append(String.format<MASK><NEW_LINE>}<NEW_LINE>if (p.getNeighborCount() > 0 && printNeighbors)<NEW_LINE>workQueue.addAll(p.getNeighbors());<NEW_LINE>if (p.getPredecessor() != null)<NEW_LINE>workQueue.add(p.getPredecessor());<NEW_LINE>else {<NEW_LINE>if (p.getSourceContext() != null)<NEW_LINE>absName += " [source]";<NEW_LINE>}<NEW_LINE>sbNodes.append(String.format(" abs%d[label=\"{%s|{<a> A%s}}\"];\n", idCounter, absName, neighbors.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>workQueue.add(absStart);<NEW_LINE>Set<Abstraction> seen = new IdentityHashSet<>();<NEW_LINE>while (!workQueue.isEmpty()) {<NEW_LINE>Abstraction p = workQueue.poll();<NEW_LINE>if (seen.add(p)) {<NEW_LINE>Integer id = absToId.get(p);<NEW_LINE>Abstraction pred = p.getPredecessor();<NEW_LINE>if (pred != null) {<NEW_LINE>int dest = absToId.get(pred);<NEW_LINE>sbEdges.append(String.format(" abs%s:a -> abs%d;\n", id, dest));<NEW_LINE>workQueue.add(pred);<NEW_LINE>}<NEW_LINE>if (p.getNeighborCount() > 0 && printNeighbors) {<NEW_LINE>int i = 0;<NEW_LINE>for (Abstraction n : p.getNeighbors()) {<NEW_LINE>int dest = absToId.get(n);<NEW_LINE>sbEdges.append(String.format(" abs%s:n%s -> abs%d;\n", id, i, dest));<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>workQueue.addAll(p.getNeighbors());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "digraph Debug {\n" + " node [shape=record];\n" + sbNodes.toString() + sbEdges.toString() + "}";<NEW_LINE>} | ("|<n%d> n%d", i, i)); |
219,810 | protected void createResponse(Values ret, Reply reply, Version version, byte[] payload) {<NEW_LINE>int[] eCodes = new int[reply.getNumErrors()];<NEW_LINE>String[] eMessages = new <MASK><NEW_LINE>String[] eServices = new String[reply.getNumErrors()];<NEW_LINE>for (int i = 0; i < reply.getNumErrors(); ++i) {<NEW_LINE>Error error = reply.getError(i);<NEW_LINE>eCodes[i] = error.getCode();<NEW_LINE>eMessages[i] = error.getMessage();<NEW_LINE>eServices[i] = error.getService() != null ? error.getService() : "";<NEW_LINE>}<NEW_LINE>ret.add(new StringValue(version.toUtf8()));<NEW_LINE>ret.add(new DoubleValue(reply.getRetryDelay()));<NEW_LINE>ret.add(new Int32Array(eCodes));<NEW_LINE>ret.add(new StringArray(eMessages));<NEW_LINE>ret.add(new StringArray(eServices));<NEW_LINE>ret.add(new StringValue(reply.getProtocol()));<NEW_LINE>ret.add(new DataValue(payload));<NEW_LINE>ret.add(new StringValue(reply.getTrace().getRoot() != null ? reply.getTrace().getRoot().encode() : ""));<NEW_LINE>} | String[reply.getNumErrors()]; |
270,155 | public void serializeWithType(AWSCredentialsProvider credentialsProvider, JsonGenerator jsonGenerator, SerializerProvider serializers, TypeSerializer typeSerializer) throws IOException {<NEW_LINE>// BEAM-11958 Use deprecated Jackson APIs to be compatible with older versions of jackson<NEW_LINE>typeSerializer.writeTypePrefixForObject(credentialsProvider, jsonGenerator);<NEW_LINE>Class<?> providerClass = credentialsProvider.getClass();<NEW_LINE>if (providerClass.equals(AWSStaticCredentialsProvider.class)) {<NEW_LINE>AWSCredentials credentials = credentialsProvider.getCredentials();<NEW_LINE>if (credentials.getClass().equals(BasicSessionCredentials.class)) {<NEW_LINE>BasicSessionCredentials sessionCredentials = (BasicSessionCredentials) credentials;<NEW_LINE>jsonGenerator.writeStringField(AWS_ACCESS_KEY_ID, sessionCredentials.getAWSAccessKeyId());<NEW_LINE>jsonGenerator.writeStringField(AWS_SECRET_KEY, sessionCredentials.getAWSSecretKey());<NEW_LINE>jsonGenerator.writeStringField(SESSION_TOKEN, sessionCredentials.getSessionToken());<NEW_LINE>} else {<NEW_LINE>jsonGenerator.writeStringField(AWS_ACCESS_KEY_ID, credentials.getAWSAccessKeyId());<NEW_LINE>jsonGenerator.writeStringField(AWS_SECRET_KEY, credentials.getAWSSecretKey());<NEW_LINE>}<NEW_LINE>} else if (providerClass.equals(PropertiesFileCredentialsProvider.class)) {<NEW_LINE>String filePath = (String) readField(credentialsProvider, CREDENTIALS_FILE_PATH);<NEW_LINE><MASK><NEW_LINE>} else if (providerClass.equals(ClasspathPropertiesFileCredentialsProvider.class)) {<NEW_LINE>String filePath = (String) readField(credentialsProvider, CREDENTIALS_FILE_PATH);<NEW_LINE>jsonGenerator.writeStringField(CREDENTIALS_FILE_PATH, filePath);<NEW_LINE>} else if (providerClass.equals(STSAssumeRoleSessionCredentialsProvider.class)) {<NEW_LINE>String arn = (String) readField(credentialsProvider, ROLE_ARN);<NEW_LINE>String sessionName = (String) readField(credentialsProvider, ROLE_SESSION_NAME);<NEW_LINE>jsonGenerator.writeStringField(ROLE_ARN, arn);<NEW_LINE>jsonGenerator.writeStringField(ROLE_SESSION_NAME, sessionName);<NEW_LINE>} else if (!SINGLETON_CREDENTIAL_PROVIDERS.contains(providerClass)) {<NEW_LINE>throw new IllegalArgumentException("Unsupported AWS credentials provider type " + providerClass);<NEW_LINE>}<NEW_LINE>// BEAM-11958 Use deprecated Jackson APIs to be compatible with older versions of jackson<NEW_LINE>typeSerializer.writeTypeSuffixForObject(credentialsProvider, jsonGenerator);<NEW_LINE>} | jsonGenerator.writeStringField(CREDENTIALS_FILE_PATH, filePath); |
1,832,673 | public String toStringDetail() {<NEW_LINE>StringBuffer sb = new StringBuffer(m_apps_host);<NEW_LINE>sb.append("{").append(m_db_host).append("-").append(m_db_name).append("-").append(m_db_uid).append("}");<NEW_LINE>//<NEW_LINE>Connection conn = getConnection(true, Connection.TRANSACTION_READ_COMMITTED);<NEW_LINE>if (conn != null) {<NEW_LINE>try {<NEW_LINE>DatabaseMetaData dbmd = conn.getMetaData();<NEW_LINE>sb.append("\nDatabase=" + dbmd.getDatabaseProductName() + <MASK><NEW_LINE>sb.append("\nDriver =" + dbmd.getDriverName() + " - " + dbmd.getDriverVersion());<NEW_LINE>if (isDataSource())<NEW_LINE>sb.append(" - via DS");<NEW_LINE>conn.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>conn = null;<NEW_LINE>return sb.toString();<NEW_LINE>} | " - " + dbmd.getDatabaseProductVersion()); |
1,030,141 | public static String replace(@NonNls @Nonnull final String text, @NonNls @Nonnull final String oldS, @NonNls @Nonnull final String newS, final boolean ignoreCase) {<NEW_LINE>if (text.length() < oldS.length())<NEW_LINE>return text;<NEW_LINE>StringBuilder newText = null;<NEW_LINE>int i = 0;<NEW_LINE>while (i < text.length()) {<NEW_LINE>final int index = ignoreCase ? indexOfIgnoreCase(text, oldS, i) : text.indexOf(oldS, i);<NEW_LINE>if (index < 0) {<NEW_LINE>if (i == 0) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>newText.append(text, i, text.length());<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>if (newText == null) {<NEW_LINE>if (text.length() == oldS.length()) {<NEW_LINE>return newS;<NEW_LINE>}<NEW_LINE>newText = new StringBuilder(text.length() - i);<NEW_LINE>}<NEW_LINE>newText.append(text, i, index);<NEW_LINE>newText.append(newS);<NEW_LINE>i = index + oldS.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newText != null <MASK><NEW_LINE>} | ? newText.toString() : ""; |
1,373,605 | private void initializeEjbInterfaceMethods() throws Exception {<NEW_LINE>ejbIntfMethods = new Method[EJB_INTF_METHODS_LENGTH];<NEW_LINE>if (isRemote) {<NEW_LINE>ejbIntfMethods[EJBHome_remove_Handle] = EJBHome.class.getMethod("remove", javax.ejb.Handle.class);<NEW_LINE>ejbIntfMethods[EJBHome_remove_Pkey] = EJBHome.class.getMethod("remove", java.lang.Object.class);<NEW_LINE>ejbIntfMethods[EJBHome_getEJBMetaData] = EJBHome.<MASK><NEW_LINE>ejbIntfMethods[EJBHome_getHomeHandle] = EJBHome.class.getMethod("getHomeHandle", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBObject_getEJBHome] = EJBObject.class.getMethod("getEJBHome", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBObject_getPrimaryKey] = EJBObject.class.getMethod("getPrimaryKey", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBObject_remove] = EJBObject.class.getMethod("remove", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBObject_getHandle] = EJBObject.class.getMethod("getHandle", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBObject_isIdentical] = EJBObject.class.getMethod("isIdentical", javax.ejb.EJBObject.class);<NEW_LINE>if (isStatelessSession) {<NEW_LINE>if (hasRemoteHomeView) {<NEW_LINE>ejbIntfMethods[EJBHome_create] = homeIntf.getMethod("create", NO_PARAMS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isLocal) {<NEW_LINE>ejbIntfMethods[EJBLocalHome_remove_Pkey] = EJBLocalHome.class.getMethod("remove", java.lang.Object.class);<NEW_LINE>//<NEW_LINE>ejbIntfMethods[EJBLocalObject_getEJBLocalHome] = EJBLocalObject.class.getMethod("getEJBLocalHome", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBLocalObject_getPrimaryKey] = EJBLocalObject.class.getMethod("getPrimaryKey", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBLocalObject_remove] = EJBLocalObject.class.getMethod("remove", NO_PARAMS);<NEW_LINE>//<NEW_LINE>ejbIntfMethods[EJBLocalObject_isIdentical] = EJBLocalObject.class.getMethod("isIdentical", javax.ejb.EJBLocalObject.class);<NEW_LINE>if (isStatelessSession) {<NEW_LINE>if (hasLocalHomeView) {<NEW_LINE>Method m = localHomeIntf.getMethod("create", NO_PARAMS);<NEW_LINE>ejbIntfMethods[EJBLocalHome_create] = m;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | class.getMethod("getEJBMetaData", NO_PARAMS); |
21,034 | public <V1, V2, V3, V4, V5> Promise<MultipleResultsN<V1, V2, V3, V4, V5>, OneReject<Throwable>, MasterProgress> when(DeferredFutureTask<V1, ?> taskV1, DeferredFutureTask<V2, ?> taskV2, DeferredFutureTask<V3, ?> taskV3, DeferredFutureTask<V4, ?> taskV4, DeferredFutureTask<V5, ?> taskV5, DeferredFutureTask<?, ?> task6, DeferredFutureTask<?, ?>... tasks) {<NEW_LINE>assertNotNull(taskV1, TASK_V1);<NEW_LINE>assertNotNull(taskV2, TASK_V2);<NEW_LINE>assertNotNull(taskV3, TASK_V3);<NEW_LINE>assertNotNull(taskV4, TASK_V4);<NEW_LINE>assertNotNull(taskV5, TASK_V5);<NEW_LINE>assertNotNull(task6, "task6");<NEW_LINE>Promise<V1, Throwable, ?> promise1 = when(taskV1);<NEW_LINE>Promise<V2, Throwable, ?> promise2 = when(taskV2);<NEW_LINE>Promise<V3, Throwable, ?> promise3 = when(taskV3);<NEW_LINE>Promise<V4, Throwable, <MASK><NEW_LINE>Promise<V5, Throwable, ?> promise5 = when(taskV5);<NEW_LINE>Promise<?, Throwable, ?> promise6 = when(task6);<NEW_LINE>Promise[] promiseN = new Promise[tasks.length];<NEW_LINE>for (int i = 0; i < tasks.length; i++) {<NEW_LINE>promiseN[i] = when(tasks[i]);<NEW_LINE>}<NEW_LINE>return new MasterDeferredObjectN(promise1, promise2, promise3, promise4, promise5, promise6, promiseN);<NEW_LINE>} | ?> promise4 = when(taskV4); |
312,794 | private LayoutInterval findIntervalToExtend(LayoutInterval parent, int dimension, int alignment) {<NEW_LINE>int d = alignment == LEADING ? -1 : 1;<NEW_LINE>int count = parent.getSubIntervalCount();<NEW_LINE>int idx = alignment <MASK><NEW_LINE>boolean atBorder = true;<NEW_LINE>boolean gap = false;<NEW_LINE>while (idx >= 0 && idx < parent.getSubIntervalCount()) {<NEW_LINE>LayoutInterval sub = parent.getSubInterval(idx);<NEW_LINE>if (sub.isEmptySpace()) {<NEW_LINE>gap = true;<NEW_LINE>} else {<NEW_LINE>if (!atBorder && gap && sub.isParallel() && !LayoutInterval.isClosedGroup(sub, alignment ^ 1)) {<NEW_LINE>// this open parallel sub-group might be a candidate to move inside to<NEW_LINE>int startIndex, endIndex;<NEW_LINE>if (alignment == LEADING) {<NEW_LINE>startIndex = idx + 1;<NEW_LINE>endIndex = parent.getSubIntervalCount() - 1;<NEW_LINE>} else {<NEW_LINE>startIndex = 0;<NEW_LINE>endIndex = idx - 1;<NEW_LINE>}<NEW_LINE>LayoutInterval extend = prepareGroupExtension(sub, parent, startIndex, endIndex, dimension, alignment ^ 1);<NEW_LINE>if (extend != null)<NEW_LINE>return extend;<NEW_LINE>}<NEW_LINE>gap = false;<NEW_LINE>atBorder = false;<NEW_LINE>}<NEW_LINE>idx += d;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | == LEADING ? count - 1 : 0; |
1,528,364 | private void logXmlExtraProblem(CategorizedProblem problem, int globalErrorCount, int localErrorCount) {<NEW_LINE>final int sourceStart = problem.getSourceStart();<NEW_LINE>final int sourceEnd = problem.getSourceEnd();<NEW_LINE>boolean isError = problem.isError();<NEW_LINE>HashMap<String, Object> parameters = new HashMap<>();<NEW_LINE>parameters.put(Logger.PROBLEM_SEVERITY, isError ? Logger.ERROR : (problem.isInfo() ? Logger<MASK><NEW_LINE>parameters.put(Logger.PROBLEM_LINE, Integer.valueOf(problem.getSourceLineNumber()));<NEW_LINE>parameters.put(Logger.PROBLEM_SOURCE_START, Integer.valueOf(sourceStart));<NEW_LINE>parameters.put(Logger.PROBLEM_SOURCE_END, Integer.valueOf(sourceEnd));<NEW_LINE>printTag(Logger.EXTRA_PROBLEM_TAG, parameters, true, false);<NEW_LINE>parameters.put(Logger.VALUE, problem.getMessage());<NEW_LINE>printTag(Logger.PROBLEM_MESSAGE, parameters, true, true);<NEW_LINE>extractContext(problem, null);<NEW_LINE>endTag(Logger.EXTRA_PROBLEM_TAG);<NEW_LINE>} | .INFO : Logger.WARNING)); |
57,731 | protected void internalReceiveCommand(String itemName, Command command) {<NEW_LINE>if (gpio != null) {<NEW_LINE>try {<NEW_LINE>if (registryLock.readLock().tryLock(REGISTRYLOCK_TIMEOUT, REGISTRYLOCK_TIMEOUT_UNITS)) {<NEW_LINE>try {<NEW_LINE>GPIOPin gpioPin = (GPIOPin) registry.get(itemName);<NEW_LINE>if (gpioPin != null) {<NEW_LINE>if (command == OnOffType.ON) {<NEW_LINE>gpioPin.setValue(GPIOPin.VALUE_HIGH);<NEW_LINE>logger.debug("Send command 1 to GPIO {}", gpioPin.getPinNumber());<NEW_LINE>} else {<NEW_LINE>gpioPin.setValue(GPIOPin.VALUE_LOW);<NEW_LINE>logger.debug("Send command 0 to GPIO {}", gpioPin.getPinNumber());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Error occurred while changing pin state for item " + itemName + ", exception: " + e.getMessage());<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>registryLock<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("Pin state for item " + itemName + " hasn't been changed, timeout expired while waiting for registry lock");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("Pin state for item " + itemName + " hasn't been changed, thread was interrupted while waiting for registry lock");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.internalReceiveCommand(itemName, command);<NEW_LINE>} | .readLock().unlock(); |
144,384 | public boolean execute(Object object) throws ContractExeException {<NEW_LINE>TransactionResultCapsule ret = (TransactionResultCapsule) object;<NEW_LINE>if (Objects.isNull(ret)) {<NEW_LINE>throw new RuntimeException(ActuatorConstant.TX_RESULT_NULL);<NEW_LINE>}<NEW_LINE>long fee = calcFee();<NEW_LINE><MASK><NEW_LINE>DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();<NEW_LINE>ExchangeStore exchangeStore = chainBaseManager.getExchangeStore();<NEW_LINE>ExchangeV2Store exchangeV2Store = chainBaseManager.getExchangeV2Store();<NEW_LINE>AssetIssueStore assetIssueStore = chainBaseManager.getAssetIssueStore();<NEW_LINE>try {<NEW_LINE>final ExchangeTransactionContract exchangeTransactionContract = this.any.unpack(ExchangeTransactionContract.class);<NEW_LINE>AccountCapsule accountCapsule = accountStore.get(exchangeTransactionContract.getOwnerAddress().toByteArray());<NEW_LINE>ExchangeCapsule exchangeCapsule = Commons.getExchangeStoreFinal(dynamicStore, exchangeStore, exchangeV2Store).get(ByteArray.fromLong(exchangeTransactionContract.getExchangeId()));<NEW_LINE>byte[] firstTokenID = exchangeCapsule.getFirstTokenId();<NEW_LINE>byte[] secondTokenID = exchangeCapsule.getSecondTokenId();<NEW_LINE>byte[] tokenID = exchangeTransactionContract.getTokenId().toByteArray();<NEW_LINE>long tokenQuant = exchangeTransactionContract.getQuant();<NEW_LINE>byte[] anotherTokenID;<NEW_LINE>long anotherTokenQuant = exchangeCapsule.transaction(tokenID, tokenQuant);<NEW_LINE>if (Arrays.equals(tokenID, firstTokenID)) {<NEW_LINE>anotherTokenID = secondTokenID;<NEW_LINE>} else {<NEW_LINE>anotherTokenID = firstTokenID;<NEW_LINE>}<NEW_LINE>long newBalance = accountCapsule.getBalance() - calcFee();<NEW_LINE>accountCapsule.setBalance(newBalance);<NEW_LINE>if (Arrays.equals(tokenID, TRX_SYMBOL_BYTES)) {<NEW_LINE>accountCapsule.setBalance(newBalance - tokenQuant);<NEW_LINE>} else {<NEW_LINE>accountCapsule.reduceAssetAmountV2(tokenID, tokenQuant, dynamicStore, assetIssueStore);<NEW_LINE>}<NEW_LINE>if (Arrays.equals(anotherTokenID, TRX_SYMBOL_BYTES)) {<NEW_LINE>accountCapsule.setBalance(newBalance + anotherTokenQuant);<NEW_LINE>} else {<NEW_LINE>accountCapsule.addAssetAmountV2(anotherTokenID, anotherTokenQuant, dynamicStore, assetIssueStore);<NEW_LINE>}<NEW_LINE>accountStore.put(accountCapsule.createDbKey(), accountCapsule);<NEW_LINE>Commons.putExchangeCapsule(exchangeCapsule, dynamicStore, exchangeStore, exchangeV2Store, assetIssueStore);<NEW_LINE>ret.setExchangeReceivedAmount(anotherTokenQuant);<NEW_LINE>ret.setStatus(fee, code.SUCESS);<NEW_LINE>} catch (ItemNotFoundException | InvalidProtocolBufferException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>ret.setStatus(fee, code.FAILED);<NEW_LINE>throw new ContractExeException(e.getMessage());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | AccountStore accountStore = chainBaseManager.getAccountStore(); |
322,344 | private Item parseUserInput(String grammar, String defaultIndex, String wordData, Language language, boolean allowNullItem) {<NEW_LINE>Query.Type parseAs = <MASK><NEW_LINE>Parser parser = ParserFactory.newInstance(parseAs, environment);<NEW_LINE>// perhaps not use already resolved doctypes, but respect source and restrict<NEW_LINE>Item item = parser.parse(new Parsable().setQuery(wordData).addSources(docTypes).setLanguage(language).setDefaultIndexName(defaultIndex)).getRoot();<NEW_LINE>// the null check should be unnecessary, but is there to avoid having to suppress null warnings<NEW_LINE>if (!allowNullItem && (item == null || item instanceof NullItem))<NEW_LINE>throw new IllegalArgumentException("Parsing '" + wordData + "' only resulted in NullItem.");<NEW_LINE>if (// mark the language used, unless it's the default<NEW_LINE>language != Language.ENGLISH)<NEW_LINE>item.setLanguage(language);<NEW_LINE>return item;<NEW_LINE>} | Query.Type.getType(grammar); |
466,125 | public static String linkToClass(String className, String memberName, String memberType, boolean useNew) {<NEW_LINE>if (!useNew && HTMLReportGenerator.oldDocPrefix == null) {<NEW_LINE>// No link possible<NEW_LINE>return "<tt>" + className + "</tt>";<NEW_LINE>}<NEW_LINE>API api = oldAPI_;<NEW_LINE>String prefix = HTMLReportGenerator.oldDocPrefix;<NEW_LINE>if (useNew) {<NEW_LINE>api = newAPI_;<NEW_LINE>prefix = HTMLReportGenerator.newDocPrefix;<NEW_LINE>}<NEW_LINE>ClassAPI cls = (ClassAPI) api.classes_.get(className);<NEW_LINE>if (cls == null) {<NEW_LINE>if (useNew)<NEW_LINE>System.out.println("Warning: class " + className + " not found in the new API when creating Javadoc link");<NEW_LINE>else<NEW_LINE>System.out.<MASK><NEW_LINE>return "<tt>" + className + "</tt>";<NEW_LINE>}<NEW_LINE>int clsIdx = className.indexOf(cls.name_);<NEW_LINE>if (clsIdx != -1) {<NEW_LINE>String pkgRef = className.substring(0, clsIdx);<NEW_LINE>pkgRef = pkgRef.replace('.', '/');<NEW_LINE>String res = "<a href=\"" + prefix + pkgRef + cls.name_ + ".html#" + memberName;<NEW_LINE>if (memberType != null)<NEW_LINE>res += "(" + memberType + ")";<NEW_LINE>res += "\" target=\"_top\">" + "<tt>" + cls.name_ + "</tt></a>";<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>return "<tt>" + className + "</tt>";<NEW_LINE>} | println("Warning: class " + className + " not found in the old API when creating Javadoc link"); |
1,433,843 | protected NodesReloadSecureSettingsResponse.NodeResponse nodeOperation(NodeRequest nodeReloadRequest) {<NEW_LINE>try (KeyStoreWrapper keystore = KeyStoreWrapper.load(environment.configFile())) {<NEW_LINE>// reread keystore from config file<NEW_LINE>if (keystore == null) {<NEW_LINE>return new NodesReloadSecureSettingsResponse.NodeResponse(clusterService.localNode(<MASK><NEW_LINE>}<NEW_LINE>keystore.decrypt(new char[0]);<NEW_LINE>// add the keystore to the original node settings object<NEW_LINE>final Settings settingsWithKeystore = Settings.builder().put(environment.settings(), false).setSecureSettings(keystore).build();<NEW_LINE>final List<Exception> exceptions = new ArrayList<>();<NEW_LINE>// broadcast the new settings object (with the open embedded keystore) to all reloadable plugins<NEW_LINE>pluginsService.filterPlugins(ReloadablePlugin.class).stream().forEach(p -> {<NEW_LINE>try {<NEW_LINE>p.reload(settingsWithKeystore);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.warn((Supplier<?>) () -> new ParameterizedMessage("Reload failed for plugin [{}]", p.getClass().getSimpleName()), e);<NEW_LINE>exceptions.add(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ExceptionsHelper.rethrowAndSuppress(exceptions);<NEW_LINE>return new NodesReloadSecureSettingsResponse.NodeResponse(clusterService.localNode(), null);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>return new NodesReloadSecureSettingsResponse.NodeResponse(clusterService.localNode(), e);<NEW_LINE>}<NEW_LINE>} | ), new IllegalStateException("Keystore is missing")); |
1,161,853 | public static void renderOutlines(Runnable draw, boolean entities, int width, float fillOpacity, ShapeMode shapeMode) {<NEW_LINE>WorldRenderer worldRenderer = mc.worldRenderer;<NEW_LINE>WorldRendererAccessor wra = (WorldRendererAccessor) worldRenderer;<NEW_LINE>Framebuffer fbo = worldRenderer.getEntityOutlinesFramebuffer();<NEW_LINE>if (entities)<NEW_LINE>wra.setEntityOutlinesFramebuffer(outlinesFramebuffer);<NEW_LINE>else {<NEW_LINE>outlinesFramebuffer.clear(false);<NEW_LINE>outlinesFramebuffer.beginWrite(false);<NEW_LINE>}<NEW_LINE>draw.run();<NEW_LINE>if (entities)<NEW_LINE>wra.setEntityOutlinesFramebuffer(fbo);<NEW_LINE>mc.getFramebuffer().beginWrite(false);<NEW_LINE>GL.bindTexture(outlinesFramebuffer.getColorAttachment());<NEW_LINE>outlinesShader.bind();<NEW_LINE>outlinesShader.set("u_Size", mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());<NEW_LINE>outlinesShader.set("u_Texture", 0);<NEW_LINE><MASK><NEW_LINE>outlinesShader.set("u_FillOpacity", fillOpacity / 255.0);<NEW_LINE>outlinesShader.set("u_ShapeMode", shapeMode.ordinal());<NEW_LINE>PostProcessRenderer.render();<NEW_LINE>} | outlinesShader.set("u_Width", width); |
896,568 | private void createNutchUrls() throws IOException, URISyntaxException {<NEW_LINE>log.info("Creating nutch urls ...");<NEW_LINE>JobConf job = new JobConf(NutchData.class);<NEW_LINE>Path urls = new Path(options.getWorkPath(), URLS_DIR_NAME);<NEW_LINE>Utils.checkHdfsPath(urls);<NEW_LINE>String jobname = "Create nutch urls";<NEW_LINE>job.setJobName(jobname);<NEW_LINE>setNutchOptions(job);<NEW_LINE>FileInputFormat.setInputPaths(job, dummy.getPath());<NEW_LINE>job.setInputFormat(NLineInputFormat.class);<NEW_LINE>job.setMapperClass(CreateUrlHash.class);<NEW_LINE>job.setNumReduceTasks(0);<NEW_LINE><MASK><NEW_LINE>job.setMapOutputValueClass(Text.class);<NEW_LINE>job.setOutputFormat(MapFileOutputFormat.class);<NEW_LINE>job.setOutputKeyClass(LongWritable.class);<NEW_LINE>job.setOutputValueClass(Text.class);<NEW_LINE>MapFileOutputFormat.setOutputPath(job, urls);<NEW_LINE>// SequenceFileOutputFormat.setOutputPath(job, fout);<NEW_LINE>log.info("Running Job: " + jobname);<NEW_LINE>log.info("Pages file " + dummy.getPath() + " as input");<NEW_LINE>log.info("Rankings file " + urls + " as output");<NEW_LINE>JobClient.runJob(job);<NEW_LINE>log.info("Finished Running Job: " + jobname);<NEW_LINE>log.info("Cleaning temp files...");<NEW_LINE>Utils.cleanTempFiles(urls);<NEW_LINE>} | job.setMapOutputKeyClass(LongWritable.class); |
1,828,893 | public static DescribeScdnServiceResponse unmarshall(DescribeScdnServiceResponse describeScdnServiceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeScdnServiceResponse.setRequestId(_ctx.stringValue("DescribeScdnServiceResponse.RequestId"));<NEW_LINE>describeScdnServiceResponse.setChangingAffectTime(_ctx.stringValue("DescribeScdnServiceResponse.ChangingAffectTime"));<NEW_LINE>describeScdnServiceResponse.setInternetChargeType(_ctx.stringValue("DescribeScdnServiceResponse.InternetChargeType"));<NEW_LINE>describeScdnServiceResponse.setChangingChargeType(_ctx.stringValue("DescribeScdnServiceResponse.ChangingChargeType"));<NEW_LINE>describeScdnServiceResponse.setInstanceId(_ctx.stringValue("DescribeScdnServiceResponse.InstanceId"));<NEW_LINE>describeScdnServiceResponse.setOpenTime(_ctx.stringValue("DescribeScdnServiceResponse.OpenTime"));<NEW_LINE>describeScdnServiceResponse.setEndTime(_ctx.stringValue("DescribeScdnServiceResponse.EndTime"));<NEW_LINE>describeScdnServiceResponse.setProtectType(_ctx.stringValue("DescribeScdnServiceResponse.ProtectType"));<NEW_LINE>describeScdnServiceResponse.setProtectTypeValue<MASK><NEW_LINE>describeScdnServiceResponse.setBandwidth(_ctx.stringValue("DescribeScdnServiceResponse.Bandwidth"));<NEW_LINE>describeScdnServiceResponse.setCcProtection(_ctx.stringValue("DescribeScdnServiceResponse.CcProtection"));<NEW_LINE>describeScdnServiceResponse.setDDoSBasic(_ctx.stringValue("DescribeScdnServiceResponse.DDoSBasic"));<NEW_LINE>describeScdnServiceResponse.setDomainCount(_ctx.stringValue("DescribeScdnServiceResponse.DomainCount"));<NEW_LINE>describeScdnServiceResponse.setElasticProtection(_ctx.stringValue("DescribeScdnServiceResponse.ElasticProtection"));<NEW_LINE>describeScdnServiceResponse.setBandwidthValue(_ctx.stringValue("DescribeScdnServiceResponse.BandwidthValue"));<NEW_LINE>describeScdnServiceResponse.setCcProtectionValue(_ctx.stringValue("DescribeScdnServiceResponse.CcProtectionValue"));<NEW_LINE>describeScdnServiceResponse.setDDoSBasicValue(_ctx.stringValue("DescribeScdnServiceResponse.DDoSBasicValue"));<NEW_LINE>describeScdnServiceResponse.setDomainCountValue(_ctx.stringValue("DescribeScdnServiceResponse.DomainCountValue"));<NEW_LINE>describeScdnServiceResponse.setElasticProtectionValue(_ctx.stringValue("DescribeScdnServiceResponse.ElasticProtectionValue"));<NEW_LINE>describeScdnServiceResponse.setCurrentProtectType(_ctx.stringValue("DescribeScdnServiceResponse.CurrentProtectType"));<NEW_LINE>describeScdnServiceResponse.setCurrentProtectTypeValue(_ctx.stringValue("DescribeScdnServiceResponse.CurrentProtectTypeValue"));<NEW_LINE>describeScdnServiceResponse.setCurrentBandwidth(_ctx.stringValue("DescribeScdnServiceResponse.CurrentBandwidth"));<NEW_LINE>describeScdnServiceResponse.setCurrentCcProtection(_ctx.stringValue("DescribeScdnServiceResponse.CurrentCcProtection"));<NEW_LINE>describeScdnServiceResponse.setCurrentDDoSBasic(_ctx.stringValue("DescribeScdnServiceResponse.CurrentDDoSBasic"));<NEW_LINE>describeScdnServiceResponse.setCurrentDomainCount(_ctx.stringValue("DescribeScdnServiceResponse.CurrentDomainCount"));<NEW_LINE>describeScdnServiceResponse.setCurrentElasticProtection(_ctx.stringValue("DescribeScdnServiceResponse.CurrentElasticProtection"));<NEW_LINE>describeScdnServiceResponse.setCurrentBandwidthValue(_ctx.stringValue("DescribeScdnServiceResponse.CurrentBandwidthValue"));<NEW_LINE>describeScdnServiceResponse.setCurrentCcProtectionValue(_ctx.stringValue("DescribeScdnServiceResponse.CurrentCcProtectionValue"));<NEW_LINE>describeScdnServiceResponse.setCurrentDDoSBasicValue(_ctx.stringValue("DescribeScdnServiceResponse.CurrentDDoSBasicValue"));<NEW_LINE>describeScdnServiceResponse.setCurrentDomainCountValue(_ctx.stringValue("DescribeScdnServiceResponse.CurrentDomainCountValue"));<NEW_LINE>describeScdnServiceResponse.setCurrentElasticProtectionValue(_ctx.stringValue("DescribeScdnServiceResponse.CurrentElasticProtectionValue"));<NEW_LINE>describeScdnServiceResponse.setPriceType(_ctx.stringValue("DescribeScdnServiceResponse.PriceType"));<NEW_LINE>describeScdnServiceResponse.setPricingCycle(_ctx.stringValue("DescribeScdnServiceResponse.PricingCycle"));<NEW_LINE>List<LockReason> operationLocks = new ArrayList<LockReason>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeScdnServiceResponse.OperationLocks.Length"); i++) {<NEW_LINE>LockReason lockReason = new LockReason();<NEW_LINE>lockReason.setLockReason(_ctx.stringValue("DescribeScdnServiceResponse.OperationLocks[" + i + "].LockReason"));<NEW_LINE>operationLocks.add(lockReason);<NEW_LINE>}<NEW_LINE>describeScdnServiceResponse.setOperationLocks(operationLocks);<NEW_LINE>return describeScdnServiceResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeScdnServiceResponse.ProtectTypeValue")); |
988,928 | public Observable<ServiceResponse<TrendingTopics>> trendingWithServiceResponseAsync(TrendingOptionalParameter trendingOptionalParameter) {<NEW_LINE>final String acceptLanguage = trendingOptionalParameter != null ? trendingOptionalParameter.acceptLanguage() : null;<NEW_LINE>final String userAgent = trendingOptionalParameter != null ? trendingOptionalParameter.userAgent() : this.client.userAgent();<NEW_LINE>final String clientId = trendingOptionalParameter != null ? trendingOptionalParameter.clientId() : null;<NEW_LINE>final String clientIp = trendingOptionalParameter != null ? trendingOptionalParameter.clientIp() : null;<NEW_LINE>final String location = trendingOptionalParameter != null ? trendingOptionalParameter.location() : null;<NEW_LINE>final String countryCode = trendingOptionalParameter != null ? trendingOptionalParameter.countryCode() : null;<NEW_LINE>final Integer count = trendingOptionalParameter != null ? trendingOptionalParameter.count() : null;<NEW_LINE>final String market = trendingOptionalParameter != null ? trendingOptionalParameter.market() : null;<NEW_LINE>final Integer offset = trendingOptionalParameter != null ? trendingOptionalParameter.offset() : null;<NEW_LINE>final SafeSearch safeSearch = trendingOptionalParameter != null ? trendingOptionalParameter.safeSearch() : null;<NEW_LINE>final String setLang = trendingOptionalParameter != null <MASK><NEW_LINE>final Long since = trendingOptionalParameter != null ? trendingOptionalParameter.since() : null;<NEW_LINE>final String sortBy = trendingOptionalParameter != null ? trendingOptionalParameter.sortBy() : null;<NEW_LINE>final Boolean textDecorations = trendingOptionalParameter != null ? trendingOptionalParameter.textDecorations() : null;<NEW_LINE>final TextFormat textFormat = trendingOptionalParameter != null ? trendingOptionalParameter.textFormat() : null;<NEW_LINE>return trendingWithServiceResponseAsync(acceptLanguage, userAgent, clientId, clientIp, location, countryCode, count, market, offset, safeSearch, setLang, since, sortBy, textDecorations, textFormat);<NEW_LINE>} | ? trendingOptionalParameter.setLang() : null; |
702,608 | public GATKReportTable generateReportTable(final String covariateNames) {<NEW_LINE>GATKReportTable argumentsTable;<NEW_LINE>argumentsTable = new GATKReportTable("Arguments", "Recalibration argument collection values used in this run", 2, GATKReportTable.Sorting.SORT_BY_COLUMN);<NEW_LINE>argumentsTable.addColumn("Argument", "%s");<NEW_LINE>argumentsTable.addColumn(RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, "");<NEW_LINE>argumentsTable.addRowID("covariate", true);<NEW_LINE>argumentsTable.set("covariate", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, covariateNames);<NEW_LINE>argumentsTable.addRowID("no_standard_covs", true);<NEW_LINE>argumentsTable.set("no_standard_covs", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DO_NOT_USE_STANDARD_COVARIATES);<NEW_LINE>argumentsTable.addRowID("run_without_dbsnp", true);<NEW_LINE>argumentsTable.set("run_without_dbsnp", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, RUN_WITHOUT_DBSNP);<NEW_LINE>argumentsTable.addRowID("solid_recal_mode", true);<NEW_LINE>argumentsTable.set("solid_recal_mode", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_RECAL_MODE);<NEW_LINE>argumentsTable.addRowID("solid_nocall_strategy", true);<NEW_LINE>argumentsTable.set("solid_nocall_strategy", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_NOCALL_STRATEGY);<NEW_LINE>argumentsTable.addRowID("mismatches_context_size", true);<NEW_LINE>argumentsTable.set("mismatches_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_CONTEXT_SIZE);<NEW_LINE>argumentsTable.addRowID("indels_context_size", true);<NEW_LINE>argumentsTable.set("indels_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INDELS_CONTEXT_SIZE);<NEW_LINE>argumentsTable.addRowID("mismatches_default_quality", true);<NEW_LINE>argumentsTable.set("mismatches_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_DEFAULT_QUALITY);<NEW_LINE>argumentsTable.addRowID("deletions_default_quality", true);<NEW_LINE>argumentsTable.set("deletions_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DELETIONS_DEFAULT_QUALITY);<NEW_LINE>argumentsTable.addRowID("insertions_default_quality", true);<NEW_LINE>argumentsTable.set("insertions_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INSERTIONS_DEFAULT_QUALITY);<NEW_LINE>argumentsTable.addRowID("maximum_cycle_value", true);<NEW_LINE>argumentsTable.set("maximum_cycle_value", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MAXIMUM_CYCLE_VALUE);<NEW_LINE>argumentsTable.addRowID("low_quality_tail", true);<NEW_LINE>argumentsTable.set("low_quality_tail", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, LOW_QUAL_TAIL);<NEW_LINE>argumentsTable.addRowID("default_platform", true);<NEW_LINE>argumentsTable.set("default_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DEFAULT_PLATFORM);<NEW_LINE>argumentsTable.addRowID("force_platform", true);<NEW_LINE>argumentsTable.set("force_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, FORCE_PLATFORM);<NEW_LINE>argumentsTable.addRowID("quantizing_levels", true);<NEW_LINE>argumentsTable.set("quantizing_levels", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, QUANTIZING_LEVELS);<NEW_LINE><MASK><NEW_LINE>argumentsTable.set("recalibration_report", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, existingRecalibrationReport == null ? "null" : existingRecalibrationReport.getAbsolutePath());<NEW_LINE>argumentsTable.addRowID("binary_tag_name", true);<NEW_LINE>argumentsTable.set("binary_tag_name", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, BINARY_TAG_NAME == null ? "null" : BINARY_TAG_NAME);<NEW_LINE>return argumentsTable;<NEW_LINE>} | argumentsTable.addRowID("recalibration_report", true); |
1,843,448 | private boolean doConvertPatterns() throws MalformedPatternException {<NEW_LINE>final String[] regexpPatterns = getRegexpPatterns();<NEW_LINE>final List<String> converted = new ArrayList<>();<NEW_LINE>final Pattern multipleExtensionsPatternPattern = compilePattern("\\.\\+\\\\\\.\\((\\w+(?:\\|\\w+)*)\\)");<NEW_LINE>final Pattern singleExtensionPatternPattern = compilePattern("\\.\\+\\\\\\.(\\w+)");<NEW_LINE>for (final String regexpPattern : regexpPatterns) {<NEW_LINE>Matcher matcher = multipleExtensionsPatternPattern.matcher(regexpPattern);<NEW_LINE>if (matcher.find()) {<NEW_LINE>final StringTokenizer tokenizer = new StringTokenizer(matcher.group(1), "|", false);<NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>converted.add("?*." + tokenizer.nextToken());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (matcher.find()) {<NEW_LINE>converted.add("?*." + matcher.group(1));<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (final String aConverted : converted) {<NEW_LINE>addWildcardResourcePattern(aConverted);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | matcher = singleExtensionPatternPattern.matcher(regexpPattern); |
383,501 | protected void layoutGrid(PrintElementIndex parentElementIndex, List<JRPrintElement> elements) {<NEW_LINE>boolean createXCuts = (xCuts == null);<NEW_LINE>xCuts = createXCuts ? new CutsInfo() : xCuts;<NEW_LINE>yCuts = nature.isIgnoreLastRow() ? new CutsInfo(0) : new CutsInfo(height);<NEW_LINE>if (// FIXMEXLS left and right margins are not ignored when all pages on a single sheet<NEW_LINE>!isNested && nature.isIgnorePageMargins()) {<NEW_LINE>// TODO lucianc this is an extra virtualization iteration<NEW_LINE>setMargins(elements);<NEW_LINE>if (createXCuts) {<NEW_LINE>if (hasLeftMargin) {<NEW_LINE>xCuts.removeCutOffset(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasTopMargin) {<NEW_LINE>yCuts.removeCutOffset(0);<NEW_LINE>}<NEW_LINE>if (hasBottomMargin) {<NEW_LINE>yCuts.removeCutOffset(height);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>createCuts(<MASK><NEW_LINE>// add a cut at the width if it's a nested grid, or if the right margin<NEW_LINE>// is not to be removed and no element goes beyond the width<NEW_LINE>if (createXCuts && (isNested || (!(nature.isIgnorePageMargins() && hasRightMargin) && !(xCuts.hasCuts() && xCuts.getLastCutOffset() >= width)))) {<NEW_LINE>xCuts.addCutOffset(width);<NEW_LINE>}<NEW_LINE>xCuts.use();<NEW_LINE>yCuts.use();<NEW_LINE>int colCount = Math.max(xCuts.size() - 1, 0);<NEW_LINE>int rowCount = Math.max(yCuts.size() - 1, 0);<NEW_LINE>grid = new Grid(rowCount, colCount);<NEW_LINE>for (int row = 0; row < rowCount; row++) {<NEW_LINE>for (int col = 0; col < colCount; col++) {<NEW_LINE>GridCellSize size = cellSize(xCuts.getCutOffset(col + 1) - xCuts.getCutOffset(col), yCuts.getCutOffset(row + 1) - yCuts.getCutOffset(row), 1, 1);<NEW_LINE>grid.set(row, col, emptyCell(size, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setGridElements(parentElementIndex, elements, offsetX, offsetY, 0, 0, rowCount, colCount);<NEW_LINE>width = xCuts.getTotalLength();<NEW_LINE>height = yCuts.getTotalLength();<NEW_LINE>} | elements, offsetX, offsetY, createXCuts); |
630,444 | static IkePhase1Policy toIkePhase1Policy(@Nonnull IsakmpKey isakmpKey, @Nonnull CiscoXrConfiguration oldConfig, @Nonnull IkePhase1Key ikePhase1KeyFromIsakmpKey) {<NEW_LINE>IkePhase1Policy ikePhase1Policy = <MASK><NEW_LINE>ikePhase1Policy.setIkePhase1Proposals(oldConfig.getIsakmpPolicies().values().stream().filter(isakmpPolicy -> isakmpPolicy.getAuthenticationMethod() == IkeAuthenticationMethod.PRE_SHARED_KEYS).map(isakmpPolicy -> isakmpPolicy.getName().toString()).collect(ImmutableList.toImmutableList()));<NEW_LINE>ikePhase1Policy.setRemoteIdentity(isakmpKey.getAddress());<NEW_LINE>ikePhase1Policy.setIkePhase1Key(ikePhase1KeyFromIsakmpKey);<NEW_LINE>// ISAKMP key is not per interface so local interface will not be set<NEW_LINE>ikePhase1Policy.setLocalInterface(UNSET_LOCAL_INTERFACE);<NEW_LINE>return ikePhase1Policy;<NEW_LINE>} | new IkePhase1Policy(getIsakmpKeyGeneratedName(isakmpKey)); |
1,628,187 | static int lastArgMatchesVarg(final Parameter[] parameters, final ClassNode... argumentTypes) {<NEW_LINE>if (!isVargs(parameters))<NEW_LINE>return -1;<NEW_LINE>int lastParamIndex = parameters.length - 1;<NEW_LINE>if (lastParamIndex == argumentTypes.length)<NEW_LINE>return 0;<NEW_LINE>// two cases remain:<NEW_LINE>// the argument is wrapped in the vargs array or<NEW_LINE>// the argument is an array that can be used for the vargs part directly<NEW_LINE>// testing only the wrapping case since the non-wrapping is done already<NEW_LINE>ClassNode arrayType = parameters[lastParamIndex].getType();<NEW_LINE><MASK><NEW_LINE>ClassNode argumentType = argumentTypes[argumentTypes.length - 1];<NEW_LINE>if (isNumberType(elementType) && isNumberType(argumentType) && !getWrapper(elementType).equals(getWrapper(argumentType)))<NEW_LINE>return -1;<NEW_LINE>return isAssignableTo(argumentType, elementType) ? min(getDistance(argumentType, arrayType), getDistance(argumentType, elementType)) : -1;<NEW_LINE>} | ClassNode elementType = arrayType.getComponentType(); |
1,368,634 | public void layout() {<NEW_LINE>if (actor == null)<NEW_LINE>return;<NEW_LINE>float padLeft = this.padLeft.get(this), padBottom = this.padBottom.get(this);<NEW_LINE>float containerWidth = getWidth() - <MASK><NEW_LINE>float containerHeight = getHeight() - padBottom - padTop.get(this);<NEW_LINE>float minWidth = this.minWidth.get(actor), minHeight = this.minHeight.get(actor);<NEW_LINE>float prefWidth = this.prefWidth.get(actor), prefHeight = this.prefHeight.get(actor);<NEW_LINE>float maxWidth = this.maxWidth.get(actor), maxHeight = this.maxHeight.get(actor);<NEW_LINE>float width;<NEW_LINE>if (fillX > 0)<NEW_LINE>width = containerWidth * fillX;<NEW_LINE>else<NEW_LINE>width = Math.min(prefWidth, containerWidth);<NEW_LINE>if (width < minWidth)<NEW_LINE>width = minWidth;<NEW_LINE>if (maxWidth > 0 && width > maxWidth)<NEW_LINE>width = maxWidth;<NEW_LINE>float height;<NEW_LINE>if (fillY > 0)<NEW_LINE>height = containerHeight * fillY;<NEW_LINE>else<NEW_LINE>height = Math.min(prefHeight, containerHeight);<NEW_LINE>if (height < minHeight)<NEW_LINE>height = minHeight;<NEW_LINE>if (maxHeight > 0 && height > maxHeight)<NEW_LINE>height = maxHeight;<NEW_LINE>float x = padLeft;<NEW_LINE>if ((align & Align.right) != 0)<NEW_LINE>x += containerWidth - width;<NEW_LINE>else if (// center<NEW_LINE>(align & Align.left) == 0)<NEW_LINE>x += (containerWidth - width) / 2;<NEW_LINE>float y = padBottom;<NEW_LINE>if ((align & Align.top) != 0)<NEW_LINE>y += containerHeight - height;<NEW_LINE>else if (// center<NEW_LINE>(align & Align.bottom) == 0)<NEW_LINE>y += (containerHeight - height) / 2;<NEW_LINE>if (round) {<NEW_LINE>x = Math.round(x);<NEW_LINE>y = Math.round(y);<NEW_LINE>width = Math.round(width);<NEW_LINE>height = Math.round(height);<NEW_LINE>}<NEW_LINE>actor.setBounds(x, y, width, height);<NEW_LINE>if (actor instanceof Layout)<NEW_LINE>((Layout) actor).validate();<NEW_LINE>} | padLeft - padRight.get(this); |
959,144 | private void calculateXForward() {<NEW_LINE>String forwardedSsl = delegate.getHeader(X_FORWARDED_SSL);<NEW_LINE>boolean isForwardedSslOn = forwardedSsl != null && forwardedSsl.equalsIgnoreCase("on");<NEW_LINE>String protocolHeader = delegate.getHeader(X_FORWARDED_PROTO);<NEW_LINE>if (protocolHeader != null) {<NEW_LINE>scheme = protocolHeader.split(",")[0];<NEW_LINE>port = -1;<NEW_LINE>} else if (isForwardedSslOn) {<NEW_LINE>scheme = HTTPS_SCHEME;<NEW_LINE>port = -1;<NEW_LINE>}<NEW_LINE>String hostHeader = delegate.getHeader(X_FORWARDED_HOST);<NEW_LINE>if (hostHeader != null) {<NEW_LINE>setHostAndPort(hostHeader.split(<MASK><NEW_LINE>}<NEW_LINE>String portHeader = delegate.getHeader(X_FORWARDED_PORT);<NEW_LINE>if (portHeader != null) {<NEW_LINE>port = parsePort(portHeader.split(",")[0], port);<NEW_LINE>}<NEW_LINE>String forHeader = delegate.getHeader(X_FORWARDED_FOR);<NEW_LINE>if (forHeader != null) {<NEW_LINE>remoteAddress = parseFor(forHeader.split(",")[0], remoteAddress.port());<NEW_LINE>}<NEW_LINE>} | ",")[0], port); |
296,293 | public static void write(NodeLibrary library, StreamResult streamResult, File file) {<NEW_LINE>try {<NEW_LINE>DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();<NEW_LINE>Document doc = builder.newDocument();<NEW_LINE>// Build the header.<NEW_LINE>Element rootElement = doc.createElement("ndbx");<NEW_LINE>rootElement.setAttribute("type", "file");<NEW_LINE>rootElement.setAttribute("formatVersion", NodeLibrary.CURRENT_FORMAT_VERSION);<NEW_LINE>rootElement.setAttribute("uuid", library.getUuid().toString());<NEW_LINE>doc.appendChild(rootElement);<NEW_LINE>// Write out all the document properties.<NEW_LINE>Set<String> propertyNames = library.getPropertyNames();<NEW_LINE>ArrayList<String> orderedNames = new ArrayList<String>(propertyNames);<NEW_LINE>Collections.sort(orderedNames);<NEW_LINE>for (String propertyName : orderedNames) {<NEW_LINE>String propertyValue = library.getProperty(propertyName);<NEW_LINE>Element e = doc.createElement("property");<NEW_LINE>e.setAttribute("name", propertyName);<NEW_LINE>e.setAttribute("value", propertyValue);<NEW_LINE>rootElement.appendChild(e);<NEW_LINE>}<NEW_LINE>// Write the function repository.<NEW_LINE>writeFunctionRepository(doc, rootElement, <MASK><NEW_LINE>writeDevices(doc, rootElement, library.getDevices());<NEW_LINE>// Write the root node.<NEW_LINE>writeNode(doc, rootElement, library.getRoot(), library.getNodeRepository());<NEW_LINE>// Convert the document to XML.<NEW_LINE>DOMSource domSource = new DOMSource(doc);<NEW_LINE>TransformerFactory tf = TransformerFactory.newInstance();<NEW_LINE>Transformer serializer = tf.newTransformer();<NEW_LINE>serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");<NEW_LINE>serializer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE>serializer.transform(domSource, streamResult);<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (TransformerException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | library.getFunctionRepository(), file); |
92,731 | public static synchronized void registerCounter(int methodId, int mean) {<NEW_LINE>if (counters.length <= methodId) {<NEW_LINE>int newLen = methodId * 2;<NEW_LINE>counters = <MASK><NEW_LINE>rLocks = Arrays.copyOf(rLocks, newLen);<NEW_LINE>means = Arrays.copyOf(means, newLen);<NEW_LINE>origMeans = Arrays.copyOf(means, newLen);<NEW_LINE>samplers = Arrays.copyOf(samplers, newLen);<NEW_LINE>tsArray = Arrays.copyOf(tsArray, newLen);<NEW_LINE>}<NEW_LINE>if (counters[methodId] == null) {<NEW_LINE>counters[methodId] = new AtomicLong(0);<NEW_LINE>rLocks[methodId] = new Object();<NEW_LINE>means[methodId] = mean * 2;<NEW_LINE>origMeans[methodId] = mean;<NEW_LINE>tsArray[methodId] = ThreadLocal.withInitial(() -> 0L);<NEW_LINE>samplers[methodId] = 0;<NEW_LINE>}<NEW_LINE>} | Arrays.copyOf(counters, newLen); |
357,418 | public void onPlayStart(int code) {<NEW_LINE>switch(code) {<NEW_LINE>case V2TXLIVE_OK:<NEW_LINE>startLoadingAnimation();<NEW_LINE>break;<NEW_LINE>case V2TXLIVE_ERROR_INVALID_PARAMETER:<NEW_LINE>Toast.makeText(mContext, R.string.liveplayer_warning_res_url_invalid, Toast.LENGTH_SHORT).show();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (code != V2TXLIVE_OK) {<NEW_LINE>mButtonPlay.setBackgroundResource(R.drawable.liveplayer_play_start_btn);<NEW_LINE>mLayoutRoot.setBackgroundResource(R.drawable.liveplayer_content_bg);<NEW_LINE><MASK><NEW_LINE>Bundle params = new Bundle();<NEW_LINE>params.putString(TXLiveConstants.EVT_DESCRIPTION, mContext.getResources().getString(R.string.liveplayer_warning_checkout_res_url));<NEW_LINE>mLogInfoWindow.setLogText(null, params, LogInfoWindow.CHECK_RTMP_URL_FAIL);<NEW_LINE>} else {<NEW_LINE>mButtonPlay.setBackgroundResource(R.drawable.liveplayer_play_pause_btn);<NEW_LINE>mLayoutRoot.setBackgroundColor(getResources().getColor(R.color.liveplayer_black));<NEW_LINE>mImageRoot.setVisibility(View.GONE);<NEW_LINE>Bundle params = new Bundle();<NEW_LINE>params.putString(TXLiveConstants.EVT_DESCRIPTION, mContext.getResources().getString(R.string.liveplayer_warning_checkout_res_url));<NEW_LINE>mLogInfoWindow.setLogText(null, params, LogInfoWindow.CHECK_RTMP_URL_OK);<NEW_LINE>}<NEW_LINE>} | mImageRoot.setVisibility(View.VISIBLE); |
1,089,698 | protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite compositeTop = (Composite) super.createDialogArea(parent);<NEW_LINE>String titleMsg;<NEW_LINE>if (confirmPassword)<NEW_LINE>titleMsg = Messages.passwordChangeTitle;<NEW_LINE>else if (passwordChange)<NEW_LINE>titleMsg = Messages.messageLoginChange;<NEW_LINE>else<NEW_LINE>titleMsg = Messages.dialogTitle;<NEW_LINE>setTitle(titleMsg);<NEW_LINE>Composite composite = new Composite(compositeTop, SWT.NONE);<NEW_LINE>new Label(composite, SWT.LEFT).setText(Messages.labelPassword);<NEW_LINE>password = new Text(composite, SWT.LEFT | SWT.BORDER);<NEW_LINE>password.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(ModifyEvent event) {<NEW_LINE>okButton.setEnabled(validatePassword());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (confirmPassword) {<NEW_LINE>new Label(composite, SWT.LEFT).setText(Messages.labelConfirm);<NEW_LINE>confirm = new Text(composite, SWT.LEFT | SWT.BORDER);<NEW_LINE>confirm.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(ModifyEvent event) {<NEW_LINE>okButton.setEnabled(validatePassword());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else<NEW_LINE>confirm = null;<NEW_LINE>// filler<NEW_LINE>new Label(composite, SWT.LEFT);<NEW_LINE>showPassword = new Button(composite, <MASK><NEW_LINE>showPassword.setText(Messages.showPassword);<NEW_LINE>showPassword.addSelectionListener(new SelectionListener() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>passwordVisibility();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void widgetDefaultSelected(SelectionEvent e) {<NEW_LINE>passwordVisibility();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>showPassword.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));<NEW_LINE>// by default don't display password as clear text<NEW_LINE>showPassword.setSelection(false);<NEW_LINE>passwordVisibility();<NEW_LINE>composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>GridLayoutFactory.swtDefaults().numColumns(2).generateLayout(composite);<NEW_LINE>return compositeTop;<NEW_LINE>} | SWT.CHECK | SWT.RIGHT); |
33,785 | protected TimerDeclarationImpl parseTimer(Element timerEventDefinition, ActivityImpl timerActivity, String jobHandlerType) {<NEW_LINE>// TimeDate<NEW_LINE>TimerDeclarationType type = TimerDeclarationType.DATE;<NEW_LINE>Expression expression = parseExpression(timerEventDefinition, "timeDate");<NEW_LINE>// TimeCycle<NEW_LINE>if (expression == null) {<NEW_LINE>type = TimerDeclarationType.CYCLE;<NEW_LINE>expression = parseExpression(timerEventDefinition, "timeCycle");<NEW_LINE>}<NEW_LINE>// TimeDuration<NEW_LINE>if (expression == null) {<NEW_LINE>type = TimerDeclarationType.DURATION;<NEW_LINE>expression = parseExpression(timerEventDefinition, "timeDuration");<NEW_LINE>}<NEW_LINE>// neither date, cycle or duration configured!<NEW_LINE>if (expression == null) {<NEW_LINE>addError("Timer needs configuration (either timeDate, timeCycle or timeDuration is needed).", timerEventDefinition, timerActivity.getId());<NEW_LINE>}<NEW_LINE>// Parse the timer declaration<NEW_LINE>// TODO move the timer declaration into the bpmn activity or next to the TimerSession<NEW_LINE>TimerDeclarationImpl timerDeclaration = new TimerDeclarationImpl(expression, type, jobHandlerType);<NEW_LINE>timerDeclaration.setRawJobHandlerConfiguration(timerActivity.getId());<NEW_LINE>timerDeclaration.setExclusive(TRUE.equals(timerEventDefinition.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "exclusive", String.valueOf(JobEntity.DEFAULT_EXCLUSIVE))));<NEW_LINE>if (timerActivity.getId() == null) {<NEW_LINE>addError("Attribute \"id\" is required!", timerEventDefinition);<NEW_LINE>}<NEW_LINE>timerDeclaration.setActivity(timerActivity);<NEW_LINE>timerDeclaration.setJobConfiguration(type.toString() + ": " + expression.getExpressionText());<NEW_LINE>addJobDeclarationToProcessDefinition(timerDeclaration, (ProcessDefinition) timerActivity.getProcessDefinition());<NEW_LINE>timerDeclaration.setJobPriorityProvider((ParameterValueProvider<MASK><NEW_LINE>return timerDeclaration;<NEW_LINE>} | ) timerActivity.getProperty(PROPERTYNAME_JOB_PRIORITY)); |
735,127 | public HelidonServiceLoader<T> build() {<NEW_LINE>// first merge the lists together<NEW_LINE>List<ServiceWithPriority<T>> services = new LinkedList<>(customServices);<NEW_LINE>if (useSystemServiceLoader) {<NEW_LINE>Set<String> <MASK><NEW_LINE>if (replaceImplementations) {<NEW_LINE>customServices.stream().map(ServiceWithPriority::instanceClassName).forEach(uniqueImplementations::add);<NEW_LINE>}<NEW_LINE>serviceLoader.forEach(service -> {<NEW_LINE>if (replaceImplementations) {<NEW_LINE>if (!uniqueImplementations.contains(service.getClass().getName())) {<NEW_LINE>services.add(ServiceWithPriority.createFindPriority(service, defaultPriority));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>services.add(ServiceWithPriority.createFindPriority(service, defaultPriority));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (useSysPropExclude) {<NEW_LINE>addSystemExcludes();<NEW_LINE>}<NEW_LINE>List<ServiceWithPriority<T>> withoutExclusions = services.stream().filter(this::notExcluded).collect(Collectors.toList());<NEW_LINE>// order by priority<NEW_LINE>return new HelidonServiceLoader<>(orderByPriority(withoutExclusions));<NEW_LINE>} | uniqueImplementations = new HashSet<>(); |
23,491 | public Map<String, Double> extract(String json) {<NEW_LINE>Map<String, Object> parsed;<NEW_LINE>try {<NEW_LINE>parsed = JsonConverter.fromJson(json, new TypeReference<HashMap<String, Object>>() {<NEW_LINE>}.getType());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(String.format("Failed to deserialize prediction detail: %s.", json));<NEW_LINE>}<NEW_LINE>Preconditions.checkArgument(parsed.containsKey(OUTLIER_SCORE_KEY), String.format("Prediction detail %s doesn't contain key %s.", json, OUTLIER_SCORE_KEY));<NEW_LINE>double p = Double.parseDouble(String.valueOf(parsed.get(OutlierDetector.OUTLIER_SCORE_KEY)));<NEW_LINE>Map<String, Double> <MASK><NEW_LINE>probMap.put(OUTLIER_LABEL, p);<NEW_LINE>probMap.put(INLIER_LABEL, 1. - p);<NEW_LINE>return probMap;<NEW_LINE>} | probMap = new HashMap<>(); |
1,012,533 | public byte[] decrypt(final byte[] ciphertext, final byte[] contextInfo) throws /* unused */<NEW_LINE>GeneralSecurityException {<NEW_LINE>if (contextInfo != null) {<NEW_LINE>throw new GeneralSecurityException("contextInfo must be null because it is unused");<NEW_LINE>}<NEW_LINE>if (ciphertext.length < WebPushConstants.CIPHERTEXT_OVERHEAD) {<NEW_LINE>throw new GeneralSecurityException("ciphertext too short");<NEW_LINE>}<NEW_LINE>// A push service is not required to support more than 4096 octets of<NEW_LINE>// payload body. See https://tools.ietf.org/html/rfc8291#section-4.0.<NEW_LINE>if (ciphertext.length > WebPushConstants.MAX_CIPHERTEXT_SIZE) {<NEW_LINE>throw new GeneralSecurityException("ciphertext too long");<NEW_LINE>}<NEW_LINE>// Unpacking.<NEW_LINE>ByteBuffer record = ByteBuffer.wrap(ciphertext);<NEW_LINE>byte[] salt = new byte[WebPushConstants.SALT_SIZE];<NEW_LINE>record.get(salt);<NEW_LINE>int recordSize = record.getInt();<NEW_LINE>if (recordSize != this.recordSize || recordSize < ciphertext.length || recordSize > WebPushConstants.MAX_CIPHERTEXT_SIZE) {<NEW_LINE>throw new GeneralSecurityException("invalid record size: " + recordSize);<NEW_LINE>}<NEW_LINE>int publicKeySize = (int) record.get();<NEW_LINE>if (publicKeySize != WebPushConstants.PUBLIC_KEY_SIZE) {<NEW_LINE>throw new GeneralSecurityException("invalid ephemeral public key size: " + publicKeySize);<NEW_LINE>}<NEW_LINE>byte[] asPublicKey = new byte[WebPushConstants.PUBLIC_KEY_SIZE];<NEW_LINE>record.get(asPublicKey);<NEW_LINE>ECPoint asPublicPoint = EllipticCurves.pointDecode(WebPushConstants.NIST_P256_CURVE_TYPE, WebPushConstants.UNCOMPRESSED_POINT_FORMAT, asPublicKey);<NEW_LINE>byte[] payload = new byte[ciphertext.length - WebPushConstants.CONTENT_CODING_HEADER_SIZE];<NEW_LINE>record.get(payload);<NEW_LINE>// See https://tools.ietf.org/html/rfc8291#section-3.4.<NEW_LINE>byte[] ecdhSecret = EllipticCurves.computeSharedSecret(recipientPrivateKey, asPublicPoint);<NEW_LINE>byte[] ikm = WebPushUtil.computeIkm(ecdhSecret, authSecret, recipientPublicKey, asPublicKey);<NEW_LINE>byte[] cek = WebPushUtil.computeCek(ikm, salt);<NEW_LINE>byte[] nonce = WebPushUtil.computeNonce(ikm, salt);<NEW_LINE>return <MASK><NEW_LINE>} | decrypt(cek, nonce, payload); |
749,892 | public void detectOrphanChannels(List<ChannelBuildItem> channels, BuildProducer<OrphanChannelBuildItem> builder) {<NEW_LINE>Map<String, ChannelBuildItem> inc = new HashMap<>();<NEW_LINE>Map<String, ChannelBuildItem> out = new HashMap<>();<NEW_LINE>for (ChannelBuildItem channel : channels) {<NEW_LINE>if (channel.getDirection() == ChannelDirection.INCOMING) {<NEW_LINE>inc.put(channel.getName(), channel);<NEW_LINE>} else {<NEW_LINE>out.put(channel.getName(), channel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> orphanInboundChannels = new HashSet<>(inc.keySet());<NEW_LINE>Set<String> orphanOutboundChannels = new HashSet<>(out.keySet());<NEW_LINE>// Orphan inbounds: all inbounds that do not have a matching outbound<NEW_LINE>orphanInboundChannels.removeAll(out.keySet());<NEW_LINE>// Orphan outbounds: all outbounds that do not have a matching inbound<NEW_LINE>orphanOutboundChannels.<MASK><NEW_LINE>// We need to remove all channels that are managed by connectors<NEW_LINE>for (String channel : orphanInboundChannels) {<NEW_LINE>if (!inc.get(channel).isManagedByAConnector()) {<NEW_LINE>builder.produce(OrphanChannelBuildItem.of(ChannelDirection.INCOMING, channel));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String channel : orphanOutboundChannels) {<NEW_LINE>if (!out.get(channel).isManagedByAConnector()) {<NEW_LINE>builder.produce(OrphanChannelBuildItem.of(ChannelDirection.OUTGOING, channel));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | removeAll(inc.keySet()); |
999,216 | private boolean pruneProductConfig() {<NEW_LINE>log.fine("In pruneProductConfig");<NEW_LINE>boolean retVal = false;<NEW_LINE>DefaultMutableTreeNode rootProductConfig = this.m_RadioButtonTreeCellRenderer.root;<NEW_LINE>Enumeration children = rootProductConfig.breadthFirstEnumeration();<NEW_LINE>log.fine("About to prune");<NEW_LINE>if (children != null) {<NEW_LINE>while (children.hasMoreElements()) {<NEW_LINE>DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement();<NEW_LINE>log.fine("Analyzing: " + child);<NEW_LINE>log.fine("level: " + child.getLevel());<NEW_LINE>nodeUserObject m_nodeUserObject = <MASK><NEW_LINE>log.fine("isMandatory: " + m_nodeUserObject.isMandatory);<NEW_LINE>log.fine("isChosen: " + m_nodeUserObject.isChosen);<NEW_LINE>if (!(child.isRoot() || m_nodeUserObject.isChosen || m_nodeUserObject.isMandatory)) {<NEW_LINE>log.fine("Removing: " + child);<NEW_LINE>child.removeFromParent();<NEW_LINE>retVal = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.fine("Exiting pruneConfig");<NEW_LINE>return retVal;<NEW_LINE>} | (nodeUserObject) child.getUserObject(); |
1,624,535 | public void voidCommand(TelCommand telCommand) throws Throwable {<NEW_LINE>String[] args = telCommand.getCommandArgs();<NEW_LINE>String argsJoin = StringUtils.join(args, "");<NEW_LINE>argsJoin = argsJoin.replace("\\s+", " ");<NEW_LINE>args = argsJoin.split("=");<NEW_LINE>//<NEW_LINE>if (args.length > 0) {<NEW_LINE>String cmd = telCommand.getCommandName();<NEW_LINE>String varName = args[0].trim();<NEW_LINE>if (StringUtils.isBlank(varName)) {<NEW_LINE>throw new Exception("var name undefined.");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if ("set".equalsIgnoreCase(cmd)) {<NEW_LINE>if (args.length > 1) {<NEW_LINE>String varValue = <MASK><NEW_LINE>telCommand.getSession().setAttribute(varName, varValue);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>throw new Exception("args count error.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ("get".equalsIgnoreCase(cmd)) {<NEW_LINE>Object obj = telCommand.getSession().getAttribute(varName);<NEW_LINE>if (obj == null) {<NEW_LINE>telCommand.writeMessageLine("");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// TODO may be is object<NEW_LINE>telCommand.writeMessageLine(obj.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>throw new Exception("does not support command '" + telCommand.getCommandName() + "'.");<NEW_LINE>} else {<NEW_LINE>throw new Exception("args count error.");<NEW_LINE>}<NEW_LINE>} | args[1].trim(); |
1,220,429 | public static HookInfoPatch toInnerForUpdate(ClientLogger logger, NotificationHook notificationHook) {<NEW_LINE>if (notificationHook instanceof EmailNotificationHook) {<NEW_LINE>EmailNotificationHook emailHook = (EmailNotificationHook) notificationHook;<NEW_LINE>EmailHookInfoPatch innerEmailHook = new EmailHookInfoPatch();<NEW_LINE>innerEmailHook.setHookName(emailHook.getName());<NEW_LINE>innerEmailHook.setDescription(emailHook.getDescription());<NEW_LINE>innerEmailHook.setExternalLink(emailHook.getExternalLink());<NEW_LINE>List<String> emailsToAlert = HookHelper.getEmailsToAlertRaw(emailHook);<NEW_LINE>if (emailsToAlert != null) {<NEW_LINE>innerEmailHook.setHookParameter(new EmailHookParameterPatch<MASK><NEW_LINE>}<NEW_LINE>innerEmailHook.setAdmins(HookHelper.getAdminsRaw(emailHook));<NEW_LINE>return innerEmailHook;<NEW_LINE>} else if (notificationHook instanceof WebNotificationHook) {<NEW_LINE>WebNotificationHook webHook = (WebNotificationHook) notificationHook;<NEW_LINE>WebhookHookInfoPatch innerWebHook = new WebhookHookInfoPatch();<NEW_LINE>innerWebHook.setHookName(webHook.getName());<NEW_LINE>innerWebHook.setDescription(webHook.getDescription());<NEW_LINE>innerWebHook.setExternalLink(webHook.getExternalLink());<NEW_LINE>WebhookHookParameterPatch hookParameter = new WebhookHookParameterPatch().setEndpoint(webHook.getEndpoint()).setUsername(webHook.getUsername()).setPassword(webHook.getPassword()).setCertificateKey(webHook.getClientCertificate()).setCertificatePassword(webHook.getClientCertificatePassword());<NEW_LINE>HttpHeaders headers = HookHelper.getHttpHeadersRaw(webHook);<NEW_LINE>if (headers != null) {<NEW_LINE>hookParameter.setHeaders(headers.toMap());<NEW_LINE>}<NEW_LINE>innerWebHook.setHookParameter(hookParameter);<NEW_LINE>innerWebHook.setAdmins(HookHelper.getAdminsRaw(webHook));<NEW_LINE>return innerWebHook;<NEW_LINE>} else {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The notificationHook type %s not supported", notificationHook.getClass().getCanonicalName())));<NEW_LINE>}<NEW_LINE>} | ().setToList(emailsToAlert)); |
227,252 | private static // It's lying; we need the "redundant" casts (as of 2014-09-08)<NEW_LINE>Object buildDependencyTree(SemanticGraph graph) {<NEW_LINE>if (graph != null) {<NEW_LINE>return // Roots<NEW_LINE>Stream.// Roots<NEW_LINE>concat(graph.getRoots().stream().map((IndexedWord root) -> (Consumer<Writer>) dep -> {<NEW_LINE>dep.set("dep", "ROOT");<NEW_LINE>dep.set("governor", 0);<NEW_LINE>dep.set("governorGloss", "ROOT");<NEW_LINE>dep.set("dependent", root.index());<NEW_LINE>dep.set("dependentGloss", root.word());<NEW_LINE>}), // Regular edges<NEW_LINE>graph.edgeListSorted().stream().map((SemanticGraphEdge edge) -> (Consumer<Writer>) (Writer dep) -> {<NEW_LINE>dep.set("dep", edge.getRelation().toString());<NEW_LINE>dep.set("governor", edge.getGovernor().index());<NEW_LINE>dep.set("governorGloss", edge.getGovernor().word());<NEW_LINE>dep.set("dependent", edge.<MASK><NEW_LINE>dep.set("dependentGloss", edge.getDependent().word());<NEW_LINE>}));<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | getDependent().index()); |
1,129,226 | // snippet-start:[sagemaker.java2.transform_job.main]<NEW_LINE>public static void transformJob(SageMakerClient sageMakerClient, String s3Uri, String s3OutputPath, String modelName, String transformJobName) {<NEW_LINE>try {<NEW_LINE>TransformS3DataSource s3DataSource = TransformS3DataSource.builder().s3DataType("S3Prefix").s3Uri(s3Uri).build();<NEW_LINE>TransformDataSource dataSource = TransformDataSource.builder().s3DataSource(s3DataSource).build();<NEW_LINE>TransformInput input = TransformInput.builder().dataSource(dataSource).contentType("text/csv").splitType("Line").build();<NEW_LINE>TransformOutput output = TransformOutput.builder().s3OutputPath(s3OutputPath).build();<NEW_LINE>TransformResources resources = TransformResources.builder().instanceCount(1).instanceType("ml.m4.xlarge").build();<NEW_LINE>CreateTransformJobRequest jobRequest = CreateTransformJobRequest.builder().transformJobName(transformJobName).modelName(modelName).transformInput(input).transformOutput(output).transformResources(resources).build();<NEW_LINE>CreateTransformJobResponse <MASK><NEW_LINE>System.out.println("Response " + jobResponse.transformJobArn());<NEW_LINE>} catch (SageMakerException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | jobResponse = sageMakerClient.createTransformJob(jobRequest); |
420,259 | public static void main(String[] args) throws IOException, NoSuchAlgorithmException {<NEW_LINE>String buildName = "build-test";<NEW_LINE>String buildNumber = "2";<NEW_LINE>String artifactoryURL = "http://localhost:8081/artifactory";<NEW_LINE>// optional. Only used when deploying the actual artifacts (in addition to the build info).<NEW_LINE>String targetRepository = "libs-release-local";<NEW_LINE>// directory location is passed by argument<NEW_LINE>File artifactsDirectory = new File(args[0]);<NEW_LINE>if (!artifactsDirectory.isDirectory()) {<NEW_LINE>throw new IOException(args[0] + " Path cannot be read, perhaps it does not exist, not a directory of there are not enough permissions to read it");<NEW_LINE>}<NEW_LINE>ArtifactoryBuildInfoClient client = new ArtifactoryBuildInfoClient(artifactoryURL, "admin", "password", new CreateAndDeploy.MyLog());<NEW_LINE>BuildInfoBuilder builder = new BuildInfoBuilder(buildName);<NEW_LINE>builder.number(buildNumber);<NEW_LINE>SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Build.STARTED_FORMAT);<NEW_LINE>builder.started(simpleDateFormat.format(new Date()));<NEW_LINE>ModuleBuilder moduleBuilder = new ModuleBuilder();<NEW_LINE>moduleBuilder.id("test-module");<NEW_LINE>List<File> listOfDirectoryArtifacts = new ArrayList<File>();<NEW_LINE>listOfDirectoryArtifacts = getFilesFromDirectoryRecursively(artifactsDirectory.listFiles(), listOfDirectoryArtifacts);<NEW_LINE>if (!listOfDirectoryArtifacts.isEmpty()) {<NEW_LINE>for (File currentArtifact : listOfDirectoryArtifacts) {<NEW_LINE>HashMap<String, String> checksums = (HashMap) FileChecksumCalculator.calculateChecksums(currentArtifact, "MD5", "SHA1");<NEW_LINE>ArtifactBuilder artifactBuilder = new ArtifactBuilder("artifactBuilder");<NEW_LINE>Artifact artifact = artifactBuilder.sha1(checksums.get("SHA1")).md5(checksums.get("MD5")).name(currentArtifact.getName()).build();<NEW_LINE>moduleBuilder = moduleBuilder.addArtifact(artifact);<NEW_LINE>// if you don't want the actual artifact to be deployed and only interested to deploy the build info, please comment the below line.<NEW_LINE>deployArtifact(client, currentArtifact, artifactsDirectory.getAbsolutePath(), targetRepository, buildName, buildNumber);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Module module = moduleBuilder.build();<NEW_LINE>Build build = builder.addModule(module).agent(new Agent<MASK><NEW_LINE>try {<NEW_LINE>client.sendBuildInfo(build);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | ("Java-example-agent")).build(); |
1,474,491 | protected void initNode(TranspilationHandler transpilationHandler) throws Exception {<NEW_LINE>ProcessUtil.initNode();<NEW_LINE>File initFile = new File(workingDir, ".node-init");<NEW_LINE>boolean initialized = initFile.exists();<NEW_LINE>if (!initialized) {<NEW_LINE>ProcessUtil.runCommand(ProcessUtil.NODE_COMMAND, currentNodeVersion -> {<NEW_LINE><MASK><NEW_LINE>if (!isVersionHighEnough(currentNodeVersion, ProcessUtil.NODE_MINIMUM_VERSION)) {<NEW_LINE>transpilationHandler.report(JSweetProblem.NODE_OBSOLETE_VERSION, null, JSweetProblem.NODE_OBSOLETE_VERSION.getMessage(currentNodeVersion, ProcessUtil.NODE_MINIMUM_VERSION));<NEW_LINE>// throw new RuntimeException("node.js version is obsolete,<NEW_LINE>// minimum version: " + ProcessUtil.NODE_MINIMUM_VERSION);<NEW_LINE>}<NEW_LINE>}, () -> {<NEW_LINE>transpilationHandler.report(JSweetProblem.NODE_CANNOT_START, null, JSweetProblem.NODE_CANNOT_START.getMessage());<NEW_LINE>throw new RuntimeException("cannot find node.js");<NEW_LINE>}, "--version");<NEW_LINE>initFile.mkdirs();<NEW_LINE>initFile.createNewFile();<NEW_LINE>}<NEW_LINE>String v = "";<NEW_LINE>File tscVersionFile = new File(ProcessUtil.NPM_DIR, "tsc-version");<NEW_LINE>if (tscVersionFile.exists()) {<NEW_LINE>v = FileUtils.readFileToString(tscVersionFile);<NEW_LINE>}<NEW_LINE>if (!ProcessUtil.isExecutableInstalledGloballyWithNpm("tsc") || !v.trim().startsWith(TSC_VERSION)) {<NEW_LINE>// this will lead to performances issues if having multiple versions<NEW_LINE>// of JSweet installed<NEW_LINE>if (ProcessUtil.isExecutableInstalledGloballyWithNpm("tsc")) {<NEW_LINE>ProcessUtil.uninstallGlobalNodePackage("typescript");<NEW_LINE>}<NEW_LINE>ProcessUtil.installGlobalNodePackage("typescript", TSC_VERSION);<NEW_LINE>FileUtils.writeStringToFile(tscVersionFile, TSC_VERSION);<NEW_LINE>}<NEW_LINE>} | logger.info("node version: " + currentNodeVersion); |
777,256 | public void testCreateMapMessage_TCP_SecOff(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String name = "Valuepair";<NEW_LINE>long value = 22222222;<NEW_LINE>JMSContext jmsContext = jmsQCFTCP.createContext();<NEW_LINE>emptyQueue(jmsQCFTCP, queue);<NEW_LINE>MapMessage msg = jmsContext.createMapMessage();<NEW_LINE><MASK><NEW_LINE>boolean testFailed = false;<NEW_LINE>if (msg.getLong(name) != value) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsContext.createProducer().send(queue, msg);<NEW_LINE>QueueBrowser queueBrowser = jmsContext.createBrowser(queue);<NEW_LINE>int numMsgs = getMessageCount(queueBrowser);<NEW_LINE>JMSConsumer jmsConsumer = jmsContext.createConsumer(queue);<NEW_LINE>jmsConsumer.receive(30000);<NEW_LINE>if (numMsgs != 1) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContext.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testCreateMapMessage_TCP_SecOff failed");<NEW_LINE>}<NEW_LINE>} | msg.setLong(name, value); |
252,513 | public void marshall(GlacierJobDescription glacierJobDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (glacierJobDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getJobId(), JOBID_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getJobDescription(), JOBDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getAction(), ACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getArchiveId(), ARCHIVEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getVaultARN(), VAULTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getCompleted(), COMPLETED_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getStatusCode(), STATUSCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getArchiveSizeInBytes(), ARCHIVESIZEINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getInventorySizeInBytes(), INVENTORYSIZEINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getCompletionDate(), COMPLETIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getSHA256TreeHash(), SHA256TREEHASH_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getArchiveSHA256TreeHash(), ARCHIVESHA256TREEHASH_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getRetrievalByteRange(), RETRIEVALBYTERANGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getTier(), TIER_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getInventoryRetrievalParameters(), INVENTORYRETRIEVALPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getJobOutputPath(), JOBOUTPUTPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getSelectParameters(), SELECTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getOutputLocation(), OUTPUTLOCATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | glacierJobDescription.getSNSTopic(), SNSTOPIC_BINDING); |
117,013 | public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length < 1)<NEW_LINE>Utils.croak("USAGE: java " + HdfsFetcher.class.getName() + " url [keytab-location kerberos-username hadoop-config-path [destDir]]");<NEW_LINE>String url = args[0];<NEW_LINE>VoldemortConfig config = new VoldemortConfig(-1, "");<NEW_LINE>HdfsFetcher fetcher = new HdfsFetcher(config);<NEW_LINE>String destDir = null;<NEW_LINE>Long diskQuotaSizeInKB;<NEW_LINE>if (args.length >= 4) {<NEW_LINE>fetcher.voldemortConfig.setReadOnlyKeytabPath(args[1]);<NEW_LINE>fetcher.voldemortConfig.setReadOnlyKerberosUser(args[2]);<NEW_LINE>fetcher.voldemortConfig.setHadoopConfigPath(args[3]);<NEW_LINE>}<NEW_LINE>if (args.length >= 5)<NEW_LINE>destDir = args[4];<NEW_LINE>if (args.length >= 6)<NEW_LINE>diskQuotaSizeInKB = Long.parseLong(args[5]);<NEW_LINE>else<NEW_LINE>diskQuotaSizeInKB = null;<NEW_LINE>// for testing we want to be able to download a single file<NEW_LINE>allowFetchingOfSingleFile = true;<NEW_LINE>FileSystem fs = HadoopUtils.getHadoopFileSystem(fetcher.voldemortConfig, url);<NEW_LINE>Path p = new Path(url);<NEW_LINE>FileStatus status = fs.listStatus(p)[0];<NEW_LINE>long size = status.getLen();<NEW_LINE><MASK><NEW_LINE>if (destDir == null)<NEW_LINE>destDir = System.getProperty("java.io.tmpdir") + File.separator + start;<NEW_LINE>File location = fetcher.fetch(url, destDir, null, null, -1, null, diskQuotaSizeInKB);<NEW_LINE>double rate = size * Time.MS_PER_SECOND / (double) (System.currentTimeMillis() - start);<NEW_LINE>NumberFormat nf = NumberFormat.getInstance();<NEW_LINE>nf.setMaximumFractionDigits(2);<NEW_LINE>System.out.println("Fetch to " + location + " completed: " + nf.format(rate / (1024.0 * 1024.0)) + " MB/sec.");<NEW_LINE>fs.close();<NEW_LINE>} | long start = System.currentTimeMillis(); |
479,964 | protected List fetch() {<NEW_LINE>HazelcastClientInstanceImpl client = (HazelcastClientInstanceImpl) context.getHazelcastInstance();<NEW_LINE>String name = cacheProxy.getPrefixedName();<NEW_LINE>if (prefetchValues) {<NEW_LINE>ClientMessage request = CacheIterateEntriesCodec.encodeRequest(name, encodePointers(pointers), fetchSize);<NEW_LINE>try {<NEW_LINE>ClientInvocation clientInvocation = new ClientInvocation(client, request, name, partitionIndex);<NEW_LINE>ClientInvocationFuture future = clientInvocation.invoke();<NEW_LINE>CacheIterateEntriesCodec.ResponseParameters responseParameters = CacheIterateEntriesCodec.decodeResponse(future.get());<NEW_LINE>IterationPointer[] pointers = decodePointers(responseParameters.iterationPointers);<NEW_LINE>setIterationPointers(responseParameters.entries, pointers);<NEW_LINE>return responseParameters.entries;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw rethrow(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ClientMessage request = CacheIterateCodec.encodeRequest(name, encodePointers(pointers), fetchSize);<NEW_LINE>try {<NEW_LINE>ClientInvocation clientInvocation = new ClientInvocation(client, request, name, partitionIndex);<NEW_LINE>ClientInvocationFuture future = clientInvocation.invoke();<NEW_LINE>CacheIterateCodec.ResponseParameters responseParameters = CacheIterateCodec.decodeResponse(future.get());<NEW_LINE>IterationPointer[] <MASK><NEW_LINE>setIterationPointers(responseParameters.keys, pointers);<NEW_LINE>return responseParameters.keys;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw rethrow(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | pointers = decodePointers(responseParameters.iterationPointers); |
1,018,969 | private static void parse(String s, Calendar cal) {<NEW_LINE>Matcher <MASK><NEW_LINE>if (!m.matches()) {<NEW_LINE>throw new IllegalArgumentException("Invalid date/time: " + s);<NEW_LINE>}<NEW_LINE>cal.clear();<NEW_LINE>cal.set(Calendar.YEAR, Integer.parseInt(m.group(1)));<NEW_LINE>cal.set(Calendar.MONTH, Integer.parseInt(m.group(2)) - 1);<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(m.group(3)));<NEW_LINE>cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(m.group(4)));<NEW_LINE>cal.set(Calendar.MINUTE, Integer.parseInt(m.group(5)));<NEW_LINE>cal.set(Calendar.SECOND, Integer.parseInt(m.group(6)));<NEW_LINE>if (m.group(7) != null) {<NEW_LINE>float fraction = Float.parseFloat(m.group(7));<NEW_LINE>cal.set(Calendar.MILLISECOND, (int) (fraction * 1000F));<NEW_LINE>}<NEW_LINE>if (m.group(8) != null) {<NEW_LINE>cal.setTimeZone(new SimpleTimeZone(0, "Z"));<NEW_LINE>} else {<NEW_LINE>int sign = m.group(9).equals("-") ? -1 : 1;<NEW_LINE>int tzhour;<NEW_LINE>tzhour = Integer.parseInt(m.group(10));<NEW_LINE>int tzminute = Integer.parseInt(m.group(11));<NEW_LINE>int offset = sign * ((tzhour * 60) + tzminute);<NEW_LINE>String id = Integer.toString(offset);<NEW_LINE>cal.setTimeZone(new SimpleTimeZone(offset * 60000, id));<NEW_LINE>}<NEW_LINE>} | m = pattern.matcher(s); |
1,381,208 | private FileChunksMeta openFileChunksInfo(FileChunksMeta fileChunksMeta) throws BrokerException {<NEW_LINE>ParamCheckUtils.validateFileName(fileChunksMeta.getFileName());<NEW_LINE>ParamCheckUtils.validateFileSize(fileChunksMeta.getFileSize());<NEW_LINE>ParamCheckUtils.validateFileMd5(fileChunksMeta.getFileMd5());<NEW_LINE>// 1. create FileChunksMeta<NEW_LINE>FileChunksMeta newFileChunksMeta;<NEW_LINE>try {<NEW_LINE>newFileChunksMeta = new FileChunksMeta(WeEventUtils.generateUuid(), URLDecoder.decode(fileChunksMeta.getFileName(), StandardCharsets.UTF_8.toString()), fileChunksMeta.getFileSize(), fileChunksMeta.getFileMd5(), fileChunksMeta.getTopic(), fileChunksMeta.getGroupId(), fileChunksMeta.isOverwrite());<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>log.error("decode fileName error", e);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// 2. create AMOP channel with FileTransportSender<NEW_LINE>FileChunksMeta remoteFileChunksMeta = this.fileTransportService.openChannel(newFileChunksMeta);<NEW_LINE>return remoteFileChunksMeta;<NEW_LINE>} | throw new BrokerException(ErrorCode.DECODE_FILE_NAME_ERROR); |
266,479 | private static void install(AttachmentProvider attachmentProvider, String processId, @MaybeNull String argument, AgentProvider agentProvider, boolean isNative) {<NEW_LINE>AttachmentProvider.<MASK><NEW_LINE>if (!attachmentAccessor.isAvailable()) {<NEW_LINE>throw new IllegalStateException("No compatible attachment provider is available");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (attachmentAccessor.isExternalAttachmentRequired() && ATTACHMENT_TYPE_EVALUATOR.requiresExternalAttachment(processId)) {<NEW_LINE>installExternal(attachmentAccessor.getExternalAttachment(), processId, agentProvider.resolve(), isNative, argument);<NEW_LINE>} else {<NEW_LINE>Attacher.install(attachmentAccessor.getVirtualMachineType(), processId, agentProvider.resolve().getAbsolutePath(), isNative, argument);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException exception) {<NEW_LINE>throw exception;<NEW_LINE>} catch (Exception exception) {<NEW_LINE>throw new IllegalStateException("Error during attachment using: " + attachmentProvider, exception);<NEW_LINE>}<NEW_LINE>} | Accessor attachmentAccessor = attachmentProvider.attempt(); |
1,639,633 | public void revokeRoomUsers(RoomUsersDeleteBatchRequest body, Long roomId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling revokeRoomUsers");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'roomId' is set<NEW_LINE>if (roomId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'roomId' when calling revokeRoomUsers");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes/rooms/{room_id}/users".replaceAll("\\{" + "room_id" + "\\}", apiClient.escapeString(roomId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
451,177 | public ShareServiceAsyncClient buildAsyncClient() {<NEW_LINE>CredentialValidator.validateSingleCredentialIsPresent(storageSharedKeyCredential, <MASK><NEW_LINE>ShareServiceVersion serviceVersion = version != null ? version : ShareServiceVersion.getLatest();<NEW_LINE>HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(() -> {<NEW_LINE>if (storageSharedKeyCredential != null) {<NEW_LINE>return new StorageSharedKeyCredentialPolicy(storageSharedKeyCredential);<NEW_LINE>} else if (azureSasCredential != null) {<NEW_LINE>return new AzureSasCredentialPolicy(azureSasCredential, false);<NEW_LINE>} else if (sasToken != null) {<NEW_LINE>return new AzureSasCredentialPolicy(new AzureSasCredential(sasToken), false);<NEW_LINE>} else {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("Credentials are required for authorization"));<NEW_LINE>}<NEW_LINE>}, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, LOGGER);<NEW_LINE>AzureFileStorageImpl azureFileStorage = new AzureFileStorageImplBuilder().url(endpoint).pipeline(pipeline).version(serviceVersion.getVersion()).buildClient();<NEW_LINE>return new ShareServiceAsyncClient(azureFileStorage, accountName, serviceVersion);<NEW_LINE>} | null, azureSasCredential, sasToken, LOGGER); |
1,244,758 | public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// Get Session Info<NEW_LINE>MobileSessionCtx <MASK><NEW_LINE>WWindowStatus ws = WWindowStatus.get(request);<NEW_LINE>if (// ws can be null for Login<NEW_LINE>wsc == null || ws == null)<NEW_LINE>;<NEW_LINE>// Get Parameter<NEW_LINE>String formName = MobileUtil.getParameter(request, FIELD_FORM);<NEW_LINE>String fieldName = MobileUtil.getParameter(request, FIELD_NAME);<NEW_LINE>String fieldValue = MobileUtil.getParameter(request, FIELD_VALUE);<NEW_LINE>String locationValue = MobileUtil.getParameter(request, LOCATION_VALUE);<NEW_LINE>log.info("doPost - Form=" + formName + " - Field=" + fieldName + " - Value=" + fieldValue + " - Location=" + locationValue);<NEW_LINE>// Document<NEW_LINE>MobileDoc doc = createPage(wsc, ws, formName, fieldName, fieldValue, locationValue);<NEW_LINE>// The Form<NEW_LINE>form fu = new form(request.getRequestURI());<NEW_LINE>fu.setName(FORM_NAME);<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, FIELD_FORM, "y"));<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, FIELD_NAME, "y"));<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, FIELD_VALUE, "y"));<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, LOCATION_VALUE, locationValue));<NEW_LINE>doc.getBody().addElement(fu);<NEW_LINE>// log.trace(log.l1_User, "WFieldUpdate=" + doc.toString());<NEW_LINE>// Answer<NEW_LINE>MobileUtil.createResponse(request, response, this, null, doc, false);<NEW_LINE>} | wsc = MobileSessionCtx.get(request); |
1,823,088 | public DataSegment move(DataSegment segment, Map<String, Object> targetLoadSpec) throws SegmentLoadingException {<NEW_LINE>try {<NEW_LINE>Map<String, Object> loadSpec = segment.getLoadSpec();<NEW_LINE>String s3Bucket = <MASK><NEW_LINE>String s3Path = MapUtils.getString(loadSpec, "key");<NEW_LINE>final String targetS3Bucket = MapUtils.getString(targetLoadSpec, "bucket");<NEW_LINE>final String targetS3BaseKey = MapUtils.getString(targetLoadSpec, "baseKey");<NEW_LINE>final String targetS3Path = S3Utils.constructSegmentPath(targetS3BaseKey, DataSegmentPusher.getDefaultStorageDir(segment, false));<NEW_LINE>if (targetS3Bucket.isEmpty()) {<NEW_LINE>throw new SegmentLoadingException("Target S3 bucket is not specified");<NEW_LINE>}<NEW_LINE>if (targetS3Path.isEmpty()) {<NEW_LINE>throw new SegmentLoadingException("Target S3 baseKey is not specified");<NEW_LINE>}<NEW_LINE>safeMove(s3Bucket, s3Path, targetS3Bucket, targetS3Path);<NEW_LINE>return segment.withLoadSpec(ImmutableMap.<String, Object>builder().putAll(Maps.filterKeys(loadSpec, new Predicate<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean apply(String input) {<NEW_LINE>return !("bucket".equals(input) || "key".equals(input));<NEW_LINE>}<NEW_LINE>})).put("bucket", targetS3Bucket).put("key", targetS3Path).build());<NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>throw new SegmentLoadingException(e, "Unable to move segment[%s]: [%s]", segment.getId(), e);<NEW_LINE>}<NEW_LINE>} | MapUtils.getString(loadSpec, "bucket"); |
1,809,100 | public static void gatherData(GatherDataEvent event) {<NEW_LINE>// Capabilities are not registered yet, but cap references throw on null caps<NEW_LINE>CapabilityItemHandler.register();<NEW_LINE>CapabilityFluidHandler.register();<NEW_LINE>CapabilityEnergy.register();<NEW_LINE>CapabilityRedstoneNetwork.register();<NEW_LINE>ExistingFileHelper exHelper = event.getExistingFileHelper();<NEW_LINE>StaticTemplateManager.EXISTING_HELPER = exHelper;<NEW_LINE>DataGenerator gen = event.getGenerator();<NEW_LINE>if (event.includeServer()) {<NEW_LINE>BlockTagsProvider blockTags = new IEBlockTags(gen, exHelper);<NEW_LINE>gen.addProvider(blockTags);<NEW_LINE>gen.addProvider(new ItemTags(gen, blockTags, exHelper));<NEW_LINE>gen.addProvider(new FluidTags(gen, exHelper));<NEW_LINE>gen.addProvider(new TileTags(gen, exHelper));<NEW_LINE>gen.addProvider(new Recipes(gen));<NEW_LINE>gen.addProvider(new BlockLoot(gen));<NEW_LINE>gen.addProvider(new GeneralLoot(gen));<NEW_LINE>gen.addProvider(new BlockStates(gen, exHelper));<NEW_LINE>MultiblockStates blockStates = new MultiblockStates(gen, exHelper);<NEW_LINE>gen.addProvider(blockStates);<NEW_LINE>gen.addProvider(new ConnectorBlockStates(gen, exHelper));<NEW_LINE>gen.addProvider(new ItemModels<MASK><NEW_LINE>gen.addProvider(new Advancements(gen));<NEW_LINE>gen.addProvider(new StructureUpdater("structures/multiblocks", Lib.MODID, exHelper, gen));<NEW_LINE>gen.addProvider(new StructureUpdater("structures/village", Lib.MODID, exHelper, gen));<NEW_LINE>// Always keep this as the last provider!<NEW_LINE>gen.addProvider(new RunCompleteHelper());<NEW_LINE>}<NEW_LINE>} | (gen, exHelper, blockStates)); |
52,696 | public Request<CreateDBClusterParameterGroupRequest> marshall(CreateDBClusterParameterGroupRequest createDBClusterParameterGroupRequest) {<NEW_LINE>if (createDBClusterParameterGroupRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateDBClusterParameterGroupRequest> request = new DefaultRequest<CreateDBClusterParameterGroupRequest>(createDBClusterParameterGroupRequest, "AmazonDocDB");<NEW_LINE>request.addParameter("Action", "CreateDBClusterParameterGroup");<NEW_LINE>request.addParameter("Version", "2014-10-31");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createDBClusterParameterGroupRequest.getDBClusterParameterGroupName() != null) {<NEW_LINE>request.addParameter("DBClusterParameterGroupName", StringUtils.fromString(createDBClusterParameterGroupRequest.getDBClusterParameterGroupName()));<NEW_LINE>}<NEW_LINE>if (createDBClusterParameterGroupRequest.getDBParameterGroupFamily() != null) {<NEW_LINE>request.addParameter("DBParameterGroupFamily", StringUtils.fromString(createDBClusterParameterGroupRequest.getDBParameterGroupFamily()));<NEW_LINE>}<NEW_LINE>if (createDBClusterParameterGroupRequest.getDescription() != null) {<NEW_LINE>request.addParameter("Description", StringUtils.fromString(createDBClusterParameterGroupRequest.getDescription()));<NEW_LINE>}<NEW_LINE>if (createDBClusterParameterGroupRequest.getTags() != null) {<NEW_LINE>java.util.List<Tag> tagsList = createDBClusterParameterGroupRequest.getTags();<NEW_LINE>if (tagsList.isEmpty()) {<NEW_LINE>request.addParameter("Tags", "");<NEW_LINE>} else {<NEW_LINE>int tagsListIndex = 1;<NEW_LINE>for (Tag tagsListValue : tagsList) {<NEW_LINE>if (tagsListValue != null) {<NEW_LINE>if (tagsListValue.getKey() != null) {<NEW_LINE>request.addParameter("Tags.Tag." + tagsListIndex + ".Key", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (tagsListValue.getValue() != null) {<NEW_LINE>request.addParameter("Tags.Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (tagsListValue.getKey())); |
1,705,449 | static void showOnAnchor(DeprecatedLithoTooltip tooltip, Rect anchorBounds, View hostView, TooltipPosition tooltipPosition, int xOffset, int yOffset) {<NEW_LINE>final int topOffset = anchorBounds.top - hostView.getHeight();<NEW_LINE>final int bottomOffset = anchorBounds.bottom - hostView.getHeight();<NEW_LINE>final int centerXOffset = anchorBounds.left + (anchorBounds.right - anchorBounds.left) / 2;<NEW_LINE>final int centerYOffset = (anchorBounds.top + (anchorBounds.bottom - anchorBounds.top) / <MASK><NEW_LINE>final int xoff, yoff;<NEW_LINE>switch(tooltipPosition) {<NEW_LINE>case CENTER:<NEW_LINE>xoff = centerXOffset;<NEW_LINE>yoff = centerYOffset;<NEW_LINE>break;<NEW_LINE>case CENTER_LEFT:<NEW_LINE>xoff = anchorBounds.left;<NEW_LINE>yoff = centerYOffset;<NEW_LINE>break;<NEW_LINE>case TOP_LEFT:<NEW_LINE>xoff = anchorBounds.left;<NEW_LINE>yoff = topOffset;<NEW_LINE>break;<NEW_LINE>case CENTER_TOP:<NEW_LINE>xoff = centerXOffset;<NEW_LINE>yoff = topOffset;<NEW_LINE>break;<NEW_LINE>case TOP_RIGHT:<NEW_LINE>xoff = anchorBounds.right;<NEW_LINE>yoff = topOffset;<NEW_LINE>break;<NEW_LINE>case CENTER_RIGHT:<NEW_LINE>xoff = anchorBounds.right;<NEW_LINE>yoff = centerYOffset;<NEW_LINE>break;<NEW_LINE>case BOTTOM_RIGHT:<NEW_LINE>xoff = anchorBounds.right;<NEW_LINE>yoff = bottomOffset;<NEW_LINE>break;<NEW_LINE>case CENTER_BOTTOM:<NEW_LINE>xoff = centerXOffset;<NEW_LINE>yoff = bottomOffset;<NEW_LINE>break;<NEW_LINE>case BOTTOM_LEFT:<NEW_LINE>default:<NEW_LINE>xoff = anchorBounds.left;<NEW_LINE>yoff = bottomOffset;<NEW_LINE>}<NEW_LINE>tooltip.showBottomLeft(hostView, xoff + xOffset, yoff + yOffset);<NEW_LINE>} | 2) - hostView.getHeight(); |
1,852,559 | protected WireFeed parseChannel(final Element rssRoot, final Locale locale) {<NEW_LINE>final Channel channel = new Channel(getType());<NEW_LINE>channel.setStyleSheet(getStyleSheet(rssRoot.getDocument()));<NEW_LINE>final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());<NEW_LINE>final Element title = eChannel.<MASK><NEW_LINE>if (title != null) {<NEW_LINE>channel.setTitle(title.getText());<NEW_LINE>}<NEW_LINE>final Element link = eChannel.getChild("link", getRSSNamespace());<NEW_LINE>if (link != null) {<NEW_LINE>channel.setLink(link.getText());<NEW_LINE>}<NEW_LINE>final Element description = eChannel.getChild("description", getRSSNamespace());<NEW_LINE>if (description != null) {<NEW_LINE>channel.setDescription(description.getText());<NEW_LINE>}<NEW_LINE>channel.setImage(parseImage(rssRoot));<NEW_LINE>channel.setTextInput(parseTextInput(rssRoot));<NEW_LINE>// Unfortunately Microsoft's SSE extension has a special case of effectively putting the<NEW_LINE>// sharing channel module inside the RSS tag and not inside the channel itself. So we also<NEW_LINE>// need to look for channel modules from the root RSS element.<NEW_LINE>final List<Module> allFeedModules = new ArrayList<Module>();<NEW_LINE>final List<Module> rootModules = parseFeedModules(rssRoot, locale);<NEW_LINE>final List<Module> channelModules = parseFeedModules(eChannel, locale);<NEW_LINE>if (rootModules != null) {<NEW_LINE>allFeedModules.addAll(rootModules);<NEW_LINE>}<NEW_LINE>if (channelModules != null) {<NEW_LINE>allFeedModules.addAll(channelModules);<NEW_LINE>}<NEW_LINE>channel.setModules(allFeedModules);<NEW_LINE>channel.setItems(parseItems(rssRoot, locale));<NEW_LINE>final List<Element> foreignMarkup = extractForeignMarkup(eChannel, channel, getRSSNamespace());<NEW_LINE>if (!foreignMarkup.isEmpty()) {<NEW_LINE>channel.setForeignMarkup(foreignMarkup);<NEW_LINE>}<NEW_LINE>return channel;<NEW_LINE>} | getChild("title", getRSSNamespace()); |
542,131 | public static SemanticGraph enhanceGraph(SemanticGraph basic, SemanticGraph originalEnhanced, boolean keepEmptyNodes, Embedding embeddings, Pattern relativePronounsPattern) {<NEW_LINE>SemanticGraph enhanced = new SemanticGraph(basic.typedDependencies());<NEW_LINE>if (keepEmptyNodes && originalEnhanced != null) {<NEW_LINE>copyEmptyNodes(originalEnhanced, enhanced);<NEW_LINE>}<NEW_LINE>if (embeddings != null) {<NEW_LINE>UniversalGappingEnhancer.addEnhancements(enhanced, embeddings);<NEW_LINE>}<NEW_LINE>if (relativePronounsPattern != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>UniversalGrammaticalStructure.collapseReferent(enhanced);<NEW_LINE>UniversalGrammaticalStructure.propagateConjuncts(enhanced);<NEW_LINE>UniversalGrammaticalStructure.addExtraNSubj(enhanced);<NEW_LINE>UniversalGrammaticalStructure.addCaseMarkerInformation(enhanced);<NEW_LINE>UniversalGrammaticalStructure.addCaseMarkerForConjunctions(enhanced);<NEW_LINE>UniversalGrammaticalStructure.addConjInformation(enhanced);<NEW_LINE>return enhanced;<NEW_LINE>} | UniversalGrammaticalStructure.addRef(enhanced, relativePronounsPattern); |
191,773 | public void addMacroButtonPropertiesAtNextIndex(List<MacroButtonProperties> toSave, boolean gmPanel) {<NEW_LINE>List<MacroButtonProperties<MASK><NEW_LINE>int lastIndex = gmPanel ? gmMacroButtonLastIndex : macroButtonLastIndex;<NEW_LINE>// populate the lookup table and confirm lastIndex<NEW_LINE>for (MacroButtonProperties prop : macroButtonList) {<NEW_LINE>int curIndex = prop.getIndex();<NEW_LINE>if (curIndex > lastIndex) {<NEW_LINE>lastIndex = curIndex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// set the indexes and add to list<NEW_LINE>for (MacroButtonProperties newProp : toSave) {<NEW_LINE>newProp.setIndex(++lastIndex);<NEW_LINE>}<NEW_LINE>macroButtonList.addAll(toSave);<NEW_LINE>// update the ButtonLastIndex prop as appropriate<NEW_LINE>if (gmPanel) {<NEW_LINE>gmMacroButtonLastIndex = lastIndex;<NEW_LINE>} else {<NEW_LINE>macroButtonLastIndex = lastIndex;<NEW_LINE>}<NEW_LINE>AbstractMacroPanel macroPanel = gmPanel ? MapTool.getFrame().getGmPanel() : MapTool.getFrame().getCampaignPanel();<NEW_LINE>macroPanel.reset();<NEW_LINE>} | > macroButtonList = gmPanel ? gmMacroButtonProperties : macroButtonProperties; |
1,212,552 | public EventBean[] snapshotUpdate(QueryGraph filterQueryGraph, ExprEvaluator optionalWhereClause, EventBeanUpdateHelperWCopy updateHelper, Annotation[] annotations) {<NEW_LINE>agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock().acquireReadLock();<NEW_LINE>try {<NEW_LINE>Collection<EventBean> events = snapshotNoLockWithFilter(filterQueryGraph, annotations, optionalWhereClause, agentInstanceContext);<NEW_LINE>if (events.isEmpty()) {<NEW_LINE>return CollectionUtil.EVENTBEANARRAY_EMPTY;<NEW_LINE>}<NEW_LINE>EventBean[] eventsPerStream = new EventBean[3];<NEW_LINE>EventBean[] updated = new EventBean[events.size()];<NEW_LINE>int count = 0;<NEW_LINE>for (EventBean event : events) {<NEW_LINE>updated[count++] = updateHelper.<MASK><NEW_LINE>}<NEW_LINE>EventBean[] deleted = events.toArray(new EventBean[events.size()]);<NEW_LINE>rootViewInstance.update(updated, deleted);<NEW_LINE>return updated;<NEW_LINE>} finally {<NEW_LINE>releaseTableLocks(agentInstanceContext);<NEW_LINE>agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock().releaseReadLock();<NEW_LINE>}<NEW_LINE>} | updateWCopy(event, eventsPerStream, agentInstanceContext); |
1,015,093 | public static void replaceWithAssignment(@NotNull Project project, @NotNull PsiElement element) {<NEW_LINE>if (element instanceof GoShortVarDeclaration) {<NEW_LINE>PsiElement parent = element.getParent();<NEW_LINE>if (parent instanceof GoSimpleStatement) {<NEW_LINE>String left = GoPsiImplUtil.joinPsiElementText(((GoShortVarDeclaration) element).getVarDefinitionList());<NEW_LINE>String right = GoPsiImplUtil.joinPsiElementText(((GoShortVarDeclaration<MASK><NEW_LINE>parent.replace(GoElementFactory.createAssignmentStatement(project, left, right));<NEW_LINE>}<NEW_LINE>} else if (element instanceof GoRangeClause) {<NEW_LINE>String left = GoPsiImplUtil.joinPsiElementText(((GoRangeClause) element).getVarDefinitionList());<NEW_LINE>GoExpression rangeExpression = ((GoRangeClause) element).getRangeExpression();<NEW_LINE>String right = rangeExpression != null ? rangeExpression.getText() : "";<NEW_LINE>element.replace(GoElementFactory.createRangeClauseAssignment(project, left, right));<NEW_LINE>} else if (element instanceof GoRecvStatement) {<NEW_LINE>String left = GoPsiImplUtil.joinPsiElementText(((GoRecvStatement) element).getVarDefinitionList());<NEW_LINE>GoExpression recvExpression = ((GoRecvStatement) element).getRecvExpression();<NEW_LINE>String right = recvExpression != null ? recvExpression.getText() : "";<NEW_LINE>element.replace(GoElementFactory.createRecvStatementAssignment(project, left, right));<NEW_LINE>}<NEW_LINE>} | ) element).getRightExpressionsList()); |
425,249 | private View createButtonWithSwitch(int iconId, @NonNull String title, boolean enabled, boolean showShortDivider, @Nullable OnClickListener listener) {<NEW_LINE>int activeColor = selectedAppMode.getProfileColor(nightMode);<NEW_LINE>int defColor = ColorUtilities.getDefaultIconColor(app, nightMode);<NEW_LINE>int iconColor = enabled ? activeColor : defColor;<NEW_LINE>View view = themedInflater.inflate(R.layout.configure_screen_list_item, null);<NEW_LINE>Drawable icon = getPaintedContentIcon(iconId, iconColor);<NEW_LINE>ImageView ivIcon = view.findViewById(R.id.icon);<NEW_LINE>ivIcon.setImageDrawable(icon);<NEW_LINE>ivIcon.setColorFilter(enabled ? activeColor : defColor);<NEW_LINE>TextView tvTitle = view.findViewById(R.id.title);<NEW_LINE>tvTitle.setText(title);<NEW_LINE>CompoundButton cb = view.findViewById(R.id.compound_button);<NEW_LINE>cb.setChecked(enabled);<NEW_LINE>cb.setVisibility(View.VISIBLE);<NEW_LINE>UiUtilities.setupCompoundButton(nightMode, activeColor, cb);<NEW_LINE>if (showShortDivider) {<NEW_LINE>view.findViewById(R.id.short_divider).setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>cb.setOnCheckedChangeListener((buttonView, isChecked) -> {<NEW_LINE>ivIcon.setColorFilter(isChecked ? activeColor : defColor);<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onClick(buttonView);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setupClickListener(view, v -> {<NEW_LINE>boolean <MASK><NEW_LINE>cb.setChecked(newState);<NEW_LINE>});<NEW_LINE>setupListItemBackground(view);<NEW_LINE>return view;<NEW_LINE>} | newState = !cb.isChecked(); |
1,344,752 | public Builder mergeFrom(cn.wildfirechat.proto.WFCMessage.PullMessageResult other) {<NEW_LINE>if (other == cn.wildfirechat.proto.WFCMessage.PullMessageResult.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (messageBuilder_ == null) {<NEW_LINE>if (!other.message_.isEmpty()) {<NEW_LINE>if (message_.isEmpty()) {<NEW_LINE>message_ = other.message_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureMessageIsMutable();<NEW_LINE>message_.addAll(other.message_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.message_.isEmpty()) {<NEW_LINE>if (messageBuilder_.isEmpty()) {<NEW_LINE>messageBuilder_.dispose();<NEW_LINE>messageBuilder_ = null;<NEW_LINE>message_ = other.message_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>messageBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getMessageFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>messageBuilder_.addAllMessages(other.message_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other.hasCurrent()) {<NEW_LINE>setCurrent(other.getCurrent());<NEW_LINE>}<NEW_LINE>if (other.hasHead()) {<NEW_LINE>setHead(other.getHead());<NEW_LINE>}<NEW_LINE>this.<MASK><NEW_LINE>return this;<NEW_LINE>} | mergeUnknownFields(other.getUnknownFields()); |
1,697,503 | public synchronized void removeObjects(Collection<? extends PathObject> pathObjects, boolean keepChildren) {<NEW_LINE>if (pathObjects.isEmpty())<NEW_LINE>return;<NEW_LINE>List<PathObject> pathObjectSet = new ArrayList<>(pathObjects);<NEW_LINE>pathObjectSet.sort((o1, o2) -> Integer.compare(o2.getLevel(), o1.getLevel()));<NEW_LINE>// Determine the parents for each object<NEW_LINE>Map<PathObject, List<PathObject>> map = new HashMap<>();<NEW_LINE>for (PathObject pathObject : pathObjectSet) {<NEW_LINE>PathObject parent = pathObject.getParent();<NEW_LINE>if (parent == null)<NEW_LINE>continue;<NEW_LINE>List<PathObject> <MASK><NEW_LINE>if (list == null) {<NEW_LINE>list = new ArrayList<>();<NEW_LINE>map.put(parent, list);<NEW_LINE>}<NEW_LINE>list.add(pathObject);<NEW_LINE>}<NEW_LINE>if (map.isEmpty())<NEW_LINE>return;<NEW_LINE>// Loop through and remove objects, keeping children if necessary<NEW_LINE>Set<PathObject> childrenToKeep = new LinkedHashSet<>();<NEW_LINE>for (Entry<PathObject, List<PathObject>> entry : map.entrySet()) {<NEW_LINE>PathObject parent = entry.getKey();<NEW_LINE>List<PathObject> children = entry.getValue();<NEW_LINE>parent.removePathObjects(children);<NEW_LINE>if (keepChildren) {<NEW_LINE>for (PathObject child : children) childrenToKeep.addAll(child.getChildObjects());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>childrenToKeep.removeAll(pathObjects);<NEW_LINE>// Add children back if required (note: this can be quite slow!)<NEW_LINE>tileCache.resetCache();<NEW_LINE>for (PathObject pathObject : childrenToKeep) {<NEW_LINE>addPathObject(pathObject, false);<NEW_LINE>}<NEW_LINE>fireHierarchyChangedEvent(this);<NEW_LINE>// This previously could result in child objects being deleted even if keepChildren was<NEW_LINE>// true, depending upon the order in which objects were removed.<NEW_LINE>// // Loop through and remove objects<NEW_LINE>// for (Entry<PathObject, List<PathObject>> entry : map.entrySet()) {<NEW_LINE>// PathObject parent = entry.getKey();<NEW_LINE>// List<PathObject> children = entry.getValue();<NEW_LINE>// parent.removePathObjects(children);<NEW_LINE>// if (keepChildren) {<NEW_LINE>// for (PathObject child : children) {<NEW_LINE>// if (child.hasChildren()) {<NEW_LINE>// List<PathObject> newChildList = new ArrayList<>(child.getChildObjects());<NEW_LINE>// newChildList.removeAll(pathObjects);<NEW_LINE>// parent.addPathObjects(newChildList);<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// fireHierarchyChangedEvent(this);<NEW_LINE>} | list = map.get(parent); |
624,609 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {<NEW_LINE>// Reset flag used to detect if child view's onMeasure() got called.<NEW_LINE>layout.setWasMeasured(false);<NEW_LINE>// Store this view's new size, minus the padding.<NEW_LINE>// Must be assigned before calling onMeasure() below.<NEW_LINE>layout.setParentContentWidth(MeasureSpec.getSize(widthMeasureSpec) - (getPaddingLeft() + getPaddingRight()));<NEW_LINE>layout.setParentContentHeight(MeasureSpec.getSize(heightMeasureSpec) - (getPaddingTop() + getPaddingBottom()));<NEW_LINE>// If the scroll view container has a fixed size (ie: not using AT_MOST/WRAP_CONTENT),<NEW_LINE>// then set up the scrollable content area to be at least the size of the container.<NEW_LINE>// Note: Allows views to be docked to bottom or right side when using a "composite" layout.<NEW_LINE>boolean hasFixedSize = (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY);<NEW_LINE>layout.setMinimumWidth(hasFixedSize ? layout.getParentContentWidth() : 0);<NEW_LINE>hasFixedSize = (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY);<NEW_LINE>layout.setMinimumHeight(hasFixedSize ? layout.getParentContentHeight() : 0);<NEW_LINE>// Update the size of this view and its children.<NEW_LINE>super.onMeasure(widthMeasureSpec, heightMeasureSpec);<NEW_LINE>// Google's scroll view won't call child's measure() method if content height is less than<NEW_LINE>// the scroll view's height. If it wasn't called, then do so now. (See: TIMOB-8243)<NEW_LINE>if (!layout.wasMeasured() && (getChildCount() > 0)) {<NEW_LINE>final View child = getChildAt(0);<NEW_LINE>int height = getMeasuredHeight();<NEW_LINE>final FrameLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams();<NEW_LINE>int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec, getPaddingLeft() + <MASK><NEW_LINE>height -= getPaddingTop();<NEW_LINE>height -= getPaddingBottom();<NEW_LINE>int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);<NEW_LINE>child.measure(childWidthMeasureSpec, childHeightMeasureSpec);<NEW_LINE>}<NEW_LINE>} | getPaddingRight(), lp.width); |
481,833 | /* Deal with unexpected exception. only used for asyc send*/<NEW_LINE>public void waitForAckForChannel(Channel channel) {<NEW_LINE>if (channel == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.info("wait for ack for channel {}", channel);<NEW_LINE>try {<NEW_LINE>ConcurrentHashMap<String, QueueObject> queueObjMap = callbacks.get(channel);<NEW_LINE>if (queueObjMap != null) {<NEW_LINE>while (true) {<NEW_LINE>if (queueObjMap.isEmpty()) {<NEW_LINE>logger.info("this channel {} is empty!", channel);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>logger.error("wait for ack for channel {}, error {}", <MASK><NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("waitForAckForChannel finished , channel is {}", channel);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.error("waitForAckForChannel exception, channel is {}", channel, e);<NEW_LINE>}<NEW_LINE>} | channel, e.getMessage()); |
425,251 | private static void initProxy() {<NEW_LINE>synchronized (SearchResultsTabArea.class) {<NEW_LINE>if (search_proxy_init_done) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>search_proxy_init_done = true;<NEW_LINE>}<NEW_LINE>new AEThread2("ST_test") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>String test_url = Constants.URL_WEBSEARCH.replaceAll("%s", "derp");<NEW_LINE>try {<NEW_LINE>URL url = new URL(test_url);<NEW_LINE>url = UrlUtils.setProtocol(url, "https");<NEW_LINE>url = UrlUtils.setPort(url, 443);<NEW_LINE>boolean use_proxy = !COConfigurationManager.getStringParameter("browser.internal.proxy.id", "none").equals("none");<NEW_LINE>if (!use_proxy) {<NEW_LINE>Boolean looks_ok = AEProxyFactory.testPluginHTTPProxy(url, true, "Search Proxy");<NEW_LINE>use_proxy = looks_ok != null && !looks_ok;<NEW_LINE>}<NEW_LINE>if (use_proxy) {<NEW_LINE>search_proxy = AEProxyFactory.getPluginHTTPProxy("search", url, true);<NEW_LINE>if (search_proxy != null) {<NEW_LINE>UrlFilter.getInstance().addUrlWhitelist("https?://" + ((InetSocketAddress) search_proxy.getProxy().address()).getAddress().getHostAddress() + ":?[0-9]*/.*");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>List<SearchResultsTabAreaBrowser> to_redo = null;<NEW_LINE>synchronized (SearchResultsTabArea.class) {<NEW_LINE>search_proxy_set = true;<NEW_LINE>to_redo <MASK><NEW_LINE>pending.clear();<NEW_LINE>}<NEW_LINE>search_proxy_sem.releaseForever();<NEW_LINE>for (SearchResultsTabAreaBrowser area : to_redo) {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>area.browserSkinObject.setAutoReloadPending(false, search_proxy == null);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>if (search_proxy != null) {<NEW_LINE>SearchQuery sq = area.sq;<NEW_LINE>if (sq != null) {<NEW_LINE>area.anotherSearch(sq);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>} | = new ArrayList<>(pending); |
56,895 | private void updatePorts(Instance instance) {<NEW_LINE>int dx = 0;<NEW_LINE>int dy = 0;<NEW_LINE>Direction facing = <MASK><NEW_LINE>if (facing == Direction.NORTH) {<NEW_LINE>dy = 1;<NEW_LINE>} else if (facing == Direction.EAST) {<NEW_LINE>dx = -1;<NEW_LINE>} else if (facing == Direction.SOUTH) {<NEW_LINE>dy = -1;<NEW_LINE>} else if (facing == Direction.WEST) {<NEW_LINE>dx = 1;<NEW_LINE>}<NEW_LINE>Object powerLoc = instance.getAttributeValue(StdAttr.SELECT_LOC);<NEW_LINE>boolean flip = (facing == Direction.NORTH || facing == Direction.WEST) == (powerLoc == StdAttr.SELECT_TOP_RIGHT);<NEW_LINE>Port[] ports = new Port[4];<NEW_LINE>ports[OUTPUT] = new Port(0, 0, Port.OUTPUT, StdAttr.WIDTH);<NEW_LINE>ports[INPUT] = new Port(40 * dx, 40 * dy, Port.INPUT, StdAttr.WIDTH);<NEW_LINE>if (flip) {<NEW_LINE>ports[GATE1] = new Port(20 * (dx - dy), 20 * (dx + dy), Port.INPUT, 1);<NEW_LINE>ports[GATE0] = new Port(20 * (dx + dy), 20 * (-dx + dy), Port.INPUT, 1);<NEW_LINE>} else {<NEW_LINE>ports[GATE0] = new Port(20 * (dx - dy), 20 * (dx + dy), Port.INPUT, 1);<NEW_LINE>ports[GATE1] = new Port(20 * (dx + dy), 20 * (-dx + dy), Port.INPUT, 1);<NEW_LINE>}<NEW_LINE>ports[INPUT].setToolTip(S.getter("transmissionGateSource"));<NEW_LINE>ports[OUTPUT].setToolTip(S.getter("transmissionGateDrain"));<NEW_LINE>ports[GATE0].setToolTip(S.getter("transmissionGatePGate"));<NEW_LINE>ports[GATE1].setToolTip(S.getter("transmissionGateNGate"));<NEW_LINE>instance.setPorts(ports);<NEW_LINE>} | instance.getAttributeValue(StdAttr.FACING); |
1,773,901 | public JSDynamicObject execute(IteratorRecord iteratorRecord, JSDynamicObject constructor, PromiseCapabilityRecord resultCapability, Object promiseResolve) {<NEW_LINE>assert JSRuntime.isConstructor(constructor);<NEW_LINE>assert JSRuntime.isCallable(promiseResolve);<NEW_LINE>SimpleArrayList<Object> errors = new SimpleArrayList<>(10);<NEW_LINE>BoxedInt remainingElementsCount = new BoxedInt(1);<NEW_LINE>for (int index = 0; ; index++) {<NEW_LINE>Object next = iteratorStepOrSetDone(iteratorRecord);<NEW_LINE>if (next == Boolean.FALSE) {<NEW_LINE>iteratorRecord.setDone(true);<NEW_LINE>remainingElementsCount.value--;<NEW_LINE>if (remainingElementsCount.value == 0) {<NEW_LINE>JSDynamicObject errorsArray = JSArray.createConstantObjectArray(context, getRealm(), errors.toArray());<NEW_LINE>throw Errors.createAggregateError(errorsArray, this);<NEW_LINE>}<NEW_LINE>return resultCapability.getPromise();<NEW_LINE>}<NEW_LINE>Object nextValue = iteratorValueOrSetDone(iteratorRecord, next);<NEW_LINE>errors.add(Undefined.instance, growProfile);<NEW_LINE>Object nextPromise = callResolve.executeCall(JSArguments.createOneArg(constructor, promiseResolve, nextValue));<NEW_LINE>Object resolveElement = createResolveElementFunction(<MASK><NEW_LINE>JSFunctionObject rejectElement = createRejectElementFunction(index, errors, resultCapability, remainingElementsCount);<NEW_LINE>remainingElementsCount.value++;<NEW_LINE>callThen.executeCall(JSArguments.create(nextPromise, getThen.getValue(nextPromise), resolveElement, rejectElement));<NEW_LINE>}<NEW_LINE>} | index, errors, resultCapability, remainingElementsCount); |
485,731 | private void runAssertion(RegressionEnvironment env, AtomicInteger milestone, boolean advanced, String filter) {<NEW_LINE>String epl = "create context MyContext start SupportBean_S0 as s0 end SupportBean_S1;\n" + HOOK + "@name('s0') context MyContext select * from SupportBean(" + filter + ");\n";<NEW_LINE>SupportFilterPlanHook.reset();<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>if (advanced) {<NEW_LINE>assertPlanSingle(new SupportFilterPlan(null, "context.s0.p00=\"x\"", makePathsFromSingle("theString", EQUAL, "abc")));<NEW_LINE>}<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "x"));<NEW_LINE>if (advanced) {<NEW_LINE>assertFilterSvcSingle(env, "s0", "theString", EQUAL);<NEW_LINE>}<NEW_LINE>sendSBAssert(env, "abc", true);<NEW_LINE>sendSBAssert(env, "def", false);<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>if (advanced) {<NEW_LINE>assertFilterSvcSingle(env, "s0", "theString", EQUAL);<NEW_LINE>}<NEW_LINE>sendSBAssert(env, "abc", true);<NEW_LINE>sendSBAssert(env, "def", false);<NEW_LINE>env.sendEventBean(new SupportBean_S1(1));<NEW_LINE>if (advanced) {<NEW_LINE>assertFilterSvcNone(env, "s0", "SupportBean");<NEW_LINE>}<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "-"));<NEW_LINE>if (advanced) {<NEW_LINE>assertFilterSvcNone(env, "s0", "SupportBean");<NEW_LINE>}<NEW_LINE>sendSBAssert(env, "abc", false);<NEW_LINE>sendSBAssert(env, "def", false);<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>if (advanced) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>sendSBAssert(env, "abc", false);<NEW_LINE>sendSBAssert(env, "def", false);<NEW_LINE>env.undeployAll();<NEW_LINE>} | assertFilterSvcNone(env, "s0", "SupportBean"); |
1,681,568 | ActionResult<WrapOutId> execute(String appDictFlag, String appInfoFlag, String path0, String path1, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<WrapOutId> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>AppInfo appInfo = business.<MASK><NEW_LINE>if (null == appInfo) {<NEW_LINE>throw new ExceptionAppInfoNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>String id = business.getAppDictFactory().getWithAppInfoWithUniqueName(appInfo.getId(), appDictFlag);<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new ExceptionAppDictNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>AppDict dict = emc.find(id, AppDict.class);<NEW_LINE>this.update(business, dict, jsonElement, path0, path1);<NEW_LINE>emc.commit();<NEW_LINE>WrapOutId wrap = new WrapOutId(dict.getId());<NEW_LINE>result.setData(wrap);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | getAppInfoFactory().pick(appInfoFlag); |
958,857 | private static void performAdds(SvnClient client, SvnProgressSupport support, List<SvnFileNode> addCandidates) throws SVNClientException {<NEW_LINE>List<File> addFiles <MASK><NEW_LINE>List<File> addDirs = new ArrayList<File>();<NEW_LINE>// XXX waht if user denied directory add but wants to add a file in it?<NEW_LINE>Iterator<SvnFileNode> it = addCandidates.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>if (support.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SvnFileNode svnFileNode = it.next();<NEW_LINE>File file = svnFileNode.getFile();<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>addDirs.add(file);<NEW_LINE>} else if (file.isFile()) {<NEW_LINE>addFiles.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (support.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Iterator<File> itFiles = addDirs.iterator();<NEW_LINE>List<File> dirsToAdd = new ArrayList<File>();<NEW_LINE>while (itFiles.hasNext()) {<NEW_LINE>File dir = itFiles.next();<NEW_LINE>if (!dirsToAdd.contains(dir)) {<NEW_LINE>dirsToAdd.add(dir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dirsToAdd.size() > 0) {<NEW_LINE>for (File file : dirsToAdd) {<NEW_LINE>client.addDirectory(file, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (support.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (addFiles.size() > 0) {<NEW_LINE>for (File file : addFiles) {<NEW_LINE>client.addFile(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new ArrayList<File>(); |
1,228,170 | public boolean invoke(final String tableName, final Object[] ids, final IContextAware ctx) {<NEW_LINE>// do some basic checking<NEW_LINE>if (Check.isEmpty(tableName, true)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (ids == null || ids.length != 1 || ids[0] == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!(ids[0] instanceof Integer)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final Mutable<Boolean> unArchiveWorked = new Mutable<>(false);<NEW_LINE>// attempt to load the record<NEW_LINE>final IConnectionCustomizerService connectionCustomizerService = Services.get(IConnectionCustomizerService.class);<NEW_LINE>try (final AutoCloseable customizer = connectionCustomizerService.registerTemporaryCustomizer(DLMConnectionCustomizer.seeThemAllCustomizer())) {<NEW_LINE>Services.get(ITrxManager.class).runInNewTrx(new TrxRunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(final String localTrxName) throws Exception {<NEW_LINE>final PlainContextAware localCtx = PlainContextAware.newWithTrxName(ctx.getCtx(), localTrxName);<NEW_LINE>final TableRecordReference reference = TableRecordReference.of(tableName, (int) ids[0]);<NEW_LINE>final IDLMAware model = reference.getModel(localCtx, IDLMAware.class);<NEW_LINE>if (model == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (model.getDLM_Level() == IMigratorService.DLM_Level_LIVE) {<NEW_LINE>logger.info("The record could be loaded, but already had DLM_Level={}; returning false; reference={}; ", IMigratorService.DLM_Level_LIVE, reference);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.info("Setting DLM_Level to {} for {}", IMigratorService.DLM_Level_LIVE, reference);<NEW_LINE>model.setDLM_Level(IMigratorService.DLM_Level_LIVE);<NEW_LINE>InterfaceWrapperHelper.save(model);<NEW_LINE>unArchiveWorked.setValue(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return unArchiveWorked.getValue();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw AdempiereException.wrapIfNeeded(e);<NEW_LINE>}<NEW_LINE>} | logger.info("Unable to load record for reference={}; returning false.", reference); |
428,016 | final DeleteLoginProfileResult executeDeleteLoginProfile(DeleteLoginProfileRequest deleteLoginProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLoginProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLoginProfileRequest> request = null;<NEW_LINE>Response<DeleteLoginProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLoginProfileRequestMarshaller().marshall(super.beforeMarshalling(deleteLoginProfileRequest));<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, "IAM");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteLoginProfileResult> responseHandler = new StaxResponseHandler<DeleteLoginProfileResult>(new DeleteLoginProfileResultStaxUnmarshaller());<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.OPERATION_NAME, "DeleteLoginProfile"); |
1,458,067 | private void performCodeGen() {<NEW_LINE>if (codeGenCompleted) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Diagnostic> diagnostics = new ArrayList<>();<NEW_LINE>// add package resolution diagnostics<NEW_LINE>diagnostics.addAll(this.packageContext.getResolution().diagnosticResult().allDiagnostics);<NEW_LINE>// add ballerina toml diagnostics<NEW_LINE>diagnostics.addAll(this.packageContext.packageManifest().diagnostics().diagnostics());<NEW_LINE>// collect compilation diagnostics<NEW_LINE>List<Diagnostic> <MASK><NEW_LINE>for (ModuleContext moduleContext : pkgResolution.topologicallySortedModuleList()) {<NEW_LINE>// If modules from the current package are being processed<NEW_LINE>// we do an overall check on the diagnostics of the package<NEW_LINE>if (moduleContext.moduleId().packageId().equals(packageContext.packageId())) {<NEW_LINE>if (packageCompilation.diagnosticResult().hasErrors()) {<NEW_LINE>moduleDiagnostics.addAll(packageCompilation.diagnosticResult().diagnostics());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// We can't generate backend code when one of its dependencies have errors.<NEW_LINE>if (hasNoErrors(moduleDiagnostics)) {<NEW_LINE>moduleContext.generatePlatformSpecificCode(compilerContext, this);<NEW_LINE>}<NEW_LINE>for (Diagnostic diagnostic : moduleContext.diagnostics()) {<NEW_LINE>moduleDiagnostics.add(new PackageDiagnostic(diagnostic, moduleContext.descriptor(), moduleContext.project()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add compilation diagnostics<NEW_LINE>diagnostics.addAll(moduleDiagnostics);<NEW_LINE>// add plugin diagnostics<NEW_LINE>diagnostics.addAll(this.packageContext.getPackageCompilation().pluginDiagnostics());<NEW_LINE>diagnostics = diagnostics.stream().distinct().collect(Collectors.toList());<NEW_LINE>this.diagnosticResult = new DefaultDiagnosticResult(diagnostics);<NEW_LINE>codeGenCompleted = true;<NEW_LINE>} | moduleDiagnostics = new ArrayList<>(); |
828,607 | private ContainerRequest createContainerRequest(ChannelHandlerContext ctx, HttpRequest req) {<NEW_LINE>String s = req.uri().startsWith("/") ? req.uri().substring(<MASK><NEW_LINE>URI requestUri = URI.create(baseUri + ContainerUtils.encodeUnsafeCharacters(s));<NEW_LINE>ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri, req.method().name(), getSecurityContext(ctx), new PropertiesDelegate() {<NEW_LINE><NEW_LINE>private final Map<String, Object> properties = new HashMap<>();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getProperty(String name) {<NEW_LINE>return properties.get(name);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Collection<String> getPropertyNames() {<NEW_LINE>return properties.keySet();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setProperty(String name, Object object) {<NEW_LINE>properties.put(name, object);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void removeProperty(String name) {<NEW_LINE>properties.remove(name);<NEW_LINE>}<NEW_LINE>}, resourceConfig);<NEW_LINE>return requestContext;<NEW_LINE>} | 1) : req.uri(); |
1,599,127 | public List<ReportReloadEntity> loadReport(long time) {<NEW_LINE>List<ReportReloadEntity> results = new ArrayList<ReportReloadEntity>();<NEW_LINE>Map<String, List<TransactionReport>> mergedReports = new HashMap<String, List<TransactionReport>>();<NEW_LINE>for (int i = 0; i < getAnalyzerCount(); i++) {<NEW_LINE>Map<String, TransactionReport> reports = m_reportManager.loadLocalReports(time, i);<NEW_LINE>for (Entry<String, TransactionReport> entry : reports.entrySet()) {<NEW_LINE>String domain = entry.getKey();<NEW_LINE><MASK><NEW_LINE>List<TransactionReport> rs = mergedReports.get(domain);<NEW_LINE>if (rs == null) {<NEW_LINE>rs = new ArrayList<TransactionReport>();<NEW_LINE>mergedReports.put(domain, rs);<NEW_LINE>}<NEW_LINE>rs.add(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<TransactionReport> reports = buildMergedReports(mergedReports);<NEW_LINE>for (TransactionReport r : reports) {<NEW_LINE>HourlyReport report = new HourlyReport();<NEW_LINE>report.setCreationDate(new Date());<NEW_LINE>report.setDomain(r.getDomain());<NEW_LINE>report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());<NEW_LINE>report.setName(getId());<NEW_LINE>report.setPeriod(new Date(time));<NEW_LINE>report.setType(1);<NEW_LINE>byte[] content = DefaultNativeBuilder.build(r);<NEW_LINE>ReportReloadEntity entity = new ReportReloadEntity(report, content);<NEW_LINE>results.add(entity);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | TransactionReport r = entry.getValue(); |
117,405 | private List<URL> createArtificialBinaries(FileObject[] fos) {<NEW_LINE>assert Thread.holdsLock(this);<NEW_LINE>final List<URL> res = new ArrayList<>(fos.length);<NEW_LINE>File artBinaries = null;<NEW_LINE>MessageDigest md5 = null;<NEW_LINE>try {<NEW_LINE>for (FileObject fo : fos) {<NEW_LINE>final <MASK><NEW_LINE>URL bin = artificalBinariesCache.get(srcURI);<NEW_LINE>if (bin == null) {<NEW_LINE>if (artBinaries == null) {<NEW_LINE>final File projectFolder = FileUtil.toFile(helper.getProjectDirectory());<NEW_LINE>// NOI18N<NEW_LINE>artBinaries = new File(projectFolder, CACHE_FREEFORM_ARTIFICAL_BIN.replace('/', File.separatorChar));<NEW_LINE>// NOI18N<NEW_LINE>md5 = MessageDigest.getInstance("MD5");<NEW_LINE>} else {<NEW_LINE>md5.reset();<NEW_LINE>}<NEW_LINE>final String digest = str(md5.digest(srcURI.toString().getBytes(StandardCharsets.UTF_8)));<NEW_LINE>final File binFile = new File(artBinaries, digest);<NEW_LINE>bin = FileUtil.urlForArchiveOrDir(binFile);<NEW_LINE>artificalBinariesCache.put(srcURI, bin);<NEW_LINE>}<NEW_LINE>res.add(bin);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | URI srcURI = fo.toURI(); |
751,920 | public BasicOpenSessionResp openSession(String username, String password, String zoneId, TSProtocolVersion tsProtocolVersion, IoTDBConstant.ClientVersion clientVersion) throws TException {<NEW_LINE>BasicOpenSessionResp openSessionResp = new BasicOpenSessionResp();<NEW_LINE>boolean status;<NEW_LINE>IAuthorizer authorizer;<NEW_LINE>try {<NEW_LINE>authorizer = BasicAuthorizer.getInstance();<NEW_LINE>} catch (AuthException e) {<NEW_LINE>throw new TException(e);<NEW_LINE>}<NEW_LINE>String loginMessage = null;<NEW_LINE>try {<NEW_LINE>status = authorizer.login(username, password);<NEW_LINE>} catch (AuthException e) {<NEW_LINE>LOGGER.info("meet error while logging in.", e);<NEW_LINE>status = false;<NEW_LINE>loginMessage = e.getMessage();<NEW_LINE>}<NEW_LINE>long sessionId = -1;<NEW_LINE>if (status) {<NEW_LINE>// check the version compatibility<NEW_LINE>boolean compatible = tsProtocolVersion.equals(CURRENT_RPC_VERSION);<NEW_LINE>if (!compatible) {<NEW_LINE>openSessionResp.setCode(<MASK><NEW_LINE>openSessionResp.setMessage("The version is incompatible, please upgrade to " + IoTDBConstant.VERSION);<NEW_LINE>return openSessionResp.sessionId(sessionId);<NEW_LINE>}<NEW_LINE>openSessionResp.setCode(TSStatusCode.SUCCESS_STATUS.getStatusCode());<NEW_LINE>openSessionResp.setMessage("Login successfully");<NEW_LINE>sessionId = requestSessionId(username, zoneId, clientVersion);<NEW_LINE>LOGGER.info("{}: Login status: {}. User : {}, opens Session-{}", IoTDBConstant.GLOBAL_DB_NAME, openSessionResp.getMessage(), username, sessionId);<NEW_LINE>} else {<NEW_LINE>openSessionResp.setMessage(loginMessage != null ? loginMessage : "Authentication failed.");<NEW_LINE>openSessionResp.setCode(TSStatusCode.WRONG_LOGIN_PASSWORD_ERROR.getStatusCode());<NEW_LINE>sessionId = requestSessionId(username, zoneId, clientVersion);<NEW_LINE>AUDIT_LOGGER.info("User {} opens Session failed with an incorrect password", username);<NEW_LINE>}<NEW_LINE>SessionTimeoutManager.getInstance().register(sessionId);<NEW_LINE>return openSessionResp.sessionId(sessionId);<NEW_LINE>} | TSStatusCode.INCOMPATIBLE_VERSION.getStatusCode()); |
1,854,449 | final GetBlacklistReportsResult executeGetBlacklistReports(GetBlacklistReportsRequest getBlacklistReportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBlacklistReportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBlacklistReportsRequest> request = null;<NEW_LINE>Response<GetBlacklistReportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBlacklistReportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBlacklistReportsRequest));<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, "Pinpoint Email");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBlacklistReports");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBlacklistReportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBlacklistReportsResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig); |
97,756 | public void run() {<NEW_LINE>log.info("Starting cluster monitor thread " + getName());<NEW_LINE>// Pings must happen in a separate thread from this to handle timeouts<NEW_LINE>// By using a cached thread pool we ensured that 1) a single thread will be used<NEW_LINE>// for all pings when there are no problems (important because it ensures that<NEW_LINE>// any thread local connections are reused) 2) a new thread will be started to execute<NEW_LINE>// new pings when a ping is not responding<NEW_LINE>ExecutorService pingExecutor = Executors.newCachedThreadPool(ThreadFactoryFactory.getDaemonThreadFactory("search.ping"));<NEW_LINE>while (!closed.get()) {<NEW_LINE>try {<NEW_LINE>log.finest("Activating ping");<NEW_LINE>ping(pingExecutor);<NEW_LINE>synchronized (nodeManager) {<NEW_LINE>nodeManager.wait(configuration.getCheckInterval());<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (closed.get() && e instanceof InterruptedException) {<NEW_LINE>break;<NEW_LINE>} else if (!(e instanceof Exception)) {<NEW_LINE>log.log(Level.WARNING, "Error in monitor thread, will quit", e);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>log.log(Level.WARNING, "Exception in monitor thread", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pingExecutor.shutdown();<NEW_LINE>try {<NEW_LINE>pingExecutor.awaitTermination(10, TimeUnit.SECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>log.<MASK><NEW_LINE>} | info("Stopped cluster monitor thread " + getName()); |
1,746,720 | final DeleteLoggingConfigurationResult executeDeleteLoggingConfiguration(DeleteLoggingConfigurationRequest deleteLoggingConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLoggingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLoggingConfigurationRequest> request = null;<NEW_LINE>Response<DeleteLoggingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLoggingConfigurationRequestProtocolMarshaller(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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLoggingConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLoggingConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLoggingConfigurationResultJsonUnmarshaller());<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(deleteLoggingConfigurationRequest)); |
1,560,409 | public void printGraph() {<NEW_LINE>int count = 0;<NEW_LINE>for (Vertex<N> v : getVertices()) {<NEW_LINE>Logger.log(1, count + ") vertex = " + v + " (" + v.getX() + ", " + <MASK><NEW_LINE>count++;<NEW_LINE>// out going edges<NEW_LINE>N node = v.getNodeDesignElement();<NEW_LINE>if (node == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// if the vertex is a dummy, there is no<NEW_LINE>// node associated with it.<NEW_LINE>Collection<E> nodeEdges = uGraph.findNodeEdges(node, true, false);<NEW_LINE>Logger.log(1, "\toutgoing edges:");<NEW_LINE>for (E edge : nodeEdges) {<NEW_LINE>Logger.log(1, "\t\t" + edge);<NEW_LINE>}<NEW_LINE>nodeEdges = uGraph.findNodeEdges(node, false, true);<NEW_LINE>Logger.log(1, "\tincoming edges:");<NEW_LINE>for (E edge : nodeEdges) {<NEW_LINE>Logger.log(1, "\t\t" + edge);<NEW_LINE>}<NEW_LINE>Logger.log(1, "\tneighbors:");<NEW_LINE>Collection<Vertex<?>> neighbors = v.getNeighbors();<NEW_LINE>for (Vertex<?> nv : neighbors) {<NEW_LINE>Logger.log(1, "\t\t" + nv);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Logger.log(1, "------------------\n------------------");<NEW_LINE>count = 0;<NEW_LINE>for (Edge<E> e : getEdges()) {<NEW_LINE>Logger.log(1, count + ") edge = " + e);<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>} | v.getY() + ")"); |
1,089,981 | private void convertFile(FileChannel fc) throws IOException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "Converting FileChannel to buffers");<NEW_LINE>}<NEW_LINE>final WsByteBuffer[] body = new WsByteBuffer[1];<NEW_LINE>final <MASK><NEW_LINE>final long max = fc.size();<NEW_LINE>final long blocksize = (1048576L < max) ? 1048576L : max;<NEW_LINE>long offset = 0;<NEW_LINE>while (offset < max) {<NEW_LINE>ByteBuffer bb = fc.map(MapMode.READ_ONLY, offset, blocksize);<NEW_LINE>offset += blocksize;<NEW_LINE>WsByteBuffer wsbb = mgr.wrap(bb);<NEW_LINE>body[0] = wsbb;<NEW_LINE>try {<NEW_LINE>this.isc.sendResponseBody(body);<NEW_LINE>} catch (MessageSentException mse) {<NEW_LINE>FFDCFilter.processException(mse, getClass().getName(), "convertFile", new Object[] { this, this.isc });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "Invalid state, message-sent-exception received; " + this.isc);<NEW_LINE>}<NEW_LINE>this.error = new IOException("Invalid state");<NEW_LINE>throw this.error;<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// no FFDC required<NEW_LINE>this.error = ioe;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Received exception during write: " + ioe);<NEW_LINE>}<NEW_LINE>throw ioe;<NEW_LINE>} finally {<NEW_LINE>wsbb.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// end-while<NEW_LINE>} | WsByteBufferPoolManager mgr = HttpDispatcher.getBufferManager(); |
1,431,731 | protected void internalReceiveCommand(String itemName, Command command) {<NEW_LINE>logger.debug("internalReceiveCommand() is called!");<NEW_LINE>EnergenieBindingConfig deviceConfig = getConfigForItemName(itemName);<NEW_LINE>if (deviceConfig == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String pmsId = deviceConfig.getDeviceId();<NEW_LINE>int pmsSocketId = Integer.<MASK><NEW_LINE>sendLogin(pmsId);<NEW_LINE>if (OnOffType.ON.equals(command)) {<NEW_LINE>sendOn(pmsId, pmsSocketId);<NEW_LINE>} else if (OnOffType.OFF.equals(command)) {<NEW_LINE>sendOff(pmsId, pmsSocketId);<NEW_LINE>}<NEW_LINE>sendLogOut(pmsId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("energenie: failed to send {} command", command, e);<NEW_LINE>}<NEW_LINE>} | parseInt(deviceConfig.getItemConfig()); |
1,587,972 | public void errorResponse(byte[] data, @NotNull AbstractService service) {<NEW_LINE>TraceManager.TraceObject traceObject = TraceManager.serviceTrace(service, "get-sql-execute-error");<NEW_LINE>TraceManager.finishSpan(service, traceObject);<NEW_LINE>pauseTime((MySQLResponseService) service);<NEW_LINE>ErrorPacket errPacket = new ErrorPacket();<NEW_LINE>errPacket.read(data);<NEW_LINE>session.resetMultiStatementStatus();<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>RouteResultsetNode rrn = (RouteResultsetNode) ((MySQLResponseService) service).getAttachment();<NEW_LINE>dnSet.add(rrn.getName());<NEW_LINE>removeNode(rrn.getName());<NEW_LINE>rrn.setLoadDataRrnStatus((byte) 1);<NEW_LINE>if (!isFail()) {<NEW_LINE>err = errPacket;<NEW_LINE>setFail(new String(err.getMessage()));<NEW_LINE>}<NEW_LINE>if (errConnection == null) {<NEW_LINE>errConnection = new ArrayList<>();<NEW_LINE>}<NEW_LINE>errConnection.add((MySQLResponseService) service);<NEW_LINE>if (decrementToZero((MySQLResponseService) service)) {<NEW_LINE>if (session.closed()) {<NEW_LINE>cleanBuffer();<NEW_LINE>} else if (byteBuffer != null) {<NEW_LINE>session.getShardingService().writeDirectly(byteBuffer, WriteFlags.PART);<NEW_LINE>}<NEW_LINE>// just for normal error<NEW_LINE>ErrorPacket errorPacket = createErrPkg(this.error, err.getErrNo());<NEW_LINE>handleEndPacket(<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>} | errorPacket, AutoTxOperation.ROLLBACK, false); |
1,150,963 | public static void down(GrayS8 input, GrayI8 output) {<NEW_LINE>int maxY = input<MASK><NEW_LINE>int maxX = input.width - input.width % 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output.stride;<NEW_LINE>int indexIn0 = input.startIndex + y * input.stride;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>int total = input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn1++];<NEW_LINE>total += input.data[indexIn1++];<NEW_LINE>output.data[indexOut++] = (byte) ((total + 2) / 4);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>if (maxX != input.width) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output.stride + output.width - 1;<NEW_LINE>int indexIn0 = input.startIndex + y * input.stride + maxX;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>int total = input.data[indexIn0];<NEW_LINE>total += input.data[indexIn1];<NEW_LINE>output.data[indexOut] = (byte) ((total + 1) / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxY != input.height) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxX, 2, x -> {<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + x / 2;<NEW_LINE>int indexIn0 = input.startIndex + (input.height - 1) * input.stride + x;<NEW_LINE>int total = input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn0++];<NEW_LINE>output.data[indexOut++] = (byte) ((total + 1) / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxX != input.width && maxY != input.height) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + output.width - 1;<NEW_LINE>int indexIn = input.startIndex + (input.height - 1) * input.stride + input.width - 1;<NEW_LINE>output.data[indexOut] = input.data[indexIn];<NEW_LINE>}<NEW_LINE>} | .height - input.height % 2; |
378,340 | public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, Object localPayload, String businessKey, CommandContext commandContext) {<NEW_LINE>eventSubscription.delete();<NEW_LINE><MASK><NEW_LINE>ensureNotNull("Compensating execution not set for compensate event subscription with id " + eventSubscription.getId(), "configuration", configuration);<NEW_LINE>ExecutionEntity compensatingExecution = commandContext.getExecutionManager().findExecutionById(configuration);<NEW_LINE>ActivityImpl compensationHandler = eventSubscription.getActivity();<NEW_LINE>// activate execution<NEW_LINE>compensatingExecution.setActive(true);<NEW_LINE>if (compensatingExecution.getActivity().getActivityBehavior() instanceof CompositeActivityBehavior) {<NEW_LINE>compensatingExecution.getParent().setActivityInstanceId(compensatingExecution.getActivityInstanceId());<NEW_LINE>}<NEW_LINE>if (compensationHandler.isScope() && !compensationHandler.isCompensationHandler()) {<NEW_LINE>// descend into scope:<NEW_LINE>List<EventSubscriptionEntity> eventsForThisScope = compensatingExecution.getCompensateEventSubscriptions();<NEW_LINE>CompensationUtil.throwCompensationEvent(eventsForThisScope, compensatingExecution, false);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>if (compensationHandler.isSubProcessScope() && compensationHandler.isTriggeredByEvent()) {<NEW_LINE>compensatingExecution.executeActivity(compensationHandler);<NEW_LINE>} else {<NEW_LINE>// since we already have a scope execution, we don't need to create another one<NEW_LINE>// for a simple scoped compensation handler<NEW_LINE>compensatingExecution.setActivity(compensationHandler);<NEW_LINE>compensatingExecution.performOperation(PvmAtomicOperation.ACTIVITY_START);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ProcessEngineException("Error while handling compensation event " + eventSubscription, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String configuration = eventSubscription.getConfiguration(); |
678,506 | private CouchDBQueryInterpreter onAggregatedQuery(EntityMetadata m, CouchDBQueryInterpreter interpreter, KunderaQuery kunderaQuery) {<NEW_LINE>interpreter.setAggregation(true);<NEW_LINE>SelectStatement selectStatement = kunderaQuery.getSelectStatement();<NEW_LINE>Expression whereClause = selectStatement.getWhereClause();<NEW_LINE>if (!NullExpression.class.isAssignableFrom(whereClause.getClass())) {<NEW_LINE>throw new KunderaException("Aggregations with where clause are yet not supported in CouchDB");<NEW_LINE>}<NEW_LINE>SelectClause selectClause = (SelectClause) selectStatement.getSelectClause();<NEW_LINE>Expression expression = selectClause.getSelectExpression();<NEW_LINE>if (CountFunction.class.isAssignableFrom(expression.getClass())) {<NEW_LINE><MASK><NEW_LINE>Expression exp = ((CountFunction) expression).getExpression();<NEW_LINE>setAggregationColInInterpreter(m, interpreter, exp);<NEW_LINE>} else if (MinFunction.class.isAssignableFrom(expression.getClass())) {<NEW_LINE>interpreter.setAggregationType(CouchDBConstants.MIN);<NEW_LINE>Expression exp = ((MinFunction) expression).getExpression();<NEW_LINE>setAggregationColInInterpreter(m, interpreter, exp);<NEW_LINE>} else if (MaxFunction.class.isAssignableFrom(expression.getClass())) {<NEW_LINE>interpreter.setAggregationType(CouchDBConstants.MAX);<NEW_LINE>Expression exp = ((MaxFunction) expression).getExpression();<NEW_LINE>setAggregationColInInterpreter(m, interpreter, exp);<NEW_LINE>} else if (AvgFunction.class.isAssignableFrom(expression.getClass())) {<NEW_LINE>interpreter.setAggregationType(CouchDBConstants.AVG);<NEW_LINE>Expression exp = ((AvgFunction) expression).getExpression();<NEW_LINE>setAggregationColInInterpreter(m, interpreter, exp);<NEW_LINE>} else if (SumFunction.class.isAssignableFrom(expression.getClass())) {<NEW_LINE>interpreter.setAggregationType(CouchDBConstants.SUM);<NEW_LINE>Expression exp = ((SumFunction) expression).getExpression();<NEW_LINE>setAggregationColInInterpreter(m, interpreter, exp);<NEW_LINE>} else {<NEW_LINE>throw new KunderaException("This query is currently not supported in CouchDB");<NEW_LINE>}<NEW_LINE>return interpreter;<NEW_LINE>} | interpreter.setAggregationType(CouchDBConstants.COUNT); |
532,215 | final ListDatasetImportJobsResult executeListDatasetImportJobs(ListDatasetImportJobsRequest listDatasetImportJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDatasetImportJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDatasetImportJobsRequest> request = null;<NEW_LINE>Response<ListDatasetImportJobsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListDatasetImportJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDatasetImportJobsRequest));<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, "Personalize");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDatasetImportJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDatasetImportJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDatasetImportJobsResultJsonUnmarshaller());<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); |
28,779 | public void handleOutbound(Context ctx) throws ServletException, IOException {<NEW_LINE>Model model = new Model(ctx);<NEW_LINE>Payload payload = ctx.getPayload();<NEW_LINE>Action action = payload.getAction();<NEW_LINE>switch(action) {<NEW_LINE>case DOMAINS:<NEW_LINE>JsonBuilder jb = new JsonBuilder();<NEW_LINE>Set<String> domains = m_projectService.findAllDomains();<NEW_LINE>Map<String, Object> jsons = new HashMap<String, Object>();<NEW_LINE>jsons.put("domains", domains);<NEW_LINE>model.setContent(jb.toJson(jsons));<NEW_LINE>break;<NEW_LINE>case PROJECT_UPDATE:<NEW_LINE>try {<NEW_LINE>Project project = payload.getProject();<NEW_LINE>if (project.getDomain() == null) {<NEW_LINE>project.setDomain(Constants.CAT);<NEW_LINE>}<NEW_LINE>Project temp = m_projectService.findByDomain(project.getDomain());<NEW_LINE>if (temp == null) {<NEW_LINE>m_projectService.insert(project);<NEW_LINE>} else {<NEW_LINE>m_projectService.update(project);<NEW_LINE>}<NEW_LINE>model.setContent(UpdateStatus.SUCCESS.getStatusJson());<NEW_LINE>} catch (Exception e) {<NEW_LINE>model.setContent(UpdateStatus.INTERNAL_ERROR.getStatusJson());<NEW_LINE>Cat.logError(e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>model.setAction(action);<NEW_LINE>model.setPage(SystemPage.PROJECT);<NEW_LINE>if (!ctx.isProcessStopped()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | m_jspViewer.view(ctx, model); |
1,789,256 | private Concrete.@Nullable Pattern translateNumberPatterns(Concrete.NumberPattern pattern, @NotNull Expression typeExpr) {<NEW_LINE>if (myVisitor == null) {<NEW_LINE>return DesugarVisitor.desugarNumberPattern(pattern, myErrorReporter);<NEW_LINE>}<NEW_LINE>var ext = myVisitor.getExtension();<NEW_LINE>if (ext == null) {<NEW_LINE>return DesugarVisitor.desugarNumberPattern(pattern, myErrorReporter);<NEW_LINE>}<NEW_LINE>var checker = ext.getLiteralTypechecker();<NEW_LINE>if (checker == null) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>int numberOfErrors = myVisitor.getNumberOfErrors();<NEW_LINE>ConcretePattern result = checker.desugarNumberPattern(pattern, myVisitor, new PatternContextDataImpl(typeExpr, pattern));<NEW_LINE>if (result == null && myVisitor.getNumberOfErrors() == numberOfErrors) {<NEW_LINE>myErrorReporter.report(new TypecheckingError("Cannot typecheck pattern", pattern));<NEW_LINE>}<NEW_LINE>if (result != null && !(result instanceof Concrete.Pattern)) {<NEW_LINE>throw new IllegalStateException("ConcretePattern must be created with ConcreteFactory");<NEW_LINE>}<NEW_LINE>if (result instanceof Concrete.NumberPattern) {<NEW_LINE>throw new IllegalStateException("desugarNumberPattern should not return ConcreteNumberPattern");<NEW_LINE>}<NEW_LINE>return (Concrete.Pattern) result;<NEW_LINE>} | DesugarVisitor.desugarNumberPattern(pattern, myErrorReporter); |
822,844 | public static ItemStack create(Type type, OrientedContraptionEntity entity) {<NEW_LINE>ItemStack stack = ItemStack.EMPTY;<NEW_LINE>switch(type) {<NEW_LINE>case RIDEABLE:<NEW_LINE>stack = AllItems.MINECART_CONTRAPTION.asStack();<NEW_LINE>break;<NEW_LINE>case FURNACE:<NEW_LINE>stack = AllItems.FURNACE_MINECART_CONTRAPTION.asStack();<NEW_LINE>break;<NEW_LINE>case CHEST:<NEW_LINE>stack = AllItems.CHEST_MINECART_CONTRAPTION.asStack();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (stack.isEmpty())<NEW_LINE>return stack;<NEW_LINE>CompoundTag tag = entity.<MASK><NEW_LINE>tag.remove("UUID");<NEW_LINE>tag.remove("Pos");<NEW_LINE>tag.remove("Motion");<NEW_LINE>NBTHelper.writeEnum(tag, "InitialOrientation", entity.getInitialOrientation());<NEW_LINE>stack.getOrCreateTag().put("Contraption", tag);<NEW_LINE>return stack;<NEW_LINE>} | getContraption().writeNBT(false); |
1,418,831 | public GetResult merge(List<PartitionGetResult> partResults) {<NEW_LINE>int resultSize = 0;<NEW_LINE>for (PartitionGetResult result : partResults) {<NEW_LINE>resultSize += ((PartGeneralGetResult) result).getNodeIds().length;<NEW_LINE>}<NEW_LINE>Long2ObjectOpenHashMap<Tuple3<long[], float[], int[]>> nodeIdToNeighbors <MASK><NEW_LINE>for (PartitionGetResult result : partResults) {<NEW_LINE>PartGeneralGetResult partResult = (PartGeneralGetResult) result;<NEW_LINE>long[] nodeIds = partResult.getNodeIds();<NEW_LINE>IElement[] data = partResult.getData();<NEW_LINE>for (int i = 0; i < nodeIds.length; i++) {<NEW_LINE>if (data[i] != null) {<NEW_LINE>long[] neighbors = ((AliasElement) data[i]).getNeighborIds();<NEW_LINE>float[] accept = ((AliasElement) data[i]).getAccept();<NEW_LINE>int[] alias = ((AliasElement) data[i]).getAlias();<NEW_LINE>if (neighbors.length > 0 && accept.length > 0 && alias.length > 0) {<NEW_LINE>nodeIdToNeighbors.put(nodeIds[i], new Tuple3<>(neighbors, accept, alias));<NEW_LINE>} else {<NEW_LINE>nodeIdToNeighbors.put(nodeIds[i], emp);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>nodeIdToNeighbors.put(nodeIds[i], emp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PullAliasResult(nodeIdToNeighbors);<NEW_LINE>} | = new Long2ObjectOpenHashMap<>(resultSize); |
1,183,757 | private static JPanel buildLinkPanel(ImageIcon icon, String topText, String bottomText, Runnable callback) {<NEW_LINE>JPanel container = new JPanel();<NEW_LINE>container.setBackground(ColorScheme.DARKER_GRAY_COLOR);<NEW_LINE>container.setLayout(new BorderLayout());<NEW_LINE>container.setBorder(new EmptyBorder(10, 10, 10, 10));<NEW_LINE>final Color hoverColor = ColorScheme.DARKER_GRAY_HOVER_COLOR;<NEW_LINE>final Color pressedColor = ColorScheme.DARKER_GRAY_COLOR.brighter();<NEW_LINE>JLabel iconLabel = new JLabel(icon);<NEW_LINE>container.add(iconLabel, BorderLayout.WEST);<NEW_LINE>JPanel textContainer = new JPanel();<NEW_LINE>textContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR);<NEW_LINE>textContainer.setLayout(new GridLayout(2, 1));<NEW_LINE>textContainer.setBorder(new EmptyBorder(5, 10, 5, 10));<NEW_LINE>container.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mousePressed(MouseEvent mouseEvent) {<NEW_LINE>container.setBackground(pressedColor);<NEW_LINE>textContainer.setBackground(pressedColor);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseReleased(MouseEvent e) {<NEW_LINE>callback.run();<NEW_LINE>container.setBackground(hoverColor);<NEW_LINE>textContainer.setBackground(hoverColor);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseEntered(MouseEvent e) {<NEW_LINE>container.setBackground(hoverColor);<NEW_LINE>textContainer.setBackground(hoverColor);<NEW_LINE>container.setCursor(new Cursor(Cursor.HAND_CURSOR));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseExited(MouseEvent e) {<NEW_LINE>container.setBackground(ColorScheme.DARKER_GRAY_COLOR);<NEW_LINE>textContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR);<NEW_LINE>container.setCursor(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>JLabel topLine = new JLabel(topText);<NEW_LINE>topLine.setForeground(Color.WHITE);<NEW_LINE>topLine.setFont(FontManager.getRunescapeSmallFont());<NEW_LINE>JLabel bottomLine = new JLabel(bottomText);<NEW_LINE>bottomLine.setForeground(Color.WHITE);<NEW_LINE>bottomLine.setFont(FontManager.getRunescapeSmallFont());<NEW_LINE>textContainer.add(topLine);<NEW_LINE>textContainer.add(bottomLine);<NEW_LINE>container.add(textContainer, BorderLayout.CENTER);<NEW_LINE>JLabel arrowLabel = new JLabel(ARROW_RIGHT_ICON);<NEW_LINE>container.add(arrowLabel, BorderLayout.EAST);<NEW_LINE>return container;<NEW_LINE>} | new Cursor(Cursor.DEFAULT_CURSOR)); |
900,274 | public Void migrateProcessInstance(CommandContext commandContext, String processInstanceId, MigrationPlan migrationPlan, ProcessDefinitionEntity targetProcessDefinition, boolean skipJavaSerializationFormatCheck) {<NEW_LINE>ensureNotNull(BadUserRequestException.class, "Process instance id cannot be null", "process instance id", processInstanceId);<NEW_LINE>final ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId);<NEW_LINE>ensureProcessInstanceExist(processInstanceId, processInstance);<NEW_LINE>ensureOperationAllowed(commandContext, processInstance, targetProcessDefinition);<NEW_LINE>ensureSameProcessDefinition(processInstance, migrationPlan.getSourceProcessDefinitionId());<NEW_LINE>MigratingProcessInstanceValidationReportImpl processInstanceReport = new MigratingProcessInstanceValidationReportImpl();<NEW_LINE>// Initialize migration: match migration instructions to activity instances and collect required entities<NEW_LINE>ProcessEngineImpl processEngine = commandContext.getProcessEngineConfiguration().getProcessEngine();<NEW_LINE>MigratingInstanceParser migratingInstanceParser = new MigratingInstanceParser(processEngine);<NEW_LINE>final MigratingProcessInstance migratingProcessInstance = migratingInstanceParser.parse(processInstanceId, migrationPlan, processInstanceReport);<NEW_LINE>validateInstructions(commandContext, migratingProcessInstance, processInstanceReport);<NEW_LINE>if (processInstanceReport.hasFailures()) {<NEW_LINE>throw LOGGER.failingMigratingProcessInstanceValidation(processInstanceReport);<NEW_LINE>}<NEW_LINE>executeInContext(() -> deleteUnmappedActivityInstances(migratingProcessInstance), migratingProcessInstance.getSourceDefinition());<NEW_LINE>executeInContext(() -> migrateProcessInstance(migratingProcessInstance), migratingProcessInstance.getTargetDefinition());<NEW_LINE>Map<String, ?> variables = migrationPlan.getVariables();<NEW_LINE>if (variables != null) {<NEW_LINE>// we don't need a context switch here since when setting an execution triggering variable,<NEW_LINE>// a context switch is performed at a later point via command invocation context<NEW_LINE>commandContext.executeWithOperationLogPrevented(new SetExecutionVariablesCmd(processInstanceId<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | , variables, false, skipJavaSerializationFormatCheck)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.