idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
661,996
public final <A> Value<A> allocate(String name, A initA) {<NEW_LINE>StreamJunction<A> j = new StreamJunction<>((l, r) -> l);<NEW_LINE>StreamSink<A> s0 = new StreamSink<>();<NEW_LINE>Listener l = j.out.listenWeak(a -> {<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>Thread.sleep(50);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>System.out.println("BackEnd: " + name + " <- " + a);<NEW_LINE>s0.send(a);<NEW_LINE>}).start();<NEW_LINE>});<NEW_LINE>Cell<A> c = s0.addCleanup(l).hold(initA);<NEW_LINE>return new Value<A>() {<NEW_LINE><NEW_LINE>public ValueOutput<A> construct(Stream<A> sWrite) {<NEW_LINE>CellSink<Optional<A>> recvd = new CellSink<>(Optional.empty());<NEW_LINE>Listener l = j.add(sWrite).append(c.listen(a -> {<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>Thread.sleep(50);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>System.out.println("BackEnd: " + name + " -> " + a);<NEW_LINE>recvd.send(Optional.of(a));<NEW_LINE>}).start();<NEW_LINE>}));<NEW_LINE>return new ValueOutput<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
<A>(recvd, l);
435,820
public void save() throws java.io.IOException {<NEW_LINE>if (formEditor == null) {<NEW_LINE>// not saving form, only java<NEW_LINE>// don't need to be in event dispatch thread (#102986)<NEW_LINE>doSave(false);<NEW_LINE>} else if (EventQueue.isDispatchThread()) {<NEW_LINE>doSave(true);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>EventQueue.invokeAndWait(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>doSave(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger(FormEditorSupport.class.getName()).log(Level.INFO, "", ex);<NEW_LINE>} catch (InvocationTargetException ex) {<NEW_LINE>if (ex.getCause() instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) ex.getCause();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger(FormEditorSupport.class.getName()).log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Level.INFO, "", ex);
1,438,120
public UpdateTrackerResult updateTracker(UpdateTrackerRequest updateTrackerRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateTrackerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateTrackerRequest> request = null;<NEW_LINE>Response<UpdateTrackerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateTrackerRequestMarshaller().marshall(updateTrackerRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<UpdateTrackerResult, JsonUnmarshallerContext> unmarshaller = new UpdateTrackerResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdateTrackerResult> responseHandler = new JsonResponseHandler<UpdateTrackerResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>}
awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
595,894
public long updateUserSettings(String userId, WFCMessage.ModifyUserSettingReq request, String clientId) {<NEW_LINE>HazelcastInstance hzInstance = m_Server.getHazelcastInstance();<NEW_LINE>MultiMap<String, WFCMessage.UserSettingEntry> userSettingMap = hzInstance.getMultiMap(USER_SETTING);<NEW_LINE>Collection<WFCMessage.UserSettingEntry> entries = userSettingMap.get(userId);<NEW_LINE>if (entries == null || entries.size() == 0) {<NEW_LINE>entries = loadPersistedUserSettings(userId, userSettingMap);<NEW_LINE>if (entries == null) {<NEW_LINE>entries = new ArrayList<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long updateDt = System.currentTimeMillis();<NEW_LINE>WFCMessage.UserSettingEntry settingEntry = WFCMessage.UserSettingEntry.newBuilder().setScope(request.getScope()).setKey(request.getKey()).setValue(request.getValue()).setUpdateDt(updateDt).build();<NEW_LINE>databaseStore.persistUserSetting(userId, settingEntry);<NEW_LINE>for (WFCMessage.UserSettingEntry entry : entries) {<NEW_LINE>if (entry.getScope() == request.getScope() && entry.getKey().equals(request.getKey())) {<NEW_LINE>userSettingMap.remove(userId, entry);<NEW_LINE>userSettingMap.put(userId, settingEntry);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>userSettingMap.put(userId, settingEntry);<NEW_LINE>if (request.getScope() == UserSettingScope.kUserSettingConversationSilent) {<NEW_LINE>int firstSplit = request.getKey().indexOf("-");<NEW_LINE>int type = Integer.parseInt(request.getKey().substring(0, firstSplit));<NEW_LINE>int secondSplit = request.getKey().indexOf("-", firstSplit + 1);<NEW_LINE>int line = Integer.parseInt(request.getKey().substring(firstSplit + 1, secondSplit));<NEW_LINE>String target = request.getKey().substring(secondSplit + 1);<NEW_LINE>String key = userId + "|" + type <MASK><NEW_LINE>userConvSlientMap.remove(key);<NEW_LINE>} else if (request.getScope() == UserSettingScope.kUserSettingGlobalSilent) {<NEW_LINE>userGlobalSlientMap.remove(userId);<NEW_LINE>} else if (request.getScope() == UserSettingScope.kUserSettingVoipSilent) {<NEW_LINE>userVoipSlientMap.remove(userId);<NEW_LINE>} else if (request.getScope() == UserSettingScope.kUserSettingHiddenNotificationDetail) {<NEW_LINE>userPushHiddenDetail.remove(userId);<NEW_LINE>}<NEW_LINE>IMHandler.getPublisher().publishNotification(IMTopic.NotifyUserSettingTopic, userId, updateDt, clientId);<NEW_LINE>return updateDt;<NEW_LINE>}
+ "|" + target + "|" + line;
62,763
private int createAcmeFile(WsLocationAdmin wslocation) {<NEW_LINE>acmeFile = wslocation.getServerWorkareaResource(acmeFileName).asFile();<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Acme history filed prepped from workarea " + acmeFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>if (acmeFile.exists()) {<NEW_LINE>return FILE_EXISTS;<NEW_LINE>}<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Acme history does not exist, write initial entry");<NEW_LINE>}<NEW_LINE>headers = new ArrayList<String>();<NEW_LINE>acmeFile.getParentFile().mkdirs();<NEW_LINE>LocalDateTime now = LocalDateTime.now();<NEW_LINE>String date = FORMATTER.format(now);<NEW_LINE>// Save headers<NEW_LINE>headers.add("# WARNING!!! DO NOT MODIFY THIS FILE. IT HAS BEEN AUTO-GENERATED: " + date);<NEW_LINE>headers.add("# Version 1.0");<NEW_LINE>headers.add("# Date" + spaceDelim + "Serial" + spaceDelim + "DirectoryURI" + spaceDelim + "Account URI" + spaceDelim + "Expiration");<NEW_LINE>headers.add("# -------------------------------------------------------------------------------------------------------------------------");<NEW_LINE>FileWriter fr = null;<NEW_LINE>try {<NEW_LINE>acmeFile.createNewFile();<NEW_LINE>fr <MASK><NEW_LINE>for (String h : headers) {<NEW_LINE>fr.write(h + "\n");<NEW_LINE>}<NEW_LINE>fr.close();<NEW_LINE>return FILE_CREATED;<NEW_LINE>} catch (IOException e) {<NEW_LINE>Tr.event(tc, "Stack trace of IOException", e);<NEW_LINE>Tr.error(tc, "CWPKI2072W", acmeFile.getAbsolutePath(), e.getMessage());<NEW_LINE>} finally {<NEW_LINE>if (fr != null) {<NEW_LINE>try {<NEW_LINE>fr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>Tr.event(tc, "Stack trace of IOException while closing", e);<NEW_LINE>Tr.error(tc, "CWPKI2072W", acmeFile.getAbsolutePath(), e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return FILE_NOT_CREATED;<NEW_LINE>}
= new FileWriter(acmeFile, false);
1,775,606
private Example createExample(JsonNode node) {<NEW_LINE>if (node instanceof ObjectNode) {<NEW_LINE>ObjectExample obj = new ObjectExample();<NEW_LINE>ObjectNode on = (ObjectNode) node;<NEW_LINE>for (Iterator<Entry<String, JsonNode>> x = on.fields(); x.hasNext(); ) {<NEW_LINE>Entry<String, JsonNode> i = x.next();<NEW_LINE>String key = i.getKey();<NEW_LINE>JsonNode value = i.getValue();<NEW_LINE>obj.put(key, createExample(value));<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>} else if (node instanceof ArrayNode) {<NEW_LINE>ArrayExample arr = new ArrayExample();<NEW_LINE>ArrayNode an = (ArrayNode) node;<NEW_LINE>for (JsonNode childNode : an) {<NEW_LINE>arr<MASK><NEW_LINE>}<NEW_LINE>return arr;<NEW_LINE>} else if (node instanceof DoubleNode) {<NEW_LINE>return new DoubleExample(node.doubleValue());<NEW_LINE>} else if (node instanceof IntNode || node instanceof ShortNode) {<NEW_LINE>return new IntegerExample(node.intValue());<NEW_LINE>} else if (node instanceof FloatNode) {<NEW_LINE>return new FloatExample(node.floatValue());<NEW_LINE>} else if (node instanceof BigIntegerNode) {<NEW_LINE>return new BigIntegerExample(node.bigIntegerValue());<NEW_LINE>} else if (node instanceof DecimalNode) {<NEW_LINE>return new DecimalExample(node.decimalValue());<NEW_LINE>} else if (node instanceof LongNode) {<NEW_LINE>return new LongExample(node.longValue());<NEW_LINE>} else if (node instanceof BooleanNode) {<NEW_LINE>return new BooleanExample(node.booleanValue());<NEW_LINE>} else {<NEW_LINE>return new StringExample(node.asText());<NEW_LINE>}<NEW_LINE>}
.add(createExample(childNode));
386,095
private void createStandardHeaderFooter() {<NEW_LINE>final MPrintTableFormat tf = m_format.getTableFormat();<NEW_LINE>// task 09359 get rid of logo. Commenting out so we have it in case we need it again<NEW_LINE>// Header: Logo<NEW_LINE>// {<NEW_LINE>// final I_AD_ClientInfo ci = Services.get(IClientDAO.class).retrieveClientInfo(Env.getCtx());<NEW_LINE>// final PrintElement logoElement;<NEW_LINE>// if (ci.getLogoReport_ID() > 0)<NEW_LINE>// {<NEW_LINE>// logoElement = new ImageElement(ci.getLogoReport_ID(), false);<NEW_LINE>// }<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>// logoElement = new ImageElement(org.compiere.Adempiere.getProductLogoLarge()); // 48x15<NEW_LINE>// }<NEW_LINE>// logoElement.layout(LOGO_WIDTH_MAX, m_headerHeight, false, MPrintFormatItem.FIELDALIGNMENTTYPE_LeadingLeft);<NEW_LINE>// logoElement.setLocation(m_header.getLocation());<NEW_LINE>// //m_headerFooter.addElement(logoElement);<NEW_LINE>// }<NEW_LINE>// Header - Report name, Page count<NEW_LINE>{<NEW_LINE>final Font font = tf.getPageHeader_Font();<NEW_LINE>final Color color = tf.getPageHeaderFG_Color();<NEW_LINE>//<NEW_LINE>PrintElement element = new StringElement("@*ReportName@", font, color, null, true);<NEW_LINE>element.layout(m_header.width, 0, true, MPrintFormatItem.FIELDALIGNMENTTYPE_Center);<NEW_LINE>element.setLocation(m_header.getLocation());<NEW_LINE>m_headerFooter.addElement(element);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>element = new StringElement("@Page@ @*Page@ @slash@ @*PageCount@", font, color, null, true);<NEW_LINE>element.layout(m_header.width, 0, true, MPrintFormatItem.FIELDALIGNMENTTYPE_TrailingRight);<NEW_LINE>element.setLocation(m_header.getLocation());<NEW_LINE>m_headerFooter.addElement(element);<NEW_LINE>}<NEW_LINE>// Footer<NEW_LINE>{<NEW_LINE>final Font font = tf.getPageFooter_Font();<NEW_LINE>final Color color = tf.getPageFooterFG_Color();<NEW_LINE>//<NEW_LINE>PrintElement element = new StringElement(Adempiere.getBrandCopyright(), font, color, null, true);<NEW_LINE>element.layout(m_footer.width, 0, true, MPrintFormatItem.FIELDALIGNMENTTYPE_LeadingLeft);<NEW_LINE>Point ft = m_footer.getLocation();<NEW_LINE>// 2pt above min<NEW_LINE>ft.y += m_footer.height - element.getHeight() - 2;<NEW_LINE>element.setLocation(ft);<NEW_LINE>m_headerFooter.addElement(element);<NEW_LINE>//<NEW_LINE>element = new StringElement("@*Header@", font, color, null, true);<NEW_LINE>element.layout(m_footer.width, <MASK><NEW_LINE>element.setLocation(ft);<NEW_LINE>m_headerFooter.addElement(element);<NEW_LINE>//<NEW_LINE>element = new StringElement("@*CurrentDateTime@", font, color, null, true);<NEW_LINE>element.layout(m_footer.width, 0, true, MPrintFormatItem.FIELDALIGNMENTTYPE_TrailingRight);<NEW_LINE>element.setLocation(ft);<NEW_LINE>m_headerFooter.addElement(element);<NEW_LINE>}<NEW_LINE>}
0, true, MPrintFormatItem.FIELDALIGNMENTTYPE_Center);
585,707
public Void resourceShape(ResourceShape shape) {<NEW_LINE>serializeTraits(shape);<NEW_LINE>codeWriter.openBlock("resource $L {", shape.getId().getName());<NEW_LINE>if (!shape.getIdentifiers().isEmpty()) {<NEW_LINE>codeWriter.openBlock("identifiers: {");<NEW_LINE>shape.getIdentifiers().entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(entry -> codeWriter.write("$L: $I,", entry.getKey(), entry.getValue()));<NEW_LINE>codeWriter.closeBlock("},");<NEW_LINE>}<NEW_LINE>shape.getPut().ifPresent(shapeId -> codeWriter.write("put: $I,", shapeId));<NEW_LINE>shape.getCreate().ifPresent(shapeId -> codeWriter.write("create: $I,", shapeId));<NEW_LINE>shape.getRead().ifPresent(shapeId -> codeWriter.write("read: $I,", shapeId));<NEW_LINE>shape.getUpdate().ifPresent(shapeId -> codeWriter.write("update: $I,", shapeId));<NEW_LINE>shape.getDelete().ifPresent(shapeId -> codeWriter.write("delete: $I,", shapeId));<NEW_LINE>shape.getList().ifPresent(shapeId -> codeWriter.write("list: $I,", shapeId));<NEW_LINE>codeWriter.writeOptionalIdList("operations", shape.getOperations());<NEW_LINE>codeWriter.writeOptionalIdList("collectionOperations", shape.getCollectionOperations());<NEW_LINE>codeWriter.writeOptionalIdList(<MASK><NEW_LINE>codeWriter.closeBlock("}");<NEW_LINE>codeWriter.write("");<NEW_LINE>return null;<NEW_LINE>}
"resources", shape.getResources());
561,047
private Mono<Response<Void>> updatePasswordCredentialsWithResponseAsync(String objectId, String tenantId, PasswordCredentialsUpdateParameters parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (objectId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (tenantId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter tenantId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json, text/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.updatePasswordCredentials(this.client.getEndpoint(), objectId, this.client.getApiVersion(), <MASK><NEW_LINE>}
tenantId, parameters, accept, context);
340,898
final ModifyLoadBalancerAttributesResult executeModifyLoadBalancerAttributes(ModifyLoadBalancerAttributesRequest modifyLoadBalancerAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyLoadBalancerAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyLoadBalancerAttributesRequest> request = null;<NEW_LINE>Response<ModifyLoadBalancerAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyLoadBalancerAttributesRequestMarshaller().marshall(super.beforeMarshalling(modifyLoadBalancerAttributesRequest));<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, "Elastic Load Balancing v2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyLoadBalancerAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyLoadBalancerAttributesResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
ModifyLoadBalancerAttributesResult>(new ModifyLoadBalancerAttributesResultStaxUnmarshaller());
326,436
private RuntimeSearchParam canonicalizeSearchParameterDstu3(org.hl7.fhir.dstu3.model.SearchParameter theNextSp) {<NEW_LINE>String name = theNextSp.getCode();<NEW_LINE>String description = theNextSp.getDescription();<NEW_LINE>String path = theNextSp.getExpression();<NEW_LINE>RestSearchParameterTypeEnum paramType = null;<NEW_LINE>RuntimeSearchParam.RuntimeSearchParamStatusEnum status = null;<NEW_LINE>switch(theNextSp.getType()) {<NEW_LINE>case COMPOSITE:<NEW_LINE>paramType = RestSearchParameterTypeEnum.COMPOSITE;<NEW_LINE>break;<NEW_LINE>case DATE:<NEW_LINE>paramType = RestSearchParameterTypeEnum.DATE;<NEW_LINE>break;<NEW_LINE>case NUMBER:<NEW_LINE>paramType = RestSearchParameterTypeEnum.NUMBER;<NEW_LINE>break;<NEW_LINE>case QUANTITY:<NEW_LINE>paramType = RestSearchParameterTypeEnum.QUANTITY;<NEW_LINE>break;<NEW_LINE>case REFERENCE:<NEW_LINE>paramType = RestSearchParameterTypeEnum.REFERENCE;<NEW_LINE>break;<NEW_LINE>case STRING:<NEW_LINE>paramType = RestSearchParameterTypeEnum.STRING;<NEW_LINE>break;<NEW_LINE>case TOKEN:<NEW_LINE>paramType = RestSearchParameterTypeEnum.TOKEN;<NEW_LINE>break;<NEW_LINE>case URI:<NEW_LINE>paramType = RestSearchParameterTypeEnum.URI;<NEW_LINE>break;<NEW_LINE>case NULL:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (theNextSp.getStatus() != null) {<NEW_LINE>switch(theNextSp.getStatus()) {<NEW_LINE>case ACTIVE:<NEW_LINE>status = RuntimeSearchParam.RuntimeSearchParamStatusEnum.ACTIVE;<NEW_LINE>break;<NEW_LINE>case DRAFT:<NEW_LINE>status = RuntimeSearchParam.RuntimeSearchParamStatusEnum.DRAFT;<NEW_LINE>break;<NEW_LINE>case RETIRED:<NEW_LINE>status = RuntimeSearchParam.RuntimeSearchParamStatusEnum.RETIRED;<NEW_LINE>break;<NEW_LINE>case UNKNOWN:<NEW_LINE>status = RuntimeSearchParam.RuntimeSearchParamStatusEnum.UNKNOWN;<NEW_LINE>break;<NEW_LINE>case NULL:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> providesMembershipInCompartments = Collections.emptySet();<NEW_LINE>Set<String> targets = DatatypeUtil.toStringSet(theNextSp.getTarget());<NEW_LINE>if (isBlank(name) || isBlank(path) || paramType == null) {<NEW_LINE>if (paramType != RestSearchParameterTypeEnum.COMPOSITE) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IIdType id = theNextSp.getIdElement();<NEW_LINE>String uri = "";<NEW_LINE>ComboSearchParamType unique = null;<NEW_LINE>List<Extension> uniqueExts = theNextSp.getExtensionsByUrl(HapiExtensions.EXT_SP_UNIQUE);<NEW_LINE>if (uniqueExts.size() > 0) {<NEW_LINE>IPrimitiveType<?> uniqueExtsValuePrimitive = uniqueExts.get(0).getValueAsPrimitive();<NEW_LINE>if (uniqueExtsValuePrimitive != null) {<NEW_LINE>if ("true".equalsIgnoreCase(uniqueExtsValuePrimitive.getValueAsString())) {<NEW_LINE>unique = ComboSearchParamType.UNIQUE;<NEW_LINE>} else if ("false".equalsIgnoreCase(uniqueExtsValuePrimitive.getValueAsString())) {<NEW_LINE>unique = ComboSearchParamType.NON_UNIQUE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<RuntimeSearchParam.Component> components = new ArrayList<>();<NEW_LINE>for (SearchParameter.SearchParameterComponentComponent next : theNextSp.getComponent()) {<NEW_LINE>components.add(new RuntimeSearchParam.Component(next.getExpression(), next.getDefinition().getReferenceElement().toUnqualifiedVersionless<MASK><NEW_LINE>}<NEW_LINE>return new RuntimeSearchParam(id, uri, name, description, path, paramType, providesMembershipInCompartments, targets, status, unique, components, toStrings(theNextSp.getBase()));<NEW_LINE>}
().getValue()));
203,298
public static void main(String[] args) {<NEW_LINE>boolean verbose = (args.length > 0 && args[0].equals("-v"));<NEW_LINE>try (ZContext ctx = new ZContext()) {<NEW_LINE>// Prepare server socket with predictable identity<NEW_LINE>String bindEndpoint = "tcp://*:5555";<NEW_LINE>String connectEndpoint = "tcp://localhost:5555";<NEW_LINE>Socket server = ctx.createSocket(SocketType.ROUTER);<NEW_LINE>server.setIdentity(connectEndpoint.getBytes(ZMQ.CHARSET));<NEW_LINE>server.bind(bindEndpoint);<NEW_LINE>System.out.printf("I: service is ready at %s\n", bindEndpoint);<NEW_LINE>while (!Thread.currentThread().isInterrupted()) {<NEW_LINE>ZMsg request = ZMsg.recvMsg(server);<NEW_LINE>if (verbose && request != null)<NEW_LINE>request.dump(System.out);<NEW_LINE>if (request == null)<NEW_LINE>// Interrupted<NEW_LINE>break;<NEW_LINE>// Frame 0: identity of client<NEW_LINE>// Frame 1: PING, or client control frame<NEW_LINE>// Frame 2: request body<NEW_LINE><MASK><NEW_LINE>ZFrame control = request.pop();<NEW_LINE>ZMsg reply = new ZMsg();<NEW_LINE>if (control.equals(new ZFrame("PING")))<NEW_LINE>reply.add("PONG");<NEW_LINE>else {<NEW_LINE>reply.add(control);<NEW_LINE>reply.add("OK");<NEW_LINE>}<NEW_LINE>request.destroy();<NEW_LINE>reply.push(identity);<NEW_LINE>if (verbose && reply != null)<NEW_LINE>reply.dump(System.out);<NEW_LINE>reply.send(server);<NEW_LINE>}<NEW_LINE>if (Thread.currentThread().isInterrupted())<NEW_LINE>System.out.printf("W: interrupted\n");<NEW_LINE>}<NEW_LINE>}
ZFrame identity = request.pop();
727,108
protected void consumeReferenceExpressionTypeForm(boolean isPrimitive) {<NEW_LINE>// actually Name or Type form.<NEW_LINE>// ReferenceExpression ::= PrimitiveType Dims '::' NonWildTypeArgumentsopt IdentifierOrNew<NEW_LINE>// ReferenceExpression ::= Name Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew<NEW_LINE>ReferenceExpression referenceExpression = newReferenceExpression();<NEW_LINE>TypeReference[] typeArguments = null;<NEW_LINE>char[] selector;<NEW_LINE>int sourceEnd;<NEW_LINE>sourceEnd = (int) this.identifierPositionStack[this.identifierPtr];<NEW_LINE>referenceExpression.nameSourceStart = (int) (this.identifierPositionStack[this.identifierPtr] >>> 32);<NEW_LINE>selector = this<MASK><NEW_LINE>this.identifierLengthPtr--;<NEW_LINE>int length = this.genericsLengthStack[this.genericsLengthPtr--];<NEW_LINE>if (length > 0) {<NEW_LINE>this.genericsPtr -= length;<NEW_LINE>System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);<NEW_LINE>// pop type arguments source start.<NEW_LINE>this.intPtr--;<NEW_LINE>}<NEW_LINE>int dimension = this.intStack[this.intPtr--];<NEW_LINE>boolean typeAnnotatedName = false;<NEW_LINE>for (int i = this.identifierLengthStack[this.identifierLengthPtr], j = 0; i > 0 && this.typeAnnotationLengthPtr >= 0; --i, j++) {<NEW_LINE>length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - j];<NEW_LINE>if (length != 0) {<NEW_LINE>typeAnnotatedName = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dimension > 0 || typeAnnotatedName) {<NEW_LINE>if (!isPrimitive) {<NEW_LINE>pushOnGenericsLengthStack(0);<NEW_LINE>pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);<NEW_LINE>}<NEW_LINE>referenceExpression.initialize(this.compilationUnit.compilationResult, getTypeReference(dimension), typeArguments, selector, sourceEnd);<NEW_LINE>} else {<NEW_LINE>referenceExpression.initialize(this.compilationUnit.compilationResult, getUnspecifiedReference(), typeArguments, selector, sourceEnd);<NEW_LINE>}<NEW_LINE>if (CharOperation.equals(selector, TypeConstants.INIT) && referenceExpression.lhs instanceof NameReference) {<NEW_LINE>referenceExpression.lhs.bits &= ~Binding.VARIABLE;<NEW_LINE>}<NEW_LINE>consumeReferenceExpression(referenceExpression);<NEW_LINE>}
.identifierStack[this.identifierPtr--];
1,063,214
public double updateWeightPlus(final double[] gradients, final double[] lastGradient, final int index) {<NEW_LINE>// multiply the current and previous gradient, and take the<NEW_LINE>// sign. We want to see if the gradient has changed its sign.<NEW_LINE>final int change = EncogMath.sign(gradients[index] * lastGradient[index]);<NEW_LINE>double weightChange = 0;<NEW_LINE>// if the gradient has retained its sign, then we increase the<NEW_LINE>// delta so that it will converge faster<NEW_LINE>if (change > 0) {<NEW_LINE>double delta = this.updateValues[index] * RPROPConst.POSITIVE_ETA;<NEW_LINE>delta = Math.min(delta, this.maxStep);<NEW_LINE>weightChange = EncogMath.sign(gradients[index]) * delta;<NEW_LINE>this.updateValues[index] = delta;<NEW_LINE>lastGradient[index] = gradients[index];<NEW_LINE>} else if (change < 0) {<NEW_LINE>// if change<0, then the sign has changed, and the last<NEW_LINE>// delta was too big<NEW_LINE>double delta = this.updateValues[index] * RPROPConst.NEGATIVE_ETA;<NEW_LINE>delta = Math.<MASK><NEW_LINE>this.updateValues[index] = delta;<NEW_LINE>weightChange = -this.lastWeightChange[index];<NEW_LINE>// set the previous gradent to zero so that there will be no<NEW_LINE>// adjustment the next iteration<NEW_LINE>lastGradient[index] = 0;<NEW_LINE>} else if (change == 0) {<NEW_LINE>// if change==0 then there is no change to the delta<NEW_LINE>final double delta = this.updateValues[index];<NEW_LINE>weightChange = EncogMath.sign(gradients[index]) * delta;<NEW_LINE>lastGradient[index] = gradients[index];<NEW_LINE>}<NEW_LINE>// apply the weight change, if any<NEW_LINE>return weightChange;<NEW_LINE>}
max(delta, RPROPConst.DELTA_MIN);
528,829
private void loadPreset() {<NEW_LINE>String presetName = getJobProps().get(GobblinConstants.GOBBLIN_PRESET_KEY);<NEW_LINE>if (presetName == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GobblinPresets preset = GobblinPresets.fromName(presetName);<NEW_LINE>Properties presetProperties = gobblinPresets.get(preset);<NEW_LINE>if (presetProperties == null) {<NEW_LINE>throw new IllegalArgumentException("Preset " + presetName + <MASK><NEW_LINE>}<NEW_LINE>getLog().info("Loading preset " + presetName + " : " + presetProperties);<NEW_LINE>Map<String, String> skipped = Maps.newHashMap();<NEW_LINE>for (String key : presetProperties.stringPropertyNames()) {<NEW_LINE>if (getJobProps().containsKey(key)) {<NEW_LINE>skipped.put(key, presetProperties.getProperty(key));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>getJobProps().put(key, presetProperties.getProperty(key));<NEW_LINE>}<NEW_LINE>getLog().info("Loaded preset " + presetName);<NEW_LINE>if (!skipped.isEmpty()) {<NEW_LINE>getLog().info("Skipped some properties from preset as already exists in job properties. Skipped: " + skipped);<NEW_LINE>}<NEW_LINE>if (getJobProps().getBoolean(GobblinConstants.GOBBLIN_PROPERTIES_HELPER_ENABLED_KEY, true)) {<NEW_LINE>getValidator(preset).validate(getJobProps());<NEW_LINE>}<NEW_LINE>}
" is not supported. Supported presets: " + gobblinPresets.keySet());
124,199
public long addLogListener(final List<Address> addresses, final List<List<Bytes32>> topics, final LogListener logListener) {<NEW_LINE>final List<org.hyperledger.besu.datatypes.Address> besuAddresses = addresses.stream().map(org.hyperledger.besu.datatypes.Address::fromPlugin<MASK><NEW_LINE>final List<List<LogTopic>> besuTopics = topics.stream().map(subList -> subList.stream().map(LogTopic::wrap).collect(toUnmodifiableList())).collect(toUnmodifiableList());<NEW_LINE>final LogsQuery logsQuery = new LogsQuery(besuAddresses, besuTopics);<NEW_LINE>return blockchain.observeLogs(logWithMetadata -> {<NEW_LINE>if (logsQuery.matches(LogWithMetadata.fromPlugin(logWithMetadata))) {<NEW_LINE>logListener.onLogEmitted(logWithMetadata);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
).collect(toUnmodifiableList());
679,855
public static LogResult postLog(@NonNull final Geocache cache, @NonNull final LogType logType, @NonNull final Calendar date, @NonNull final String log, final boolean addRecommendation) throws SuApiException {<NEW_LINE>final IConnector connector = ConnectorFactory.getConnector(cache.getGeocode());<NEW_LINE>if (!(connector instanceof SuConnector)) {<NEW_LINE>return new LogResult(StatusCode.LOG_POST_ERROR, "");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final Parameters params = new Parameters();<NEW_LINE>params.add("cacheID", cache.getCacheId());<NEW_LINE>params.add("type", getSuLogType(logType));<NEW_LINE>params.add("text", log);<NEW_LINE>params.add("add_recommendation", addRecommendation ? "true" : "false");<NEW_LINE>params.add("find_date", LOG_DATE_FORMAT.format(date.getTime()));<NEW_LINE>final ObjectNode data = postRequest(gcsuConnector, SuApiEndpoint.NOTE, params).data;<NEW_LINE>if (data == null) {<NEW_LINE>return new LogResult(StatusCode.LOG_POST_ERROR, "");<NEW_LINE>}<NEW_LINE>if (data.get("status").get("code").toString().contains("ERROR")) {<NEW_LINE>return new LogResult(StatusCode.LOG_POST_ERROR, "");<NEW_LINE>}<NEW_LINE>return new LogResult(StatusCode.NO_ERROR, data.get("data").get("noteID").asText());<NEW_LINE>}
final SuConnector gcsuConnector = (SuConnector) connector;
1,730,461
final SignOutUserResult executeSignOutUser(SignOutUserRequest signOutUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(signOutUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SignOutUserRequest> request = null;<NEW_LINE>Response<SignOutUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SignOutUserRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(signOutUserRequest));<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, "WorkLink");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SignOutUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SignOutUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SignOutUserResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
794,913
private static VcfFuncotationFactory createVcfDataSource(final Path dataSourceFile, final Properties dataSourceProperties, final LinkedHashMap<String, String> annotationOverridesMap, final FeatureInput<? extends Feature> featureInput, final int minBasesForValidSegment) {<NEW_LINE>Utils.nonNull(dataSourceFile);<NEW_LINE>Utils.nonNull(dataSourceProperties);<NEW_LINE>Utils.nonNull(annotationOverridesMap);<NEW_LINE>// Get some metadata:<NEW_LINE>final String <MASK><NEW_LINE>final String srcFile = dataSourceProperties.getProperty(CONFIG_FILE_FIELD_NAME_SRC_FILE);<NEW_LINE>final String version = dataSourceProperties.getProperty(CONFIG_FILE_FIELD_NAME_VERSION);<NEW_LINE>final boolean isB37 = getIsB37PropertyValue(dataSourceProperties);<NEW_LINE>// Create our VCF factory:<NEW_LINE>return new VcfFuncotationFactory(name, version, resolveFilePathStringFromKnownPath(srcFile, dataSourceFile), annotationOverridesMap, featureInput, isB37, minBasesForValidSegment);<NEW_LINE>}
name = dataSourceProperties.getProperty(CONFIG_FILE_FIELD_NAME_NAME);
49,641
protected Control createContents(Composite parent) {<NEW_LINE>final Composite composite = UIUtils.createComposite(parent, 1);<NEW_LINE>final DBPPreferenceStore preferences = GISViewerActivator.getDefault().getPreferences();<NEW_LINE>{<NEW_LINE>final Group group = UIUtils.createControlGroup(composite, GISMessages.pref_page_gis_viewer_group, 2, SWT.NONE, 0);<NEW_LINE>defaultSridText = UIUtils.createLabelText(group, GISMessages.pref_page_gis_viewer_label_srid, preferences.getString(GeometryViewerConstants.PREF_DEFAULT_SRID), SWT.BORDER);<NEW_LINE>defaultSridText.addVerifyListener(UIUtils.getIntegerVerifyListener(Locale.ENGLISH));<NEW_LINE>maxObjectsText = UIUtils.createLabelText(group, GISMessages.pref_page_gis_viewer_label_max_objects, preferences.getString(GeometryViewerConstants.PREF_MAX_OBJECTS_RENDER), SWT.BORDER);<NEW_LINE>maxObjectsText.addVerifyListener(UIUtils<MASK><NEW_LINE>}<NEW_LINE>return composite;<NEW_LINE>}
.getIntegerVerifyListener(Locale.ENGLISH));
890,377
public NotificationChannel unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>NotificationChannel notificationChannel = new NotificationChannel();<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 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("SNSTopicArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>notificationChannel.setSNSTopicArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RoleArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>notificationChannel.setRoleArn(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 notificationChannel;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
514,773
private void processRoleRefs(PolicyConfiguration ejbPC, String beanName, Map<String, String> roleLinkMap, Set<String> allRoles) throws PolicyContextException {<NEW_LINE>if (roleLinkMap != null) {<NEW_LINE>for (Entry<String, String> entry : roleLinkMap.entrySet()) {<NEW_LINE>String refName = entry.getKey();<NEW_LINE>String refLink = entry.getValue();<NEW_LINE>EJBRoleRefPermission ejbRolePerm = new EJBRoleRefPermission(beanName, refName);<NEW_LINE>ejbPC.addToRole(refLink, ejbRolePerm);<NEW_LINE>EJBRoleRefPermission ejbRolePermLink = new EJBRoleRefPermission(beanName, refLink);<NEW_LINE>ejbPC.addToRole(refLink, ejbRolePermLink);<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, <MASK><NEW_LINE>Tr.debug(tc, "addToRole(RefLink) role : " + refLink + " permission : " + ejbRolePermLink);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add additional role refs.<NEW_LINE>if (allRoles == null || !allRoles.contains(STARSTAR)) {<NEW_LINE>EJBRoleRefPermission ejbRolePerm = new EJBRoleRefPermission(beanName, STARSTAR);<NEW_LINE>ejbPC.addToRole(STARSTAR, ejbRolePerm);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "addToRole(DeclaredRefLink) role : ** permission : " + ejbRolePerm);<NEW_LINE>}<NEW_LINE>if (allRoles != null) {<NEW_LINE>for (String roleName : allRoles) {<NEW_LINE>if (roleLinkMap == null || !roleLinkMap.containsValue(roleName)) {<NEW_LINE>EJBRoleRefPermission ejbRolePerm = new EJBRoleRefPermission(beanName, roleName);<NEW_LINE>ejbPC.addToRole(roleName, ejbRolePerm);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "addToRole(DeclaredRefLink) role : " + roleName + " permission : " + ejbRolePerm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"addToRole(RefName) role : " + refLink + " permission : " + ejbRolePerm);
907,276
private static int[] cusum(double[] values, double threshold) {<NEW_LINE>// double threshold=1.0;<NEW_LINE>double drift = 0.0;<NEW_LINE>int size = values.length;<NEW_LINE>double[] csum_pos = new double[size];<NEW_LINE>double[] csum_neg = new double[size];<NEW_LINE>int[] change_points = new int[size];<NEW_LINE>int cp_idx = -1;<NEW_LINE>for (int i = 1; i < size; i++) {<NEW_LINE>double diff = values[i] - values[i - 1];<NEW_LINE>csum_pos[i] = csum_pos[i - 1] + diff - drift;<NEW_LINE>csum_neg[i] = csum_neg[<MASK><NEW_LINE>if (csum_pos[i] < 0) {<NEW_LINE>csum_pos[i] = 0;<NEW_LINE>}<NEW_LINE>if (csum_neg[i] < 0) {<NEW_LINE>csum_neg[i] = 0;<NEW_LINE>}<NEW_LINE>if (csum_pos[i] > threshold || csum_neg[i] > threshold) {<NEW_LINE>cp_idx++;<NEW_LINE>change_points[cp_idx] = i;<NEW_LINE>csum_pos[i] = 0.;<NEW_LINE>csum_neg[i] = 0.;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Arrays.copyOf(change_points, cp_idx + 1);<NEW_LINE>}
i - 1] - diff - drift;
947,828
public static void registerTornadoMathPlugins(final InvocationPlugins plugins) {<NEW_LINE>InvocationPlugins.Registration registration = new InvocationPlugins.Registration(plugins, TornadoMath.class);<NEW_LINE>registerFloatMath1Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerTrigonometric1Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerFloatMath2Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerFloatMath1Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerFloatMath2Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerIntMath1Plugins(registration, int.class, JavaKind.Int);<NEW_LINE>registerIntMath2Plugins(registration, int.class, JavaKind.Int);<NEW_LINE>registerIntMath3Plugins(registration, <MASK><NEW_LINE>registerIntMath1Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath2Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath3Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath1Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath2Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath3Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath1Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>registerIntMath2Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>registerIntMath3Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>}
int.class, JavaKind.Int);
1,172,893
// Register late start callbacks with a policy executor. Verify that at most one can be registered,<NEW_LINE>// that the most recently registered replaces any previous ones, and that the late start callback<NEW_LINE>// can be unregistered by supplying null. Verify that the late start callback is notified when a<NEW_LINE>// task starts after the designated threshold.<NEW_LINE>@Test<NEW_LINE>public void testLateStartCallback() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testLateStartCallback").maxConcurrency(1).maxQueueSize(1).maxWaitForEnqueue(TimeUnit.NANOSECONDS.toMillis(TIMEOUT_NS));<NEW_LINE>CountDownLatch lateBy3MinutesLatch = new CountDownLatch(1);<NEW_LINE>Runnable lateBy3MinutesCallback = new CountDownCallback(lateBy3MinutesLatch);<NEW_LINE>assertNull(executor.registerLateStartCallback(3<MASK><NEW_LINE>// use up maxConcurrency<NEW_LINE>CountDownLatch blocker1StartedLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch blockerContinueLatch = new CountDownLatch(1);<NEW_LINE>CountDownTask blocker1Task = new CountDownTask(blocker1StartedLatch, blockerContinueLatch, TimeUnit.MINUTES.toNanos(9));<NEW_LINE>Future<Boolean> blocker1Future = executor.submit(blocker1Task);<NEW_LINE>// queue another task<NEW_LINE>PolicyTaskFuture<Integer> lateTaskFuture = executor.submit(new SharedIncrementTask(), 1, null);<NEW_LINE>assertTrue(blocker1StartedLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>// new registration replaces previous<NEW_LINE>CountDownLatch lateBy200MillisLatch = new CountDownLatch(1);<NEW_LINE>Runnable lateBy200MillisCallback = new CountDownCallback(lateBy200MillisLatch);<NEW_LINE>assertEquals(lateBy3MinutesCallback, executor.registerLateStartCallback(200, TimeUnit.MILLISECONDS, lateBy200MillisCallback));<NEW_LINE>// wait for task to become late, and then allow it to run<NEW_LINE>// extra 100ms tolerance<NEW_LINE>TimeUnit.MILLISECONDS.sleep(300 - lateTaskFuture.getElapsedAcceptTime(TimeUnit.MILLISECONDS) - lateTaskFuture.getElapsedQueueTime(TimeUnit.MILLISECONDS));<NEW_LINE>blockerContinueLatch.countDown();<NEW_LINE>assertTrue(lateBy200MillisLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>// register another callback which hasn't been reached<NEW_LINE>assertNull(executor.registerLateStartCallback(3, TimeUnit.MINUTES, lateBy3MinutesCallback));<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>assertEquals(Integer.valueOf(1), lateTaskFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(blocker1Future.isDone());<NEW_LINE>assertFalse(blocker1Future.isCancelled());<NEW_LINE>executor.shutdown();<NEW_LINE>assertTrue(executor.awaitTermination(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>// never invoked<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>try {<NEW_LINE>Runnable previous = executor.registerLateStartCallback(5, TimeUnit.SECONDS, new CountDownCallback(new CountDownLatch(1)));<NEW_LINE>fail("Should not be able to register callback after shutdown. Result of register was: " + previous);<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>}
, TimeUnit.MINUTES, lateBy3MinutesCallback));
196,071
private static void insertRecord(String deviceId, int minTime, int maxTime) throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>List<String> measurements = new ArrayList<>();<NEW_LINE>List<TSDataType> types = new ArrayList<>();<NEW_LINE>measurements.add("s2");<NEW_LINE>measurements.add("s4");<NEW_LINE>measurements.add("s5");<NEW_LINE>measurements.add("s6");<NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE>for (long time = minTime; time < maxTime; time++) {<NEW_LINE>List<Object> values = new ArrayList<>();<NEW_LINE>values.add(time * 10 + 3L);<NEW_LINE>values.add(time * 10 + 4L);<NEW_LINE>values.add(time * 10 + 5L);<NEW_LINE>values.<MASK><NEW_LINE>session.insertRecord(deviceId, time, measurements, types, values);<NEW_LINE>}<NEW_LINE>}
add(time * 10 + 6L);
1,795,801
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "ServiceDiscovery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
930,645
final AdminDeleteUserResult executeAdminDeleteUser(AdminDeleteUserRequest adminDeleteUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(adminDeleteUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<AdminDeleteUserRequest> request = null;<NEW_LINE>Response<AdminDeleteUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AdminDeleteUserRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(adminDeleteUserRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AdminDeleteUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AdminDeleteUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AdminDeleteUserResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,141,309
private void verifyResults(PrintWriter pw, JobExecution je, String testName) throws TestFailureException {<NEW_LINE>// Common stuff<NEW_LINE>JobOperator jobOp = BatchRuntime.getJobOperator();<NEW_LINE>long execId = je.getExecutionId();<NEW_LINE>// Tests<NEW_LINE>if (testName.equals("testNullPropOnJobExecution")) {<NEW_LINE>JobInstance ji = jobOp.getJobInstance(execId);<NEW_LINE>JobExecution jex = jobOp.getJobExecutions(ji).get(0);<NEW_LINE>if (!jex.getBatchStatus().toString().equals(BatchStatus.COMPLETED.toString())) {<NEW_LINE>throw new TestFailureException("Expected " + BatchStatus.COMPLETED.toString() + ", but found " + jex.getBatchStatus().toString());<NEW_LINE>}<NEW_LINE>Properties storedProps = jex.getJobParameters();<NEW_LINE>if (storedProps.size() > 1) {<NEW_LINE>throw new TestFailureException(<MASK><NEW_LINE>}<NEW_LINE>if (!storedProps.getProperty("sleepTime").equals("100")) {<NEW_LINE>throw new TestFailureException("Unexpected property value returned, expected " + "100" + ", but found " + storedProps.getProperty("sleepTime"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Not expecting testName = " + testName);<NEW_LINE>}<NEW_LINE>}
"Unexpected number of properties returned, expected 1 but found " + storedProps.size());
1,693,959
protected void initChannel(LocalChannel ch) throws Exception {<NEW_LINE>synchronized (suspensionLock) {<NEW_LINE>while (suspended) {<NEW_LINE>suspensionLock.wait();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BookieSideConnectionPeerContextHandler contextHandler = new BookieSideConnectionPeerContextHandler();<NEW_LINE>ChannelPipeline pipeline = ch.pipeline();<NEW_LINE>pipeline.addLast("lengthbaseddecoder", new LengthFieldBasedFrameDecoder(maxFrameSize, 0<MASK><NEW_LINE>pipeline.addLast("lengthprepender", new LengthFieldPrepender(4));<NEW_LINE>pipeline.addLast("bookieProtoDecoder", new BookieProtoEncoding.RequestDecoder(registry));<NEW_LINE>pipeline.addLast("bookieProtoEncoder", new BookieProtoEncoding.ResponseEncoder(registry));<NEW_LINE>pipeline.addLast("bookieAuthHandler", new AuthHandler.ServerSideHandler(contextHandler.getConnectionPeer(), authProviderFactory));<NEW_LINE>ChannelInboundHandler requestHandler = isRunning.get() ? new BookieRequestHandler(conf, requestProcessor, allChannels) : new RejectRequestHandler();<NEW_LINE>pipeline.addLast("bookieRequestHandler", requestHandler);<NEW_LINE>pipeline.addLast("contextHandler", contextHandler);<NEW_LINE>}
, 4, 0, 4));
844,537
private void startSingleBackupTask(String taskToken, SingleBackupTaskConfig config) {<NEW_LINE>if (config.exportMode() && !supportsApkExport()) {<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.queued(taskToken, config));<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.inProgress(taskToken, config, 0, 1));<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.failed(taskToken, config, new IllegalArgumentException("APK export is not supported by this storage")));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InternalDelegatedFile delegatedFile = new InternalDelegatedFile(config);<NEW_LINE>ApksSingleBackupTaskExecutor taskExecutor = new ApksSingleBackupTaskExecutor(getContext(), config, delegatedFile);<NEW_LINE>taskExecutor.setListener(new ApksSingleBackupTaskExecutor.Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStart() {<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.inProgress(taskToken, config, 0, 1));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(long current, long goal) {<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.inProgress(taskToken, config, current, goal));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancelled() {<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.cancelled(taskToken, config));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(@Nullable Backup backup) {<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.succeeded(taskToken, config, backup));<NEW_LINE>if (!config.exportMode()) {<NEW_LINE>notifyBackupAdded(Objects.requireNonNull(backup));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Exception e) {<NEW_LINE>Log.w(TAG, String.format("Unable to export %s, task token is %s", config.packageMeta().packageName, taskToken), e);<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus.failed(taskToken, config, e));<NEW_LINE>}<NEW_LINE>}, mTaskProgressHandler);<NEW_LINE>synchronized (mTaskExecutors) {<NEW_LINE>mTaskExecutors.put(taskToken, taskExecutor);<NEW_LINE>}<NEW_LINE>notifyBackupTaskStatusChanged(BackupTaskStatus<MASK><NEW_LINE>taskExecutor.execute(mTaskExecutor);<NEW_LINE>}
.queued(taskToken, config));
1,432,389
public AvailabilityOptionsStatus unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>AvailabilityOptionsStatus availabilityOptionsStatus = new AvailabilityOptionsStatus();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return availabilityOptionsStatus;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Options", targetDepth)) {<NEW_LINE>availabilityOptionsStatus.setOptions(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>availabilityOptionsStatus.setStatus(OptionStatusStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return availabilityOptionsStatus;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,761,537
private void removeVmfsDatastore(Command cmd, VmwareHypervisorHost hyperHost, String datastoreName, String storageIpAddress, int storagePortNumber, String iqn, List<Pair<ManagedObjectReference, String>> lstHosts) throws Exception {<NEW_LINE>VmwareContext context = hostService.getServiceContext(cmd);<NEW_LINE>unmountVmfsDatastore(context, hyperHost, datastoreName, lstHosts);<NEW_LINE>HostDiscoveryMethod hostDiscoveryMethod = getHostDiscoveryMethod(context, storageIpAddress, lstHosts);<NEW_LINE>List<HostMO> hostsUsingStaticDiscovery = hostDiscoveryMethod.getHostsUsingStaticDiscovery();<NEW_LINE>if (hostsUsingStaticDiscovery != null && hostsUsingStaticDiscovery.size() > 0) {<NEW_LINE>HostInternetScsiHbaStaticTarget target = new HostInternetScsiHbaStaticTarget();<NEW_LINE>target.setAddress(storageIpAddress);<NEW_LINE>target.setPort(storagePortNumber);<NEW_LINE>target.setIScsiName(iqn);<NEW_LINE>final List<HostInternetScsiHbaStaticTarget> <MASK><NEW_LINE>lstTargets.add(target);<NEW_LINE>addRemoveInternetScsiTargetsToAllHosts(false, lstTargets, hostsUsingStaticDiscovery);<NEW_LINE>rescanAllHosts(hostsUsingStaticDiscovery, true, false);<NEW_LINE>}<NEW_LINE>}
lstTargets = new ArrayList<>();
1,539,298
public List<ThrustCurveMotor> findMotors(String digest, Motor.Type type, String manufacturer, String designation, double diameter, double length) {<NEW_LINE>ArrayList<ThrustCurveMotor> fullMatches = new ArrayList<ThrustCurveMotor>();<NEW_LINE>ArrayList<ThrustCurveMotor> digestMatches <MASK><NEW_LINE>ArrayList<ThrustCurveMotor> descriptionMatches = new ArrayList<ThrustCurveMotor>();<NEW_LINE>// Apply filters to see if we can find any motors that match the given criteria. We'll return<NEW_LINE>// the most restrictive nonempty list we find, or empty list if no matches at all<NEW_LINE>for (ThrustCurveMotorSet set : motorSets) {<NEW_LINE>for (ThrustCurveMotor m : set.getMotors()) {<NEW_LINE>boolean matchDescription = true;<NEW_LINE>boolean matchDigest = true;<NEW_LINE>// unlike the description, digest must be present in search criteria to get a match<NEW_LINE>if (digest == null || digest != m.getDigest())<NEW_LINE>matchDigest = false;<NEW_LINE>// match description<NEW_LINE>if (type != null && type != set.getType())<NEW_LINE>matchDescription = false;<NEW_LINE>else if (manufacturer != null && !m.getManufacturer().matches(manufacturer))<NEW_LINE>matchDescription = false;<NEW_LINE>else if (designation != null && !m.getDesignation().toUpperCase().contains(designation.toUpperCase()) && !designation.toUpperCase().contains(m.getCommonName().toUpperCase()))<NEW_LINE>matchDescription = false;<NEW_LINE>else if (!Double.isNaN(diameter) && (Math.abs(diameter - m.getDiameter()) > 0.005))<NEW_LINE>matchDescription = false;<NEW_LINE>else if (!Double.isNaN(length) && (Math.abs(length - m.getLength()) > 0.005))<NEW_LINE>matchDescription = false;<NEW_LINE>if (matchDigest)<NEW_LINE>digestMatches.add(m);<NEW_LINE>if (matchDescription)<NEW_LINE>descriptionMatches.add(m);<NEW_LINE>if (matchDigest && matchDescription)<NEW_LINE>fullMatches.add(m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!fullMatches.isEmpty())<NEW_LINE>return fullMatches;<NEW_LINE>if (!digestMatches.isEmpty())<NEW_LINE>return digestMatches;<NEW_LINE>return descriptionMatches;<NEW_LINE>}
= new ArrayList<ThrustCurveMotor>();
1,413,961
public TemplateModel exec(List args) throws TemplateModelException {<NEW_LINE>if (args.size() == 1) {<NEW_LINE>String messageKey = ((SimpleScalar) args.get(0)).getAsString();<NEW_LINE>String messageValue = messages.get(messageKey, language);<NEW_LINE>return new SimpleScalar(messageValue);<NEW_LINE>} else if (args.size() > 1) {<NEW_LINE>List<Object> objects = new ArrayList<>();<NEW_LINE>for (Object o : args) {<NEW_LINE>if (o instanceof SimpleScalar) {<NEW_LINE>objects.add(((SimpleScalar<MASK><NEW_LINE>} else if (o instanceof SimpleNumber) {<NEW_LINE>objects.add(o.toString());<NEW_LINE>} else if (o instanceof StringModel) {<NEW_LINE>objects.add(((StringModel) o).getWrappedObject());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String messageKey = objects.get(0).toString();<NEW_LINE>String messageValue = messages.get(messageKey, language, objects.subList(1, objects.size()).toArray());<NEW_LINE>return new SimpleScalar(messageValue);<NEW_LINE>} else {<NEW_LINE>throw new TemplateModelException("Please specify a message key for the i18n() method!");<NEW_LINE>}<NEW_LINE>}
) o).getAsString());
285,105
private static Map<TypeVariable, Type> buildGenericInfo(Class<?> clazz) {<NEW_LINE>Class<?> childClass = clazz;<NEW_LINE>Class<?> currentClass = clazz.getSuperclass();<NEW_LINE>if (currentClass == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<TypeVariable, Type> typeVarMap = null;<NEW_LINE>// analyse the whole generic info from the class inheritance<NEW_LINE>for (; currentClass != null && currentClass != Object.class; childClass = currentClass, currentClass = currentClass.getSuperclass()) {<NEW_LINE>if (childClass.getGenericSuperclass() instanceof ParameterizedType) {<NEW_LINE>Type[] childGenericParentActualTypeArgs = ((ParameterizedType) childClass.getGenericSuperclass()).getActualTypeArguments();<NEW_LINE>TypeVariable[] currentTypeParameters = currentClass.getTypeParameters();<NEW_LINE>for (int i = 0; i < childGenericParentActualTypeArgs.length; i++) {<NEW_LINE>// if the child class's generic super class actual args is defined in the child class type parameters<NEW_LINE>if (typeVarMap == null) {<NEW_LINE>typeVarMap = new HashMap<TypeVariable, Type>();<NEW_LINE>}<NEW_LINE>if (typeVarMap.containsKey(childGenericParentActualTypeArgs[i])) {<NEW_LINE>Type actualArg = typeVarMap.get(childGenericParentActualTypeArgs[i]);<NEW_LINE>typeVarMap.put(currentTypeParameters[i], actualArg);<NEW_LINE>} else {<NEW_LINE>typeVarMap.put(currentTypeParameters[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return typeVarMap;<NEW_LINE>}
i], childGenericParentActualTypeArgs[i]);
737,493
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1".split(",");<NEW_LINE>SupportEvalBuilder builder = new SupportEvalBuilder("SupportCollection");<NEW_LINE>builder.expression(fields[0], "strvals.orderBy()");<NEW_LINE>builder.expression(fields[1], "strvals.orderByDesc()");<NEW_LINE>builder.statementConsumer(stmt -> SupportEventPropUtil.assertTypesAllSame(stmt.getEventType(), fields, EPTypeClassParameterized.from(Collection.class, String.class)));<NEW_LINE>builder.assertion(SupportCollection.makeString("E2,E1,E5,E4")).verify("c0", val -> assertValuesArrayScalar(val, "E1", "E2", "E4", "E5")).verify("c1", val -> assertValuesArrayScalar(val, "E5"<MASK><NEW_LINE>LambdaAssertionUtil.assertSingleAndEmptySupportColl(builder, fields);<NEW_LINE>builder.run(env);<NEW_LINE>}
, "E4", "E2", "E1"));
731,910
private void processPlayerList(ByteBufDataInput in) {<NEW_LINE>ByteBuf buf = Unpooled.buffer();<NEW_LINE>ByteBufDataOutput out = new ByteBufDataOutput(buf);<NEW_LINE>String target = in.readUTF();<NEW_LINE>if (target.equals("ALL")) {<NEW_LINE>out.writeUTF("PlayerList");<NEW_LINE>out.writeUTF("ALL");<NEW_LINE>StringJoiner joiner = new StringJoiner(", ");<NEW_LINE>for (Player online : proxy.getAllPlayers()) {<NEW_LINE>joiner.add(online.getUsername());<NEW_LINE>}<NEW_LINE>out.writeUTF(joiner.toString());<NEW_LINE>} else {<NEW_LINE>proxy.getServer(target).ifPresent(info -> {<NEW_LINE>out.writeUTF("PlayerList");<NEW_LINE>out.writeUTF(info.getServerInfo().getName());<NEW_LINE><MASK><NEW_LINE>for (Player online : info.getPlayersConnected()) {<NEW_LINE>joiner.add(online.getUsername());<NEW_LINE>}<NEW_LINE>out.writeUTF(joiner.toString());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (buf.isReadable()) {<NEW_LINE>sendResponseOnConnection(buf);<NEW_LINE>} else {<NEW_LINE>buf.release();<NEW_LINE>}<NEW_LINE>}
StringJoiner joiner = new StringJoiner(", ");
152,506
protected void saveEditorValue(Control control, int index, TableItem item) {<NEW_LINE>SQLQueryParameter param = (SQLQueryParameter) item.getData();<NEW_LINE><MASK><NEW_LINE>item.setText(2, newValue);<NEW_LINE>param.setValue(newValue);<NEW_LINE>param.setVariableSet(!CommonUtils.isEmpty(newValue));<NEW_LINE>if (param.isNamed()) {<NEW_LINE>final List<SQLQueryParameter> dups = dupParameters.get(param.getName());<NEW_LINE>if (dups != null) {<NEW_LINE>for (SQLQueryParameter dup : dups) {<NEW_LINE>dup.setValue(newValue);<NEW_LINE>dup.setVariableSet(!CommonUtils.isEmpty(newValue));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>queryContext.setVariable(param.getName(), param.getValue());<NEW_LINE>}<NEW_LINE>savedParamValues.put(param.getName().toUpperCase(Locale.ENGLISH), new SQLQueryParameterRegistry.ParameterInfo(param.getName(), newValue));<NEW_LINE>updateQueryPreview();<NEW_LINE>}
String newValue = editor.getText();
1,679,363
private ActionToolbar createTreeToolbarPanel() {<NEW_LINE>final CommonActionsManager actionManager = CommonActionsManager.getInstance();<NEW_LINE>DefaultActionGroup actions = new DefaultActionGroup();<NEW_LINE>actions.add(new InspectionFilterAction(mySelectedProfile, myInspectionsFilter, myProjectProfileManager.getProject()));<NEW_LINE>actions.addSeparator();<NEW_LINE>actions.add(actionManager<MASK><NEW_LINE>actions.add(actionManager.createCollapseAllAction(myTreeExpander, myTreeTable));<NEW_LINE>actions.add(new DumbAwareAction("Reset to Empty", "Reset to empty", AllIcons.General.Reset) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(@Nonnull AnActionEvent e) {<NEW_LINE>e.getPresentation().setEnabled(mySelectedProfile != null && mySelectedProfile.isExecutable(myProjectProfileManager.getProject()));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>mySelectedProfile.resetToEmpty(e.getProject());<NEW_LINE>loadDescriptorsConfigs(false);<NEW_LINE>postProcessModification();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>actions.add(new AdvancedSettingsAction(myProjectProfileManager.getProject(), myRoot) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected InspectionProfileImpl getInspectionProfile() {<NEW_LINE>return mySelectedProfile;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void postProcessModification() {<NEW_LINE>loadDescriptorsConfigs(true);<NEW_LINE>SingleInspectionProfilePanel.this.postProcessModification();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actions, true);<NEW_LINE>actionToolbar.setTargetComponent(this);<NEW_LINE>return actionToolbar;<NEW_LINE>}
.createExpandAllAction(myTreeExpander, myTreeTable));
646,006
public AccountOut lookupCredentials(AccountIn credentials) {<NEW_LINE>AccountOut auth = null;<NEW_LINE>// asynch<NEW_LINE>Boolean success = lookupAccount(credentials);<NEW_LINE>if (success) {<NEW_LINE>// get authentication token from lookupAccountPoll<NEW_LINE>Boolean loop = true;<NEW_LINE>while (loop) {<NEW_LINE>loop = false;<NEW_LINE>try {<NEW_LINE>Thread.sleep(minRetryInterval);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>auth = lookupAccountPoll();<NEW_LINE>if (auth == null) {<NEW_LINE>Logging.logError(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (auth.getErrorNum() == BOINCErrors.ERR_IN_PROGRESS) {<NEW_LINE>// no result yet, keep looping<NEW_LINE>loop = true;<NEW_LINE>} else {<NEW_LINE>// final result ready<NEW_LINE>if (auth.getErrorNum() == 0) {<NEW_LINE>Logging.logDebug(Logging.Category.CLIENT, "ClientInterfaceImplementation.lookupCredentials: authenticator retrieved.");<NEW_LINE>} else {<NEW_LINE>Logging.logDebug(Logging.Category.CLIENT, "ClientInterfaceImplementation.lookupCredentials: final result with error_num: " + auth.getErrorNum());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Logging.logDebug(Logging.Category.CLIENT, "rpc.lookupAccount failed.");<NEW_LINE>}<NEW_LINE>return auth;<NEW_LINE>}
Logging.Category.CLIENT, "ClientInterfaceImplementation.lookupCredentials: returned null.");
52,225
private void applyOverlayMonochrome(int gg0000, WritableRaster raster, int frameIndex, ImageReadParam param, byte[] ovlyData) {<NEW_LINE>Attributes ovlyAttrs = metadata.getAttributes();<NEW_LINE>int[] pixelValue = new int[] { 0xff };<NEW_LINE>if (param instanceof DicomImageReadParam) {<NEW_LINE>DicomImageReadParam dParam = (DicomImageReadParam) param;<NEW_LINE>pixelValue = new int[] { dParam<MASK><NEW_LINE>Attributes psAttrs = dParam.getPresentationState();<NEW_LINE>if (psAttrs != null) {<NEW_LINE>if (psAttrs.containsValue(Tag.OverlayData | gg0000))<NEW_LINE>ovlyAttrs = psAttrs;<NEW_LINE>pixelValue = Overlays.getRecommendedGrayscalePixelValue(psAttrs, gg0000, 8);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Overlays.applyOverlay(ovlyData != null ? 0 : frameIndex, raster, ovlyAttrs, gg0000, pixelValue, ovlyData);<NEW_LINE>}
.getOverlayGrayscaleValue() >> 8 };
1,419,372
// submit the map/reduce job.<NEW_LINE>public int run(final String[] args) throws Exception {<NEW_LINE>if (args.length != 4) {<NEW_LINE>System.out.println("args.length = " + args.length);<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < args.length; i++) {<NEW_LINE>System.out.println("args[" + i + "] = " + args[i]);<NEW_LINE>}<NEW_LINE>return printUsage();<NEW_LINE>}<NEW_LINE>edge_path = new Path(args[0]);<NEW_LINE>output_path = new Path(args[1]);<NEW_LINE>nreducers = Integer<MASK><NEW_LINE>if (args[3].compareTo("makesym") == 0)<NEW_LINE>make_symmetric = 1;<NEW_LINE>else<NEW_LINE>make_symmetric = 0;<NEW_LINE>System.out.println("\n-----===[PEGASUS: A Peta-Scale Graph Mining System]===-----\n");<NEW_LINE>System.out.println("[PEGASUS] Converting the adjacency matrix to column-normalized format.\n");<NEW_LINE>JobClient.runJob(configStage1());<NEW_LINE>System.out.println("\n[PEGASUS] Conversion finished.");<NEW_LINE>System.out.println("[PEGASUS] Column normalized adjacency matrix is saved in the HDFS " + args[1] + "\n");<NEW_LINE>return 0;<NEW_LINE>}
.parseInt(args[2]);
1,483,806
protected Map<String, String> toMetricTags() {<NEW_LINE>Map<String, String> tags = super.toMetricTags();<NEW_LINE>addTag(tags, CLUSTER, cluster.getClusterName());<NEW_LINE>addTag(tags, SHARD, shard);<NEW_LINE>addTag(tags, ROLE, role);<NEW_LINE>addTag(tags, READ_STRATEGY, readStrategy);<NEW_LINE>addTag(tags, DB_KEY, String.format("%s-%s-%s", cluster, shard, role));<NEW_LINE>ClusterType type = cluster.getClusterType();<NEW_LINE>if (type == ClusterType.DRC) {<NEW_LINE><MASK><NEW_LINE>if (config != null && config.getLocalizationState() == LocalizationState.ACTIVE)<NEW_LINE>tags.put(CLUSTER_TYPE, type.getValue() + "_" + config.getLocalizationState().getValue());<NEW_LINE>else<NEW_LINE>tags.put(CLUSTER_TYPE, type.getValue() + "_" + LocalizationState.PREPARED.getValue());<NEW_LINE>if (config != null && config.getUnitStrategyId() != null)<NEW_LINE>tags.put(UCS_STRATEGY, String.valueOf(config.getUnitStrategyId()));<NEW_LINE>} else if (type != null)<NEW_LINE>tags.put(CLUSTER_TYPE, type.getValue());<NEW_LINE>return tags;<NEW_LINE>}
LocalizationConfig config = cluster.getLocalizationConfig();
462,057
private Document LoadProjectFileFromController() throws IhcExecption {<NEW_LINE>try {<NEW_LINE>WSProjectInfo projectInfo = getProjectInfo();<NEW_LINE><MASK><NEW_LINE>int segmentationSize = controllerService.getProjectSegmentationSize();<NEW_LINE>logger.debug("Number of segments: {}", numberOfSegments);<NEW_LINE>logger.debug("Segmentation size: {}", segmentationSize);<NEW_LINE>ByteArrayOutputStream byteStream = new ByteArrayOutputStream();<NEW_LINE>for (int i = 0; i < numberOfSegments; i++) {<NEW_LINE>logger.debug("Downloading segment {}", i);<NEW_LINE>WSFile data = controllerService.getProjectSegment(i, projectInfo.getProjectMajorRevision(), projectInfo.getProjectMinorRevision());<NEW_LINE>byteStream.write(data.getData());<NEW_LINE>}<NEW_LINE>logger.debug("File size before base64 encoding: {} bytes", byteStream.size());<NEW_LINE>byte[] decodedBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(byteStream.toString());<NEW_LINE>logger.debug("File size after base64 encoding: {} bytes", decodedBytes.length);<NEW_LINE>GZIPInputStream gzis = new GZIPInputStream(new ByteArrayInputStream(decodedBytes));<NEW_LINE>InputStreamReader in = new InputStreamReader(gzis, "ISO-8859-1");<NEW_LINE>InputSource reader = new InputSource(in);<NEW_LINE>DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder db = dbf.newDocumentBuilder();<NEW_LINE>return db.parse(reader);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IhcExecption(e);<NEW_LINE>}<NEW_LINE>}
int numberOfSegments = controllerService.getProjectNumberOfSegments();
1,853,480
public static void main(String[] args) {<NEW_LINE>// grep -C1 'static boolean . = false;' * | grep 'static final Logger . = LogManager\.getLogger();' # od<NEW_LINE>od.c();<NEW_LINE>// grep '"textures/atlas/blocks.png"' * # cty<NEW_LINE>// grep 'private final cty b;' * # cxi<NEW_LINE>cxi manager = new cxi(new cty("textures"));<NEW_LINE>Map block_to_blockstate = manager.c().a().a();<NEW_LINE>System.out.print("// (name, temperature, humidity)\n");<NEW_LINE>System.out.print("pub static BIOMES: [Option<(&'static str, f32, f32)>, ..256] = [");<NEW_LINE>int none_trail_len = 0;<NEW_LINE>// grep Swampland * # ark<NEW_LINE>for (ark biome : ark.n()) {<NEW_LINE>if (biome == null) {<NEW_LINE>if ((none_trail_len % 16) == 0)<NEW_LINE>System.out.print("\n None,");<NEW_LINE>else<NEW_LINE>System.out.print(" None,");<NEW_LINE>none_trail_len++;<NEW_LINE>} else {<NEW_LINE>System.out.printf("\n Some((\"%s\", %.1f, %.1f)),", biome.ah, biome.ap, biome.aq);<NEW_LINE>none_trail_len = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.print("\n];\n\n");<NEW_LINE>System.out.print("// (id, name, variant)\n");<NEW_LINE>System.out.print("pub static BLOCK_STATES: &'static [(u16, &'static str, &'static str)] = &[\n");<NEW_LINE>// grep 'new \w*("air");' * # atp<NEW_LINE>for (Object o : atp.d) {<NEW_LINE>int id = <MASK><NEW_LINE>// grep '?"normal":' * # cxj<NEW_LINE>cxj path = (cxj) block_to_blockstate.get(o);<NEW_LINE>if (path == null || !path.b().equals("minecraft"))<NEW_LINE>System.out.printf(" // %04x: \"%s\" (%s)\n", id, o, path);<NEW_LINE>else<NEW_LINE>System.out.printf(" (0x%04x, \"%s\", \"%s\"),\n", id, path.a(), path.c());<NEW_LINE>}<NEW_LINE>System.out.print("];\n");<NEW_LINE>}
atp.d.b(o);
1,116,192
void onNeighboursReceived(final DiscoveryPeer peer, final List<DiscoveryPeer> peers) {<NEW_LINE>final MetadataPeer metadataPeer = oneTrueMap.get(peer.getId());<NEW_LINE>if (metadataPeer == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.debug(<MASK><NEW_LINE>for (final DiscoveryPeer receivedDiscoPeer : peers) {<NEW_LINE>if (satisfiesMapAdditionCriteria(receivedDiscoPeer)) {<NEW_LINE>final MetadataPeer receivedMetadataPeer = new MetadataPeer(receivedDiscoPeer, PeerDistanceCalculator.distance(target, receivedDiscoPeer.getId()));<NEW_LINE>oneTrueMap.put(receivedDiscoPeer.getId(), receivedMetadataPeer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!metadataPeer.hasOutstandingNeighboursRequest()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>metadataPeer.findNeighboursComplete();<NEW_LINE>if (neighboursRoundTermination()) {<NEW_LINE>bondingInitiateRound();<NEW_LINE>}<NEW_LINE>}
"Received neighbours packet with {} neighbours", peers.size());
752,098
public AlarmConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AlarmConfiguration alarmConfiguration = new AlarmConfiguration();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>alarmConfiguration.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ignorePollAlarmFailure", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>alarmConfiguration.setIgnorePollAlarmFailure(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("alarms", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>alarmConfiguration.setAlarms(new ListUnmarshaller<Alarm>(AlarmJsonUnmarshaller.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 alarmConfiguration;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
220,233
private Route postAgentClustersRoute() {<NEW_LINE>logger.info("POST /api/v1/agentClusters called");<NEW_LINE>return entity(Jackson.unmarshaller(new TypeReference<List<String>>() {<NEW_LINE>}), activeClustersList -> {<NEW_LINE>logger.info("POST {} called {}", API_V1_AGENT_CLUSTER, activeClustersList);<NEW_LINE>try {<NEW_LINE>agentClusterOps.setActiveVMsAttributeValues(activeClustersList);<NEW_LINE>} catch (IOException e) {<NEW_LINE>HttpRequestMetrics.getInstance().incrementEndpointMetrics(HttpRequestMetrics.Endpoints.AGENT_CLUSTERS, new BasicTag("verb", HttpRequestMetrics.HttpVerb.GET.toString()), new BasicTag("responseCode", String.valueOf(StatusCodes.INTERNAL_SERVER_ERROR.intValue())));<NEW_LINE>return complete(StatusCodes.INTERNAL_SERVER_ERROR, "Failed to set active clusters to " + activeClustersList.toString());<NEW_LINE>}<NEW_LINE>HttpRequestMetrics.getInstance().incrementEndpointMetrics(HttpRequestMetrics.Endpoints.AGENT_CLUSTERS, new BasicTag("verb", HttpRequestMetrics.HttpVerb.GET.toString()), new BasicTag("responseCode", String.valueOf(StatusCodes.OK.intValue())));<NEW_LINE>return <MASK><NEW_LINE>});<NEW_LINE>}
complete(StatusCodes.OK, "");
1,477,347
public ImmutableList<RateAccrualPeriod> createAccrualPeriods(Schedule accrualSchedule, Schedule paymentSchedule, ReferenceData refData) {<NEW_LINE>// avoid null stub definitions if there are stubs<NEW_LINE>FixedRateStubCalculation initialStub = firstNonNull(this.initialStub, FixedRateStubCalculation.NONE);<NEW_LINE>FixedRateStubCalculation finalStub = firstNonNull(this.finalStub, FixedRateStubCalculation.NONE);<NEW_LINE>// resolve data by schedule<NEW_LINE>DoubleArray resolvedRates = rate.resolveValues(accrualSchedule);<NEW_LINE>// future value notional present<NEW_LINE>if (getFutureValueNotional().isPresent()) {<NEW_LINE>if (accrualSchedule.size() != 1) {<NEW_LINE>throw new IllegalArgumentException("Invalid swap, only one accrual period allowed when future value notional is present");<NEW_LINE>}<NEW_LINE>SchedulePeriod period = accrualSchedule.getPeriod(0);<NEW_LINE>double yearFraction = period.yearFraction(dayCount, accrualSchedule);<NEW_LINE>double resolvedRate = resolvedRates.get(0);<NEW_LINE>RateComputation rateComputation = FixedOvernightCompoundedAnnualRateComputation.of(resolvedRate, yearFraction);<NEW_LINE>RateAccrualPeriod accrualPeriod = new RateAccrualPeriod(period, yearFraction, rateComputation);<NEW_LINE>return ImmutableList.of(accrualPeriod);<NEW_LINE>}<NEW_LINE>// need to use getStubs(boolean) and not getInitialStub()/getFinalStub() to ensure correct stub allocation<NEW_LINE>Pair<Optional<SchedulePeriod>, Optional<SchedulePeriod>> scheduleStubs = accrualSchedule.getStubs(this.initialStub == null && this.finalStub != null);<NEW_LINE>Optional<SchedulePeriod> scheduleInitialStub = scheduleStubs.getFirst();<NEW_LINE>Optional<SchedulePeriod> scheduleFinalStub = scheduleStubs.getSecond();<NEW_LINE>// normal case<NEW_LINE>ImmutableList.Builder<RateAccrualPeriod> accrualPeriods = ImmutableList.builder();<NEW_LINE>for (int i = 0; i < accrualSchedule.size(); i++) {<NEW_LINE>SchedulePeriod period = accrualSchedule.getPeriod(i);<NEW_LINE>double yearFraction = period.yearFraction(dayCount, accrualSchedule);<NEW_LINE>// handle stubs<NEW_LINE>RateComputation rateComputation;<NEW_LINE>if (scheduleInitialStub.isPresent() && scheduleInitialStub.get() == period) {<NEW_LINE>rateComputation = initialStub.createRateComputation(resolvedRates.get(i));<NEW_LINE>} else if (scheduleFinalStub.isPresent() && scheduleFinalStub.get() == period) {<NEW_LINE>rateComputation = finalStub.createRateComputation<MASK><NEW_LINE>} else {<NEW_LINE>rateComputation = FixedRateComputation.of(resolvedRates.get(i));<NEW_LINE>}<NEW_LINE>accrualPeriods.add(new RateAccrualPeriod(period, yearFraction, rateComputation));<NEW_LINE>}<NEW_LINE>return accrualPeriods.build();<NEW_LINE>}
(resolvedRates.get(i));
637,789
public String makeHtml(FitNesseContext context, WikiPage page) {<NEW_LINE>PageData pageData = page.getData();<NEW_LINE>HtmlPage html = context.pageFactory.newPage();<NEW_LINE>WikiPagePath fullPath = page.getFullPath();<NEW_LINE>String fullPathName = PathParser.render(fullPath);<NEW_LINE>PageTitle pt = new PageTitle(fullPath);<NEW_LINE>String tags = pageData.getAttribute(PageData.PropertySUITES);<NEW_LINE>pt.setPageTags(tags);<NEW_LINE>html.setTitle(fullPathName);<NEW_LINE>html.setPageTitle(pt.notLinked());<NEW_LINE>html.setNavTemplate("wikiNav.vm");<NEW_LINE>html.put("actions", new WikiPageActions(page));<NEW_LINE>html.put("helpText", pageData.getProperties()<MASK><NEW_LINE>if (WikiPageUtil.isTestPage(page)) {<NEW_LINE>// Add test url inputs to context's variableSource.<NEW_LINE>WikiTestPage testPage = new TestPageWithSuiteSetUpAndTearDown(page);<NEW_LINE>html.put("content", new WikiTestPageRenderer(testPage));<NEW_LINE>} else {<NEW_LINE>html.put("content", new WikiPageRenderer(page));<NEW_LINE>}<NEW_LINE>html.setMainTemplate("wikiPage");<NEW_LINE>html.setFooterTemplate("wikiFooter");<NEW_LINE>html.put("footerContent", new WikiPageFooterRenderer(page));<NEW_LINE>handleSpecialProperties(html, page);<NEW_LINE>return html.html(request);<NEW_LINE>}
.get(PageData.PropertyHELP));
626,622
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>String job = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>if (!business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted, new ExceptionEntityNotExist(workOrWorkCompleted))) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson);<NEW_LINE>}<NEW_LINE>job = business.<MASK><NEW_LINE>}<NEW_LINE>final String workLogJob = job;<NEW_LINE>CompletableFuture<List<WoTaskCompleted>> future_taskCompleteds = CompletableFuture.supplyAsync(() -> {<NEW_LINE>return this.taskCompleteds(workLogJob);<NEW_LINE>});<NEW_LINE>CompletableFuture<List<Wo>> future_workLogs = CompletableFuture.supplyAsync(() -> {<NEW_LINE>return this.workLogs(workLogJob);<NEW_LINE>});<NEW_LINE>List<WoTaskCompleted> taskCompleteds = future_taskCompleteds.get();<NEW_LINE>List<Wo> wos = future_workLogs.get();<NEW_LINE>ListTools.groupStick(wos, taskCompleteds, WorkLog.fromActivityToken_FIELDNAME, TaskCompleted.activityToken_FIELDNAME, taskCompletedList_FIELDNAME);<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}
job().findWithWorkOrWorkCompleted(workOrWorkCompleted);
1,466,841
public static void removePolicy(PermissionTicket ticket, StoreFactory storeFactory) {<NEW_LINE>Policy policy = ticket.getPolicy();<NEW_LINE>if (policy != null) {<NEW_LINE>Map<PermissionTicket.FilterOption, String> filter = new EnumMap<>(PermissionTicket.FilterOption.class);<NEW_LINE>filter.put(PermissionTicket.FilterOption.OWNER, ticket.getOwner());<NEW_LINE>filter.put(PermissionTicket.FilterOption.REQUESTER, ticket.getRequester());<NEW_LINE>filter.put(PermissionTicket.FilterOption.RESOURCE_ID, ticket.getResource().getId());<NEW_LINE>filter.put(PermissionTicket.FilterOption.GRANTED, Boolean.TRUE.toString());<NEW_LINE>List<PermissionTicket> tickets = storeFactory.getPermissionTicketStore().find(ticket.getResourceServer(<MASK><NEW_LINE>if (tickets.isEmpty()) {<NEW_LINE>PolicyStore policyStore = storeFactory.getPolicyStore();<NEW_LINE>for (Policy associatedPolicy : policy.getAssociatedPolicies()) {<NEW_LINE>policyStore.delete(associatedPolicy.getId());<NEW_LINE>}<NEW_LINE>policyStore.delete(policy.getId());<NEW_LINE>} else if (ticket.getScope() != null) {<NEW_LINE>policy.removeScope(ticket.getScope());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), filter, null, null);
110,418
public static List<MHRAttribute> findByConceptValueAndPartnerId(Properties ctx, String conceptValue, Integer partnerId, String referenceNo, String description, String trxName) {<NEW_LINE>List<MHRAttribute> attributes = new ArrayList<MHRAttribute>();<NEW_LINE>if (partnerId == null)<NEW_LINE>return attributes;<NEW_LINE>StringBuilder whereClause = new StringBuilder();<NEW_LINE>List<Object> parameters = new ArrayList<Object>();<NEW_LINE>whereClause.append("EXISTS (SELECT 1 FROM HR_Concept c WHERE c.IsEmployee=? AND c.HR_Concept_ID=HR_Attribute.HR_Concept_ID AND c.Value=?)");<NEW_LINE>parameters.add("Y");<NEW_LINE>parameters.add(conceptValue);<NEW_LINE>if (partnerId > 0) {<NEW_LINE>whereClause.append(" AND ").append(MHRAttribute.COLUMNNAME_C_BPartner_ID).append("=?");<NEW_LINE>parameters.add(partnerId);<NEW_LINE>}<NEW_LINE>if (description != null && description.length() > 0) {<NEW_LINE>whereClause.append(" AND ").append(MHRAttribute<MASK><NEW_LINE>parameters.add(description);<NEW_LINE>}<NEW_LINE>if (referenceNo != null && referenceNo.length() > 0) {<NEW_LINE>whereClause.append(" AND ").append(MHRAttribute.COLUMNNAME_ReferenceNo).append("=?");<NEW_LINE>parameters.add(referenceNo);<NEW_LINE>}<NEW_LINE>attributes = new Query(ctx, MHRAttribute.Table_Name, whereClause.toString(), trxName).setClient_ID().setParameters(parameters).list();<NEW_LINE>return attributes;<NEW_LINE>}
.COLUMNNAME_Description).append("=?");
1,154,519
public void askConfirmationMoveToRubbish(final ArrayList<Long> handleList) {<NEW_LINE>logDebug("askConfirmationMoveToRubbish");<NEW_LINE>DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>switch(which) {<NEW_LINE>case DialogInterface.BUTTON_POSITIVE:<NEW_LINE>moveToTrash(handleList);<NEW_LINE>break;<NEW_LINE>case DialogInterface.BUTTON_NEGATIVE:<NEW_LINE>// No button clicked<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (handleList != null) {<NEW_LINE>if (handleList.size() > 0) {<NEW_LINE>MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this, R.style.ThemeOverlay_Mega_MaterialAlertDialog);<NEW_LINE>if (handleList.size() > 1) {<NEW_LINE>builder.setMessage(getResources().getString<MASK><NEW_LINE>} else {<NEW_LINE>builder.setMessage(getResources().getString(R.string.confirmation_move_to_rubbish));<NEW_LINE>}<NEW_LINE>builder.setPositiveButton(R.string.general_move, dialogClickListener);<NEW_LINE>builder.setNegativeButton(R.string.general_cancel, dialogClickListener);<NEW_LINE>builder.show();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logWarning("handleList NULL");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
(R.string.confirmation_move_to_rubbish_plural));
996,329
static MapStoreContext create(MapContainer mapContainer) {<NEW_LINE>final BasicMapStoreContext context = new BasicMapStoreContext();<NEW_LINE>final String mapName = mapContainer.getName();<NEW_LINE>final MapServiceContext mapServiceContext = mapContainer.getMapServiceContext();<NEW_LINE>final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();<NEW_LINE>final PartitioningStrategy partitioningStrategy = mapContainer.getPartitioningStrategy();<NEW_LINE>final MapConfig mapConfig = mapContainer.getMapConfig();<NEW_LINE>final MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig();<NEW_LINE>final ClassLoader configClassLoader = nodeEngine.getConfigClassLoader();<NEW_LINE>// create store.<NEW_LINE>final Object store = createStore(mapName, mapStoreConfig, configClassLoader);<NEW_LINE>final MapStoreWrapper storeWrapper <MASK><NEW_LINE>storeWrapper.instrument(nodeEngine);<NEW_LINE>context.setMapName(mapName);<NEW_LINE>context.setMapStoreConfig(mapStoreConfig);<NEW_LINE>context.setPartitioningStrategy(partitioningStrategy);<NEW_LINE>context.setMapServiceContext(mapServiceContext);<NEW_LINE>context.setStoreWrapper(storeWrapper);<NEW_LINE>final MapStoreManager mapStoreManager = createMapStoreManager(context);<NEW_LINE>context.setMapStoreManager(mapStoreManager);<NEW_LINE>// todo this is user code. it may also block map store creation.<NEW_LINE>callLifecycleSupportInit(context);<NEW_LINE>return context;<NEW_LINE>}
= new MapStoreWrapper(mapName, store);
1,044,048
public void marshall(CaseDetails caseDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (caseDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(caseDetails.getCaseId(), CASEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getDisplayId(), DISPLAYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getSubject(), SUBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getServiceCode(), SERVICECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getCategoryCode(), CATEGORYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getSeverityCode(), SEVERITYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getSubmittedBy(), SUBMITTEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getTimeCreated(), TIMECREATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(caseDetails.getRecentCommunications(), RECENTCOMMUNICATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(caseDetails.getLanguage(), LANGUAGE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
caseDetails.getCcEmailAddresses(), CCEMAILADDRESSES_BINDING);
1,811,784
public static void updateQueue(String projectId, String locationId, String queueId) throws Exception {<NEW_LINE>try (CloudTasksClient client = CloudTasksClient.create()) {<NEW_LINE>// TODO(developer): Uncomment these lines and replace with your values.<NEW_LINE>// String projectId = "your-project-id";<NEW_LINE>// String locationId = "us-central1";<NEW_LINE>// String queueId = "queue-blue";<NEW_LINE>LocationName parent = LocationName.of(projectId, locationId);<NEW_LINE>Queue queueBlue = Queue.newBuilder().setName(QueueName.of(projectId, locationId, queueId).toString()).setRateLimits(RateLimits.newBuilder().setMaxDispatchesPerSecond(20.0).setMaxConcurrentDispatches(10)).build();<NEW_LINE>UpdateQueueRequest request = UpdateQueueRequest.newBuilder().<MASK><NEW_LINE>Queue response = client.updateQueue(request);<NEW_LINE>System.out.println(response);<NEW_LINE>}<NEW_LINE>}
setQueue(queueBlue).build();
734,337
public void deletePort(String userId, String serverName, String externalSourceName, String guid, String qualifiedName, String portType, DeleteSemantic deleteSemantic) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException, FunctionNotSupportedException, EntityNotDeletedException {<NEW_LINE>final String methodName = "deletePort";<NEW_LINE>String portGUID = getEntityGUID(userId, serverName, <MASK><NEW_LINE>DataEnginePortHandler dataEnginePortHandler = instanceHandler.getPortHandler(userId, serverName, methodName);<NEW_LINE>if (PORT_IMPLEMENTATION_TYPE_NAME.equalsIgnoreCase(portType)) {<NEW_LINE>Optional<EntityDetail> schemaType = dataEnginePortHandler.findSchemaTypeForPort(userId, portGUID);<NEW_LINE>if (schemaType.isPresent()) {<NEW_LINE>deleteSchemaType(userId, serverName, externalSourceName, schemaType.get().getGUID(), null, deleteSemantic);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dataEnginePortHandler.removePort(userId, portGUID, externalSourceName, deleteSemantic);<NEW_LINE>log.debug(DEBUG_DELETE_MESSAGE, portGUID, PORT_TYPE_NAME);<NEW_LINE>}
guid, qualifiedName, PORT_TYPE_NAME, methodName);
1,626,337
protected String doInBackground(Void[] params) {<NEW_LINE>String items = "";<NEW_LINE>long fileLength = file.length(context);<NEW_LINE>if (file.isDirectory(context)) {<NEW_LINE>final AtomicInteger x = new AtomicInteger(0);<NEW_LINE>file.forEachChildrenFile(context, false, <MASK><NEW_LINE>final int folderLength = x.intValue();<NEW_LINE>long folderSize;<NEW_LINE>if (isStorage) {<NEW_LINE>folderSize = file.getUsableSpace();<NEW_LINE>} else {<NEW_LINE>folderSize = FileUtils.folderSize(file, data -> publishProgress(new Pair<>(folderLength, data)));<NEW_LINE>}<NEW_LINE>items = getText(folderLength, folderSize, false);<NEW_LINE>} else {<NEW_LINE>items = Formatter.formatFileSize(context, fileLength) + (" (" + fileLength + " " + // truncation is insignificant<NEW_LINE>context.getResources().// truncation is insignificant<NEW_LINE>getQuantityString(// truncation is insignificant<NEW_LINE>R.plurals.bytes, (int) fileLength) + ")");<NEW_LINE>}<NEW_LINE>return items;<NEW_LINE>}
file -> x.incrementAndGet());
1,482,338
protected INDArray preOutput(boolean training, boolean forBackprop, LayerWorkspaceMgr workspaceMgr) {<NEW_LINE>assertInputSet(false);<NEW_LINE>applyDropOutIfNecessary(training, null);<NEW_LINE>if (input.rank() != 4) {<NEW_LINE>throw new DL4JInvalidInputException("Got rank " + input.rank() + " array as input to space to batch with shape " + Arrays.toString(input.shape()) + ". Expected rank 4 array with shape " + layerConf().getFormat().dimensionNames() + ". " + layerId());<NEW_LINE>}<NEW_LINE>if (preOutput != null && forBackprop) {<NEW_LINE>return preOutput;<NEW_LINE>}<NEW_LINE>boolean nchw = layerConf().getFormat() == CNN2DFormat.NCHW;<NEW_LINE>long inMiniBatch = input.size(0);<NEW_LINE>long depth = input.size(nchw ? 1 : 3);<NEW_LINE>long inH = input.size(nchw ? 2 : 1);<NEW_LINE>long inW = input.size(nchw ? 3 : 2);<NEW_LINE>int[] blocks = getBlocks();<NEW_LINE>int[][] padding = getPadding();<NEW_LINE>long paddedH = inH + padding[0][0] + padding[0][1];<NEW_LINE>long paddedW = inW + padding[1][0] <MASK><NEW_LINE>long outH = paddedH / blocks[0];<NEW_LINE>long outW = paddedW / blocks[1];<NEW_LINE>long outMiniBatch = inMiniBatch * blocks[0] * blocks[1];<NEW_LINE>long[] outShape = nchw ? new long[] { outMiniBatch, depth, outH, outW } : new long[] { outMiniBatch, outH, outW, depth };<NEW_LINE>INDArray out = workspaceMgr.create(ArrayType.ACTIVATIONS, input.dataType(), outShape, 'c');<NEW_LINE>INDArray inNHWC = nchw ? input.permute(0, 2, 3, 1) : input;<NEW_LINE>INDArray outNHWC = nchw ? out.permute(0, 2, 3, 1) : out;<NEW_LINE>CustomOp op = DynamicCustomOp.builder("space_to_batch_nd").addInputs(inNHWC, getBlocksArray(), getPaddingArray()).addOutputs(outNHWC).build();<NEW_LINE>Nd4j.exec(op);<NEW_LINE>return out;<NEW_LINE>}
+ padding[1][1];
714,197
public CompletableFuture<List<Long>> mergeTxnSegments(final String scope, final String stream, final long targetSegmentId, final long sourceSegmentId, final List<UUID> txId, final String delegationToken, final long clientRequestId) {<NEW_LINE>Preconditions.checkArgument(getSegmentNumber(targetSegmentId) == getSegmentNumber(sourceSegmentId));<NEW_LINE>final Controller.NodeUri uri = <MASK><NEW_LINE>final String qualifiedNameTarget = getQualifiedStreamSegmentName(scope, stream, targetSegmentId);<NEW_LINE>final List<String> transactionNames = txId.stream().map(x -> getTransactionName(scope, stream, sourceSegmentId, x)).collect(Collectors.toList());<NEW_LINE>final WireCommandType type = WireCommandType.MERGE_SEGMENTS_BATCH;<NEW_LINE>RawClient connection = new RawClient(ModelHelper.encode(uri), connectionPool);<NEW_LINE>final long requestId = connection.getFlow().asLong();<NEW_LINE>WireCommands.MergeSegmentsBatch request = new WireCommands.MergeSegmentsBatch(requestId, qualifiedNameTarget, transactionNames, delegationToken);<NEW_LINE>return sendRequest(connection, clientRequestId, request).thenApply(r -> {<NEW_LINE>handleReply(clientRequestId, r, connection, qualifiedNameTarget, WireCommands.MergeSegmentsBatch.class, type);<NEW_LINE>return ((WireCommands.SegmentsBatchMerged) r).getNewTargetWriteOffset();<NEW_LINE>});<NEW_LINE>}
getSegmentUri(scope, stream, sourceSegmentId);
391,768
public List<String> load(Path dataPath) {<NEW_LINE>List<String> trainingData = new ArrayList<>();<NEW_LINE>try (Stream<String> stream = Files.lines(dataPath)) {<NEW_LINE>List<String> instance = new ArrayList<>();<NEW_LINE>ListIterator<String> iterator = stream.collect(Collectors.toList()).listIterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>String current = iterator.next();<NEW_LINE>if (StringUtils.isBlank(current)) {<NEW_LINE>if (CollectionUtils.isNotEmpty(instance)) {<NEW_LINE>trainingData.add(String.join("\n", instance));<NEW_LINE>}<NEW_LINE>instance = new ArrayList<>();<NEW_LINE>} else {<NEW_LINE>instance.add(current);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (CollectionUtils.isNotEmpty(instance)) {<NEW_LINE>trainingData.add(String<MASK><NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new GrobidException("Error in n-fold, when loading training data. Failing. ", e);<NEW_LINE>}<NEW_LINE>return trainingData;<NEW_LINE>}
.join("\n", instance));
1,848,610
protected boolean isTokenProtected(List<WSSecurityEngineResult> results, List<WSSecurityEngineResult> signedResults) {<NEW_LINE>for (WSSecurityEngineResult result : signedResults) {<NEW_LINE>// Get the Token result that was used for the signature<NEW_LINE>WSSecurityEngineResult tokenResult = findCorrespondingToken(result, results);<NEW_LINE>if (tokenResult == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Now go through what was signed and see if the token itself was signed<NEW_LINE>List<WSDataRef> sl = CastUtils.cast((List<?>) result.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));<NEW_LINE>boolean found = false;<NEW_LINE>if (sl != null) {<NEW_LINE>for (WSDataRef dataRef : sl) {<NEW_LINE><MASK><NEW_LINE>if (referenceElement != null && referenceElement.equals(tokenResult.get(WSSecurityEngineResult.TAG_TOKEN_ELEMENT))) {<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
Element referenceElement = dataRef.getProtectedElement();
1,640,278
public static DataSet<Row> mapDataSetWithIdMapping(DataSet<Row> original, DataSet<Tuple2<String, Long>> dict, int[] colIds) {<NEW_LINE>DataSet<Row> tmp = original;<NEW_LINE>for (int i = 0; i < colIds.length; i++) {<NEW_LINE>int colId = colIds[i];<NEW_LINE>tmp = tmp.coGroup(dict).where(new KeySelector<Row, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getKey(Row value) throws Exception {<NEW_LINE>return (String) value.getField(colId);<NEW_LINE>}<NEW_LINE>}).equalTo(0).with(new CoGroupFunction<Row, Tuple2<String, Long>, Row>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void coGroup(Iterable<Row> first, Iterable<Tuple2<String, Long>> second, Collector<Row> out) throws Exception {<NEW_LINE>Iterator<Tuple2<String, Long>> iterator2 = second.iterator();<NEW_LINE>if (iterator2.hasNext()) {<NEW_LINE>long idx = iterator2.next().f1;<NEW_LINE>for (Row r : first) {<NEW_LINE>r.setField(colId, idx);<NEW_LINE>out.collect(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<MASK><NEW_LINE>}<NEW_LINE>return tmp;<NEW_LINE>}
).name("cogroup at " + colId);
704,595
final DeleteGroupResult executeDeleteGroup(DeleteGroupRequest deleteGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteGroupRequest> request = null;<NEW_LINE>Response<DeleteGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteGroupRequestProtocolMarshaller(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, "Resource Groups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteGroupResultJsonUnmarshaller());<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(deleteGroupRequest));
664,633
public void init(DataSource dataSource) throws Exception {<NEW_LINE>Assert.notNull(dataSource, "data source must be specified");<NEW_LINE>Assert.hasLength(selectClause, "selectClause must be specified");<NEW_LINE>Assert.hasLength(fromClause, "fromClause must be specified");<NEW_LINE>Assert.notEmpty(sortKeys, "sortKey must be specified");<NEW_LINE>StringBuilder sql = new StringBuilder();<NEW_LINE>sql.append<MASK><NEW_LINE>sql.append(" FROM ").append(fromClause);<NEW_LINE>if (whereClause != null) {<NEW_LINE>sql.append(" WHERE ").append(whereClause);<NEW_LINE>}<NEW_LINE>List<String> namedParameters = new ArrayList<String>();<NEW_LINE>parameterCount = JdbcParameterUtils.countParameterPlaceholders(sql.toString(), namedParameters);<NEW_LINE>if (namedParameters.size() > 0) {<NEW_LINE>if (parameterCount != namedParameters.size()) {<NEW_LINE>throw new InvalidDataAccessApiUsageException("You can't use both named parameters and classic \"?\" placeholders: " + sql);<NEW_LINE>}<NEW_LINE>usingNamedParameters = true;<NEW_LINE>}<NEW_LINE>}
("SELECT ").append(selectClause);
1,220,154
public void marshall(AwsEc2SecurityGroupIpPermission awsEc2SecurityGroupIpPermission, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsEc2SecurityGroupIpPermission == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupIpPermission.getIpProtocol(), IPPROTOCOL_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupIpPermission.getFromPort(), FROMPORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupIpPermission.getToPort(), TOPORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupIpPermission.getUserIdGroupPairs(), USERIDGROUPPAIRS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupIpPermission.getIpRanges(), IPRANGES_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupIpPermission.getIpv6Ranges(), IPV6RANGES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
awsEc2SecurityGroupIpPermission.getPrefixListIds(), PREFIXLISTIDS_BINDING);
1,802,775
final DescribeAccountOverviewResult executeDescribeAccountOverview(DescribeAccountOverviewRequest describeAccountOverviewRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAccountOverviewRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAccountOverviewRequest> request = null;<NEW_LINE>Response<DescribeAccountOverviewResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAccountOverviewRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAccountOverviewRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAccountOverview");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAccountOverviewResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAccountOverviewResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "DevOps Guru");
691,062
public void onQuotedTweet(User source, User target, Status status) {<NEW_LINE>if (!thisInstanceOn || isUserBlocked(source.getId())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!source.getScreenName().equals(settings.myScreenName) && target.getScreenName().equals(settings.myScreenName)) {<NEW_LINE>AppSettings settings = new AppSettings(mContext);<NEW_LINE>Log.v("twitter_stream_push", "onQuote source:@" + source.getScreenName() + " target:@" + target.getScreenName() + " @" + status.getUser().getScreenName() + " - " + status.getText());<NEW_LINE>InteractionsDataSource.getInstance(mContext).updateInteraction(mContext, source, status, sharedPreferences.getInt("current_account", 1), InteractionsDataSource.TYPE_QUOTED_TWEET);<NEW_LINE>sharedPreferences.edit().putBoolean("new_notification", true).commit();<NEW_LINE>if (settings.mentionsNot) {<NEW_LINE>int newQuotes = sharedPreferences.getInt("new_quotes", 0);<NEW_LINE>newQuotes++;<NEW_LINE>sharedPreferences.edit().putInt(<MASK><NEW_LINE>if (settings.notifications) {<NEW_LINE>NotificationUtils.newInteractions(source, mContext, sharedPreferences, " " + getResources().getString(R.string.quoted));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"new_quotes", newQuotes).commit();
760,702
public FormBuilder addLabeledComponent(@Nullable JComponent label, @Nonnull JComponent component, int topInset, boolean labelOnTop) {<NEW_LINE>GridBagConstraints c = new GridBagConstraints();<NEW_LINE>topInset = myLineCount > 0 ? topInset : 0;<NEW_LINE>if (myVertical || labelOnTop || label == null) {<NEW_LINE>c.gridwidth = 2;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = myLineCount;<NEW_LINE>c.weightx = 0;<NEW_LINE>c.weighty = 0;<NEW_LINE>c.fill = NONE;<NEW_LINE>c.anchor = getLabelAnchor(component, false);<NEW_LINE>c.insets = new Insets(topInset, myIndent, DEFAULT_VGAP, 0);<NEW_LINE>if (label != null)<NEW_LINE>myPanel.add(label, c);<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = myLineCount + 1;<NEW_LINE>c.weightx = 1.0;<NEW_LINE>c.weighty = getWeightY(component);<NEW_LINE>c.fill = getFill(component);<NEW_LINE>c.anchor = WEST;<NEW_LINE>c.insets = new Insets(label == null ? topInset : 0, myIndent, 0, 0);<NEW_LINE>myPanel.add(component, c);<NEW_LINE>myLineCount += 2;<NEW_LINE>} else {<NEW_LINE>c.gridwidth = 1;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = myLineCount;<NEW_LINE>c.weightx = 0;<NEW_LINE>c.weighty = 0;<NEW_LINE>c.fill = NONE;<NEW_LINE>c.anchor = getLabelAnchor(component, true);<NEW_LINE>c.insets = new Insets(<MASK><NEW_LINE>myPanel.add(label, c);<NEW_LINE>c.gridx = 1;<NEW_LINE>c.weightx = 1;<NEW_LINE>c.weighty = getWeightY(component);<NEW_LINE>c.fill = getFill(component);<NEW_LINE>c.anchor = WEST;<NEW_LINE>c.insets = new Insets(topInset, myIndent, 0, 0);<NEW_LINE>myPanel.add(component, c);<NEW_LINE>myLineCount++;<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
topInset, myIndent, 0, myHorizontalGap);
241,922
final StopTriggerResult executeStopTrigger(StopTriggerRequest stopTriggerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopTriggerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopTriggerRequest> request = null;<NEW_LINE>Response<StopTriggerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopTriggerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopTriggerRequest));<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.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopTrigger");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopTriggerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new StopTriggerResultJsonUnmarshaller());
133,554
public synchronized void dispose() {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>log.debug("Shutdown Core...");<NEW_LINE>DesktopPlatform.setClosing(true);<NEW_LINE>DBPApplication application = getApplication();<NEW_LINE>if (application instanceof DBPApplicationController) {<NEW_LINE>// Shutdown in headless mode<NEW_LINE>((DBPApplicationController) application).setHeadlessMode(true);<NEW_LINE>}<NEW_LINE>super.dispose();<NEW_LINE>workspace.dispose();<NEW_LINE>if (this.qmLogWriter != null) {<NEW_LINE>this.queryManager.unregisterMetaListener(qmLogWriter);<NEW_LINE>this.qmLogWriter.dispose();<NEW_LINE>this.qmLogWriter = null;<NEW_LINE>}<NEW_LINE>if (this.queryManager != null) {<NEW_LINE>this.queryManager.dispose();<NEW_LINE>// queryManager = null;<NEW_LINE>}<NEW_LINE>DataSourceProviderRegistry<MASK><NEW_LINE>if (isStandalone() && workspace != null && !application.isExclusiveMode()) {<NEW_LINE>try {<NEW_LINE>workspace.save(new VoidProgressMonitor());<NEW_LINE>} catch (DBException ex) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.error("Can't save workspace", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove temp folder<NEW_LINE>if (tempFolder != null) {<NEW_LINE>if (!ContentUtils.deleteFileRecursive(tempFolder)) {<NEW_LINE>log.warn("Can't delete temp folder '" + tempFolder.getAbsolutePath() + "'");<NEW_LINE>}<NEW_LINE>tempFolder = null;<NEW_LINE>}<NEW_LINE>DesktopPlatform.instance = null;<NEW_LINE>DesktopPlatform.disposed = true;<NEW_LINE>System.gc();<NEW_LINE>log.debug("Shutdown completed in " + (System.currentTimeMillis() - startTime) + "ms");<NEW_LINE>}
.getInstance().dispose();
702,412
private AppendMessageResult doAppendData(final LogSegment segment, final ByteBuffer data) {<NEW_LINE>int currentPos = segment.getWrotePosition();<NEW_LINE>final int freeSize = segment.getFileSize() - currentPos;<NEW_LINE>int remaining = data.remaining();<NEW_LINE>ByteBuf to = ByteBufAllocator.DEFAULT.ioBuffer(Math.min(remaining, freeSize));<NEW_LINE>try {<NEW_LINE>AppendMessageStatus status = copy(data, to);<NEW_LINE>if (status == DATA_OVERFLOW) {<NEW_LINE>fillZero(to);<NEW_LINE>}<NEW_LINE>if (!segment.appendData(to.nioBuffer()))<NEW_LINE>throw new RuntimeException("append index data failed.");<NEW_LINE>if (status == DATA_OVERFLOW) {<NEW_LINE>return new AppendMessageResult(END_OF_FILE, segment.getBaseOffset() + segment.getFileSize());<NEW_LINE>} else {<NEW_LINE>return new AppendMessageResult(SUCCESS, segment.getBaseOffset(<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ReferenceCountUtil.release(to);<NEW_LINE>}<NEW_LINE>}
) + segment.getWrotePosition());
514,968
public boolean entersBattlefield(Ability source, Game game, Zone fromZone, boolean fireEvent) {<NEW_LINE>controlledFromStartOfControllerTurn = false;<NEW_LINE>if (this.isFaceDown(game)) {<NEW_LINE>// remove some attributes here, because first apply effects comes later otherwise abilities (e.g. color related) will unintended trigger<NEW_LINE>MorphAbility.setPermanentToFaceDownCreature(this, game);<NEW_LINE>}<NEW_LINE>if (game.replaceEvent(new EntersTheBattlefieldEvent(this, source, getControllerId(), fromZone, EnterEventType.SELF))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>EntersTheBattlefieldEvent event = new EntersTheBattlefieldEvent(this, source, getControllerId(), fromZone);<NEW_LINE>if (game.replaceEvent(event)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (this.isPlaneswalker(game)) {<NEW_LINE>int loyalty;<NEW_LINE>if (this.getStartingLoyalty() == -2) {<NEW_LINE>loyalty = source<MASK><NEW_LINE>} else {<NEW_LINE>loyalty = this.getStartingLoyalty();<NEW_LINE>}<NEW_LINE>int countersToAdd;<NEW_LINE>if (this.hasAbility(CompleatedAbility.getInstance(), game)) {<NEW_LINE>countersToAdd = loyalty - 2 * source.getManaCostsToPay().getPhyrexianPaid();<NEW_LINE>} else {<NEW_LINE>countersToAdd = loyalty;<NEW_LINE>}<NEW_LINE>if (countersToAdd > 0) {<NEW_LINE>this.addCounters(CounterType.LOYALTY.createInstance(countersToAdd), source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!fireEvent) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>game.addSimultaneousEvent(event);<NEW_LINE>return true;<NEW_LINE>}
.getManaCostsToPay().getX();
1,167,479
private static void initWindows2AndroidMap() {<NEW_LINE>windowsToAndroidEventMap.put(0x08, KeyEvent.KEYCODE_DEL);<NEW_LINE>windowsToAndroidEventMap.put(0x09, KeyEvent.KEYCODE_TAB);<NEW_LINE>windowsToAndroidEventMap.put(0x0C, KeyEvent.KEYCODE_CLEAR);<NEW_LINE>windowsToAndroidEventMap.put(0x0D, KeyEvent.KEYCODE_ENTER);<NEW_LINE>windowsToAndroidEventMap.put(0x12, KeyEvent.KEYCODE_MENU);<NEW_LINE>windowsToAndroidEventMap.put(0x13, KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE);<NEW_LINE>windowsToAndroidEventMap.put(0x20, KeyEvent.KEYCODE_SPACE);<NEW_LINE>windowsToAndroidEventMap.put(0x21, KeyEvent.KEYCODE_PAGE_UP);<NEW_LINE>windowsToAndroidEventMap.put(0x22, KeyEvent.KEYCODE_PAGE_DOWN);<NEW_LINE>windowsToAndroidEventMap.put(0x25, KeyEvent.KEYCODE_DPAD_LEFT);<NEW_LINE>windowsToAndroidEventMap.put(0x26, KeyEvent.KEYCODE_DPAD_UP);<NEW_LINE>windowsToAndroidEventMap.put(0x27, KeyEvent.KEYCODE_DPAD_RIGHT);<NEW_LINE>windowsToAndroidEventMap.put(0x28, KeyEvent.KEYCODE_DPAD_DOWN);<NEW_LINE>windowsToAndroidEventMap.put(0x29, KeyEvent.KEYCODE_BUTTON_SELECT);<NEW_LINE>int j = 0;<NEW_LINE>for (int i = 0x30; i <= 0x3A; i++, j++) windowsToAndroidEventMap.put(i, KeyEvent.KEYCODE_0 + j);<NEW_LINE>j = 0;<NEW_LINE>for (int i = 0x41; i <= 0x5A; i++, j++) windowsToAndroidEventMap.put(i, KeyEvent.KEYCODE_A + j);<NEW_LINE>windowsToAndroidEventMap.put(0x6A, KeyEvent.KEYCODE_STAR);<NEW_LINE>windowsToAndroidEventMap.put(0x6B, KeyEvent.KEYCODE_PLUS);<NEW_LINE>windowsToAndroidEventMap.put(0x6D, KeyEvent.KEYCODE_MINUS);<NEW_LINE>windowsToAndroidEventMap.put(0x10, KeyEvent.KEYCODE_SHIFT_LEFT);<NEW_LINE>windowsToAndroidEventMap.put(0xA6, KeyEvent.KEYCODE_BACK);<NEW_LINE>windowsToAndroidEventMap.put(0xAA, KeyEvent.KEYCODE_SEARCH);<NEW_LINE>windowsToAndroidEventMap.put(0xAE, KeyEvent.KEYCODE_VOLUME_DOWN);<NEW_LINE>windowsToAndroidEventMap.<MASK><NEW_LINE>windowsToAndroidEventMap.put(0xBA, KeyEvent.KEYCODE_SEMICOLON);<NEW_LINE>windowsToAndroidEventMap.put(0xBC, KeyEvent.KEYCODE_COMMA);<NEW_LINE>windowsToAndroidEventMap.put(0xBE, KeyEvent.KEYCODE_PERIOD);<NEW_LINE>windowsToAndroidEventMap.put(0xBF, KeyEvent.KEYCODE_SLASH);<NEW_LINE>windowsToAndroidEventMap.put(0xDB, KeyEvent.KEYCODE_LEFT_BRACKET);<NEW_LINE>windowsToAndroidEventMap.put(0xDC, KeyEvent.KEYCODE_BACKSLASH);<NEW_LINE>windowsToAndroidEventMap.put(0xDD, KeyEvent.KEYCODE_RIGHT_BRACKET);<NEW_LINE>windowsToAndroidEventMap.put(0xDE, KeyEvent.KEYCODE_APOSTROPHE);<NEW_LINE>// Characters which can't be mapped<NEW_LINE>androidToWindowsEventMap.put(KeyEvent.KEYCODE_GRAVE + 0xFE, KeyEvent.KEYCODE_GRAVE);<NEW_LINE>androidToWindowsEventMap.put(KeyEvent.KEYCODE_AT + 0xFE, KeyEvent.KEYCODE_AT);<NEW_LINE>androidToWindowsEventMap.put(KeyEvent.KEYCODE_POUND + 0xFE, KeyEvent.KEYCODE_POUND);<NEW_LINE>androidToWindowsEventMap.put(KeyEvent.KEYCODE_ALT_LEFT + 0xFE, KeyEvent.KEYCODE_ALT_LEFT);<NEW_LINE>androidToWindowsEventMap.put(KeyEvent.KEYCODE_EQUALS + 0xFE, KeyEvent.KEYCODE_EQUALS);<NEW_LINE>}
put(0xAF, KeyEvent.KEYCODE_VOLUME_UP);
165,807
public void error(Context ctx, Throwable throwable) throws Exception {<NEW_LINE>LOGGER.error("exception thrown for request to " + ctx.getRequest().getRawUri(), throwable);<NEW_LINE>ctx.getResponse().status(500);<NEW_LINE>ctx.byContent(s -> s.plainText(() -> ctx.render(Throwables.getStackTraceAsString(throwable) + "\n\nThis stacktrace error response was generated by the default development error handler.")).html(() -> new ErrorPageRenderer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void render() {<NEW_LINE>render(ctx, "Internal Error", w -> {<NEW_LINE>messages(w, "Internal Error", () -> {<NEW_LINE>Request request = ctx.getRequest();<NEW_LINE>meta(w, m -> m.put("URI:", request.getRawUri()).put("Method:", request.getMethod().getName()));<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>}).noMatch("text/plain"));<NEW_LINE>}
stack(w, null, throwable);
594,430
public ListWebsiteAuthorizationProvidersResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListWebsiteAuthorizationProvidersResult listWebsiteAuthorizationProvidersResult = new ListWebsiteAuthorizationProvidersResult();<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 listWebsiteAuthorizationProvidersResult;<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("WebsiteAuthorizationProviders", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listWebsiteAuthorizationProvidersResult.setWebsiteAuthorizationProviders(new ListUnmarshaller<WebsiteAuthorizationProviderSummary>(WebsiteAuthorizationProviderSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listWebsiteAuthorizationProvidersResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listWebsiteAuthorizationProvidersResult;<NEW_LINE>}
class).unmarshall(context));
858,662
public void analyze() {<NEW_LINE>AnalysisScope scope = myForwardScope;<NEW_LINE>final DependenciesBuilder builder = new ForwardDependenciesBuilder(getProject(), scope, getScopeOfInterest());<NEW_LINE>builder.setTotalFileCount(myTotalFileCount);<NEW_LINE>builder.analyze();<NEW_LINE><MASK><NEW_LINE>final PsiManager psiManager = PsiManager.getInstance(getProject());<NEW_LINE>psiManager.startBatchFilesProcessingMode();<NEW_LINE>try {<NEW_LINE>final int fileCount = getScope().getFileCount();<NEW_LINE>getScope().accept(new PsiRecursiveElementVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitFile(final PsiFile file) {<NEW_LINE>ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();<NEW_LINE>if (indicator != null) {<NEW_LINE>if (indicator.isCanceled()) {<NEW_LINE>throw new ProcessCanceledException();<NEW_LINE>}<NEW_LINE>indicator.setText(AnalysisScopeBundle.message("package.dependencies.progress.text"));<NEW_LINE>final VirtualFile virtualFile = file.getVirtualFile();<NEW_LINE>if (virtualFile != null) {<NEW_LINE>indicator.setText2(ProjectUtil.calcRelativeToProjectPath(virtualFile, getProject()));<NEW_LINE>}<NEW_LINE>if (fileCount > 0) {<NEW_LINE>indicator.setFraction(((double) ++myFileCount) / myTotalFileCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Map<PsiFile, Set<PsiFile>> dependencies = builder.getDependencies();<NEW_LINE>for (final PsiFile psiFile : dependencies.keySet()) {<NEW_LINE>if (dependencies.get(psiFile).contains(file)) {<NEW_LINE>Set<PsiFile> fileDeps = getDependencies().get(file);<NEW_LINE>if (fileDeps == null) {<NEW_LINE>fileDeps = new HashSet<PsiFile>();<NEW_LINE>getDependencies().put(file, fileDeps);<NEW_LINE>}<NEW_LINE>fileDeps.add(psiFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>psiManager.dropResolveCaches();<NEW_LINE>InjectedLanguageManager.getInstance(file.getProject()).dropFileCaches(file);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>psiManager.finishBatchFilesProcessingMode();<NEW_LINE>}<NEW_LINE>}
subtractScope(builder, getScope());
619,642
public <R> R aggregate(final R init, final EditorAggregator<R> aggregator) {<NEW_LINE>final AtomicReference<R> ref = new AtomicReference<>(init);<NEW_LINE>when(new EditorVisitor<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean isShape(EditorShape object) {<NEW_LINE>ref.set(aggregator.addShape(ref.get(), object));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean isArray(EditorArray array) {<NEW_LINE>ref.set(aggregator.addArray(ref.get(), array));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean isPick(EditorPick pick) {<NEW_LINE>ref.set(aggregator.addString(ref.get(), new EditorString(pick.selected)));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean isNumber(EditorNumber number) {<NEW_LINE>ref.set(aggregator.addNumber(ref.get(), number));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean isString(EditorString string) {<NEW_LINE>ref.set(aggregator.addString(ref<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean isBool(EditorBool bool) {<NEW_LINE>ref.set(aggregator.addBool(ref.get(), bool));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ref.get();<NEW_LINE>}
.get(), string));
693,512
private void onAddClick() {<NEW_LINE>getPanel();<NEW_LINE>LabelsPanel labelsPanel = new LabelsPanel();<NEW_LINE>LabelVariable[] variables = Git.getInstance()<MASK><NEW_LINE>labelsPanel.labelsList.setListData(variables);<NEW_LINE>String title = Bundle.GitOptionsPanel_labelVariables_title();<NEW_LINE>String acsd = Bundle.GitOptionsPanel_labelVariables_acsd();<NEW_LINE>DialogDescriptor dialogDescriptor = new DialogDescriptor(labelsPanel, title, true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, null);<NEW_LINE>final Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);<NEW_LINE>dialog.getAccessibleContext().setAccessibleDescription(acsd);<NEW_LINE>labelsPanel.labelsList.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>if (e.getClickCount() == 2) {<NEW_LINE>dialog.setVisible(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.setVisible(true);<NEW_LINE>if (DialogDescriptor.OK_OPTION == dialogDescriptor.getValue()) {<NEW_LINE>Object[] selection = (Object[]) labelsPanel.labelsList.getSelectedValues();<NEW_LINE>// NOI18N<NEW_LINE>String variable = "";<NEW_LINE>for (Object o : selection) {<NEW_LINE>// NOI18N<NEW_LINE>variable += ((LabelVariable) o).getPattern();<NEW_LINE>}<NEW_LINE>String annotation = panel.txtProjectAnnotation.getText();<NEW_LINE>int pos = panel.txtProjectAnnotation.getCaretPosition();<NEW_LINE>if (pos < 0) {<NEW_LINE>pos = annotation.length();<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder(annotation.length() + variable.length());<NEW_LINE>sb.append(annotation.substring(0, pos));<NEW_LINE>sb.append(variable);<NEW_LINE>if (pos < annotation.length()) {<NEW_LINE>sb.append(annotation.substring(pos, annotation.length()));<NEW_LINE>}<NEW_LINE>panel.txtProjectAnnotation.setText(sb.toString());<NEW_LINE>panel.txtProjectAnnotation.requestFocus();<NEW_LINE>panel.txtProjectAnnotation.setCaretPosition(pos + variable.length());<NEW_LINE>}<NEW_LINE>}
.getVCSAnnotator().getProjectVariables();
760,189
public void enqueue(SerialMessage serialMessage) {<NEW_LINE>// Sanity check!<NEW_LINE>if (serialMessage == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// First try and get the node<NEW_LINE>// If we're sending to a node, then this obviously isn't to the controller, and we should<NEW_LINE>// queue anything to a battery node (ie a node supporting the WAKEUP class)!<NEW_LINE>ZWaveNode node = this.getNode(serialMessage.getMessageNode());<NEW_LINE>if (node != null) {<NEW_LINE>// Does this message need to be security encapsulated?<NEW_LINE>if (node.doesMessageRequireSecurityEncapsulation(serialMessage)) {<NEW_LINE>ZWaveSecurityCommandClass securityCommandClass = (ZWaveSecurityCommandClass) node.getCommandClass(CommandClass.SECURITY);<NEW_LINE>securityCommandClass.queueMessageForEncapsulationAndTransmission(serialMessage);<NEW_LINE>// the above call will call enqueue again with the <b>encapsulated<b/> message,<NEW_LINE>// so we discard this one without putting it on the queue<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Keep track of the number of packets sent to this device<NEW_LINE>node.incrementSendCount();<NEW_LINE>// If the device isn't listening, queue the message if it supports the wakeup class<NEW_LINE>if (!node.isListening() && !node.isFrequentlyListening()) {<NEW_LINE>ZWaveWakeUpCommandClass wakeUpCommandClass = (ZWaveWakeUpCommandClass) node.getCommandClass(CommandClass.WAKE_UP);<NEW_LINE>// If it's a battery operated device, check if it's awake or place in wake-up queue.<NEW_LINE>if (wakeUpCommandClass != null && !wakeUpCommandClass.processOutgoingWakeupMessage(serialMessage)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add the message to the queue<NEW_LINE>this.sendQueue.add(serialMessage);<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.debug("Enqueueing message. Queue length = {}, Queue = {}", this.sendQueue.size(), this.sendQueue);<NEW_LINE>} else {<NEW_LINE>logger.debug("Enqueueing message. Queue length = {}", <MASK><NEW_LINE>}<NEW_LINE>}
this.sendQueue.size());
1,780,202
public Cursor<byte[]> scan(long cursorId, ScanOptions options) {<NEW_LINE>return new ScanCursor<byte[]>(cursorId, options) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected ScanIteration<byte[]> doScan(long cursorId, ScanOptions options) {<NEW_LINE>if (isQueueing() || isPipelined()) {<NEW_LINE>throw new UnsupportedOperationException("'SCAN' cannot be called in pipeline / transaction mode.");<NEW_LINE>}<NEW_LINE>ScanParams <MASK><NEW_LINE>ScanResult<byte[]> result;<NEW_LINE>byte[] type = null;<NEW_LINE>if (options instanceof KeyScanOptions) {<NEW_LINE>String typeAsString = ((KeyScanOptions) options).getType();<NEW_LINE>if (!ObjectUtils.isEmpty(typeAsString)) {<NEW_LINE>type = typeAsString.getBytes(StandardCharsets.US_ASCII);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type != null) {<NEW_LINE>result = connection.getJedis().scan(Long.toString(cursorId).getBytes(), params, type);<NEW_LINE>} else {<NEW_LINE>result = connection.getJedis().scan(Long.toString(cursorId).getBytes(), params);<NEW_LINE>}<NEW_LINE>return new ScanIteration<>(Long.parseLong(result.getCursor()), result.getResult());<NEW_LINE>}<NEW_LINE><NEW_LINE>protected void doClose() {<NEW_LINE>JedisKeyCommands.this.connection.close();<NEW_LINE>}<NEW_LINE>}.open();<NEW_LINE>}
params = JedisConverters.toScanParams(options);
868,911
private <T> T withFollowingRedirect(WebTarget initialWebTarget, RequestWithFollowingRedirect<T> request) {<NEW_LINE>WebApplicationException firstRedirectException = null;<NEW_LINE>WebTarget webTarget = initialWebTarget;<NEW_LINE>Optional<Response> lastResponse = Optional.absent();<NEW_LINE>for (int i = 0; i < MAX_REDIRECT; i++) {<NEW_LINE>try {<NEW_LINE>return request.invoke(webTarget, lastResponse);<NEW_LINE>} catch (WebApplicationException e) {<NEW_LINE>if (firstRedirectException == null) {<NEW_LINE>firstRedirectException = e;<NEW_LINE>}<NEW_LINE>Response response = checkNotNull(e.getResponse());<NEW_LINE>int status = response.getStatus();<NEW_LINE>if (status % 100 == 3 && response.getLocation() != null) {<NEW_LINE>lastResponse = Optional.of(response);<NEW_LINE>webTarget = client.target(UriBuilder.fromUri<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw firstRedirectException;<NEW_LINE>}
(response.getLocation()));
924,615
private EntityDef addSecurityGroupEntity() {<NEW_LINE>final String guid = "042d9b5c-677e-477b-811f-1c39bf716759";<NEW_LINE>final String name = "SecurityGroup";<NEW_LINE>final String description = "A collection of users that should be given the same security privileges.";<NEW_LINE>final String descriptionGUID = null;<NEW_LINE>final String superTypeName = "TechnicalControl";<NEW_LINE>EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef<MASK><NEW_LINE>List<TypeDefAttribute> properties = new ArrayList<>();<NEW_LINE>TypeDefAttribute property;<NEW_LINE>final String attribute1Name = "distinguishedName";<NEW_LINE>final String attribute1Description = "The LDAP distinguished name (DN) that gives a unique positional name in the LDAP DIT.";<NEW_LINE>final String attribute1DescriptionGUID = null;<NEW_LINE>property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, attribute1DescriptionGUID);<NEW_LINE>properties.add(property);<NEW_LINE>entityDef.setPropertiesDefinition(properties);<NEW_LINE>return entityDef;<NEW_LINE>}
(superTypeName), description, descriptionGUID);
1,405,013
public void submit(Class<? extends Runnable> actionClass, Action<? super org.gradle.workers.WorkerConfiguration> configAction) {<NEW_LINE>DeprecationLogger.deprecateMethod(WorkerExecutor.class, "submit()").replaceWith("noIsolation(), classLoaderIsolation() or processIsolation()").willBeRemovedInGradle8().withUserManual("upgrading_version_5", "method_workerexecutor_submit_is_deprecated").nagUser();<NEW_LINE><MASK><NEW_LINE>configAction.execute(configuration);<NEW_LINE>Action<AdapterWorkParameters> parametersAction = parameters -> {<NEW_LINE>parameters.setImplementationClassName(actionClass.getName());<NEW_LINE>parameters.setParams(configuration.getParams());<NEW_LINE>parameters.setDisplayName(configuration.getDisplayName());<NEW_LINE>};<NEW_LINE>WorkQueue workQueue;<NEW_LINE>switch(configuration.getIsolationMode()) {<NEW_LINE>case NONE:<NEW_LINE>case AUTO:<NEW_LINE>workQueue = noIsolation(getWorkerSpecAdapterAction(configuration));<NEW_LINE>break;<NEW_LINE>case CLASSLOADER:<NEW_LINE>workQueue = classLoaderIsolation(getWorkerSpecAdapterAction(configuration));<NEW_LINE>break;<NEW_LINE>case PROCESS:<NEW_LINE>workQueue = processIsolation(getWorkerSpecAdapterAction(configuration));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown isolation mode: " + configuration.getIsolationMode());<NEW_LINE>}<NEW_LINE>workQueue.submit(AdapterWorkAction.class, parametersAction);<NEW_LINE>}
DefaultWorkerConfiguration configuration = new DefaultWorkerConfiguration(forkOptionsFactory);
1,013,062
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>FilterPermanent filter = new FilterPermanent("nonenchantment permanents you don't control");<NEW_LINE>filter.add(Predicates.not(CardType.ENCHANTMENT.getPredicate()));<NEW_LINE>filter.add(TargetController.OPPONENT.getControllerPredicate());<NEW_LINE>List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game);<NEW_LINE>if (permanents.size() > 4) {<NEW_LINE>permanents.clear();<NEW_LINE>TargetPermanent target = new TargetPermanent(<MASK><NEW_LINE>controller.chooseTarget(outcome, target, source, game);<NEW_LINE>for (UUID targetId : target.getTargets()) {<NEW_LINE>Permanent permanent = game.getPermanent(targetId);<NEW_LINE>if (permanent != null) {<NEW_LINE>permanents.add(permanent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Permanent permanent : permanents) {<NEW_LINE>permanent.addCounters(CounterType.AIM.createInstance(), source.getControllerId(), source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
4, 4, filter, true);
835,314
public static GetPatentPlanInfoListResponse unmarshall(GetPatentPlanInfoListResponse getPatentPlanInfoListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getPatentPlanInfoListResponse.setRequestId(_ctx.stringValue("GetPatentPlanInfoListResponse.RequestId"));<NEW_LINE>getPatentPlanInfoListResponse.setPageNum(_ctx.integerValue("GetPatentPlanInfoListResponse.PageNum"));<NEW_LINE>getPatentPlanInfoListResponse.setSuccess(_ctx.booleanValue("GetPatentPlanInfoListResponse.Success"));<NEW_LINE>getPatentPlanInfoListResponse.setTotalItemNum(_ctx.integerValue("GetPatentPlanInfoListResponse.TotalItemNum"));<NEW_LINE>getPatentPlanInfoListResponse.setPageSize(_ctx.integerValue("GetPatentPlanInfoListResponse.PageSize"));<NEW_LINE>getPatentPlanInfoListResponse.setTotalPageNum(_ctx.integerValue("GetPatentPlanInfoListResponse.TotalPageNum"));<NEW_LINE>List<Produces> data = new ArrayList<Produces>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetPatentPlanInfoListResponse.Data.Length"); i++) {<NEW_LINE>Produces produces = new Produces();<NEW_LINE>produces.setOwner(_ctx.stringValue<MASK><NEW_LINE>produces.setPlanId(_ctx.longValue("GetPatentPlanInfoListResponse.Data[" + i + "].PlanId"));<NEW_LINE>produces.setName(_ctx.stringValue("GetPatentPlanInfoListResponse.Data[" + i + "].Name"));<NEW_LINE>produces.setContact(_ctx.stringValue("GetPatentPlanInfoListResponse.Data[" + i + "].Contact"));<NEW_LINE>produces.setWarnDays(_ctx.integerValue("GetPatentPlanInfoListResponse.Data[" + i + "].WarnDays"));<NEW_LINE>data.add(produces);<NEW_LINE>}<NEW_LINE>getPatentPlanInfoListResponse.setData(data);<NEW_LINE>return getPatentPlanInfoListResponse;<NEW_LINE>}
("GetPatentPlanInfoListResponse.Data[" + i + "].Owner"));
805,943
private Mono<Response<RedisForceRebootResponseInner>> forceRebootWithResponseAsync(String resourceGroupName, String name, RedisRebootParameters parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.forceReboot(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), this.client.getSubscriptionId(<MASK><NEW_LINE>}
), parameters, accept, context);
1,674,099
private InitiateAuthRequest initiateCustomAuthRequest(final Map<String, String> clientMetadata, final AuthenticationDetails authenticationDetails, final AuthenticationHelper authenticationHelper) {<NEW_LINE>final InitiateAuthRequest authRequest = new InitiateAuthRequest();<NEW_LINE>authRequest.setAuthFlow(CognitoServiceConstants.AUTH_TYPE_INIT_CUSTOM_AUTH);<NEW_LINE>authRequest.setClientId(clientId);<NEW_LINE>authRequest.setClientMetadata(clientMetadata);<NEW_LINE>Map<String, String> authenticationParameters = authenticationDetails.getAuthenticationParameters();<NEW_LINE>if (clientSecret != null && authenticationParameters.get(CognitoServiceConstants.AUTH_PARAM_SECRET_HASH) == null) {<NEW_LINE>secretHash = CognitoSecretHash.getSecretHash(authenticationDetails.getUserId(), clientId, clientSecret);<NEW_LINE>authenticationParameters.put(CognitoServiceConstants.AUTH_PARAM_SECRET_HASH, secretHash);<NEW_LINE>}<NEW_LINE>if (CognitoServiceConstants.AUTH_PARAM_SRP_A.equals(authenticationDetails.getCustomChallenge())) {<NEW_LINE>authenticationParameters.put(CognitoServiceConstants.AUTH_PARAM_SRP_A, authenticationHelper.getA().toString(16));<NEW_LINE>}<NEW_LINE>authRequest.setAuthParameters(authenticationDetails.getAuthenticationParameters());<NEW_LINE>if (authenticationDetails.getValidationData() != null && authenticationDetails.getValidationData().size() > 0) {<NEW_LINE>final Map<String, String> userValidationData = new HashMap<String, String>();<NEW_LINE>for (final AttributeType attribute : authenticationDetails.getValidationData()) {<NEW_LINE>userValidationData.put(attribute.getName(<MASK><NEW_LINE>}<NEW_LINE>authRequest.setClientMetadata(userValidationData);<NEW_LINE>}<NEW_LINE>authRequest.setUserContextData(getUserContextData());<NEW_LINE>return authRequest;<NEW_LINE>}
), attribute.getValue());
562,602
public static EnvironmentVariablesData readExternal(@Nonnull Element element) {<NEW_LINE>Element <MASK><NEW_LINE>if (envsElement == null) {<NEW_LINE>return DEFAULT;<NEW_LINE>}<NEW_LINE>Map<String, String> envs = Collections.emptyMap();<NEW_LINE>String passParentEnvsStr = envsElement.getAttributeValue(PASS_PARENT_ENVS);<NEW_LINE>boolean passParentEnvs = passParentEnvsStr == null || Boolean.parseBoolean(passParentEnvsStr);<NEW_LINE>for (Element envElement : envsElement.getChildren(ENV)) {<NEW_LINE>String envName = envElement.getAttributeValue(NAME);<NEW_LINE>String envValue = envElement.getAttributeValue(VALUE);<NEW_LINE>if (envName != null && envValue != null) {<NEW_LINE>if (envs.isEmpty()) {<NEW_LINE>envs = new LinkedHashMap<>();<NEW_LINE>}<NEW_LINE>envs.put(envName, envValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return create(envs, passParentEnvs);<NEW_LINE>}
envsElement = element.getChild(ENVS);
1,403,858
public final Reader reader() throws IOException {<NEW_LINE>try {<NEW_LINE>if (string != null)<NEW_LINE>return new StringReader(string);<NEW_LINE>else if (bytes != null)<NEW_LINE>if (length > -1)<NEW_LINE>return inputStreamReader(new ByteArrayInputStream(bytes, 0, length));<NEW_LINE>else<NEW_LINE>return inputStreamReader(new ByteArrayInputStream(bytes));<NEW_LINE>else if (reader != null)<NEW_LINE>if (length > -1)<NEW_LINE>return new LengthLimitedReader(reader, length);<NEW_LINE>else<NEW_LINE>return reader;<NEW_LINE>else if (inputStream != null)<NEW_LINE>if (length > -1)<NEW_LINE>return inputStreamReader(new LengthLimitedInputStream(inputStream, length));<NEW_LINE>else<NEW_LINE>return inputStreamReader(inputStream);<NEW_LINE>else if (file != null)<NEW_LINE>return new BufferedReader(inputStreamReader(new FileInputStream(file)));<NEW_LINE>else<NEW_LINE>throw new IllegalStateException("Could not produce a reader from this source");<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>throw new IOException(<MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
509,984
public void render(MatrixStack matrixStack, float partialTicks) {<NEW_LINE>if (tabGuiOtf.isHidden())<NEW_LINE>return;<NEW_LINE>ClickGui gui = WurstClient.INSTANCE.getGui();<NEW_LINE>int txtColor = gui.getTxtColor();<NEW_LINE>GL11.glDisable(GL11.GL_CULL_FACE);<NEW_LINE>GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);<NEW_LINE>matrixStack.push();<NEW_LINE>Window sr = WurstClient.MC.getWindow();<NEW_LINE>int x = 2;<NEW_LINE>int y = 23;<NEW_LINE>matrixStack.translate(x, y, 0);<NEW_LINE>drawBox(matrixStack, 0, 0, width, height);<NEW_LINE>double factor = sr.getScaleFactor();<NEW_LINE>GL11.glScissor((int) (x * factor), (int) ((sr.getScaledHeight() - height - y) * factor), (int) (width * factor), (int) (height * factor));<NEW_LINE>GL11.glEnable(GL11.GL_SCISSOR_TEST);<NEW_LINE>int textY = 1;<NEW_LINE>for (int i = 0; i < tabs.size(); i++) {<NEW_LINE>String tabName = tabs.get(i).name;<NEW_LINE>if (i == selected)<NEW_LINE>tabName = (tabOpened ? "<" : ">") + tabName;<NEW_LINE>WurstClient.MC.textRenderer.draw(matrixStack, tabName, 2, textY, txtColor);<NEW_LINE>textY += 10;<NEW_LINE>}<NEW_LINE>GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>GL11.glDisable(GL11.GL_SCISSOR_TEST);<NEW_LINE>if (tabOpened) {<NEW_LINE>matrixStack.push();<NEW_LINE>Tab tab = tabs.get(selected);<NEW_LINE>int tabX = x + width + 2;<NEW_LINE>int tabY = y;<NEW_LINE>matrixStack.translate(width + 2, 0, 0);<NEW_LINE>drawBox(matrixStack, 0, 0, tab.width, tab.height);<NEW_LINE>GL11.glScissor((int) (tabX * factor), (int) ((sr.getScaledHeight() - tab.height - tabY) * factor), (int) (tab.width * factor), (int) (tab.height * factor));<NEW_LINE>GL11.glEnable(GL11.GL_SCISSOR_TEST);<NEW_LINE>int tabTextY = 1;<NEW_LINE>for (int i = 0; i < tab.features.size(); i++) {<NEW_LINE>Feature feature = tab.features.get(i);<NEW_LINE>String fName = feature.getName();<NEW_LINE>if (feature.isEnabled())<NEW_LINE>fName = "\u00a7a" + fName + "\u00a7r";<NEW_LINE>if (i == tab.selected)<NEW_LINE>fName = ">" + fName;<NEW_LINE>WurstClient.MC.textRenderer.draw(matrixStack, fName, 2, tabTextY, txtColor);<NEW_LINE>tabTextY += 10;<NEW_LINE>}<NEW_LINE>GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>GL11.glDisable(GL11.GL_SCISSOR_TEST);<NEW_LINE>matrixStack.pop();<NEW_LINE>}<NEW_LINE>matrixStack.pop();<NEW_LINE><MASK><NEW_LINE>}
GL11.glEnable(GL11.GL_CULL_FACE);
1,754,196
protected void initHistoricVariableUpdateEvt(HistoricVariableUpdateEventEntity evt, VariableInstanceEntity variableInstance, HistoryEventType eventType) {<NEW_LINE>// init properties<NEW_LINE>evt.setEventType(eventType.getEventName());<NEW_LINE>evt.setTimestamp(ClockUtil.getCurrentTime());<NEW_LINE>evt.setVariableInstanceId(variableInstance.getId());<NEW_LINE>evt.setProcessInstanceId(variableInstance.getProcessInstanceId());<NEW_LINE>evt.setExecutionId(variableInstance.getExecutionId());<NEW_LINE>evt.setCaseInstanceId(variableInstance.getCaseInstanceId());<NEW_LINE>evt.setCaseExecutionId(variableInstance.getCaseExecutionId());<NEW_LINE>evt.setTaskId(variableInstance.getTaskId());<NEW_LINE>evt.setRevision(variableInstance.getRevision());<NEW_LINE>evt.setVariableName(variableInstance.getName());<NEW_LINE>evt.setSerializerName(variableInstance.getSerializerName());<NEW_LINE>evt.setTenantId(variableInstance.getTenantId());<NEW_LINE>evt.setUserOperationId(Context.getCommandContext().getOperationId());<NEW_LINE>ExecutionEntity execution = variableInstance.getExecution();<NEW_LINE>if (execution != null) {<NEW_LINE>ProcessDefinitionEntity definition = execution.getProcessDefinition();<NEW_LINE>if (definition != null) {<NEW_LINE>evt.setProcessDefinitionId(definition.getId());<NEW_LINE>evt.setProcessDefinitionKey(definition.getKey());<NEW_LINE>}<NEW_LINE>evt.<MASK><NEW_LINE>if (isHistoryRemovalTimeStrategyStart()) {<NEW_LINE>provideRemovalTime(evt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CaseExecutionEntity caseExecution = variableInstance.getCaseExecution();<NEW_LINE>if (caseExecution != null) {<NEW_LINE>CaseDefinitionEntity definition = (CaseDefinitionEntity) caseExecution.getCaseDefinition();<NEW_LINE>if (definition != null) {<NEW_LINE>evt.setCaseDefinitionId(definition.getId());<NEW_LINE>evt.setCaseDefinitionKey(definition.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// copy value<NEW_LINE>evt.setTextValue(variableInstance.getTextValue());<NEW_LINE>evt.setTextValue2(variableInstance.getTextValue2());<NEW_LINE>evt.setDoubleValue(variableInstance.getDoubleValue());<NEW_LINE>evt.setLongValue(variableInstance.getLongValue());<NEW_LINE>if (variableInstance.getByteArrayValueId() != null) {<NEW_LINE>evt.setByteValue(variableInstance.getByteArrayValue());<NEW_LINE>}<NEW_LINE>}
setRootProcessInstanceId(execution.getRootProcessInstanceId());
1,336,705
public CopyResult call() throws Exception {<NEW_LINE>CompleteMultipartUploadResult res;<NEW_LINE>try {<NEW_LINE>CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest(origReq.getDestinationBucketName(), origReq.getDestinationKey(), uploadId, collectPartETags()).withRequesterPays(origReq.isRequesterPays()).withGeneralProgressListener(origReq.getGeneralProgressListener()).withRequestMetricCollector(origReq.getRequestMetricCollector()).<MASK><NEW_LINE>res = s3.completeMultipartUpload(req);<NEW_LINE>} catch (Exception e) {<NEW_LINE>monitor.reportFailure();<NEW_LINE>publishProgress(listener, ProgressEventType.TRANSFER_FAILED_EVENT);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>CopyResult copyResult = new CopyResult();<NEW_LINE>copyResult.setSourceBucketName(origReq.getSourceBucketName());<NEW_LINE>copyResult.setSourceKey(origReq.getSourceKey());<NEW_LINE>copyResult.setDestinationBucketName(res.getBucketName());<NEW_LINE>copyResult.setDestinationKey(res.getKey());<NEW_LINE>copyResult.setETag(res.getETag());<NEW_LINE>copyResult.setVersionId(res.getVersionId());<NEW_LINE>monitor.copyComplete();<NEW_LINE>return copyResult;<NEW_LINE>}
withRequestCredentialsProvider(origReq.getRequestCredentialsProvider());
19,954
private Map propertiesToMap(Check check) {<NEW_LINE>Map map = new HashMap();<NEW_LINE>map.put("_id", check.getId());<NEW_LINE>map.put("name", check.getName());<NEW_LINE>map.put("description", check.getDescription());<NEW_LINE>map.put("target", check.getTarget());<NEW_LINE>map.put("from", check.getFrom());<NEW_LINE>map.put(<MASK><NEW_LINE>if (check.getWarn() != null) {<NEW_LINE>map.put("warn", check.getWarn().toPlainString());<NEW_LINE>}<NEW_LINE>if (check.getError() != null) {<NEW_LINE>map.put("error", check.getError().toPlainString());<NEW_LINE>}<NEW_LINE>map.put("enabled", check.isEnabled());<NEW_LINE>map.put("live", check.isLive());<NEW_LINE>map.put("allowNoData", check.isAllowNoData());<NEW_LINE>map.put("state", check.getState().toString());<NEW_LINE>if (check.getLastCheck() != null) {<NEW_LINE>map.put("lastCheck", new Date(check.getLastCheck().getMillis()));<NEW_LINE>}<NEW_LINE>if (check.getSubscriptions() != null && !check.getSubscriptions().isEmpty()) {<NEW_LINE>final ArrayList<DBObject> dbSubscriptions = new ArrayList<DBObject>();<NEW_LINE>for (Subscription s : check.getSubscriptions()) {<NEW_LINE>final BasicDBObject dbObject = new BasicDBObject(propertiesToMap(s));<NEW_LINE>if (dbObject.get("_id") == null) {<NEW_LINE>dbObject.put("_id", new ObjectId().toHexString());<NEW_LINE>}<NEW_LINE>dbSubscriptions.add(dbObject);<NEW_LINE>}<NEW_LINE>map.put("subscriptions", dbSubscriptions);<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
"until", check.getUntil());
941,342
void updateInstanceStatesForNewConsumingSegment(Map<String, Map<String, String>> instanceStatesMap, @Nullable String committingSegmentName, @Nullable String newSegmentName, SegmentAssignment segmentAssignment, Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap) {<NEW_LINE>if (committingSegmentName != null) {<NEW_LINE>// Change committing segment state to ONLINE<NEW_LINE>Set<String> instances = instanceStatesMap.<MASK><NEW_LINE>instanceStatesMap.put(committingSegmentName, SegmentAssignmentUtils.getInstanceStateMap(instances, SegmentStateModel.ONLINE));<NEW_LINE>LOGGER.info("Updating segment: {} to ONLINE state", committingSegmentName);<NEW_LINE>}<NEW_LINE>// There used to be a race condition in pinot (caused by heavy GC on the controller during segment commit)<NEW_LINE>// that ended up creating multiple consuming segments for the same stream partition, named somewhat like<NEW_LINE>// tableName__1__25__20210920T190005Z and tableName__1__25__20210920T190007Z. It was fixed by checking the<NEW_LINE>// Zookeeper Stat object before updating the segment metadata.<NEW_LINE>// These conditions can happen again due to manual operations considered as fixes in Issues #5559 and #5263<NEW_LINE>// The following check prevents the table from going into such a state (but does not prevent the root cause<NEW_LINE>// of attempting such a zk update).<NEW_LINE>if (newSegmentName != null) {<NEW_LINE>LLCSegmentName newLLCSegmentName = new LLCSegmentName(newSegmentName);<NEW_LINE>int partitionId = newLLCSegmentName.getPartitionGroupId();<NEW_LINE>int seqNum = newLLCSegmentName.getSequenceNumber();<NEW_LINE>for (String segmentNameStr : instanceStatesMap.keySet()) {<NEW_LINE>if (!LLCSegmentName.isLowLevelConsumerSegmentName(segmentNameStr)) {<NEW_LINE>// skip the segment name if the name is not in low-level consumer format<NEW_LINE>// such segment name can appear for uploaded segment<NEW_LINE>LOGGER.debug("Skip segment name {} not in low-level consumer format", segmentNameStr);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LLCSegmentName llcSegmentName = new LLCSegmentName(segmentNameStr);<NEW_LINE>if (llcSegmentName.getPartitionGroupId() == partitionId && llcSegmentName.getSequenceNumber() == seqNum) {<NEW_LINE>String errorMsg = String.format("Segment %s is a duplicate of existing segment %s", newSegmentName, segmentNameStr);<NEW_LINE>LOGGER.error(errorMsg);<NEW_LINE>throw new HelixHelper.PermanentUpdaterException(errorMsg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Assign instances to the new segment and add instances as state CONSUMING<NEW_LINE>List<String> instancesAssigned = segmentAssignment.assignSegment(newSegmentName, instanceStatesMap, instancePartitionsMap);<NEW_LINE>instanceStatesMap.put(newSegmentName, SegmentAssignmentUtils.getInstanceStateMap(instancesAssigned, SegmentStateModel.CONSUMING));<NEW_LINE>LOGGER.info("Adding new CONSUMING segment: {} to instances: {}", newSegmentName, instancesAssigned);<NEW_LINE>}<NEW_LINE>}
get(committingSegmentName).keySet();
1,081,163
private ControlSilence createSilenceMessage(long tick, long completedPrefix, int priority, Reliability reliability, SIBUuid12 stream) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "createSilenceMessage", new Object[] { new Long(tick), new Long(completedPrefix), new Integer(priority), reliability, stream });<NEW_LINE>ControlSilence sMsg = null;<NEW_LINE>try {<NEW_LINE>// Create new Silence message<NEW_LINE>sMsg = cmf.createNewControlSilence();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// FFDC<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.createSilenceMessage", "1:1327:1.241", this);<NEW_LINE><MASK><NEW_LINE>SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:1333:1.241", e });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createSilenceMessage", e);<NEW_LINE>throw new SIResourceException(nls.getFormattedMessage("INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:1344:1.241", e }, null), e);<NEW_LINE>}<NEW_LINE>// As we are using the Guaranteed Header - set all the attributes as<NEW_LINE>// well as the ones we want.<NEW_LINE>SIMPUtils.setGuaranteedDeliveryProperties(sMsg, messageProcessor.getMessagingEngineUuid(), targetMEUuid, stream, null, destinationHandler.getUuid(), ProtocolType.UNICASTINPUT, GDConfig.PROTOCOL_VERSION);<NEW_LINE>sMsg.setStartTick(tick);<NEW_LINE>sMsg.setEndTick(tick);<NEW_LINE>sMsg.setPriority(priority);<NEW_LINE>sMsg.setReliability(reliability);<NEW_LINE>sMsg.setCompletedPrefix(completedPrefix);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createSilenceMessage", sMsg);<NEW_LINE>return sMsg;<NEW_LINE>}
SibTr.exception(tc, e);
504,885
public void marshall(Device device, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (device == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(device.getDeviceArn(), DEVICEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getDeviceSerialNumber(), DEVICESERIALNUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getDeviceType(), DEVICETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getDeviceName(), DEVICENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getSoftwareVersion(), SOFTWAREVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getMacAddress(), MACADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getRoomArn(), ROOMARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(device.getDeviceStatusInfo(), DEVICESTATUSINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getNetworkProfileInfo(), NETWORKPROFILEINFO_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
device.getDeviceStatus(), DEVICESTATUS_BINDING);
1,477,670
public Composite createControl(Composite parent, DashboardResources resources) {<NEW_LINE>Composite container = new Composite(parent, SWT.NONE);<NEW_LINE>GridLayoutFactory.fillDefaults().numColumns(1).margins(5, 5).applyTo(container);<NEW_LINE>container.setBackground(parent.getBackground());<NEW_LINE>title = new Label(container, SWT.NONE);<NEW_LINE>title.setBackground(container.getBackground());<NEW_LINE>title.setText(TextUtil.tooltip(getWidget().getLabel()));<NEW_LINE>GridDataFactory.fillDefaults().grab(true, false).applyTo(title);<NEW_LINE>chart = new PlainChart(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>chart.setData(UIConstants.CSS.CLASS_NAME, "chart");<NEW_LINE>getDashboardData().getStylingEngine().style(chart);<NEW_LINE>chart.setBackground(container.getBackground());<NEW_LINE>chart.getTitle().setVisible(false);<NEW_LINE>chart.getTitle().setText(title.getText());<NEW_LINE>chart.getLegend().setVisible(false);<NEW_LINE>toolTip = new TimelineChartToolTip(chart);<NEW_LINE>toolTip.enableCategory(true);<NEW_LINE>toolTip.reverseLabels(true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>toolTip.setDefaultValueFormat(new DecimalFormat("#"));<NEW_LINE>toolTip.setXAxisFormat(obj -> {<NEW_LINE>Integer index = (Integer) obj;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<YearMonth> yearMonths = (List<YearMonth>) chart.getData();<NEW_LINE>return yearMonths.<MASK><NEW_LINE>});<NEW_LINE>int yHint = get(ChartHeightConfig.class).getPixel();<NEW_LINE>GridDataFactory.fillDefaults().hint(SWT.DEFAULT, yHint).grab(true, false).applyTo(chart);<NEW_LINE>// configure axis<NEW_LINE>IAxis xAxis = chart.getAxisSet().getXAxis(0);<NEW_LINE>xAxis.getTick().setVisible(true);<NEW_LINE>xAxis.getTitle().setVisible(false);<NEW_LINE>xAxis.getTitle().setText(Messages.ColumnMonth);<NEW_LINE>xAxis.getGrid().setStyle(LineStyle.NONE);<NEW_LINE>xAxis.enableCategory(true);<NEW_LINE>IAxis yAxis = chart.getAxisSet().getYAxis(0);<NEW_LINE>yAxis.getTitle().setVisible(false);<NEW_LINE>yAxis.setPosition(Position.Secondary);<NEW_LINE>chart.getPlotArea().addTraverseListener(event -> event.doit = true);<NEW_LINE>((IPlotArea) chart.getPlotArea()).addCustomPaintListener(new TimeGridPaintListener(chart));<NEW_LINE>container.layout();<NEW_LINE>return container;<NEW_LINE>}
get(index).toString();