idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
271,012
public static ListTaskGroupsResponse unmarshall(ListTaskGroupsResponse listTaskGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTaskGroupsResponse.setRequestId(_ctx.stringValue("ListTaskGroupsResponse.RequestId"));<NEW_LINE>listTaskGroupsResponse.setCode(_ctx.stringValue("ListTaskGroupsResponse.Code"));<NEW_LINE>listTaskGroupsResponse.setMessage(_ctx.stringValue("ListTaskGroupsResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalElements(_ctx.longValue("ListTaskGroupsResponse.Data.TotalElements"));<NEW_LINE>data.setTotalPages(_ctx.integerValue("ListTaskGroupsResponse.Data.TotalPages"));<NEW_LINE>List<ItemsItem> items = new ArrayList<ItemsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTaskGroupsResponse.Data.Items.Length"); i++) {<NEW_LINE>ItemsItem itemsItem = new ItemsItem();<NEW_LINE>itemsItem.setCompletedTasks(_ctx.integerValue("ListTaskGroupsResponse.Data.Items[" + i + "].CompletedTasks"));<NEW_LINE>itemsItem.setCreatedAt(_ctx.stringValue("ListTaskGroupsResponse.Data.Items[" + i + "].CreatedAt"));<NEW_LINE>itemsItem.setId(_ctx.stringValue("ListTaskGroupsResponse.Data.Items[" + i + "].Id"));<NEW_LINE>itemsItem.setName(_ctx.stringValue("ListTaskGroupsResponse.Data.Items[" + i + "].Name"));<NEW_LINE>itemsItem.setRuleId(_ctx.stringValue("ListTaskGroupsResponse.Data.Items[" + i + "].RuleId"));<NEW_LINE>itemsItem.setRuleName(_ctx.stringValue("ListTaskGroupsResponse.Data.Items[" + i + "].RuleName"));<NEW_LINE>itemsItem.setStatus(_ctx.stringValue("ListTaskGroupsResponse.Data.Items[" + i + "].Status"));<NEW_LINE>itemsItem.setTotalTasks(_ctx.integerValue("ListTaskGroupsResponse.Data.Items[" + i + "].TotalTasks"));<NEW_LINE>List<String> taskIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListTaskGroupsResponse.Data.Items[" + i + "].TaskIds.Length"); j++) {<NEW_LINE>taskIds.add(_ctx.stringValue("ListTaskGroupsResponse.Data.Items[" + i <MASK><NEW_LINE>}<NEW_LINE>itemsItem.setTaskIds(taskIds);<NEW_LINE>items.add(itemsItem);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>listTaskGroupsResponse.setData(data);<NEW_LINE>return listTaskGroupsResponse;<NEW_LINE>}
+ "].TaskIds[" + j + "]"));
134,639
public DescribeScheduleResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeScheduleResult describeScheduleResult = new DescribeScheduleResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeScheduleResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeScheduleResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("scheduleActions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeScheduleResult.setScheduleActions(new ListUnmarshaller<ScheduleAction>(ScheduleActionJsonUnmarshaller.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 describeScheduleResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
163,944
public Set<String> children(String account, String container, BlobPath path) throws URISyntaxException, StorageException {<NEW_LINE>final var blobsBuilder = new HashSet<String>();<NEW_LINE>final Tuple<CloudBlobClient, Supplier<OperationContext>> client = client();<NEW_LINE>final CloudBlobContainer blobContainer = client.v1().getContainerReference(container);<NEW_LINE>final <MASK><NEW_LINE>final EnumSet<BlobListingDetails> enumBlobListingDetails = EnumSet.of(BlobListingDetails.METADATA);<NEW_LINE>for (ListBlobItem blobItem : blobContainer.listBlobs(keyPath, false, enumBlobListingDetails, null, client.v2().get())) {<NEW_LINE>if (blobItem instanceof CloudBlobDirectory) {<NEW_LINE>final URI uri = blobItem.getUri();<NEW_LINE>LOGGER.trace(() -> new ParameterizedMessage("blob url [{}]", uri));<NEW_LINE>// uri.getPath is of the form /container/keyPath.* and we want to strip off the /container/<NEW_LINE>// this requires 1 + container.length() + 1, with each 1 corresponding to one of the /.<NEW_LINE>// Lastly, we add the length of keyPath to the offset to strip this container's path.<NEW_LINE>final String uriPath = uri.getPath();<NEW_LINE>blobsBuilder.add(uriPath.substring(1 + container.length() + 1 + keyPath.length(), uriPath.length() - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Set.copyOf(blobsBuilder);<NEW_LINE>}
String keyPath = path.buildAsString();
811,322
public void generateProjectBuildScript(String projectName, InitSettings settings, BuildScriptBuilder buildScriptBuilder) {<NEW_LINE>buildScriptBuilder.repositories().mavenCentral("Use Maven Central for resolving dependencies.");<NEW_LINE>String pluginId = settings.getPackageName() + ".greeting";<NEW_LINE>String pluginClassName = StringUtils.capitalize(GUtil.toCamelCase(settings.getProjectName())) + "Plugin";<NEW_LINE>buildScriptBuilder.fileComment("This generated file contains a sample Gradle plugin project to get you started.").fileComment("For more details take a look at the Writing Custom Plugins chapter in the Gradle").fileComment("User Manual available at " + documentationRegistry.getDocumentationFor("custom_plugins"));<NEW_LINE>buildScriptBuilder.plugin("Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins", "java-gradle-plugin");<NEW_LINE>buildScriptBuilder.block(null, "gradlePlugin", b -> b.containerElement("Define the plugin", "plugins", "greeting", null, g -> {<NEW_LINE>g.propertyAssignment(<MASK><NEW_LINE>g.propertyAssignment(null, "implementationClass", withPackage(settings, pluginClassName), true);<NEW_LINE>}));<NEW_LINE>final BuildScriptBuilder.Expression functionalTestSourceSet;<NEW_LINE>if (settings.isUseTestSuites()) {<NEW_LINE>configureDefaultTestSuite(buildScriptBuilder, settings.getTestFramework(), libraryVersionProvider);<NEW_LINE>addTestSuite("functionalTest", buildScriptBuilder, settings.getTestFramework(), libraryVersionProvider);<NEW_LINE>functionalTestSourceSet = buildScriptBuilder.containerElementExpression("sourceSets", "functionalTest");<NEW_LINE>} else {<NEW_LINE>functionalTestSourceSet = buildScriptBuilder.createContainerElement("Add a source set for the functional test suite", "sourceSets", "functionalTest", "functionalTestSourceSet");<NEW_LINE>BuildScriptBuilder.Expression functionalTestConfiguration = buildScriptBuilder.containerElementExpression("configurations", "functionalTestImplementation");<NEW_LINE>BuildScriptBuilder.Expression testConfiguration = buildScriptBuilder.containerElementExpression("configurations", "testImplementation");<NEW_LINE>buildScriptBuilder.methodInvocation(null, functionalTestConfiguration, "extendsFrom", testConfiguration);<NEW_LINE>BuildScriptBuilder.Expression functionalTest = buildScriptBuilder.taskRegistration("Add a task to run the functional tests", "functionalTest", "Test", b -> {<NEW_LINE>b.propertyAssignment(null, "testClassesDirs", buildScriptBuilder.propertyExpression(functionalTestSourceSet, "output.classesDirs"), true);<NEW_LINE>b.propertyAssignment(null, "classpath", buildScriptBuilder.propertyExpression(functionalTestSourceSet, "runtimeClasspath"), true);<NEW_LINE>if (getTestFrameworks().contains(BuildInitTestFramework.SPOCK) || getTestFrameworks().contains(BuildInitTestFramework.JUNIT_JUPITER)) {<NEW_LINE>b.methodInvocation(null, "useJUnitPlatform");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>buildScriptBuilder.taskMethodInvocation("Run the functional tests as part of `check`", "check", "Task", "dependsOn", functionalTest);<NEW_LINE>if (getTestFrameworks().contains(BuildInitTestFramework.SPOCK) || getTestFrameworks().contains(BuildInitTestFramework.JUNIT_JUPITER)) {<NEW_LINE>buildScriptBuilder.taskMethodInvocation("Use JUnit Jupiter for unit tests.", "test", "Test", "useJUnitPlatform");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buildScriptBuilder.methodInvocation(null, "gradlePlugin.testSourceSets", functionalTestSourceSet);<NEW_LINE>}
null, "id", pluginId, true);
1,761,396
boolean inCatchNullBlock(Location loc) {<NEW_LINE>int pc = loc.getHandle().getPosition();<NEW_LINE>int catchSize = Util.getSizeOfSurroundingTryBlock(classContext.getJavaClass().getConstantPool(), method.<MASK><NEW_LINE>if (catchSize < Integer.MAX_VALUE) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>catchSize = Util.getSizeOfSurroundingTryBlock(classContext.getJavaClass().getConstantPool(), method.getCode(), "java/lang/Exception", pc);<NEW_LINE>if (catchSize < 5) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>catchSize = Util.getSizeOfSurroundingTryBlock(classContext.getJavaClass().getConstantPool(), method.getCode(), "java/lang/RuntimeException", pc);<NEW_LINE>if (catchSize < 5) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>catchSize = Util.getSizeOfSurroundingTryBlock(classContext.getJavaClass().getConstantPool(), method.getCode(), "java/lang/Throwable", pc);<NEW_LINE>return catchSize < 5;<NEW_LINE>}
getCode(), "java/lang/NullPointerException", pc);
380,244
private static Optional<Path> determineWatchmanTransportPath(ListeningProcessExecutor executor, ImmutableMap<String, String> env, ExecutableFinder exeFinder, Console console, Clock clock, long timeoutMillis) throws IOException, InterruptedException {<NEW_LINE>Optional<Path> watchmanPathOpt = exeFinder.getOptionalExecutable(WATCHMAN, env);<NEW_LINE>if (!watchmanPathOpt.isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Path watchmanPath = watchmanPathOpt.get().toAbsolutePath();<NEW_LINE>Optional<? extends Map<String, ?>> result = execute(executor, console, clock, timeoutMillis, TimeUnit.MILLISECONDS.toNanos(timeoutMillis), watchmanPath, "get-sockname");<NEW_LINE>if (!result.isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>String rawSockname = (String) result.get().get("sockname");<NEW_LINE>if (rawSockname == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Path <MASK><NEW_LINE>LOG.info("Connecting to Watchman version %s at %s", result.get().get("version"), transportPath);<NEW_LINE>return Optional.of(transportPath);<NEW_LINE>}
transportPath = Paths.get(rawSockname);
796,277
private static ORecordHook.RESULT executeFunction(final ODocument iDocument, final OFunction func, ODatabaseDocumentInternal database) {<NEW_LINE>if (func == null)<NEW_LINE>return ORecordHook.RESULT.RECORD_NOT_CHANGED;<NEW_LINE>final OScriptManager scriptManager = database.getSharedContext().getOrientDB().getScriptManager();<NEW_LINE>final OPartitionedObjectPool.PoolEntry<ScriptEngine> entry = scriptManager.acquireDatabaseEngine(database.getName(), func.getLanguage());<NEW_LINE>final ScriptEngine scriptEngine = entry.object;<NEW_LINE>try {<NEW_LINE>final Bindings binding = scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE);<NEW_LINE>scriptManager.bind(scriptEngine, binding, (<MASK><NEW_LINE>binding.put("doc", iDocument);<NEW_LINE>String result = null;<NEW_LINE>try {<NEW_LINE>if (func.getLanguage() == null)<NEW_LINE>throw new OConfigurationException("Database function '" + func.getName() + "' has no language");<NEW_LINE>final String funcStr = scriptManager.getFunctionDefinition(func);<NEW_LINE>if (funcStr != null) {<NEW_LINE>try {<NEW_LINE>scriptEngine.eval(funcStr);<NEW_LINE>} catch (ScriptException e) {<NEW_LINE>scriptManager.throwErrorMessage(e, funcStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (scriptEngine instanceof Invocable) {<NEW_LINE>final Invocable invocableEngine = (Invocable) scriptEngine;<NEW_LINE>Object[] empty = OCommonConst.EMPTY_OBJECT_ARRAY;<NEW_LINE>result = (String) invocableEngine.invokeFunction(func.getName(), empty);<NEW_LINE>}<NEW_LINE>} catch (ScriptException e) {<NEW_LINE>throw OException.wrapException(new OCommandScriptException("Error on execution of the script", func.getName(), e.getColumnNumber()), e);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw OException.wrapException(new OCommandScriptException("Error on execution of the script", func.getName(), 0), e);<NEW_LINE>} catch (OCommandScriptException e) {<NEW_LINE>// PASS THROUGH<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>scriptManager.unbind(scriptEngine, binding, null, null);<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>return ORecordHook.RESULT.RECORD_NOT_CHANGED;<NEW_LINE>}<NEW_LINE>return ORecordHook.RESULT.valueOf(result);<NEW_LINE>} finally {<NEW_LINE>scriptManager.releaseDatabaseEngine(func.getLanguage(), database.getName(), entry);<NEW_LINE>}<NEW_LINE>}
ODatabaseDocumentInternal) database, null, null);
1,434,400
public static void recoverSmartCommit(DBCExecutionContext executionContext) {<NEW_LINE>DBPPreferenceStore preferenceStore = executionContext.getDataSource().getContainer().getPreferenceStore();<NEW_LINE>if (preferenceStore.getBoolean(ModelPreferences.TRANSACTIONS_SMART_COMMIT) && preferenceStore.getBoolean(ModelPreferences.TRANSACTIONS_SMART_COMMIT_RECOVER)) {<NEW_LINE>DBCTransactionManager transactionManager = DBUtils.getTransactionManager(executionContext);<NEW_LINE>if (transactionManager != null) {<NEW_LINE>new AbstractJob("Recover smart commit mode") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IStatus run(DBRProgressMonitor monitor) {<NEW_LINE>if (!executionContext.isConnected()) {<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (!transactionManager.isAutoCommit()) {<NEW_LINE>transactionManager.setAutoCommit(monitor, true);<NEW_LINE>}<NEW_LINE>} catch (DBCException e) {<NEW_LINE>log.debug("Error recovering smart commit mode: " + e.getMessage());<NEW_LINE>} finally {<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>}.schedule();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
monitor.beginTask("Switch to auto-commit mode", 1);
1,244,181
public Object readFPrimitiveArray(Object array, Class componentType, int len) {<NEW_LINE>if (componentType == double.class) {<NEW_LINE>double[] da = (double[]) array;<NEW_LINE>for (int i = 0; i < da.length; i++) {<NEW_LINE>da[i] = (double) input.readTag(input.readIn());<NEW_LINE>}<NEW_LINE>return da;<NEW_LINE>}<NEW_LINE>if (componentType == float.class) {<NEW_LINE>float[] da = (float[]) array;<NEW_LINE>for (int i = 0; i < da.length; i++) {<NEW_LINE>da[i] = (float) input.readTag(input.readIn());<NEW_LINE>}<NEW_LINE>return da;<NEW_LINE>}<NEW_LINE>// input.readObject();<NEW_LINE>Object arr = array;<NEW_LINE>int <MASK><NEW_LINE>if (len != -1 && len != length)<NEW_LINE>throw new RuntimeException("unexpected arrays size");<NEW_LINE>byte type = 0;<NEW_LINE>if (componentType == boolean.class)<NEW_LINE>type |= MinBin.INT_8;<NEW_LINE>else if (componentType == byte.class)<NEW_LINE>type |= MinBin.INT_8;<NEW_LINE>else if (componentType == short.class)<NEW_LINE>type |= MinBin.INT_16;<NEW_LINE>else if (componentType == char.class)<NEW_LINE>type |= MinBin.INT_16 | MinBin.UNSIGN_MASK;<NEW_LINE>else if (componentType == int.class)<NEW_LINE>type |= MinBin.INT_32;<NEW_LINE>else if (componentType == long.class)<NEW_LINE>type |= MinBin.INT_64;<NEW_LINE>else<NEW_LINE>throw new RuntimeException("unsupported type " + componentType.getName());<NEW_LINE>input.readArrayRaw(type, len, array);<NEW_LINE>return arr;<NEW_LINE>}
length = Array.getLength(arr);
1,085,026
final UpdateFlowTemplateResult executeUpdateFlowTemplate(UpdateFlowTemplateRequest updateFlowTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateFlowTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateFlowTemplateRequest> request = null;<NEW_LINE>Response<UpdateFlowTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateFlowTemplateRequestProtocolMarshaller(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, "IoTThingsGraph");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateFlowTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateFlowTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateFlowTemplateResultJsonUnmarshaller());<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(updateFlowTemplateRequest));
1,170,282
private void addToHeap(MinHeap heap, Object obj, Expression exp, Context ctx) {<NEW_LINE>if (obj instanceof Sequence) {<NEW_LINE>ComputeStack stack = ctx.getComputeStack();<NEW_LINE>try {<NEW_LINE>Sequence seq = (Sequence) obj;<NEW_LINE>Sequence.Current current = seq.new Current();<NEW_LINE>stack.push(current);<NEW_LINE>for (int i = 1, len = seq.length(); i <= len; ++i) {<NEW_LINE>current.setCurrent(i);<NEW_LINE>Object val = exp.calculate(ctx);<NEW_LINE>if (val != null) {<NEW_LINE>Object[] vals = new Object[2];<NEW_LINE>vals[0] = exp.calculate(ctx);<NEW_LINE>vals[1] = current.getCurrent();<NEW_LINE>heap.insert(vals);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>} else if (obj instanceof Record) {<NEW_LINE>if (isCurrent) {<NEW_LINE>Object val = exp.calculate(ctx);<NEW_LINE>if (val != null) {<NEW_LINE>Object[] vals = new Object[2];<NEW_LINE>vals[0] = val;<NEW_LINE>vals[1] = obj;<NEW_LINE>heap.insert(vals);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ComputeStack stack = ctx.getComputeStack();<NEW_LINE>try {<NEW_LINE>stack.push((Record) obj);<NEW_LINE>Object <MASK><NEW_LINE>if (val != null) {<NEW_LINE>Object[] vals = new Object[2];<NEW_LINE>vals[0] = val;<NEW_LINE>vals[1] = obj;<NEW_LINE>heap.insert(vals);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (obj != null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("top" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>}
val = exp.calculate(ctx);
1,478,829
private Resource parseJsonElementToresource(String region, JsonNode jsonNode) {<NEW_LINE>Validate.notNull(jsonNode);<NEW_LINE>String imageId = jsonNode.get("imageId").getTextValue();<NEW_LINE>Resource resource = new AWSResource().withId(imageId).withRegion(region).withResourceType(AWSResourceType.IMAGE);<NEW_LINE>Long <MASK><NEW_LINE>if (creationTime != null) {<NEW_LINE>resource.setLaunchTime(new Date(creationTime));<NEW_LINE>}<NEW_LINE>JsonNode tags = jsonNode.get("tags");<NEW_LINE>if (tags == null || !tags.isArray() || tags.size() == 0) {<NEW_LINE>LOGGER.debug(String.format("No tags is found for %s", resource.getId()));<NEW_LINE>} else {<NEW_LINE>for (Iterator<JsonNode> it = tags.getElements(); it.hasNext(); ) {<NEW_LINE>JsonNode tag = it.next();<NEW_LINE>String key = tag.get("key").getTextValue();<NEW_LINE>String value = tag.get("value").getTextValue();<NEW_LINE>resource.setTag(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JsonNode descNode = jsonNode.get("description");<NEW_LINE>if (descNode != null && !descNode.isNull()) {<NEW_LINE>String description = descNode.getTextValue();<NEW_LINE>resource.setDescription(description);<NEW_LINE>String ancestorImageId = getBaseAmiIdFromDescription(description);<NEW_LINE>if (ancestorImageId != null && !ancestorImageIds.contains(ancestorImageId)) {<NEW_LINE>LOGGER.info(String.format("Found base AMI id %s from description '%s'", ancestorImageId, description));<NEW_LINE>ancestorImageIds.add(ancestorImageId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>((AWSResource) resource).setAWSResourceState(jsonNode.get("state").getTextValue());<NEW_LINE>String owner = getOwnerEmailForResource(resource);<NEW_LINE>if (owner != null) {<NEW_LINE>resource.setOwnerEmail(owner);<NEW_LINE>}<NEW_LINE>return resource;<NEW_LINE>}
creationTime = imageIdToCreationTime.get(imageId);
1,086,765
private PaymentDataRequest createPaymentDataRequest(ReadableMap payParams) {<NEW_LINE>final String estimatedTotalPrice = payParams.getString(TOTAL_PRICE);<NEW_LINE>final String <MASK><NEW_LINE>final boolean billingAddressRequired = Converters.getValue(payParams, BILLING_ADDRESS_REQUIRED, false);<NEW_LINE>final boolean shippingAddressRequired = Converters.getValue(payParams, SHIPPING_ADDRESS_REQUIRED, false);<NEW_LINE>final boolean phoneNumberRequired = Converters.getValue(payParams, PHONE_NUMBER_REQUIRED, false);<NEW_LINE>final boolean emailRequired = Converters.getValue(payParams, EMAIL_REQUIRED, false);<NEW_LINE>final Collection<String> allowedCountryCodes = getAllowedShippingCountryCodes(payParams);<NEW_LINE>return createPaymentDataRequest(estimatedTotalPrice, currencyCode, billingAddressRequired, shippingAddressRequired, phoneNumberRequired, emailRequired, allowedCountryCodes);<NEW_LINE>}
currencyCode = payParams.getString(CURRENCY_CODE);
608,209
public Object apply(final Object context, final Options options) throws IOException {<NEW_LINE>if (context == null) {<NEW_LINE>return options.hash("default", "");<NEW_LINE>}<NEW_LINE>String viewName = options.hash("view", "");<NEW_LINE>JsonGenerator generator = null;<NEW_LINE>try {<NEW_LINE>final ObjectWriter writer;<NEW_LINE>// do we need to use a view?<NEW_LINE>if (!Handlebars.Utils.isEmpty(viewName)) {<NEW_LINE>Class<?> viewClass = alias.get(viewName);<NEW_LINE>if (viewClass == null) {<NEW_LINE>viewClass = getClass().<MASK><NEW_LINE>}<NEW_LINE>writer = mapper.writerWithView(viewClass);<NEW_LINE>} else {<NEW_LINE>writer = mapper.writer();<NEW_LINE>}<NEW_LINE>JsonFactory jsonFactory = mapper.getFactory();<NEW_LINE>SegmentedStringWriter output = new SegmentedStringWriter(jsonFactory._getBufferRecycler());<NEW_LINE>// creates a json generator.<NEW_LINE>generator = jsonFactory.createJsonGenerator(output);<NEW_LINE>Boolean escapeHtml = options.hash("escapeHTML", Boolean.FALSE);<NEW_LINE>// do we need to escape html?<NEW_LINE>if (escapeHtml) {<NEW_LINE>generator.setCharacterEscapes(new HtmlEscapes());<NEW_LINE>}<NEW_LINE>Boolean pretty = options.hash("pretty", Boolean.FALSE);<NEW_LINE>// write the JSON output.<NEW_LINE>if (pretty) {<NEW_LINE>writer.withDefaultPrettyPrinter().writeValue(generator, context);<NEW_LINE>} else {<NEW_LINE>writer.writeValue(generator, context);<NEW_LINE>}<NEW_LINE>generator.close();<NEW_LINE>return new Handlebars.SafeString(output.getAndClear());<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>throw new IllegalArgumentException(viewName, ex);<NEW_LINE>} finally {<NEW_LINE>if (generator != null && !generator.isClosed()) {<NEW_LINE>generator.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getClassLoader().loadClass(viewName);
1,046,531
public Forwardable<? extends ThingVertex, Order.Asc> branch(GraphManager graphMgr, Vertex<?, ?> fromVertex, Traversal.Parameters params) {<NEW_LINE>assert fromVertex.isThing() && to.props().predicates().isEmpty();<NEW_LINE><MASK><NEW_LINE>Set<Label> toTypes = to.props().types();<NEW_LINE>Forwardable<? extends ThingVertex, Order.Asc> iter;<NEW_LINE>if (to.props().hasIID()) {<NEW_LINE>assert to.id().isVariable();<NEW_LINE>iter = backwardBranchToIIDFiltered(graphMgr, role, RELATING, params.getIID(to.id().asVariable()), toTypes);<NEW_LINE>} else {<NEW_LINE>Set<TypeVertex> relations = graphMgr.schema().relationsOfRoleType(role.type());<NEW_LINE>iter = iterate(relations).filter(rel -> toTypes.contains(rel.properLabel())).mergeMap(t -> role.ins().edge(RELATING, PrefixIID.of(RELATION), t.iid()).from(), ASC);<NEW_LINE>}<NEW_LINE>return iter;<NEW_LINE>}
ThingVertex role = fromVertex.asThing();
635,208
public static void load() {<NEW_LINE>String pkg = Scanner.cutOutLast(ServiceHandlingProxy.class.getName(), ".");<NEW_LINE>Set<String> classes = new Scanner(pkg).process(ServiceHandlingProxy.class.getClassLoader());<NEW_LINE>Set<String> custom = new Scanner(System.getProperty("scouter.handler")).process();<NEW_LINE>classes.addAll(custom);<NEW_LINE>Iterator<String> itr = classes.iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>try {<NEW_LINE>Class c = Class.forName(itr.next());<NEW_LINE>if (Modifier.isPublic(c.getModifiers()) == false) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Method[<MASK><NEW_LINE>for (int i = 0; i < m.length; i++) {<NEW_LINE>ServiceHandler mapAn = (ServiceHandler) m[i].getAnnotation(ServiceHandler.class);<NEW_LINE>if (mapAn == null)<NEW_LINE>continue;<NEW_LINE>String key = mapAn.value();<NEW_LINE>Invocation news = new Invocation(c.newInstance(), m[i]);<NEW_LINE>Invocation olds = handlers.get(key);<NEW_LINE>if (olds != null) {<NEW_LINE>Logger.println("Warning duplicated Handler key=" + key + " old=" + olds + " new=" + news);<NEW_LINE>} else {<NEW_LINE>if (Configure.getInstance().log_service_handler_list) {<NEW_LINE>Logger.println("ServiceHandler " + key + "=>" + news);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handlers.put(key, news);<NEW_LINE>}<NEW_LINE>} catch (Exception x) {<NEW_LINE>x.printStackTrace();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] m = c.getDeclaredMethods();
1,588,174
private void gwFieldValueInt64V(MethodWriterContext mwc, FieldWriter fieldWriter, int OBJECT, int i, boolean jsonb) {<NEW_LINE>MethodWriter mw = mwc.mw;<NEW_LINE>String format = fieldWriter.getFormat();<NEW_LINE>String classNameType = mwc.classNameType;<NEW_LINE>int FIELD_VALUE = mwc.var(long.class);<NEW_LINE>int WRITE_DEFAULT_VALUE = mwc.var(NOT_WRITE_DEFAULT_VALUE);<NEW_LINE>Label notDefaultValue_ = new Label(), endWriteValue_ = new Label();<NEW_LINE>genGetObject(mwc, fieldWriter, OBJECT);<NEW_LINE>mw.visitInsn(Opcodes.DUP2);<NEW_LINE>mw.visitVarInsn(Opcodes.LSTORE, FIELD_VALUE);<NEW_LINE>mw.visitInsn(Opcodes.LCONST_0);<NEW_LINE>mw.visitInsn(Opcodes.LCMP);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFNE, notDefaultValue_);<NEW_LINE>mw.visitVarInsn(Opcodes.ILOAD, WRITE_DEFAULT_VALUE);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFEQ, notDefaultValue_);<NEW_LINE>mw.visitJumpInsn(Opcodes.GOTO, endWriteValue_);<NEW_LINE>mw.visitLabel(notDefaultValue_);<NEW_LINE>if (jsonb) {<NEW_LINE>gwFieldName(mwc, i);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_WRITER);<NEW_LINE>mw.<MASK><NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEVIRTUAL, TYPE_JSON_WRITER, "writeInt64", "(J)V", false);<NEW_LINE>} else {<NEW_LINE>// Int32FieldWriter.writeInt64(JSONWriter w, long value);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, THIS);<NEW_LINE>mw.visitFieldInsn(Opcodes.GETFIELD, classNameType, fieldWriter(i), DESC_FIELD_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.LLOAD, FIELD_VALUE);<NEW_LINE>if ("iso8601".equals(format)) {<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEINTERFACE, TYPE_FIELD_WRITER, "writeDate", METHOD_DESC_WRITE_J, true);<NEW_LINE>} else {<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEINTERFACE, TYPE_FIELD_WRITER, "writeInt64", METHOD_DESC_WRITE_J, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mw.visitLabel(endWriteValue_);<NEW_LINE>}
visitVarInsn(Opcodes.LLOAD, FIELD_VALUE);
252,745
public void addNoteTextPara(String noteText, String lang) {<NEW_LINE>// eg "en-AU"<NEW_LINE>org.docx4j.dml.ObjectFactory dmlObjectFactory = new org.docx4j.dml.ObjectFactory();<NEW_LINE>CTTextParagraph textparagraph = dmlObjectFactory.createCTTextParagraph();<NEW_LINE>// Create object for endParaRPr<NEW_LINE>CTRegularTextRun regulartextrun = dmlObjectFactory.createCTRegularTextRun();<NEW_LINE>textparagraph.getEGTextRun().add(regulartextrun);<NEW_LINE>// Create object for rPr<NEW_LINE><MASK><NEW_LINE>regulartextrun.setRPr(textcharacterproperties);<NEW_LINE>textcharacterproperties.setLang(lang);<NEW_LINE>textcharacterproperties.setSmtId(Long.valueOf(0));<NEW_LINE>regulartextrun.setT(noteText);<NEW_LINE>// Create object for endParaRPr<NEW_LINE>CTTextCharacterProperties textcharacterproperties2 = dmlObjectFactory.createCTTextCharacterProperties();<NEW_LINE>textparagraph.setEndParaRPr(textcharacterproperties2);<NEW_LINE>textcharacterproperties2.setLang(lang);<NEW_LINE>textcharacterproperties2.setSmtId(Long.valueOf(0));<NEW_LINE>// Now<NEW_LINE>Shape notesPlaceholder = (Shape) this.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().get(0);<NEW_LINE>notesPlaceholder.getTxBody().getP().add(textparagraph);<NEW_LINE>}
CTTextCharacterProperties textcharacterproperties = dmlObjectFactory.createCTTextCharacterProperties();
452,971
public static void main(String[] arg) throws IOException {<NEW_LINE>String version = arg[0];<NEW_LINE>String inputFilePath = arg[1];<NEW_LINE>String outputFilePath = arg[2];<NEW_LINE>String inputHighResolutionFilePath = arg[3];<NEW_LINE>String outputHighResolutionFilePath = arg[4];<NEW_LINE>String fullText = String.format("%s\n\nCopyright SmartBear Software\n\nwww.soapui.org\nwww.smartbear.com", version);<NEW_LINE>BufferedImage lowResolutionImage = ImageIO.read(new File(inputFilePath));<NEW_LINE>BufferedImage highResolutionImage = ImageIO.read(new File(inputHighResolutionFilePath));<NEW_LINE>Graphics2D[] imageGraphics = { lowResolutionImage.createGraphics(), highResolutionImage.createGraphics() };<NEW_LINE>Font font = new Font("Arial", Font.PLAIN, 12);<NEW_LINE>Font bigSizeFont = new Font("Arial", Font.PLAIN, 20);<NEW_LINE>for (Graphics2D graphics : imageGraphics) {<NEW_LINE>graphics.setColor(new Color(0x66, 0x66, 0x66));<NEW_LINE>graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);<NEW_LINE>}<NEW_LINE>imageGraphics[0].setFont(font);<NEW_LINE>imageGraphics[1].setFont(bigSizeFont);<NEW_LINE>int y = 181;<NEW_LINE>for (String text : fullText.split("\n")) {<NEW_LINE>imageGraphics[0].drawString(text, 42, y);<NEW_LINE>y += 15;<NEW_LINE>}<NEW_LINE>y = 362;<NEW_LINE>for (String text : fullText.split("\n")) {<NEW_LINE>imageGraphics[1].<MASK><NEW_LINE>y += 30;<NEW_LINE>}<NEW_LINE>ImageIO.write(lowResolutionImage, "png", new File(outputFilePath));<NEW_LINE>ImageIO.write(highResolutionImage, "png", new File(outputHighResolutionFilePath));<NEW_LINE>}
drawString(text, 84, y);
1,233,110
public static GetAgentIndexRealTimeResponse unmarshall(GetAgentIndexRealTimeResponse getAgentIndexRealTimeResponse, UnmarshallerContext _ctx) {<NEW_LINE>getAgentIndexRealTimeResponse.setRequestId(_ctx.stringValue("GetAgentIndexRealTimeResponse.RequestId"));<NEW_LINE>getAgentIndexRealTimeResponse.setMessage(_ctx.stringValue("GetAgentIndexRealTimeResponse.Message"));<NEW_LINE>getAgentIndexRealTimeResponse.setCode(_ctx.stringValue("GetAgentIndexRealTimeResponse.Code"));<NEW_LINE>getAgentIndexRealTimeResponse.setSuccess(_ctx.booleanValue("GetAgentIndexRealTimeResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageSize(_ctx.integerValue("GetAgentIndexRealTimeResponse.Data.PageSize"));<NEW_LINE>data.setTotal(_ctx.integerValue("GetAgentIndexRealTimeResponse.Data.Total"));<NEW_LINE>data.setPage(_ctx.integerValue("GetAgentIndexRealTimeResponse.Data.Page"));<NEW_LINE>List<Map<Object, Object>> <MASK><NEW_LINE>data.setRows(rows);<NEW_LINE>List<ColumnsItem> columns = new ArrayList<ColumnsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetAgentIndexRealTimeResponse.Data.Columns.Length"); i++) {<NEW_LINE>ColumnsItem columnsItem = new ColumnsItem();<NEW_LINE>columnsItem.setKey(_ctx.stringValue("GetAgentIndexRealTimeResponse.Data.Columns[" + i + "].Key"));<NEW_LINE>columnsItem.setTitle(_ctx.stringValue("GetAgentIndexRealTimeResponse.Data.Columns[" + i + "].Title"));<NEW_LINE>columns.add(columnsItem);<NEW_LINE>}<NEW_LINE>data.setColumns(columns);<NEW_LINE>getAgentIndexRealTimeResponse.setData(data);<NEW_LINE>return getAgentIndexRealTimeResponse;<NEW_LINE>}
rows = _ctx.listMapValue("GetAgentIndexRealTimeResponse.Data.Rows");
874,363
private OCacheEntry allocateNewPage(OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>final OCacheEntry rightBucketEntry;<NEW_LINE>final OCacheEntry entryPointCacheEntry = loadPageForWrite(atomicOperation, fileId, ENTRY_POINT_INDEX, false, true);<NEW_LINE>try {<NEW_LINE>final CellBTreeSingleValueEntryPointV3<K> entryPoint = new CellBTreeSingleValueEntryPointV3<>(entryPointCacheEntry);<NEW_LINE>final int freeListHead = entryPoint.getFreeListHead();<NEW_LINE>if (freeListHead > -1) {<NEW_LINE>rightBucketEntry = loadPageForWrite(atomicOperation, fileId, freeListHead, false, false);<NEW_LINE>final CellBTreeSingleValueBucketV3<?> bucket = new CellBTreeSingleValueBucketV3<>(rightBucketEntry);<NEW_LINE>entryPoint.setFreeListHead(bucket.getNextFreeListPage());<NEW_LINE>} else {<NEW_LINE>int pageSize = entryPoint.getPagesSize();<NEW_LINE>if (pageSize < getFilledUpTo(atomicOperation, fileId) - 1) {<NEW_LINE>pageSize++;<NEW_LINE>rightBucketEntry = loadPageForWrite(atomicOperation, <MASK><NEW_LINE>entryPoint.setPagesSize(pageSize);<NEW_LINE>} else {<NEW_LINE>assert pageSize == getFilledUpTo(atomicOperation, fileId) - 1;<NEW_LINE>rightBucketEntry = addPage(atomicOperation, fileId);<NEW_LINE>entryPoint.setPagesSize(rightBucketEntry.getPageIndex());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, entryPointCacheEntry);<NEW_LINE>}<NEW_LINE>return rightBucketEntry;<NEW_LINE>}
fileId, pageSize, false, false);
963,516
public JSONObject debugStringInJson(ProfileTreePrinter.PrintLevel level, String nodeLevel) {<NEW_LINE>JSONObject jsonObject = new JSONObject();<NEW_LINE>jsonObject.put("id", nodeLevel);<NEW_LINE>JSONObject title = new JSONObject();<NEW_LINE>if (!id.equals(ProfileTreeBuilder.UNKNOWN_ID)) {<NEW_LINE>title.put("id", id);<NEW_LINE>}<NEW_LINE>title.put("name", name);<NEW_LINE>jsonObject.put("title", title);<NEW_LINE>if (level == ProfileTreePrinter.PrintLevel.FRAGMENT) {<NEW_LINE>jsonObject.put("fragment", fragmentId);<NEW_LINE>JSONArray labels = new JSONArray();<NEW_LINE>if (!Strings.isNullOrEmpty(maxInstanceActiveTime)) {<NEW_LINE>JSONObject label = new JSONObject();<NEW_LINE>label.put("name", "MaxActiveTime");<NEW_LINE>label.put("value", maxInstanceActiveTime);<NEW_LINE>labels.add(label);<NEW_LINE>}<NEW_LINE>jsonObject.put("labels", labels);<NEW_LINE>}<NEW_LINE>if (level == ProfileTreePrinter.PrintLevel.INSTANCE) {<NEW_LINE>jsonObject.put("active", activeTime);<NEW_LINE><MASK><NEW_LINE>JSONArray counters = new JSONArray();<NEW_LINE>for (CounterNode node : counterNode.getChildren()) {<NEW_LINE>JSONObject counter = new JSONObject();<NEW_LINE>counter.put(node.getCounter().first, node.getCounter().second);<NEW_LINE>counters.add(counter);<NEW_LINE>}<NEW_LINE>jsonObject.put("counters", counters);<NEW_LINE>}<NEW_LINE>return jsonObject;<NEW_LINE>}
jsonObject.put("non-child", nonChild);
153,849
public void actionPerformed(java.awt.event.ActionEvent ev) {<NEW_LINE>WindowManager wm = WindowManager.getDefault();<NEW_LINE>MultiViewHandler handler = MultiViews.findMultiViewHandler(wm.getRegistry().getActivated());<NEW_LINE>if (handler != null) {<NEW_LINE>MultiViewPerspective pers = handler.getSelectedPerspective();<NEW_LINE>MultiViewPerspective[] all = handler.getPerspectives();<NEW_LINE>for (int i = 0; i < all.length; i++) {<NEW_LINE>if (pers.equals(all[i])) {<NEW_LINE>int newIndex = i != all.length - 1 ? i + 1 : 0;<NEW_LINE>MultiViewDescription selectedDescr = <MASK><NEW_LINE>if (selectedDescr instanceof ContextAwareDescription) {<NEW_LINE>if (((ContextAwareDescription) selectedDescr).isSplitDescription()) {<NEW_LINE>newIndex = i != all.length - 1 ? i + 2 : 1;<NEW_LINE>} else {<NEW_LINE>newIndex = i != all.length - 2 ? i + 2 : 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handler.requestActive(all[newIndex]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Utilities.disabledActionBeep();<NEW_LINE>}<NEW_LINE>}
Accessor.DEFAULT.extractDescription(pers);
85,221
public void resetAdapter() {<NEW_LINE>if (UserSubscriptions.hasSubs()) {<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>usedArray = new CaseInsensitiveArrayList(UserSubscriptions.getSubscriptions(MainActivity.this));<NEW_LINE>adapter = new MainPagerAdapter(getSupportFragmentManager());<NEW_LINE>pager.setAdapter(adapter);<NEW_LINE>if (mTabLayout != null) {<NEW_LINE>mTabLayout.setupWithViewPager(pager);<NEW_LINE>LayoutUtils.scrollToTabAfterLayout(mTabLayout<MASK><NEW_LINE>}<NEW_LINE>setToolbarClick();<NEW_LINE>pager.setCurrentItem(usedArray.indexOf(subToDo));<NEW_LINE>int color = Palette.getColor(subToDo);<NEW_LINE>hea.setBackgroundColor(color);<NEW_LINE>header.setBackgroundColor(color);<NEW_LINE>if (accountsArea != null) {<NEW_LINE>accountsArea.setBackgroundColor(Palette.getDarkerColor(color));<NEW_LINE>}<NEW_LINE>themeSystemBars(subToDo);<NEW_LINE>setRecentBar(subToDo);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
, usedArray.indexOf(subToDo));
1,058,957
private void buildTransactionNameGraph(Model model, TransactionReport report, String type, String name, String ip) {<NEW_LINE>TransactionType t = report.findOrCreateMachine(ip).findOrCreateType(type);<NEW_LINE>TransactionName transactionName = t.findOrCreateName(name);<NEW_LINE>if (transactionName != null) {<NEW_LINE>String graph1 = m_builder.build(new DurationPayload("Duration Distribution"<MASK><NEW_LINE>String graph2 = m_builder.build(new HitPayload("Hits Over Time", "Time (min)", "Count", transactionName));<NEW_LINE>String graph3 = m_builder.build(new AverageTimePayload("Average Duration Over Time", "Time (min)", "Average Duration (ms)", transactionName));<NEW_LINE>String graph4 = m_builder.build(new FailurePayload("Failures Over Time", "Time (min)", "Count", transactionName));<NEW_LINE>model.setGraph1(graph1);<NEW_LINE>model.setGraph2(graph2);<NEW_LINE>model.setGraph3(graph3);<NEW_LINE>model.setGraph4(graph4);<NEW_LINE>}<NEW_LINE>}
, "Duration (ms)", "Count", transactionName));
1,586,704
public void goToPosition() {<NEW_LINE><MASK><NEW_LINE>FocusDialog dialog = new FocusDialog(windowFrame, Translator.get("binary_viewer.go_to.dialog_title"), windowFrame);<NEW_LINE>Container contentPane = dialog.getContentPane();<NEW_LINE>GoToBinaryPanel goToPanel = new GoToBinaryPanel();<NEW_LINE>goToPanel.setCursorPosition(codeArea.getDataPosition());<NEW_LINE>goToPanel.setMaxPosition(codeArea.getDataSize());<NEW_LINE>contentPane.add(goToPanel, BorderLayout.CENTER);<NEW_LINE>final JButton okButton = new JButton(Translator.get("binary_viewer.go_to.ok"));<NEW_LINE>JButton cancelButton = new JButton(Translator.get("cancel"));<NEW_LINE>contentPane.add(DialogToolkit.createOKCancelPanel(okButton, cancelButton, dialog.getRootPane(), e -> {<NEW_LINE>Object source = e.getSource();<NEW_LINE>if (source == okButton) {<NEW_LINE>goToPanel.acceptInput();<NEW_LINE>long targetPosition = goToPanel.getTargetPosition();<NEW_LINE>codeArea.setCaretPosition(targetPosition);<NEW_LINE>codeArea.revealCursor();<NEW_LINE>}<NEW_LINE>dialog.dispose();<NEW_LINE>}), BorderLayout.SOUTH);<NEW_LINE>SwingUtilities.invokeLater(goToPanel::initFocus);<NEW_LINE>dialog.showDialog();<NEW_LINE>}
CodeArea codeArea = binaryComponent.getCodeArea();
1,278,112
private int score(Variable v) {<NEW_LINE>// since these are increasing with distance<NEW_LINE>int variableScore = 100 - v.variableType;<NEW_LINE>int subStringScore = getLongestCommonSubstring(v.name, fParamName).length();<NEW_LINE>// substring scores under 60% are not considered<NEW_LINE>// this prevents marginal matches like a - ba and false - isBool that will<NEW_LINE>// destroy the sort order<NEW_LINE>int shorter = Math.min(v.name.length(), fParamName.length());<NEW_LINE>if (subStringScore < 0.6 * shorter) {<NEW_LINE>subStringScore = 0;<NEW_LINE>}<NEW_LINE>// since ???<NEW_LINE>int positionScore = v.positionScore;<NEW_LINE>int matchedScore = v.alreadyMatched ? 0 : 1;<NEW_LINE>int autoboxingScore <MASK><NEW_LINE>int score = autoboxingScore << 30 | variableScore << 21 | subStringScore << 11 | matchedScore << 10 | positionScore;<NEW_LINE>return score;<NEW_LINE>}
= v.isAutoboxingMatch ? 0 : 1;
1,397,265
public GetInvitationsCountResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetInvitationsCountResult getInvitationsCountResult = new GetInvitationsCountResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getInvitationsCountResult;<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("invitationsCount", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getInvitationsCountResult.setInvitationsCount(context.getUnmarshaller(Long.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 getInvitationsCountResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,063,922
private TagElement findTagElementToInsertAfter(List<TagElement> tags, String tagName) {<NEW_LINE>List<String> tagOrder = Arrays.asList(TagElement.TAG_AUTHOR, TagElement.TAG_VERSION, TagElement.TAG_PARAM, TagElement.TAG_RETURN, TagElement.TAG_THROWS, TagElement.TAG_EXCEPTION, TagElement.TAG_SEE, TagElement.TAG_SINCE, TagElement.TAG_SERIAL, TagElement.TAG_SERIALFIELD, TagElement.TAG_SERIALDATA, <MASK><NEW_LINE>int goalOrdinal = tagOrder.indexOf(tagName);<NEW_LINE>if (goalOrdinal == -1) {<NEW_LINE>return (tags.isEmpty()) ? null : (TagElement) tags.get(tags.size());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < tags.size(); i++) {<NEW_LINE>int tagOrdinal = tagOrder.indexOf(tags.get(i).getTagName());<NEW_LINE>if (tagOrdinal >= goalOrdinal) {<NEW_LINE>return (i == 0) ? null : (TagElement) tags.get(i - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (tags.isEmpty()) ? null : (TagElement) tags.get(tags.size() - 1);<NEW_LINE>}
TagElement.TAG_DEPRECATED, TagElement.TAG_VALUE);
416,811
private void encodeInternal(Object o) {<NEW_LINE>if (o instanceof Map) {<NEW_LINE>encodeMap((Map<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof List) {<NEW_LINE>encodeList((List<Object>) o);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof String) {<NEW_LINE>encodeString((String) o);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof byte[]) {<NEW_LINE>byte[] b = (byte[]) o;<NEW_LINE>encodeInt(b.length, (byte) ':');<NEW_LINE>buf.put(b);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof ByteBuffer) {<NEW_LINE>ByteBuffer clone = ((ByteBuffer) o).slice();<NEW_LINE>encodeInt(clone.remaining(), (byte) ':');<NEW_LINE>buf.put(clone);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof Integer) {<NEW_LINE>buf.put((byte) 'i');<NEW_LINE>encodeInt(((Integer) o).intValue(), (byte) 'e');<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof Long) {<NEW_LINE>buf.put((byte) 'i');<NEW_LINE>encodeLong(((Long) o).longValue(), 'e');<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof RawData) {<NEW_LINE>ByteBuffer raw = ((RawData) o).rawBuf;<NEW_LINE>buf.put(raw.duplicate());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof StringWriter) {<NEW_LINE>StringWriter w = (StringWriter) o;<NEW_LINE>encodeInt(w.length(), (byte) ':');<NEW_LINE>w.writeTo(buf);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (o instanceof Stream) {<NEW_LINE>encodeStream((Stream<Object>) o);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new RuntimeException("unknown object to encode " + o);<NEW_LINE>}
<String, Object>) o);
999,189
final StartTargetedSentimentDetectionJobResult executeStartTargetedSentimentDetectionJob(StartTargetedSentimentDetectionJobRequest startTargetedSentimentDetectionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startTargetedSentimentDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartTargetedSentimentDetectionJobRequest> request = null;<NEW_LINE>Response<StartTargetedSentimentDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartTargetedSentimentDetectionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startTargetedSentimentDetectionJobRequest));<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, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartTargetedSentimentDetectionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartTargetedSentimentDetectionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartTargetedSentimentDetectionJobResultJsonUnmarshaller());<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);
702,358
public void init(Analyzer analyzer) throws UserException {<NEW_LINE>// Compute the memory layout for the generated tuple.<NEW_LINE>computeStats(analyzer);<NEW_LINE>// createDefaultSmap(analyzer);<NEW_LINE>// // populate resolvedTupleExprs and outputSmap_<NEW_LINE>// List<SlotDescriptor> sortTupleSlots = info.getSortTupleDescriptor().getSlots();<NEW_LINE>// List<Expr> slotExprs = info.getSortTupleSlotExprs_();<NEW_LINE>// Preconditions.checkState(sortTupleSlots.size() == slotExprs.size());<NEW_LINE>// populate resolvedTupleExprs_ and outputSmap_<NEW_LINE>List<SlotDescriptor> sortTupleSlots = info.getSortTupleDescriptor().getSlots();<NEW_LINE>List<Expr> slotExprs = info.getSortTupleSlotExprs();<NEW_LINE>Preconditions.checkState(sortTupleSlots.size() == slotExprs.size());<NEW_LINE>resolvedTupleExprs = Lists.newArrayList();<NEW_LINE>outputSmap = new ExprSubstitutionMap();<NEW_LINE>for (int i = 0; i < slotExprs.size(); ++i) {<NEW_LINE>if (!sortTupleSlots.get(i).isMaterialized()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>resolvedTupleExprs.add<MASK><NEW_LINE>outputSmap.put(slotExprs.get(i), new SlotRef(sortTupleSlots.get(i)));<NEW_LINE>}<NEW_LINE>ExprSubstitutionMap childSmap = getCombinedChildSmap();<NEW_LINE>resolvedTupleExprs = Expr.substituteList(resolvedTupleExprs, childSmap, analyzer, false);<NEW_LINE>// Remap the ordering exprs to the tuple materialized by this sort node. The mapping<NEW_LINE>// is a composition of the childSmap and the outputSmap_ because the child node may<NEW_LINE>// have also remapped its input (e.g., as in a a series of (sort->analytic)* nodes).<NEW_LINE>// Parent nodes have have to do the same so set the composition as the outputSmap_.<NEW_LINE>outputSmap = ExprSubstitutionMap.compose(childSmap, outputSmap, analyzer);<NEW_LINE>info.substituteOrderingExprs(outputSmap, analyzer);<NEW_LINE>hasNullableGenerateChild = checkHasNullableGenerateChild();<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("sort id " + tupleIds.get(0).toString() + " smap: " + outputSmap.debugString());<NEW_LINE>LOG.debug("sort input exprs: " + Expr.debugString(resolvedTupleExprs));<NEW_LINE>}<NEW_LINE>}
(slotExprs.get(i));
210,444
public Cluster readCluster(Reader input, boolean verifySchema) {<NEW_LINE>try {<NEW_LINE>SAXBuilder builder = new SAXBuilder(false);<NEW_LINE>Document doc = builder.build(input);<NEW_LINE>if (verifySchema) {<NEW_LINE>Validator validator = this.schema.newValidator();<NEW_LINE>validator.validate(new JDOMSource(doc));<NEW_LINE>}<NEW_LINE>Element root = doc.getRootElement();<NEW_LINE>if (!root.getName().equals(CLUSTER_ELMT))<NEW_LINE>throw new MappingException("Invalid root element: " + doc.getRootElement().getName());<NEW_LINE>String name = root.getChildText(CLUSTER_NAME_ELMT);<NEW_LINE>List<Zone> zones = new ArrayList<Zone>();<NEW_LINE>for (Element node : (List<Element>) root.getChildren(ZONE_ELMT)) zones<MASK><NEW_LINE>List<Node> servers = new ArrayList<Node>();<NEW_LINE>for (Element node : (List<Element>) root.getChildren(SERVER_ELMT)) servers.add(readServer(node));<NEW_LINE>return new Cluster(name, servers, zones);<NEW_LINE>} catch (JDOMException e) {<NEW_LINE>throw new MappingException(e);<NEW_LINE>} catch (SAXException e) {<NEW_LINE>throw new MappingException(e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MappingException(e);<NEW_LINE>}<NEW_LINE>}
.add(readZone(node));
119,161
public HtmlResponse delete(final EditForm form) {<NEW_LINE>verifyCrudMode(form.crudMode, CrudMode.DETAILS);<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asDetailsHtml);<NEW_LINE>verifyToken(this::asDetailsHtml);<NEW_LINE>final String id = form.id;<NEW_LINE>keyMatchService.getKeyMatch(id).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>keyMatchService.delete(entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));<NEW_LINE>ComponentUtil.getKeyMatchHelper().update();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(<MASK><NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), this::asDetailsHtml);<NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>}
e)), this::asEditHtml);
1,849,255
protected BigDecimal computeProrataTemporis(FixedAsset fixedAsset) {<NEW_LINE>BigDecimal prorataTemporis = BigDecimal.ONE;<NEW_LINE>if (fixedAsset.getFixedAssetCategory().getIsProrataTemporis() && !fixedAsset.getAcquisitionDate().equals(fixedAsset.getFirstDepreciationDate())) {<NEW_LINE>LocalDate acquisitionDate = fixedAsset.getAcquisitionDate().minusDays(1);<NEW_LINE>LocalDate depreciationDate = fixedAsset.getFirstDepreciationDate();<NEW_LINE>int acquisitionYear = acquisitionDate.getYear();<NEW_LINE><MASK><NEW_LINE>int acquisitionDay = acquisitionDate.getDayOfMonth();<NEW_LINE>int depreciationYear = depreciationDate.getYear();<NEW_LINE>Month depreciationMonth = depreciationDate.getMonth();<NEW_LINE>int depreciationDay = depreciationDate.getDayOfMonth();<NEW_LINE>// US way<NEW_LINE>if (fixedAsset.getFixedAssetCategory().getIsUSProrataTemporis()) {<NEW_LINE>if (acquisitionMonth == Month.FEBRUARY && depreciationMonth == Month.FEBRUARY && isLastDayOfFebruary(acquisitionYear, acquisitionDay) && isLastDayOfFebruary(depreciationYear, depreciationDay)) {<NEW_LINE>depreciationDay = 30;<NEW_LINE>}<NEW_LINE>if (acquisitionMonth == Month.FEBRUARY && isLastDayOfFebruary(acquisitionYear, acquisitionDay)) {<NEW_LINE>acquisitionDay = 30;<NEW_LINE>}<NEW_LINE>if (acquisitionDay >= 30 && depreciationDay > 30) {<NEW_LINE>depreciationDay = 30;<NEW_LINE>}<NEW_LINE>if (acquisitionDay > 30) {<NEW_LINE>acquisitionDay = 30;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// European way<NEW_LINE>if (acquisitionDay == 31) {<NEW_LINE>acquisitionDay = 30;<NEW_LINE>}<NEW_LINE>if (depreciationDay == 31) {<NEW_LINE>depreciationDay = 30;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BigDecimal nbDaysBetweenAcqAndFirstDepDate = BigDecimal.valueOf(360 * (depreciationYear - acquisitionYear) + 30 * (depreciationMonth.getValue() - acquisitionMonth.getValue()) + (depreciationDay - acquisitionDay)).setScale(CALCULATION_SCALE, RoundingMode.HALF_UP);<NEW_LINE>BigDecimal nbDaysOfPeriod = BigDecimal.valueOf(fixedAsset.getPeriodicityInMonth() * 30).setScale(CALCULATION_SCALE, RoundingMode.HALF_UP);<NEW_LINE>prorataTemporis = nbDaysBetweenAcqAndFirstDepDate.divide(nbDaysOfPeriod, CALCULATION_SCALE, RoundingMode.HALF_UP);<NEW_LINE>}<NEW_LINE>return prorataTemporis;<NEW_LINE>}
Month acquisitionMonth = acquisitionDate.getMonth();
155,283
void preInit(XCreateWindowParams params) {<NEW_LINE>target = (Component) params.get(TARGET);<NEW_LINE>windowType = ((Window) target).getType();<NEW_LINE>params.put(REPARENTED, Boolean.valueOf(isOverrideRedirect() || isSimpleWindow()));<NEW_LINE>super.preInit(params);<NEW_LINE>params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));<NEW_LINE>long eventMask = 0;<NEW_LINE>if (params.containsKey(EVENT_MASK)) {<NEW_LINE>eventMask = ((Long) params.get(EVENT_MASK));<NEW_LINE>}<NEW_LINE>eventMask |= XConstants.VisibilityChangeMask;<NEW_LINE>params.put(EVENT_MASK, eventMask);<NEW_LINE>XA_NET_WM_STATE = XAtom.get("_NET_WM_STATE");<NEW_LINE>params.put(OVERRIDE_REDIRECT, X11_DISABLE_OVERRIDE_FLAG ? Boolean.FALSE : Boolean.valueOf(isOverrideRedirect()));<NEW_LINE>SunToolkit.awtLock();<NEW_LINE>try {<NEW_LINE>windows.add(this);<NEW_LINE>} finally {<NEW_LINE>SunToolkit.awtUnlock();<NEW_LINE>}<NEW_LINE>cachedFocusableWindow = isFocusableWindow();<NEW_LINE>if (!target.isFontSet()) {<NEW_LINE>target.setFont(XWindow.getDefaultFont());<NEW_LINE>// we should not call setFont because it will call a repaint<NEW_LINE>// which the peer may not be ready to do yet.<NEW_LINE>}<NEW_LINE>if (!target.isBackgroundSet()) {<NEW_LINE>target.setBackground(SystemColor.window);<NEW_LINE>// we should not call setBackGround because it will call a repaint<NEW_LINE>// which the peer may not be ready to do yet.<NEW_LINE>}<NEW_LINE>if (!target.isForegroundSet()) {<NEW_LINE>target.setForeground(SystemColor.windowText);<NEW_LINE>// we should not call setForeGround because it will call a repaint<NEW_LINE>// which the peer may not be ready to do yet.<NEW_LINE>}<NEW_LINE>alwaysOnTop = ((Window) target).isAlwaysOnTop() && ((Window) target).isAlwaysOnTopSupported();<NEW_LINE>GraphicsConfiguration gc = getGraphicsConfiguration();<NEW_LINE>((X11GraphicsDevice) gc.getDevice<MASK><NEW_LINE>}
()).addDisplayChangedListener(this);
317,971
private static Constraint<?> createRealConstraint(IntegerConstraint c) {<NEW_LINE>if (c.getLeftOperand() instanceof RealComparison) {<NEW_LINE>RealComparison cmp = (RealComparison) c.getLeftOperand();<NEW_LINE>int value = ((Number) c.getRightOperand().getConcreteValue()).intValue();<NEW_LINE>Comparator op = c.getComparator();<NEW_LINE>Expression<Double> cmp_left = cmp.getLeftOperant();<NEW_LINE>Expression<Double<MASK><NEW_LINE>return createRealConstraint(cmp_left, op, cmp_right, value);<NEW_LINE>} else {<NEW_LINE>assert (c.getRightOperand() instanceof RealComparison);<NEW_LINE>RealComparison cmp = (RealComparison) c.getRightOperand();<NEW_LINE>Comparator op = c.getComparator();<NEW_LINE>Comparator swap_op = op.swap();<NEW_LINE>int value = ((Number) c.getLeftOperand().getConcreteValue()).intValue();<NEW_LINE>int swap_value = -value;<NEW_LINE>Expression<Double> cmp_left = cmp.getLeftOperant();<NEW_LINE>Expression<Double> cmp_right = cmp.getRightOperant();<NEW_LINE>return createRealConstraint(cmp_left, swap_op, cmp_right, swap_value);<NEW_LINE>}<NEW_LINE>}
> cmp_right = cmp.getRightOperant();
973,830
public DeleteBotAliasResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteBotAliasResult deleteBotAliasResult = new DeleteBotAliasResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteBotAliasResult;<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("botAliasId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteBotAliasResult.setBotAliasId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("botId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteBotAliasResult.setBotId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("botAliasStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteBotAliasResult.setBotAliasStatus(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 deleteBotAliasResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
39,709
public void start(Stage stage) throws Exception {<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>SVGGlyphLoader.loadGlyphsFont(MainDemo.class.getResourceAsStream("/fonts/icomoon.svg"), "icomoon.svg");<NEW_LINE>} catch (IOException ioExc) {<NEW_LINE>ioExc.printStackTrace();<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>Flow flow = new Flow(MainController.class);<NEW_LINE>DefaultFlowContainer container = new DefaultFlowContainer();<NEW_LINE>flowContext = new ViewFlowContext();<NEW_LINE>flowContext.register("Stage", stage);<NEW_LINE>flow.createHandler(flowContext).start(container);<NEW_LINE>JFXDecorator decorator = new JFXDecorator(stage, container.getView());<NEW_LINE>decorator.setCustomMaximize(true);<NEW_LINE>decorator.<MASK><NEW_LINE>stage.setTitle("JFoenix Demo");<NEW_LINE>double width = 800;<NEW_LINE>double height = 600;<NEW_LINE>try {<NEW_LINE>Rectangle2D bounds = Screen.getScreens().get(0).getBounds();<NEW_LINE>width = bounds.getWidth() / 2.5;<NEW_LINE>height = bounds.getHeight() / 1.35;<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>Scene scene = new Scene(decorator, width, height);<NEW_LINE>final ObservableList<String> stylesheets = scene.getStylesheets();<NEW_LINE>stylesheets.addAll(JFoenixResources.load("css/jfoenix-fonts.css").toExternalForm(), JFoenixResources.load("css/jfoenix-design.css").toExternalForm(), MainDemo.class.getResource("/css/jfoenix-main-demo.css").toExternalForm());<NEW_LINE>stage.setScene(scene);<NEW_LINE>stage.show();<NEW_LINE>}
setGraphic(new SVGGlyph(""));
155,436
private void sort(char[] arr) {<NEW_LINE>int n = arr.length;<NEW_LINE>// The output character array that will have sorted arr<NEW_LINE>char[] output = new char[n];<NEW_LINE>// Create a count array to store count of inidividul<NEW_LINE>// characters and initialize count array as 0<NEW_LINE>int[] count = new int[256];<NEW_LINE>for (int i = 0; i < 256; ++i) count[i] = 0;<NEW_LINE>// store count of each character<NEW_LINE>for (char anArr1 : arr) ++count[anArr1];<NEW_LINE>// Change count[i] so that count[i] now contains actual<NEW_LINE>// position of this character in output array<NEW_LINE>for (int i = 1; i <= 255; ++i) count[i] += count[i - 1];<NEW_LINE>// Build the output character array<NEW_LINE>for (char anArr : arr) {<NEW_LINE>output[count[anArr] - 1] = anArr;<NEW_LINE>--count[anArr];<NEW_LINE>}<NEW_LINE>// Copy the output array to arr, so that arr now<NEW_LINE>// contains sorted characters<NEW_LINE>System.arraycopy(output, <MASK><NEW_LINE>}
0, arr, 0, n);
432,580
public void registerPush(Hashtable meta, boolean noFallback) {<NEW_LINE>Preferences p = Preferences.userNodeForPackage(com.codename1.ui.Component.class);<NEW_LINE>String user = p.get("user", null);<NEW_LINE>Display d = Display.getInstance();<NEW_LINE>if (user == null) {<NEW_LINE>JPanel pnl = new JPanel();<NEW_LINE>JTextField tf = new JTextField(20);<NEW_LINE>pnl.add(new JLabel("E-Mail For Push"));<NEW_LINE>pnl.add(tf);<NEW_LINE>JOptionPane.showMessageDialog(canvas, pnl, "Email For Push", JOptionPane.PLAIN_MESSAGE);<NEW_LINE>user = tf.getText();<NEW_LINE>p.put("user", user);<NEW_LINE>}<NEW_LINE>d.setProperty("built_by_user", user);<NEW_LINE>String <MASK><NEW_LINE>if (mainClass != null) {<NEW_LINE>mainClass = mainClass.substring(0, mainClass.lastIndexOf('.'));<NEW_LINE>d.setProperty("package_name", mainClass);<NEW_LINE>}<NEW_LINE>super.registerPush(meta, noFallback);<NEW_LINE>if (pushSimulation != null && pushSimulation.isVisible()) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>JOptionPane.showMessageDialog(window, "registerForPush invoked. Use the buttons in the push simulator to send the appropriate callback to your app", "Push Registration", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
mainClass = System.getProperty("MainClass");
712,992
public static void dump(ServletContext ctx) {<NEW_LINE>log.config("ServletContext " + ctx.getServletContextName());<NEW_LINE>log.config("- ServerInfo=" + ctx.getServerInfo());<NEW_LINE>if (!CLogMgt.isLevelFiner())<NEW_LINE>return;<NEW_LINE>boolean first = true;<NEW_LINE>Enumeration e = ctx.getInitParameterNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>if (first)<NEW_LINE>log.finer("InitParameter:");<NEW_LINE>first = false;<NEW_LINE>String key = (String) e.nextElement();<NEW_LINE>Object value = ctx.getInitParameter(key);<NEW_LINE>log.finer(<MASK><NEW_LINE>}<NEW_LINE>first = true;<NEW_LINE>e = ctx.getAttributeNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>if (first)<NEW_LINE>log.finer("Attributes:");<NEW_LINE>first = false;<NEW_LINE>String key = (String) e.nextElement();<NEW_LINE>Object value = ctx.getAttribute(key);<NEW_LINE>log.finer("- " + key + " = " + value);<NEW_LINE>}<NEW_LINE>}
"- " + key + " = " + value);
1,594,906
final StopBuildBatchResult executeStopBuildBatch(StopBuildBatchRequest stopBuildBatchRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopBuildBatchRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopBuildBatchRequest> request = null;<NEW_LINE>Response<StopBuildBatchResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new StopBuildBatchRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopBuildBatchRequest));<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, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopBuildBatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopBuildBatchResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopBuildBatchResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
204,445
// snippet-start:[cf.java2.create_stack.main]<NEW_LINE>public static void createCFStack(CloudFormationClient cfClient, String stackName, String roleARN, String location, String key, String value) {<NEW_LINE>try {<NEW_LINE>CloudFormationWaiter waiter = cfClient.waiter();<NEW_LINE>Parameter myParameter = Parameter.builder().parameterKey(key).parameterValue(value).build();<NEW_LINE>CreateStackRequest stackRequest = CreateStackRequest.builder().stackName(stackName).templateURL(location).roleARN(roleARN).onFailure(OnFailure.ROLLBACK).parameters(myParameter).build();<NEW_LINE>cfClient.createStack(stackRequest);<NEW_LINE>DescribeStacksRequest stacksRequest = DescribeStacksRequest.builder().stackName(stackName).build();<NEW_LINE>WaiterResponse<DescribeStacksResponse> waiterResponse = waiter.waitUntilStackCreateComplete(stacksRequest);<NEW_LINE>waiterResponse.matched().response().ifPresent(System.out::println);<NEW_LINE>System.<MASK><NEW_LINE>} catch (CloudFormationException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
out.println(stackName + " is ready");
1,143,510
private ProcessPreconditionsResolution rejectIfSecurPharmAttributesAreNotOK(final HUEditorRow document) {<NEW_LINE>//<NEW_LINE>// OK if this is not a Pharma product<NEW_LINE>final HUEditorRowAttributes attributes = document.getAttributes();<NEW_LINE>if (!attributes.hasAttribute(AttributeConstants.ATTR_SecurPharmScannedStatus)) {<NEW_LINE>return ProcessPreconditionsResolution.accept();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// NOK if SecurPharm connection is not configured and we deal with a pharma product<NEW_LINE>if (!securPharmService.hasConfig()) {<NEW_LINE>return ProcessPreconditionsResolution.reject("SecurPharm not configured");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// NOK if not scanned and vendor != manufacturer<NEW_LINE>final BPartnerId vendorId = document.getBpartnerId();<NEW_LINE>final BPartnerId manufacturerId = productRepository.getById(document.getProductId()).getManufacturerId();<NEW_LINE>if (!BPartnerId.equals(vendorId, manufacturerId)) {<NEW_LINE>final SecurPharmAttributesStatus status = SecurPharmAttributesStatus.ofNullableCodeOrKnown(attributes<MASK><NEW_LINE>if (status.isUnknown()) {<NEW_LINE>return ProcessPreconditionsResolution.reject(Services.get(IMsgBL.class).getTranslatableMsgText(MSG_ScanRequired));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// OK<NEW_LINE>return ProcessPreconditionsResolution.accept();<NEW_LINE>}
.getValueAsString(AttributeConstants.ATTR_SecurPharmScannedStatus));
240,096
private static List<Row> loadData() throws IOException {<NEW_LINE>List<Row> <MASK><NEW_LINE>ClassLoader classLoader = FlinkQuickStart.class.getClassLoader();<NEW_LINE>final URL resource = classLoader.getResource("starbucks-stores-world.csv");<NEW_LINE>try (BufferedReader br = new BufferedReader(new InputStreamReader(resource.openStream()))) {<NEW_LINE>String line = null;<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>// split by comma, but in quotes<NEW_LINE>String[] parts = line.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)", -1);<NEW_LINE>if (parts[0].isEmpty() || parts[1].isEmpty()) {<NEW_LINE>System.out.println(line);<NEW_LINE>}<NEW_LINE>rows.add(Row.of(Float.parseFloat(parts[0]), Float.parseFloat(parts[1]), parts[2], parts[3]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rows;<NEW_LINE>}
rows = new ArrayList<>();
1,660,636
protected void onPause() {<NEW_LINE>super.onPause();<NEW_LINE>mController.deregisterEventHandler(HANDLER_KEY);<NEW_LINE>mPaused = true;<NEW_LINE>mHomeTime.removeCallbacks(mHomeTimeUpdater);<NEW_LINE>if (!Utils.isCalendarPermissionGranted(this, false)) {<NEW_LINE>// If permission is not granted then just return.<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mContentResolver.unregisterContentObserver(mObserver);<NEW_LINE>if (isFinishing()) {<NEW_LINE>// Stop listening for changes that would require this to be refreshed<NEW_LINE>SharedPreferences prefs = GeneralPreferences.Companion.getSharedPreferences(this);<NEW_LINE>prefs.unregisterOnSharedPreferenceChangeListener(this);<NEW_LINE>}<NEW_LINE>// FRAG_TODO save highlighted days of the week;<NEW_LINE>if (mController.getViewType() != ViewType.EDIT) {<NEW_LINE>Utils.setDefaultView(this, mController.getViewType());<NEW_LINE>}<NEW_LINE>Utils.resetMidnightUpdater(mHandler, mTimeChangesUpdater);<NEW_LINE>Utils.clearTimeChangesReceiver(this, mCalIntentReceiver);<NEW_LINE>}
Log.d(TAG, "Manifest.permission.WRITE_CALENDAR is not granted");
1,004,557
private JsonVendor toJsonVendor(@NonNull final JsonResponseComposite jsonResponseComposite, @NonNull final String tenantId, @Nullable final String bPartnerBasePath) {<NEW_LINE>final JsonResponseBPartner jsonResponseBPartner = jsonResponseComposite.getBpartner();<NEW_LINE>final String bpartnerMetasfreshId = String.valueOf(jsonResponseBPartner.getMetasfreshId().getValue());<NEW_LINE><MASK><NEW_LINE>final int inactive = jsonResponseBPartner.isActive() ? 0 : 1;<NEW_LINE>final JsonVendor.JsonVendorBuilder vendorBuilder = ExportLocationHelper.getBPartnerMainLocation(jsonResponseComposite.getLocations()).map(ExportVendorProcessor::initVendorWithLocationFields).orElseGet(JsonVendor::builder);<NEW_LINE>if (Check.isNotBlank(bPartnerBasePath)) {<NEW_LINE>vendorBuilder.bpartnerDirPath(bPartnerBasePath);<NEW_LINE>}<NEW_LINE>return vendorBuilder.bpartnerValue(jsonResponseBPartner.getCode()).name(bPartnerName).inactive(inactive).flag(Endpoint.VENDOR.getFlag()).tenantId(tenantId).name2(jsonResponseBPartner.getName2()).metasfreshId(bpartnerMetasfreshId).metasfreshURL(jsonResponseBPartner.getMetasfreshUrl()).contacts(toJsonBPartnerContact(jsonResponseComposite.getContacts())).creditorId(jsonResponseBPartner.getCreditorId()).debtorId(jsonResponseBPartner.getDebtorId()).build();<NEW_LINE>}
final String bPartnerName = computeBPartnerNameToExport(jsonResponseBPartner);
766,962
public // parameters: theta and apex. Feel free to modify according to taste.<NEW_LINE>float updateVertices(Engine engine, float t, float rigidity, CurlStyle style) {<NEW_LINE>t = Math.min(1.0f, Math.max(0.0f, t));<NEW_LINE>rigidity = Math.min(1.0f, Math.max(0.0f, rigidity));<NEW_LINE>double rigidAngle = 0;<NEW_LINE>switch(style) {<NEW_LINE>case BREEZE:<NEW_LINE>{<NEW_LINE>double D0 = 0.15f * (1.0 + rigidity);<NEW_LINE>double deformation = D0 + (1.0 - Math.sin(t * Math.PI)) * (1.0 - D0);<NEW_LINE>double apex = -15 * deformation;<NEW_LINE>double theta = -deformation * Math.PI / 2.0;<NEW_LINE>rigidAngle = Math.PI * t;<NEW_LINE>this.deformMesh(engine, (float) theta, (float) apex);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PULL_CORNER:<NEW_LINE>{<NEW_LINE>double D0 = 0.15f * (1.0 + rigidity);<NEW_LINE>double deformation = D0;<NEW_LINE>if (t <= 0.125) {<NEW_LINE>deformation += (1.0 + Math.cos(8.0 * Math.PI * t)) * (1.0f - D0) / 2.0;<NEW_LINE>} else if (t > 0.5) {<NEW_LINE>final float invt = t - 0.5f;<NEW_LINE>final double t1 = Math.max(0.0, invt / 0.5 - 0.125);<NEW_LINE>deformation += (1.0f - D0) * <MASK><NEW_LINE>}<NEW_LINE>double apex = -15 * deformation;<NEW_LINE>double theta = deformation * Math.PI / 2.0;<NEW_LINE>rigidAngle = Math.PI * Math.max(0.0, (t - 0.125) / 0.875);<NEW_LINE>this.deformMesh(engine, (float) theta, (float) apex);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (float) rigidAngle;<NEW_LINE>}
Math.pow(t1, 3.0);
1,096,309
public SQLName name() {<NEW_LINE>SQLName name = super.name();<NEW_LINE>if (lexer.token() == Token.MONKEYS_AT) {<NEW_LINE>lexer.nextToken();<NEW_LINE>if (lexer.token() != Token.IDENTIFIER) {<NEW_LINE>throw new ParserException("syntax error, expect identifier, but " + lexer.token() + ", " + lexer.info());<NEW_LINE>}<NEW_LINE>SQLDbLinkExpr dbLink = new SQLDbLinkExpr();<NEW_LINE>dbLink.setExpr(name);<NEW_LINE><MASK><NEW_LINE>lexer.nextToken();<NEW_LINE>while (lexer.token() == Token.DOT) {<NEW_LINE>lexer.nextToken();<NEW_LINE>String stringVal = lexer.stringVal();<NEW_LINE>accept(Token.IDENTIFIER);<NEW_LINE>link += "." + stringVal;<NEW_LINE>}<NEW_LINE>dbLink.setDbLink(link);<NEW_LINE>return dbLink;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// if (name.nameHashCode64() == FnvHash.Constants.UNSUPPORTED<NEW_LINE>// && lexer.identifierEquals(FnvHash.Constants.TYPE)) {<NEW_LINE>// name = new SQLIdentifierExpr(name.getSimpleName() + " " + lexer.stringVal());<NEW_LINE>// lexer.nextToken();<NEW_LINE>// }<NEW_LINE>return name;<NEW_LINE>}
String link = lexer.stringVal();
395,109
private static String tokenStringOf(Token t) {<NEW_LINE>if (ttypes == null) {<NEW_LINE>java.util.HashMap map = <MASK><NEW_LINE>java.lang.reflect.Field[] fields = GroovyTokenTypes.class.getDeclaredFields();<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>if (fields[i].getType() != int.class)<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>map.put(fields[i].get(null), fields[i].getName());<NEW_LINE>} catch (IllegalAccessException ee) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ttypes = map;<NEW_LINE>}<NEW_LINE>Integer tt = Integer.valueOf(t.getType());<NEW_LINE>Object ttn = ttypes.get(tt);<NEW_LINE>if (ttn == null)<NEW_LINE>ttn = "<" + tt + ">";<NEW_LINE>return "[" + ttn + ",\"" + t.getText() + "\"]";<NEW_LINE>}
new java.util.HashMap();
1,245,388
public void send(final MailMessage message) throws MailException {<NEW_LINE>final EmailAccount emailAccount = mailAccountService.getDefaultSender();<NEW_LINE>if (emailAccount == null) {<NEW_LINE>super.send(message);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Preconditions.checkNotNull(message, "mail message can't be null");<NEW_LINE>final Model related = findEntity(message);<NEW_LINE>final MailSender sender = getMailSender(emailAccount);<NEW_LINE>final Set<String> recipients = recipients(message, related);<NEW_LINE>if (recipients.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final MailMessageRepository messages = Beans.get(MailMessageRepository.class);<NEW_LINE>final MailBuilder builder = sender.compose().subject(getSubject(message, related));<NEW_LINE>for (String recipient : recipients) {<NEW_LINE>builder.to(recipient);<NEW_LINE>}<NEW_LINE>for (MetaAttachment attachment : messages.findAttachments(message)) {<NEW_LINE>final Path filePath = MetaFiles.getPath(attachment.getMetaFile());<NEW_LINE>final File file = filePath.toFile();<NEW_LINE>builder.attach(file.getName(), file.toString());<NEW_LINE>}<NEW_LINE>final MimeMessage email;<NEW_LINE>try {<NEW_LINE>builder.html(template(message, related));<NEW_LINE>email = builder.build(message.getMessageId());<NEW_LINE>final Set<String> <MASK><NEW_LINE>if (message.getParent() != null) {<NEW_LINE>references.add(message.getParent().getMessageId());<NEW_LINE>}<NEW_LINE>if (message.getRoot() != null) {<NEW_LINE>references.add(message.getRoot().getMessageId());<NEW_LINE>}<NEW_LINE>if (!references.isEmpty()) {<NEW_LINE>email.setHeader("References", Joiner.on(" ").skipNulls().join(references));<NEW_LINE>}<NEW_LINE>} catch (MessagingException | IOException e) {<NEW_LINE>throw new MailException(e);<NEW_LINE>}<NEW_LINE>// send email using a separate process to void thread blocking<NEW_LINE>executor.submit(new Callable<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean call() throws Exception {<NEW_LINE>send(sender, email);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
references = new LinkedHashSet<>();
772,185
public void createAt(final File location) throws Exception {<NEW_LINE>if (location.exists()) {<NEW_LINE>if (!FileUtils.deleteQuietly(location)) {<NEW_LINE>throw new IOException("Data already exists at location and it could not be deleted: " + location);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>java.nio.file.Path normalizedLocationPath = location.toPath().normalize();<NEW_LINE>each(new CodeSet.Processor<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void doit(CodeSetEntry e) throws Exception {<NEW_LINE>IPath path = e.getPath();<NEW_LINE>File target = new File(location, path.toString());<NEW_LINE>assertCorrectOutputLocation(normalizedLocationPath, target.<MASK><NEW_LINE>if (e.isDirectory()) {<NEW_LINE>target.mkdirs();<NEW_LINE>} else {<NEW_LINE>IOUtil.pipe(e.getData(), target);<NEW_LINE>if (!IS_WINDOWS) {<NEW_LINE>int mode = e.getUnixMode();<NEW_LINE>if (mode > 0) {<NEW_LINE>Files.setPosixFilePermissions(target.toPath(), OsUtils.posixFilePermissions(mode));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (afterCreateHook != null) {<NEW_LINE>afterCreateHook.afterCreateAt(location);<NEW_LINE>}<NEW_LINE>}
toPath().normalize());
1,396,347
public static Map<String, String> parseTagAttributes(StartElement start) {<NEW_LINE>// Using a map to deduplicate xmlns declarations on the attributes.<NEW_LINE>Map<String, String> attributeMap = new LinkedHashMap<>();<NEW_LINE>Iterator<Attribute> attributes = iterateAttributesFrom(start);<NEW_LINE>while (attributes.hasNext()) {<NEW_LINE><MASK><NEW_LINE>QName name = attribute.getName();<NEW_LINE>// Name used as the resource key, so skip it here.<NEW_LINE>if (ATTR_NAME.equals(name)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String value = escapeXmlValues(attribute.getValue()).replace("\"", "&quot;");<NEW_LINE>if (!name.getNamespaceURI().isEmpty()) {<NEW_LINE>attributeMap.put(name.getPrefix() + ":" + attribute.getName().getLocalPart(), value);<NEW_LINE>} else {<NEW_LINE>attributeMap.put(attribute.getName().getLocalPart(), value);<NEW_LINE>}<NEW_LINE>Iterator<Namespace> namespaces = iterateNamespacesFrom(start);<NEW_LINE>while (namespaces.hasNext()) {<NEW_LINE>Namespace namespace = namespaces.next();<NEW_LINE>attributeMap.put("xmlns:" + namespace.getPrefix(), namespace.getNamespaceURI());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return attributeMap;<NEW_LINE>}
Attribute attribute = attributes.next();
203,898
protected void processClassLevelAnnotations(ConstPool constantPool, ClassPool pool, Object object) throws NotFoundException {<NEW_LINE>if (AnnotationsAttribute.class.isAssignableFrom(object.getClass())) {<NEW_LINE>AnnotationsAttribute attr = (AnnotationsAttribute) object;<NEW_LINE>Annotation[] items = attr.getAnnotations();<NEW_LINE>List<Annotation> newItems = new ArrayList<Annotation>();<NEW_LINE>ArrayMemberValue namedQueryArray = new ArrayMemberValue(constantPool);<NEW_LINE>ArrayMemberValue nativeQueryArray = new ArrayMemberValue(constantPool);<NEW_LINE>for (Annotation annotation : items) {<NEW_LINE>String typeName = annotation.getTypeName();<NEW_LINE>if (typeName.equals(NamedQueries.class.getName())) {<NEW_LINE>namedQueryArray = (ArrayMemberValue) annotation.getMemberValue("value");<NEW_LINE>} else if (typeName.equals(NamedNativeQueries.class.getName())) {<NEW_LINE>nativeQueryArray = (ArrayMemberValue) annotation.getMemberValue("value");<NEW_LINE>} else {<NEW_LINE>newItems.add(annotation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!namedQueries.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>Annotation namedQueriesAnnotation = new Annotation(NamedQueries.class.getName(), constantPool);<NEW_LINE>namedQueriesAnnotation.addMemberValue("value", namedQueryArray);<NEW_LINE>newItems.add(namedQueriesAnnotation);<NEW_LINE>}<NEW_LINE>if (!nativeQueries.isEmpty()) {<NEW_LINE>prepareNativeQueries(constantPool, pool, nativeQueryArray);<NEW_LINE>Annotation nativeQueriesAnnotation = new Annotation(NamedQueries.class.getName(), constantPool);<NEW_LINE>nativeQueriesAnnotation.addMemberValue("value", nativeQueryArray);<NEW_LINE>newItems.add(nativeQueriesAnnotation);<NEW_LINE>}<NEW_LINE>attr.setAnnotations(newItems.toArray(new Annotation[newItems.size()]));<NEW_LINE>}<NEW_LINE>}
prepareNamedQueries(constantPool, pool, namedQueryArray);
1,825,005
public void sendText(String partialMessage, boolean isLast) throws IOException {<NEW_LINE>assertMessageNotNull(partialMessage);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("sendText({},{})", TextUtils.hint(partialMessage), isLast);<NEW_LINE>}<NEW_LINE>Frame frame;<NEW_LINE>switch(messageType) {<NEW_LINE>case -1:<NEW_LINE>// New message!<NEW_LINE>frame = new Frame(OpCode.TEXT);<NEW_LINE>break;<NEW_LINE>case OpCode.TEXT:<NEW_LINE>frame <MASK><NEW_LINE>break;<NEW_LINE>case OpCode.BINARY:<NEW_LINE>throw new IllegalStateException("Cannot send a partial TEXT message: BINARY message in progress");<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Cannot send a partial TEXT message: unrecognized active message type " + OpCode.name(messageType));<NEW_LINE>}<NEW_LINE>frame.setPayload(BufferUtil.toBuffer(partialMessage, UTF_8));<NEW_LINE>frame.setFin(isLast);<NEW_LINE>FutureCallback b = new FutureCallback();<NEW_LINE>sendFrame(frame, b, false);<NEW_LINE>b.block(getBlockingTimeout(), TimeUnit.MILLISECONDS);<NEW_LINE>}
= new Frame(OpCode.CONTINUATION);
1,154,985
public JsonResult execute() {<NEW_LINE>String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID);<NEW_LINE>String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);<NEW_LINE>FeedbackSessionAttributes feedbackSession = logic.getFeedbackSessionFromRecycleBin(feedbackSessionName, courseId);<NEW_LINE>if (feedbackSession == null) {<NEW_LINE>throw new EntityNotFoundException("Feedback session is not in recycle bin");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>logic.restoreFeedbackSessionFromRecycleBin(feedbackSessionName, courseId);<NEW_LINE>} catch (EntityDoesNotExistException e) {<NEW_LINE>throw new EntityNotFoundException(e);<NEW_LINE>}<NEW_LINE>FeedbackSessionAttributes restoredFs = getNonNullFeedbackSession(feedbackSessionName, courseId);<NEW_LINE><MASK><NEW_LINE>InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId());<NEW_LINE>InstructorPermissionSet privilege = constructInstructorPrivileges(instructor, feedbackSessionName);<NEW_LINE>output.setPrivileges(privilege);<NEW_LINE>return new JsonResult(output);<NEW_LINE>}
FeedbackSessionData output = new FeedbackSessionData(restoredFs);
443,857
public boolean saveModel(IArchimateModel model) throws IOException {<NEW_LINE>// Check integrity<NEW_LINE><MASK><NEW_LINE>if (!checker.checkAll()) {<NEW_LINE>if (PlatformUI.isWorkbenchRunning()) {<NEW_LINE>checker.showErrorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// First time to save...<NEW_LINE>if (model.getFile() == null) {<NEW_LINE>File file = askSaveModel();<NEW_LINE>if (file == null) {<NEW_LINE>// cancelled<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>model.setFile(file);<NEW_LINE>}<NEW_LINE>File file = model.getFile();<NEW_LINE>// Save backup (if set in Preferences)<NEW_LINE>if (ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.BACKUP_ON_SAVE) && file.exists()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>FileUtils.copyFile(file, new File(model.getFile().getAbsolutePath() + ".bak"), false);<NEW_LINE>}<NEW_LINE>// Set model version<NEW_LINE>model.setVersion(ModelVersion.VERSION);<NEW_LINE>// Use Archive Manager to save contents<NEW_LINE>IArchiveManager archiveManager = (IArchiveManager) model.getAdapter(IArchiveManager.class);<NEW_LINE>archiveManager.saveModel();<NEW_LINE>// Set CommandStack Save point<NEW_LINE>CommandStack stack = (CommandStack) model.getAdapter(CommandStack.class);<NEW_LINE>if (stack != null) {<NEW_LINE>stack.markSaveLocation();<NEW_LINE>// Send notification to Tree<NEW_LINE>firePropertyChange(model, COMMAND_STACK_CHANGED, true, false);<NEW_LINE>}<NEW_LINE>// Set all diagram models to be marked as "saved" - this is for the editor view persistence<NEW_LINE>markDiagramModelsAsSaved(model);<NEW_LINE>firePropertyChange(this, PROPERTY_MODEL_SAVED, null, model);<NEW_LINE>return true;<NEW_LINE>}
ModelChecker checker = new ModelChecker(model);
1,206,933
public static String renameFile(File from_file, File to_file, boolean fail_on_existing_directory, FileFilter file_filter, ProgressListener pl) {<NEW_LINE>FileTime from_last_modified = null;<NEW_LINE>FileTime from_last_access = null;<NEW_LINE>FileTime from_created = null;<NEW_LINE>try {<NEW_LINE>BasicFileAttributeView from_attributes_view = Files.getFileAttributeView(from_file.<MASK><NEW_LINE>BasicFileAttributes from_attributes = from_attributes_view.readAttributes();<NEW_LINE>from_last_modified = from_attributes.lastModifiedTime();<NEW_LINE>from_last_access = from_attributes.lastAccessTime();<NEW_LINE>from_created = from_attributes.creationTime();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>String result = renameFileSupport(from_file, to_file, fail_on_existing_directory, file_filter, pl);<NEW_LINE>if (result == null) {<NEW_LINE>// try to maintain the file times if they now differ<NEW_LINE>try {<NEW_LINE>BasicFileAttributeView to_attributes_view = Files.getFileAttributeView(to_file.toPath(), BasicFileAttributeView.class);<NEW_LINE>BasicFileAttributes to_attributes = to_attributes_view.readAttributes();<NEW_LINE>FileTime to_last_modified = to_attributes.lastModifiedTime();<NEW_LINE>FileTime to_last_access = to_attributes.lastAccessTime();<NEW_LINE>FileTime to_created = to_attributes.creationTime();<NEW_LINE>if (from_last_modified.equals(to_last_modified) && from_last_access.equals(to_last_access) && from_created.equals(to_created)) {<NEW_LINE>} else {<NEW_LINE>to_attributes_view.setTimes(from_last_modified, from_last_access, from_created);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Debug.out(result);<NEW_LINE>}<NEW_LINE>return (result);<NEW_LINE>}
toPath(), BasicFileAttributeView.class);
227,994
private Bitmap createSnapshot(int x, int y, int w, int h) {<NEW_LINE>int[] bitmapBuffer = new int[w * h];<NEW_LINE>int[] bitmapSource = new int[w * h];<NEW_LINE>IntBuffer intBuffer = IntBuffer.wrap(bitmapBuffer);<NEW_LINE>intBuffer.position(0);<NEW_LINE>try {<NEW_LINE>glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, intBuffer);<NEW_LINE>int offset1, offset2;<NEW_LINE>for (int i = 0; i < h; i++) {<NEW_LINE>offset1 = i * w;<NEW_LINE>offset2 = (<MASK><NEW_LINE>for (int j = 0; j < w; j++) {<NEW_LINE>int texturePixel = bitmapBuffer[offset1 + j];<NEW_LINE>int blue = (texturePixel >> 16) & 0xff;<NEW_LINE>int red = (texturePixel << 16) & 0x00ff0000;<NEW_LINE>int pixel = (texturePixel & 0xff00ff00) | red | blue;<NEW_LINE>bitmapSource[offset2 + j] = pixel;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (GLException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return Bitmap.createBitmap(bitmapSource, w, h, Bitmap.Config.ARGB_8888);<NEW_LINE>}
h - i - 1) * w;
430,947
public RFuture<Map<String, String>> infoAsync(InfoSection section) {<NEW_LINE>if (section == InfoSection.ALL) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_ALL);<NEW_LINE>} else if (section == InfoSection.DEFAULT) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_DEFAULT);<NEW_LINE>} else if (section == InfoSection.SERVER) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_SERVER);<NEW_LINE>} else if (section == InfoSection.CLIENTS) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_CLIENTS);<NEW_LINE>} else if (section == InfoSection.MEMORY) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_MEMORY);<NEW_LINE>} else if (section == InfoSection.PERSISTENCE) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_PERSISTENCE);<NEW_LINE>} else if (section == InfoSection.STATS) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_STATS);<NEW_LINE>} else if (section == InfoSection.REPLICATION) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_REPLICATION);<NEW_LINE>} else if (section == InfoSection.CPU) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_CPU);<NEW_LINE>} else if (section == InfoSection.COMMANDSTATS) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_COMMANDSTATS);<NEW_LINE>} else if (section == InfoSection.CLUSTER) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE<MASK><NEW_LINE>} else if (section == InfoSection.KEYSPACE) {<NEW_LINE>return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.INFO_KEYSPACE);<NEW_LINE>}<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}
, -1, RedisCommands.INFO_CLUSTER);
720,467
public void copyTo(ShortBuffer target) throws CudaException {<NEW_LINE>final int fromIndex = target.position();<NEW_LINE>final <MASK><NEW_LINE>lengthCheck(toIndex - fromIndex, 1);<NEW_LINE>if (target.isDirect()) {<NEW_LINE>// <br/><NEW_LINE>// <br/><NEW_LINE>copyToHostDirect(// <br/><NEW_LINE>deviceId, getAddress(), target, (long) fromIndex << 1, (long) toIndex << 1);<NEW_LINE>} else if (target.hasArray()) {<NEW_LINE>final int offset = target.arrayOffset();<NEW_LINE>copyTo(target.array(), fromIndex + offset, toIndex + offset);<NEW_LINE>} else {<NEW_LINE>final long byteCount = (long) (toIndex - fromIndex) << 1;<NEW_LINE>final int chunkSize = chunkBytes(byteCount);<NEW_LINE>final // <br/><NEW_LINE>ShortBuffer // <br/><NEW_LINE>tmp = allocateDirectBuffer(chunkSize).order(DeviceOrder).asShortBuffer();<NEW_LINE>try {<NEW_LINE>for (long start = 0; start < byteCount; start += chunkSize) {<NEW_LINE>final int chunk = (int) Math.min(byteCount - start, chunkSize);<NEW_LINE>tmp.position(0).limit(chunk >> 1);<NEW_LINE>// <br/><NEW_LINE>// <br/><NEW_LINE>copyToHostDirect(// <br/><NEW_LINE>deviceId, getAddress() + start, tmp, 0, chunk);<NEW_LINE>target.put(tmp);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>freeDirectBuffer(tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>target.position(toIndex);<NEW_LINE>}
int toIndex = target.limit();
1,512,806
private String printTag(TagElement tag) {<NEW_LINE>TagKind kind = tag.getTagKind();<NEW_LINE>// Remove @param tags for parameterized types, such as "@param <T> the type".<NEW_LINE>// TODO(tball): update when (if) Xcode supports Objective C type parameter documenting.<NEW_LINE>if (kind == TagKind.PARAM && hasTypeParam(tag.getFragments())) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>// Xcode 7 compatible tags.<NEW_LINE>if (kind == TagKind.AUTHOR || kind == TagKind.EXCEPTION || kind == TagKind.PARAM || kind == TagKind.RETURN || kind == TagKind.SINCE || kind == TagKind.THROWS || kind == TagKind.VERSION) {<NEW_LINE>// Skip<NEW_LINE>String comment = printTagFragments(tag.getFragments()).trim();<NEW_LINE>return comment.isEmpty() ? "" : String.format("%s %s", kind, comment);<NEW_LINE>}<NEW_LINE>if (kind == TagKind.DEPRECATED) {<NEW_LINE>// Deprecated annotation translated instead.<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>if (kind == TagKind.SEE) {<NEW_LINE>String comment = printTagFragments(tag.getFragments()).trim();<NEW_LINE>return comment.isEmpty() ? "" : "- seealso: " + comment;<NEW_LINE>}<NEW_LINE>if (kind == TagKind.CODE) {<NEW_LINE>String text = printTagFragments(tag.getFragments());<NEW_LINE>if (spanningPreTag) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>return String.format("<code>%s</code>", text.trim());<NEW_LINE>}<NEW_LINE>if (kind == TagKind.LINK) {<NEW_LINE>return formatLinkTag(tag, "<code>%s</code>");<NEW_LINE>}<NEW_LINE>if (kind == TagKind.LINKPLAIN) {<NEW_LINE>return formatLinkTag(tag, "%s");<NEW_LINE>}<NEW_LINE>if (kind == TagKind.LITERAL) {<NEW_LINE>String text = printTagFragments(tag.getFragments()).trim();<NEW_LINE>if (spanningPreTag) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>return escapeHtmlText(text);<NEW_LINE>}<NEW_LINE>if (kind == TagKind.UNKNOWN) {<NEW_LINE>// Skip unknown tags. If --doc-comment-warnings was specified, a warning was<NEW_LINE>// already created.<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
printTagFragments(tag.getFragments());
1,697,518
public static void generateMov(final ITranslationEnvironment environment, final long baseOffset, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>Preconditions.checkNotNull(environment, "Error: Argument environment can't be null");<NEW_LINE><MASK><NEW_LINE>Preconditions.checkNotNull(instructions, "Error: Argument instructions can't be null");<NEW_LINE>long reilOffset = baseOffset;<NEW_LINE>final List<? extends IOperandTree> operands = instruction.getOperands();<NEW_LINE>// Load source operand.<NEW_LINE>final TranslationResult loadSource = Helpers.translateOperand(environment, reilOffset, operands.get(1), true);<NEW_LINE>instructions.addAll(loadSource.getInstructions());<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>reilOffset = baseOffset + instructions.size();<NEW_LINE>// Load destination operand.<NEW_LINE>final TranslationResult loadDest = Helpers.translateOperand(environment, reilOffset, operands.get(0), false);<NEW_LINE>instructions.addAll(loadDest.getInstructions());<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>reilOffset = baseOffset + instructions.size();<NEW_LINE>// Write the loaded value back into the destination<NEW_LINE>Helpers.writeBack(environment, reilOffset, operands.get(0), loadSource.getRegister(), loadDest.getSize(), loadDest.getAddress(), loadDest.getType(), instructions);<NEW_LINE>}
Preconditions.checkNotNull(instruction, "Error: Argument instruction can't be null");
1,300,417
private void registerHandlers(RaftServerProtocol protocol) {<NEW_LINE>protocol.registerOpenSessionHandler(request -> runOnContextIfReady(() -> role.onOpenSession(request), OpenSessionResponse::builder));<NEW_LINE>protocol.registerCloseSessionHandler(request -> runOnContextIfReady(() -> role.onCloseSession(request), CloseSessionResponse::builder));<NEW_LINE>protocol.registerKeepAliveHandler(request -> runOnContextIfReady(() -> role.onKeepAlive(request), KeepAliveResponse::builder));<NEW_LINE>protocol.registerMetadataHandler(request -> runOnContextIfReady(() -> role.onMetadata(request), MetadataResponse::builder));<NEW_LINE>protocol.registerConfigureHandler(request -> runOnContext(() -> role.onConfigure(request)));<NEW_LINE>protocol.registerInstallHandler(request -> runOnContext(() -> role.onInstall(request)));<NEW_LINE>protocol.registerJoinHandler(request -> runOnContext(() -> role.onJoin(request)));<NEW_LINE>protocol.registerReconfigureHandler(request -> runOnContext(() -> role.onReconfigure(request)));<NEW_LINE>protocol.registerLeaveHandler(request -> runOnContext(() -> <MASK><NEW_LINE>protocol.registerTransferHandler(request -> runOnContext(() -> role.onTransfer(request)));<NEW_LINE>protocol.registerAppendHandler(request -> runOnContext(() -> role.onAppend(request)));<NEW_LINE>protocol.registerPollHandler(request -> runOnContext(() -> role.onPoll(request)));<NEW_LINE>protocol.registerVoteHandler(request -> runOnContext(() -> role.onVote(request)));<NEW_LINE>protocol.registerCommandHandler(request -> runOnContextIfReady(() -> role.onCommand(request), CommandResponse::builder));<NEW_LINE>protocol.registerQueryHandler(request -> runOnContextIfReady(() -> role.onQuery(request), QueryResponse::builder));<NEW_LINE>}
role.onLeave(request)));
1,191,428
private void refreshConsumerMaxRate(String consumerId) {<NEW_LINE>logger.info("Refreshing max rate of {}", consumerId);<NEW_LINE>String consumerMaxRatePath = registryPaths.consumerMaxRatePath(consumerId);<NEW_LINE>zookeeper.getNodeData(consumerMaxRatePath).map(consumerMaxRatesDecoder::decode).ifPresent(maxRates -> {<NEW_LINE>int decodedSize = maxRates.size();<NEW_LINE>maxRates.cleanup(clusterAssignmentCache.getConsumerSubscriptions(consumerId));<NEW_LINE>int cleanedSize = maxRates.size();<NEW_LINE>if (decodedSize > cleanedSize) {<NEW_LINE>logger.info("Refreshed max rates of {} with {} subscriptions ({} stale entries omitted)", <MASK><NEW_LINE>} else {<NEW_LINE>logger.info("Refreshed max rates of {} with {} subscriptions", consumerId, cleanedSize);<NEW_LINE>}<NEW_LINE>consumersMaxRates.put(consumerId, maxRates);<NEW_LINE>});<NEW_LINE>}
consumerId, cleanedSize, decodedSize - cleanedSize);
1,003,294
public static CreateBatchJobsResponse unmarshall(CreateBatchJobsResponse createBatchJobsResponse, UnmarshallerContext _ctx) {<NEW_LINE>createBatchJobsResponse.setRequestId(_ctx.stringValue("CreateBatchJobsResponse.RequestId"));<NEW_LINE>createBatchJobsResponse.setCode(_ctx.stringValue("CreateBatchJobsResponse.Code"));<NEW_LINE>createBatchJobsResponse.setHttpStatusCode(_ctx.integerValue("CreateBatchJobsResponse.HttpStatusCode"));<NEW_LINE>createBatchJobsResponse.setMessage(_ctx.stringValue("CreateBatchJobsResponse.Message"));<NEW_LINE>createBatchJobsResponse.setSuccess(_ctx.booleanValue("CreateBatchJobsResponse.Success"));<NEW_LINE>BatchJob batchJob = new BatchJob();<NEW_LINE>batchJob.setBatchJobId(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.BatchJobId"));<NEW_LINE>batchJob.setCreationTime(_ctx.longValue("CreateBatchJobsResponse.BatchJob.CreationTime"));<NEW_LINE>batchJob.setJobFilePath(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.JobFilePath"));<NEW_LINE>batchJob.setJobGroupDescription(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.JobGroupDescription"));<NEW_LINE>batchJob.setJobGroupName(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.JobGroupName"));<NEW_LINE>batchJob.setScenarioId(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.ScenarioId"));<NEW_LINE>List<String> callingNumbers = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateBatchJobsResponse.BatchJob.CallingNumbers.Length"); i++) {<NEW_LINE>callingNumbers.add(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.CallingNumbers[" + i + "]"));<NEW_LINE>}<NEW_LINE>batchJob.setCallingNumbers(callingNumbers);<NEW_LINE>Strategy strategy = new Strategy();<NEW_LINE>strategy.setCustomized(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.Customized"));<NEW_LINE>strategy.setEndTime(_ctx.longValue("CreateBatchJobsResponse.BatchJob.Strategy.EndTime"));<NEW_LINE>strategy.setFollowUpStrategy(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.FollowUpStrategy"));<NEW_LINE>strategy.setIsTemplate(_ctx.booleanValue("CreateBatchJobsResponse.BatchJob.Strategy.IsTemplate"));<NEW_LINE>strategy.setMaxAttemptsPerDay(_ctx.integerValue("CreateBatchJobsResponse.BatchJob.Strategy.MaxAttemptsPerDay"));<NEW_LINE>strategy.setMinAttemptInterval(_ctx.integerValue("CreateBatchJobsResponse.BatchJob.Strategy.MinAttemptInterval"));<NEW_LINE>strategy.setRepeatBy(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.RepeatBy"));<NEW_LINE>strategy.setRoutingStrategy(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.RoutingStrategy"));<NEW_LINE>strategy.setStartTime(_ctx.longValue("CreateBatchJobsResponse.BatchJob.Strategy.StartTime"));<NEW_LINE>strategy.setStrategyDescription(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.StrategyDescription"));<NEW_LINE>strategy.setStrategyId(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.StrategyId"));<NEW_LINE>strategy.setStrategyName(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.StrategyName"));<NEW_LINE>strategy.setType(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.Type"));<NEW_LINE>List<String> repeatDays = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateBatchJobsResponse.BatchJob.Strategy.RepeatDays.Length"); i++) {<NEW_LINE>repeatDays.add(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.RepeatDays[" + i + "]"));<NEW_LINE>}<NEW_LINE>strategy.setRepeatDays(repeatDays);<NEW_LINE>List<TimeFrame> workingTime = new ArrayList<TimeFrame>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateBatchJobsResponse.BatchJob.Strategy.WorkingTime.Length"); i++) {<NEW_LINE>TimeFrame timeFrame = new TimeFrame();<NEW_LINE>timeFrame.setBeginTime(_ctx.stringValue<MASK><NEW_LINE>timeFrame.setEndTime(_ctx.stringValue("CreateBatchJobsResponse.BatchJob.Strategy.WorkingTime[" + i + "].EndTime"));<NEW_LINE>workingTime.add(timeFrame);<NEW_LINE>}<NEW_LINE>strategy.setWorkingTime(workingTime);<NEW_LINE>batchJob.setStrategy(strategy);<NEW_LINE>createBatchJobsResponse.setBatchJob(batchJob);<NEW_LINE>return createBatchJobsResponse;<NEW_LINE>}
("CreateBatchJobsResponse.BatchJob.Strategy.WorkingTime[" + i + "].BeginTime"));
433,823
public WebsiteCaSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>WebsiteCaSummary websiteCaSummary = new WebsiteCaSummary();<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("WebsiteCaId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>websiteCaSummary.setWebsiteCaId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("CreatedTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>websiteCaSummary.setCreatedTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DisplayName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>websiteCaSummary.setDisplayName(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 websiteCaSummary;<NEW_LINE>}
class).unmarshall(context));
1,234,906
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.aptana.ide.core.io.ConnectionPoint#loadState(com.aptana.ide.core.io.epl.IMemento)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void loadState(IMemento memento) {<NEW_LINE>super.loadState(memento);<NEW_LINE>IMemento child = memento.getChild(ELEMENT_HOST);<NEW_LINE>if (child != null) {<NEW_LINE>host = child.getTextData();<NEW_LINE>}<NEW_LINE>child = memento.getChild(ELEMENT_PORT);<NEW_LINE>if (child != null) {<NEW_LINE>try {<NEW_LINE>port = Integer.parseInt(child.getTextData());<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>child = memento.getChild(ELEMENT_PATH);<NEW_LINE>if (child != null) {<NEW_LINE>String text = child.getTextData();<NEW_LINE>if (text != null) {<NEW_LINE>path = Path.fromPortableString(text);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>child = memento.getChild(ELEMENT_LOGIN);<NEW_LINE>if (child != null) {<NEW_LINE>login = child.getTextData();<NEW_LINE>}<NEW_LINE>child = memento.getChild(ELEMENT_PASSIVE);<NEW_LINE>if (child != null) {<NEW_LINE>passiveMode = Boolean.parseBoolean(child.getTextData());<NEW_LINE>}<NEW_LINE>child = memento.getChild(ELEMENT_TRANSFER_TYPE);<NEW_LINE>if (child != null) {<NEW_LINE>transferType = child.getTextData();<NEW_LINE>}<NEW_LINE>child = memento.getChild(ELEMENT_ENCODING);<NEW_LINE>if (child != null) {<NEW_LINE>encoding = child.getTextData();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (child != null) {<NEW_LINE>timezone = child.getTextData();<NEW_LINE>}<NEW_LINE>}
child = memento.getChild(ELEMENT_TIMEZONE);
995,286
public void scan(int index, GradPair left, GradPair right) {<NEW_LINE>if (numClass == 2 || multiClassMultiTree) {<NEW_LINE>((BinaryGradPair) left).plusBy(gradients[index], hessians[index]);<NEW_LINE>((BinaryGradPair) right).subtractBy(gradients[index], hessians[index]);<NEW_LINE>} else if (!fullHessian) {<NEW_LINE>MultiGradPair leftMulti = (MultiGradPair) left;<NEW_LINE>double[] leftGrad = leftMulti.getGrad();<NEW_LINE>double[] leftHess = leftMulti.getHess();<NEW_LINE>MultiGradPair rightMulti = (MultiGradPair) right;<NEW_LINE>double[] rightGrad = rightMulti.getGrad();<NEW_LINE>double[] rightHess = rightMulti.getHess();<NEW_LINE>int offset = index * numClass;<NEW_LINE>for (int i = 0; i < numClass; i++) {<NEW_LINE>leftGrad[i] += gradients[offset + i];<NEW_LINE>leftHess[i] += hessians[offset + i];<NEW_LINE>rightGrad[i] -= gradients[offset + i];<NEW_LINE>rightHess[i] -= hessians[offset + i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MultiGradPair leftMulti = (MultiGradPair) left;<NEW_LINE>double[] leftGrad = leftMulti.getGrad();<NEW_LINE>double[] leftHess = leftMulti.getHess();<NEW_LINE>MultiGradPair rightMulti = (MultiGradPair) right;<NEW_LINE>double[] rightGrad = rightMulti.getGrad();<NEW_LINE>double[] rightHess = rightMulti.getHess();<NEW_LINE>int gradOffset = index * leftGrad.length;<NEW_LINE>int hessOffset = index * leftHess.length;<NEW_LINE>for (int i = 0; i < leftGrad.length; i++) {<NEW_LINE>leftGrad[i] += gradients[gradOffset + i];<NEW_LINE>rightGrad[i<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < leftHess.length; i++) {<NEW_LINE>leftHess[i] += hessians[hessOffset + i];<NEW_LINE>rightHess[i] -= hessians[hessOffset + i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] -= gradients[gradOffset + i];
1,171,694
/*<NEW_LINE>* Execute same test as above only make execution concurrent<NEW_LINE>*/<NEW_LINE>@Test<NEW_LINE>public void testConcurrentExecute() throws Exception {<NEW_LINE>Log.info(c, "Begin concurrent Persistent test", "affirm test begin");<NEW_LINE>ExecutorService executor = null;<NEW_LINE>try {<NEW_LINE>executor = Executors.newFixedThreadPool(2);<NEW_LINE><MASK><NEW_LINE>CallableServlet callServ2 = new CallableServlet(server2);<NEW_LINE>Collection<CallableServlet> collection = new ArrayList<CallableServlet>();<NEW_LINE>collection.add(callServ1);<NEW_LINE>collection.add(callServ2);<NEW_LINE>List<Future<String>> results = executor.invokeAll(collection, 100L, TimeUnit.SECONDS);<NEW_LINE>String failure = "";<NEW_LINE>// Make sure both servlet calls are complete<NEW_LINE>if (results.size() != 2) {<NEW_LINE>throw new Exception("Both servers were not successfully called ");<NEW_LINE>} else {<NEW_LINE>// Check each result for success message<NEW_LINE>int i = 0;<NEW_LINE>for (Future<String> result : results) {<NEW_LINE>String output = result.get();<NEW_LINE>if (output.indexOf("COMPLETED SUCCESSFULLY") < 0)<NEW_LINE>failure += "\r\n----- SERVER " + (++i) + " OUTPUT -----\r\n" + output;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Make sure we got all success messages<NEW_LINE>assertEquals("", failure);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>if (executor != null)<NEW_LINE>executor.shutdown();<NEW_LINE>}<NEW_LINE>}
CallableServlet callServ1 = new CallableServlet(server1);
1,211,306
public BackendEntry writeVertexLabel(VertexLabel vertexLabel) {<NEW_LINE>TableBackendEntry entry = newBackendEntry(vertexLabel);<NEW_LINE>entry.column(HugeKeys.ID, vertexLabel.id().asLong());<NEW_LINE>entry.column(HugeKeys.NAME, vertexLabel.name());<NEW_LINE>entry.column(HugeKeys.ID_STRATEGY, vertexLabel.idStrategy().code());<NEW_LINE>entry.column(HugeKeys.PROPERTIES, this.toLongSet(vertexLabel.properties()));<NEW_LINE>entry.column(HugeKeys.PRIMARY_KEYS, this.toLongList<MASK><NEW_LINE>entry.column(HugeKeys.NULLABLE_KEYS, this.toLongSet(vertexLabel.nullableKeys()));<NEW_LINE>entry.column(HugeKeys.INDEX_LABELS, this.toLongSet(vertexLabel.indexLabels()));<NEW_LINE>this.writeEnableLabelIndex(vertexLabel, entry);<NEW_LINE>this.writeUserdata(vertexLabel, entry);<NEW_LINE>entry.column(HugeKeys.STATUS, vertexLabel.status().code());<NEW_LINE>entry.column(HugeKeys.TTL, vertexLabel.ttl());<NEW_LINE>entry.column(HugeKeys.TTL_START_TIME, vertexLabel.ttlStartTime().asLong());<NEW_LINE>return entry;<NEW_LINE>}
(vertexLabel.primaryKeys()));
271,799
private Size applyPreviewCropping(@NonNull Size referenceSize, @NonNull PointF referencePoint) {<NEW_LINE>Size previewStreamSize = this.previewStreamSize;<NEW_LINE>Size previewSurfaceSize = referenceSize;<NEW_LINE>int referenceWidth = previewSurfaceSize.getWidth();<NEW_LINE>int referenceHeight = previewSurfaceSize.getHeight();<NEW_LINE>AspectRatio previewStreamAspectRatio = AspectRatio.of(previewStreamSize);<NEW_LINE>AspectRatio previewSurfaceAspectRatio = AspectRatio.of(previewSurfaceSize);<NEW_LINE>if (previewIsCropping) {<NEW_LINE>if (previewStreamAspectRatio.toFloat() > previewSurfaceAspectRatio.toFloat()) {<NEW_LINE>// Stream is larger. The x coordinate must be increased: a touch on the left side<NEW_LINE>// of the surface is not on the left size of stream (it's more to the right).<NEW_LINE>float scale = previewStreamAspectRatio.toFloat() / previewSurfaceAspectRatio.toFloat();<NEW_LINE>referencePoint.x += previewSurfaceSize.getWidth() * (scale - 1F) / 2F;<NEW_LINE>referenceWidth = Math.round(previewSurfaceSize.getWidth() * scale);<NEW_LINE>} else {<NEW_LINE>// Stream is taller. The y coordinate must be increased: a touch on the top side<NEW_LINE>// of the surface is not on the top size of stream (it's a bit lower).<NEW_LINE>float scale = previewSurfaceAspectRatio.toFloat<MASK><NEW_LINE>referencePoint.y += previewSurfaceSize.getHeight() * (scale - 1F) / 2F;<NEW_LINE>referenceHeight = Math.round(previewSurfaceSize.getHeight() * scale);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Size(referenceWidth, referenceHeight);<NEW_LINE>}
() / previewStreamAspectRatio.toFloat();
177,243
protected void paint(Graphics2D g, boolean border, boolean area) {<NEW_LINE>if (radius == 0)<NEW_LINE>return;<NEW_LINE>Zone zone = MapTool.getCampaign().getZone(zoneId);<NEW_LINE>if (zone == null)<NEW_LINE>return;<NEW_LINE>// Find the proper distance<NEW_LINE>int gridSize = zone<MASK><NEW_LINE>for (int y = 0; y < radius; y++) {<NEW_LINE>for (int x = 0; x < radius; x++) {<NEW_LINE>// Get the offset to the corner of the square<NEW_LINE>int xOff = x * gridSize;<NEW_LINE>int yOff = y * gridSize;<NEW_LINE>// Template specific painting<NEW_LINE>if (border)<NEW_LINE>paintBorder(g, x, y, xOff, yOff, gridSize, getDistance(x, y));<NEW_LINE>if (area)<NEW_LINE>paintArea(g, x, y, xOff, yOff, gridSize, getDistance(x, y));<NEW_LINE>}<NEW_LINE>// endfor<NEW_LINE>}<NEW_LINE>// endfor<NEW_LINE>}
.getGrid().getSize();
765,698
public static String decodeToken(String token) throws S3Exception {<NEW_LINE>if (token != null && token.length() > 0) {<NEW_LINE>int indexSeparator = token.indexOf(CONTINUATION_TOKEN_SEPARATOR);<NEW_LINE>if (indexSeparator == -1) {<NEW_LINE>throw new S3Exception(token, S3ErrorCode.INVALID_CONTINUATION_TOKEN);<NEW_LINE>}<NEW_LINE>String hex = token.substring(0, indexSeparator);<NEW_LINE>String digest = token.substring(indexSeparator + 1);<NEW_LINE>String digestActualKey = DigestUtils.sha256Hex(hex);<NEW_LINE>if (!digest.equals(digestActualKey)) {<NEW_LINE>throw new S3Exception(token, S3ErrorCode.INVALID_CONTINUATION_TOKEN);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ByteBuffer buffer = ByteBuffer.wrap(Hex.decodeHex(hex));<NEW_LINE>return new String(buffer.array(), StandardCharsets.UTF_8);<NEW_LINE>} catch (DecoderException e) {<NEW_LINE>throw new S3Exception(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>}
e, token, S3ErrorCode.INVALID_CONTINUATION_TOKEN);
577,806
private void handleArrayIteration(EnhancedForStatement node) {<NEW_LINE>Expression expression = node.getExpression();<NEW_LINE>ArrayType expressionType = (ArrayType) expression.getTypeMirror();<NEW_LINE>VariableElement loopVariable = node.getParameter().getVariableElement();<NEW_LINE>TypeMirror componentType = expressionType.getComponentType();<NEW_LINE>TypeElement iosArrayType = typeUtil.getIosArray(componentType);<NEW_LINE>TypeMirror bufferType = new PointerType(componentType);<NEW_LINE>VariableElement arrayVariable = GeneratedVariableElement.newLocalVar("a__", expressionType, null);<NEW_LINE>VariableElement bufferVariable = GeneratedVariableElement.newLocalVar("b__", bufferType, null).setTypeQualifiers("const*");<NEW_LINE>VariableElement endVariable = GeneratedVariableElement.newLocalVar("e__", bufferType, null).setTypeQualifiers("const*");<NEW_LINE>VariableElement bufferField = GeneratedVariableElement.newField("buffer", bufferType, iosArrayType).addModifiers(Modifier.PUBLIC);<NEW_LINE>VariableElement sizeField = GeneratedVariableElement.newField("size", typeUtil.getInt(), iosArrayType).addModifiers(Modifier.PUBLIC);<NEW_LINE>VariableDeclarationStatement arrayDecl = new VariableDeclarationStatement(arrayVariable, TreeUtil.remove(expression));<NEW_LINE>FieldAccess bufferAccess = new FieldAccess(bufferField, new SimpleName(arrayVariable));<NEW_LINE>VariableDeclarationStatement bufferDecl <MASK><NEW_LINE>InfixExpression endInit = new InfixExpression(bufferType, InfixExpression.Operator.PLUS, new SimpleName(bufferVariable), new FieldAccess(sizeField, new SimpleName(arrayVariable)));<NEW_LINE>VariableDeclarationStatement endDecl = new VariableDeclarationStatement(endVariable, endInit);<NEW_LINE>WhileStatement loop = new WhileStatement();<NEW_LINE>loop.setExpression(new InfixExpression(typeUtil.getBoolean(), InfixExpression.Operator.LESS, new SimpleName(bufferVariable), new SimpleName(endVariable)));<NEW_LINE>Block newLoopBody = makeBlock(TreeUtil.remove(node.getBody()));<NEW_LINE>loop.setBody(newLoopBody);<NEW_LINE>newLoopBody.addStatement(0, new VariableDeclarationStatement(loopVariable, new PrefixExpression(componentType, PrefixExpression.Operator.DEREFERENCE, new PostfixExpression(bufferVariable, PostfixExpression.Operator.INCREMENT))));<NEW_LINE>Block block = new Block();<NEW_LINE>List<Statement> stmts = block.getStatements();<NEW_LINE>stmts.add(arrayDecl);<NEW_LINE>stmts.add(bufferDecl);<NEW_LINE>stmts.add(endDecl);<NEW_LINE>stmts.add(loop);<NEW_LINE>replaceLoop(node, block, loop);<NEW_LINE>}
= new VariableDeclarationStatement(bufferVariable, bufferAccess);
1,669,372
public void cleanupEvents(String last_id, Table table, String token, boolean includeAutomaticEvents) {<NEW_LINE>final String tableName = table.getName();<NEW_LINE>try {<NEW_LINE>final SQLiteDatabase db = mDb.getWritableDatabase();<NEW_LINE>StringBuffer deleteQuery = new StringBuffer("_id <= " + last_id + " AND " + KEY_TOKEN + " = '" + token + "'");<NEW_LINE>if (!includeAutomaticEvents) {<NEW_LINE>deleteQuery.append(" AND " + KEY_AUTOMATIC_DATA + "=0");<NEW_LINE>}<NEW_LINE>db.delete(tableName, deleteQuery.toString(), null);<NEW_LINE>} catch (final SQLiteException e) {<NEW_LINE>MPLog.e(LOGTAG, "Could not clean sent Mixpanel records from " + tableName + ". Re-initializing database.", e);<NEW_LINE>// We assume that in general, the results of a SQL exception are<NEW_LINE>// unrecoverable, and could be associated with an oversized or<NEW_LINE>// otherwise unusable DB. Better to bomb it and get back on track<NEW_LINE>// than to leave it junked up (and maybe filling up the disk.)<NEW_LINE>mDb.deleteDatabase();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>MPLog.e(LOGTAG, <MASK><NEW_LINE>mDb.deleteDatabase();<NEW_LINE>} finally {<NEW_LINE>mDb.close();<NEW_LINE>}<NEW_LINE>}
"Unknown exception. Could not clean sent Mixpanel records from " + tableName + ".Re-initializing database.", e);
1,592,283
final DescribeDomainChangeProgressResult executeDescribeDomainChangeProgress(DescribeDomainChangeProgressRequest describeDomainChangeProgressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDomainChangeProgressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDomainChangeProgressRequest> request = null;<NEW_LINE>Response<DescribeDomainChangeProgressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDomainChangeProgressRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDomainChangeProgressRequest));<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, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDomainChangeProgress");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDomainChangeProgressResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDomainChangeProgressResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
299,613
public KafkaStreamService.Stream of(Class<?> clientId, Class<?> groupId, Topology topology, Properties properties, Logger logger) {<NEW_LINE>properties.putAll(clientConfig.getProperties());<NEW_LINE>if (this.streamConfig.getProperties() != null) {<NEW_LINE>properties.<MASK><NEW_LINE>}<NEW_LINE>properties.put(CommonClientConfigs.CLIENT_ID_CONFIG, clientId.getName());<NEW_LINE>properties.put(StreamsConfig.APPLICATION_ID_CONFIG, kafkaConfigService.getConsumerGroupName(groupId));<NEW_LINE>// hack, we send application context in order to use on exception handler<NEW_LINE>properties.put(StreamsConfig.DEFAULT_PRODUCTION_EXCEPTION_HANDLER_CLASS_CONFIG, KafkaExecutorProductionExceptionHandler.class);<NEW_LINE>properties.put(APPLICATION_CONTEXT_CONFIG, applicationContext);<NEW_LINE>properties.put(StreamsConfig.DEFAULT_DESERIALIZATION_EXCEPTION_HANDLER_CLASS_CONFIG, KafkaDeserializationExceptionHandler.class);<NEW_LINE>// interceptor<NEW_LINE>if (clientConfig.getLoggers() != null) {<NEW_LINE>properties.put(StreamsConfig.PRODUCER_PREFIX + ProducerConfig.INTERCEPTOR_CLASSES_CONFIG, ProducerInterceptor.class.getName());<NEW_LINE>properties.put(StreamsConfig.MAIN_CONSUMER_PREFIX + ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG, ConsumerInterceptor.class.getName());<NEW_LINE>}<NEW_LINE>if (properties.containsKey(StreamsConfig.STATE_DIR_CONFIG)) {<NEW_LINE>File stateDir = new File((String) properties.get(StreamsConfig.STATE_DIR_CONFIG));<NEW_LINE>if (!stateDir.exists()) {<NEW_LINE>// noinspection ResultOfMethodCallIgnored<NEW_LINE>stateDir.mkdirs();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Stream stream = new Stream(topology, properties, metricsEnabled ? metricRegistry : null, logger);<NEW_LINE>eventPublisher.publishEvent(new KafkaStreamEndpoint.Event(clientId.getName(), stream));<NEW_LINE>return stream;<NEW_LINE>}
putAll(streamConfig.getProperties());
993,724
@Produces(MediaType.SERVER_SENT_EVENTS)<NEW_LINE>public void startDomain(@PathParam("id") final String id, @Context SseEventSink domainSink, @Context Sse sse) {<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>domainSink.send(sse.newEventBuilder().name("domain-progress").data(String.class, "starting domain " + id <MASK><NEW_LINE>Thread.sleep(200);<NEW_LINE>domainSink.send(sse.newEventBuilder().name("domain-progress").data(String.class, "50%").build());<NEW_LINE>Thread.sleep(200);<NEW_LINE>domainSink.send(sse.newEventBuilder().name("domain-progress").data(String.class, "60%").build());<NEW_LINE>Thread.sleep(200);<NEW_LINE>domainSink.send(sse.newEventBuilder().name("domain-progress").data(String.class, "70%").build());<NEW_LINE>Thread.sleep(200);<NEW_LINE>domainSink.send(sse.newEventBuilder().name("domain-progress").data(String.class, "99%").build());<NEW_LINE>Thread.sleep(200);<NEW_LINE>domainSink.send(sse.newEventBuilder().name("domain-progress").data(String.class, "done").build());<NEW_LINE>domainSink.close();<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>}
+ " ...").build());
1,004,656
private static GapiPaths findTools() {<NEW_LINE>return ImmutableList.<Supplier<File>>of(() -> {<NEW_LINE>String gapidRoot = gapidPath.get();<NEW_LINE>return "".equals(gapidRoot) <MASK><NEW_LINE>}, () -> {<NEW_LINE>String gapidRoot = System.getenv(GAPID_ROOT_ENV_VAR);<NEW_LINE>return gapidRoot != null && gapidRoot.length() > 0 ? new File(gapidRoot) : null;<NEW_LINE>}, () -> join(new File(OS.userHomeDir), USER_HOME_GAPID_ROOT), () -> join(new File(OS.userHomeDir), USER_HOME_GAPID_ROOT, GAPID_PKG_SUBDIR)).stream().map(dir -> checkForTools(dir.get())).filter(GapiPaths::shouldUse).findFirst().orElse(MISSING);<NEW_LINE>}
? null : new File(gapidRoot);
69,612
public List<String> findPermissionsInSolrOnly() throws SearchException {<NEW_LINE>List<String> permissionInSolrOnly = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>int rows = 100;<NEW_LINE>SolrQuery q = (new SolrQuery(SearchFields.DEFINITION_POINT_DVOBJECT_ID + ":*")).setRows(rows).setSort(SortClause.asc(SearchFields.ID));<NEW_LINE>String cursorMark = CursorMarkParams.CURSOR_MARK_START;<NEW_LINE>boolean done = false;<NEW_LINE>while (!done) {<NEW_LINE>q.set(CursorMarkParams.CURSOR_MARK_PARAM, cursorMark);<NEW_LINE>QueryResponse <MASK><NEW_LINE>String nextCursorMark = rsp.getNextCursorMark();<NEW_LINE>SolrDocumentList list = rsp.getResults();<NEW_LINE>for (SolrDocument doc : list) {<NEW_LINE>long id = Long.parseLong((String) doc.getFieldValue(SearchFields.DEFINITION_POINT_DVOBJECT_ID));<NEW_LINE>if (!dvObjectService.checkExists(id)) {<NEW_LINE>permissionInSolrOnly.add((String) doc.getFieldValue(SearchFields.ID));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cursorMark.equals(nextCursorMark)) {<NEW_LINE>done = true;<NEW_LINE>}<NEW_LINE>cursorMark = nextCursorMark;<NEW_LINE>}<NEW_LINE>} catch (SolrServerException | IOException ex) {<NEW_LINE>throw new SearchException("Error searching Solr for permissions", ex);<NEW_LINE>}<NEW_LINE>return permissionInSolrOnly;<NEW_LINE>}
rsp = solrServer.query(q);
705,227
final DeleteAccessPointForObjectLambdaResult executeDeleteAccessPointForObjectLambda(DeleteAccessPointForObjectLambdaRequest deleteAccessPointForObjectLambdaRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAccessPointForObjectLambdaRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteAccessPointForObjectLambdaRequest> request = null;<NEW_LINE>Response<DeleteAccessPointForObjectLambdaResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteAccessPointForObjectLambdaRequestMarshaller().marshall(super.beforeMarshalling(deleteAccessPointForObjectLambdaRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAccessPointForObjectLambda");<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(deleteAccessPointForObjectLambdaRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(deleteAccessPointForObjectLambdaRequest.getAccountId(), "AccountId", "deleteAccessPointForObjectLambdaRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", deleteAccessPointForObjectLambdaRequest.getAccountId());<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteAccessPointForObjectLambdaResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<DeleteAccessPointForObjectLambdaResult>(new DeleteAccessPointForObjectLambdaResultStaxUnmarshaller());<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>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
859,093
public static ListCustomPersonsResponse unmarshall(ListCustomPersonsResponse listCustomPersonsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCustomPersonsResponse.setRequestId(_ctx.stringValue("ListCustomPersonsResponse.RequestId"));<NEW_LINE>List<Category> categories = new ArrayList<Category>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCustomPersonsResponse.Categories.Length"); i++) {<NEW_LINE>Category category = new Category();<NEW_LINE>category.setCategoryId(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i + "].CategoryId"));<NEW_LINE>category.setCategoryName(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i + "].CategoryName"));<NEW_LINE>category.setCategoryDescription(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i + "].CategoryDescription"));<NEW_LINE>List<Person> persons = new ArrayList<Person>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListCustomPersonsResponse.Categories[" + i + "].Persons.Length"); j++) {<NEW_LINE>Person person = new Person();<NEW_LINE>person.setPersonName(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i + "].Persons[" + j + "].PersonName"));<NEW_LINE>person.setPersonDescription(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i <MASK><NEW_LINE>person.setPersonId(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i + "].Persons[" + j + "].PersonId"));<NEW_LINE>List<Face> faces = new ArrayList<Face>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("ListCustomPersonsResponse.Categories[" + i + "].Persons[" + j + "].Faces.Length"); k++) {<NEW_LINE>Face face = new Face();<NEW_LINE>face.setImageUrl(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i + "].Persons[" + j + "].Faces[" + k + "].ImageUrl"));<NEW_LINE>face.setFaceId(_ctx.stringValue("ListCustomPersonsResponse.Categories[" + i + "].Persons[" + j + "].Faces[" + k + "].FaceId"));<NEW_LINE>faces.add(face);<NEW_LINE>}<NEW_LINE>person.setFaces(faces);<NEW_LINE>persons.add(person);<NEW_LINE>}<NEW_LINE>category.setPersons(persons);<NEW_LINE>categories.add(category);<NEW_LINE>}<NEW_LINE>listCustomPersonsResponse.setCategories(categories);<NEW_LINE>return listCustomPersonsResponse;<NEW_LINE>}
+ "].Persons[" + j + "].PersonDescription"));
1,356,567
final DeleteDevEndpointResult executeDeleteDevEndpoint(DeleteDevEndpointRequest deleteDevEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDevEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDevEndpointRequest> request = null;<NEW_LINE>Response<DeleteDevEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDevEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDevEndpointRequest));<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, "Glue");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDevEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDevEndpointResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDevEndpoint");
570,683
private List<Cache> enforceGeoRedirect(final Track track, final DeliveryService ds, final String clientIp, final Geolocation queriedClientLocation, final IPVersions requestVersion) {<NEW_LINE>final String urlType = ds.getGeoRedirectUrlType();<NEW_LINE>track.setResult(ResultType.GEO_REDIRECT);<NEW_LINE>if ("NOT_DS_URL".equals(urlType)) {<NEW_LINE>// redirect url not belongs to this DS, just redirect it<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!"DS_URL".equals(urlType)) {<NEW_LINE>LOGGER.error("invalid geo redirect url type '" + urlType + "'");<NEW_LINE>track.setResult(ResultType.MISS);<NEW_LINE>track.setResultDetails(ResultDetails.GEO_NO_CACHE_FOUND);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Geolocation clientLocation = queriedClientLocation;<NEW_LINE>// redirect url belongs to this DS, will try return the caches<NEW_LINE>if (clientLocation == null) {<NEW_LINE>try {<NEW_LINE>clientLocation = getLocation(clientIp, ds);<NEW_LINE>} catch (GeolocationException e) {<NEW_LINE>LOGGER.warn("Failed getting geolocation for client ip " + clientIp + " and delivery service '" + ds.getId() + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clientLocation == null) {<NEW_LINE>clientLocation = ds.getMissLocation();<NEW_LINE>}<NEW_LINE>if (clientLocation == null) {<NEW_LINE><MASK><NEW_LINE>// particular error was logged in ds.supportLocation<NEW_LINE>track.setResult(ResultType.MISS);<NEW_LINE>track.setResultDetails(ResultDetails.DS_CLIENT_GEO_UNSUPPORTED);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Cache> caches = null;<NEW_LINE>try {<NEW_LINE>caches = getCachesByGeo(ds, clientLocation, track, requestVersion);<NEW_LINE>} catch (GeolocationException e) {<NEW_LINE>LOGGER.error("Failed getting caches by geolocation " + e.getMessage());<NEW_LINE>}<NEW_LINE>if (caches == null) {<NEW_LINE>LOGGER.warn(String.format("No Cache found by Geo in NGB redirect"));<NEW_LINE>track.setResult(ResultType.MISS);<NEW_LINE>track.setResultDetails(ResultDetails.GEO_NO_CACHE_FOUND);<NEW_LINE>}<NEW_LINE>return caches;<NEW_LINE>}
LOGGER.error("cannot find a geo location for the client: " + clientIp);
880,049
public void onUpdate() {<NEW_LINE>// wait for timer<NEW_LINE>if (timer > 0) {<NEW_LINE>timer--;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check screen<NEW_LINE>if (MC.currentScreen instanceof HandledScreen && !(MC.currentScreen instanceof InventoryScreen))<NEW_LINE>return;<NEW_LINE>ClientPlayerEntity player = MC.player;<NEW_LINE>PlayerInventory inventory = player.getInventory();<NEW_LINE>if (!swapWhileMoving.isChecked() && (player.input.movementForward != 0 || player.input.movementSideways != 0))<NEW_LINE>return;<NEW_LINE>// store slots and values of best armor pieces<NEW_LINE>int[] bestArmorSlots = new int[4];<NEW_LINE>int[] bestArmorValues = new int[4];<NEW_LINE>// initialize with currently equipped armor<NEW_LINE>for (int type = 0; type < 4; type++) {<NEW_LINE>bestArmorSlots[type] = -1;<NEW_LINE>ItemStack stack = inventory.getArmorStack(type);<NEW_LINE>if (stack.isEmpty() || !(stack.getItem() instanceof ArmorItem))<NEW_LINE>continue;<NEW_LINE>ArmorItem item = (ArmorItem) stack.getItem();<NEW_LINE>bestArmorValues[type] = getArmorValue(item, stack);<NEW_LINE>}<NEW_LINE>// search inventory for better armor<NEW_LINE>for (int slot = 0; slot < 36; slot++) {<NEW_LINE>ItemStack stack = inventory.getStack(slot);<NEW_LINE>if (stack.isEmpty() || !(stack.getItem() instanceof ArmorItem))<NEW_LINE>continue;<NEW_LINE>ArmorItem item = (ArmorItem) stack.getItem();<NEW_LINE>int armorType = item<MASK><NEW_LINE>int armorValue = getArmorValue(item, stack);<NEW_LINE>if (armorValue > bestArmorValues[armorType]) {<NEW_LINE>bestArmorSlots[armorType] = slot;<NEW_LINE>bestArmorValues[armorType] = armorValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// equip better armor in random order<NEW_LINE>ArrayList<Integer> types = new ArrayList<>(Arrays.asList(0, 1, 2, 3));<NEW_LINE>Collections.shuffle(types);<NEW_LINE>for (int type : types) {<NEW_LINE>// check if better armor was found<NEW_LINE>int slot = bestArmorSlots[type];<NEW_LINE>if (slot == -1)<NEW_LINE>continue;<NEW_LINE>// check if armor can be swapped<NEW_LINE>// needs 1 free slot where it can put the old armor<NEW_LINE>ItemStack oldArmor = inventory.getArmorStack(type);<NEW_LINE>if (!oldArmor.isEmpty() && inventory.getEmptySlot() == -1)<NEW_LINE>continue;<NEW_LINE>// hotbar fix<NEW_LINE>if (slot < 9)<NEW_LINE>slot += 36;<NEW_LINE>// swap armor<NEW_LINE>if (!oldArmor.isEmpty())<NEW_LINE>IMC.getInteractionManager().windowClick_QUICK_MOVE(8 - type);<NEW_LINE>IMC.getInteractionManager().windowClick_QUICK_MOVE(slot);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
.getSlotType().getEntitySlotId();
822,632
private <T extends Event & CancelLogging> void testEvent(CommandSender receiver, Player target, T event, boolean stacktraceMode) throws CommandPermissionsException {<NEW_LINE>boolean isConsole = receiver instanceof ConsoleCommandSender;<NEW_LINE>if (!receiver.equals(target)) {<NEW_LINE>if (!isConsole) {<NEW_LINE>log.info(receiver.getName() + " is simulating an event on " + target.getName());<NEW_LINE>}<NEW_LINE>target.sendMessage(ChatColor.RED + "(Please ignore any messages that may immediately follow.)");<NEW_LINE>}<NEW_LINE>Bukkit.getPluginManager().callEvent(event);<NEW_LINE>int start = new Exception().getStackTrace().length;<NEW_LINE>CancelReport report = new CancelReport(event, <MASK><NEW_LINE>report.setDetectingPlugin(!stacktraceMode);<NEW_LINE>String result = report.toString();<NEW_LINE>if (stacktraceMode) {<NEW_LINE>receiver.sendMessage(ChatColor.GRAY + "The report was printed to console.");<NEW_LINE>log.info("Event report for " + receiver.getName() + ":\n\n" + result);<NEW_LINE>plugin.checkPermission(receiver, "worldguard.debug.pastebin");<NEW_LINE>ActorCallbackPaste.pastebin(WorldGuard.getInstance().getSupervisor(), plugin.wrapCommandSender(receiver), result, "Event debugging report: %s.txt");<NEW_LINE>} else {<NEW_LINE>receiver.sendMessage(result.replaceAll("(?m)^", ChatColor.AQUA.toString()));<NEW_LINE>if (result.length() >= 500 && !isConsole) {<NEW_LINE>receiver.sendMessage(ChatColor.GRAY + "The report was also printed to console.");<NEW_LINE>log.info("Event report for " + receiver.getName() + ":\n\n" + result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
event.getCancels(), start);
61,687
public okhttp3.Call connectPatchNamespacedPodProxyWithPathCall(String name, String namespace, String path, String path2, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())).replaceAll("\\{" + "path" + "\\}", localVarApiClient.escapeString(path.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path2 != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path2));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarHeaderParams.put("Accept", localVarAccept);
995,286
public void scan(int index, GradPair left, GradPair right) {<NEW_LINE>if (numClass == 2 || multiClassMultiTree) {<NEW_LINE>((BinaryGradPair) left).plusBy(gradients[index], hessians[index]);<NEW_LINE>((BinaryGradPair) right).subtractBy(gradients[index], hessians[index]);<NEW_LINE>} else if (!fullHessian) {<NEW_LINE>MultiGradPair leftMulti = (MultiGradPair) left;<NEW_LINE>double[] leftGrad = leftMulti.getGrad();<NEW_LINE>double[] leftHess = leftMulti.getHess();<NEW_LINE>MultiGradPair rightMulti = (MultiGradPair) right;<NEW_LINE>double[] rightGrad = rightMulti.getGrad();<NEW_LINE>double[] rightHess = rightMulti.getHess();<NEW_LINE>int offset = index * numClass;<NEW_LINE>for (int i = 0; i < numClass; i++) {<NEW_LINE>leftGrad[i] += gradients[offset + i];<NEW_LINE>leftHess[i] += hessians[offset + i];<NEW_LINE>rightGrad[i] -= gradients[offset + i];<NEW_LINE>rightHess[i] -= hessians[offset + i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MultiGradPair leftMulti = (MultiGradPair) left;<NEW_LINE>double[<MASK><NEW_LINE>double[] leftHess = leftMulti.getHess();<NEW_LINE>MultiGradPair rightMulti = (MultiGradPair) right;<NEW_LINE>double[] rightGrad = rightMulti.getGrad();<NEW_LINE>double[] rightHess = rightMulti.getHess();<NEW_LINE>int gradOffset = index * leftGrad.length;<NEW_LINE>int hessOffset = index * leftHess.length;<NEW_LINE>for (int i = 0; i < leftGrad.length; i++) {<NEW_LINE>leftGrad[i] += gradients[gradOffset + i];<NEW_LINE>rightGrad[i] -= gradients[gradOffset + i];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < leftHess.length; i++) {<NEW_LINE>leftHess[i] += hessians[hessOffset + i];<NEW_LINE>rightHess[i] -= hessians[hessOffset + i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] leftGrad = leftMulti.getGrad();
578,792
private void showView(SettingsView aView) {<NEW_LINE>if (mCurrentView != null) {<NEW_LINE>mCurrentView.onHidden();<NEW_LINE>this.removeView(mCurrentView);<NEW_LINE>}<NEW_LINE>mCurrentView = aView;<NEW_LINE>if (mCurrentView != null) {<NEW_LINE>mOpenDialog = aView.getType();<NEW_LINE>Point viewDimensions = mCurrentView.getDimensions();<NEW_LINE>mViewMarginH = mWidgetPlacement.width - viewDimensions.x;<NEW_LINE>mViewMarginH = WidgetPlacement.<MASK><NEW_LINE>mViewMarginV = mWidgetPlacement.height - viewDimensions.y;<NEW_LINE>mViewMarginV = WidgetPlacement.convertDpToPixel(getContext(), mViewMarginV);<NEW_LINE>FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);<NEW_LINE>params.leftMargin = params.rightMargin = mViewMarginH / 2;<NEW_LINE>params.topMargin = params.bottomMargin = mViewMarginV / 2;<NEW_LINE>mCurrentView.onShown();<NEW_LINE>this.addView(mCurrentView, params);<NEW_LINE>mCurrentView.setDelegate(this);<NEW_LINE>mBinding.optionsLayout.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>updateUI();<NEW_LINE>mBinding.optionsLayout.setVisibility(View.VISIBLE);<NEW_LINE>updateCurrentAccountState();<NEW_LINE>}<NEW_LINE>}
convertDpToPixel(getContext(), mViewMarginH);
1,814,336
private SslPolicy createSslPolicy(SslPolicyConfig policyConfig) {<NEW_LINE>Path baseDirectory = config.get(policyConfig.base_directory);<NEW_LINE>Path revokedCertificatesDir = config.get(policyConfig.revoked_dir);<NEW_LINE>if (Files.notExists(baseDirectory)) {<NEW_LINE>throw new IllegalArgumentException(format("Base directory '%s' for SSL policy with name '%s' does not exist.", baseDirectory, policyConfig.name()));<NEW_LINE>}<NEW_LINE>KeyAndChain keyAndChain = pemKeyAndChain(policyConfig);<NEW_LINE>Collection<X509CRL> crls = getCRLs(revokedCertificatesDir, certificateFilenameFilter());<NEW_LINE>TrustManagerFactory trustManagerFactory;<NEW_LINE>try {<NEW_LINE>trustManagerFactory = createTrustManagerFactory(config.get(policyConfig.trust_all), crls, keyAndChain.trustStore);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Failed to create trust manager", e);<NEW_LINE>}<NEW_LINE>boolean verifyHostname = <MASK><NEW_LINE>ClientAuth clientAuth = config.get(policyConfig.client_auth);<NEW_LINE>List<String> tlsVersions = config.get(policyConfig.tls_versions);<NEW_LINE>List<String> ciphers = config.get(policyConfig.ciphers);<NEW_LINE>return new SslPolicy(keyAndChain.privateKey, keyAndChain.keyCertChain, tlsVersions, ciphers, clientAuth, trustManagerFactory, sslProvider, verifyHostname, logProvider);<NEW_LINE>}
config.get(policyConfig.verify_hostname);
81,773
public Texture validateMaskTexture(MaskData maskData, boolean canScale) {<NEW_LINE>int pad = canScale ? 1 : 0;<NEW_LINE>int needW = maskData.getWidth() + pad + pad;<NEW_LINE>int needH = maskData.getHeight() + pad + pad;<NEW_LINE>int texW = 0, texH = 0;<NEW_LINE>if (maskTex != null) {<NEW_LINE>maskTex.lock();<NEW_LINE>if (maskTex.isSurfaceLost()) {<NEW_LINE>maskTex = null;<NEW_LINE>} else {<NEW_LINE>texW = maskTex.getContentWidth();<NEW_LINE>texH = maskTex.getContentHeight();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (maskTex == null || texW < needW || texH < needH) {<NEW_LINE>if (maskTex != null) {<NEW_LINE>flushVertexBuffer();<NEW_LINE>maskTex.dispose();<NEW_LINE>maskTex = null;<NEW_LINE>}<NEW_LINE>maskBuffer = null;<NEW_LINE>// grow the mask texture so that the new one is always<NEW_LINE>// at least as large as the previous one; this avoids<NEW_LINE>// lots of creation/disposal when the shapes alternate<NEW_LINE>// between narrow/tall and wide/short<NEW_LINE>int newTexW = Math.max(MIN_MASK_DIM, Math.max(needW, texW));<NEW_LINE>int newTexH = Math.max(MIN_MASK_DIM, Math.max(needH, texH));<NEW_LINE>maskTex = getResourceFactory().createMaskTexture(newTexW, newTexH, WrapMode.CLAMP_NOT_NEEDED);<NEW_LINE>maskBuffer = ByteBuffer.allocate(newTexW * newTexH);<NEW_LINE>if (clearBuffer == null || clearBuffer.capacity() < newTexW) {<NEW_LINE>clearBuffer = null;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>curMaskRow = curMaskCol = nextMaskRow = highMaskCol = 0;<NEW_LINE>}<NEW_LINE>return maskTex;<NEW_LINE>}
clearBuffer = ByteBuffer.allocate(newTexW);
712,052
public static PDShading createLinearGradient(PdfBoxFastOutputDevice od, AffineTransform transform, FSLinearGradient gradient, Shape bounds) {<NEW_LINE>PDShadingType2 shading = new PDShadingType2(new COSDictionary());<NEW_LINE>shading.setShadingType(PDShading.SHADING_TYPE2);<NEW_LINE>shading.setColorSpace(PDDeviceRGB.INSTANCE);<NEW_LINE>Rectangle rect = bounds.getBounds();<NEW_LINE>Point2D ptStart = new Point2D.Float(gradient.getX1() + (float) rect.getMinX(), gradient.getY1() + (float) rect.getMinY());<NEW_LINE>Point2D ptEnd = new Point2D.Float(gradient.getX2() + (float) rect.getMinX(), gradient.getY2() + (float) rect.getMinY());<NEW_LINE>Point2D ptStartDevice = transform.transform(ptStart, null);<NEW_LINE>Point2D ptEndDevice = transform.transform(ptEnd, null);<NEW_LINE>float startX = (float) ptStartDevice.getX();<NEW_LINE>float startY = od.normalizeY((float) ptStartDevice.getY());<NEW_LINE>float endX = (float) ptEndDevice.getX();<NEW_LINE>float endY = od.normalizeY((float) ptEndDevice.getY());<NEW_LINE>COSArray coords = new COSArray();<NEW_LINE>coords.add(new COSFloat(startX));<NEW_LINE>coords.<MASK><NEW_LINE>coords.add(new COSFloat(endX));<NEW_LINE>coords.add(new COSFloat(endY));<NEW_LINE>shading.setCoords(coords);<NEW_LINE>PDFunctionType3 type3 = buildType3Function(gradient.getStopPoints(), (float) ptEnd.distance(ptStart));<NEW_LINE>COSArray extend = new COSArray();<NEW_LINE>extend.add(COSBoolean.FALSE);<NEW_LINE>extend.add(COSBoolean.FALSE);<NEW_LINE>shading.setFunction(type3);<NEW_LINE>shading.setExtend(extend);<NEW_LINE>return shading;<NEW_LINE>}
add(new COSFloat(startY));
697,203
private StateMachineInstance createMachineInstance(String stateMachineName, String tenantId, String businessKey, Map<String, Object> startParams) {<NEW_LINE>StateMachine stateMachine = stateMachineConfig.getStateMachineRepository().getStateMachine(stateMachineName, tenantId);<NEW_LINE>if (stateMachine == null) {<NEW_LINE>throw new EngineExecutionException("StateMachine[" + stateMachineName + "] is not exists", FrameworkErrorCode.ObjectNotExists);<NEW_LINE>}<NEW_LINE>StateMachineInstanceImpl inst = new StateMachineInstanceImpl();<NEW_LINE>inst.setStateMachine(stateMachine);<NEW_LINE>inst.setMachineId(stateMachine.getId());<NEW_LINE>inst.setTenantId(tenantId);<NEW_LINE>inst.setBusinessKey(businessKey);<NEW_LINE>inst.setStartParams(startParams);<NEW_LINE>if (startParams != null) {<NEW_LINE>if (StringUtils.hasText(businessKey)) {<NEW_LINE>startParams.put(DomainConstants.VAR_NAME_BUSINESSKEY, businessKey);<NEW_LINE>}<NEW_LINE>String parentId = (String) startParams.get(DomainConstants.VAR_NAME_PARENT_ID);<NEW_LINE>if (StringUtils.hasText(parentId)) {<NEW_LINE>inst.setParentId(parentId);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>inst.setStatus(ExecutionStatus.RU);<NEW_LINE>inst.setRunning(true);<NEW_LINE>inst.setGmtStarted(new Date());<NEW_LINE>inst.setGmtUpdated(inst.getGmtStarted());<NEW_LINE>return inst;<NEW_LINE>}
startParams.remove(DomainConstants.VAR_NAME_PARENT_ID);
1,283,801
public WatchKey register(final Watchable folder, final WatchEvent.Kind<?>[] events, final WatchEvent.Modifier... modifiers) throws IOException {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Register file %s for events %s", folder, Arrays.toString(events)));<NEW_LINE>}<NEW_LINE>final Pointer[] values = { CFStringRef.toCFString(folder.toString<MASK><NEW_LINE>final MacOSXWatchKey key = new MacOSXWatchKey(folder, this, events);<NEW_LINE>// Latency in seconds<NEW_LINE>final double latency = 1.0;<NEW_LINE>final Map<File, Long> timestamps = createLastModifiedMap(new File(folder.toString()));<NEW_LINE>final FSEvents.FSEventStreamCallback callback = new Callback(key, timestamps);<NEW_LINE>final FSEventStreamRef stream = library.FSEventStreamCreate(Pointer.NULL, callback, Pointer.NULL, library.CFArrayCreate(null, values, CFIndex.valueOf(1), null), -1, latency, kFSEventStreamCreateFlagNoDefer);<NEW_LINE>final CountDownLatch lock = new CountDownLatch(1);<NEW_LINE>final CFRunLoop loop = new CFRunLoop(lock, stream);<NEW_LINE>threadFactory.newThread(loop).start();<NEW_LINE>Uninterruptibles.awaitUninterruptibly(lock);<NEW_LINE>loops.put(key, loop);<NEW_LINE>callbacks.put(key, callback);<NEW_LINE>return key;<NEW_LINE>}
()).getPointer() };
1,831,712
public void deserialize(final ODocument document, final BytesContainer bytes) {<NEW_LINE>final String className = readString(bytes);<NEW_LINE>if (className.length() != 0)<NEW_LINE>ODocumentInternal.fillClassNameIfNeeded(document, className);<NEW_LINE>int last = 0;<NEW_LINE>String fieldName;<NEW_LINE>int valuePos;<NEW_LINE>OType type;<NEW_LINE>while (true) {<NEW_LINE>OGlobalProperty prop;<NEW_LINE>final int len = OVarIntSerializer.readAsInteger(bytes);<NEW_LINE>if (len == 0) {<NEW_LINE>// SCAN COMPLETED<NEW_LINE>break;<NEW_LINE>} else if (len > 0) {<NEW_LINE>// PARSE FIELD NAME<NEW_LINE>fieldName = stringFromBytes(bytes.bytes, bytes.offset, len).intern();<NEW_LINE>bytes.skip(len);<NEW_LINE>Tuple<Integer, OType> pointerAndType = getPointerAndTypeFromCurrentPosition(bytes);<NEW_LINE>valuePos = pointerAndType.getFirstVal();<NEW_LINE>type = pointerAndType.getSecondVal();<NEW_LINE>} else {<NEW_LINE>// LOAD GLOBAL PROPERTY BY ID<NEW_LINE>prop = getGlobalProperty(document, len);<NEW_LINE>fieldName = prop.getName();<NEW_LINE>valuePos = readInteger(bytes);<NEW_LINE>if (prop.getType() != OType.ANY)<NEW_LINE>type = prop.getType();<NEW_LINE>else<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (ODocumentInternal.rawContainsField(document, fieldName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (valuePos != 0) {<NEW_LINE>int headerCursor = bytes.offset;<NEW_LINE>bytes.offset = valuePos;<NEW_LINE>final Object value = deserializeValue(bytes, type, document);<NEW_LINE>if (bytes.offset > last)<NEW_LINE>last = bytes.offset;<NEW_LINE>bytes.offset = headerCursor;<NEW_LINE>ODocumentInternal.rawField(document, fieldName, value, type);<NEW_LINE>} else<NEW_LINE>ODocumentInternal.rawField(document, fieldName, null, null);<NEW_LINE>}<NEW_LINE>ORecordInternal.clearSource(document);<NEW_LINE>if (last > bytes.offset)<NEW_LINE>bytes.offset = last;<NEW_LINE>}
type = readOType(bytes, false);
1,098,153
public static ExecutionOptions createFromObject(final Object obj) {<NEW_LINE>if (obj == null || !(obj instanceof Map)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Map<String, Object> optionsMap = (Map<String, Object>) obj;<NEW_LINE>final TypedMapWrapper<String, Object> wrapper = new TypedMapWrapper<>(optionsMap);<NEW_LINE>final ExecutionOptions options = new ExecutionOptions();<NEW_LINE>if (optionsMap.containsKey(FLOW_PARAMETERS)) {<NEW_LINE>options.flowParameters = new HashMap<>();<NEW_LINE>options.flowParameters.putAll(wrapper.<String<MASK><NEW_LINE>}<NEW_LINE>if (optionsMap.containsKey(RUNTIME_PROPERTIES)) {<NEW_LINE>options.runtimeProperties = new HashMap<>();<NEW_LINE>options.runtimeProperties.putAll(wrapper.getMap(RUNTIME_PROPERTIES));<NEW_LINE>}<NEW_LINE>// Failure notification<NEW_LINE>options.notifyOnFirstFailure = wrapper.getBool(NOTIFY_ON_FIRST_FAILURE, options.notifyOnFirstFailure);<NEW_LINE>options.notifyOnLastFailure = wrapper.getBool(NOTIFY_ON_LAST_FAILURE, options.notifyOnLastFailure);<NEW_LINE>options.concurrentOption = wrapper.getString(CONCURRENT_OPTION, options.concurrentOption);<NEW_LINE>if (wrapper.containsKey(DISABLE)) {<NEW_LINE>options.initiallyDisabledJobs = DisabledJob.fromDeprecatedObjectList(wrapper.<Object>getList(DISABLE));<NEW_LINE>}<NEW_LINE>if (optionsMap.containsKey(MAIL_CREATOR)) {<NEW_LINE>options.mailCreator = (String) optionsMap.get(MAIL_CREATOR);<NEW_LINE>}<NEW_LINE>// Failure action<NEW_LINE>options.failureAction = FailureAction.valueOf(wrapper.getString(FAILURE_ACTION, options.failureAction.toString()));<NEW_LINE>options.pipelineLevel = wrapper.getInt(PIPELINE_LEVEL, options.pipelineLevel);<NEW_LINE>options.pipelineExecId = wrapper.getInt(PIPELINE_EXECID, options.pipelineExecId);<NEW_LINE>options.queueLevel = wrapper.getInt(QUEUE_LEVEL, options.queueLevel);<NEW_LINE>// Success emails<NEW_LINE>options.setSuccessEmails(wrapper.<String>getList(SUCCESS_EMAILS, Collections.<String>emptyList()));<NEW_LINE>options.setFailureEmails(wrapper.<String>getList(FAILURE_EMAILS, Collections.<String>emptyList()));<NEW_LINE>options.setSuccessEmailsOverridden(wrapper.getBool(SUCCESS_EMAILS_OVERRIDE, false));<NEW_LINE>options.setFailureEmailsOverridden(wrapper.getBool(FAILURE_EMAILS_OVERRIDE, false));<NEW_LINE>options.setFailureActionOverride(wrapper.getBool(FAILURE_ACTION_OVERRIDE, false));<NEW_LINE>options.setMemoryCheck(wrapper.getBool(MEMORY_CHECK, true));<NEW_LINE>// Note: slaOptions was originally outside of execution options, so it parsed and set<NEW_LINE>// separately for the original JSON format. New formats should include slaOptions as<NEW_LINE>// part of execution options.<NEW_LINE>options.setExecutionRetried(wrapper.getBool(EXECUTION_RETRIED_BY_AZKABAN, false));<NEW_LINE>options.setOriginalFlowExecutionIdBeforeRetry(wrapper.getInt(ORIGINAL_FLOW_EXECUTION_ID_BEFORE_RETRY, options.originalFlowExecutionIdBeforeRetry));<NEW_LINE>return options;<NEW_LINE>}
, String>getMap(FLOW_PARAMETERS));
1,297,767
public void marshall(UpdateStackRequest updateStackRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateStackRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getDisplayName(), DISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getStorageConnectors(), STORAGECONNECTORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getDeleteStorageConnectors(), DELETESTORAGECONNECTORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getRedirectURL(), REDIRECTURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getFeedbackURL(), FEEDBACKURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getAttributesToDelete(), ATTRIBUTESTODELETE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getUserSettings(), USERSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getAccessEndpoints(), ACCESSENDPOINTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateStackRequest.getEmbedHostDomains(), EMBEDHOSTDOMAINS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateStackRequest.getApplicationSettings(), APPLICATIONSETTINGS_BINDING);
1,770,276
public void show() {<NEW_LINE>if (debugMode) {<NEW_LINE>MessageHandler.printToLogFile("CheckDialog: show: Goto next Error");<NEW_LINE>}<NEW_LINE>dialog.setEnabled(false);<NEW_LINE>dialog.setEnabled(true);<NEW_LINE>if (dialogX < 0 || dialogY < 0) {<NEW_LINE>Dimension screenSize = Toolkit<MASK><NEW_LINE>Dimension frameSize = dialog.getSize();<NEW_LINE>dialogX = screenSize.width / 2 - frameSize.width / 2;<NEW_LINE>dialogY = screenSize.height / 2 - frameSize.height / 2;<NEW_LINE>}<NEW_LINE>dialog.setLocation(dialogX, dialogY);<NEW_LINE>isRunning = true;<NEW_LINE>setInitialButtonState();<NEW_LINE>dialog.setAutoRequestFocus(true);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>try {<NEW_LINE>Thread.sleep(500);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>MessageHandler.printException(e);<NEW_LINE>}<NEW_LINE>dialog.toFront();<NEW_LINE>if (!initCursor()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>runCheckForNextError(false);<NEW_LINE>}
.getDefaultToolkit().getScreenSize();