idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,445,906
public ListRegexMatchSetsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListRegexMatchSetsResult listRegexMatchSetsResult = new ListRegexMatchSetsResult();<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 listRegexMatchSetsResult;<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("NextMarker", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRegexMatchSetsResult.setNextMarker(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RegexMatchSets", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRegexMatchSetsResult.setRegexMatchSets(new ListUnmarshaller<RegexMatchSetSummary>(RegexMatchSetSummaryJsonUnmarshaller.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 listRegexMatchSetsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
800,437
private String toStringSlow() {<NEW_LINE>// Prepare all properties required for building a String, so that we don't have a chance of<NEW_LINE>// building one String with a thread-local StringBuilder while building another String with<NEW_LINE>// the same StringBuilder. See TemporaryThreadLocals for more information.<NEW_LINE>final String sreqId = id().shortText();<NEW_LINE>final String chanId = ch.id().asShortText();<NEW_LINE>final InetSocketAddress raddr = remoteAddress();<NEW_LINE>final InetSocketAddress laddr = localAddress();<NEW_LINE>final InetAddress caddr = clientAddress();<NEW_LINE>final String proto <MASK><NEW_LINE>final String authority = config().virtualHost().defaultHostname();<NEW_LINE>final String path = path();<NEW_LINE>final String method = method().name();<NEW_LINE>// Build the string representation.<NEW_LINE>try (TemporaryThreadLocals tempThreadLocals = TemporaryThreadLocals.acquire()) {<NEW_LINE>final StringBuilder buf = tempThreadLocals.stringBuilder();<NEW_LINE>buf.append("[sreqId=").append(sreqId).append(", chanId=").append(chanId);<NEW_LINE>if (!Objects.equals(caddr, raddr.getAddress())) {<NEW_LINE>buf.append(", caddr=");<NEW_LINE>TextFormatter.appendInetAddress(buf, caddr);<NEW_LINE>}<NEW_LINE>buf.append(", raddr=");<NEW_LINE>TextFormatter.appendSocketAddress(buf, raddr);<NEW_LINE>buf.append(", laddr=");<NEW_LINE>TextFormatter.appendSocketAddress(buf, laddr);<NEW_LINE>buf.append("][").append(proto).append("://").append(authority).append(path).append('#').append(method).append(']');<NEW_LINE>return strVal = buf.toString();<NEW_LINE>}<NEW_LINE>}
= sessionProtocol().uriText();
1,355,517
protected RepositoryModel createRepository(UserModel user, String repository, String action) {<NEW_LINE>boolean isPush = !StringUtils.isEmpty(action) && GIT_RECEIVE_PACK.equals(action);<NEW_LINE>if (GIT_LFS.equals(action)) {<NEW_LINE>// Repository must already exist for any filestore actions<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (isPush) {<NEW_LINE>if (user.canCreate(repository)) {<NEW_LINE>// user is pushing to a new repository<NEW_LINE>// validate name<NEW_LINE>if (repository.startsWith("../")) {<NEW_LINE>logger.error(MessageFormat.format("Illegal relative path in repository name! {0}", repository));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (repository.contains("/../")) {<NEW_LINE>logger.error(MessageFormat.format("Illegal relative path in repository name! {0}", repository));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// confirm valid characters in repository name<NEW_LINE>Character c = StringUtils.findInvalidCharacter(repository);<NEW_LINE>if (c != null) {<NEW_LINE>logger.error(MessageFormat.format("Invalid character '{0}' in repository name {1}!", c, repository));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// create repository<NEW_LINE>RepositoryModel model = new RepositoryModel();<NEW_LINE>model.name = repository;<NEW_LINE>model.addOwner(user.username);<NEW_LINE>model.projectPath = StringUtils.getFirstPathElement(repository);<NEW_LINE>if (model.isUsersPersonalRepository(user.username)) {<NEW_LINE>// personal repository, default to private for user<NEW_LINE>model.authorizationControl = AuthorizationControl.NAMED;<NEW_LINE>model.accessRestriction = AccessRestrictionType.VIEW;<NEW_LINE>} else {<NEW_LINE>// common repository, user default server settings<NEW_LINE>model.authorizationControl = AuthorizationControl.fromName(settings.getString(Keys.git.defaultAuthorizationControl, ""));<NEW_LINE>model.accessRestriction = AccessRestrictionType.fromName(settings.getString(Keys.git.defaultAccessRestriction, "PUSH"));<NEW_LINE>}<NEW_LINE>// create the repository<NEW_LINE>try {<NEW_LINE>repositoryManager.updateRepositoryModel(model.name, model, true);<NEW_LINE>logger.info(MessageFormat.format("{0} created {1} ON-PUSH", user.username, model.name));<NEW_LINE>return repositoryManager.getRepositoryModel(model.name);<NEW_LINE>} catch (GitBlitException e) {<NEW_LINE>logger.error(MessageFormat.format("{0} failed to create repository {1} ON-PUSH!", user.username<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn(MessageFormat.format("{0} is not permitted to create repository {1} ON-PUSH!", user.username, repository));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// repository could not be created or action was not a push<NEW_LINE>return null;<NEW_LINE>}
, model.name), e);
897,147
public void findDevice_bootloader() {<NEW_LINE>Log.d(QtApplication.QtTAG, "findDevice_bootloader");<NEW_LINE>// ???<NEW_LINE>PendingIntent mPermissionIntent = PendingIntent.getBroadcast(this, 0, <MASK><NEW_LINE>// Handle to system USB service?<NEW_LINE>UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);<NEW_LINE>HashMap<String, UsbDevice> deviceList = manager.getDeviceList();<NEW_LINE>Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();<NEW_LINE>if (!deviceIterator.hasNext()) {<NEW_LINE>Log.d(QtApplication.QtTAG, "NO DEVICE FOUND");<NEW_LINE>}<NEW_LINE>while (deviceIterator.hasNext()) {<NEW_LINE>Log.d(QtApplication.QtTAG, "DEVICE FOUND");<NEW_LINE>UsbDevice device = deviceIterator.next();<NEW_LINE>manager.requestPermission(device, mPermissionIntent);<NEW_LINE>// Wait until it gets the permission<NEW_LINE>while (!manager.hasPermission(device)) {<NEW_LINE>;<NEW_LINE>}<NEW_LINE>String Model = device.getDeviceName();<NEW_LINE>int DeviceID = device.getDeviceId();<NEW_LINE>int VID = device.getVendorId();<NEW_LINE>int PID = device.getProductId();<NEW_LINE>Log.d(QtApplication.QtTAG, String.format("Device ID = %d\nVID=0x%04x\nPID=0x%04x\n", DeviceID, VID, PID));<NEW_LINE>if ((VID == 0x03eb) && (PID == 0x2fe4)) {<NEW_LINE>if (!manager.hasPermission(device)) {<NEW_LINE>Log.d(QtApplication.QtTAG, "permission was not granted to the USB device!!!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.d(QtApplication.QtTAG, "MATCH FOUND!");<NEW_LINE>usbfs_path = device.getDeviceName();<NEW_LINE>Log.d(QtApplication.QtTAG, "usbfs_path = " + usbfs_path);<NEW_LINE>connection = manager.openDevice(device);<NEW_LINE>file_descriptor = connection.getFileDescriptor();<NEW_LINE>Log.d(QtApplication.QtTAG, "fd = " + file_descriptor);<NEW_LINE>Log.d(QtApplication.QtTAG, "Returning...");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new Intent(ACTION_USB_PERMISSION), 0);
358,168
public static void rotateCCW(GrayF32 image) {<NEW_LINE>if (image.width != image.height)<NEW_LINE>throw new IllegalArgumentException("Image must be square");<NEW_LINE>int w = image.height / 2 + image.height % 2;<NEW_LINE>int h = image.height / 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, h, y0->{<NEW_LINE>for (int y0 = 0; y0 < h; y0++) {<NEW_LINE>int y1 = image.height - y0 - 1;<NEW_LINE>for (int x0 = 0; x0 < w; x0++) {<NEW_LINE>int x1 = image.width - x0 - 1;<NEW_LINE>int index0 = image.startIndex + y0 * image.stride + x0;<NEW_LINE>int index1 = image.startIndex + x0 * image.stride + y1;<NEW_LINE>int index2 = image.startIndex <MASK><NEW_LINE>int index3 = image.startIndex + x1 * image.stride + y0;<NEW_LINE>float tmp0 = image.data[index0];<NEW_LINE>image.data[index0] = image.data[index1];<NEW_LINE>image.data[index1] = image.data[index2];<NEW_LINE>image.data[index2] = image.data[index3];<NEW_LINE>image.data[index3] = (float) tmp0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
+ y1 * image.stride + x1;
449,051
public static GetNodeGroupResponse unmarshall(GetNodeGroupResponse getNodeGroupResponse, UnmarshallerContext _ctx) {<NEW_LINE>getNodeGroupResponse.setRequestId(_ctx.stringValue("GetNodeGroupResponse.RequestId"));<NEW_LINE>getNodeGroupResponse.setSuccess(_ctx.booleanValue("GetNodeGroupResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setNodeGroupId(_ctx.stringValue("GetNodeGroupResponse.Data.NodeGroupId"));<NEW_LINE>data.setNodeGroupName(_ctx.stringValue("GetNodeGroupResponse.Data.NodeGroupName"));<NEW_LINE>data.setNodesCnt(_ctx.longValue("GetNodeGroupResponse.Data.NodesCnt"));<NEW_LINE>data.setDataDispatchEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.DataDispatchEnabled"));<NEW_LINE>data.setJoinPermissionId(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionId"));<NEW_LINE>data.setJoinPermissionOwnerAliyunId(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionOwnerAliyunId"));<NEW_LINE>data.setJoinEui(_ctx.stringValue("GetNodeGroupResponse.Data.JoinEui"));<NEW_LINE>data.setFreqBandPlanGroupId(_ctx.longValue("GetNodeGroupResponse.Data.FreqBandPlanGroupId"));<NEW_LINE>data.setClassMode<MASK><NEW_LINE>data.setJoinPermissionType(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionType"));<NEW_LINE>data.setJoinPermissionEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.JoinPermissionEnabled"));<NEW_LINE>data.setRxDailySum(_ctx.stringValue("GetNodeGroupResponse.Data.RxDailySum"));<NEW_LINE>data.setRxMonthSum(_ctx.longValue("GetNodeGroupResponse.Data.RxMonthSum"));<NEW_LINE>data.setTxDailySum(_ctx.longValue("GetNodeGroupResponse.Data.TxDailySum"));<NEW_LINE>data.setTxMonthSum(_ctx.longValue("GetNodeGroupResponse.Data.TxMonthSum"));<NEW_LINE>data.setCreateMillis(_ctx.longValue("GetNodeGroupResponse.Data.CreateMillis"));<NEW_LINE>data.setJoinPermissionName(_ctx.stringValue("GetNodeGroupResponse.Data.JoinPermissionName"));<NEW_LINE>data.setMulticastGroupId(_ctx.stringValue("GetNodeGroupResponse.Data.MulticastGroupId"));<NEW_LINE>data.setMulticastEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.MulticastEnabled"));<NEW_LINE>data.setMulticastNodeCapacity(_ctx.integerValue("GetNodeGroupResponse.Data.MulticastNodeCapacity"));<NEW_LINE>data.setMulticastNodeCount(_ctx.integerValue("GetNodeGroupResponse.Data.MulticastNodeCount"));<NEW_LINE>DataDispatchConfig dataDispatchConfig = new DataDispatchConfig();<NEW_LINE>dataDispatchConfig.setDestination(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.Destination"));<NEW_LINE>IotProduct iotProduct = new IotProduct();<NEW_LINE>iotProduct.setProductName(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.ProductName"));<NEW_LINE>iotProduct.setProductKey(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.ProductKey"));<NEW_LINE>iotProduct.setProductType(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.ProductType"));<NEW_LINE>iotProduct.setDebugSwitch(_ctx.booleanValue("GetNodeGroupResponse.Data.DataDispatchConfig.IotProduct.DebugSwitch"));<NEW_LINE>dataDispatchConfig.setIotProduct(iotProduct);<NEW_LINE>OnsTopics onsTopics = new OnsTopics();<NEW_LINE>onsTopics.setDownlinkRegionName(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.DownlinkRegionName"));<NEW_LINE>onsTopics.setDownlinkTopic(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.DownlinkTopic"));<NEW_LINE>onsTopics.setUplinkRegionName(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.UplinkRegionName"));<NEW_LINE>onsTopics.setUplinkTopic(_ctx.stringValue("GetNodeGroupResponse.Data.DataDispatchConfig.OnsTopics.UplinkTopic"));<NEW_LINE>dataDispatchConfig.setOnsTopics(onsTopics);<NEW_LINE>data.setDataDispatchConfig(dataDispatchConfig);<NEW_LINE>List<LocksItem> locks = new ArrayList<LocksItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetNodeGroupResponse.Data.Locks.Length"); i++) {<NEW_LINE>LocksItem locksItem = new LocksItem();<NEW_LINE>locksItem.setLockId(_ctx.stringValue("GetNodeGroupResponse.Data.Locks[" + i + "].LockId"));<NEW_LINE>locksItem.setLockType(_ctx.stringValue("GetNodeGroupResponse.Data.Locks[" + i + "].LockType"));<NEW_LINE>locksItem.setEnabled(_ctx.booleanValue("GetNodeGroupResponse.Data.Locks[" + i + "].Enabled"));<NEW_LINE>locksItem.setCreateMillis(_ctx.longValue("GetNodeGroupResponse.Data.Locks[" + i + "].CreateMillis"));<NEW_LINE>locks.add(locksItem);<NEW_LINE>}<NEW_LINE>data.setLocks(locks);<NEW_LINE>getNodeGroupResponse.setData(data);<NEW_LINE>return getNodeGroupResponse;<NEW_LINE>}
(_ctx.stringValue("GetNodeGroupResponse.Data.ClassMode"));
319,002
public static ListWorkFlowTemplatesResponse unmarshall(ListWorkFlowTemplatesResponse listWorkFlowTemplatesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listWorkFlowTemplatesResponse.setRequestId(_ctx.stringValue("ListWorkFlowTemplatesResponse.RequestId"));<NEW_LINE>listWorkFlowTemplatesResponse.setErrorCode(_ctx.stringValue("ListWorkFlowTemplatesResponse.ErrorCode"));<NEW_LINE>listWorkFlowTemplatesResponse.setErrorMessage(_ctx.stringValue("ListWorkFlowTemplatesResponse.ErrorMessage"));<NEW_LINE>listWorkFlowTemplatesResponse.setSuccess(_ctx.booleanValue("ListWorkFlowTemplatesResponse.Success"));<NEW_LINE>List<WorkFlowTemplate> workFlowTemplates = new ArrayList<WorkFlowTemplate>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates.Length"); i++) {<NEW_LINE>WorkFlowTemplate workFlowTemplate = new WorkFlowTemplate();<NEW_LINE>workFlowTemplate.setIsSystem(_ctx.integerValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].IsSystem"));<NEW_LINE>workFlowTemplate.setComment(_ctx.stringValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].Comment"));<NEW_LINE>workFlowTemplate.setEnabled(_ctx.stringValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].Enabled"));<NEW_LINE>workFlowTemplate.setTemplateName(_ctx.stringValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].TemplateName"));<NEW_LINE>workFlowTemplate.setTemplateId(_ctx.longValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].TemplateId"));<NEW_LINE>workFlowTemplate.setCreateUserId(_ctx.longValue<MASK><NEW_LINE>List<WorkflowNode> workflowNodes = new ArrayList<WorkflowNode>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes.Length"); j++) {<NEW_LINE>WorkflowNode workflowNode = new WorkflowNode();<NEW_LINE>workflowNode.setComment(_ctx.stringValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes[" + j + "].Comment"));<NEW_LINE>workflowNode.setNodeType(_ctx.stringValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes[" + j + "].NodeType"));<NEW_LINE>workflowNode.setNodeName(_ctx.stringValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes[" + j + "].NodeName"));<NEW_LINE>workflowNode.setPosition(_ctx.integerValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes[" + j + "].Position"));<NEW_LINE>workflowNode.setCreateUserId(_ctx.longValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes[" + j + "].CreateUserId"));<NEW_LINE>workflowNode.setTemplateId(_ctx.longValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes[" + j + "].TemplateId"));<NEW_LINE>workflowNode.setNodeId(_ctx.longValue("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].WorkflowNodes[" + j + "].NodeId"));<NEW_LINE>workflowNodes.add(workflowNode);<NEW_LINE>}<NEW_LINE>workFlowTemplate.setWorkflowNodes(workflowNodes);<NEW_LINE>workFlowTemplates.add(workFlowTemplate);<NEW_LINE>}<NEW_LINE>listWorkFlowTemplatesResponse.setWorkFlowTemplates(workFlowTemplates);<NEW_LINE>return listWorkFlowTemplatesResponse;<NEW_LINE>}
("ListWorkFlowTemplatesResponse.WorkFlowTemplates[" + i + "].CreateUserId"));
1,386,931
public SSLContext forDirectory(String directory) {<NEW_LINE>try {<NEW_LINE>Path keyPath = Paths.get(directory, "key.pem");<NEW_LINE>Path certPath = Paths.get(directory, "cert.pem");<NEW_LINE>Path caPath = Paths.get(directory, "ca.pem");<NEW_LINE>Path caKeyPath = Paths.get(directory, "ca-key.pem");<NEW_LINE>verifyCertificateFiles(keyPath, certPath, caPath);<NEW_LINE>KeyManagerFactory keyManagerFactory = getKeyManagerFactory(keyPath, certPath);<NEW_LINE>TrustManagerFactory <MASK><NEW_LINE>SSLContext sslContext = SSLContext.getInstance("TLS");<NEW_LINE>sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);<NEW_LINE>return sslContext;<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
trustManagerFactory = getTrustManagerFactory(caPath, caKeyPath);
1,268,044
public Future<Void> startAsync() {<NEW_LINE>log.info("Session store / pubsub factory used: {}", configCopy.getStoreFactory());<NEW_LINE>initGroups();<NEW_LINE>pipelineFactory.start(configCopy, namespacesHub);<NEW_LINE>Class<? extends ServerChannel> channelClass = NioServerSocketChannel.class;<NEW_LINE>if (configCopy.isUseLinuxNativeEpoll()) {<NEW_LINE>channelClass = EpollServerSocketChannel.class;<NEW_LINE>}<NEW_LINE>ServerBootstrap b = new ServerBootstrap();<NEW_LINE>b.group(bossGroup, workerGroup).channel(channelClass).childHandler(pipelineFactory);<NEW_LINE>applyConnectionOptions(b);<NEW_LINE>InetSocketAddress addr = new <MASK><NEW_LINE>if (configCopy.getHostname() != null) {<NEW_LINE>addr = new InetSocketAddress(configCopy.getHostname(), configCopy.getPort());<NEW_LINE>}<NEW_LINE>return b.bind(addr).addListener(new FutureListener<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void operationComplete(Future<Void> future) throws Exception {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>log.info("SocketIO server started at port: {}", configCopy.getPort());<NEW_LINE>} else {<NEW_LINE>log.error("SocketIO server start failed at port: {}!", configCopy.getPort());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
InetSocketAddress(configCopy.getPort());
1,014,630
private void forwardResults(BatchIterator<Row> it, boolean isLast) {<NEW_LINE>multiBucketBuilder.build(buckets);<NEW_LINE>AtomicInteger numActiveRequests = new AtomicInteger(downstreams.size());<NEW_LINE>for (int i = 0; i < downstreams.size(); i++) {<NEW_LINE>Downstream downstream = downstreams.get(i);<NEW_LINE>if (downstream.needsMoreData == false) {<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, true);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (traceEnabled) {<NEW_LINE>LOGGER.trace("forwardResults targetNode={} jobId={} targetPhase={}/{} bucket={} isLast={}", downstream.nodeId, jobId, <MASK><NEW_LINE>}<NEW_LINE>distributedResultAction.pushResult(downstream.nodeId, new DistributedResultRequest(jobId, targetPhaseId, inputId, bucketIdx, buckets[i], isLast), new ActionListener<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(DistributedResultResponse response) {<NEW_LINE>downstream.needsMoreData = response.needMore();<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, false);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>failure = e;<NEW_LINE>downstream.needsMoreData = false;<NEW_LINE>// continue because it's necessary to send something to downstreams still waiting for data<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
targetPhaseId, inputId, bucketIdx, isLast);
1,684,439
public void loadExtensions(ExtensionLoader loader) {<NEW_LINE>logger.info("ReindexPlugin reloadSPI called");<NEW_LINE>Iterable<RemoteReindexExtension> iterable = loader.loadExtensions(RemoteReindexExtension.class);<NEW_LINE>List<RemoteReindexExtension> remoteReindexExtensionList = new ArrayList<>();<NEW_LINE>iterable.forEach(remoteReindexExtensionList::add);<NEW_LINE>if (remoteReindexExtensionList.isEmpty()) {<NEW_LINE>logger.info("Unable to find any implementation for RemoteReindexExtension");<NEW_LINE>} else {<NEW_LINE>if (remoteReindexExtensionList.size() > 1) {<NEW_LINE>logger.warn("More than one implementation found: " + remoteReindexExtensionList);<NEW_LINE>}<NEW_LINE>// We shouldn't have more than one extension. Incase there is, we simply pick the first one.<NEW_LINE>TransportReindexAction.remoteExtension = Optional.ofNullable<MASK><NEW_LINE>logger.info("Loaded extension " + TransportReindexAction.remoteExtension);<NEW_LINE>}<NEW_LINE>}
(remoteReindexExtensionList.get(0));
1,653,299
private ImmutableMessageData addReaction(ImmutableMessageData message, MessageReactionAdd dispatch) {<NEW_LINE>boolean me = dispatch.userId().asLong() == selfUser.get().id().asLong();<NEW_LINE>List<ReactionData> reactions = message.reactions().toOptional().orElse(Collections.emptyList());<NEW_LINE>if (reactions.stream().anyMatch(EmojiKey.predicateEquals(dispatch.emoji()))) {<NEW_LINE>return message.withReactions(Possible.of(reactions.stream().map(r -> EmojiKey.predicateEquals(dispatch.emoji()).test(r) ? ImmutableReactionData.builder().from(r).count(r.count() + 1).me(r.me() || me).build() : r).collect(<MASK><NEW_LINE>}<NEW_LINE>return message.withReactions(Possible.of(add(reactions, ImmutableReactionData.of(1, me, dispatch.emoji()))));<NEW_LINE>}
Collectors.toList())));
89,552
public long lastModified() {<NEW_LINE>switch(mode) {<NEW_LINE>case SFTP:<NEW_LINE>final Long returnValue = SshClientUtils.execute(new SFtpClientTemplate<Long>(path) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Long execute(@NonNull SFTPClient client) throws IOException {<NEW_LINE>return client.mtime(SshClientUtils.extractRemotePathFrom(path));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (returnValue == null) {<NEW_LINE>Log.e(TAG, "Error obtaining last modification time over SFTP");<NEW_LINE>}<NEW_LINE>return returnValue == null ? 0L : returnValue;<NEW_LINE>case SMB:<NEW_LINE>SmbFile smbFile = getSmbFile();<NEW_LINE>if (smbFile != null) {<NEW_LINE>try {<NEW_LINE>return smbFile.lastModified();<NEW_LINE>} catch (SmbException e) {<NEW_LINE>Log.e(TAG, <MASK><NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FILE:<NEW_LINE>return getFile().lastModified();<NEW_LINE>case DOCUMENT_FILE:<NEW_LINE>return getDocumentFile(false).lastModified();<NEW_LINE>case ROOT:<NEW_LINE>HybridFileParcelable baseFile = generateBaseFileFromParent();<NEW_LINE>if (baseFile != null)<NEW_LINE>return baseFile.getDate();<NEW_LINE>}<NEW_LINE>return new File("/").lastModified();<NEW_LINE>}
"Error getting last modified time for SMB [" + path + "]", e);
1,448,316
final UpdateDocumentResult executeUpdateDocument(UpdateDocumentRequest updateDocumentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDocumentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDocumentRequest> request = null;<NEW_LINE>Response<UpdateDocumentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDocumentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDocumentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDocument");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDocumentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDocumentResultJsonUnmarshaller());<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,236,561
private void initView() {<NEW_LINE>HomeTitleBar titleBar = findViewById(R.id.title_bar);<NEW_LINE><MASK><NEW_LINE>titleBar.setListener(new HomeTitleBar.OnTitleBarClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRightClick() {<NEW_LINE>getActivity().finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mSettingList = findViewById(R.id.setting_list);<NEW_LINE>mSettingList.setLayoutManager(new LinearLayoutManager(getContext()));<NEW_LINE>mSettingItemAdapter = new SettingItemAdapter(getContext());<NEW_LINE>mSettingItemAdapter.append(getSettingItems(new ArrayList<SettingItem>()));<NEW_LINE>mSettingItemAdapter.setOnSettingItemSwitchListener(new SettingItemAdapter.OnSettingItemSwitchListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSettingItemSwitch(View view, SettingItem data, boolean on) {<NEW_LINE>if (on && !ownPermissionCheck()) {<NEW_LINE>if (view instanceof CheckBox) {<NEW_LINE>((CheckBox) view).setChecked(false);<NEW_LINE>}<NEW_LINE>requestPermissions(PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SettingItemAdapter.OnSettingItemSwitchListener itemSwitchListener = getItemSwitchListener();<NEW_LINE>if (itemSwitchListener != null) {<NEW_LINE>itemSwitchListener.onSettingItemSwitch(view, data, on);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mSettingItemAdapter.setOnSettingItemClickListener(new SettingItemAdapter.OnSettingItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSettingItemClick(View view, SettingItem data) {<NEW_LINE>if (!ownPermissionCheck()) {<NEW_LINE>requestPermissions(PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SettingItemAdapter.OnSettingItemClickListener itemClickListener = getItemClickListener();<NEW_LINE>if (itemClickListener != null) {<NEW_LINE>itemClickListener.onSettingItemClick(view, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mSettingList.setAdapter(mSettingItemAdapter);<NEW_LINE>}
titleBar.setTitle(getTitle());
1,652,026
Reporter<Span> reporter(ReporterMetrics reporterMetrics, ZipkinProperties zipkin, @Qualifier(SENDER_BEAN_NAME) Sender sender) {<NEW_LINE>CheckResult checkResult = checkResult(zipkinExecutor, sender, 1_000L);<NEW_LINE>logCheckResult(sender, checkResult);<NEW_LINE>// historical constraint. Note: AsyncReporter supports memory bounds<NEW_LINE>AsyncReporter<Span> asyncReporter = AsyncReporter.builder(sender).queuedMaxSpans(1000).messageTimeout(zipkin.getMessageTimeout(), TimeUnit.SECONDS).metrics(reporterMetrics).<MASK><NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>log.info("Flushing remaining spans on shutdown");<NEW_LINE>asyncReporter.flush();<NEW_LINE>try {<NEW_LINE>Thread.sleep(TimeUnit.SECONDS.toMillis(zipkin.getMessageTimeout()) + 500);<NEW_LINE>log.debug("Flushing done - closing the reporter");<NEW_LINE>asyncReporter.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return asyncReporter;<NEW_LINE>}
build(zipkin.getEncoder());
854,224
public static <N extends ImageBase, D extends ImageBase<D>> void divide(N imgA, D imgB, N output) {<NEW_LINE>if (imgA instanceof ImageGray && imgB instanceof ImageGray) {<NEW_LINE>if (GrayF32.class == imgA.getClass()) {<NEW_LINE>PixelMath.divide((GrayF32) imgA, (GrayF32) imgB, (GrayF32) output);<NEW_LINE>} else if (GrayF64.class == imgA.getClass()) {<NEW_LINE>PixelMath.divide((GrayF64) imgA, (GrayF64) imgB, (GrayF64) output);<NEW_LINE>}<NEW_LINE>} else if (imgA instanceof Planar && imgB instanceof ImageGray) {<NEW_LINE>Planar in = (Planar) imgA;<NEW_LINE>Planar out = (Planar) output;<NEW_LINE>for (int i = 0; i < in.getNumBands(); i++) {<NEW_LINE>if (GrayF32.class == imgB.getClass()) {<NEW_LINE>PixelMath.divide((GrayF32) in.getBand(i), (GrayF32) imgB, (GrayF32) out.getBand(i));<NEW_LINE>} else if (GrayF64.class == imgB.getClass()) {<NEW_LINE>PixelMath.divide((GrayF64) in.getBand(i), (GrayF64) imgB, (GrayF64<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (imgA instanceof Planar && imgB instanceof Planar) {<NEW_LINE>Planar inA = (Planar) imgA;<NEW_LINE>Planar inB = (Planar) imgB;<NEW_LINE>Planar out = (Planar) output;<NEW_LINE>for (int i = 0; i < inA.getNumBands(); i++) {<NEW_LINE>divide(inA.getBand(i), inB.getBand(i), out.getBand(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image Type: " + imgA.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>}
) out.getBand(i));
1,721,021
public void sendAReaction() {<NEW_LINE>ChannelClient channelClient = client.channel("messaging", "general");<NEW_LINE>// Add reaction 'like' with a custom field<NEW_LINE>Reaction reaction = new Reaction();<NEW_LINE>reaction.setMessageId("message-id");<NEW_LINE>reaction.setType("like");<NEW_LINE>reaction.setScore(1);<NEW_LINE>reaction.getExtraData(<MASK><NEW_LINE>// Don't remove other existing reactions<NEW_LINE>boolean enforceUnique = false;<NEW_LINE>channelClient.sendReaction(reaction, enforceUnique).enqueue(result -> {<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>Reaction sentReaction = result.data();<NEW_LINE>} else {<NEW_LINE>// Handle result.error()<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Add reaction 'like' and replace all other reactions of this user by it<NEW_LINE>enforceUnique = true;<NEW_LINE>channelClient.sendReaction(reaction, enforceUnique).enqueue(result -> {<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>Reaction sentReaction = result.data();<NEW_LINE>} else {<NEW_LINE>// Handle result.error()<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
).put("customField", 1);
1,261,064
public void applyCamera(GL2 gl) {<NEW_LINE>// Setup projection.<NEW_LINE>gl.glMatrixMode(GL2.GL_PROJECTION);<NEW_LINE>gl.glLoadIdentity();<NEW_LINE>// fov,<NEW_LINE>// fov,<NEW_LINE>glu.// fov,<NEW_LINE>gluPerspective(// ratio<NEW_LINE>45f, // near, far clipping<NEW_LINE>width / (float) height, // near, far clipping<NEW_LINE>0.f, 10.f);<NEW_LINE>eye[0] = (float) Math.sin(theta) * 2.f;<NEW_LINE>eye[1] = .5f;<NEW_LINE>eye[2] = (float) <MASK><NEW_LINE>// eye<NEW_LINE>// eye<NEW_LINE>glu.// eye<NEW_LINE>gluLookAt(// eye<NEW_LINE>eye[0], // eye<NEW_LINE>eye[1], // center<NEW_LINE>eye[2], // center<NEW_LINE>.0f, // center<NEW_LINE>.0f, // up<NEW_LINE>0.f, // up<NEW_LINE>0.f, // up<NEW_LINE>1.f, 0.f);<NEW_LINE>gl.glMatrixMode(GL2.GL_MODELVIEW);<NEW_LINE>gl.glLoadIdentity();<NEW_LINE>gl.glViewport(0, 0, width, height);<NEW_LINE>}
Math.cos(theta) * 2.f;
1,109,858
public void onGetLatestJobDiscoveryInfo(GetLatestJobDiscoveryInfoRequest r) {<NEW_LINE>LOGGER.trace("Entering onGetLatestJobDiscoveryInfo {}", r);<NEW_LINE>ActorRef sender = getSender();<NEW_LINE>if (r.getJobCluster().equals(this.jobId.getCluster())) {<NEW_LINE>JobSchedulingInfo schedulingInfo = workerManager.getJobStatusSubject().getValue();<NEW_LINE>if (schedulingInfo != null) {<NEW_LINE>sender.tell(new GetLatestJobDiscoveryInfoResponse(r.requestId, SUCCESS, "", ofNullable(schedulingInfo)), getSelf());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>sender.tell(new GetLatestJobDiscoveryInfoResponse(r.requestId, SERVER_ERROR, "discoveryInfo from BehaviorSubject is null " + jobId, empty()), getSelf());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String msg = "JobCluster in the request " + r.getJobCluster() + " does not match Job Actors job ID " + this.jobId;<NEW_LINE>LOGGER.warn(msg);<NEW_LINE>sender.tell(new GetLatestJobDiscoveryInfoResponse(r.requestId, SERVER_ERROR, msg, empty()), getSelf());<NEW_LINE>}<NEW_LINE>}
LOGGER.info("discoveryInfo from BehaviorSubject is null {}", jobId);
1,493,646
public static List<TrojanConfig> readTrojanServerConfigList(String trojanConfigListPath) {<NEW_LINE>File file = new File(trojanConfigListPath);<NEW_LINE>if (!file.exists()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>try (InputStream fis = new FileInputStream(file)) {<NEW_LINE>byte[] data = new byte[(<MASK><NEW_LINE>fis.read(data);<NEW_LINE>String json = new String(data);<NEW_LINE>JSONArray jsonArr = new JSONArray(json);<NEW_LINE>int len = jsonArr.length();<NEW_LINE>List<TrojanConfig> list = new ArrayList<>(len);<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>list.add(parseTrojanConfigFromJSON(jsonArr.getJSONObject(i).toString()));<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} catch (IOException | JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
int) file.length()];
452,359
private static List<Token> tokenize(String string, char delimiter) {<NEW_LINE>final List<Token> tokens = new ArrayList<>();<NEW_LINE>final StringBuilder builder = new StringBuilder();<NEW_LINE>for (int cursor = 0; cursor < string.length(); ) {<NEW_LINE>final char c = string.charAt(cursor);<NEW_LINE>int nextChar = cursor + 1;<NEW_LINE>if (c == '\'') {<NEW_LINE>nextChar = consumeInQuotes(string, '\'', cursor, builder);<NEW_LINE>tokens.add(new Token(TokenType.SINGLE_QUOTED, builder.toString(), cursor));<NEW_LINE>} else if (c == '"') {<NEW_LINE>nextChar = consumeInQuotes(string, '"', cursor, builder);<NEW_LINE>tokens.add(new Token(TokenType.DOUBLE_QUOTED, builder<MASK><NEW_LINE>} else if (c == '`') {<NEW_LINE>nextChar = consumeInQuotes(string, '`', cursor, builder);<NEW_LINE>tokens.add(new Token(TokenType.BACK_QUOTED, builder.toString(), cursor));<NEW_LINE>} else if (c == delimiter) {<NEW_LINE>tokens.add(new Token(TokenType.DELIMITER, String.valueOf(c), cursor));<NEW_LINE>} else if (singleLineComment(c, nextChar, string)) {<NEW_LINE>nextChar = consumeSingleLineComment(string, nextChar, builder);<NEW_LINE>tokens.add(new Token(TokenType.COMMENT, builder.toString(), cursor));<NEW_LINE>} else if (multiLineComment(c, nextChar, string)) {<NEW_LINE>nextChar = consumeMultiLineComment(string, nextChar, builder);<NEW_LINE>tokens.add(new Token(TokenType.COMMENT, builder.toString(), cursor));<NEW_LINE>} else if (!Character.isWhitespace(c)) {<NEW_LINE>nextChar = consumeUnquoted(string, delimiter, cursor, builder);<NEW_LINE>tokens.add(new Token(TokenType.UNQUOTED, builder.toString(), cursor));<NEW_LINE>}<NEW_LINE>builder.setLength(0);<NEW_LINE>cursor = nextChar;<NEW_LINE>}<NEW_LINE>return tokens;<NEW_LINE>}
.toString(), cursor));
830,773
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length < 1) {<NEW_LINE>throw new NotEnoughArgumentsException();<NEW_LINE>}<NEW_LINE>String message = getFinalArg(args, 0);<NEW_LINE>final IMessageRecipient messageSender;<NEW_LINE>if (sender.isPlayer()) {<NEW_LINE>final User user = ess.getUser(sender.getPlayer());<NEW_LINE>if (user.isMuted()) {<NEW_LINE>final String dateDiff = user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : null;<NEW_LINE>if (dateDiff == null) {<NEW_LINE>throw new Exception(user.hasMuteReason() ? tl("voiceSilencedReason", user.getMuteReason()) : tl("voiceSilenced"));<NEW_LINE>}<NEW_LINE>throw new Exception(user.hasMuteReason() ? tl("voiceSilencedReasonTime", dateDiff, user.getMuteReason()) : tl("voiceSilencedTime", dateDiff));<NEW_LINE>}<NEW_LINE>message = FormatUtil.formatMessage(user, "essentials.msg", message);<NEW_LINE>messageSender = user;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>messageSender = Console.getInstance();<NEW_LINE>}<NEW_LINE>final IMessageRecipient target = messageSender.getReplyRecipient();<NEW_LINE>// Check to make sure the sender does have a quick-reply recipient<NEW_LINE>if (target == null || (!ess.getSettings().isReplyToVanished() && sender.isPlayer() && target.isHiddenFrom(sender.getPlayer()))) {<NEW_LINE>messageSender.setReplyRecipient(null);<NEW_LINE>throw new Exception(tl("foreverAlone"));<NEW_LINE>}<NEW_LINE>messageSender.sendMessage(target, message);<NEW_LINE>}
message = FormatUtil.replaceFormat(message);
931,508
void applyAll(int y0, int y1, GrayU8 mask) {<NEW_LINE>init();<NEW_LINE>float maxWidth = srcImg.getWidth() - 1;<NEW_LINE>float maxHeight = srcImg.getHeight() - 1;<NEW_LINE>for (int y = y0; y < y1; y++) {<NEW_LINE>int indexDst = dstImg.startIndex + dstImg.stride * y + x0;<NEW_LINE>int indexMsk = mask.startIndex + mask.stride * y + x0;<NEW_LINE>for (int x = x0; x < x1; x++, indexDst++, indexMsk++) {<NEW_LINE>Point2D_F32 s = map[indexDst];<NEW_LINE>assigner.assign(indexDst, interp.get(s<MASK><NEW_LINE>if (s.x >= 0 && s.x <= maxWidth && s.y >= 0 && s.y <= maxHeight) {<NEW_LINE>mask.data[indexMsk] = 1;<NEW_LINE>} else {<NEW_LINE>mask.data[indexMsk] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.x, s.y));
1,757,531
private void installDevices(int platformIndex, TornadoPlatform platform, final OptionValues options, final HotSpotJVMCIRuntime vmRuntime, TornadoVMConfig vmConfig) {<NEW_LINE>info("OpenCL[%d]: Platform %s", platformIndex, platform.getName());<NEW_LINE>final OCLExecutionEnvironment context = platform.createContext();<NEW_LINE>assert context != null : "OpenCL context is null";<NEW_LINE>contexts.add(context);<NEW_LINE>final int numDevices = context.getNumDevices();<NEW_LINE>info("OpenCL[%d]: Has %d devices...", platformIndex, numDevices);<NEW_LINE>backends[platformIndex] = new OCLBackend[numDevices];<NEW_LINE>for (int deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) {<NEW_LINE>final OCLTargetDevice device = context.<MASK><NEW_LINE>info("OpenCL[%d]: device=%s", platformIndex, device.getDeviceName());<NEW_LINE>backends[platformIndex][deviceIndex] = createOCLJITCompiler(options, vmRuntime, vmConfig, context, deviceIndex);<NEW_LINE>}<NEW_LINE>}
devices().get(deviceIndex);
91,529
private SimpleStatement buildDynamicStatementHitCount(EventQueryDefinition query) {<NEW_LINE>// Default settings<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("SELECT * FROM " + AUDIT_HITCOUNT_TABLE);<NEW_LINE>sb.append(" WHERE (" + AUDIT_ATT_TIME + "> ?) ");<NEW_LINE>sb.append(" AND (" + AUDIT_ATT_TIME + "< ?) ");<NEW_LINE>List<Object> parameters = new ArrayList<>();<NEW_LINE>parameters.add(Instant.ofEpochMilli(query.getFrom()));<NEW_LINE>parameters.add(Instant.ofEpochMilli(query.getTo()));<NEW_LINE>// Name is the PARTITION KEY<NEW_LINE>if (!query.getNamesFilter().isEmpty()) {<NEW_LINE>sb.append(" AND (" + AUDIT_ATT_NAME + " IN ?)");<NEW_LINE>parameters.add(query.getNamesFilter());<NEW_LINE>}<NEW_LINE>if (!query.getActionFilters().isEmpty()) {<NEW_LINE>sb.<MASK><NEW_LINE>parameters.add(query.getActionFilters());<NEW_LINE>}<NEW_LINE>if (!query.getHostFilters().isEmpty()) {<NEW_LINE>sb.append(" AND (" + AUDIT_ATT_HOSTNAME + " IN ?)");<NEW_LINE>parameters.add(query.getHostFilters());<NEW_LINE>}<NEW_LINE>if (!query.getSourceFilters().isEmpty()) {<NEW_LINE>sb.append(" AND (" + AUDIT_ATT_SOURCE + " IN ? )");<NEW_LINE>parameters.add(query.getSourceFilters());<NEW_LINE>}<NEW_LINE>sb.append(" ALLOW FILTERING");<NEW_LINE>SimpleStatementBuilder builder = SimpleStatement.builder(sb.toString());<NEW_LINE>for (Object o : parameters) {<NEW_LINE>builder = builder.addPositionalValue(o);<NEW_LINE>}<NEW_LINE>// Accelerate the query<NEW_LINE>SimpleStatement ss = builder.build();<NEW_LINE>ss.setConsistencyLevel(ConsistencyLevel.ONE);<NEW_LINE>ss.setTimeout(Duration.ofMinutes(10));<NEW_LINE>ss.setTracing(false);<NEW_LINE>return ss;<NEW_LINE>}
append(" AND (" + AUDIT_ATT_ACTION + " IN ?)");
1,044,065
private static void tryAssertionStreamInsertWWidenMap(RegressionEnvironment env, EventRepresentationChoice rep) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String schemaSrc = rep.getAnnotationTextWJsonProvided(MyLocalJsonProvidedSrc.class) + "@name('schema') @public @buseventtype create schema Src as (myint int, mystr string)";<NEW_LINE>env.compileDeploy(schemaSrc, path);<NEW_LINE>env.compileDeploy(rep.getAnnotationTextWJsonProvided(MyLocalJsonProvidedD1.class) + "@public create schema D1 as (myint int, mystr string, addprop long)", path);<NEW_LINE>String eplOne = "insert into D1 select 1 as addprop, mysrc.* from Src as mysrc";<NEW_LINE>runStreamInsertAssertion(env, path, rep, eplOne, "myint,mystr,addprop", new Object[] { 123, "abc", 1L });<NEW_LINE>env.compileDeploy(rep.getAnnotationTextWJsonProvided(MyLocalJsonProvidedD2.class) + "@public create schema D2 as (mystr string, myint int, addprop double)", path);<NEW_LINE>String eplTwo = "insert into D2 select 1 as addprop, mysrc.* from Src as mysrc";<NEW_LINE>runStreamInsertAssertion(env, path, rep, eplTwo, "myint,mystr,addprop", new Object[] { 123, "abc", 1d });<NEW_LINE>env.compileDeploy(rep.getAnnotationTextWJsonProvided(MyLocalJsonProvidedD3.class) + "@public create schema D3 as (mystr string, addprop int)", path);<NEW_LINE>String eplThree = "insert into D3 select 1 as addprop, mysrc.* from Src as mysrc";<NEW_LINE>runStreamInsertAssertion(env, path, rep, eplThree, "mystr,addprop", new Object[] { "abc", 1 });<NEW_LINE>env.compileDeploy(rep.getAnnotationTextWJsonProvided(MyLocalJsonProvidedD4.class) + "@public create schema D4 as (myint int, mystr string)", path);<NEW_LINE>String eplFour = "insert into D4 select mysrc.* from Src as mysrc";<NEW_LINE>runStreamInsertAssertion(env, path, rep, eplFour, "myint,mystr", new Object<MASK><NEW_LINE>String eplFive = "insert into D4 select mysrc.*, 999 as myint, 'xxx' as mystr from Src as mysrc";<NEW_LINE>runStreamInsertAssertion(env, path, rep, eplFive, "myint,mystr", new Object[] { 999, "xxx" });<NEW_LINE>String eplSix = "insert into D4 select 999 as myint, 'xxx' as mystr, mysrc.* from Src as mysrc";<NEW_LINE>runStreamInsertAssertion(env, path, rep, eplSix, "myint,mystr", new Object[] { 999, "xxx" });<NEW_LINE>env.undeployAll();<NEW_LINE>}
[] { 123, "abc" });
1,643,737
private okhttp3.Call replaceNamespacedCronJobValidateBeforeCall(String name, String namespace, V1beta1CronJob body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException {<NEW_LINE>// verify the required parameter 'name' is set<NEW_LINE>if (name == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'name' when calling replaceNamespacedCronJob(Async)");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'namespace' is set<NEW_LINE>if (namespace == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'namespace' when calling replaceNamespacedCronJob(Async)");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'body' when calling replaceNamespacedCronJob(Async)");<NEW_LINE>}<NEW_LINE>okhttp3.Call localVarCall = replaceNamespacedCronJobCall(name, namespace, body, pretty, <MASK><NEW_LINE>return localVarCall;<NEW_LINE>}
dryRun, fieldManager, fieldValidation, _callback);
38,364
synchronized public void writeMetadata(@NonNull BackupFiles.BackupFile backupFile) throws IOException {<NEW_LINE>if (metadata == null) {<NEW_LINE>throw new RuntimeException("Metadata not set for path " + backupFile.getBackupPath());<NEW_LINE>}<NEW_LINE>Path metadataFile = backupFile.getMetadataFile();<NEW_LINE>try (OutputStream outputStream = metadataFile.openOutputStream()) {<NEW_LINE>JSONObject rootObject = new JSONObject();<NEW_LINE>rootObject.put("label", metadata.label);<NEW_LINE>rootObject.put("package_name", metadata.packageName);<NEW_LINE>rootObject.put("version_name", metadata.versionName);<NEW_LINE>rootObject.put("version_code", metadata.versionCode);<NEW_LINE>rootObject.put("data_dirs", JSONUtils.getJSONArray(metadata.dataDirs));<NEW_LINE>rootObject.put("is_system", metadata.isSystem);<NEW_LINE>rootObject.put("is_split_apk", metadata.isSplitApk);<NEW_LINE>rootObject.put("split_configs", JSONUtils.getJSONArray(metadata.splitConfigs));<NEW_LINE>rootObject.put("has_rules", metadata.hasRules);<NEW_LINE>rootObject.put("backup_time", metadata.backupTime);<NEW_LINE>rootObject.put("checksum_algo", metadata.checksumAlgo);<NEW_LINE>rootObject.put("crypto", metadata.crypto);<NEW_LINE>rootObject.put("key_ids", metadata.keyIds);<NEW_LINE>rootObject.put("iv", metadata.iv == null ? null : HexEncoding.encodeToString(metadata.iv));<NEW_LINE>rootObject.put("aes", metadata.aes == null ? null : HexEncoding.encodeToString(metadata.aes));<NEW_LINE>rootObject.put("version", metadata.version);<NEW_LINE>rootObject.put("apk_name", metadata.apkName);<NEW_LINE>rootObject.put("instruction_set", metadata.instructionSet);<NEW_LINE>rootObject.put("flags", metadata.flags.getFlags());<NEW_LINE>rootObject.put("user_handle", metadata.userHandle);<NEW_LINE>rootObject.put("tar_type", metadata.tarType);<NEW_LINE>rootObject.put("key_store", metadata.keyStore);<NEW_LINE>rootObject.put("installer", metadata.installer);<NEW_LINE>outputStream.write(rootObject.toString(4).getBytes());<NEW_LINE>} catch (JSONException e) {<NEW_LINE>throw new IOException(e.getMessage() + <MASK><NEW_LINE>}<NEW_LINE>}
" for path " + backupFile.getBackupPath());
996,063
public void onMatch(RelOptRuleCall call) {<NEW_LINE>ExecutionContext ec = PlannerContext.getPlannerContext(call).getExecutionContext();<NEW_LINE>final LogicalInsert origin = call.rel(0);<NEW_LINE>final PlannerContext context = call.getPlanner().getContext().unwrap(PlannerContext.class);<NEW_LINE>final ExecutionStrategyResult executionStrategyRs = ExecutionStrategy.determineExecutionStrategy(origin, context);<NEW_LINE>ExecutionStrategy executionStrategy = executionStrategyRs.execStrategy;<NEW_LINE>RelNode updated = origin;<NEW_LINE>switch(executionStrategy) {<NEW_LINE>case PUSHDOWN:<NEW_LINE>updated = handlePushdown(origin, false, ec);<NEW_LINE>break;<NEW_LINE>case DETERMINISTIC_PUSHDOWN:<NEW_LINE>updated = handlePushdown(origin, true, ec);<NEW_LINE>break;<NEW_LINE>case LOGICAL:<NEW_LINE>if (origin.isReplace()) {<NEW_LINE>updated = handleReplace(origin, context, executionStrategyRs, ec);<NEW_LINE>} else if (origin.isUpsert()) {<NEW_LINE>updated = handleUpsert(origin, context, ec);<NEW_LINE>} else if (origin.isInsertIgnore()) {<NEW_LINE>updated = handleInsertIgnore(origin, context, executionStrategyRs, ec);<NEW_LINE>} else {<NEW_LINE>updated = <MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected value: " + executionStrategy);<NEW_LINE>}<NEW_LINE>if (updated != origin) {<NEW_LINE>call.transformTo(updated);<NEW_LINE>}<NEW_LINE>}
handleInsert(origin, context, ec);
699,961
public synchronized void writeVideoBuffer(ByteBuffer encodedVideoFrame, long dts, int frameRotation, int streamIndex, boolean isKeyFrame, long firstFrameTimeStamp, long pts) {<NEW_LINE>if (!isRunning.get()) {<NEW_LINE>logPacketIssue("Not writing VideoBuffer for {} because Is running:{}", streamId, isRunning.get());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.rotation = frameRotation;<NEW_LINE>videoPkt.stream_index(streamIndex);<NEW_LINE>videoPkt.pts(pts);<NEW_LINE>videoPkt.dts(dts);<NEW_LINE>if (isKeyFrame) {<NEW_LINE>videoPkt.flags(videoPkt.flags() | AV_PKT_FLAG_KEY);<NEW_LINE>}<NEW_LINE>encodedVideoFrame.rewind();<NEW_LINE>videoPkt.<MASK><NEW_LINE>videoPkt.size(encodedVideoFrame.limit());<NEW_LINE>videoPkt.position(0);<NEW_LINE>writePacket(videoPkt, (AVCodecContext) null);<NEW_LINE>av_packet_unref(videoPkt);<NEW_LINE>}
data(new BytePointer(encodedVideoFrame));
1,092,807
public static Map<Integer, BitSet> buildEquitySet(List<RexNode> andFilters) {<NEW_LINE>Map<Integer, BitSet> equalitySet = new HashMap<>();<NEW_LINE>for (RexNode filter : andFilters) {<NEW_LINE>if (SqlKind.EQUALS.equals(filter.getKind()) && filter instanceof RexCall) {<NEW_LINE>RexCall filterCall = (RexCall) filter;<NEW_LINE>RexNode leftRexNode = filterCall.getOperands().get(0);<NEW_LINE>RexNode rightRexNode = filterCall.getOperands().get(1);<NEW_LINE>if (leftRexNode instanceof RexInputRef && rightRexNode instanceof RexInputRef) {<NEW_LINE>int leftIndex = ((RexInputRef) leftRexNode).getIndex();<NEW_LINE>int rightIndex = ((<MASK><NEW_LINE>BitSet leftBitSet = equalitySet.get(leftIndex);<NEW_LINE>if (leftBitSet != null) {<NEW_LINE>leftBitSet.set(rightIndex);<NEW_LINE>} else {<NEW_LINE>leftBitSet = new BitSet();<NEW_LINE>leftBitSet.set(leftIndex);<NEW_LINE>leftBitSet.set(rightIndex);<NEW_LINE>}<NEW_LINE>equalitySet.put(leftIndex, leftBitSet);<NEW_LINE>BitSet rightBitSet = equalitySet.get(rightIndex);<NEW_LINE>if (rightBitSet != null) {<NEW_LINE>rightBitSet.set(leftIndex);<NEW_LINE>} else {<NEW_LINE>rightBitSet = new BitSet();<NEW_LINE>rightBitSet.set(rightIndex);<NEW_LINE>rightBitSet.set(leftIndex);<NEW_LINE>}<NEW_LINE>equalitySet.put(rightIndex, rightBitSet);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return equalitySet;<NEW_LINE>}
RexInputRef) rightRexNode).getIndex();
1,272,972
private void updateGUI() {<NEW_LINE>var viewer = qupath.getViewer();<NEW_LINE>var imageData = viewer.getImageData();<NEW_LINE>if (imageData == null) {<NEW_LINE>transforms.getItems().clear();<NEW_LINE>transforms.setDisable(true);<NEW_LINE>spinner.setDisable(true);<NEW_LINE>sigmaSpinner.setDisable(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>transforms.setDisable(false);<NEW_LINE>spinner.setDisable(false);<NEW_LINE>sigmaSpinner.setDisable(false);<NEW_LINE>sigmaSpinner.setEditable(true);<NEW_LINE>spinner.setEditable(true);<NEW_LINE>var newResolutions = ClassificationResolution.getDefaultResolutions(imageData, selectedResolution.get());<NEW_LINE>if (!newResolutions.equals(comboResolutions.getItems()))<NEW_LINE>comboResolutions.<MASK><NEW_LINE>if (selectedResolution.get() == null)<NEW_LINE>comboResolutions.getSelectionModel().selectLast();<NEW_LINE>// Set the transforms if we have to<NEW_LINE>var newTransforms = new ArrayList<>(getAvailableTransforms(imageData));<NEW_LINE>if (!newTransforms.equals(transforms.getItems()))<NEW_LINE>transforms.getItems().setAll(newTransforms);<NEW_LINE>if (transforms.getSelectionModel().getSelectedItem() == null)<NEW_LINE>transforms.getSelectionModel().selectFirst();<NEW_LINE>}
getItems().setAll(newResolutions);
851,472
private void generateBinary(WasmIntBinaryOperation intOp, WasmFloatBinaryOperation floatOp, BinaryExpr expr) {<NEW_LINE>accept(expr.getFirstOperand());<NEW_LINE>WasmExpression first = result;<NEW_LINE>accept(expr.getSecondOperand());<NEW_LINE>WasmExpression second = result;<NEW_LINE>if (expr.getType() == null) {<NEW_LINE>result = new WasmIntBinary(WasmIntType.INT32, intOp, first, second);<NEW_LINE>} else {<NEW_LINE>switch(expr.getType()) {<NEW_LINE>case INT:<NEW_LINE>result = new WasmIntBinary(WasmIntType.INT32, intOp, first, second);<NEW_LINE>break;<NEW_LINE>case LONG:<NEW_LINE>result = new WasmIntBinary(WasmIntType.INT64, intOp, first, second);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>result = new WasmFloatBinary(WasmFloatType.FLOAT32, floatOp, first, second);<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>result = new WasmFloatBinary(WasmFloatType.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setLocation(expr.getLocation());<NEW_LINE>}
FLOAT64, floatOp, first, second);
1,306,748
private void processCustomRoles(String parent, boolean isOrgLevel) throws Exception {<NEW_LINE>logger.atInfo().log("Processing custom roles: " + parent);<NEW_LINE>Set<Role> customRole = null;<NEW_LINE>try {<NEW_LINE>if (isOrgLevel) {<NEW_LINE>customRole = iamClient.fetchCustomRolesOrgLevel(parent);<NEW_LINE>} else {<NEW_LINE>customRole = iamClient.fetchCustomRolesProjectLevel(parent);<NEW_LINE>}<NEW_LINE>} catch (IOException | GeneralSecurityException e) {<NEW_LINE>logger.atSevere().withCause(e<MASK><NEW_LINE>try {<NEW_LINE>if (resultsFile != null) {<NEW_LINE>resultsFile.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ie) {<NEW_LINE>logger.atSevere().withCause(ie).log("Exception while closing file steam.");<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>logger.atInfo().log("Total number of custom roles at " + parent + ":" + customRole.size());<NEW_LINE>Iterator<Role> iterator = customRole.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Role role = iterator.next();<NEW_LINE>Set<String> customRolePermissionsSet = new HashSet<String>(role.getIncludedPermissions());<NEW_LINE>logger.atInfo().log("Finding possible matching roles for: " + role.getName());<NEW_LINE>Map<String, Set<String>> possibleMatchingRoles = roleUtil.findPosibleMatchingRoles(customRolePermissionsSet, predefinedRolesWithSupportedPermissions);<NEW_LINE>Map<String, Set<String>> matchingRoles = roleUtil.findMachingPredefindedRoles(role, possibleMatchingRoles);<NEW_LINE>printResult(parent, matchingRoles, role);<NEW_LINE>}<NEW_LINE>}
).log("Exception while feching custom roles: " + parent);
696,143
public void createOrUpdateDraftBy(Integer postId, String content, String originalContent) {<NEW_LINE>Assert.notNull(postId, "The postId must not be null.");<NEW_LINE>// First, we need to save the contentPatchLog<NEW_LINE>ContentPatchLog contentPatchLog = contentPatchLogService.<MASK><NEW_LINE>// then update the value of headPatchLogId field.<NEW_LINE>Optional<Content> savedContentOptional = contentRepository.findById(postId);<NEW_LINE>if (savedContentOptional.isPresent()) {<NEW_LINE>Content savedContent = savedContentOptional.get();<NEW_LINE>savedContent.setHeadPatchLogId(contentPatchLog.getId());<NEW_LINE>contentRepository.save(savedContent);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If the content record does not exist, it needs to be created<NEW_LINE>Content postContent = new Content();<NEW_LINE>postContent.setPatchLogId(contentPatchLog.getId());<NEW_LINE>postContent.setContent(content);<NEW_LINE>postContent.setOriginalContent(originalContent);<NEW_LINE>postContent.setId(postId);<NEW_LINE>postContent.setStatus(PostStatus.DRAFT);<NEW_LINE>postContent.setHeadPatchLogId(contentPatchLog.getId());<NEW_LINE>contentRepository.save(postContent);<NEW_LINE>}
createOrUpdate(postId, content, originalContent);
381,388
final ResumeSessionResult executeResumeSession(ResumeSessionRequest resumeSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(resumeSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ResumeSessionRequest> request = null;<NEW_LINE>Response<ResumeSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ResumeSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(resumeSessionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ResumeSession");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ResumeSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ResumeSessionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,763,346
protected void update(ManaPoolView pool) {<NEW_LINE>for (Map.Entry<JLabel, ManaType> mana : manaLabels.entrySet()) {<NEW_LINE>String category = mana.getValue().toString() + " mana";<NEW_LINE>switch(mana.getValue()) {<NEW_LINE>case BLACK:<NEW_LINE>setTextForLabel(category, mana.getKey(), manaButtons.get(mana.getKey()), pool.getBlack(), false, activeValueColor);<NEW_LINE>break;<NEW_LINE>case RED:<NEW_LINE>setTextForLabel(category, mana.getKey(), manaButtons.get(mana.getKey()), pool.<MASK><NEW_LINE>break;<NEW_LINE>case WHITE:<NEW_LINE>setTextForLabel(category, mana.getKey(), manaButtons.get(mana.getKey()), pool.getWhite(), false, activeValueColor);<NEW_LINE>break;<NEW_LINE>case GREEN:<NEW_LINE>setTextForLabel(category, mana.getKey(), manaButtons.get(mana.getKey()), pool.getGreen(), false, activeValueColor);<NEW_LINE>break;<NEW_LINE>case BLUE:<NEW_LINE>setTextForLabel(category, mana.getKey(), manaButtons.get(mana.getKey()), pool.getBlue(), false, activeValueColor);<NEW_LINE>break;<NEW_LINE>case COLORLESS:<NEW_LINE>setTextForLabel(category, mana.getKey(), manaButtons.get(mana.getKey()), pool.getColorless(), false, activeValueColor);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// HoverButton btn = manaButtons.get(mana.getKey());<NEW_LINE>// mana.getKey().setOpaque(true);<NEW_LINE>// mana.getKey().setBackground(Color.green);<NEW_LINE>}<NEW_LINE>}
getRed(), false, activeValueColor);
663,534
public synchronized void fill(InputStream in) throws IOException {<NEW_LINE>if (readOnly) {<NEW_LINE>throw new UnsupportedOperationException("Read-only buffer");<NEW_LINE>}<NEW_LINE>byte[<MASK><NEW_LINE>int index = 0;<NEW_LINE>int offset = 0;<NEW_LINE>int length = size;<NEW_LINE>int readSpace = dataSpace;<NEW_LINE>if (useXORMask) {<NEW_LINE>xorData = new byte[dataSpace];<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>while (length > 0) {<NEW_LINE>int readLen = Math.min(length, readSpace);<NEW_LINE>int cnt = in.read(data, 0, readLen);<NEW_LINE>if (cnt < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>putBytes(index, offset, data, 0, readLen);<NEW_LINE>readSpace -= cnt;<NEW_LINE>offset += cnt;<NEW_LINE>length -= cnt;<NEW_LINE>if (readSpace == 0) {<NEW_LINE>// move-on to next buffer<NEW_LINE>++index;<NEW_LINE>readSpace = dataSpace;<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>xorData = null;<NEW_LINE>}<NEW_LINE>}
] data = new byte[dataSpace];
1,611,653
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>Query post = RemoteAccess.evaluate(request);<NEW_LINE>boolean localhost = post.isLocalhostAccess();<NEW_LINE>String callback = post.get("callback", "");<NEW_LINE>boolean jsonp = callback != null && callback.length() > 0;<NEW_LINE>String[] incubation = post.get("start", new String[0], ",");<NEW_LINE>int depth = Math.min(localhost ? 8 : 1, post.get("depth", 0));<NEW_LINE>boolean hashtags = post.get("hashtags", true);<NEW_LINE>boolean users = post.get("users", true);<NEW_LINE>for (String query : incubation) {<NEW_LINE>Crawler.stack(query, depth, hashtags, users, true);<NEW_LINE>}<NEW_LINE>post.setResponse(response, "application/javascript");<NEW_LINE>// generate json<NEW_LINE><MASK><NEW_LINE>if (incubation == null || incubation.length == 0) {<NEW_LINE>json.put("_hint", "start a crawl: start=<terms, comma-separated>, depth=<crawl depth> (dflt: 0), hashtags=<true|false> (dflt: true), users=<true|false> (dflt: true)");<NEW_LINE>}<NEW_LINE>if (!localhost) {<NEW_LINE>json.put("_hint", "you are connecting from a non-localhost client " + post.getClientHost() + " , depth is limited to 1");<NEW_LINE>}<NEW_LINE>JSONObject index_sizes = new JSONObject(true);<NEW_LINE>json.put("index_sizes", index_sizes);<NEW_LINE>index_sizes.put("messages", DAO.countLocalMessages(-1, true));<NEW_LINE>index_sizes.put("users", DAO.countLocalUsers());<NEW_LINE>json.put("crawler_status", Crawler.toJSON());<NEW_LINE>// write json<NEW_LINE>ServletOutputStream sos = response.getOutputStream();<NEW_LINE>if (jsonp) {<NEW_LINE>sos.print(callback + "(");<NEW_LINE>}<NEW_LINE>sos.print(json.toString(2));<NEW_LINE>if (jsonp) {<NEW_LINE>sos.println(");");<NEW_LINE>}<NEW_LINE>sos.println();<NEW_LINE>post.finalize();<NEW_LINE>}
JSONObject json = new JSONObject(true);
470,695
private void cacheEviction(EntityRelation relation, Cache cache) {<NEW_LINE>List<Object> fromToTypeAndTypeGroup = new ArrayList<>();<NEW_LINE>fromToTypeAndTypeGroup.add(relation.getFrom());<NEW_LINE>fromToTypeAndTypeGroup.add(relation.getTo());<NEW_LINE>fromToTypeAndTypeGroup.add(relation.getType());<NEW_LINE>fromToTypeAndTypeGroup.<MASK><NEW_LINE>cache.evict(fromToTypeAndTypeGroup);<NEW_LINE>List<Object> fromTypeAndTypeGroup = new ArrayList<>();<NEW_LINE>fromTypeAndTypeGroup.add(relation.getFrom());<NEW_LINE>fromTypeAndTypeGroup.add(relation.getType());<NEW_LINE>fromTypeAndTypeGroup.add(relation.getTypeGroup());<NEW_LINE>fromTypeAndTypeGroup.add(EntitySearchDirection.FROM.name());<NEW_LINE>cache.evict(fromTypeAndTypeGroup);<NEW_LINE>List<Object> fromAndTypeGroup = new ArrayList<>();<NEW_LINE>fromAndTypeGroup.add(relation.getFrom());<NEW_LINE>fromAndTypeGroup.add(relation.getTypeGroup());<NEW_LINE>fromAndTypeGroup.add(EntitySearchDirection.FROM.name());<NEW_LINE>cache.evict(fromAndTypeGroup);<NEW_LINE>List<Object> toAndTypeGroup = new ArrayList<>();<NEW_LINE>toAndTypeGroup.add(relation.getTo());<NEW_LINE>toAndTypeGroup.add(relation.getTypeGroup());<NEW_LINE>toAndTypeGroup.add(EntitySearchDirection.TO.name());<NEW_LINE>cache.evict(toAndTypeGroup);<NEW_LINE>List<Object> toTypeAndTypeGroup = new ArrayList<>();<NEW_LINE>toTypeAndTypeGroup.add(relation.getTo());<NEW_LINE>toTypeAndTypeGroup.add(relation.getType());<NEW_LINE>toTypeAndTypeGroup.add(relation.getTypeGroup());<NEW_LINE>toTypeAndTypeGroup.add(EntitySearchDirection.TO.name());<NEW_LINE>cache.evict(toTypeAndTypeGroup);<NEW_LINE>}
add(relation.getTypeGroup());
1,078,051
public boolean importData(JComponent comp, Transferable t) {<NEW_LINE>Map<String, String> _copiedImgs = getCopiedImgs();<NEW_LINE>DataFlavor htmlFlavor = DataFlavor.stringFlavor;<NEW_LINE>if (canImport(comp, t.getTransferDataFlavors())) {<NEW_LINE>String transferString = null;<NEW_LINE>String msg = "";<NEW_LINE>try {<NEW_LINE>transferString = (String) t.getTransferData(htmlFlavor);<NEW_LINE>} catch (UnsupportedFlavorException e) {<NEW_LINE>msg = e.getMessage();<NEW_LINE>} catch (IOException e) {<NEW_LINE>msg = e.getMessage();<NEW_LINE>}<NEW_LINE>if (transferString == null) {<NEW_LINE>log("ERROR: MyTransferHandler: importData: getTransferData: %s", msg);<NEW_LINE>}<NEW_LINE>EditorPane targetPane = (EditorPane) comp;<NEW_LINE>for (Map.Entry<String, String> entry : _copiedImgs.entrySet()) {<NEW_LINE>String imgName = entry.getKey();<NEW_LINE><MASK><NEW_LINE>File destFile = Commons.smartCopy(new File(imgPath), context.getImageFolder());<NEW_LINE>if (destFile != null) {<NEW_LINE>String newName = destFile.getName();<NEW_LINE>if (!newName.equals(imgName)) {<NEW_LINE>String ptnImgName = "\"" + imgName + "\"";<NEW_LINE>newName = "\"" + newName + "\"";<NEW_LINE>transferString = transferString.replaceAll(ptnImgName, newName);<NEW_LINE>log("MyTransferHandler: importData: image renamed: %s to %s", ptnImgName, newName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>targetPane.insertString(transferString);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
String imgPath = entry.getValue();
965,799
static boolean insert_door_ok(ExpansionRoom p_room_1, ExpansionRoom p_room_2, TileShape p_door_shape) {<NEW_LINE>if (p_room_1.door_exists(p_room_2)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (p_room_1 instanceof ObstacleExpansionRoom && p_room_2 instanceof ObstacleExpansionRoom) {<NEW_LINE>Item first_item = ((<MASK><NEW_LINE>Item second_item = ((ObstacleExpansionRoom) p_room_2).get_item();<NEW_LINE>// insert only overlap_doors between items of the same net for performance reasons.<NEW_LINE>return (first_item.shares_net(second_item));<NEW_LINE>}<NEW_LINE>if (!(p_room_1 instanceof ObstacleExpansionRoom) && !(p_room_2 instanceof ObstacleExpansionRoom)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Insert 1 dimensional doors of trace rooms only, if they are parallel to the trace line.<NEW_LINE>// Otherwise there may be check ripup problems with entering at the wrong side at a fork.<NEW_LINE>Line door_line = null;<NEW_LINE>Point prev_corner = p_door_shape.corner(0);<NEW_LINE>int corner_count = p_door_shape.border_line_count();<NEW_LINE>for (int i = 1; i < corner_count; ++i) {<NEW_LINE>Point curr_corner = p_door_shape.corner(i);<NEW_LINE>if (!curr_corner.equals(prev_corner)) {<NEW_LINE>door_line = p_door_shape.border_line(i - 1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>prev_corner = curr_corner;<NEW_LINE>}<NEW_LINE>if (p_room_1 instanceof ObstacleExpansionRoom) {<NEW_LINE>if (!insert_door_ok((ObstacleExpansionRoom) p_room_1, door_line)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p_room_2 instanceof ObstacleExpansionRoom) {<NEW_LINE>return insert_door_ok((ObstacleExpansionRoom) p_room_2, door_line);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
ObstacleExpansionRoom) p_room_1).get_item();
975,040
public Item[] split(final LocalDate splitDate) {<NEW_LINE>// Relax this pre-condition to allow splitting from 'merge' phase as well.<NEW_LINE>// Preconditions.checkState(action == ItemAction.ADD);<NEW_LINE>Preconditions.checkState(currentRepairedAmount.compareTo(BigDecimal.ZERO) == 0);<NEW_LINE>Preconditions.checkState(adjustedAmount.compareTo<MASK><NEW_LINE>final Item[] result = new Item[2];<NEW_LINE>final BigDecimal amount0 = InvoiceDateUtils.calculateProrationBetweenDates(startDate, splitDate, Days.daysBetween(startDate, endDate).getDays()).multiply(amount);<NEW_LINE>final BigDecimal amount1 = amount.subtract(amount0);<NEW_LINE>result[0] = new Item(this, this.startDate, splitDate, amount0);<NEW_LINE>result[1] = new Item(this, splitDate, this.endDate, amount1);<NEW_LINE>return result;<NEW_LINE>}
(BigDecimal.ZERO) == 0);
116,640
public ListMeshesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListMeshesResult listMeshesResult = new ListMeshesResult();<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 listMeshesResult;<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("meshes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listMeshesResult.setMeshes(new ListUnmarshaller<MeshRef>(MeshRefJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listMeshesResult.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 listMeshesResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
368,631
public synchronized void indexMainMap(File f, long dateCreated) {<NEW_LINE>String nm = Algorithms.getFileNameWithoutExtension(f).toLowerCase();<NEW_LINE>RegionUpdateFiles regionUpdateFiles = regions.get(nm);<NEW_LINE>if (regionUpdateFiles == null) {<NEW_LINE>regionUpdateFiles = new RegionUpdateFiles(nm);<NEW_LINE>regions.put(nm, regionUpdateFiles);<NEW_LINE>}<NEW_LINE>regionUpdateFiles.mainFile = f;<NEW_LINE>regionUpdateFiles.mainFileInit = dateCreated;<NEW_LINE>if (!regionUpdateFiles.monthUpdates.isEmpty()) {<NEW_LINE>List<String> list = new ArrayList<String>(regionUpdateFiles.monthUpdates.keySet());<NEW_LINE>for (String month : list) {<NEW_LINE>RegionUpdate ru = regionUpdateFiles.monthUpdates.get(month);<NEW_LINE>if (ru.obfCreated <= dateCreated) {<NEW_LINE>log.info("Delete overlapping month update " + ru.file.getName());<NEW_LINE>resourceManager.closeFile(ru.file.getName());<NEW_LINE>regionUpdateFiles.monthUpdates.remove(month);<NEW_LINE>ru.file.delete();<NEW_LINE>log.info("Delete overlapping month update " + ru.file.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!regionUpdateFiles.dayUpdates.isEmpty()) {<NEW_LINE>ArrayList<String> list = new ArrayList<String>(regionUpdateFiles.dayUpdates.keySet());<NEW_LINE>for (String month : list) {<NEW_LINE>List<RegionUpdate> newList = new ArrayList<>(regionUpdateFiles<MASK><NEW_LINE>Iterator<RegionUpdate> it = newList.iterator();<NEW_LINE>RegionUpdate monthRu = regionUpdateFiles.monthUpdates.get(month);<NEW_LINE>while (it.hasNext()) {<NEW_LINE>RegionUpdate ru = it.next();<NEW_LINE>if (ru == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (ru.obfCreated <= dateCreated || (monthRu != null && ru.obfCreated < monthRu.obfCreated)) {<NEW_LINE>log.info("Delete overlapping day update " + ru.file.getName());<NEW_LINE>resourceManager.closeFile(ru.file.getName());<NEW_LINE>it.remove();<NEW_LINE>ru.file.delete();<NEW_LINE>log.info("Delete overlapping day update " + ru.file.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>regionUpdateFiles.dayUpdates.put(month, newList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.dayUpdates.get(month));
334,295
public synchronized void open() throws IOException {<NEW_LINE>HugeConfig config = this.config();<NEW_LINE>String hosts = config.get(HbaseOptions.HBASE_HOSTS);<NEW_LINE>int port = config.get(HbaseOptions.HBASE_PORT);<NEW_LINE>String znodeParent = config.get(HbaseOptions.HBASE_ZNODE_PARENT);<NEW_LINE>boolean isEnableKerberos = config.get(HbaseOptions.HBASE_KERBEROS_ENABLE);<NEW_LINE>Configuration hConfig = HBaseConfiguration.create();<NEW_LINE>hConfig.set(HConstants.ZOOKEEPER_QUORUM, hosts);<NEW_LINE>hConfig.set(HConstants.ZOOKEEPER_CLIENT_PORT, String.valueOf(port));<NEW_LINE>hConfig.set(HConstants.ZOOKEEPER_ZNODE_PARENT, znodeParent);<NEW_LINE>hConfig.setInt("zookeeper.recovery.retry", config.get(HbaseOptions.HBASE_ZK_RETRY));<NEW_LINE>// Set hbase.hconnection.threads.max 64 to avoid OOM(default value: 256)<NEW_LINE>hConfig.setInt("hbase.hconnection.threads.max", config.get(HbaseOptions.HBASE_THREADS_MAX));<NEW_LINE>String hbaseSite = config.get(HbaseOptions.HBASE_HBASE_SITE);<NEW_LINE>hConfig.addResource(new Path(hbaseSite));<NEW_LINE>if (isEnableKerberos) {<NEW_LINE>String krb5Conf = config.get(HbaseOptions.HBASE_KRB5_CONF);<NEW_LINE><MASK><NEW_LINE>String principal = config.get(HbaseOptions.HBASE_KERBEROS_PRINCIPAL);<NEW_LINE>String keyTab = config.get(HbaseOptions.HBASE_KERBEROS_KEYTAB);<NEW_LINE>hConfig.set("hadoop.security.authentication", "kerberos");<NEW_LINE>hConfig.set("hbase.security.authentication", "kerberos");<NEW_LINE>// login/authenticate using keytab<NEW_LINE>UserGroupInformation.setConfiguration(hConfig);<NEW_LINE>UserGroupInformation.loginUserFromKeytab(principal, keyTab);<NEW_LINE>}<NEW_LINE>this.hbase = ConnectionFactory.createConnection(hConfig);<NEW_LINE>}
System.setProperty("java.security.krb5.conf", krb5Conf);
338,356
public void marshall(PoolInformation poolInformation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (poolInformation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(poolInformation.getPoolArn(), POOLARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getPoolId(), POOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getMessageType(), MESSAGETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getTwoWayEnabled(), TWOWAYENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getTwoWayChannelArn(), TWOWAYCHANNELARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getSelfManagedOptOutsEnabled(), SELFMANAGEDOPTOUTSENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getOptOutListName(), OPTOUTLISTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(poolInformation.getDeletionProtectionEnabled(), DELETIONPROTECTIONENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(poolInformation.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
poolInformation.getSharedRoutesEnabled(), SHAREDROUTESENABLED_BINDING);
899,284
private void handleResourceRequest(Request request, Response response) throws IOException {<NEW_LINE>String resourcePath = RESOURCE_PACKAGE + request.getRequestURI();<NEW_LINE>ClassLoader loader = RestMonitoringAdapter.class.getClassLoader();<NEW_LINE>try (InputStream inputStream = loader.getResourceAsStream(resourcePath)) {<NEW_LINE>if (inputStream == null) {<NEW_LINE>logger.log(Level.WARNING, "Resource not found: {0}", resourcePath);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] buffer = new byte[512];<NEW_LINE><MASK><NEW_LINE>for (int i = inputStream.read(buffer); i != -1; i = inputStream.read(buffer)) {<NEW_LINE>byteArrayOutputStream.write(buffer, 0, i);<NEW_LINE>}<NEW_LINE>String contentType = getContentType(resourcePath);<NEW_LINE>if (contentType != null) {<NEW_LINE>response.setContentType(contentType);<NEW_LINE>}<NEW_LINE>response.setContentLength(byteArrayOutputStream.size());<NEW_LINE>OutputStream outputStream = response.getOutputStream();<NEW_LINE>byteArrayOutputStream.writeTo(outputStream);<NEW_LINE>outputStream.flush();<NEW_LINE>}<NEW_LINE>}
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(512);
1,082,598
protected void initModel() {<NEW_LINE>title = currentPage.getTitle();<NEW_LINE>description = currentPage.getDescription();<NEW_LINE>if (StringUtils.isBlank(title)) {<NEW_LINE>title = currentPage.getName();<NEW_LINE>}<NEW_LINE>Tag[] tags = currentPage.getTags();<NEW_LINE>keywords = new String[tags.length];<NEW_LINE>int index = 0;<NEW_LINE>for (Tag tag : tags) {<NEW_LINE>keywords[index++] = tag.getTitle<MASK><NEW_LINE>}<NEW_LINE>if (currentDesign != null) {<NEW_LINE>String designPath = currentDesign.getPath();<NEW_LINE>if (!Designer.DEFAULT_DESIGN_PATH.equals(designPath)) {<NEW_LINE>this.designPath = designPath;<NEW_LINE>if (resolver.getResource(designPath + "/static.css") != null) {<NEW_LINE>staticDesignPath = designPath + "/static.css";<NEW_LINE>}<NEW_LINE>loadFavicons(designPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>populateClientlibCategories();<NEW_LINE>templateName = extractTemplateName();<NEW_LINE>brandSlug = Utils.getInheritedValue(currentPage, PN_BRANDSLUG);<NEW_LINE>}
(currentPage.getLanguage(false));
601,751
public String sayHello(String vote, int expectedDirection) {<NEW_LINE>if (expectedDirection < 0) {<NEW_LINE>return "Hello, this is HelloImplTwowayService";<NEW_LINE>} else {<NEW_LINE>boolean result = false;<NEW_LINE>try {<NEW_LINE>if (vote.endsWith("clear")) {<NEW_LINE>XAResourceImpl.clear();<NEW_LINE>}<NEW_LINE>final ExtendedTransactionManager TM = TransactionManagerFactory.getTransactionManager();<NEW_LINE>final Serializable xaResInfo = XAResourceInfoFactory.getXAResourceInfo(0);<NEW_LINE>XAResourceImpl xaRes;<NEW_LINE>if (vote.startsWith("rollback")) {<NEW_LINE>xaRes = XAResourceFactoryImpl.instance().getXAResourceImpl(xaResInfo<MASK><NEW_LINE>} else {<NEW_LINE>xaRes = XAResourceFactoryImpl.instance().getXAResourceImpl(xaResInfo);<NEW_LINE>}<NEW_LINE>final int recoveryId = TM.registerResourceInfo("xaResInfo", xaResInfo);<NEW_LINE>xaRes.setExpectedDirection(expectedDirection);<NEW_LINE>result = TM.enlist(xaRes, recoveryId);<NEW_LINE>} catch (XAResourceNotAvailableException e) {<NEW_LINE>return "Catch XAResourceNotAvailableException:" + e.toString();<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>return "Catch IllegalStateException:" + e.toString();<NEW_LINE>} catch (RollbackException e) {<NEW_LINE>return "Catch RollbackException:" + e.toString();<NEW_LINE>} catch (SystemException e) {<NEW_LINE>return "Catch SystemException:" + e.toString();<NEW_LINE>}<NEW_LINE>return "Enlist XAResourse result: " + result;<NEW_LINE>}<NEW_LINE>}
).setPrepareAction(XAException.XA_RBROLLBACK);
1,314,399
private void addClassifiedManagedDependencies(Node dependencyManagement) {<NEW_LINE>Node dependencies = findChild(dependencyManagement, "dependencies");<NEW_LINE>if (dependencies != null) {<NEW_LINE>for (Node dependency : findChildren(dependencies, "dependency")) {<NEW_LINE>String groupId = findChild(dependency, "groupId").text();<NEW_LINE>String artifactId = findChild(dependency, "artifactId").text();<NEW_LINE>String version = findChild(dependency, "version").text();<NEW_LINE>Set<String> classifiers = this.bom.getLibraries().stream().flatMap((library) -> library.getGroups().stream()).filter((group) -> group.getId().equals(groupId)).flatMap((group) -> group.getModules().stream()).filter((module) -> module.getName().equals(artifactId)).map(Module::getClassifier).filter(Objects::nonNull).<MASK><NEW_LINE>Node target = dependency;<NEW_LINE>for (String classifier : classifiers) {<NEW_LINE>if (classifier.length() > 0) {<NEW_LINE>if (target == null) {<NEW_LINE>target = new Node(null, "dependency");<NEW_LINE>target.appendNode("groupId", groupId);<NEW_LINE>target.appendNode("artifactId", artifactId);<NEW_LINE>target.appendNode("version", version);<NEW_LINE>int index = dependency.parent().children().indexOf(dependency);<NEW_LINE>dependency.parent().children().add(index + 1, target);<NEW_LINE>}<NEW_LINE>target.appendNode("classifier", classifier);<NEW_LINE>}<NEW_LINE>target = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
collect(Collectors.toSet());
649,298
public static void main(String[] args) throws Exception {<NEW_LINE>EventLoopGroup bossGroup = new NioEventLoopGroup(1);<NEW_LINE>EventLoopGroup workerGroup = new NioEventLoopGroup();<NEW_LINE>try {<NEW_LINE>ServerBootstrap b = new ServerBootstrap();<NEW_LINE><MASK><NEW_LINE>b.option(ChannelOption.SO_BACKLOG, 1024);<NEW_LINE>b.channel(NioServerSocketChannel.class);<NEW_LINE>b.childHandler(new ChannelInitializer<SocketChannel>() {<NEW_LINE><NEW_LINE>protected void initChannel(SocketChannel ch) throws Exception {<NEW_LINE>ch.pipeline().addLast("encoder", MqttEncoder.INSTANCE);<NEW_LINE>ch.pipeline().addLast("decoder", new MqttDecoder());<NEW_LINE>ch.pipeline().addLast("heartBeatHandler", new IdleStateHandler(45, 0, 0, TimeUnit.SECONDS));<NEW_LINE>ch.pipeline().addLast("handler", MqttHeartBeatBrokerHandler.INSTANCE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ChannelFuture f = b.bind(1883).sync();<NEW_LINE>System.out.println("Broker initiated...");<NEW_LINE>f.channel().closeFuture().sync();<NEW_LINE>} finally {<NEW_LINE>workerGroup.shutdownGracefully();<NEW_LINE>bossGroup.shutdownGracefully();<NEW_LINE>}<NEW_LINE>}
b.group(bossGroup, workerGroup);
873,965
private static Node deserializeHeader(DataInput dataInput) throws IOException {<NEW_LINE>int nodeTypeOrdinal = dataInput.readByte();<NEW_LINE>short count = Short.reverseBytes(dataInput.readShort());<NEW_LINE>byte prefixLength = dataInput.readByte();<NEW_LINE>byte[] prefix = new byte[0];<NEW_LINE>if (prefixLength > 0) {<NEW_LINE>prefix = new byte[prefixLength];<NEW_LINE>dataInput.readFully(prefix);<NEW_LINE>}<NEW_LINE>if (nodeTypeOrdinal == NodeType.NODE4.ordinal()) {<NEW_LINE>Node4 node4 = new Node4(prefixLength);<NEW_LINE>node4.prefixLength = prefixLength;<NEW_LINE>node4.prefix = prefix;<NEW_LINE>node4.count = count;<NEW_LINE>return node4;<NEW_LINE>}<NEW_LINE>if (nodeTypeOrdinal == NodeType.NODE16.ordinal()) {<NEW_LINE><MASK><NEW_LINE>node16.prefixLength = prefixLength;<NEW_LINE>node16.prefix = prefix;<NEW_LINE>node16.count = count;<NEW_LINE>return node16;<NEW_LINE>}<NEW_LINE>if (nodeTypeOrdinal == NodeType.NODE48.ordinal()) {<NEW_LINE>Node48 node48 = new Node48(prefixLength);<NEW_LINE>node48.prefixLength = prefixLength;<NEW_LINE>node48.prefix = prefix;<NEW_LINE>node48.count = count;<NEW_LINE>return node48;<NEW_LINE>}<NEW_LINE>if (nodeTypeOrdinal == NodeType.NODE256.ordinal()) {<NEW_LINE>Node256 node256 = new Node256(prefixLength);<NEW_LINE>node256.prefixLength = prefixLength;<NEW_LINE>node256.prefix = prefix;<NEW_LINE>node256.count = count;<NEW_LINE>return node256;<NEW_LINE>}<NEW_LINE>if (nodeTypeOrdinal == NodeType.LEAF_NODE.ordinal()) {<NEW_LINE>LeafNode leafNode = new LeafNode(0L, 0);<NEW_LINE>leafNode.prefixLength = prefixLength;<NEW_LINE>leafNode.prefix = prefix;<NEW_LINE>leafNode.count = count;<NEW_LINE>return leafNode;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Node16 node16 = new Node16(prefixLength);
131,016
void initNoFileLayout() {<NEW_LINE>nofilesview = rootView.findViewById(R.id.nofilelayout);<NEW_LINE>nofilesview.setColorSchemeColors(mainFragmentViewModel.getAccentColor());<NEW_LINE>nofilesview.setOnRefreshListener(() -> {<NEW_LINE>loadlist((mainFragmentViewModel.getCurrentPath()), false, mainFragmentViewModel.getOpenMode());<NEW_LINE>nofilesview.setRefreshing(false);<NEW_LINE>});<NEW_LINE>nofilesview.findViewById(R.id.no_files_relative).setOnKeyListener((v, keyCode, event) -> {<NEW_LINE>if (event.getAction() == KeyEvent.ACTION_DOWN) {<NEW_LINE>if (event.getKeyCode() == KeyEvent.KEYCODE_DPAD_RIGHT) {<NEW_LINE>getMainActivity().getFAB().requestFocus();<NEW_LINE>} else if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {<NEW_LINE>getMainActivity().onBackPressed();<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>if (utilsProvider.getAppTheme().equals(AppTheme.LIGHT)) {<NEW_LINE>((ImageView) nofilesview.findViewById(R.id.image)).setColorFilter(Color.parseColor("#666666"));<NEW_LINE>} else if (utilsProvider.getAppTheme().equals(AppTheme.BLACK)) {<NEW_LINE>nofilesview.setBackgroundColor(Utils.getColor(getContext(), android.R.color.black));<NEW_LINE>((TextView) nofilesview.findViewById(R.id.nofiletext)).setTextColor(Color.WHITE);<NEW_LINE>} else {<NEW_LINE>nofilesview.setBackgroundColor(Utils.getColor(getContext()<MASK><NEW_LINE>((TextView) nofilesview.findViewById(R.id.nofiletext)).setTextColor(Color.WHITE);<NEW_LINE>}<NEW_LINE>}
, R.color.holo_dark_background));
528,515
public List<T> applyFuzzy(List<T> target, int maxFuzz) throws PatchFailedException {<NEW_LINE>PatchApplyingContext<T> ctx = new PatchApplyingContext<>(new ArrayList<>(target), maxFuzz);<NEW_LINE>// the difference between patch's position and actually applied position<NEW_LINE>int lastPatchDelta = 0;<NEW_LINE>for (AbstractDelta<T> delta : getDeltas()) {<NEW_LINE>ctx.defaultPosition = delta.getSource().getPosition() + lastPatchDelta;<NEW_LINE>int patchPosition = findPositionFuzzy(ctx, delta);<NEW_LINE>if (0 <= patchPosition) {<NEW_LINE>delta.applyFuzzyToAt(ctx.result, ctx.currentFuzz, patchPosition);<NEW_LINE>lastPatchDelta = patchPosition - delta.getSource().getPosition();<NEW_LINE>ctx.lastPatchEnd = delta.getSource<MASK><NEW_LINE>} else {<NEW_LINE>conflictOutput.processConflict(VerifyChunk.CONTENT_DOES_NOT_MATCH_TARGET, delta, ctx.result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ctx.result;<NEW_LINE>}
().last() + lastPatchDelta;
944,801
public SimilarityQuery<O> similarityQuery() {<NEW_LINE>if (simQuery != null) {<NEW_LINE>return simQuery;<NEW_LINE>}<NEW_LINE>if (similarity == null) {<NEW_LINE>throw new IllegalStateException("Similarity query requested for 'null' similarity!");<NEW_LINE>}<NEW_LINE>for (It<SimilarityIndex<O>> it = Metadata.hierarchyOf(relation).iterChildrenReverse().filter(SimilarityIndex.class); it.valid(); it.advance()) {<NEW_LINE>simQuery = it.<MASK><NEW_LINE>logUsing(it.get(), "similarity", simQuery != null);<NEW_LINE>if (simQuery != null) {<NEW_LINE>return simQuery;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Use optimizer<NEW_LINE>if ((flags & FLAGS_NO_OPTIMIZER) == 0) {<NEW_LINE>simQuery = OPTIMIZER.getSimilarityQuery(relation, similarity, flags);<NEW_LINE>if (simQuery != null) {<NEW_LINE>return simQuery;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((flags & FLAG_OPTIMIZED_ONLY) != 0 && !(similarity instanceof DBIDSimilarity)) {<NEW_LINE>// Disallowed<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return similarity.instantiate(relation);<NEW_LINE>}
get().getSimilarityQuery(similarity);
116,663
public Status delete(String remotePath) {<NEW_LINE>// get a proper broker<NEW_LINE>Pair<TPaloBrokerService.Client, TNetworkAddress> pair = getBroker();<NEW_LINE>if (pair == null) {<NEW_LINE>return new Status(Status.ErrCode.COMMON_ERROR, "failed to get broker client");<NEW_LINE>}<NEW_LINE>TPaloBrokerService.Client client = pair.first;<NEW_LINE>TNetworkAddress address = pair.second;<NEW_LINE>// delete<NEW_LINE>boolean needReturn = true;<NEW_LINE>try {<NEW_LINE>TBrokerDeletePathRequest req = new TBrokerDeletePathRequest(TBrokerVersion.VERSION_ONE, remotePath, getProperties());<NEW_LINE>TBrokerOperationStatus opst = client.deletePath(req);<NEW_LINE>if (opst.getStatusCode() != TBrokerOperationStatusCode.OK) {<NEW_LINE>return new Status(Status.ErrCode.COMMON_ERROR, "failed to delete remote path: " + remotePath + ". msg: " + opst.getMessage() + ", broker: " + BrokerUtil.printBroker(getName(), address));<NEW_LINE>}<NEW_LINE>LOG.info("finished to delete remote path {}.", remotePath);<NEW_LINE>} catch (TException e) {<NEW_LINE>needReturn = false;<NEW_LINE>return new Status(Status.ErrCode.COMMON_ERROR, "failed to delete remote path: " + remotePath + ". msg: " + e.getMessage() + ", broker: " + BrokerUtil.printBroker(getName(), address));<NEW_LINE>} finally {<NEW_LINE>if (needReturn) {<NEW_LINE>ClientPool.brokerPool.returnObject(address, client);<NEW_LINE>} else {<NEW_LINE>ClientPool.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Status.OK;<NEW_LINE>}
brokerPool.invalidateObject(address, client);
325,922
private void addExternalUrl(Property property, KubeLink kubeLink, String externalUrl) throws IOException {<NEW_LINE>if (externalUrl != null) {<NEW_LINE>out.append(" For more information, see the ").append(externalUrl).append("[").append("external documentation for ").append(kubeLink.group()).append("/").append(kubeLink.version()).append(" ").append(kubeLink.kind()).append("].").append(NL).append(NL);<NEW_LINE>} else if (isPolymorphic(property.getType().getType())) {<NEW_LINE>out.append(" The type depends on the value of the `").append(property.getName()).append(".").append(discriminator(property.getType().getType())).append("` property within the given object, which must be one of ").append(subtypeNames(property.getType().getType()).toString<MASK><NEW_LINE>}<NEW_LINE>}
()).append(".");
153,061
public void preview(PFMFile pfm) {<NEW_LINE>if (log != null && log.isInfoEnabled()) {<NEW_LINE>log.info("Font: " + pfm.getWindowsName());<NEW_LINE>log.info("Name: " + pfm.getPostscriptName());<NEW_LINE>log.info("CharSet: " + pfm.getCharSetName());<NEW_LINE>log.info("CapHeight: " + pfm.getCapHeight());<NEW_LINE>log.info("XHeight: " + pfm.getXHeight());<NEW_LINE>log.info("LowerCaseAscent: " + pfm.getLowerCaseAscent());<NEW_LINE>log.info("LowerCaseDescent: " + pfm.getLowerCaseDescent());<NEW_LINE>log.info("Having widths for " + (pfm.getLastChar() - pfm.getFirstChar()) + " characters (" + pfm.getFirstChar() + "-" + <MASK><NEW_LINE>log.info("for example: Char " + pfm.getFirstChar() + " has a width of " + pfm.getCharWidth(pfm.getFirstChar()));<NEW_LINE>log.info("");<NEW_LINE>}<NEW_LINE>}
pfm.getLastChar() + ").");
371,243
private static Hashtable parseQueryString(String query) {<NEW_LINE>Hashtable<String, String[]> ht = new Hashtable<String, String[]>();<NEW_LINE>if (query == null)<NEW_LINE>return ht;<NEW_LINE>StringTokenizer st = new StringTokenizer(query, "&");<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>String pair = st.nextToken();<NEW_LINE>int eq = pair.indexOf('=');<NEW_LINE>if (eq >= 0) {<NEW_LINE>String key = percentDecode(pair.substring(0, eq));<NEW_LINE>String value = percentDecode(pair.substring(eq + 1));<NEW_LINE>if (ht.containsKey(key)) {<NEW_LINE>// This implementation is quite inefficient, but<NEW_LINE>// this won't bother us in any real-world use.<NEW_LINE>String[] oldvalues = (String[]) ht.get(key);<NEW_LINE>String[] values = new String[oldvalues.length + 1];<NEW_LINE>System.arraycopy(oldvalues, 0, values, 0, oldvalues.length);<NEW_LINE>values[oldvalues.length] = value;<NEW_LINE>ht.put(key, values);<NEW_LINE>} else {<NEW_LINE>String[] values = new String[1];<NEW_LINE>values[0] = value;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ht;<NEW_LINE>}
ht.put(key, values);
1,002,757
final public MutableString replace(final char[] c, final char[] r) {<NEW_LINE>final int n = c.length;<NEW_LINE>if (n == 0)<NEW_LINE>return this;<NEW_LINE>final char[] a = array;<NEW_LINE>int i = length(), k, bloomFilter = 0;<NEW_LINE>k = n;<NEW_LINE>while (k-- != 0) bloomFilter |= 1 << (c[k] & 0x1F);<NEW_LINE>while (i-- != 0) {<NEW_LINE>if ((bloomFilter & (1 << (a[i] & 0x1F))) != 0) {<NEW_LINE>k = n;<NEW_LINE>while (k-- != 0) if (a[i] == c[k])<NEW_LINE>break;<NEW_LINE>if (k >= 0)<NEW_LINE>a<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hashLength < 0)<NEW_LINE>hashLength = -1;<NEW_LINE>return this;<NEW_LINE>}
[i] = r[k];
447,743
public LambdaFunctionAssociations unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>LambdaFunctionAssociations lambdaFunctionAssociations = new LambdaFunctionAssociations();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return lambdaFunctionAssociations;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Quantity", targetDepth)) {<NEW_LINE>lambdaFunctionAssociations.setQuantity(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Items", targetDepth)) {<NEW_LINE>lambdaFunctionAssociations.withItems(new ArrayList<LambdaFunctionAssociation>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Items/LambdaFunctionAssociation", targetDepth)) {<NEW_LINE>lambdaFunctionAssociations.withItems(LambdaFunctionAssociationStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return lambdaFunctionAssociations;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
66,253
/*<NEW_LINE>private static RestClientBuilder buildRestClient(Elasticsearch settings) {<NEW_LINE>List<HttpHost> hosts = new ArrayList<>(settings.<MASK><NEW_LINE>settings.getNodes().forEach(node -> hosts.add(HttpHost.create(node.decodedUrl())));<NEW_LINE><NEW_LINE>RestClientBuilder builder = RestClient.builder(hosts.toArray(new HttpHost[0]));<NEW_LINE><NEW_LINE>if (settings.getPathPrefix() != null) {<NEW_LINE>builder.setPathPrefix(settings.getPathPrefix());<NEW_LINE>}<NEW_LINE><NEW_LINE>if (settings.getUsername() != null) {<NEW_LINE>CredentialsProvider credentialsProvider = new BasicCredentialsProvider();<NEW_LINE>credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(settings.getUsername(), settings.getPassword()));<NEW_LINE>if (settings.getSslVerification()) {<NEW_LINE>builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider));<NEW_LINE>} else {<NEW_LINE>builder.setHttpClientConfigCallback(httpClientBuilder -> {<NEW_LINE>SSLContext sc;<NEW_LINE>try {<NEW_LINE>sc = SSLContext.getInstance("SSL");<NEW_LINE>sc.init(null, trustAllCerts, new SecureRandom());<NEW_LINE>} catch (KeyManagementException | NoSuchAlgorithmException e) {<NEW_LINE>logger.warn("Failed to get SSL Context", e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>httpClientBuilder.setSSLStrategy(new SSLIOSessionStrategy(sc, new NullHostNameVerifier()));<NEW_LINE>httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);<NEW_LINE>return httpClientBuilder;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>return builder;<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void createIndices() throws Exception {<NEW_LINE>Path jobMappingDir = config.resolve(settings.getName()).resolve("_mappings");<NEW_LINE>// If needed, we create the new settings for this files index<NEW_LINE>if (!settings.getFs().isAddAsInnerObject() || (!settings.getFs().isJsonSupport() && !settings.getFs().isXmlSupport())) {<NEW_LINE>createIndex(jobMappingDir, majorVersion, INDEX_SETTINGS_FILE, settings.getElasticsearch().getIndex());<NEW_LINE>} else {<NEW_LINE>createIndex(settings.getElasticsearch().getIndex(), true, null);<NEW_LINE>}<NEW_LINE>// If needed, we create the new settings for this folder index<NEW_LINE>if (settings.getFs().isIndexFolders()) {<NEW_LINE>createIndex(jobMappingDir, majorVersion, INDEX_SETTINGS_FOLDER_FILE, settings.getElasticsearch().getIndexFolder());<NEW_LINE>} else {<NEW_LINE>createIndex(settings.getElasticsearch().getIndexFolder(), true, null);<NEW_LINE>}<NEW_LINE>}
getNodes().size());
1,228,185
public NetworkFirewallBlackHoleRouteDetectedViolation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>NetworkFirewallBlackHoleRouteDetectedViolation networkFirewallBlackHoleRouteDetectedViolation = new NetworkFirewallBlackHoleRouteDetectedViolation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ViolationTarget", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallBlackHoleRouteDetectedViolation.setViolationTarget(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("RouteTableId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallBlackHoleRouteDetectedViolation.setRouteTableId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("VpcId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallBlackHoleRouteDetectedViolation.setVpcId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ViolatingRoutes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallBlackHoleRouteDetectedViolation.setViolatingRoutes(new ListUnmarshaller<Route>(RouteJsonUnmarshaller.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 networkFirewallBlackHoleRouteDetectedViolation;<NEW_LINE>}
class).unmarshall(context));
1,647,423
private ResolvedType inferReturnType(EntityContext context, HandlerMethod handler) {<NEW_LINE>TypeResolver resolver = context.getTypeResolver();<NEW_LINE><MASK><NEW_LINE>RepositoryMetadata repository = context.getRepositoryMetadata();<NEW_LINE>ResolvedType domainReturnType = resolver.resolve(repository.getReturnedDomainClass(handler.getMethod()));<NEW_LINE>ResolvedType methodReturnType = methodResolver.methodReturnType(handler);<NEW_LINE>if (isContainerType(methodReturnType)) {<NEW_LINE>return resolver.resolve(CollectionModel.class, collectionElementType(methodReturnType));<NEW_LINE>} else if (Iterable.class.isAssignableFrom(methodReturnType.getErasedType())) {<NEW_LINE>return resolver.resolve(CollectionModel.class, domainReturnType);<NEW_LINE>} else if (ScalarTypes.builtInScalarType(domainReturnType).isPresent()) {<NEW_LINE>return domainReturnType;<NEW_LINE>} else if (isVoid(domainReturnType)) {<NEW_LINE>return resolver.resolve(Void.TYPE);<NEW_LINE>}<NEW_LINE>return resolver.resolve(EntityModel.class, domainReturnType);<NEW_LINE>}
HandlerMethodResolver methodResolver = new HandlerMethodResolver(resolver);
1,092,131
static File resolveTarget(File root, List<Pair<String, String>> mappings, File file) {<NEW_LINE>String name = file.getName();<NEW_LINE>String extension = FileUtil.getExtension(name);<NEW_LINE>if (!extension.isEmpty()) {<NEW_LINE>name = name.substring(0, name.length() - (extension.length() + 1));<NEW_LINE>}<NEW_LINE>for (Pair<String, String> mapping : mappings) {<NEW_LINE>File from = resolveFile(root, mapping.first());<NEW_LINE>if (from.equals(file)) {<NEW_LINE>// exact file match<NEW_LINE>File to = resolveFile(<MASK><NEW_LINE>if (isFileMapping(to, CSS_EXTENSION)) {<NEW_LINE>// 'to' is file<NEW_LINE>return to;<NEW_LINE>}<NEW_LINE>// 'to' is directory<NEW_LINE>return resolveFile(to, makeCssFilename(name));<NEW_LINE>} else if (isFileMapping(from, extension)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// 'from' is directory<NEW_LINE>String relpath;<NEW_LINE>try {<NEW_LINE>relpath = PropertyUtils.relativizeFile(from, file.getParentFile());<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>// #237525<NEW_LINE>LOGGER.log(Level.INFO, "Incorrect mapping [input is existing file but directory expected]", ex);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (relpath == null || relpath.startsWith("..")) {<NEW_LINE>// NOI18N<NEW_LINE>// unrelated<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>File to = PropertyUtils.resolveFile(resolveFile(root, mapping.second()), relpath);<NEW_LINE>assert !isFileMapping(to, CSS_EXTENSION) : to;<NEW_LINE>return resolveFile(to, makeCssFilename(name));<NEW_LINE>}<NEW_LINE>// no mapping<NEW_LINE>return null;<NEW_LINE>}
root, mapping.second());
1,115,790
protected DefaultActionGroup collectToolbarActions(@javax.annotation.Nullable List<AnAction> viewerActions) {<NEW_LINE>DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>List<AnAction> navigationActions = new ArrayList<AnAction>();<NEW_LINE>navigationActions.addAll(getNavigationActions());<NEW_LINE>navigationActions.add(myOpenInEditorAction);<NEW_LINE>navigationActions.add(new MyChangeDiffToolAction());<NEW_LINE>DiffUtil.addActionBlock(group, navigationActions);<NEW_LINE>DiffUtil.addActionBlock(group, viewerActions);<NEW_LINE>List<AnAction> requestContextActions = myActiveRequest.getUserData(DiffUserDataKeys.CONTEXT_ACTIONS);<NEW_LINE>DiffUtil.addActionBlock(group, requestContextActions);<NEW_LINE>List<AnAction> contextActions = myContext.getUserData(DiffUserDataKeys.CONTEXT_ACTIONS);<NEW_LINE><MASK><NEW_LINE>DiffUtil.addActionBlock(group, new ShowInExternalToolAction(), ActionManager.getInstance().getAction(IdeActions.ACTION_CONTEXT_HELP));<NEW_LINE>return group;<NEW_LINE>}
DiffUtil.addActionBlock(group, contextActions);
338,104
public DkimSigningAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DkimSigningAttributes dkimSigningAttributes = new DkimSigningAttributes();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("DomainSigningSelector", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dkimSigningAttributes.setDomainSigningSelector(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DomainSigningPrivateKey", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dkimSigningAttributes.setDomainSigningPrivateKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextSigningKeyLength", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dkimSigningAttributes.setNextSigningKeyLength(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 dkimSigningAttributes;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
946,557
Object typeGeneric(VirtualFrame frame, Object cls, Object name, Object bases, Object dict, PKeyword[] kwds, @Cached TypeNode nextTypeNode, @Cached IsTypeNode isTypeNode) {<NEW_LINE>if (PGuards.isNoValue(bases) && !PGuards.isNoValue(dict) || !PGuards.isNoValue(bases) && PGuards.isNoValue(dict)) {<NEW_LINE>throw raise(TypeError, ErrorMessages.TAKES_D_OR_D_ARGS, "type()", 1, 3);<NEW_LINE>} else if (!(name instanceof String || name instanceof PString)) {<NEW_LINE>throw raise(TypeError, ErrorMessages.MUST_BE_STRINGS_NOT_P, "type() argument 1", name);<NEW_LINE>} else if (!(bases instanceof PTuple)) {<NEW_LINE>throw raise(TypeError, ErrorMessages.MUST_BE_STRINGS_NOT_P, "type() argument 2", bases);<NEW_LINE>} else if (!(dict instanceof PDict)) {<NEW_LINE>throw raise(TypeError, ErrorMessages.MUST_BE_STRINGS_NOT_P, "type() argument 3", dict);<NEW_LINE>} else if (!isTypeNode.execute(cls)) {<NEW_LINE>// TODO: this is actually allowed, deal with it<NEW_LINE>throw raise(NotImplementedError, "creating a class with non-class metaclass");<NEW_LINE>}<NEW_LINE>return nextTypeNode.execute(frame, cls, <MASK><NEW_LINE>}
name, bases, dict, kwds);
3,338
private List<List<Object>> explodeRow(Heading head, List<Object> row) throws SQLException {<NEW_LINE>List<List<Object>> rows = new ArrayList<List<Object>>();<NEW_LINE>rows.add(row);<NEW_LINE>for (int ri = 0; ri < head.getColumnCount(); ri++) {<NEW_LINE>if (!head.getColumn(ri).isVisible())<NEW_LINE>continue;<NEW_LINE>Object element = row.get(ri);<NEW_LINE>if (element instanceof ESResultSet) {<NEW_LINE>ESResultSet nested = (ESResultSet) element;<NEW_LINE>String parent = head.getColumn(ri).getColumn();<NEW_LINE>long nestedCount = nested.getTotal();<NEW_LINE>if (nestedCount == 0) {<NEW_LINE>nested.close();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// add rows to hold the nested data<NEW_LINE>int rowCount = rows.size();<NEW_LINE>for (int n = 0; n < nestedCount - 1; n++) for (int i = 0; i < rowCount; i++) rows.add(Utils.clone(rows.get(i)));<NEW_LINE>// now add a nested row to each of the rows in the final resultset<NEW_LINE>for (int i = 0; i < rows.size(); i++) {<NEW_LINE>List<Object> destinationRow = rows.get(i);<NEW_LINE>List<Object> nestedRow = nested.getRow(i % (int) nestedCount);<NEW_LINE>for (Column nestedCol : nested.getHeading().columns()) {<NEW_LINE>String nestedColName = parent + "." + nestedCol.getColumn();<NEW_LINE>Column destinationCol = head.getColumnByLabel(nestedColName);<NEW_LINE>if (destinationCol == null) {<NEW_LINE>destinationCol = new Column(nestedColName).setAlias(nestedCol.getAlias()).setSqlType(nestedCol.getSqlType()).setVisible(nestedCol.isVisible());<NEW_LINE>head.add(destinationCol);<NEW_LINE>}<NEW_LINE>Object value = nestedRow.<MASK><NEW_LINE>destinationRow.set(destinationCol.getIndex(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nested.close();<NEW_LINE>row.set(ri, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rows;<NEW_LINE>}
get(nestedCol.getIndex());
735,726
public void updateListenerParam(Listener listener, ListenerParam param) {<NEW_LINE>checkDead();<NEW_LINE>synchronized (threadLock) {<NEW_LINE>if (audioDisabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(param) {<NEW_LINE>case Position:<NEW_LINE>Vector3f pos = listener.getLocation();<NEW_LINE>al.alListener3f(AL_POSITION, pos.x, pos.y, pos.z);<NEW_LINE>break;<NEW_LINE>case Rotation:<NEW_LINE>Vector3f dir = listener.getDirection();<NEW_LINE>Vector3f up = listener.getUp();<NEW_LINE>fb.rewind();<NEW_LINE>fb.put(dir.x).put(dir.y).put(dir.z);<NEW_LINE>fb.put(up.x).put(up.y).put(up.z);<NEW_LINE>fb.flip();<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case Velocity:<NEW_LINE>Vector3f vel = listener.getVelocity();<NEW_LINE>al.alListener3f(AL_VELOCITY, vel.x, vel.y, vel.z);<NEW_LINE>break;<NEW_LINE>case Volume:<NEW_LINE>al.alListenerf(AL_GAIN, listener.getVolume());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
al.alListener(AL_ORIENTATION, fb);
1,585,720
protected void onSizeChanged(int w, int h, int oldw, int oldh) {<NEW_LINE>super.onSizeChanged(w, h, oldw, oldh);<NEW_LINE>float xpad = (float) (getPaddingLeft() + getPaddingRight());<NEW_LINE>float ypad = (float) (getPaddingTop() + getPaddingBottom());<NEW_LINE>int viewWidth = (int) (w - xpad);<NEW_LINE>int viewHeight = (int) (h - ypad);<NEW_LINE>whiteKeysWidth = viewWidth / (numberOfWhiteKeys);<NEW_LINE>blackKeysWidth = (int) (whiteKeysWidth * 0.595f);<NEW_LINE>blackKeysHeight = <MASK><NEW_LINE>int whiteKeysIndex = 0;<NEW_LINE>int blackKeysIndex = 1;<NEW_LINE>int whiteKeysOffset = 0;<NEW_LINE>for (int i = 0; i < numberOfKeys; i++) {<NEW_LINE>if (keysType[i % 12] == 3) {<NEW_LINE>keys[i].layout(0, 0, blackKeysWidth, blackKeysHeight);<NEW_LINE>keys[i].offsetLeftAndRight((int) (whiteKeysOffset + whiteKeysWidth * 0.71f));<NEW_LINE>blackKeysIndex++;<NEW_LINE>} else {<NEW_LINE>keys[i].layout(0, 0, whiteKeysWidth, viewHeight);<NEW_LINE>whiteKeysOffset = whiteKeysWidth * whiteKeysIndex;<NEW_LINE>keys[i].offsetLeftAndRight(whiteKeysOffset);<NEW_LINE>whiteKeysIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(int) (viewHeight * 0.535f);
719,028
public static boolean registerDevice(final ActivityBase context) {<NEW_LINE>int userId = Util.getUserId(Process.myUid());<NEW_LINE>if (Util.hasProLicense(context) == null && !PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingRegistered, false)) {<NEW_LINE>// Get accounts<NEW_LINE>String email = null;<NEW_LINE>for (Account account : AccountManager.get(context).getAccounts()) if ("com.google".equals(account.type)) {<NEW_LINE>email = account.name;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>LayoutInflater LayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);<NEW_LINE>View view = LayoutInflater.inflate(R.layout.register, null);<NEW_LINE>final EditText input = (EditText) view.findViewById(R.id.etEmail);<NEW_LINE>if (email != null)<NEW_LINE>input.setText(email);<NEW_LINE>// Build dialog<NEW_LINE>AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);<NEW_LINE>alertDialogBuilder.setTitle(R.string.msg_register);<NEW_LINE>alertDialogBuilder.setIcon(context.getThemed(R.attr.icon_launcher));<NEW_LINE>alertDialogBuilder.setView(view);<NEW_LINE>alertDialogBuilder.setPositiveButton(context.getString(android.R.string.ok), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>String email = input.getText().toString();<NEW_LINE>if (Patterns.EMAIL_ADDRESS.matcher(email).matches())<NEW_LINE>new RegisterTask(context<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>alertDialogBuilder.setNegativeButton(context.getString(android.R.string.cancel), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>// Do nothing<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Show dialog<NEW_LINE>AlertDialog alertDialog = alertDialogBuilder.create();<NEW_LINE>alertDialog.show();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
).executeOnExecutor(mExecutor, email);
521,778
protected int writeValueAndFinal(int i, boolean isFinal) {<NEW_LINE>if (0 <= i && i <= BytesTrie.kMaxOneByteValue) {<NEW_LINE>return write(((BytesTrie.kMinOneByteValueLead + i) << 1) | (isFinal ? 1 : 0));<NEW_LINE>}<NEW_LINE>int length = 1;<NEW_LINE>if (i < 0 || i > 0xffffff) {<NEW_LINE>intBytes[0] = (byte) BytesTrie.kFiveByteValueLead;<NEW_LINE>intBytes[1] = (<MASK><NEW_LINE>intBytes[2] = (byte) (i >> 16);<NEW_LINE>intBytes[3] = (byte) (i >> 8);<NEW_LINE>intBytes[4] = (byte) i;<NEW_LINE>length = 5;<NEW_LINE>// } else if(i<=BytesTrie.kMaxOneByteValue) {<NEW_LINE>// intBytes[0]=(byte)(BytesTrie.kMinOneByteValueLead+i);<NEW_LINE>} else {<NEW_LINE>if (i <= BytesTrie.kMaxTwoByteValue) {<NEW_LINE>intBytes[0] = (byte) (BytesTrie.kMinTwoByteValueLead + (i >> 8));<NEW_LINE>} else {<NEW_LINE>if (i <= BytesTrie.kMaxThreeByteValue) {<NEW_LINE>intBytes[0] = (byte) (BytesTrie.kMinThreeByteValueLead + (i >> 16));<NEW_LINE>} else {<NEW_LINE>intBytes[0] = (byte) BytesTrie.kFourByteValueLead;<NEW_LINE>intBytes[1] = (byte) (i >> 16);<NEW_LINE>length = 2;<NEW_LINE>}<NEW_LINE>intBytes[length++] = (byte) (i >> 8);<NEW_LINE>}<NEW_LINE>intBytes[length++] = (byte) i;<NEW_LINE>}<NEW_LINE>intBytes[0] = (byte) ((intBytes[0] << 1) | (isFinal ? 1 : 0));<NEW_LINE>return write(intBytes, length);<NEW_LINE>}
byte) (i >> 24);
1,222,809
public KubernetesServiceInstance map(Service service) {<NEW_LINE>final ObjectMeta meta = service.getMetadata();<NEW_LINE>final List<ServicePort> ports = service.getSpec().getPorts();<NEW_LINE>ServicePort port = null;<NEW_LINE>if (ports.size() == 1) {<NEW_LINE>port = ports.get(0);<NEW_LINE>} else if (ports.size() > 1 && Utils.isNotNullOrEmpty(this.properties.getPortName())) {<NEW_LINE>Optional<ServicePort> optPort = ports.stream().filter(it -> properties.getPortName().endsWith(it.getName<MASK><NEW_LINE>if (optPort.isPresent()) {<NEW_LINE>port = optPort.get();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (port == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String host = KubernetesServiceInstanceMapper.createHost(service.getMetadata().getName(), service.getMetadata().getNamespace(), properties.getClusterDomain());<NEW_LINE>final boolean secure = KubernetesServiceInstanceMapper.isSecure(service.getMetadata().getLabels(), service.getMetadata().getAnnotations(), port.getName(), port.getPort());<NEW_LINE>return new KubernetesServiceInstance(meta.getUid(), meta.getName(), host, port.getPort(), getServiceMetadata(service), secure);<NEW_LINE>}
())).findAny();
1,204,919
public Credentials unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>Credentials credentials = new Credentials();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return credentials;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("AccessKeyId", targetDepth)) {<NEW_LINE>credentials.setAccessKeyId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("SecretAccessKey", targetDepth)) {<NEW_LINE>credentials.setSecretAccessKey(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("SessionToken", targetDepth)) {<NEW_LINE>credentials.setSessionToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Expiration", targetDepth)) {<NEW_LINE>credentials.setExpiration(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return credentials;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,784,290
private void createDetailsView() {<NEW_LINE>TableGroupHeadline conflictTableHeadline = new TableGroupHeadline(getConflictTableHeadLine());<NEW_LINE>GridPane.setRowIndex(conflictTableHeadline, ++gridRow);<NEW_LINE>GridPane.setMargin(conflictTableHeadline, new Insets(Layout.GROUP_DISTANCE, -10, -10, -10));<NEW_LINE>root.getChildren().add(conflictTableHeadline);<NEW_LINE>conflictTableView = new TableView<>();<NEW_LINE>conflictTableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData")));<NEW_LINE>conflictTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);<NEW_LINE>conflictTableView.setPrefHeight(100);<NEW_LINE>createConflictColumns();<NEW_LINE>GridPane.setRowIndex(conflictTableView, gridRow);<NEW_LINE>GridPane.setHgrow(conflictTableView, Priority.ALWAYS);<NEW_LINE>GridPane.<MASK><NEW_LINE>GridPane.setMargin(conflictTableView, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE, -10, 5, -10));<NEW_LINE>root.getChildren().add(conflictTableView);<NEW_LINE>conflictTableView.setItems(sortedConflictList);<NEW_LINE>}
setVgrow(conflictTableView, Priority.SOMETIMES);
1,402,281
public static StateModelDefinition build() {<NEW_LINE>Builder builder = new Builder(name);<NEW_LINE>// init state<NEW_LINE>builder.initialState(States.OFFLINE.name());<NEW_LINE>// add states<NEW_LINE>builder.addState(States.ONLINE.name(), 20);<NEW_LINE>builder.addState(States.OFFLINE.name(), -1);<NEW_LINE>for (HelixDefinedState state : HelixDefinedState.values()) {<NEW_LINE>builder.addState(state.name(), -1);<NEW_LINE>}<NEW_LINE>// add transitions<NEW_LINE>builder.addTransition(States.ONLINE.name(), States.<MASK><NEW_LINE>builder.addTransition(States.OFFLINE.name(), States.ONLINE.name(), 5);<NEW_LINE>builder.addTransition(States.OFFLINE.name(), HelixDefinedState.DROPPED.name(), 0);<NEW_LINE>// bounds<NEW_LINE>builder.dynamicUpperBound(States.ONLINE.name(), "R");<NEW_LINE>return builder.build();<NEW_LINE>}
OFFLINE.name(), 25);
958,875
private void captureImage(Request req) {<NEW_LINE>boolean needExternalStoragePermission = !PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);<NEW_LINE>boolean needCameraPermission = cameraPermissionInManifest && !PermissionHelper.hasPermission(this, Manifest.permission.CAMERA);<NEW_LINE>if (needExternalStoragePermission || needCameraPermission) {<NEW_LINE>if (needExternalStoragePermission && needCameraPermission) {<NEW_LINE>PermissionHelper.requestPermissions(this, req.requestCode, new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA });<NEW_LINE>} else if (needExternalStoragePermission) {<NEW_LINE>PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.WRITE_EXTERNAL_STORAGE);<NEW_LINE>} else {<NEW_LINE>PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.CAMERA);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Save the number of images currently on disk for later<NEW_LINE>this.numPics = queryImgDB(whichContentStore()).getCount();<NEW_LINE>Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);<NEW_LINE>ContentResolver contentResolver = this.cordova.getActivity().getContentResolver();<NEW_LINE>ContentValues cv = new ContentValues();<NEW_LINE>cv.put(MediaStore.<MASK><NEW_LINE>imageUri = contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cv);<NEW_LINE>LOG.d(LOG_TAG, "Taking a picture and saving to: " + imageUri.toString());<NEW_LINE>intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageUri);<NEW_LINE>this.cordova.startActivityForResult((CordovaPlugin) this, intent, req.requestCode);<NEW_LINE>}<NEW_LINE>}
Images.Media.MIME_TYPE, IMAGE_JPEG);
954,628
public static void deleteLoggers(List<Map<String, Object>> allRows, String configName) {<NEW_LINE>ArrayList<String> newLoggers = new ArrayList<String>();<NEW_LINE>HashMap attrs = new HashMap();<NEW_LINE>attrs.put("target", configName);<NEW_LINE>Map result = RestUtil.restRequest((String) GuiUtil.getSessionValue("REST_URL") + "/list-log-levels.json", attrs, "GET", null, false);<NEW_LINE>List<String> oldLoggers = (List<String>) ((HashMap) ((HashMap) result.get("data")).get("extraProperties")).get("loggers");<NEW_LINE>for (Map<String, Object> oneRow : allRows) {<NEW_LINE>newLoggers.add((String) oneRow.get("loggerName"));<NEW_LINE>}<NEW_LINE>// delete the removed loggers<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String sep = "";<NEW_LINE>for (String logger : oldLoggers) {<NEW_LINE>if (!newLoggers.contains(logger)) {<NEW_LINE>if (logger.contains(":")) {<NEW_LINE>logger = logger.replace(":", "\\:");<NEW_LINE>}<NEW_LINE>sb.append(sep).append(logger);<NEW_LINE>sep = ":";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>attrs = new HashMap();<NEW_LINE>attrs.put("id", sb.toString());<NEW_LINE>attrs.put("target", configName);<NEW_LINE>RestUtil.restRequest((String) GuiUtil.getSessionValue("REST_URL") + "/delete-log-levels", <MASK><NEW_LINE>}<NEW_LINE>}
attrs, "POST", null, false);
261,202
private void updateHighlighters() {<NEW_LINE>final EditorEx editor = ((<MASK><NEW_LINE>if (editor == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final EditorEx editor2 = ((EditorEx) mySuffix.getEditor());<NEW_LINE>assert editor2 != null;<NEW_LINE>final Language language = InjectedLanguage.findLanguageById(getLanguage());<NEW_LINE>if (language == null) {<NEW_LINE>editor.setHighlighter(new LexerEditorHighlighter(new PlainSyntaxHighlighter(), editor.getColorsScheme()));<NEW_LINE>editor2.setHighlighter(new LexerEditorHighlighter(new PlainSyntaxHighlighter(), editor.getColorsScheme()));<NEW_LINE>} else {<NEW_LINE>final SyntaxHighlighter s1 = SyntaxHighlighterFactory.getSyntaxHighlighter(language, getProject(), null);<NEW_LINE>final SyntaxHighlighter s2 = SyntaxHighlighterFactory.getSyntaxHighlighter(language, getProject(), null);<NEW_LINE>editor.setHighlighter(new LexerEditorHighlighter(s1, editor.getColorsScheme()));<NEW_LINE>editor2.setHighlighter(new LexerEditorHighlighter(s2, editor2.getColorsScheme()));<NEW_LINE>}<NEW_LINE>}
EditorEx) myPrefix.getEditor());
1,165,937
private Mono<Response<RemediationInner>> createOrUpdateAtSubscriptionWithResponseAsync(String remediationName, RemediationInner parameters) {<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 (remediationName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-10-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.createOrUpdateAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), remediationName, apiVersion, parameters, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter remediationName is required and cannot be null."));
962,226
public Matrix subtract(Matrix m1, Matrix m2) {<NEW_LINE><MASK><NEW_LINE>ArgChecker.notNull(m2, "m2");<NEW_LINE>if (m1 instanceof DoubleArray) {<NEW_LINE>if (m2 instanceof DoubleArray) {<NEW_LINE>DoubleArray array1 = (DoubleArray) m1;<NEW_LINE>DoubleArray array2 = (DoubleArray) m2;<NEW_LINE>return array1.minus(array2);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Tried to subtract a " + m1.getClass() + " and " + m2.getClass());<NEW_LINE>} else if (m1 instanceof DoubleMatrix) {<NEW_LINE>if (m2 instanceof DoubleMatrix) {<NEW_LINE>DoubleMatrix matrix1 = (DoubleMatrix) m1;<NEW_LINE>DoubleMatrix matrix2 = (DoubleMatrix) m2;<NEW_LINE>return matrix1.minus(matrix2);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Tried to subtract a " + m1.getClass() + " and " + m2.getClass());<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}
ArgChecker.notNull(m1, "m1");
561,481
private void stopTask() {<NEW_LINE><MASK><NEW_LINE>// Flag the task to be stopped<NEW_LINE>if (_taskService != null && _taskService.isRunning()) {<NEW_LINE>_taskService.stopAsync();<NEW_LINE>}<NEW_LINE>// Send a signal to the task thread if necessary<NEW_LINE>if (_taskThread != null && _taskThread.isAlive()) {<NEW_LINE>try {<NEW_LINE>DurableScheduledService.this.signalShutdown(_taskThread);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>// Best faith effort<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Wait for the task to stop on its own accord after calling signal<NEW_LINE>try {<NEW_LINE>_taskService.awaitTerminated(_shutdownTimeout.toMillis(), TimeUnit.MILLISECONDS);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>// Best faith effort<NEW_LINE>}<NEW_LINE>LOG.debug("Task {} stopped {}", _taskService, Optional.ofNullable(_taskThread).map(Thread::isAlive).orElse(false) ? "unsuccessfully" : "successfully");<NEW_LINE>}
LOG.debug("Stopping task {}", _taskService);
378,504
private void createRerunButtons() {<NEW_LINE>rerunButton = new JButton(rerunIcon);<NEW_LINE>rerunButton.setEnabled(false);<NEW_LINE>rerunButton.getAccessibleContext().setAccessibleName(Bundle.ACSN_RerunButton());<NEW_LINE>rerunButton.setToolTipText(Bundle.MultiviewPanel_rerunButton_tooltip());<NEW_LINE>rerunFailedButton = new JButton(rerunFailedIcon);<NEW_LINE>rerunFailedButton.setEnabled(false);<NEW_LINE>rerunFailedButton.getAccessibleContext().setAccessibleName(Bundle.ACSN_RerunFailedButton());<NEW_LINE>rerunFailedButton.setToolTipText(Bundle.MultiviewPanel_rerunFailedButton_tooltip());<NEW_LINE>final RerunHandler rerunHandler = displayHandler.getSession().getRerunHandler();<NEW_LINE>if (rerunHandler != null) {<NEW_LINE>rerunButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>rerunHandler.rerun();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>rerunFailedButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>rerunHandler.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>rerunHandler.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>updateButtons();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>updateButtons();<NEW_LINE>}<NEW_LINE>}
rerun(treePanel.getFailedTests());
914,682
public void doOnResponse(Object result) {<NEW_LINE>if (rpcFuture == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ClassLoader oldCl = Thread.currentThread().getContextClassLoader();<NEW_LINE>SofaResponse response = (SofaResponse) result;<NEW_LINE>try {<NEW_LINE>Thread.currentThread().setContextClassLoader(this.classLoader);<NEW_LINE>RpcInternalContext.setContext(context);<NEW_LINE>if (EventBus.isEnable(ClientAsyncReceiveEvent.class)) {<NEW_LINE>EventBus.post(new ClientAsyncReceiveEvent(consumerConfig, providerInfo, request, response, null));<NEW_LINE>}<NEW_LINE>pickupBaggage(response);<NEW_LINE>// do async filter after respond server<NEW_LINE>FilterChain chain = consumerConfig.getConsumerBootstrap()<MASK><NEW_LINE>if (chain != null) {<NEW_LINE>chain.onAsyncResponse(consumerConfig, request, response, null);<NEW_LINE>}<NEW_LINE>recordClientElapseTime();<NEW_LINE>if (EventBus.isEnable(ClientEndInvokeEvent.class)) {<NEW_LINE>EventBus.post(new ClientEndInvokeEvent(request, response, null));<NEW_LINE>}<NEW_LINE>decode(response);<NEW_LINE>rpcFuture.setSuccess(response);<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(oldCl);<NEW_LINE>RpcInvokeContext.removeContext();<NEW_LINE>RpcInternalContext.removeAllContext();<NEW_LINE>}<NEW_LINE>}
.getCluster().getFilterChain();
1,308,812
private Agent lookupAgent(Task task) {<NEW_LINE>// FIXME: superuser security context<NEW_LINE>Class taskClass = task.getClass();<NEW_LINE>Agent agent = null;<NEW_LINE>Class agentClass = agentClassCache.get(taskClass.getName());<NEW_LINE>// cache miss<NEW_LINE>if (agentClass == null) {<NEW_LINE>Map<String, Class<? extends Agent>> agentClassesMap = getAgents();<NEW_LINE>if (agentClassesMap != null) {<NEW_LINE>for (Entry<String, Class<? extends Agent>> classEntry : agentClassesMap.entrySet()) {<NEW_LINE>Class<? extends Agent> supportedAgentClass = agentClassesMap.get(classEntry.getKey());<NEW_LINE>try {<NEW_LINE>Agent supportedAgent = supportedAgentClass.newInstance();<NEW_LINE><MASK><NEW_LINE>if (supportedTaskClass.equals(taskClass)) {<NEW_LINE>agentClass = supportedAgentClass;<NEW_LINE>}<NEW_LINE>agentClassCache.put(supportedTaskClass.getName(), supportedAgentClass);<NEW_LINE>} catch (Throwable ignore) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (agentClass != null) {<NEW_LINE>try {<NEW_LINE>agent = (Agent) agentClass.newInstance();<NEW_LINE>} catch (Throwable ignore) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (agent);<NEW_LINE>}
Class supportedTaskClass = supportedAgent.getSupportedTaskType();
1,106,889
private void migrateAttachment() {<NEW_LINE>addLog("@AD_Attachment_ID@");<NEW_LINE>KeyNamePair[] attachmentArray = DB.getKeyNamePairs("SELECT AD_Attachment_ID, UUID " + "FROM AD_Attachment " + "WHERE AD_Client_ID = ?", false, getAD_Client_ID());<NEW_LINE>Arrays.asList(attachmentArray).forEach(attachmentPair -> {<NEW_LINE>Arrays.asList(new MAttachment(getCtx(), attachmentPair.getKey(), get_TrxName()).getEntries()).forEach(entry -> {<NEW_LINE>Trx.run(new TrxRunnable() {<NEW_LINE><NEW_LINE>public void run(String trxName) {<NEW_LINE>// Find existing reference<NEW_LINE>int attachmentReferenceId = DB.getSQLValue(get_TrxName(), "SELECT AD_AttachmentReference_ID " + "FROM AD_AttachmentReference " + "WHERE AD_Attachment_ID = ? " + "AND FileName = ? " + "AND FileHandler_ID = ?", attachmentPair.getKey(), entry.<MASK><NEW_LINE>if (attachmentReferenceId < 0) {<NEW_LINE>try {<NEW_LINE>AttachmentUtil.getInstance(getCtx()).withData(entry.getData()).withAttachmentId(attachmentPair.getKey()).withFileName(entry.getName()).withDescription(Msg.getMsg(getCtx(), "CreatedFromSetupExternalStorage")).withFileHandlerId(getFileHandlerId()).saveAttachment();<NEW_LINE>addLog(entry.getName() + ": @Ok@");<NEW_LINE>processed.incrementAndGet();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warning("Error: " + e.getLocalizedMessage());<NEW_LINE>addLog("@ErrorProcessingFile@ " + entry.getName() + ": " + e.getLocalizedMessage());<NEW_LINE>errors.incrementAndGet();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addLog(entry.getName() + ": @Ignored@");<NEW_LINE>ignored.incrementAndGet();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
getName(), getAppSupportId());
1,583,144
public static void main(String[] args) throws Exception {<NEW_LINE>Exchange itbit = ItBitDemoUtils.createExchange();<NEW_LINE>AccountService account = itbit.getAccountService();<NEW_LINE>TradeService tradeService = itbit.getTradeService();<NEW_LINE>AccountInfo accountInfo = account.getAccountInfo();<NEW_LINE>System.out.println("Account Info: " + accountInfo);<NEW_LINE>printOpenOrders(tradeService);<NEW_LINE>String placeLimitOrderXBT = tradeService.placeLimitOrder(new LimitOrder(OrderType.BID, BigDecimal.valueOf(0.001), new CurrencyPair("XBT", "USD"), "0", new Date(), BigDecimal.valueOf(300)));<NEW_LINE>String placeLimitOrderBTC = tradeService.placeLimitOrder(new LimitOrder(OrderType.BID, BigDecimal.valueOf(0.001), new CurrencyPair("BTC", "USD"), "0", new Date(), BigDecimal.valueOf(360)));<NEW_LINE>System.out.println("limit order id " + placeLimitOrderXBT);<NEW_LINE>System.out.println("limit order id " + placeLimitOrderBTC);<NEW_LINE>printOrderStatus(tradeService, placeLimitOrderXBT);<NEW_LINE>printOrderStatus(tradeService, placeLimitOrderBTC);<NEW_LINE>printOpenOrders(tradeService);<NEW_LINE>System.out.println("Cancelling " + placeLimitOrderXBT);<NEW_LINE>tradeService.cancelOrder(placeLimitOrderXBT);<NEW_LINE>printOrderStatus(tradeService, placeLimitOrderXBT);<NEW_LINE>printOpenOrders(tradeService);<NEW_LINE>System.<MASK><NEW_LINE>tradeService.cancelOrder(placeLimitOrderBTC);<NEW_LINE>printOrderStatus(tradeService, placeLimitOrderBTC);<NEW_LINE>printOpenOrders(tradeService);<NEW_LINE>Trades tradeHistory = tradeService.getTradeHistory(tradeService.createTradeHistoryParams());<NEW_LINE>System.out.println("Trade history: " + tradeHistory);<NEW_LINE>printOrderStatus(tradeService, placeLimitOrderXBT);<NEW_LINE>printOrderStatus(tradeService, placeLimitOrderBTC);<NEW_LINE>printOpenOrders(tradeService);<NEW_LINE>}
out.println("Cancelling " + placeLimitOrderBTC);
1,423,756
final ListModelPackagingJobsResult executeListModelPackagingJobs(ListModelPackagingJobsRequest listModelPackagingJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listModelPackagingJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListModelPackagingJobsRequest> request = null;<NEW_LINE>Response<ListModelPackagingJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListModelPackagingJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listModelPackagingJobsRequest));<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, "LookoutVision");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListModelPackagingJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListModelPackagingJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListModelPackagingJobsResultJsonUnmarshaller());<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());
74,089
public static void main(final String[] args) {<NEW_LINE>CommandSpec spec = CommandSpec.create();<NEW_LINE>spec.mixinStandardHelpOptions(true);<NEW_LINE>spec.addOption(OptionSpec.builder("-c", "--count").paramLabel("COUNT").type(int.class).description<MASK><NEW_LINE>spec.addPositional(PositionalParamSpec.builder().paramLabel("FILES").type(List.class).auxiliaryTypes(File.class).description("The files to process").build());<NEW_LINE>CommandLine commandLine = new CommandLine(spec);<NEW_LINE>try {<NEW_LINE>ParseResult pr = commandLine.parseArgs(args);<NEW_LINE>if (CommandLine.printHelpIfRequested(pr)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int count = pr.matchedOptionValue('c', 1);<NEW_LINE>List<File> files = pr.matchedPositionalValue(0, Collections.<File>emptyList());<NEW_LINE>for (File f : files) {<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>System.out.println(i + " " + f.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ParameterException ex) {<NEW_LINE>System.err.println(ex.getMessage());<NEW_LINE>ex.getCommandLine().usage(System.err);<NEW_LINE>}<NEW_LINE>}
("number of times to execute").build());
1,817,511
public com.amazonaws.services.route53resolver.model.InternalServiceErrorException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.route53resolver.model.InternalServiceErrorException internalServiceErrorException = new com.amazonaws.services.route53resolver.model.InternalServiceErrorException(null);<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>} 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 internalServiceErrorException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
542,985
final GetTagsResult executeGetTags(GetTagsRequest getTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTagsRequest> request = null;<NEW_LINE>Response<GetTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTagsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTagsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
209,135
private JSONObject decode35(ByteBuffer buf) {<NEW_LINE>JSONObject m = new JSONObject();<NEW_LINE>while (buf.position() < buf.array().length) {<NEW_LINE>long tl = uint32(buf);<NEW_LINE>int t = (int) (tl >>> 3);<NEW_LINE>switch(t) {<NEW_LINE>case 1:<NEW_LINE>m.put("AAA311", uint32(buf));<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>m.put("AAA303", uint64(buf));<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>m.put<MASK><NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>m.put("AAA166", uint32(buf));<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>m.put("AAA167", (int) uint32(buf));<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>m.put("AAA168", uint32(buf));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// r.skipType(t&7)<NEW_LINE>// break;<NEW_LINE>return m;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>}
("AAA312", uint32(buf));
1,386,931
public SSLContext forDirectory(String directory) {<NEW_LINE>try {<NEW_LINE>Path keyPath = Paths.get(directory, "key.pem");<NEW_LINE>Path certPath = Paths.get(directory, "cert.pem");<NEW_LINE>Path caPath = Paths.get(directory, "ca.pem");<NEW_LINE>Path caKeyPath = Paths.get(directory, "ca-key.pem");<NEW_LINE><MASK><NEW_LINE>KeyManagerFactory keyManagerFactory = getKeyManagerFactory(keyPath, certPath);<NEW_LINE>TrustManagerFactory trustManagerFactory = getTrustManagerFactory(caPath, caKeyPath);<NEW_LINE>SSLContext sslContext = SSLContext.getInstance("TLS");<NEW_LINE>sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);<NEW_LINE>return sslContext;<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
verifyCertificateFiles(keyPath, certPath, caPath);
1,185,976
public static Event[] fromJson(final String json, final EventFactory factory) throws IOException {<NEW_LINE>// empty/blank json string does not generate an event<NEW_LINE>if (json == null || isBlank(json)) {<NEW_LINE>return NULL_ARRAY;<NEW_LINE>}<NEW_LINE>Object o = parseJson(json);<NEW_LINE>// we currently only support Map or Array json objects<NEW_LINE>if (o instanceof Map) {<NEW_LINE>// NOTE: we need to assume the factory returns org.logstash.Event impl<NEW_LINE>return new Event[] { (Event) factory.newEvent((Map<? extends Serializable, Object>) o) };<NEW_LINE>}<NEW_LINE>if (o instanceof List) {<NEW_LINE>// Jackson returns an ArrayList<NEW_LINE>return fromList((List<Map<String, <MASK><NEW_LINE>}<NEW_LINE>throw new IOException("incompatible json object type=" + o.getClass().getName() + " , only hash map or arrays are supported");<NEW_LINE>}
Object>>) o, factory);
1,293,593
public void testShardingKeyNotUsableWithDriversConnectionBuilder() throws Exception {<NEW_LINE>ShardingKeyBuilder keybuilder = sharablePool1DataSourceWithAppAuth.createShardingKeyBuilder();<NEW_LINE>ShardingKey key = keybuilder.subkey(Arrays.asList(23, 41, 86, 17, 95), JDBCType.ARRAY).build();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>conbuilder.shardingKey(key);<NEW_LINE>fail("Should not be able to set sharding key on connection builder that is backed by java.sql.Driver. " + keybuilder);<NEW_LINE>} catch (UnsupportedOperationException x) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>conbuilder.superShardingKey(key);<NEW_LINE>fail("Should not be able to set super sharding key on connection builder that is backed by java.sql.Driver. " + keybuilder);<NEW_LINE>} catch (UnsupportedOperationException x) {<NEW_LINE>}<NEW_LINE>// Null values are acceptable<NEW_LINE>conbuilder.shardingKey(null);<NEW_LINE>conbuilder.superShardingKey(null);<NEW_LINE>Connection con = conbuilder.build();<NEW_LINE>try {<NEW_LINE>PreparedStatement ps = con.prepareStatement("INSERT INTO STREETS VALUES(?, ?, ?)");<NEW_LINE>ps.setString(1, "Northern Hills Drive NE");<NEW_LINE>ps.setString(2, "Rochester");<NEW_LINE>ps.setString(3, "MN");<NEW_LINE>ps.executeUpdate();<NEW_LINE>ps.close();<NEW_LINE>} finally {<NEW_LINE>con.close();<NEW_LINE>}<NEW_LINE>}
ConnectionBuilder conbuilder = defaultDataSource.createConnectionBuilder();
1,513,894
protected Answer execute(MigrateVmToPoolCommand cmd) {<NEW_LINE>final String vmName = cmd.getVmName();<NEW_LINE>VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());<NEW_LINE>try {<NEW_LINE>VirtualMachineMO vmMo = getVirtualMachineMO(vmName, hyperHost);<NEW_LINE>if (vmMo == null) {<NEW_LINE>s_logger.info("VM " + vmName + " was not found in the cluster of host " + <MASK><NEW_LINE>ManagedObjectReference dcMor = hyperHost.getHyperHostDatacenter();<NEW_LINE>DatacenterMO dcMo = new DatacenterMO(hyperHost.getContext(), dcMor);<NEW_LINE>vmMo = dcMo.findVm(vmName);<NEW_LINE>if (vmMo == null) {<NEW_LINE>String msg = "VM " + vmName + " does not exist in VMware datacenter";<NEW_LINE>s_logger.error(msg);<NEW_LINE>throw new CloudRuntimeException(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return migrateAndAnswer(vmMo, null, hyperHost, cmd);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// hopefully only CloudRuntimeException :/<NEW_LINE>if (e instanceof Exception) {<NEW_LINE>return new Answer(cmd, (Exception) e);<NEW_LINE>}<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("problem", e);<NEW_LINE>}<NEW_LINE>s_logger.error(e.getLocalizedMessage());<NEW_LINE>return new Answer(cmd, false, "unknown problem: " + e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}
hyperHost.getHyperHostName() + ". Looking for the VM in datacenter.");
816,653
protected void encodeContent(FacesContext context, ConfirmDialog dialog) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String messageText = dialog.getMessage();<NEW_LINE>UIComponent <MASK><NEW_LINE>String defaultIcon = dialog.isGlobal() ? "ui-icon" : "ui-icon ui-icon-" + dialog.getSeverity();<NEW_LINE>String severityIcon = defaultIcon + " " + ConfirmDialog.SEVERITY_ICON_CLASS;<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("class", Dialog.CONTENT_CLASS, null);<NEW_LINE>writer.writeAttribute("id", dialog.getClientId(context) + "_content", null);<NEW_LINE>// severity<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", severityIcon, null);<NEW_LINE>writer.endElement("span");<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", ConfirmDialog.MESSAGE_CLASS, null);<NEW_LINE>if (ComponentUtils.shouldRenderFacet(messageFacet)) {<NEW_LINE>messageFacet.encodeAll(context);<NEW_LINE>} else if (messageText != null) {<NEW_LINE>writer.writeText(messageText, null);<NEW_LINE>}<NEW_LINE>writer.endElement("span");<NEW_LINE>writer.endElement("div");<NEW_LINE>}
messageFacet = dialog.getFacet("message");