idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,157,791
private static String createRandomKey() {<NEW_LINE>SecureRandom random = new SecureRandom();<NEW_LINE>List<Character> possibleCharacters = new ArrayList<>();<NEW_LINE>for (char c = 'A'; c <= 'Z'; c++) {<NEW_LINE>possibleCharacters.add(c);<NEW_LINE>}<NEW_LINE>for (char c = 'a'; c <= 'z'; c++) {<NEW_LINE>possibleCharacters.add(c);<NEW_LINE>}<NEW_LINE>for (char c = '2'; c <= '9'; c++) {<NEW_LINE>possibleCharacters.add(c);<NEW_LINE>}<NEW_LINE>possibleCharacters.remove<MASK><NEW_LINE>possibleCharacters.remove(Character.valueOf('I'));<NEW_LINE>possibleCharacters.remove(Character.valueOf('O'));<NEW_LINE>StringBuilder codeBuilder = new StringBuilder();<NEW_LINE>for (int i = 0; i < 20; i++) {<NEW_LINE>if ((i != 0) && (i % 4 == 0)) {<NEW_LINE>codeBuilder.append("-");<NEW_LINE>}<NEW_LINE>codeBuilder.append(possibleCharacters.get(random.nextInt(possibleCharacters.size())));<NEW_LINE>}<NEW_LINE>return codeBuilder.toString();<NEW_LINE>}
(Character.valueOf('l'));
911,327
// snippet-start:[s3.java2.getobjecttags.main]<NEW_LINE>public static void listTags(S3Client s3, String bucketName, String keyName) {<NEW_LINE>try {<NEW_LINE>GetObjectTaggingRequest getTaggingRequest = GetObjectTaggingRequest.builder().key(keyName).bucket(bucketName).build();<NEW_LINE>GetObjectTaggingResponse <MASK><NEW_LINE>List<Tag> tagSet = tags.tagSet();<NEW_LINE>// Write out the tags<NEW_LINE>Iterator<Tag> tagIterator = tagSet.iterator();<NEW_LINE>while (tagIterator.hasNext()) {<NEW_LINE>Tag tag = (Tag) tagIterator.next();<NEW_LINE>System.out.println(tag.key());<NEW_LINE>System.out.println(tag.value());<NEW_LINE>}<NEW_LINE>} catch (S3Exception e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
tags = s3.getObjectTagging(getTaggingRequest);
940,030
public void prepareDocumentForEncryption(PDDocument document) throws IOException {<NEW_LINE>PDEncryption encryptionDictionary = document.getEncryption();<NEW_LINE>if (encryptionDictionary == null) {<NEW_LINE>encryptionDictionary = new PDEncryption();<NEW_LINE>}<NEW_LINE>int version = computeVersionNumber();<NEW_LINE>int revision = computeRevisionNumber(version);<NEW_LINE>encryptionDictionary.setFilter(FILTER);<NEW_LINE>encryptionDictionary.setVersion(version);<NEW_LINE>if (version != 4 && version != 5) {<NEW_LINE>// remove CF, StmF, and StrF entries that may be left from a previous encryption<NEW_LINE>encryptionDictionary.removeV45filters();<NEW_LINE>}<NEW_LINE>encryptionDictionary.setRevision(revision);<NEW_LINE>encryptionDictionary.setLength(keyLength);<NEW_LINE>String ownerPassword = policy.getOwnerPassword();<NEW_LINE><MASK><NEW_LINE>if (ownerPassword == null) {<NEW_LINE>ownerPassword = "";<NEW_LINE>}<NEW_LINE>if (userPassword == null) {<NEW_LINE>userPassword = "";<NEW_LINE>}<NEW_LINE>// If no owner password is set, use the user password instead.<NEW_LINE>if (ownerPassword.isEmpty()) {<NEW_LINE>ownerPassword = userPassword;<NEW_LINE>}<NEW_LINE>int permissionInt = policy.getPermissions().getPermissionBytes();<NEW_LINE>encryptionDictionary.setPermissions(permissionInt);<NEW_LINE>int length = keyLength / 8;<NEW_LINE>if (revision == 6) {<NEW_LINE>// PDFBOX-4155<NEW_LINE>ownerPassword = SaslPrep.saslPrepStored(ownerPassword);<NEW_LINE>userPassword = SaslPrep.saslPrepStored(userPassword);<NEW_LINE>prepareEncryptionDictRev6(ownerPassword, userPassword, encryptionDictionary, permissionInt);<NEW_LINE>} else {<NEW_LINE>prepareEncryptionDictRev2345(ownerPassword, userPassword, encryptionDictionary, permissionInt, document, revision, length);<NEW_LINE>}<NEW_LINE>document.setEncryptionDictionary(encryptionDictionary);<NEW_LINE>document.getDocument().setEncryptionDictionary(encryptionDictionary.getCOSObject());<NEW_LINE>}
String userPassword = policy.getUserPassword();
1,344,765
final GetSizeConstraintSetResult executeGetSizeConstraintSet(GetSizeConstraintSetRequest getSizeConstraintSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSizeConstraintSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSizeConstraintSetRequest> request = null;<NEW_LINE>Response<GetSizeConstraintSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSizeConstraintSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSizeConstraintSetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSizeConstraintSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSizeConstraintSetResult>> 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 GetSizeConstraintSetResultJsonUnmarshaller());
702,840
public void reset() {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "reset");<NEW_LINE>if (finalResults != null) {<NEW_LINE>for (int i = 0; i < MessageProcessorMatchTarget.NUM_TYPES; i++) {<NEW_LINE>if (handlers[i] != null)<NEW_LINE>handlers[i].resetResult(finalResults[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>finalResults = new Object[MessageProcessorMatchTarget.NUM_TYPES];<NEW_LINE>for (int i = 0; i < MessageProcessorMatchTarget.NUM_TYPES; i++) {<NEW_LINE>if (handlers[i] != null)<NEW_LINE>finalResults[i] = <MASK><NEW_LINE>else<NEW_LINE>finalResults[i] = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cachedResults = null;<NEW_LINE>postProcessed = false;<NEW_LINE>// reset reference to topicspace<NEW_LINE>destinationHandler = null;<NEW_LINE>// clear the PSOHs list<NEW_LINE>matchingPSOHs.clear();<NEW_LINE>generatedMatchingPSOHs = false;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "reset");<NEW_LINE>}
handlers[i].initResult();
1,114,365
// autogenerated by CtBiScannerGenerator<NEW_LINE>public <T, A extends T> void visitCtOperatorAssignment(final spoon.reflect.code.CtOperatorAssignment<T, A> assignment) {<NEW_LINE>spoon.reflect.code.CtOperatorAssignment other = ((spoon.reflect.code.CtOperatorAssignment) (this<MASK><NEW_LINE>enter(assignment);<NEW_LINE>biScan(spoon.reflect.path.CtRole.ANNOTATION, assignment.getAnnotations(), other.getAnnotations());<NEW_LINE>biScan(spoon.reflect.path.CtRole.TYPE, assignment.getType(), other.getType());<NEW_LINE>biScan(spoon.reflect.path.CtRole.CAST, assignment.getTypeCasts(), other.getTypeCasts());<NEW_LINE>biScan(spoon.reflect.path.CtRole.ASSIGNED, assignment.getAssigned(), other.getAssigned());<NEW_LINE>biScan(spoon.reflect.path.CtRole.ASSIGNMENT, assignment.getAssignment(), other.getAssignment());<NEW_LINE>biScan(spoon.reflect.path.CtRole.COMMENT, assignment.getComments(), other.getComments());<NEW_LINE>exit(assignment);<NEW_LINE>}
.stack.peek()));
704,946
public static void scrollToTheEnd(@Nonnull Editor editor, boolean preferVerticalScroll) {<NEW_LINE>editor.getSelectionModel().removeSelection();<NEW_LINE><MASK><NEW_LINE>int lastLine = Math.max(0, document.getLineCount() - 1);<NEW_LINE>boolean caretWasAtLastLine = editor.getCaretModel().getLogicalPosition().line == lastLine;<NEW_LINE>editor.getCaretModel().moveToOffset(document.getTextLength());<NEW_LINE>ScrollingModel scrollingModel = editor.getScrollingModel();<NEW_LINE>if (preferVerticalScroll && document.getLineStartOffset(lastLine) == document.getLineEndOffset(lastLine)) {<NEW_LINE>// don't move 'focus' to empty last line<NEW_LINE>int scrollOffset;<NEW_LINE>if (editor instanceof EditorEx) {<NEW_LINE>JScrollBar verticalScrollBar = ((EditorEx) editor).getScrollPane().getVerticalScrollBar();<NEW_LINE>scrollOffset = verticalScrollBar.getMaximum() - verticalScrollBar.getModel().getExtent();<NEW_LINE>} else {<NEW_LINE>scrollOffset = editor.getContentComponent().getHeight() - scrollingModel.getVisibleArea().height;<NEW_LINE>}<NEW_LINE>scrollingModel.scrollVertically(scrollOffset);<NEW_LINE>} else if (!caretWasAtLastLine) {<NEW_LINE>// don't scroll to the end of the last line (IDEA-124688)...<NEW_LINE>scrollingModel.scrollTo(new LogicalPosition(lastLine, 0), ScrollType.RELATIVE);<NEW_LINE>} else {<NEW_LINE>// ...unless the caret was already on the last line - then scroll to the end of it.<NEW_LINE>scrollingModel.scrollToCaret(ScrollType.RELATIVE);<NEW_LINE>}<NEW_LINE>}
Document document = editor.getDocument();
219,735
public GenericTrigger createContainerTriggerImpl(@NotNull GenericStructContainer container, @NotNull JDBCResultSet dbResult) throws DBException {<NEW_LINE>String name = <MASK><NEW_LINE>if (name == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int sequence = JDBCUtils.safeGetInt(dbResult, "RDB$TRIGGER_SEQUENCE");<NEW_LINE>int type = JDBCUtils.safeGetInt(dbResult, "RDB$TRIGGER_TYPE");<NEW_LINE>String description = JDBCUtils.safeGetStringTrimmed(dbResult, "RDB$DESCRIPTION");<NEW_LINE>int systemFlag = JDBCUtils.safeGetInt(dbResult, "RDB$SYSTEM_FLAG");<NEW_LINE>boolean isSystem = true;<NEW_LINE>if (systemFlag == 0) {<NEW_LINE>// System flag value 0 - if user-defined and 1 or more if system<NEW_LINE>isSystem = false;<NEW_LINE>}<NEW_LINE>return new FireBirdDatabaseTrigger(container, name, description, FireBirdTriggerType.getByType(type), sequence, isSystem);<NEW_LINE>}
JDBCUtils.safeGetStringTrimmed(dbResult, "RDB$TRIGGER_NAME");
63,352
public static byte[] toPdf(String fileName, byte[] bytes, String stamp) throws Exception {<NEW_LINE>Config.collect().validate();<NEW_LINE>URL serverUrl = new URL(Config.collect().url() + "/o2_collect_assemble/jaxrs/document/to/pdf");<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) serverUrl.openConnection();<NEW_LINE>String boundary = "----" + StringTools.uniqueToken();<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.setUseCaches(false);<NEW_LINE>connection.addRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);<NEW_LINE>try (OutputStream out = connection.getOutputStream();<NEW_LINE>BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out))) {<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Disposition: form-data; name=\"file\"; filename=\"" + (StringUtils.isEmpty(fileName) ? StringTools.uniqueToken() : fileName) + "\"");<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Type: " + HttpMediaType.APPLICATION_OCTET_STREAM);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.flush();<NEW_LINE>out.write(bytes);<NEW_LINE>out.flush();<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>if (StringUtils.isNotEmpty(stamp)) {<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Disposition: form-data; name=\"stamp\"");<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Type: " + HttpMediaType.TEXT_PLAIN);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(stamp);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>}<NEW_LINE>writer.write(twoHyphens);<NEW_LINE>writer.flush();<NEW_LINE>}<NEW_LINE>String respText = null;<NEW_LINE>try (InputStream in = connection.getInputStream()) {<NEW_LINE>respText = IOUtils.<MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(respText)) {<NEW_LINE>ActionResponse response = XGsonBuilder.instance().fromJson(respText, ActionResponse.class);<NEW_LINE>WrapString wrap = XGsonBuilder.instance().fromJson(response.getData(), WrapString.class);<NEW_LINE>return Base64.decodeBase64(wrap.getValue());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
toString(in, DefaultCharset.charset_utf_8);
170,639
public void delete(ClientModel client) {<NEW_LINE>String id = client.getId();<NEW_LINE>ResourceServerEntity entity = entityManager.find(ResourceServerEntity.class, id);<NEW_LINE>if (entity == null)<NEW_LINE>return;<NEW_LINE>// This didn't work, had to loop through and remove each policy individually<NEW_LINE>// entityManager.createNamedQuery("deletePolicyByResourceServer")<NEW_LINE>// .setParameter("serverId", id).executeUpdate();<NEW_LINE>{<NEW_LINE>TypedQuery<String> query = entityManager.createNamedQuery("findPolicyIdByServerId", String.class);<NEW_LINE>query.setParameter("serverId", id);<NEW_LINE>List<String> result = query.getResultList();<NEW_LINE>for (String policyId : result) {<NEW_LINE>entityManager.remove(entityManager.getReference(PolicyEntity.class, policyId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>{<NEW_LINE>TypedQuery<String> query = entityManager.createNamedQuery("findPermissionTicketIdByServerId", String.class);<NEW_LINE>query.setParameter("serverId", id);<NEW_LINE>List<String> result = query.getResultList();<NEW_LINE>for (String permissionId : result) {<NEW_LINE>entityManager.remove(entityManager.getReference(PermissionTicketEntity.class, permissionId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// entityManager.createNamedQuery("deleteResourceByResourceServer")<NEW_LINE>// .setParameter("serverId", id).executeUpdate();<NEW_LINE>{<NEW_LINE>TypedQuery<String> query = entityManager.createNamedQuery("findResourceIdByServerId", String.class);<NEW_LINE>query.setParameter("serverId", id);<NEW_LINE>List<String> result = query.getResultList();<NEW_LINE>for (String resourceId : result) {<NEW_LINE>entityManager.remove(entityManager.getReference<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// entityManager.createNamedQuery("deleteScopeByResourceServer")<NEW_LINE>// .setParameter("serverId", id).executeUpdate();<NEW_LINE>{<NEW_LINE>TypedQuery<String> query = entityManager.createNamedQuery("findScopeIdByResourceServer", String.class);<NEW_LINE>query.setParameter("serverId", id);<NEW_LINE>List<String> result = query.getResultList();<NEW_LINE>for (String scopeId : result) {<NEW_LINE>entityManager.remove(entityManager.getReference(ScopeEntity.class, scopeId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.entityManager.remove(entity);<NEW_LINE>entityManager.flush();<NEW_LINE>entityManager.detach(entity);<NEW_LINE>}
(ResourceEntity.class, resourceId));
851,295
public void drawBackground(@Nonnull PoseStack matrix, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>super.drawBackground(matrix, mouseX, mouseY, partialTicks);<NEW_LINE>// Draw Black and border<NEW_LINE>renderBackgroundTexture(matrix, GuiInnerScreen.SCREEN, GuiInnerScreen.SCREEN_SIZE, GuiInnerScreen.SCREEN_SIZE);<NEW_LINE>RenderSystem.setShaderTexture(0, getResource());<NEW_LINE>// Draw the graph<NEW_LINE>int size = graphData.size();<NEW_LINE>int x = this.x + 1;<NEW_LINE>int y = this.y + 1;<NEW_LINE>int height = this.height - 2;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>int relativeHeight = getRelativeHeight(i, height);<NEW_LINE>blit(matrix, x + i, y + height - relativeHeight, 0, 0, 1, 1, TEXTURE_WIDTH, TEXTURE_HEIGHT);<NEW_LINE>RenderSystem.enableBlend();<NEW_LINE>RenderSystem.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);<NEW_LINE>RenderSystem.setShaderColor(1, 1, 1, 0.2F + 0.8F * i / size);<NEW_LINE>blit(matrix, x + i, y + height - relativeHeight, 1, 0, 1, relativeHeight, TEXTURE_WIDTH, TEXTURE_HEIGHT);<NEW_LINE>int hoverIndex = mouseX - getButtonX();<NEW_LINE>if (hoverIndex == i && mouseY >= getButtonY() && mouseY < getButtonY() + height) {<NEW_LINE>RenderSystem.setShaderColor(1, 1, 1, 0.5F);<NEW_LINE>blit(matrix, x + i, y, 2, 0, <MASK><NEW_LINE>MekanismRenderer.resetColor();<NEW_LINE>blit(matrix, x + i, y + height - relativeHeight, 0, 1, 1, 1, TEXTURE_WIDTH, TEXTURE_HEIGHT);<NEW_LINE>}<NEW_LINE>MekanismRenderer.resetColor();<NEW_LINE>RenderSystem.disableBlend();<NEW_LINE>}<NEW_LINE>}
1, height, TEXTURE_WIDTH, TEXTURE_HEIGHT);
339,463
public void marshall(RuleGroupResponse ruleGroupResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (ruleGroupResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getRuleGroupArn(), RULEGROUPARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getRuleGroupName(), RULEGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getCapacity(), CAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getRuleGroupStatus(), RULEGROUPSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getConsumedCapacity(), CONSUMEDCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroupResponse.getNumberOfAssociations(), NUMBEROFASSOCIATIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
ruleGroupResponse.getRuleGroupId(), RULEGROUPID_BINDING);
1,336,429
private Object post(Object[] arguments) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {<NEW_LINE>if (arguments.length < 1) {<NEW_LINE>throw ArityException.create(1, -1, arguments.length);<NEW_LINE>}<NEW_LINE>if (!InteropLibrary.getUncached().isString(arguments[0])) {<NEW_LINE>throw UnsupportedTypeException.create(new Object[] { arguments[0] });<NEW_LINE>}<NEW_LINE>String method = InteropLibrary.getUncached().asString(arguments[0]);<NEW_LINE>TruffleObject params = null;<NEW_LINE>TruffleObject callback = null;<NEW_LINE>if (arguments.length >= 2) {<NEW_LINE>if (!(arguments[1] instanceof TruffleObject)) {<NEW_LINE>throw UnsupportedTypeException.create(new Object[] { arguments[1] });<NEW_LINE>}<NEW_LINE>TruffleObject to = (TruffleObject) arguments[1];<NEW_LINE>if (InteropLibrary.getFactory().getUncached().isExecutable(to)) {<NEW_LINE>callback = to;<NEW_LINE>} else {<NEW_LINE>params = to;<NEW_LINE>}<NEW_LINE>if (callback == null && arguments.length >= 3) {<NEW_LINE>if (!(arguments[2] instanceof TruffleObject)) {<NEW_LINE>throw UnsupportedTypeException.create(new Object[<MASK><NEW_LINE>}<NEW_LINE>callback = (TruffleObject) arguments[2];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>post(method, params, callback);<NEW_LINE>return undefinedProvider.get();<NEW_LINE>}
] { arguments[2] });
658,123
static org.batfish.datamodel.eigrp.EigrpProcess toEigrpProcess(EigrpProcess proc, String vrfName, Configuration c, AsaConfiguration oldConfig) {<NEW_LINE>org.batfish.datamodel.eigrp.EigrpProcess.Builder newProcess = org.batfish.datamodel.eigrp.EigrpProcess.builder();<NEW_LINE>if (proc.getAsn() == null) {<NEW_LINE>oldConfig.getWarnings().redFlag("Invalid EIGRP process");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (firstNonNull(proc.getShutdown(), Boolean.FALSE)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>newProcess.setAsNumber(proc.getAsn());<NEW_LINE>newProcess.setMode(proc.getMode());<NEW_LINE>// TODO set stub process<NEW_LINE>// newProcess.setStub(proc.isStub())<NEW_LINE>// TODO create summary filters<NEW_LINE>// TODO originate default route if configured<NEW_LINE>Ip routerId = proc.getRouterId();<NEW_LINE>if (routerId == null) {<NEW_LINE>routerId = getHighestIp(oldConfig.getInterfaces());<NEW_LINE>if (routerId == Ip.ZERO) {<NEW_LINE>oldConfig.getWarnings().redFlag("No candidates for EIGRP (AS " + proc.getAsn() + ") router-id");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newProcess.setRouterId(routerId).setMetricVersion(EigrpMetricVersion.V1);<NEW_LINE>String redistributionPolicyName = "~EIGRP_EXPORT_POLICY:" + vrfName + ":" + proc.getAsn() + "~";<NEW_LINE>RoutingPolicy redistributionPolicy <MASK><NEW_LINE>c.getRoutingPolicies().put(redistributionPolicyName, redistributionPolicy);<NEW_LINE>newProcess.setRedistributionPolicy(redistributionPolicyName);<NEW_LINE>redistributionPolicy.getStatements().addAll(eigrpRedistributionPoliciesToStatements(proc.getRedistributionPolicies().values(), proc, oldConfig));<NEW_LINE>return newProcess.build();<NEW_LINE>}
= new RoutingPolicy(redistributionPolicyName, c);
71,846
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.set(Position.KEY_INDEX, parser.nextInt(0));<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setValid(true);<NEW_LINE>position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN_MIN));<NEW_LINE>position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN_MIN));<NEW_LINE>position.setTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS));<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0)));<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextInt(0));<NEW_LINE>position.set(Position.KEY_CHARGE, parser<MASK><NEW_LINE>return position;<NEW_LINE>}
.nextInt(0) == 1);
712,448
public void draw() {<NEW_LINE>TabSegment segment = segments.get(segmentIndex);<NEW_LINE>// getAdvance();<NEW_LINE>float advance = segment.layout.getVisibleAdvance();<NEW_LINE>if (bulletChunk != null) {<NEW_LINE>PdfPhrase phrase = pdfProducer.createPhrase();<NEW_LINE>pdfExporter.getPhrase(bulletChunk, bulletText, text, phrase);<NEW_LINE>// + leftPadding<NEW_LINE>phrase.// + leftPadding<NEW_LINE>go(-htmlListIndent - 10 + x + drawPosX + leftOffsetFactor * advance, // - text.getLeadingOffset()<NEW_LINE>pdfExporter.getCurrentPageFormat().getPageHeight() - y - topPadding - verticalAlignOffset + lineHeight - // + leftPadding<NEW_LINE>drawPosY, -10 + x + drawPosX + leftOffsetFactor * advance, // - text.getLeadingOffset()<NEW_LINE>pdfExporter.getCurrentPageFormat().getPageHeight() - y - topPadding - verticalAlignOffset - // + lineHeight//FIXMETAB<NEW_LINE>400 - drawPosY, lineHeight, 0, PdfTextAlignment.RIGHT, TextDirection.LTR);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>pdfExporter.getPhrase(segment.as, segment.text, text, phrase);<NEW_LINE>// + leftPadding<NEW_LINE>phrase.// + leftPadding<NEW_LINE>go(x + drawPosX + leftOffsetFactor * advance, // - text.getLeadingOffset()<NEW_LINE>pdfExporter.getCurrentPageFormat().getPageHeight() - y - topPadding - verticalAlignOffset + lineHeight - // + leftPadding<NEW_LINE>drawPosY, x + drawPosX + advance + rightOffsetFactor * advance, // - text.getLeadingOffset()<NEW_LINE>pdfExporter.getCurrentPageFormat().getPageHeight() - y - topPadding - verticalAlignOffset - // + lineHeight//FIXMETAB<NEW_LINE>400 - // text.getLineSpacingFactor(),// * text.getFont().getSize(),<NEW_LINE>drawPosY, lineHeight, 0, horizontalAlignment == PdfTextAlignment.JUSTIFIED && (!segment.isLastLine || (isLastParagraph && justifyLastLine)) ? PdfTextAlignment.JUSTIFIED_ALL : horizontalAlignment, text.getRunDirectionValue() == RunDirectionEnum.LTR ? TextDirection.LTR : TextDirection.RTL);<NEW_LINE>}
PdfPhrase phrase = pdfProducer.createPhrase();
1,067,035
public static ClientMessage encodeRequest(java.lang.String name, java.util.UUID txnId, long threadId, com.hazelcast.internal.serialization.Data key, com.hazelcast.internal.serialization.Data value) {<NEW_LINE>ClientMessage clientMessage = ClientMessage.createForEncode();<NEW_LINE>clientMessage.setRetryable(false);<NEW_LINE>clientMessage.setOperationName("TransactionalMap.PutIfAbsent");<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);<NEW_LINE>encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);<NEW_LINE>encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);<NEW_LINE>encodeUUID(initialFrame.content, REQUEST_TXN_ID_FIELD_OFFSET, txnId);<NEW_LINE>encodeLong(initialFrame.content, REQUEST_THREAD_ID_FIELD_OFFSET, threadId);<NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>StringCodec.encode(clientMessage, name);<NEW_LINE>DataCodec.encode(clientMessage, key);<NEW_LINE><MASK><NEW_LINE>return clientMessage;<NEW_LINE>}
DataCodec.encode(clientMessage, value);
1,516,277
public boolean command(Room room, String command, Parameters parameters) {<NEW_LINE>String channel = room.getChannel();<NEW_LINE>// Args could be null<NEW_LINE>String parameter = parameters.getArgs();<NEW_LINE>command = StringUtil.toLowerCase(command);<NEW_LINE>if (commands.performCommand(command, room, parameters)) {<NEW_LINE>// Already done if true<NEW_LINE>} else if (c.command(channel, command, parameter, null)) {<NEW_LINE>// Already done if true<NEW_LINE>} else // Has to be tested last, so regular commands with the same name take<NEW_LINE>// precedence<NEW_LINE>if (customCommands.containsCommand(command, room)) {<NEW_LINE>customCommand(room, command, parameters);<NEW_LINE>} else if (command.equals("debug")) {<NEW_LINE>String[] split = parameter.split(" ", 2);<NEW_LINE>String actualCommand = split[0];<NEW_LINE>String actualParamter = null;<NEW_LINE>if (split.length == 2) {<NEW_LINE>actualParamter = split[1];<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else // --------------------<NEW_LINE>// Only for testing<NEW_LINE>if (Chatty.DEBUG || settings.getBoolean("debugCommands")) {<NEW_LINE>testCommands(room, command, parameter);<NEW_LINE>} else // ----------------------<NEW_LINE>{<NEW_LINE>g.printLine(Language.getString("chat.unknownCommand", command));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
testCommands(room, actualCommand, actualParamter);
1,698,022
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {<NEW_LINE>this.exprs = exprs[0] instanceof ExpressionList ? (ExpressionList<?>) exprs[0] : new ExpressionList<>(new Expression<?>[] { exprs[0] }, Object.class, false);<NEW_LINE>this.recursive = matchedPattern == 1;<NEW_LINE>for (Expression<?> expr : this.exprs.getExpressions()) {<NEW_LINE>if (expr instanceof Literal<?>) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (expr.isSingle()) {<NEW_LINE>Skript.error("'" + expr.toString<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (recursive && !(expr instanceof Variable<?>)) {<NEW_LINE>Skript.error("Getting the recursive size of a list only applies to variables, thus the '" + expr.toString(null, false) + "' expression is useless.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(null, false) + "' can only ever have one value at most, thus the 'amount of ...' expression is useless. Use '... exists' instead to find out whether the expression has a value.");
263,161
public static void hashClientMetaTypeSecret(@Sensitive JsonObject clientMetadataAsJson, String clientId, boolean updateXORtoHash) {<NEW_LINE>if (clientMetadataAsJson != null && clientMetadataAsJson.has(OAuth20Constants.CLIENT_SECRET)) {<NEW_LINE>String clientSecret = clientMetadataAsJson.get(<MASK><NEW_LINE>if (clientSecret != null && !clientSecret.isEmpty()) {<NEW_LINE>clientMetadataAsJson.addProperty(OAuth20Constants.CLIENT_SECRET, hashSecret(clientSecret, clientId, updateXORtoHash, clientMetadataAsJson.get(OAuth20Constants.SALT).getAsString(), clientMetadataAsJson.get(OAuth20Constants.HASH_ALGORITHM).getAsString(), clientMetadataAsJson.get(OAuth20Constants.HASH_ITERATIONS).getAsInt(), clientMetadataAsJson.get(OAuth20Constants.HASH_LENGTH).getAsInt()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
OAuth20Constants.CLIENT_SECRET).getAsString();
1,112,671
private List<NameValueCountPair> listActivityName(Business business, EffectivePerson effectivePerson, Application application) throws Exception {<NEW_LINE>List<NameValueCountPair> wos = new ArrayList<>();<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Work.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Work> root = cq.from(Work.class);<NEW_LINE>Predicate p = cb.equal(root.get(Work_.application<MASK><NEW_LINE>p = cb.and(p, cb.equal(root.get(Work_.creatorPerson), effectivePerson.getDistinguishedName()));<NEW_LINE>cq.select(root.get(Work_.activityName)).where(p);<NEW_LINE>List<String> list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>for (String str : list) {<NEW_LINE>NameValueCountPair o = new NameValueCountPair();<NEW_LINE>o.setValue(str);<NEW_LINE>o.setName(str);<NEW_LINE>wos.add(o);<NEW_LINE>}<NEW_LINE>SortTools.asc(wos, "name");<NEW_LINE>return wos;<NEW_LINE>}
), application.getId());
1,232,562
PBytes doit(ZLibCompObject.JavaZlibCompObject self, int mode, PythonObjectFactory factory) {<NEW_LINE>byte[] result = new byte[DEF_BUF_SIZE];<NEW_LINE>Deflater <MASK><NEW_LINE>int deflateMode = mode;<NEW_LINE>if (mode == Z_FINISH) {<NEW_LINE>deflateMode = Z_SYNC_FLUSH;<NEW_LINE>deflater.finish();<NEW_LINE>}<NEW_LINE>int bytesWritten = result.length;<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>while (bytesWritten == result.length) {<NEW_LINE>bytesWritten = deflater.deflate(result, 0, result.length, deflateMode);<NEW_LINE>baos.write(result, 0, bytesWritten);<NEW_LINE>}<NEW_LINE>if (mode == Z_FINISH) {<NEW_LINE>deflater.end();<NEW_LINE>self.setUninitialized();<NEW_LINE>}<NEW_LINE>return factory.createBytes(baos.toByteArray());<NEW_LINE>}
deflater = (Deflater) self.stream;
1,455,791
final ListViolationEventsResult executeListViolationEvents(ListViolationEventsRequest listViolationEventsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listViolationEventsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListViolationEventsRequest> request = null;<NEW_LINE>Response<ListViolationEventsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListViolationEventsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listViolationEventsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListViolationEvents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListViolationEventsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListViolationEventsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,688,000
private static float draw(final PGraphics pGraphic, final String pText, final float pArcRadius, final float pTheta, final EDisplay pDisplay, final EReverseDirection pReverseDrawDirection) {<NEW_LINE>assert pGraphic != null;<NEW_LINE>assert pText != null;<NEW_LINE>assert pArcRadius >= 0;<NEW_LINE>// assert pTheta >= 0f && pTheta <= PConstants.TWO_PI;<NEW_LINE>assert pDisplay != null;<NEW_LINE>assert pReverseDrawDirection != null;<NEW_LINE>final String text = pText;<NEW_LINE>// We must keep track of our position along the curve.<NEW_LINE>float arclength = 0;<NEW_LINE>// For every box.<NEW_LINE>for (int i = 0; i < text.length(); i++) {<NEW_LINE>// Instead of a constant width, we check the width of each character.<NEW_LINE>final char currentChar = text.charAt(i);<NEW_LINE>// Work around.<NEW_LINE>final float w = pGraphic.textWidth(currentChar) + 1;<NEW_LINE>// Each box is centered so we move half the width.<NEW_LINE>arclength += currentChar <MASK><NEW_LINE>// Angle in radians is the arclength divided by the radius.<NEW_LINE>// Starting on the left side of the circle by adding PI.<NEW_LINE>final float theta = pReverseDrawDirection == EReverseDirection.YES ? pTheta - arclength / pArcRadius : pTheta + arclength / pArcRadius;<NEW_LINE>pGraphic.pushMatrix();<NEW_LINE>// Polar to cartesian coordinate conversion.<NEW_LINE>pGraphic.translate(pArcRadius * PApplet.cos(theta), pArcRadius * PApplet.sin(theta));<NEW_LINE>// Rotate the box.<NEW_LINE>if (pReverseDrawDirection == EReverseDirection.YES) {<NEW_LINE>// rotation is offset by 90<NEW_LINE>pGraphic.rotate(theta - PConstants.PI / 2f);<NEW_LINE>// degrees<NEW_LINE>} else {<NEW_LINE>// rotation is offset by 90<NEW_LINE>pGraphic.rotate(theta + PConstants.PI / 2f);<NEW_LINE>// degrees<NEW_LINE>}<NEW_LINE>if (pDisplay == EDisplay.YES) {<NEW_LINE>pGraphic.text(currentChar, 0, 0);<NEW_LINE>}<NEW_LINE>pGraphic.popMatrix();<NEW_LINE>// Move halfway again.<NEW_LINE>arclength += w / 2f;<NEW_LINE>}<NEW_LINE>pGraphic.noFill();<NEW_LINE>return pTheta + arclength / pArcRadius;<NEW_LINE>}
!= 'i' ? w * 0.5f : w;
164,762
protected void addRowTable() {<NEW_LINE>SingleRowTabTable table = new SingleRowTabTable(tabModel);<NEW_LINE>table.getSelectionModel().setSelectionInterval(0, 0);<NEW_LINE>table.getColumnModel().getSelectionModel().setSelectionInterval(0, 0);<NEW_LINE>table.addMouseWheelListener(this);<NEW_LINE>table.<MASK><NEW_LINE>table.getColumnModel().getSelectionModel().addListSelectionListener(this);<NEW_LINE>table.addMouseListener(controller);<NEW_LINE>table.addMouseListener(closeHandler);<NEW_LINE>table.addMouseMotionListener(closeHandler);<NEW_LINE>rowTables.add(table);<NEW_LINE>if (rowTables.size() == 1)<NEW_LINE>table.setBorder(TabTableUI.createTabBorder(table, tabsLocation));<NEW_LINE>rowPanel.add(table, new GridBagConstraints(0, rowTables.size() - 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>}
getSelectionModel().addListSelectionListener(this);
507,338
public IndexDescriptor completeConfiguration(IndexDescriptor index) {<NEW_LINE>EnumMap<IndexSlot, IndexDescriptor> descriptors = new EnumMap<>(IndexSlot.class);<NEW_LINE>EnumMap<IndexSlot, IndexCapability> capabilities = new <MASK><NEW_LINE>for (IndexSlot slot : IndexSlot.values()) {<NEW_LINE>IndexDescriptor result = providers.select(slot).completeConfiguration(index);<NEW_LINE>descriptors.put(slot, result);<NEW_LINE>capabilities.put(slot, result.getCapability());<NEW_LINE>}<NEW_LINE>IndexConfig config = index.getIndexConfig();<NEW_LINE>for (IndexDescriptor result : descriptors.values()) {<NEW_LINE>IndexConfig resultConfig = result.getIndexConfig();<NEW_LINE>for (Pair<String, Value> entry : resultConfig.entries()) {<NEW_LINE>config = config.withIfAbsent(entry.getOne(), entry.getTwo());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>index = index.withIndexConfig(config);<NEW_LINE>if (index.getCapability().equals(IndexCapability.NO_CAPABILITY)) {<NEW_LINE>index = index.withIndexCapability(new FusionIndexCapability(slotSelector, new InstanceSelector<>(capabilities)));<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>}
EnumMap<>(IndexSlot.class);
29,343
public void marshall(SplunkDestinationUpdate splunkDestinationUpdate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (splunkDestinationUpdate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getHECEndpoint(), HECENDPOINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getHECEndpointType(), HECENDPOINTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getHECToken(), HECTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getRetryOptions(), RETRYOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getS3BackupMode(), S3BACKUPMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getS3Update(), S3UPDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getProcessingConfiguration(), PROCESSINGCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(splunkDestinationUpdate.getCloudWatchLoggingOptions(), CLOUDWATCHLOGGINGOPTIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
splunkDestinationUpdate.getHECAcknowledgmentTimeoutInSeconds(), HECACKNOWLEDGMENTTIMEOUTINSECONDS_BINDING);
241,456
private void queryMultiDumpGraph(UAVHttpMessage data) {<NEW_LINE>String ipport = data.getRequest("ipport");<NEW_LINE>String timesStr = data.getRequest("times");<NEW_LINE>String threadIdsStr = data.getRequest("threadIds");<NEW_LINE>List<String> times = JSONHelper.toObjectArray(timesStr, String.class);<NEW_LINE>List<String> threadIds = JSONHelper.toObjectArray(threadIdsStr, String.class);<NEW_LINE>List<List<Map<String, Object>>> records = new ArrayList<>();<NEW_LINE>for (String time : times) {<NEW_LINE>long timestamp = DataConvertHelper.toLong(time, -1L);<NEW_LINE>// build query builder<NEW_LINE><MASK><NEW_LINE>queryBuilder.must(QueryBuilders.rangeQuery("time").gte(timestamp).lte(timestamp));<NEW_LINE>queryBuilder.must(QueryBuilders.termQuery("ipport", ipport));<NEW_LINE>SearchResponse sr = query(data, queryBuilder, null, buildSorts(data));<NEW_LINE>List<Map<String, Object>> record = getRecords(sr);<NEW_LINE>records.add(record);<NEW_LINE>}<NEW_LINE>ThreadAnalyser ta = (ThreadAnalyser) getConfigManager().getComponent(feature, "ThreadAnalyser");<NEW_LINE>Map<String, Object> rs = ta.queryMutilDumpGraph(threadIds, records);<NEW_LINE>data.putResponse("rs", JSONHelper.toString(rs));<NEW_LINE>}
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
188,151
public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select symbol as mySymbol from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by mySymbol";<NEW_LINE>SupportUpdateListener listener = new SupportUpdateListener();<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>SymbolPricesVolumes spv = new SymbolPricesVolumes();<NEW_LINE>orderValuesBySymbol(spv);<NEW_LINE>assertValues(env, spv.symbols, "mySymbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "mySymbol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol as mySymbol, price as myPrice from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by myPrice";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "mySymbol");<NEW_LINE>assertValues(env, spv.prices, "myPrice");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "mySymbol", "myPrice" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol, price as myPrice from " + "SupportMarketDataBean#length(10) " + "output every 6 events " + "order by (myPrice * 6) + 5, price";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "myPrice" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol, 1+volume*23 as myVol from " + "SupportMarketDataBean#length(10) " + "output every 6 events " + "order by (price * 6) + 5, price, myVol";<NEW_LINE><MASK><NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "myVol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>}
createAndSend(env, epl, milestone);
853,395
public ContextQuery toContextQuery(CompletionQuery query, Map<String, List<ContextMapping.InternalQueryContext>> queryContexts) {<NEW_LINE>ContextQuery typedContextQuery = new ContextQuery(query);<NEW_LINE>boolean hasContext = false;<NEW_LINE>if (queryContexts.isEmpty() == false) {<NEW_LINE>CharsRefBuilder scratch = new CharsRefBuilder();<NEW_LINE>scratch.grow(1);<NEW_LINE>for (int typeId = 0; typeId < contextMappings.size(); typeId++) {<NEW_LINE>scratch.setCharAt(0, (char) typeId);<NEW_LINE>scratch.setLength(1);<NEW_LINE>ContextMapping mapping = contextMappings.get(typeId);<NEW_LINE>List<ContextMapping.InternalQueryContext> internalQueryContext = queryContexts.get(mapping.name());<NEW_LINE>if (internalQueryContext != null) {<NEW_LINE>for (ContextMapping.InternalQueryContext context : internalQueryContext) {<NEW_LINE>scratch.append(context.context);<NEW_LINE>typedContextQuery.addContext(scratch.toCharsRef(), context<MASK><NEW_LINE>scratch.setLength(1);<NEW_LINE>hasContext = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasContext == false) {<NEW_LINE>DEPRECATION_LOGGER.deprecated("The ability to query with no context on a context enabled completion field is deprecated " + "and will be removed in the next major release.");<NEW_LINE>}<NEW_LINE>return typedContextQuery;<NEW_LINE>}
.boost, !context.isPrefix);
481,198
private View createIconItemView(@NonNull LayoutInflater inflater, @NonNull String iconName) {<NEW_LINE>View iconItemView = inflater.inflate(R.layout.point_editor_button, iconsSelector, false);<NEW_LINE>int iconId = RenderingIcons.getBigIconResourceId(iconName);<NEW_LINE>int validIconId = iconId != 0 ? iconId : DEFAULT_UI_ICON_ID;<NEW_LINE>iconItemView.setTag(validIconId);<NEW_LINE>ImageView icon = iconItemView.<MASK><NEW_LINE>AndroidUiHelper.updateVisibility(icon, true);<NEW_LINE>setUnselectedIconColor(icon, validIconId);<NEW_LINE>ImageView backgroundCircle = iconItemView.findViewById(R.id.background);<NEW_LINE>setUnselectedBackground(backgroundCircle);<NEW_LINE>backgroundCircle.setOnClickListener(v -> reselectIcon(validIconId, true));<NEW_LINE>ImageView outline = iconItemView.findViewById(R.id.outline);<NEW_LINE>int outlineColorId = ColorUtilities.getStrokedButtonsOutlineColorId(nightMode);<NEW_LINE>outline.setImageDrawable(getColoredIcon(R.drawable.bg_point_circle_contour, outlineColorId));<NEW_LINE>return iconItemView;<NEW_LINE>}
findViewById(R.id.icon);
1,694,718
private void makeVars() {<NEW_LINE>SourceInfo info = jsProgram.createSourceInfoSynthetic(getClass());<NEW_LINE>JsVar stackVar = new JsVar(info, stack);<NEW_LINE>stackVar.setInitExpr(new JsArrayLiteral(info));<NEW_LINE>JsVar stackDepthVar = new JsVar(info, stackDepth);<NEW_LINE>stackDepthVar.setInitExpr(new JsNumberLiteral(info, (-1)));<NEW_LINE>JsVar lineNumbersVar = new JsVar(info, lineNumbers);<NEW_LINE>lineNumbersVar.setInitExpr(new JsArrayLiteral(info));<NEW_LINE>JsVar tmpVar = new JsVar(info, tmp);<NEW_LINE>JsVars vars;<NEW_LINE>JsStatement first = jsProgram.getGlobalBlock().getStatements().get(0);<NEW_LINE>if (first instanceof JsVars) {<NEW_LINE>vars = (JsVars) first;<NEW_LINE>} else {<NEW_LINE>vars = new JsVars(info);<NEW_LINE>jsProgram.getGlobalBlock().getStatements(<MASK><NEW_LINE>}<NEW_LINE>vars.add(stackVar);<NEW_LINE>vars.add(stackDepthVar);<NEW_LINE>vars.add(lineNumbersVar);<NEW_LINE>vars.add(tmpVar);<NEW_LINE>}
).add(0, vars);
233,699
public Object lookup(Name inName) throws NamingException {<NEW_LINE>NameUtil nameUtil = new NameUtil(inName);<NEW_LINE>Object toReturn = null;<NEW_LINE>// if there wasn't a name to lookup return a Context<NEW_LINE>if (nameUtil.getStringNameWithoutPrefix().equals(""))<NEW_LINE>return new JavaURLContext(nameUtil.getName(), this);<NEW_LINE>// loop through the helper services looking for a non-null result<NEW_LINE>for (Iterator<JavaColonNamingHelper> it = helperServices.getServices(); it.hasNext(); ) {<NEW_LINE>JavaColonNamingHelper helperService = it.next();<NEW_LINE>toReturn = helperService.getObjectInstance(nameUtil.getNamespace(<MASK><NEW_LINE>if (toReturn != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (toReturn != null) {<NEW_LINE>// return the resource asked for<NEW_LINE>return toReturn;<NEW_LINE>}<NEW_LINE>boolean hasPrefix = false;<NEW_LINE>// loop through the helper services to know whether any object instance's name<NEW_LINE>// is prefixed with the name specified<NEW_LINE>for (Iterator<JavaColonNamingHelper> it = helperServices.getServices(); it.hasNext(); ) {<NEW_LINE>JavaColonNamingHelper helperService = it.next();<NEW_LINE>hasPrefix = helperService.hasObjectWithPrefix(nameUtil.getNamespace(), nameUtil.getNameInContext());<NEW_LINE>if (hasPrefix) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasPrefix) {<NEW_LINE>throw new NameNotFoundException(NameNotFoundException.class.getName() + ": " + nameUtil.getName().toString());<NEW_LINE>}<NEW_LINE>return new JavaURLContext(nameUtil.getName(), this);<NEW_LINE>}
), nameUtil.getNameInContext());
1,267,909
private MessageType buildParquetSchema(final String group) throws SerialisationException {<NEW_LINE>SchemaElementDefinition groupGafferSchema;<NEW_LINE>final boolean isEntity = gafferSchema.getEntityGroups().contains(group);<NEW_LINE>final StringBuilder schemaString = new StringBuilder("message Element {\n");<NEW_LINE><MASK><NEW_LINE>// Check that the vertex does not get stored as nested data<NEW_LINE>if (serialiser instanceof ParquetSerialiser && ((ParquetSerialiser) serialiser).getParquetSchema("test").contains(" group ")) {<NEW_LINE>throw new SerialisationException("Can not have a vertex that is serialised as nested data as it can not be indexed");<NEW_LINE>}<NEW_LINE>if (isEntity) {<NEW_LINE>groupGafferSchema = gafferSchema.getEntity(group);<NEW_LINE>schemaString.append(convertColumnSerialiserToParquetColumns(serialiser, ParquetStore.VERTEX)).append("\n");<NEW_LINE>addGroupColumnToSerialiser(group, ParquetStore.VERTEX, serialiser);<NEW_LINE>} else {<NEW_LINE>groupGafferSchema = gafferSchema.getEdge(group);<NEW_LINE>schemaString.append(convertColumnSerialiserToParquetColumns(serialiser, ParquetStore.SOURCE)).append("\n");<NEW_LINE>addGroupColumnToSerialiser(group, ParquetStore.SOURCE, serialiser);<NEW_LINE>schemaString.append(convertColumnSerialiserToParquetColumns(serialiser, ParquetStore.DESTINATION)).append("\n");<NEW_LINE>addGroupColumnToSerialiser(group, ParquetStore.DESTINATION, serialiser);<NEW_LINE>addGroupColumnToSerialiser(group, ParquetStore.DIRECTED, BooleanParquetSerialiser.class.getCanonicalName());<NEW_LINE>schemaString.append(convertColumnSerialiserToParquetColumns(getSerialiser(BooleanParquetSerialiser.class.getCanonicalName()), ParquetStore.DIRECTED)).append("\n");<NEW_LINE>}<NEW_LINE>Map<String, String> propertyMap = groupGafferSchema.getPropertyMap();<NEW_LINE>for (final Map.Entry<String, String> entry : propertyMap.entrySet()) {<NEW_LINE>if (entry.getKey().contains("_") || entry.getKey().contains(".")) {<NEW_LINE>throw new SchemaException("The ParquetStore does not support properties which contain the characters '_' or '.'");<NEW_LINE>}<NEW_LINE>final TypeDefinition type = gafferSchema.getType(entry.getValue());<NEW_LINE>addGroupColumnToSerialiser(group, entry.getKey(), type.getSerialiserClass());<NEW_LINE>schemaString.append(convertColumnSerialiserToParquetColumns(getSerialiser(type.getSerialiserClass()), entry.getKey())).append("\n");<NEW_LINE>}<NEW_LINE>schemaString.append("}");<NEW_LINE>String parquetSchemaString = schemaString.toString();<NEW_LINE>final MessageType parquetSchema = MessageTypeParser.parseMessageType(parquetSchemaString);<NEW_LINE>LOGGER.debug("Generated Parquet schema: " + parquetSchemaString);<NEW_LINE>return parquetSchema;<NEW_LINE>}
Serialiser serialiser = gafferSchema.getVertexSerialiser();
660,494
public S3DestinationConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>S3DestinationConfiguration s3DestinationConfiguration = new S3DestinationConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("bucketName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3DestinationConfiguration.setBucketName(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 s3DestinationConfiguration;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
831,821
public void onSelectionChanged() {<NEW_LINE>super.onSelectionChanged();<NEW_LINE>selectedRows.clear();<NEW_LINE>if (tracker.hasSelection()) {<NEW_LINE>final Iterator<TableViewRowProxy> i = tracker.getSelection().iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>final TableViewRowProxy row = i.next();<NEW_LINE>if (row.isPlaceholder()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final KrollDict selectedRow = new KrollDict();<NEW_LINE>selectedRow.put(TiC.PROPERTY_INDEX, row.index);<NEW_LINE>selectedRow.put(TiC.EVENT_PROPERTY_ROW, row);<NEW_LINE>selectedRow.put(TiC.PROPERTY_ROW_DATA, row.getProperties());<NEW_LINE>if (getParent() instanceof TableViewSectionProxy) {<NEW_LINE>selectedRow.put(TiC.PROPERTY_SECTION, getParent());<NEW_LINE>}<NEW_LINE>selectedRows.add(selectedRow);<NEW_LINE>if (!allowsMultipleSelection) {<NEW_LINE>row.fireEvent(TiC.EVENT_CLICK, null);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allowsMultipleSelection) {<NEW_LINE><MASK><NEW_LINE>data.put(TiC.PROPERTY_SELECTED_ROWS, selectedRows.toArray(new KrollDict[0]));<NEW_LINE>data.put(TiC.PROPERTY_STARTING_ROW, selectedRows.isEmpty() ? null : selectedRows.get(0));<NEW_LINE>proxy.fireEvent(TiC.EVENT_ROWS_SELECTED, data);<NEW_LINE>}<NEW_LINE>}
final KrollDict data = new KrollDict();
1,521,269
// Allowed Skew is deprecated for users, but must be respected<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>private void checkTimestamp(Instant timestamp) {<NEW_LINE>Instant lowerBound;<NEW_LINE>try {<NEW_LINE>lowerBound = timestamp().<MASK><NEW_LINE>} catch (ArithmeticException e) {<NEW_LINE>lowerBound = BoundedWindow.TIMESTAMP_MIN_VALUE;<NEW_LINE>}<NEW_LINE>if (timestamp.isBefore(lowerBound) || timestamp.isAfter(BoundedWindow.TIMESTAMP_MAX_VALUE)) {<NEW_LINE>throw new IllegalArgumentException(String.format("Cannot output with timestamp %s. Output timestamps must be no earlier than the " + "output timestamp of the timer (%s) minus the allowed skew (%s) and no " + "later than %s. See the DoFn#getAllowedTimestampSkew() Javadoc for details " + "on changing the allowed skew.", timestamp, timestamp(), fn.getAllowedTimestampSkew().getMillis() >= Integer.MAX_VALUE ? fn.getAllowedTimestampSkew() : PeriodFormat.getDefault().print(fn.getAllowedTimestampSkew().toPeriod()), BoundedWindow.TIMESTAMP_MAX_VALUE));<NEW_LINE>}<NEW_LINE>}
minus(fn.getAllowedTimestampSkew());
650,101
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {<NEW_LINE>final String failureUrlParam = StringUtil.cleanseUrlString(request.getParameter("failureUrl"));<NEW_LINE>String successUrlParam = StringUtil.cleanseUrlString(request.getParameter("successUrl"));<NEW_LINE>String failureUrl = StringUtils.trimToNull(failureUrlParam);<NEW_LINE>// Verify that the url passed in is a servlet path and not a link redirecting away from the webapp.<NEW_LINE>failureUrl = validateUrlParam(failureUrl);<NEW_LINE>successUrlParam = validateUrlParam(successUrlParam);<NEW_LINE>// check if the implementor has a particular view mapped for this exception<NEW_LINE>if (failureUrl == null) {<NEW_LINE>final String exceptionClassname = exception<MASK><NEW_LINE>failureUrl = StringUtils.trimToNull(failureUrlMap.get(exceptionClassname));<NEW_LINE>}<NEW_LINE>if (failureUrl == null) {<NEW_LINE>failureUrl = StringUtils.trimToNull(defaultFailureUrl);<NEW_LINE>}<NEW_LINE>if (failureUrl != null) {<NEW_LINE>if (StringUtils.isNotEmpty(successUrlParam)) {<NEW_LINE>if (!failureUrl.contains("?")) {<NEW_LINE>failureUrl += "?successUrl=" + successUrlParam;<NEW_LINE>} else {<NEW_LINE>failureUrl += "&successUrl=" + successUrlParam;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>saveException(request, exception);<NEW_LINE>getRedirectStrategy().sendRedirect(request, response, failureUrl);<NEW_LINE>} else {<NEW_LINE>super.onAuthenticationFailure(request, response, exception);<NEW_LINE>}<NEW_LINE>}
.getClass().getName();
864,664
public static boolean update(Map<String, Object> source, Map<String, Object> changes, boolean checkUpdatesAreUnequal) {<NEW_LINE>boolean modified = false;<NEW_LINE>for (Map.Entry<String, Object> changesEntry : changes.entrySet()) {<NEW_LINE>if (!source.containsKey(changesEntry.getKey())) {<NEW_LINE>// safe to copy, change does not exist in source<NEW_LINE>source.put(changesEntry.getKey(), changesEntry.getValue());<NEW_LINE>modified = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Object old = source.get(changesEntry.getKey());<NEW_LINE>if (old instanceof Map && changesEntry.getValue() instanceof Map) {<NEW_LINE>// recursive merge maps<NEW_LINE>modified |= update((Map<String, Object>) source.get(changesEntry.getKey()), (Map<String, Object>) changesEntry.getValue(), checkUpdatesAreUnequal && !modified);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// update the field<NEW_LINE>source.put(changesEntry.getKey(), changesEntry.getValue());<NEW_LINE>if (modified) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!checkUpdatesAreUnequal) {<NEW_LINE>modified = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>modified = !Objects.equals(<MASK><NEW_LINE>}<NEW_LINE>return modified;<NEW_LINE>}
old, changesEntry.getValue());
1,324,328
private static void messageForwardingViaEmail(final Switchboard sb, final MessageBoard.entry msgEntry) {<NEW_LINE>try {<NEW_LINE>if (!sb.getConfigBool("msgForwardingEnabled", false)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// get the recipient address<NEW_LINE>final String sendMailTo = sb.getConfig("msgForwardingTo", "root@localhost").trim();<NEW_LINE>// get the sendmail configuration<NEW_LINE>final String sendMailStr = sb.getConfig("msgForwardingCmd", "/usr/bin/sendmail") + " " + sendMailTo;<NEW_LINE>final String[] sendMail = CommonPattern.SPACE.split(sendMailStr.trim());<NEW_LINE>// build the message text<NEW_LINE>final StringBuilder emailTxt = new StringBuilder();<NEW_LINE>emailTxt.append("To: ").append(sendMailTo).append("\nFrom: ").append("yacy@").append(sb.peers.mySeed().getName()).append("\nSubject: [YaCy] ").append(msgEntry.subject().replace('\n', ' ')).append("\nDate: ").append(msgEntry.date()).append("\n").append("\nMessage from: ").append(msgEntry.author()).append("/").append(msgEntry.authorHash()).append("\nMessage to: ").append(msgEntry.recipient()).append("/").append(msgEntry.recipientHash()).append("\nCategory: ").append(msgEntry.category()).append("\n===================================================================\n").append(UTF8.String(msgEntry.message()));<NEW_LINE>final Process process = Runtime.getRuntime().exec(sendMail);<NEW_LINE>final PrintWriter email = new PrintWriter(process.getOutputStream());<NEW_LINE>email.print(new String(emailTxt));<NEW_LINE>email.close();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Network.<MASK><NEW_LINE>}<NEW_LINE>}
log.warn("message: message forwarding via email failed. ", e);
645,378
public static Transaction retrieveTransaction(final Driver driver, final DatabaseSelection targetDatabase, final UserSelection asUser) {<NEW_LINE>if (!TransactionSynchronizationManager.isSynchronizationActive()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Check whether we have a transaction managed by a Neo4j transaction manager<NEW_LINE>Neo4jTransactionHolder connectionHolder = (Neo4jTransactionHolder) TransactionSynchronizationManager.getResource(driver);<NEW_LINE>if (connectionHolder != null) {<NEW_LINE>Transaction optionalOngoingTransaction = connectionHolder.getTransaction(targetDatabase, asUser);<NEW_LINE>if (optionalOngoingTransaction != null) {<NEW_LINE>return optionalOngoingTransaction;<NEW_LINE>}<NEW_LINE>throw new IllegalStateException(Neo4jTransactionUtils.formatOngoingTxInAnotherDbErrorMessage(connectionHolder.getDatabaseSelection(), targetDatabase, connectionHolder.getUserSelection(), asUser));<NEW_LINE>}<NEW_LINE>// Otherwise we open a session and synchronize it.<NEW_LINE>Session session = driver.session(Neo4jTransactionUtils.defaultSessionConfig(targetDatabase, asUser));<NEW_LINE>Transaction transaction = session.beginTransaction(TransactionConfig.empty());<NEW_LINE>// Manually create a new synchronization<NEW_LINE>connectionHolder = new Neo4jTransactionHolder(new Neo4jTransactionContext(targetDatabase, asUser), session, transaction);<NEW_LINE>connectionHolder.setSynchronizedWithTransaction(true);<NEW_LINE>TransactionSynchronizationManager.registerSynchronization(<MASK><NEW_LINE>TransactionSynchronizationManager.bindResource(driver, connectionHolder);<NEW_LINE>return connectionHolder.getTransaction(targetDatabase, asUser);<NEW_LINE>}
new Neo4jSessionSynchronization(connectionHolder, driver));
934,798
public static int parseUnsignedIntAttribute(CharSequence charSeq) {<NEW_LINE>String value = charSeq.toString();<NEW_LINE>long bits;<NEW_LINE>int index = 0;<NEW_LINE><MASK><NEW_LINE>int base = 10;<NEW_LINE>if ('0' == value.charAt(index)) {<NEW_LINE>// Quick check for zero by itself<NEW_LINE>if (index == (len - 1)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>char c = value.charAt(index + 1);<NEW_LINE>if ('x' == c || 'X' == c) {<NEW_LINE>// check for hex<NEW_LINE>index += 2;<NEW_LINE>base = 16;<NEW_LINE>} else {<NEW_LINE>// check for octal<NEW_LINE>index++;<NEW_LINE>base = 8;<NEW_LINE>}<NEW_LINE>} else if ('#' == value.charAt(index)) {<NEW_LINE>index++;<NEW_LINE>base = 16;<NEW_LINE>}<NEW_LINE>return (int) Long.parseLong(value.substring(index), base);<NEW_LINE>}
int len = value.length();
244,018
protected SentryPartInstanceEntity createSentryPartInstanceEntity(EntityWithSentryPartInstances entityWithSentryPartInstances, Sentry sentry, SentryOnPart sentryOnPart, SentryIfPart sentryIfPart) {<NEW_LINE>SentryPartInstanceEntityManager sentryPartInstanceEntityManager = CommandContextUtil.getSentryPartInstanceEntityManager(commandContext);<NEW_LINE>SentryPartInstanceEntity sentryPartInstanceEntity = sentryPartInstanceEntityManager.create();<NEW_LINE>sentryPartInstanceEntity.setTimeStamp(CommandContextUtil.getCmmnEngineConfiguration(commandContext).getClock().getCurrentTime());<NEW_LINE>if (sentryOnPart != null) {<NEW_LINE>sentryPartInstanceEntity.setOnPartId(sentryOnPart.getId());<NEW_LINE>} else if (sentryIfPart != null) {<NEW_LINE>sentryPartInstanceEntity.setIfPartId(sentryIfPart.getId());<NEW_LINE>}<NEW_LINE>if (entityWithSentryPartInstances instanceof CaseInstanceEntity) {<NEW_LINE>sentryPartInstanceEntity.setCaseInstanceId(((CaseInstanceEntity<MASK><NEW_LINE>sentryPartInstanceEntity.setCaseDefinitionId(((CaseInstanceEntity) entityWithSentryPartInstances).getCaseDefinitionId());<NEW_LINE>} else if (entityWithSentryPartInstances instanceof PlanItemInstanceEntity) {<NEW_LINE>PlanItemInstanceEntity planItemInstanceEntity = (PlanItemInstanceEntity) entityWithSentryPartInstances;<NEW_LINE>sentryPartInstanceEntity.setCaseInstanceId(planItemInstanceEntity.getCaseInstanceId());<NEW_LINE>sentryPartInstanceEntity.setCaseDefinitionId(planItemInstanceEntity.getCaseDefinitionId());<NEW_LINE>sentryPartInstanceEntity.setPlanItemInstanceId(planItemInstanceEntity.getId());<NEW_LINE>// Update relationship count<NEW_LINE>if (sentry.isDefaultTriggerMode() && entityWithSentryPartInstances instanceof CountingPlanItemInstanceEntity) {<NEW_LINE>CountingPlanItemInstanceEntity countingPlanItemInstanceEntity = (CountingPlanItemInstanceEntity) planItemInstanceEntity;<NEW_LINE>countingPlanItemInstanceEntity.setSentryPartInstanceCount(countingPlanItemInstanceEntity.getSentryPartInstanceCount() + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// In the default triggerMode satisfied parts are remembered for subsequent evaluation cycles.<NEW_LINE>// In the onEvent triggerMode, they are stored for the duration of the transaction (which is the same as one evaluation cycle) but not inserted.<NEW_LINE>if (sentry.isDefaultTriggerMode()) {<NEW_LINE>sentryPartInstanceEntityManager.insert(sentryPartInstanceEntity);<NEW_LINE>}<NEW_LINE>entityWithSentryPartInstances.getSatisfiedSentryPartInstances().add(sentryPartInstanceEntity);<NEW_LINE>return sentryPartInstanceEntity;<NEW_LINE>}
) entityWithSentryPartInstances).getId());
3,201
private TimeLockServices createNewClient(String namespace, boolean ignoreDisabled) {<NEW_LINE>Preconditions.checkArgument(IS_VALID_NAME.test(namespace), "Invalid namespace", SafeArg<MASK><NEW_LINE>Preconditions.checkArgument(!namespace.equals(PaxosTimeLockConstants.LEADER_ELECTION_NAMESPACE), "The client name is reserved for the leader election service, and may not be used.", SafeArg.of("clientName", PaxosTimeLockConstants.LEADER_ELECTION_NAMESPACE));<NEW_LINE>Preconditions.checkArgument(ignoreDisabled || disabledNamespaces.isEnabled(Namespace.of(namespace)), "Cannot create a client for namespace because the namespace has been explicitly disabled.", SafeArg.of("namespace", namespace));<NEW_LINE>if (getNumberOfActiveClients() >= getMaxNumberOfClients()) {<NEW_LINE>log.error("Unable to create timelock services for client {}, as it would exceed the maximum number of " + "allowed clients ({}). If this is intentional, the maximum number of clients can be " + "increased via the maximum-number-of-clients runtime config property.", SafeArg.of("client", namespace), SafeArg.of("maxNumberOfClients", getMaxNumberOfClients()));<NEW_LINE>throw new SafeIllegalStateException("Maximum number of clients exceeded");<NEW_LINE>}<NEW_LINE>TimeLockServices services = factory.apply(namespace);<NEW_LINE>log.info("Successfully created services for a new TimeLock client {}.", SafeArg.of("client", namespace));<NEW_LINE>return services;<NEW_LINE>}
.of("namespace", namespace));
1,536,222
/*<NEW_LINE>* this http interface is used to return configuration information requested by other fe.<NEW_LINE>*/<NEW_LINE>@RequestMapping(path = "/config", method = RequestMethod.GET)<NEW_LINE>public Object config(HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>executeCheckPassword(request, response);<NEW_LINE>checkGlobalAuth(ConnectContext.get().getCurrentUserIdentity(), PrivPredicate.ADMIN);<NEW_LINE>List<List<String>> configs = ConfigBase.getConfigInfo(null);<NEW_LINE>// Sort all configs by config key.<NEW_LINE>configs.sort(Comparator.comparing(o -> o.get(0)));<NEW_LINE>// reorder the fields<NEW_LINE>List<List<String><MASK><NEW_LINE>for (List<String> config : configs) {<NEW_LINE>List<String> list = Lists.newArrayList();<NEW_LINE>list.add(config.get(0));<NEW_LINE>list.add(config.get(2));<NEW_LINE>list.add(config.get(4));<NEW_LINE>list.add(config.get(1));<NEW_LINE>list.add(config.get(3));<NEW_LINE>results.add(list);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
> results = Lists.newArrayList();
682,531
public static <P extends ImmutableFollowParameters> void initParser(ConstructingObjectParser<P, ?> parser) {<NEW_LINE>parser.declareInt(ConstructingObjectParser.optionalConstructorArg(), FollowParameters.MAX_READ_REQUEST_OPERATION_COUNT);<NEW_LINE>parser.declareInt(ConstructingObjectParser.optionalConstructorArg(), FollowParameters.MAX_WRITE_REQUEST_OPERATION_COUNT);<NEW_LINE>parser.declareInt(ConstructingObjectParser.optionalConstructorArg(), FollowParameters.MAX_OUTSTANDING_READ_REQUESTS);<NEW_LINE>parser.declareInt(ConstructingObjectParser.optionalConstructorArg(), FollowParameters.MAX_OUTSTANDING_WRITE_REQUESTS);<NEW_LINE>parser.declareField(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> ByteSizeValue.parseBytesSizeValue(p.text(), FollowParameters.MAX_READ_REQUEST_SIZE.getPreferredName()), FollowParameters.MAX_READ_REQUEST_SIZE, ObjectParser.ValueType.STRING);<NEW_LINE>parser.declareField(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> ByteSizeValue.parseBytesSizeValue(p.text(), FollowParameters.MAX_WRITE_REQUEST_SIZE.getPreferredName()), FollowParameters.MAX_WRITE_REQUEST_SIZE, ObjectParser.ValueType.STRING);<NEW_LINE>parser.declareInt(ConstructingObjectParser.optionalConstructorArg(), FollowParameters.MAX_WRITE_BUFFER_COUNT);<NEW_LINE>parser.declareField(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> ByteSizeValue.parseBytesSizeValue(p.text(), FollowParameters.MAX_WRITE_BUFFER_SIZE.getPreferredName()), FollowParameters.MAX_WRITE_BUFFER_SIZE, ObjectParser.ValueType.STRING);<NEW_LINE>parser.declareField(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> TimeValue.parseTimeValue(p.text(), FollowParameters.MAX_RETRY_DELAY.getPreferredName()), FollowParameters.<MASK><NEW_LINE>parser.declareField(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> TimeValue.parseTimeValue(p.text(), FollowParameters.READ_POLL_TIMEOUT.getPreferredName()), FollowParameters.READ_POLL_TIMEOUT, ObjectParser.ValueType.STRING);<NEW_LINE>}
MAX_RETRY_DELAY, ObjectParser.ValueType.STRING);
1,292,987
public static BArray slice(BArray arr, long startIndex, long endIndex) {<NEW_LINE>int size = arr.size();<NEW_LINE>if (startIndex < 0) {<NEW_LINE>throw BLangExceptionHelper.getRuntimeException(RuntimeErrors.ARRAY_INDEX_OUT_OF_RANGE, startIndex, size);<NEW_LINE>}<NEW_LINE>if (endIndex > size) {<NEW_LINE>throw BLangExceptionHelper.getRuntimeException(RuntimeErrors.ARRAY_INDEX_OUT_OF_RANGE, endIndex, size);<NEW_LINE>}<NEW_LINE>long sliceSize = endIndex - startIndex;<NEW_LINE>if (sliceSize < 0) {<NEW_LINE>throw BLangExceptionHelper.getRuntimeException(RuntimeErrors.ARRAY_INDEX_OUT_OF_RANGE, sliceSize, size);<NEW_LINE>}<NEW_LINE>Type arrType = arr.getType();<NEW_LINE>BArray slicedArr;<NEW_LINE>switch(arrType.getTag()) {<NEW_LINE>case TypeTags.ARRAY_TAG:<NEW_LINE>slicedArr = arr.slice(startIndex, endIndex);<NEW_LINE>break;<NEW_LINE>case TypeTags.TUPLE_TAG:<NEW_LINE>TupleType tupleType = (TupleType) arrType;<NEW_LINE>List<Type> memTypes = new ArrayList<>(tupleType.getTupleTypes());<NEW_LINE>Type restType = tupleType.getRestType();<NEW_LINE>if (restType != null) {<NEW_LINE>memTypes.add(restType);<NEW_LINE>}<NEW_LINE>UnionType unionType = TypeCreator.createUnionType(memTypes);<NEW_LINE>ArrayType slicedArrType = TypeCreator.createArrayType(unionType);<NEW_LINE>slicedArr = ValueCreator.createArrayValue(slicedArrType);<NEW_LINE>for (long i = startIndex, j = 0; i < endIndex; i++, j++) {<NEW_LINE>slicedArr.add(j<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw createOpNotSupportedError(arrType, "slice()");<NEW_LINE>}<NEW_LINE>return slicedArr;<NEW_LINE>}
, arr.getRefValue(i));
374,633
private static void annotateBytecode(InputStream is, OutputStream os, MethodParamAnnotations nonnullParams, MethodReturnAnnotations nullableReturns, String nullableDesc, String nonnullDesc) throws IOException {<NEW_LINE>ClassReader cr = new ClassReader(is);<NEW_LINE>ClassWriter cw = new ClassWriter(0);<NEW_LINE>ClassNode cn = new ClassNode(Opcodes.ASM7);<NEW_LINE>cr.accept(cn, 0);<NEW_LINE>String className = cn.name.replace('/', '.');<NEW_LINE>List<MethodNode> methods = cn.methods;<NEW_LINE>for (MethodNode method : methods) {<NEW_LINE>// Skip methods that already have nullability annotations anywhere in their signature<NEW_LINE>if (hasNullnessAnnotations(method)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean visible = annotationsShouldBeVisible(nullableDesc);<NEW_LINE>String methodSignature = className + "." <MASK><NEW_LINE>if (nullableReturns.contains(methodSignature)) {<NEW_LINE>// Add a @Nullable annotation on this method to indicate that the method can return null.<NEW_LINE>method.visitAnnotation(nullableDesc, visible);<NEW_LINE>LOG(debug, "DEBUG", "Added nullable return annotation for " + methodSignature);<NEW_LINE>}<NEW_LINE>Set<Integer> params = nonnullParams.get(methodSignature);<NEW_LINE>if (params != null) {<NEW_LINE>boolean isStatic = (method.access & Opcodes.ACC_STATIC) != 0;<NEW_LINE>for (Integer param : params) {<NEW_LINE>int paramNum = isStatic ? param : param - 1;<NEW_LINE>// Add a @Nonnull annotation on this parameter.<NEW_LINE>method.visitParameterAnnotation(paramNum, nonnullDesc, visible);<NEW_LINE>LOG(debug, "DEBUG", "Added nonnull parameter annotation for #" + param + " in " + methodSignature);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cn.accept(cw);<NEW_LINE>os.write(cw.toByteArray());<NEW_LINE>}
+ method.name + method.desc;
1,599,149
private Hover summaryHover(CpuTrack.Data data, Fonts.TextMeasurer m, double x, int mods) {<NEW_LINE>long time = state.pxToTime(x);<NEW_LINE>int bucket = (int) ((time - data.request.range.start) / data.bucketSize);<NEW_LINE>if (bucket < 0 || bucket >= data.utilizations.length) {<NEW_LINE>return Hover.NONE;<NEW_LINE>}<NEW_LINE>double p = data.utilizations[bucket];<NEW_LINE>String text = (int) (p * 100) + "% (" + timeToString(Math.round(p * data.bucketSize)) + " / " + timeToString(data.bucketSize) + ")";<NEW_LINE>hovered = new HoverCard(bucket, p, text, m.measure(Fonts.Style.Normal, text));<NEW_LINE>double mouseX = state.timeToPx(data.request.range.start + hovered.bucket * data.bucketSize + data.bucketSize / 2);<NEW_LINE>double dx = HOVER_PADDING + hovered.size.w + HOVER_PADDING;<NEW_LINE>double dy = height;<NEW_LINE>String ids = data.concatedIds[bucket];<NEW_LINE>return new Hover() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Area getRedraw() {<NEW_LINE>return new Area(mouseX - CURSOR_SIZE, -TRACK_MARGIN, CURSOR_SIZE + HOVER_MARGIN + dx, dy);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stop() {<NEW_LINE>hovered = null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean click() {<NEW_LINE>if (ids.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if ((mods & SWT.MOD1) == SWT.MOD1) {<NEW_LINE>state.addSelection(Selection.Kind.Cpu, transform(track.getSlices(ids), r -> {<NEW_LINE>r.stream().forEach(s -> state.addSelectedThread(state.<MASK><NEW_LINE>return new CpuTrack.SlicesBuilder(r).build();<NEW_LINE>}));<NEW_LINE>} else {<NEW_LINE>state.clearSelectedThreads();<NEW_LINE>state.setSelection(Selection.Kind.Cpu, transform(track.getSlices(ids), r -> {<NEW_LINE>r.stream().forEach(s -> state.addSelectedThread(state.getThreadInfo(s.utid)));<NEW_LINE>return new CpuTrack.SlicesBuilder(r).build();<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
getThreadInfo(s.utid)));
1,202,929
private void printReceiptLabels(final InOutGenerateResult result) {<NEW_LINE>final IInOutDAO inOutDAO = <MASK><NEW_LINE>final IHUAssignmentDAO huAssignmentDAO = Services.get(IHUAssignmentDAO.class);<NEW_LINE>final Set<Integer> seenHUIds = new HashSet<>();<NEW_LINE>final List<I_M_InOut> inouts = createList(result.getInOuts(), I_M_InOut.class);<NEW_LINE>for (final I_M_InOut inout : inouts) {<NEW_LINE>final int vendorBPartnerId = inout.getC_BPartner_ID();<NEW_LINE>final List<I_M_InOutLine> inoutLines = inOutDAO.retrieveLines(inout);<NEW_LINE>for (final I_M_InOutLine inoutLine : inoutLines) {<NEW_LINE>final List<I_M_HU_Assignment> huAssignments = huAssignmentDAO.retrieveTopLevelHUAssignmentsForModel(inoutLine);<NEW_LINE>for (final I_M_HU_Assignment huAssignment : huAssignments) {<NEW_LINE>final int huId = huAssignment.getM_HU_ID();<NEW_LINE>if (huId > 0 && seenHUIds.add(huId)) {<NEW_LINE>final HUToReportWrapper hu = HUToReportWrapper.of(huAssignment.getM_HU());<NEW_LINE>printReceiptLabel(hu, vendorBPartnerId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Services.get(IInOutDAO.class);
1,561,764
int injectFile(AnActionEvent event) {<NEW_LINE>try {<NEW_LINE>if (!new File(bundlePath).exists())<NEW_LINE>return alert("Please download InjectionIII from the Mac App Store.");<NEW_LINE>if (clientOutput == null)<NEW_LINE>return alert("Application not running/connected.");<NEW_LINE>Project project = event.getData(PlatformDataKeys.PROJECT);<NEW_LINE>if (project == null)<NEW_LINE>alert("Null project");<NEW_LINE>if (!sentProjectPath) {<NEW_LINE>VirtualFile proj = project.getBaseDir();<NEW_LINE>String projectPath = proj.getPath() + "/" + proj.getName() + ".xcworkspace";<NEW_LINE>if (!new File(projectPath).exists())<NEW_LINE>projectPath = proj.getPath() + "/" + proj.getName() + ".xcodeproj";<NEW_LINE>writeCommand(clientOutput, InjectionCommand.<MASK><NEW_LINE>sentProjectPath = true;<NEW_LINE>}<NEW_LINE>VirtualFile vf = event.getData(PlatformDataKeys.VIRTUAL_FILE);<NEW_LINE>if (vf == null)<NEW_LINE>return 0;<NEW_LINE>String selectedFile = vf.getCanonicalPath();<NEW_LINE>FileDocumentManager.getInstance().saveAllDocuments();<NEW_LINE>writeCommand(clientOutput, InjectionCommand.Inject.ordinal(), selectedFile);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>error("Inject File error", e);<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
Connected.ordinal(), projectPath);
508,075
public void update(long time) {<NEW_LINE>if (isMergeable() && isPickable() && (mergeDelay == null || !Cooldown.hasCooldown(time, lastMergeCheck, mergeDelay))) {<NEW_LINE>this.lastMergeCheck = time;<NEW_LINE>this.instance.getEntityTracker().nearbyEntities(position, mergeRange, EntityTracker.Target.ITEMS, itemEntity -> {<NEW_LINE>if (itemEntity == this)<NEW_LINE>return;<NEW_LINE>if (!itemEntity.isPickable() || !itemEntity.isMergeable())<NEW_LINE>return;<NEW_LINE>if (getDistance(itemEntity) > mergeRange)<NEW_LINE>return;<NEW_LINE>final ItemStack itemStackEntity = itemEntity.getItemStack();<NEW_LINE>final StackingRule stackingRule = StackingRule.get();<NEW_LINE>final boolean canStack = stackingRule.canBeStacked(itemStack, itemStackEntity);<NEW_LINE>if (!canStack)<NEW_LINE>return;<NEW_LINE>final int totalAmount = stackingRule.getAmount(itemStack) + stackingRule.getAmount(itemStackEntity);<NEW_LINE>if (!stackingRule.canApply(itemStack, totalAmount))<NEW_LINE>return;<NEW_LINE>final ItemStack result = <MASK><NEW_LINE>EntityItemMergeEvent entityItemMergeEvent = new EntityItemMergeEvent(this, itemEntity, result);<NEW_LINE>EventDispatcher.callCancellable(entityItemMergeEvent, () -> {<NEW_LINE>setItemStack(entityItemMergeEvent.getResult());<NEW_LINE>itemEntity.remove();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
stackingRule.apply(itemStack, totalAmount);
1,711,551
public DateTimeParseResult parse(ExtractResult er, LocalDateTime reference) {<NEW_LINE>LocalDateTime referenceDate = reference;<NEW_LINE>Object value = null;<NEW_LINE>if (er.getType().equals(getParserName())) {<NEW_LINE>DateTimeResolutionResult innerResult = this.mergeDateAndTime(er.getText(), referenceDate);<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parseBasicRegex(er.getText(), referenceDate);<NEW_LINE>}<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parseTimeOfToday(er.getText(), referenceDate);<NEW_LINE>}<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parseSpecialTimeOfDate(<MASK><NEW_LINE>}<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parserDurationWithAgoAndLater(er.getText(), referenceDate);<NEW_LINE>}<NEW_LINE>if (innerResult.getSuccess()) {<NEW_LINE>Map<String, String> futureResolution = ImmutableMap.<String, String>builder().put(TimeTypeConstants.DATETIME, DateTimeFormatUtil.formatDateTime((LocalDateTime) innerResult.getFutureValue())).build();<NEW_LINE>innerResult.setFutureResolution(futureResolution);<NEW_LINE>Map<String, String> pastResolution = ImmutableMap.<String, String>builder().put(TimeTypeConstants.DATETIME, DateTimeFormatUtil.formatDateTime((LocalDateTime) innerResult.getPastValue())).build();<NEW_LINE>innerResult.setPastResolution(pastResolution);<NEW_LINE>value = innerResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DateTimeParseResult ret = new DateTimeParseResult(er.getStart(), er.getLength(), er.getText(), er.getType(), er.getData(), value, "", value == null ? "" : ((DateTimeResolutionResult) value).getTimex());<NEW_LINE>return ret;<NEW_LINE>}
er.getText(), referenceDate);
56,169
public void sendNotification(Check check, Subscription subscription, List<Alert> alerts) throws NotificationFailedException {<NEW_LINE>String httpUrl = StringUtils.<MASK><NEW_LINE>if (httpUrl == null) {<NEW_LINE>LOGGER.warn("URL needs to be set before sending notifications to HTTP");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Object> body = new HashMap<String, Object>();<NEW_LINE>body.put("seyrenUrl", seyrenConfig.getBaseUrl());<NEW_LINE>body.put("check", check);<NEW_LINE>body.put("subscription", subscription);<NEW_LINE>body.put("alerts", alerts);<NEW_LINE>body.put("preview", getPreviewImage(check));<NEW_LINE>HttpClient client = HttpClientBuilder.create().useSystemProperties().build();<NEW_LINE>HttpPost post;<NEW_LINE>if (StringUtils.isNotBlank(seyrenConfig.getHttpNotificationUrl())) {<NEW_LINE>post = new HttpPost(seyrenConfig.getHttpNotificationUrl());<NEW_LINE>} else {<NEW_LINE>post = new HttpPost(subscription.getTarget());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>HttpEntity entity = new StringEntity(MAPPER.writeValueAsString(body), ContentType.APPLICATION_JSON);<NEW_LINE>post.setEntity(entity);<NEW_LINE>HttpResponse response = client.execute(post);<NEW_LINE>HttpEntity responseEntity = response.getEntity();<NEW_LINE>if (responseEntity != null) {<NEW_LINE>LOGGER.info("Response : {} ", EntityUtils.toString(responseEntity));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new NotificationFailedException("Failed to send notification to HTTP", e);<NEW_LINE>} finally {<NEW_LINE>post.releaseConnection();<NEW_LINE>HttpClientUtils.closeQuietly(client);<NEW_LINE>}<NEW_LINE>}
trimToNull(subscription.getTarget());
252,735
private List<Wo> list(Wi wi) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>for (String str : wi.getUnitList()) {<NEW_LINE>Unit o = business.<MASK><NEW_LINE>if (o != null) {<NEW_LINE>Wo wo = Wo.copier.copy(o);<NEW_LINE>wo.setMatchKey(str);<NEW_LINE>if (StringUtils.isNotEmpty(wo.getSuperior())) {<NEW_LINE>Unit superior = business.unit().pick(wo.getSuperior());<NEW_LINE>if (null != superior) {<NEW_LINE>wo.setSuperior(superior.getDistinguishedName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>wo.setSubDirectIdentityCount(this.countSubDirectIdentity(business, wo));<NEW_LINE>wo.setSubDirectUnitCount(this.countSubDirectUnit(business, wo));<NEW_LINE>wos.add(wo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return wos;<NEW_LINE>}<NEW_LINE>}
unit().pick(str);
1,008,162
public void execute(Transaction transaction) throws UserException, BimserverLockConflictException, BimserverDatabaseException, IOException, QueryException {<NEW_LINE>PackageMetaData packageMetaData = transaction.getDatabaseSession().getMetaDataManager().getPackageMetaData(transaction.getProject().getSchema());<NEW_LINE>HashMapVirtualObject object = transaction.get(oid);<NEW_LINE>if (object == null) {<NEW_LINE>Query query = new Query(packageMetaData);<NEW_LINE>QueryPart queryPart = query.createQueryPart();<NEW_LINE>queryPart.addOid(oid);<NEW_LINE>QueryObjectProvider queryObjectProvider = new QueryObjectProvider(transaction.getDatabaseSession(), transaction.getBimServer(), query, Collections.singleton(transaction.getPreviousRevision().getOid()), packageMetaData);<NEW_LINE>object = queryObjectProvider.next();<NEW_LINE>transaction.updated(object);<NEW_LINE>}<NEW_LINE>EClass eClass = transaction.getDatabaseSession().getEClassForOid(oid);<NEW_LINE>if (!ChangeHelper.canBeChanged(eClass)) {<NEW_LINE>throw new UserException("Only objects from the following schemas are allowed to be changed: Ifc2x3tc1 and IFC4, this object (" + eClass.getName() + ") is from the \"" + eClass.getEPackage().getName() + "\" package");<NEW_LINE>}<NEW_LINE>if (object == null) {<NEW_LINE>throw new UserException("No object of type \"" + eClass.getName() + "\" with oid " + oid + " found in project with pid " + transaction.getProject().getId());<NEW_LINE>}<NEW_LINE>EReference eReference = packageMetaData.getEReference(eClass.getName(), referenceName);<NEW_LINE>if (eReference == null) {<NEW_LINE>throw new UserException("No reference with the name \"" + referenceName + "\" found in class \"" + eClass.getName() + "\"");<NEW_LINE>}<NEW_LINE>if (eReference.isMany()) {<NEW_LINE>throw new UserException("Reference " + referenceName + " is not of type 'single'");<NEW_LINE>}<NEW_LINE>object.setReference(eReference, referenceOid, 0);<NEW_LINE>EClass eClassForOid = transaction.<MASK><NEW_LINE>EReference inverseOrOpposite = packageMetaData.getInverseOrOpposite(eClassForOid, eReference);<NEW_LINE>if (inverseOrOpposite != null) {<NEW_LINE>HashMapVirtualObject referencedObject = transaction.get(referenceOid);<NEW_LINE>if (referencedObject == null) {<NEW_LINE>Query query = new Query(packageMetaData);<NEW_LINE>QueryPart queryPart = query.createQueryPart();<NEW_LINE>queryPart.addOid(referenceOid);<NEW_LINE>QueryObjectProvider queryObjectProvider = new QueryObjectProvider(transaction.getDatabaseSession(), transaction.getBimServer(), query, Collections.singleton(transaction.getPreviousRevision().getOid()), packageMetaData);<NEW_LINE>referencedObject = queryObjectProvider.next();<NEW_LINE>}<NEW_LINE>if (inverseOrOpposite.isMany()) {<NEW_LINE>referencedObject.addReference(inverseOrOpposite, eClassForOid, oid);<NEW_LINE>} else {<NEW_LINE>referencedObject.setReference(inverseOrOpposite, oid);<NEW_LINE>}<NEW_LINE>transaction.updated(referencedObject);<NEW_LINE>}<NEW_LINE>}
getDatabaseSession().getEClassForOid(referenceOid);
953,036
public static PrivateTransaction readFrom(final RLPInput input) throws RLPException {<NEW_LINE>input.enterList();<NEW_LINE>final Builder builder = builder().nonce(input.readLongScalar()).gasPrice(Wei.of(input.readUInt256Scalar())).gasLimit(input.readLongScalar()).to(input.readBytes(v -> v.size() == 0 ? null : Address.wrap(v))).value(Wei.of(input.readUInt256Scalar())).payload(input.readBytes());<NEW_LINE>final BigInteger v = input.readBigIntegerScalar();<NEW_LINE>final byte recId;<NEW_LINE>Optional<BigInteger> chainId = Optional.empty();<NEW_LINE>if (v.equals(REPLAY_UNPROTECTED_V_BASE) || v.equals(REPLAY_UNPROTECTED_V_BASE_PLUS_1)) {<NEW_LINE>recId = v.subtract(REPLAY_UNPROTECTED_V_BASE).byteValueExact();<NEW_LINE>} else if (v.compareTo(REPLAY_PROTECTED_V_MIN) > 0) {<NEW_LINE>chainId = Optional.of(v.subtract(REPLAY_PROTECTED_V_BASE).divide(TWO));<NEW_LINE>recId = v.subtract(TWO.multiply(chainId.get()).add(REPLAY_PROTECTED_V_BASE)).byteValueExact();<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException(String.format("An unsupported encoded `v` value of %s was found", v));<NEW_LINE>}<NEW_LINE>final BigInteger r = input.readUInt256Scalar().toUnsignedBigInteger();<NEW_LINE>final BigInteger s = input<MASK><NEW_LINE>final SECPSignature signature = SIGNATURE_ALGORITHM.get().createSignature(r, s, recId);<NEW_LINE>final Bytes privateFrom = input.readBytes();<NEW_LINE>final Object privateForOrPrivacyGroupId = resolvePrivateForOrPrivacyGroupId(input.readAsRlp());<NEW_LINE>final Restriction restriction = convertToEnum(input.readBytes());<NEW_LINE>input.leaveList();<NEW_LINE>chainId.ifPresent(builder::chainId);<NEW_LINE>if (privateForOrPrivacyGroupId instanceof List) {<NEW_LINE>return builder.signature(signature).privateFrom(privateFrom).privateFor((List<Bytes>) privateForOrPrivacyGroupId).restriction(restriction).build();<NEW_LINE>} else {<NEW_LINE>return builder.signature(signature).privateFrom(privateFrom).privacyGroupId((Bytes) privateForOrPrivacyGroupId).restriction(restriction).build();<NEW_LINE>}<NEW_LINE>}
.readUInt256Scalar().toUnsignedBigInteger();
1,426,099
public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "Usage:\n" + " PutItems <datasetArn, item1Id, item1PropertyName, item1PropertyValue,\n" + " item2Id, item2PropertyName, item2PropertyValue>\n\n" + "Where:\n" + " datasetArn - The ARN (Amazon Resource Name) for the item's destination dataset.\n" + " item1Id - The identification number of the first item.\n" + " item1propertyName - The metadata field name (in camel case) for the first item.\n" <MASK><NEW_LINE>if (args.length != 7) {<NEW_LINE>System.out.println(USAGE);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String datasetArn = args[0];<NEW_LINE>String item1Id = args[1];<NEW_LINE>String item1PropertyName = args[2];<NEW_LINE>String item1PropertyValue = args[3];<NEW_LINE>String item2Id = args[4];<NEW_LINE>String item2PropertyName = args[5];<NEW_LINE>String item2PropertyValue = args[6];<NEW_LINE>// Change to the region where your resources are located<NEW_LINE>Region region = Region.US_WEST_2;<NEW_LINE>// Build a personalize events client<NEW_LINE>PersonalizeEventsClient personalizeEventsClient = PersonalizeEventsClient.builder().region(region).build();<NEW_LINE>int response = putItems(personalizeEventsClient, datasetArn, item1Id, item1PropertyName, item1PropertyValue, item2Id, item2PropertyName, item2PropertyValue);<NEW_LINE>System.out.println("Response code: " + response);<NEW_LINE>personalizeEventsClient.close();<NEW_LINE>}
+ " item1propertyValue - The metadata value for the first item.\n" + " item2Id - The identification number of the second item.\n" + " item2propertyName - The metadata field name (in camel case) for the second item.\n" + " item2propertyValue - The metadata value for the second item.\n\n";
734,127
public void process() throws BimserverDatabaseException, UserException, ServerException {<NEW_LINE>DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.READ_ONLY);<NEW_LINE>try {<NEW_LINE>Project project = session.get(StorePackage.eINSTANCE.getProject(), poid, OldQuery.getDefault());<NEW_LINE>for (Service service : project.getServices()) {<NEW_LINE>if (soid == -1 || service.getOid() == soid) {<NEW_LINE>triggerNewExtendedData(session, getBimServer().getNotificationsManager(), getBimServer(), getBimServer().getNotificationsManager().getSiteAddress(), project, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (soid == -1) {<NEW_LINE>// Only execute if we are not triggering a specific service with this notification<NEW_LINE>NewExtendedDataOnRevisionTopic topic = getBimServer().getNotificationsManager().getNewExtendedDataOnRevisionTopic(new NewExtendedDataOnRevisionTopicKey(roid));<NEW_LINE>if (topic != null) {<NEW_LINE>topic.process(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>session.close();<NEW_LINE>}<NEW_LINE>}
roid, Trigger.NEW_EXTENDED_DATA, service);
241,945
public static boolean enablePlugin(@Nullable Activity activity, @NonNull OsmandApplication app, @NonNull OsmandPlugin plugin, boolean enable) {<NEW_LINE>if (enable) {<NEW_LINE>if (!plugin.init(app, activity)) {<NEW_LINE>plugin.setEnabled(false);<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>plugin.setEnabled(true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>plugin.disable(app);<NEW_LINE>plugin.setEnabled(false);<NEW_LINE>}<NEW_LINE>app.getSettings().enablePlugin(plugin.getId(), enable);<NEW_LINE>app.getQuickActionRegistry().updateActionTypes();<NEW_LINE>if (activity != null) {<NEW_LINE>if (activity instanceof MapActivity) {<NEW_LINE>final MapActivity mapActivity = (MapActivity) activity;<NEW_LINE>plugin.updateLayers(mapActivity, mapActivity);<NEW_LINE>mapActivity.getDashboard().refreshDashboardFragments();<NEW_LINE><MASK><NEW_LINE>if (!enable && fragmentData != null) {<NEW_LINE>FragmentManager fm = mapActivity.getSupportFragmentManager();<NEW_LINE>Fragment fragment = fm.findFragmentByTag(fragmentData.tag);<NEW_LINE>if (fragment != null) {<NEW_LINE>fm.beginTransaction().remove(fragment).commitAllowingStateLoss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (plugin.isMarketPlugin() || plugin.isPaid()) {<NEW_LINE>if (plugin.isActive()) {<NEW_LINE>plugin.showInstallDialog(activity);<NEW_LINE>} else if (OsmandPlugin.checkPluginPackage(app, plugin)) {<NEW_LINE>plugin.showDisableDialog(activity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
DashFragmentData fragmentData = plugin.getCardFragment();
865,517
public static DescribeLoadBalancersResponse unmarshall(DescribeLoadBalancersResponse describeLoadBalancersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLoadBalancersResponse.setRequestId(_ctx.stringValue("DescribeLoadBalancersResponse.RequestId"));<NEW_LINE>describeLoadBalancersResponse.setPageNumber(_ctx.integerValue("DescribeLoadBalancersResponse.PageNumber"));<NEW_LINE>describeLoadBalancersResponse.setPageSize(_ctx.integerValue("DescribeLoadBalancersResponse.PageSize"));<NEW_LINE>describeLoadBalancersResponse.setTotalCount(_ctx.integerValue("DescribeLoadBalancersResponse.TotalCount"));<NEW_LINE>List<LoadBalancer> loadBalancers = new ArrayList<LoadBalancer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLoadBalancersResponse.LoadBalancers.Length"); i++) {<NEW_LINE>LoadBalancer loadBalancer = new LoadBalancer();<NEW_LINE>loadBalancer.setVpcId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].VpcId"));<NEW_LINE>loadBalancer.setCreateTimeStamp(_ctx.longValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].CreateTimeStamp"));<NEW_LINE>loadBalancer.setLoadBalancerId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerId"));<NEW_LINE>loadBalancer.setCreateTime(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].CreateTime"));<NEW_LINE>loadBalancer.setPayType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].PayType"));<NEW_LINE>loadBalancer.setAddressType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].AddressType"));<NEW_LINE>loadBalancer.setNetworkType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].NetworkType"));<NEW_LINE>loadBalancer.setServiceManagedMode(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ServiceManagedMode"));<NEW_LINE>loadBalancer.setSpecBpsFlag(_ctx.booleanValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].SpecBpsFlag"));<NEW_LINE>loadBalancer.setAddressIPVersion(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].AddressIPVersion"));<NEW_LINE>loadBalancer.setLoadBalancerName(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerName"));<NEW_LINE>loadBalancer.setBandwidth(_ctx.integerValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Bandwidth"));<NEW_LINE>loadBalancer.setAddress(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Address"));<NEW_LINE>loadBalancer.setSlaveZoneId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].SlaveZoneId"));<NEW_LINE>loadBalancer.setMasterZoneId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].MasterZoneId"));<NEW_LINE>loadBalancer.setInternetChargeTypeAlias(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].InternetChargeTypeAlias"));<NEW_LINE>loadBalancer.setLoadBalancerSpec(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerSpec"));<NEW_LINE>loadBalancer.setSpecType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].SpecType"));<NEW_LINE>loadBalancer.setRegionId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].RegionId"));<NEW_LINE>loadBalancer.setModificationProtectionReason(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ModificationProtectionReason"));<NEW_LINE>loadBalancer.setModificationProtectionStatus(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ModificationProtectionStatus"));<NEW_LINE>loadBalancer.setVSwitchId(_ctx.stringValue<MASK><NEW_LINE>loadBalancer.setLoadBalancerStatus(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerStatus"));<NEW_LINE>loadBalancer.setResourceGroupId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ResourceGroupId"));<NEW_LINE>loadBalancer.setInternetChargeType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].InternetChargeType"));<NEW_LINE>loadBalancer.setBusinessStatus(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].BusinessStatus"));<NEW_LINE>loadBalancer.setDeleteProtection(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].DeleteProtection"));<NEW_LINE>loadBalancer.setRegionIdAlias(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].RegionIdAlias"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>loadBalancer.setTags(tags);<NEW_LINE>loadBalancers.add(loadBalancer);<NEW_LINE>}<NEW_LINE>describeLoadBalancersResponse.setLoadBalancers(loadBalancers);<NEW_LINE>return describeLoadBalancersResponse;<NEW_LINE>}
("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].VSwitchId"));
1,315,428
public List<Double> evaluate(List<Object> timeSeriesObj, int dayWindow) {<NEW_LINE>List<Double> timeSeries = this.parseDoubleList(timeSeriesObj);<NEW_LINE>List<Double> mvnAvgTimeSeries = new ArrayList<Double<MASK><NEW_LINE>double mvnTotal = 0.0;<NEW_LINE>for (int i = 0; i < timeSeries.size(); ++i) {<NEW_LINE>// // Do we want to set days befo<NEW_LINE>mvnTotal += timeSeries.get(i);<NEW_LINE>if (i >= dayWindow) {<NEW_LINE>mvnTotal -= timeSeries.get(i - dayWindow);<NEW_LINE>double mvnAvg = mvnTotal / ((double) dayWindow);<NEW_LINE>mvnAvgTimeSeries.add(mvnAvg);<NEW_LINE>} else {<NEW_LINE>if (i > 0) {<NEW_LINE>// /smooth out according to number of days for less than day window<NEW_LINE>double mvnAvg = mvnTotal / ((double) i + 1.0);<NEW_LINE>mvnAvgTimeSeries.add(mvnAvg);<NEW_LINE>} else {<NEW_LINE>// /<NEW_LINE>mvnAvgTimeSeries.add(mvnTotal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mvnAvgTimeSeries;<NEW_LINE>}
>(timeSeries.size());
790,657
void sendTokenProperties(MTWebSocket mtws, String inResponseTo, JsonObject data) {<NEW_LINE>String tokenId = data.get("tokenId").getAsString();<NEW_LINE>Token token = findTokenFromId(tokenId);<NEW_LINE>if (token == null) {<NEW_LINE>System.out.println("DEBUG: sendTokenInfo(): Unable to find token " + tokenId);<NEW_LINE>return;<NEW_LINE>// FIXME: log this error<NEW_LINE>}<NEW_LINE>JsonObject jobj = new JsonObject();<NEW_LINE>jobj.addProperty("tokenId", tokenId);<NEW_LINE>JsonArray properties = new JsonArray();<NEW_LINE>JsonObject propertiesMap = new JsonObject();<NEW_LINE>JsonArray propToFetch = data.get("propertyNames").getAsJsonArray();<NEW_LINE>for (int i = 0; i < propToFetch.size(); i++) {<NEW_LINE>String pname = propToFetch.get(i).getAsString();<NEW_LINE>String val;<NEW_LINE>if (pname.startsWith(":")) {<NEW_LINE>val = getTokenValue(token, pname);<NEW_LINE>} else {<NEW_LINE>val = token.getProperty(pname) == null ? null : token.getProperty(pname).toString();<NEW_LINE>}<NEW_LINE>JsonObject jprop = new JsonObject();<NEW_LINE>jprop.addProperty("name", pname);<NEW_LINE><MASK><NEW_LINE>properties.add(jprop);<NEW_LINE>propertiesMap.addProperty(pname, val);<NEW_LINE>}<NEW_LINE>jobj.add("properties", properties);<NEW_LINE>jobj.add("propertiesMap", propertiesMap);<NEW_LINE>mtws.sendMessage("tokenProperties", inResponseTo, jobj);<NEW_LINE>}
jprop.addProperty("value", val);
1,277,457
public static Properties replaceUseBlackUIProperty(@NonNull Properties properties) {<NEW_LINE>String useBlackUIStringValue = properties.getProperty(TermuxPropertyConstants.KEY_USE_BLACK_UI);<NEW_LINE>if (useBlackUIStringValue == null)<NEW_LINE>return properties;<NEW_LINE>Logger.logWarn(LOG_TAG, "Removing deprecated property " + TermuxPropertyConstants.KEY_USE_BLACK_UI + "=" + useBlackUIStringValue);<NEW_LINE>properties.remove(TermuxPropertyConstants.KEY_USE_BLACK_UI);<NEW_LINE>// If KEY_NIGHT_MODE is not set<NEW_LINE>if (properties.getProperty(TermuxPropertyConstants.KEY_NIGHT_MODE) == null) {<NEW_LINE>Boolean <MASK><NEW_LINE>if (useBlackUI != null) {<NEW_LINE>String termuxAppTheme = useBlackUI ? TermuxPropertyConstants.IVALUE_NIGHT_MODE_TRUE : TermuxPropertyConstants.IVALUE_NIGHT_MODE_FALSE;<NEW_LINE>Logger.logWarn(LOG_TAG, "Replacing deprecated property " + TermuxPropertyConstants.KEY_USE_BLACK_UI + "=" + useBlackUI + " with " + TermuxPropertyConstants.KEY_NIGHT_MODE + "=" + termuxAppTheme);<NEW_LINE>properties.put(TermuxPropertyConstants.KEY_NIGHT_MODE, termuxAppTheme);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>}
useBlackUI = SharedProperties.getBooleanValueForStringValue(useBlackUIStringValue);
178,062
public AddLFTagsToResourceResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AddLFTagsToResourceResult addLFTagsToResourceResult = new AddLFTagsToResourceResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return addLFTagsToResourceResult;<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("Failures", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>addLFTagsToResourceResult.setFailures(new ListUnmarshaller<LFTagError>(LFTagErrorJsonUnmarshaller.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 addLFTagsToResourceResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,428,892
public void customize(MavenBuild mavenBuild) {<NEW_LINE>Version platformVersion = this.description.getPlatformVersion();<NEW_LINE>String sccPluginVersion = this.projectsVersionResolver.resolveVersion(platformVersion, "org.springframework.cloud:spring-cloud-contract-verifier");<NEW_LINE>if (sccPluginVersion == null) {<NEW_LINE>logger.warn("Spring Cloud Contract Verifier Maven plugin version could not be resolved for Spring Boot version: " + platformVersion.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mavenBuild.plugins().add("org.springframework.cloud", "spring-cloud-contract-maven-plugin", (plugin) -> {<NEW_LINE>plugin.extensions(true).version(sccPluginVersion);<NEW_LINE>plugin.configuration((builder) -> builder.add("testFramework", "JUNIT5"));<NEW_LINE>if (mavenBuild.dependencies().has("webflux")) {<NEW_LINE>plugin.configuration((builder) -> builder.add("testMode", "WEBTESTCLIENT"));<NEW_LINE>mavenBuild.dependencies().add("rest-assured-spring-web-test-client", Dependency.withCoordinates("io.rest-assured", "spring-web-test-client")<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>configurePluginRepositories(mavenBuild, sccPluginVersion);<NEW_LINE>}
.scope(DependencyScope.TEST_COMPILE));
1,490,830
public List<InetRecord> selectTrafficRoutersLocalized(final Geolocation clientGeolocation, final String zoneName, final DeliveryService ds, final Track track, final int queryType) throws GeolocationException {<NEW_LINE>final List<InetRecord> trafficRouterRecords = new ArrayList<>();<NEW_LINE>if (!isEdgeDNSRouting() && !isEdgeHTTPRouting()) {<NEW_LINE>return trafficRouterRecords;<NEW_LINE>}<NEW_LINE>final List<TrafficRouterLocation> trafficRouterLocations = (List<TrafficRouterLocation>) orderLocations(getCacheRegister(<MASK><NEW_LINE>for (final TrafficRouterLocation location : trafficRouterLocations) {<NEW_LINE>final List<Node> trafficRouters = consistentHasher.selectHashables(location.getTrafficRouters(), zoneName);<NEW_LINE>if (trafficRouters == null || trafficRouters.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (isEdgeDNSRouting()) {<NEW_LINE>trafficRouterRecords.addAll(nsRecordsFromNodes(ds, trafficRouters));<NEW_LINE>}<NEW_LINE>if (ds != null && !ds.isDns() && isEdgeHTTPRouting()) {<NEW_LINE>// only generate edge routing records for HTTP DSs when necessary<NEW_LINE>trafficRouterRecords.addAll(inetRecordsFromNodes(ds, trafficRouters));<NEW_LINE>}<NEW_LINE>if (track != null) {<NEW_LINE>track.setResultLocation(location.getGeolocation());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return trafficRouterRecords;<NEW_LINE>}
).getEdgeTrafficRouterLocations(), clientGeolocation);
223,551
private void strip(@Nonnull final Document document) {<NEW_LINE>if (!document.isWritable())<NEW_LINE>return;<NEW_LINE>FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();<NEW_LINE>VirtualFile file = fileDocumentManager.getFile(document);<NEW_LINE>if (file == null || !file.isValid() || Boolean.TRUE.equals(DISABLE_FOR_FILE_KEY.get(file)))<NEW_LINE>return;<NEW_LINE>final EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance();<NEW_LINE>if (settings == null)<NEW_LINE>return;<NEW_LINE>final String overrideStripTrailingSpacesData = file.getUserData(OVERRIDE_STRIP_TRAILING_SPACES_KEY);<NEW_LINE>final Boolean overrideEnsureNewlineData = file.getUserData(OVERRIDE_ENSURE_NEWLINE_KEY);<NEW_LINE>@EditorSettingsExternalizable.StripTrailingSpaces<NEW_LINE>String stripTrailingSpaces = overrideStripTrailingSpacesData != null <MASK><NEW_LINE>final boolean doStrip = !stripTrailingSpaces.equals(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE);<NEW_LINE>final boolean ensureEOL = overrideEnsureNewlineData != null ? overrideEnsureNewlineData.booleanValue() : settings.isEnsureNewLineAtEOF();<NEW_LINE>if (doStrip) {<NEW_LINE>final boolean inChangedLinesOnly = !stripTrailingSpaces.equals(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_WHOLE);<NEW_LINE>boolean success = strip(document, inChangedLinesOnly, settings.isKeepTrailingSpacesOnCaretLine());<NEW_LINE>if (!success) {<NEW_LINE>myDocumentsToStripLater.add(document);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int lines = document.getLineCount();<NEW_LINE>if (ensureEOL && lines > 0) {<NEW_LINE>final int start = document.getLineStartOffset(lines - 1);<NEW_LINE>final int end = document.getLineEndOffset(lines - 1);<NEW_LINE>if (start != end) {<NEW_LINE>final CharSequence content = document.getCharsSequence();<NEW_LINE>ApplicationManager.getApplication().runWriteAction(new DocumentRunnable(document, null) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>CommandProcessor.getInstance().runUndoTransparentAction(() -> {<NEW_LINE>if (CharArrayUtil.containsOnlyWhiteSpaces(content.subSequence(start, end)) && doStrip) {<NEW_LINE>document.deleteString(start, end);<NEW_LINE>} else {<NEW_LINE>document.insertString(end, "\n");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
? overrideStripTrailingSpacesData : settings.getStripTrailingSpaces();
1,506,069
public void addRange(int n, float[] x, float[] y1, float[] y2, Color c) {<NEW_LINE>if (xPoints.length <= n) {<NEW_LINE>float[][] yp = new float[n + 2][];<NEW_LINE>float[][] xp = new float[n + 2][];<NEW_LINE>Color[] ncol <MASK><NEW_LINE>int[] m = new int[n + 2];<NEW_LINE>for (int i = 0; i < xPoints.length; i++) {<NEW_LINE>xp[i] = xPoints[i];<NEW_LINE>yp[i] = yPoints[i];<NEW_LINE>ncol[i] = pointColor[i];<NEW_LINE>m[i] = pointMode[i];<NEW_LINE>}<NEW_LINE>pointColor = ncol;<NEW_LINE>xPoints = xp;<NEW_LINE>yPoints = yp;<NEW_LINE>pointMode = m;<NEW_LINE>}<NEW_LINE>xPoints[n] = x;<NEW_LINE>yPoints[n] = y1;<NEW_LINE>pointColor[n] = c;<NEW_LINE>pointMode[n] = -1;<NEW_LINE>xPoints[n + 1] = x;<NEW_LINE>yPoints[n + 1] = y2;<NEW_LINE>pointColor[n + 1] = c;<NEW_LINE>pointMode[n + 1] = RANGE_MODE;<NEW_LINE>calcRange();<NEW_LINE>repaint();<NEW_LINE>}
= new Color[n + 2];
880,568
public Boolean hasUserPermissionToObject(final User user, final PermissionName permissionName, final SecurableModel securableModel) {<NEW_LINE>if (user == null) {<NEW_LINE>throw new IllegalArgumentException("User can not be null.");<NEW_LINE>}<NEW_LINE>if (permissionName == null) {<NEW_LINE>throw new IllegalArgumentException("Permission Name can not be null.");<NEW_LINE>}<NEW_LINE>if (securableModel == null) {<NEW_LINE>throw new IllegalArgumentException("SecurableModel can not be null.");<NEW_LINE>}<NEW_LINE>if (hasUserPermissionToClass(user, permissionName, securableModel.getClass().getCanonicalName())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final List<Long> userRoleIds = new ArrayList<>();<NEW_LINE>for (Role role : user.getRoles()) {<NEW_LINE>userRoleIds.add(role.getId());<NEW_LINE>}<NEW_LINE>final List<AclEntry> rolesAclEntries = aclEntryService.findAll(permissionName, AclSidType.ROLE, userRoleIds, AclClassName.getByName(securableModel.getClass().getCanonicalName()), securableModel.getId());<NEW_LINE>if (rolesAclEntries.size() > 0) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("User " + user.getUsername() + " has permission " + permissionName + " to object " + securableModel.getClass().getCanonicalName() + "[id=" + securableModel.getId() + "] based on the ACL security settings.");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (securableModel.getCreatedBy() != null && securableModel.getCreatedBy().getId().equals(user.getId())) {<NEW_LINE>List<AclEntry> ownerAclEntries = aclEntryService.findAll(permissionName, AclSidType.OWNER, 0L, AclClassName.getByName(securableModel.getClass().getCanonicalName()<MASK><NEW_LINE>if (ownerAclEntries.size() > 0) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("User " + user.getUsername() + " has permission " + permissionName + " to object " + securableModel.getClass().getCanonicalName() + "[id=" + securableModel.getId() + "] based on that he is the owner.");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("User " + user.getUsername() + " has not permission " + permissionName + " to object " + securableModel.getClass().getCanonicalName() + "[id=" + securableModel.getId() + "].");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
), securableModel.getId());
1,716,856
private void notEqualToValue(Node mLiteral, Node otherNode, AnnotationMirror otherAnno, CFStore store) {<NEW_LINE>Long integerLiteral = ValueCheckerUtils.getExactValue(mLiteral.getTree(), aTypeFactory.getValueAnnotatedTypeFactory());<NEW_LINE>if (integerLiteral == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long intLiteral = integerLiteral.longValue();<NEW_LINE>if (intLiteral == 0) {<NEW_LINE>if (aTypeFactory.areSameByClass(otherAnno, NonNegative.class)) {<NEW_LINE>List<<MASK><NEW_LINE>for (Node internal : internals) {<NEW_LINE>JavaExpression je = JavaExpression.fromNode(internal);<NEW_LINE>store.insertValue(je, POS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (intLiteral == -1) {<NEW_LINE>if (aTypeFactory.areSameByClass(otherAnno, GTENegativeOne.class)) {<NEW_LINE>List<Node> internals = splitAssignments(otherNode);<NEW_LINE>for (Node internal : internals) {<NEW_LINE>JavaExpression je = JavaExpression.fromNode(internal);<NEW_LINE>store.insertValue(je, NN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Node> internals = splitAssignments(otherNode);
679,337
public static ListUsersOfRoleResponse unmarshall(ListUsersOfRoleResponse listUsersOfRoleResponse, UnmarshallerContext context) {<NEW_LINE>listUsersOfRoleResponse.setRequestId<MASK><NEW_LINE>listUsersOfRoleResponse.setSuccess(context.booleanValue("ListUsersOfRoleResponse.Success"));<NEW_LINE>listUsersOfRoleResponse.setCode(context.stringValue("ListUsersOfRoleResponse.Code"));<NEW_LINE>listUsersOfRoleResponse.setMessage(context.stringValue("ListUsersOfRoleResponse.Message"));<NEW_LINE>listUsersOfRoleResponse.setHttpStatusCode(context.integerValue("ListUsersOfRoleResponse.HttpStatusCode"));<NEW_LINE>Users users = new Users();<NEW_LINE>users.setTotalCount(context.integerValue("ListUsersOfRoleResponse.Users.TotalCount"));<NEW_LINE>users.setPageNumber(context.integerValue("ListUsersOfRoleResponse.Users.PageNumber"));<NEW_LINE>users.setPageSize(context.integerValue("ListUsersOfRoleResponse.Users.PageSize"));<NEW_LINE>List<User> list = new ArrayList<User>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListUsersOfRoleResponse.Users.List.Length"); i++) {<NEW_LINE>User user = new User();<NEW_LINE>user.setUserId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].UserId"));<NEW_LINE>user.setRamId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].RamId"));<NEW_LINE>user.setInstanceId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].InstanceId"));<NEW_LINE>Detail detail = new Detail();<NEW_LINE>detail.setLoginName(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.LoginName"));<NEW_LINE>detail.setDisplayName(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.DisplayName"));<NEW_LINE>detail.setPhone(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.Phone"));<NEW_LINE>detail.setEmail(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.Email"));<NEW_LINE>detail.setDepartment(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.Department"));<NEW_LINE>user.setDetail(detail);<NEW_LINE>List<SkillLevel> skillLevels = new ArrayList<SkillLevel>();<NEW_LINE>for (int j = 0; j < context.lengthValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels.Length"); j++) {<NEW_LINE>SkillLevel skillLevel = new SkillLevel();<NEW_LINE>skillLevel.setSkillLevelId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].SkillLevelId"));<NEW_LINE>skillLevel.setLevel(context.integerValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Level"));<NEW_LINE>Skill skill = new Skill();<NEW_LINE>skill.setSkillGroupId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.SkillGroupId"));<NEW_LINE>skill.setInstanceId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.InstanceId"));<NEW_LINE>skill.setSkillGroupName(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.SkillGroupName"));<NEW_LINE>skill.setSkillGroupDescription(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.SkillGroupDescription"));<NEW_LINE>skillLevel.setSkill(skill);<NEW_LINE>skillLevels.add(skillLevel);<NEW_LINE>}<NEW_LINE>user.setSkillLevels(skillLevels);<NEW_LINE>list.add(user);<NEW_LINE>}<NEW_LINE>users.setList(list);<NEW_LINE>listUsersOfRoleResponse.setUsers(users);<NEW_LINE>return listUsersOfRoleResponse;<NEW_LINE>}
(context.stringValue("ListUsersOfRoleResponse.RequestId"));
101,317
final BatchGetCustomDataIdentifiersResult executeBatchGetCustomDataIdentifiers(BatchGetCustomDataIdentifiersRequest batchGetCustomDataIdentifiersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchGetCustomDataIdentifiersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchGetCustomDataIdentifiersRequest> request = null;<NEW_LINE>Response<BatchGetCustomDataIdentifiersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchGetCustomDataIdentifiersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetCustomDataIdentifiersRequest));<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, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetCustomDataIdentifiers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchGetCustomDataIdentifiersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchGetCustomDataIdentifiersResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
537,718
private PropertyNode createDefaultClassConstructor(int classLineNumber, long classToken, long lastToken, IdentNode className, boolean subclass) {<NEW_LINE>final int ctorFinish = finish;<NEW_LINE>final List<Statement> statements;<NEW_LINE>final List<IdentNode> parameters;<NEW_LINE>final long identToken = Token.recast(classToken, TokenType.IDENT);<NEW_LINE>if (subclass) {<NEW_LINE>IdentNode superIdent = createIdentNode(identToken, ctorFinish, SUPER.<MASK><NEW_LINE>IdentNode argsIdent = createIdentNode(identToken, ctorFinish, "args").setIsRestParameter();<NEW_LINE>Expression spreadArgs = new UnaryNode(Token.recast(classToken, TokenType.SPREAD_ARGUMENT), argsIdent);<NEW_LINE>CallNode superCall = new CallNode(classLineNumber, classToken, ctorFinish, superIdent, Collections.singletonList(spreadArgs), false);<NEW_LINE>statements = Collections.singletonList(new ExpressionStatement(classLineNumber, classToken, ctorFinish, superCall));<NEW_LINE>parameters = Collections.singletonList(argsIdent);<NEW_LINE>} else {<NEW_LINE>statements = Collections.emptyList();<NEW_LINE>parameters = Collections.emptyList();<NEW_LINE>}<NEW_LINE>Block body = new Block(classToken, ctorFinish, Block.IS_BODY, statements);<NEW_LINE>IdentNode ctorName = className != null ? className : createIdentNode(identToken, ctorFinish, "constructor");<NEW_LINE>ParserContextFunctionNode function = createParserContextFunctionNode(ctorName, classToken, FunctionNode.Kind.NORMAL, classLineNumber, parameters);<NEW_LINE>function.setLastToken(lastToken);<NEW_LINE>function.setFlag(FunctionNode.IS_METHOD);<NEW_LINE>function.setFlag(FunctionNode.IS_CLASS_CONSTRUCTOR);<NEW_LINE>if (subclass) {<NEW_LINE>function.setFlag(FunctionNode.IS_SUBCLASS_CONSTRUCTOR);<NEW_LINE>function.setFlag(FunctionNode.HAS_DIRECT_SUPER);<NEW_LINE>}<NEW_LINE>if (className == null) {<NEW_LINE>function.setFlag(FunctionNode.IS_ANONYMOUS);<NEW_LINE>}<NEW_LINE>PropertyNode constructor = new PropertyNode(classToken, ctorFinish, ctorName, createFunctionNode(function, classToken, ctorName, parameters, FunctionNode.Kind.NORMAL, classLineNumber, body), null, null, false, false);<NEW_LINE>return constructor;<NEW_LINE>}
getName()).setIsDirectSuper();
1,751,796
private void layout() {<NEW_LINE>assert !isLayouted() : "Already layouted";<NEW_LINE>final int wordSize = ConfigurationValues.getTarget().wordSize;<NEW_LINE>int offset = 0;<NEW_LINE>for (Entry<CGlobalDataImpl<?>, CGlobalDataInfo> entry : map.entrySet()) {<NEW_LINE>CGlobalDataImpl<?> data = entry.getKey();<NEW_LINE>CGlobalDataInfo info = entry.getValue();<NEW_LINE>int size;<NEW_LINE>byte[] bytes = null;<NEW_LINE>if (data.bytesSupplier != null) {<NEW_LINE>bytes = data.bytesSupplier.get();<NEW_LINE>size = bytes.length;<NEW_LINE>} else {<NEW_LINE>if (data.sizeSupplier != null) {<NEW_LINE>size = data.sizeSupplier.getAsInt();<NEW_LINE>} else {<NEW_LINE>assert data.symbolName != null : "CGlobalData without bytes, size, or referenced symbol";<NEW_LINE>size = wordSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>offset += size;<NEW_LINE>// align<NEW_LINE>offset = (offset + (wordSize - 1)) & ~(wordSize - 1);<NEW_LINE>}<NEW_LINE>totalSize = offset;<NEW_LINE>assert isLayouted();<NEW_LINE>}
info.assign(offset, bytes);
403,969
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN_PING, (String) msg);<NEW_LINE>if (parser.matches()) {<NEW_LINE>if (channel != null) {<NEW_LINE>channel.writeAndFlush(new // keep-alive response<NEW_LINE>NetworkMessage(// keep-alive response<NEW_LINE>"&&" + parser.next() + "\r\n", remoteAddress));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>parser = new Parser(PATTERN_DATA, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setValid(parser.next().equals("A"));<NEW_LINE>position.<MASK><NEW_LINE>position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN));<NEW_LINE>position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN));<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));<NEW_LINE>position.setCourse(parser.nextDouble());<NEW_LINE>position.set(Position.PREFIX_TEMP + 1, parser.nextInt());<NEW_LINE>position.set(Position.KEY_STATUS, parser.nextHexLong());<NEW_LINE>position.set(Position.KEY_EVENT, parser.nextInt());<NEW_LINE>return position;<NEW_LINE>}
setTime(parser.nextDateTime());
472,991
public void paginatingChannels() {<NEW_LINE>// Get the first 10 channels<NEW_LINE>FilterObject filter = Filters.in("members", "thierry");<NEW_LINE>int offset = 0;<NEW_LINE>int limit = 10;<NEW_LINE>QuerySort<Channel> sort = new QuerySort<>();<NEW_LINE>int messageLimit = 0;<NEW_LINE>int memberLimit = 0;<NEW_LINE>QueryChannelsRequest request = new QueryChannelsRequest(filter, offset, <MASK><NEW_LINE>client.queryChannels(request).enqueue(result -> {<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>List<Channel> channels = result.data();<NEW_LINE>} else {<NEW_LINE>// Handle result.error()<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Get the second 10 channels<NEW_LINE>// Skips first 10<NEW_LINE>int nextOffset = 10;<NEW_LINE>QueryChannelsRequest nextRequest = new QueryChannelsRequest(filter, nextOffset, limit, sort, messageLimit, memberLimit);<NEW_LINE>client.queryChannels(nextRequest).enqueue(result -> {<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>List<Channel> channels = result.data();<NEW_LINE>} else {<NEW_LINE>// Handle result.error()<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
limit, sort, messageLimit, memberLimit);
1,012,823
public void bind(Name name, Object obj) throws NamingException {<NEW_LINE>if (__root.isLocked())<NEW_LINE>throw new NamingException("This context is immutable");<NEW_LINE>Name cname = __root.toCanonicalName(name);<NEW_LINE>if (cname == null)<NEW_LINE>throw new NamingException("Name is null");<NEW_LINE>if (cname.size() == 0)<NEW_LINE>throw new NamingException("Name is empty");<NEW_LINE>// if no subcontexts, just bind it<NEW_LINE>if (cname.size() == 1) {<NEW_LINE>// get the object to be bound<NEW_LINE>Object objToBind = NamingManager.getStateToBind(obj, name, this, _env);<NEW_LINE>// Check for Referenceable<NEW_LINE>if (objToBind instanceof Referenceable) {<NEW_LINE>objToBind = ((Referenceable) objToBind).getReference();<NEW_LINE>}<NEW_LINE>// anything else we should be able to bind directly<NEW_LINE>__root.addBinding(cname, objToBind);<NEW_LINE>} else {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("Checking for existing binding for name={} for first element of name={}", cname<MASK><NEW_LINE>getContext(cname).bind(cname.getSuffix(1), obj);<NEW_LINE>}<NEW_LINE>}
, cname.get(0));
1,671,589
// for test<NEW_LINE>SpanBo newSpanBo(TSpan tSpan) {<NEW_LINE><MASK><NEW_LINE>spanBo.setAgentId(tSpan.getAgentId());<NEW_LINE>spanBo.setApplicationId(tSpan.getApplicationName());<NEW_LINE>spanBo.setAgentStartTime(tSpan.getAgentStartTime());<NEW_LINE>final TransactionId transactionId = newTransactionId(tSpan.getTransactionId(), spanBo.getAgentId());<NEW_LINE>spanBo.setTransactionId(transactionId);<NEW_LINE>spanBo.setSpanId(tSpan.getSpanId());<NEW_LINE>spanBo.setParentSpanId(tSpan.getParentSpanId());<NEW_LINE>spanBo.setStartTime(tSpan.getStartTime());<NEW_LINE>spanBo.setElapsed(tSpan.getElapsed());<NEW_LINE>spanBo.setRpc(tSpan.getRpc());<NEW_LINE>spanBo.setServiceType(tSpan.getServiceType());<NEW_LINE>spanBo.setEndPoint(tSpan.getEndPoint());<NEW_LINE>spanBo.setFlag(tSpan.getFlag());<NEW_LINE>spanBo.setApiId(tSpan.getApiId());<NEW_LINE>spanBo.setErrCode(tSpan.getErr());<NEW_LINE>spanBo.setAcceptorHost(tSpan.getAcceptorHost());<NEW_LINE>spanBo.setRemoteAddr(tSpan.getRemoteAddr());<NEW_LINE>spanBo.setLoggingTransactionInfo(tSpan.getLoggingTransactionInfo());<NEW_LINE>// FIXME (2015.03) Legacy - applicationServiceType added in v1.1.0<NEW_LINE>// applicationServiceType is not saved for older versions where applicationServiceType does not exist.<NEW_LINE>if (tSpan.isSetApplicationServiceType()) {<NEW_LINE>spanBo.setApplicationServiceType(tSpan.getApplicationServiceType());<NEW_LINE>} else {<NEW_LINE>spanBo.setApplicationServiceType(tSpan.getServiceType());<NEW_LINE>}<NEW_LINE>spanBo.setParentApplicationId(tSpan.getParentApplicationName());<NEW_LINE>spanBo.setParentApplicationServiceType(tSpan.getParentApplicationType());<NEW_LINE>// FIXME span.errCode contains error of span and spanEvent<NEW_LINE>// because exceptionInfo is the error information of span itself, exceptionInfo can be null even if errCode is not 0<NEW_LINE>final TIntStringValue exceptionInfo = tSpan.getExceptionInfo();<NEW_LINE>if (exceptionInfo != null) {<NEW_LINE>spanBo.setExceptionInfo(exceptionInfo.getIntValue(), exceptionInfo.getStringValue());<NEW_LINE>}<NEW_LINE>List<AnnotationBo> annotationBoList = buildAnnotationList(tSpan.getAnnotations());<NEW_LINE>spanBo.setAnnotationBoList(annotationBoList);<NEW_LINE>return spanBo;<NEW_LINE>}
final SpanBo spanBo = new SpanBo();
229,748
private boolean isObjectLocal(Value localOrRef, SootMethod sm, boolean includePrimitiveDataFlowIfAvailable) {<NEW_LINE>if (localOrRef instanceof StaticFieldRef) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (dfa.printDebug()) {<NEW_LINE>logger.debug(" CLOA testing if " + localOrRef + " is local in " + sm);<NEW_LINE>}<NEW_LINE>SmartMethodLocalObjectsAnalysis smloa = getMethodLocalObjectsAnalysis(sm, includePrimitiveDataFlowIfAvailable);<NEW_LINE>if (localOrRef instanceof InstanceFieldRef) {<NEW_LINE>InstanceFieldRef ifr = (InstanceFieldRef) localOrRef;<NEW_LINE>if (ifr.getBase().equivTo(smloa.getThisLocal())) {<NEW_LINE>return isFieldLocal(ifr.getFieldRef().resolve());<NEW_LINE>} else {<NEW_LINE>// if referred object is local, then find out if field is local in that object<NEW_LINE>if (isObjectLocal(ifr.getBase(), sm, includePrimitiveDataFlowIfAvailable)) {<NEW_LINE>boolean retval = loa.isFieldLocalToParent(ifr.<MASK><NEW_LINE>if (dfa.printDebug()) {<NEW_LINE>logger.debug(" " + (retval ? "local" : "shared"));<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>} else {<NEW_LINE>if (dfa.printDebug()) {<NEW_LINE>logger.debug(" shared");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO Prepare a CallLocalityContext!<NEW_LINE>CallLocalityContext context = getContextFor(sm);<NEW_LINE>boolean retval = smloa.isObjectLocal(localOrRef, context);<NEW_LINE>if (dfa.printDebug()) {<NEW_LINE>logger.debug(" " + (retval ? "local" : "shared"));<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>}
getFieldRef().resolve());
341,448
public JSONObject buildOptions4InternalAddon(String appId, String addonId) {<NEW_LINE>log.<MASK><NEW_LINE>if (INTERNAL_ADDON_DEVELOPMENT_META.equals(addonId)) {<NEW_LINE>return new JSONObject();<NEW_LINE>}<NEW_LINE>if (INTERNAL_ADDON_APP_META.equals(addonId)) {<NEW_LINE>return new JSONObject();<NEW_LINE>}<NEW_LINE>AppAddonQueryCondition condition = AppAddonQueryCondition.builder().appId(appId).addonId(addonId).addonName(addonId).build();<NEW_LINE>AppAddonDO appAddon = appAddonService.get(condition);<NEW_LINE>if (appAddon == null) {<NEW_LINE>log.error("action=packService|buildOptions4InternalAddon|ERROR|message=addon not exists|appId={}|" + "addonId={}", appId, addonId);<NEW_LINE>throw new AppException(AppErrorCode.INVALID_USER_ARGS, String.format("addon not exists|appId=%s|addonId=%s", appId, addonId));<NEW_LINE>}<NEW_LINE>JSONObject addonConfigJson = JSON.parseObject(appAddon.getAddonConfig());<NEW_LINE>if (addonConfigJson.containsKey("common")) {<NEW_LINE>return addonConfigJson.getJSONObject("common");<NEW_LINE>}<NEW_LINE>return new JSONObject();<NEW_LINE>}
info("action=packService|buildOptions4InternalAddon|enter|appId={}|addonId={}|", appId, addonId);
1,674,253
final CreateResponseHeadersPolicyResult executeCreateResponseHeadersPolicy(CreateResponseHeadersPolicyRequest createResponseHeadersPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createResponseHeadersPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateResponseHeadersPolicyRequest> request = null;<NEW_LINE>Response<CreateResponseHeadersPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateResponseHeadersPolicyRequestMarshaller().marshall(super.beforeMarshalling(createResponseHeadersPolicyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateResponseHeadersPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateResponseHeadersPolicyResult> responseHandler = new StaxResponseHandler<CreateResponseHeadersPolicyResult>(new CreateResponseHeadersPolicyResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
373,999
private void callClassModuleBuilder(String name, boolean is_singleton) {<NEW_LINE>MethodGenerator mg = cg_.getMethodGenerator();<NEW_LINE>int i = mg.newLocal(Types.RUBY_VALUE_TYPE);<NEW_LINE>mg.storeLocal(i);<NEW_LINE>String uniqueName = NameFactory.createClassnameForClassModuleBuilder(extra_, script_name_, name);<NEW_LINE>Type builder = Type.getType("L" + uniqueName + ";");<NEW_LINE>mg.newInstance(builder);<NEW_LINE>mg.dup();<NEW_LINE>mg.<MASK><NEW_LINE>mg.loadLocal(i);<NEW_LINE>mg.pushNull();<NEW_LINE>mg.pushNull();<NEW_LINE>mg.loadLocal(i);<NEW_LINE>mg.invokeVirtual(builder, CgUtil.getMethod("invoke", Types.RUBY_VALUE_TYPE, Types.RUBY_VALUE_TYPE, Types.RUBY_ARRAY_TYPE, Types.RUBY_BLOCK_TYPE, Types.RUBY_MODULE_TYPE));<NEW_LINE>switchToNewClassGenerator(new ClassGeneratorForClassModuleBuilder(uniqueName, script_name_, null, is_singleton));<NEW_LINE>}
invokeConstructor(builder, CgUtil.CONSTRUCTOR);
857,043
private Element createXSDEnumeration(final String name, final int AD_Reference_ID) {<NEW_LINE>Check.assume(toJavaName(name).equals(name), "'name' param '" + name + "' equals '" + toJavaName(name) + "'");<NEW_LINE>final List<ADRefListItem> listValues = new ArrayList<>(adReferenceDAO.retrieveListItems(AD_Reference_ID));<NEW_LINE>if (listValues.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final HashMap<String, String> map = new HashMap<>(listValues.size());<NEW_LINE>// final ValueNamePair[] list = MRefList.getList(ctx, AD_Reference_ID, false);<NEW_LINE>for (final ADRefListItem listValue : listValues) {<NEW_LINE>final <MASK><NEW_LINE>// 08456: Take valueName instead of name when generating enumerations (Names can be equal!)<NEW_LINE>final String valueName = listValue.getValueName();<NEW_LINE>map.put(toJavaName(value), toJavaName(valueName));<NEW_LINE>}<NEW_LINE>return createXSDEnumeration(name, map);<NEW_LINE>}
String value = listValue.getValue();
1,022,685
public static DescribeDcdnsecServiceResponse unmarshall(DescribeDcdnsecServiceResponse describeDcdnsecServiceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnsecServiceResponse.setRequestId(_ctx.stringValue("DescribeDcdnsecServiceResponse.RequestId"));<NEW_LINE>describeDcdnsecServiceResponse.setInstanceId(_ctx.stringValue("DescribeDcdnsecServiceResponse.InstanceId"));<NEW_LINE>describeDcdnsecServiceResponse.setInternetChargeType(_ctx.stringValue("DescribeDcdnsecServiceResponse.InternetChargeType"));<NEW_LINE>describeDcdnsecServiceResponse.setStartTime(_ctx.stringValue("DescribeDcdnsecServiceResponse.StartTime"));<NEW_LINE>describeDcdnsecServiceResponse.setEndTime(_ctx.stringValue("DescribeDcdnsecServiceResponse.EndTime"));<NEW_LINE>describeDcdnsecServiceResponse.setChangingChargeType(_ctx.stringValue("DescribeDcdnsecServiceResponse.ChangingChargeType"));<NEW_LINE>describeDcdnsecServiceResponse.setChangingAffectTime(_ctx.stringValue("DescribeDcdnsecServiceResponse.ChangingAffectTime"));<NEW_LINE>describeDcdnsecServiceResponse.setVersion(_ctx.stringValue("DescribeDcdnsecServiceResponse.Version"));<NEW_LINE>describeDcdnsecServiceResponse.setFlowType(_ctx.stringValue("DescribeDcdnsecServiceResponse.FlowType"));<NEW_LINE>describeDcdnsecServiceResponse.setRequestType(_ctx.stringValue("DescribeDcdnsecServiceResponse.RequestType"));<NEW_LINE>describeDcdnsecServiceResponse.setDomainNum<MASK><NEW_LINE>List<LockReason> operationLocks = new ArrayList<LockReason>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnsecServiceResponse.OperationLocks.Length"); i++) {<NEW_LINE>LockReason lockReason = new LockReason();<NEW_LINE>lockReason.setLockReason(_ctx.stringValue("DescribeDcdnsecServiceResponse.OperationLocks[" + i + "].LockReason"));<NEW_LINE>operationLocks.add(lockReason);<NEW_LINE>}<NEW_LINE>describeDcdnsecServiceResponse.setOperationLocks(operationLocks);<NEW_LINE>return describeDcdnsecServiceResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeDcdnsecServiceResponse.DomainNum"));
216,938
public static void insertTask(TaskEntity taskEntity, ExecutionEntity execution, boolean fireCreateEvent, boolean addEntityLinks) {<NEW_LINE>// Inherit tenant id (if applicable)<NEW_LINE>if (execution != null && execution.getTenantId() != null) {<NEW_LINE>taskEntity.setTenantId(execution.getTenantId());<NEW_LINE>}<NEW_LINE>if (execution != null) {<NEW_LINE>taskEntity.setExecutionId(execution.getId());<NEW_LINE>taskEntity.setProcessInstanceId(execution.getProcessInstanceId());<NEW_LINE>taskEntity.setProcessDefinitionId(execution.getProcessDefinitionId());<NEW_LINE>}<NEW_LINE>insertTask(taskEntity, fireCreateEvent);<NEW_LINE>if (execution != null) {<NEW_LINE>if (CountingEntityUtil.isExecutionRelatedEntityCountEnabled(execution)) {<NEW_LINE>CountingExecutionEntity countingExecutionEntity = (CountingExecutionEntity) execution;<NEW_LINE>countingExecutionEntity.setTaskCount(countingExecutionEntity.getTaskCount() + 1);<NEW_LINE>}<NEW_LINE>if (addEntityLinks) {<NEW_LINE>EntityLinkUtil.createEntityLinks(execution.getProcessInstanceId(), execution.getId(), taskEntity.getTaskDefinitionKey(), taskEntity.getId(), ScopeTypes.TASK);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();<NEW_LINE>if (fireCreateEvent && eventDispatcher != null && eventDispatcher.isEnabled()) {<NEW_LINE>if (taskEntity.getAssignee() != null) {<NEW_LINE>eventDispatcher.dispatchEvent(FlowableEventBuilder.createEntityEvent(FlowableEngineEventType.TASK_ASSIGNED, taskEntity), processEngineConfiguration.getEngineCfgKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processEngineConfiguration.getActivityInstanceEntityManager().recordTaskCreated(taskEntity, execution);<NEW_LINE>}
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();
476,629
public DruidFilter deserialize(JsonParser jp, DeserializationContext context) throws IOException {<NEW_LINE>ObjectMapper mapper = (ObjectMapper) jp.getCodec();<NEW_LINE>ObjectNode root = mapper.readTree(jp);<NEW_LINE>boolean filterKnowsItsType = root.has("type");<NEW_LINE>if (filterKnowsItsType) {<NEW_LINE>DruidCompareOp type = DruidCompareOp.get(root.get("type").asText());<NEW_LINE>switch(type) {<NEW_LINE>case TYPE_SELECTOR:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.toString(), DruidSelectorFilter.class);<NEW_LINE>}<NEW_LINE>case TYPE_BOUND:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.toString(), DruidBoundFilter.class);<NEW_LINE>}<NEW_LINE>case TYPE_IN:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.toString(), DruidInFilter.class);<NEW_LINE>}<NEW_LINE>case TYPE_REGEX:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.<MASK><NEW_LINE>}<NEW_LINE>case TYPE_SEARCH:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.toString(), DruidSearchFilter.class);<NEW_LINE>}<NEW_LINE>case AND:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.toString(), DruidAndFilter.class);<NEW_LINE>}<NEW_LINE>case OR:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.toString(), DruidOrFilter.class);<NEW_LINE>}<NEW_LINE>case NOT:<NEW_LINE>{<NEW_LINE>return mapper.readValue(root.toString(), DruidNotFilter.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (filterKnowsItsType && root.get("type").asText().equals(TYPE_SELECTOR.getCompareOp())) {<NEW_LINE>return mapper.readValue(root.toString(), DruidSelectorFilter.class);<NEW_LINE>}<NEW_LINE>return mapper.readValue(root.toString(), DruidSelectorFilter.class);<NEW_LINE>}
toString(), DruidRegexFilter.class);
1,384,598
public void start(Stage stage) {<NEW_LINE>stage.setTitle("Touch Suite");<NEW_LINE>Group root = new Group();<NEW_LINE>Scene scene = new Scene(root, WIDTH, HEIGHT);<NEW_LINE>scene.setFill(Color.BEIGE);<NEW_LINE>root.getChildren().add(launcher);<NEW_LINE>root.<MASK><NEW_LINE>register("Hello Gestures", HelloGestures.class, HelloGestures.info());<NEW_LINE>register("Hello Multi-touch", HelloMultiTouch.class, HelloMultiTouch.info());<NEW_LINE>register("List Selection Simple", ListSelectionSimple.class, ListSelectionSimple.info());<NEW_LINE>register("List Selection", ListSelection.class, ListSelection.info());<NEW_LINE>register("Draw Line", DrawLine.class, DrawLine.info());<NEW_LINE>register("Moving Stones", MovingStones.class, MovingStones.info());<NEW_LINE>register("Consume Touches", ConsumeTouches.class, ConsumeTouches.info());<NEW_LINE>register("Image Viewer", ImageViewer.class, ImageViewer.info());<NEW_LINE>register("Image Board", ImageBoard.class, ImageBoard.info());<NEW_LINE>register("Controls", Controls.class, Controls.info());<NEW_LINE>if (DEBUG) {<NEW_LINE>register("Event Logger", EventLogger.class, EventLogger.info());<NEW_LINE>}<NEW_LINE>stage.setScene(scene);<NEW_LINE>stage.show();<NEW_LINE>}
getChildren().add(info);
407,842
public ListPortalsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPortalsResult listPortalsResult = new ListPortalsResult();<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 listPortalsResult;<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("portalSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPortalsResult.setPortalSummaries(new ListUnmarshaller<PortalSummary>(PortalSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPortalsResult.setNextToken(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 listPortalsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,467,203
// See CompatibilityReport for the report format.<NEW_LINE>private void processLine(String s) {<NEW_LINE>String message = s.substring(s.indexOf(':') + 1);<NEW_LINE>if (s.startsWith("[RS-COMPAT]")) {<NEW_LINE>isRestSpecCompatible = Boolean.parseBoolean(message.trim());<NEW_LINE>} else if (s.startsWith("[MD-COMPAT]")) {<NEW_LINE>isModelCompatible = Boolean.parseBoolean(message.trim());<NEW_LINE>} else if (s.startsWith("[RS-C]")) {<NEW_LINE>restSpecCompatibility.add(new FileCompatibility(message, true));<NEW_LINE>} else if (s.startsWith("[RS-I]")) {<NEW_LINE>restSpecCompatibility.add(new FileCompatibility(message, false));<NEW_LINE>} else if (s.startsWith("[MD-C]")) {<NEW_LINE>modelCompatibility.add(new FileCompatibility(message, true));<NEW_LINE>} else if (s.startsWith("[MD-I]")) {<NEW_LINE>modelCompatibility.add(new FileCompatibility(message, false));<NEW_LINE>} else if (s.startsWith("[SCHEMA-ANNOTATION-COMPAT]")) {<NEW_LINE>isAnnotationCompatible = Boolean.<MASK><NEW_LINE>}<NEW_LINE>}
parseBoolean(message.trim());
1,137,697
IQueryBuilder<I_AD_User_Record_Access> query(@NonNull final RecordAccessQuery query) {<NEW_LINE>final IQueryBuilder<I_AD_User_Record_Access> queryBuilder = queryBL.createQueryBuilder(I_AD_User_Record_Access.class);<NEW_LINE>//<NEW_LINE>// Records<NEW_LINE>final ImmutableSet<TableRecordReference> recordRefs = query.getRecordRefs();<NEW_LINE>if (!recordRefs.isEmpty()) {<NEW_LINE>final ICompositeQueryFilter<I_AD_User_Record_Access> recordRefsFilter = queryBuilder.addCompositeQueryFilter().setJoinOr();<NEW_LINE>for (final TableRecordReference recordRef : recordRefs) {<NEW_LINE>recordRefsFilter.addCompositeQueryFilter().setJoinAnd().addEqualsFilter(I_AD_User_Record_Access.COLUMNNAME_AD_Table_ID, recordRef.getAD_Table_ID()).addEqualsFilter(I_AD_User_Record_Access.COLUMNNAME_Record_ID, recordRef.getRecord_ID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Permissions<NEW_LINE>final ImmutableSet<Access> permissions = query.getPermissions();<NEW_LINE>if (!permissions.isEmpty()) {<NEW_LINE>queryBuilder.addInArrayFilter(I_AD_User_Record_Access.COLUMNNAME_Access, permissions);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Principals<NEW_LINE>if (!query.getPrincipals().isEmpty()) {<NEW_LINE>final Set<UserId> userIds = new HashSet<>();<NEW_LINE>final Set<UserGroupId> userGroupIds = new HashSet<>();<NEW_LINE>for (final Principal principal : query.getPrincipals()) {<NEW_LINE>if (principal.getUserId() != null) {<NEW_LINE>userIds.add(principal.getUserId());<NEW_LINE>} else if (principal.getUserGroupId() != null) {<NEW_LINE>userGroupIds.add(principal.getUserGroupId());<NEW_LINE>} else {<NEW_LINE>// shall not happen<NEW_LINE>throw new AdempiereException("Invalid principal: " + principal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!userIds.isEmpty() || !userGroupIds.isEmpty()) {<NEW_LINE>final ICompositeQueryFilter<I_AD_User_Record_Access> principalsFilter = queryBuilder.addCompositeQueryFilter().setJoinOr();<NEW_LINE>if (!userIds.isEmpty()) {<NEW_LINE>principalsFilter.addInArrayFilter(I_AD_User_Record_Access.COLUMNNAME_AD_User_ID, userIds);<NEW_LINE>}<NEW_LINE>if (!userGroupIds.isEmpty()) {<NEW_LINE>principalsFilter.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Issuer<NEW_LINE>if (query.getIssuer() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_User_Record_Access.COLUMNNAME_PermissionIssuer, query.getIssuer().getCode());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>return queryBuilder;<NEW_LINE>}
addInArrayFilter(I_AD_User_Record_Access.COLUMNNAME_AD_UserGroup_ID, userGroupIds);
19,762
private void deleteNullFieldRecord(int fk) {<NEW_LINE>Column[] newColumns = columns.clone();<NEW_LINE>for (int i = 0; i < newColumns.length; i++) {<NEW_LINE>newColumns[i] = <MASK><NEW_LINE>}<NEW_LINE>int size = this.size;<NEW_LINE>int total = 0;<NEW_LINE>int count = columns.length;<NEW_LINE>Column[] columns = this.columns;<NEW_LINE>Column col = columns[fk];<NEW_LINE>for (int i = 1; i <= size; i++) {<NEW_LINE>if (col.getData(i) != null) {<NEW_LINE>for (int j = 0; j < count; j++) {<NEW_LINE>if (newColumns[j] instanceof NullColumn) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (newColumns[j] instanceof SeqRefColumn) {<NEW_LINE>int seq = ((SeqRefColumn) columns[j]).getSeq(i);<NEW_LINE>((SeqRefColumn) newColumns[j]).addData(seq);<NEW_LINE>} else {<NEW_LINE>newColumns[j].addData(columns[j].getData(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>total++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.columns = newColumns;<NEW_LINE>this.size = total;<NEW_LINE>}
columns[i].clone();
354,240
final DeleteWorkteamResult executeDeleteWorkteam(DeleteWorkteamRequest deleteWorkteamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteWorkteamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteWorkteamRequest> request = null;<NEW_LINE>Response<DeleteWorkteamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteWorkteamRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteWorkteamRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteWorkteam");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteWorkteamResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteWorkteamResultJsonUnmarshaller());<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,438,804
private void initFromEquinoxAD() {<NEW_LINE>EquinoxAttributeDefinition delegate = (EquinoxAttributeDefinition) this.delegate;<NEW_LINE>Set<String> supportedExtensions = delegate.getExtensionUris();<NEW_LINE>if (supportedExtensions != null && supportedExtensions.contains(XMLConfigConstants.METATYPE_EXTENSION_URI)) {<NEW_LINE>Map<String, String> extensions = delegate.getExtensionAttributes(XMLConfigConstants.METATYPE_EXTENSION_URI);<NEW_LINE>String typeStr = extensions.get(ATTRIBUTE_TYPE_NAME);<NEW_LINE>if (typeStr != null) {<NEW_LINE>Integer cachedType = MetaTypeFactoryImpl.IBM_TYPES.get(typeStr);<NEW_LINE>if (cachedType != null) {<NEW_LINE>this.cachedType = cachedType;<NEW_LINE>} else {<NEW_LINE>throw new NullPointerException("Unrecognized ibm type: '" + typeStr + "' in AD " + delegate.getID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>isFinal = extensions.get(FINAL_ATTR_NAME) != null;<NEW_LINE>isFlat = extensions.get(FLAT_ATTR_NAME) != null;<NEW_LINE>copyOf = extensions.get(COPY_OF_ATTR_NAME);<NEW_LINE>isUnique = extensions.get(UNIQUE_ATTR_NAME) != null;<NEW_LINE>referencePid = extensions.get(ATTRIBUTE_REFERENCE_NAME);<NEW_LINE>service = extensions.get(SERVICE);<NEW_LINE>serviceFilter = extensions.get(SERVICE_FILTER);<NEW_LINE><MASK><NEW_LINE>uniqueCategory = extensions.get(UNIQUE_ATTR_NAME);<NEW_LINE>variable = extensions.get(VARIABLE_ATTR_NAME);<NEW_LINE>beta = "true".equals(extensions.get(BETA_NAME));<NEW_LINE>obscure = extensions.get(OBSCURE_NAME) != null;<NEW_LINE>String variableResolution = extensions.get(VARIABLE_SUBSTITUTION_NAME);<NEW_LINE>if (variableResolution != null && FALSE.equalsIgnoreCase(variableResolution))<NEW_LINE>resolveVariables = false;<NEW_LINE>}<NEW_LINE>if (supportedExtensions != null && supportedExtensions.contains(XMLConfigConstants.METATYPE_UI_EXTENSION_URI)) {<NEW_LINE>Map<String, String> uiExtensions = delegate.getExtensionAttributes(XMLConfigConstants.METATYPE_UI_EXTENSION_URI);<NEW_LINE>group = uiExtensions.get(GROUP_ATTR_NAME);<NEW_LINE>requiresFalse = uiExtensions.get(REQUIRES_FALSE_ATTR_NAME);<NEW_LINE>requiresTrue = uiExtensions.get(REQUIRES_TRUE_ATTR_NAME);<NEW_LINE>if (uiExtensions.get(UI_REFERENCE) != null) {<NEW_LINE>uiReference = Arrays.asList(uiExtensions.get(UI_REFERENCE).split("[, ]+"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
rename = extensions.get(RENAME_ATTR_NAME);
1,567,715
private Mono<Response<CheckNameAvailabilityResultInner>> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest checkNameAvailabilityRequest, 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 (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 (checkNameAvailabilityRequest == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter checkNameAvailabilityRequest is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>checkNameAvailabilityRequest.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(<MASK><NEW_LINE>}
), checkNameAvailabilityRequest, accept, context);
614,460
// / Extract unsatisfiable core example with AssertAndTrack<NEW_LINE>public void unsatCoreAndProofExample2(Context ctx) {<NEW_LINE>System.out.println("UnsatCoreAndProofExample2");<NEW_LINE>Log.append("UnsatCoreAndProofExample2");<NEW_LINE>Solver solver = ctx.mkSolver();<NEW_LINE>BoolExpr pa = ctx.mkBoolConst("PredA");<NEW_LINE>BoolExpr pb = ctx.mkBoolConst("PredB");<NEW_LINE>BoolExpr pc = ctx.mkBoolConst("PredC");<NEW_LINE>BoolExpr pd = ctx.mkBoolConst("PredD");<NEW_LINE>BoolExpr f1 = ctx.mkAnd(new BoolExpr[] { pa, pb, pc });<NEW_LINE>BoolExpr f2 = ctx.mkAnd(new BoolExpr[] { pa, ctx.mkNot(pb), pc });<NEW_LINE>BoolExpr f3 = ctx.mkOr(ctx.mkNot(pa), ctx.mkNot(pc));<NEW_LINE>BoolExpr f4 = pd;<NEW_LINE>BoolExpr p1 = ctx.mkBoolConst("P1");<NEW_LINE>BoolExpr p2 = ctx.mkBoolConst("P2");<NEW_LINE>BoolExpr p3 = ctx.mkBoolConst("P3");<NEW_LINE>BoolExpr p4 = ctx.mkBoolConst("P4");<NEW_LINE>solver.assertAndTrack(f1, p1);<NEW_LINE><MASK><NEW_LINE>solver.assertAndTrack(f3, p3);<NEW_LINE>solver.assertAndTrack(f4, p4);<NEW_LINE>Status result = solver.check();<NEW_LINE>if (result == Status.UNSATISFIABLE) {<NEW_LINE>System.out.println("unsat");<NEW_LINE>System.out.println("core: ");<NEW_LINE>for (Expr<?> c : solver.getUnsatCore()) {<NEW_LINE>System.out.println(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
solver.assertAndTrack(f2, p2);
22,451
public void init(Map<String, Object> params) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>BackgroundTask<T, V> task = (BackgroundTask<T, V>) params.get("task");<NEW_LINE>String title = (<MASK><NEW_LINE>if (title != null) {<NEW_LINE>setCaption(title);<NEW_LINE>}<NEW_LINE>String message = (String) params.get("message");<NEW_LINE>if (message != null) {<NEW_LINE>text.setValue(message);<NEW_LINE>}<NEW_LINE>Boolean cancelAllowedNullable = (Boolean) params.get("cancelAllowed");<NEW_LINE>cancelAllowed = BooleanUtils.isTrue(cancelAllowedNullable);<NEW_LINE>cancelButton.setVisible(cancelAllowed);<NEW_LINE>getDialogOptions().setCloseable(cancelAllowed);<NEW_LINE>BackgroundTask<T, V> wrapperTask = new LocalizedTaskWrapper<>(task, this);<NEW_LINE>taskHandler = backgroundWorker.handle(wrapperTask);<NEW_LINE>taskHandler.execute();<NEW_LINE>}
String) params.get("title");
73,525
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>output.writeMessage(1, getHandle());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE>output.writeFloat(4, networkCost_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) != 0)) {<NEW_LINE>output.writeFloat(5, cpuCost_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) != 0)) {<NEW_LINE>output.writeFloat(6, diskCost_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) != 0)) {<NEW_LINE>output.writeFloat(7, memoryCost_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 8, fragmentJson_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) != 0)) {<NEW_LINE>output.writeBool(9, leafFragment_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000080) != 0)) {<NEW_LINE>output.writeMessage(10, getAssignment());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000100) != 0)) {<NEW_LINE>output.writeMessage(11, getForeman());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000200) != 0)) {<NEW_LINE>output.writeInt64(12, memInitial_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000400) != 0)) {<NEW_LINE>output.writeInt64(13, memMax_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000800) != 0)) {<NEW_LINE>output.writeMessage(14, getCredentials());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00001000) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 15, optionsJson_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00002000) != 0)) {<NEW_LINE>output.<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < collector_.size(); i++) {<NEW_LINE>output.writeMessage(17, collector_.get(i));<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
writeMessage(16, getContext());
839,751
protected Object visitLambdaExpression(LambdaExpression node, Object context) {<NEW_LINE>if (optimize) {<NEW_LINE>// TODO: enable optimization related to lambda expression<NEW_LINE>// A mechanism to convert function type back into lambda expression need to exist to enable optimization<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>Expression body = node.getBody();<NEW_LINE>List<String> argumentNames = node.getArguments().stream().map(LambdaArgumentDeclaration::getName).map(Identifier::getValue).collect(toImmutableList());<NEW_LINE>FunctionType functionType = (FunctionType) expressionTypes.get(NodeRef.<MASK><NEW_LINE>checkArgument(argumentNames.size() == functionType.getArgumentTypes().size());<NEW_LINE>return generateVarArgsToMapAdapter(Primitives.wrap(functionType.getReturnType().getJavaType()), functionType.getArgumentTypes().stream().map(Type::getJavaType).map(Primitives::wrap).collect(toImmutableList()), argumentNames, map -> processWithExceptionHandling(body, new LambdaSymbolResolver(map)));<NEW_LINE>}
<Expression>of(node));
694,443
public void process() {<NEW_LINE>try {<NEW_LINE>final InputStream istream = this.getClass().getResourceAsStream("/iris.csv");<NEW_LINE>if (istream == null) {<NEW_LINE>System.out.println("Cannot access data set, make sure the resources are available.");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>final DataSet ds = DataSet.load(istream);<NEW_LINE>// The following ranges are setup for the Iris data set. If you wish to normalize other files you will<NEW_LINE>// need to modify the below function calls other files.<NEW_LINE>ds.normalizeRange(0, 0, 1);<NEW_LINE>ds.normalizeRange(1, 0, 1);<NEW_LINE>ds.normalizeRange(2, 0, 1);<NEW_LINE>ds.normalizeRange(3, 0, 1);<NEW_LINE>final Map<String, Integer> <MASK><NEW_LINE>istream.close();<NEW_LINE>final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 2);<NEW_LINE>final RBFNetwork network = new RBFNetwork(4, 4, 2);<NEW_LINE>network.reset(new MersenneTwisterGenerateRandom());<NEW_LINE>final ScoreFunction score = new ScoreRegressionData(trainingData);<NEW_LINE>final TrainHillClimb train = new TrainHillClimb(true, network, score);<NEW_LINE>performIterations(train, 100000, 0.01, true);<NEW_LINE>queryEquilateral(network, trainingData, species, 0, 1);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>}
species = ds.encodeEquilateral(4);