idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,089,625
@RequestMapping(value = "/alarm/{alarmId}", method = RequestMethod.DELETE)<NEW_LINE>@ResponseBody<NEW_LINE>public Boolean deleteAlarm(@ApiParam(value = ALARM_ID_PARAM_DESCRIPTION) @PathVariable(ALARM_ID) String strAlarmId) throws ThingsboardException {<NEW_LINE>checkParameter(ALARM_ID, strAlarmId);<NEW_LINE>try {<NEW_LINE>AlarmId alarmId = new AlarmId(toUUID(strAlarmId));<NEW_LINE>Alarm alarm = checkAlarmId(alarmId, Operation.WRITE);<NEW_LINE>List<EdgeId> relatedEdgeIds = findRelatedEdgeIds(getTenantId(), alarm.getOriginator());<NEW_LINE>logEntityAction(alarm.getOriginator(), alarm, getCurrentUser().getCustomerId(), ActionType.ALARM_DELETE, null);<NEW_LINE>sendAlarmDeleteNotificationMsg(getTenantId(), alarmId, relatedEdgeIds, alarm);<NEW_LINE>return alarmService.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw handleException(e);<NEW_LINE>}<NEW_LINE>}
deleteAlarm(getTenantId(), alarmId);
1,722,977
public static void lsfAnalysis(BaselineAdaptationSet fileSet, LsfFileHeader lsfParams, boolean isForcedAnalysis) throws IOException {<NEW_LINE>System.err.println("Starting LSF analysis...");<NEW_LINE>boolean bAnalyze;<NEW_LINE>for (int i = 0; i < fileSet.items.length; i++) {<NEW_LINE>bAnalyze = true;<NEW_LINE>if (!isForcedAnalysis && FileUtils.exists(fileSet.items[i].lsfFile)) {<NEW_LINE>LsfFileHeader tmpParams = new LsfFileHeader(fileSet.items[i].lsfFile);<NEW_LINE>if (tmpParams.isIdenticalAnalysisParams(lsfParams))<NEW_LINE>bAnalyze = false;<NEW_LINE>}<NEW_LINE>if (bAnalyze) {<NEW_LINE>LsfAnalyser.lsfAnalyzeWavFile(fileSet.items[i].audioFile, fileSet.items<MASK><NEW_LINE>System.err.println("Extracted LSFs: " + fileSet.items[i].lsfFile);<NEW_LINE>} else<NEW_LINE>System.err.println("LSF file found with identical analysis parameters: " + fileSet.items[i].lsfFile);<NEW_LINE>}<NEW_LINE>System.err.println("LSF analysis completed...");<NEW_LINE>}
[i].lsfFile, lsfParams);
1,302,192
public Sequence execute(final StaticContext sctx, final QueryContext ctx, final Sequence[] args) {<NEW_LINE>if (args.length != 2 && args.length != 3) {<NEW_LINE>throw new QueryException(new QNm("No valid arguments specified!"));<NEW_LINE>}<NEW_LINE>final XmlDBNode doc = ((XmlDBNode) args[0]);<NEW_LINE>final XmlNodeReadOnlyTrx rtx = doc.getTrx();<NEW_LINE>final XmlResourceManager manager = rtx.getResourceManager();<NEW_LINE>final Optional<XmlNodeTrx> optionalWriteTrx = manager.getNodeTrx();<NEW_LINE>final XmlNodeTrx wtx = optionalWriteTrx.orElseGet(() -> manager.beginNodeTrx());<NEW_LINE>if (rtx.getRevisionNumber() < manager.getMostRecentRevisionNumber()) {<NEW_LINE>wtx.revertTo(rtx.getRevisionNumber());<NEW_LINE>}<NEW_LINE>final XmlIndexController controller = wtx.getResourceManager().getWtxIndexController(wtx.getRevisionNumber() - 1);<NEW_LINE>if (controller == null) {<NEW_LINE>throw new QueryException(new QNm("Document not found: " + ((Str) args[1]).stringValue()));<NEW_LINE>}<NEW_LINE>final Set<Path<QNm>> paths = new HashSet<>();<NEW_LINE>if (args.length > 1 && args[1] != null) {<NEW_LINE>final Iter it = args[1].iterate();<NEW_LINE><MASK><NEW_LINE>while (next != null) {<NEW_LINE>paths.add(Path.parse(((Str) next).stringValue()));<NEW_LINE>next = it.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final IndexDef idxDef = IndexDefs.createPathIdxDef(paths, controller.getIndexes().getNrOfIndexDefsWithType(IndexType.PATH), IndexDef.DbType.XML);<NEW_LINE>try {<NEW_LINE>controller.createIndexes(ImmutableSet.of(idxDef), wtx);<NEW_LINE>} catch (final SirixIOException e) {<NEW_LINE>throw new QueryException(new QNm("I/O exception: " + e.getMessage()), e);<NEW_LINE>}<NEW_LINE>return idxDef.materialize();<NEW_LINE>}
Item next = it.next();
122,943
private List<ThemeFile> scan(@NonNull Path rootPath) {<NEW_LINE>Assert.notNull(rootPath, "Root path must not be null");<NEW_LINE>// Check file type<NEW_LINE>if (!Files.isDirectory(rootPath)) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>try (Stream<Path> pathStream = Files.list(rootPath)) {<NEW_LINE>List<ThemeFile> <MASK><NEW_LINE>pathStream.forEach(path -> {<NEW_LINE>// Build theme file<NEW_LINE>ThemeFile themeFile = new ThemeFile();<NEW_LINE>themeFile.setName(path.getFileName().toString());<NEW_LINE>themeFile.setPath(path.toString());<NEW_LINE>themeFile.setIsFile(Files.isRegularFile(path));<NEW_LINE>themeFile.setEditable(isEditable(path));<NEW_LINE>if (Files.isDirectory(path)) {<NEW_LINE>themeFile.setNode(scan(path));<NEW_LINE>}<NEW_LINE>// Add to theme files<NEW_LINE>themeFiles.add(themeFile);<NEW_LINE>});<NEW_LINE>// Sort with isFile param<NEW_LINE>themeFiles.sort(new ThemeFile());<NEW_LINE>return themeFiles;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ServiceException("Failed to list sub files", e);<NEW_LINE>}<NEW_LINE>}
themeFiles = new LinkedList<>();
1,016,115
private void initFileDownload(Resource file) {<NEW_LINE>filename = properties.get(<MASK><NEW_LINE>if (StringUtils.isNotEmpty(filename)) {<NEW_LINE>Resource fileContent = file.getChild(JcrConstants.JCR_CONTENT);<NEW_LINE>if (fileContent != null) {<NEW_LINE>ValueMap valueMap = fileContent.adaptTo(ValueMap.class);<NEW_LINE>if (valueMap != null) {<NEW_LINE>format = valueMap.get(JcrConstants.JCR_MIMETYPE, String.class);<NEW_LINE>if (StringUtils.isNotEmpty(format)) {<NEW_LINE>extension = mimeTypeService.getExtension(format);<NEW_LINE>}<NEW_LINE>Calendar calendar = valueMap.get(JcrConstants.JCR_LASTMODIFIED, Calendar.class);<NEW_LINE>if (calendar != null) {<NEW_LINE>lastModified = calendar.getTimeInMillis();<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(format)) {<NEW_LINE>extension = mimeTypeService.getExtension(format);<NEW_LINE>}<NEW_LINE>url = linkHandler.getLink(getDownloadUrl(file) + "/" + filename, null).map(Link::getURL).orElse(null);<NEW_LINE>size = FileUtils.byteCountToDisplaySize(getFileSize(fileContent));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
DownloadResource.PN_FILE_NAME, String.class);
100,606
public void transferAnnotations() {<NEW_LINE>if (atypeFactory instanceof GenericAnnotatedTypeFactory<?, ?, ?, ?>) {<NEW_LINE>GenericAnnotatedTypeFactory<?, ?, ?, ?> genericAtf = (GenericAnnotatedTypeFactory<?, ?, ?, ?>) atypeFactory;<NEW_LINE>for (AnnotationMirror contractAnno : genericAtf.getContractAnnotations(this)) {<NEW_LINE>declaration.addAnnotation(AnnotationMirrorToAnnotationExprConversion.annotationMirrorToAnnotationExpr(contractAnno));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (declarationAnnotations != null) {<NEW_LINE>for (AnnotationMirror annotation : declarationAnnotations) {<NEW_LINE>declaration.addAnnotation(AnnotationMirrorToAnnotationExprConversion.annotationMirrorToAnnotationExpr(annotation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (returnType != null) {<NEW_LINE>// If a return type exists, then the declaration must be a method, not a constructor.<NEW_LINE>WholeProgramInferenceJavaParserStorage.transferAnnotations(returnType, declaration.<MASK><NEW_LINE>}<NEW_LINE>if (receiverType != null) {<NEW_LINE>addExplicitReceiver(declaration.asMethodDeclaration());<NEW_LINE>// The receiver won't be present for an anonymous class.<NEW_LINE>if (declaration.getReceiverParameter().isPresent()) {<NEW_LINE>WholeProgramInferenceJavaParserStorage.transferAnnotations(receiverType, declaration.getReceiverParameter().get().getType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parameterTypes == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < parameterTypes.size(); i++) {<NEW_LINE>AnnotatedTypeMirror inferredType = parameterTypes.get(i);<NEW_LINE>Parameter param = declaration.getParameter(i);<NEW_LINE>Type javaParserType = param.getType();<NEW_LINE>if (param.isVarArgs()) {<NEW_LINE>NodeList<AnnotationExpr> varArgsAnnoExprs = AnnotationMirrorToAnnotationExprConversion.annotationMirrorSetToAnnotationExprList(inferredType.getAnnotations());<NEW_LINE>param.setVarArgsAnnotations(varArgsAnnoExprs);<NEW_LINE>AnnotatedTypeMirror inferredComponentType = ((AnnotatedArrayType) inferredType).getComponentType();<NEW_LINE>WholeProgramInferenceJavaParserStorage.transferAnnotations(inferredComponentType, javaParserType);<NEW_LINE>} else {<NEW_LINE>WholeProgramInferenceJavaParserStorage.transferAnnotations(inferredType, javaParserType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
asMethodDeclaration().getType());
1,081,257
private void processCommonGet(boolean appPasswordRequest, OAuth20Provider provider, HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>String[] clientIdAndSecret = extractClientIdAndSecretFromAuthHeader(request, response);<NEW_LINE>if (clientIdAndSecret != null && clientIdAndSecret[0] != null) {<NEW_LINE>auditMap.get().put(AuditConstants.CLIENT_ID, clientIdAndSecret[0]);<NEW_LINE>}<NEW_LINE>String role = "";<NEW_LINE>if (request.isUserInRole(AuditConstants.TOKEN_MANAGER))<NEW_LINE>role += AuditConstants.TOKEN_MANAGER.concat(", ");<NEW_LINE>if (request.isUserInRole(AuditConstants.CLIENT_MANAGER))<NEW_LINE>role += AuditConstants.CLIENT_MANAGER.concat(", ");<NEW_LINE>if (request.isUserInRole(AuditConstants.AUTHENTICATED))<NEW_LINE>role += AuditConstants.AUTHENTICATED.concat(", ");<NEW_LINE>if (role.length() > 0)<NEW_LINE>auditMap.get().put(AuditConstants.INITIATOR_ROLE, role.substring(0, role.length() - 2));<NEW_LINE>AuthResult authRes = validateClientAndAuthenticate(appPasswordRequest, provider, request, response);<NEW_LINE>auditMap.get().put(AuditConstants.AUTH_RESULT, authRes);<NEW_LINE>if (authRes == null) {<NEW_LINE>auditMap.get().put(AuditConstants.AUDIT_OUTCOME, AuditConstants.FAILURE);<NEW_LINE>if (response.getStatus() == 400)<NEW_LINE>auditMap.get().put(AuditConstants.DETAILED_ERROR, AuditConstants.BAD_REQUEST);<NEW_LINE>else if (response.getStatus() == 401)<NEW_LINE>auditMap.get().put(AuditConstants.DETAILED_ERROR, AuditConstants.INVALID_CLIENT);<NEW_LINE>Audit.audit(Audit.EventID.APPLICATION_PASSWORD_TOKEN_01, auditMap.get());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String responseJson = listTokensJson(appPasswordRequest, authRes, provider);<NEW_LINE>if (responseJson == null) {<NEW_LINE>// some internal error occurred<NEW_LINE>sendHttp500(response);<NEW_LINE>auditMap.get().put(AuditConstants.AUDIT_OUTCOME, AuditConstants.FAILURE);<NEW_LINE>auditMap.get().put(AuditConstants.DETAILED_ERROR, AuditConstants.INTERNAL_ERROR);<NEW_LINE>Audit.audit(Audit.EventID.APPLICATION_PASSWORD_TOKEN_01, auditMap.get());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sendGoodResponse(responseJson, response);<NEW_LINE>auditMap.get().put(<MASK><NEW_LINE>Audit.audit(Audit.EventID.APPLICATION_PASSWORD_TOKEN_01, auditMap.get());<NEW_LINE>}
AuditConstants.AUDIT_OUTCOME, AuditConstants.SUCCESS);
1,335,180
private static boolean isShardingColumn(TableStat.Column column) {<NEW_LINE>if (null == column) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String columnName = column.getName();<NEW_LINE>boolean isSharding = false;<NEW_LINE>String table = column.getTable();<NEW_LINE>if (null == table) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String[] split = table.split("\\.");<NEW_LINE>if (split.length == 2) {<NEW_LINE>String schemaName = split[0];<NEW_LINE>String tableName = split[1];<NEW_LINE>SchemaConfig schema = DbleServer.getInstance().getConfig().getSchemas().get(schemaName);<NEW_LINE>BaseTableConfig tableConfig = schema.getTables().get(tableName);<NEW_LINE>if (tableConfig instanceof ShardingTableConfig) {<NEW_LINE>ShardingTableConfig shardingTableConfig = (ShardingTableConfig) tableConfig;<NEW_LINE>String partitionCol = shardingTableConfig.getShardingColumn();<NEW_LINE>isSharding = <MASK><NEW_LINE>} else if (tableConfig instanceof ChildTableConfig) {<NEW_LINE>ChildTableConfig childTableConfig = (ChildTableConfig) tableConfig;<NEW_LINE>String joinColumn = childTableConfig.getJoinColumn();<NEW_LINE>isSharding = StringUtil.equalsIgnoreCase(joinColumn, columnName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isSharding;<NEW_LINE>}
StringUtil.equalsIgnoreCase(partitionCol, columnName);
1,110,914
public LengthInfo readLength() throws IOException {<NEW_LINE>int accumulator = 0;<NEW_LINE>int byteVal = read();<NEW_LINE>if (byteVal == -1) {<NEW_LINE>throw new EOFException("expecting length");<NEW_LINE>}<NEW_LINE>if (// short form 8.6.4<NEW_LINE>(byteVal & 0x80) == 0) {<NEW_LINE>debugPrint("Len (Short form): " + (byteVal & 0x7F));<NEW_LINE>return new LengthInfo(BigInteger.valueOf(byteVal & 0x7F), true);<NEW_LINE>} else {<NEW_LINE>// Long form 8.6.5<NEW_LINE>byte[] lengthInt = new byte[(byteVal & 0x7F)];<NEW_LINE>if (Streams.readFully(this, lengthInt) != lengthInt.length) {<NEW_LINE>throw new EOFException("did not read all bytes of length definition");<NEW_LINE>}<NEW_LINE>// -DM Hex.toHexString<NEW_LINE>debugPrint("Len (Long Form): " + (byteVal & 0x7F) + " actual len: " <MASK><NEW_LINE>return new LengthInfo(BigIntegers.fromUnsignedByteArray(lengthInt), false);<NEW_LINE>}<NEW_LINE>}
+ Hex.toHexString(lengthInt));
184,720
private JPanel create() {<NEW_LINE>labelNameChoices = new GhidraComboBox<>();<NEW_LINE>labelNameChoices.setName("label.name.choices");<NEW_LINE>GhidraComboBox<NamespaceWrapper> comboBox = new GhidraComboBox<>();<NEW_LINE>comboBox.setEnterKeyForwarding(true);<NEW_LINE>namespaceChoices = comboBox;<NEW_LINE>primaryCheckBox = new GCheckBox("Primary");<NEW_LINE>primaryCheckBox.setMnemonic('P');<NEW_LINE>primaryCheckBox.setToolTipText("Make this label be the one that shows up in references to this location.");<NEW_LINE>entryPointCheckBox = new GCheckBox("Entry Point ");<NEW_LINE>entryPointCheckBox.setMnemonic('E');<NEW_LINE>entryPointCheckBox.setToolTipText("Mark this location as an external entry point.");<NEW_LINE>pinnedCheckBox = new GCheckBox("Pinned");<NEW_LINE>pinnedCheckBox.setMnemonic('A');<NEW_LINE>pinnedCheckBox.setToolTipText("Do not allow this label to move when the image base changes or a memory block is moved.");<NEW_LINE>labelNameChoices.setEditable(true);<NEW_LINE>JPanel mainPanel = new JPanel(new VerticalLayout(4));<NEW_LINE>JPanel topPanel = new JPanel(new BorderLayout());<NEW_LINE>JPanel midPanel = <MASK><NEW_LINE>JPanel bottomPanel = new JPanel();<NEW_LINE>nameBorder = BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Enter Label");<NEW_LINE>topPanel.setBorder(nameBorder);<NEW_LINE>Border border = BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Namespace");<NEW_LINE>midPanel.setBorder(border);<NEW_LINE>border = BorderFactory.createEmptyBorder(5, 0, 0, 5);<NEW_LINE>bottomPanel.setBorder(border);<NEW_LINE>mainPanel.add(topPanel);<NEW_LINE>mainPanel.add(midPanel);<NEW_LINE>mainPanel.add(bottomPanel);<NEW_LINE>topPanel.add(labelNameChoices, BorderLayout.NORTH);<NEW_LINE>midPanel.add(namespaceChoices, BorderLayout.NORTH);<NEW_LINE>bottomPanel.add(entryPointCheckBox);<NEW_LINE>bottomPanel.add(primaryCheckBox);<NEW_LINE>bottomPanel.add(pinnedCheckBox);<NEW_LINE>bottomPanel.setBorder(BorderFactory.createTitledBorder("Properties"));<NEW_LINE>addListeners();<NEW_LINE>mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));<NEW_LINE>return mainPanel;<NEW_LINE>}
new JPanel(new BorderLayout());
1,083,632
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String loadTestName) {<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 (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>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (loadTestName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter loadTestName 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(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), loadTestName, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>}
)).readOnly()));
1,347,981
final ListVirtualMFADevicesResult executeListVirtualMFADevices(ListVirtualMFADevicesRequest listVirtualMFADevicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listVirtualMFADevicesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListVirtualMFADevicesRequest> request = null;<NEW_LINE>Response<ListVirtualMFADevicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListVirtualMFADevicesRequestMarshaller().marshall(super.beforeMarshalling(listVirtualMFADevicesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListVirtualMFADevices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListVirtualMFADevicesResult> responseHandler = new StaxResponseHandler<ListVirtualMFADevicesResult>(new ListVirtualMFADevicesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
466,755
private void generateMessageSubclasses(Task task) throws ParserConfigurationException, SAXException, IOException, TransformerFactoryConfigurationError, TransformerException {<NEW_LINE>logInfo(task.getName() + ": generating message subclasses");<NEW_LINE>String outputDirectory = task.getOutputBaseDirectory() + "/" + task.getMessageDirectory() + "/";<NEW_LINE>writePackageDocumentation(outputDirectory, "Message classes");<NEW_LINE>Document document = getSpecification(task);<NEW_LINE>List<String> messageNames = getNames(document.getDocumentElement(), "messages/message");<NEW_LINE>Transformer <MASK><NEW_LINE>for (String messageName : messageNames) {<NEW_LINE>logDebug("generating message class: " + messageName);<NEW_LINE>Map<String, String> parameters = new HashMap<>();<NEW_LINE>parameters.put("itemName", messageName);<NEW_LINE>parameters.put(XSLPARAM_SERIAL_UID, SERIAL_UID_STR);<NEW_LINE>parameters.put("orderedFields", Boolean.toString(task.isOrderedFields()));<NEW_LINE>parameters.put("fieldPackage", task.getFieldPackage());<NEW_LINE>parameters.put("messagePackage", task.getMessagePackage());<NEW_LINE>generateCodeFile(task, document, parameters, outputDirectory + messageName + ".java", transformer);<NEW_LINE>}<NEW_LINE>}
transformer = createTransformer(task, "MessageSubclass.xsl");
1,793,195
public GlobalReplicationGroupMember unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>GlobalReplicationGroupMember globalReplicationGroupMember = new GlobalReplicationGroupMember();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 3;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return globalReplicationGroupMember;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("ReplicationGroupId", targetDepth)) {<NEW_LINE>globalReplicationGroupMember.setReplicationGroupId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReplicationGroupRegion", targetDepth)) {<NEW_LINE>globalReplicationGroupMember.setReplicationGroupRegion(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Role", targetDepth)) {<NEW_LINE>globalReplicationGroupMember.setRole(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("AutomaticFailover", targetDepth)) {<NEW_LINE>globalReplicationGroupMember.setAutomaticFailover(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>globalReplicationGroupMember.setStatus(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return globalReplicationGroupMember;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,321,069
public void validate() {<NEW_LINE>if (applicationRuleCollections() != null) {<NEW_LINE>applicationRuleCollections().forEach(e -> e.validate());<NEW_LINE>}<NEW_LINE>if (natRuleCollections() != null) {<NEW_LINE>natRuleCollections().forEach(e -> e.validate());<NEW_LINE>}<NEW_LINE>if (networkRuleCollections() != null) {<NEW_LINE>networkRuleCollections().forEach(e -> e.validate());<NEW_LINE>}<NEW_LINE>if (ipConfigurations() != null) {<NEW_LINE>ipConfigurations().forEach(e -> e.validate());<NEW_LINE>}<NEW_LINE>if (managementIpConfiguration() != null) {<NEW_LINE>managementIpConfiguration().validate();<NEW_LINE>}<NEW_LINE>if (hubIpAddresses() != null) {<NEW_LINE>hubIpAddresses().validate();<NEW_LINE>}<NEW_LINE>if (ipGroups() != null) {<NEW_LINE>ipGroups().forEach(<MASK><NEW_LINE>}<NEW_LINE>if (sku() != null) {<NEW_LINE>sku().validate();<NEW_LINE>}<NEW_LINE>}
e -> e.validate());
1,078,832
final CreateChannelModeratorResult executeCreateChannelModerator(CreateChannelModeratorRequest createChannelModeratorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createChannelModeratorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateChannelModeratorRequest> request = null;<NEW_LINE>Response<CreateChannelModeratorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateChannelModeratorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createChannelModeratorRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateChannelModerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "messaging-";<NEW_LINE>String resolvedHostPrefix = String.format("messaging-");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateChannelModeratorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateChannelModeratorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,577,626
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) {<NEW_LINE>PaintingInfo pI = getPaintingInfo();<NEW_LINE>if (pI != null && !pI.getAggregateBounds().contains(absX, absY)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Box result = null;<NEW_LINE>for (int i = 0; i < getInlineChildCount(); i++) {<NEW_LINE>Object child = getInlineChild(i);<NEW_LINE>if (child instanceof Box) {<NEW_LINE>result = ((Box) child).find(cssCtx, absX, absY, findAnonymous);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Rectangle edge = getContentAreaEdge(getAbsX(), getAbsY(), cssCtx);<NEW_LINE>result = edge.contains(absX, absY) && getStyle().isVisible(<MASK><NEW_LINE>if (!findAnonymous && result != null && getElement() == null) {<NEW_LINE>return getParent().getParent();<NEW_LINE>} else {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
null, this) ? this : null;
37,272
protected KeycloakUriBuilder parseHierarchicalUri(String uriTemplate, Matcher match) {<NEW_LINE>boolean scheme = match.group(2) != null;<NEW_LINE>if (scheme)<NEW_LINE>this.scheme = match.group(2);<NEW_LINE>String authority = match.group(4);<NEW_LINE>if (authority != null) {<NEW_LINE>this.authority = null;<NEW_LINE>String host = match.group(4);<NEW_LINE>int <MASK><NEW_LINE>if (at > -1) {<NEW_LINE>String user = host.substring(0, at);<NEW_LINE>host = host.substring(at + 1);<NEW_LINE>this.userInfo = user;<NEW_LINE>}<NEW_LINE>Matcher hostPortMatch = hostPortPattern.matcher(host);<NEW_LINE>if (hostPortMatch.matches()) {<NEW_LINE>this.host = hostPortMatch.group(1);<NEW_LINE>try {<NEW_LINE>this.port = Integer.parseInt(hostPortMatch.group(2));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new IllegalArgumentException("Illegal uri template: " + uriTemplate, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.host = host;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (match.group(5) != null) {<NEW_LINE>String group = match.group(5);<NEW_LINE>if (!scheme && !"".equals(group) && !group.startsWith("/") && group.indexOf(':') > -1)<NEW_LINE>throw new IllegalArgumentException("Illegal uri template: " + uriTemplate);<NEW_LINE>if (!"".equals(group))<NEW_LINE>replacePath(group);<NEW_LINE>}<NEW_LINE>if (match.group(7) != null)<NEW_LINE>replaceQuery(match.group(7));<NEW_LINE>if (match.group(9) != null)<NEW_LINE>fragment(match.group(9));<NEW_LINE>return this;<NEW_LINE>}
at = host.indexOf('@');
456,846
public void updateConfiguration(WatchedUpdateResult watchedUpdateResult) {<NEW_LINE>Map<String, Object> adds = watchedUpdateResult.getAdded();<NEW_LINE>if (adds != null) {<NEW_LINE>for (String add : adds.keySet()) {<NEW_LINE>if (add.startsWith(CONFIG_CSE_PREFIX)) {<NEW_LINE>String key = CONFIG_SERVICECOMB_PREFIX + add.substring(add.indexOf(".") + 1);<NEW_LINE>injectConfig.addProperty(key<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Object> deletes = watchedUpdateResult.getDeleted();<NEW_LINE>if (deletes != null) {<NEW_LINE>for (String delete : deletes.keySet()) {<NEW_LINE>if (delete.startsWith(CONFIG_CSE_PREFIX)) {<NEW_LINE>injectConfig.clearProperty(CONFIG_SERVICECOMB_PREFIX + delete.substring(delete.indexOf(".") + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Object> changes = watchedUpdateResult.getChanged();<NEW_LINE>if (changes != null) {<NEW_LINE>for (String change : changes.keySet()) {<NEW_LINE>if (change.startsWith(CONFIG_CSE_PREFIX)) {<NEW_LINE>String key = CONFIG_SERVICECOMB_PREFIX + change.substring(change.indexOf(".") + 1);<NEW_LINE>injectConfig.setProperty(key, changes.get(change));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EventManager.post(new DynamicConfigurationChangedEvent(watchedUpdateResult));<NEW_LINE>}
, adds.get(add));
1,136,351
static <F, T> Spliterator<T> map(Spliterator<F> fromSpliterator, Function<? super F, ? extends T> function) {<NEW_LINE>checkNotNull(fromSpliterator);<NEW_LINE>checkNotNull(function);<NEW_LINE>return new Spliterator<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean tryAdvance(Consumer<? super T> action) {<NEW_LINE>return fromSpliterator.tryAdvance(fromElement -> action.accept(function.apply(fromElement)));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void forEachRemaining(Consumer<? super T> action) {<NEW_LINE>fromSpliterator.forEachRemaining(fromElement -> action.accept(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Spliterator<T> trySplit() {<NEW_LINE>Spliterator<F> fromSplit = fromSpliterator.trySplit();<NEW_LINE>return (fromSplit != null) ? map(fromSplit, function) : null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long estimateSize() {<NEW_LINE>return fromSpliterator.estimateSize();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int characteristics() {<NEW_LINE>return fromSpliterator.characteristics() & ~(Spliterator.DISTINCT | Spliterator.NONNULL | Spliterator.SORTED);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
function.apply(fromElement)));
1,532,036
public void dump(MotionScene scene, int... ids) {<NEW_LINE>Set<Integer> keys = mConstraints.keySet();<NEW_LINE>HashSet<Integer> set;<NEW_LINE>if (ids.length != 0) {<NEW_LINE>set = new HashSet<Integer>();<NEW_LINE>for (int id : ids) {<NEW_LINE>set.add(id);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>set = new HashSet<>(keys);<NEW_LINE>}<NEW_LINE>System.out.println(set.size() + " constraints");<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>for (Integer id : set.toArray(new Integer[0])) {<NEW_LINE>Constraint constraint = mConstraints.get(id);<NEW_LINE>if (constraint == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>stringBuilder.append("<Constraint id=");<NEW_LINE>stringBuilder.append(id);<NEW_LINE>stringBuilder.append(" \n");<NEW_LINE>constraint.<MASK><NEW_LINE>stringBuilder.append("/>\n");<NEW_LINE>}<NEW_LINE>System.out.println(stringBuilder.toString());<NEW_LINE>}
layout.dump(scene, stringBuilder);
619,433
private static void tightenJumpsToTerminal(List<Op03SimpleStatement> statements, BlockIdentifier switchBlock, Op03SimpleStatement following, Op03SimpleStatement followingTrans) {<NEW_LINE>List<Op03SimpleStatement> tsource = ListFactory.<MASK><NEW_LINE>boolean acted = false;<NEW_LINE>for (Op03SimpleStatement source : tsource) {<NEW_LINE>if (source.getBlockIdentifiers().contains(switchBlock)) {<NEW_LINE>followingTrans.removeSource(source);<NEW_LINE>source.replaceTarget(followingTrans, following);<NEW_LINE>following.addSource(source);<NEW_LINE>acted = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// We don't want this to be undone immediately, so break nop goto chains.<NEW_LINE>if (acted) {<NEW_LINE>Statement followingStatement = following.getStatement();<NEW_LINE>if (followingStatement instanceof Nop) {<NEW_LINE>following.replaceStatement(new CommentStatement(""));<NEW_LINE>} else if (followingStatement.getClass() == GotoStatement.class) {<NEW_LINE>following.replaceStatement(new CommentStatement(""));<NEW_LINE>Op03SimpleStatement force = new Op03SimpleStatement(following.getBlockIdentifiers(), new GotoStatement(BytecodeLoc.TODO), following.getSSAIdentifiers(), following.getIndex().justAfter());<NEW_LINE>Op03SimpleStatement followingTgt = following.getTargets().get(0);<NEW_LINE>followingTgt.replaceSource(following, force);<NEW_LINE>following.replaceTarget(followingTgt, force);<NEW_LINE>force.addSource(following);<NEW_LINE>force.addTarget(followingTgt);<NEW_LINE>statements.add(force);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
newList(followingTrans.getSources());
846,441
final ListBulkDeploymentDetailedReportsResult executeListBulkDeploymentDetailedReports(ListBulkDeploymentDetailedReportsRequest listBulkDeploymentDetailedReportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBulkDeploymentDetailedReportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBulkDeploymentDetailedReportsRequest> request = null;<NEW_LINE>Response<ListBulkDeploymentDetailedReportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBulkDeploymentDetailedReportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBulkDeploymentDetailedReportsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBulkDeploymentDetailedReports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBulkDeploymentDetailedReportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListBulkDeploymentDetailedReportsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Greengrass");
527,192
public RouteCalculationResult recalculatePartOfflineRoute(RouteCalculationResult res, RouteCalculationParams params) {<NEW_LINE>RouteCalculationResult rcr = params.previousToRecalculate;<NEW_LINE>List<Location> locs = new ArrayList<Location>(rcr.getRouteLocations());<NEW_LINE>try {<NEW_LINE>int[] startI = new int[] { 0 };<NEW_LINE>int[] endI = new int[] { locs.size() };<NEW_LINE>locs = findStartAndEndLocationsFromRoute(locs, params.start, params.end, startI, endI);<NEW_LINE>List<RouteDirectionInfo> directions = calcDirections(startI, <MASK><NEW_LINE>insertInitialSegment(params, locs, directions, true);<NEW_LINE>res = new RouteCalculationResult(locs, directions, params, null, true);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
endI, rcr.getRouteDirections());
367,892
public BatchRemoveFacetFromObject unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchRemoveFacetFromObject batchRemoveFacetFromObject = new BatchRemoveFacetFromObject();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("SchemaFacet", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchRemoveFacetFromObject.setSchemaFacet(SchemaFacetJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ObjectReference", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchRemoveFacetFromObject.setObjectReference(ObjectReferenceJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return batchRemoveFacetFromObject;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
860,278
public ServiceResponse serviceImpl(Query call, HttpServletResponse response, Authorization rights, final JsonObjectWithDefault permissions) throws APIException {<NEW_LINE>JSONObject result = new JSONObject(true);<NEW_LINE><MASK><NEW_LINE>result.put("message", "Error: Unable to reset Password");<NEW_LINE>String newpass = call.get("newpass", null);<NEW_LINE>ClientCredential credential = new ClientCredential(ClientCredential.Type.resetpass_token, call.get("token", null));<NEW_LINE>Authentication authentication = new Authentication(credential, DAO.passwordreset);<NEW_LINE>ClientCredential emailcred = new ClientCredential(ClientCredential.Type.passwd_login, authentication.getIdentity().getName());<NEW_LINE>String passwordPattern = DAO.getConfig("users.password.regex", "^((?=.*\\d)(?=.*[A-Z])(?=.*\\W).{8,64})$");<NEW_LINE>Pattern pattern = Pattern.compile(passwordPattern);<NEW_LINE>if ((authentication.getIdentity().getName()).equals(newpass) || !new TimeoutMatcher(pattern.matcher(newpass)).matches()) {<NEW_LINE>// password can't equal email and regex should match<NEW_LINE>throw new APIException(422, "invalid password");<NEW_LINE>}<NEW_LINE>if (DAO.hasAuthentication(emailcred)) {<NEW_LINE>Authentication emailauth = DAO.getAuthentication(emailcred);<NEW_LINE>String salt = createRandomString(20);<NEW_LINE>emailauth.remove("salt");<NEW_LINE>emailauth.remove("passwordHash");<NEW_LINE>emailauth.put("salt", salt);<NEW_LINE>emailauth.put("passwordHash", getHash(newpass, salt));<NEW_LINE>}<NEW_LINE>if (authentication.has("one_time") && authentication.getBoolean("one_time")) {<NEW_LINE>authentication.delete();<NEW_LINE>}<NEW_LINE>String subject = "Password Reset";<NEW_LINE>try {<NEW_LINE>EmailHandler.sendEmail(authentication.getIdentity().getName(), subject, "Your password has been reset successfully!");<NEW_LINE>result.put("accepted", true);<NEW_LINE>result.put("message", "Your password has been changed!");<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.put("message", e.getMessage());<NEW_LINE>}<NEW_LINE>return new ServiceResponse(result);<NEW_LINE>}
result.put("accepted", false);
814,720
public static DescribeImageFromFamilyResponse unmarshall(DescribeImageFromFamilyResponse describeImageFromFamilyResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeImageFromFamilyResponse.setRequestId(_ctx.stringValue("DescribeImageFromFamilyResponse.RequestId"));<NEW_LINE>Image image = new Image();<NEW_LINE>image.setCreationTime(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.CreationTime"));<NEW_LINE>image.setStatus(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Status"));<NEW_LINE>image.setImageFamily(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageFamily"));<NEW_LINE>image.setProgress(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Progress"));<NEW_LINE>image.setIsCopied(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsCopied"));<NEW_LINE>image.setIsSupportIoOptimized(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsSupportIoOptimized"));<NEW_LINE>image.setImageOwnerAlias(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageOwnerAlias"));<NEW_LINE>image.setIsSupportCloudinit(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsSupportCloudinit"));<NEW_LINE>image.setImageVersion<MASK><NEW_LINE>image.setUsage(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Usage"));<NEW_LINE>image.setIsSelfShared(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.IsSelfShared"));<NEW_LINE>image.setDescription(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Description"));<NEW_LINE>image.setSize(_ctx.integerValue("DescribeImageFromFamilyResponse.Image.Size"));<NEW_LINE>image.setPlatform(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Platform"));<NEW_LINE>image.setImageName(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageName"));<NEW_LINE>image.setOSName(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.OSName"));<NEW_LINE>image.setImageId(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageId"));<NEW_LINE>image.setOSType(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.OSType"));<NEW_LINE>image.setIsSubscribed(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsSubscribed"));<NEW_LINE>image.setProductCode(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ProductCode"));<NEW_LINE>image.setArchitecture(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Architecture"));<NEW_LINE>List<DiskDeviceMapping> diskDeviceMappings = new ArrayList<DiskDeviceMapping>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings.Length"); i++) {<NEW_LINE>DiskDeviceMapping diskDeviceMapping = new DiskDeviceMapping();<NEW_LINE>diskDeviceMapping.setType(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Type"));<NEW_LINE>diskDeviceMapping.setImportOSSBucket(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].ImportOSSBucket"));<NEW_LINE>diskDeviceMapping.setSnapshotId(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].SnapshotId"));<NEW_LINE>diskDeviceMapping.setImportOSSObject(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].ImportOSSObject"));<NEW_LINE>diskDeviceMapping.setSize(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Size"));<NEW_LINE>diskDeviceMapping.setDevice(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Device"));<NEW_LINE>diskDeviceMapping.setFormat(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Format"));<NEW_LINE>diskDeviceMappings.add(diskDeviceMapping);<NEW_LINE>}<NEW_LINE>image.setDiskDeviceMappings(diskDeviceMappings);<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeImageFromFamilyResponse.Image.Tags.Length"); i++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Tags[" + i + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Tags[" + i + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>image.setTags(tags);<NEW_LINE>describeImageFromFamilyResponse.setImage(image);<NEW_LINE>return describeImageFromFamilyResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageVersion"));
1,697,197
final GetMinuteUsageResult executeGetMinuteUsage(GetMinuteUsageRequest getMinuteUsageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMinuteUsageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMinuteUsageRequest> request = null;<NEW_LINE>Response<GetMinuteUsageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMinuteUsageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMinuteUsageRequest));<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, "GroundStation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMinuteUsage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMinuteUsageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMinuteUsageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,402,354
// computes all divisions in input string<NEW_LINE>public static String division(String input) {<NEW_LINE>double num1 = 0, num2 = 0, ans = 0;<NEW_LINE>int b = 0, t1 = 0, t2 = 0;<NEW_LINE>String anstring = "";<NEW_LINE>String temp = "";<NEW_LINE>int count = 0;<NEW_LINE>while (b < input.length()) {<NEW_LINE>if (input.charAt(b) == '/') {<NEW_LINE>num1 = getbacknumber(input, (b - 1));<NEW_LINE>num2 = getfrontnumber(input, (b + 1));<NEW_LINE>ans = num1 / num2;<NEW_LINE>t1 = getendex(<MASK><NEW_LINE>t2 = getfrontex(input, (b + 1));<NEW_LINE>if (ans >= 0) {<NEW_LINE>anstring = "+" + String.valueOf(ans);<NEW_LINE>temp = input.substring(0, t1) + anstring + input.substring(t2 + 1);<NEW_LINE>} else {<NEW_LINE>anstring = String.valueOf(ans);<NEW_LINE>temp = input.substring(0, t1) + anstring + input.substring(t2 + 1);<NEW_LINE>}<NEW_LINE>b = 1;<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>if ((count > 0) && (input != temp)) {<NEW_LINE>input = simplification1(temp);<NEW_LINE>}<NEW_LINE>b++;<NEW_LINE>}<NEW_LINE>return input;<NEW_LINE>}
input, (b - 1));
1,795,620
public void sendNotificationMsgToEdgeService(TenantId tenantId, EdgeId edgeId, EntityId entityId, String body, EdgeEventType type, EdgeEventActionType action) {<NEW_LINE>if (!edgesEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (type == null) {<NEW_LINE>if (entityId != null) {<NEW_LINE>type = EdgeUtils.getEdgeEventTypeByEntityType(entityId.getEntityType());<NEW_LINE>} else {<NEW_LINE>log.trace("[{}] entity id and type are null. Ignoring this notification", tenantId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (type == null) {<NEW_LINE>log.trace("[{}] edge event type is null. Ignoring this notification [{}]", tenantId, entityId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TransportProtos.EdgeNotificationMsgProto.Builder builder = TransportProtos.EdgeNotificationMsgProto.newBuilder();<NEW_LINE>builder.setTenantIdMSB(tenantId.getId().getMostSignificantBits());<NEW_LINE>builder.setTenantIdLSB(tenantId.getId().getLeastSignificantBits());<NEW_LINE>builder.setType(type.name());<NEW_LINE>builder.setAction(action.name());<NEW_LINE>if (entityId != null) {<NEW_LINE>builder.setEntityIdMSB(entityId.getId().getMostSignificantBits());<NEW_LINE>builder.setEntityIdLSB(entityId.getId().getLeastSignificantBits());<NEW_LINE>builder.setEntityType(entityId.getEntityType().name());<NEW_LINE>}<NEW_LINE>if (edgeId != null) {<NEW_LINE>builder.setEdgeIdMSB(edgeId.getId().getMostSignificantBits());<NEW_LINE>builder.setEdgeIdLSB(edgeId.getId().getLeastSignificantBits());<NEW_LINE>}<NEW_LINE>if (body != null) {<NEW_LINE>builder.setBody(body);<NEW_LINE>}<NEW_LINE>TransportProtos.<MASK><NEW_LINE>log.trace("[{}] sending notification to edge service {}", tenantId.getId(), msg);<NEW_LINE>pushMsgToCore(tenantId, entityId != null ? entityId : tenantId, TransportProtos.ToCoreMsg.newBuilder().setEdgeNotificationMsg(msg).build(), null);<NEW_LINE>if (entityId != null && EntityType.DEVICE.equals(entityId.getEntityType())) {<NEW_LINE>pushDeviceUpdateMessage(tenantId, edgeId, entityId, action);<NEW_LINE>}<NEW_LINE>}
EdgeNotificationMsgProto msg = builder.build();
1,745,024
public PlanBean createPlan(String organizationId, NewPlanBean bean) throws OrganizationNotFoundException, PlanAlreadyExistsException, NotAuthorizedException, InvalidNameException {<NEW_LINE>securityContext.checkPermissions(PermissionType.planEdit, organizationId);<NEW_LINE>FieldValidator.<MASK><NEW_LINE>PlanBean newPlan = new PlanBean();<NEW_LINE>newPlan.setName(bean.getName());<NEW_LINE>newPlan.setDescription(bean.getDescription());<NEW_LINE>newPlan.setId(BeanUtils.idFromName(bean.getName()));<NEW_LINE>newPlan.setCreatedOn(new Date());<NEW_LINE>newPlan.setCreatedBy(securityContext.getCurrentUser());<NEW_LINE>try {<NEW_LINE>// Store/persist the new plan<NEW_LINE>storage.beginTx();<NEW_LINE>OrganizationBean orgBean = getOrganizationFromStorage(organizationId);<NEW_LINE>if (storage.getPlan(orgBean.getId(), newPlan.getId()) != null) {<NEW_LINE>throw ExceptionFactory.planAlreadyExistsException(newPlan.getName());<NEW_LINE>}<NEW_LINE>newPlan.setOrganization(orgBean);<NEW_LINE>storage.createPlan(newPlan);<NEW_LINE>storage.createAuditEntry(AuditUtils.planCreated(newPlan, securityContext));<NEW_LINE>if (bean.getInitialVersion() != null) {<NEW_LINE>NewPlanVersionBean newPlanVersion = new NewPlanVersionBean();<NEW_LINE>newPlanVersion.setVersion(bean.getInitialVersion());<NEW_LINE>createPlanVersionInternal(newPlanVersion, newPlan);<NEW_LINE>}<NEW_LINE>storage.commitTx();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.debug(String.format("Created plan: %s", newPlan));<NEW_LINE>return newPlan;<NEW_LINE>} catch (AbstractRestException e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw new SystemErrorException(e);<NEW_LINE>}<NEW_LINE>}
validateName(bean.getName());
1,417,546
public boolean filter(CompilationInfo info, ComputeImports state) {<NEW_LINE>Map<String, List<Element>> candidates = state.candidates;<NEW_LINE>List<Element> left = null;<NEW_LINE>List<Element> right = null;<NEW_LINE>boolean leftReadOnly = false;<NEW_LINE>boolean rightReadOnly = false;<NEW_LINE>if (this.left.hasSecond()) {<NEW_LINE>Element el = this.left.second().asElement();<NEW_LINE>// TODO do not use instanceof!<NEW_LINE>if (el instanceof TypeElement) {<NEW_LINE>left = Collections.singletonList(el);<NEW_LINE>leftReadOnly = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>left = candidates.get(<MASK><NEW_LINE>}<NEW_LINE>if (this.right.hasSecond()) {<NEW_LINE>Element el = this.right.second().asElement();<NEW_LINE>// TODO do not use instanceof!<NEW_LINE>if (el instanceof TypeElement) {<NEW_LINE>right = Collections.singletonList(el);<NEW_LINE>rightReadOnly = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>right = candidates.get(this.right.first());<NEW_LINE>}<NEW_LINE>if (left != null && right != null && !left.isEmpty() && !right.isEmpty()) {<NEW_LINE>return ComputeImports.filter(info.getTypes(), left, right, leftReadOnly, rightReadOnly);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
this.left.first());
1,688,440
public String parseLineText(String line) {<NEW_LINE>if (line.startsWith("#")) {<NEW_LINE>Pattern aName = Pattern.compile("^#[A-Za-z0-9_]+ =$");<NEW_LINE>Matcher mN = aName.matcher(line);<NEW_LINE>if (mN.find()) {<NEW_LINE>return line.substring(1).split(" ")[0];<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>Matcher mR = patRegionStr.matcher(line);<NEW_LINE>String asOffset = ".asOffset()";<NEW_LINE>if (mR.find()) {<NEW_LINE>if (line.length() >= mR.end() + asOffset.length()) {<NEW_LINE>if (line.substring(mR.end()).contains(asOffset)) {<NEW_LINE>return line.substring(mR.start(), mR.end()) + asOffset;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return line.substring(mR.start(), mR.end());<NEW_LINE>}<NEW_LINE>Matcher mL = patLocationStr.matcher(line);<NEW_LINE>if (mL.find()) {<NEW_LINE>return line.substring(mL.start(<MASK><NEW_LINE>}<NEW_LINE>Matcher mP = patPatternStr.matcher(line);<NEW_LINE>if (mP.find()) {<NEW_LINE>return line.substring(mP.start(), mP.end());<NEW_LINE>}<NEW_LINE>Matcher mI = patPngStr.matcher(line);<NEW_LINE>if (mI.find()) {<NEW_LINE>return line.substring(mI.start(), mI.end());<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
), mL.end());
59,218
private static void downloadLicense(URL licenseURL) {<NEW_LINE>assert remote2local != null;<NEW_LINE>File downloadDir = new File(System.getProperty("mary.downloadDir", "."));<NEW_LINE>String filename = licenseURL.toString().replace('/', '_').replace(':', '_');<NEW_LINE>File licenseFile = new File(downloadDir, filename);<NEW_LINE>System.out.println("Downloading license from " + licenseURL.toString());<NEW_LINE>try (FileOutputStream out = new FileOutputStream(licenseFile);<NEW_LINE>InputStream in = licenseURL.openStream()) {<NEW_LINE><MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Cannot download license from " + licenseURL.toString());<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// Now we need to update remote2local and write an updated license-index.txt:<NEW_LINE>remote2local.put(licenseURL, filename);<NEW_LINE>saveIndex();<NEW_LINE>}
IOUtils.copy(in, out);
800,218
// Print method header and return the ERROR_RETURN string.<NEW_LINE>private String generateCPPMethodheader(BNFProduction p, Token t) {<NEW_LINE>StringBuffer sig = new StringBuffer();<NEW_LINE>String ret, params;<NEW_LINE>String method_name = p.getLhs();<NEW_LINE>boolean void_ret = false;<NEW_LINE>boolean ptr_ret = false;<NEW_LINE>codeGenerator.printTokenSetup(t);<NEW_LINE>ccol = 1;<NEW_LINE>String comment1 = codeGenerator.getLeadingComments(t);<NEW_LINE>cline = t.beginLine;<NEW_LINE>ccol = t.beginColumn;<NEW_LINE>sig.append(t.image);<NEW_LINE>if (t.kind == JavaCCParserConstants.VOID)<NEW_LINE>void_ret = true;<NEW_LINE>if (t.kind == JavaCCParserConstants.STAR)<NEW_LINE>ptr_ret = true;<NEW_LINE>for (int i = 1; i < p.getReturnTypeTokens().size(); i++) {<NEW_LINE>t = (Token) (p.getReturnTypeTokens().get(i));<NEW_LINE>sig.append(codeGenerator.getStringToPrint(t));<NEW_LINE>if (t.kind == JavaCCParserConstants.VOID)<NEW_LINE>void_ret = true;<NEW_LINE>if (t.kind == JavaCCParserConstants.STAR)<NEW_LINE>ptr_ret = true;<NEW_LINE>}<NEW_LINE>String comment2 = codeGenerator.getTrailingComments(t);<NEW_LINE>ret = sig.toString();<NEW_LINE>sig.setLength(0);<NEW_LINE>sig.append("(");<NEW_LINE>if (p.getParameterListTokens().size() != 0) {<NEW_LINE>codeGenerator.printTokenSetup((Token) (p.getParameterListTokens().get(0)));<NEW_LINE>for (java.util.Iterator it = p.getParameterListTokens().iterator(); it.hasNext(); ) {<NEW_LINE>t = <MASK><NEW_LINE>sig.append(codeGenerator.getStringToPrint(t));<NEW_LINE>}<NEW_LINE>sig.append(codeGenerator.getTrailingComments(t));<NEW_LINE>}<NEW_LINE>sig.append(")");<NEW_LINE>params = sig.toString();<NEW_LINE>// For now, just ignore comments<NEW_LINE>codeGenerator.generateMethodDefHeader(ret, cu_name, p.getLhs() + params, sig.toString());<NEW_LINE>// Generate a default value for error return.<NEW_LINE>String default_return;<NEW_LINE>if (ptr_ret)<NEW_LINE>default_return = "NULL";<NEW_LINE>else if (void_ret)<NEW_LINE>default_return = "";<NEW_LINE>else<NEW_LINE>// 0 converts to most (all?) basic types.<NEW_LINE>default_return = "0";<NEW_LINE>StringBuffer ret_val = new StringBuffer("\n#if !defined ERROR_RET_" + method_name + "\n");<NEW_LINE>ret_val.append("#define ERROR_RET_" + method_name + " " + default_return + "\n");<NEW_LINE>ret_val.append("#endif\n");<NEW_LINE>ret_val.append("#define __ERROR_RET__ ERROR_RET_" + method_name + "\n");<NEW_LINE>return ret_val.toString();<NEW_LINE>}
(Token) it.next();
347,397
public static <T, R1, R2, R3, R> IterableX<R> forEach4(Iterable<T> host, final Function<? super T, ? extends Iterable<R1>> iterable1, final BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, final Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, final Function4<? super T, ? super R1, ? super R2, ? super R3, Boolean> filterFunction, final Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {<NEW_LINE>return fromIterable(host).concatMap(in -> {<NEW_LINE>ReactiveSeq<R1> a = ReactiveSeq.fromIterable(iterable1.apply(in));<NEW_LINE>return a.flatMap(ina -> {<NEW_LINE>ReactiveSeq<R2> b = ReactiveSeq.fromIterable(iterable2.apply(in, ina));<NEW_LINE>return b.flatMap(inb -> {<NEW_LINE>ReactiveSeq<R3> c = ReactiveSeq.fromIterable(iterable3.apply(in, ina, inb));<NEW_LINE>return c.filter(in2 -> filterFunction.apply(in, ina, inb, in2)).map(in2 -> yieldingFunction.apply(in<MASK><NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
, ina, inb, in2));
1,474,135
public static DescribeHardwareTerminalsResponse unmarshall(DescribeHardwareTerminalsResponse describeHardwareTerminalsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeHardwareTerminalsResponse.setRequestId(_ctx.stringValue("DescribeHardwareTerminalsResponse.RequestId"));<NEW_LINE>List<HardwareTerminal> hardwareTerminals = new ArrayList<HardwareTerminal>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeHardwareTerminalsResponse.HardwareTerminals.Length"); i++) {<NEW_LINE>HardwareTerminal hardwareTerminal = new HardwareTerminal();<NEW_LINE>hardwareTerminal.setHardwareType(_ctx.stringValue("DescribeHardwareTerminalsResponse.HardwareTerminals[" + i + "].HardwareType"));<NEW_LINE>List<HardwareTypeDetail> hardwareTypeDetails <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeHardwareTerminalsResponse.HardwareTerminals[" + i + "].HardwareTypeDetails.Length"); j++) {<NEW_LINE>HardwareTypeDetail hardwareTypeDetail = new HardwareTypeDetail();<NEW_LINE>hardwareTypeDetail.setStockState(_ctx.stringValue("DescribeHardwareTerminalsResponse.HardwareTerminals[" + i + "].HardwareTypeDetails[" + j + "].StockState"));<NEW_LINE>hardwareTypeDetail.setHardwareVersion(_ctx.integerValue("DescribeHardwareTerminalsResponse.HardwareTerminals[" + i + "].HardwareTypeDetails[" + j + "].HardwareVersion"));<NEW_LINE>hardwareTypeDetail.setDescription(_ctx.stringValue("DescribeHardwareTerminalsResponse.HardwareTerminals[" + i + "].HardwareTypeDetails[" + j + "].Description"));<NEW_LINE>hardwareTypeDetails.add(hardwareTypeDetail);<NEW_LINE>}<NEW_LINE>hardwareTerminal.setHardwareTypeDetails(hardwareTypeDetails);<NEW_LINE>hardwareTerminals.add(hardwareTerminal);<NEW_LINE>}<NEW_LINE>describeHardwareTerminalsResponse.setHardwareTerminals(hardwareTerminals);<NEW_LINE>return describeHardwareTerminalsResponse;<NEW_LINE>}
= new ArrayList<HardwareTypeDetail>();
728,104
public void marshall(CreateLicenseConfigurationRequest createLicenseConfigurationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createLicenseConfigurationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseCountingType(), LICENSECOUNTINGTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseCount(), LICENSECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseCountHardLimit(), LICENSECOUNTHARDLIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseRules(), LICENSERULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getDisassociateWhenNotFound(), DISASSOCIATEWHENNOTFOUND_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getProductInformationList(), PRODUCTINFORMATIONLIST_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createLicenseConfigurationRequest.getDescription(), DESCRIPTION_BINDING);
186,161
private static RelationshipGroupRecord readRelationshipGroupExtendedRecord(long id, ReadableChannel channel) throws IOException {<NEW_LINE>byte flags = channel.get();<NEW_LINE>boolean inUse = bitFlag(flags, Record.IN_USE.byteValue());<NEW_LINE>boolean requireSecondaryUnit = bitFlag(flags, Record.REQUIRE_SECONDARY_UNIT);<NEW_LINE>boolean hasSecondaryUnit = bitFlag(flags, Record.HAS_SECONDARY_UNIT);<NEW_LINE>boolean usesFixedReferenceFormat = bitFlag(flags, Record.USES_FIXED_REFERENCE_FORMAT);<NEW_LINE>boolean hasExternalDegreesOut = bitFlag(flags, Record.ADDITIONAL_FLAG_1);<NEW_LINE>boolean hasExternalDegreesIn = bitFlag(flags, Record.ADDITIONAL_FLAG_2);<NEW_LINE>boolean hasExternalDegreesLoop = bitFlag(flags, Record.ADDITIONAL_FLAG_3);<NEW_LINE>int type = unsignedShortToInt(channel.getShort());<NEW_LINE>type |= unsignedByteToInt(channel.get()) << Short.SIZE;<NEW_LINE><MASK><NEW_LINE>long firstOut = channel.getLong();<NEW_LINE>long firstIn = channel.getLong();<NEW_LINE>long firstLoop = channel.getLong();<NEW_LINE>long owningNode = channel.getLong();<NEW_LINE>RelationshipGroupRecord record = new RelationshipGroupRecord(id).initialize(inUse, type, firstOut, firstIn, firstLoop, owningNode, next);<NEW_LINE>record.setHasExternalDegreesOut(hasExternalDegreesOut);<NEW_LINE>record.setHasExternalDegreesIn(hasExternalDegreesIn);<NEW_LINE>record.setHasExternalDegreesLoop(hasExternalDegreesLoop);<NEW_LINE>record.setRequiresSecondaryUnit(requireSecondaryUnit);<NEW_LINE>if (hasSecondaryUnit) {<NEW_LINE>record.setSecondaryUnitIdOnLoad(channel.getLong());<NEW_LINE>}<NEW_LINE>record.setUseFixedReferences(usesFixedReferenceFormat);<NEW_LINE>return record;<NEW_LINE>}
long next = channel.getLong();
196,174
public void createPack(ReadableMap options, final Promise promise) throws JSONException {<NEW_LINE>final String name = ConvertUtils.getString("name", options, "");<NEW_LINE>final OfflineManager offlineManager = RCTMGLOfflineModule.getOfflineManager(mReactContext);<NEW_LINE>LatLngBounds latLngBounds = getBoundsFromOptions(options);<NEW_LINE>TilesetDescriptorOptions descriptorOptions = new TilesetDescriptorOptions.Builder().styleURI(options.getString("styleURL")).minZoom((byte) options.getInt("minZoom")).maxZoom((byte) options.getInt("maxZoom")).build();<NEW_LINE>TilesetDescriptor tilesetDescriptor = offlineManager.createTilesetDescriptor(descriptorOptions);<NEW_LINE>ArrayList<TilesetDescriptor> descriptors = new ArrayList<>();<NEW_LINE>descriptors.add(tilesetDescriptor);<NEW_LINE>TileRegionLoadOptions loadOptions = new TileRegionLoadOptions.Builder().geometry(GeoJSONUtils.fromLatLngBoundsToPolygon(latLngBounds)).descriptors(descriptors).metadata(Value.valueOf(options.getString("metadata"))).acceptExpired(true).networkRestriction(NetworkRestriction.NONE).build();<NEW_LINE>String <MASK><NEW_LINE>JSONObject metadata = new JSONObject(metadataStr);<NEW_LINE>String id = metadata.getString("name");<NEW_LINE>TileRegionPack pack = new TileRegionPack(id, null, TileRegionPack.INACTIVE);<NEW_LINE>pack.loadOptions = loadOptions;<NEW_LINE>tileRegionPacks.put(id, pack);<NEW_LINE>promise.resolve(fromOfflineRegion(latLngBounds, metadataStr));<NEW_LINE>startPackDownload(pack);<NEW_LINE>}
metadataStr = options.getString("metadata");
1,188,474
public Mat run(Mat inputMat, ImageBlob imageBlob) {<NEW_LINE><MASK><NEW_LINE>int origin_h = inputMat.height();<NEW_LINE>imageBlob.getReshapeInfo().put("resize", new int[] { origin_w, origin_h });<NEW_LINE>int im_size_max = Math.max(origin_w, origin_h);<NEW_LINE>int im_size_min = Math.min(origin_w, origin_h);<NEW_LINE>float scale = (float) (short_size) / (float) (im_size_min);<NEW_LINE>if (max_size > 0) {<NEW_LINE>if (Math.round(scale * im_size_max) > max_size) {<NEW_LINE>scale = (float) (max_size) / (float) (im_size_max);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int width = Math.round(scale * origin_w);<NEW_LINE>int height = Math.round(scale * origin_h);<NEW_LINE>Size sz = new Size(width, height);<NEW_LINE>Imgproc.resize(inputMat, inputMat, sz, 0, 0, interpMap.get(interp));<NEW_LINE>imageBlob.setNewImageSize(inputMat.height(), 2);<NEW_LINE>imageBlob.setNewImageSize(inputMat.width(), 3);<NEW_LINE>imageBlob.setScale(scale);<NEW_LINE>return inputMat;<NEW_LINE>}
int origin_w = inputMat.width();
758,775
public static void teleportSpawnItem(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull ItemStack stack) {<NEW_LINE>EntityItem entity = new EntityItem(world, pos.getX() + .5, pos.getY() + .5, pos.<MASK><NEW_LINE>entity.setDefaultPickupDelay();<NEW_LINE>double origX = entity.posX, origY = MathHelper.clamp(entity.posY, 1, 255), origZ = entity.posZ;<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>double targetX = origX + rand.nextGaussian() * 16f;<NEW_LINE>double targetY = -1;<NEW_LINE>while (targetY < 1.1) {<NEW_LINE>targetY = origY + rand.nextGaussian() * 8f;<NEW_LINE>}<NEW_LINE>double targetZ = origZ + rand.nextGaussian() * 16f;<NEW_LINE>if (isClear(world, entity, targetX, targetY, targetZ) && doTeleport(world, entity, targetX, targetY, targetZ)) {<NEW_LINE>world.spawnEntity(entity);<NEW_LINE>entity.timeUntilPortal = 5;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>world.spawnEntity(entity);<NEW_LINE>}
getZ() + .5, stack);
1,790,458
public static TensorInfo constructFromJavaArray(Object obj) throws OrtException {<NEW_LINE>Class<?<MASK><NEW_LINE>// Check if it's an array or a scalar.<NEW_LINE>if (!objClass.isArray()) {<NEW_LINE>// Check if it's a valid non-array type<NEW_LINE>OnnxJavaType javaType = OnnxJavaType.mapFromClass(objClass);<NEW_LINE>if (javaType == OnnxJavaType.UNKNOWN) {<NEW_LINE>throw new OrtException("Cannot convert " + objClass + " to a OnnxTensor.");<NEW_LINE>} else {<NEW_LINE>// scalar primitive<NEW_LINE>return new TensorInfo(new long[0], javaType, OnnxTensorType.mapFromJavaType(javaType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Figure out base type and number of dimensions.<NEW_LINE>int dimensions = 0;<NEW_LINE>while (objClass.isArray()) {<NEW_LINE>objClass = objClass.getComponentType();<NEW_LINE>dimensions++;<NEW_LINE>}<NEW_LINE>if (!objClass.isPrimitive() && !objClass.equals(String.class)) {<NEW_LINE>throw new OrtException("Cannot create an OnnxTensor from a base type of " + objClass);<NEW_LINE>} else if (dimensions > MAX_DIMENSIONS) {<NEW_LINE>throw new OrtException("Cannot create an OnnxTensor with more than " + MAX_DIMENSIONS + " dimensions. Found " + dimensions + " dimensions.");<NEW_LINE>}<NEW_LINE>OnnxJavaType javaType = OnnxJavaType.mapFromClass(objClass);<NEW_LINE>// Now we extract the shape and validate that the java array is rectangular (i.e. not ragged).<NEW_LINE>// this is pretty nasty as we have to look at every object array recursively.<NEW_LINE>// Thanks Java!<NEW_LINE>long[] shape = new long[dimensions];<NEW_LINE>extractShape(shape, 0, obj);<NEW_LINE>return new TensorInfo(shape, javaType, OnnxTensorType.mapFromJavaType(javaType));<NEW_LINE>}
> objClass = obj.getClass();
1,152,920
final PutDomainPermissionsPolicyResult executePutDomainPermissionsPolicy(PutDomainPermissionsPolicyRequest putDomainPermissionsPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putDomainPermissionsPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutDomainPermissionsPolicyRequest> request = null;<NEW_LINE>Response<PutDomainPermissionsPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutDomainPermissionsPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putDomainPermissionsPolicyRequest));<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, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutDomainPermissionsPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutDomainPermissionsPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutDomainPermissionsPolicyResultJsonUnmarshaller());<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,678,663
public void run() {<NEW_LINE>if (isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (delegate instanceof AbstractFuture) {<NEW_LINE>AbstractFuture<? extends V> other = (AbstractFuture<? extends V>) delegate;<NEW_LINE>value = other.value;<NEW_LINE>throwable = other.throwable;<NEW_LINE>// don't copy the mayInterruptIfRunning bit, for consistency with the server, to ensure that<NEW_LINE>// interruptTask() is called if and only if the bit is true and because we cannot infer the<NEW_LINE>// interrupt status from non AbstractFuture futures.<NEW_LINE>state = other.state;<NEW_LINE>notifyAndClearListeners();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>forceSet(getDone(delegate));<NEW_LINE>} catch (ExecutionException exception) {<NEW_LINE><MASK><NEW_LINE>} catch (CancellationException cancellation) {<NEW_LINE>cancel(false);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>forceSetException(t);<NEW_LINE>}<NEW_LINE>}
forceSetException(exception.getCause());
1,452,875
public void updateBlock(GlowBlock block) {<NEW_LINE>if (isNearWater(block) || GlowBiomeClimate.isRainy(block)) {<NEW_LINE>// set this block as fully wet<NEW_LINE>block.setData((byte) 7);<NEW_LINE>} else if (block.getData() > 0) {<NEW_LINE>// if this block is wet, it becomes less wet<NEW_LINE>block.// if this block is wet, it becomes less wet<NEW_LINE>setData((byte) (block.getData() - 1));<NEW_LINE>} else if (!Arrays.asList(possibleCrops).contains(block.getRelative(BlockFace.UP).getType())) {<NEW_LINE>// turns block back to dirt if nothing is planted on<NEW_LINE>GlowBlockState state = block.getState();<NEW_LINE>state.setType(Material.DIRT);<NEW_LINE>state<MASK><NEW_LINE>BlockFadeEvent fadeEvent = new BlockFadeEvent(block, state);<NEW_LINE>EventFactory.getInstance().callEvent(fadeEvent);<NEW_LINE>if (!fadeEvent.isCancelled()) {<NEW_LINE>state.update(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.setRawData((byte) 0);
1,520,832
public Value unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Value value = new Value();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("originalValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>value.setOriginalValue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("interpretedValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>value.setInterpretedValue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resolvedValues", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>value.setResolvedValues(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
697,544
private static TsMethodModel createDeserializationGenericFunctionConstructor(SymbolTable symbolTable, TsModel tsModel, TsBeanModel bean) {<NEW_LINE>final Symbol beanIdentifier = symbolTable.getSymbol(bean.getOrigin());<NEW_LINE>List<TsType.GenericVariableType> typeParameters = getTypeParameters(bean.getOrigin());<NEW_LINE>final TsType.ReferenceType dataType = new <MASK><NEW_LINE>final List<TsParameterModel> constructorFnOfParameters = getConstructorFnOfParameters(typeParameters);<NEW_LINE>final List<TsExpression> arguments = new ArrayList<>();<NEW_LINE>arguments.add(new TsIdentifierReference("data"));<NEW_LINE>for (TsParameterModel constructorFnOfParameter : constructorFnOfParameters) {<NEW_LINE>arguments.add(new TsIdentifierReference(constructorFnOfParameter.name));<NEW_LINE>}<NEW_LINE>final List<TsStatement> body = new ArrayList<>();<NEW_LINE>body.add(new TsReturnStatement(new TsArrowFunction(Arrays.asList(new TsParameter("data", null)), new TsCallExpression(new TsMemberExpression(new TsTypeReferenceExpression(new TsType.ReferenceType(beanIdentifier)), "fromData"), null, arguments))));<NEW_LINE>return new TsMethodModel("fromDataFn", TsModifierFlags.None.setStatic(), typeParameters, constructorFnOfParameters, new TsType.FunctionType(Arrays.asList(new TsParameter("data", dataType)), dataType), body, null);<NEW_LINE>}
TsType.GenericReferenceType(beanIdentifier, typeParameters);
1,804,126
public void run() {<NEW_LINE>PwDatabase pm = mDb.pm;<NEW_LINE>byte[] backupKey = new byte[pm.masterKey.length];<NEW_LINE>System.arraycopy(pm.masterKey, 0, backupKey, 0, backupKey.length);<NEW_LINE>// Set key<NEW_LINE>try {<NEW_LINE>InputStream is = <MASK><NEW_LINE>pm.setMasterKey(mPassword, is);<NEW_LINE>} catch (InvalidKeyFileException e) {<NEW_LINE>erase(backupKey);<NEW_LINE>finish(false, e.getMessage());<NEW_LINE>return;<NEW_LINE>} catch (IOException e) {<NEW_LINE>erase(backupKey);<NEW_LINE>finish(false, e.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Save Database<NEW_LINE>mFinish = new AfterSave(backupKey, mFinish);<NEW_LINE>SaveDB save = new SaveDB(ctx, mDb, mFinish, mDontSave);<NEW_LINE>save.run();<NEW_LINE>}
UriUtil.getUriInputStream(ctx, mKeyfile);
1,799,106
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>// taking input array<NEW_LINE>System.out.println("Enter size of array:");<NEW_LINE><MASK><NEW_LINE>float[] arr = new float[size];<NEW_LINE>System.out.println("Enter array elements:");<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>arr[i] = sc.nextFloat();<NEW_LINE>}<NEW_LINE>System.out.println("Enter number of buckets:");<NEW_LINE>int bucketNum = sc.nextInt();<NEW_LINE>// before sorting<NEW_LINE>System.out.println("Array before bucket sort:");<NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>System.out.print(arr[i] + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>bucketSort(arr, bucketNum);<NEW_LINE>// after sorting<NEW_LINE>System.out.println("Array after Bucket sort:");<NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>System.out.print(arr[i] + " ");<NEW_LINE>}<NEW_LINE>sc.close();<NEW_LINE>}
int size = sc.nextInt();
1,348,812
public static IdentityCookieToken createIdentityToken(KeycloakSession keycloakSession, RealmModel realm, UserModel user, UserSessionModel session, String issuer) {<NEW_LINE>IdentityCookieToken token = new IdentityCookieToken();<NEW_LINE>token.id(KeycloakModelUtils.generateId());<NEW_LINE>token.issuedNow();<NEW_LINE>token.subject(user.getId());<NEW_LINE>token.issuer(issuer);<NEW_LINE>token.type(TokenUtil.TOKEN_TYPE_KEYCLOAK_ID);<NEW_LINE>if (session != null) {<NEW_LINE>token.setSessionState(session.getId());<NEW_LINE>}<NEW_LINE>if (session != null && session.isRememberMe() && realm.getSsoSessionMaxLifespanRememberMe() > 0) {<NEW_LINE>token.expiration(Time.currentTime() + realm.getSsoSessionMaxLifespanRememberMe());<NEW_LINE>} else if (realm.getSsoSessionMaxLifespan() > 0) {<NEW_LINE>token.expiration(Time.currentTime() + realm.getSsoSessionMaxLifespan());<NEW_LINE>}<NEW_LINE>String stateChecker = (String) keycloakSession.getAttribute("state_checker");<NEW_LINE>if (stateChecker == null) {<NEW_LINE>stateChecker = Base64Url.encode(SecretGenerator.<MASK><NEW_LINE>keycloakSession.setAttribute("state_checker", stateChecker);<NEW_LINE>}<NEW_LINE>token.getOtherClaims().put("state_checker", stateChecker);<NEW_LINE>return token;<NEW_LINE>}
getInstance().randomBytes());
561,072
public AsyncDocumentClient build() {<NEW_LINE>ifThrowIllegalArgException(this.serviceEndpoint == null || StringUtils.isEmpty(this.serviceEndpoint<MASK><NEW_LINE>ifThrowIllegalArgException(this.masterKeyOrResourceToken == null && (permissionFeed == null || permissionFeed.isEmpty()) && this.credential == null && this.tokenCredential == null && this.cosmosAuthorizationTokenResolver == null, "cannot buildAsyncClient client without any one of masterKey, " + "resource token, permissionFeed and azure key credential");<NEW_LINE>ifThrowIllegalArgException(credential != null && StringUtils.isEmpty(credential.getKey()), "cannot buildAsyncClient client without key credential");<NEW_LINE>RxDocumentClientImpl client = new RxDocumentClientImpl(serviceEndpoint, masterKeyOrResourceToken, permissionFeed, connectionPolicy, desiredConsistencyLevel, configs, cosmosAuthorizationTokenResolver, credential, tokenCredential, sessionCapturingOverride, transportClientSharing, contentResponseOnWriteEnabled, state, apiType);<NEW_LINE>client.init(state, null);<NEW_LINE>return client;<NEW_LINE>}
.toString()), "cannot buildAsyncClient client without service endpoint");
1,578,507
public void doMentionToSpeaker(Annotation doc) {<NEW_LINE>List<CoreMap> quotes = doc.get(CoreAnnotations.QuotationsAnnotation.class);<NEW_LINE>List<List<Pair<Integer, Integer>>> skipChains = new ArrayList<>();<NEW_LINE>// Pairs are (pred_idx, paragraph_idx)<NEW_LINE>List<Pair<Integer, Integer>> currChain = new ArrayList<>();<NEW_LINE>for (int quote_idx = 0; quote_idx < quotes.size(); quote_idx++) {<NEW_LINE>CoreMap <MASK><NEW_LINE>if (quote.get(QuoteAttributionAnnotator.SpeakerAnnotation.class) != null) {<NEW_LINE>int para_idx = getQuoteParagraph(quote);<NEW_LINE>if (currChain.size() != 0) {<NEW_LINE>if (currChain.get(currChain.size() - 1).second != para_idx - 2) {<NEW_LINE>skipChains.add(currChain);<NEW_LINE>currChain = new ArrayList<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currChain.add(new Pair<>(quote_idx, para_idx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currChain.size() != 0) {<NEW_LINE>skipChains.add(currChain);<NEW_LINE>}<NEW_LINE>for (List<Pair<Integer, Integer>> skipChain : skipChains) {<NEW_LINE>Pair<Integer, Integer> firstPair = skipChain.get(0);<NEW_LINE>int firstParagraph = firstPair.second;<NEW_LINE>// look for conversational chain candidate<NEW_LINE>for (int prev_idx = firstPair.first - 1; prev_idx >= 0; prev_idx--) {<NEW_LINE>CoreMap quote = quotes.get(prev_idx + 1);<NEW_LINE>CoreMap prevQuote = quotes.get(prev_idx);<NEW_LINE>if (getQuoteParagraph(prevQuote) == firstParagraph - 2) {<NEW_LINE>quote.set(QuoteAttributionAnnotator.SpeakerAnnotation.class, prevQuote.get(QuoteAttributionAnnotator.SpeakerAnnotation.class));<NEW_LINE>quote.set(QuoteAttributionAnnotator.SpeakerSieveAnnotation.class, "Loose Conversational Speaker");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
quote = quotes.get(quote_idx);
513,228
public void changeToSlave(int brokerId) {<NEW_LINE>log.info("Begin to change to slave brokerName={} brokerId={}", brokerConfig.getBrokerName(), brokerId);<NEW_LINE>// change the role<NEW_LINE>// TO DO check<NEW_LINE>brokerConfig.setBrokerId(brokerId == 0 ? 1 : brokerId);<NEW_LINE>messageStoreConfig.setBrokerRole(BrokerRole.SLAVE);<NEW_LINE>// handle the scheduled service<NEW_LINE>try {<NEW_LINE>this.messageStore.handleScheduleMessageService(BrokerRole.SLAVE);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.error("[MONITOR] handleScheduleMessageService failed when changing to slave", t);<NEW_LINE>}<NEW_LINE>// handle the transactional service<NEW_LINE>try {<NEW_LINE>this.shutdownProcessorByHa();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.error("[MONITOR] shutdownProcessorByHa failed when changing to slave", t);<NEW_LINE>}<NEW_LINE>// handle the slave synchronise<NEW_LINE>handleSlaveSynchronize(BrokerRole.SLAVE);<NEW_LINE>try {<NEW_LINE>this.<MASK><NEW_LINE>} catch (Throwable ignored) {<NEW_LINE>}<NEW_LINE>log.info("Finish to change to slave brokerName={} brokerId={}", brokerConfig.getBrokerName(), brokerId);<NEW_LINE>}
registerBrokerAll(true, true, true);
410,748
private Suggestions prefixLookup(final List<NamedIndexReader> readers, final SuggesterPrefixQuery suggesterQuery) {<NEW_LINE>BooleanWrapper partialResult = new BooleanWrapper();<NEW_LINE>List<LookupResultItem> results = readers.parallelStream().flatMap(namedIndexReader -> {<NEW_LINE>SuggesterProjectData data = projectData.get(namedIndexReader.name);<NEW_LINE>if (data == null) {<NEW_LINE>LOGGER.log(Level.FINE, "{0} not yet initialized", namedIndexReader.name);<NEW_LINE>partialResult.value = true;<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>boolean gotLock = data.tryLock();<NEW_LINE>if (!gotLock) {<NEW_LINE>// do not wait for rebuild<NEW_LINE>partialResult.value = true;<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String prefix = suggesterQuery.getPrefix().text();<NEW_LINE>return data.lookup(suggesterQuery.getField(), prefix, resultSize).stream().map(item -> new LookupResultItem(item.key.toString(), namedIndexReader<MASK><NEW_LINE>} finally {<NEW_LINE>data.unlock();<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return new Suggestions(results, partialResult.value);<NEW_LINE>}
.name, item.value));
634,066
public void uploadFromFileCodeSnippets() {<NEW_LINE>// BEGIN: com.azure.storage.file.datalake.DataLakeFileClient.uploadFromFile#String<NEW_LINE>try {<NEW_LINE>client.uploadFromFile(filePath);<NEW_LINE>System.out.println("Upload from file succeeded");<NEW_LINE>} catch (UncheckedIOException ex) {<NEW_LINE>System.err.printf("Failed to upload from file %s%n", ex.getMessage());<NEW_LINE>}<NEW_LINE>// END: com.azure.storage.file.datalake.DataLakeFileClient.uploadFromFile#String<NEW_LINE>// BEGIN: com.azure.storage.file.datalake.DataLakeFileClient.uploadFromFile#String-boolean<NEW_LINE>try {<NEW_LINE>boolean overwrite = false;<NEW_LINE><MASK><NEW_LINE>System.out.println("Upload from file succeeded");<NEW_LINE>} catch (UncheckedIOException ex) {<NEW_LINE>System.err.printf("Failed to upload from file %s%n", ex.getMessage());<NEW_LINE>}<NEW_LINE>// END: com.azure.storage.file.datalake.DataLakeFileClient.uploadFromFile#String-boolean<NEW_LINE>// BEGIN: com.azure.storage.file.datalake.DataLakeFileClient.uploadFromFile#String-ParallelTransferOptions-PathHttpHeaders-Map-DataLakeRequestConditions-Duration<NEW_LINE>PathHttpHeaders headers = new PathHttpHeaders().setContentMd5("data".getBytes(StandardCharsets.UTF_8)).setContentLanguage("en-US").setContentType("binary");<NEW_LINE>Map<String, String> metadata = Collections.singletonMap("metadata", "value");<NEW_LINE>DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));<NEW_LINE>// 100 MB;<NEW_LINE>Long blockSize = 100L * 1024L * 1024L;<NEW_LINE>ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions().setBlockSizeLong(blockSize);<NEW_LINE>try {<NEW_LINE>client.uploadFromFile(filePath, parallelTransferOptions, headers, metadata, requestConditions, timeout);<NEW_LINE>System.out.println("Upload from file succeeded");<NEW_LINE>} catch (UncheckedIOException ex) {<NEW_LINE>System.err.printf("Failed to upload from file %s%n", ex.getMessage());<NEW_LINE>}<NEW_LINE>// END: com.azure.storage.file.datalake.DataLakeFileClient.uploadFromFile#String-ParallelTransferOptions-PathHttpHeaders-Map-DataLakeRequestConditions-Duration<NEW_LINE>}
client.uploadFromFile(filePath, overwrite);
1,013,620
public void onClick(View arg0) {<NEW_LINE>if (Authentication.didOnline || submission.getComments() != null) {<NEW_LINE>holder.title.setAlpha(0.65f);<NEW_LINE>holder.leadImage.setAlpha(0.65f);<NEW_LINE>holder.thumbimage.setAlpha(0.65f);<NEW_LINE>Intent i2 = new <MASK><NEW_LINE>i2.putExtra(CommentsScreen.EXTRA_PAGE, holder2.getBindingAdapterPosition() - 1);<NEW_LINE>i2.putExtra(CommentsScreen.EXTRA_MULTIREDDIT, dataSet.multiReddit.getDisplayName());<NEW_LINE>context.startActivityForResult(i2, 940);<NEW_LINE>i2.putExtra("fullname", submission.getFullName());<NEW_LINE>clicked = holder2.getBindingAdapterPosition();<NEW_LINE>} else {<NEW_LINE>Snackbar s = Snackbar.make(holder.itemView, R.string.offline_comments_not_loaded, Snackbar.LENGTH_SHORT);<NEW_LINE>LayoutUtils.showSnackbar(s);<NEW_LINE>}<NEW_LINE>}
Intent(context, CommentsScreen.class);
1,387,724
public void refreshStatisticsForEntity(String name) {<NEW_LINE>log.debug("Refreshing statistics for entity " + name);<NEW_LINE>MetaClass metaClass = metadata.getExtendedEntities().getOriginalOrThisMetaClass(metadata.getClassNN(name));<NEW_LINE>String storeName = metadata.getTools().getStoreName(metaClass);<NEW_LINE>if (storeName == null) {<NEW_LINE>log.debug("Entity " + name + " is not persistent, ignoring it");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Transaction tx = persistence.createTransaction(storeName);<NEW_LINE>try {<NEW_LINE>EntityManager em = persistence.getEntityManager(storeName);<NEW_LINE>Query q = em.createQuery("select count(e) from " + name + " e");<NEW_LINE>Long count = <MASK><NEW_LINE>EntityStatistics entityStatistics;<NEW_LINE>if (Stores.isMain(storeName)) {<NEW_LINE>entityStatistics = getEntityStatisticsInstance(name, em);<NEW_LINE>entityStatistics.setInstanceCount(count);<NEW_LINE>} else {<NEW_LINE>entityStatistics = persistence.callInTransaction(mainDsEm -> {<NEW_LINE>EntityStatistics es = getEntityStatisticsInstance(name, mainDsEm);<NEW_LINE>es.setInstanceCount(count);<NEW_LINE>return es;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>getStatisticsCache().put(name, entityStatistics);<NEW_LINE>tx.commit();<NEW_LINE>} finally {<NEW_LINE>tx.end();<NEW_LINE>}<NEW_LINE>}
(Long) q.getSingleResult();
356,053
private void printBoxedOperators() {<NEW_LINE>PrimitiveType primitiveType = env.typeUtil().unboxedType(typeElement.asType());<NEW_LINE>if (primitiveType == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>char binaryName = env.typeUtil().getSignatureName(primitiveType).charAt(0);<NEW_LINE>String <MASK><NEW_LINE>String capName = NameTable.capitalize(primitiveName);<NEW_LINE>String primitiveTypeName = NameTable.getPrimitiveObjCType(primitiveType);<NEW_LINE>String valueMethod = primitiveName + "Value";<NEW_LINE>if (primitiveName.equals("long")) {<NEW_LINE>valueMethod = "longLongValue";<NEW_LINE>} else if (primitiveName.equals("byte")) {<NEW_LINE>valueMethod = "charValue";<NEW_LINE>}<NEW_LINE>newline();<NEW_LINE>printf("BOXED_INC_AND_DEC(%s, %s, %s)\n", capName, valueMethod, typeName);<NEW_LINE>if ("DFIJ".indexOf(binaryName) >= 0) {<NEW_LINE>printf("BOXED_COMPOUND_ASSIGN_ARITHMETIC(%s, %s, %s, %s)\n", capName, valueMethod, primitiveTypeName, typeName);<NEW_LINE>}<NEW_LINE>if ("IJ".indexOf(binaryName) >= 0) {<NEW_LINE>printf("BOXED_COMPOUND_ASSIGN_MOD(%s, %s, %s, %s)\n", capName, valueMethod, primitiveTypeName, typeName);<NEW_LINE>}<NEW_LINE>if ("DF".indexOf(binaryName) >= 0) {<NEW_LINE>printf("BOXED_COMPOUND_ASSIGN_FPMOD(%s, %s, %s, %s)\n", capName, valueMethod, primitiveTypeName, typeName);<NEW_LINE>}<NEW_LINE>if ("IJ".indexOf(binaryName) >= 0) {<NEW_LINE>printf("BOXED_COMPOUND_ASSIGN_BITWISE(%s, %s, %s, %s)\n", capName, valueMethod, primitiveTypeName, typeName);<NEW_LINE>}<NEW_LINE>if ("I".indexOf(binaryName) >= 0) {<NEW_LINE>printf("BOXED_SHIFT_ASSIGN_32(%s, %s, %s, %s)\n", capName, valueMethod, primitiveTypeName, typeName);<NEW_LINE>}<NEW_LINE>if ("J".indexOf(binaryName) >= 0) {<NEW_LINE>printf("BOXED_SHIFT_ASSIGN_64(%s, %s, %s, %s)\n", capName, valueMethod, primitiveTypeName, typeName);<NEW_LINE>}<NEW_LINE>}
primitiveName = TypeUtil.getName(primitiveType);
461,309
public GetAlarmsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetAlarmsResult getAlarmsResult = new GetAlarmsResult();<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 getAlarmsResult;<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("alarms", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAlarmsResult.setAlarms(new ListUnmarshaller<Alarm>(AlarmJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("nextPageToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAlarmsResult.setNextPageToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getAlarmsResult;<NEW_LINE>}
)).unmarshall(context));
1,453,910
public static void main(String[] args) {<NEW_LINE>// Vector dot product<NEW_LINE>double[] x = { 2.0, 3.0, 4.0 };<NEW_LINE>double[] y = { 3.0, 2.0, 5.5 };<NEW_LINE>StdOut.println("Dot: " + dot(x, y));<NEW_LINE>// Matrix-matrix product<NEW_LINE>double[][] a = { { 1, 2 } };<NEW_LINE>double[][] b = { { 2, 3, 4 }, { 2, 3, 4 } };<NEW_LINE>double[][] c = mult(a, b);<NEW_LINE>StdOut.println("\nMatrix multiplication:");<NEW_LINE>for (int i = 0; i < c.length; i++) {<NEW_LINE>for (int j = 0; j < c[0].length; j++) {<NEW_LINE>StdOut.print(c[i][j] + " ");<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>}<NEW_LINE>// Transpose<NEW_LINE>double[][] d = { { 1, 2, 3 }, { 4, 5, 6 } };<NEW_LINE>double[][] e = transpose(d);<NEW_LINE>StdOut.println("\nTranspose:");<NEW_LINE>for (int i = 0; i < e.length; i++) {<NEW_LINE>for (int j = 0; j < e[0].length; j++) {<NEW_LINE>StdOut.print(e[i][j] + " ");<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>}<NEW_LINE>// Matrix-vector product<NEW_LINE>double[][] f = { { 1, 2, 3 }, { 4, 5, 6 } };<NEW_LINE>double[] g = { 1, 2, 3 };<NEW_LINE>double[] h = mult(f, g);<NEW_LINE>StdOut.println("\nMatrix-vector product:");<NEW_LINE>for (int i = 0; i < h.length; i++) {<NEW_LINE>StdOut.print(h[i] + " ");<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>// Vector-matrix product<NEW_LINE>double[] i = { 1, 2 };<NEW_LINE>double[][] j = { { 1, 2, 3 }, { 4, 5, 6 } };<NEW_LINE>double[] <MASK><NEW_LINE>StdOut.println("\nVector-matrix product:");<NEW_LINE>for (int l = 0; l < k.length; l++) {<NEW_LINE>StdOut.print(k[l] + " ");<NEW_LINE>}<NEW_LINE>}
k = mult(i, j);
65,015
public void run(final SyncTaskChain chain) {<NEW_LINE>final ApplianceVmAsyncHttpCallReply reply = new ApplianceVmAsyncHttpCallReply();<NEW_LINE>if (msg.isCheckStatus() && getSelf().getStatus() != ApplianceVmStatus.Connected) {<NEW_LINE>reply.setError(operr("appliance vm[uuid:%s] is in status of %s that cannot make http call to %s", self.getUuid(), getSelf().getStatus()<MASK><NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MessageCommandRecorder.record(msg.getCommandClassName());<NEW_LINE>restf.asyncJsonPost(buildUrl(msg.getPath()), msg.getCommand(), new JsonAsyncRESTCallback<LinkedHashMap>(msg, chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode err) {<NEW_LINE>reply.setError(err);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(LinkedHashMap ret) {<NEW_LINE>reply.setResponse(ret);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Class<LinkedHashMap> getReturnClass() {<NEW_LINE>return LinkedHashMap.class;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
, msg.getPath()));
1,238,174
private PartialPath parseIntoPath(IoTDBSqlParser.IntoPathContext intoPathContext) {<NEW_LINE>int levelLimitOfSourcePrefixPath;<NEW_LINE>if (queryOp.isGroupByLevel()) {<NEW_LINE>levelLimitOfSourcePrefixPath = Arrays.stream(queryOp.getSpecialClauseComponent().getLevels()).max().getAsInt();<NEW_LINE>} else {<NEW_LINE>levelLimitOfSourcePrefixPath = queryOp.getFromComponent().getPrefixPaths().get(0).getNodeLength() - 1;<NEW_LINE>}<NEW_LINE>PartialPath intoPath = null;<NEW_LINE>if (intoPathContext.fullPath() != null) {<NEW_LINE>intoPath = parseFullPath(intoPathContext.fullPath());<NEW_LINE>Matcher m = leveledPathNodePattern.matcher(intoPath.getFullPath());<NEW_LINE>while (m.find()) {<NEW_LINE>String param = m.group();<NEW_LINE>int nodeIndex;<NEW_LINE>try {<NEW_LINE>nodeIndex = Integer.parseInt(param.substring(2, param.length() - 1).trim());<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new SQLParserException("the x of ${x} should be an integer.");<NEW_LINE>}<NEW_LINE>if (nodeIndex < 1 || levelLimitOfSourcePrefixPath < nodeIndex) {<NEW_LINE>throw new SQLParserException("the x of ${x} should be greater than 0 and equal to or less than <level> or the length of queried path prefix.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (intoPathContext.nodeNameWithoutWildcard() != null) {<NEW_LINE>List<IoTDBSqlParser.NodeNameWithoutWildcardContext> nodeNameWithoutStars = intoPathContext.nodeNameWithoutWildcard();<NEW_LINE>String[] intoPathNodes = new String[1 + levelLimitOfSourcePrefixPath + nodeNameWithoutStars.size()];<NEW_LINE>intoPathNodes[0] = "root";<NEW_LINE>for (int i = 1; i <= levelLimitOfSourcePrefixPath; ++i) {<NEW_LINE>intoPathNodes[<MASK><NEW_LINE>}<NEW_LINE>for (int i = 1; i <= nodeNameWithoutStars.size(); ++i) {<NEW_LINE>intoPathNodes[levelLimitOfSourcePrefixPath + i] = parseNodeName(nodeNameWithoutStars.get(i - 1).getText());<NEW_LINE>}<NEW_LINE>intoPath = new PartialPath(intoPathNodes);<NEW_LINE>}<NEW_LINE>return intoPath;<NEW_LINE>}
i] = "${" + i + "}";
229,840
public FieldComparator<?> newComparator(String fieldname, int numHits, boolean enableSkipping, boolean reversed) {<NEW_LINE>assert indexFieldData == null || fieldname.<MASK><NEW_LINE>final long lMissingValue = (Long) missingObject(missingValue, reversed);<NEW_LINE>// NOTE: it's important to pass null as a missing value in the constructor so that<NEW_LINE>// the comparator doesn't check docsWithField since we replace missing values in select()<NEW_LINE>return new LongComparator(numHits, null, null, reversed, false) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException {<NEW_LINE>return new LongLeafComparator(context) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException {<NEW_LINE>return LongValuesComparatorSource.this.getNumericDocValues(context, lMissingValue);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
equals(indexFieldData.getFieldName());
1,400,977
public SwaggerEntity swaggerJson() {<NEW_LINE>this.DEFINITION_MAP.clear();<NEW_LINE>List<ApiInfo> infos = requestMagicDynamicRegistry.mappings();<NEW_LINE>SwaggerEntity swaggerEntity = new SwaggerEntity();<NEW_LINE>swaggerEntity.setInfo(info);<NEW_LINE>swaggerEntity.setBasePath(this.basePath);<NEW_LINE>for (ApiInfo info : infos) {<NEW_LINE>String groupName = magicResourceService.getGroupName(info.getGroupId()).replace("/", "-");<NEW_LINE>String requestPath = PathUtils.replaceSlash(this.prefix + magicResourceService.getGroupPath(info.getGroupId()) + "/" + info.getPath());<NEW_LINE>SwaggerEntity.Path path = new SwaggerEntity.Path(info.getId());<NEW_LINE>path.addTag(groupName);<NEW_LINE>boolean hasBody = false;<NEW_LINE>try {<NEW_LINE>List<Map<String, Object<MASK><NEW_LINE>hasBody = parameters.stream().anyMatch(it -> VAR_NAME_REQUEST_BODY.equals(it.get("in")));<NEW_LINE>BaseDefinition baseDefinition = info.getRequestBodyDefinition();<NEW_LINE>if (hasBody && baseDefinition != null) {<NEW_LINE>doProcessDefinition(baseDefinition, info, groupName, "root_", "request", 0);<NEW_LINE>}<NEW_LINE>parameters.forEach(path::addParameter);<NEW_LINE>if (this.persistenceResponseBody) {<NEW_LINE>baseDefinition = info.getResponseBodyDefinition();<NEW_LINE>if (baseDefinition != null) {<NEW_LINE>Map responseMap = parseResponse(info);<NEW_LINE>if (!responseMap.isEmpty()) {<NEW_LINE>path.setResponses(responseMap);<NEW_LINE>doProcessDefinition(baseDefinition, info, groupName, "root_" + baseDefinition.getName(), "response", 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>path.addResponse("200", JsonUtils.readValue(Objects.toString(info.getResponseBody(), BODY_EMPTY), Object.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>if (hasBody) {<NEW_LINE>path.addConsume("application/json");<NEW_LINE>} else {<NEW_LINE>path.addConsume("*/*");<NEW_LINE>}<NEW_LINE>path.addProduce("application/json");<NEW_LINE>path.setSummary(info.getName());<NEW_LINE>path.setDescription(StringUtils.defaultIfBlank(info.getDescription(), info.getName()));<NEW_LINE>swaggerEntity.addPath(requestPath, info.getMethod(), path);<NEW_LINE>}<NEW_LINE>if (this.DEFINITION_MAP.size() > 0) {<NEW_LINE>Set<Map.Entry> entries = ((Map) this.DEFINITION_MAP).entrySet();<NEW_LINE>for (Map.Entry entry : entries) {<NEW_LINE>swaggerEntity.addDefinitions(Objects.toString(entry.getKey()), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return swaggerEntity;<NEW_LINE>}
>> parameters = parseParameters(info);
847,251
private void processModuleReferenceTable(ModuleReferenceTable mrt, SegmentTable st, ImportedNameTable imp, Program program, SegmentedAddressSpace space, MessageLog log, TaskMonitor monitor) throws IOException {<NEW_LINE>int thunkBodySize = 4;<NEW_LINE>ExternalManager externalManager = program.getExternalManager();<NEW_LINE>FunctionManager functionManager = program.getFunctionManager();<NEW_LINE>Namespace globalNamespace = program.getGlobalNamespace();<NEW_LINE>LengthStringSet[] names = mrt.getNames();<NEW_LINE>String[][] mod2proclist = new String[names.length][];<NEW_LINE>int length = 0;<NEW_LINE>for (int i = 0; i < names.length; ++i) {<NEW_LINE>String moduleName = names[i].getString();<NEW_LINE>String[] callnames = getCallNamesForModule(moduleName, mrt, st, imp);<NEW_LINE>mod2proclist[i] = callnames;<NEW_LINE>length += callnames.length * thunkBodySize;<NEW_LINE>}<NEW_LINE>if (length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int segment = space.getNextOpenSegment(program.getMemory().getMaxAddress());<NEW_LINE>Address addr = space.getAddress(segment, 0);<NEW_LINE>String comment = "";<NEW_LINE>String source = "";<NEW_LINE>// This isn't a real block, just place holder addresses, so don't create an initialized block<NEW_LINE>MemoryBlockUtils.createUninitializedBlock(program, false, MemoryBlock.EXTERNAL_BLOCK_NAME, addr, length, comment, source, true, false, false, log);<NEW_LINE>for (int i = 0; i < names.length; ++i) {<NEW_LINE>String moduleName = names[i].getString();<NEW_LINE>String[] callnames = mod2proclist[i];<NEW_LINE>for (String callname : callnames) {<NEW_LINE>Function refFunction = null;<NEW_LINE>try {<NEW_LINE>ExternalLocation loc;<NEW_LINE>loc = externalManager.addExtFunction(moduleName, callname, null, SourceType.IMPORTED);<NEW_LINE>refFunction = loc.getFunction();<NEW_LINE>} catch (DuplicateNameException e) {<NEW_LINE>log.appendMsg(e.getMessage() + '\n');<NEW_LINE>continue;<NEW_LINE>} catch (InvalidInputException e) {<NEW_LINE>log.appendMsg(e.getMessage() + '\n');<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>AddressSet body = new AddressSet();<NEW_LINE>body.add(addr, addr.add(thunkBodySize - 1));<NEW_LINE>try {<NEW_LINE>functionManager.createThunkFunction(null, globalNamespace, addr, body, refFunction, SourceType.IMPORTED);<NEW_LINE>} catch (OverlappingFunctionException e) {<NEW_LINE>log.appendMsg(<MASK><NEW_LINE>}<NEW_LINE>addr = addr.addWrap(thunkBodySize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
e.getMessage() + '\n');
783,625
private boolean reloadFromDB(Transaction tx) throws DynamicNamespacePrefixConflict {<NEW_LINE>Node nsPrefDefNode;<NEW_LINE>ResourceIterator<Node> namespacePrefixDefinitionNodes = tx.findNodes<MASK><NEW_LINE>if (namespacePrefixDefinitionNodes.hasNext()) {<NEW_LINE>nsPrefDefNode = namespacePrefixDefinitionNodes.next();<NEW_LINE>// to prevent concurrent updates<NEW_LINE>tx.acquireWriteLock(nsPrefDefNode);<NEW_LINE>// get the latest from the DB and update it.<NEW_LINE>for (Entry<String, Object> entry : nsPrefDefNode.getAllProperties().entrySet()) {<NEW_LINE>if (!prefixToNs.containsKey(entry.getKey()) && !nsToPrefix.containsKey(entry.getValue())) {<NEW_LINE>// it's a new entry. We get it.<NEW_LINE>add(entry.getKey(), (String) entry.getValue());<NEW_LINE>} else if (prefixToNs.containsKey(entry.getKey()) && !nsToPrefix.containsKey(entry.getValue())) {<NEW_LINE>throw new DynamicNamespacePrefixConflict("Prefix " + entry.getKey() + " is already in use for namespace <" + entry.getValue() + ">");<NEW_LINE>} else if (!prefixToNs.containsKey(entry.getKey()) && nsToPrefix.containsKey(entry.getValue())) {<NEW_LINE>throw new DynamicNamespacePrefixConflict("An alternative prefix (" + entry.getKey() + ") is already in use for namespace <" + entry.getValue() + ">");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(Label.label("_NsPrefDef"));
610,782
public List<ScoredItem<Term>> rescoreStatistics(List<Histogram<Term>> histograms, List<ScoredItem<Term>> initialScores) {<NEW_LINE>int termCount = histograms.get(0).size();<NEW_LINE>// TODO: use a priority queue<NEW_LINE>List<ScoredItem<Term>> scores = new ArrayList<>();<NEW_LINE>for (ScoredItem<Term> si : initialScores) {<NEW_LINE>Term term = si.item;<NEW_LINE>// position of first occurrence<NEW_LINE>double pfo = Math.log(DEFAULT_CUTOFF_POSITION / (si.item.firstOccurrenceIndex + 1));<NEW_LINE>double termLength = Math.<MASK><NEW_LINE>double tf = termCount - subSumCount(term, histograms, initialScores.subList(0, 100));<NEW_LINE>// add 1 for smoothing.<NEW_LINE>double termDocCount = term.order() == 1 ? (statistics.documentFrequencies.getCount(term.words[0])) + 1 : 1;<NEW_LINE>double idf = Math.log(statistics.documentCount / termDocCount);<NEW_LINE>ScoredItem<Term> scoredItem = new ScoredItem<>(term, (float) (tf * pfo * idf * termLength));<NEW_LINE>scores.add(scoredItem);<NEW_LINE>}<NEW_LINE>Collections.sort(scores);<NEW_LINE>return new ArrayList<>(scores.subList(0, scores.size()));<NEW_LINE>}
sqrt(term.order());
1,750,968
public static void planarToBuffered_U8(Planar<GrayU8> src, DataBufferInt buffer, WritableRaster dst) {<NEW_LINE>if (src.getNumBands() != dst.getNumBands())<NEW_LINE>throw new IllegalArgumentException("Unequal number of bands src = " + src.getNumBands() + " dst = " + dst.getNumBands());<NEW_LINE>final int[] dstData = buffer.getData();<NEW_LINE>final int numBands = dst.getNumBands();<NEW_LINE>final byte[] band1 = src.getBand(0).data;<NEW_LINE>final byte[] band2 = src.getBand(1).data;<NEW_LINE>final byte[] band3 = src.getBand(2).data;<NEW_LINE>if (numBands == 3) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + y * src.stride;<NEW_LINE>int indexDst = y * src.width;<NEW_LINE>for (int x = 0; x < src.width; x++, indexSrc++) {<NEW_LINE>int c1 = band1[indexSrc] & 0xFF;<NEW_LINE>int c2 = band2[indexSrc] & 0xFF;<NEW_LINE>int c3 = band3[indexSrc] & 0xFF;<NEW_LINE>dstData[indexDst++] = c1 << 16 | c2 << 8 | c3;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (numBands == 4) {<NEW_LINE>final byte[] band4 = src.getBand(3).data;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + y * src.stride;<NEW_LINE>int indexDst = y * src.width;<NEW_LINE>for (int x = 0; x < src.width; x++, indexSrc++) {<NEW_LINE>int c1 = band1[indexSrc] & 0xFF;<NEW_LINE>int c2 = band2[indexSrc] & 0xFF;<NEW_LINE>int <MASK><NEW_LINE>int c4 = band4[indexSrc] & 0xFF;<NEW_LINE>dstData[indexDst++] = c1 << 24 | c2 << 16 | c3 << 8 | c4;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Code more here");<NEW_LINE>}<NEW_LINE>}
c3 = band3[indexSrc] & 0xFF;
216,340
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>if ("GET".equals(request.getMethod())) {<NEW_LINE>// Process input<NEW_LINE>boolean compact = Boolean.valueOf<MASK><NEW_LINE>boolean yaml = true;<NEW_LINE>response.setContentType(MIME_TEXT_PLAIN);<NEW_LINE>String acceptHeader = "";<NEW_LINE>acceptHeader = request.getHeader(ACCEPT_HEADER);<NEW_LINE>if (acceptHeader != null && acceptHeader.equals(MIME_JSON)) {<NEW_LINE>response.setContentType(MIME_JSON);<NEW_LINE>yaml = false;<NEW_LINE>}<NEW_LINE>String formatParam = request.getParameter("format");<NEW_LINE>if (formatParam != null && formatParam.equals("json")) {<NEW_LINE>response.setContentType(MIME_JSON);<NEW_LINE>yaml = false;<NEW_LINE>}<NEW_LINE>boolean isSuccess = getOASProviderAggregator(false).getPublicDocumentation(request, compact, yaml, response);<NEW_LINE>if (!isSuccess) {<NEW_LINE>// OASProviderAggregator was deactivated, grab the new OASProviderAggregator (if available) and try again<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "Couldn't get public API documentation. Retry after resetting the aggregator.");<NEW_LINE>}<NEW_LINE>getOASProviderAggregator(true).getPublicDocumentation(request, compact, yaml, response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(request.getParameter(QUERY_COMPACT));
1,208,725
protected Sheet createSheet() {<NEW_LINE><MASK><NEW_LINE>Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);<NEW_LINE>if (sheetSet == null) {<NEW_LINE>sheetSet = Sheet.createPropertiesSet();<NEW_LINE>sheet.put(sheetSet);<NEW_LINE>}<NEW_LINE>if (filter != null && (filter.equals(FileTypesByExtension.RootFilter.TSK_DOCUMENT_FILTER) || filter.equals(FileTypesByExtension.RootFilter.TSK_EXECUTABLE_FILTER))) {<NEW_LINE>String extensions = "";<NEW_LINE>for (String ext : filter.getFilter()) {<NEW_LINE>extensions += "'" + ext + "', ";<NEW_LINE>}<NEW_LINE>extensions = extensions.substring(0, extensions.lastIndexOf(','));<NEW_LINE>sheetSet.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "FileTypesByExtNode.createSheet.fileExt.name"), NbBundle.getMessage(this.getClass(), "FileTypesByExtNode.createSheet.fileExt.displayName"), NbBundle.getMessage(this.getClass(), "FileTypesByExtNode.createSheet.fileExt.desc"), extensions));<NEW_LINE>} else {<NEW_LINE>sheetSet.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "FileTypesByExtNode.createSheet.name.name"), NbBundle.getMessage(this.getClass(), "FileTypesByExtNode.createSheet.name.displayName"), NbBundle.getMessage(this.getClass(), "FileTypesByExtNode.createSheet.name.desc"), getDisplayName()));<NEW_LINE>}<NEW_LINE>return sheet;<NEW_LINE>}
Sheet sheet = super.createSheet();
783,147
public boolean replaceHeader(Chain expected, Chain replacement) {<NEW_LINE>long suffixHead = chain + OffHeapChainStorageEngine.this.totalChainHeaderSize;<NEW_LINE>long prefixTail;<NEW_LINE>Iterator<Element> expectedIt = expected.iterator();<NEW_LINE>do {<NEW_LINE>if (!compare(expectedIt.next(), suffixHead)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>prefixTail = suffixHead;<NEW_LINE>suffixHead = storage.readLong(suffixHead + ELEMENT_HEADER_NEXT_OFFSET);<NEW_LINE>} while (expectedIt.<MASK><NEW_LINE>if (expectedIt.hasNext()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int hash = readKeyHash(chain);<NEW_LINE>Long newChainAddress = createAttachedChain(readKeyBuffer(chain), hash, replacement.iterator());<NEW_LINE>if (newChainAddress == null) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>try (AttachedInternalChain newChain = new AttachedInternalChain(newChainAddress)) {<NEW_LINE>newChain.chainModified = true;<NEW_LINE>// copy remaining elements from old chain (by reference)<NEW_LINE>if (suffixHead != chain) {<NEW_LINE>newChain.append(suffixHead, storage.readLong(chain + CHAIN_HEADER_TAIL_OFFSET));<NEW_LINE>}<NEW_LINE>if (owner.updateEncoding(hash, chain, newChainAddress, ~0)) {<NEW_LINE>storage.writeLong(prefixTail + ELEMENT_HEADER_NEXT_OFFSET, chain);<NEW_LINE>chainMoved(chain, newChainAddress);<NEW_LINE>free();<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>newChain.free();<NEW_LINE>throw new AssertionError("Encoding update failure - impossible!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
hasNext() && suffixHead != chain);
440,591
public ProcessStatus restResetSetting(final PwmRequest pwmRequest) throws IOException, PwmUnrecoverableException {<NEW_LINE>final ConfigManagerBean configManagerBean = getBean(pwmRequest);<NEW_LINE>final StoredConfigurationModifier modifier = StoredConfigurationModifier.<MASK><NEW_LINE>final UserIdentity loggedInUser = pwmRequest.getUserInfoIfLoggedIn();<NEW_LINE>final StoredConfigKey key = ConfigEditorServletUtils.readConfigKeyFromRequest(pwmRequest);<NEW_LINE>if (key.getRecordType() == StoredConfigKey.RecordType.LOCALE_BUNDLE) {<NEW_LINE>final PwmLocaleBundle pwmLocaleBundle = key.toLocaleBundle();<NEW_LINE>final String keyName = key.getProfileID();<NEW_LINE>final DomainID domainID = DomainStateReader.forRequest(pwmRequest).getDomainIDForLocaleBundle();<NEW_LINE>modifier.resetLocaleBundleMap(pwmLocaleBundle, keyName, domainID);<NEW_LINE>} else {<NEW_LINE>modifier.resetSetting(key, loggedInUser);<NEW_LINE>}<NEW_LINE>ConfigurationCleaner.postProcessStoredConfig(modifier);<NEW_LINE>configManagerBean.setStoredConfiguration(modifier.newStoredConfiguration());<NEW_LINE>pwmRequest.outputJsonResult(RestResultBean.forSuccessMessage(pwmRequest, Message.Success_Unknown));<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}
newModifier(configManagerBean.getStoredConfiguration());
189,765
private void commandWait(Shell shell, Command cmd) throws Exception {<NEW_LINE>while (!cmd.isFinished()) {<NEW_LINE>synchronized (cmd) {<NEW_LINE>try {<NEW_LINE>if (!cmd.isFinished()) {<NEW_LINE>cmd.wait(mTimeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!cmd.isExecuting() && !cmd.isFinished()) {<NEW_LINE>Exception e = new Exception();<NEW_LINE>if (!shell.isExecuting && !shell.isReading) {<NEW_LINE>log.warn(<MASK><NEW_LINE>e.setStackTrace(Thread.currentThread().getStackTrace());<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>} else if (shell.isExecuting && !shell.isReading) {<NEW_LINE>log.error("Waiting for a command to be executed in a shell that is executing but not reading! \n\n Command: {}", cmd.getCommand());<NEW_LINE>e.setStackTrace(Thread.currentThread().getStackTrace());<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>log.error("Waiting for a command to be executed in a shell that is not reading! \n\n Command: {}", cmd.getCommand());<NEW_LINE>e.setStackTrace(Thread.currentThread().getStackTrace());<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Waiting for a command to be executed in a shell that is not executing and not reading! \n\n Command: {}", cmd.getCommand());
464,435
protected void encodeData(FacesContext context, Chart chart) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>BubbleChartModel model = (BubbleChartModel) chart.getModel();<NEW_LINE>List<BubbleChartSeries> data = model.getData();<NEW_LINE>writer.write(",data:[[");<NEW_LINE>for (Iterator<BubbleChartSeries> it = data.iterator(); it.hasNext(); ) {<NEW_LINE>BubbleChartSeries s = it.next();<NEW_LINE>writer.write("[");<NEW_LINE>writer.write(escapeChartData(s.getX()));<NEW_LINE>writer.write(",");<NEW_LINE>writer.write(escapeChartData<MASK><NEW_LINE>writer.write(",");<NEW_LINE>writer.write(escapeChartData(s.getRadius()));<NEW_LINE>writer.write(",");<NEW_LINE>writer.write(escapeChartData(s.getLabel()));<NEW_LINE>writer.write("]");<NEW_LINE>if (it.hasNext()) {<NEW_LINE>writer.write(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.write("]]");<NEW_LINE>}
(s.getY()));
1,250,094
public PropertySource<?> locate(Environment environment) {<NEW_LINE>if (!(environment instanceof ConfigurableEnvironment)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ConfigurableEnvironment env = (ConfigurableEnvironment) environment;<NEW_LINE>String applicationName = this.properties.getName();<NEW_LINE>if (!StringUtils.hasText(applicationName)) {<NEW_LINE>applicationName = env.getProperty(SPRING_APP_NAME_PROP);<NEW_LINE>}<NEW_LINE>List<String> profiles = Arrays.asList(env.getActiveProfiles());<NEW_LINE>CompositePropertySource composite = new CompositePropertySource(PROPERTY_SOURCE_NAME);<NEW_LINE>// Last store has highest precedence<NEW_LINE>Collections.reverse(configStores);<NEW_LINE>Iterator<ConfigStore> configStoreIterator = configStores.iterator();<NEW_LINE>// Feature Management needs to be set in the last config store.<NEW_LINE>while (configStoreIterator.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (startup.get() || StateHolder.getLoadState(configStore.getEndpoint())) {<NEW_LINE>addPropertySource(composite, configStore, applicationName, profiles, storeContextsMap, !configStoreIterator.hasNext());<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Not loading configurations from {} as it failed on startup.", configStore.getEndpoint());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>startup.set(false);<NEW_LINE>return composite;<NEW_LINE>}
ConfigStore configStore = configStoreIterator.next();
1,624,391
private static Object parserValue(SqlNode oriValue, SqlSystemVar key, ServerConnection c) {<NEW_LINE>Object value = IGNORE_VALUE;<NEW_LINE>if (oriValue instanceof SqlCharStringLiteral) {<NEW_LINE>value = RelUtils.stringValue(oriValue);<NEW_LINE>} else if (oriValue instanceof SqlNumericLiteral) {<NEW_LINE>value = ((<MASK><NEW_LINE>} else if (oriValue instanceof SqlUserDefVar) {<NEW_LINE>value = c.getUserDefVariables().get(((SqlUserDefVar) oriValue).getName().toLowerCase());<NEW_LINE>if (!c.getUserDefVariables().containsKey(((SqlUserDefVar) oriValue).getName().toLowerCase())) {<NEW_LINE>c.writeErrMessage(ErrorCode.ER_WRONG_VALUE_FOR_VAR, "Variable " + key.getName() + " can't be set to the value of " + RelUtils.stringValue(oriValue));<NEW_LINE>return RETURN_VALUE;<NEW_LINE>}<NEW_LINE>} else if (oriValue instanceof SqlSystemVar) {<NEW_LINE>SqlSystemVar var = (SqlSystemVar) oriValue;<NEW_LINE>if (!ServerVariables.contains(var.getName()) && !ServerVariables.isExtra(var.getName())) {<NEW_LINE>c.writeErrMessage(ErrorCode.ER_UNKNOWN_SYSTEM_VARIABLE, "Unknown system variable '" + var.getName() + "'");<NEW_LINE>return RETURN_VALUE;<NEW_LINE>}<NEW_LINE>value = c.getSysVarValue(var);<NEW_LINE>} else if (oriValue instanceof SqlLiteral && ((SqlLiteral) oriValue).getTypeName() == SqlTypeName.NULL) {<NEW_LINE>value = null;<NEW_LINE>} else if (oriValue instanceof SqlLiteral && ((SqlLiteral) oriValue).getTypeName() == SqlTypeName.BOOLEAN) {<NEW_LINE>value = ((SqlLiteral) oriValue).booleanValue();<NEW_LINE>} else if (isDefault(oriValue)) {<NEW_LINE>value = "default";<NEW_LINE>} else if (oriValue instanceof SqlIdentifier) {<NEW_LINE>value = oriValue.toString();<NEW_LINE>// } else if (oriValue instanceof SqlBasicCall<NEW_LINE>// && oriValue.getKind() == SqlKind.MINUS) {<NEW_LINE>// value =<NEW_LINE>// ((SqlNode)oriValue).evaluation(Collections.emptyMap());<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
SqlNumericLiteral) oriValue).getValue();
82,737
final GetArtifactUrlResult executeGetArtifactUrl(GetArtifactUrlRequest getArtifactUrlRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getArtifactUrlRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetArtifactUrlRequest> request = null;<NEW_LINE>Response<GetArtifactUrlResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetArtifactUrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getArtifactUrlRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Amplify");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetArtifactUrl");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetArtifactUrlResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetArtifactUrlResultJsonUnmarshaller());<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>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,798,202
private Map<String, String> parseInfos(String content) throws Exception {<NEW_LINE>Map<String, String> infosMap = new HashMap<String, String>();<NEW_LINE>JsonObject project = new JsonObject(content).getJSONObject("project");<NEW_LINE>if (project == null) {<NEW_LINE>return infosMap;<NEW_LINE>}<NEW_LINE>Object owner = project.get("rd_duty");<NEW_LINE>Object email = project.get("project_email");<NEW_LINE>Object phone = project.get("rd_mobile");<NEW_LINE>Object level = project.get("project_level");<NEW_LINE>if (email != null) {<NEW_LINE>infosMap.put("owner", owner.toString());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (email != null) {<NEW_LINE>infosMap.put("email", email.toString());<NEW_LINE>} else {<NEW_LINE>infosMap.put("email", null);<NEW_LINE>}<NEW_LINE>if (phone != null) {<NEW_LINE>infosMap.put("phone", phone.toString());<NEW_LINE>} else {<NEW_LINE>infosMap.put("phone", null);<NEW_LINE>}<NEW_LINE>if (level != null) {<NEW_LINE>infosMap.put("level", level.toString());<NEW_LINE>} else {<NEW_LINE>infosMap.put("level", null);<NEW_LINE>}<NEW_LINE>return infosMap;<NEW_LINE>}
infosMap.put("owner", null);
190,012
static int queryChunkTermfreq(Set<String> keywords, String contentID) throws KeywordSearchModuleException, NoOpenCoreException {<NEW_LINE>SolrQuery q = new SolrQuery();<NEW_LINE>q.setShowDebugInfo(DEBUG);<NEW_LINE>final String filterQuery = Server.Schema.ID.toString() + ":" + KeywordSearchUtil.escapeLuceneQuery(contentID);<NEW_LINE>final String highlightQuery = keywords.stream().map(s -> LanguageSpecificContentQueryHelper.expandQueryString(KeywordSearchUtil.quoteQuery(KeywordSearchUtil.escapeLuceneQuery(s)))).collect(Collectors.joining(" "));<NEW_LINE>q.addFilterQuery(filterQuery);<NEW_LINE>q.setQuery(highlightQuery);<NEW_LINE>LanguageSpecificContentQueryHelper.configureTermfreqQuery(q, keywords.iterator().next());<NEW_LINE>QueryResponse response = KeywordSearch.getServer().query(q, SolrRequest.METHOD.POST);<NEW_LINE>SolrDocumentList results = response.getResults();<NEW_LINE>if (results.isEmpty()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>SolrDocument <MASK><NEW_LINE>return ((Float) document.getFieldValue(Server.Schema.TERMFREQ.toString())).intValue();<NEW_LINE>}
document = results.get(0);
1,410,213
private void chooseSnapshot() {<NEW_LINE>JFileChooser chooser = new JFileChooser();<NEW_LINE>// NOI18N<NEW_LINE>chooser.putClientProperty("JFileChooser.packageIsTraversable", "always");<NEW_LINE>chooser.setDialogTitle(// NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>JavaPlatformSelector.class, "CAP_Select_java_binary"));<NEW_LINE>chooser.setSelectedFile(new File(getJavaBinary()));<NEW_LINE>if (Platform.isWindows()) {<NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.setFileFilter(new FileFilter() {<NEW_LINE><NEW_LINE>// NOI18N<NEW_LINE>private String java = "java.exe";<NEW_LINE><NEW_LINE>public boolean accept(File f) {<NEW_LINE>return f.isDirectory() || (f.isFile() && java.equals(f.getName()));<NEW_LINE>}<NEW_LINE><NEW_LINE>public String getDescription() {<NEW_LINE>return // NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>JavaPlatformSelector.class, // NOI18N<NEW_LINE>"LBL_Java_file_filter", java);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.setFileFilter(new FileFilter() {<NEW_LINE><NEW_LINE>// NOI18N<NEW_LINE>private String java = "java";<NEW_LINE><NEW_LINE>public boolean accept(File f) {<NEW_LINE>// NOI18N<NEW_LINE>return f.isDirectory() || (f.isFile() && java.equals<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>public String getDescription() {<NEW_LINE>return // NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>JavaPlatformSelector.class, // NOI18N<NEW_LINE>"LBL_Java_file_filter", java);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (chooser.showOpenDialog(WindowManager.getDefault().getMainWindow()) == JFileChooser.APPROVE_OPTION)<NEW_LINE>javaPlatformFileField.setText(chooser.getSelectedFile().getAbsolutePath());<NEW_LINE>}
(f.getName()));
920,984
public void runVTTask(VtTask task) {<NEW_LINE>Program destinationProgram = getDestinationProgram();<NEW_LINE>SystemUtilities.assertTrue(destinationProgram != null, "How did we run a task with no destination program?");<NEW_LINE>// Not sure why this check is needed, but previously, it was in each of the VT tasks.<NEW_LINE>// I suspect it is a crude way to keep the user from starting another task while another is<NEW_LINE>// running.<NEW_LINE>if (hasTransactionsOpen(destinationProgram, task)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int matchSetTransactionID = session.startTransaction(task.getTaskTitle());<NEW_LINE>try {<NEW_LINE>new TaskLauncher(wrappedTask, getParentComponent());<NEW_LINE>} finally {<NEW_LINE>session.endTransaction(matchSetTransactionID, task.wasSuccessfull());<NEW_LINE>}<NEW_LINE>if (task.hasErrors()) {<NEW_LINE>task.showErrors();<NEW_LINE>}<NEW_LINE>}
WrapperTask wrappedTask = new WrapperTask(task);
447,192
private void configWithMetadata(ODocument metadata) {<NEW_LINE>if (metadata != null) {<NEW_LINE>if (metadata.containsField(CONFIG_IGNORE_CHARS)) {<NEW_LINE>ignoreChars = metadata.field(CONFIG_IGNORE_CHARS);<NEW_LINE>}<NEW_LINE>if (metadata.containsField(CONFIG_INDEX_RADIX)) {<NEW_LINE>indexRadix = metadata.field(CONFIG_INDEX_RADIX);<NEW_LINE>}<NEW_LINE>if (metadata.containsField(CONFIG_SEPARATOR_CHARS)) {<NEW_LINE>separatorChars = metadata.field(CONFIG_SEPARATOR_CHARS);<NEW_LINE>}<NEW_LINE>if (metadata.containsField(CONFIG_MIN_WORD_LEN)) {<NEW_LINE>minWordLength = metadata.field(CONFIG_MIN_WORD_LEN);<NEW_LINE>}<NEW_LINE>if (metadata.containsField(CONFIG_STOP_WORDS)) {<NEW_LINE>stopWords = new HashSet<><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(metadata.field(CONFIG_STOP_WORDS));
562,690
private void processRows(IncrementalIndex index, BitmapFactory bitmapFactory, List<IncrementalIndex.DimensionDesc> dimensions) {<NEW_LINE>int rowNum = 0;<NEW_LINE>for (IncrementalIndexRow row : index.getFacts().persistIterable()) {<NEW_LINE>final Object[] dims = row.getDims();<NEW_LINE>for (IncrementalIndex.DimensionDesc dimension : dimensions) {<NEW_LINE>final int dimIndex = dimension.getIndex();<NEW_LINE>DimensionAccessor accessor = accessors.get(dimension.getName());<NEW_LINE>// Add 'null' to the dimension's dictionary.<NEW_LINE>if (dimIndex >= dims.length || dims[dimIndex] == null) {<NEW_LINE>accessor.<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final ColumnCapabilities capabilities = dimension.getCapabilities();<NEW_LINE>if (capabilities.hasBitmapIndexes()) {<NEW_LINE>final MutableBitmap[] bitmapIndexes = accessor.invertedIndexes;<NEW_LINE>final DimensionIndexer indexer = accessor.indexer;<NEW_LINE>indexer.fillBitmapsFromUnsortedEncodedKeyComponent(dims[dimIndex], rowNum, bitmapIndexes, bitmapFactory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>++rowNum;<NEW_LINE>}<NEW_LINE>}
indexer.processRowValsToUnsortedEncodedKeyComponent(null, true);
549,484
public void handleRequest(Transaction transaction, Request<JsonObject> request) throws Exception {<NEW_LINE>Notification notif = null;<NEW_LINE>try {<NEW_LINE>switch(request.getMethod()) {<NEW_LINE>case ProtocolElements.ICECANDIDATE_METHOD:<NEW_LINE>notif = iceCandidate(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.MEDIAERROR_METHOD:<NEW_LINE>notif = mediaError(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.PARTICIPANTJOINED_METHOD:<NEW_LINE>notif = participantJoined(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.PARTICIPANTLEFT_METHOD:<NEW_LINE>notif = participantLeft(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.PARTICIPANTEVICTED_METHOD:<NEW_LINE>notif = participantEvicted(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.PARTICIPANTPUBLISHED_METHOD:<NEW_LINE>notif = participantPublished(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.PARTICIPANTUNPUBLISHED_METHOD:<NEW_LINE>notif = participantUnpublished(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.ROOMCLOSED_METHOD:<NEW_LINE>notif = roomClosed(transaction, request);<NEW_LINE>break;<NEW_LINE>case ProtocolElements.PARTICIPANTSENDMESSAGE_METHOD:<NEW_LINE>notif = participantSendMessage(transaction, request);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new Exception("Unrecognized request " + request.getMethod());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Exception processing request {}", request, e);<NEW_LINE>transaction.sendError(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (notif != null) {<NEW_LINE>try {<NEW_LINE>notifications.put(notif);<NEW_LINE><MASK><NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.warn("Interrupted when enqueuing notification {}", notif, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
log.debug("Enqueued notification {}", notif);
1,518,217
public void publish(final String topic) throws TubeClientException {<NEW_LINE>checkServiceStatus();<NEW_LINE>StringBuilder sBuilder = new StringBuilder(512);<NEW_LINE>try {<NEW_LINE>logger.info(sBuilder.append("[Publish begin 1] publish topic ").append(topic).append(", address = ").append(this.toString()).toString());<NEW_LINE>sBuilder.delete(<MASK><NEW_LINE>AtomicInteger curPubCnt = this.publishTopics.get(topic);<NEW_LINE>if (curPubCnt == null) {<NEW_LINE>AtomicInteger tmpPubCnt = new AtomicInteger(0);<NEW_LINE>curPubCnt = this.publishTopics.putIfAbsent(topic, tmpPubCnt);<NEW_LINE>if (curPubCnt == null) {<NEW_LINE>curPubCnt = tmpPubCnt;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (curPubCnt.incrementAndGet() == 1) {<NEW_LINE>long curTime = System.currentTimeMillis();<NEW_LINE>new ProducerHeartbeatTask().run();<NEW_LINE>logger.info(sBuilder.append("[Publish begin 1] already get meta info, topic: ").append(topic).append(", waste time ").append(System.currentTimeMillis() - curTime).append(" Ms").toString());<NEW_LINE>sBuilder.delete(0, sBuilder.length());<NEW_LINE>}<NEW_LINE>if (topicPartitionMap.get(topic) == null) {<NEW_LINE>throw new TubeClientException(sBuilder.append("Publish topic failure, make sure the topic ").append(topic).append(" exist or acceptPublish and try later!").toString());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (isStartHeart.compareAndSet(false, true)) {<NEW_LINE>heartbeatService.scheduleWithFixedDelay(new ProducerHeartbeatTask(), 5L, tubeClientConfig.getHeartbeatPeriodMs(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
0, sBuilder.length());
306,573
public Object list(HttpServletRequest request) throws Exception {<NEW_LINE>String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);<NEW_LINE>String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);<NEW_LINE>NamingUtils.checkServiceNameFormat(serviceName);<NEW_LINE>String <MASK><NEW_LINE>String clusters = WebUtils.optional(request, "clusters", StringUtils.EMPTY);<NEW_LINE>String clientIP = WebUtils.optional(request, "clientIP", StringUtils.EMPTY);<NEW_LINE>int udpPort = Integer.parseInt(WebUtils.optional(request, "udpPort", "0"));<NEW_LINE>boolean healthyOnly = Boolean.parseBoolean(WebUtils.optional(request, "healthyOnly", "false"));<NEW_LINE>String app = WebUtils.optional(request, "app", StringUtils.EMPTY);<NEW_LINE>Subscriber subscriber = new Subscriber(clientIP + ":" + udpPort, agent, app, clientIP, namespaceId, serviceName, udpPort, clusters);<NEW_LINE>return getInstanceOperator().listInstance(namespaceId, serviceName, subscriber, clusters, healthyOnly);<NEW_LINE>}
agent = WebUtils.getUserAgent(request);
1,225,618
public Sql[] generateSql(CreateDatabaseChangeLogTableStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {<NEW_LINE><MASK><NEW_LINE>database.setObjectQuotingStrategy(ObjectQuotingStrategy.LEGACY);<NEW_LINE>try {<NEW_LINE>return new Sql[] { new UnparsedSql("CREATE TABLE " + database.escapeTableName(database.getLiquibaseCatalogName(), database.getLiquibaseSchemaName(), database.getDatabaseChangeLogTableName()) + " (ID VARCHAR(150) NOT NULL, " + "AUTHOR VARCHAR(150) NOT NULL, " + "FILENAME VARCHAR(255) NOT NULL, " + "DATEEXECUTED " + DataTypeFactory.getInstance().fromDescription("datetime", database).toDatabaseDataType(database) + " NOT NULL, " + "ORDEREXECUTED INT NOT NULL, " + "EXECTYPE VARCHAR(10) NOT NULL, " + "MD5SUM VARCHAR(35) NULL, " + "DESCRIPTION VARCHAR(255) NULL, " + "COMMENTS VARCHAR(255) NULL, " + "TAG VARCHAR(255) NULL, " + "LIQUIBASE VARCHAR(20) NULL, " + "CONTEXTS VARCHAR(255) NULL, " + "LABELS VARCHAR(255) NULL, " + "DEPLOYMENT_ID VARCHAR(10) NULL, " + "PRIMARY KEY(ID, AUTHOR, FILENAME))", getAffectedTable(database)) };<NEW_LINE>} finally {<NEW_LINE>database.setObjectQuotingStrategy(currentStrategy);<NEW_LINE>}<NEW_LINE>}
ObjectQuotingStrategy currentStrategy = database.getObjectQuotingStrategy();
66,295
public Request<DeleteLogGroupRequest> marshall(DeleteLogGroupRequest deleteLogGroupRequest) {<NEW_LINE>if (deleteLogGroupRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DeleteLogGroupRequest)");<NEW_LINE>}<NEW_LINE>Request<DeleteLogGroupRequest> request = new DefaultRequest<DeleteLogGroupRequest>(deleteLogGroupRequest, "AmazonCloudWatchLogs");<NEW_LINE>String target = "Logs_20140328.DeleteLogGroup";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (deleteLogGroupRequest.getLogGroupName() != null) {<NEW_LINE>String logGroupName = deleteLogGroupRequest.getLogGroupName();<NEW_LINE>jsonWriter.name("logGroupName");<NEW_LINE>jsonWriter.value(logGroupName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
.toString(content.length));
1,069,223
public static void viewHelpAndSupportInNewStack(@NonNull Context context, @NonNull Origin origin, @Nullable SiteModel selectedSite, @Nullable List<String> extraSupportTags) {<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>properties.put("origin", origin.name());<NEW_LINE>AnalyticsTracker.track(Stat.SUPPORT_OPENED, properties);<NEW_LINE>TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(context);<NEW_LINE>Intent mainActivityIntent = getMainActivityInNewStack(context);<NEW_LINE><MASK><NEW_LINE>Intent meIntent = new Intent(context, MeActivity.class);<NEW_LINE>meIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);<NEW_LINE>Intent helpIntent = HelpActivity.createIntent(context, origin, selectedSite, extraSupportTags);<NEW_LINE>taskStackBuilder.addNextIntent(mainActivityIntent);<NEW_LINE>taskStackBuilder.addNextIntent(meIntent);<NEW_LINE>taskStackBuilder.addNextIntent(helpIntent);<NEW_LINE>taskStackBuilder.startActivities();<NEW_LINE>}
mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
1,760,426
public static void main(String[] args) {<NEW_LINE>String a = "923456789";<NEW_LINE>String b = "12345";<NEW_LINE>EditDistance solver = new EditDistance(a, b, 100, 4, 2);<NEW_LINE>System.out.println(solver.editDistance());<NEW_LINE>System.out.println(micahEditDistance(a, b, 100, 4, 2));<NEW_LINE>a = "12345";<NEW_LINE>b = "923456789";<NEW_LINE>solver = new EditDistance(a, b, 100, 4, 2);<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println(micahEditDistance(a, b, 100, 4, 2));<NEW_LINE>a = "aaa";<NEW_LINE>b = "aaabbb";<NEW_LINE>solver = new EditDistance(a, b, 10, 2, 3);<NEW_LINE>System.out.println(solver.editDistance());<NEW_LINE>System.out.println(micahEditDistance(a, b, 10, 2, 3));<NEW_LINE>a = "1023";<NEW_LINE>b = "10101010";<NEW_LINE>solver = new EditDistance(a, b, 5, 7, 2);<NEW_LINE>System.out.println(solver.editDistance());<NEW_LINE>System.out.println(micahEditDistance(a, b, 5, 7, 2));<NEW_LINE>a = "923456789";<NEW_LINE>b = "12345";<NEW_LINE>EditDistance solver2 = new EditDistance(a, b, 100, 4, 2);<NEW_LINE>System.out.println(solver2.editDistance());<NEW_LINE>System.out.println(micahEditDistance(a, b, 100, 4, 2));<NEW_LINE>a = "aaaaa";<NEW_LINE>b = "aabaa";<NEW_LINE>solver = new EditDistance(a, b, 2, 3, 10);<NEW_LINE>System.out.println(solver.editDistance());<NEW_LINE>System.out.println(micahEditDistance(a, b, 2, 3, 10));<NEW_LINE>}
println(solver.editDistance());
1,086,815
final ListPageReceiptsResult executeListPageReceipts(ListPageReceiptsRequest listPageReceiptsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPageReceiptsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPageReceiptsRequest> request = null;<NEW_LINE>Response<ListPageReceiptsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPageReceiptsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPageReceiptsRequest));<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, "SSM Contacts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPageReceipts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPageReceiptsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new ListPageReceiptsResultJsonUnmarshaller());
1,242,408
public static void addToString(SourceBuilder code, Datatype datatype, Map<Property, PropertyCodeGenerator> generatorsByProperty, boolean forPartial) {<NEW_LINE>// This code is to ensure entry order is preserved.<NEW_LINE>// Specifically this code is boiler plate from Collectors.toMap.<NEW_LINE>// Except with a LinkedHashMap supplier.<NEW_LINE>generatorsByProperty = generatorsByProperty.entrySet().stream().filter(e -> e.getKey().isInToString()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (u, v) -> {<NEW_LINE>throw new IllegalStateException(String.format("Duplicate key %s", u));<NEW_LINE>}, LinkedHashMap::new));<NEW_LINE>String typename = (forPartial ? "partial " : "") + datatype.getType().getSimpleName();<NEW_LINE>Predicate<PropertyCodeGenerator> isOptional = generator -> {<NEW_LINE>Initially initially = generator.initialState();<NEW_LINE>return (initially == Initially.OPTIONAL || (initially == Initially.REQUIRED && forPartial));<NEW_LINE>};<NEW_LINE>boolean anyOptional = generatorsByProperty.values().stream().anyMatch(isOptional);<NEW_LINE>boolean allOptional = generatorsByProperty.values().stream().allMatch(isOptional) && !generatorsByProperty.isEmpty();<NEW_LINE>code.addLine("").addLine("@%s", Override.class).addLine("public %s toString() {", String.class);<NEW_LINE>if (allOptional) {<NEW_LINE>bodyWithBuilderAndSeparator(<MASK><NEW_LINE>} else if (anyOptional) {<NEW_LINE>bodyWithBuilder(code, datatype, generatorsByProperty, typename, isOptional);<NEW_LINE>} else {<NEW_LINE>bodyWithConcatenation(code, generatorsByProperty, typename);<NEW_LINE>}<NEW_LINE>code.addLine("}");<NEW_LINE>}
code, datatype, generatorsByProperty, typename);
824,227
static InvocationFrames computeChildTheadInvocation(InvocationFrames parent) {<NEW_LINE>InvocationFrames childFrames = new InvocationFrames();<NEW_LINE>InvocationFrames parentFrames = parent;<NEW_LINE>if (parentFrames != null && !parentFrames.isEmpty() && !parentFrames.isStartup()) {<NEW_LINE>// Get current invocation<NEW_LINE>ComponentInvocation parentFrame = parentFrames.getLast();<NEW_LINE>// TODO: The following is ugly. The logic of what needs to be in the<NEW_LINE>// new ComponentInvocation should be with the respective container<NEW_LINE>ComponentInvocationType parentType = parentFrame.getInvocationType();<NEW_LINE>if (parentType == SERVLET_INVOCATION) {<NEW_LINE>// If this is a thread created by user in servlet's service method<NEW_LINE>// create a new ComponentInvocation with transaction<NEW_LINE>// left to null and instance left to null<NEW_LINE>// so that the resource won't be enlisted or registered<NEW_LINE>ComponentInvocation invocation = new ComponentInvocation();<NEW_LINE>invocation.setComponentInvocationType(parentType);<NEW_LINE>invocation.setComponentId(parentFrame.getComponentId());<NEW_LINE>invocation.setAppName(parentFrame.getAppName());<NEW_LINE>invocation.setModuleName(parentFrame.getModuleName());<NEW_LINE>invocation.<MASK><NEW_LINE>invocation.setJndiEnvironment(parentFrame.getJndiEnvironment());<NEW_LINE>childFrames.add(invocation);<NEW_LINE>} else if (parentType != EJB_INVOCATION) {<NEW_LINE>// Push a copy of invocation onto the new result<NEW_LINE>childFrames.add(new ComponentInvocation(parentFrame.getComponentId(), parentType, parentFrame.getInstance(), parentFrame.getContainerContext(), parentFrame.getTransaction()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.finest(() -> "Computed new invocation stack for child thread: " + childFrames);<NEW_LINE>return childFrames;<NEW_LINE>}
setContainer(parentFrame.getContainer());
1,594,147
void updateTopologyHandler(String topologyName, Config updateConfig) throws TopologyRuntimeManagementException, PackingException, UpdateDryRunResponse {<NEW_LINE>assert !potentialStaleExecutionData;<NEW_LINE>String <MASK><NEW_LINE>String newContainerNumber = updateConfig.getStringValue(RUNTIME_MANAGER_CONTAINER_NUMBER_KEY);<NEW_LINE>String userRuntimeConfig = updateConfig.getStringValue(RUNTIME_MANAGER_RUNTIME_CONFIG_KEY);<NEW_LINE>LOG.info("userRuntimeConfig " + userRuntimeConfig + "; newParallelism " + newParallelism + "; newContainerNumber " + newContainerNumber);<NEW_LINE>// parallelism and runtime config can not be updated at the same time.<NEW_LINE>if (((newParallelism != null && !newParallelism.isEmpty()) || (newContainerNumber != null && !newContainerNumber.isEmpty())) && userRuntimeConfig != null && !userRuntimeConfig.isEmpty()) {<NEW_LINE>throw new TopologyRuntimeManagementException("parallelism or container number " + "and runtime config can not be updated at the same time.");<NEW_LINE>}<NEW_LINE>if (userRuntimeConfig != null && !userRuntimeConfig.isEmpty()) {<NEW_LINE>// Update user runtime config if userRuntimeConfig parameter is available<NEW_LINE>updateTopologyUserRuntimeConfig(topologyName, userRuntimeConfig);<NEW_LINE>} else if (newContainerNumber != null && !newContainerNumber.isEmpty()) {<NEW_LINE>// Update container count if newContainerNumber parameter is available<NEW_LINE>updateTopologyContainerCount(topologyName, newContainerNumber, newParallelism);<NEW_LINE>} else if (newParallelism != null && !newParallelism.isEmpty()) {<NEW_LINE>// Update parallelism if newParallelism parameter is available<NEW_LINE>updateTopologyComponentParallelism(topologyName, newParallelism);<NEW_LINE>} else {<NEW_LINE>throw new TopologyRuntimeManagementException("Missing arguments. Not taking action.");<NEW_LINE>}<NEW_LINE>// Clean the connection when we are done.<NEW_LINE>LOG.fine("Scheduler updated topology successfully.");<NEW_LINE>}
newParallelism = updateConfig.getStringValue(RUNTIME_MANAGER_COMPONENT_PARALLELISM_KEY);
889,951
private void init() {<NEW_LINE>setLayout(new MigLayout("insets 0 0 0 0", "[grow,fill]", "[grow,fill]"));<NEW_LINE>mMapViewer.setOverlayPainter(mMapPainter);<NEW_LINE>mMapService.addListener(this);<NEW_LINE>TileFactoryInfo info = new OSMTileFactoryInfo();<NEW_LINE>DefaultTileFactory tileFactory = new DefaultTileFactory(info);<NEW_LINE>mMapViewer.setTileFactory(tileFactory);<NEW_LINE>tileFactory.setThreadPoolSize(8);<NEW_LINE>GeoPosition syracuse = new GeoPosition(43.048, -76.147);<NEW_LINE>int zoom = 7;<NEW_LINE>MapViewSetting view = mSettingsManager.getMapViewSetting("Default", syracuse, zoom);<NEW_LINE>mMapViewer.setAddressLocation(view.getGeoPosition());<NEW_LINE>mMapViewer.<MASK><NEW_LINE>MapMouseListener listener = new MapMouseListener(mMapViewer, mSettingsManager);<NEW_LINE>mMapViewer.addMouseListener(listener);<NEW_LINE>mMapViewer.addMouseMotionListener(listener);<NEW_LINE>mMapViewer.addKeyListener(new PanKeyListener(mMapViewer));<NEW_LINE>SelectionAdapter sa = new SelectionAdapter(mMapViewer);<NEW_LINE>mMapViewer.addMouseListener(sa);<NEW_LINE>mMapViewer.addMouseMotionListener(sa);<NEW_LINE>add(mMapViewer, "span");<NEW_LINE>}
setZoom(view.getZoom());
1,806,018
private void pin(Watch watch, EditorUI eui, Line line) throws IndexOutOfBoundsException {<NEW_LINE>// just to be sure<NEW_LINE>Annotation ann = watchToAnnotation.remove(watch);<NEW_LINE>if (ann != null)<NEW_LINE>ann.detach();<NEW_LINE>JComponent frame = watchToWindow.remove(watch);<NEW_LINE>StickyWindowSupport stickyWindowSupport = eui.getStickyWindowSupport();<NEW_LINE>if (frame != null) {<NEW_LINE>frame.setVisible(false);<NEW_LINE>stickyWindowSupport.removeWindow(frame);<NEW_LINE>}<NEW_LINE>final EditorPin pin = (EditorPin) watch.getPin();<NEW_LINE>if (pin == null)<NEW_LINE>return;<NEW_LINE>if (line == null) {<NEW_LINE>line = getLine(pin.getFile(), pin.getLine());<NEW_LINE>}<NEW_LINE>final DebuggerAnnotation annotation = new DebuggerAnnotation(DebuggerAnnotation.WATCH_ANNOTATION_TYPE, line);<NEW_LINE>annotation.setWatch(watch);<NEW_LINE>watchToAnnotation.put(watch, annotation);<NEW_LINE>annotation.attach(line);<NEW_LINE>pin.addPropertyChangeListener(new PropertyChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>if (EditorPin.PROP_LINE.equals(evt.getPropertyName())) {<NEW_LINE>annotation.detach();<NEW_LINE>Line line = getLine(pin.getFile(), pin.getLine());<NEW_LINE>annotation.attach(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JComponent window <MASK><NEW_LINE>stickyWindowSupport.addWindow(window);<NEW_LINE>window.setLocation(pin.getLocation());<NEW_LINE>watchToWindow.put(watch, window);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Dimension size = window.getPreferredSize();<NEW_LINE>Point loc = window.getLocation();<NEW_LINE>window.setBounds(loc.x, loc.y, size.width, size.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
= new StickyPanel(watch, eui);
764,895
public void deserialize(ByteBuffer buffer) throws IllegalPathException {<NEW_LINE>// adapt to old version based on version mark<NEW_LINE>int length = buffer.getInt();<NEW_LINE>boolean isOldVersion = true;<NEW_LINE>if (length == PLAN_SINCE_0_14) {<NEW_LINE>length = buffer.getInt();<NEW_LINE>isOldVersion = false;<NEW_LINE>}<NEW_LINE>byte[] bytes = new byte[length];<NEW_LINE>buffer.get(bytes);<NEW_LINE>prefixPath = new PartialPath(new String(bytes));<NEW_LINE>int size = ReadWriteIOUtils.readInt(buffer);<NEW_LINE>measurements = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>measurements.add(ReadWriteIOUtils.readString(buffer));<NEW_LINE>}<NEW_LINE>dataTypes = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>dataTypes.add(TSDataType.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>encodings = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>encodings.add(TSEncoding.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>compressors = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>compressors.add(CompressionType.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>if (!isOldVersion) {<NEW_LINE>tagOffsets = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>tagOffsets.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// alias<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>aliasList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>aliasList.add(ReadWriteIOUtils.readString(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isOldVersion) {<NEW_LINE>// tags<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>tagsList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>tagsList.add(ReadWriteIOUtils.readMap(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// attributes<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>attributesList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>attributesList.add(ReadWriteIOUtils.readMap(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.index = buffer.getLong();<NEW_LINE>}
add(buffer.getLong());
370,357
// This was extracted the method above, because otherwise it is difficult to test what terms are included in<NEW_LINE>// the query in case a CoveringQuery is used (it does not have a getter to retrieve the clauses)<NEW_LINE>Tuple<List<BytesRef>, Map<String, List<byte[]>>> extractTermsAndRanges(IndexReader indexReader) throws IOException {<NEW_LINE>List<BytesRef> extractedTerms = new ArrayList<>();<NEW_LINE>Map<String, List<byte[]>> encodedPointValuesByField = new HashMap<>();<NEW_LINE>LeafReader reader = indexReader.leaves().get(0).reader();<NEW_LINE>for (FieldInfo info : reader.getFieldInfos()) {<NEW_LINE>Terms terms = <MASK><NEW_LINE>if (terms != null) {<NEW_LINE>BytesRef fieldBr = new BytesRef(info.name);<NEW_LINE>TermsEnum tenum = terms.iterator();<NEW_LINE>for (BytesRef term = tenum.next(); term != null; term = tenum.next()) {<NEW_LINE>BytesRefBuilder builder = new BytesRefBuilder();<NEW_LINE>builder.append(fieldBr);<NEW_LINE>builder.append(FIELD_VALUE_SEPARATOR);<NEW_LINE>builder.append(term);<NEW_LINE>extractedTerms.add(builder.toBytesRef());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (info.getPointIndexDimensionCount() == 1) {<NEW_LINE>// not != 0 because range fields are not supported<NEW_LINE>PointValues values = reader.getPointValues(info.name);<NEW_LINE>List<byte[]> encodedPointValues = new ArrayList<>();<NEW_LINE>encodedPointValues.add(values.getMinPackedValue().clone());<NEW_LINE>encodedPointValues.add(values.getMaxPackedValue().clone());<NEW_LINE>encodedPointValuesByField.put(info.name, encodedPointValues);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Tuple<>(extractedTerms, encodedPointValuesByField);<NEW_LINE>}
reader.terms(info.name);
1,101,175
public RegisteredClient build() {<NEW_LINE>Assert.hasText(this.clientId, "clientId cannot be empty");<NEW_LINE>Assert.notEmpty(this.authorizationGrantTypes, "authorizationGrantTypes cannot be empty");<NEW_LINE>if (this.authorizationGrantTypes.contains(AuthorizationGrantType.AUTHORIZATION_CODE)) {<NEW_LINE>Assert.<MASK><NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(this.clientName)) {<NEW_LINE>this.clientName = this.id;<NEW_LINE>}<NEW_LINE>if (CollectionUtils.isEmpty(this.clientAuthenticationMethods)) {<NEW_LINE>this.clientAuthenticationMethods.add(ClientAuthenticationMethod.CLIENT_SECRET_BASIC);<NEW_LINE>}<NEW_LINE>if (this.clientSettings == null) {<NEW_LINE>ClientSettings.Builder builder = ClientSettings.builder();<NEW_LINE>if (isPublicClientType()) {<NEW_LINE>// @formatter:off<NEW_LINE>builder.requireProofKey(true).requireAuthorizationConsent(true);<NEW_LINE>// @formatter:on<NEW_LINE>}<NEW_LINE>this.clientSettings = builder.build();<NEW_LINE>}<NEW_LINE>if (this.tokenSettings == null) {<NEW_LINE>this.tokenSettings = TokenSettings.builder().build();<NEW_LINE>}<NEW_LINE>validateScopes();<NEW_LINE>validateRedirectUris();<NEW_LINE>return create();<NEW_LINE>}
notEmpty(this.redirectUris, "redirectUris cannot be empty");