idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
436,727 | public static void decompress(final String sourceFile, final String outputDir, final Checksum checksum) throws IOException {<NEW_LINE>try (final FileInputStream fis = new FileInputStream(sourceFile);<NEW_LINE>final CheckedInputStream cis = new CheckedInputStream(fis, checksum);<NEW_LINE>final ZipInputStream zis = new ZipInputStream(new BufferedInputStream(cis))) {<NEW_LINE>ZipEntry entry;<NEW_LINE>while ((entry = zis.getNextEntry()) != null) {<NEW_LINE>final String fileName = entry.getName();<NEW_LINE>final File entryFile = new File(Paths.get(outputDir, fileName).toString());<NEW_LINE>FileUtils.forceMkdir(entryFile.getParentFile());<NEW_LINE>try (final <MASK><NEW_LINE>final BufferedOutputStream bos = new BufferedOutputStream(fos)) {<NEW_LINE>IOUtils.copy(zis, bos);<NEW_LINE>bos.flush();<NEW_LINE>fos.getFD().sync();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Continue to read all remaining bytes(extra metadata of ZipEntry) directly from the checked stream,<NEW_LINE>// Otherwise, the checksum value maybe unexpected.<NEW_LINE>//<NEW_LINE>// See https://coderanch.com/t/279175/java/ZipInputStream<NEW_LINE>IOUtils.copy(cis, NullOutputStream.NULL_OUTPUT_STREAM);<NEW_LINE>}<NEW_LINE>} | FileOutputStream fos = new FileOutputStream(entryFile); |
419,341 | protected void handleException(Throwable failure) {<NEW_LINE>// Unwrap wrapping Jetty and Servlet exceptions.<NEW_LINE>Throwable quiet = unwrap(failure, QuietException.class);<NEW_LINE>Throwable noStack = unwrap(failure, BadMessageException.class, IOException.class, TimeoutException.class);<NEW_LINE>if (quiet != null || !getServer().isRunning()) {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug(_request.getRequestURI(), failure);<NEW_LINE>} else if (noStack != null) {<NEW_LINE>// No stack trace unless there is debug turned on<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.warn("handleException {}", _request.getRequestURI(), failure);<NEW_LINE>else<NEW_LINE>LOG.warn("handleException {} {}", _request.getRequestURI(), noStack.toString());<NEW_LINE>} else {<NEW_LINE>LOG.warn(<MASK><NEW_LINE>}<NEW_LINE>if (isCommitted()) {<NEW_LINE>abort(failure);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>_state.onError(failure);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>abort(failure);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | _request.getRequestURI(), failure); |
1,237,879 | public boolean doHandle(NavigationState requestedState, AppUI ui) {<NEW_LINE>UrlChangeHandler urlChangeHandler = ui.getUrlChangeHandler();<NEW_LINE>if (urlChangeHandler.isEmptyState(requestedState)) {<NEW_LINE>urlChangeHandler.revertNavigationState();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!rootChanged(requestedState, ui)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String rootRoute = requestedState.getRoot();<NEW_LINE>WindowInfo windowInfo = windowConfig.findWindowInfoByRoute(rootRoute);<NEW_LINE>if (windowInfo == null) {<NEW_LINE>log.info("No registered screen found for route: '{}'", rootRoute);<NEW_LINE>urlChangeHandler.revertNavigationState();<NEW_LINE>handle404(rootRoute, ui);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (urlChangeHandler.shouldRedirect(windowInfo)) {<NEW_LINE>urlChangeHandler.redirect(requestedState);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!urlChangeHandler.isPermittedToNavigate(requestedState, windowInfo)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Screen screen = ui.getScreens().create(windowInfo.getId(), OpenMode.ROOT);<NEW_LINE>boolean hasNestedRoute = StringUtils.isNotEmpty(requestedState.getNestedRoute());<NEW_LINE>if (!hasNestedRoute && MapUtils.isNotEmpty(requestedState.getParams())) {<NEW_LINE>UiControllerUtils.fireEvent(screen, UrlParamsChangedEvent.class, new UrlParamsChangedEvent(screen, requestedState.getParams()));<NEW_LINE>((WebWindow) screen.getWindow<MASK><NEW_LINE>}<NEW_LINE>screen.show();<NEW_LINE>return !hasNestedRoute;<NEW_LINE>} | ()).setResolvedState(requestedState); |
1,438,271 | public void publish(String senderAddress, String subject, PublishScope scope, Object args) {<NEW_LINE>// publish cannot be in DB transaction, which may hold DB lock too long, and we are guarding this here<NEW_LINE>if (!noDbTxn()) {<NEW_LINE>String errMsg = "NO EVENT PUBLISH CAN BE WRAPPED WITHIN DB TRANSACTION!";<NEW_LINE>s_logger.error(errMsg, new CloudRuntimeException(errMsg));<NEW_LINE>}<NEW_LINE>if (_gate.enter(true)) {<NEW_LINE>if (s_logger.isTraceEnabled()) {<NEW_LINE>s_logger.trace("Enter gate in message bus publish");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<SubscriptionNode> chainFromTop <MASK><NEW_LINE>SubscriptionNode current = locate(subject, chainFromTop, false);<NEW_LINE>if (current != null)<NEW_LINE>current.notifySubscribers(senderAddress, subject, args);<NEW_LINE>Collections.reverse(chainFromTop);<NEW_LINE>for (SubscriptionNode node : chainFromTop) node.notifySubscribers(senderAddress, subject, args);<NEW_LINE>} finally {<NEW_LINE>_gate.leave();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new ArrayList<SubscriptionNode>(); |
286,292 | private static MQuery evaluateQuery(String targetTableName, int AD_Tab_ID, String Name, final PO po) {<NEW_LINE>MTab tab = new MTab(Env.getCtx(), AD_Tab_ID, null);<NEW_LINE>final MQuery query = new MQuery();<NEW_LINE>query.addRestriction(targetTableName + "." + po.get_TableName() + <MASK><NEW_LINE>if (tab.getWhereClause() != null && tab.getWhereClause().length() > 0)<NEW_LINE>query.addRestriction("(" + tab.getWhereClause() + ")");<NEW_LINE>query.setZoomTableName(targetTableName);<NEW_LINE>query.setZoomColumnName(po.get_KeyColumns()[0]);<NEW_LINE>query.setZoomValue(po.get_ID());<NEW_LINE>String sql = "SELECT COUNT(*) FROM " + targetTableName + " WHERE " + Env.parseVariable(query.getWhereClause(false), po, null, false);<NEW_LINE>int count = DB.getSQLValue(null, sql);<NEW_LINE>query.setRecordCount(count);<NEW_LINE>return query;<NEW_LINE>} | "_ID=" + po.get_ID()); |
814,296 | private List<RecordQueryResult.Record> findDeadRecord(final String subject, final String messageId) {<NEW_LINE>final String subjectId = dicService.name2Id(subject);<NEW_LINE>final String keyRegexp = <MASK><NEW_LINE>final String startKey = BackupMessageKeyRangeBuilder.buildDeadRecordStartKey(subjectId, messageId);<NEW_LINE>final String endKey = BackupMessageKeyRangeBuilder.buildDeadRecordEndKey(subjectId, messageId);<NEW_LINE>try {<NEW_LINE>return scan(table, keyRegexp, startKey, endKey, 100, 0, R_FAMILY, B_RECORD_QUALIFIERS, kvs -> {<NEW_LINE>final KeyValueList<KeyValue> kvl = new KeyValueListImpl(kvs);<NEW_LINE>final byte[] value = kvl.getValue(RECORDS);<NEW_LINE>final long sequence = Bytes.getLong(value, 0);<NEW_LINE>final long timestamp = Bytes.getLong(value, 8);<NEW_LINE>final int consumerGroupLength = value.length - 16;<NEW_LINE>final byte[] consumerGroupBytes = new byte[consumerGroupLength];<NEW_LINE>System.arraycopy(value, 16, consumerGroupBytes, 0, consumerGroupLength);<NEW_LINE>final String consumerGroup = CharsetUtils.toUTF8String(consumerGroupBytes);<NEW_LINE>return new RecordQueryResult.Record(consumerGroup, ActionEnum.OMIT.getCode(), RecordEnum.DEAD_RECORD.getCode(), timestamp, "", sequence);<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to find dead records.", e);<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>} | BackupMessageKeyRegexpBuilder.buildDeadRecordRegexp(subjectId, messageId); |
16,258 | protected int countByUserId(String userId) throws SystemException {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("SELECT COUNT(*) ");<NEW_LINE>query.append("FROM PortletPreferences IN CLASS com.liferay.portal.ejb.PortletPreferencesHBM WHERE ");<NEW_LINE>query.append("userId = ?");<NEW_LINE>query.append(" ");<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q.setString(queryPos++, userId);<NEW_LINE>Iterator itr = q<MASK><NEW_LINE>if (itr.hasNext()) {<NEW_LINE>Integer count = (Integer) itr.next();<NEW_LINE>if (count != null) {<NEW_LINE>return count.intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>} finally {<NEW_LINE>HibernateUtil.closeSession(session);<NEW_LINE>}<NEW_LINE>} | .list().iterator(); |
1,420,725 | //<NEW_LINE>Reference(//<NEW_LINE>authors = "D. W. Scott", //<NEW_LINE>title = "Multivariate density estimation: Theory, Practice, and Visualization", //<NEW_LINE>booktitle = "Multivariate Density Estimation: Theory, Practice, and Visualization", url = "https://doi.org/10.1002/9780470316849", bibkey = "doi:10.1002/9780470316849")<NEW_LINE>private double[] initializeBandwidth(double[][] data) {<NEW_LINE>MeanVariance mv0 = new MeanVariance();<NEW_LINE>MeanVariance mv1 = new MeanVariance();<NEW_LINE>// For Kernel bandwidth.<NEW_LINE>for (double[] projected : data) {<NEW_LINE>mv0<MASK><NEW_LINE>mv1.put(projected[1]);<NEW_LINE>}<NEW_LINE>// Set bandwidths according to Scott's rule:<NEW_LINE>// Note: in projected space, d=2.<NEW_LINE>double[] bandwidth = new double[2];<NEW_LINE>bandwidth[0] = MathUtil.SQRT5 * mv0.getSampleStddev() * FastMath.pow(rel.size(), -1 / 6.);<NEW_LINE>bandwidth[1] = MathUtil.SQRT5 * mv1.getSampleStddev() * FastMath.pow(rel.size(), -1 / 6.);<NEW_LINE>return bandwidth;<NEW_LINE>} | .put(projected[0]); |
1,414,508 | private void loadNode89() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.NamespaceMetadataType_NamespaceFile_Writable, new QualifiedName(0, "Writable"), new LocalizedText("en", "Writable"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Boolean, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile_Writable, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile_Writable, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile_Writable, Identifiers.HasProperty, Identifiers.NamespaceMetadataType_NamespaceFile.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (1), 0.0, false); |
58,451 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,813,311 | public static <V, T> ObjectDoubleMap<V> sumByFloat(T[] array, int size, Function<T, V> groupBy, FloatFunction<? super T> function) {<NEW_LINE>ObjectDoubleHashMap<V> result = ObjectDoubleHashMap.newMap();<NEW_LINE>ObjectDoubleHashMap<V> groupKeyToCompensation = ObjectDoubleHashMap.newMap();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>T item = array[i];<NEW_LINE>V groupByKey = groupBy.valueOf(item);<NEW_LINE>double compensation = <MASK><NEW_LINE>double adjustedValue = function.floatValueOf(item) - compensation;<NEW_LINE>double nextSum = result.get(groupByKey) + adjustedValue;<NEW_LINE>groupKeyToCompensation.put(groupByKey, nextSum - result.get(groupByKey) - adjustedValue);<NEW_LINE>result.put(groupByKey, nextSum);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | groupKeyToCompensation.getIfAbsentPut(groupByKey, 0.0d); |
890,124 | public static String checkEntryInner(String urlString) throws Exception {<NEW_LINE>String METHOD = "checkEntryInnter";<NEW_LINE>HttpURLConnection con = null;<NEW_LINE>String msg = null;<NEW_LINE>try {<NEW_LINE>Log.info(thisClass, METHOD, "Check requested type");<NEW_LINE>URL setupURL = new URL(urlString);<NEW_LINE>Log.info(thisClass, METHOD, "setupURL: " + setupURL);<NEW_LINE>con = (HttpURLConnection) setupURL.openConnection();<NEW_LINE>con.setDoInput(true);<NEW_LINE>con.setDoOutput(true);<NEW_LINE>con.setUseCaches(false);<NEW_LINE>con.setRequestMethod("GET");<NEW_LINE><MASK><NEW_LINE>InputStreamReader isr = new InputStreamReader(is);<NEW_LINE>BufferedReader br = new BufferedReader(isr);<NEW_LINE>String sep = System.getProperty("line.separator");<NEW_LINE>StringBuilder lines = new StringBuilder();<NEW_LINE>// Send output from servlet to console output<NEW_LINE>for (String line = br.readLine(); line != null; line = br.readLine()) {<NEW_LINE>lines.append(line).append(sep);<NEW_LINE>Log.info(thisClass, METHOD, line);<NEW_LINE>msg = line;<NEW_LINE>}<NEW_LINE>con.disconnect();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.info(thisClass, METHOD, "Exception occurred: " + e.toString());<NEW_LINE>Log.error(thisClass, METHOD, e, "Exception occurred");<NEW_LINE>System.err.println("Exception: " + e);<NEW_LINE>if (con != null) {<NEW_LINE>con.disconnect();<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return msg;<NEW_LINE>} | InputStream is = con.getInputStream(); |
1,729,006 | private void sendLog(ConsoleCommunication consoleCommunication, String testId) {<NEW_LINE>File logFolder = new File(agentConfig.getHome().getLogDirectory(), testId);<NEW_LINE>if (!logFolder.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File[] logFiles = logFolder.listFiles((dir, name) -> (name.endsWith(".log")));<NEW_LINE>if (logFiles == null || ArrayUtils.isEmpty(logFiles)) {<NEW_LINE>LOGGER.error("No log exists under {}", logFolder.getAbsolutePath());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Arrays.sort(logFiles);<NEW_LINE>// Take only one file... if agent.send.all.logs is not set.<NEW_LINE>if (!agentConfig.getAgentProperties().getPropertyBoolean(PROP_AGENT_ALL_LOGS)) {<NEW_LINE>logFiles = new File[] { logFiles[0] };<NEW_LINE>}<NEW_LINE>final byte[] compressedLog = LogCompressUtils.compress(logFiles, Charset.<MASK><NEW_LINE>consoleCommunication.sendMessage(new LogReportGrinderMessage(testId, compressedLog, new AgentAddress(m_agentIdentity)));<NEW_LINE>// Delete logs to clean up<NEW_LINE>if (!agentConfig.getAgentProperties().getPropertyBoolean(PROP_AGENT_KEEP_LOGS)) {<NEW_LINE>LOGGER.info("Clean up the perftest logs");<NEW_LINE>FileUtils.deleteQuietly(logFolder);<NEW_LINE>}<NEW_LINE>} | defaultCharset(), StandardCharsets.UTF_8); |
1,098,902 | protected MapValueBuilder queryStats(QueryStatistics queryStatistics) {<NEW_LINE>MapValueBuilder builder = new MapValueBuilder();<NEW_LINE>addIfNonZero(builder, "nodes-created", queryStatistics.getNodesCreated());<NEW_LINE>addIfNonZero(builder, "nodes-deleted", queryStatistics.getNodesDeleted());<NEW_LINE>addIfNonZero(builder, "relationships-created", queryStatistics.getRelationshipsCreated());<NEW_LINE>addIfNonZero(builder, "relationships-deleted", queryStatistics.getRelationshipsDeleted());<NEW_LINE>addIfNonZero(builder, "properties-set", queryStatistics.getPropertiesSet());<NEW_LINE>addIfNonZero(builder, "labels-added", queryStatistics.getLabelsAdded());<NEW_LINE>addIfNonZero(builder, "labels-removed", queryStatistics.getLabelsRemoved());<NEW_LINE>addIfNonZero(builder, "indexes-added", queryStatistics.getIndexesAdded());<NEW_LINE>addIfNonZero(builder, "indexes-removed", queryStatistics.getIndexesRemoved());<NEW_LINE>addIfNonZero(builder, "constraints-added", queryStatistics.getConstraintsAdded());<NEW_LINE>addIfNonZero(builder, <MASK><NEW_LINE>return builder;<NEW_LINE>} | "constraints-removed", queryStatistics.getConstraintsRemoved()); |
231,229 | // end utilities<NEW_LINE>static void test_i386(byte[] code) {<NEW_LINE>fd_chains.clean();<NEW_LINE>System.out.printf("Emulate i386 code\n");<NEW_LINE>try {<NEW_LINE>// Initialize emulator in X86-32bit mode<NEW_LINE>Unicorn mu = new Unicorn(Unicorn.UC_ARCH_X86, Unicorn.UC_MODE_32);<NEW_LINE>// map 2MB memory for this emulation<NEW_LINE>mu.mem_map(ADDRESS, 2 * 1024 * 1024, Unicorn.UC_PROT_ALL);<NEW_LINE>// write machine code to be emulated to memory<NEW_LINE><MASK><NEW_LINE>// initialize stack<NEW_LINE>mu.reg_write(Unicorn.UC_X86_REG_ESP, ADDRESS + 0x200000L);<NEW_LINE>// handle interrupt ourself<NEW_LINE>mu.hook_add(new MyInterruptHook(), null);<NEW_LINE>// emulate machine code in infinite time<NEW_LINE>mu.emu_start(ADDRESS, ADDRESS + code.length, 0, 0);<NEW_LINE>// now print out some registers<NEW_LINE>System.out.printf(">>> Emulation done\n");<NEW_LINE>} catch (UnicornException uex) {<NEW_LINE>System.out.printf("ERROR: %s\n", uex.getMessage());<NEW_LINE>}<NEW_LINE>fd_chains.print_report();<NEW_LINE>} | mu.mem_write(ADDRESS, code); |
1,065,228 | public void marshall(UpdateIntegrationRequest updateIntegrationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateIntegrationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getApiId(), APIID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getConnectionId(), CONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getConnectionType(), CONNECTIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getCredentialsArn(), CREDENTIALSARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getIntegrationId(), INTEGRATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getIntegrationMethod(), INTEGRATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getIntegrationSubtype(), INTEGRATIONSUBTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getIntegrationType(), INTEGRATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getIntegrationUri(), INTEGRATIONURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getPassthroughBehavior(), PASSTHROUGHBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getPayloadFormatVersion(), PAYLOADFORMATVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getRequestParameters(), REQUESTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getRequestTemplates(), REQUESTTEMPLATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getResponseParameters(), RESPONSEPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getTemplateSelectionExpression(), TEMPLATESELECTIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getTimeoutInMillis(), TIMEOUTINMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIntegrationRequest.getTlsConfig(), TLSCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateIntegrationRequest.getContentHandlingStrategy(), CONTENTHANDLINGSTRATEGY_BINDING); |
855,099 | private V deserializeVersion0(final short version, final DataInput in) throws IOException {<NEW_LINE>final <MASK><NEW_LINE>switch(termCode) {<NEW_LINE>case ITermIndexCodes.TERM_CODE_BND:<NEW_LINE>{<NEW_LINE>return (V) valueFactory.createBNode(in.readUTF());<NEW_LINE>}<NEW_LINE>case ITermIndexCodes.TERM_CODE_URI:<NEW_LINE>{<NEW_LINE>return (V) valueFactory.createURI(in.readUTF());<NEW_LINE>}<NEW_LINE>case ITermIndexCodes.TERM_CODE_LIT:<NEW_LINE>{<NEW_LINE>final String label = in.readUTF();<NEW_LINE>return (V) valueFactory.createLiteral(label);<NEW_LINE>}<NEW_LINE>case ITermIndexCodes.TERM_CODE_LCL:<NEW_LINE>{<NEW_LINE>final String language = in.readUTF();<NEW_LINE>final String label = in.readUTF();<NEW_LINE>return (V) valueFactory.createLiteral(label, language);<NEW_LINE>}<NEW_LINE>case ITermIndexCodes.TERM_CODE_DTL:<NEW_LINE>{<NEW_LINE>final String datatype = in.readUTF();<NEW_LINE>final String label = in.readUTF();<NEW_LINE>return (V) valueFactory.createLiteral(label, valueFactory.createURI(datatype));<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IOException(ERR_CODE + " : " + termCode);<NEW_LINE>}<NEW_LINE>} | byte termCode = in.readByte(); |
492,675 | private Expression rewriteTemporary(ArithmeticOperation arith) {<NEW_LINE>Expression lhs = arith.getLhs();<NEW_LINE>Expression rhs = arith.getRhs();<NEW_LINE>boolean safe = isSideEffectFree<MASK><NEW_LINE>ComparisonOperation compareEq;<NEW_LINE>if (safe) {<NEW_LINE>compareEq = new ComparisonOperation(arith.getLoc(), lhs, rhs, CompOp.EQ);<NEW_LINE>} else {<NEW_LINE>LValue tmp = vf.tempVariable(lhs.getInferredJavaType());<NEW_LINE>Expression zero = Literal.getLiteralOrNull(lhs.getInferredJavaType().getRawType(), lhs.getInferredJavaType(), 0);<NEW_LINE>if (zero == null) {<NEW_LINE>zero = Literal.INT_ZERO;<NEW_LINE>}<NEW_LINE>compareEq = new ComparisonOperation(arith.getLoc(), new AssignmentExpression(BytecodeLoc.NONE, tmp, new ArithmeticOperation(arith.getLoc(), lhs, rhs, ArithOp.MINUS)), zero, CompOp.EQ);<NEW_LINE>lhs = new LValueExpression(tmp);<NEW_LINE>rhs = zero;<NEW_LINE>}<NEW_LINE>switch(arith.getOp()) {<NEW_LINE>case LCMP:<NEW_LINE>// CmpG will return 1 if either value is nan.<NEW_LINE>case DCMPG:<NEW_LINE>case FCMPG:<NEW_LINE>return new TernaryExpression(BytecodeLoc.NONE, compareEq, Literal.INT_ZERO, new TernaryExpression(arith.getLoc(), new ComparisonOperation(arith.getLoc(), lhs, rhs, CompOp.LT), Literal.MINUS_ONE, Literal.INT_ONE));<NEW_LINE>// CmpL will return -1 if either value is nan.<NEW_LINE>case DCMPL:<NEW_LINE>case FCMPL:<NEW_LINE>return new TernaryExpression(BytecodeLoc.NONE, compareEq, Literal.INT_ZERO, new TernaryExpression(arith.getLoc(), new ComparisonOperation(arith.getLoc(), lhs, rhs, CompOp.GT), Literal.INT_ONE, Literal.MINUS_ONE));<NEW_LINE>}<NEW_LINE>return arith;<NEW_LINE>} | (lhs) && isSideEffectFree(rhs); |
1,751,931 | public void doFinally() {<NEW_LINE>if (t[0] == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>org.compiere.model.I_AD_User userInCharge = Services.get(IBPartnerOrgBL.class).retrieveUserInChargeOrNull(ctx, olCand.getAD_Org_ID(), trxName);<NEW_LINE>if (userInCharge == null) {<NEW_LINE>userInCharge = InterfaceWrapperHelper.create(ctx, Env.getAD_User_ID(ctx<MASK><NEW_LINE>}<NEW_LINE>final MNote note = new MNote(ctx, IOLCandBL.MSG_OL_CAND_PROCESSOR_PROCESSING_ERROR_0P, userInCharge.getAD_User_ID(), trxName);<NEW_LINE>note.setRecord(InterfaceWrapperHelper.getTableId(I_C_OLCand.class), olCand.getC_OLCand_ID());<NEW_LINE>note.setClientOrg(userInCharge.getAD_Client_ID(), userInCharge.getAD_Org_ID());<NEW_LINE>note.setTextMsg(t[0].getLocalizedMessage());<NEW_LINE>note.saveEx();<NEW_LINE>olCand.setIsError(true);<NEW_LINE>olCand.setAD_Note_ID(note.getAD_Note_ID());<NEW_LINE>olCand.setErrorMsg(t[0].getLocalizedMessage());<NEW_LINE>} | ), I_AD_User.class, trxName); |
194,742 | private void warmUp(Callback<None> callback) {<NEW_LINE>// we want to be certain that the warm up doesn't take more than warmUpTimeoutSeconds<NEW_LINE>Callback<None> timeoutCallback = new TimeoutCallback<>(_executorService, _warmUpTimeoutSeconds, TimeUnit.SECONDS, new Callback<None>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE>LOG.info("EventBus Throttler didn't send all requests in time, continuing startup. The WarmUp will continue in background");<NEW_LINE>callback.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(None result) {<NEW_LINE>LOG.info("EventBus Throttler sent all requests");<NEW_LINE>callback.onSuccess(None.none());<NEW_LINE>}<NEW_LINE>}, "This message will never be used, even in case of timeout, no exception should be passed up");<NEW_LINE>// make warmup requests through requests throttler<NEW_LINE>List<String> fileListWithoutExtension = new ArrayList<>(_fsStore.getAll().keySet());<NEW_LINE>PropertyEventBusRequestsThrottler<T> throttler = new PropertyEventBusRequestsThrottler<>(_zkToFsBus, _zkBusUpdaterSubscriber, fileListWithoutExtension, _concurrentRequests, true);<NEW_LINE>throttler.sendRequests(timeoutCallback);<NEW_LINE>} | onSuccess(None.none()); |
522,610 | public void validate(final EventBasedGateway element, final ValidationResultCollector validationResultCollector) {<NEW_LINE>final Collection<SequenceFlow> outgoingSequenceFlows = element.getOutgoing();<NEW_LINE>if (outgoingSequenceFlows.size() < 2) {<NEW_LINE>validationResultCollector.addError(0, "Event-based gateway must have at least 2 outgoing sequence flows.");<NEW_LINE>}<NEW_LINE>final boolean isValid = outgoingSequenceFlows.stream(<MASK><NEW_LINE>if (!isValid) {<NEW_LINE>validationResultCollector.addError(0, ERROR_UNSUPPORTED_TARGET_NODE);<NEW_LINE>}<NEW_LINE>final List<MessageEventDefinition> messageEventDefinitions = getMessageEventDefinitions(outgoingSequenceFlows).collect(Collectors.toList());<NEW_LINE>ModelUtil.verifyNoDuplicatedEventDefinition(messageEventDefinitions, error -> validationResultCollector.addError(0, error));<NEW_LINE>if (!succeedingNodesOnlyHaveEventBasedGatewayAsIncomingFlows(element)) {<NEW_LINE>validationResultCollector.addError(0, "Target elements of an event gateway must not have any additional incoming sequence flows other than that from the event gateway.");<NEW_LINE>}<NEW_LINE>} | ).allMatch(this::isValidOutgoingSequenceFlow); |
298,074 | public StreamResponse asContentResponse(final Map<String, Object> doc) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final FessConfig fessConfig = ComponentUtil.getFessConfig();<NEW_LINE>final CrawlingConfigHelper crawlingConfigHelper = ComponentUtil.getCrawlingConfigHelper();<NEW_LINE>final String configId = DocumentUtil.getValue(doc, fessConfig.getIndexFieldConfigId(), String.class);<NEW_LINE>if (configId == null) {<NEW_LINE>throw new FessSystemException("configId is null.");<NEW_LINE>}<NEW_LINE>if (configId.length() < 2) {<NEW_LINE>throw new FessSystemException("Invalid configId: " + configId);<NEW_LINE>}<NEW_LINE>final CrawlingConfig config = crawlingConfigHelper.getCrawlingConfig(configId);<NEW_LINE>if (config == null) {<NEW_LINE>throw new FessSystemException("No crawlingConfig: " + configId);<NEW_LINE>}<NEW_LINE>final String url = DocumentUtil.getValue(doc, fessConfig.getIndexFieldUrl(), String.class);<NEW_LINE>final CrawlerClientFactory crawlerClientFactory = config.initializeClientFactory(() -> ComponentUtil.getComponent(CrawlerClientFactory.class));<NEW_LINE>final CrawlerClient client = crawlerClientFactory.getClient(url);<NEW_LINE>if (client == null) {<NEW_LINE>throw new FessSystemException("No CrawlerClient: " + configId + ", url: " + url);<NEW_LINE>}<NEW_LINE>return writeContent(configId, url, client);<NEW_LINE>} | logger.debug("writing the content of: {}", doc); |
603,239 | final GetCelebrityRecognitionResult executeGetCelebrityRecognition(GetCelebrityRecognitionRequest getCelebrityRecognitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCelebrityRecognitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCelebrityRecognitionRequest> request = null;<NEW_LINE>Response<GetCelebrityRecognitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCelebrityRecognitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCelebrityRecognitionRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCelebrityRecognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCelebrityRecognitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCelebrityRecognitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
207,402 | private void jbInit() throws Exception {<NEW_LINE>this.setSize(new Dimension(800, 800));<NEW_LINE>this.setTitle("JTS TestBuilder");<NEW_LINE>this.setJMenuBar(tbMenuBar.getMenuBar());<NEW_LINE>fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);<NEW_LINE>fileChooser.setMultiSelectionEnabled(false);<NEW_LINE>fileAndDirectoryChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);<NEW_LINE>fileAndDirectoryChooser.setMultiSelectionEnabled(true);<NEW_LINE>directoryChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>directoryChooser.setMultiSelectionEnabled(false);<NEW_LINE>// Center the window<NEW_LINE>// Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();<NEW_LINE>// ---------------------------------------------------<NEW_LINE>wktPanel.setMinimumSize(new Dimension(111, 0));<NEW_LINE>wktPanel.setPreferredSize(new Dimension(600, 100));<NEW_LINE>testPanel.setLayout(gridBagLayout2);<NEW_LINE>gridLayout1.setRows(4);<NEW_LINE>gridLayout1.setColumns(1);<NEW_LINE>panelTop.setLayout(borderLayout2);<NEW_LINE>panelTop.setMinimumSize(new Dimension(431, 0));<NEW_LINE>panelTop.<MASK><NEW_LINE>panelBottom.setLayout(borderLayout3);<NEW_LINE>panelBottom.setMinimumSize(new Dimension(431, 0));<NEW_LINE>panelBottom.add(tbToolBar.getToolBar(), BorderLayout.NORTH);<NEW_LINE>panelBottom.add(inputTabbedPane, BorderLayout.CENTER);<NEW_LINE>// ---- Input tabs<NEW_LINE>inputTabbedPane.setTabPlacement(JTabbedPane.LEFT);<NEW_LINE>inputTabbedPane.add(testListPanel, AppStrings.TAB_LABEL_CASES);<NEW_LINE>inputTabbedPane.add(layerListPanel, AppStrings.TAB_LABEL_LAYERS);<NEW_LINE>inputTabbedPane.add(wktPanel, AppStrings.TAB_LABEL_INPUT);<NEW_LINE>inputTabbedPane.add(resultWKTPanel, AppStrings.TAB_LABEL_RESULT);<NEW_LINE>inputTabbedPane.add(resultValuePanel, AppStrings.TAB_LABEL_VALUE);<NEW_LINE>inputTabbedPane.add(inspectPanel, AppStrings.TAB_LABEL_INSPECT);<NEW_LINE>inputTabbedPane.add(statsPanel, AppStrings.TAB_LABEL_STATS);<NEW_LINE>inputTabbedPane.add(logPanel, AppStrings.TAB_LABEL_LOG);<NEW_LINE>inputTabbedPane.add(commandPanel, AppStrings.TAB_LABEL_COMMAND);<NEW_LINE>inputTabbedPane.setSelectedIndex(1);<NEW_LINE>inputTabbedPane.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>updateStatsPanelIfVisible();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// --- main frame<NEW_LINE>jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);<NEW_LINE>jSplitPane1.setPreferredSize(new Dimension(601, 690));<NEW_LINE>jSplitPane1.setBorder(new EmptyBorder(2, 2, 2, 2));<NEW_LINE>jSplitPane1.setResizeWeight(1);<NEW_LINE>jSplitPane1.setDividerLocation(500);<NEW_LINE>jSplitPane1.add(panelTop, JSplitPane.TOP);<NEW_LINE>jSplitPane1.add(panelBottom, JSplitPane.BOTTOM);<NEW_LINE>contentPane = (JPanel) this.getContentPane();<NEW_LINE>contentPane.setLayout(contentLayout);<NEW_LINE>contentPane.setPreferredSize(new Dimension(601, 690));<NEW_LINE>contentPane.add(jSplitPane1, BorderLayout.CENTER);<NEW_LINE>} | add(testCasePanel, BorderLayout.CENTER); |
658,081 | private static GalenPageTest gridGalenPageTest(String[] args, String originalText, Place place) {<NEW_LINE>GalenCommand command = new GalenCommandLineParser().parse(args);<NEW_LINE>List<String> leftovers = command.getLeftovers();<NEW_LINE>if (leftovers.size() == 0) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>String gridUrl = leftovers.get(0);<NEW_LINE>String pageUrl = command.get("page");<NEW_LINE>String size = command.get("size");<NEW_LINE>SeleniumGridBrowserFactory browserFactory = new SeleniumGridBrowserFactory(gridUrl).withBrowser(command.get("browser")).withBrowserVersion(command.get("version")).withPlatform(readPlatform(command.get("platform")));<NEW_LINE>for (String parameter : command.getParameterNames()) {<NEW_LINE>if (parameter.startsWith("dc.")) {<NEW_LINE>String desiredCapaibility = parameter.substring(3);<NEW_LINE>browserFactory.withDesiredCapability(desiredCapaibility, command.get(parameter));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new GalenPageTest().withUrl(pageUrl).withSize(readSize(size)).withBrowserFactory(browserFactory);<NEW_LINE>} | SyntaxException(place, "Cannot parse grid arguments: " + originalText); |
438,799 | public static Result restCompare() {<NEW_LINE>DynamicForm form = Form.form().bindFromRequest(request());<NEW_LINE>String flowExecId1 = form.get(COMPARE_FLOW_ID1);<NEW_LINE>flowExecId1 = (flowExecId1 != null) ? flowExecId1.trim() : null;<NEW_LINE>String flowExecId2 = form.get(COMPARE_FLOW_ID2);<NEW_LINE>flowExecId2 = (flowExecId2 != null) ? flowExecId2.trim() : null;<NEW_LINE>List<AppResult> results1 = null;<NEW_LINE>List<AppResult> results2 = null;<NEW_LINE>if (flowExecId1 != null && !flowExecId1.isEmpty() && flowExecId2 != null && !flowExecId2.isEmpty()) {<NEW_LINE>results1 = AppResult.find.select("*").where().eq(AppResult.TABLE.FLOW_EXEC_ID, flowExecId1).setMaxRows(100).fetch(AppResult.TABLE.APP_HEURISTIC_RESULTS, "*").fetch(AppResult.TABLE.APP_HEURISTIC_RESULTS + "." + AppHeuristicResult.TABLE.APP_HEURISTIC_RESULT_DETAILS, "*").findList();<NEW_LINE>results2 = AppResult.find.select("*").where().eq(AppResult.TABLE.FLOW_EXEC_ID, flowExecId2).setMaxRows(100).fetch(AppResult.TABLE.APP_HEURISTIC_RESULTS, "*").fetch(AppResult.TABLE.APP_HEURISTIC_RESULTS + "." + AppHeuristicResult.TABLE.APP_HEURISTIC_RESULT_DETAILS, "*").findList();<NEW_LINE>}<NEW_LINE>Map<IdUrlPair, Map<IdUrlPair, List<AppResult>>> compareResults = compareFlows(results1, results2);<NEW_LINE>Map<String, Map<String, List<AppResult>>> resMap = new HashMap<String, Map<String, List<AppResult>>>();<NEW_LINE>for (Map.Entry<IdUrlPair, Map<IdUrlPair, List<AppResult>>> entry : compareResults.entrySet()) {<NEW_LINE>IdUrlPair jobExecPair = entry.getKey();<NEW_LINE>Map<IdUrlPair, List<AppResult>> value = entry.getValue();<NEW_LINE>for (Map.Entry<IdUrlPair, List<AppResult>> innerEntry : value.entrySet()) {<NEW_LINE>IdUrlPair flowExecPair = innerEntry.getKey();<NEW_LINE>List<AppResult> results = innerEntry.getValue();<NEW_LINE>Map<String, List<AppResult>> resultMap = new HashMap<String<MASK><NEW_LINE>resultMap.put(flowExecPair.getId(), results);<NEW_LINE>resMap.put(jobExecPair.getId(), resultMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ok(Json.toJson(resMap));<NEW_LINE>} | , List<AppResult>>(); |
442,203 | // Returns true of scanning actually was started, false if it did not need to be<NEW_LINE>private boolean startScanning() {<NEW_LINE>BeaconManager beaconManager = <MASK><NEW_LINE>beaconManager.setScannerInSameProcess(true);<NEW_LINE>if (beaconManager.isMainProcess()) {<NEW_LINE>LogManager.i(TAG, "scanJob version %s is starting up on the main process", BuildConfig.VERSION_NAME);<NEW_LINE>} else {<NEW_LINE>LogManager.i(TAG, "beaconScanJob library version %s is starting up on a separate process", BuildConfig.VERSION_NAME);<NEW_LINE>ProcessUtils processUtils = new ProcessUtils(ScanJob.this);<NEW_LINE>LogManager.i(TAG, "beaconScanJob PID is " + processUtils.getPid() + " with process name " + processUtils.getProcessName());<NEW_LINE>}<NEW_LINE>ModelSpecificDistanceCalculator defaultDistanceCalculator = new ModelSpecificDistanceCalculator(ScanJob.this, BeaconManager.getDistanceModelUpdateUrl());<NEW_LINE>Beacon.setDistanceCalculator(defaultDistanceCalculator);<NEW_LINE>return restartScanning();<NEW_LINE>} | BeaconManager.getInstanceForApplication(getApplicationContext()); |
1,077,514 | public SubjectAreaOMASAPIResponse<HasA> createTermHasARelationship(String serverName, String userId, HasA termHasARelationship) {<NEW_LINE>String restAPIName = "createTermHasARelationship";<NEW_LINE>RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, restAPIName);<NEW_LINE>SubjectAreaOMASAPIResponse<HasA> response = new SubjectAreaOMASAPIResponse<>();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>// should not be called without a supplied relationship - the calling layer should not allow this.<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.<MASK><NEW_LINE>RelationshipHandler handler = instanceHandler.getRelationshipHandler(serverName, userId, restAPIName);<NEW_LINE>HasA createdTermHasARelationship = handler.createTermHasARelationship(userId, termHasARelationship);<NEW_LINE>response.addResult(createdTermHasARelationship);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>response = getResponseForException(exception, auditLog, className, restAPIName);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, response.toString());<NEW_LINE>return response;<NEW_LINE>} | getAuditLog(userId, serverName, restAPIName); |
1,510,200 | public List<ValidationEvent> validate(Model model) {<NEW_LINE>ConditionKeysIndex conditionIndex = ConditionKeysIndex.of(model);<NEW_LINE>TopDownIndex topDownIndex = TopDownIndex.of(model);<NEW_LINE>return model.shapes(ServiceShape.class).filter(service -> service.hasTrait(ServiceTrait.class)).flatMap(service -> {<NEW_LINE>List<ValidationEvent> results = new ArrayList<>();<NEW_LINE>Set<String> knownKeys = conditionIndex.getDefinedConditionKeys(service).keySet();<NEW_LINE>for (OperationShape operation : topDownIndex.getContainedOperations(service)) {<NEW_LINE>for (String name : conditionIndex.getConditionKeyNames(service, operation)) {<NEW_LINE>if (!knownKeys.contains(name) && !name.startsWith("aws:")) {<NEW_LINE>results.add(error(operation, String.format("This operation scoped within the `%s` service refers to an undefined " + "condition key `%s`. Expected one of the following defined condition " + "keys: [%s]", service.getId(), name, ValidationUtils<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results.stream();<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>} | .tickedList(knownKeys)))); |
1,637,796 | public CharSequence format(Number value) {<NEW_LINE>double d = value.doubleValue();<NEW_LINE>if (Double.isNaN(d)) {<NEW_LINE>return String.format(Locale.ENGLISH, "%" + totalLength + "s", "nan");<NEW_LINE>} else if (Double.isInfinite(d)) {<NEW_LINE>if (d > 0) {<NEW_LINE>return String.format(Locale.ENGLISH, "%" + totalLength + "s", "inf");<NEW_LINE>} else {<NEW_LINE>return String.format(Locale.ENGLISH, "%" + totalLength + "s", "-inf");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exponential) {<NEW_LINE>precision = Math.max(PRECISION, precision);<NEW_LINE>return String.format(Locale.ENGLISH, "% ." + precision + "e", value.doubleValue());<NEW_LINE>}<NEW_LINE>if (precision == 0) {<NEW_LINE>String fmt = "%" + (totalLength - <MASK><NEW_LINE>return String.format(Locale.ENGLISH, fmt, value.doubleValue());<NEW_LINE>}<NEW_LINE>String fmt = "%" + totalLength + '.' + precision + 'f';<NEW_LINE>String ret = String.format(Locale.ENGLISH, fmt, value.doubleValue());<NEW_LINE>// Replace trailing zeros with space<NEW_LINE>char[] chars = ret.toCharArray();<NEW_LINE>for (int i = chars.length - 1; i >= 0; --i) {<NEW_LINE>if (chars[i] == '0') {<NEW_LINE>chars[i] = ' ';<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new String(chars);<NEW_LINE>} | 1) + '.' + precision + "f."; |
1,724,348 | public Pair<INDArray, MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize) {<NEW_LINE>if (maskArray == null) {<NEW_LINE>for (int i = 0; i < layers.length; i++) {<NEW_LINE>layers[i].feedForwardMaskArray(null, null, minibatchSize);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Do a forward pass through each preprocessor and layer<NEW_LINE>for (int i = 0; i < layers.length; i++) {<NEW_LINE>InputPreProcessor preProcessor = getLayerWiseConfigurations().getInputPreProcess(i);<NEW_LINE>if (preProcessor != null) {<NEW_LINE>Pair<INDArray, MaskState> p = preProcessor.feedForwardMaskArray(maskArray, currentMaskState, minibatchSize);<NEW_LINE>if (p != null) {<NEW_LINE>maskArray = p.getFirst();<NEW_LINE>currentMaskState = p.getSecond();<NEW_LINE>} else {<NEW_LINE>maskArray = null;<NEW_LINE>currentMaskState = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Pair<INDArray, MaskState> p = layers[i].<MASK><NEW_LINE>if (p != null) {<NEW_LINE>maskArray = p.getFirst();<NEW_LINE>currentMaskState = p.getSecond();<NEW_LINE>} else {<NEW_LINE>maskArray = null;<NEW_LINE>currentMaskState = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Pair<>(maskArray, currentMaskState);<NEW_LINE>} | feedForwardMaskArray(maskArray, currentMaskState, minibatchSize); |
1,313,607 | public String doGet(Model model) {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("transcodings", transcodingService.getAllTranscodings());<NEW_LINE>map.put("transcodeDirectory", SettingsService.getTranscodeDirectory());<NEW_LINE>map.put("downsampleCommand", settingsService.getDownsamplingCommand());<NEW_LINE>map.put(<MASK><NEW_LINE>map.put("jukeboxCommand", settingsService.getJukeboxCommand());<NEW_LINE>map.put("videoImageCommand", settingsService.getVideoImageCommand());<NEW_LINE>map.put("subtitlesExtractionCommand", settingsService.getSubtitlesExtractionCommand());<NEW_LINE>map.put("transcodeEstimateTimePadding", settingsService.getTranscodeEstimateTimePadding());<NEW_LINE>map.put("transcodeEstimateBytePadding", settingsService.getTranscodeEstimateBytePadding());<NEW_LINE>map.put("brand", settingsService.getBrand());<NEW_LINE>model.addAttribute("model", map);<NEW_LINE>return "transcodingSettings";<NEW_LINE>} | "hlsCommand", settingsService.getHlsCommand()); |
1,698,901 | public void onBindViewHolder(@NonNull BaseViewHolder viewHolder, int position) {<NEW_LINE>super.onBindViewHolder(viewHolder, position);<NEW_LINE>if (viewHolder instanceof RepoViewHolder) {<NEW_LINE>RepoViewHolder holder = (RepoViewHolder) viewHolder;<NEW_LINE>Repository model = data.get(position).getM1();<NEW_LINE>holder.repoName.setText(model.getFullName());<NEW_LINE>GlideApp.with(fragment).load(model.getOwner().getAvatarUrl()).onlyRetrieveFromCache(!PrefUtils.isLoadImageEnable()).into(holder.userAvatar);<NEW_LINE>} else {<NEW_LINE>NotificationViewHolder holder = (NotificationViewHolder) viewHolder;<NEW_LINE>Notification model = data.get(position).getM2();<NEW_LINE>holder.title.setText(model.getSubject().getTitle());<NEW_LINE>if (model.isUnread()) {<NEW_LINE>holder.status.setImageResource(R.drawable.ic_mark_unread);<NEW_LINE>holder.status.setImageTintList(ColorStateList.valueOf(ViewUtils.getAccentColor(context)));<NEW_LINE>} else {<NEW_LINE>holder.status.setVisibility(View.INVISIBLE);<NEW_LINE>// holder.status.setImageResource(R.drawable.ic_mark_readed);<NEW_LINE>// holder.status.setImageTintList(ColorStateList.valueOf(ViewUtils.getSecondaryTextColor(context)));<NEW_LINE>}<NEW_LINE>holder.time.setText(StringUtils.getNewsTimeStr(context, model.getUpdateAt()));<NEW_LINE>int padding = <MASK><NEW_LINE>if (NotificationSubject.Type.Issue.equals(model.getSubject().getType())) {<NEW_LINE>holder.typeIcon.setImageResource(R.drawable.ic_issues);<NEW_LINE>padding = 0;<NEW_LINE>} else if (NotificationSubject.Type.Commit.equals(model.getSubject().getType())) {<NEW_LINE>holder.typeIcon.setImageResource(R.drawable.ic_commit);<NEW_LINE>} else {<NEW_LINE>holder.typeIcon.setImageResource(R.drawable.ic_pull);<NEW_LINE>}<NEW_LINE>holder.typeIcon.setPadding(padding, padding, padding, padding);<NEW_LINE>}<NEW_LINE>} | WindowUtil.dipToPx(context, 2); |
503,493 | private FlowScope traverseOptChain(Node n, FlowScope scope) {<NEW_LINE>checkArgument(NodeUtil.isOptChainNode(n));<NEW_LINE>if (NodeUtil.isEndOfOptChainSegment(n)) {<NEW_LINE>// Create new optional chain tracking object and push it onto the stack.<NEW_LINE>final Node startOfChain = NodeUtil.getStartOfOptChainSegment(n);<NEW_LINE>OptChainInfo optChainInfo = new OptChainInfo(n, startOfChain);<NEW_LINE>optChainArrayDeque.addFirst(optChainInfo);<NEW_LINE>}<NEW_LINE>FlowScope lhsScope = traverse(n.getFirstChild(), scope);<NEW_LINE>if (n.isOptionalChainStart()) {<NEW_LINE>// Store lhsScope into top-of-stack as unexecuted (unconditional) scope.<NEW_LINE>optChainArrayDeque.peekFirst().unconditionalScope = lhsScope;<NEW_LINE>}<NEW_LINE>// Traverse the remaining children and capture their changes into a new FlowScope var<NEW_LINE>// `aboutToExecuteScope`. This FlowScope must be constructed on top of the `lhsScope` and not<NEW_LINE>// the original scope `scope`, otherwise changes to outer variable that are preserved in the<NEW_LINE>// lhsScope would not be captured in the `aboutToExecuteScope`.<NEW_LINE>FlowScope aboutToExecuteScope = lhsScope;<NEW_LINE>Node nextChild = n.getSecondChild();<NEW_LINE>while (nextChild != null) {<NEW_LINE>aboutToExecuteScope = traverse(nextChild, aboutToExecuteScope);<NEW_LINE>nextChild = nextChild.getNext();<NEW_LINE>}<NEW_LINE>// Assigns the type to `n` assuming the entire chain executes and returns the the executed<NEW_LINE>// scope.<NEW_LINE>FlowScope executedScope = setOptChainNodeTypeAfterChildrenTraversed(n, aboutToExecuteScope);<NEW_LINE>// Unlike CALL, the OPTCHAIN_CALL nodes must not remain untyped when left child is untyped.<NEW_LINE>if (n.getJSType() == null) {<NEW_LINE>n.setJSType(unknownType);<NEW_LINE>}<NEW_LINE>if (NodeUtil.isEndOfOptChainSegment(n)) {<NEW_LINE>// Use the startNode's type to selectively join the executed scope with the unexecuted scope,<NEW_LINE>// and update the type assigned to `n` in `setXAfterChildrenTraversed()`<NEW_LINE>final Node startOfChain = NodeUtil.getStartOfOptChainSegment(n);<NEW_LINE>// Pop the stack to obtain the current chain.<NEW_LINE>OptChainInfo currentChain = optChainArrayDeque.removeFirst();<NEW_LINE>// Sanity check that the popped chain correctly corresponds to the current optional chain<NEW_LINE><MASK><NEW_LINE>checkState(currentChain.startOfChain == startOfChain);<NEW_LINE>final Node startNode = checkNotNull(startOfChain.getFirstChild());<NEW_LINE>return updateTypeWhenEndOfOptChain(n, startNode, currentChain, executedScope);<NEW_LINE>} else {<NEW_LINE>// `n` is just an inner node (i.e. not the end of the current chain). Simply return the<NEW_LINE>// executedScope.<NEW_LINE>return executedScope;<NEW_LINE>}<NEW_LINE>} | checkState(currentChain.endOfChain == n); |
294,037 | private int findOtherSubMessage(int partIndex) {<NEW_LINE>int count = msgPattern.countParts();<NEW_LINE>MessagePattern.Part part = msgPattern.getPart(partIndex);<NEW_LINE>if (part.getType().hasNumericValue()) {<NEW_LINE>++partIndex;<NEW_LINE>}<NEW_LINE>// Iterate over (ARG_SELECTOR [ARG_INT|ARG_DOUBLE] message) tuples<NEW_LINE>// until ARG_LIMIT or end of plural-only pattern.<NEW_LINE>do {<NEW_LINE>part = msgPattern.getPart(partIndex++);<NEW_LINE>MessagePattern.Part.Type type = part.getType();<NEW_LINE>if (type == MessagePattern.Part.Type.ARG_LIMIT) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>assert type == MessagePattern.Part.Type.ARG_SELECTOR;<NEW_LINE>// part is an ARG_SELECTOR followed by an optional explicit value, and then a message<NEW_LINE>if (msgPattern.partSubstringMatches(part, "other")) {<NEW_LINE>return partIndex;<NEW_LINE>}<NEW_LINE>if (msgPattern.getPartType(partIndex).hasNumericValue()) {<NEW_LINE>// skip the numeric-value part of "=1" etc.<NEW_LINE>++partIndex;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} while (++partIndex < count);<NEW_LINE>return 0;<NEW_LINE>} | partIndex = msgPattern.getLimitPartIndex(partIndex); |
731,840 | private static Vector apply(CompLongIntVector v1, LongDummyVector v2, Binary op) {<NEW_LINE>LongIntVector[] parts = v1.getPartitions();<NEW_LINE>Storage[] resParts = StorageSwitch.<MASK><NEW_LINE>if (!op.isKeepStorage()) {<NEW_LINE>for (int i = 0; i < parts.length; i++) {<NEW_LINE>if (parts[i].getStorage() instanceof LongIntSortedVectorStorage) {<NEW_LINE>resParts[i] = new LongIntSparseVectorStorage(parts[i].getDim(), parts[i].getStorage().getIndices(), parts[i].getStorage().getValues());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long subDim = (v1.getDim() + v1.getNumPartitions() - 1) / v1.getNumPartitions();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>int pidx = (int) (i / subDim);<NEW_LINE>long subidx = i % subDim;<NEW_LINE>((LongIntVectorStorage) resParts[pidx]).set(subidx, op.apply(parts[pidx].get(subidx), v2.get(i)));<NEW_LINE>}<NEW_LINE>LongIntVector[] res = new LongIntVector[parts.length];<NEW_LINE>int i = 0;<NEW_LINE>for (LongIntVector part : parts) {<NEW_LINE>res[i] = new LongIntVector(part.getMatrixId(), part.getRowId(), part.getClock(), part.getDim(), (LongIntVectorStorage) resParts[i]);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>v1.setPartitions(res);<NEW_LINE>return v1;<NEW_LINE>} | applyComp(v1, v2, op); |
16,839 | private void resetColorsCache(boolean useInbuiltDefaults) {<NEW_LINE>fColorsCache.clear();<NEW_LINE>for (EClass eClass : ArchimateModelUtils.getAllArchimateClasses()) {<NEW_LINE>Color color = useInbuiltDefaults ? ColorFactory.getInbuiltDefaultFillColor(eClass) : ColorFactory.getDefaultFillColor(eClass);<NEW_LINE>fColorsCache.put(eClass, new Color(color.getDevice(), color.getRGB()));<NEW_LINE>}<NEW_LINE>// Note Fill Color<NEW_LINE>EClass eClass = IArchimatePackage.eINSTANCE.getDiagramModelNote();<NEW_LINE>Color color = useInbuiltDefaults ? ColorFactory.getInbuiltDefaultFillColor(eClass) : ColorFactory.getDefaultFillColor(eClass);<NEW_LINE>fColorsCache.put(eClass, new Color(color.getDevice(), color.getRGB()));<NEW_LINE>// Group Fill Color<NEW_LINE>eClass = IArchimatePackage.eINSTANCE.getDiagramModelGroup();<NEW_LINE>color = useInbuiltDefaults ? ColorFactory.getInbuiltDefaultFillColor(eClass) : ColorFactory.getDefaultFillColor(eClass);<NEW_LINE>fColorsCache.put(eClass, new Color(color.getDevice(), color.getRGB()));<NEW_LINE>// Element line color<NEW_LINE>eClass = IArchimatePackage.eINSTANCE.getArchimateElement();<NEW_LINE>color = useInbuiltDefaults ? ColorFactory.getInbuiltDefaultLineColor(eClass) : ColorFactory.getDefaultLineColor(eClass);<NEW_LINE>fColorsCache.put(DEFAULT_ELEMENT_LINE_COLOR, new Color(color.getDevice(), color.getRGB()));<NEW_LINE>// Connection line color<NEW_LINE>eClass = IArchimatePackage.eINSTANCE.getArchimateRelationship();<NEW_LINE>color = useInbuiltDefaults ? ColorFactory.getInbuiltDefaultLineColor(eClass<MASK><NEW_LINE>fColorsCache.put(DEFAULT_CONNECTION_LINE_COLOR, new Color(color.getDevice(), color.getRGB()));<NEW_LINE>// Folder colours<NEW_LINE>for (FolderType folderType : FolderType.VALUES) {<NEW_LINE>if (folderType != FolderType.USER) {<NEW_LINE>// This is not used<NEW_LINE>color = useInbuiltDefaults ? FolderUIProvider.getDefaultFolderColor(folderType) : FolderUIProvider.getFolderColor(folderType);<NEW_LINE>fColorsCache.put(folderType, new Color(color.getDevice(), color.getRGB()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) : ColorFactory.getDefaultLineColor(eClass); |
252,867 | public synchronized void process(JCas jcas) throws AnalysisEngineProcessException {<NEW_LINE>JCas questionView, answerHitlist;<NEW_LINE>try {<NEW_LINE>questionView = jcas.getView("Question");<NEW_LINE>answerHitlist = jcas.getView("AnswerHitlist");<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AnalysisEngineProcessException(e);<NEW_LINE>}<NEW_LINE>QuestionInfo qi = JCasUtil.selectSingle(questionView, QuestionInfo.class);<NEW_LINE>Pattern ap = qi.getAnswerPattern() != null ? Pattern.compile(qi.getAnswerPattern(), Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE) : null;<NEW_LINE>double procTime = (System.currentTimeMillis() - qi.getProcBeginTime()) / 1000.0;<NEW_LINE>FSIndex idx = answerHitlist.getJFSIndexRepository().getIndex("SortedAnswers");<NEW_LINE>FSIterator answers = idx.iterator();<NEW_LINE>if (answers.hasNext()) {<NEW_LINE>String[] toplist = new String[topListLen];<NEW_LINE>int match = -1;<NEW_LINE>String matchText = ".";<NEW_LINE>int i = 0;<NEW_LINE>while (answers.hasNext()) {<NEW_LINE>Answer answer = <MASK><NEW_LINE>String text = answer.getText();<NEW_LINE>if (i < topListLen) {<NEW_LINE>toplist[i] = text + ":" + answer.getConfidence();<NEW_LINE>}<NEW_LINE>if (match < 0 && ap != null && ap.matcher(text).find()) {<NEW_LINE>match = i;<NEW_LINE>matchText = text;<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>double score = 0.0;<NEW_LINE>if (match >= 0)<NEW_LINE>score = 1.0 - Math.log(1 + match) / (double) Math.log(i);<NEW_LINE>output(qi, procTime, score, match, i, matchText, toplist);<NEW_LINE>} else { | (Answer) answers.next(); |
552,934 | protected Object rbTrEncMbcCaseFold(RubyEncoding enc, int flags, Object string, Object write_p, Object p, @CachedLibrary(limit = "LIBSTRING_CACHE") RubyStringLibrary strings, @CachedLibrary("write_p") InteropLibrary receivers, @Cached RopeNodes.BytesNode getBytes, @Cached TranslateInteropExceptionNode translateInteropExceptionNode) {<NEW_LINE>final byte[] bytes = getBytes.execute(strings.getRope(string));<NEW_LINE>final byte[] to = new byte[bytes.length];<NEW_LINE>final IntHolder intHolder = new IntHolder();<NEW_LINE>intHolder.value = 0;<NEW_LINE>final int resultLength = enc.jcoding.mbcCaseFold(flags, bytes, intHolder, bytes.length, to);<NEW_LINE>InteropNodes.execute(write_p, new Object[] { p, intHolder.value }, receivers, translateInteropExceptionNode);<NEW_LINE>final byte[] result = new byte[resultLength];<NEW_LINE>if (resultLength > 0) {<NEW_LINE>System.arraycopy(to, 0, result, 0, resultLength);<NEW_LINE>}<NEW_LINE>return StringOperations.createString(this, RopeOperations.create(result, USASCIIEncoding.INSTANCE, CodeRange<MASK><NEW_LINE>} | .CR_UNKNOWN), Encodings.US_ASCII); |
764,175 | public static UnsafeBuffer createDefaultHeader(final int sessionId, final int streamId, final int termId) {<NEW_LINE>final UnsafeBuffer buffer = new UnsafeBuffer(BufferUtil.allocateDirectAligned(HEADER_LENGTH, CACHE_LINE_LENGTH));<NEW_LINE>buffer.putByte(VERSION_FIELD_OFFSET, CURRENT_VERSION);<NEW_LINE>buffer.putByte(FLAGS_FIELD_OFFSET, (byte) BEGIN_AND_END_FLAGS);<NEW_LINE>buffer.putShort(TYPE_FIELD_OFFSET, (short) HDR_TYPE_DATA, LITTLE_ENDIAN);<NEW_LINE>buffer.putInt(SESSION_ID_FIELD_OFFSET, sessionId, LITTLE_ENDIAN);<NEW_LINE>buffer.<MASK><NEW_LINE>buffer.putInt(TERM_ID_FIELD_OFFSET, termId, LITTLE_ENDIAN);<NEW_LINE>buffer.putLong(RESERVED_VALUE_OFFSET, DEFAULT_RESERVE_VALUE);<NEW_LINE>return buffer;<NEW_LINE>} | putInt(STREAM_ID_FIELD_OFFSET, streamId, LITTLE_ENDIAN); |
654,132 | public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) {<NEW_LINE>List<Part> signedParts = new ArrayList<>();<NEW_LINE>Stack<Part> partsToCheck = new Stack<>();<NEW_LINE>partsToCheck.push(startPart);<NEW_LINE>while (!partsToCheck.isEmpty()) {<NEW_LINE>Part part = partsToCheck.pop();<NEW_LINE>if (messageCryptoAnnotations.has(part)) {<NEW_LINE>CryptoResultAnnotation resultAnnotation = messageCryptoAnnotations.get(part);<NEW_LINE><MASK><NEW_LINE>if (replacementData != null) {<NEW_LINE>part = replacementData;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Body body = part.getBody();<NEW_LINE>if (isPartMultipartSigned(part)) {<NEW_LINE>signedParts.add(part);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (body instanceof Multipart) {<NEW_LINE>Multipart multipart = (Multipart) body;<NEW_LINE>for (int i = multipart.getCount() - 1; i >= 0; i--) {<NEW_LINE>BodyPart bodyPart = multipart.getBodyPart(i);<NEW_LINE>partsToCheck.push(bodyPart);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return signedParts;<NEW_LINE>} | MimeBodyPart replacementData = resultAnnotation.getReplacementData(); |
51,268 | private static int interp(int rgb0, int rgb1, int fract0, int fract1) {<NEW_LINE>int a0 = (rgb0 >> 24) & 0xff;<NEW_LINE>int r0 = (rgb0 >> 16) & 0xff;<NEW_LINE>int g0 = (rgb0 >> 8) & 0xff;<NEW_LINE>int b0 = (rgb0) & 0xff;<NEW_LINE>int a1 = (rgb1 >> 24) & 0xff;<NEW_LINE>int r1 = (rgb1 >> 16) & 0xff;<NEW_LINE>int g1 = (rgb1 >> 8) & 0xff;<NEW_LINE><MASK><NEW_LINE>int a = (a0 * fract0 + a1 * fract1) >> 8;<NEW_LINE>int r = (r0 * fract0 + r1 * fract1) >> 8;<NEW_LINE>int g = (g0 * fract0 + g1 * fract1) >> 8;<NEW_LINE>int b = (b0 * fract0 + b1 * fract1) >> 8;<NEW_LINE>return (a << 24) | (r << 16) | (g << 8) | b;<NEW_LINE>} | int b1 = (rgb1) & 0xff; |
1,236,457 | private void addParametersToEachOperation(PathItem pathItem) {<NEW_LINE>if (settings.addParametersToEachOperation()) {<NEW_LINE>List<Parameter<MASK><NEW_LINE>if (parameters != null) {<NEW_LINE>// add parameters to each operation<NEW_LINE>List<Operation> operations = pathItem.readOperations();<NEW_LINE>if (operations != null) {<NEW_LINE>for (Operation operation : operations) {<NEW_LINE>List<Parameter> parametersToAdd = new ArrayList<>();<NEW_LINE>List<Parameter> existingParameters = operation.getParameters();<NEW_LINE>for (Parameter parameterToAdd : parameters) {<NEW_LINE>boolean matched = false;<NEW_LINE>for (Parameter existingParameter : existingParameters) {<NEW_LINE>if (parameterToAdd.getIn() != null && parameterToAdd.getIn().equals(existingParameter.getIn()) && parameterToAdd.getName().equals(existingParameter.getName())) {<NEW_LINE>matched = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!matched) {<NEW_LINE>parametersToAdd.add(parameterToAdd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parametersToAdd.size() > 0) {<NEW_LINE>operation.getParameters().addAll(0, parametersToAdd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remove the shared parameters<NEW_LINE>pathItem.setParameters(null);<NEW_LINE>}<NEW_LINE>} | > parameters = pathItem.getParameters(); |
1,375,836 | private void handleJsonRPCRequest(final RoutingContext routingContext) {<NEW_LINE>// first check token if authentication is required<NEW_LINE>final String token = getAuthToken(routingContext);<NEW_LINE>// we check the no auth api methods actually match what's in the request later on<NEW_LINE>if (authenticationService.isPresent() && token == null && config.getNoAuthRpcApis().isEmpty()) {<NEW_LINE>// no auth token when auth required<NEW_LINE>handleJsonRpcUnauthorizedError(routingContext, null, JsonRpcError.UNAUTHORIZED);<NEW_LINE>} else {<NEW_LINE>// Parse json<NEW_LINE>try {<NEW_LINE>final String json = routingContext<MASK><NEW_LINE>if (!json.isEmpty() && json.charAt(0) == '{') {<NEW_LINE>final JsonObject requestBodyJsonObject = ContextKey.REQUEST_BODY_AS_JSON_OBJECT.extractFrom(routingContext, () -> new JsonObject(json));<NEW_LINE>if (authenticationService.isPresent()) {<NEW_LINE>authenticationService.get().authenticate(token, user -> handleJsonSingleRequest(routingContext, requestBodyJsonObject, user));<NEW_LINE>} else {<NEW_LINE>handleJsonSingleRequest(routingContext, requestBodyJsonObject, Optional.empty());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final JsonArray array = new JsonArray(json);<NEW_LINE>if (array.size() < 1) {<NEW_LINE>handleJsonRpcError(routingContext, null, INVALID_REQUEST);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (authenticationService.isPresent()) {<NEW_LINE>authenticationService.get().authenticate(token, user -> handleJsonBatchRequest(routingContext, array, user));<NEW_LINE>} else {<NEW_LINE>handleJsonBatchRequest(routingContext, array, Optional.empty());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final DecodeException | NullPointerException ex) {<NEW_LINE>handleJsonRpcError(routingContext, null, JsonRpcError.PARSE_ERROR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getBodyAsString().trim(); |
920,270 | private void onSoundSettings() {<NEW_LINE>Uri current = Prefs.getChatRingtone(this, chatId);<NEW_LINE>Uri defaultUri = Prefs.getNotificationRingtone(this);<NEW_LINE>if (current == null)<NEW_LINE>current = Settings.System.DEFAULT_NOTIFICATION_URI;<NEW_LINE>else if (current.toString().isEmpty())<NEW_LINE>current = null;<NEW_LINE>Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);<NEW_LINE>intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);<NEW_LINE>intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);<NEW_LINE>intent.<MASK><NEW_LINE>intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);<NEW_LINE>intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, current);<NEW_LINE>startActivityForResult(intent, REQUEST_CODE_PICK_RINGTONE);<NEW_LINE>} | putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, defaultUri); |
210,036 | protected List<MemoryQueryResultRow> init(final ShardingRule shardingRule, final ShardingSphereSchema schema, final SQLStatementContext<?> sqlStatementContext, final List<QueryResult> queryResults) throws SQLException {<NEW_LINE>SelectStatementContext selectStatementContext = (SelectStatementContext) sqlStatementContext;<NEW_LINE>Map<GroupByValue, MemoryQueryResultRow> dataMap <MASK><NEW_LINE>Map<GroupByValue, Map<AggregationProjection, AggregationUnit>> aggregationMap = new HashMap<>(1024);<NEW_LINE>for (QueryResult each : queryResults) {<NEW_LINE>while (each.next()) {<NEW_LINE>GroupByValue groupByValue = new GroupByValue(each, selectStatementContext.getGroupByContext().getItems());<NEW_LINE>initForFirstGroupByValue(selectStatementContext, each, groupByValue, dataMap, aggregationMap);<NEW_LINE>aggregate(selectStatementContext, each, groupByValue, aggregationMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setAggregationValueToMemoryRow(selectStatementContext, dataMap, aggregationMap);<NEW_LINE>List<Boolean> valueCaseSensitive = queryResults.isEmpty() ? Collections.emptyList() : getValueCaseSensitive(queryResults.iterator().next(), selectStatementContext, schema);<NEW_LINE>return getMemoryResultSetRows(selectStatementContext, dataMap, valueCaseSensitive);<NEW_LINE>} | = new HashMap<>(1024); |
706,225 | private VaadinSession createAndRegisterSession(VaadinRequest request) throws ServiceException {<NEW_LINE>assert ((ReentrantLock) getSessionLock(request.getWrappedSession())).isHeldByCurrentThread() : "Session has not been locked by this thread";<NEW_LINE>VaadinSession session = createVaadinSession(request);<NEW_LINE>VaadinSession.setCurrent(session);<NEW_LINE>storeSession(session, request.getWrappedSession());<NEW_LINE>// Initial WebBrowser data comes from the request<NEW_LINE>session.<MASK><NEW_LINE>// Initial locale comes from the request<NEW_LINE>Locale locale = request.getLocale();<NEW_LINE>session.setLocale(locale);<NEW_LINE>session.setConfiguration(getDeploymentConfiguration());<NEW_LINE>session.setCommunicationManager(new LegacyCommunicationManager(session));<NEW_LINE>ServletPortletHelper.initDefaultUIProvider(session, this);<NEW_LINE>onVaadinSessionStarted(request, session);<NEW_LINE>return session;<NEW_LINE>} | getBrowser().updateRequestDetails(request); |
946,433 | final DeleteReportResult executeDeleteReport(DeleteReportRequest deleteReportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteReportRequest> request = null;<NEW_LINE>Response<DeleteReportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteReportRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteReportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReportResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,360,857 | private void transferFile() {<NEW_LINE>dumpParams();<NEW_LINE>// source includes /mnt/sdcard/ which would be prefixed again by the file transfer service, therefore we need to delete it<NEW_LINE>String source = path;<NEW_LINE>int sdcardPathPos = path.indexOf("/mnt/sdcard/");<NEW_LINE>if (sdcardPathPos == 0)<NEW_LINE>// 12 = length("/mnt/sdcard/")<NEW_LINE><MASK><NEW_LINE>FileTransferService.FileTransferProtocols protocol = null;<NEW_LINE>try {<NEW_LINE>URL destinationUrl = new URL(destination);<NEW_LINE>protocol = FileTransferService.parseProtocol(destinationUrl.getProtocol());<NEW_LINE>if (protocol != null) {<NEW_LINE>// Create the intent to initialise the FileTransferService, this will<NEW_LINE>// contain all attributes applicable to the transfer such as source,<NEW_LINE>// destination etc. The user does not have to specify all fields but<NEW_LINE>// if they have provided insufficient information the transfer will<NEW_LINE>// not succeed. The fields which need to be specified are identical to Browser<NEW_LINE>Intent transferIntent = new Intent(Common.mainActivity, FileTransferService.class);<NEW_LINE>// Add data to the intent<NEW_LINE>transferIntent.putExtra(FileTransferService.TransferProtocol, protocol);<NEW_LINE>transferIntent.putExtra(FileTransferService.FileDestination, false);<NEW_LINE>transferIntent.putExtra(FileTransferService.CreateFolders, true);<NEW_LINE>transferIntent.putExtra(FileTransferService.Port, destinationUrl.getPort());<NEW_LINE>transferIntent.putExtra(FileTransferService.Source, source);<NEW_LINE>transferIntent.putExtra(FileTransferService.Destination, destination);<NEW_LINE>transferIntent.putExtra(FileTransferService.Overwrite, true);<NEW_LINE>transferIntent.putExtra(FileTransferService.Copy, true);<NEW_LINE>transferIntent.putExtra(FileTransferService.Username, userName);<NEW_LINE>transferIntent.putExtra(FileTransferService.Password, password);<NEW_LINE>transferIntent.putExtra(FileTransferService.TransferEvent, mCaptureEvent);<NEW_LINE>// Specify our Broadcast receiver to be notified when the File Transfer has finished<NEW_LINE>transferIntent.putExtra(FileTransferService.IntentFilter, AUDIO_PLUGIN_TRANSFER_COMPLETE);<NEW_LINE>// Return ID allows us to distinguish between responses from the FileTransferService<NEW_LINE>transferIntent.putExtra(FileTransferService.ReturnID, AUDIO_TRANSFER_RETURN_ID);<NEW_LINE>// Start the File Transfer Service<NEW_LINE>Common.mainActivity.startService(transferIntent);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>Logger.E(TAG, "Passed URL is not formatted correctly");<NEW_LINE>}<NEW_LINE>} | source = path.substring(12); |
64,661 | public void checkValidProxy() throws InstallException {<NEW_LINE>String protocol = null;<NEW_LINE>if (envMap.get("https.proxyUser") != null) {<NEW_LINE>protocol = "https";<NEW_LINE>} else if (envMap.get("http.proxyUser") != null) {<NEW_LINE>protocol = "http";<NEW_LINE>}<NEW_LINE>String proxyPort = (String) <MASK><NEW_LINE>if (protocol != null) {<NEW_LINE>int proxyPortnum = Integer.parseInt(proxyPort);<NEW_LINE>if (((String) envMap.get(protocol + ".proxyHost")).isEmpty()) {<NEW_LINE>throw ExceptionUtils.createByKey("ERROR_TOOL_PROXY_HOST_MISSING");<NEW_LINE>} else if (proxyPortnum < 0 || proxyPortnum > 65535) {<NEW_LINE>throw ExceptionUtils.createByKey("ERROR_TOOL_INVALID_PROXY_PORT", proxyPort);<NEW_LINE>} else if (((String) envMap.get(protocol + ".proxyPassword")).isEmpty() || envMap.get(protocol + ".proxyPassword") == null) {<NEW_LINE>throw ExceptionUtils.createByKey("ERROR_TOOL_PROXY_PWD_MISSING");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | envMap.get(protocol + ".proxyPort"); |
596,507 | public void onActivityCreated(Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>mPaintView = getActivity().findViewById(R.id.custom_paint_view);<NEW_LINE>cancel = mainView.findViewById(R.id.paint_cancel);<NEW_LINE>apply = mainView.<MASK><NEW_LINE>mPaintModeView = mainView.findViewById(R.id.paint_thumb);<NEW_LINE>mColorListView = mainView.findViewById(R.id.paint_color_list);<NEW_LINE>mEraserView = mainView.findViewById(R.id.paint_eraser);<NEW_LINE>cancel.setOnClickListener(this);<NEW_LINE>apply.setOnClickListener(this);<NEW_LINE>mColorPicker = new ColorPicker(getActivity(), 255, 0, 0);<NEW_LINE>initColorListView();<NEW_LINE>mPaintModeView.setOnClickListener(this);<NEW_LINE>initStokeWidthPopWindow();<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>mPaintView.mDrawBit = savedInstanceState.getParcelable("Draw Bit");<NEW_LINE>CustomPaintView.mPaintCanvas = new Canvas(mPaintView.mDrawBit);<NEW_LINE>mStokeColor = savedInstanceState.getInt("Stoke Color");<NEW_LINE>mStokeWidth = savedInstanceState.getFloat("Stoke Width");<NEW_LINE>}<NEW_LINE>if (mStokeColor != Integer.MIN_VALUE && mStokeWidth != Integer.MIN_VALUE) {<NEW_LINE>mPaintModeView.setPaintStrokeColor(mStokeColor);<NEW_LINE>mPaintModeView.setPaintStrokeWidth(mStokeWidth);<NEW_LINE>setPaintColor(mStokeColor);<NEW_LINE>mPaintModeView.setPaintStrokeWidth(mStokeWidth);<NEW_LINE>}<NEW_LINE>mEraserView.setOnClickListener(this);<NEW_LINE>updateEraserView();<NEW_LINE>onShow();<NEW_LINE>} | findViewById(R.id.paint_apply); |
424,045 | private GitHubConnectorRequest prepareConnectorRequest(GitHubRequest request) throws IOException {<NEW_LINE>GitHubRequest.Builder<?<MASK><NEW_LINE>// if the authentication is needed but no credential is given, try it anyway (so that some calls<NEW_LINE>// that do work with anonymous access in the reduced form should still work.)<NEW_LINE>if (!request.allHeaders().containsKey("Authorization")) {<NEW_LINE>String authorization = getEncodedAuthorization();<NEW_LINE>if (authorization != null) {<NEW_LINE>builder.setHeader("Authorization", authorization);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (request.header("Accept") == null) {<NEW_LINE>builder.setHeader("Accept", "application/vnd.github.v3+json");<NEW_LINE>}<NEW_LINE>builder.setHeader("Accept-Encoding", "gzip");<NEW_LINE>if (request.hasBody()) {<NEW_LINE>if (request.body() != null) {<NEW_LINE>builder.contentType(defaultString(request.contentType(), "application/x-www-form-urlencoded"));<NEW_LINE>} else {<NEW_LINE>builder.contentType("application/json");<NEW_LINE>Map<String, Object> json = new HashMap<>();<NEW_LINE>for (GitHubRequest.Entry e : request.args()) {<NEW_LINE>json.put(e.key, e.value);<NEW_LINE>}<NEW_LINE>builder.with(new ByteArrayInputStream(getMappingObjectWriter().writeValueAsBytes(json)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | > builder = request.toBuilder(); |
343,488 | public void beginRestoreAsync() {<NEW_LINE>// BEGIN: readme-sample-beginRestoreAsync<NEW_LINE>String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";<NEW_LINE>String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";<NEW_LINE>// You can set a custom polling interval.<NEW_LINE>keyVaultBackupAsyncClient.beginRestore(folderUrl, sasToken).// You can set a custom polling interval.<NEW_LINE>setPollInterval(Duration.ofSeconds(1)).doOnError(e -> System.out.printf("Restore failed with error: %s.%n", e.getMessage())).doOnNext(pollResponse -> System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus())).filter(pollResponse -> pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED).flatMap(AsyncPollResponse::getFinalResult).subscribe(unused -> System<MASK><NEW_LINE>// END: readme-sample-beginRestoreAsync<NEW_LINE>} | .out.printf("Backup restored successfully.%n")); |
369,839 | private Toolbar createToolbar(Commands commands, PublishHtmlSource publishHtmlSource) {<NEW_LINE>Toolbar toolbar = new EditingTargetToolbar(commands, true, column_);<NEW_LINE>// Buttons are unique to a source column so require SourceAppCommands<NEW_LINE>SourceColumnManager mgr = RStudioGinjector.INSTANCE.getSourceColumnManager();<NEW_LINE>toolbar.addLeftWidget(mgr.getSourceCommand(commands.gotoProfileSource()<MASK><NEW_LINE>toolbar.addLeftWidget(mgr.getSourceCommand(commands.saveProfileAs(), column_).createToolbarButton());<NEW_LINE>toolbar.addLeftSeparator();<NEW_LINE>toolbar.addLeftWidget(mgr.getSourceCommand(commands.openProfileInBrowser(), column_).createToolbarButton());<NEW_LINE>toolbar.addRightWidget(publishButton_ = new RSConnectPublishButton(RSConnectPublishButton.HOST_PROFILER, RSConnect.CONTENT_TYPE_DOCUMENT, true, null));<NEW_LINE>publishButton_.setPublishHtmlSource(publishHtmlSource);<NEW_LINE>publishButton_.setContentType(RSConnect.CONTENT_TYPE_HTML);<NEW_LINE>return toolbar;<NEW_LINE>} | , column_).createToolbarButton()); |
297,403 | public com.squareup.okhttp.Call userGetWalletSummaryCall(String currency, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/user/walletSummary";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (currency != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("currency", currency));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/xml", "text/xml", "application/javascript", "text/javascript" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>final String <MASK><NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] { "apiExpires", "apiKey", "apiSignature" };<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
609,565 | public Object invoke(ConfigHandler handler, Object[] args, Object proxy) {<NEW_LINE>try {<NEW_LINE>if (SystemUtils.IS_JAVA_1_8) {<NEW_LINE>// hack to invoke default method of an interface reflectively<NEW_LINE>Constructor<MethodHandles.Lookup> lookupConstructor = MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, Integer.TYPE);<NEW_LINE>if (!lookupConstructor.isAccessible()) {<NEW_LINE>lookupConstructor.setAccessible(true);<NEW_LINE>}<NEW_LINE>return lookupConstructor.newInstance(configInterface, MethodHandles.Lookup.PRIVATE).unreflectSpecial(configMethod, configInterface).bindTo(proxy).invokeWithArguments(args);<NEW_LINE>} else {<NEW_LINE>return MethodHandles.lookup().findSpecial(configInterface, configMethod.getName(), MethodType.methodType(configMethod.getReturnType(), configMethod.getParameterTypes()), configInterface).bindTo<MASK><NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>throw new RuntimeException("Error invoking default method of config interface", throwable);<NEW_LINE>}<NEW_LINE>} | (proxy).invokeWithArguments(args); |
855,828 | protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0).getChildren().size() == 1 ? instruction.getOperands().get(0).getRootNode().getChildren().get(0).getChildren().get(0) : instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final Boolean wback = instruction.getOperands().get(0).getRootNode().getChildren().get(0).getChildren().size() == 1 ? true : false;<NEW_LINE>final int registerListLength = instruction.getOperands().get(1).getRootNode().getChildren().get(0).getChildren().size();<NEW_LINE>final String sourceRegister1 <MASK><NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>long baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>final String tmpAddress = environment.getNextVariableString();<NEW_LINE>instructions.add(ReilHelpers.createStr(baseOffset++, dw, sourceRegister1, dw, tmpAddress));<NEW_LINE>for (int i = 0; i < registerListLength; i++) {<NEW_LINE>final String currentRegisterValue = instruction.getOperands().get(1).getRootNode().getChildren().get(0).getChildren().get(i).getValue();<NEW_LINE>instructions.add(ReilHelpers.createLdm(baseOffset++, dw, tmpAddress, dw, currentRegisterValue));<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, dw, tmpAddress, bt, String.valueOf(4L), dw, tmpAddress));<NEW_LINE>}<NEW_LINE>if (wback) {<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, dw, sourceRegister1, dw, String.valueOf(registerListLength * 4), dw, sourceRegister1));<NEW_LINE>}<NEW_LINE>} | = (registerOperand1.getValue()); |
1,041,544 | protected void addCompletions(@NotNull CompletionParameters completionParameters, @NotNull ProcessingContext processingContext, @NotNull CompletionResultSet resultSet) {<NEW_LINE>if (!Symfony2ProjectComponent.isEnabled(completionParameters.getPosition())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>resultSet.restartCompletionOnPrefixChange(StandardPatterns.string().longerThan(1).with(new PatternCondition<>("include startsWith") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accepts(@NotNull String s, ProcessingContext processingContext) {<NEW_LINE>return "include".startsWith(s);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>if (!isCompletionStartingMatch("include", completionParameters, 2)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> extendsTemplateUsageAsOrderedList = TwigUtil.getIncludeTemplateUsageAsOrderedList(completionParameters.getPosition(<MASK><NEW_LINE>CompletionSorter completionSorter = CompletionService.getCompletionService().defaultSorter(completionParameters, resultSet.getPrefixMatcher()).weigh(new ServiceCompletionProvider.MyLookupElementWeigher(extendsTemplateUsageAsOrderedList));<NEW_LINE>resultSet = resultSet.withRelevanceSorter(completionSorter);<NEW_LINE>for (String s : extendsTemplateUsageAsOrderedList) {<NEW_LINE>resultSet.addElement(LookupElementBuilder.create(String.format("include '%s'", s)).withIcon(TwigIcons.TwigFileIcon));<NEW_LINE>}<NEW_LINE>} | ).getProject(), 50); |
596,197 | /* (non-Javadoc)<NEW_LINE>* @see com.ibm.ws.sib.processor.impl.interfaces.DownstreamControl#sendNotFlushedMessage(com.ibm.ws.sib.utils.SIBUuid12)<NEW_LINE>*<NEW_LINE>* Sends an 'I am not flushed' message in response to a query from a target<NEW_LINE>*/<NEW_LINE>public void sendNotFlushedMessage(SIBUuid8 ignore, SIBUuid12 streamID, long requestID) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "sendNotFlushedMessage", new Object[] { ignore, streamID, new Long(requestID) });<NEW_LINE>ControlNotFlushed notFlushed = createControlNotFlushed(streamID, requestID);<NEW_LINE>notFlushed = sourceStreamManager.stampNotFlushed(notFlushed);<NEW_LINE>// If the destination in a Link add Link specific properties to message<NEW_LINE>if (isLink) {<NEW_LINE>notFlushed <MASK><NEW_LINE>// The following is set so we can create the linkReceiver correctly on the<NEW_LINE>// other side of the link - 499581<NEW_LINE>notFlushed.setRoutingDestination(routingDestination);<NEW_LINE>} else if (this.isSystemOrTemp) {<NEW_LINE>// If the destination is system or temporary then the<NEW_LINE>// routingDestination into th message<NEW_LINE>notFlushed.setRoutingDestination(routingDestination);<NEW_LINE>}<NEW_LINE>mpio.sendToMe(routingMEUuid, SIMPConstants.MSG_HIGH_PRIORITY, notFlushed);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "sendNotFlushedMessage");<NEW_LINE>} | = (ControlNotFlushed) addLinkProps(notFlushed); |
292,270 | final ListDiscoveredResourcesResult executeListDiscoveredResources(ListDiscoveredResourcesRequest listDiscoveredResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDiscoveredResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListDiscoveredResourcesRequest> request = null;<NEW_LINE>Response<ListDiscoveredResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDiscoveredResourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDiscoveredResourcesRequest));<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, "Migration Hub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDiscoveredResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDiscoveredResourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDiscoveredResourcesResultJsonUnmarshaller());<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.ClientExecuteTime); |
1,299,965 | public static ListControlPoliciesResponse unmarshall(ListControlPoliciesResponse listControlPoliciesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listControlPoliciesResponse.setRequestId<MASK><NEW_LINE>listControlPoliciesResponse.setTotalCount(_ctx.integerValue("ListControlPoliciesResponse.TotalCount"));<NEW_LINE>listControlPoliciesResponse.setPageSize(_ctx.integerValue("ListControlPoliciesResponse.PageSize"));<NEW_LINE>listControlPoliciesResponse.setPageNumber(_ctx.integerValue("ListControlPoliciesResponse.PageNumber"));<NEW_LINE>List<ControlPolicy> controlPolicies = new ArrayList<ControlPolicy>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListControlPoliciesResponse.ControlPolicies.Length"); i++) {<NEW_LINE>ControlPolicy controlPolicy = new ControlPolicy();<NEW_LINE>controlPolicy.setUpdateDate(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].UpdateDate"));<NEW_LINE>controlPolicy.setDescription(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].Description"));<NEW_LINE>controlPolicy.setEffectScope(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].EffectScope"));<NEW_LINE>controlPolicy.setAttachmentCount(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].AttachmentCount"));<NEW_LINE>controlPolicy.setPolicyName(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].PolicyName"));<NEW_LINE>controlPolicy.setPolicyId(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].PolicyId"));<NEW_LINE>controlPolicy.setCreateDate(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].CreateDate"));<NEW_LINE>controlPolicy.setPolicyType(_ctx.stringValue("ListControlPoliciesResponse.ControlPolicies[" + i + "].PolicyType"));<NEW_LINE>controlPolicies.add(controlPolicy);<NEW_LINE>}<NEW_LINE>listControlPoliciesResponse.setControlPolicies(controlPolicies);<NEW_LINE>return listControlPoliciesResponse;<NEW_LINE>} | (_ctx.stringValue("ListControlPoliciesResponse.RequestId")); |
922,352 | public void marshall(Integration integration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (integration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(integration.getHttpMethod(), HTTPMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getUri(), URI_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getConnectionType(), CONNECTIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getConnectionId(), CONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCredentials(), CREDENTIALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getRequestParameters(), REQUESTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getRequestTemplates(), REQUESTTEMPLATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getPassthroughBehavior(), PASSTHROUGHBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getContentHandling(), CONTENTHANDLING_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getTimeoutInMillis(), TIMEOUTINMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCacheNamespace(), CACHENAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCacheKeyParameters(), CACHEKEYPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getIntegrationResponses(), INTEGRATIONRESPONSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getTlsConfig(), TLSCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | integration.getType(), TYPE_BINDING); |
995,794 | Map<String, Set<Integer>> queryPartitionNameAndIds(String clusterName) throws SQLException {<NEW_LINE>Map<String, Set<Integer>> nameAndIds = new HashMap<>();<NEW_LINE>try (Connection connection = dataSource.getConnection()) {<NEW_LINE>try (PreparedStatement queryStatement = connection.prepareStatement(queryPartitionIdAndNamesSql)) {<NEW_LINE>long startTimeMs = System.currentTimeMillis();<NEW_LINE><MASK><NEW_LINE>try (ResultSet resultSet = queryStatement.executeQuery()) {<NEW_LINE>while (resultSet.next()) {<NEW_LINE>int partitionId = resultSet.getInt(ID_COLUMN);<NEW_LINE>String partitionClassName = resultSet.getString(NAME_COLUMN);<NEW_LINE>nameAndIds.computeIfAbsent(partitionClassName, k -> new HashSet<>()).add(partitionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>metrics.readTimeMs.update(System.currentTimeMillis() - startTimeMs);<NEW_LINE>metrics.readSuccessCount.inc();<NEW_LINE>}<NEW_LINE>return nameAndIds;<NEW_LINE>} catch (SQLException e) {<NEW_LINE>metrics.readFailureCount.inc();<NEW_LINE>logger.error("Failed to execute query {}, with parameter {}", queryPartitionIdAndNamesSql, clusterName, e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | queryStatement.setString(1, clusterName); |
1,624,963 | public ChoiceContent unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ChoiceContent choiceContent = new ChoiceContent();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("DisplayText", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>choiceContent.setDisplayText(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Url", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>choiceContent.setUrl(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return choiceContent;<NEW_LINE>} | class).unmarshall(context)); |
275,190 | public static <R> Task<R> flatten(final String desc, final Task<Task<R>> task) {<NEW_LINE>ArgumentUtil.requireNotNull(task, "task");<NEW_LINE>Task<R> flattenTask = async(desc, context -> {<NEW_LINE>final SettablePromise<R> result = Promises.settable();<NEW_LINE>context.after(task).run(() -> {<NEW_LINE>try {<NEW_LINE>if (!task.isFailed()) {<NEW_LINE>Task<R> t = task.get();<NEW_LINE>if (t == null) {<NEW_LINE>throw new RuntimeException(desc + " returned null");<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>return t;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result.fail(task.getError());<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>result.fail(t);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>context.run(task);<NEW_LINE>return result;<NEW_LINE>});<NEW_LINE>flattenTask.getShallowTraceBuilder().setTaskType(TaskType.FLATTEN.getName());<NEW_LINE>return flattenTask;<NEW_LINE>} | Promises.propagateResult(t, result); |
222,165 | final DescribeCertificatesResult executeDescribeCertificates(DescribeCertificatesRequest describeCertificatesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCertificatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeCertificatesRequest> request = null;<NEW_LINE>Response<DescribeCertificatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeCertificatesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCertificatesRequest));<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, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCertificates");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeCertificatesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCertificatesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,782,763 | private Object addToPrimitiveArray(Object srcObj, FieldMap fieldMap, int size, Object srcCollectionValue, Object destObj, Class<?> destEntryType) {<NEW_LINE>Object result;<NEW_LINE>Object field = fieldMap.getDestValue(destObj);<NEW_LINE>int arraySize = 0;<NEW_LINE>if (field == null) {<NEW_LINE>result = Array.newInstance(destEntryType, size);<NEW_LINE>} else {<NEW_LINE>result = Array.newInstance(destEntryType, size + Array.getLength(field));<NEW_LINE>arraySize = Array.getLength(field);<NEW_LINE>System.arraycopy(field, 0, result, 0, arraySize);<NEW_LINE>}<NEW_LINE>// primitive arrays are ALWAYS cumulative<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>CopyByReferenceContainer copyByReferences = globalConfiguration.getCopyByReferences();<NEW_LINE>Object toValue;<NEW_LINE>if (srcCollectionValue != null && copyByReferences.contains(srcCollectionValue.getClass())) {<NEW_LINE>toValue = srcCollectionValue;<NEW_LINE>} else {<NEW_LINE>toValue = mapOrRecurseObject(srcObj, Array.get(srcCollectionValue, i), destEntryType, fieldMap, destObj);<NEW_LINE>}<NEW_LINE>Array.<MASK><NEW_LINE>arraySize++;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | set(result, arraySize, toValue); |
496,552 | private I_C_OrderLine createOrderLine(final PurchaseCandidate candidate) {<NEW_LINE>final int flatrateDataEntryId = candidate.getC_Flatrate_DataEntry_ID();<NEW_LINE>final <MASK><NEW_LINE>final Timestamp datePromised = candidate.getDatePromised();<NEW_LINE>final BigDecimal price = candidate.getPrice();<NEW_LINE>final I_C_OrderLine orderLine = orderLineBL.createOrderLine(order, I_C_OrderLine.class);<NEW_LINE>orderLine.setIsMFProcurement(true);<NEW_LINE>//<NEW_LINE>// BPartner/Location/Contact<NEW_LINE>OrderLineDocumentLocationAdapterFactory.locationAdapter(orderLine).setFromOrderHeader(order);<NEW_LINE>//<NEW_LINE>// PMM Contract<NEW_LINE>if (flatrateDataEntryId > 0) {<NEW_LINE>orderLine.setC_Flatrate_DataEntry_ID(flatrateDataEntryId);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Product/UOM/Handling unit<NEW_LINE>orderLine.setM_Product_ID(candidate.getM_Product_ID());<NEW_LINE>orderLine.setC_UOM_ID(candidate.getC_UOM_ID());<NEW_LINE>if (huPIItemProductId > 0) {<NEW_LINE>orderLine.setM_HU_PI_Item_Product_ID(huPIItemProductId);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// ASI<NEW_LINE>final AttributeSetInstanceId attributeSetInstanceId = candidate.getAttributeSetInstanceId();<NEW_LINE>final I_M_AttributeSetInstance contractASI = attributeSetInstanceId.isRegular() ? Services.get(IAttributeDAO.class).getAttributeSetInstanceById(attributeSetInstanceId) : null;<NEW_LINE>final I_M_AttributeSetInstance asi;<NEW_LINE>if (contractASI != null) {<NEW_LINE>asi = Services.get(IAttributeDAO.class).copy(contractASI);<NEW_LINE>} else {<NEW_LINE>asi = null;<NEW_LINE>}<NEW_LINE>orderLine.setPMM_Contract_ASI(contractASI);<NEW_LINE>orderLine.setM_AttributeSetInstance(asi);<NEW_LINE>//<NEW_LINE>// Quantities<NEW_LINE>orderLine.setQtyEntered(BigDecimal.ZERO);<NEW_LINE>orderLine.setQtyOrdered(BigDecimal.ZERO);<NEW_LINE>//<NEW_LINE>// Dates<NEW_LINE>orderLine.setDatePromised(datePromised);<NEW_LINE>//<NEW_LINE>// Pricing<NEW_LINE>// go with the candidate's price. e.g. don't reset it to 0 because we have no PL<NEW_LINE>orderLine.setIsManualPrice(true);<NEW_LINE>orderLine.setPriceEntered(price);<NEW_LINE>orderLine.setPriceActual(price);<NEW_LINE>//<NEW_LINE>// BPartner/Location/Contact<NEW_LINE>return orderLine;<NEW_LINE>} | int huPIItemProductId = candidate.getM_HU_PI_Item_Product_ID(); |
18,201 | // loads a single CSV file, filtering by date<NEW_LINE>private static void parseSingle(Predicate<LocalDate> datePredicate, CharSource resource, Map<LocalDate, ImmutableMap.Builder<FxRateId, FxRate>> mutableMap) {<NEW_LINE>try {<NEW_LINE>CsvFile csv = CsvFile.of(resource, true);<NEW_LINE>for (CsvRow row : csv.rows()) {<NEW_LINE>String <MASK><NEW_LINE>LocalDate date = LoaderUtils.parseDate(dateText);<NEW_LINE>if (datePredicate.test(date)) {<NEW_LINE>String currencyPairStr = row.getField(CURRENCY_PAIR_FIELD);<NEW_LINE>String valueStr = row.getField(VALUE_FIELD);<NEW_LINE>CurrencyPair currencyPair = CurrencyPair.parse(currencyPairStr);<NEW_LINE>double value = Double.valueOf(valueStr);<NEW_LINE>ImmutableMap.Builder<FxRateId, FxRate> builderForDate = mutableMap.computeIfAbsent(date, k -> ImmutableMap.builder());<NEW_LINE>builderForDate.put(FxRateId.of(currencyPair), FxRate.of(currencyPair, value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("Error processing resource as CSV file: {}", resource), ex);<NEW_LINE>}<NEW_LINE>} | dateText = row.getField(DATE_FIELD); |
62,790 | protected Result[] doSearch() {<NEW_LINE>// get a search client<NEW_LINE>BingSearchServiceClientFactory factory = BingSearchServiceClientFactory.newInstance();<NEW_LINE>BingSearchClient client = factory.createBingSearchClient();<NEW_LINE>// configure search client<NEW_LINE>SearchRequestBuilder builder = client.newSearchRequestBuilder();<NEW_LINE>builder.withAppId(BING_APP_ID);<NEW_LINE>builder.withQuery(query.getQueryString());<NEW_LINE>builder.withSourceType(SourceType.WEB);<NEW_LINE>builder.withVersion("2.0");<NEW_LINE>builder.withMarket("en-us");<NEW_LINE>builder.withAdultOption(AdultOption.MODERATE);<NEW_LINE>builder.withSearchOption(SearchOption.ENABLE_HIGHLIGHTING);<NEW_LINE>builder.withWebRequestCount((long) maxResults);<NEW_LINE>builder.withWebRequestOffset((long) firstResult);<NEW_LINE>builder.withWebRequestSearchOption(WebSearchOption.DISABLE_HOST_COLLAPSING);<NEW_LINE><MASK><NEW_LINE>// do the actual search here, and collect the results<NEW_LINE>SearchResponse response = client.search(builder.getResult());<NEW_LINE>List<WebResult> results = response.getWeb().getResults();<NEW_LINE>ArrayList<String> snippets = new ArrayList<String>();<NEW_LINE>ArrayList<String> urls = new ArrayList<String>();<NEW_LINE>for (WebResult result : results) {<NEW_LINE>snippets.add(result.getDescription());<NEW_LINE>urls.add(result.getUrl());<NEW_LINE>}<NEW_LINE>// return results<NEW_LINE>return getResults(Collections.toStringArray(snippets), Collections.toStringArray(urls), true);<NEW_LINE>} | builder.withWebRequestSearchOption(WebSearchOption.DISABLE_QUERY_ALTERATIONS); |
1,202,904 | protected void initChannel(Channel channel) throws Exception {<NEW_LINE>ChannelPipeline pipeline = channel.pipeline();<NEW_LINE>// Add the ConnectionLimitHandler to the pipeline if configured to do so.<NEW_LINE>if (TransportDescriptor.getNativeTransportMaxConcurrentConnections() > 0 || TransportDescriptor.getNativeTransportMaxConcurrentConnectionsPerIp() > 0) {<NEW_LINE>// Add as first to the pipeline so the limit is enforced as first action.<NEW_LINE>pipeline.addFirst("connectionLimitHandler", connectionLimitHandler);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (idleTimeout > 0) {<NEW_LINE>pipeline.addLast("idleStateHandler", new IdleStateHandler(false, 0, 0, idleTimeout, TimeUnit.MILLISECONDS) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) {<NEW_LINE>logger.info("Closing client connection {} after timeout of {}ms", channel.remoteAddress(), idleTimeout);<NEW_LINE>ctx.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (USE_PROXY_PROTOCOL) {<NEW_LINE>pipeline.addLast("proxyProtocol", new HAProxyProtocolDetectingDecoder());<NEW_LINE>}<NEW_LINE>// pipeline.addLast("debug", new LoggingHandler());<NEW_LINE>pipeline.addLast("frameDecoder", new Frame.Decoder(server::newConnection));<NEW_LINE>pipeline.addLast("frameEncoder", frameEncoder);<NEW_LINE>pipeline.addLast("inboundFrameTransformer", inboundFrameTransformer);<NEW_LINE>pipeline.addLast("outboundFrameTransformer", outboundFrameTransformer);<NEW_LINE>pipeline.addLast("messageDecoder", messageDecoder);<NEW_LINE>pipeline.addLast("messageEncoder", messageEncoder);<NEW_LINE>pipeline.addLast("executor", new Message.Dispatcher(TransportDescriptor.useNativeTransportLegacyFlusher(), EndpointPayloadTracker.get(((InetSocketAddress) channel.remoteAddress()).getAddress())));<NEW_LINE>// The exceptionHandler will take care of handling exceptionCaught(...) events while still<NEW_LINE>// running<NEW_LINE>// on the same EventLoop as all previous added handlers in the pipeline. This is important as<NEW_LINE>// the used<NEW_LINE>// eventExecutorGroup may not enforce strict ordering for channel events.<NEW_LINE>// As the exceptionHandler runs in the EventLoop as the previous handlers we are sure all<NEW_LINE>// exceptions are<NEW_LINE>// correctly handled before the handler itself is removed.<NEW_LINE>// See https://issues.apache.org/jira/browse/CASSANDRA-13649<NEW_LINE>pipeline.addLast("exceptionHandler", exceptionHandler);<NEW_LINE>} | long idleTimeout = TransportDescriptor.nativeTransportIdleTimeout(); |
1,845,553 | protected void adaptGetClassReturnTypeToReceiver(AnnotatedExecutableType getClassType, AnnotatedTypeMirror receiverType, ExpressionTree tree) {<NEW_LINE>TypeMirror type = TreeUtils.typeOf(tree);<NEW_LINE>AnnotatedTypeMirror returnType = AnnotatedTypeMirror.createType(type, this, false);<NEW_LINE>if (returnType == null || !(returnType.getKind() == TypeKind.DECLARED) || ((AnnotatedDeclaredType) returnType).getTypeArguments().size() != 1) {<NEW_LINE>throw new BugInCF(<MASK><NEW_LINE>}<NEW_LINE>AnnotatedWildcardType classWildcardArg = (AnnotatedWildcardType) ((AnnotatedDeclaredType) getClassType.getReturnType()).getTypeArguments().get(0);<NEW_LINE>getClassType.setReturnType(returnType);<NEW_LINE>// Usually, the only locations that will add annotations to the return type are getClass in stub<NEW_LINE>// files defaults and propagation tree annotator. Since getClass is final they cannot come from<NEW_LINE>// source code. Also, since the newBound is an erased type we have no type arguments. So, we<NEW_LINE>// just copy the annotations from the bound of the declared type to the new bound.<NEW_LINE>Set<AnnotationMirror> newAnnos = AnnotationUtils.createAnnotationSet();<NEW_LINE>Set<AnnotationMirror> typeBoundAnnos = getTypeDeclarationBounds(receiverType.getErased().getUnderlyingType());<NEW_LINE>Set<AnnotationMirror> wildcardBoundAnnos = classWildcardArg.getExtendsBound().getAnnotations();<NEW_LINE>for (AnnotationMirror typeBoundAnno : typeBoundAnnos) {<NEW_LINE>AnnotationMirror wildcardAnno = qualHierarchy.findAnnotationInSameHierarchy(wildcardBoundAnnos, typeBoundAnno);<NEW_LINE>if (qualHierarchy.isSubtype(typeBoundAnno, wildcardAnno)) {<NEW_LINE>newAnnos.add(typeBoundAnno);<NEW_LINE>} else {<NEW_LINE>newAnnos.add(wildcardAnno);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AnnotatedTypeMirror newTypeArg = ((AnnotatedDeclaredType) getClassType.getReturnType()).getTypeArguments().get(0);<NEW_LINE>((AnnotatedTypeVariable) newTypeArg).getUpperBound().replaceAnnotations(newAnnos);<NEW_LINE>} | "Unexpected type passed to AnnotatedTypes.adaptGetClassReturnTypeToReceiver%n" + "getClassType=%s%nreceiverType=%s", getClassType, receiverType); |
579,399 | public Problem checkParameters() {<NEW_LINE>String newName = refactoring.getNewName();<NEW_LINE>if (newName.length() == 0) {<NEW_LINE>// NOI18N<NEW_LINE>return new Problem(true, NbBundle.getMessage(CssRenameRefactoringPlugin.class, "MSG_Error_ElementEmpty"));<NEW_LINE>}<NEW_LINE>if (context instanceof CssElementContext.Editor) {<NEW_LINE>CssElementContext.Editor <MASK><NEW_LINE>char firstChar = refactoring.getNewName().charAt(0);<NEW_LINE>switch(editorContext.getElement().type()) {<NEW_LINE>case cssId:<NEW_LINE>case hexColor:<NEW_LINE>// hex color code<NEW_LINE>// id<NEW_LINE>if (firstChar != '#') {<NEW_LINE>// NOI18N<NEW_LINE>return new Problem(true, NbBundle.getMessage(CssRenameRefactoringPlugin.class, "MSG_Error_MissingHash"));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case cssClass:<NEW_LINE>// class<NEW_LINE>if (firstChar != '.') {<NEW_LINE>// NOI18N<NEW_LINE>return new Problem(true, NbBundle.getMessage(CssRenameRefactoringPlugin.class, "MSG_Error_MissingDot"));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (newName.length() == 1) {<NEW_LINE>// NOI18N<NEW_LINE>return new Problem(true, NbBundle.getMessage(CssRenameRefactoringPlugin.class, "MSG_Error_ElementShortName"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | editorContext = (CssElementContext.Editor) context; |
655,411 | private void runActionTypeInit(FormStructureHelper formStructureHelper) {<NEW_LINE>if ((request.getAttribute(FormsHelper.REQ_ATTR_IS_INIT) == null)) {<NEW_LINE>request.setAttribute(FormsHelper.REQ_ATTR_IS_INIT, "true");<NEW_LINE>final RequestPathInfo requestPathInfo = request.getRequestPathInfo();<NEW_LINE>if (response != null && !StringUtils.equals(requestPathInfo.getSelectorString(), SCRIPT_FORM_SERVER_VALIDATION) && StringUtils.isNotEmpty(actionType)) {<NEW_LINE>final Resource formStart = formStructureHelper.<MASK><NEW_LINE>try {<NEW_LINE>FormsHelper.runAction(actionType, INIT_SCRIPT, formStart, request, response);<NEW_LINE>} catch (IOException | ServletException e) {<NEW_LINE>LOGGER.error("Unable to initialise form " + resource.getPath(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>request.removeAttribute(FormsHelper.REQ_ATTR_IS_INIT);<NEW_LINE>}<NEW_LINE>} | getFormResource(request.getResource()); |
1,152,874 | public void createPartnerAddress(ActionRequest request, ActionResponse response) {<NEW_LINE><MASK><NEW_LINE>Context parentContext = context.getParent();<NEW_LINE>if (parentContext.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String parentModel = (String) parentContext.get("_model");<NEW_LINE>LOG.debug("Create partner address : Parent model = {}", parentModel);<NEW_LINE>String partnerField = PartnerAddressRepository.modelPartnerFieldMap.get(parentModel);<NEW_LINE>LOG.debug("Create partner address : Parent field = {}", partnerField);<NEW_LINE>Partner partner = null;<NEW_LINE>if (parentContext.get(partnerField) instanceof Partner) {<NEW_LINE>partner = (Partner) parentContext.get(partnerField);<NEW_LINE>} else if (parentContext.get(partnerField) instanceof Map) {<NEW_LINE>partner = Mapper.toBean(Partner.class, (Map<String, Object>) parentContext.get(partnerField));<NEW_LINE>}<NEW_LINE>LOG.debug("Create partner address : Partner = {}", partner);<NEW_LINE>if (partner == null || partner.getId() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Address address = context.asType(Address.class);<NEW_LINE>PartnerAddress partnerAddress = Beans.get(PartnerAddressRepository.class).all().filter("self.partner.id = ? AND self.address.id = ?", partner.getId(), address.getId()).fetchOne();<NEW_LINE>LOG.debug("Create partner address : Partner Address = {}", partnerAddress);<NEW_LINE>if (partnerAddress == null) {<NEW_LINE>partner = Beans.get(PartnerRepository.class).find(partner.getId());<NEW_LINE>address = Beans.get(AddressRepository.class).find(address.getId());<NEW_LINE>Boolean invoicing = (Boolean) context.get("isInvoicingAddr");<NEW_LINE>if (invoicing == null) {<NEW_LINE>invoicing = false;<NEW_LINE>}<NEW_LINE>Boolean delivery = (Boolean) context.get("isDeliveryAddr");<NEW_LINE>if (delivery == null) {<NEW_LINE>delivery = false;<NEW_LINE>}<NEW_LINE>Boolean isDefault = (Boolean) context.get("isDefault");<NEW_LINE>if (isDefault == null) {<NEW_LINE>isDefault = false;<NEW_LINE>}<NEW_LINE>PartnerService partnerService = Beans.get(PartnerService.class);<NEW_LINE>partnerService.addPartnerAddress(partner, address, isDefault, invoicing, delivery);<NEW_LINE>partnerService.savePartner(partner);<NEW_LINE>}<NEW_LINE>} | Context context = request.getContext(); |
164,810 | public static GetTaxTypeForAliResponse unmarshall(GetTaxTypeForAliResponse getTaxTypeForAliResponse, UnmarshallerContext _ctx) {<NEW_LINE>getTaxTypeForAliResponse.setRequestId<MASK><NEW_LINE>List<TaxTypeListItem> taxTypeList = new ArrayList<TaxTypeListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetTaxTypeForAliResponse.TaxTypeList.Length"); i++) {<NEW_LINE>TaxTypeListItem taxTypeListItem = new TaxTypeListItem();<NEW_LINE>taxTypeListItem.setId(_ctx.longValue("GetTaxTypeForAliResponse.TaxTypeList[" + i + "].Id"));<NEW_LINE>taxTypeListItem.setName(_ctx.stringValue("GetTaxTypeForAliResponse.TaxTypeList[" + i + "].Name"));<NEW_LINE>taxTypeListItem.setCode(_ctx.stringValue("GetTaxTypeForAliResponse.TaxTypeList[" + i + "].Code"));<NEW_LINE>taxTypeList.add(taxTypeListItem);<NEW_LINE>}<NEW_LINE>getTaxTypeForAliResponse.setTaxTypeList(taxTypeList);<NEW_LINE>return getTaxTypeForAliResponse;<NEW_LINE>} | (_ctx.stringValue("GetTaxTypeForAliResponse.RequestId")); |
1,108,140 | private DataSet<byte[]> clearObjs(DataSet<byte[]> raw) {<NEW_LINE>final int localSessionId = sessionId;<NEW_LINE>DataSet<byte[]> clear = expandDataSet2MaxParallelism(BatchOperator.getExecutionEnvironmentFromDataSets(raw).fromElements(0)).mapPartition(new RichMapPartitionFunction<Integer, byte[]>() {<NEW_LINE><NEW_LINE><MASK><NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mapPartition(Iterable<Integer> values, Collector<byte[]> out) {<NEW_LINE>SessionSharedObjs.clear(localSessionId);<NEW_LINE>}<NEW_LINE>}).withBroadcastSet(raw.mapPartition(new MapPartitionFunction<byte[], byte[]>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 570124206050744389L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mapPartition(Iterable<byte[]> values, Collector<byte[]> out) throws Exception {<NEW_LINE>// pass<NEW_LINE>}<NEW_LINE>}), "barrier");<NEW_LINE>return raw.map(new MapFunction<byte[], byte[]>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 6060666608672449498L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public byte[] map(byte[] value) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>}).withBroadcastSet(clear, "barrier").name("clearReturn");<NEW_LINE>} | private static final long serialVersionUID = -7819774126101954367L; |
1,221,817 | public boolean createQueue(String taskTrackerNodeGroup) {<NEW_LINE>String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);<NEW_LINE>DBCollection dbCollection = template.getCollection(tableName);<NEW_LINE>List<DBObject> indexInfo = dbCollection.getIndexInfo();<NEW_LINE>// create index if not exist<NEW_LINE>if (CollectionUtils.sizeOf(indexInfo) <= 1) {<NEW_LINE>template.ensureIndex(tableName, "idx_jobId", "jobId", true, true);<NEW_LINE>template.ensureIndex(tableName, <MASK><NEW_LINE>template.ensureIndex(tableName, "idx_taskTrackerIdentity", "taskTrackerIdentity");<NEW_LINE>template.ensureIndex(tableName, "idx_jobType", "jobType");<NEW_LINE>template.ensureIndex(tableName, "idx_realTaskId_taskTrackerNodeGroup", "realTaskId, taskTrackerNodeGroup");<NEW_LINE>template.ensureIndex(tableName, "idx_priority_triggerTime_gmtCreated", "priority,triggerTime,gmtCreated");<NEW_LINE>template.ensureIndex(tableName, "idx_isRunning", "isRunning");<NEW_LINE>LOGGER.info("create queue " + tableName);<NEW_LINE>}<NEW_LINE>EXIST_TABLE.add(tableName);<NEW_LINE>return true;<NEW_LINE>} | "idx_taskId_taskTrackerNodeGroup", "taskId, taskTrackerNodeGroup", true, true); |
1,086,692 | protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) {<NEW_LINE>if (!isDomainGridlinesVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object saved = g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);<NEW_LINE>for (Object o : ticks) {<NEW_LINE>ValueTick tick = (ValueTick) o;<NEW_LINE>double v = this.domainAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.BOTTOM);<NEW_LINE>Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());<NEW_LINE>g2.setPaint(getDomainGridlinePaint());<NEW_LINE><MASK><NEW_LINE>g2.draw(line);<NEW_LINE>}<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, saved);<NEW_LINE>} | g2.setStroke(getDomainGridlineStroke()); |
1,139,193 | public void generate() {<NEW_LINE>Stack<TypeElement> q = new Stack<TypeElement>();<NEW_LINE>Set<TypeElement> visited = new HashSet<TypeElement>();<NEW_LINE>q.push(clz);<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE>TypeElement t = q.pop();<NEW_LINE>// been here already<NEW_LINE>if (!visited.add(t))<NEW_LINE>continue;<NEW_LINE>for (javax.lang.model.element.Element child : t.getEnclosedElements()) {<NEW_LINE>switch(child.getKind()) {<NEW_LINE>case FIELD:<NEW_LINE>{<NEW_LINE>// ElementFilter.fieldsIn<NEW_LINE>generate(new Property.Field((VariableElement) child));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case METHOD:<NEW_LINE>{<NEW_LINE>generate(new Property.Method((ExecutableElement) child));<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TypeMirror it : clz.getInterfaces()) q.add((TypeElement) ((DeclaredType) it).asElement());<NEW_LINE>if (ElementKind.CLASS.equals(t.getKind())) {<NEW_LINE>TypeMirror sc = t.getSuperclass();<NEW_LINE>if (!TypeKind.NONE.equals(sc.getKind()))<NEW_LINE>q.add((TypeElement) ((DeclaredType<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>service.param("metadata", toCommaSeparatedString(metadata));<NEW_LINE>} | ) sc).asElement()); |
1,357,951 | public String visitQuery(final QueryContext context) {<NEW_LINE>final StringBuilder stringBuilder = new StringBuilder("SELECT ");<NEW_LINE>// visit as select items<NEW_LINE>final List<String> selectItemList = new ArrayList<>();<NEW_LINE>for (SelectItemContext selectItem : context.selectItem()) {<NEW_LINE>if (selectItem.getText().equals("*")) {<NEW_LINE>selectItemList.add("*");<NEW_LINE>} else {<NEW_LINE>selectItemList<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>stringBuilder.append(StringUtils.join(selectItemList, ", "));<NEW_LINE>// visit from statement<NEW_LINE>stringBuilder.append(String.format(" FROM %s", visit(context.from)));<NEW_LINE>// visit where statement<NEW_LINE>if (context.where != null) {<NEW_LINE>stringBuilder.append(String.format(" WHERE %s", visit(context.where)));<NEW_LINE>}<NEW_LINE>// visit partition by<NEW_LINE>if (context.partitionBy() != null) {<NEW_LINE>stringBuilder.append(String.format(" PARTITION BY %s", visit(context.partitionBy())));<NEW_LINE>}<NEW_LINE>// visit group by<NEW_LINE>if (context.groupBy() != null) {<NEW_LINE>stringBuilder.append(String.format(" GROUP BY %s", visit(context.groupBy())));<NEW_LINE>}<NEW_LINE>// visit emit changes<NEW_LINE>if (context.EMIT() != null) {<NEW_LINE>stringBuilder.append(" EMIT CHANGES");<NEW_LINE>}<NEW_LINE>return stringBuilder.toString();<NEW_LINE>} | .add(visit(selectItem)); |
980,883 | final DeleteVPCEConfigurationResult executeDeleteVPCEConfiguration(DeleteVPCEConfigurationRequest deleteVPCEConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteVPCEConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteVPCEConfigurationRequest> request = null;<NEW_LINE>Response<DeleteVPCEConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteVPCEConfigurationRequestProtocolMarshaller(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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteVPCEConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteVPCEConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteVPCEConfigurationResultJsonUnmarshaller());<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(deleteVPCEConfigurationRequest)); |
145,064 | public byte[] uncompress(byte[] content, final int offset, final int length) {<NEW_LINE>try {<NEW_LINE>final ByteArrayInputStream memoryInputStream = new ByteArrayInputStream(content, offset, length);<NEW_LINE>// 16KB<NEW_LINE>final GZIPInputStream gzipInputStream = new GZIPInputStream(memoryInputStream, 16384);<NEW_LINE>try {<NEW_LINE>final byte[] buffer = new byte[1024];<NEW_LINE>byte[] result = new byte[1024];<NEW_LINE>int bytesRead;<NEW_LINE>int len = 0;<NEW_LINE>while ((bytesRead = gzipInputStream.read(buffer, 0, buffer.length)) > -1) {<NEW_LINE>if (len + bytesRead > result.length) {<NEW_LINE><MASK><NEW_LINE>if (newSize < len + bytesRead)<NEW_LINE>newSize = Integer.MAX_VALUE;<NEW_LINE>final byte[] oldResult = result;<NEW_LINE>result = new byte[newSize];<NEW_LINE>System.arraycopy(oldResult, 0, result, 0, oldResult.length);<NEW_LINE>}<NEW_LINE>System.arraycopy(buffer, 0, result, len, bytesRead);<NEW_LINE>len += bytesRead;<NEW_LINE>}<NEW_LINE>return Arrays.copyOf(result, len);<NEW_LINE>} finally {<NEW_LINE>gzipInputStream.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new IllegalStateException("Exception during data uncompression", ioe);<NEW_LINE>}<NEW_LINE>} | int newSize = 2 * result.length; |
223,380 | public void initTeam(Long teamId, String operator) {<NEW_LINE>String teamDefaultRepo = System.getenv("TEAM_DEFAULT_REPO");<NEW_LINE>String teamDefaultRegistry = System.getenv("TEAM_DEFAULT_REGISTRY");<NEW_LINE>String <MASK><NEW_LINE>if (!StringUtils.isEmpty(teamDefaultRepo)) {<NEW_LINE>String repo = new String(Base64.getDecoder().decode(teamDefaultRepo));<NEW_LINE>TeamRepo teamRepo = JSONObject.parseObject(repo, TeamRepo.class);<NEW_LINE>teamRepo.setGmtCreate(System.currentTimeMillis() / 1000);<NEW_LINE>teamRepo.setGmtModified(System.currentTimeMillis() / 1000);<NEW_LINE>teamRepo.setCreator(operator);<NEW_LINE>teamRepo.setLastModifier(operator);<NEW_LINE>teamRepo.setTeamId(teamId);<NEW_LINE>teamRepoRepository.saveAndFlush(teamRepo);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isEmpty(teamDefaultRegistry)) {<NEW_LINE>String registry = new String(Base64.getDecoder().decode(teamDefaultRegistry));<NEW_LINE>TeamRegistry teamRegistry = JSONObject.parseObject(registry, TeamRegistry.class);<NEW_LINE>teamRegistry.setGmtCreate(System.currentTimeMillis() / 1000);<NEW_LINE>teamRegistry.setGmtModified(System.currentTimeMillis() / 1000);<NEW_LINE>teamRegistry.setCreator(operator);<NEW_LINE>teamRegistry.setLastModifier(operator);<NEW_LINE>teamRegistry.setTeamId(teamId);<NEW_LINE>teamRegistryRepository.saveAndFlush(teamRegistry);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isEmpty(teamDefaultAccount)) {<NEW_LINE>String account = new String(Base64.getDecoder().decode(teamDefaultAccount));<NEW_LINE>TeamAccount teamAccount = JSONObject.parseObject(account, TeamAccount.class);<NEW_LINE>teamAccount.setGmtCreate(System.currentTimeMillis() / 1000);<NEW_LINE>teamAccount.setGmtModified(System.currentTimeMillis() / 1000);<NEW_LINE>teamAccount.setCreator(operator);<NEW_LINE>teamAccount.setLastModifier(operator);<NEW_LINE>teamAccount.setTeamId(teamId);<NEW_LINE>teamAccountRepository.saveAndFlush(teamAccount);<NEW_LINE>}<NEW_LINE>} | teamDefaultAccount = System.getenv("TEAM_DEFAULT_ACCOUNT"); |
1,034,402 | public Container copy(final Container source, Host destination, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException {<NEW_LINE>if (!permissionAPI.doesUserHavePermission(source, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {<NEW_LINE>throw new DotSecurityException("You don't have permission to read the source container.");<NEW_LINE>}<NEW_LINE>if (!permissionAPI.doesUserHavePermission(destination, PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {<NEW_LINE>throw new DotSecurityException("You don't have permission to wirte in the destination folder.");<NEW_LINE>}<NEW_LINE>// gets the new information for the template from the request object<NEW_LINE><MASK><NEW_LINE>newContainer.copy(source);<NEW_LINE>final String appendToName = getAppendToContainerTitle(source.getTitle(), destination);<NEW_LINE>newContainer.setFriendlyName(source.getFriendlyName() + appendToName);<NEW_LINE>newContainer.setTitle(source.getTitle() + appendToName);<NEW_LINE>// creates new identifier for this webasset and persists it<NEW_LINE>final Identifier newIdentifier = APILocator.getIdentifierAPI().createNew(newContainer, destination);<NEW_LINE>newContainer.setIdentifier(newIdentifier.getId());<NEW_LINE>// persists the webasset<NEW_LINE>save(newContainer);<NEW_LINE>if (source.isWorking()) {<NEW_LINE>APILocator.getVersionableAPI().setWorking(newContainer);<NEW_LINE>}<NEW_LINE>if (source.isLive()) {<NEW_LINE>APILocator.getVersionableAPI().setLive(newContainer);<NEW_LINE>}<NEW_LINE>// issue-2093 Copying multiple structures per container<NEW_LINE>if (source.getMaxContentlets() > 0) {<NEW_LINE>final List<ContainerStructure> sourceCS = getContainerStructures(source);<NEW_LINE>final List<ContainerStructure> newContainerCS = new LinkedList<ContainerStructure>();<NEW_LINE>for (final ContainerStructure oldCS : sourceCS) {<NEW_LINE>final ContainerStructure newCS = new ContainerStructure();<NEW_LINE>newCS.setContainerId(newContainer.getIdentifier());<NEW_LINE>newCS.setContainerInode(newContainer.getInode());<NEW_LINE>newCS.setStructureId(oldCS.getStructureId());<NEW_LINE>newCS.setCode(oldCS.getCode());<NEW_LINE>newContainerCS.add(newCS);<NEW_LINE>}<NEW_LINE>saveContainerStructures(newContainerCS);<NEW_LINE>}<NEW_LINE>// Copy permissions<NEW_LINE>permissionAPI.copyPermissions(source, newContainer);<NEW_LINE>// saves to working folder under velocity<NEW_LINE>new ContainerLoader().invalidate(newContainer);<NEW_LINE>return newContainer;<NEW_LINE>} | final Container newContainer = new Container(); |
479,447 | public String show(@RequestParam(value = "cluster", required = true) String clusterName, @RequestParam(value = "host", required = true) String host, @RequestParam(value = "port", required = false) String logServerPort, @RequestParam(value = "dir", required = false) String dir, @RequestParam(value = "wport", required = false) String workerPort, @RequestParam(value = "file", required = false) String logName, @RequestParam(value = "tid", required = false) String topologyId, @RequestParam(value = "pos", required = false) String pos, ModelMap model) {<NEW_LINE>if (UIUtils.isValidSupervisorHost(clusterName, host)) {<NEW_LINE>UIUtils.addErrorAttribute(model, new RuntimeException("Not a valid host: " + host));<NEW_LINE>return "log";<NEW_LINE>}<NEW_LINE>clusterName = StringEscapeUtils.escapeHtml(clusterName);<NEW_LINE>topologyId = StringEscapeUtils.escapeHtml(topologyId);<NEW_LINE>if (StringUtils.isBlank(dir)) {<NEW_LINE>dir = ".";<NEW_LINE>}<NEW_LINE>Map conf = UIUtils.getNimbusConf(clusterName);<NEW_LINE>Event event = new Event(clusterName, host, logServerPort, logName, topologyId, workerPort, pos, dir, conf);<NEW_LINE>try {<NEW_LINE>requestLog(event, model);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>model.addAttribute("logName", event.logName);<NEW_LINE>model.addAttribute("host", host);<NEW_LINE>model.addAttribute("dir", event.dir);<NEW_LINE>model.addAttribute("clusterName", clusterName);<NEW_LINE>model.addAttribute("logServerPort", logServerPort);<NEW_LINE>model.addAttribute("topologyId", topologyId);<NEW_LINE>model.addAttribute("fullFile", getFullFile(event.dir, event.logName));<NEW_LINE><MASK><NEW_LINE>return "log";<NEW_LINE>} | model.addAttribute("workerPort", workerPort); |
1,754,528 | private void rotateDate() {<NEW_LINE>this.startDate = System.currentTimeMillis();<NEW_LINE>if (handler != null) {<NEW_LINE>handler.close();<NEW_LINE>}<NEW_LINE>SimpleDateFormat format = dateFormatThreadLocal.get();<NEW_LINE>String newPattern = pattern.replace("%d", format.format(new Date()));<NEW_LINE>// Get current date.<NEW_LINE>Calendar next = Calendar.getInstance();<NEW_LINE>// Begin of next date.<NEW_LINE>next.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>next.set(Calendar.MINUTE, 0);<NEW_LINE>next.set(Calendar.SECOND, 0);<NEW_LINE>next.set(Calendar.MILLISECOND, 0);<NEW_LINE>next.add(Calendar.DATE, 1);<NEW_LINE>this.endDate = next.getTimeInMillis();<NEW_LINE>try {<NEW_LINE>this.handler = new FileHandler(newPattern, limit, count, append);<NEW_LINE>if (initialized) {<NEW_LINE>handler.setEncoding(this.getEncoding());<NEW_LINE>handler.setErrorManager(this.getErrorManager());<NEW_LINE>handler.setFilter(this.getFilter());<NEW_LINE>handler.<MASK><NEW_LINE>handler.setLevel(this.getLevel());<NEW_LINE>}<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | setFormatter(this.getFormatter()); |
739,501 | public void onSuccess(@Nullable final Set<String> retainedMessageTopics) {<NEW_LINE>if (retainedMessageTopics == null || retainedMessageTopics.size() == 0) {<NEW_LINE>// Do nothing, we don't have retained messages<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Attention, this set is immutable, so we need a fresh mutable collection<NEW_LINE>final Queue<String> topics = new ConcurrentLinkedQueue<>(retainedMessageTopics);<NEW_LINE>final Integer clientReceiveMaximum = channel.attr(ChannelAttributes.CLIENT_CONNECTION).get().getClientReceiveMaximum();<NEW_LINE>int concurrentMessages = clientReceiveMaximum == null ? CONCURRENT_MESSAGES : Math.min(clientReceiveMaximum, CONCURRENT_MESSAGES);<NEW_LINE>concurrentMessages = Math.min(concurrentMessages, retainedMessageTopics.size());<NEW_LINE>final Topic[] topicBatch = new Topic[concurrentMessages];<NEW_LINE>for (int i = 0; i < concurrentMessages; i++) {<NEW_LINE>final String nextTopic = topics.poll();<NEW_LINE>topicBatch[i] = new Topic(nextTopic, subscription.getQoS(), subscription.isNoLocal(), subscription.isRetainAsPublished(), subscription.getRetainHandling(), subscription.getSubscriptionIdentifier());<NEW_LINE>}<NEW_LINE>final ListenableFuture<Void> sentFuture = <MASK><NEW_LINE>Futures.addCallback(sentFuture, new SendRetainedMessageListenerAndScheduleNext(subscription, topics, channel, retainedMessagesSender, concurrentMessages), channel.eventLoop());<NEW_LINE>} | retainedMessagesSender.writeRetainedMessages(channel, topicBatch); |
1,850,812 | public static void main(String... args) throws IOException, URISyntaxException {<NEW_LINE>// Figure out paths for current jar and patched jar<NEW_LINE>Path currentFile = Paths.get(PatcherTool.class.getProtectionDomain().getCodeSource().getLocation().toURI());<NEW_LINE>Path oldFile = Paths.get(args[0]);<NEW_LINE>System.out.println("Patch source: " + currentFile);<NEW_LINE>System.out.println("Old jar: " + oldFile);<NEW_LINE>Path patchedFile = Paths.get(<MASK><NEW_LINE>Files.copy(oldFile, patchedFile, StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>// Parse all options.<NEW_LINE>Set<Option> options = new HashSet<>();<NEW_LINE>for (int i = 1; i < args.length; i++) {<NEW_LINE>String option = args[i].substring(2).replace('-', '_').toUpperCase(Locale.ENGLISH);<NEW_LINE>assert option != null;<NEW_LINE>options.add(Option.valueOf(option));<NEW_LINE>}<NEW_LINE>// Open jars and patch target<NEW_LINE>try (FileSystem source = FileSystems.newFileSystem(currentFile, (ClassLoader) null);<NEW_LINE>FileSystem target = FileSystems.newFileSystem(patchedFile, (ClassLoader) null)) {<NEW_LINE>assert source != null;<NEW_LINE>assert target != null;<NEW_LINE>new PatcherTool(source, target).patch(options);<NEW_LINE>}<NEW_LINE>System.out.println("Successfully patched to " + patchedFile);<NEW_LINE>} | "patched-" + oldFile.getFileName()); |
1,404,659 | public void marshall(CreateExperimentTemplateTargetInput createExperimentTemplateTargetInput, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createExperimentTemplateTargetInput == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createExperimentTemplateTargetInput.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createExperimentTemplateTargetInput.getResourceArns(), RESOURCEARNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createExperimentTemplateTargetInput.getFilters(), FILTERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createExperimentTemplateTargetInput.getSelectionMode(), SELECTIONMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createExperimentTemplateTargetInput.getParameters(), PARAMETERS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createExperimentTemplateTargetInput.getResourceTags(), RESOURCETAGS_BINDING); |
914,377 | public FileVisitResult preVisitDirectory(java.nio.file.Path dir, BasicFileAttributes attrs) throws IOException {<NEW_LINE><MASK><NEW_LINE>if (count == 1) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>if (count == 2) {<NEW_LINE>// e.g. /9A/java.base<NEW_LINE>java.nio.file.Path mod = dir.getName(1);<NEW_LINE>if ((JRTUtil.MODULE_TO_LOAD != null && JRTUtil.MODULE_TO_LOAD.length() > 0 && JRTUtil.MODULE_TO_LOAD.indexOf(mod.toString()) == -1)) {<NEW_LINE>return FileVisitResult.SKIP_SUBTREE;<NEW_LINE>}<NEW_LINE>return ((notify & JRTUtil.NOTIFY_MODULES) == 0) ? FileVisitResult.CONTINUE : visitor.visitModule(dir);<NEW_LINE>}<NEW_LINE>if ((notify & JRTUtil.NOTIFY_PACKAGES) == 0) {<NEW_LINE>// client is not interested in packages<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>return visitor.visitPackage(dir.subpath(2, count), dir.getName(1), attrs);<NEW_LINE>} | int count = dir.getNameCount(); |
112,541 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String clusterName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (clusterName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); |
884,745 | public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>TreeSelectionModel sm = myTree.getSelectionModel();<NEW_LINE><MASK><NEW_LINE>if (query == null)<NEW_LINE>return;<NEW_LINE>List<TreePath> filtered = mySearch.findAllFilteredElements(query);<NEW_LINE>if (filtered.isEmpty())<NEW_LINE>return;<NEW_LINE>boolean alreadySelected = sm.getSelectionCount() == filtered.size() && ContainerUtil.and(filtered, (path) -> sm.isPathSelected(path));<NEW_LINE>if (alreadySelected) {<NEW_LINE>TreePath anchor = myTree.getAnchorSelectionPath();<NEW_LINE>sm.setSelectionPath(anchor);<NEW_LINE>myTree.setAnchorSelectionPath(anchor);<NEW_LINE>mySearch.findAndSelectElement(query);<NEW_LINE>} else {<NEW_LINE>TreePath currentElement = (TreePath) mySearch.findElement(query);<NEW_LINE>TreePath anchor = ObjectUtils.chooseNotNull(currentElement, filtered.get(0));<NEW_LINE>sm.setSelectionPaths(filtered.toArray(new TreePath[0]));<NEW_LINE>myTree.setAnchorSelectionPath(anchor);<NEW_LINE>}<NEW_LINE>} | String query = mySearch.getEnteredPrefix(); |
1,385,461 | private MethodSpec factoryModelMethodUnderContainer(ObjectResolvedType type) {<NEW_LINE>Builder factory = MethodSpec.methodBuilder("new" + type.getName()).addModifiers(PUBLIC).returns(getTypeName(type));<NEW_LINE>List<CodeBlock> <MASK><NEW_LINE>type.getProperties().stream().filter(f -> !isASchemaUrlField(f)).forEach(f -> {<NEW_LINE>if (isAProducerField(f)) {<NEW_LINE>factoryParams.add(CodeBlock.of("this.producer"));<NEW_LINE>} else {<NEW_LINE>factory.addParameter(ParameterSpec.builder(getTypeName(f.getType()), f.getName()).build());<NEW_LINE>factory.addJavadoc("@param $N $N\n", f.getName(), f.getDescription() == null ? "the " + f.getName() : f.getDescription());<NEW_LINE>factoryParams.add(CodeBlock.of("$N", f.getName()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>factory.addJavadoc("@return $N", type.getName());<NEW_LINE>factory.addCode("return new $N(", type.getName());<NEW_LINE>factory.addCode(CodeBlock.join(factoryParams, ", "));<NEW_LINE>factory.addCode(");\n");<NEW_LINE>return factory.build();<NEW_LINE>} | factoryParams = new ArrayList<>(); |
457,947 | public TextCommand parser(TextDecoder decoder, String cmd, int space) {<NEW_LINE>StringTokenizer st = new StringTokenizer(cmd);<NEW_LINE>st.nextToken();<NEW_LINE>String key;<NEW_LINE>int valueLen;<NEW_LINE>int flag;<NEW_LINE>int expiration;<NEW_LINE>boolean noReply = false;<NEW_LINE>if (st.hasMoreTokens()) {<NEW_LINE>key = st.nextToken();<NEW_LINE>} else {<NEW_LINE>return new ErrorCommand(ERROR_CLIENT);<NEW_LINE>}<NEW_LINE>if (st.hasMoreTokens()) {<NEW_LINE>flag = Integer.<MASK><NEW_LINE>} else {<NEW_LINE>return new ErrorCommand(ERROR_CLIENT);<NEW_LINE>}<NEW_LINE>if (st.hasMoreTokens()) {<NEW_LINE>expiration = Integer.parseInt(st.nextToken());<NEW_LINE>} else {<NEW_LINE>return new ErrorCommand(ERROR_CLIENT);<NEW_LINE>}<NEW_LINE>if (st.hasMoreTokens()) {<NEW_LINE>valueLen = Integer.parseInt(st.nextToken());<NEW_LINE>} else {<NEW_LINE>return new ErrorCommand(ERROR_CLIENT);<NEW_LINE>}<NEW_LINE>if (st.hasMoreTokens()) {<NEW_LINE>noReply = "noreply".equals(st.nextToken());<NEW_LINE>}<NEW_LINE>return new SetCommand(type, key, flag, expiration, valueLen, noReply);<NEW_LINE>} | parseInt(st.nextToken()); |
1,687,194 | public static ListPrefixListsResponse unmarshall(ListPrefixListsResponse listPrefixListsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listPrefixListsResponse.setRequestId(_ctx.stringValue("ListPrefixListsResponse.RequestId"));<NEW_LINE>listPrefixListsResponse.setNextToken(_ctx.stringValue("ListPrefixListsResponse.NextToken"));<NEW_LINE>listPrefixListsResponse.setTotalCount(_ctx.longValue("ListPrefixListsResponse.TotalCount"));<NEW_LINE>listPrefixListsResponse.setMaxResults(_ctx.longValue("ListPrefixListsResponse.MaxResults"));<NEW_LINE>List<PrefixList> prefixLists = new ArrayList<PrefixList>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListPrefixListsResponse.PrefixLists.Length"); i++) {<NEW_LINE>PrefixList prefixList = new PrefixList();<NEW_LINE>prefixList.setPrefixListId(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListId"));<NEW_LINE>prefixList.setPrefixListStatus(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListStatus"));<NEW_LINE>prefixList.setPrefixListName(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListName"));<NEW_LINE>prefixList.setPrefixListDescription(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListDescription"));<NEW_LINE>prefixList.setIpVersion(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].IpVersion"));<NEW_LINE>prefixList.setCreationTime(_ctx.stringValue<MASK><NEW_LINE>List<String> cidrBlocks = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListPrefixListsResponse.PrefixLists[" + i + "].CidrBlocks.Length"); j++) {<NEW_LINE>cidrBlocks.add(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].CidrBlocks[" + j + "]"));<NEW_LINE>}<NEW_LINE>prefixList.setCidrBlocks(cidrBlocks);<NEW_LINE>prefixLists.add(prefixList);<NEW_LINE>}<NEW_LINE>listPrefixListsResponse.setPrefixLists(prefixLists);<NEW_LINE>return listPrefixListsResponse;<NEW_LINE>} | ("ListPrefixListsResponse.PrefixLists[" + i + "].CreationTime")); |
1,454,585 | private static ConstantPoolInfo loadConstantPoolInfo(DataInputStream dis) throws IOException {<NEW_LINE>byte tag = dis.readByte();<NEW_LINE>// System.out.println("tag=" + tag);<NEW_LINE>switch(tag) {<NEW_LINE>case 7:<NEW_LINE>return new ConstantClassInfo(dis.readShort());<NEW_LINE>case 9:<NEW_LINE>return new ConstantFieldrefInfo(dis.readShort(), dis.readShort());<NEW_LINE>case 10:<NEW_LINE>return new ConstantMethodrefInfo(dis.readShort(), dis.readShort());<NEW_LINE>case 11:<NEW_LINE>return new ConstantInterfaceMethodrefInfo(dis.readShort(), dis.readShort());<NEW_LINE>case 8:<NEW_LINE>return new ConstantStringInfo(dis.readShort());<NEW_LINE>case 3:<NEW_LINE>return new ConstantIntegerInfo(dis.readInt());<NEW_LINE>case 4:<NEW_LINE>return new ConstantFloatInfo(dis.readFloat());<NEW_LINE>case 5:<NEW_LINE>return new ConstantLongInfo(dis.readLong());<NEW_LINE>case 6:<NEW_LINE>return new ConstantDoubleInfo(dis.readDouble());<NEW_LINE>case 12:<NEW_LINE>return new ConstantNameAndTypeInfo(dis.readShort(), dis.readShort());<NEW_LINE>case 1:<NEW_LINE>return new ConstantUtf8Info(dis.readUTF());<NEW_LINE>case 15:<NEW_LINE>return new ConstantMethodHandleInfo(dis.readByte(<MASK><NEW_LINE>case 16:<NEW_LINE>return new ConstantMethodTypeInfo(dis.readShort());<NEW_LINE>case 18:<NEW_LINE>return new ConstantInvokeDynamicInfo(dis.readShort(), dis.readShort());<NEW_LINE>default:<NEW_LINE>throw new ClassFileException("Invalid constant pool tag " + tag);<NEW_LINE>}<NEW_LINE>} | ), dis.readShort()); |
1,769,525 | protected void openAddLoggerDialog() {<NEW_LINE>AdditionLoggerWindow additionLogger = (AdditionLoggerWindow) openWindow("serverLogAddLoggerDialog", OpenType.DIALOG);<NEW_LINE>additionLogger.addCloseListener(actionId -> {<NEW_LINE>if (COMMIT_ACTION_ID.equals(actionId)) {<NEW_LINE>Level level = additionLogger.getSelectedLevel();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>jmxRemoteLoggingAPI.setLoggerLevel(getSelectedConnection(), loggerName, level.toString());<NEW_LINE>} catch (LogControlException | JmxControlException e) {<NEW_LINE>log.error("Error setting logger level", e);<NEW_LINE>showNotification(getMessage("exception.logControl"), NotificationType.ERROR);<NEW_LINE>}<NEW_LINE>showNotification(formatMessage("logger.setMessage", loggerName, level.toString()));<NEW_LINE>refreshLoggers();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>loggerNameField.setValue(null);<NEW_LINE>loggerLevelField.setValue(null);<NEW_LINE>} | String loggerName = additionLogger.getSelectedLoggerName(); |
518,066 | private InsertTabletPlan constructInsertTabletPlan(TSInsertTabletsReq req, int i) throws IllegalPathException {<NEW_LINE>InsertTabletPlan insertTabletPlan = new InsertTabletPlan(new PartialPath(req.prefixPaths.get(i)), req.measurementsList.get(i));<NEW_LINE>insertTabletPlan.setTimes(QueryDataSetUtils.readTimesFromBuffer(req.timestampsList.get(i), req.sizeList.get(i)));<NEW_LINE>insertTabletPlan.setColumns(QueryDataSetUtils.readValuesFromBuffer(req.valuesList.get(i), req.typesList.get(i), req.measurementsList.get(i).size(), req.sizeList.get(i)));<NEW_LINE>insertTabletPlan.setBitMaps(QueryDataSetUtils.readBitMapsFromBuffer(req.valuesList.get(i), req.measurementsList.get(i).size(), req.sizeList.get(i)));<NEW_LINE>insertTabletPlan.setRowCount(req.sizeList.get(i));<NEW_LINE>insertTabletPlan.setDataTypes(req<MASK><NEW_LINE>insertTabletPlan.setAligned(req.isAligned);<NEW_LINE>return insertTabletPlan;<NEW_LINE>} | .typesList.get(i)); |
879,072 | public void prepare(final Map stormConf, final TopologyContext context, final OutputCollector collector) {<NEW_LINE>IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));<NEW_LINE>try {<NEW_LINE>IFn preparer = (IFn) hof.applyTo(RT.seq(_params));<NEW_LINE>final Map<Keyword, Object> collectorMap = new PersistentArrayMap(new Object[] { Keyword.intern(Symbol.create("output-collector")), collector, Keyword.intern(Symbol.create("context")), context });<NEW_LINE>List<Object> args = new ArrayList<Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>add(stormConf);<NEW_LINE>add(context);<NEW_LINE>add(collectorMap);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>_bolt = (IBolt) preparer.applyTo(RT.seq(args));<NEW_LINE>// this is kind of unnecessary for clojure<NEW_LINE>try {<NEW_LINE>_bolt.<MASK><NEW_LINE>} catch (AbstractMethodError ignored) {<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | prepare(stormConf, context, collector); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.