idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,114,290 | private boolean decodeRelayParameters(Cardio2eRelayTransaction receivedCardio2eTransaction, List<String> digestedTransaction) {<NEW_LINE>boolean decodeComplete = false;<NEW_LINE>switch(receivedCardio2eTransaction.getTransactionType()) {<NEW_LINE>case ACK:<NEW_LINE>case GET:<NEW_LINE>if (digestedTransaction.size() == 3) {<NEW_LINE>try {<NEW_LINE>receivedCardio2eTransaction.setObjectNumber(Short.parseShort(digestedTransaction.get(2)));<NEW_LINE>decodeComplete = true;<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>logger.warn("Illegal argument in decoding RELAY transaction: '{}'", ex.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NACK:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case INFORMATION:<NEW_LINE>case SET:<NEW_LINE>if (digestedTransaction.size() == 4) {<NEW_LINE>try {<NEW_LINE>if (digestedTransaction.get(3).length() == 1) {<NEW_LINE>receivedCardio2eTransaction.setObjectNumber(Short.parseShort(digestedTransaction.get(2)));<NEW_LINE>receivedCardio2eTransaction.setRelayState(Cardio2eRelayStates.fromSymbol(digestedTransaction.get(3).charAt(0)));<NEW_LINE>decodeComplete = true;<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>logger.warn("Illegal argument in decoding RELAY transaction: '{}'", ex.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return decodeComplete;<NEW_LINE>} | decodeComplete = decodeNACK(receivedCardio2eTransaction, digestedTransaction); |
262,287 | // Look for reads and writes to temporaries<NEW_LINE>private void optimizeGather1(Constructor ct, MapSTL<Long, OptimizeRecord> recs, int secnum) {<NEW_LINE>ConstructTpl tpl;<NEW_LINE>if (secnum < 0) {<NEW_LINE>tpl = ct.getTempl();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (tpl == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VectorSTL<OpTpl> ops = tpl.getOpvec();<NEW_LINE>for (int i = 0; i < ops.size(); ++i) {<NEW_LINE>OpTpl op = ops.get(i);<NEW_LINE>for (int j = 0; j < op.numInput(); ++j) {<NEW_LINE>VarnodeTpl vnin = op.getIn(j);<NEW_LINE>examineVn(recs, vnin, i, j, secnum);<NEW_LINE>}<NEW_LINE>VarnodeTpl vn = op.getOut();<NEW_LINE>examineVn(recs, vn, i, -1, secnum);<NEW_LINE>}<NEW_LINE>} | tpl = ct.getNamedTempl(secnum); |
1,617,399 | // transfer demand from previous to next<NEW_LINE>public void addMissingRequests() {<NEW_LINE>int missed = 1;<NEW_LINE>long toRequest = 0L;<NEW_LINE>do {<NEW_LINE>long localQueued = queued.getAndSet(0l);<NEW_LINE>Subscription localSub = next.getAndSet(null);<NEW_LINE>long missedOutput = produced.get();<NEW_LINE>Subscription localActive = active.get();<NEW_LINE>long reqs = requested.get() + localQueued;<NEW_LINE>if (reqs < 0 || toRequest < 0) {<NEW_LINE>processAll = true;<NEW_LINE>if (localSub != null)<NEW_LINE>localSub.request(Long.MAX_VALUE);<NEW_LINE>if (localActive != null)<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>requested.set(reqs);<NEW_LINE>if (localSub != null) {<NEW_LINE>active.set(localSub);<NEW_LINE>toRequest += reqs;<NEW_LINE>} else if (localQueued != 0 && localActive != null) {<NEW_LINE>toRequest += reqs;<NEW_LINE>}<NEW_LINE>missed = wip.accumulateAndGet(missed, (a, b) -> a - b);<NEW_LINE>} while (missed != 0);<NEW_LINE>if (toRequest > 0)<NEW_LINE>active.get().request(toRequest);<NEW_LINE>} | localActive.request(Long.MAX_VALUE); |
145,167 | public static NKFCharset guess(ThreadContext context, IRubyObject s) {<NEW_LINE>// TODO: Fix charset usage for JRUBY-4553<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>if (!s.respondsTo("to_str")) {<NEW_LINE>throw runtime.newTypeError("can't convert " + s.getMetaClass() + " into String");<NEW_LINE>}<NEW_LINE>ByteList bytes = s.convertToString().getByteList();<NEW_LINE>ByteBuffer buf = ByteBuffer.wrap(bytes.getUnsafeBytes(), bytes.begin(<MASK><NEW_LINE>CharsetDecoder decoder;<NEW_LINE>try {<NEW_LINE>decoder = Charset.forName("x-JISAutoDetect").newDecoder();<NEW_LINE>} catch (UnsupportedCharsetException e) {<NEW_LINE>throw runtime.newStandardError("charsets.jar is required to use NKF#guess. Please install JRE which supports m17n.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>decoder.decode(buf);<NEW_LINE>if (!decoder.isCharsetDetected()) {<NEW_LINE>return NKFCharset.UNKNOWN;<NEW_LINE>}<NEW_LINE>Charset charset = decoder.detectedCharset();<NEW_LINE>String name = charset.name();<NEW_LINE>if ("Shift_JIS".equals(name)) {<NEW_LINE>return NKFCharset.SJIS;<NEW_LINE>}<NEW_LINE>if ("Windows-31j".equalsIgnoreCase(name)) {<NEW_LINE>return NKFCharset.JIS;<NEW_LINE>}<NEW_LINE>if ("EUC-JP".equals(name)) {<NEW_LINE>return NKFCharset.EUC;<NEW_LINE>}<NEW_LINE>if ("ISO-2022-JP".equals(name)) {<NEW_LINE>return NKFCharset.JIS;<NEW_LINE>}<NEW_LINE>} catch (CharacterCodingException e) {<NEW_LINE>// fall through and try direct encoding<NEW_LINE>}<NEW_LINE>if (bytes.getEncoding() == UTF8Encoding.INSTANCE) {<NEW_LINE>return NKFCharset.UTF8;<NEW_LINE>}<NEW_LINE>if (bytes.getEncoding().toString().startsWith("UTF-16")) {<NEW_LINE>return NKFCharset.UTF16;<NEW_LINE>}<NEW_LINE>if (bytes.getEncoding().toString().startsWith("UTF-32")) {<NEW_LINE>return NKFCharset.UTF32;<NEW_LINE>}<NEW_LINE>return NKFCharset.UNKNOWN;<NEW_LINE>} | ), bytes.length()); |
332,066 | public CtClass makeSubclass2(ClassPool pool, CtClass type) throws CannotCompileException, NotFoundException, IOException {<NEW_LINE>CtClass vec = pool.makeClass(makeClassName(type));<NEW_LINE>vec.setSuperclass(pool.get("java.util.Vector"));<NEW_LINE>CtClass c = pool.get("sample.vector.Sample2");<NEW_LINE>CtMethod addmethod = c.getDeclaredMethod("add");<NEW_LINE>CtMethod atmethod = c.getDeclaredMethod("at");<NEW_LINE>CtClass[] args1 = { type };<NEW_LINE>CtClass[<MASK><NEW_LINE>CtMethod m = CtNewMethod.wrapped(CtClass.voidType, "add", args1, null, addmethod, null, vec);<NEW_LINE>vec.addMethod(m);<NEW_LINE>m = CtNewMethod.wrapped(type, "at", args2, null, atmethod, null, vec);<NEW_LINE>vec.addMethod(m);<NEW_LINE>vec.writeFile();<NEW_LINE>return vec;<NEW_LINE>} | ] args2 = { CtClass.intType }; |
1,395,773 | public Address add(Address addr, long displacement) {<NEW_LINE>if (displacement < 0) {<NEW_LINE>return subtract(addr, -displacement);<NEW_LINE>}<NEW_LINE>testAddressSpace(addr);<NEW_LINE>if (displacement > spaceSize) {<NEW_LINE>throw new AddressOutOfBoundsException("Address Overflow in add: " + addr + " + " + displacement);<NEW_LINE>}<NEW_LINE>long off = addr.getOffset() + displacement;<NEW_LINE>// if ((off & MASK) == off) {<NEW_LINE>if (off >= 0 && off <= maxOffset) {<NEW_LINE>SegmentedAddress saddr = (SegmentedAddress) addr;<NEW_LINE>Address resaddr = getAddressInSegment(off, saddr.getSegment());<NEW_LINE>if (resaddr == null) {<NEW_LINE>// Could not map into desired segment<NEW_LINE>// just use default<NEW_LINE>resaddr = new SegmentedAddress(this, off);<NEW_LINE>}<NEW_LINE>return resaddr;<NEW_LINE>}<NEW_LINE>throw new AddressOutOfBoundsException(<MASK><NEW_LINE>} | "Address Overflow in add: " + addr + " + " + displacement); |
1,202,941 | public Set<Permission> fetchAllPermissions(String resouceName) throws IOException, GeneralSecurityException {<NEW_LINE>logger.atInfo().log("Fetching all permissions from " + resouceName);<NEW_LINE>QueryTestablePermissionsRequest requestBody = new QueryTestablePermissionsRequest();<NEW_LINE>requestBody.setFullResourceName(resouceName);<NEW_LINE><MASK><NEW_LINE>Iam.Permissions.QueryTestablePermissions request = iamService.permissions().queryTestablePermissions(requestBody);<NEW_LINE>QueryTestablePermissionsResponse response;<NEW_LINE>Set<Permission> permissionSet = new HashSet<Permission>();<NEW_LINE>do {<NEW_LINE>response = request.execute();<NEW_LINE>if (response.getPermissions() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Permission permission : response.getPermissions()) {<NEW_LINE>permissionSet.add(permission);<NEW_LINE>}<NEW_LINE>requestBody.setPageToken(response.getNextPageToken());<NEW_LINE>} while (response.getNextPageToken() != null);<NEW_LINE>logger.atInfo().log("Total number of permissions at " + resouceName + ":" + permissionSet.size());<NEW_LINE>return permissionSet;<NEW_LINE>} | Iam iamService = IamClient.getIamClient(); |
1,809,798 | private PureNFA createNFA(RegexASTSubtreeRootNode root) {<NEW_LINE>assert expansionQueue.isEmpty();<NEW_LINE>Arrays.fill(nfaStates, null);<NEW_LINE>stateID.reset();<NEW_LINE>transitionID.reset();<NEW_LINE>PureNFAState dummyInitialState = new PureNFAState(stateID.inc(), ast.getWrappedRoot());<NEW_LINE>nfaStates[ast.getWrappedRoot().getId()] = dummyInitialState;<NEW_LINE>if (!root.hasDollar()) {<NEW_LINE>anchoredFinalState = null;<NEW_LINE>} else {<NEW_LINE>anchoredFinalState = createFinalState(root.getAnchoredFinalState(), false);<NEW_LINE>anchoredFinalState.setAnchoredFinalState();<NEW_LINE>}<NEW_LINE>unAnchoredFinalState = createFinalState(root.getMatchFound(), false);<NEW_LINE>unAnchoredFinalState.setUnAnchoredFinalState();<NEW_LINE>PureNFATransition initialStateTransition = createEmptyTransition(dummyInitialState, createUnAnchoredInitialState(root.getUnAnchoredInitialState()));<NEW_LINE>if (root.hasCaret()) {<NEW_LINE>dummyInitialState.setSuccessors(new PureNFATransition[] { createEmptyTransition(dummyInitialState, createAnchoredInitialState(root.getAnchoredInitialState())), initialStateTransition });<NEW_LINE>} else {<NEW_LINE>dummyInitialState.setSuccessors(new PureNFATransition[] { initialStateTransition, initialStateTransition });<NEW_LINE>}<NEW_LINE>PureNFATransition finalStateTransition = createEmptyTransition(unAnchoredFinalState, dummyInitialState);<NEW_LINE>if (root.hasDollar()) {<NEW_LINE>dummyInitialState.setPredecessors(new PureNFATransition[] { createEmptyTransition(<MASK><NEW_LINE>} else {<NEW_LINE>dummyInitialState.setPredecessors(new PureNFATransition[] { finalStateTransition, finalStateTransition });<NEW_LINE>}<NEW_LINE>assert dummyInitialState.getId() == 0;<NEW_LINE>expandAllStates();<NEW_LINE>return new PureNFA(root, nfaStates, stateID, transitionID);<NEW_LINE>} | anchoredFinalState, dummyInitialState), finalStateTransition }); |
1,446,622 | public static DescribeDnsGtmMonitorConfigResponse unmarshall(DescribeDnsGtmMonitorConfigResponse describeDnsGtmMonitorConfigResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDnsGtmMonitorConfigResponse.setRequestId(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.RequestId"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setMonitorConfigId(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.MonitorConfigId"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setCreateTime(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.CreateTime"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setCreateTimestamp(_ctx.longValue("DescribeDnsGtmMonitorConfigResponse.CreateTimestamp"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setUpdateTime(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.UpdateTime"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setUpdateTimestamp<MASK><NEW_LINE>describeDnsGtmMonitorConfigResponse.setProtocolType(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.ProtocolType"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setInterval(_ctx.integerValue("DescribeDnsGtmMonitorConfigResponse.Interval"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setEvaluationCount(_ctx.integerValue("DescribeDnsGtmMonitorConfigResponse.EvaluationCount"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setTimeout(_ctx.integerValue("DescribeDnsGtmMonitorConfigResponse.Timeout"));<NEW_LINE>describeDnsGtmMonitorConfigResponse.setMonitorExtendInfo(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.MonitorExtendInfo"));<NEW_LINE>List<IspCityNode> ispCityNodes = new ArrayList<IspCityNode>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDnsGtmMonitorConfigResponse.IspCityNodes.Length"); i++) {<NEW_LINE>IspCityNode ispCityNode = new IspCityNode();<NEW_LINE>ispCityNode.setCountryName(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.IspCityNodes[" + i + "].CountryName"));<NEW_LINE>ispCityNode.setCountryCode(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.IspCityNodes[" + i + "].CountryCode"));<NEW_LINE>ispCityNode.setCityName(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.IspCityNodes[" + i + "].CityName"));<NEW_LINE>ispCityNode.setCityCode(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.IspCityNodes[" + i + "].CityCode"));<NEW_LINE>ispCityNode.setIspCode(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.IspCityNodes[" + i + "].IspCode"));<NEW_LINE>ispCityNode.setIspName(_ctx.stringValue("DescribeDnsGtmMonitorConfigResponse.IspCityNodes[" + i + "].IspName"));<NEW_LINE>ispCityNodes.add(ispCityNode);<NEW_LINE>}<NEW_LINE>describeDnsGtmMonitorConfigResponse.setIspCityNodes(ispCityNodes);<NEW_LINE>return describeDnsGtmMonitorConfigResponse;<NEW_LINE>} | (_ctx.longValue("DescribeDnsGtmMonitorConfigResponse.UpdateTimestamp")); |
224,257 | public boolean previewSql(EditingTarget editingTarget) {<NEW_LINE>TextEditingTargetCommentHeaderHelper previewSource = new TextEditingTargetCommentHeaderHelper(docDisplay_.getCode(), "preview", "--");<NEW_LINE>if (!previewSource.hasCommentHeader())<NEW_LINE>return false;<NEW_LINE>if (previewSource.getFunction().length() == 0) {<NEW_LINE>previewSource.setFunction(".rs.previewSql");<NEW_LINE>}<NEW_LINE>previewSource.buildCommand(editingTarget.getPath(), new OperationWithInput<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(String command) {<NEW_LINE>server_.previewSql(command, new ServerRequestCallback<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponseReceived(String message) {<NEW_LINE>if (!StringUtil.isNullOrEmpty(message)) {<NEW_LINE>display_.showErrorMessage(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(ServerError error) {<NEW_LINE>Debug.logError(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>} | constants_.errorPreviewingSql(), message); |
120,910 | private void dump() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (Map.Entry<Class, ApiMessageDescriptor> e : descriptors.entrySet()) {<NEW_LINE><MASK><NEW_LINE>sb.append("\n-------------------------------------------");<NEW_LINE>sb.append(String.format("\nname: %s", desc.getName()));<NEW_LINE>sb.append(String.format("\nconfigured service id: %s", desc.getServiceId()));<NEW_LINE>sb.append(String.format("\nconfig path: %s", desc.getConfigPath()));<NEW_LINE>List<String> inc = new ArrayList<String>();<NEW_LINE>for (ApiMessageInterceptor ic : desc.getInterceptors()) {<NEW_LINE>inc.add(ic.getClass().getName());<NEW_LINE>}<NEW_LINE>sb.append(String.format("\ninterceptors: %s", inc));<NEW_LINE>sb.append("\n-------------------------------------------");<NEW_LINE>}<NEW_LINE>logger.debug(String.format("ApiMessageDescriptor dump:\n%s", sb.toString()));<NEW_LINE>} | ApiMessageDescriptor desc = e.getValue(); |
228,139 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>log.info("doGet from " + request.getRemoteHost() + " - " + request.getRemoteAddr() + " - forward to notes.jsp");<NEW_LINE>String url = "/notes.jsp";<NEW_LINE>//<NEW_LINE>HttpSession session = request.getSession(false);<NEW_LINE>if (session == null || session.getAttribute(WebInfo.NAME) == null)<NEW_LINE>url = "/login.jsp";<NEW_LINE>else {<NEW_LINE>session.removeAttribute(WebSessionCtx.HDR_MESSAGE);<NEW_LINE>WebInfo info = (WebInfo) session.getAttribute(WebInfo.NAME);<NEW_LINE>if (info != null)<NEW_LINE>info.setMessage("");<NEW_LINE>// Parameter = Activity_ID - if valid and belongs to wu then create PDF & stream it<NEW_LINE>String msg = streamAttachment(request, response);<NEW_LINE>if (msg == null || msg.length() == 0)<NEW_LINE>return;<NEW_LINE>if (info != null)<NEW_LINE>info.setMessage(msg);<NEW_LINE>}<NEW_LINE>log.info("doGet - Forward to " + url);<NEW_LINE>RequestDispatcher dispatcher = <MASK><NEW_LINE>dispatcher.forward(request, response);<NEW_LINE>} | getServletContext().getRequestDispatcher(url); |
719,801 | private List<AbstractAnnotationBeanPostProcessor.AnnotatedFieldElement> findFieldAnnotationMetadata(final Class<?> beanClass) {<NEW_LINE>final List<AbstractAnnotationBeanPostProcessor.AnnotatedFieldElement> elements = new LinkedList<AbstractAnnotationBeanPostProcessor.AnnotatedFieldElement>();<NEW_LINE>ReflectionUtils.doWithFields(beanClass, new ReflectionUtils.FieldCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {<NEW_LINE>for (Class<? extends Annotation> annotationType : getAnnotationTypes()) {<NEW_LINE>AnnotationAttributes attributes = getAnnotationAttributes(field, annotationType, <MASK><NEW_LINE>if (attributes != null) {<NEW_LINE>if (Modifier.isStatic(field.getModifiers())) {<NEW_LINE>if (logger.isWarnEnabled()) {<NEW_LINE>logger.warn("@" + annotationType.getName() + " is not supported on static fields: " + field);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>elements.add(new AnnotatedFieldElement(field, attributes));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return elements;<NEW_LINE>} | getEnvironment(), true, true); |
3,496 | final GetStreamingImageResult executeGetStreamingImage(GetStreamingImageRequest getStreamingImageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getStreamingImageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetStreamingImageRequest> request = null;<NEW_LINE>Response<GetStreamingImageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetStreamingImageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getStreamingImageRequest));<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, "nimble");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetStreamingImage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetStreamingImageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetStreamingImageResultJsonUnmarshaller());<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); |
463,030 | public Request<PutRetentionPolicyRequest> marshall(PutRetentionPolicyRequest putRetentionPolicyRequest) {<NEW_LINE>if (putRetentionPolicyRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(PutRetentionPolicyRequest)");<NEW_LINE>}<NEW_LINE>Request<PutRetentionPolicyRequest> request = new DefaultRequest<PutRetentionPolicyRequest>(putRetentionPolicyRequest, "AmazonCloudWatchLogs");<NEW_LINE>String target = "Logs_20140328.PutRetentionPolicy";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (putRetentionPolicyRequest.getLogGroupName() != null) {<NEW_LINE>String logGroupName = putRetentionPolicyRequest.getLogGroupName();<NEW_LINE>jsonWriter.name("logGroupName");<NEW_LINE>jsonWriter.value(logGroupName);<NEW_LINE>}<NEW_LINE>if (putRetentionPolicyRequest.getRetentionInDays() != null) {<NEW_LINE>Integer retentionInDays = putRetentionPolicyRequest.getRetentionInDays();<NEW_LINE>jsonWriter.name("retentionInDays");<NEW_LINE>jsonWriter.value(retentionInDays);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] <MASK><NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | content = snippet.getBytes(UTF8); |
751,298 | public InstanceList[] nextSplit() {<NEW_LINE>if (!hasNext()) {<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>}<NEW_LINE>InstanceList[] ret = new InstanceList[2];<NEW_LINE>if (this.folds.length == 1) {<NEW_LINE>ret[0<MASK><NEW_LINE>ret[1] = this.folds[0];<NEW_LINE>} else {<NEW_LINE>InstanceList[] training = new InstanceList[this.folds.length - 1];<NEW_LINE>@Var<NEW_LINE>int j = 0;<NEW_LINE>for (int i = 0; i < this.folds.length; i++) {<NEW_LINE>if (i == this.index) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>training[j++] = this.folds[i];<NEW_LINE>}<NEW_LINE>ret[0] = new MultiInstanceList(training);<NEW_LINE>ret[1] = this.folds[this.index];<NEW_LINE>}<NEW_LINE>this.index++;<NEW_LINE>return ret;<NEW_LINE>} | ] = this.folds[0]; |
864,970 | private Path findBalaPath(Path repoLocation, String orgName, String pkgName, String platform, String versionStr) throws IOException {<NEW_LINE>Path balaFilePath = this.repoLocation.resolve(orgName).resolve<MASK><NEW_LINE>// try to find a compatible bala file<NEW_LINE>if (Files.exists(balaFilePath)) {<NEW_LINE>Stream<Path> list = Files.list(balaFilePath);<NEW_LINE>PathMatcher pathMatcher = balaFilePath.getFileSystem().getPathMatcher("glob:**/" + pkgName + "-*-" + platform + "-" + versionStr + ".bala");<NEW_LINE>for (Path file : (Iterable<Path>) list::iterator) {<NEW_LINE>if (pathMatcher.matches(file)) {<NEW_LINE>return file;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if a similar file is not found assume the default bala name<NEW_LINE>String balaFileName = pkgName + "-" + orgName + "-" + platform + "-" + versionStr + ".bala";<NEW_LINE>return balaFilePath.resolve(balaFileName);<NEW_LINE>} | (pkgName).resolve(versionStr); |
1,051,462 | public MultiplexOutputSettings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MultiplexOutputSettings multiplexOutputSettings = new MultiplexOutputSettings();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("destination", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>multiplexOutputSettings.setDestination(OutputLocationRefJsonUnmarshaller.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 multiplexOutputSettings;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,487,163 | final PutAccountConfigurationResult executePutAccountConfiguration(PutAccountConfigurationRequest putAccountConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putAccountConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutAccountConfigurationRequest> request = null;<NEW_LINE>Response<PutAccountConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutAccountConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putAccountConfigurationRequest));<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, "ACM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutAccountConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutAccountConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutAccountConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,517,746 | private static JsExpression simplifyOp(JsBinaryOperation expr) {<NEW_LINE>SourceInfo info = expr.getSourceInfo();<NEW_LINE><MASK><NEW_LINE>JsExpression arg2 = expr.getArg2();<NEW_LINE>JsBinaryOperator op = expr.getOperator();<NEW_LINE>if (op == JsBinaryOperator.ADD && (arg1 instanceof JsStringLiteral || arg2 instanceof JsStringLiteral)) {<NEW_LINE>// cases: number + string or string + number<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>if (appendLiteral(result, (JsValueLiteral) arg1) && appendLiteral(result, (JsValueLiteral) arg2)) {<NEW_LINE>return new JsStringLiteral(info, result.toString());<NEW_LINE>}<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if (arg1 instanceof JsNumberLiteral && arg2 instanceof JsNumberLiteral) {<NEW_LINE>double num1 = ((JsNumberLiteral) arg1).getValue();<NEW_LINE>double num2 = ((JsNumberLiteral) arg2).getValue();<NEW_LINE>Object result;<NEW_LINE>switch(op) {<NEW_LINE>case ADD:<NEW_LINE>result = Ieee754_64_Arithmetic.add(num1, num2);<NEW_LINE>break;<NEW_LINE>case SUB:<NEW_LINE>result = Ieee754_64_Arithmetic.subtract(num1, num2);<NEW_LINE>break;<NEW_LINE>case MUL:<NEW_LINE>result = Ieee754_64_Arithmetic.multiply(num1, num2);<NEW_LINE>break;<NEW_LINE>case DIV:<NEW_LINE>result = Ieee754_64_Arithmetic.divide(num1, num2);<NEW_LINE>break;<NEW_LINE>case MOD:<NEW_LINE>result = Ieee754_64_Arithmetic.mod(num1, num2);<NEW_LINE>break;<NEW_LINE>case LT:<NEW_LINE>result = Ieee754_64_Arithmetic.lt(num1, num2);<NEW_LINE>break;<NEW_LINE>case LTE:<NEW_LINE>result = Ieee754_64_Arithmetic.le(num1, num2);<NEW_LINE>break;<NEW_LINE>case GT:<NEW_LINE>result = Ieee754_64_Arithmetic.gt(num1, num2);<NEW_LINE>break;<NEW_LINE>case GTE:<NEW_LINE>result = Ieee754_64_Arithmetic.ge(num1, num2);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new InternalCompilerException("Can't handle simplify of op " + op);<NEW_LINE>}<NEW_LINE>return result instanceof Double ? new JsNumberLiteral(info, ((Double) result).doubleValue()) : JsBooleanLiteral.get(((Boolean) result).booleanValue());<NEW_LINE>}<NEW_LINE>return expr;<NEW_LINE>} | JsExpression arg1 = expr.getArg1(); |
1,401,335 | static void convertBgpProcess(Configuration c, CumulusNcluConfiguration vsConfig, Warnings w) {<NEW_LINE><MASK><NEW_LINE>if (bgpProcess == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// First pass: only core processes<NEW_LINE>c.getDefaultVrf().setBgpProcess(toBgpProcess(c, vsConfig, DEFAULT_VRF_NAME, bgpProcess.getDefaultVrf()));<NEW_LINE>// We make one VI process per VRF because our current datamodel requires it<NEW_LINE>bgpProcess.getVrfs().forEach((vrfName, bgpVrf) -> c.getVrfs().get(vrfName).setBgpProcess(toBgpProcess(c, vsConfig, vrfName, bgpVrf)));<NEW_LINE>// Create dud processes for other VRFs that use VNIs, so we can have proper RIBs<NEW_LINE>c.getVrfs().forEach((vrfName, vrf) -> {<NEW_LINE>if ((// VRF has some VNI<NEW_LINE>!vrf.getLayer2Vnis().isEmpty() || // process does not already exist<NEW_LINE>!vrf.getLayer3Vnis().isEmpty()) && vrf.getBgpProcess() == null && c.getDefaultVrf().getBgpProcess() != null) {<NEW_LINE>// there is a default BGP proc<NEW_LINE>vrf.setBgpProcess(bgpProcessBuilder().setRouterId(c.getDefaultVrf().getBgpProcess().getRouterId()).setRedistributionPolicy(initDenyAllBgpRedistributionPolicy(c)).build());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Iterables.concat(ImmutableSet.of(bgpProcess.getDefaultVrf()), bgpProcess.getVrfs().values()).forEach(bgpVrf -> {<NEW_LINE>bgpVrf.getNeighbors().values().forEach(neighbor -> addBgpNeighbor(c, vsConfig, bgpVrf, neighbor, w));<NEW_LINE>});<NEW_LINE>} | BgpProcess bgpProcess = vsConfig.getBgpProcess(); |
1,443,466 | private void createSearchItem() {<NEW_LINE>View searchView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.bottom_sheet_double_item, null);<NEW_LINE>TextView firstTitle = (TextView) searchView.findViewById(R.id.first_title);<NEW_LINE>TextView secondTitle = (TextView) searchView.findViewById(R.id.second_title);<NEW_LINE>ImageView firstIcon = (ImageView) searchView.findViewById(R.id.first_icon);<NEW_LINE>ImageView secondIcon = (ImageView) searchView.findViewById(R.id.second_icon);<NEW_LINE>firstTitle.setText(R.string.shared_string_search);<NEW_LINE>secondTitle.setText(R.string.shared_string_address);<NEW_LINE>firstIcon.setImageDrawable(getActiveIcon(R.drawable.ic_action_search_dark));<NEW_LINE>secondIcon.setImageDrawable(getActiveIcon(R.drawable.ic_action_street_name));<NEW_LINE>int dividerColor = ColorUtilities.getDividerColorId(nightMode);<NEW_LINE>AndroidUtils.setBackground(getContext(), searchView.findViewById(R.id.first_divider), dividerColor);<NEW_LINE>AndroidUtils.setBackground(getContext(), searchView.findViewById(R.id.second_divider), dividerColor);<NEW_LINE>searchView.findViewById(R.id.first_item).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>MapActivity mapActivity = (MapActivity) getActivity();<NEW_LINE>if (mapActivity != null) {<NEW_LINE>mapActivity.showQuickSearch(getSearchMode(), QuickSearchDialogFragment.QuickSearchTab.HISTORY);<NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>searchView.findViewById(R.id.second_item).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>MapActivity mapActivity = (MapActivity) getActivity();<NEW_LINE>if (mapActivity != null) {<NEW_LINE>mapActivity.<MASK><NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>items.add(new BaseBottomSheetItem.Builder().setCustomView(searchView).create());<NEW_LINE>} | showQuickSearch(getSearchMode(), false); |
190,245 | private void checkExpansionKeystroke(KeyEvent evt) {<NEW_LINE>Position pos = null;<NEW_LINE>Document d = null;<NEW_LINE>synchronized (abbrevChars) {<NEW_LINE>if (abbrevEndPosition != null && component != null && doc != null && component.getCaretPosition() == abbrevEndPosition.getOffset() && !isAbbrevDisabled() && doc.getProperty(EDITING_TEMPLATE_DOC_PROPERTY) == null) {<NEW_LINE>pos = abbrevEndPosition;<NEW_LINE>d = component.getDocument();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos != null && d != null) {<NEW_LINE>CodeTemplateManagerOperation operation = CodeTemplateManagerOperation.get(<MASK><NEW_LINE>if (operation != null) {<NEW_LINE>KeyStroke expandKeyStroke = operation.getExpansionKey();<NEW_LINE>if (expandKeyStroke.equals(KeyStroke.getKeyStrokeForEvent(evt))) {<NEW_LINE>if (expand(operation)) {<NEW_LINE>evt.consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | d, pos.getOffset()); |
1,667,646 | // ----- private methods -----<NEW_LINE>private boolean eq(final Object o1, final Object o2) {<NEW_LINE>if (o1 == null && o2 == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if ((o1 == null && o2 != null) || (o1 != null && o2 == null)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (o1 instanceof Number && o2 instanceof Number) {<NEW_LINE>return compareNumberNumber(o1, o2) == 0;<NEW_LINE>} else if (o1 instanceof String && o2 instanceof String) {<NEW_LINE>return compareStringString(o1, o2) == 0;<NEW_LINE>} else if (o1 instanceof Date && o2 instanceof Date) {<NEW_LINE>return compareDateDate(o1, o2) == 0;<NEW_LINE>} else if (o1 instanceof Date && o2 instanceof String) {<NEW_LINE>return compareDateString(o1, o2) == 0;<NEW_LINE>} else if (o1 instanceof String && o2 instanceof Date) {<NEW_LINE>return compareStringDate(o1, o2) == 0;<NEW_LINE>} else if (o1 instanceof Boolean && o2 instanceof String) {<NEW_LINE>return compareBooleanStringEqual((Boolean<MASK><NEW_LINE>} else if (o1 instanceof String && o2 instanceof Boolean) {<NEW_LINE>return compareBooleanStringEqual((String) o1, (Boolean) o2);<NEW_LINE>} else if (o1 instanceof Number && o2 instanceof String) {<NEW_LINE>return compareNumberString((Number) o1, (String) o2) == 0;<NEW_LINE>} else if (o1 instanceof String && o2 instanceof Number) {<NEW_LINE>return compareStringNumber((String) o1, (Number) o2) == 0;<NEW_LINE>} else {<NEW_LINE>return compareStringString(o1.toString(), o2.toString()) == 0;<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | ) o1, (String) o2); |
1,308,734 | private Model filterMetadata(Model model, Config config, List<ValidationEvent> suppressedEvents, Set<String> removedValidators) {<NEW_LINE>// Next remove metadata suppressions that didn't suppress anything.<NEW_LINE>ArrayNode suppressionsNode = model.getMetadata().getOrDefault("suppressions", Node.arrayNode()).expectArrayNode();<NEW_LINE>List<ObjectNode> updatedMetadataSuppressions = new ArrayList<>();<NEW_LINE>for (Node suppressionNode : suppressionsNode) {<NEW_LINE>ObjectNode object = suppressionNode.expectObjectNode();<NEW_LINE>String id = object.getStringMemberOrDefault("id", "");<NEW_LINE>String namespace = object.getStringMemberOrDefault("namespace", "");<NEW_LINE>if (config.getRemoveReasons()) {<NEW_LINE>object = object.withoutMember("reason");<NEW_LINE>}<NEW_LINE>// Only keep the suppression if it passes each filter.<NEW_LINE>if (isAllowed(id, config.getEventIdAllowList(), config.getEventIdDenyList()) && isAllowed(namespace, config.getNamespaceAllowList(), config.getNamespaceDenyList())) {<NEW_LINE>if (!config.getRemoveUnused()) {<NEW_LINE>updatedMetadataSuppressions.add(object);<NEW_LINE>} else {<NEW_LINE>Suppression <MASK><NEW_LINE>for (ValidationEvent event : suppressedEvents) {<NEW_LINE>if (!removedValidators.contains(event.getId()) && suppression.test(event)) {<NEW_LINE>updatedMetadataSuppressions.add(object);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ArrayNode updatedMetadataSuppressionsNode = Node.fromNodes(updatedMetadataSuppressions);<NEW_LINE>if (suppressionsNode.equals(updatedMetadataSuppressionsNode)) {<NEW_LINE>return model;<NEW_LINE>}<NEW_LINE>Model.Builder builder = model.toBuilder();<NEW_LINE>builder.removeMetadataProperty("suppressions");<NEW_LINE>if (!updatedMetadataSuppressions.isEmpty()) {<NEW_LINE>builder.putMetadataProperty("suppressions", updatedMetadataSuppressionsNode);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | suppression = Suppression.fromMetadata(object); |
1,199,812 | static ElementDocProvider create(@NotNull PsiElement psiElement) {<NEW_LINE>Project project = psiElement.getProject();<NEW_LINE>if (psiElement instanceof ErlangModule) {<NEW_LINE>VirtualFile virtualFile = getVirtualFile(psiElement);<NEW_LINE>if (virtualFile == null)<NEW_LINE>return null;<NEW_LINE>ErlangModule erlangModule = (ErlangModule) psiElement;<NEW_LINE>if (isFileFromErlangSdk(project, virtualFile)) {<NEW_LINE>return new ErlangSdkModuleDocProvider(project, virtualFile);<NEW_LINE>}<NEW_LINE>return new ErlangModuleDocProvider(erlangModule);<NEW_LINE>} else if (psiElement instanceof ErlangFunction) {<NEW_LINE>VirtualFile virtualFile = getVirtualFile(psiElement);<NEW_LINE>if (virtualFile == null)<NEW_LINE>return null;<NEW_LINE>ErlangFunction erlangFunction = (ErlangFunction) psiElement;<NEW_LINE>if (isFileFromErlangSdk(project, virtualFile)) {<NEW_LINE>return new ErlangSdkFunctionDocProvider(project, erlangFunction.getName(), erlangFunction.getArity(), virtualFile);<NEW_LINE>}<NEW_LINE>return new ErlangFunctionDocProvider(erlangFunction);<NEW_LINE>} else if (psiElement instanceof ErlangTypeDefinition) {<NEW_LINE>VirtualFile virtualFile = getVirtualFile(psiElement);<NEW_LINE>if (virtualFile == null)<NEW_LINE>return null;<NEW_LINE>ErlangTypeDefinition typeDefinition = (ErlangTypeDefinition) psiElement;<NEW_LINE>if (isFileFromErlangSdk(project, virtualFile)) {<NEW_LINE>return new ErlangSdkTypeDocProvider(project, virtualFile, typeDefinition.getName());<NEW_LINE>}<NEW_LINE>// TODO implement TypeDocProvider<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>ErlangGlobalFunctionCallExpression erlGlobalFunctionCall = PsiTreeUtil.getParentOfType(psiElement, ErlangGlobalFunctionCallExpression.class);<NEW_LINE>if (erlGlobalFunctionCall != null) {<NEW_LINE>ErlangModuleRef moduleRef = erlGlobalFunctionCall.getModuleRef();<NEW_LINE>String moduleName = moduleRef.getText();<NEW_LINE>ErlangFunctionCallExpression erlFunctionCall = erlGlobalFunctionCall.getFunctionCallExpression();<NEW_LINE>String functionName = erlFunctionCall.getName();<NEW_LINE>int arity = erlFunctionCall.getArgumentList().getExpressionList().size();<NEW_LINE>if (ErlangBifTable.isBif(moduleName, functionName, arity)) {<NEW_LINE>PsiElement tentativeErlangModule = moduleRef.getReference().resolve();<NEW_LINE>if (tentativeErlangModule instanceof ErlangModule) {<NEW_LINE>VirtualFile virtualFile = getVirtualFile(tentativeErlangModule);<NEW_LINE>if (virtualFile != null) {<NEW_LINE>return new ErlangSdkFunctionDocProvider(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | project, functionName, arity, virtualFile); |
957,390 | void outOfScope() {<NEW_LINE>final String methodName = "outOfScope";<NEW_LINE>if (TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.entry(this, TRACE, methodName);<NEW_LINE>}<NEW_LINE>_outOfScope = true;<NEW_LINE>try {<NEW_LINE>// Close cloned connection so that it, and any resource created<NEW_LINE>// from it, also throw SIObjectClosedException<NEW_LINE>_connectionClone.close();<NEW_LINE>} catch (final SIException exception) {<NEW_LINE>FFDCFilter.processException(<MASK><NEW_LINE>if (TRACE.isEventEnabled()) {<NEW_LINE>SibTr.exception(this, TRACE, exception);<NEW_LINE>}<NEW_LINE>// Swallow exception<NEW_LINE>} catch (final SIErrorException exception) {<NEW_LINE>FFDCFilter.processException(exception, "com.ibm.ws.sib.ra.inbound.impl.SibRaAbstractConsumerSession.outOfScope", FFDC_PROBE_2, this);<NEW_LINE>if (TRACE.isEventEnabled()) {<NEW_LINE>SibTr.exception(this, TRACE, exception);<NEW_LINE>}<NEW_LINE>// Swallow exception<NEW_LINE>}<NEW_LINE>if (TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.exit(this, TRACE, methodName);<NEW_LINE>}<NEW_LINE>} | exception, "com.ibm.ws.sib.ra.inbound.impl.SibRaAbstractConsumerSession.outOfScope", FFDC_PROBE_1, this); |
219,851 | void redirect(String to) {<NEW_LINE>Supplier<String>[] redirectedFrom = this.redirectedFrom;<NEW_LINE>UriEndpoint toURITemp;<NEW_LINE>UriEndpoint from = toURI;<NEW_LINE><MASK><NEW_LINE>if (address instanceof InetSocketAddress) {<NEW_LINE>try {<NEW_LINE>URI redirectUri = new URI(to);<NEW_LINE>if (!redirectUri.isAbsolute()) {<NEW_LINE>URI requestUri = new URI(resourceUrl);<NEW_LINE>redirectUri = requestUri.resolve(redirectUri);<NEW_LINE>}<NEW_LINE>toURITemp = uriEndpointFactory.createUriEndpoint(redirectUri, from.isWs());<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IllegalArgumentException("Cannot resolve location header", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>toURITemp = uriEndpointFactory.createUriEndpoint(from, to, () -> address);<NEW_LINE>}<NEW_LINE>fromURI = from;<NEW_LINE>toURI = toURITemp;<NEW_LINE>resourceUrl = toURITemp.toExternalForm();<NEW_LINE>this.redirectedFrom = addToRedirectedFromArray(redirectedFrom, from);<NEW_LINE>} | SocketAddress address = from.getRemoteAddress(); |
1,460,381 | public Long migrate(final HaWorkVO work) {<NEW_LINE>long vmId = work.getInstanceId();<NEW_LINE>long srcHostId = work.getHostId();<NEW_LINE>VMInstanceVO vm = _instanceDao.findById(vmId);<NEW_LINE>if (vm == null) {<NEW_LINE>s_logger.info("Unable to find vm: " + vmId + ", skipping migrate.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>s_logger.info("Migration attempt: for VM " + vm.getUuid() + "from host id " + srcHostId + ". Starting attempt: " + (1 + work.getTimesTried()) + "/" + _maxRetries + " times.");<NEW_LINE>try {<NEW_LINE>work.setStep(Step.Migrating);<NEW_LINE>_haDao.update(work.getId(), work);<NEW_LINE>// First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency.<NEW_LINE>_itMgr.migrateAway(vm.getUuid(), srcHostId);<NEW_LINE>return null;<NEW_LINE>} catch (InsufficientServerCapacityException e) {<NEW_LINE>s_logger.warn("Migration attempt: Insufficient capacity for migrating a VM " + vm.getUuid() + " from source host id " + srcHostId + <MASK><NEW_LINE>_resourceMgr.migrateAwayFailed(srcHostId, vmId);<NEW_LINE>return (System.currentTimeMillis() >> 10) + _migrateRetryInterval;<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.warn("Migration attempt: Unexpected exception occurred when attempting migration of " + vm.getUuid() + e.getMessage());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | ". Exception: " + e.getMessage()); |
1,110,854 | // [END string_task_method]<NEW_LINE>public void taskChaining() {<NEW_LINE>// [START task_chaining]<NEW_LINE>Task<AuthResult> signInTask = FirebaseAuth.getInstance().signInAnonymously();<NEW_LINE>signInTask.continueWithTask(new Continuation<AuthResult, Task<String>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Task<String> then(@NonNull Task<AuthResult> task) throws Exception {<NEW_LINE>// Take the result from the first task and start the second one<NEW_LINE><MASK><NEW_LINE>return doSomething(result);<NEW_LINE>}<NEW_LINE>}).addOnSuccessListener(new OnSuccessListener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(String s) {<NEW_LINE>// Chain of tasks completed successfully, got result from last task.<NEW_LINE>// ...<NEW_LINE>}<NEW_LINE>}).addOnFailureListener(new OnFailureListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(@NonNull Exception e) {<NEW_LINE>// One of the tasks in the chain failed with an exception.<NEW_LINE>// ...<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// [END task_chaining]<NEW_LINE>} | AuthResult result = task.getResult(); |
366,206 | public void contribute(BuildContext context, AotOptions aotOptions) {<NEW_LINE>TypeSystem typeSystem = new TypeSystem(context.getClasspath(), context.getMainClass());<NEW_LINE>typeSystem.setAotOptions(aotOptions);<NEW_LINE>SpringAnalyzer springAnalyzer = new SpringAnalyzer(typeSystem, aotOptions);<NEW_LINE>springAnalyzer.analyze();<NEW_LINE>ConfigurationCollector configurationCollector = springAnalyzer.getConfigurationCollector();<NEW_LINE>processBuildTimeClassProxyRequests(context, configurationCollector);<NEW_LINE>context.describeReflection(reflect -> reflect.merge(configurationCollector.getReflectionDescriptor()));<NEW_LINE>context.describeResources(resources -> resources.merge(configurationCollector.getResourcesDescriptors()));<NEW_LINE>context.describeProxies(proxies -> proxies.merge(configurationCollector.getProxyDescriptors()));<NEW_LINE>context.describeSerialization(serial -> serial.merge(configurationCollector.getSerializationDescriptor()));<NEW_LINE>context.describeJNIReflection(jniReflect -> jniReflect.merge(configurationCollector.getJNIReflectionDescriptor()));<NEW_LINE>context.describeInitialization(init -> init.merge(configurationCollector.getInitializationDescriptor()));<NEW_LINE>context.getOptions().forEach(configurationCollector::addOption);<NEW_LINE>String mainClass = getMainClass(context);<NEW_LINE>if (mainClass != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>byte[] springComponentsFileContents = configurationCollector.getResources("META-INF/spring.components");<NEW_LINE>if (springComponentsFileContents != null) {<NEW_LINE>logger.debug("Storing synthesized META-INF/spring.components");<NEW_LINE>context.addResources((resourcesPath) -> {<NEW_LINE>Path metaInfFolder = resourcesPath.resolve(Paths.get("META-INF"));<NEW_LINE>Files.createDirectories(metaInfFolder);<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(resourcesPath.resolve(ResourceFile.SPRING_COMPONENTS_PATH).toFile())) {<NEW_LINE>fos.write(springComponentsFileContents);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// Create native-image.properties<NEW_LINE>context.addResources(new ResourceFile() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void writeTo(Path rootPath) throws IOException {<NEW_LINE>Path nativeConfigFolder = rootPath.resolve(ResourceFile.NATIVE_CONFIG_PATH);<NEW_LINE>Files.createDirectories(nativeConfigFolder);<NEW_LINE>Path nativeImagePropertiesFile = nativeConfigFolder.resolve("native-image.properties");<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(nativeImagePropertiesFile.toFile())) {<NEW_LINE>fos.write(configurationCollector.getNativeImagePropertiesContent().getBytes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | configurationCollector.addOption("-H:Class=" + mainClass); |
879,201 | public final InheritanceGraph build() {<NEW_LINE>validateUniqueClasses(nodes);<NEW_LINE>Map<InheritanceGraph.Key, InheritanceGraphNode> <MASK><NEW_LINE>// First, compute the inheritance graph<NEW_LINE>for (ClassNode classNode : nodes) {<NEW_LINE>InheritanceGraphNode thisNode = inheritanceGraph.computeIfAbsent(InheritanceGraph.getKey(classNode), InheritanceGraphNode::new);<NEW_LINE>{<NEW_LINE>if (classNode.superName != null) {<NEW_LINE>// In case we reached java/lang/Object<NEW_LINE>InheritanceGraphNode superClass = inheritanceGraph.computeIfAbsent(InheritanceGraph.getKey(classNode.superName), InheritanceGraphNode::new);<NEW_LINE>thisNode.addParent(superClass);<NEW_LINE>superClass.addChild(thisNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>{<NEW_LINE>if (classNode.interfaces != null) {<NEW_LINE>for (String intf : classNode.interfaces) {<NEW_LINE>InheritanceGraphNode intfClass = inheritanceGraph.computeIfAbsent(InheritanceGraph.getKey(intf), InheritanceGraphNode::new);<NEW_LINE>thisNode.addParent(intfClass);<NEW_LINE>intfClass.addChild(thisNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Now, aggregate results to form an "all children" and "all parents" view<NEW_LINE>inheritanceGraph.values().forEach(InheritanceGraphNode::computeIndirectRelationships);<NEW_LINE>// Freeze it!<NEW_LINE>inheritanceGraph.values().forEach(InheritanceGraphNode::freeze);<NEW_LINE>return new InheritanceGraph(inheritanceGraph);<NEW_LINE>} | inheritanceGraph = new HashMap<>(); |
1,689,482 | private void processDirectory(TransferListener listener, String dMsg, String tMsg, LocalDestFile f) throws IOException {<NEW_LINE>// D<perms> 0 <dirname><NEW_LINE>final List<String> dMsgParts = tokenize(dMsg, 3, true);<NEW_LINE>final long length = parseLong(dMsgParts<MASK><NEW_LINE>final String dirname = dMsgParts.get(2);<NEW_LINE>if (length != 0) {<NEW_LINE>throw new IOException("Remote SCP command sent strange directory length: " + length);<NEW_LINE>}<NEW_LINE>final TransferListener dirListener = listener.directory(dirname);<NEW_LINE>{<NEW_LINE>f = f.getTargetDirectory(dirname);<NEW_LINE>engine.signal("ACK: D");<NEW_LINE>do {<NEW_LINE>} while (!process(dirListener, null, engine.readMessage(), f));<NEW_LINE>setAttributes(f, parsePermissions(dMsgParts.get(0)), tMsg);<NEW_LINE>engine.signal("ACK: E");<NEW_LINE>}<NEW_LINE>} | .get(1), "dir length"); |
1,700,168 | protected void configure() {<NEW_LINE>install(new MessagingBinders.MessageBodyProviders(clientRuntimeProperties, RuntimeType.CLIENT), new MessagingBinders.HeaderDelegateProviders());<NEW_LINE>bindFactory(ReferencingFactory.referenceFactory()).to(new GenericType<Ref<ClientConfig>>() {<NEW_LINE>}).in(RequestScoped.class);<NEW_LINE>bindFactory(RequestContextInjectionFactory.class).to(ClientRequest.class).in(RequestScoped.class);<NEW_LINE>bindFactory(RequestContextInjectionFactory.class).to(HttpHeaders.class).proxy(true).proxyForSameScope(false<MASK><NEW_LINE>bindFactory(ReferencingFactory.referenceFactory()).to(new GenericType<Ref<ClientRequest>>() {<NEW_LINE>}).in(RequestScoped.class);<NEW_LINE>bindFactory(PropertiesDelegateFactory.class, Singleton.class).to(PropertiesDelegate.class).in(RequestScoped.class);<NEW_LINE>// ChunkedInput entity support<NEW_LINE>bind(ChunkedInputReader.class).to(MessageBodyReader.class).in(Singleton.class);<NEW_LINE>} | ).in(RequestScoped.class); |
237,688 | private final Command mergeSetCommands(final Command currentCmd, final Queue writeQueue, final Queue<Command> executingCmds, final CommandType expectedCommandType, final int sendBufferSize) {<NEW_LINE>int mergeCount = 1;<NEW_LINE>final CommandCollector commandCollector = BIN_SET_CMD_COLLECTOR_THREAD_LOCAL.get().reset();<NEW_LINE>currentCmd.setStatus(OperationStatus.WRITING);<NEW_LINE>int totalBytes = currentCmd.getIoBuffer().remaining();<NEW_LINE>commandCollector.visit(currentCmd);<NEW_LINE>while (mergeCount < this.mergeFactor && totalBytes + MARGIN < sendBufferSize) {<NEW_LINE>Command nextCmd = (Command) writeQueue.peek();<NEW_LINE>if (nextCmd == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (nextCmd.isCancel()) {<NEW_LINE>writeQueue.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (nextCmd.getCommandType() == expectedCommandType && !nextCmd.isNoreply()) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(<MASK><NEW_LINE>}<NEW_LINE>nextCmd.setStatus(OperationStatus.WRITING);<NEW_LINE>writeQueue.remove();<NEW_LINE>commandCollector.visit(nextCmd);<NEW_LINE>mergeCount++;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>totalBytes += nextCmd.getIoBuffer().remaining();<NEW_LINE>}<NEW_LINE>if (mergeCount == 1) {<NEW_LINE>return currentCmd;<NEW_LINE>} else {<NEW_LINE>commandCollector.finish();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Merge optimieze:merge " + mergeCount + " get commands");<NEW_LINE>}<NEW_LINE>return (Command) commandCollector.getResult();<NEW_LINE>}<NEW_LINE>} | "Merge set command:" + nextCmd.toString()); |
1,310,065 | public void publishTemplate(String designId, NewApiTemplate newApiTemplate) throws ServerError, NotFoundException, AccessDeniedException {<NEW_LINE><MASK><NEW_LINE>metrics.apiCall("/designs/{designId}/templates", "POST");<NEW_LINE>final User user = this.security.getCurrentUser();<NEW_LINE>final String userLogin = user.getLogin();<NEW_LINE>try {<NEW_LINE>if (!this.authorizationService.hasTemplateCreationPermission(user)) {<NEW_LINE>throw new AccessDeniedException();<NEW_LINE>}<NEW_LINE>if (!this.authorizationService.hasWritePermission(user, designId)) {<NEW_LINE>throw new NotFoundException();<NEW_LINE>}<NEW_LINE>// Apply the pending commands to get an up-to-date version number<NEW_LINE>final ApiDesign apiDesign = this.storage.getApiDesign(userLogin, designId);<NEW_LINE>final ApiDesignContent latestDocument = this.storage.getLatestContentDocument(userLogin, designId);<NEW_LINE>long version = latestDocument.getContentVersion();<NEW_LINE>final FormatType formatType = apiDesign.getType() == ApiDesignType.GraphQL ? FormatType.SDL : FormatType.JSON;<NEW_LINE>String documentAsString = getApiContent(designId, formatType, false);<NEW_LINE>// Create the template<NEW_LINE>final StoredApiTemplate storedApiTemplate = newApiTemplate.toStoredApiTemplate();<NEW_LINE>final String templateId = UUID.randomUUID().toString();<NEW_LINE>storedApiTemplate.setTemplateId(templateId);<NEW_LINE>storedApiTemplate.setType(apiDesign.getType());<NEW_LINE>storedApiTemplate.setOwner(userLogin);<NEW_LINE>storedApiTemplate.setDocument(documentAsString);<NEW_LINE>this.storage.createApiTemplate(storedApiTemplate);<NEW_LINE>// Store the publication metadata<NEW_LINE>final String templateData = createTemplateData(designId, newApiTemplate, version);<NEW_LINE>this.storage.addContent(userLogin, designId, ApiContentType.Template, templateData);<NEW_LINE>} catch (StorageException e) {<NEW_LINE>throw new ServerError(e);<NEW_LINE>}<NEW_LINE>} | logger.debug("Publishing a template from API: {}", designId); |
799,324 | public void testServletSubmitsManagedTaskThatLooksUpBMTBean(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>Future<?> future = executor.submit(new Callable<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call() throws Exception {<NEW_LINE>Runnable ejbRunnable = (Runnable) new InitialContext().lookup("java:global/concurrent/ConcurrentBMTBean!java.lang.Runnable");<NEW_LINE>ejbRunnable.run();<NEW_LINE>ConcurrentBMT ejb = (ConcurrentBMT) new InitialContext().lookup("java:global/concurrent/ConcurrentBMTBean!ejb.ConcurrentBMT");<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>Object txKeyBefore = tranSyncRegistry.getTransactionKey();<NEW_LINE><MASK><NEW_LINE>if (ejbTxKey != null)<NEW_LINE>throw new Exception("Transaction " + ejbTxKey + " found when invoking BMT bean method. Transaction on invoking thread was " + txKeyBefore);<NEW_LINE>ejbRunnable.run();<NEW_LINE>Object txKeyAfter = tranSyncRegistry.getTransactionKey();<NEW_LINE>if (!txKeyBefore.equals(txKeyAfter))<NEW_LINE>throw new Exception("Original transaction " + txKeyBefore + " not resumed on thread. Instead " + txKeyAfter);<NEW_LINE>} finally {<NEW_LINE>tran.commit();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>future.get();<NEW_LINE>} finally {<NEW_LINE>future.cancel(true);<NEW_LINE>}<NEW_LINE>} | Object ejbTxKey = ejb.getTransactionKey(); |
1,277,879 | public <T> TaskResult<T> executeWithLock(@NonNull TaskWithResult<T> task, @NonNull LockConfiguration lockConfig) throws Throwable {<NEW_LINE>Optional<SimpleLock> lock = lockProvider.lock(lockConfig);<NEW_LINE>String lockName = lockConfig.getName();<NEW_LINE>if (alreadyLockedBy(lockName)) {<NEW_LINE>logger.debug("Already locked '{}'", lockName);<NEW_LINE>return TaskResult.result(task.call());<NEW_LINE>} else if (lock.isPresent()) {<NEW_LINE>try {<NEW_LINE>LockAssert.startLock(lockName);<NEW_LINE>LockExtender.<MASK><NEW_LINE>logger.debug("Locked '{}', lock will be held at most until {}", lockName, lockConfig.getLockAtMostUntil());<NEW_LINE>return TaskResult.result(task.call());<NEW_LINE>} finally {<NEW_LINE>LockAssert.endLock();<NEW_LINE>SimpleLock activeLock = LockExtender.endLock();<NEW_LINE>if (activeLock != null) {<NEW_LINE>activeLock.unlock();<NEW_LINE>} else {<NEW_LINE>// This should never happen, but I do not know any better way to handle the null case.<NEW_LINE>logger.warn("No active lock, please report this as a bug.");<NEW_LINE>lock.get().unlock();<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>Instant lockAtLeastUntil = lockConfig.getLockAtLeastUntil();<NEW_LINE>Instant now = ClockProvider.now();<NEW_LINE>if (lockAtLeastUntil.isAfter(now)) {<NEW_LINE>logger.debug("Task finished, lock '{}' will be released at {}", lockName, lockAtLeastUntil);<NEW_LINE>} else {<NEW_LINE>logger.debug("Task finished, lock '{}' released", lockName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug("Not executing '{}'. It's locked.", lockName);<NEW_LINE>return TaskResult.notExecuted();<NEW_LINE>}<NEW_LINE>} | startLock(lock.get()); |
796,402 | public void marshall(WorkflowRun workflowRun, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (workflowRun == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(workflowRun.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getWorkflowRunId(), WORKFLOWRUNID_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getPreviousRunId(), PREVIOUSRUNID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(workflowRun.getStartedOn(), STARTEDON_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getCompletedOn(), COMPLETEDON_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getErrorMessage(), ERRORMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getStatistics(), STATISTICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getGraph(), GRAPH_BINDING);<NEW_LINE>protocolMarshaller.marshall(workflowRun.getStartingEventBatchCondition(), STARTINGEVENTBATCHCONDITION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | workflowRun.getWorkflowRunProperties(), WORKFLOWRUNPROPERTIES_BINDING); |
295,653 | public void run() {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (database == null) {<NEW_LINE>callback.onError("Database Error");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String sql = "INSERT OR REPLACE INTO " + mSQLiteHelper.getTableName() + " VALUES (?, ?);";<NEW_LINE>SQLiteStatement statement = database.compileStatement(sql);<NEW_LINE>try {<NEW_LINE>database.beginTransaction();<NEW_LINE>for (HippyStorageKeyValue keyValue : keyValues) {<NEW_LINE>statement.clearBindings();<NEW_LINE>statement.bindString(1, keyValue.key);<NEW_LINE>statement.bindString(2, keyValue.value);<NEW_LINE>statement.execute();<NEW_LINE>}<NEW_LINE>database.setTransactionSuccessful();<NEW_LINE>callback.onSuccess(null);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>callback.onError(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>database.endTransaction();<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>callback.onError(e.getMessage());<NEW_LINE>}<NEW_LINE>} | SQLiteDatabase database = mSQLiteHelper.getDatabase(); |
1,299,131 | static RemoteMessage remoteMessageFromReadableMap(ReadableMap readableMap) {<NEW_LINE>RemoteMessage.Builder builder = new RemoteMessage.Builder(readableMap.getString(KEY_TO));<NEW_LINE>if (readableMap.hasKey(KEY_TTL)) {<NEW_LINE>builder.setTtl(readableMap.getInt(KEY_TTL));<NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_MESSAGE_ID)) {<NEW_LINE>builder.setMessageId(readableMap.getString(KEY_MESSAGE_ID));<NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_MESSAGE_TYPE)) {<NEW_LINE>builder.setMessageType<MASK><NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_COLLAPSE_KEY)) {<NEW_LINE>builder.setCollapseKey(readableMap.getString(KEY_COLLAPSE_KEY));<NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_DATA)) {<NEW_LINE>ReadableMap messageData = readableMap.getMap(KEY_DATA);<NEW_LINE>ReadableMapKeySetIterator iterator = messageData.keySetIterator();<NEW_LINE>while (iterator.hasNextKey()) {<NEW_LINE>String key = iterator.nextKey();<NEW_LINE>builder.addData(key, messageData.getString(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | (readableMap.getString(KEY_MESSAGE_TYPE)); |
205,713 | public RecordTypeDescriptorNode transform(RecordTypeDescriptorNode recordTypeDesc) {<NEW_LINE>final int recordKeywordTrailingWS = 1;<NEW_LINE>Token recordKeyword = formatNode(recordTypeDesc.recordKeyword(), recordKeywordTrailingWS, 0);<NEW_LINE>int fieldTrailingWS = 0;<NEW_LINE>int fieldTrailingNL = 0;<NEW_LINE>if (shouldExpand(recordTypeDesc)) {<NEW_LINE>fieldTrailingNL++;<NEW_LINE>} else {<NEW_LINE>fieldTrailingWS++;<NEW_LINE>}<NEW_LINE>Token bodyStartDelimiter = formatToken(recordTypeDesc.bodyStartDelimiter(), 0, fieldTrailingNL);<NEW_LINE>// Set indentation for record fields<NEW_LINE>indent();<NEW_LINE>NodeList<Node> fields = formatNodeList(recordTypeDesc.fields(), fieldTrailingWS, fieldTrailingNL, 0, fieldTrailingNL);<NEW_LINE>RecordRestDescriptorNode recordRestDescriptor = formatNode(recordTypeDesc.recordRestDescriptor().orElse(null), fieldTrailingWS, fieldTrailingNL);<NEW_LINE>// Revert indentation for record fields<NEW_LINE>unindent();<NEW_LINE>Token bodyEndDelimiter = formatToken(recordTypeDesc.bodyEndDelimiter(), env.trailingWS, env.trailingNL);<NEW_LINE>return recordTypeDesc.modify().withRecordKeyword(recordKeyword).withBodyStartDelimiter(bodyStartDelimiter).withFields(fields).withRecordRestDescriptor(recordRestDescriptor).<MASK><NEW_LINE>} | withBodyEndDelimiter(bodyEndDelimiter).apply(); |
1,618,316 | private ImmutableList<AnnotationMirror> propertyFieldAnnotations(TypeElement type, ExecutableElement method) {<NEW_LINE>if (!hasAnnotationMirror(method, COPY_ANNOTATIONS_NAME)) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>ImmutableSet<String> excludedAnnotations = ImmutableSet.<String>builder().addAll(getExcludedAnnotationClassNames(method)).add(Override.class.getCanonicalName()).build();<NEW_LINE>// We need to exclude type annotations from the ones being output on the method, since<NEW_LINE>// they will be output as part of the field's type.<NEW_LINE>Set<String> returnTypeAnnotations = <MASK><NEW_LINE>Set<String> nonFieldAnnotations = method.getAnnotationMirrors().stream().map(a -> a.getAnnotationType().asElement()).map(MoreElements::asType).filter(a -> !annotationAppliesToFields(a)).map(e -> e.getQualifiedName().toString()).collect(toSet());<NEW_LINE>Set<String> excluded = ImmutableSet.<String>builder().addAll(excludedAnnotations).addAll(returnTypeAnnotations).addAll(nonFieldAnnotations).build();<NEW_LINE>return annotationsToCopy(type, method, excluded);<NEW_LINE>} | getReturnTypeAnnotations(method, this::annotationAppliesToFields); |
1,596,318 | public boolean validate() throws ContractValidateException {<NEW_LINE>if (this.any == null) {<NEW_LINE>throw new ContractValidateException(ActuatorConstant.CONTRACT_NOT_EXIST);<NEW_LINE>}<NEW_LINE>if (chainBaseManager == null) {<NEW_LINE>throw new ContractValidateException(ActuatorConstant.STORE_NOT_EXIST);<NEW_LINE>}<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();<NEW_LINE>MortgageService mortgageService = chainBaseManager.getMortgageService();<NEW_LINE>if (!this.any.is(WithdrawBalanceContract.class)) {<NEW_LINE>throw new ContractValidateException("contract type error, expected type [WithdrawBalanceContract], real type[" + any.getClass() + "]");<NEW_LINE>}<NEW_LINE>final WithdrawBalanceContract withdrawBalanceContract;<NEW_LINE>try {<NEW_LINE>withdrawBalanceContract = this.any.unpack(WithdrawBalanceContract.class);<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>throw new ContractValidateException(e.getMessage());<NEW_LINE>}<NEW_LINE>byte[] ownerAddress = withdrawBalanceContract.getOwnerAddress().toByteArray();<NEW_LINE>if (!DecodeUtil.addressValid(ownerAddress)) {<NEW_LINE>throw new ContractValidateException("Invalid address");<NEW_LINE>}<NEW_LINE>AccountCapsule accountCapsule = accountStore.get(ownerAddress);<NEW_LINE>if (accountCapsule == null) {<NEW_LINE>String readableOwnerAddress = StringUtil.createReadableString(ownerAddress);<NEW_LINE>throw new ContractValidateException(ACCOUNT_EXCEPTION_STR + readableOwnerAddress + NOT_EXIST_STR);<NEW_LINE>}<NEW_LINE>String readableOwnerAddress = StringUtil.createReadableString(ownerAddress);<NEW_LINE>boolean isGP = CommonParameter.getInstance().getGenesisBlock().getWitnesses().stream().anyMatch(witness -> Arrays.equals(ownerAddress, witness.getAddress()));<NEW_LINE>if (isGP) {<NEW_LINE>throw new ContractValidateException(ACCOUNT_EXCEPTION_STR + readableOwnerAddress + "] is a guard representative and is not allowed to withdraw Balance");<NEW_LINE>}<NEW_LINE>long latestWithdrawTime = accountCapsule.getLatestWithdrawTime();<NEW_LINE>long now = dynamicStore.getLatestBlockHeaderTimestamp();<NEW_LINE>long witnessAllowanceFrozenTime = dynamicStore.getWitnessAllowanceFrozenTime() * FROZEN_PERIOD;<NEW_LINE>if (now - latestWithdrawTime < witnessAllowanceFrozenTime) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (accountCapsule.getAllowance() <= 0 && mortgageService.queryReward(ownerAddress) <= 0) {<NEW_LINE>throw new ContractValidateException("witnessAccount does not have any reward");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LongMath.checkedAdd(accountCapsule.getBalance(), accountCapsule.getAllowance());<NEW_LINE>} catch (ArithmeticException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>throw new ContractValidateException(e.getMessage());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ContractValidateException("The last withdraw time is " + latestWithdrawTime + ", less than 24 hours"); |
1,502,062 | public Long apply(Long captureTime) {<NEW_LINE>Calendar calendar;<NEW_LINE>switch(rollup) {<NEW_LINE>case HOURLY:<NEW_LINE>return CaptureTimes.getRollup(captureTime, HOURS.toMillis(1), timeZone);<NEW_LINE>case DAILY:<NEW_LINE>return <MASK><NEW_LINE>case WEEKLY:<NEW_LINE>calendar = getDailyRollupCaptureTime(captureTime);<NEW_LINE>int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);<NEW_LINE>int diff = baseDayOfWeek - dayOfWeek;<NEW_LINE>if (diff < 0) {<NEW_LINE>diff += 7;<NEW_LINE>}<NEW_LINE>calendar.add(Calendar.DATE, diff);<NEW_LINE>return calendar.getTimeInMillis();<NEW_LINE>case MONTHLY:<NEW_LINE>calendar = Calendar.getInstance(timeZone);<NEW_LINE>calendar.setTimeInMillis(captureTime);<NEW_LINE>calendar.set(Calendar.DAY_OF_MONTH, 1);<NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>calendar.set(Calendar.MINUTE, 0);<NEW_LINE>calendar.set(Calendar.SECOND, 0);<NEW_LINE>calendar.set(Calendar.MILLISECOND, 0);<NEW_LINE>if (calendar.getTimeInMillis() == captureTime) {<NEW_LINE>return captureTime;<NEW_LINE>} else {<NEW_LINE>calendar.add(Calendar.MONTH, 1);<NEW_LINE>return calendar.getTimeInMillis();<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected rollup: " + rollup);<NEW_LINE>}<NEW_LINE>} | getDailyRollupCaptureTime(captureTime).getTimeInMillis(); |
1,489,538 | public RelRoot toRel(final SqlNode validatedNode) {<NEW_LINE>initCluster(initPlanner());<NEW_LINE>DrillViewExpander viewExpander = new DrillViewExpander(this);<NEW_LINE>final SqlToRelConverter sqlToRelConverter = new SqlToRelConverter(viewExpander, validator, catalog, cluster, DrillConvertletTable.INSTANCE, sqlToRelConverterConfig);<NEW_LINE>boolean topLevelQuery = !isInnerQuery || isExpandedView;<NEW_LINE>RelRoot rel = sqlToRelConverter.convertQuery(validatedNode, false, topLevelQuery);<NEW_LINE>// If extra expressions used in ORDER BY were added to the project list,<NEW_LINE>// add another project to remove them.<NEW_LINE>if (topLevelQuery && rel.rel.getRowType().getFieldCount() - rel.fields.size() > 0) {<NEW_LINE>RexBuilder builder = rel.rel.getCluster().getRexBuilder();<NEW_LINE>RelNode relNode = rel.rel;<NEW_LINE>List<RexNode> expressions = rel.fields.stream().map(f -> builder.makeInputRef(relNode, f.left)).collect(Collectors.toList());<NEW_LINE>RelNode project = LogicalProject.create(rel.rel, expressions, rel.validatedRowType);<NEW_LINE>rel = RelRoot.of(project, rel.validatedRowType, rel.kind);<NEW_LINE>}<NEW_LINE>return rel.withRel(sqlToRelConverter.flattenTypes<MASK><NEW_LINE>} | (rel.rel, true)); |
1,736,404 | public boolean eventOccurred(UISWTViewEvent event) {<NEW_LINE>switch(event.getType()) {<NEW_LINE>case UISWTViewEvent.TYPE_CREATE:<NEW_LINE>swtView = event.getView();<NEW_LINE>swtView.setTitle(getFullTitle());<NEW_LINE>swtView.setToolBarListener(this);<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_DESTROY:<NEW_LINE>delete();<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_INITIALIZE:<NEW_LINE>initialize((Composite) event.getData());<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_LANGUAGEUPDATE:<NEW_LINE>Messages.updateLanguageForControl(getComposite());<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_DATASOURCE_CHANGED:<NEW_LINE>dataSourceChanged(event.getData());<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_FOCUSGAINED:<NEW_LINE>String id = "DMDetails_General";<NEW_LINE>if (manager != null) {<NEW_LINE>if (manager.getTorrent() != null) {<NEW_LINE>id += "." + manager.getInternalName();<NEW_LINE>} else {<NEW_LINE>id += ":" + manager.getSize();<NEW_LINE>}<NEW_LINE>SelectedContentManager.changeCurrentlySelectedContent(id, new SelectedContent[] { new SelectedContent(manager) });<NEW_LINE>} else {<NEW_LINE>SelectedContentManager.changeCurrentlySelectedContent(id, null);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_FOCUSLOST:<NEW_LINE>SelectedContentManager.clearCurrentlySelectedContent();<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_REFRESH:<NEW_LINE>refresh(false);<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_OBFUSCATE:<NEW_LINE>Object data = event.getData();<NEW_LINE>if (data instanceof Map) {<NEW_LINE>obfuscatedImage((Image) MapUtils.getMapObject((Map) data, "image", null, Image.class));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | swtView.setTitle(getFullTitle()); |
635,498 | private void init(Map<UUID, SecretKey> keys) {<NEW_LINE>CencDecryptingSampleEntryTransformer tx = new CencDecryptingSampleEntryTransformer();<NEW_LINE>List<Sample> encSamples = original.getSamples();<NEW_LINE>RangeStartMap<Integer, SecretKey> indexToKey = new RangeStartMap<>();<NEW_LINE>RangeStartMap<Integer, SampleEntry> indexToSampleEntry = new RangeStartMap<>();<NEW_LINE>SampleEntry previousSampleEntry = null;<NEW_LINE>for (int i = 0; i < encSamples.size(); i++) {<NEW_LINE>Sample encSample = encSamples.get(i);<NEW_LINE>SampleEntry current = encSample.getSampleEntry();<NEW_LINE>sampleEntries.add(tx.transform(encSample.getSampleEntry()));<NEW_LINE>if (previousSampleEntry != current) {<NEW_LINE>indexToSampleEntry.put(i, current);<NEW_LINE>TrackEncryptionBox tenc = Path.getPath((Container) encSample.getSampleEntry(), "sinf[0]/schi[0]/tenc[0]");<NEW_LINE>if (tenc != null) {<NEW_LINE>indexToKey.put(i, keys.get(tenc.getDefault_KID()));<NEW_LINE>} else {<NEW_LINE>indexToKey.put(i, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>previousSampleEntry = current;<NEW_LINE>}<NEW_LINE>samples = new CencDecryptingSampleList(indexToKey, indexToSampleEntry, <MASK><NEW_LINE>} | encSamples, original.getSampleEncryptionEntries()); |
586,470 | private void writeRels(SubGraph graph, CSVWriter out, Reporter reporter, List<String> relHeader, int cols, int offset, int batchSize, String delimiter) {<NEW_LINE>String[] row = new String[cols];<NEW_LINE>int rels = 0;<NEW_LINE>for (Relationship rel : graph.getRelationships()) {<NEW_LINE>row[offset] = String.valueOf(rel.getStartNode().getId());<NEW_LINE>row[offset + 1] = String.valueOf(rel.getEndNode().getId());<NEW_LINE>row[offset + 2] = rel.getType().name();<NEW_LINE>collectProps(relHeader, rel, reporter, row, 3 + offset, delimiter);<NEW_LINE><MASK><NEW_LINE>rels++;<NEW_LINE>if (batchSize == -1 || rels % batchSize == 0) {<NEW_LINE>reporter.update(0, rels, 0);<NEW_LINE>rels = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rels > 0) {<NEW_LINE>reporter.update(0, rels, 0);<NEW_LINE>}<NEW_LINE>} | out.writeNext(row, applyQuotesToAll); |
1,289,346 | protected void addActionsTimed() {<NEW_LINE>FutureTask<Integer> task = new FutureTask<>(new Callable<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer call() throws Exception {<NEW_LINE>return addActions(root, Integer.MIN_VALUE, Integer.MAX_VALUE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>pool.execute(task);<NEW_LINE>try {<NEW_LINE>task.get(maxThink, TimeUnit.SECONDS);<NEW_LINE>long endTime = System.nanoTime();<NEW_LINE>long duration = endTime - startTime;<NEW_LINE>logger.info("Calculated " + SimulationNode.nodeCount + " nodes in " + duration / 1000000000.0 + 's');<NEW_LINE>nodeCount += SimulationNode.nodeCount;<NEW_LINE>thinkTime += duration;<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>logger.debug("simulating - timed out");<NEW_LINE>task.cancel(true);<NEW_LINE>// sleep for 1 second to allow cleanup to finish<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>logger.fatal("can't sleep");<NEW_LINE>}<NEW_LINE>long endTime = System.nanoTime();<NEW_LINE>long duration = endTime - startTime;<NEW_LINE>logger.info("Timeout - Calculated " + SimulationNode.nodeCount + " nodes in " + duration / 1000000000.0 + 's');<NEW_LINE>nodeCount += SimulationNode.nodeCount;<NEW_LINE>thinkTime += duration;<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE><MASK><NEW_LINE>task.cancel(true);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.fatal("Simulation interrupted", e);<NEW_LINE>task.cancel(true);<NEW_LINE>}<NEW_LINE>} | logger.fatal("Simulation error", e); |
1,806,628 | public void onResume() {<NEW_LINE>super.onResume();<NEW_LINE>tileFileSystemMaxQueueSize.setText(Configuration.getInstance().getTileFileSystemMaxQueueSize() + "");<NEW_LINE>tileFileSystemThreads.setText(Configuration.getInstance().getTileFileSystemThreads() + "");<NEW_LINE>tileDownloadMaxQueueSize.setText(Configuration.getInstance().getTileDownloadMaxQueueSize() + "");<NEW_LINE>tileDownloadThreads.setText(Configuration.getInstance().getTileDownloadThreads() + "");<NEW_LINE>gpsWaitTime.setText(Configuration.getInstance().getGpsWaitTime() + "");<NEW_LINE>additionalExpirationTime.setText(Configuration.getInstance().getExpirationExtendedDuration() + "");<NEW_LINE>cacheMapTileCount.setText(Configuration.getInstance().getCacheMapTileCount() + "");<NEW_LINE>if (Configuration.getInstance().getExpirationOverrideDuration() != null)<NEW_LINE>overrideExpirationTime.setText(Configuration.getInstance().getExpirationOverrideDuration() + "");<NEW_LINE>httpUserAgent.setText(Configuration.getInstance().getUserAgentValue());<NEW_LINE>checkBoxMapViewDebug.setChecked(Configuration.getInstance().isDebugMapView());<NEW_LINE>checkBoxDebugMode.setChecked(Configuration.getInstance().isDebugMode());<NEW_LINE>checkBoxDebugTileProvider.setChecked(Configuration.getInstance().isDebugTileProviders());<NEW_LINE>checkBoxHardwareAcceleration.setChecked(Configuration.getInstance().isMapViewHardwareAccelerated());<NEW_LINE>checkBoxDebugDownloading.setChecked(Configuration.getInstance().isDebugMapTileDownloader());<NEW_LINE>textViewCacheDirectory.setText(Configuration.getInstance().getOsmdroidTileCache().getAbsolutePath());<NEW_LINE>textViewBaseDirectory.setText(Configuration.getInstance().<MASK><NEW_LINE>cacheMaxSize.setText(Configuration.getInstance().getTileFileSystemCacheMaxBytes() + "");<NEW_LINE>cacheTrimSize.setText(Configuration.getInstance().getTileFileSystemCacheTrimBytes() + "");<NEW_LINE>zoomSpeedDefault.setText(Configuration.getInstance().getAnimationSpeedDefault() + "");<NEW_LINE>zoomSpeedShort.setText(Configuration.getInstance().getAnimationSpeedShort() + "");<NEW_LINE>} | getOsmdroidBasePath().getAbsolutePath()); |
603,613 | private void parseTypeNode(CanInclude include, int i, JsonNode typeNode) throws QueryException {<NEW_LINE>String identifier = i == -1 ? "type" : "\\types\"[" + i + "]";<NEW_LINE>if (typeNode.isTextual()) {<NEW_LINE>EClass eClass = packageMetaData.getEClassIncludingDependencies(typeNode.asText());<NEW_LINE>if (eClass == null) {<NEW_LINE>throw new QueryException("Type " + typeNode.asText() + " not found");<NEW_LINE>}<NEW_LINE>include.addType(eClass, false);<NEW_LINE>} else if (typeNode.isObject()) {<NEW_LINE>if (!typeNode.has("name")) {<NEW_LINE>throw new QueryException(identifier + " object must have a \"name\" property");<NEW_LINE>}<NEW_LINE>EClass eClass = packageMetaData.getEClassIncludingDependencies(typeNode.get("name").asText());<NEW_LINE>Set<EClass> excludes = null;<NEW_LINE>if (typeNode.has("exclude")) {<NEW_LINE>if (!typeNode.get("exclude").isArray()) {<NEW_LINE>throw new QueryException("\"exclude\" must be an array");<NEW_LINE>}<NEW_LINE>excludes = new LinkedHashSet<>();<NEW_LINE>ArrayNode excludeNodes = (ArrayNode) typeNode.get("exclude");<NEW_LINE>for (JsonNode excludeNode : excludeNodes) {<NEW_LINE>excludes.add(packageMetaData.getEClassIncludingDependencies(excludeNode.asText()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>include.addType(eClass, typeNode.has("includeAllSubTypes") ? typeNode.get("includeAllSubTypes").asBoolean() : false, excludes);<NEW_LINE>Iterator<String> fieldNames = typeNode.fieldNames();<NEW_LINE>while (fieldNames.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (!fieldName.equals("name") && !fieldName.equals("includeAllSubTypes") && !fieldName.equals("exclude")) {<NEW_LINE>throw new QueryException(identifier + " object cannot contain \"" + fieldName + "\" field");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new QueryException(identifier + " field must be of type string or of type object, is " + typeNode.toString());<NEW_LINE>}<NEW_LINE>} | String fieldName = fieldNames.next(); |
1,297,427 | public com.amazonaws.services.simplesystemsmanagement.model.UnsupportedCalendarException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.simplesystemsmanagement.model.UnsupportedCalendarException unsupportedCalendarException = new com.amazonaws.services.simplesystemsmanagement.model.UnsupportedCalendarException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 unsupportedCalendarException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
485,512 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2,c3".split(",");<NEW_LINE>SupportEvalBuilder builder = new SupportEvalBuilder("SupportBean_Container");<NEW_LINE>builder.expression(fields[0], "beans.sumOf(x => intBoxed)");<NEW_LINE>builder.expression(fields[1], "beans.sumOf( (x, i) => intBoxed + i*10)");<NEW_LINE>builder.expression(fields[2], "beans.sumOf( (x, i, s) => intBoxed + i*10 + s*100)");<NEW_LINE>builder.expression(fields[3], "beans.sumOf( (x, i) => case when i = 1 then null else 1 end)");<NEW_LINE>builder.statementConsumer(stmt -> assertTypesAllSame(stmt.getEventType(), fields, INTEGERBOXED.getEPType()));<NEW_LINE>builder.assertion(new SupportBean_Container(null)).expect(fields, <MASK><NEW_LINE>builder.assertion(new SupportBean_Container(Collections.emptyList())).expect(fields, null, null, null, null);<NEW_LINE>List<SupportBean> listOne = new ArrayList<>(Arrays.asList(makeSB("E1", 10)));<NEW_LINE>builder.assertion(new SupportBean_Container(listOne)).expect(fields, 10, 10, 110, 1);<NEW_LINE>List<SupportBean> listTwo = new ArrayList<>(Arrays.asList(makeSB("E1", 10), makeSB("E2", 11)));<NEW_LINE>builder.assertion(new SupportBean_Container(listTwo)).expect(fields, 21, 31, 431, 1);<NEW_LINE>builder.run(env);<NEW_LINE>} | null, null, null, null); |
79,297 | public void testUnchangedContextTypesIgnoredIfUnknown() throws Exception {<NEW_LINE>ThreadContext contextSvc = ThreadContext.builder().propagated(TestContextTypes.CITY, TestContextTypes.STATE).unchanged("AnUnknownType", "AnotherUnknownType").build();<NEW_LINE>CurrentLocation.setLocation("Pine Island", "Minnesota");<NEW_LINE>try {<NEW_LINE>BiConsumer<String, String> checkLocation = contextSvc.contextualConsumer((city, state) -> {<NEW_LINE>assertEquals(city, CurrentLocation.getCity());<NEW_LINE>assertEquals(state, CurrentLocation.getState());<NEW_LINE>try {<NEW_LINE>fail("Should not have access to application namespace: " + InitialContext.doLookup("java:comp/env/executorRef"));<NEW_LINE>} catch (NamingException x) {<NEW_LINE>// expected, application context must be cleared<NEW_LINE>}<NEW_LINE>});<NEW_LINE>CurrentLocation.setLocation("Janesville", "Wisconsin");<NEW_LINE>checkLocation.accept("Pine Island", "Minnesota");<NEW_LINE>// verify context is restored<NEW_LINE>assertEquals("Janesville", CurrentLocation.getCity());<NEW_LINE>assertEquals(<MASK><NEW_LINE>assertNotNull(InitialContext.doLookup("java:comp/env/executorRef"));<NEW_LINE>} finally {<NEW_LINE>CurrentLocation.clear();<NEW_LINE>}<NEW_LINE>} | "Wisconsin", CurrentLocation.getState()); |
760,908 | JPanel createSourceCodePanel() {<NEW_LINE>Font sourceFont = new Font("Monospaced", Font.PLAIN, (int) Driver.getFontSize());<NEW_LINE>mainFrame.getSourceCodeTextPane().setFont(sourceFont);<NEW_LINE>mainFrame.getSourceCodeTextPane().setEditable(false);<NEW_LINE>mainFrame.getSourceCodeTextPane().<MASK><NEW_LINE>mainFrame.getSourceCodeTextPane().setDocument(SourceCodeDisplay.SOURCE_NOT_RELEVANT);<NEW_LINE>JScrollPane sourceCodeScrollPane = new JScrollPane(mainFrame.getSourceCodeTextPane());<NEW_LINE>sourceCodeScrollPane.getVerticalScrollBar().setUnitIncrement(20);<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>panel.setLayout(new BorderLayout());<NEW_LINE>panel.add(sourceCodeScrollPane, BorderLayout.CENTER);<NEW_LINE>panel.revalidate();<NEW_LINE>if (MainFrame.GUI2_DEBUG) {<NEW_LINE>System.out.println("Created source code panel");<NEW_LINE>}<NEW_LINE>return panel;<NEW_LINE>} | getCaret().setSelectionVisible(true); |
577,151 | public boolean apply(Game game, Ability source, Ability abilityToModify) {<NEW_LINE>int reduceAmount;<NEW_LINE>if (game.inCheckPlayableState()) {<NEW_LINE>// checking state (search max possible targets)<NEW_LINE>reduceAmount = getMaxPossibleTargetCreatures(abilityToModify, game);<NEW_LINE>} else {<NEW_LINE>// real cast check<NEW_LINE>Set<UUID> creaturesTargeted = new HashSet<>();<NEW_LINE>for (Target target : abilityToModify.getAllSelectedTargets()) {<NEW_LINE>if (target.isNotTarget()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (UUID uuid : target.getTargets()) {<NEW_LINE>Permanent <MASK><NEW_LINE>if (permanent != null && permanent.isCreature(game)) {<NEW_LINE>creaturesTargeted.add(permanent.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reduceAmount = creaturesTargeted.size();<NEW_LINE>}<NEW_LINE>CardUtil.reduceCost(abilityToModify, reduceAmount);<NEW_LINE>return true;<NEW_LINE>} | permanent = game.getPermanent(uuid); |
221,199 | public void executeWriteAction(Editor editor, Caret caret, DataContext dataContext) {<NEW_LINE>final Document doc = editor.getDocument();<NEW_LINE>LogicalPosition caretPosition = caret.getLogicalPosition();<NEW_LINE>int startLine = caretPosition.line;<NEW_LINE>int endLine = startLine + 1;<NEW_LINE>if (caret.hasSelection()) {<NEW_LINE>startLine = doc.getLineNumber(caret.getSelectionStart());<NEW_LINE>endLine = doc.getLineNumber(caret.getSelectionEnd());<NEW_LINE>if (doc.getLineStartOffset(endLine) == caret.getSelectionEnd())<NEW_LINE>endLine--;<NEW_LINE>}<NEW_LINE>int[] caretRestoreOffset = new int[] { -1 };<NEW_LINE>int lineCount = endLine - startLine;<NEW_LINE>final int line = startLine;<NEW_LINE>DocumentUtil.executeInBulk(doc, lineCount > 1000, () -> {<NEW_LINE>for (int i = 0; i < lineCount; i++) {<NEW_LINE>if (line >= doc.getLineCount() - 1)<NEW_LINE>break;<NEW_LINE>CharSequence text = doc.getCharsSequence();<NEW_LINE>int end = doc.getLineEndOffset(line<MASK><NEW_LINE>int start = end - doc.getLineSeparatorLength(line);<NEW_LINE>while (start > 0 && (text.charAt(start) == ' ' || text.charAt(start) == '\t')) start--;<NEW_LINE>if (caretRestoreOffset[0] == -1)<NEW_LINE>caretRestoreOffset[0] = start + 1;<NEW_LINE>while (end < doc.getTextLength() && (text.charAt(end) == ' ' || text.charAt(end) == '\t')) end++;<NEW_LINE>doc.replaceString(start, end, " ");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (caret.hasSelection()) {<NEW_LINE>caret.moveToOffset(caret.getSelectionEnd());<NEW_LINE>} else {<NEW_LINE>if (caretRestoreOffset[0] != -1) {<NEW_LINE>caret.moveToOffset(caretRestoreOffset[0]);<NEW_LINE>editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);<NEW_LINE>caret.removeSelection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) + doc.getLineSeparatorLength(line); |
1,826,094 | public static void printHelp(PrintStream stream) throws IOException {<NEW_LINE>stream.println();<NEW_LINE>stream.println("NAME");<NEW_LINE>stream.println(" meta set - Set metadata on nodes");<NEW_LINE>stream.println();<NEW_LINE>stream.println("SYNOPSIS");<NEW_LINE>stream.println(" meta set <meta-key>=<meta-value>[,<meta-key2>=<meta-value2>] -u <url>");<NEW_LINE>stream.println(" [-n <node-id-list> | --all-nodes] [--confirm]");<NEW_LINE>stream.println();<NEW_LINE>stream.println("COMMENTS");<NEW_LINE>stream.println(" To set one metadata, please specify one of the following:");<NEW_LINE>stream.println(" " + MetadataStore.CLUSTER_KEY + " (meta-value is cluster.xml file path)");<NEW_LINE>stream.println(" " + MetadataStore.STORES_KEY + " (meta-value is stores.xml file path)");<NEW_LINE>stream.println(" " + MetadataStore.SLOP_STREAMING_ENABLED_KEY);<NEW_LINE>stream.<MASK><NEW_LINE>stream.println(" " + MetadataStore.READONLY_FETCH_ENABLED_KEY);<NEW_LINE>stream.println(" " + MetadataStore.QUOTA_ENFORCEMENT_ENABLED_KEY);<NEW_LINE>stream.println(" " + MetadataStore.REBALANCING_SOURCE_CLUSTER_XML);<NEW_LINE>stream.println(" " + MetadataStore.REBALANCING_STEAL_INFO);<NEW_LINE>stream.println(" " + KEY_OFFLINE);<NEW_LINE>stream.println(" To set a pair of metadata values, valid meta keys are:");<NEW_LINE>stream.println(" " + MetadataStore.CLUSTER_KEY + " (meta-value is cluster.xml file path)");<NEW_LINE>stream.println(" " + MetadataStore.STORES_KEY + " (meta-value is stores.xml file path)");<NEW_LINE>stream.println();<NEW_LINE>getParser().printHelpOn(stream);<NEW_LINE>stream.println();<NEW_LINE>} | println(" " + MetadataStore.PARTITION_STREAMING_ENABLED_KEY); |
811,755 | public boolean validateSubjectOUField(final String provider, final String certSubjectOU, Set<String> validValues) {<NEW_LINE>try {<NEW_LINE>String value = Crypto.extractX509CSRSubjectOUField(certReq);<NEW_LINE>if (value == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// we have three values that we want to possible match against<NEW_LINE>// a) provider callback specified value<NEW_LINE>// b) provider name<NEW_LINE>// c) configured set of valid ou names<NEW_LINE>// in all cases the caller might ask for a restricted certificate<NEW_LINE>// which cannot be used to talk to ZMS/ZTS - those have the<NEW_LINE>// suffix of ":restricted" so if our value contains one of those<NEW_LINE>// we'll strip it out before comparing<NEW_LINE>if (value.endsWith(Crypto.CERT_RESTRICTED_SUFFIX)) {<NEW_LINE>value = value.substring(0, value.length() - <MASK><NEW_LINE>}<NEW_LINE>if (value.equalsIgnoreCase(certSubjectOU)) {<NEW_LINE>return true;<NEW_LINE>} else if (value.equalsIgnoreCase(provider)) {<NEW_LINE>return true;<NEW_LINE>} else if (validValues != null && !validValues.isEmpty() && validValues.contains(value)) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>LOGGER.error("Failed to validate Subject OU Field {}", value);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (CryptoException ex) {<NEW_LINE>LOGGER.error("Unable to extract Subject OU Field: {}", ex.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | Crypto.CERT_RESTRICTED_SUFFIX.length()); |
1,678,213 | public static void onTextureStitchPre(TextureMap map) {<NEW_LINE>for (FluidSpriteType type : FluidSpriteType.values()) {<NEW_LINE>fluidSprites.get(type).clear();<NEW_LINE>}<NEW_LINE>Map<ResourceLocation, SpriteFluidFrozen> spritesStitched = new HashMap<>();<NEW_LINE>for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {<NEW_LINE>ResourceLocation still = fluid.getStill();<NEW_LINE>ResourceLocation flowing = fluid.getFlowing();<NEW_LINE>if (still == null || flowing == null) {<NEW_LINE>throw new IllegalStateException("Encountered a fluid with a null still sprite! (" + fluid.getName() + " - " + FluidRegistry.getDefaultFluidName(fluid) + ")");<NEW_LINE>}<NEW_LINE>if (spritesStitched.containsKey(still)) {<NEW_LINE>fluidSprites.get(FluidSpriteType.FROZEN).put(fluid.getName(), spritesStitched.get(still));<NEW_LINE>} else {<NEW_LINE>SpriteFluidFrozen spriteFrozen = new SpriteFluidFrozen(still);<NEW_LINE>spritesStitched.put(still, spriteFrozen);<NEW_LINE>if (!map.setTextureEntry(spriteFrozen)) {<NEW_LINE>throw new IllegalStateException("Failed to set the frozen variant of " + still + "!");<NEW_LINE>}<NEW_LINE>fluidSprites.get(FluidSpriteType.FROZEN).put(fluid.getName(), spriteFrozen);<NEW_LINE>}<NEW_LINE>// Note: this must be called with EventPriority.LOW so that we don't overwrite other custom sprites.<NEW_LINE>fluidSprites.get(FluidSpriteType.STILL).put(fluid.getName(), map.registerSprite(still));<NEW_LINE>fluidSprites.get(FluidSpriteType.FLOWING).put(fluid.getName()<MASK><NEW_LINE>}<NEW_LINE>} | , map.registerSprite(flowing)); |
1,593,214 | public void marshall(BackendJobRespObj backendJobRespObj, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (backendJobRespObj == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(backendJobRespObj.getAppId(), APPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(backendJobRespObj.getBackendEnvironmentName(), BACKENDENVIRONMENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(backendJobRespObj.getCreateTime(), CREATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(backendJobRespObj.getJobId(), JOBID_BINDING);<NEW_LINE>protocolMarshaller.marshall(backendJobRespObj.getOperation(), OPERATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(backendJobRespObj.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(backendJobRespObj.getUpdateTime(), UPDATETIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | backendJobRespObj.getError(), ERROR_BINDING); |
1,421,356 | private static void dumpCertInfo(X509Certificate[] certs) throws CertificateEncodingException {<NEW_LINE>logger.tracef(":: Try Holder of Key Token");<NEW_LINE>logger.tracef(":: # of x509 Client Certificate in Certificate Chain = %d", certs.length);<NEW_LINE>for (int i = 0; i < certs.length; i++) {<NEW_LINE>logger.tracef(":: certs[%d] Raw Bytes Counts of first x509 Client Certificate in Certificate Chain = %d", i, certs[i].<MASK><NEW_LINE>logger.tracef(":: certs[%d] Raw Bytes String of first x509 Client Certificate in Certificate Chain = %s", i, certs[i].toString());<NEW_LINE>logger.tracef(":: certs[%d] DER Dump Bytes of first x509 Client Certificate in Certificate Chain = %d", i, certs[i].getEncoded().length);<NEW_LINE>String DERX509Base64UrlEncoded = null;<NEW_LINE>try {<NEW_LINE>DERX509Base64UrlEncoded = getCertificateThumbprintInSHA256DERX509Base64UrlEncoded(certs[i]);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>logger.tracef(":: certs[%d] Base64URL Encoded SHA-256 Hash of DER formatted first x509 Client Certificate in Certificate Chain = %s", i, DERX509Base64UrlEncoded);<NEW_LINE>logger.tracef(":: certs[%d] DER Dump Bytes of first x509 Client Certificate TBScertificate in Certificate Chain = %d", i, certs[i].getTBSCertificate().length);<NEW_LINE>logger.tracef(":: certs[%d] Signature Algorithm of first x509 Client Certificate in Certificate Chain = %s", i, certs[i].getSigAlgName());<NEW_LINE>logger.tracef(":: certs[%d] Certfication Type of first x509 Client Certificate in Certificate Chain = %s", i, certs[i].getType());<NEW_LINE>logger.tracef(":: certs[%d] Issuer DN of first x509 Client Certificate in Certificate Chain = %s", i, certs[i].getIssuerDN().getName());<NEW_LINE>logger.tracef(":: certs[%d] Subject DN of first x509 Client Certificate in Certificate Chain = %s", i, certs[i].getSubjectDN().getName());<NEW_LINE>}<NEW_LINE>} | toString().length()); |
1,150,706 | public final void onBindViewHolder(EpisodeItemViewHolder holder, int pos) {<NEW_LINE>// Reset state of recycled views<NEW_LINE>holder.coverHolder.setVisibility(View.VISIBLE);<NEW_LINE>holder.dragHandle.setVisibility(View.GONE);<NEW_LINE>beforeBindViewHolder(holder, pos);<NEW_LINE>FeedItem item = episodes.get(pos);<NEW_LINE>holder.bind(item);<NEW_LINE>holder.itemView.setOnClickListener(v -> {<NEW_LINE>MainActivity activity = mainActivityRef.get();<NEW_LINE>if (activity != null && !inActionMode()) {<NEW_LINE>long[] ids = FeedItemUtil.getIds(episodes);<NEW_LINE>int position = ArrayUtils.indexOf(ids, item.getId());<NEW_LINE>activity.loadChildFragment(ItemPagerFragment.newInstance(ids, position));<NEW_LINE>} else {<NEW_LINE>toggleSelection(holder.getBindingAdapterPosition());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>holder.itemView.setOnCreateContextMenuListener(this);<NEW_LINE>holder.itemView.setOnLongClickListener(v -> {<NEW_LINE>longPressedItem = <MASK><NEW_LINE>longPressedPosition = holder.getBindingAdapterPosition();<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>holder.itemView.setOnTouchListener((v, e) -> {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>if (e.isFromSource(InputDevice.SOURCE_MOUSE) && e.getButtonState() == MotionEvent.BUTTON_SECONDARY) {<NEW_LINE>longPressedItem = getItem(holder.getBindingAdapterPosition());<NEW_LINE>longPressedPosition = holder.getBindingAdapterPosition();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>if (inActionMode()) {<NEW_LINE>holder.secondaryActionButton.setVisibility(View.GONE);<NEW_LINE>holder.selectCheckBox.setOnClickListener(v -> toggleSelection(holder.getBindingAdapterPosition()));<NEW_LINE>holder.selectCheckBox.setChecked(isSelected(pos));<NEW_LINE>holder.selectCheckBox.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>holder.selectCheckBox.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>afterBindViewHolder(holder, pos);<NEW_LINE>holder.hideSeparatorIfNecessary();<NEW_LINE>} | getItem(holder.getBindingAdapterPosition()); |
34,985 | private ImmutableList<ModuleDependencyMetadata> filterDependencies(DefaultConfigurationMetadata config) {<NEW_LINE>if (dependencies.isEmpty()) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// If we're reaching this point, we're very likely going to iterate on the dependencies<NEW_LINE>// several times. It appears that iterating using `dependencies` is expensive because of<NEW_LINE>// the creation of an iterator and checking bounds. Iterating an array is faster.<NEW_LINE>if (dependenciesAsArray == null) {<NEW_LINE>dependenciesAsArray = dependencies.toArray(new MavenDependencyDescriptor[0]);<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<ModuleDependencyMetadata> filteredDependencies = null;<NEW_LINE>boolean isOptionalConfiguration = "optional".equals(config.getName());<NEW_LINE>ImmutableSet<String> hierarchy = config.getHierarchy();<NEW_LINE>for (MavenDependencyDescriptor dependency : dependenciesAsArray) {<NEW_LINE>if (isOptionalConfiguration && includeInOptionalConfiguration(dependency)) {<NEW_LINE>ModuleDependencyMetadata element = new OptionalConfigurationDependencyMetadata(config, getId(), dependency);<NEW_LINE>if (size == 1) {<NEW_LINE>return ImmutableList.of(element);<NEW_LINE>}<NEW_LINE>if (filteredDependencies == null) {<NEW_LINE>filteredDependencies = ImmutableList.builder();<NEW_LINE>}<NEW_LINE>filteredDependencies.add(element);<NEW_LINE>} else if (include(dependency, hierarchy)) {<NEW_LINE>ModuleDependencyMetadata element = contextualize(config, getId(), dependency);<NEW_LINE>if (size == 1) {<NEW_LINE>return ImmutableList.of(element);<NEW_LINE>}<NEW_LINE>if (filteredDependencies == null) {<NEW_LINE>filteredDependencies = ImmutableList.builder();<NEW_LINE>}<NEW_LINE>filteredDependencies.add(element);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filteredDependencies == null ? ImmutableList.of() : filteredDependencies.build();<NEW_LINE>} | int size = dependencies.size(); |
1,287,935 | public synchronized // f187521.2.1<NEW_LINE>// f187521.2.1<NEW_LINE>AsynchConsumerProxyQueue // f187521.2.1<NEW_LINE>createReadAheadProxyQueue(Reliability unrecoverableReliability) throws SIResourceException, SIIncorrectCallException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "createReadAheadProxyQueue");<NEW_LINE>checkClosed();<NEW_LINE>// begin D249096<NEW_LINE>short id = nextId();<NEW_LINE>// f187521.2.1 // f191114<NEW_LINE>AsynchConsumerProxyQueue // f187521.2.1 // f191114<NEW_LINE>proxyQueue = new ReadAheadSessionProxyQueueImpl(<MASK><NEW_LINE>// end D249096<NEW_LINE>idToProxyQueueMap.put(new ImmutableId(id), proxyQueue);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createReadAheadProxyQueue", proxyQueue);<NEW_LINE>return proxyQueue;<NEW_LINE>} | this, id, conversation, unrecoverableReliability); |
624,291 | static Response toStandardResponse(MockMvcResponse response) {<NEW_LINE>if (!(response instanceof MockMvcRestAssuredResponseImpl)) {<NEW_LINE>throw new IllegalArgumentException(MockMvcResponse.class.getName() + " must be an instance of " + MockMvcRestAssuredResponseImpl.class.getName());<NEW_LINE>}<NEW_LINE>MockMvcRestAssuredResponseImpl mvc = (MockMvcRestAssuredResponseImpl) response;<NEW_LINE>RestAssuredResponseImpl std = new RestAssuredResponseImpl();<NEW_LINE>std.setConnectionManager(mvc.getConnectionManager());<NEW_LINE>std.setContent(mvc.getContent());<NEW_LINE>std.setContentType(mvc.getContentType());<NEW_LINE>std.setCookies(mvc.detailedCookies());<NEW_LINE>std.setDecoderConfig(mvc.getDecoderConfig());<NEW_LINE>std.setDefaultContentType(mvc.getDefaultContentType());<NEW_LINE>std.setHasExpectations(mvc.getHasExpectations());<NEW_LINE>std.setResponseHeaders(mvc.getResponseHeaders());<NEW_LINE>std.setSessionIdName(mvc.getSessionIdName());<NEW_LINE>std.<MASK><NEW_LINE>std.setStatusLine(mvc.getStatusLine());<NEW_LINE>std.setRpr(mvc.getRpr());<NEW_LINE>std.setFilterContextProperties(mvc.getFilterContextProperties());<NEW_LINE>std.setLogRepository(mvc.getLogRepository());<NEW_LINE>return std;<NEW_LINE>} | setStatusCode(mvc.getStatusCode()); |
1,106,396 | public OResultSet executeSimple(OCommandContext ctx) {<NEW_LINE>ODatabaseDocumentInternal db = getDatabase();<NEW_LINE>ORole role = db.getMetadata().getSecurity().getRole(actor.getStringValue());<NEW_LINE>if (role == null)<NEW_LINE>throw new OCommandExecutionException("Invalid role: " + actor.getStringValue());<NEW_LINE>String resourcePath = securityResource.toString();<NEW_LINE>if (permission != null) {<NEW_LINE>role.grant(resourcePath, toPrivilege(permission.permission));<NEW_LINE>role.save();<NEW_LINE>} else {<NEW_LINE>OSecurityInternal security = db.getSharedContext().getSecurity();<NEW_LINE>OSecurityPolicyImpl policy = security.getSecurityPolicy(db, policyName.getStringValue());<NEW_LINE>security.setSecurityPolicy(db, role, securityResource.toString(), policy);<NEW_LINE>}<NEW_LINE>OInternalResultSet rs = new OInternalResultSet();<NEW_LINE>OResultInternal result = new OResultInternal();<NEW_LINE>result.setProperty("operation", "grant");<NEW_LINE>result.setProperty("role", actor.getStringValue());<NEW_LINE>if (permission != null) {<NEW_LINE>result.setProperty("permission", permission.toString());<NEW_LINE>} else {<NEW_LINE>result.setProperty(<MASK><NEW_LINE>}<NEW_LINE>result.setProperty("resource", resourcePath);<NEW_LINE>rs.add(result);<NEW_LINE>return rs;<NEW_LINE>} | "policy", policyName.getStringValue()); |
39,583 | private void reassignEarlyHolders(Context context) {<NEW_LINE>ReflectUtil.field(ReflectUtil.method(ReflectUtil.type("com.sun.tools.javac.comp.Analyzer"), "instance", Context.class).invokeStatic(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Annotate.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Attr.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Check.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(DeferredAttr.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Flow.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Gen.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Infer.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavaCompiler.instance(context)<MASK><NEW_LINE>ReflectUtil.field(JavacElements.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavacProcessingEnvironment.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavacTrees.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(JavacTypes.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(LambdaToMethod.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(Lower.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(ManResolve.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(MemberEnter.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(ReflectUtil.method(ReflectUtil.type("com.sun.tools.javac.comp.Modules"), "instance", Context.class).invokeStatic(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(ReflectUtil.method(ReflectUtil.type("com.sun.tools.javac.comp.Operators"), "instance", Context.class).invokeStatic(context), TYPES_FIELD).set(this);<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>ReflectUtil.field(ReflectUtil.method(ReflectUtil.type("com.sun.tools.javac.jvm.StringConcat"), "instance", Context.class).invokeStatic(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(RichDiagnosticFormatter.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(TransTypes.instance(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(ReflectUtil.method(ReflectUtil.type("com.sun.tools.javac.comp.TypeEnter"), "instance", Context.class).invokeStatic(context), TYPES_FIELD).set(this);<NEW_LINE>ReflectUtil.field(TreeMaker.instance(context), TYPES_FIELD).set(this);<NEW_LINE>} | , TYPES_FIELD).set(this); |
1,072,442 | private void readSegmentationParams(BitReader br) {<NEW_LINE>segmentationEnabled = br.read1Bit() == 1;<NEW_LINE>if (segmentationEnabled) {<NEW_LINE>if (br.read1Bit() == 1) {<NEW_LINE>for (int i = 0; i < 7; i++) segmentationTreeProbs[i] = readProb(br);<NEW_LINE>int segmentationTemporalUpdate = br.read1Bit();<NEW_LINE>for (int i = 0; i < 3; i++) segmentationPredProbs[i] = segmentationTemporalUpdate == <MASK><NEW_LINE>}<NEW_LINE>if (br.read1Bit() == 1) {<NEW_LINE>int segmentationAbsOrDeltaUpdate = br.read1Bit();<NEW_LINE>for (int i = 0; i < MAX_SEGMENTS; i++) {<NEW_LINE>for (int j = 0; j < SEG_LVL_MAX; j++) {<NEW_LINE>if (br.read1Bit() == 1) {<NEW_LINE>featureEnabled[i][j] = 1;<NEW_LINE>int bits_to_read = SEGMENTATION_FEATURE_BITS[j];<NEW_LINE>int value = br.readNBit(bits_to_read);<NEW_LINE>if (SEGMENTATION_FEATURE_SIGNED[j] == 1) {<NEW_LINE>if (br.read1Bit() == 1)<NEW_LINE>value *= -1;<NEW_LINE>}<NEW_LINE>featureData[i][j] = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 1 ? readProb(br) : 255; |
1,855,184 | public static void main(final String[] args) {<NEW_LINE>final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null;<NEW_LINE>final Aeron.Context ctx = new Aeron.Context();<NEW_LINE>if (EMBEDDED_MEDIA_DRIVER) {<NEW_LINE>ctx.aeronDirectoryName(driver.aeronDirectoryName());<NEW_LINE>}<NEW_LINE>if (INFO_FLAG) {<NEW_LINE>ctx.availableImageHandler(SamplesUtil::printAvailableImage);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final IdleStrategy idleStrategy = new BusySpinIdleStrategy();<NEW_LINE>System.out.println("Subscribing Ping at " + PING_CHANNEL + " on stream id " + PING_STREAM_ID);<NEW_LINE>System.out.println("Publishing Pong at " + PONG_CHANNEL + " on stream id " + PONG_STREAM_ID);<NEW_LINE>System.out.println("Using exclusive publications " + EXCLUSIVE_PUBLICATIONS);<NEW_LINE>final AtomicBoolean running = new AtomicBoolean(true);<NEW_LINE>SigInt.register(() -> running.set(false));<NEW_LINE>try (Aeron aeron = Aeron.connect(ctx);<NEW_LINE>Subscription subscription = aeron.addSubscription(PING_CHANNEL, PING_STREAM_ID);<NEW_LINE>Publication publication = EXCLUSIVE_PUBLICATIONS ? aeron.addExclusivePublication(PONG_CHANNEL, PONG_STREAM_ID) : aeron.addPublication(PONG_CHANNEL, PONG_STREAM_ID)) {<NEW_LINE>final BufferClaim bufferClaim = new BufferClaim();<NEW_LINE>final FragmentHandler fragmentHandler = (buffer, offset, length, header) -> pingHandler(bufferClaim, publication, buffer, offset, length, header);<NEW_LINE>while (running.get()) {<NEW_LINE>idleStrategy.idle(subscription.poll(fragmentHandler, FRAME_COUNT_LIMIT));<NEW_LINE>}<NEW_LINE>System.out.println("Shutting down...");<NEW_LINE>}<NEW_LINE>CloseHelper.close(driver);<NEW_LINE>} | ctx.unavailableImageHandler(SamplesUtil::printUnavailableImage); |
1,206,947 | public int codePointBefore(int index) {<NEW_LINE>int currentLength = lengthInternal();<NEW_LINE>if (index > 0 && index <= currentLength) {<NEW_LINE>// Check if the StringBuilder is compressed<NEW_LINE>if (String.COMPACT_STRINGS && count >= 0) {<NEW_LINE>return helpers.byteToCharUnsigned(helpers.getByteFromArrayByIndex(value, index - 1));<NEW_LINE>} else {<NEW_LINE>int <MASK><NEW_LINE>if (index > 1 && low >= Character.MIN_LOW_SURROGATE && low <= Character.MAX_LOW_SURROGATE) {<NEW_LINE>int high = value[index - 2];<NEW_LINE>if (high >= Character.MIN_HIGH_SURROGATE && high <= Character.MAX_HIGH_SURROGATE) {<NEW_LINE>return 0x10000 + ((high - Character.MIN_HIGH_SURROGATE) << 10) + (low - Character.MIN_LOW_SURROGATE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return low;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new StringIndexOutOfBoundsException(index);<NEW_LINE>}<NEW_LINE>} | low = value[index - 1]; |
21,703 | final ListImportsResult executeListImports(ListImportsRequest listImportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listImportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListImportsRequest> request = null;<NEW_LINE>Response<ListImportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListImportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listImportsRequest));<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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListImports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListImportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListImportsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
523,710 | private void checkPartitionNames() throws AnalysisException {<NEW_LINE>if (optPartitionNames != null) {<NEW_LINE>optPartitionNames.analyze(analyzer);<NEW_LINE>if (optTableName != null) {<NEW_LINE>Database db = analyzer.getEnv().getInternalCatalog().getDbOrAnalysisException(optTableName.getDb());<NEW_LINE>OlapTable olapTable = (OlapTable) db.getTableOrAnalysisException(optTableName.getTbl());<NEW_LINE>if (!olapTable.isPartitioned()) {<NEW_LINE>throw new AnalysisException("Not a partitioned table: " + olapTable.getName());<NEW_LINE>}<NEW_LINE>List<String> names = optPartitionNames.getPartitionNames();<NEW_LINE>Set<String> olapPartitionNames = olapTable.getPartitionNames();<NEW_LINE>List<String> tempPartitionNames = olapTable.getTempPartitions().stream().map(Partition::getName).collect(Collectors.toList());<NEW_LINE>Optional<String> optional = names.stream().filter(name -> (tempPartitionNames.contains(name) || !olapPartitionNames.contains(name))).findFirst();<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>throw new AnalysisException("Temporary partition or partition does not exist");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new AnalysisException("Specify partition should specify table name as well");<NEW_LINE>}<NEW_LINE>partitionNames.<MASK><NEW_LINE>}<NEW_LINE>} | addAll(optPartitionNames.getPartitionNames()); |
1,462,930 | protected void addStoreAfter(Block pred, @Nullable Node node, S s, boolean addBlockToWorklist) {<NEW_LINE>// If the block pred is an exception block, decide whether the block of passing node is an<NEW_LINE>// exceptional successor of the block pred<NEW_LINE>TypeMirror excSuccType = getSuccExceptionType(pred, node);<NEW_LINE>if (excSuccType != null) {<NEW_LINE>if (isIgnoredExceptionType(excSuccType)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If the block of passing node is an exceptional successor of Block pred, propagate<NEW_LINE>// store to the exceptionStores. Currently it doesn't track the label of an<NEW_LINE>// exceptional edge from exception block to its exceptional successors in backward<NEW_LINE>// direction. Instead, all exception stores of exceptional successors of an<NEW_LINE>// exception block will merge to one exception store at the exception block<NEW_LINE>ExceptionBlock ebPred = (ExceptionBlock) pred;<NEW_LINE>S exceptionStore = exceptionStores.get(ebPred);<NEW_LINE>S newExceptionStore = (exceptionStore != null) ? exceptionStore.leastUpperBound(s) : s;<NEW_LINE>if (!newExceptionStore.equals(exceptionStore)) {<NEW_LINE>exceptionStores.put(ebPred, newExceptionStore);<NEW_LINE>inputs.put(ebPred, new TransferInput<V, S>(node, this, newExceptionStore));<NEW_LINE>addBlockToWorklist = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>S predOutStore = getStoreAfter(pred);<NEW_LINE>S newPredOutStore = (predOutStore != null) ? predOutStore.leastUpperBound(s) : s;<NEW_LINE>if (!newPredOutStore.equals(predOutStore)) {<NEW_LINE>outStores.put(pred, newPredOutStore);<NEW_LINE>inputs.put(pred, new TransferInput<><MASK><NEW_LINE>addBlockToWorklist = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addBlockToWorklist) {<NEW_LINE>addToWorklist(pred);<NEW_LINE>}<NEW_LINE>} | (node, this, newPredOutStore)); |
206,481 | private static void addEntryCondition(List<BuiltCondition> conditions, QueryContext context) {<NEW_LINE>JsonNode entryKey, entryValue;<NEW_LINE>if (!context.value.isObject() || context.value.size() != 2 || (entryKey = context.value.get("key")) == null || (entryValue = context.value.get("value")) == null) {<NEW_LINE>throw new IllegalArgumentException(String.format("Value entry for field %s, operation %s must be an object " + "with two fields 'key' and 'value'.", context.fieldName, context.rawOp));<NEW_LINE>}<NEW_LINE>if (context.type == null || !context.type.isMap()) {<NEW_LINE>throw new IllegalArgumentException(String.format("Field %s: operation %s is only supported for map types", context<MASK><NEW_LINE>}<NEW_LINE>Column.ColumnType keyType = context.type.parameters().get(0);<NEW_LINE>Column.ColumnType valueType = context.type.parameters().get(1);<NEW_LINE>Object mapKey = Converters.toCqlValue(keyType, entryKey.asText());<NEW_LINE>Object mapValue = Converters.toCqlValue(valueType, entryValue.asText());<NEW_LINE>conditions.add(BuiltCondition.of(LHS.mapAccess(context.fieldName, mapKey), context.operator.predicate, mapValue));<NEW_LINE>} | .fieldName, context.rawOp)); |
481,506 | public Object visitar(ValorTreeNode no) {<NEW_LINE>StringBuilder sb = new StringBuilder("<html>[");<NEW_LINE>sb.append(no.getPosicao()).append("]");<NEW_LINE>Icon icon = getIcon(no.getTipoDado(), false);<NEW_LINE>if (no.getValor() != null) {<NEW_LINE>Object valor = no.getValor();<NEW_LINE>if (valor instanceof Boolean) {<NEW_LINE>valor = ((<MASK><NEW_LINE>}<NEW_LINE>sb.append(" = ").append(valor);<NEW_LINE>} else if (no.isColuna()) {<NEW_LINE>icon = getVectorIcon(no.getTipoDado());<NEW_LINE>;<NEW_LINE>}<NEW_LINE>component.setText(sb.toString());<NEW_LINE>// component.setPreferredSize(new Dimension(200,20));<NEW_LINE>if (no.isModificado()) {<NEW_LINE>component.setForeground(Color.BLUE);<NEW_LINE>}<NEW_LINE>component.setDisabledIcon(icon);<NEW_LINE>component.setIcon(icon);<NEW_LINE>return null;<NEW_LINE>} | Boolean) valor) ? "verdadeiro" : "falso"; |
1,715,070 | void collectScheduledMethods(BeanRegistrationPhaseBuildItem beanRegistrationPhase, BuildProducer<ScheduledBusinessMethodItem> scheduledBusinessMethods) {<NEW_LINE>AnnotationStore annotationStore = beanRegistrationPhase.getContext().get(BuildExtension.Key.ANNOTATION_STORE);<NEW_LINE>for (BeanInfo bean : beanRegistrationPhase.getContext().beans().classBeans()) {<NEW_LINE>ClassInfo classInfo = bean.getTarget().get().asClass();<NEW_LINE>for (MethodInfo method : classInfo.methods()) {<NEW_LINE>List<AnnotationInstance> schedules = null;<NEW_LINE>AnnotationInstance scheduledAnnotation = annotationStore.getAnnotation(method, SPRING_SCHEDULED);<NEW_LINE>if (scheduledAnnotation != null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>AnnotationInstance schedulesAnnotation = annotationStore.getAnnotation(method, SPRING_SCHEDULES);<NEW_LINE>if (schedulesAnnotation != null) {<NEW_LINE>schedules = new ArrayList<>();<NEW_LINE>for (AnnotationInstance scheduledInstance : schedulesAnnotation.value().asNestedArray()) {<NEW_LINE>schedules.add(AnnotationInstance.create(scheduledInstance.name(), schedulesAnnotation.target(), scheduledInstance.values()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processSpringScheduledAnnotation(scheduledBusinessMethods, bean, method, schedules);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | schedules = Collections.singletonList(scheduledAnnotation); |
93,041 | private static int listDFSPaths() {<NEW_LINE>Date alpha = new Date();<NEW_LINE>int inodeCount = 0;<NEW_LINE>String basePath = new String(TEST_BASE_DIR) + "/" + hostName_ + "_" + processName_;<NEW_LINE>Queue<String> pending = new LinkedList<String>();<NEW_LINE>pending.add(basePath);<NEW_LINE>while (!pending.isEmpty()) {<NEW_LINE>String parent = pending.remove();<NEW_LINE>DirectoryListing thisListing;<NEW_LINE>try {<NEW_LINE>thisListing = dfsClient_.listPaths(parent, HdfsFileStatus.EMPTY_NAME);<NEW_LINE>if (thisListing == null || thisListing.getPartialListing().length == 0) {<NEW_LINE>// System.out.println("Empty directory");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>do {<NEW_LINE>HdfsFileStatus[] children = thisListing.getPartialListing();<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>String localName = children[i].getLocalName();<NEW_LINE>// System.out.printf("Readdir going through [%s/%s]\n", parent, localName);<NEW_LINE>if (localName.equals(".") || localName.equals("..")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>inodeCount++;<NEW_LINE>if (inodeCount % COUNT_INCR == 0) {<NEW_LINE>System.out.printf("Readdir paths so far: %d\n", inodeCount);<NEW_LINE>}<NEW_LINE>if (children[i].isDir()) {<NEW_LINE>pending.add(parent + "/" + localName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!thisListing.hasMore()) {<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>// System.out.println("Remaining entries " + Integer.toString(thisListing.getRemainingEntries()));<NEW_LINE>}<NEW_LINE>thisListing = dfsClient_.listPaths(parent, thisListing.getLastName());<NEW_LINE>} while (thisListing != null);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Date zigma = new Date();<NEW_LINE>System.out.printf("Client: Directory walk done over %d inodes in %d msec\n", inodeCount<MASK><NEW_LINE>return 0;<NEW_LINE>} | , timeDiffMilliSec(alpha, zigma)); |
880,671 | public ServerAuthorConfigurationResponse configureAllAccessServices(String userId, String serverName, String serverToBeConfiguredName, Map<String, Object> accessServiceOptions) {<NEW_LINE>final String methodName = "configureAllAccessServices";<NEW_LINE>RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);<NEW_LINE>ServerAuthorConfigurationResponse response = new ServerAuthorConfigurationResponse();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);<NEW_LINE>ServerAuthorViewHandler serverAuthorViewHandler = instanceHandler.getServerAuthorViewHandler(userId, serverName, methodName);<NEW_LINE>serverAuthorViewHandler.configureAllAccessServices(className, methodName, serverToBeConfiguredName, accessServiceOptions);<NEW_LINE>response = <MASK><NEW_LINE>} catch (ServerAuthorViewServiceException error) {<NEW_LINE>ServerAuthorExceptionHandler.captureCheckedException(response, error, className);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>restExceptionHandler.captureExceptions(response, exception, methodName, auditLog);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, response.toString());<NEW_LINE>return response;<NEW_LINE>} | getStoredConfiguration(userId, serverName, serverToBeConfiguredName); |
1,109,206 | private Optional<ConfiguredStatement<CreateSource>> injectForCreateStatement(final ConfiguredStatement<CreateSource> original) {<NEW_LINE>final CreateSource statement = original.getStatement();<NEW_LINE>final CreateSourceProperties properties = statement.getProperties();<NEW_LINE>final Optional<FormatInfo> keyFormat = properties.getKeyFormat(statement.getName());<NEW_LINE>final Optional<FormatInfo> valueFormat = properties.getValueFormat();<NEW_LINE>if (keyFormat.isPresent() && valueFormat.isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final KsqlConfig config = getConfig(original);<NEW_LINE>final CreateSourceProperties injectedProps = properties.withFormats(keyFormat.map(FormatInfo::getFormat).orElseGet(() -> getDefaultKeyFormat(config)), valueFormat.map(FormatInfo::getFormat).orElseGet(() -> getDefaultValueFormat(config)));<NEW_LINE>final CreateSource withFormats = statement.copyWith(original.getStatement(<MASK><NEW_LINE>final PreparedStatement<CreateSource> prepared = buildPreparedStatement(withFormats);<NEW_LINE>final ConfiguredStatement<CreateSource> configured = ConfiguredStatement.of(prepared, original.getSessionConfig());<NEW_LINE>return Optional.of(configured);<NEW_LINE>} | ).getElements(), injectedProps); |
1,040,971 | public static void main(String[] args) {<NEW_LINE>int size = args.length == 1 ? Integer.parseInt(args[0]) : 8;<NEW_LINE>int[][] array = new int[size][size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>Arrays.setAll(array[i], (index) -> index);<NEW_LINE>}<NEW_LINE>printArray(array);<NEW_LINE>TornadoDevice device = TornadoRuntime.getTornadoRuntime().getDefaultDevice();<NEW_LINE>TornadoGlobalObjectState state = TornadoRuntime.getTornadoRuntime().resolveObject(array);<NEW_LINE>TornadoDeviceObjectState deviceState = state.getDeviceState(device);<NEW_LINE>List<Integer> writeEvent = device.ensurePresent(array, deviceState, null, 0, 0);<NEW_LINE>if (writeEvent != null) {<NEW_LINE>for (Integer e : writeEvent) {<NEW_LINE>device.resolveEvent(e).waitOn();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>Arrays.fill(array[i], -1);<NEW_LINE>}<NEW_LINE>printArray(array);<NEW_LINE>int readEvent = device.streamOut(array, 0, deviceState, null);<NEW_LINE>device.<MASK><NEW_LINE>printArray(array);<NEW_LINE>} | resolveEvent(readEvent).waitOn(); |
143,198 | private void online(Tuple2<DataSet<Vector>, DataSet<BaseVectorSummary>> dataAndStat, int numTopic, int numIter, double alpha, double beta, DataSet<DocCountVectorizerModelData> resDocCountModel, int gammaShape, Integer seed) {<NEW_LINE>if (beta == -1) {<NEW_LINE>beta = 1.0 / numTopic;<NEW_LINE>}<NEW_LINE>if (alpha == -1) {<NEW_LINE>alpha = 1.0 / numTopic;<NEW_LINE>}<NEW_LINE>double learningOffset = getParams().get(ONLINE_LEARNING_OFFSET);<NEW_LINE>double learningDecay = getParams().get(LEARNING_DECAY);<NEW_LINE>double subSamplingRate = getParams().get(SUBSAMPLING_RATE);<NEW_LINE>boolean optimizeDocConcentration = getParams().get(OPTIMIZE_DOC_CONCENTRATION);<NEW_LINE>DataSet<Vector> data = dataAndStat.f0;<NEW_LINE>DataSet<Tuple2<Long, Integer>> shape = dataAndStat.f1.map(new MapFunction<BaseVectorSummary, Tuple2<Long, Integer>>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1305270477796787466L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Tuple2<Long, Integer> map(BaseVectorSummary srt) {<NEW_LINE>return new Tuple2<>(srt.count(), srt.vectorSize());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>DataSet<Tuple2<DenseMatrix, DenseMatrix>> initModel = data.mapPartition(new OnlineInit(numTopic, gammaShape, alpha, seed)).name("init lambda").withBroadcastSet(shape, LdaVariable.shape);<NEW_LINE>DataSet<Row> ldaModelData = new IterativeComQueue().initWithPartitionedData(LdaVariable.data, data).initWithBroadcastData(LdaVariable.shape, shape).initWithBroadcastData(LdaVariable.initModel, initModel).add(new OnlineCorpusStep(numTopic, subSamplingRate, gammaShape, seed)).add(new AllReduce(LdaVariable.wordTopicStat)).add(new AllReduce(LdaVariable.logPhatPart)).add(new AllReduce(LdaVariable.nonEmptyWordCount)).add(new AllReduce(LdaVariable.nonEmptyDocCount)).add(new UpdateLambdaAndAlpha(numTopic, learningOffset, learningDecay, subSamplingRate, optimizeDocConcentration, beta)).add(new OnlineLogLikelihood(beta, numTopic, numIter, gammaShape, seed)).add(new AllReduce(LdaVariable.logLikelihood)).closeWith(new BuildOnlineLdaModel(numTopic, beta)).setMaxIter(numIter).exec();<NEW_LINE>DataSet<Row> model = ldaModelData.flatMap(new BuildResModel(seed)).withBroadcastSet(resDocCountModel, "DocCountModel");<NEW_LINE>setOutput(model, new <MASK><NEW_LINE>saveWordTopicModelAndPerplexity(model, numTopic, true);<NEW_LINE>} | LdaModelDataConverter().getModelSchema()); |
1,568,475 | protected List<String> buildJvmArguments() {<NEW_LINE>List<String> jvmArguments = new ArrayList<>();<NEW_LINE>String systemPropertyDevMode = "-D" + NinjaConstant.MODE_KEY_NAME + "=" + mode;<NEW_LINE>jvmArguments.add(systemPropertyDevMode);<NEW_LINE>if (port != null) {<NEW_LINE>String portSelection = "-D" <MASK><NEW_LINE>jvmArguments.add(portSelection);<NEW_LINE>}<NEW_LINE>if (sslPort != null) {<NEW_LINE>String sslPortSelection = "-D" + Standalone.KEY_NINJA_SSL_PORT + "=" + sslPort;<NEW_LINE>jvmArguments.add(sslPortSelection);<NEW_LINE>}<NEW_LINE>if (getContextPath() != null) {<NEW_LINE>String contextPathSelection = "-D" + Standalone.KEY_NINJA_CONTEXT_PATH + "=" + getContextPath();<NEW_LINE>jvmArguments.add(contextPathSelection);<NEW_LINE>}<NEW_LINE>if (jvmArgs != null) {<NEW_LINE>// use excellent DrJava library to tokenize arguments (do not keep tokens)<NEW_LINE>List<String> tokenizedArgs = ArgumentTokenizer.tokenize(jvmArgs, false);<NEW_LINE>getLog().debug("JVM arguments tokenizer results:");<NEW_LINE>for (String s : tokenizedArgs) {<NEW_LINE>getLog().debug("argument: " + s + "");<NEW_LINE>}<NEW_LINE>jvmArguments.addAll(tokenizedArgs);<NEW_LINE>}<NEW_LINE>return jvmArguments;<NEW_LINE>} | + Standalone.KEY_NINJA_PORT + "=" + port; |
1,740,513 | private void writeMaterialGroups(JsonWriter json) throws IOException {<NEW_LINE>// groups<NEW_LINE>json.name("groups").beginArray();<NEW_LINE>if (size > 0) {<NEW_LINE>int miSize = size * FI_MATERIAL_INDEX, lastMaterial = materialIndex[0], material = lastMaterial, groupStart = 0;<NEW_LINE>json.beginObject();<NEW_LINE>json.name("materialIndex").value(material);<NEW_LINE>json.name("start").value(0);<NEW_LINE>for (int i = 1; i < miSize; i++) {<NEW_LINE>material = materialIndex[i];<NEW_LINE>if (material != lastMaterial) {<NEW_LINE>json.name("count").value((i - groupStart) * 3);<NEW_LINE>json.endObject();<NEW_LINE>groupStart = i;<NEW_LINE>json.beginObject();<NEW_LINE>json.name("materialIndex").value(material);<NEW_LINE>json.name("start").value(groupStart * 3);<NEW_LINE>}<NEW_LINE>lastMaterial = material;<NEW_LINE>}<NEW_LINE>json.name("count").value(<MASK><NEW_LINE>json.endObject();<NEW_LINE>}<NEW_LINE>// groups<NEW_LINE>json.endArray();<NEW_LINE>} | (miSize - groupStart) * 3); |
1,788,085 | private void buildNewSlotEqSlotPredicate(List<Pair<Integer, Integer>> newSlots, Map<Integer, Expr> warshallArraySubscriptToExpr, List<Expr> slotEqSlotExpr, Set<Pair<Expr, Expr>> slotEqSlotDeDuplication, Analyzer analyzer, ExprRewriter.ClauseType clauseType) {<NEW_LINE>for (Pair<Integer, Integer> slotPair : newSlots) {<NEW_LINE>Pair<Expr, Expr> pair = Pair.of(warshallArraySubscriptToExpr.get(slotPair.first), warshallArraySubscriptToExpr.get(slotPair.second));<NEW_LINE>Pair<Expr, Expr> eqPair = Pair.of(warshallArraySubscriptToExpr.get(slotPair.second), warshallArraySubscriptToExpr.get(slotPair.first));<NEW_LINE>if (!slotEqSlotDeDuplication.contains(pair) && !slotEqSlotDeDuplication.contains(eqPair)) {<NEW_LINE>slotEqSlotDeDuplication.add(pair);<NEW_LINE>slotEqSlotExpr.add(new BinaryPredicate(BinaryPredicate.Operator.EQ, warshallArraySubscriptToExpr.get(slotPair.first), warshallArraySubscriptToExpr.<MASK><NEW_LINE>if (clauseType.isOnClause()) {<NEW_LINE>analyzer.registerOnSlotEqSlotDeDuplication(pair);<NEW_LINE>analyzer.registerOnSlotEqSlotExpr(new BinaryPredicate(BinaryPredicate.Operator.EQ, warshallArraySubscriptToExpr.get(slotPair.first), warshallArraySubscriptToExpr.get(slotPair.second)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(slotPair.second))); |
1,280,965 | final DescribeQueryResult executeDescribeQuery(DescribeQueryRequest describeQueryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeQueryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeQueryRequest> request = null;<NEW_LINE>Response<DescribeQueryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeQueryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeQueryRequest));<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, "CloudTrail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeQuery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeQueryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeQueryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
686,949 | public void onEvent(Event event) throws Exception {<NEW_LINE>if (event == null)<NEW_LINE>return;<NEW_LINE>if (logout == event.getTarget()) {<NEW_LINE>cleanup();<NEW_LINE>Objects.requireNonNull(SessionManager.getApplication()).logout();<NEW_LINE>} else if (role == event.getTarget()) {<NEW_LINE>String roleInfo = MRole.getDefault().toStringX(Env.getCtx());<NEW_LINE>roleInfo = roleInfo.<MASK><NEW_LINE>Messagebox.showDialog(roleInfo, Msg.getMsg(ctx, "RoleInfo"), Messagebox.OK, Messagebox.INFORMATION);<NEW_LINE>} else if (preference == event.getTarget()) {<NEW_LINE>if (preferencePopup != null) {<NEW_LINE>preferencePopup.detach();<NEW_LINE>}<NEW_LINE>preferencePopup = new WPreference();<NEW_LINE>preferencePopup.setPage(this.getPage());<NEW_LINE>preferencePopup.open(preference);<NEW_LINE>} else if (context == event.getTarget()) {<NEW_LINE>if (contextPopup != null) {<NEW_LINE>contextPopup.detach();<NEW_LINE>}<NEW_LINE>contextPopup = new WContext();<NEW_LINE>AEnv.showWindow(contextPopup);<NEW_LINE>} else if (changeRole == event.getTarget()) {<NEW_LINE>MUser user = MUser.get(ctx);<NEW_LINE>Clients.confirmClose(null);<NEW_LINE>SessionManager.changeRole(user);<NEW_LINE>}<NEW_LINE>} | replace(Env.NL, "<br>"); |
1,451,070 | public boolean applyLimitsToMatrix() {<NEW_LINE>// Do not continue if matrix has no translations or scales applied to it. (This is an optimization.)<NEW_LINE>if (this.matrix.isIdentity()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Fetch matrix values.<NEW_LINE>float[] matrixValues = new float[9];<NEW_LINE>this.matrix.getValues(matrixValues);<NEW_LINE>// Do not allow scale to be less than 1x.<NEW_LINE>if ((matrixValues[Matrix.MSCALE_X] < 1.0f) || (matrixValues[Matrix.MSCALE_Y] < 1.0f)) {<NEW_LINE>this.matrix.reset();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Do not allow scale to be greater than 5x.<NEW_LINE>final float MAX_SCALE = 5.0f;<NEW_LINE>if ((matrixValues[Matrix.MSCALE_X] > MAX_SCALE) || (matrixValues[Matrix.MSCALE_Y] > MAX_SCALE)) {<NEW_LINE>this.matrix.postScale(MAX_SCALE / matrixValues[Matrix.MSCALE_X], MAX_SCALE / matrixValues[Matrix.MSCALE_Y], this.tiImageView.getWidth() / 2.0f, this.tiImageView.getHeight() / 2.0f);<NEW_LINE>this.matrix.getValues(matrixValues);<NEW_LINE>}<NEW_LINE>// Fetch min/max bounds the image can be scrolled to, preventing image from being scrolled off-screen.<NEW_LINE>float translateX = -matrixValues[Matrix.MTRANS_X];<NEW_LINE>float translateY = -matrixValues[Matrix.MTRANS_Y];<NEW_LINE>float maxTranslateX = (tiImageView.getWidth() * matrixValues[Matrix.MSCALE_X]) - tiImageView.getWidth();<NEW_LINE>float maxTranslateY = (tiImageView.getHeight() * matrixValues[Matrix.MSCALE_Y]) - tiImageView.getHeight();<NEW_LINE>// Apply translation limits.<NEW_LINE>boolean wasChanged = false;<NEW_LINE>if (translateX < 0) {<NEW_LINE>this.matrix.postTranslate(translateX, 0);<NEW_LINE>wasChanged = true;<NEW_LINE>} else if (translateX > maxTranslateX) {<NEW_LINE>this.matrix.postTranslate(translateX - maxTranslateX, 0);<NEW_LINE>wasChanged = true;<NEW_LINE>}<NEW_LINE>if (translateY < 0) {<NEW_LINE>this.matrix.postTranslate(0, translateY);<NEW_LINE>wasChanged = true;<NEW_LINE>} else if (translateY > maxTranslateY) {<NEW_LINE>this.matrix.<MASK><NEW_LINE>wasChanged = true;<NEW_LINE>}<NEW_LINE>return wasChanged;<NEW_LINE>} | postTranslate(0, translateY - maxTranslateY); |
1,124,094 | public void runAsSystemUser() throws SiteWhereException {<NEW_LINE>Period missingInterval;<NEW_LINE>try {<NEW_LINE>missingInterval = Period.parse(getPresenceMissingInterval(), ISOPeriodFormat.standard());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>missingInterval = <MASK><NEW_LINE>}<NEW_LINE>int missingIntervalSecs = missingInterval.toStandardSeconds().getSeconds();<NEW_LINE>Period checkInterval;<NEW_LINE>try {<NEW_LINE>checkInterval = Period.parse(getPresenceCheckInterval(), ISOPeriodFormat.standard());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>checkInterval = PERIOD_FORMATTER.parsePeriod(getPresenceCheckInterval());<NEW_LINE>}<NEW_LINE>int checkIntervalSecs = checkInterval.toStandardSeconds().getSeconds();<NEW_LINE>getLogger().info("Presence manager checking every " + PERIOD_FORMATTER.print(checkInterval) + " (" + checkIntervalSecs + " seconds) " + "for devices with last interaction date of more than " + PERIOD_FORMATTER.print(missingInterval) + " (" + missingIntervalSecs + " seconds) " + ".");<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>// TODO: For performance/memory consumption, this should be done in batches.<NEW_LINE>Date endDate = new Date(System.currentTimeMillis() - (missingIntervalSecs * 1000));<NEW_LINE>DeviceStateSearchCriteria criteria = new DeviceStateSearchCriteria(1, 0);<NEW_LINE>criteria.setLastInteractionDateBefore(endDate);<NEW_LINE>ISearchResults<? extends IDeviceState> missing = getDeviceStateManagement().searchDeviceStates(criteria);<NEW_LINE>if (missing.getNumResults() > 0) {<NEW_LINE>getLogger().info("Presence manager detected " + missing.getNumResults() + " non-present devices.");<NEW_LINE>} else {<NEW_LINE>getLogger().info("No non-present devices detected.");<NEW_LINE>}<NEW_LINE>for (IDeviceState deviceState : missing.getResults()) {<NEW_LINE>if (sendPresenceMissing(deviceState)) {<NEW_LINE>try {<NEW_LINE>DeviceStateCreateRequest update = new DeviceStateCreateRequest();<NEW_LINE>update.setDeviceId(deviceState.getDeviceId());<NEW_LINE>update.setDeviceAssignmentId(deviceState.getDeviceAssignmentId());<NEW_LINE>update.setPresenceMissingDate(new Date());<NEW_LINE>update.setLastInteractionDate(deviceState.getLastInteractionDate());<NEW_LINE>getDeviceStateManagement().updateDeviceState(deviceState.getId(), update);<NEW_LINE>} catch (SiteWhereException e) {<NEW_LINE>getLogger().warn("Unable to update presence missing date.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SiteWhereException e) {<NEW_LINE>getLogger().error("Error processing presence query.", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(checkIntervalSecs * 1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>getLogger().info("Presence check thread shut down.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | PERIOD_FORMATTER.parsePeriod(getPresenceMissingInterval()); |
1,260,114 | final DeleteWirelessGatewayTaskResult executeDeleteWirelessGatewayTask(DeleteWirelessGatewayTaskRequest deleteWirelessGatewayTaskRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteWirelessGatewayTaskRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteWirelessGatewayTaskRequest> request = null;<NEW_LINE>Response<DeleteWirelessGatewayTaskResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteWirelessGatewayTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteWirelessGatewayTaskRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteWirelessGatewayTask");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteWirelessGatewayTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteWirelessGatewayTaskResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion()); |
700,823 | public DDOrderMoveSchedule createScheduleToMove(@NonNull final DDOrderMoveScheduleCreateRequest request) {<NEW_LINE>final I_DD_Order_MoveSchedule record = <MASK><NEW_LINE>// record.setAD_Org_ID(ddOrderline.getAD_Org_ID());<NEW_LINE>record.setDD_Order_ID(request.getDdOrderId().getRepoId());<NEW_LINE>record.setDD_OrderLine_ID(request.getDdOrderLineId().getRepoId());<NEW_LINE>record.setStatus(DDOrderMoveScheduleStatus.NOT_STARTED.getCode());<NEW_LINE>record.setM_Product_ID(request.getProductId().getRepoId());<NEW_LINE>//<NEW_LINE>// Pick From<NEW_LINE>record.setPickFrom_Warehouse_ID(request.getPickFromLocatorId().getWarehouseId().getRepoId());<NEW_LINE>record.setPickFrom_Locator_ID(request.getPickFromLocatorId().getRepoId());<NEW_LINE>record.setPickFrom_HU_ID(request.getPickFromHUId().getRepoId());<NEW_LINE>record.setC_UOM_ID(request.getQtyToPick().getUomId().getRepoId());<NEW_LINE>record.setQtyToPick(request.getQtyToPick().toBigDecimal());<NEW_LINE>record.setQtyPicked(BigDecimal.ZERO);<NEW_LINE>record.setIsPickWholeHU(request.isPickWholeHU());<NEW_LINE>//<NEW_LINE>// Drop To<NEW_LINE>record.setDropTo_Warehouse_ID(request.getDropToLocatorId().getWarehouseId().getRepoId());<NEW_LINE>record.setDropTo_Locator_ID(request.getDropToLocatorId().getRepoId());<NEW_LINE>//<NEW_LINE>InterfaceWrapperHelper.save(record);<NEW_LINE>return toDDOrderMoveSchedule(record, ImmutableList.of());<NEW_LINE>} | InterfaceWrapperHelper.newInstance(I_DD_Order_MoveSchedule.class); |
1,842,101 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>// create a scene and add a basemap to it<NEW_LINE>ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);<NEW_LINE>// [DocRef: Name=Display Scene-android, Category=Work with 3D, Topic=Display a scene]<NEW_LINE>// create SceneView from layout<NEW_LINE>mSceneView = (SceneView) findViewById(R.id.sceneView);<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>// [DocRef: END]<NEW_LINE>// [DocRef: Name=Add elevation to base surface-android, Category=Work with 3D, Topic=Display a scene,<NEW_LINE>// RemoveChars=getResources().getString(R.string.elevation_image_service),<NEW_LINE>// ReplaceChars=http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer]<NEW_LINE>// create an elevation source, and add this to the base surface of the scene<NEW_LINE>ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource(getResources().getString(R.string.elevation_image_service));<NEW_LINE>scene.getBaseSurface().getElevationSources().add(elevationSource);<NEW_LINE>// [DocRef: END]<NEW_LINE>// add a camera and initial camera position<NEW_LINE>Camera camera = new Camera(28.4, 83.9, <MASK><NEW_LINE>mSceneView.setViewpointCamera(camera);<NEW_LINE>} | 10010.0, 10.0, 80.0, 0.0); |
488,123 | public void highlight(Region r_) {<NEW_LINE>// change due to oracle blog: https://blogs.oracle.com/thejavatutorials/entry/translucent_and_shaped_windows_in<NEW_LINE>if (!_isTransparentSupported) {<NEW_LINE>Debug.error("highlight transparent is not support on " + System.getProperty("os.name") + "!");<NEW_LINE>// use at least an not transparent color<NEW_LINE>_transparentColor = Color.pink;<NEW_LINE>}<NEW_LINE>_borderOnly = true;<NEW_LINE>Region r;<NEW_LINE><MASK><NEW_LINE>if (!_native_transparent) {<NEW_LINE>captureScreen(r.x, r.y, r.w, r.h);<NEW_LINE>}<NEW_LINE>setLocation(r.x, r.y);<NEW_LINE>setSize(r.w, r.h);<NEW_LINE>this.setBackground(_transparentColor);<NEW_LINE>setVisible(true);<NEW_LINE>requestFocus();<NEW_LINE>} | r = r_.grow(3); |
156,930 | public <T extends Throwable> RuntimeException sanitize(T error) {<NEW_LINE>if (error instanceof QueryException) {<NEW_LINE>return (QueryException) errorResponseTransformStrategy.transformIfNeeded((QueryException) error);<NEW_LINE>}<NEW_LINE>if (error instanceof ForbiddenException) {<NEW_LINE>return (ForbiddenException) errorResponseTransformStrategy.transformIfNeeded((ForbiddenException) error);<NEW_LINE>}<NEW_LINE>if (error instanceof ISE) {<NEW_LINE>return (ISE) errorResponseTransformStrategy.transformIfNeeded((ISE) error);<NEW_LINE>}<NEW_LINE>if (error instanceof UOE) {<NEW_LINE>return (UOE) errorResponseTransformStrategy.transformIfNeeded((UOE) error);<NEW_LINE>}<NEW_LINE>// catch any non explicit sanitizable exceptions<NEW_LINE>if (error instanceof SanitizableException) {<NEW_LINE>return new RuntimeException(errorResponseTransformStrategy.<MASK><NEW_LINE>}<NEW_LINE>// cannot check cause of the throwable because it cannot be cast back to the original's type<NEW_LINE>// so this only checks runtime exceptions for causes<NEW_LINE>if (error instanceof RuntimeException && error.getCause() instanceof SanitizableException) {<NEW_LINE>// could do `throw sanitize(error);` but just sanitizing immediatley avoids unnecessary going down multiple levels<NEW_LINE>return new RuntimeException(errorResponseTransformStrategy.transformIfNeeded((SanitizableException) error.getCause()));<NEW_LINE>}<NEW_LINE>QueryInterruptedException wrappedError = QueryInterruptedException.wrapIfNeeded(error);<NEW_LINE>return (QueryException) errorResponseTransformStrategy.transformIfNeeded(wrappedError);<NEW_LINE>} | transformIfNeeded((SanitizableException) error)); |
483,080 | public ContractVersion copy(Contract contract) {<NEW_LINE>ContractVersion newVersion = new ContractVersion();<NEW_LINE>ContractVersion currentVersion = contract.getCurrentContractVersion();<NEW_LINE>newVersion.setStatusSelect(ContractVersionRepository.DRAFT_VERSION);<NEW_LINE>newVersion.setNextContract(contract);<NEW_LINE>newVersion.setPaymentMode(currentVersion.getPaymentMode());<NEW_LINE>newVersion.setPaymentCondition(currentVersion.getPaymentCondition());<NEW_LINE>newVersion.setInvoicingDuration(currentVersion.getInvoicingDuration());<NEW_LINE>newVersion.setInvoicingMomentSelect(currentVersion.getInvoicingMomentSelect());<NEW_LINE>newVersion.setIsPeriodicInvoicing(currentVersion.getIsPeriodicInvoicing());<NEW_LINE>newVersion.<MASK><NEW_LINE>newVersion.setIsProratedInvoice(currentVersion.getIsProratedInvoice());<NEW_LINE>newVersion.setIsProratedFirstInvoice(currentVersion.getIsProratedFirstInvoice());<NEW_LINE>newVersion.setIsProratedLastInvoice(currentVersion.getIsProratedLastInvoice());<NEW_LINE>newVersion.setDescription(currentVersion.getDescription());<NEW_LINE>newVersion.setIsTacitRenewal(currentVersion.getIsTacitRenewal());<NEW_LINE>newVersion.setRenewalDuration(currentVersion.getRenewalDuration());<NEW_LINE>newVersion.setIsAutoEnableVersionOnRenew(currentVersion.getIsAutoEnableVersionOnRenew());<NEW_LINE>newVersion.setIsWithEngagement(currentVersion.getIsWithEngagement());<NEW_LINE>newVersion.setEngagementDuration(currentVersion.getEngagementDuration());<NEW_LINE>newVersion.setIsWithPriorNotice(currentVersion.getIsWithPriorNotice());<NEW_LINE>newVersion.setPriorNoticeDuration(currentVersion.getPriorNoticeDuration());<NEW_LINE>newVersion.setEngagementStartFromVersion(currentVersion.getEngagementStartFromVersion());<NEW_LINE>newVersion.setDoNotRenew(currentVersion.getDoNotRenew());<NEW_LINE>ContractLineRepository repository = Beans.get(ContractLineRepository.class);<NEW_LINE>List<ContractLine> lines = ModelTool.copy(repository, currentVersion.getContractLineList(), false);<NEW_LINE>newVersion.setContractLineList(lines);<NEW_LINE>newVersion.setIsTimeProratedInvoice(currentVersion.getIsTimeProratedInvoice());<NEW_LINE>newVersion.setIsVersionProratedInvoice(currentVersion.getIsVersionProratedInvoice());<NEW_LINE>newVersion.setIsConsumptionBeforeEndDate(currentVersion.getIsConsumptionBeforeEndDate());<NEW_LINE>newVersion.setIsConsumptionManagement(currentVersion.getIsConsumptionManagement());<NEW_LINE>return newVersion;<NEW_LINE>} | setAutomaticInvoicing(currentVersion.getAutomaticInvoicing()); |
733,152 | public BatchPartResponse createBatchPartResponse(BatchPart batchPart, RestUrlBuilder urlBuilder) {<NEW_LINE>BatchPartResponse response = new BatchPartResponse();<NEW_LINE>response.setId(batchPart.getId());<NEW_LINE>response.setBatchId(batchPart.getBatchId());<NEW_LINE>response.setBatchType(batchPart.getBatchType());<NEW_LINE>response.setSearchKey(batchPart.getBatchSearchKey());<NEW_LINE>response.<MASK><NEW_LINE>response.setScopeId(batchPart.getScopeId());<NEW_LINE>response.setSubScopeId(batchPart.getSubScopeId());<NEW_LINE>response.setScopeType(batchPart.getScopeType());<NEW_LINE>response.setCreateTime(batchPart.getCreateTime());<NEW_LINE>response.setCompleteTime(batchPart.getCompleteTime());<NEW_LINE>response.setStatus(batchPart.getStatus());<NEW_LINE>response.setTenantId(batchPart.getTenantId());<NEW_LINE>response.setUrl(urlBuilder.buildUrl(RestUrls.URL_BATCH_PART, batchPart.getId()));<NEW_LINE>response.setBatchUrl(urlBuilder.buildUrl(RestUrls.URL_BATCH, batchPart.getBatchId()));<NEW_LINE>return response;<NEW_LINE>} | setSearchKey2(batchPart.getBatchSearchKey2()); |
106,678 | ColumnDefinition decodeColumnDefinitionPacketPayload(ByteBuf payload) {<NEW_LINE>String catalog = BufferUtils.readLengthEncodedString(payload, StandardCharsets.UTF_8);<NEW_LINE>String schema = BufferUtils.readLengthEncodedString(payload, StandardCharsets.UTF_8);<NEW_LINE>String table = BufferUtils.readLengthEncodedString(payload, StandardCharsets.UTF_8);<NEW_LINE>String orgTable = BufferUtils.readLengthEncodedString(payload, StandardCharsets.UTF_8);<NEW_LINE>String name = BufferUtils.readLengthEncodedString(payload, StandardCharsets.UTF_8);<NEW_LINE>String orgName = BufferUtils.readLengthEncodedString(payload, StandardCharsets.UTF_8);<NEW_LINE>long <MASK><NEW_LINE>int characterSet = payload.readUnsignedShortLE();<NEW_LINE>long columnLength = payload.readUnsignedIntLE();<NEW_LINE>DataType type = DataType.valueOf(payload.readUnsignedByte());<NEW_LINE>int flags = payload.readUnsignedShortLE();<NEW_LINE>byte decimals = payload.readByte();<NEW_LINE>return new ColumnDefinition(catalog, schema, table, orgTable, name, orgName, characterSet, columnLength, type, flags, decimals);<NEW_LINE>} | lengthOfFixedLengthFields = BufferUtils.readLengthEncodedInteger(payload); |
1,356,039 | private Mono<Response<MetricAlertStatusCollectionInner>> listByNameWithResponseAsync(String resourceGroupName, String ruleName, String statusName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (ruleName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (statusName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter statusName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-03-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByName(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ruleName, statusName, apiVersion, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); |
88,925 | final ListMembersResult executeListMembers(ListMembersRequest listMembersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listMembersRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListMembersRequest> request = null;<NEW_LINE>Response<ListMembersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listMembersRequest));<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, "Detective");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListMembers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListMembersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListMembersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.