idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
935,148 | public StartSessionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartSessionResult startSessionResult = new StartSessionResult();<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 startSessionResult;<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("SessionId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSessionResult.setSessionId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TokenValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSessionResult.setTokenValue(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("StreamUrl", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSessionResult.setStreamUrl(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 startSessionResult;<NEW_LINE>} | class).unmarshall(context)); |
1,109,464 | public void write(FloatBuffer value, String name, FloatBuffer defVal) throws IOException {<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Element el = appendElement(name);<NEW_LINE>el.setAttribute("size", String.valueOf<MASK><NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>int pos = value.position();<NEW_LINE>value.rewind();<NEW_LINE>int ctr = 0;<NEW_LINE>while (value.hasRemaining()) {<NEW_LINE>ctr++;<NEW_LINE>buf.append(value.get());<NEW_LINE>buf.append(" ");<NEW_LINE>}<NEW_LINE>if (ctr != value.limit()) {<NEW_LINE>throw new IOException("'" + name + "' buffer contention resulted in write data consistency. " + ctr + " values written when should have written " + value.limit());<NEW_LINE>}<NEW_LINE>if (buf.length() > 0) {<NEW_LINE>// remove last space<NEW_LINE>buf.setLength(buf.length() - 1);<NEW_LINE>}<NEW_LINE>value.position(pos);<NEW_LINE>el.setAttribute(dataAttributeName, buf.toString());<NEW_LINE>currentElement = (Element) el.getParentNode();<NEW_LINE>} | (value.limit())); |
20,504 | void copy(ConstraintWidgetContainer src, ConstraintWidgetContainer dest) {<NEW_LINE>ArrayList<ConstraintWidget> children = src.getChildren();<NEW_LINE>HashMap<ConstraintWidget, ConstraintWidget> map = new HashMap<>();<NEW_LINE>map.put(src, dest);<NEW_LINE>dest.getChildren().clear();<NEW_LINE><MASK><NEW_LINE>for (ConstraintWidget child_s : children) {<NEW_LINE>ConstraintWidget child_d;<NEW_LINE>if (child_s instanceof androidx.constraintlayout.core.widgets.Barrier) {<NEW_LINE>child_d = new androidx.constraintlayout.core.widgets.Barrier();<NEW_LINE>} else if (child_s instanceof androidx.constraintlayout.core.widgets.Guideline) {<NEW_LINE>child_d = new androidx.constraintlayout.core.widgets.Guideline();<NEW_LINE>} else if (child_s instanceof Flow) {<NEW_LINE>child_d = new Flow();<NEW_LINE>} else if (child_s instanceof Placeholder) {<NEW_LINE>child_d = new Placeholder();<NEW_LINE>} else if (child_s instanceof androidx.constraintlayout.core.widgets.Helper) {<NEW_LINE>child_d = new androidx.constraintlayout.core.widgets.HelperWidget();<NEW_LINE>} else {<NEW_LINE>child_d = new ConstraintWidget();<NEW_LINE>}<NEW_LINE>dest.add(child_d);<NEW_LINE>map.put(child_s, child_d);<NEW_LINE>}<NEW_LINE>for (ConstraintWidget child_s : children) {<NEW_LINE>map.get(child_s).copy(child_s, map);<NEW_LINE>}<NEW_LINE>} | dest.copy(src, map); |
740,555 | final DefineExpressionResult executeDefineExpression(DefineExpressionRequest defineExpressionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(defineExpressionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DefineExpressionRequest> request = null;<NEW_LINE>Response<DefineExpressionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DefineExpressionRequestMarshaller().marshall(super.beforeMarshalling(defineExpressionRequest));<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, "DefineExpression");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DefineExpressionResult> responseHandler = new StaxResponseHandler<DefineExpressionResult>(new DefineExpressionResultStaxUnmarshaller());<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, "CloudSearch"); |
1,810,499 | public CompletableFuture<V> put(K key, V value) {<NEW_LINE>MapUpdate<K, V> update = updates.get(key);<NEW_LINE>if (update != null && update.type() != Type.REMOVE_IF_VERSION_MATCH) {<NEW_LINE>updates.put(key, MapUpdate.<K, V>builder().withType(update.type()).withKey(key).withValue(value).withVersion(update.version()).build());<NEW_LINE>}<NEW_LINE>return read(key).thenApply(versioned -> {<NEW_LINE>if (versioned == null) {<NEW_LINE>updates.put(key, MapUpdate.<K, V>builder().withType(Type.PUT_IF_ABSENT).withKey(key).withValue(value).build());<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>updates.put(key, MapUpdate.<K, V>builder().withType(Type.PUT_IF_VERSION_MATCH).withKey(key).withValue(value).withVersion(versioned.version<MASK><NEW_LINE>return versioned.value();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ()).build()); |
1,648,636 | protected Map<String, Object> convertMap(Map<String, Object> obj, long features, Set<String> ignoreProperty) {<NEW_LINE>if (ignoreProperty.isEmpty()) {<NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>boolean cover = ToString.Feature.hasFeature(features, coverIgnoreProperty);<NEW_LINE>boolean isNullPropertyToEmpty = ToString.Feature.hasFeature(features, nullPropertyToEmpty);<NEW_LINE>boolean isDisableNestProperty = ToString.Feature.hasFeature(features, disableNestProperty);<NEW_LINE>Map<String, Object> newMap = new HashMap<>(obj);<NEW_LINE>Set<String> ignore = new HashSet<>(ignoreProperty.size());<NEW_LINE>ignore.addAll(defaultIgnoreProperties);<NEW_LINE>for (Map.Entry<String, Object> entry : newMap.entrySet()) {<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (value == null) {<NEW_LINE>if (isNullPropertyToEmpty) {<NEW_LINE>entry.setValue("");<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Class<?> type = value.getClass();<NEW_LINE>if (simpleTypePredicate.test(type)) {<NEW_LINE>value = simpleConvertBuilder.apply(type).apply(value, null);<NEW_LINE>if (ignoreProperty.contains(entry.getKey())) {<NEW_LINE>if (cover) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ignore.add(entry.getKey());<NEW_LINE>}<NEW_LINE>entry.setValue(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isDisableNestProperty) {<NEW_LINE>ignore.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ignore.forEach(newMap::remove);<NEW_LINE>return newMap;<NEW_LINE>} | value = coverStringConvert.apply(value); |
1,114,875 | final GetEntityResult executeGetEntity(GetEntityRequest getEntityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEntityRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEntityRequest> request = null;<NEW_LINE>Response<GetEntityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEntityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEntityRequest));<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, "IoTTwinMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEntity");<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 = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEntityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEntityResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,752,888 | public IRubyObject nsWait(ThreadContext context, IRubyObject[] args) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>if (args.length > 1) {<NEW_LINE>throw runtime.newArgumentError(args.length, 1);<NEW_LINE>}<NEW_LINE>Double timeout = null;<NEW_LINE>if (args.length > 0 && !args[0].isNil()) {<NEW_LINE>timeout = args[0]<MASK><NEW_LINE>if (timeout < 0) {<NEW_LINE>throw runtime.newArgumentError("time interval must be positive");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Thread.interrupted()) {<NEW_LINE>throw runtime.newConcurrencyError("thread interrupted");<NEW_LINE>}<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>success = context.getThread().wait_timeout(this, timeout);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>throw runtime.newConcurrencyError(ie.getLocalizedMessage());<NEW_LINE>} finally {<NEW_LINE>// An interrupt or timeout may have caused us to miss<NEW_LINE>// a notify that we consumed, so do another notify in<NEW_LINE>// case someone else is available to pick it up.<NEW_LINE>if (!success) {<NEW_LINE>this.notify();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | .convertToFloat().getDoubleValue(); |
1,058,064 | private boolean addJVMProxyOptions(EditableProperties prop, String proxyHost, String proxyPort) {<NEW_LINE>String jvmOptions = prop.getProperty(AppClientProjectProperties.RUN_JVM_ARGS);<NEW_LINE>boolean modif = false;<NEW_LINE>// NOI18N<NEW_LINE>String localHosts = "localhost";<NEW_LINE>try {<NEW_LINE>localHosts = InetAddress.getLocalHost().getCanonicalHostName();<NEW_LINE>} catch (UnknownHostException ex) {<NEW_LINE>}<NEW_LINE>if (!"localhost".equals(localHosts)) {<NEW_LINE>// NOI18N<NEW_LINE>localHosts = '\"' + localHosts + "|localhost\"";<NEW_LINE>}<NEW_LINE>if (jvmOptions == null || jvmOptions.length() == 0) {<NEW_LINE>jvmOptions = PROXY_HOST_OPTION + '=' + proxyHost + ' ' + PROXY_PORT_OPTION + '=' + proxyPort + ' ' + NON_PROXY_HOSTS_OPTION + '=' + localHosts;<NEW_LINE>modif = true;<NEW_LINE>} else {<NEW_LINE>if (jvmOptions.indexOf(PROXY_HOST_OPTION) < 0) {<NEW_LINE>jvmOptions <MASK><NEW_LINE>modif = true;<NEW_LINE>}<NEW_LINE>if (jvmOptions.indexOf(PROXY_PORT_OPTION) < 0) {<NEW_LINE>jvmOptions += ' ' + PROXY_PORT_OPTION + '=' + proxyPort;<NEW_LINE>modif = true;<NEW_LINE>}<NEW_LINE>if (jvmOptions.indexOf(NON_PROXY_HOSTS_OPTION) < 0) {<NEW_LINE>jvmOptions += ' ' + NON_PROXY_HOSTS_OPTION + '=' + localHosts;<NEW_LINE>modif = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modif) {<NEW_LINE>prop.setProperty(AppClientProjectProperties.RUN_JVM_ARGS, jvmOptions);<NEW_LINE>}<NEW_LINE>return modif;<NEW_LINE>} | += ' ' + PROXY_HOST_OPTION + '=' + proxyHost; |
1,037,213 | public void load() {<NEW_LINE>try {<NEW_LINE>FileExportSettings settings = FileExportSettings.load();<NEW_LINE>if (settings != null) {<NEW_LINE>Path path = settings.getFilesRootDirectory();<NEW_LINE>if (path != null) {<NEW_LINE>tbRootDirectory.setText(path.toString());<NEW_LINE>}<NEW_LINE>path = settings.getReportsRootDirectory();<NEW_LINE>if (path != null) {<NEW_LINE>tbReportDirectory.setText(path.toString());<NEW_LINE>}<NEW_LINE>TreeMap<String, FileExportRuleSet> treeMap = settings.getRuleSets();<NEW_LINE>if (treeMap != null && !treeMap.isEmpty()) {<NEW_LINE>exportRuleSet = treeMap.firstEntry().getValue();<NEW_LINE>}<NEW_LINE>boolean answer = settings.getFileExportEnabledState();<NEW_LINE>setEnabledState(answer);<NEW_LINE>cbEnableFileExport.setSelected(answer);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} catch (FileExportSettings.PersistenceException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, <MASK><NEW_LINE>}<NEW_LINE>setEnabledState(false);<NEW_LINE>cbEnableFileExport.setSelected(false);<NEW_LINE>} | "Unable to load rule settings: {0}", ex.getMessage()); |
1,020,847 | final CreateEndpointAccessResult executeCreateEndpointAccess(CreateEndpointAccessRequest createEndpointAccessRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEndpointAccessRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEndpointAccessRequest> request = null;<NEW_LINE>Response<CreateEndpointAccessResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEndpointAccessRequestMarshaller().marshall(super.beforeMarshalling(createEndpointAccessRequest));<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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEndpointAccess");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateEndpointAccessResult> responseHandler = new StaxResponseHandler<CreateEndpointAccessResult>(new CreateEndpointAccessResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,791,600 | private Registries insertAllChecked(List<NamedToken> tokens, Registries registries) {<NEW_LINE>MutableObjectIntMap<String> uniquePublicNames = new ObjectIntHashMap<>();<NEW_LINE>MutableObjectIntMap<String> uniqueInternalNames = new ObjectIntHashMap<>();<NEW_LINE>MutableIntSet uniqueIds = new IntHashSet();<NEW_LINE>for (NamedToken token : tokens) {<NEW_LINE>if (token.isInternal()) {<NEW_LINE>checkNameUniqueness(uniqueInternalNames, token, registries);<NEW_LINE>checkNameUniqueness(registries.internalNameToId, token, registries);<NEW_LINE>uniqueInternalNames.put(token.name(), token.id());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>checkNameUniqueness(registries.publicNameToId, token, registries);<NEW_LINE>uniquePublicNames.put(token.name(), token.id());<NEW_LINE>}<NEW_LINE>if (!uniqueIds.add(token.id()) || registries.idToToken.containsKey(token.id())) {<NEW_LINE>NamedToken existingToken = registries.idToToken.get(token.id());<NEW_LINE>throw new NonUniqueTokenException(tokenType, token, existingToken);<NEW_LINE>}<NEW_LINE>insertUnchecked(token, registries);<NEW_LINE>}<NEW_LINE>return registries;<NEW_LINE>} | checkNameUniqueness(uniquePublicNames, token, registries); |
905,527 | public static CodegenExpression codegenCoerce(CodegenExpression expression, EPType exprType, EPType targetType, boolean alwaysCast) {<NEW_LINE>if (targetType == null || targetType == EPTypeNull.INSTANCE || exprType == null || exprType == EPTypeNull.INSTANCE) {<NEW_LINE>return expression;<NEW_LINE>}<NEW_LINE>EPTypeClass exprClass = (EPTypeClass) exprType;<NEW_LINE>EPTypeClass exprClassBoxed = JavaClassHelper.getBoxedType(exprClass);<NEW_LINE>EPTypeClass targetClass = (EPTypeClass) targetType;<NEW_LINE>EPTypeClass targetClassBoxed = JavaClassHelper.getBoxedType(targetClass);<NEW_LINE>if (exprClassBoxed.getType() == targetClassBoxed.getType()) {<NEW_LINE>return alwaysCast ? cast(targetClass, expression) : expression;<NEW_LINE>}<NEW_LINE>SimpleNumberCoercer coercer = SimpleNumberCoercerFactory.getCoercer(exprClass, JavaClassHelper.getBoxedType(targetClass));<NEW_LINE>if (exprClass.getType().isPrimitive() || alwaysCast) {<NEW_LINE>expression = cast(exprClassBoxed, expression);<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} | coercer.coerceCodegen(expression, exprClass); |
326,280 | public void save(Map<String, Object> optionMap) {<NEW_LINE>if (CollectionUtils.isEmpty(optionMap)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Option> optionKeyMap = ServiceUtils.convertToMap(listAll(), Option::getKey);<NEW_LINE>List<Option> <MASK><NEW_LINE>List<Option> optionsToUpdate = new LinkedList<>();<NEW_LINE>optionMap.forEach((key, value) -> {<NEW_LINE>Option oldOption = optionKeyMap.get(key);<NEW_LINE>if (oldOption == null || !StringUtils.equals(oldOption.getValue(), value.toString())) {<NEW_LINE>OptionParam optionParam = new OptionParam();<NEW_LINE>optionParam.setKey(key);<NEW_LINE>optionParam.setValue(value.toString());<NEW_LINE>ValidationUtils.validate(optionParam);<NEW_LINE>if (oldOption == null) {<NEW_LINE>// Create it<NEW_LINE>optionsToCreate.add(optionParam.convertTo());<NEW_LINE>} else if (!StringUtils.equals(oldOption.getValue(), value.toString())) {<NEW_LINE>// Update it<NEW_LINE>optionParam.update(oldOption);<NEW_LINE>optionsToUpdate.add(oldOption);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Update them<NEW_LINE>updateInBatch(optionsToUpdate);<NEW_LINE>// Create them<NEW_LINE>createInBatch(optionsToCreate);<NEW_LINE>if (!CollectionUtils.isEmpty(optionsToUpdate) || !CollectionUtils.isEmpty(optionsToCreate)) {<NEW_LINE>// If there is something changed<NEW_LINE>eventPublisher.publishEvent(new OptionUpdatedEvent(this));<NEW_LINE>}<NEW_LINE>} | optionsToCreate = new LinkedList<>(); |
672,513 | protected FetchResult fetch(Git git, String label) {<NEW_LINE>FetchCommand fetch = git.fetch();<NEW_LINE>fetch.setRemote("origin");<NEW_LINE>fetch.setTagOpt(TagOpt.FETCH_TAGS);<NEW_LINE>fetch.setRemoveDeletedRefs(this.deleteUntrackedBranches);<NEW_LINE>if (this.refreshRate > 0) {<NEW_LINE>this.setLastRefresh(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>configureCommand(fetch);<NEW_LINE>try {<NEW_LINE>FetchResult result = fetch.call();<NEW_LINE>if (result.getTrackingRefUpdates() != null && result.getTrackingRefUpdates().size() > 0) {<NEW_LINE>this.logger.info("Fetched for remote " + label + " and found " + result.getTrackingRefUpdates().size() + " updates");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>String message = "Could not fetch remote for " + label + " remote: " + git.getRepository().getConfig().<MASK><NEW_LINE>warn(message, ex);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | getString("remote", "origin", "url"); |
450,797 | public MethodDeclaration createStaticConstructor(AccessLevel level, String name, EclipseNode type, Collection<EclipseNode> fields, ASTNode source) {<NEW_LINE>int pS = source.sourceStart, pE = source.sourceEnd;<NEW_LINE>long p = (long) pS << 32 | pE;<NEW_LINE>MethodDeclaration constructor = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult);<NEW_LINE>constructor.modifiers = toEclipseModifier(level) | ClassFileConstants.AccStatic;<NEW_LINE>TypeDeclaration typeDecl = <MASK><NEW_LINE>constructor.returnType = EclipseHandlerUtil.namePlusTypeParamsToTypeReference(type, typeDecl.typeParameters, p);<NEW_LINE>constructor.annotations = null;<NEW_LINE>if (getCheckerFrameworkVersion(type).generateUnique()) {<NEW_LINE>int len = constructor.returnType.getTypeName().length;<NEW_LINE>constructor.returnType.annotations = new Annotation[len][];<NEW_LINE>constructor.returnType.annotations[len - 1] = new Annotation[] { generateNamedAnnotation(source, CheckerFrameworkVersion.NAME__UNIQUE) };<NEW_LINE>}<NEW_LINE>constructor.selector = name.toCharArray();<NEW_LINE>constructor.thrownExceptions = null;<NEW_LINE>constructor.typeParameters = copyTypeParams(((TypeDeclaration) type.get()).typeParameters, source);<NEW_LINE>constructor.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;<NEW_LINE>constructor.bodyStart = constructor.declarationSourceStart = constructor.sourceStart = source.sourceStart;<NEW_LINE>constructor.bodyEnd = constructor.declarationSourceEnd = constructor.sourceEnd = source.sourceEnd;<NEW_LINE>List<Argument> params = new ArrayList<Argument>();<NEW_LINE>List<Expression> assigns = new ArrayList<Expression>();<NEW_LINE>AllocationExpression statement = new AllocationExpression();<NEW_LINE>statement.sourceStart = pS;<NEW_LINE>statement.sourceEnd = pE;<NEW_LINE>statement.type = copyType(constructor.returnType, source);<NEW_LINE>for (EclipseNode fieldNode : fields) {<NEW_LINE>FieldDeclaration field = (FieldDeclaration) fieldNode.get();<NEW_LINE>long fieldPos = (((long) field.sourceStart) << 32) | field.sourceEnd;<NEW_LINE>SingleNameReference nameRef = new SingleNameReference(field.name, fieldPos);<NEW_LINE>assigns.add(nameRef);<NEW_LINE>Argument parameter = new Argument(field.name, fieldPos, copyType(field.type, source), Modifier.FINAL);<NEW_LINE>parameter.annotations = copyAnnotations(source, findCopyableAnnotations(fieldNode));<NEW_LINE>if (parameter.annotations != null) {<NEW_LINE>parameter.bits |= Eclipse.HasTypeAnnotations;<NEW_LINE>constructor.bits |= Eclipse.HasTypeAnnotations;<NEW_LINE>}<NEW_LINE>params.add(parameter);<NEW_LINE>}<NEW_LINE>statement.arguments = assigns.isEmpty() ? null : assigns.toArray(new Expression[0]);<NEW_LINE>constructor.arguments = params.isEmpty() ? null : params.toArray(new Argument[0]);<NEW_LINE>constructor.statements = new Statement[] { new ReturnStatement(statement, (int) (p >> 32), (int) p) };<NEW_LINE>createRelevantNonNullAnnotation(type, constructor);<NEW_LINE>constructor.traverse(new SetGeneratedByVisitor(source), typeDecl.scope);<NEW_LINE>return constructor;<NEW_LINE>} | (TypeDeclaration) type.get(); |
1,671,670 | protected ServerHello generate13HelloRetryRequest(ClientHello clientHello) throws IOException {<NEW_LINE>// TODO[tls13] In future there might be other reasons for a HelloRetryRequest.<NEW_LINE>if (retryGroup < 0) {<NEW_LINE>throw new TlsFatalAlert(AlertDescription.internal_error);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ProtocolVersion serverVersion = securityParameters.getNegotiatedVersion();<NEW_LINE>Hashtable serverHelloExtensions = new Hashtable();<NEW_LINE>TlsExtensionsUtils.addSupportedVersionsExtensionServer(serverHelloExtensions, serverVersion);<NEW_LINE>if (retryGroup >= 0) {<NEW_LINE>TlsExtensionsUtils.addKeyShareHelloRetryRequest(serverHelloExtensions, retryGroup);<NEW_LINE>}<NEW_LINE>if (null != retryCookie) {<NEW_LINE>TlsExtensionsUtils.addCookieExtension(serverHelloExtensions, retryCookie);<NEW_LINE>}<NEW_LINE>TlsUtils.checkExtensionData13(serverHelloExtensions, HandshakeType.hello_retry_request, AlertDescription.internal_error);<NEW_LINE>return new ServerHello(clientHello.getSessionID(), securityParameters.getCipherSuite(), serverHelloExtensions);<NEW_LINE>} | SecurityParameters securityParameters = tlsServerContext.getSecurityParametersHandshake(); |
1,366,616 | private void addSourceJobDataPoint(final MetricData datapoint) {<NEW_LINE>final String sourceJobId = datapoint.getJobId();<NEW_LINE>final <MASK><NEW_LINE>String sourceWorkerKey = sourceJobId + ":" + workerIndex;<NEW_LINE>WorkerMetrics workerMetrics = sourceJobWorkersMap.get(sourceWorkerKey);<NEW_LINE>if (workerMetrics == null) {<NEW_LINE>workerMetrics = new WorkerMetrics(valuesToKeep);<NEW_LINE>sourceJobWorkersMap.put(sourceWorkerKey, workerMetrics);<NEW_LINE>}<NEW_LINE>workerMetrics.addDataPoint(datapoint.getMetricGroupName(), datapoint);<NEW_LINE>String sourceMetricKey = sourceWorkerKey + ":" + datapoint.getMetricGroupName();<NEW_LINE>sourceJobMetricsRecent.put(sourceMetricKey, sourceMetricKey);<NEW_LINE>// Detect outlier on sourcejob drops, if high percentage of drops are concentrated on few workers.<NEW_LINE>Matcher matcher = hostExtractorPattern.matcher(datapoint.getMetricGroupName());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>// From the sourcejob drop metric, we only know the sockAddr of the downstream worker. Multiple worker<NEW_LINE>// may be running on the same machine. We need to count that evenly in the outlier detector.<NEW_LINE>List<Integer> workerIndices = lookupWorkersByHost(matcher.group("host"));<NEW_LINE>for (Map.Entry<String, Double> gauge : datapoint.getGaugeData().getGauges().entrySet()) {<NEW_LINE>if (autoScaleMetricsConfig.isSourceJobDropMetric(datapoint.getMetricGroupName(), gauge.getKey())) {<NEW_LINE>workerIndices.stream().forEach(i -> workerOutlierForSourceJobMetrics.addDataPoint(i, gauge.getValue() / workerIndices.size(), numStageWorkersFn.call(stage)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int workerIndex = datapoint.getWorkerIndex(); |
912,198 | public static long parseLong(final CharSequence s) {<NEW_LINE>if (s == null)<NEW_LINE>throw new NumberFormatException("Null string");<NEW_LINE>// Check for a sign.<NEW_LINE>long num = 0;<NEW_LINE>long sign = -1;<NEW_LINE>final <MASK><NEW_LINE>final char ch = s.charAt(0);<NEW_LINE>if (ch == '-') {<NEW_LINE>if (len == 1)<NEW_LINE>throw new NumberFormatException("Missing digits: " + s);<NEW_LINE>sign = 1;<NEW_LINE>} else {<NEW_LINE>final int d = ch - '0';<NEW_LINE>if (d < 0 || d > 9)<NEW_LINE>throw new NumberFormatException("Malformed: " + s);<NEW_LINE>num = -d;<NEW_LINE>}<NEW_LINE>// Build the number.<NEW_LINE>final long max = (sign == -1L) ? -Long.MAX_VALUE : Long.MIN_VALUE;<NEW_LINE>final long multmax = max / 10;<NEW_LINE>int i = 1;<NEW_LINE>while (i < len) {<NEW_LINE>long d = s.charAt(i++) - '0';<NEW_LINE>if (d < 0L || d > 9L)<NEW_LINE>throw new NumberFormatException("Malformed: " + s);<NEW_LINE>if (num < multmax)<NEW_LINE>throw new NumberFormatException("Over/underflow: " + s);<NEW_LINE>num *= 10;<NEW_LINE>if (num < (max + d))<NEW_LINE>throw new NumberFormatException("Over/underflow: " + s);<NEW_LINE>num -= d;<NEW_LINE>}<NEW_LINE>return sign * num;<NEW_LINE>} | int len = s.length(); |
541,918 | public static DescribeIPv6TranslatorsResponse unmarshall(DescribeIPv6TranslatorsResponse describeIPv6TranslatorsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeIPv6TranslatorsResponse.setRequestId(_ctx.stringValue("DescribeIPv6TranslatorsResponse.RequestId"));<NEW_LINE>describeIPv6TranslatorsResponse.setPageSize(_ctx.integerValue("DescribeIPv6TranslatorsResponse.PageSize"));<NEW_LINE>describeIPv6TranslatorsResponse.setPageNumber(_ctx.integerValue("DescribeIPv6TranslatorsResponse.PageNumber"));<NEW_LINE>describeIPv6TranslatorsResponse.setTotalCount(_ctx.integerValue("DescribeIPv6TranslatorsResponse.TotalCount"));<NEW_LINE>List<Ipv6Translator> ipv6Translators = new ArrayList<Ipv6Translator>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeIPv6TranslatorsResponse.Ipv6Translators.Length"); i++) {<NEW_LINE>Ipv6Translator ipv6Translator = new Ipv6Translator();<NEW_LINE>ipv6Translator.setStatus(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Status"));<NEW_LINE>ipv6Translator.setSpec(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Spec"));<NEW_LINE>ipv6Translator.setCreateTime(_ctx.longValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].CreateTime"));<NEW_LINE>ipv6Translator.setPayType(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].PayType"));<NEW_LINE>ipv6Translator.setIpv6TranslatorId(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Ipv6TranslatorId"));<NEW_LINE>ipv6Translator.setAllocateIpv4Addr(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].AllocateIpv4Addr"));<NEW_LINE>ipv6Translator.setAvailableBandwidth(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].AvailableBandwidth"));<NEW_LINE>ipv6Translator.setRegionId(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].RegionId"));<NEW_LINE>ipv6Translator.setEndTime(_ctx.longValue<MASK><NEW_LINE>ipv6Translator.setDescription(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Description"));<NEW_LINE>ipv6Translator.setBandwidth(_ctx.integerValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Bandwidth"));<NEW_LINE>ipv6Translator.setBusinessStatus(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].BusinessStatus"));<NEW_LINE>ipv6Translator.setAllocateIpv6Addr(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].AllocateIpv6Addr"));<NEW_LINE>ipv6Translator.setName(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Name"));<NEW_LINE>List<String> ipv6TranslatorEntryIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Ipv6TranslatorEntryIds.Length"); j++) {<NEW_LINE>ipv6TranslatorEntryIds.add(_ctx.stringValue("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].Ipv6TranslatorEntryIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>ipv6Translator.setIpv6TranslatorEntryIds(ipv6TranslatorEntryIds);<NEW_LINE>ipv6Translators.add(ipv6Translator);<NEW_LINE>}<NEW_LINE>describeIPv6TranslatorsResponse.setIpv6Translators(ipv6Translators);<NEW_LINE>return describeIPv6TranslatorsResponse;<NEW_LINE>} | ("DescribeIPv6TranslatorsResponse.Ipv6Translators[" + i + "].EndTime")); |
230,731 | public String prettyPrint() {<NEW_LINE>StringBuilder sb = new StringBuilder(shortSummary());<NEW_LINE>sb.append('\n');<NEW_LINE>if (!this.keepTaskList) {<NEW_LINE>sb.append("No task info kept");<NEW_LINE>} else {<NEW_LINE>sb.append("---------------------------------------------\n");<NEW_LINE>sb.append("ns % Task name\n");<NEW_LINE>sb.append("---------------------------------------------\n");<NEW_LINE><MASK><NEW_LINE>nf.setMinimumIntegerDigits(9);<NEW_LINE>nf.setGroupingUsed(false);<NEW_LINE>NumberFormat pf = NumberFormat.getPercentInstance();<NEW_LINE>pf.setMinimumIntegerDigits(3);<NEW_LINE>pf.setGroupingUsed(false);<NEW_LINE>for (TaskInfo task : getTaskInfo()) {<NEW_LINE>sb.append(nf.format(task.getTimeNanos())).append(" ");<NEW_LINE>sb.append(pf.format((double) task.getTimeNanos() / getTotalTimeNanos())).append(" ");<NEW_LINE>sb.append(task.getTaskName()).append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | NumberFormat nf = NumberFormat.getNumberInstance(); |
529,466 | public static void parse(ArrayList<SSTNode> formatStringParts, String text, boolean isRawString, int partOffsetInSource, int textOffsetInSource, Source source, FStringExprParser exprParser, ParserErrorCallback errorCallback, PythonSSTNodeFactory nodeFactory) {<NEW_LINE>int estimatedTokensCount = 1;<NEW_LINE>for (int i = 0; i < text.length(); i++) {<NEW_LINE>char c = text.charAt(i);<NEW_LINE>if (c == '{' || c == '}' || c == ':') {<NEW_LINE>estimatedTokensCount++;<NEW_LINE>if (estimatedTokensCount > 32) {<NEW_LINE>// don't get too crazy...<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// create tokens<NEW_LINE>ArrayList<Token> tokens <MASK><NEW_LINE>createTokens(tokens, errorCallback, 0, text, isRawString, 0);<NEW_LINE>// create nodes from the tokens<NEW_LINE>int tokenIndex = 0;<NEW_LINE>Token token;<NEW_LINE>while (tokenIndex < tokens.size()) {<NEW_LINE>token = tokens.get(tokenIndex);<NEW_LINE>SSTNode part = createFormatStringLiteralSSTNodeFromToken(tokens, tokenIndex, text, isRawString, partOffsetInSource, textOffsetInSource, source, nodeFactory, errorCallback, exprParser);<NEW_LINE>formatStringParts.add(part);<NEW_LINE>tokenIndex = tokenIndex + 1 + token.formatTokensCount;<NEW_LINE>}<NEW_LINE>} | = new ArrayList<>(estimatedTokensCount); |
1,356,633 | private ExportResult<ContactsModelWrapper> doExport(TokensAndUrlAuthData authData, String url) {<NEW_LINE>Request.Builder graphReqBuilder = new Request.Builder().url(url);<NEW_LINE>graphReqBuilder.header("Authorization", "Bearer " + authData.getAccessToken());<NEW_LINE>try (Response graphResponse = client.newCall(graphReqBuilder.build()).execute()) {<NEW_LINE>ResponseBody body = graphResponse.body();<NEW_LINE>if (body == null) {<NEW_LINE>return new ExportResult<>(new Exception("Error retrieving contacts: response body was null"));<NEW_LINE>}<NEW_LINE>String graphBody = new <MASK><NEW_LINE>Map graphMap = objectMapper.reader().forType(Map.class).readValue(graphBody);<NEW_LINE>String nextLink = (String) graphMap.get(ODATA_NEXT);<NEW_LINE>ContinuationData continuationData = nextLink == null ? null : new ContinuationData(new GraphPagination(nextLink));<NEW_LINE>List<Map<String, Object>> rawContacts = (List<Map<String, Object>>) graphMap.get("value");<NEW_LINE>if (rawContacts == null) {<NEW_LINE>return new ExportResult<>(ExportResult.ResultType.END);<NEW_LINE>}<NEW_LINE>ContactsModelWrapper wrapper = transform(rawContacts);<NEW_LINE>return new ExportResult<>(ExportResult.ResultType.CONTINUE, wrapper, continuationData);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// FIXME log error<NEW_LINE>e.printStackTrace();<NEW_LINE>return new ExportResult<>(e);<NEW_LINE>}<NEW_LINE>} | String(body.bytes()); |
1,834,496 | public static void main(String[] args) {<NEW_LINE>TokenCredential tokenCredential = <MASK><NEW_LINE>LogsQueryClient logsQueryClient = new LogsQueryClientBuilder().credential(tokenCredential).httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)).buildClient();<NEW_LINE>LogsQueryResult queryResults = logsQueryClient.queryWorkspaceWithResponse("d2d0e126-fa1e-4b0a-b647-250cdd471e68", "union * | where TimeGenerated > ago(10d) | project TenantId", null, new LogsQueryOptions().setAdditionalWorkspaces(Arrays.asList("srnagar-log-analytics-ws-2", "srnagar-log-analytics-ws")), Context.NONE).getValue();<NEW_LINE>System.out.println("Number of tables = " + queryResults.getAllTables().size());<NEW_LINE>// Sample to iterate by row<NEW_LINE>Set<String> results = new HashSet<>();<NEW_LINE>for (LogsTable table : queryResults.getAllTables()) {<NEW_LINE>for (LogsTableRow row : table.getRows()) {<NEW_LINE>Set<String> collect = row.getRow().stream().map(cell -> cell.getValueAsString()).collect(Collectors.toSet());<NEW_LINE>row.getRow().forEach(cell -> System.out.println(cell.getValueAsString()));<NEW_LINE>results.addAll(collect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Collected tenants " + results);<NEW_LINE>} | new DefaultAzureCredentialBuilder().build(); |
1,403,389 | final GetRuleResult executeGetRule(GetRuleRequest getRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRuleRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRuleRequest> request = null;<NEW_LINE>Response<GetRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRuleRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRuleResultJsonUnmarshaller());<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(); |
128,612 | public CodegenMethod make(CodegenMethodScope parent, CodegenClassScope classScope) {<NEW_LINE>int size = filterTypes.size() + arrayEventTypes.size();<NEW_LINE>CodegenMethod method = parent.makeChild(EventBean.EPTYPEARRAY, this.getClass(), classScope).addParam(MatchedEventMap.EPTYPE, "mem");<NEW_LINE>if (size == 0 || (streamsUsedCanNull != null && streamsUsedCanNull.isEmpty())) {<NEW_LINE>method.getBlock().methodReturn(publicConstValue(CollectionUtil.class, "EVENTBEANARRAY_EMPTY"));<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>int sizeArray = baseStreamIndexOne ? size + 1 : size;<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "events", newArrayByLength(EventBean.EPTYPE, constant(sizeArray))).declareVar(EPTypePremade.OBJECTARRAY.getEPType(), "buf", exprDotMethod(<MASK><NEW_LINE>int count = 0;<NEW_LINE>for (Map.Entry<String, Pair<EventType, String>> entry : filterTypes.entrySet()) {<NEW_LINE>int indexTag = findTag(allTags, entry.getKey());<NEW_LINE>int indexStream = baseStreamIndexOne ? count + 1 : count;<NEW_LINE>if (streamsUsedCanNull == null || streamsUsedCanNull.contains(indexStream)) {<NEW_LINE>method.getBlock().assignArrayElement(ref("events"), constant(indexStream), cast(EventBean.EPTYPE, arrayAtIndex(ref("buf"), constant(indexTag))));<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Pair<EventType, String>> entry : arrayEventTypes.entrySet()) {<NEW_LINE>int indexTag = findTag(allTags, entry.getKey());<NEW_LINE>int indexStream = baseStreamIndexOne ? count + 1 : count;<NEW_LINE>if (streamsUsedCanNull == null || streamsUsedCanNull.contains(indexStream)) {<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "arr" + count, cast(EventBean.EPTYPEARRAY, arrayAtIndex(ref("buf"), constant(indexTag)))).declareVar(EPTypePremade.MAP.getEPType(), "map" + count, staticMethod(Collections.class, "singletonMap", constant(entry.getKey()), ref("arr" + count))).assignArrayElement(ref("events"), constant(indexStream), newInstance(MapEventBean.EPTYPE, ref("map" + count), constantNull()));<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>method.getBlock().methodReturn(ref("events"));<NEW_LINE>return method;<NEW_LINE>} | ref("mem"), "getMatchingEvents")); |
1,451,991 | private void handleExecException(Exception execException) throws SQLException {<NEW_LINE>// TODO (bullman): This is terrible. There has to be a better way.<NEW_LINE>log.debug("Handling Exception from Statement method.", execException);<NEW_LINE>Connection conn = delegate.getConnection(<MASK><NEW_LINE>if (conn.isClosed()) {<NEW_LINE>// Closed connections are automatically returned to the pool.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// How a JDBC driver handles closing a connection with an active connection is<NEW_LINE>// an implementation-specific detail. Don't assume that closing the driver will<NEW_LINE>// roll back the transaction - some of them commit.<NEW_LINE>log.debug("Issuing rollback on connection.");<NEW_LINE>conn.rollback();<NEW_LINE>} catch (SQLException sqe) {<NEW_LINE>log.error("Transaction roll back threw exception.", sqe);<NEW_LINE>} finally {<NEW_LINE>conn.close();<NEW_LINE>}<NEW_LINE>} | ).unwrap(Connection.class); |
1,769,677 | public static void main(String[] args) {<NEW_LINE>if (args.length < 3) {<NEW_LINE>System.out.println("paramters not specified.");<NEW_LINE>System.out.println("H2Control <h2 command> <h2 host> <h2 port> <h2 home> <redirect output>");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>H2Control h2Control = null;<NEW_LINE>if (args.length == 3) {<NEW_LINE>h2Control = new H2Control(args[0], args[<MASK><NEW_LINE>} else if (args.length == 4) {<NEW_LINE>h2Control = new H2Control(args[0], args[1], args[2], args[3]);<NEW_LINE>} else if (args.length == 5) {<NEW_LINE>h2Control = new H2Control(args[0], args[1], args[2], args[3], args[4]);<NEW_LINE>} else if (args.length > 5) {<NEW_LINE>h2Control = new H2Control(args[0], args[1], args[2], args[3], args[4], args[5]);<NEW_LINE>}<NEW_LINE>if (h2Control != null) {<NEW_LINE>h2Control.invokeServer();<NEW_LINE>}<NEW_LINE>} | 1], args[2]); |
1,062,170 | public CodegenExpression evaluateCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) {<NEW_LINE>if (subselect.getEvaluationType() == EPTypeNull.INSTANCE) {<NEW_LINE>return constantNull();<NEW_LINE>}<NEW_LINE>CodegenExpressionField eventToPublic = TableDeployTimeResolver.makeTableEventToPublicField(table, classScope, this.getClass());<NEW_LINE>CodegenMethod method = parent.makeChild((EPTypeClass) subselect.getEvaluationType(), this.getClass(), classScope);<NEW_LINE>method.getBlock().applyTri(DECLARE_EVENTS_SHIFTED, method, symbols);<NEW_LINE>method.getBlock().declareVar(EventBean.<MASK><NEW_LINE>CodegenBlock foreach = method.getBlock().forEach(EventBean.EPTYPE, "event", symbols.getAddMatchingEvents(method));<NEW_LINE>{<NEW_LINE>foreach.assignArrayElement(REF_EVENTS_SHIFTED, constant(0), ref("event"));<NEW_LINE>CodegenMethod filter = CodegenLegoMethodExpression.codegenExpression(subselect.filterExpr, method, classScope);<NEW_LINE>CodegenLegoBooleanExpression.codegenContinueIfNotNullAndNotPass(foreach, EPTypePremade.BOOLEANBOXED.getEPType(), localMethod(filter, REF_EVENTS_SHIFTED, symbols.getAddIsNewData(method), symbols.getAddExprEvalCtx(method)));<NEW_LINE>foreach.ifCondition(notEqualsNull(ref("filtered"))).blockReturn(constantNull()).assignRef("filtered", ref("event"));<NEW_LINE>}<NEW_LINE>method.getBlock().ifRefNullReturnNull("filtered").methodReturn(exprDotMethod(eventToPublic, "convertToUnd", ref("filtered"), symbols.getAddEPS(method), symbols.getAddIsNewData(method), symbols.getAddExprEvalCtx(method)));<NEW_LINE>return localMethod(method);<NEW_LINE>} | EPTYPE, "filtered", constantNull()); |
601,976 | public final <K> Map<K, ?> toMap(Supplier<? extends K> keySupplier1, Supplier<? extends K> keySupplier2, Supplier<? extends K> keySupplier3, Supplier<? extends K> keySupplier4, Supplier<? extends K> keySupplier5, Supplier<? extends K> keySupplier6, Supplier<? extends K> keySupplier7, Supplier<? extends K> keySupplier8, Supplier<? extends K> keySupplier9, Supplier<? extends K> keySupplier10, Supplier<? extends K> keySupplier11, Supplier<? extends K> keySupplier12, Supplier<? extends K> keySupplier13, Supplier<? extends K> keySupplier14, Supplier<? extends K> keySupplier15) {<NEW_LINE>Map<K, Object> result = new LinkedHashMap<>();<NEW_LINE>result.put(keySupplier1.get(), v1);<NEW_LINE>result.put(keySupplier2.get(), v2);<NEW_LINE>result.put(keySupplier3.get(), v3);<NEW_LINE>result.put(keySupplier4.get(), v4);<NEW_LINE>result.put(keySupplier5.get(), v5);<NEW_LINE>result.put(keySupplier6.get(), v6);<NEW_LINE>result.put(keySupplier7.get(), v7);<NEW_LINE>result.put(<MASK><NEW_LINE>result.put(keySupplier9.get(), v9);<NEW_LINE>result.put(keySupplier10.get(), v10);<NEW_LINE>result.put(keySupplier11.get(), v11);<NEW_LINE>result.put(keySupplier12.get(), v12);<NEW_LINE>result.put(keySupplier13.get(), v13);<NEW_LINE>result.put(keySupplier14.get(), v14);<NEW_LINE>result.put(keySupplier15.get(), v15);<NEW_LINE>return result;<NEW_LINE>} | keySupplier8.get(), v8); |
781,308 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.group_edit);<NEW_LINE>setTitle(R.string.add_group_title);<NEW_LINE>ImageButton iconButton = (ImageButton) findViewById(R.id.icon_button);<NEW_LINE>iconButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>IconPickerActivity.Launch(GroupEditActivity.this);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Button okButton = (Button) findViewById(R.id.ok);<NEW_LINE>okButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>TextView nameField = (TextView) findViewById(R.id.group_name);<NEW_LINE>String name = nameField.getText().toString();<NEW_LINE>if (name.length() > 0) {<NEW_LINE>final Intent intent = new Intent();<NEW_LINE><MASK><NEW_LINE>intent.putExtra(KEY_ICON_ID, mSelectedIconID);<NEW_LINE>setResult(Activity.RESULT_OK, intent);<NEW_LINE>finish();<NEW_LINE>} else {<NEW_LINE>Toast.makeText(GroupEditActivity.this, R.string.error_no_name, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Button cancel = (Button) findViewById(R.id.cancel);<NEW_LINE>cancel.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>final Intent intent = new Intent();<NEW_LINE>setResult(Activity.RESULT_CANCELED, intent);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | intent.putExtra(KEY_NAME, name); |
17,378 | public static QueryMsConfigResourcesResponse unmarshall(QueryMsConfigResourcesResponse queryMsConfigResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMsConfigResourcesResponse.setRequestId(_ctx.stringValue("QueryMsConfigResourcesResponse.RequestId"));<NEW_LINE>queryMsConfigResourcesResponse.setResultCode(_ctx.stringValue("QueryMsConfigResourcesResponse.ResultCode"));<NEW_LINE>queryMsConfigResourcesResponse.setResultMessage(_ctx.stringValue("QueryMsConfigResourcesResponse.ResultMessage"));<NEW_LINE>queryMsConfigResourcesResponse.setPageNum<MASK><NEW_LINE>queryMsConfigResourcesResponse.setPageSize(_ctx.longValue("QueryMsConfigResourcesResponse.PageSize"));<NEW_LINE>queryMsConfigResourcesResponse.setTotalCount(_ctx.longValue("QueryMsConfigResourcesResponse.TotalCount"));<NEW_LINE>List<ResourcesItem> resources = new ArrayList<ResourcesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMsConfigResourcesResponse.Resources.Length"); i++) {<NEW_LINE>ResourcesItem resourcesItem = new ResourcesItem();<NEW_LINE>resourcesItem.setAppName(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].AppName"));<NEW_LINE>resourcesItem.setDesc(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Desc"));<NEW_LINE>resourcesItem.setId(_ctx.longValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Id"));<NEW_LINE>resourcesItem.setInstanceId(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].InstanceId"));<NEW_LINE>resourcesItem.setRegion(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Region"));<NEW_LINE>resourcesItem.setResourceId(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].ResourceId"));<NEW_LINE>List<AttributesItem> attributes = new ArrayList<AttributesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes.Length"); j++) {<NEW_LINE>AttributesItem attributesItem = new AttributesItem();<NEW_LINE>attributesItem.setAttributeName(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].AttributeName"));<NEW_LINE>attributesItem.setDesc(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].Desc"));<NEW_LINE>attributesItem.setId(_ctx.longValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].Id"));<NEW_LINE>attributesItem.setInstanceId(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].InstanceId"));<NEW_LINE>attributes.add(attributesItem);<NEW_LINE>}<NEW_LINE>resourcesItem.setAttributes(attributes);<NEW_LINE>resources.add(resourcesItem);<NEW_LINE>}<NEW_LINE>queryMsConfigResourcesResponse.setResources(resources);<NEW_LINE>return queryMsConfigResourcesResponse;<NEW_LINE>} | (_ctx.longValue("QueryMsConfigResourcesResponse.PageNum")); |
754,542 | Intent createTwitterIntent() {<NEW_LINE>final Intent intent = new Intent(Intent.ACTION_SEND);<NEW_LINE>final StringBuilder builder = new StringBuilder();<NEW_LINE>if (!TextUtils.isEmpty(this.text)) {<NEW_LINE>builder.append(this.text);<NEW_LINE>}<NEW_LINE>if (this.uri != null) {<NEW_LINE>if (builder.length() > 0) {<NEW_LINE>builder.append(' ');<NEW_LINE>}<NEW_LINE>builder.append(this.uri.toString());<NEW_LINE>}<NEW_LINE>intent.putExtra(Intent.<MASK><NEW_LINE>intent.setType(MIME_TYPE_PLAIN_TEXT);<NEW_LINE>if (this.imageUri != null) {<NEW_LINE>intent.putExtra(Intent.EXTRA_STREAM, this.imageUri);<NEW_LINE>intent.setType(MIME_TYPE_JPEG);<NEW_LINE>}<NEW_LINE>final PackageManager packManager = this.context.getPackageManager();<NEW_LINE>final List<ResolveInfo> resolvedInfoList = packManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);<NEW_LINE>for (ResolveInfo resolveInfo : resolvedInfoList) {<NEW_LINE>if (resolveInfo.activityInfo.packageName.startsWith(TWITTER_PACKAGE_NAME)) {<NEW_LINE>intent.setClassName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name);<NEW_LINE>return intent;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | EXTRA_TEXT, builder.toString()); |
199,804 | public static ListDataStreamsResponse unmarshall(ListDataStreamsResponse listDataStreamsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDataStreamsResponse.setRequestId(_ctx.stringValue("ListDataStreamsResponse.RequestId"));<NEW_LINE>Headers headers = new Headers();<NEW_LINE>headers.setXManagedCount(_ctx.integerValue("ListDataStreamsResponse.Headers.X-Managed-Count"));<NEW_LINE>headers.setXManagedStorageSize(_ctx.longValue("ListDataStreamsResponse.Headers.X-Managed-StorageSize"));<NEW_LINE>listDataStreamsResponse.setHeaders(headers);<NEW_LINE>List<ResultItem> result <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDataStreamsResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setHealth(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].health"));<NEW_LINE>resultItem.setTotalStorageSize(_ctx.longValue("ListDataStreamsResponse.Result[" + i + "].totalStorageSize"));<NEW_LINE>resultItem.setName(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].name"));<NEW_LINE>resultItem.setManagedStorageSize(_ctx.longValue("ListDataStreamsResponse.Result[" + i + "].managedStorageSize"));<NEW_LINE>resultItem.setIndexTemplateName(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].indexTemplateName"));<NEW_LINE>resultItem.setIlmPolicyName(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].ilmPolicyName"));<NEW_LINE>List<IndicesItem> indices = new ArrayList<IndicesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListDataStreamsResponse.Result[" + i + "].indices.Length"); j++) {<NEW_LINE>IndicesItem indicesItem = new IndicesItem();<NEW_LINE>indicesItem.setName(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].indices[" + j + "].name"));<NEW_LINE>indicesItem.setHealth(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].indices[" + j + "].health"));<NEW_LINE>indicesItem.setSize(_ctx.longValue("ListDataStreamsResponse.Result[" + i + "].indices[" + j + "].size"));<NEW_LINE>indicesItem.setCreateTime(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].indices[" + j + "].createTime"));<NEW_LINE>indicesItem.setIsManaged(_ctx.booleanValue("ListDataStreamsResponse.Result[" + i + "].indices[" + j + "].isManaged"));<NEW_LINE>indicesItem.setManagedStatus(_ctx.stringValue("ListDataStreamsResponse.Result[" + i + "].indices[" + j + "].managedStatus"));<NEW_LINE>indices.add(indicesItem);<NEW_LINE>}<NEW_LINE>resultItem.setIndices(indices);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>listDataStreamsResponse.setResult(result);<NEW_LINE>return listDataStreamsResponse;<NEW_LINE>} | = new ArrayList<ResultItem>(); |
178,393 | private TipoDado geraTipoResultante() {<NEW_LINE>TipoDado tipoOpEsquerdo = operandoEsquerdo.getTipoResultante();<NEW_LINE>TipoDado tipoOpDireito = operandoDireito.getTipoResultante();<NEW_LINE>if (tipoOpEsquerdo != tipoOpDireito) {<NEW_LINE>try {<NEW_LINE>return TabelaCompatibilidadeTiposPortugol.INSTANCE.obterTipoRetornoOperacao(this.getClass(), tipoOpEsquerdo, tipoOpDireito);<NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>Logger.getLogger(NoOperacao.class.getName()).log(Level.SEVERE, null, ex);<NEW_LINE>} catch (ExcecaoImpossivelDeterminarTipoDado ex) {<NEW_LINE>Logger.getLogger(NoOperacao.class.getName()).log(<MASK><NEW_LINE>} catch (ExcecaoValorSeraConvertido ex) {<NEW_LINE>return ex.getTipoSaida();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tipoOpEsquerdo;<NEW_LINE>} | Level.SEVERE, null, ex); |
20,669 | private void recursivePush(IRubyObject list, IRubyObject obj, IRubyObject paired_obj) {<NEW_LINE>IRubyObject pair_list;<NEW_LINE>Ruby runtime = this.runtime;<NEW_LINE>final ThreadContext context = runtime.getCurrentContext();<NEW_LINE>if (paired_obj == null) {<NEW_LINE>((RubyHash) list).op_aset(context, obj, runtime.getTrue());<NEW_LINE>} else if ((pair_list = ((RubyHash) list).fastARef(obj)) == null) {<NEW_LINE>((RubyHash) list).op_aset(context, obj, paired_obj);<NEW_LINE>} else {<NEW_LINE>if (!(pair_list instanceof RubyHash)) {<NEW_LINE>IRubyObject other_paired_obj = pair_list;<NEW_LINE>pair_list = RubyHash.newHash(runtime);<NEW_LINE>((RubyHash) pair_list).op_aset(context, other_paired_obj, runtime.getTrue());<NEW_LINE>((RubyHash) list).<MASK><NEW_LINE>}<NEW_LINE>((RubyHash) pair_list).op_aset(context, paired_obj, runtime.getTrue());<NEW_LINE>}<NEW_LINE>} | op_aset(context, obj, pair_list); |
740,619 | public void addAndConsumeAdvancedQueryClauses(ExtendedLuceneClauseBuilder builder, String theResourceType, SearchParameterMap theParams, ISearchParamRegistry theSearchParamRegistry) {<NEW_LINE>// copy the keys to avoid concurrent modification error<NEW_LINE>ArrayList<String> paramNames = Lists.newArrayList(theParams.keySet());<NEW_LINE>for (String nextParam : paramNames) {<NEW_LINE>if (ourUnsafeSearchParmeters.contains(nextParam)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>RuntimeSearchParam activeParam = theSearchParamRegistry.getActiveSearchParam(theResourceType, nextParam);<NEW_LINE>if (activeParam == null) {<NEW_LINE>// ignore magic params handled in JPA<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// NOTE - keep this in sync with isParamSupported() above.<NEW_LINE>switch(activeParam.getParamType()) {<NEW_LINE>case TOKEN:<NEW_LINE>List<List<IQueryParameterType>> tokenTextAndOrTerms = theParams.removeByNameAndModifier(nextParam, Constants.PARAMQUALIFIER_TOKEN_TEXT);<NEW_LINE>builder.addStringTextSearch(nextParam, tokenTextAndOrTerms);<NEW_LINE>List<List<IQueryParameterType>> tokenUnmodifiedAndOrTerms = theParams.removeByNameUnmodified(nextParam);<NEW_LINE>builder.addTokenUnmodifiedSearch(nextParam, tokenUnmodifiedAndOrTerms);<NEW_LINE>break;<NEW_LINE>case STRING:<NEW_LINE>List<List<IQueryParameterType>> stringTextAndOrTerms = theParams.removeByNameAndModifier(nextParam, Constants.PARAMQUALIFIER_TOKEN_TEXT);<NEW_LINE>builder.addStringTextSearch(nextParam, stringTextAndOrTerms);<NEW_LINE>List<List<IQueryParameterType>> stringExactAndOrTerms = theParams.<MASK><NEW_LINE>builder.addStringExactSearch(nextParam, stringExactAndOrTerms);<NEW_LINE>List<List<IQueryParameterType>> stringContainsAndOrTerms = theParams.removeByNameAndModifier(nextParam, Constants.PARAMQUALIFIER_STRING_CONTAINS);<NEW_LINE>builder.addStringContainsSearch(nextParam, stringContainsAndOrTerms);<NEW_LINE>List<List<IQueryParameterType>> stringAndOrTerms = theParams.removeByNameUnmodified(nextParam);<NEW_LINE>builder.addStringUnmodifiedSearch(nextParam, stringAndOrTerms);<NEW_LINE>break;<NEW_LINE>case QUANTITY:<NEW_LINE>break;<NEW_LINE>case REFERENCE:<NEW_LINE>List<List<IQueryParameterType>> referenceAndOrTerms = theParams.removeByNameUnmodified(nextParam);<NEW_LINE>builder.addReferenceUnchainedSearch(nextParam, referenceAndOrTerms);<NEW_LINE>break;<NEW_LINE>case DATE:<NEW_LINE>List<List<IQueryParameterType>> dateAndOrTerms = theParams.removeByNameUnmodified(nextParam);<NEW_LINE>builder.addDateUnmodifiedSearch(nextParam, dateAndOrTerms);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | removeByNameAndModifier(nextParam, Constants.PARAMQUALIFIER_STRING_EXACT); |
1,331,318 | public void begin() throws SIIncorrectCallException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "begin");<NEW_LINE>// Are we currently in use? do we have work<NEW_LINE>// we still need to commit?<NEW_LINE>if (_state == TransactionState.STATE_ACTIVE && _workList != null) {<NEW_LINE>SIIncorrectCallException ice = new SIIncorrectCallException(nls.getFormattedMessage("TRAN_PROTOCOL_ERROR_SIMS1001", null, "TRAN_PROTOCOL_ERROR_SIMS1001"));<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>SibTr.event(this, tc, "Cannot begin new LocalTran. Existing work needs completing first!", ice);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "begin");<NEW_LINE>throw ice;<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>_ptid = null;<NEW_LINE>}<NEW_LINE>_workList = null;<NEW_LINE>_size = 0;<NEW_LINE>_callbacks.clear();<NEW_LINE>_state = TransactionState.STATE_ACTIVE;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>} | exit(this, tc, "begin"); |
1,764,338 | public void runRat() {<NEW_LINE>ReportConfiguration reportConfiguration = new ReportConfiguration();<NEW_LINE>reportConfiguration.setAddingLicenses(true);<NEW_LINE>List<IHeaderMatcher> matchers = new ArrayList<>();<NEW_LINE>matchers.add(Defaults.createDefaultMatcher());<NEW_LINE>// BSD 4-clause stuff (is disallowed below)<NEW_LINE>// we keep this here, in case someone adds BSD code for some reason, it should never be allowed.<NEW_LINE>matchers.add(subStringMatcher("BSD4 ", "Original BSD License (with advertising clause)", "All advertising materials"));<NEW_LINE>// Apache<NEW_LINE>matchers.add(subStringMatcher("AL ", "Apache", "Licensed to Elasticsearch B.V. under one or more contributor"));<NEW_LINE>// Apache lz4-java<NEW_LINE>matchers.add(subStringMatcher<MASK><NEW_LINE>// Generated resources<NEW_LINE>matchers.add(subStringMatcher("GEN ", "Generated", "ANTLR GENERATED CODE"));<NEW_LINE>// Vendored Code<NEW_LINE>matchers.add(subStringMatcher("VEN ", "Vendored", "@notice"));<NEW_LINE>additionalLicenses.get().forEach(l -> matchers.add(subStringMatcher(l.licenseFamilyCategory, l.licenseFamilyName, l.substringPattern)));<NEW_LINE>reportConfiguration.setHeaderMatcher(new HeaderMatcherMultiplexer(matchers.toArray(IHeaderMatcher[]::new)));<NEW_LINE>reportConfiguration.setApprovedLicenseNames(approvedLicenses.stream().map(license -> {<NEW_LINE>SimpleLicenseFamily simpleLicenseFamily = new SimpleLicenseFamily();<NEW_LINE>simpleLicenseFamily.setFamilyName(license);<NEW_LINE>return simpleLicenseFamily;<NEW_LINE>}).toArray(SimpleLicenseFamily[]::new));<NEW_LINE>File repFile = getReportFile().getAsFile().get();<NEW_LINE>ClaimStatistic stats = generateReport(reportConfiguration, repFile);<NEW_LINE>boolean unknownLicenses = stats.getNumUnknown() > 0;<NEW_LINE>boolean unApprovedLicenses = stats.getNumUnApproved() > 0;<NEW_LINE>if (unknownLicenses || unApprovedLicenses) {<NEW_LINE>getLogger().error("The following files contain unapproved license headers:");<NEW_LINE>unapprovedFiles(repFile).stream().forEachOrdered(unapprovedFile -> getLogger().error(unapprovedFile));<NEW_LINE>throw new GradleException("Check failed. License header problems were found. Full details: " + repFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} | ("ALLZ4", "Apache LZ4-Java", "Copyright 2020 Adrien Grand and the lz4-java contributors")); |
869,246 | final ApplySecurityGroupsToClientVpnTargetNetworkResult executeApplySecurityGroupsToClientVpnTargetNetwork(ApplySecurityGroupsToClientVpnTargetNetworkRequest applySecurityGroupsToClientVpnTargetNetworkRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(applySecurityGroupsToClientVpnTargetNetworkRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ApplySecurityGroupsToClientVpnTargetNetworkRequest> request = null;<NEW_LINE>Response<ApplySecurityGroupsToClientVpnTargetNetworkResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ApplySecurityGroupsToClientVpnTargetNetworkRequestMarshaller().marshall(super.beforeMarshalling(applySecurityGroupsToClientVpnTargetNetworkRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ApplySecurityGroupsToClientVpnTargetNetwork");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ApplySecurityGroupsToClientVpnTargetNetworkResult> responseHandler = new StaxResponseHandler<ApplySecurityGroupsToClientVpnTargetNetworkResult>(new ApplySecurityGroupsToClientVpnTargetNetworkResultStaxUnmarshaller());<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,630,370 | public void calibrateZ(ReferenceNozzleTip nt) throws Exception {<NEW_LINE>if (nt != getCalibrationNozzleTip()) {<NEW_LINE>throw new Exception("Nozzle " + getName() + " has not nozzle tip " + nt.getName() + " loaded.");<NEW_LINE>}<NEW_LINE>if (nt == null) {<NEW_LINE>throw new Exception("Nozzle " + getName() + " has no nozzle tip loaded.");<NEW_LINE>}<NEW_LINE>Location nominalLocation = nt.getTouchLocation();<NEW_LINE>if (!nominalLocation.isInitialized()) {<NEW_LINE>throw new Exception("Nozzle tip " + nt.getName() + " has no touch location configured.");<NEW_LINE>}<NEW_LINE>resetZCalibration();<NEW_LINE>Location probedLocation = contactProbeCycle(nominalLocation);<NEW_LINE>Length offsetZ = nominalLocation.getLengthZ().subtract(probedLocation.getLengthZ());<NEW_LINE>Logger.debug("Nozzle " + getName() + " nozzle tip " + nt.<MASK><NEW_LINE>if (Math.abs(offsetZ.convertToUnits(LengthUnit.Millimeters).getValue()) > maxZOffsetMm) {<NEW_LINE>throw new Exception("Nozzle " + getName() + " nozzle tip " + nt.getName() + " Z calibration offset " + offsetZ + " unexpectedly large. Check setup.");<NEW_LINE>}<NEW_LINE>// Remember which nozzle tip for trigger control.<NEW_LINE>zCalibratedNozzleTip = nt;<NEW_LINE>// Establish the new Z calibration.<NEW_LINE>setCalibrationOffsetZ(offsetZ);<NEW_LINE>if (getNozzleTip() == null) {<NEW_LINE>// Store the special "naked" nozzle Z offset.<NEW_LINE>setUnloadedCalibrationOffsetZ(calibrationOffsetZ);<NEW_LINE>}<NEW_LINE>} | getName() + " Z calibration offset " + offsetZ); |
589,525 | final UpdateJobPriorityResult executeUpdateJobPriority(UpdateJobPriorityRequest updateJobPriorityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateJobPriorityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateJobPriorityRequest> request = null;<NEW_LINE>Response<UpdateJobPriorityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateJobPriorityRequestMarshaller().marshall(super.beforeMarshalling(updateJobPriorityRequest));<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, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateJobPriority");<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>ValidationUtils.assertStringNotEmpty(<MASK><NEW_LINE>HostnameValidator.validateHostnameCompliant(updateJobPriorityRequest.getAccountId(), "AccountId", "updateJobPriorityRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", updateJobPriorityRequest.getAccountId());<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateJobPriorityResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<UpdateJobPriorityResult>(new UpdateJobPriorityResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | updateJobPriorityRequest.getAccountId(), "AccountId"); |
1,522,314 | private void emptyCourtesyMeasure() {<NEW_LINE>MeasureStack lastStack = system.getLastStack();<NEW_LINE>Measure topMeasure = lastStack.getFirstMeasure();<NEW_LINE>// Check it is a short measure with no ending barline<NEW_LINE>if (topMeasure.getRightPartBarline() != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int minStandardWidth = system.getSheet().getScale(<MASK><NEW_LINE>if (topMeasure.getWidth() >= minStandardWidth) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check stack has one measure per part, otherwise simply remove this pseudo stack<NEW_LINE>if (lastStack.getMeasures().size() < system.getParts().size()) {<NEW_LINE>logger.info("Partial courtesy stack removed {}", lastStack);<NEW_LINE>system.removeStack(lastStack);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Min abscissa value for the stack<NEW_LINE>int minX = Integer.MAX_VALUE;<NEW_LINE>for (Staff staff : system.getStaves()) {<NEW_LINE>Measure measure = lastStack.getMeasureAt(staff);<NEW_LINE>minX = Math.min(minX, measure.getAbscissa(LEFT, staff));<NEW_LINE>}<NEW_LINE>// Look for heads in courtesy stack<NEW_LINE>for (Inter inter : system.getSig().inters(HeadInter.class)) {<NEW_LINE>if (inter.getCenter().x < minX) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>HeadInter head = (HeadInter) inter;<NEW_LINE>Part part = head.getPart();<NEW_LINE>Measure measure = part.getMeasureAt(head.getCenter());<NEW_LINE>if (measure.getStack() == lastStack) {<NEW_LINE>if (logger.isDebugEnabled() || head.isVip()) {<NEW_LINE>logger.info("Courtesy {} purging {}", lastStack, head);<NEW_LINE>}<NEW_LINE>head.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).toPixels(constants.minStandardWidth); |
1,717,331 | public static void updateWidget(Context context, AppWidgetManager manager, Song song, int state) {<NEW_LINE>if (!sEnabled)<NEW_LINE>return;<NEW_LINE>RemoteViews views = new RemoteViews(context.getPackageName(<MASK><NEW_LINE>if ((state & PlaybackService.FLAG_NO_MEDIA) != 0) {<NEW_LINE>views.setViewVisibility(R.id.play_pause, View.GONE);<NEW_LINE>views.setViewVisibility(R.id.next, View.GONE);<NEW_LINE>views.setViewVisibility(R.id.title, View.GONE);<NEW_LINE>views.setInt(R.id.artist, "setText", R.string.no_songs);<NEW_LINE>views.setViewVisibility(R.id.album, View.GONE);<NEW_LINE>} else if (song == null) {<NEW_LINE>views.setViewVisibility(R.id.play_pause, View.VISIBLE);<NEW_LINE>views.setViewVisibility(R.id.next, View.VISIBLE);<NEW_LINE>views.setViewVisibility(R.id.title, View.GONE);<NEW_LINE>views.setInt(R.id.artist, "setText", R.string.app_name);<NEW_LINE>views.setViewVisibility(R.id.album, View.GONE);<NEW_LINE>} else {<NEW_LINE>views.setViewVisibility(R.id.play_pause, View.VISIBLE);<NEW_LINE>views.setViewVisibility(R.id.next, View.VISIBLE);<NEW_LINE>views.setViewVisibility(R.id.title, View.VISIBLE);<NEW_LINE>views.setViewVisibility(R.id.album, View.VISIBLE);<NEW_LINE>views.setTextViewText(R.id.title, song.title);<NEW_LINE>views.setTextViewText(R.id.artist, song.artist);<NEW_LINE>views.setTextViewText(R.id.album, song.album);<NEW_LINE>Bitmap cover = song.getMediumCover(context);<NEW_LINE>if (cover == null) {<NEW_LINE>views.setImageViewResource(R.id.cover, R.drawable.fallback_cover_large);<NEW_LINE>} else {<NEW_LINE>views.setImageViewBitmap(R.id.cover, cover);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean playing = (state & PlaybackService.FLAG_PLAYING) != 0;<NEW_LINE>views.setImageViewResource(R.id.play_pause, playing ? R.drawable.pause : R.drawable.play);<NEW_LINE>Intent intent;<NEW_LINE>PendingIntent pendingIntent;<NEW_LINE>int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME;<NEW_LINE>intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN);<NEW_LINE>pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);<NEW_LINE>views.setOnClickPendingIntent(R.id.cover, pendingIntent);<NEW_LINE>views.setOnClickPendingIntent(R.id.text_layout, pendingIntent);<NEW_LINE>intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK);<NEW_LINE>pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);<NEW_LINE>views.setOnClickPendingIntent(R.id.play_pause, pendingIntent);<NEW_LINE>intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG);<NEW_LINE>pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);<NEW_LINE>views.setOnClickPendingIntent(R.id.next, pendingIntent);<NEW_LINE>manager.updateAppWidget(new ComponentName(context, FourLongWidget.class), views);<NEW_LINE>} | ), R.layout.four_long_widget); |
1,102,437 | public ArtifactConfigOutput unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ArtifactConfigOutput artifactConfigOutput = new ArtifactConfigOutput();<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("S3Encryption", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>artifactConfigOutput.setS3Encryption(S3EncryptionConfigJsonUnmarshaller.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 artifactConfigOutput;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,636,916 | public void registerMetrics(MeterRegistry registry) {<NEW_LINE>Gauge.builder(METRICS_GC_STARTED, metricValues, v -> v.getLastCollect().getStarted()).description("Timestamp GC file collection cycle started").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_FINISHED, metricValues, v -> v.getLastCollect().getFinished()).description("Timestamp GC file collect cycle finished").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_CANDIDATES, metricValues, v -> v.getLastCollect().getCandidates()).description("Number of files that are candidates for deletion").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_IN_USE, metricValues, v -> v.getLastCollect().getInUse()).description("Number of candidate files still in use").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_DELETED, metricValues, v -> v.getLastCollect().getDeleted()).description("Number of candidate files deleted").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_ERRORS, metricValues, v -> v.getLastCollect().getErrors()).description("Number of candidate deletion errors").register(registry);<NEW_LINE>// WAL metrics Gauges<NEW_LINE>Gauge.builder(METRICS_GC_WAL_STARTED, metricValues, v -> v.getLastWalCollect().getStarted()).description<MASK><NEW_LINE>Gauge.builder(METRICS_GC_WAL_FINISHED, metricValues, v -> v.getLastWalCollect().getFinished()).description("Timestamp GC WAL collect cycle finished").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_WAL_CANDIDATES, metricValues, v -> v.getLastWalCollect().getCandidates()).description("Number of files that are candidates for deletion").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_WAL_IN_USE, metricValues, v -> v.getLastWalCollect().getInUse()).description("Number of wal file candidates that are still in use").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_WAL_DELETED, metricValues, v -> v.getLastWalCollect().getDeleted()).description("Number of candidate wal files deleted").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_WAL_ERRORS, metricValues, v -> v.getLastWalCollect().getErrors()).description("Number candidate wal file deletion errors").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_POST_OP_DURATION, metricValues, v -> TimeUnit.NANOSECONDS.toMillis(v.getPostOpDurationNanos())).description("GC metadata table post operation duration in milliseconds").register(registry);<NEW_LINE>Gauge.builder(METRICS_GC_RUN_CYCLE, metricValues, GcCycleMetrics::getRunCycleCount).description("gauge incremented each gc cycle run, rest on process start").register(registry);<NEW_LINE>} | ("Timestamp GC WAL collection cycle started").register(registry); |
1,735,290 | public ApiResponse<ExtendedUser> usersPostWithHttpInfo(CreateUserRequest createUserRequest) throws ApiException {<NEW_LINE>Object localVarPostBody = createUserRequest;<NEW_LINE>// verify the required parameter 'createUserRequest' is set<NEW_LINE>if (createUserRequest == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'createUserRequest' when calling usersPost");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/users";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "text/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames <MASK><NEW_LINE>GenericType<ExtendedUser> localVarReturnType = new GenericType<ExtendedUser>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | = new String[] { "oauth2" }; |
1,411,481 | public void marshall(ControlMappingSource controlMappingSource, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (controlMappingSource == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(controlMappingSource.getSourceId(), SOURCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(controlMappingSource.getSourceName(), SOURCENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(controlMappingSource.getSourceSetUpOption(), SOURCESETUPOPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(controlMappingSource.getSourceType(), SOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(controlMappingSource.getSourceKeyword(), SOURCEKEYWORD_BINDING);<NEW_LINE>protocolMarshaller.marshall(controlMappingSource.getSourceFrequency(), SOURCEFREQUENCY_BINDING);<NEW_LINE>protocolMarshaller.marshall(controlMappingSource.getTroubleshootingText(), TROUBLESHOOTINGTEXT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | controlMappingSource.getSourceDescription(), SOURCEDESCRIPTION_BINDING); |
1,280,810 | final ClaimDevicesByClaimCodeResult executeClaimDevicesByClaimCode(ClaimDevicesByClaimCodeRequest claimDevicesByClaimCodeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(claimDevicesByClaimCodeRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ClaimDevicesByClaimCodeRequest> request = null;<NEW_LINE>Response<ClaimDevicesByClaimCodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ClaimDevicesByClaimCodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(claimDevicesByClaimCodeRequest));<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, "IoT 1Click Devices Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ClaimDevicesByClaimCode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ClaimDevicesByClaimCodeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ClaimDevicesByClaimCodeResultJsonUnmarshaller());<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(); |
402,630 | protected void appendDataWithoutCache(Key key, @Nonnull final BufferExposingByteArrayOutputStream bytes) {<NEW_LINE>myEnumerator.lockStorage();<NEW_LINE>try {<NEW_LINE>long previousRecord;<NEW_LINE>final int id;<NEW_LINE>if (myDirectlyStoreLongFileOffsetMode) {<NEW_LINE>previousRecord = ((PersistentBTreeEnumerator<Key>) myEnumerator).getNonNegativeValue(key);<NEW_LINE>id = -1;<NEW_LINE>} else {<NEW_LINE>id = enumerate(key);<NEW_LINE>previousRecord = readValueId(id);<NEW_LINE>}<NEW_LINE>long headerRecord = myValueStorage.appendBytes(<MASK><NEW_LINE>if (myDirectlyStoreLongFileOffsetMode) {<NEW_LINE>((PersistentBTreeEnumerator<Key>) myEnumerator).putNonNegativeValue(key, headerRecord);<NEW_LINE>} else {<NEW_LINE>updateValueId(id, headerRecord, previousRecord, key, 0);<NEW_LINE>}<NEW_LINE>if (previousRecord == NULL_ADDR) {<NEW_LINE>myLiveAndGarbageKeysCounter += LIVE_KEY_MASK;<NEW_LINE>}<NEW_LINE>if (bytes.getInternalBuffer().length <= MAX_RECYCLED_BUFFER_SIZE) {<NEW_LINE>// Avoid internal fragmentation by not retaining / reusing large append buffers (IDEA-208533)<NEW_LINE>myStreamPool.recycle(bytes);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>markCorrupted();<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>myEnumerator.unlockStorage();<NEW_LINE>}<NEW_LINE>} | bytes.toByteArraySequence(), previousRecord); |
918,892 | public InstanceInfo instanceConfig() {<NEW_LINE>String namespace = properties.getNamespace();<NEW_LINE>String itemId = properties.getItemId();<NEW_LINE>String port = environment.getProperty("server.port", "8080");<NEW_LINE>String applicationName = environment.getProperty("spring.dynamic.thread-pool.item-id");<NEW_LINE>String active = environment.getProperty("spring.profiles.active", "UNKNOWN");<NEW_LINE>InstanceInfo instanceInfo = new InstanceInfo();<NEW_LINE>String instanceId = CloudCommonIdUtil.getDefaultInstanceId(environment, hippo4JInetUtils);<NEW_LINE>instanceId = StrBuilder.create().append(instanceId).append(IDENTIFY_SLICER_SYMBOL).<MASK><NEW_LINE>String contextPath = environment.getProperty("server.servlet.context-path", "");<NEW_LINE>instanceInfo.setInstanceId(instanceId).setIpApplicationName(CloudCommonIdUtil.getIpApplicationName(environment, hippo4JInetUtils)).setHostName(InetAddress.getLocalHost().getHostAddress()).setAppName(applicationName).setPort(port).setClientBasePath(contextPath).setGroupKey(ContentUtil.getGroupKey(itemId, namespace));<NEW_LINE>String callBackUrl = new StringBuilder().append(instanceInfo.getHostName()).append(":").append(port).append(instanceInfo.getClientBasePath()).toString();<NEW_LINE>instanceInfo.setCallBackUrl(callBackUrl);<NEW_LINE>String identify = IdentifyUtil.generate(environment, hippo4JInetUtils);<NEW_LINE>instanceInfo.setIdentify(identify);<NEW_LINE>instanceInfo.setActive(active.toUpperCase());<NEW_LINE>return instanceInfo;<NEW_LINE>} | append(CLIENT_IDENTIFICATION_VALUE).toString(); |
483,423 | public void bindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder) {<NEW_LINE>if (viewHolder instanceof ArticleTravelVH) {<NEW_LINE>final ArticleTravelVH holder = (ArticleTravelVH) viewHolder;<NEW_LINE>final String url = TravelArticle.getImageUrl(article.getImageTitle(), false);<NEW_LINE>Boolean loaded = picasso.isURLLoaded(url);<NEW_LINE>RequestCreator rc = Picasso.get().load(url);<NEW_LINE>WikivoyageUtils.setupNetworkPolicy(app.getSettings(), rc);<NEW_LINE>rc.transform(new CropCircleTransformation()).into(holder.icon, new Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess() {<NEW_LINE>holder.icon.setVisibility(View.VISIBLE);<NEW_LINE>picasso.setResultLoaded(url, true);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Exception e) {<NEW_LINE>holder.icon.setVisibility(View.GONE);<NEW_LINE>picasso.setResultLoaded(url, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>holder.icon.setVisibility(loaded == null || loaded.booleanValue() ? View.VISIBLE : View.GONE);<NEW_LINE>holder.title.setText(article.getTitle());<NEW_LINE>holder.content.setText(WikiArticleHelper.getPartialContent(article.getContent()));<NEW_LINE>holder.partOf.setText(article.getGeoDescription());<NEW_LINE>holder.leftButton.setText(app.getString(R.string.shared_string_read));<NEW_LINE>View.OnClickListener readClickListener = new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>if (fragmentManager != null) {<NEW_LINE>WikivoyageArticleDialogFragment.showInstance(app, fragmentManager, article.generateIdentifier(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>holder.leftButton.setOnClickListener(readClickListener);<NEW_LINE>holder.itemView.setOnClickListener(readClickListener);<NEW_LINE>holder.leftButton.setCompoundDrawablesWithIntrinsicBounds(readIcon, null, null, null);<NEW_LINE>updateSaveButton(holder);<NEW_LINE>holder.divider.setVisibility(isLastItem ? View.GONE : View.VISIBLE);<NEW_LINE>holder.shadow.setVisibility(isLastItem ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>} | ), article.getLang()); |
80,536 | public void init() {<NEW_LINE>DefaultDateMetadata disabled = DefaultDateMetadata.builder().disabled(true).styleClass("tst-disabled").build();<NEW_LINE>DefaultDateMetadata begin = DefaultDateMetadata.builder().styleClass("tst-begin").build();<NEW_LINE>DefaultDateMetadata end = DefaultDateMetadata.builder().styleClass("tst-end").build();<NEW_LINE>LocalDate start = LocalDate.now().withDayOfMonth(1);<NEW_LINE>model = new DefaultDateMetadataModel();<NEW_LINE>// 2nd of previous month<NEW_LINE>model.add(start.minusMonths(1).plusDays(1), disabled);<NEW_LINE>// 1st of this month<NEW_LINE>model.add(start, disabled);<NEW_LINE>// 3rd of next month<NEW_LINE>model.add(start.plusMonths(1).plusDays(2), disabled);<NEW_LINE>// 2nd of this month<NEW_LINE>model.add(start.plusDays(1), begin);<NEW_LINE>// 3rd of this month<NEW_LINE>model.add(start.plusDays(2), end);<NEW_LINE>modelLazy = new LazyDateMetadataModel() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void loadDateMetadata(LocalDate d1, LocalDate d2) {<NEW_LINE>LocalDate start = LocalDate.now().withDayOfMonth(1);<NEW_LINE>// 2nd of previous month<NEW_LINE>add(start.minusMonths(1).plusDays(1), disabled);<NEW_LINE>// 1st of this month<NEW_LINE>add(start, disabled);<NEW_LINE>// 3rd of next month<NEW_LINE>add(start.plusMonths(1)<MASK><NEW_LINE>// 2nd of this month<NEW_LINE>add(start.plusDays(1), begin);<NEW_LINE>// 3rd of this month<NEW_LINE>add(start.plusDays(2), end);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | .plusDays(2), disabled); |
1,520,485 | private List<Cctop901991V> createCctop901991VList(final List<EDICctop901991VType> xmlCctop901991VList, final DecimalFormat decimalFormat) {<NEW_LINE>final List<Cctop901991V> cctop901991VList = new ArrayList<>();<NEW_LINE>for (final EDICctop901991VType xmlCctop901991V : xmlCctop901991VList) {<NEW_LINE>final Cctop901991V cctop901991V = new Cctop901991V();<NEW_LINE>cctop901991V.setcInvoiceID(formatNumber(xmlCctop901991V.getCInvoiceID(), decimalFormat));<NEW_LINE>cctop901991V.setRate(xmlCctop901991V.getRate());<NEW_LINE>cctop901991V.setTaxAmt(xmlCctop901991V.getTaxAmt());<NEW_LINE>cctop901991V.setTaxBaseAmt(xmlCctop901991V.getTaxBaseAmt());<NEW_LINE>cctop901991V.setTotalAmt(xmlCctop901991V.getTotalAmt());<NEW_LINE>cctop901991V.setESRNumber(xmlCctop901991V.getReferenceNo());<NEW_LINE>if (xmlCctop901991V.getTaxAmt() != null && xmlCctop901991V.getTaxBaseAmt() != null) {<NEW_LINE>final BigDecimal taxSum = xmlCctop901991V.getTaxAmt().<MASK><NEW_LINE>cctop901991V.setTaxAmtSumTaxBaseAmt(taxSum);<NEW_LINE>}<NEW_LINE>cctop901991VList.add(cctop901991V);<NEW_LINE>}<NEW_LINE>return cctop901991VList;<NEW_LINE>} | add(xmlCctop901991V.getTaxBaseAmt()); |
1,333,526 | public static void main(String[] args) {<NEW_LINE>int[] array = { -4, -1, 1, 2, 2, 2, 2, 2, 2, 2, 4, 5 };<NEW_LINE>Exercise23_BinarySearchWithDuplicates exercise23_binarySearchWithDuplicates = new Exercise23_BinarySearchWithDuplicates();<NEW_LINE>// First rank tests<NEW_LINE>int firstRankElement1 = exercise23_binarySearchWithDuplicates.firstRank(array, -4);<NEW_LINE>int firstRankElement2 = exercise23_binarySearchWithDuplicates.firstRank(array, -8);<NEW_LINE>int firstRankElement3 = <MASK><NEW_LINE>int firstRankElement4 = exercise23_binarySearchWithDuplicates.firstRank(array, 2);<NEW_LINE>StdOut.println("First index of element -4: " + firstRankElement1 + " Expected: 0");<NEW_LINE>StdOut.println("First index of element -8: " + firstRankElement2 + " Expected: -1");<NEW_LINE>StdOut.println("First index of element 5: " + firstRankElement3 + " Expected: 11");<NEW_LINE>StdOut.println("First index of element 2: " + firstRankElement4 + " Expected: 3");<NEW_LINE>// Last rank tests<NEW_LINE>int firstRankElement5 = exercise23_binarySearchWithDuplicates.lastRank(array, -4);<NEW_LINE>int firstRankElement6 = exercise23_binarySearchWithDuplicates.lastRank(array, -8);<NEW_LINE>int firstRankElement7 = exercise23_binarySearchWithDuplicates.lastRank(array, 5);<NEW_LINE>int firstRankElement8 = exercise23_binarySearchWithDuplicates.lastRank(array, 2);<NEW_LINE>StdOut.println("First index of element -4: " + firstRankElement5 + " Expected: 0");<NEW_LINE>StdOut.println("First index of element -8: " + firstRankElement6 + " Expected: -1");<NEW_LINE>StdOut.println("First index of element 5: " + firstRankElement7 + " Expected: 11");<NEW_LINE>StdOut.println("First index of element 2: " + firstRankElement8 + " Expected: 9");<NEW_LINE>} | exercise23_binarySearchWithDuplicates.firstRank(array, 5); |
25,636 | public DeviceMinutes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeviceMinutes deviceMinutes = new DeviceMinutes();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("total", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deviceMinutes.setTotal(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("metered", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deviceMinutes.setMetered(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("unmetered", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deviceMinutes.setUnmetered(context.getUnmarshaller(Double.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deviceMinutes;<NEW_LINE>} | class).unmarshall(context)); |
588,689 | void handleTimeout() throws VpnNetworkException {<NEW_LINE>if (!this.enabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Timber.d("handleTimeout: Milliseconds elapsed between last receive and sent: %dms", (this<MASK><NEW_LINE>// Receive really timed out<NEW_LINE>if (this.lastPacketReceived < this.lastPacketSent && this.lastPacketSent != 0) {<NEW_LINE>this.initPenalty += INIT_PENALTY_INC;<NEW_LINE>if (this.initPenalty > INIT_PENALTY_END) {<NEW_LINE>this.initPenalty = INIT_PENALTY_END;<NEW_LINE>}<NEW_LINE>throw new VpnNetworkException("Watchdog timed out");<NEW_LINE>}<NEW_LINE>// We received a packet after sending it, so we can be more confident and grow our wait time<NEW_LINE>this.pollTimeout *= POLL_TIMEOUT_GROW;<NEW_LINE>if (this.pollTimeout > POLL_TIMEOUT_END) {<NEW_LINE>this.pollTimeout = POLL_TIMEOUT_END;<NEW_LINE>}<NEW_LINE>sendPacket();<NEW_LINE>} | .lastPacketReceived - this.lastPacketSent)); |
267,869 | public void zoomToBoundingBox(final BoundingBoxE6 boundingBox) {<NEW_LINE>final BoundingBoxE6 currentBox = getBoundingBox();<NEW_LINE>// Calculated required zoom based on latitude span<NEW_LINE>final double maxZoomLatitudeSpan = mZoomLevel == getMaxZoomLevel() ? currentBox.getLatitudeSpanE6() : currentBox.getLatitudeSpanE6() / Math.pow(2, getMaxZoomLevel() - mZoomLevel);<NEW_LINE>final double requiredLatitudeZoom = getMaxZoomLevel() - Math.ceil(Math.log(boundingBox.getLatitudeSpanE6() / maxZoomLatitudeSpan) / Math.log(2));<NEW_LINE>// Calculated required zoom based on longitude span<NEW_LINE>final double maxZoomLongitudeSpan = mZoomLevel == getMaxZoomLevel() ? currentBox.getLongitudeSpanE6() : currentBox.getLongitudeSpanE6() / Math.pow(<MASK><NEW_LINE>final double requiredLongitudeZoom = getMaxZoomLevel() - Math.ceil(Math.log(boundingBox.getLongitudeSpanE6() / maxZoomLongitudeSpan) / Math.log(2));<NEW_LINE>// Zoom to boundingBox center, at calculated maximum allowed zoom level<NEW_LINE>getController().setZoom((int) (requiredLatitudeZoom < requiredLongitudeZoom ? requiredLatitudeZoom : requiredLongitudeZoom));<NEW_LINE>getController().setCenter(new GeoPoint(boundingBox.getCenter().getLatitudeE6(), boundingBox.getCenter().getLongitudeE6()));<NEW_LINE>} | 2, getMaxZoomLevel() - mZoomLevel); |
1,276,567 | public List<OrderAttachmentRow> buildRowsFor(@NonNull final AttachmentEntry attachmentEntry) {<NEW_LINE>final TableRecordReference purchaseOrderRecordRef = TableRecordReference.of(I_C_Order.<MASK><NEW_LINE>final Set<TableRecordReference> matchingRecordReferences = attachmentEntry.getLinkedRecords().stream().filter(tableRecordReference -> !tableRecordReference.equals(purchaseOrderRecordRef)).filter(targetRecordReferences::contains).collect(ImmutableSet.toImmutableSet());<NEW_LINE>final Priority highestPriorityFound = matchingRecordReferences.stream().map(TableRecordReference::getTableName).map(tableName2PriorityRowBuilder::get).filter(Objects::nonNull).map(PriorityRowBuilder::getPriority).max(Priority::compareTo).orElse(Priority.NO_PRIORITY);<NEW_LINE>final ImmutableList.Builder<OrderAttachmentRow> attachmentRows = ImmutableList.builder();<NEW_LINE>if (highestPriorityFound.equals(Priority.NO_PRIORITY)) {<NEW_LINE>return attachmentRows.add(purchaseOrderRowBuilder.apply(attachmentEntry)).build();<NEW_LINE>}<NEW_LINE>for (final TableRecordReference linkedRecord : matchingRecordReferences) {<NEW_LINE>Optional.ofNullable(tableName2PriorityRowBuilder.get(linkedRecord.getTableName())).filter(priorityRowBuilder -> priorityRowBuilder.getPriority().equals(highestPriorityFound)).map(PriorityRowBuilder::getBuildRowFunction).map(buildFunction -> buildFunction.apply(linkedRecord, attachmentEntry)).ifPresent(attachmentRows::add);<NEW_LINE>}<NEW_LINE>return attachmentRows.build();<NEW_LINE>} | Table_Name, purchaseOrderId.getRepoId()); |
1,519,007 | private void refreshKeys() {<NEW_LINE>List<HudsonJob> jobs = new ArrayList<HudsonJob>();<NEW_LINE>HudsonView view = instance.getPrimaryView();<NEW_LINE>String selectedView = instance.prefs().get(SELECTED_VIEW, null);<NEW_LINE>if (selectedView != null) {<NEW_LINE>for (HudsonView v : instance.getViews()) {<NEW_LINE>if (v.getName().equals(selectedView)) {<NEW_LINE>view = v;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (HudsonJob job : instance.getJobs()) {<NEW_LINE>if (!job.getViews().contains(view)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>jobs.add(job);<NEW_LINE>}<NEW_LINE>Collections.sort(jobs);<NEW_LINE>List<Union2<HudsonJob, HudsonFolder>> items = new LinkedList<Union2<HudsonJob, HudsonFolder>>();<NEW_LINE>for (HudsonFolder folder : instance.getFolders()) {<NEW_LINE>// XXX ideally should restrict by selected view, like jobs<NEW_LINE>items.add(Union2.<HudsonJob, HudsonFolder>createSecond(folder));<NEW_LINE>}<NEW_LINE>for (HudsonJob job : jobs) {<NEW_LINE>items.add(Union2.<HudsonJob<MASK><NEW_LINE>}<NEW_LINE>setKeys(items);<NEW_LINE>} | , HudsonFolder>createFirst(job)); |
563,959 | public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>if (additionalProperties.containsKey("modelNamePrefix")) {<NEW_LINE>supportingFiles.clear();<NEW_LINE>supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "Helpers.h"));<NEW_LINE>supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "Helpers.cpp"));<NEW_LINE>supportingFiles.add(new SupportingFile("object.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "Object.h"));<NEW_LINE>supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder <MASK><NEW_LINE>supportingFiles.add(new SupportingFile("HttpFileElement.h.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "HttpFileElement.h"));<NEW_LINE>supportingFiles.add(new SupportingFile("HttpFileElement.cpp.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "HttpFileElement.cpp"));<NEW_LINE>supportingFiles.add(new SupportingFile("apirouter.h.mustache", sourceFolder + APIHANDLER_DIR, modelNamePrefix + "ApiRouter.h"));<NEW_LINE>supportingFiles.add(new SupportingFile("apirouter.cpp.mustache", sourceFolder + APIHANDLER_DIR, modelNamePrefix + "ApiRouter.cpp"));<NEW_LINE>supportingFiles.add(new SupportingFile("main.cpp.mustache", sourceFolder + SRC_DIR, "main.cpp"));<NEW_LINE>supportingFiles.add(new SupportingFile("src-CMakeLists.txt.mustache", sourceFolder + SRC_DIR, "CMakeLists.txt"));<NEW_LINE>supportingFiles.add(new SupportingFile("README.md.mustache", sourceFolder, "README.MD"));<NEW_LINE>supportingFiles.add(new SupportingFile("Makefile.mustache", sourceFolder, "Makefile"));<NEW_LINE>supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt"));<NEW_LINE>supportingFiles.add(new SupportingFile("Dockerfile.mustache", sourceFolder, "Dockerfile"));<NEW_LINE>supportingFiles.add(new SupportingFile("LICENSE.txt.mustache", sourceFolder, "LICENSE.txt"));<NEW_LINE>typeMapping.put("file", modelNamePrefix + "HttpFileElement");<NEW_LINE>importMapping.put(modelNamePrefix + "HttpFileElement", "#include \"" + modelNamePrefix + "HttpFileElement.h\"");<NEW_LINE>}<NEW_LINE>} | + MODEL_DIR, modelNamePrefix + "Enum.h")); |
1,189,206 | public void check(Database database, DatabaseChangeLog changeLog, ChangeSet changeSet, ChangeExecListener changeExecListener) throws PreconditionFailedException, PreconditionErrorException {<NEW_LINE>CustomPrecondition customPrecondition;<NEW_LINE>try {<NEW_LINE>// System.out.println(classLoader.toString());<NEW_LINE>try {<NEW_LINE>customPrecondition = (CustomPrecondition) Class.forName(className, true, Scope.getCurrentScope().getClassLoader()).getConstructor().newInstance();<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>// fails in Ant in particular<NEW_LINE>customPrecondition = (CustomPrecondition) Class.forName(className).getConstructor().newInstance();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new PreconditionFailedException("Could not open custom precondition class " + className, changeLog, this);<NEW_LINE>}<NEW_LINE>for (String param : params) {<NEW_LINE>try {<NEW_LINE>ObjectUtil.setProperty(customPrecondition, param, paramValues.get(param));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new PreconditionFailedException("Error setting parameter " + param + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>customPrecondition.check(database);<NEW_LINE>} catch (CustomPreconditionFailedException e) {<NEW_LINE>throw new PreconditionFailedException(new FailedPrecondition("Custom Precondition Failed: " + e.getMessage(), changeLog, this));<NEW_LINE>} catch (CustomPreconditionErrorException e) {<NEW_LINE>throw new PreconditionErrorException(new ErrorPrecondition(e, changeLog, this));<NEW_LINE>}<NEW_LINE>} | " on custom precondition " + className, changeLog, this); |
96,206 | void propagate_parentage_alternate_(Treap aet, int treeNode, int edge, int leftEdge, int twinEdge, int edgeChain, int edgeChainParent, int twinHalfEdgeChain) {<NEW_LINE>// Now do specific sweep calculations<NEW_LINE>// This one is done when we are doing a topological operation.<NEW_LINE><MASK><NEW_LINE>int geometryID = getGeometryID(geometry);<NEW_LINE>if (leftEdge == -1) {<NEW_LINE>// no left edge neighbour means the twin chain is surrounded by the<NEW_LINE>// universe<NEW_LINE>assert (getChainParent(twinHalfEdgeChain) == m_universeChain);<NEW_LINE>assert (getChainParentage(twinHalfEdgeChain) == 0 || getChainParentage(twinHalfEdgeChain) == m_universe_geomID);<NEW_LINE>assert (getChainParentage(edgeChain) == 0);<NEW_LINE>setChainParentage_(twinHalfEdgeChain, m_universe_geomID);<NEW_LINE>int parity = getHalfEdgeUserIndex(edge, m_tmpHalfEdgeOddEvenNumberIndex);<NEW_LINE>if ((parity & 1) != 0)<NEW_LINE>// set the parenentage<NEW_LINE>setChainParentage_(edgeChain, geometryID);<NEW_LINE>else<NEW_LINE>// from the parity<NEW_LINE>// this chain<NEW_LINE>setChainParentage_(edgeChain, m_universe_geomID);<NEW_LINE>// does not<NEW_LINE>// belong to<NEW_LINE>// geometry<NEW_LINE>} else {<NEW_LINE>int twin_parentage = getChainParentage(twinHalfEdgeChain);<NEW_LINE>if (twin_parentage == 0) {<NEW_LINE>int leftEdgeChain = getHalfEdgeChain(leftEdge);<NEW_LINE>int left_parentage = getChainParentage(leftEdgeChain);<NEW_LINE>setChainParentage_(twinHalfEdgeChain, left_parentage);<NEW_LINE>int parity = getHalfEdgeUserIndex(edge, m_tmpHalfEdgeOddEvenNumberIndex);<NEW_LINE>if ((parity & 1) != 0)<NEW_LINE>setChainParentage_(edgeChain, (left_parentage == geometryID) ? m_universe_geomID : geometryID);<NEW_LINE>else<NEW_LINE>setChainParentage_(edgeChain, left_parentage);<NEW_LINE>} else {<NEW_LINE>int parity = getHalfEdgeUserIndex(edge, m_tmpHalfEdgeOddEvenNumberIndex);<NEW_LINE>if ((parity & 1) != 0)<NEW_LINE>setChainParentage_(edgeChain, (twin_parentage == geometryID) ? m_universe_geomID : geometryID);<NEW_LINE>else<NEW_LINE>setChainParentage_(edgeChain, twin_parentage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int geometry = m_shape.getFirstGeometry(); |
1,514,976 | public static void processAnnotation(LoggingFramework framework, AnnotationValues<? extends java.lang.annotation.Annotation> annotation, Annotation source, EclipseNode annotationNode) {<NEW_LINE>EclipseNode owner = annotationNode.up();<NEW_LINE>switch(owner.getKind()) {<NEW_LINE>case TYPE:<NEW_LINE>IdentifierName logFieldName = annotationNode.getAst().readConfiguration(ConfigurationKeys.LOG_ANY_FIELD_NAME);<NEW_LINE>if (logFieldName == null)<NEW_LINE>logFieldName = LOG;<NEW_LINE>boolean useStatic = !Boolean.FALSE.equals(annotationNode.getAst()<MASK><NEW_LINE>TypeDeclaration typeDecl = null;<NEW_LINE>if (owner.get() instanceof TypeDeclaration)<NEW_LINE>typeDecl = (TypeDeclaration) owner.get();<NEW_LINE>int modifiers = typeDecl == null ? 0 : typeDecl.modifiers;<NEW_LINE>boolean notAClass = (modifiers & (ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation)) != 0;<NEW_LINE>if (typeDecl == null || notAClass) {<NEW_LINE>annotationNode.addError(framework.getAnnotationAsString() + " is legal only on classes and enums.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fieldExists(logFieldName.getName(), owner) != MemberExistsResult.NOT_EXISTS) {<NEW_LINE>annotationNode.addWarning("Field '" + logFieldName + "' already exists.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isRecord(owner) && !useStatic) {<NEW_LINE>annotationNode.addError("Logger fields must be static in records.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (useStatic && !isStaticAllowed(owner)) {<NEW_LINE>annotationNode.addError(framework.getAnnotationAsString() + " is not supported on non-static nested classes.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object valueGuess = annotation.getValueGuess("topic");<NEW_LINE>Expression loggerTopic = (Expression) annotation.getActualExpression("topic");<NEW_LINE>if (valueGuess instanceof String && ((String) valueGuess).trim().isEmpty())<NEW_LINE>loggerTopic = null;<NEW_LINE>if (framework.getDeclaration().getParametersWithTopic() == null && loggerTopic != null) {<NEW_LINE>annotationNode.addError(framework.getAnnotationAsString() + " does not allow a topic.");<NEW_LINE>loggerTopic = null;<NEW_LINE>}<NEW_LINE>if (framework.getDeclaration().getParametersWithoutTopic() == null && loggerTopic == null) {<NEW_LINE>annotationNode.addError(framework.getAnnotationAsString() + " requires a topic.");<NEW_LINE>loggerTopic = new StringLiteral(new char[] {}, 0, 0, 0);<NEW_LINE>}<NEW_LINE>ClassLiteralAccess loggingType = selfType(owner, source);<NEW_LINE>FieldDeclaration fieldDeclaration = createField(framework, source, loggingType, logFieldName.getName(), useStatic, loggerTopic);<NEW_LINE>fieldDeclaration.traverse(new SetGeneratedByVisitor(source), typeDecl.staticInitializerScope);<NEW_LINE>// TODO temporary workaround for issue 290. https://github.com/projectlombok/lombok/issues/290<NEW_LINE>// injectFieldSuppressWarnings(owner, fieldDeclaration);<NEW_LINE>injectField(owner, fieldDeclaration);<NEW_LINE>owner.rebuild();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | .readConfiguration(ConfigurationKeys.LOG_ANY_FIELD_IS_STATIC)); |
564,383 | public static void main(String[] args) throws IOException {<NEW_LINE>Cmd cmd = MainUtils.parseArguments(args, FLAGS);<NEW_LINE>if (cmd.argsLength() < 2) {<NEW_LINE>MainUtils.printHelpArgs(FLAGS, new String[] { "input.wav", "output.wav" });<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>WavFile wavFile = new WavInput.WavFile(new File(cmd.getArg(0)));<NEW_LINE>WavOutFile wavOutFile = new WavOutput.WavOutFile(new File(cmd.getArg(1)), wavFile.getFormat());<NEW_LINE>WavInput.Source source = new WavInput.Source(wavFile);<NEW_LINE>WavOutput.Sink sink = new WavOutput.Sink(wavOutFile);<NEW_LINE>int dB = cmd.getIntegerFlagD(FLAG_LEVEL, -22);<NEW_LINE>if (dB > -15 || dB < -90) {<NEW_LINE>System.out.println("Impractical noise level of: " + dB + ", exiting!");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>// @formatter:off<NEW_LINE>AudioFilter filter = FilterGraph.addLevel(new ChannelSplit(source.getFormat())).addLevelSpan(new NoiseFilter(dB)).addLevel(new ChannelMerge[] { new ChannelMerge(source.getFormat()) }).create();<NEW_LINE>// @formatter:on<NEW_LINE>Audio.<MASK><NEW_LINE>source.close();<NEW_LINE>sink.close();<NEW_LINE>} | filterTransfer(source, filter, sink); |
1,585,872 | protected Bundle doInBackground(Bundle... params) {<NEW_LINE>String verifier = params[0].getString(PARAM_VERIFIER);<NEW_LINE>Bundle result = new Bundle();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>HttpsURLConnection httpsURLConnection = (HttpsURLConnection) url.openConnection();<NEW_LINE>httpsURLConnection.setRequestMethod("POST");<NEW_LINE>httpsURLConnection.setDoInput(true);<NEW_LINE>httpsURLConnection.setDoOutput(true);<NEW_LINE>OutputStreamWriter outputStreamWriter = new OutputStreamWriter(httpsURLConnection.getOutputStream());<NEW_LINE>outputStreamWriter.write("client_id=" + mClientId + "&client_secret=" + mClientSecret + "&grant_type=authorization_code" + "&redirect_uri=" + mRedirectURL + "&code=" + verifier);<NEW_LINE>outputStreamWriter.flush();<NEW_LINE>String response = streamToString(httpsURLConnection.getInputStream());<NEW_LINE>JSONObject jsonObject = (JSONObject) new JSONTokener(response).nextValue();<NEW_LINE>String accessToken = jsonObject.getString("access_token");<NEW_LINE>String id = jsonObject.getJSONObject("user").getString("id");<NEW_LINE>result.putString(RESULT_ACCESS_TOKEN, accessToken);<NEW_LINE>result.putString(RESULT_REQUEST_TOKEN, verifier);<NEW_LINE>result.putString(RESULT_USER_ID, id);<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.putString(RESULT_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | URL url = new URL(mTokenURLString); |
1,808,293 | public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) {<NEW_LINE>super.visitMethodInsn(opcode, owner, name, descriptor, isInterface);<NEW_LINE>// if current instruction is a call to ASM ClassWriter.toByteArray() insert call to<NEW_LINE>// our lambda transformer<NEW_LINE>if (opcode == Opcodes.INVOKEVIRTUAL && "toByteArray".equals(name) && "()[B".equals(descriptor)) {<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 0);<NEW_LINE>mv.visitFieldInsn(Opcodes.GETFIELD, slashClassName, "lambdaClassName", "Ljava/lang/String;");<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 0);<NEW_LINE>// targetClass is used to get the ClassLoader where lambda class will be defined<NEW_LINE>mv.visitFieldInsn(Opcodes.GETFIELD, slashClassName, "targetClass", "Ljava/lang/Class;");<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(LambdaTransformer.class<MASK><NEW_LINE>}<NEW_LINE>} | ), "transform", "([BLjava/lang/String;Ljava/lang/Class;)[B", false); |
1,223,814 | public String renderMessage(ChatInstance chat, ChatMessage message) {<NEW_LINE>List<StyleRange> ranges = new ArrayList<>();<NEW_LINE>String msg = BuddyPluginViewBetaChat.renderMessage(null, chat, message, message.getMessage(), message.getMessageType(), 0, ranges, null, null, null, null);<NEW_LINE>StringBuilder new_msg = new StringBuilder();<NEW_LINE>int pos = 0;<NEW_LINE>for (StyleRange range : ranges) {<NEW_LINE>Object data = range.data;<NEW_LINE>if (range.underline && data instanceof String) {<NEW_LINE>int start = range.start;<NEW_LINE>int length = range.length;<NEW_LINE>String link_text = msg.<MASK><NEW_LINE>String link_url = (String) data;<NEW_LINE>if (start > pos) {<NEW_LINE>new_msg.append(msg, pos, start);<NEW_LINE>}<NEW_LINE>new_msg.append("<A HREF=\"" + link_url + "\">" + link_text + "</A>");<NEW_LINE>pos = start + length;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos == 0) {<NEW_LINE>return (msg);<NEW_LINE>} else {<NEW_LINE>if (pos < msg.length()) {<NEW_LINE>new_msg.append(msg.substring(pos));<NEW_LINE>}<NEW_LINE>return (new_msg.toString());<NEW_LINE>}<NEW_LINE>} | substring(start, start + length); |
381,388 | final ResumeSessionResult executeResumeSession(ResumeSessionRequest resumeSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(resumeSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ResumeSessionRequest> request = null;<NEW_LINE>Response<ResumeSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ResumeSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(resumeSessionRequest));<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");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ResumeSession");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ResumeSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ResumeSessionResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime); |
341,742 | public LibvirtVMDef createVMFromSpec(final VirtualMachineTO vmTO) {<NEW_LINE>s_logger.debug(String.format("Creating VM from specifications [%s]", vmTO.toString()));<NEW_LINE>LibvirtVMDef vm = new LibvirtVMDef();<NEW_LINE>vm.setDomainName(vmTO.getName());<NEW_LINE>String uuid = vmTO.getUuid();<NEW_LINE>uuid = getUuid(uuid);<NEW_LINE>vm.setDomUUID(uuid);<NEW_LINE>vm.setDomDescription(vmTO.getOs());<NEW_LINE>vm.setPlatformEmulator(vmTO.getPlatformEmulator());<NEW_LINE>Map<String, String> customParams = vmTO.getDetails();<NEW_LINE>boolean isUefiEnabled = false;<NEW_LINE>boolean isSecureBoot = false;<NEW_LINE>String bootMode = null;<NEW_LINE>if (MapUtils.isNotEmpty(customParams) && customParams.containsKey(GuestDef.BootType.UEFI.toString())) {<NEW_LINE>isUefiEnabled = true;<NEW_LINE>s_logger.debug(String.format("Enabled UEFI for VM UUID [%s].", uuid));<NEW_LINE>if (isSecureMode(customParams.get(GuestDef.BootType.UEFI.toString()))) {<NEW_LINE>s_logger.debug(String.format("Enabled Secure Boot for VM UUID [%s].", uuid));<NEW_LINE>isSecureBoot = true;<NEW_LINE>}<NEW_LINE>bootMode = customParams.get(GuestDef.BootType.UEFI.toString());<NEW_LINE>}<NEW_LINE>Map<String, String> extraConfig = vmTO.getExtraConfig();<NEW_LINE>if (dpdkSupport && (!extraConfig.containsKey(DpdkHelper.DPDK_NUMA) || !extraConfig.containsKey(DpdkHelper.DPDK_HUGE_PAGES))) {<NEW_LINE>s_logger.info(String.format("DPDK is enabled for VM [%s], but it needs extra configurations for CPU NUMA and Huge Pages for VM deployment."<MASK><NEW_LINE>}<NEW_LINE>configureVM(vmTO, vm, customParams, isUefiEnabled, isSecureBoot, bootMode, extraConfig, uuid);<NEW_LINE>return vm;<NEW_LINE>} | , vmTO.toString())); |
1,348,433 | public void mergeKnownValuesWith(IsNullValueFrame otherFrame) {<NEW_LINE>assert trackValueNumbers;<NEW_LINE>if (IsNullValueAnalysis.DEBUG) {<NEW_LINE><MASK><NEW_LINE>System.out.println(" " + this);<NEW_LINE>System.out.println(" with" + otherFrame);<NEW_LINE>}<NEW_LINE>Map<ValueNumber, IsNullValue> replaceMap = new HashMap<ValueNumber, IsNullValue>();<NEW_LINE>for (Map.Entry<ValueNumber, IsNullValue> entry : knownValueMap.entrySet()) {<NEW_LINE>IsNullValue otherKnownValue = otherFrame.knownValueMap.get(entry.getKey());<NEW_LINE>if (otherKnownValue == null) {<NEW_LINE>if (IsNullValueAnalysis.DEBUG) {<NEW_LINE>System.out.println("No match for " + entry.getKey());<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>IsNullValue mergedValue = IsNullValue.merge(entry.getValue(), otherKnownValue);<NEW_LINE>replaceMap.put(entry.getKey(), mergedValue);<NEW_LINE>if (IsNullValueAnalysis.DEBUG && !mergedValue.equals(entry.getValue())) {<NEW_LINE>System.out.println("Updated information for " + entry.getKey());<NEW_LINE>System.out.println(" was " + entry.getValue());<NEW_LINE>System.out.println(" merged value " + mergedValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>knownValueMap.clear();<NEW_LINE>knownValueMap.putAll(replaceMap);<NEW_LINE>if (IsNullValueAnalysis.DEBUG) {<NEW_LINE>System.out.println("resulting in " + this);<NEW_LINE>}<NEW_LINE>} | System.out.println("merge"); |
1,615,500 | final UpdateSubnetChangeProtectionResult executeUpdateSubnetChangeProtection(UpdateSubnetChangeProtectionRequest updateSubnetChangeProtectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSubnetChangeProtectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSubnetChangeProtectionRequest> request = null;<NEW_LINE>Response<UpdateSubnetChangeProtectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSubnetChangeProtectionRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Network Firewall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSubnetChangeProtection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSubnetChangeProtectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSubnetChangeProtectionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(updateSubnetChangeProtectionRequest)); |
1,542,792 | public void registerMap() {<NEW_LINE>// 0 - Particle ID<NEW_LINE>map(Type.INT);<NEW_LINE>// 1 - Long Distance<NEW_LINE>map(Type.BOOLEAN);<NEW_LINE>// 2 - X<NEW_LINE>map(Type.FLOAT, Type.DOUBLE);<NEW_LINE>// 3 - Y<NEW_LINE>map(Type.FLOAT, Type.DOUBLE);<NEW_LINE>// 4 - Z<NEW_LINE>map(Type.FLOAT, Type.DOUBLE);<NEW_LINE>// 5 - Offset X<NEW_LINE>map(Type.FLOAT);<NEW_LINE>// 6 - Offset Y<NEW_LINE>map(Type.FLOAT);<NEW_LINE>// 7 - Offset Z<NEW_LINE>map(Type.FLOAT);<NEW_LINE>// 8 - Particle Data<NEW_LINE>map(Type.FLOAT);<NEW_LINE>// 9 - Particle Count<NEW_LINE>map(Type.INT);<NEW_LINE>handler(new PacketHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(PacketWrapper wrapper) throws Exception {<NEW_LINE>int id = wrapper.get(Type.INT, 0);<NEW_LINE>if (id == 3 || id == 23) {<NEW_LINE>int data = wrapper.passthrough(Type.VAR_INT);<NEW_LINE>wrapper.set(Type.VAR_INT, 0, protocol.getMappingData().getNewBlockStateId(data));<NEW_LINE>} else if (id == 32) {<NEW_LINE>protocol.getItemRewriter().handleItemToClient(wrapper<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .passthrough(Type.FLAT_VAR_INT_ITEM)); |
325,511 | public ResetPersonalPINResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ResetPersonalPINResult resetPersonalPINResult = new ResetPersonalPINResult();<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 resetPersonalPINResult;<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("User", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resetPersonalPINResult.setUser(UserJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resetPersonalPINResult;<NEW_LINE>} | ().unmarshall(context)); |
1,819,360 | public int[] findMatchingBlock(int offset, boolean simpleSearch) throws BadLocationException {<NEW_LINE>int[] r_value = null;<NEW_LINE>TokenItem token = getItemAtOrBefore((offset < getDocument().getLength()) ? offset + 1 : offset);<NEW_LINE>if (token != null) {<NEW_LINE>// do we need to match jsp comment?<NEW_LINE>if (token.getTokenID() == JspTagTokenContext.COMMENT) {<NEW_LINE>return findMatchingJspComment(token, offset);<NEW_LINE>}<NEW_LINE>// Is it matching of scriptlet delimiters?<NEW_LINE>if (token.getTokenContextPath().contains(JspTagTokenContext.contextPath) && token.getTokenID().getNumericID() == JspTagTokenContext.SYMBOL2_ID) {<NEW_LINE>return findMatchingScripletDelimiter(token);<NEW_LINE>}<NEW_LINE>// Try to match the tags.<NEW_LINE>if (token.getTokenContextPath().contains(JspTagTokenContext.contextPath)) {<NEW_LINE>return findMatchingTag(token);<NEW_LINE>} else {<NEW_LINE>if (isScriptingOrContentToken(token)) {<NEW_LINE>useCustomBracketFinder = false;<NEW_LINE>} else {<NEW_LINE>useCustomBracketFinder = true;<NEW_LINE>}<NEW_LINE>r_value = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return r_value;<NEW_LINE>} | super.findMatchingBlock(offset, simpleSearch); |
889,281 | private static FunctionEx<Iterable<Object[]>, Traverser<Object[]>> joinFn(@Nonnull JetJoinInfo joinInfo, @Nonnull IMap<Object, Object> map, @Nonnull KvRowProjector.Supplier rightRowProjectorSupplier, @Nonnull ExpressionEvalContext context) {<NEW_LINE>Projection<Entry<Object, Object>, Object[]> projection = QueryUtil.toProjection(rightRowProjectorSupplier);<NEW_LINE>return lefts -> {<NEW_LINE>List<Object[]> rights = new ArrayList<>();<NEW_LINE>// TODO it would be nice if we executed the project() with the predicate that the rightRowProjector<NEW_LINE>// uses, maybe the majority of rows are rejected. In general it's good to do filtering as closely to the<NEW_LINE>// source as possible. However, the predicate has state. Without a state the predicate will have to<NEW_LINE>// create QueryTargets and extractors for each row.<NEW_LINE>// current rules pull projects up, hence project() cardinality won't be greater than the source's<NEW_LINE>// changing the rules might require revisiting<NEW_LINE>for (Object[] right : map.project(projection)) {<NEW_LINE>if (right != null) {<NEW_LINE>rights.add(right);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Object[]> <MASK><NEW_LINE>for (Object[] left : lefts) {<NEW_LINE>boolean joined = join(rows, left, rights, joinInfo.condition(), context);<NEW_LINE>if (!joined && joinInfo.isLeftOuter()) {<NEW_LINE>rows.add(extendArray(left, rightRowProjectorSupplier.columnCount()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return traverseIterable(rows);<NEW_LINE>};<NEW_LINE>} | rows = new ArrayList<>(); |
1,445,912 | public ScenarioRuntime handleUpload(JobChunk<ScenarioRuntime> chunk, File upload) {<NEW_LINE>ScenarioRuntime runtime = chunk.getValue();<NEW_LINE>File jsonFile = JobUtils.getFirstFileMatching(upload, n -> n<MASK><NEW_LINE>if (jsonFile == null) {<NEW_LINE>logger.warn("no karate json found in job executor result");<NEW_LINE>return runtime;<NEW_LINE>}<NEW_LINE>String json = FileUtils.toString(jsonFile);<NEW_LINE>Map<String, Object> map = Json.of(json).asMap();<NEW_LINE>FeatureResult fr = FeatureResult.fromKarateJson(runtime.featureRuntime.suite.workingDir, map);<NEW_LINE>if (fr.getScenarioResults().isEmpty()) {<NEW_LINE>logger.warn("executor feature result is empty");<NEW_LINE>return runtime;<NEW_LINE>}<NEW_LINE>Optional<ScenarioResult> optional = fr.getScenarioResults().stream().filter(sr -> !sr.getStepResults().isEmpty()).findFirst();<NEW_LINE>if (!optional.isPresent()) {<NEW_LINE>logger.warn("executor scenario result is empty");<NEW_LINE>return runtime;<NEW_LINE>}<NEW_LINE>ScenarioResult sr = optional.get();<NEW_LINE>sr.setExecutorName(chunk.getExecutorId());<NEW_LINE>sr.setStartTime(chunk.getStartTime());<NEW_LINE>sr.setEndTime(System.currentTimeMillis());<NEW_LINE>synchronized (runtime.featureRuntime) {<NEW_LINE>runtime.featureRuntime.result.addResult(sr);<NEW_LINE>}<NEW_LINE>String reportDir = runtime.featureRuntime.suite.reportDir;<NEW_LINE>for (File file : fr.getAllEmbedFiles()) {<NEW_LINE>File dest = new File(reportDir + File.separator + file.getName());<NEW_LINE>FileUtils.copy(file, dest);<NEW_LINE>}<NEW_LINE>File videoFile = JobUtils.getFirstFileMatching(upload, n -> n.endsWith("karate.mp4"));<NEW_LINE>if (videoFile != null) {<NEW_LINE>StepResult stepResult = sr.addFakeStepResult("[video]", null);<NEW_LINE>Embed embed = runtime.saveToFileAndCreateEmbed(FileUtils.toBytes(videoFile), ResourceType.MP4);<NEW_LINE>stepResult.addEmbed(embed);<NEW_LINE>}<NEW_LINE>return runtime;<NEW_LINE>} | .endsWith(Constants.KARATE_JSON_SUFFIX)); |
1,127,399 | public SRenderEnginePluginConfiguration convertToSObject(RenderEnginePluginConfiguration input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SRenderEnginePluginConfiguration result = new SRenderEnginePluginConfiguration();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setName(input.getName());<NEW_LINE>result.setEnabled(input.getEnabled());<NEW_LINE>result.setDescription(input.getDescription());<NEW_LINE>PluginDescriptor pluginDescriptorVal = input.getPluginDescriptor();<NEW_LINE>result.setPluginDescriptorId(pluginDescriptorVal == null ? -1 : pluginDescriptorVal.getOid());<NEW_LINE>ObjectType settingsVal = input.getSettings();<NEW_LINE>result.setSettingsId(settingsVal == null ? -<MASK><NEW_LINE>List<Long> listserializers = new ArrayList<Long>();<NEW_LINE>for (SerializerPluginConfiguration v : input.getSerializers()) {<NEW_LINE>listserializers.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setSerializers(listserializers);<NEW_LINE>UserSettings userSettingsVal = input.getUserSettings();<NEW_LINE>result.setUserSettingsId(userSettingsVal == null ? -1 : userSettingsVal.getOid());<NEW_LINE>return result;<NEW_LINE>} | 1 : settingsVal.getOid()); |
216,679 | private Expr rewriteWhereClause(Expr expr, CompoundPredicate predicate, List<PartitionRange.PartitionSingle> newRangeList) {<NEW_LINE>if (expr == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!(expr instanceof CompoundPredicate)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if (expr.equals(predicate)) {<NEW_LINE>if (newRangeList == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>getPartitionRange().rewritePredicate((CompoundPredicate) expr, newRangeList);<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < expr.getChildren().size(); i++) {<NEW_LINE>Expr child = rewriteWhereClause(expr.getChild<MASK><NEW_LINE>if (child == null) {<NEW_LINE>expr.removeNode(i);<NEW_LINE>i--;<NEW_LINE>} else {<NEW_LINE>expr.setChild(i, child);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (expr.getChildren().size() == 0) {<NEW_LINE>return null;<NEW_LINE>} else if (expr.getChildren().size() == 1) {<NEW_LINE>return expr.getChild(0);<NEW_LINE>} else {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>} | (i), predicate, newRangeList); |
757,688 | public AgentConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AgentConfiguration agentConfiguration = new AgentConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("agentParameters", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>agentConfiguration.setAgentParameters(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("periodInSeconds", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>agentConfiguration.setPeriodInSeconds(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("shouldProfile", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>agentConfiguration.setShouldProfile(context.getUnmarshaller(Boolean.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 agentConfiguration;<NEW_LINE>} | class).unmarshall(context)); |
888,829 | private void addV3OnionServicesToTorrc(StringBuffer torrc, ContentResolver contentResolver) {<NEW_LINE>try {<NEW_LINE>var onionServices = contentResolver.query(V3_ONION_SERVICES_CONTENT_URI, V3_ONION_SERVICE_PROJECTION, OnionService.ENABLED + "=1", null, null);<NEW_LINE>if (onionServices != null) {<NEW_LINE>while (onionServices.moveToNext()) {<NEW_LINE>var id = onionServices.getInt(onionServices.getColumnIndex(OnionService._ID));<NEW_LINE>var localPort = onionServices.getInt(onionServices.getColumnIndex(OnionService.PORT));<NEW_LINE>var onionPort = onionServices.getInt(onionServices.getColumnIndex(OnionService.ONION_PORT));<NEW_LINE>var path = onionServices.getString(onionServices.getColumnIndex(OnionService.PATH));<NEW_LINE>var domain = onionServices.getString(onionServices.getColumnIndex(OnionService.DOMAIN));<NEW_LINE>if (path == null) {<NEW_LINE>path = "v3";<NEW_LINE>if (domain == null)<NEW_LINE>path += UUID.randomUUID().toString();<NEW_LINE>else<NEW_LINE>path += localPort;<NEW_LINE>var cv = new ContentValues();<NEW_LINE>cv.put(OnionService.PATH, path);<NEW_LINE>contentResolver.update(V3_ONION_SERVICES_CONTENT_URI, cv, OnionService._ID + "=" + id, null);<NEW_LINE>}<NEW_LINE>var v3DirPath = new File(mV3OnionBasePath.getAbsolutePath(), path).getCanonicalPath();<NEW_LINE>torrc.append("HiddenServiceDir ").append(v3DirPath).append("\n");<NEW_LINE>torrc.append("HiddenServiceVersion 3").append("\n");<NEW_LINE>torrc.append("HiddenServicePort ").append(onionPort).append(" 127.0.0.1:").append(localPort).append("\n");<NEW_LINE>}<NEW_LINE>onionServices.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(<MASK><NEW_LINE>}<NEW_LINE>} | TAG, e.getLocalizedMessage()); |
1,688,557 | public List<CallLogEntry> readCallLog() {<NEW_LINE>if (instrumentation.getTargetContext().checkCallingOrSelfPermission(Manifest.permission.READ_CALL_LOG) == PackageManager.PERMISSION_GRANTED) {<NEW_LINE>List<CallLogEntry> logs = new ArrayList<CallLogEntry>();<NEW_LINE>Cursor managedCursor = instrumentation.getTargetContext().getContentResolver().query(CallLog.Calls.CONTENT_URI, null, null, null, null);<NEW_LINE>int number = managedCursor.getColumnIndex(CallLog.Calls.NUMBER);<NEW_LINE>int type = managedCursor.getColumnIndex(CallLog.Calls.TYPE);<NEW_LINE>int date = managedCursor.getColumnIndex(CallLog.Calls.DATE);<NEW_LINE>int duration = managedCursor.getColumnIndex(CallLog.Calls.DURATION);<NEW_LINE>while (managedCursor.moveToNext()) {<NEW_LINE>String phNumber = managedCursor.getString(number);<NEW_LINE>String <MASK><NEW_LINE>String callDate = managedCursor.getString(date);<NEW_LINE>Date callDayTime = new Date(Long.valueOf(callDate));<NEW_LINE>String callDuration = managedCursor.getString(duration);<NEW_LINE>logs.add(new CallLogEntry(phNumber, Integer.parseInt(callDuration), callDayTime, Integer.parseInt(callType)));<NEW_LINE>}<NEW_LINE>managedCursor.close();<NEW_LINE>return logs;<NEW_LINE>} else {<NEW_LINE>throw new PermissionDeniedException("Application under test does not have required READ_CALL_LOG permission for this feature.");<NEW_LINE>}<NEW_LINE>} | callType = managedCursor.getString(type); |
991,917 | public RecommendedOptionProjectedMetric unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RecommendedOptionProjectedMetric recommendedOptionProjectedMetric = new RecommendedOptionProjectedMetric();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("recommendedInstanceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendedOptionProjectedMetric.setRecommendedInstanceType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("rank", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendedOptionProjectedMetric.setRank(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("projectedMetrics", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendedOptionProjectedMetric.setProjectedMetrics(new ListUnmarshaller<ProjectedMetric>(ProjectedMetricJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return recommendedOptionProjectedMetric;<NEW_LINE>} | )).unmarshall(context)); |
514,621 | private void patchTimerImplementation() {<NEW_LINE>SootClass sc = Scene.v().getSootClassUnsafe("java.util.Timer");<NEW_LINE>if (sc == null || sc.resolvingLevel() < SootClass.SIGNATURES)<NEW_LINE>return;<NEW_LINE>sc.setLibraryClass();<NEW_LINE>SootMethod smSchedule1 = sc.getMethodUnsafe("void schedule(java.util.TimerTask,long)");<NEW_LINE>if (smSchedule1 != null && !smSchedule1.hasActiveBody()) {<NEW_LINE>patchTimerScheduleMethod(smSchedule1);<NEW_LINE>smSchedule1.addTag(new FlowDroidEssentialMethodTag());<NEW_LINE>}<NEW_LINE>SootMethod smSchedule2 = sc.getMethodUnsafe("void schedule(java.util.TimerTask,java.util.Date)");<NEW_LINE>if (smSchedule2 != null && !smSchedule2.hasActiveBody()) {<NEW_LINE>patchTimerScheduleMethod(smSchedule2);<NEW_LINE>smSchedule2.addTag(new FlowDroidEssentialMethodTag());<NEW_LINE>}<NEW_LINE>SootMethod smSchedule3 = sc.getMethodUnsafe("void schedule(java.util.TimerTask,java.util.Date,long)");<NEW_LINE>if (smSchedule3 != null && !smSchedule3.hasActiveBody()) {<NEW_LINE>patchTimerScheduleMethod(smSchedule3);<NEW_LINE>smSchedule3.addTag(new FlowDroidEssentialMethodTag());<NEW_LINE>}<NEW_LINE>SootMethod smSchedule4 = sc.getMethodUnsafe("void schedule(java.util.TimerTask,long,long)");<NEW_LINE>if (smSchedule4 != null && !smSchedule4.hasActiveBody()) {<NEW_LINE>patchTimerScheduleMethod(smSchedule4);<NEW_LINE>smSchedule4.addTag(new FlowDroidEssentialMethodTag());<NEW_LINE>}<NEW_LINE>SootMethod smSchedule5 = sc.getMethodUnsafe("void scheduleAtFixedRate(java.util.TimerTask,java.util.Date,long)");<NEW_LINE>if (smSchedule5 != null && !smSchedule5.hasActiveBody()) {<NEW_LINE>patchTimerScheduleMethod(smSchedule5);<NEW_LINE>smSchedule5<MASK><NEW_LINE>}<NEW_LINE>SootMethod smSchedule6 = sc.getMethodUnsafe("void scheduleAtFixedRate(java.util.TimerTask,long,long)");<NEW_LINE>if (smSchedule6 != null && !smSchedule6.hasActiveBody()) {<NEW_LINE>patchTimerScheduleMethod(smSchedule6);<NEW_LINE>smSchedule6.addTag(new FlowDroidEssentialMethodTag());<NEW_LINE>}<NEW_LINE>} | .addTag(new FlowDroidEssentialMethodTag()); |
1,032,224 | protected void instanceCallbackInfo(final Callback callback, String id, String desc, boolean store) {<NEW_LINE>this.lastId = id;<NEW_LINE>this.lastDesc = desc;<NEW_LINE>this.callbackInfoVar = callback.marshalVar();<NEW_LINE>this.callbackInfoClass = callback.target.getCallbackInfoClass();<NEW_LINE>// If we were going to store the CI anyway, and if we need it again, and if the current injection isn't at<NEW_LINE>// return or cancellable, inject the CI creation at the method head so that it's available everywhere<NEW_LINE>boolean head = store && this.totalInjections > 1 && !callback.isAtReturn && !this.cancellable;<NEW_LINE>callback.add(new TypeInsnNode(Opcodes.NEW, this.callbackInfoClass), true, !store, head);<NEW_LINE>callback.add(new InsnNode(Opcodes.DUP), true, true, head);<NEW_LINE>callback.add(new LdcInsnNode(id), true, !store, head);<NEW_LINE>callback.add(new InsnNode(this.cancellable ? Opcodes.ICONST_1 : Opcodes.ICONST_0)<MASK><NEW_LINE>if (callback.isAtReturn) {<NEW_LINE>callback.add(new VarInsnNode(callback.target.returnType.getOpcode(Opcodes.ILOAD), callback.marshalVar()), true, !store);<NEW_LINE>callback.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, this.callbackInfoClass, Constants.CTOR, desc, false));<NEW_LINE>} else {<NEW_LINE>callback.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, this.callbackInfoClass, Constants.CTOR, desc, false), false, false, head);<NEW_LINE>}<NEW_LINE>if (store) {<NEW_LINE>callback.target.addLocalVariable(this.callbackInfoVar, "callbackInfo" + this.callbackInfoVar, "L" + this.callbackInfoClass + ";");<NEW_LINE>callback.add(new VarInsnNode(Opcodes.ASTORE, this.callbackInfoVar), false, false, head);<NEW_LINE>}<NEW_LINE>} | , true, !store, head); |
759,818 | public void updateCommandAttributes(Command cmd, IFactory factory) {<NEW_LINE>parser().updateSeparator(interpolator.interpolate(cmd.separator()));<NEW_LINE>updateExitCodeOnSuccess(cmd.exitCodeOnSuccess());<NEW_LINE>updateExitCodeOnUsageHelp(cmd.exitCodeOnUsageHelp());<NEW_LINE>updateExitCodeOnVersionHelp(cmd.exitCodeOnVersionHelp());<NEW_LINE>updateExitCodeOnInvalidInput(cmd.exitCodeOnInvalidInput());<NEW_LINE>updateExitCodeOnExecutionException(cmd.exitCodeOnExecutionException());<NEW_LINE>aliases(cmd.aliases());<NEW_LINE>updateName(cmd.name());<NEW_LINE>updateVersion(cmd.version());<NEW_LINE>updateHelpCommand(cmd.helpCommand());<NEW_LINE>updateSubcommandsRepeatable(cmd.subcommandsRepeatable());<NEW_LINE><MASK><NEW_LINE>usageMessage().updateFromCommand(cmd, this, factory != null);<NEW_LINE>updateScopeType(cmd.scope());<NEW_LINE>if (factory != null) {<NEW_LINE>updateModelTransformer(cmd.modelTransformer(), factory);<NEW_LINE>updateVersionProvider(cmd.versionProvider(), factory);<NEW_LINE>initDefaultValueProvider(cmd.defaultValueProvider(), factory);<NEW_LINE>updatePreprocessor(cmd.preprocessor(), factory);<NEW_LINE>}<NEW_LINE>} | updateAddMethodSubcommands(cmd.addMethodSubcommands()); |
1,190,956 | private void generateMovements() {<NEW_LINE>log.info("DD_Order_ID=" + m_DD_Order_ID);<NEW_LINE>log.info("MovementDate" + m_MovementDate);<NEW_LINE>String trxName = Trx.createTrxName("IOG");<NEW_LINE>// trx needs to be committed too<NEW_LINE>Trx trx = Trx.get(trxName, true);<NEW_LINE>// prevents from being called twice<NEW_LINE>m_selectionActive = false;<NEW_LINE>statusBar.setStatusLine(Msg.translate(Env.getCtx(), "M_Movement_ID"));<NEW_LINE>statusBar.setStatusDB(String.valueOf(selection.size()));<NEW_LINE>if (selection.size() <= 0)<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>Timestamp MovementDate = (Timestamp) m_MovementDate;<NEW_LINE>MDDOrder order = new MDDOrder(m_ctx, Integer.parseInt(m_DD_Order_ID.toString()), trxName);<NEW_LINE>MMovement movement = new MMovement(m_ctx, 0, trxName);<NEW_LINE>movement.setDD_Order_ID(order.getDD_Order_ID());<NEW_LINE>movement.setAD_User_ID(order.getAD_User_ID());<NEW_LINE>movement.setPOReference(order.getPOReference());<NEW_LINE>movement.setReversal_ID(0);<NEW_LINE>movement.setM_Shipper_ID(order.getM_Shipper_ID());<NEW_LINE>movement.setDescription(order.getDescription());<NEW_LINE>movement.setC_BPartner_ID(order.getC_BPartner_ID());<NEW_LINE>movement.setC_BPartner_Location_ID(order.getC_BPartner_Location_ID());<NEW_LINE>movement.setAD_Org_ID(order.getAD_Org_ID());<NEW_LINE>movement.setAD_OrgTrx_ID(order.getAD_OrgTrx_ID());<NEW_LINE>movement.setAD_User_ID(order.getAD_User_ID());<NEW_LINE>movement.setC_Activity_ID(order.getC_Activity_ID());<NEW_LINE>movement.setC_Campaign_ID(order.getC_Campaign_ID());<NEW_LINE>movement.setC_Project_ID(order.getC_Project_ID());<NEW_LINE>movement.setMovementDate(MovementDate);<NEW_LINE>movement.setDeliveryRule(order.getDeliveryRule());<NEW_LINE>movement.setDeliveryViaRule(order.getDeliveryViaRule());<NEW_LINE>movement.setDocAction(MMovement.ACTION_Prepare);<NEW_LINE>movement.setDocStatus(MMovement.DOCSTATUS_Drafted);<NEW_LINE>// Look the document type for the organization<NEW_LINE>int docTypeDO_ID = getDocType(MDocType.DOCBASETYPE_MaterialMovement, order.getAD_Org_ID());<NEW_LINE>if (docTypeDO_ID > 0)<NEW_LINE>movement.setC_DocType_ID(docTypeDO_ID);<NEW_LINE>movement.saveEx();<NEW_LINE>for (int i = 0; i < selection.size(); i++) {<NEW_LINE>int DD_OrderLine_ID = selection.get(i);<NEW_LINE>MDDOrderLine oline = new MDDOrderLine(m_ctx, DD_OrderLine_ID, trxName);<NEW_LINE>MMovementLine line = new MMovementLine(movement);<NEW_LINE>line.setM_Product_ID(oline.getM_Product_ID());<NEW_LINE>BigDecimal QtyDeliver = (BigDecimal) miniTable.getValueAt(i, 1);<NEW_LINE>if (QtyDeliver == null | QtyDeliver.compareTo(oline.getQtyInTransit()) > 0)<NEW_LINE>throw new AdempiereException("Error in Qty");<NEW_LINE>line.setOrderLine(oline, QtyDeliver, true);<NEW_LINE>line.saveEx();<NEW_LINE>}<NEW_LINE>movement.setDocAction(MMovement.DOCACTION_Close);<NEW_LINE>movement.setDocStatus(movement.completeIt());<NEW_LINE>movement.saveEx();<NEW_LINE>trx.commit();<NEW_LINE>generateMovements_complete(movement);<NEW_LINE>//<NEW_LINE>} | Properties m_ctx = Env.getCtx(); |
1,110,033 | public Expr apply(Expr expr, Analyzer analyzer, ExprRewriter.ClauseType clauseType) throws AnalysisException {<NEW_LINE>SlotRef queryColumnSlotRef;<NEW_LINE>Column mvColumn;<NEW_LINE>// meet the condition<NEW_LINE>if (!(expr instanceof FunctionCallExpr)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>FunctionCallExpr fnExpr = (FunctionCallExpr) expr;<NEW_LINE>String fnNameString = fnExpr.getFnName().getFunction();<NEW_LINE>if (!fnNameString.equalsIgnoreCase("hll_union") && !fnNameString.equalsIgnoreCase("hll_raw_agg") && !fnNameString.equalsIgnoreCase("hll_union_agg")) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if (!(fnExpr.getChild(0) instanceof FunctionCallExpr)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>FunctionCallExpr child0FnExpr = (FunctionCallExpr) fnExpr.getChild(0);<NEW_LINE>if (!child0FnExpr.getFnName().getFunction().equalsIgnoreCase("hll_hash")) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if (child0FnExpr.getChild(0) instanceof SlotRef) {<NEW_LINE>queryColumnSlotRef = (SlotRef) child0FnExpr.getChild(0);<NEW_LINE>} else if (child0FnExpr.getChild(0) instanceof CastExpr) {<NEW_LINE>CastExpr castExpr = (CastExpr) child0FnExpr.getChild(0);<NEW_LINE>if (!(castExpr.getChild(0) instanceof SlotRef)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>queryColumnSlotRef = (<MASK><NEW_LINE>} else {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>Column column = queryColumnSlotRef.getColumn();<NEW_LINE>Table table = queryColumnSlotRef.getTable();<NEW_LINE>if (column == null || table == null || !(table instanceof OlapTable)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>OlapTable olapTable = (OlapTable) table;<NEW_LINE>// check column<NEW_LINE>String queryColumnName = column.getName();<NEW_LINE>String mvColumnName = CreateMaterializedViewStmt.mvColumnBuilder(AggregateType.HLL_UNION.name().toLowerCase(), queryColumnName);<NEW_LINE>mvColumn = olapTable.getVisibleColumn(mvColumnName);<NEW_LINE>if (mvColumn == null) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>// equal expr<NEW_LINE>return rewriteExpr(fnNameString, queryColumnSlotRef, mvColumn, analyzer);<NEW_LINE>} | SlotRef) castExpr.getChild(0); |
490,388 | public void init() throws ServletException {<NEW_LINE>format = getServletConfig().getInitParameter("outputFormat");<NEW_LINE>if (format == null || format.trim().isEmpty()) {<NEW_LINE>throw new ServletException("Invalid outputFormat setting.");<NEW_LINE>}<NEW_LINE>String spacingStr = getServletConfig().getInitParameter("preserveSpacing");<NEW_LINE>if (spacingStr == null || spacingStr.trim().isEmpty()) {<NEW_LINE>throw new ServletException("Invalid preserveSpacing setting.");<NEW_LINE>}<NEW_LINE>// spacing = Boolean.valueOf(spacingStr).booleanValue();<NEW_LINE>spacingStr = spacingStr.trim().toLowerCase();<NEW_LINE>spacing = "true".equals(spacingStr);<NEW_LINE>String path = getServletContext().getRealPath("/WEB-INF/data/models");<NEW_LINE>for (String classifier : new File(path).list()) {<NEW_LINE>classifiers.add(classifier);<NEW_LINE>}<NEW_LINE>// TODO: get this from somewhere more interesting?<NEW_LINE>defaultClassifier = classifiers.get(0);<NEW_LINE>for (String classifier : classifiers) {<NEW_LINE>log(classifier);<NEW_LINE>}<NEW_LINE>ners = new HashMap<>();<NEW_LINE>for (String classifier : classifiers) {<NEW_LINE>CRFClassifier<CoreMap> model = null;<NEW_LINE>String filename = "/WEB-INF/data/models/" + classifier;<NEW_LINE>InputStream is = getServletConfig().getServletContext().getResourceAsStream(filename);<NEW_LINE>if (is == null) {<NEW_LINE>throw new ServletException("File not found. Filename = " + filename);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (filename.endsWith(".gz")) {<NEW_LINE>is = new BufferedInputStream(new GZIPInputStream(is));<NEW_LINE>} else {<NEW_LINE>is = new BufferedInputStream(is);<NEW_LINE>}<NEW_LINE>model = CRFClassifier.getClassifier(is);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ServletException("IO problem reading classifier.");<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>throw new ServletException("Classifier class casting problem.");<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new ServletException("Classifier class not found problem.");<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeIgnoringExceptions(is);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | ners.put(classifier, model); |
1,248,656 | public static byte[] digest(char[] plainBytes, byte[] salt, String algorithm, int iteration, int length) throws InvalidPasswordCipherException {<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.fine("algorithm : " + algorithm + " iteration : " + iteration);<NEW_LINE>logger.fine("input length: " + plainBytes.length);<NEW_LINE>logger.fine("salt length: " + salt.length);<NEW_LINE>logger.fine("output length: " + length);<NEW_LINE>}<NEW_LINE>byte[] oBytes = null;<NEW_LINE>if (plainBytes != null && plainBytes.length > 0 && algorithm != null && algorithm.length() > 0 && iteration > 0) {<NEW_LINE>long begin = 0;<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>begin = System.nanoTime();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SecretKeyFactory skf = SecretKeyFactory.getInstance(algorithm);<NEW_LINE>PBEKeySpec ks = new PBEKeySpec(plainBytes, salt, iteration, length);<NEW_LINE>SecretKey s = skf.generateSecret(ks);<NEW_LINE>oBytes = s.getEncoded();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw (InvalidPasswordCipherException) new InvalidPasswordCipherException(e.getMessage()).initCause(e);<NEW_LINE>}<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>long elapsed <MASK><NEW_LINE>// debug<NEW_LINE>logger.fine("Elapsed time : " + elapsed + " ns " + (elapsed / 1000000) + " ms");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((logger.isLoggable(Level.FINE)) && oBytes != null) {<NEW_LINE>logger.fine("digest length: " + oBytes.length);<NEW_LINE>logger.fine(hexDump(oBytes));<NEW_LINE>}<NEW_LINE>return oBytes;<NEW_LINE>} | = System.nanoTime() - begin; |
1,074,711 | final DescribeJobResult executeDescribeJob(DescribeJobRequest describeJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeJobRequest> request = null;<NEW_LINE>Response<DescribeJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeJobRequest));<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, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeJobResultJsonUnmarshaller());<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); |
481,747 | private static void addWebXmlOAuthArtifacts(FileObject ddFo, String parentClassName, String packageName) throws IOException {<NEW_LINE>// NOI18N<NEW_LINE>String[] servletNames = new String[] { "OAuthLoginServlet", "OAuthCallbackServlet" };<NEW_LINE>// NOI18N<NEW_LINE>String[] urlPatterns = new String[] { "/OAuthLogin", "/OAuthCallback" };<NEW_LINE>WebApp webApp = DDProvider.<MASK><NEW_LINE>if (webApp != null) {<NEW_LINE>for (int i = 0; i < servletNames.length; i++) {<NEW_LINE>String servletName = parentClassName + "$" + servletNames[i];<NEW_LINE>String className = packageName + "." + servletName;<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>Servlet servlet = (Servlet) webApp.createBean("Servlet");<NEW_LINE>servlet.setServletName(servletName);<NEW_LINE>servlet.setServletClass(className);<NEW_LINE>// NOI18N<NEW_LINE>ServletMapping25 servletMapping = (ServletMapping25) webApp.createBean("ServletMapping");<NEW_LINE>servletMapping.setServletName(servletName);<NEW_LINE>servletMapping.addUrlPattern(urlPatterns[i]);<NEW_LINE>webApp.addServlet(servlet);<NEW_LINE>webApp.addServletMapping(servletMapping);<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>webApp.write(ddFo);<NEW_LINE>}<NEW_LINE>} | getDefault().getDDRoot(ddFo); |
560,312 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {<NEW_LINE>CommonLayoutParams.adjustChildrenLayoutParams(this, widthMeasureSpec, heightMeasureSpec);<NEW_LINE>int measureWidth = 0;<NEW_LINE>int measureHeight = 0;<NEW_LINE>int width = MeasureSpec.getSize(widthMeasureSpec);<NEW_LINE>int widthMode = MeasureSpec.getMode(widthMeasureSpec);<NEW_LINE>int height = MeasureSpec.getSize(heightMeasureSpec);<NEW_LINE>int heightMode = MeasureSpec.getMode(heightMeasureSpec);<NEW_LINE>int verticalPadding = this.getPaddingTop() + this.getPaddingBottom();<NEW_LINE>int horizontalPadding = this.getPaddingLeft() + this.getPaddingRight();<NEW_LINE>int remainingWidth = widthMode == MeasureSpec.UNSPECIFIED ? 0 : width - horizontalPadding;<NEW_LINE>int remainingHeight = heightMode == MeasureSpec.UNSPECIFIED ? 0 : height - verticalPadding;<NEW_LINE>int tempHeight = 0;<NEW_LINE>int tempWidth = 0;<NEW_LINE>int childWidthMeasureSpec = 0;<NEW_LINE>int childHeightMeasureSpec = 0;<NEW_LINE>int count = this.getChildCount();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>View child = this.getChildAt(i);<NEW_LINE>if (child.getVisibility() == View.GONE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (this._stretchLastChild && (i == (count - 1))) {<NEW_LINE>childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(remainingWidth, widthMode);<NEW_LINE>childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(remainingHeight, heightMode);<NEW_LINE>} else {<NEW_LINE>// Measure children with AT_MOST even if our mode is EXACT<NEW_LINE>childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(remainingWidth, widthMode == MeasureSpec.EXACTLY ? MeasureSpec.AT_MOST : widthMode);<NEW_LINE>childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(remainingHeight, heightMode == MeasureSpec.EXACTLY ? MeasureSpec.AT_MOST : heightMode);<NEW_LINE>}<NEW_LINE>CommonLayoutParams.measureChild(child, childWidthMeasureSpec, childHeightMeasureSpec);<NEW_LINE>final int childMeasuredWidth = CommonLayoutParams.getDesiredWidth(child);<NEW_LINE>final int childMeasuredHeight = CommonLayoutParams.getDesiredHeight(child);<NEW_LINE>CommonLayoutParams childLayoutParams = (CommonLayoutParams) child.getLayoutParams();<NEW_LINE>Dock dock = childLayoutParams.dock;<NEW_LINE>switch(dock) {<NEW_LINE>case top:<NEW_LINE>case bottom:<NEW_LINE>remainingHeight = Math.max(0, remainingHeight - childMeasuredHeight);<NEW_LINE>tempHeight += childMeasuredHeight;<NEW_LINE>measureWidth = Math.max(measureWidth, tempWidth + childMeasuredWidth);<NEW_LINE>measureHeight = <MASK><NEW_LINE>break;<NEW_LINE>case left:<NEW_LINE>case right:<NEW_LINE>default:<NEW_LINE>remainingWidth = Math.max(0, remainingWidth - childMeasuredWidth);<NEW_LINE>tempWidth += childMeasuredWidth;<NEW_LINE>measureWidth = Math.max(measureWidth, tempWidth);<NEW_LINE>measureHeight = Math.max(measureHeight, tempHeight + childMeasuredHeight);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add in our padding<NEW_LINE>measureWidth += horizontalPadding;<NEW_LINE>measureHeight += verticalPadding;<NEW_LINE>// Check against our minimum sizes<NEW_LINE>measureWidth = Math.max(measureWidth, this.getSuggestedMinimumWidth());<NEW_LINE>measureHeight = Math.max(measureHeight, this.getSuggestedMinimumHeight());<NEW_LINE>int widthSizeAndState = resolveSizeAndState(measureWidth, widthMeasureSpec, 0);<NEW_LINE>int heightSizeAndState = resolveSizeAndState(measureHeight, heightMeasureSpec, 0);<NEW_LINE>this.setMeasuredDimension(widthSizeAndState, heightSizeAndState);<NEW_LINE>} | Math.max(measureHeight, tempHeight); |
1,777,141 | private void fill(Block block, BlockResult result) {<NEW_LINE>Metric metric = profiler.start(Profiler.PROFILING_TYPE.FILLING_EXECUTED_BLOCK);<NEW_LINE>BlockHeader header = block.getHeader();<NEW_LINE>block.setTransactionsList(result.getExecutedTransactions());<NEW_LINE>boolean isRskip126Enabled = activationConfig.isActive(<MASK><NEW_LINE>header.setTransactionsRoot(BlockHashesHelper.getTxTrieRoot(block.getTransactionsList(), isRskip126Enabled));<NEW_LINE>header.setReceiptsRoot(BlockHashesHelper.calculateReceiptsTrieRoot(result.getTransactionReceipts(), isRskip126Enabled));<NEW_LINE>header.setStateRoot(result.getFinalState().getHash().getBytes());<NEW_LINE>header.setGasUsed(result.getGasUsed());<NEW_LINE>header.setPaidFees(result.getPaidFees());<NEW_LINE>header.setLogsBloom(calculateLogsBloom(result.getTransactionReceipts()));<NEW_LINE>block.flushRLP();<NEW_LINE>profiler.stop(metric);<NEW_LINE>} | RSKIP126, block.getNumber()); |
447,814 | protected void replaceStructureBlock(StructureBlockInfo info, Level world, BlockPos actualPos, boolean mirrored, Direction clickDirection, Vec3i offsetFromMaster) {<NEW_LINE>BlockState state = baseState.get();<NEW_LINE>if (!offsetFromMaster.equals(Vec3i.ZERO))<NEW_LINE>state = state.<MASK><NEW_LINE>world.setBlockAndUpdate(actualPos, state);<NEW_LINE>BlockEntity curr = world.getBlockEntity(actualPos);<NEW_LINE>if (curr instanceof MultiblockPartTileEntity) {<NEW_LINE>MultiblockPartTileEntity tile = (MultiblockPartTileEntity) curr;<NEW_LINE>tile.formed = true;<NEW_LINE>tile.offsetToMaster = new BlockPos(offsetFromMaster);<NEW_LINE>tile.posInMultiblock = info.pos;<NEW_LINE>if (state.hasProperty(IEProperties.MIRRORED))<NEW_LINE>tile.setMirrored(mirrored);<NEW_LINE>tile.setFacing(transformDirection(clickDirection.getOpposite()));<NEW_LINE>tile.setChanged();<NEW_LINE>world.blockEvent(actualPos, world.getBlockState(actualPos).getBlock(), 255, 0);<NEW_LINE>} else<NEW_LINE>IELogger.logger.error("Expected MB TE at {} during placement", actualPos);<NEW_LINE>} | setValue(IEProperties.MULTIBLOCKSLAVE, true); |
1,559,849 | public void deleteProjectTag(DeleteProjectTag request, StreamObserver<DeleteProjectTag.Response> responseObserver) {<NEW_LINE>try {<NEW_LINE>final var response = futureProjectDAO.deleteTags(DeleteProjectTags.newBuilder().setId(request.getId()).addTags(request.getTag()).setDeleteAll(false).build()).thenCompose(unused -> futureProjectDAO.getProjectById(request.getId()), executor).thenCompose(updatedProject -> addEvent(updatedProject.getId(), updatedProject.getWorkspaceServiceId(), UPDATE_PROJECT_EVENT_TYPE, Optional.of("tags"), Collections.singletonMap("tags", new Gson().toJsonTree(Collections.singletonList(request.getTag()), new TypeToken<ArrayList<String>>() {<NEW_LINE>}.getType())), "project tag deleted successfully").thenApply(eventLoggedStatus -> updatedProject, executor), executor).thenApply(updatedProject -> DeleteProjectTag.Response.newBuilder().setProject(updatedProject<MASK><NEW_LINE>FutureGrpc.ServerResponse(responseObserver, response, executor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>CommonUtils.observeError(responseObserver, e);<NEW_LINE>}<NEW_LINE>} | ).build(), executor); |
130,234 | protected void convertResultToContextUOMIfNeeded(@NonNull final IPricingResult result, @NonNull final IPricingContext pricingCtx) {<NEW_LINE>// We are asked to keep the prices in context's UOM, so do nothing<NEW_LINE>if (!pricingCtx.isConvertPriceToContextUOM()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (pricingCtx.getUomId() != null && !UomId.equals(pricingCtx.getUomId(), result.getPriceUomId())) {<NEW_LINE>final ProductPrice.ProductPriceBuilder productPriceBuilder = ProductPrice.builder().productId(result.getProductId()).uomId(result.getPriceUomId());<NEW_LINE>final CurrencyPrecision productPricePrecision = Optional.ofNullable(result.getPrecision()).orElseGet(() -> CurrencyPrecision.ofInt(result.getPriceStd().scale()));<NEW_LINE>final ProductPrice stdProductPrice = productPriceBuilder.money(Money.of(result.getPriceStd(), result.getCurrencyId())).build();<NEW_LINE>final ProductPrice stdProductPriceInContextUOM = uomConversionBL.convertProductPriceToUom(stdProductPrice, pricingCtx.getUomId(), productPricePrecision);<NEW_LINE>result.setPriceStd(stdProductPriceInContextUOM.toBigDecimal());<NEW_LINE>final ProductPrice listProductPrice = productPriceBuilder.money(Money.of(result.getPriceList(), result.getCurrencyId())).build();<NEW_LINE>final ProductPrice listProductPriceInContextUOM = uomConversionBL.convertProductPriceToUom(listProductPrice, pricingCtx.getUomId(), productPricePrecision);<NEW_LINE>result.setPriceList(listProductPriceInContextUOM.toBigDecimal());<NEW_LINE>final ProductPrice limitProductPrice = productPriceBuilder.money(Money.of(result.getPriceLimit(), result.getCurrencyId())).build();<NEW_LINE>final ProductPrice limitProductPriceInContextUOM = uomConversionBL.convertProductPriceToUom(limitProductPrice, <MASK><NEW_LINE>result.setPriceLimit(limitProductPriceInContextUOM.toBigDecimal());<NEW_LINE>result.setPriceUomId(pricingCtx.getUomId());<NEW_LINE>}<NEW_LINE>} | pricingCtx.getUomId(), productPricePrecision); |
186,088 | protected void loadLocationPaths(Compiler compiler, int opPos, int count) throws javax.xml.transform.TransformerException {<NEW_LINE>// TODO: Handle unwrapped FilterExpr<NEW_LINE>int steptype = compiler.getOp(opPos);<NEW_LINE>if (steptype == OpCodes.OP_LOCATIONPATH) {<NEW_LINE>loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);<NEW_LINE>m_exprs[count] = createDTMIterator(compiler, opPos);<NEW_LINE>m_exprs[count].exprSetParent(this);<NEW_LINE>} else {<NEW_LINE>// Have to check for unwrapped functions, which the LocPathIterator<NEW_LINE>// doesn't handle.<NEW_LINE>switch(steptype) {<NEW_LINE>case OpCodes.OP_VARIABLE:<NEW_LINE>case OpCodes.OP_EXTFUNCTION:<NEW_LINE>case OpCodes.OP_FUNCTION:<NEW_LINE>case OpCodes.OP_GROUP:<NEW_LINE>loadLocationPaths(compiler, compiler.getNextOpPos<MASK><NEW_LINE>WalkingIterator iter = new WalkingIterator(compiler.getNamespaceContext());<NEW_LINE>iter.exprSetParent(this);<NEW_LINE>if (compiler.getLocationPathDepth() <= 0)<NEW_LINE>iter.setIsTopLevel(true);<NEW_LINE>iter.m_firstWalker = new org.apache.xpath.axes.FilterExprWalker(iter);<NEW_LINE>iter.m_firstWalker.init(compiler, opPos, steptype);<NEW_LINE>m_exprs[count] = iter;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>m_exprs = new LocPathIterator[count];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (opPos), count + 1); |
592,050 | private TrackEntry trackEntry(int trackIndex, Animation animation, boolean loop, @Null TrackEntry last) {<NEW_LINE><MASK><NEW_LINE>entry.trackIndex = trackIndex;<NEW_LINE>entry.animation = animation;<NEW_LINE>entry.loop = loop;<NEW_LINE>entry.holdPrevious = false;<NEW_LINE>entry.eventThreshold = 0;<NEW_LINE>entry.attachmentThreshold = 0;<NEW_LINE>entry.drawOrderThreshold = 0;<NEW_LINE>entry.animationStart = 0;<NEW_LINE>entry.animationEnd = animation.getDuration();<NEW_LINE>entry.animationLast = -1;<NEW_LINE>entry.nextAnimationLast = -1;<NEW_LINE>entry.delay = 0;<NEW_LINE>entry.trackTime = 0;<NEW_LINE>entry.trackLast = -1;<NEW_LINE>entry.nextTrackLast = -1;<NEW_LINE>entry.trackEnd = Float.MAX_VALUE;<NEW_LINE>entry.timeScale = 1;<NEW_LINE>entry.alpha = 1;<NEW_LINE>entry.interruptAlpha = 1;<NEW_LINE>entry.mixTime = 0;<NEW_LINE>entry.mixDuration = last == null ? 0 : data.getMix(last.animation, animation);<NEW_LINE>entry.mixBlend = MixBlend.replace;<NEW_LINE>return entry;<NEW_LINE>} | TrackEntry entry = trackEntryPool.obtain(); |
1,811,784 | public static void updateQueue(String projectId, String locationId, String queueId) throws Exception {<NEW_LINE>try (CloudTasksClient client = CloudTasksClient.create()) {<NEW_LINE>// TODO(developer): Uncomment these lines and replace with your values.<NEW_LINE>// String projectId = "your-project-id";<NEW_LINE>// String locationId = "us-central1";<NEW_LINE>// String queueId = "queue-blue";<NEW_LINE>LocationName parent = LocationName.of(projectId, locationId);<NEW_LINE>Queue queueBlue = Queue.newBuilder().setName(QueueName.of(projectId, locationId, queueId).toString()).setRateLimits(RateLimits.newBuilder().setMaxDispatchesPerSecond(20.0).setMaxConcurrentDispatches<MASK><NEW_LINE>UpdateQueueRequest request = UpdateQueueRequest.newBuilder().setQueue(queueBlue).build();<NEW_LINE>Queue response = client.updateQueue(request);<NEW_LINE>System.out.println(response);<NEW_LINE>}<NEW_LINE>} | (10)).build(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.