idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
363,365 | private void sortIntoLists(Map<String, CtClass> oldClassesMap, Map<String, CtClass> newClassesMap) {<NEW_LINE>for (CtClass oldCtClass : oldClassesMap.values()) {<NEW_LINE>CtClass newCtClass = newClassesMap.get(oldCtClass.getName());<NEW_LINE>if (newCtClass == null) {<NEW_LINE>JApiClassType classType = new JApiClassType(Optional.of(ClassHelper.getType(oldCtClass)), Optional.<JApiClassType.ClassType>absent(), JApiChangeStatus.REMOVED);<NEW_LINE>JApiClass jApiClass = new JApiClass(this.jarArchiveComparator, oldCtClass.getName(), Optional.of(oldCtClass), Optional.<CtClass>absent(), JApiChangeStatus.REMOVED, classType);<NEW_LINE>if (includeClass(jApiClass)) {<NEW_LINE>classes.add(jApiClass);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>JApiChangeStatus changeStatus = JApiChangeStatus.UNCHANGED;<NEW_LINE>JApiClassType.ClassType <MASK><NEW_LINE>JApiClassType.ClassType newType = ClassHelper.getType(newCtClass);<NEW_LINE>if (oldType != newType) {<NEW_LINE>changeStatus = JApiChangeStatus.MODIFIED;<NEW_LINE>}<NEW_LINE>JApiClassType classType = new JApiClassType(Optional.of(oldType), Optional.of(newType), changeStatus);<NEW_LINE>JApiClass jApiClass = new JApiClass(this.jarArchiveComparator, oldCtClass.getName(), Optional.of(oldCtClass), Optional.of(newCtClass), changeStatus, classType);<NEW_LINE>if (includeClass(jApiClass)) {<NEW_LINE>classes.add(jApiClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (CtClass newCtClass : newClassesMap.values()) {<NEW_LINE>CtClass oldCtClass = oldClassesMap.get(newCtClass.getName());<NEW_LINE>if (oldCtClass == null) {<NEW_LINE>JApiClassType.ClassType newType = ClassHelper.getType(newCtClass);<NEW_LINE>JApiClassType classType = new JApiClassType(Optional.<JApiClassType.ClassType>absent(), Optional.of(newType), JApiChangeStatus.NEW);<NEW_LINE>JApiClass jApiClass = new JApiClass(this.jarArchiveComparator, newCtClass.getName(), Optional.<CtClass>absent(), Optional.of(newCtClass), JApiChangeStatus.NEW, classType);<NEW_LINE>if (includeClass(jApiClass)) {<NEW_LINE>classes.add(jApiClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | oldType = ClassHelper.getType(oldCtClass); |
273,414 | private void prepareForUpdating() {<NEW_LINE>W_deltas = new ArrayList<Matrix>(layersActivation.size());<NEW_LINE>W_updaters = new ArrayList<List<GradientUpdater>>(layersActivation.size());<NEW_LINE>B_deltas = new ArrayList<Vec>(layersActivation.size());<NEW_LINE>B_updaters = new ArrayList<GradientUpdater>(layersActivation.size());<NEW_LINE>for (int l = 1; l < layerSizes.length; l++) {<NEW_LINE>W_deltas.add(new DenseMatrix(layerSizes[l], layerSizes[l - 1]));<NEW_LINE>B_deltas.add(new DenseVector(layerSizes[l]));<NEW_LINE>// updaters<NEW_LINE>List<GradientUpdater> W_updaters_l = new ArrayList<GradientUpdater>(layerSizes[l]);<NEW_LINE>for (int i = 0; i < layerSizes[l]; i++) {<NEW_LINE>GradientUpdater W_updater = updater.clone();<NEW_LINE>W_updater.setup(layerSizes[l - 1]);<NEW_LINE>W_updaters_l.add(W_updater);<NEW_LINE>}<NEW_LINE>W_updaters.add(W_updaters_l);<NEW_LINE>B_updaters.add(updater.clone());<NEW_LINE>B_updaters.get(B_updaters.size() - 1).setup(layerSizes[l]);<NEW_LINE>}<NEW_LINE>activations = new Matrix[layersActivation.size()];<NEW_LINE>unactivated = new Matrix[layersActivation.size()];<NEW_LINE>deltas = new <MASK><NEW_LINE>} | Matrix[layersActivation.size()]; |
1,229,266 | public String generatePreview(BibEntry originalEntry, BibDatabaseContext databaseContext) {<NEW_LINE>if (error != null) {<NEW_LINE>return error;<NEW_LINE>}<NEW_LINE>// ensure that the entry is of BibTeX format (and do not modify the original entry)<NEW_LINE>BibEntry entry = (BibEntry) originalEntry.clone();<NEW_LINE>new ConvertToBibtexCleanup().cleanup(entry);<NEW_LINE>String result = vm.run(List.of(entry));<NEW_LINE>// Remove all comments<NEW_LINE>result = result.replaceAll("%.*", "");<NEW_LINE>// Remove all LaTeX comments<NEW_LINE>// The RemoveLatexCommandsFormatter keeps the words inside latex environments. Therefore, we remove them manually<NEW_LINE>result = result.replace("\\begin{thebibliography}{1}", "");<NEW_LINE>result = result.replace("\\end{thebibliography}", "");<NEW_LINE>// The RemoveLatexCommandsFormatter keeps the word inside the latex command, but we want to remove that completely<NEW_LINE>result = result.replaceAll("\\\\bibitem[{].*[}]", "");<NEW_LINE>// We want to replace \newblock by a space instead of completely removing it<NEW_LINE>result = result.replace("\\newblock", " ");<NEW_LINE>// remove all latex commands statements - assumption: command in a separate line<NEW_LINE>result = result.replaceAll("(?m)^\\\\.*$", "");<NEW_LINE>// remove some IEEEtran.bst output (resulting from a multiline \providecommand)<NEW_LINE>result = result.replace("#2}}", "");<NEW_LINE>// Have quotes right - and more<NEW_LINE>result = new LatexToUnicodeFormatter().format(result);<NEW_LINE>result = result.replace("``", "\"");<NEW_LINE>result = result.replace("''", "\"");<NEW_LINE>// Final cleanup<NEW_LINE>result = new RemoveNewlinesFormatter().format(result);<NEW_LINE>result = new RemoveLatexCommandsFormatter().format(result);<NEW_LINE>result = new RemoveTilde().format(result);<NEW_LINE>result = result.trim(<MASK><NEW_LINE>return result;<NEW_LINE>} | ).replaceAll(" +", " "); |
1,150,581 | public static AssignRolesToUserResponse unmarshall(AssignRolesToUserResponse assignRolesToUserResponse, UnmarshallerContext context) {<NEW_LINE>assignRolesToUserResponse.setRequestId(context.stringValue("AssignRolesToUserResponse.RequestId"));<NEW_LINE>assignRolesToUserResponse.setSuccess(context.booleanValue("AssignRolesToUserResponse.Success"));<NEW_LINE>assignRolesToUserResponse.setCode(context.stringValue("AssignRolesToUserResponse.Code"));<NEW_LINE>assignRolesToUserResponse.setMessage(context.stringValue("AssignRolesToUserResponse.Message"));<NEW_LINE>assignRolesToUserResponse.setHttpStatusCode(context.integerValue("AssignRolesToUserResponse.HttpStatusCode"));<NEW_LINE>User user = new User();<NEW_LINE>user.setUserId(context.stringValue("AssignRolesToUserResponse.User.UserId"));<NEW_LINE>user.setRamId(context.stringValue("AssignRolesToUserResponse.User.RamId"));<NEW_LINE>user.setInstanceId(context.stringValue("AssignRolesToUserResponse.User.InstanceId"));<NEW_LINE>Detail detail = new Detail();<NEW_LINE>detail.setLoginName(context.stringValue("AssignRolesToUserResponse.User.Detail.LoginName"));<NEW_LINE>detail.setDisplayName(context.stringValue("AssignRolesToUserResponse.User.Detail.DisplayName"));<NEW_LINE>detail.setPhone(context.stringValue("AssignRolesToUserResponse.User.Detail.Phone"));<NEW_LINE>detail.setEmail(context.stringValue("AssignRolesToUserResponse.User.Detail.Email"));<NEW_LINE>detail.setDepartment(context.stringValue("AssignRolesToUserResponse.User.Detail.Department"));<NEW_LINE>user.setDetail(detail);<NEW_LINE>List<Role> roles = new ArrayList<Role>();<NEW_LINE>for (int i = 0; i < context.lengthValue("AssignRolesToUserResponse.User.Roles.Length"); i++) {<NEW_LINE>Role role = new Role();<NEW_LINE>role.setRoleId(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].RoleId"));<NEW_LINE>role.setInstanceId(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].InstanceId"));<NEW_LINE>role.setRoleName(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].RoleName"));<NEW_LINE>role.setRoleDescription(context.stringValue("AssignRolesToUserResponse.User.Roles[" + i + "].RoleDescription"));<NEW_LINE>roles.add(role);<NEW_LINE>}<NEW_LINE>user.setRoles(roles);<NEW_LINE>List<SkillLevel> skillLevels = new ArrayList<SkillLevel>();<NEW_LINE>for (int i = 0; i < context.lengthValue("AssignRolesToUserResponse.User.SkillLevels.Length"); i++) {<NEW_LINE>SkillLevel skillLevel = new SkillLevel();<NEW_LINE>skillLevel.setSkillLevelId(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].SkillLevelId"));<NEW_LINE>skillLevel.setLevel(context.integerValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Level"));<NEW_LINE>Skill skill = new Skill();<NEW_LINE>skill.setSkillGroupId(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.SkillGroupId"));<NEW_LINE>skill.setInstanceId(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.InstanceId"));<NEW_LINE>skill.setSkillGroupName(context.stringValue("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.SkillGroupName"));<NEW_LINE>skill.setSkillGroupDescription(context.stringValue<MASK><NEW_LINE>skillLevel.setSkill(skill);<NEW_LINE>skillLevels.add(skillLevel);<NEW_LINE>}<NEW_LINE>user.setSkillLevels(skillLevels);<NEW_LINE>assignRolesToUserResponse.setUser(user);<NEW_LINE>return assignRolesToUserResponse;<NEW_LINE>} | ("AssignRolesToUserResponse.User.SkillLevels[" + i + "].Skill.SkillGroupDescription")); |
1,203,204 | public double configureProcSip(PowerProfile powerProfile, long procJiffies) {<NEW_LINE>if (!powerProfile.isSupported()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>long jiffySum = 0;<NEW_LINE>for (ListEntry<DigitEntry<Long>> stepJiffies : procCpuCoreStates) {<NEW_LINE>for (DigitEntry<Long> item : stepJiffies.getList()) {<NEW_LINE>jiffySum += item.get();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double sipSum = 0;<NEW_LINE>for (int i = 0; i < procCpuCoreStates.size(); i++) {<NEW_LINE>List<DigitEntry<Long>> stepJiffies = procCpuCoreStates.get(i).getList();<NEW_LINE>for (int j = 0; j < stepJiffies.size(); j++) {<NEW_LINE>long jiffy = stepJiffies.get(j).get();<NEW_LINE>double figuredJiffies = ((<MASK><NEW_LINE>double power = powerProfile.getAveragePowerForCpuCore(i, j);<NEW_LINE>double sip = power * (figuredJiffies * JIFFY_MILLIS / ONE_HOR);<NEW_LINE>sipSum += sip;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sipSum;<NEW_LINE>} | double) jiffy / jiffySum) * procJiffies; |
779,319 | public Float implicitCast(Object value) throws IllegalArgumentException, ClassCastException {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>} else if (value instanceof Float) {<NEW_LINE>return (Float) value;<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>return Float.parseFloat((String) value);<NEW_LINE>} else if (value instanceof BigDecimal) {<NEW_LINE>var bigDecimalValue = (BigDecimal) value;<NEW_LINE>var MAX = BigDecimal.valueOf(Float.MAX_VALUE).toBigInteger();<NEW_LINE>var MIN = BigDecimal.valueOf(-Float.MAX_VALUE).toBigInteger();<NEW_LINE>if (MAX.compareTo(bigDecimalValue.toBigInteger()) <= 0 || MIN.compareTo(bigDecimalValue.toBigInteger()) >= 0) {<NEW_LINE>throw new IllegalArgumentException("float value out of range: " + value);<NEW_LINE>}<NEW_LINE>return bigDecimalValue.floatValue();<NEW_LINE>} else if (value instanceof Number) {<NEW_LINE>Number number = (Number) value;<NEW_LINE>float val = number.floatValue();<NEW_LINE>if (Float.isInfinite(val) && !Double.isInfinite(number.doubleValue())) {<NEW_LINE>throw new IllegalArgumentException("float value out of range: " + value);<NEW_LINE>}<NEW_LINE>return val;<NEW_LINE>} else {<NEW_LINE>throw new ClassCastException("Can't cast '" + <MASK><NEW_LINE>}<NEW_LINE>} | value + "' to " + getName()); |
815,274 | public static ListAssistHistoryDetailsResponse unmarshall(ListAssistHistoryDetailsResponse listAssistHistoryDetailsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAssistHistoryDetailsResponse.setRequestId(_ctx.stringValue("ListAssistHistoryDetailsResponse.RequestId"));<NEW_LINE>List<ActionsItem> actions = new ArrayList<ActionsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAssistHistoryDetailsResponse.Actions.Length"); i++) {<NEW_LINE>ActionsItem actionsItem = new ActionsItem();<NEW_LINE>actionsItem.setAssistId(_ctx.stringValue("ListAssistHistoryDetailsResponse.Actions[" + i + "].AssistId"));<NEW_LINE>actionsItem.setAction(_ctx.stringValue("ListAssistHistoryDetailsResponse.Actions[" + i + "].Action"));<NEW_LINE>actionsItem.setTimestamp(_ctx.stringValue("ListAssistHistoryDetailsResponse.Actions[" + i + "].Timestamp"));<NEW_LINE>actionsItem.setCreatedAt(_ctx.longValue("ListAssistHistoryDetailsResponse.Actions[" + i + "].CreatedAt"));<NEW_LINE>actionsItem.setUpdatedAt(_ctx.longValue("ListAssistHistoryDetailsResponse.Actions[" + i + "].UpdatedAt"));<NEW_LINE>actionsItem.setID(_ctx.stringValue<MASK><NEW_LINE>actions.add(actionsItem);<NEW_LINE>}<NEW_LINE>listAssistHistoryDetailsResponse.setActions(actions);<NEW_LINE>return listAssistHistoryDetailsResponse;<NEW_LINE>} | ("ListAssistHistoryDetailsResponse.Actions[" + i + "].ID")); |
894,989 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String publicIpAddressName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (publicIpAddressName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter publicIpAddressName 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>final String apiVersion = "2018-11-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, publicIpAddressName, apiVersion, this.client.getSubscriptionId(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
290,483 | private Map<String, Action> initActionMap(GCModelLoaderController controller, GCViewerGui gui, Image icon) {<NEW_LINE>Map<String, Action> actions = new TreeMap<String, Action>();<NEW_LINE>actions.put(ActionCommands.EXIT.toString(), new Exit(gui));<NEW_LINE>actions.put(ActionCommands.ABOUT.toString(), new About(gui));<NEW_LINE>actions.put(ActionCommands.SHOW_README.toString(), new ReadmeAction(gui));<NEW_LINE>actions.put(ActionCommands.SHOW_LICENSE.toString(), new LicenseAction(gui));<NEW_LINE>actions.put(ActionCommands.OPEN_FILE.toString(), new OpenFile(controller, gui));<NEW_LINE>actions.put(ActionCommands.OPEN_SERIES.toString(), new OpenSeries(controller, gui));<NEW_LINE>actions.put(ActionCommands.OPEN_URL.toString(), <MASK><NEW_LINE>actions.put(ActionCommands.REFRESH.toString(), new Refresh(controller, gui));<NEW_LINE>actions.put(ActionCommands.EXPORT.toString(), new Export(gui));<NEW_LINE>actions.put(ActionCommands.ZOOM.toString(), new Zoom(gui));<NEW_LINE>actions.put(ActionCommands.ARRANGE.toString(), new Arrange(gui));<NEW_LINE>actions.put(ActionCommands.WATCH.toString(), new Watch(controller, gui));<NEW_LINE>if (OSXSupport.isOSX()) {<NEW_LINE>OSXSupport.initializeMacOSX(actions.get(ActionCommands.ABOUT.toString()), actions.get(ActionCommands.EXIT.toString()), null, icon, gui);<NEW_LINE>if (OSXSupport.hasOSXFullScreenSupport()) {<NEW_LINE>actions.put(ActionCommands.OSX_FULLSCREEN.toString(), new OSXFullScreen(gui));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return actions;<NEW_LINE>} | new OpenURL(controller, gui)); |
1,132,748 | private void build(@Nonnull final Iterator<int[]> changedLines) {<NEW_LINE>int[] starts = new int[myCount];<NEW_LINE>int[] ends = new int[myCount];<NEW_LINE>int[] last = new int[myCount];<NEW_LINE>for (int i = 0; i < myCount; i++) {<NEW_LINE>last[i] = Integer.MIN_VALUE;<NEW_LINE>}<NEW_LINE>while (changedLines.hasNext()) {<NEW_LINE>int[] offsets = changedLines.next();<NEW_LINE>for (int i = 0; i < myCount; i++) {<NEW_LINE>starts[i] = last[i];<NEW_LINE>ends[i] = offsets[i * 2];<NEW_LINE>last[i] = offsets[i * 2 + 1];<NEW_LINE>}<NEW_LINE>addRange(starts, ends);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < myCount; i++) {<NEW_LINE>starts[i] = last[i];<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>addRange(starts, ends);<NEW_LINE>} | ends[i] = Integer.MAX_VALUE; |
1,697,806 | public Graph<EntityDescriptor> resolveNativeEntity(EntityDescriptor entityDescriptor) {<NEW_LINE>final MutableGraph<EntityDescriptor> mutableGraph = GraphBuilder<MASK><NEW_LINE>mutableGraph.addNode(entityDescriptor);<NEW_LINE>final ModelId modelId = entityDescriptor.id();<NEW_LINE>try {<NEW_LINE>final GrokPattern grokPattern = grokPatternService.load(modelId.id());<NEW_LINE>final String namedPattern = grokPattern.pattern();<NEW_LINE>final Set<String> patterns = GrokPatternService.extractPatternNames(namedPattern);<NEW_LINE>patterns.stream().forEach(patternName -> {<NEW_LINE>grokPatternService.loadByName(patternName).ifPresent(depPattern -> {<NEW_LINE>final EntityDescriptor depEntityDescriptor = EntityDescriptor.create(depPattern.id(), ModelTypes.GROK_PATTERN_V1);<NEW_LINE>mutableGraph.putEdge(entityDescriptor, depEntityDescriptor);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>LOG.debug("Couldn't find grok pattern {}", entityDescriptor, e);<NEW_LINE>}<NEW_LINE>return mutableGraph;<NEW_LINE>} | .directed().build(); |
1,728,145 | final GetEmailIdentityResult executeGetEmailIdentity(GetEmailIdentityRequest getEmailIdentityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEmailIdentityRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEmailIdentityRequest> request = null;<NEW_LINE>Response<GetEmailIdentityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEmailIdentityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEmailIdentityRequest));<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, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEmailIdentity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEmailIdentityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEmailIdentityResultJsonUnmarshaller());<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(); |
785,304 | public okhttp3.Call applicationsApplicationIdKeysKeyTypePutCall(String applicationId, String keyType, ApplicationKeyDTO applicationKeyDTO, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = applicationKeyDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/applications/{applicationId}/keys/{keyType}".replaceAll("\\{" + "applicationId" + "\\}", localVarApiClient.escapeString(applicationId.toString())).replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames <MASK><NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | = new String[] { "OAuth2Security" }; |
148,883 | public ListSecurityProfilesForTargetResult listSecurityProfilesForTarget(ListSecurityProfilesForTargetRequest listSecurityProfilesForTargetRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSecurityProfilesForTargetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListSecurityProfilesForTargetRequest> request = null;<NEW_LINE>Response<ListSecurityProfilesForTargetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSecurityProfilesForTargetRequestMarshaller().marshall(listSecurityProfilesForTargetRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListSecurityProfilesForTargetResult, JsonUnmarshallerContext> unmarshaller = new ListSecurityProfilesForTargetResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListSecurityProfilesForTargetResult> responseHandler = new JsonResponseHandler<ListSecurityProfilesForTargetResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>} | awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
1,368,161 | public static void main(String[] args) {<NEW_LINE>final ConfigBuilder configBuilder = new ConfigBuilder();<NEW_LINE>if (args.length > 0) {<NEW_LINE>configBuilder.withMasterUrl(args[0]);<NEW_LINE>}<NEW_LINE>try (KubernetesClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build()) {<NEW_LINE>String namespace = NAMESPACE;<NEW_LINE>if (args.length > 2) {<NEW_LINE>namespace = args[2];<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Creating namespace<NEW_LINE>Namespace ns = new NamespaceBuilder().withNewMetadata().withName(namespace).addToLabels("hello", "world").endMetadata().build();<NEW_LINE>logger.info("Created namespace: {}", client.namespaces().create(ns).getMetadata().getName());<NEW_LINE>// Get namespace by name<NEW_LINE>logger.info("Get namespace by name: {}", client.namespaces().withName<MASK><NEW_LINE>// Get namespace by label<NEW_LINE>logger.info("Get namespace by label:");<NEW_LINE>client.namespaces().withLabel("hello", "world").list().getItems().forEach(n -> logger.info(" - {}", n.getMetadata().getName()));<NEW_LINE>final ResourceQuota quota = client.resourceQuotas().inNamespace(namespace).createOrReplace(new ResourceQuotaBuilder().withNewMetadata().withName("quota-example").endMetadata().withNewSpec().addToHard("pods", new Quantity("5")).endSpec().build());<NEW_LINE>logger.info("Create resource quota: {}", quota.getMetadata().getName());<NEW_LINE>logger.info("Listing jobs in namespace");<NEW_LINE>client.batch().v1().jobs().inNamespace(namespace).list().getItems().forEach(j -> logger.info(" - {}", j.getMetadata().getName()));<NEW_LINE>} finally {<NEW_LINE>// Delete namespace<NEW_LINE>client.namespaces().withName(namespace).delete();<NEW_LINE>logger.info("Deleted namespace: {}", namespace);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>Throwable[] suppressed = e.getSuppressed();<NEW_LINE>if (suppressed != null) {<NEW_LINE>for (Throwable t : suppressed) {<NEW_LINE>logger.error(t.getMessage(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (namespace).get()); |
1,586,122 | public void invokeAsync(String addr, RemotingCommand request, long timeoutMillis, InvokeCallback invokeCallback) throws InterruptedException, RemotingConnectException, RemotingTooMuchRequestException, RemotingTimeoutException, RemotingSendRequestException {<NEW_LINE>long beginStartTime = System.currentTimeMillis();<NEW_LINE>final Channel channel = this.getAndCreateChannel(addr);<NEW_LINE>if (channel != null && channel.isActive()) {<NEW_LINE>try {<NEW_LINE>doBeforeRpcHooks(addr, request);<NEW_LINE>long costTime <MASK><NEW_LINE>if (timeoutMillis < costTime) {<NEW_LINE>throw new RemotingTooMuchRequestException("invokeAsync call the addr[" + addr + "] timeout");<NEW_LINE>}<NEW_LINE>this.invokeAsyncImpl(channel, request, timeoutMillis - costTime, invokeCallback);<NEW_LINE>} catch (RemotingSendRequestException e) {<NEW_LINE>log.warn("invokeAsync: send request exception, so close the channel[{}]", addr);<NEW_LINE>this.closeChannel(addr, channel);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.closeChannel(addr, channel);<NEW_LINE>throw new RemotingConnectException(addr);<NEW_LINE>}<NEW_LINE>} | = System.currentTimeMillis() - beginStartTime; |
508,895 | private static MultiHandlerEnhancerDefinition findDelegates(ClassLoader classLoader) {<NEW_LINE>Iterator<HandlerEnhancerDefinition> iterator = load(HandlerEnhancerDefinition.class, classLoader == null ? Thread.currentThread().getContextClassLoader() : classLoader).iterator();<NEW_LINE>// noinspection WhileLoopReplaceableByForEach<NEW_LINE>final List<HandlerEnhancerDefinition> enhancers = new ArrayList<>();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>try {<NEW_LINE>HandlerEnhancerDefinition factory = iterator.next();<NEW_LINE>enhancers.add(factory);<NEW_LINE>} catch (ServiceConfigurationError e) {<NEW_LINE>LOGGER.info("HandlerEnhancerDefinition instance ignored, as one of the required classes is not available" + "on the classpath: {}", e.getMessage());<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>LOGGER.info(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MultiHandlerEnhancerDefinition(enhancers);<NEW_LINE>} | "HandlerEnhancerDefinition instance ignored. It relies on a class that cannot be found: {}", e.getMessage()); |
842,241 | private static void addToBuilder(Zone zone, DateTimeZoneBuilder builder, Map<String, RuleSet> ruleSets) {<NEW_LINE>for (; zone != null; zone = zone.iNext) {<NEW_LINE>builder.setStandardOffset(zone.iOffsetMillis);<NEW_LINE>if (zone.iRules == null) {<NEW_LINE>builder.<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>// Check if iRules actually just refers to a savings.<NEW_LINE>int saveMillis = parseTime(zone.iRules);<NEW_LINE>builder.setFixedSavings(zone.iFormat, saveMillis);<NEW_LINE>} catch (Exception e) {<NEW_LINE>RuleSet rs = ruleSets.get(zone.iRules);<NEW_LINE>if (rs == null) {<NEW_LINE>throw new IllegalArgumentException("Rules not found: " + zone.iRules);<NEW_LINE>}<NEW_LINE>rs.addRecurring(builder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (zone.iUntilYear == Integer.MAX_VALUE) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>zone.iUntilDateTimeOfYear.addCutover(builder, zone.iUntilYear);<NEW_LINE>}<NEW_LINE>} | setFixedSavings(zone.iFormat, 0); |
1,205,371 | public GetSchemaAsJsonResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetSchemaAsJsonResult getSchemaAsJsonResult = new GetSchemaAsJsonResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getSchemaAsJsonResult;<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("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getSchemaAsJsonResult.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Document", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getSchemaAsJsonResult.setDocument(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getSchemaAsJsonResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,550,549 | public static void main(String[] args) throws Exception {<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>AudioInputStream inputAudio = AudioSystem.getAudioInputStream(new <MASK><NEW_LINE>int samplingRate = (int) inputAudio.getFormat().getSampleRate();<NEW_LINE>AudioDoubleDataSource signal = new AudioDoubleDataSource(inputAudio);<NEW_LINE>int frameLength = Integer.getInteger("signalproc.lpcanalysissynthesis.framelength", 512).intValue();<NEW_LINE>int predictionOrder = Integer.getInteger("signalproc.lpcanalysissynthesis.predictionorder", 20).intValue();<NEW_LINE>FrameOverlapAddSource foas = new FrameOverlapAddSource(signal, Window.HANNING, true, frameLength, samplingRate, new LPCAnalysisResynthesis(predictionOrder));<NEW_LINE>DDSAudioInputStream outputAudio = new DDSAudioInputStream(new BufferedDoubleDataSource(foas), inputAudio.getFormat());<NEW_LINE>String outFileName = args[i].substring(0, args[i].length() - 4) + "_lpc_ar.wav";<NEW_LINE>AudioSystem.write(outputAudio, AudioFileFormat.Type.WAVE, new File(outFileName));<NEW_LINE>}<NEW_LINE>} | File(args[i])); |
600,376 | public void benchmarkCglib(Blackhole blackHole) {<NEW_LINE>blackHole.consume(cglibInstance.method(booleanValue));<NEW_LINE>blackHole.consume(cglibInstance.method(byteValue));<NEW_LINE>blackHole.consume(cglibInstance.method(shortValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(charValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(longValue));<NEW_LINE>blackHole.consume(cglibInstance.method(floatValue));<NEW_LINE>blackHole.consume(cglibInstance.method(doubleValue));<NEW_LINE>blackHole.consume(cglibInstance.method(stringValue));<NEW_LINE>blackHole.consume(cglibInstance.method(booleanValue, booleanValue, booleanValue));<NEW_LINE>blackHole.consume(cglibInstance.method(byteValue, byteValue, byteValue));<NEW_LINE>blackHole.consume(cglibInstance.method(shortValue, shortValue, shortValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(charValue, charValue, charValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(longValue, longValue, longValue));<NEW_LINE>blackHole.consume(cglibInstance.method<MASK><NEW_LINE>blackHole.consume(cglibInstance.method(doubleValue, doubleValue, doubleValue));<NEW_LINE>blackHole.consume(cglibInstance.method(stringValue, stringValue, stringValue));<NEW_LINE>} | (floatValue, floatValue, floatValue)); |
963,178 | public Description matchMethod(MethodTree tree, VisitorState state) {<NEW_LINE>if (!tree.getName().equals(PROCESS_NAME.get(state))) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>MethodSymbol sym = ASTHelpers.getSymbol(tree);<NEW_LINE>if (!ASTHelpers.isSameType(sym.getReturnType(), state.getSymtab().booleanType, state)) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>if (sym.getParameters().size() != 2) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>if (!Streams.zip(sym.getParameters().stream(), PARAMETER_TYPES.get(state).stream(), (p, t) -> ASTHelpers.isSameType(p.asType(), t, state)).allMatch(x -> x)) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>if (!sym.owner.enclClass().isSubClass(PROCESSOR_SYMBOL.get(state), state.getTypes())) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>List<ReturnTree> returns = new ArrayList<>();<NEW_LINE>new TreeScanner<Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitLambdaExpression(LambdaExpressionTree node, Void aVoid) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitClass(ClassTree node, Void aVoid) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitReturn(ReturnTree node, Void unused) {<NEW_LINE>if (!Objects.equals(ASTHelpers.constValue(node.getExpression(), Boolean.class), false)) {<NEW_LINE>returns.add(node);<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}.scan(tree.getBody(), null);<NEW_LINE>if (returns.isEmpty()) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>SuggestedFix.Builder fix = SuggestedFix.builder();<NEW_LINE>for (ReturnTree returnTree : returns) {<NEW_LINE>if (Objects.equals(ASTHelpers.constValue(returnTree.getExpression(), Boolean.class), true)) {<NEW_LINE>fix.replace(returnTree.getExpression(), "false");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return describeMatch(returns.get(0), fix.build());<NEW_LINE>} | super.visitReturn(node, null); |
1,073,446 | public ImageDataOp build(ImageData<BufferedImage> imageData, PixelCalibration resolution) {<NEW_LINE>if (selectedFeatures == null || selectedSigmas == null)<NEW_LINE>throw new IllegalArgumentException("Features and scales must be selected!");<NEW_LINE>// Extract features, removing any that are incompatible<NEW_LINE>MultiscaleFeature[] features;<NEW_LINE>// if (do3D.get())<NEW_LINE>// features = selectedFeatures.stream().filter(f -> f.supports3D()).toArray(MultiscaleFeature[]::new);<NEW_LINE>// else<NEW_LINE>features = selectedFeatures.stream().filter(f -> f.supports2D()).toArray(MultiscaleFeature[]::new);<NEW_LINE>double[] sigmas = selectedSigmas.stream().mapToDouble(d -> d).toArray();<NEW_LINE>// TODO: Make the variance scale ratio editable<NEW_LINE>double varianceScaleRatio = 1.0;<NEW_LINE>// TODO: Consider reinstating 3D<NEW_LINE>// SmoothingScale scale;<NEW_LINE>// scale = SmoothingScale.get3DIsotropic(localNormalizeSigma);<NEW_LINE>// scale = SmoothingScale.get2D(localNormalizeSigma);<NEW_LINE>List<ImageOp> <MASK><NEW_LINE>for (var sigma : sigmas) {<NEW_LINE>ops.add(ImageOps.Filters.features(Arrays.asList(features), sigma, sigma));<NEW_LINE>}<NEW_LINE>var op = ImageOps.Core.splitMerge(ops);<NEW_LINE>// Handle normalization if needed<NEW_LINE>double localNormalizeSigma = normalizationSigma.get();<NEW_LINE>ImageOp opNormalize = null;<NEW_LINE>if (localNormalizeSigma > 0) {<NEW_LINE>switch(normalization.get()) {<NEW_LINE>case GAUSSIAN_MEAN:<NEW_LINE>opNormalize = ImageOps.Normalize.localNormalization(localNormalizeSigma, 0);<NEW_LINE>break;<NEW_LINE>case GAUSSIAN_MEAN_VARIANCE:<NEW_LINE>opNormalize = ImageOps.Normalize.localNormalization(localNormalizeSigma, localNormalizeSigma * varianceScaleRatio);<NEW_LINE>break;<NEW_LINE>case NONE:<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (opNormalize != null)<NEW_LINE>op = ImageOps.Core.sequential(opNormalize, op);<NEW_LINE>// op = ImageOps.Core.sequential(op, opNormalize);<NEW_LINE>return ImageOps.buildImageDataOp(selectedChannels).appendOps(op);<NEW_LINE>} | ops = new ArrayList<>(); |
1,012,709 | private void drawCardinalDirections(Canvas canvas, QuadPoint center, float radiusLength, RotatedTileBox tileBox, RenderingLineAttributes attrs) {<NEW_LINE>float textMargin = <MASK><NEW_LINE>attrs.paint2.setTextAlign(Paint.Align.CENTER);<NEW_LINE>attrs.paint3.setTextAlign(Paint.Align.CENTER);<NEW_LINE>setAttrsPaintsTypeface(attrs, Typeface.DEFAULT_BOLD);<NEW_LINE>for (int i = 0; i < degrees.length; i += 9) {<NEW_LINE>String cardinalDirection = getCardinalDirection(i);<NEW_LINE>if (cardinalDirection != null) {<NEW_LINE>float textWidth = AndroidUtils.getTextWidth(attrs.paint2.getTextSize(), cardinalDirection);<NEW_LINE>canvas.save();<NEW_LINE>canvas.translate(center.x, center.y);<NEW_LINE>canvas.rotate(-i * 5 - 90);<NEW_LINE>canvas.translate(0, radiusLength - textMargin - textWidth / 2);<NEW_LINE>canvas.rotate(i * 5 - tileBox.getRotate() + 90);<NEW_LINE>canvas.drawText(cardinalDirection, 0, 0, attrs.paint3);<NEW_LINE>canvas.drawText(cardinalDirection, 0, 0, attrs.paint2);<NEW_LINE>canvas.restore();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>attrs.paint2.setTextAlign(Paint.Align.LEFT);<NEW_LINE>attrs.paint3.setTextAlign(Paint.Align.LEFT);<NEW_LINE>setAttrsPaintsTypeface(attrs, null);<NEW_LINE>} | AndroidUtils.dpToPx(app, 14); |
1,487,079 | public void load() {<NEW_LINE>ExUtil.asyncRun(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>MapPack out = null;<NEW_LINE>final List<HeapHistoData> datas = new ArrayList<HeapHistoData>();<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("objHash", objHash);<NEW_LINE>out = (MapPack) tcp.getSingle(RequestCmd.OBJECT_HEAPHISTO, param);<NEW_LINE>if (out == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String error = out.getText("error");<NEW_LINE>if (error != null) {<NEW_LINE>ConsoleProxy.errorSafe(error);<NEW_LINE>}<NEW_LINE>ListValue lv = out.getList("heaphisto");<NEW_LINE>if (lv == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < lv.size(); i++) {<NEW_LINE>HeapHistoData data = new HeapHistoData();<NEW_LINE>String[] tokens = StringUtil.tokenizer(lv.getString(i), " ");<NEW_LINE>if (tokens == null || tokens.length < 4) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String index = removeNotDigit(tokens[0]);<NEW_LINE>data.no = CastUtil.cint(index);<NEW_LINE>data.count = CastUtil.cint(tokens[1]);<NEW_LINE>data.size = CastUtil.clong(tokens[2]);<NEW_LINE>data.name <MASK><NEW_LINE>datas.add(data);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>ConsoleProxy.errorSafe(e.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>ExUtil.exec(viewer.getTable(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>viewer.setInput(datas);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = getCanonicalName(tokens[3]); |
1,228,168 | public void invoke(FunqyServerRequest request, FunqyServerResponse response) {<NEW_LINE>Object[] args = null;<NEW_LINE>if (parameterInjectors != null) {<NEW_LINE>args = new Object[parameterInjectors.size()];<NEW_LINE>int i = 0;<NEW_LINE>for (ValueInjector injector : parameterInjectors) {<NEW_LINE>args[i++] = injector.extract(request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object target = constructor.construct();<NEW_LINE>try {<NEW_LINE>Object result = <MASK><NEW_LINE>if (isAsync()) {<NEW_LINE>response.setOutput(((Uni<?>) result).onFailure().transform(t -> new ApplicationException(t)));<NEW_LINE>} else {<NEW_LINE>response.setOutput(Uni.createFrom().item(result));<NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>InternalError ex = new InternalError("Failed to invoke function", e);<NEW_LINE>response.setOutput(Uni.createFrom().failure(ex));<NEW_LINE>throw ex;<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>ApplicationException ex = new ApplicationException(e.getCause());<NEW_LINE>response.setOutput(Uni.createFrom().failure(ex));<NEW_LINE>throw ex;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>InternalError ex = new InternalError(t);<NEW_LINE>response.setOutput(Uni.createFrom().failure(ex));<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | method.invoke(target, args); |
907,332 | public static PyObject compile(PyObject source, String filename, CompileMode kind, CompilerFlags cflags, boolean dont_inherit) {<NEW_LINE>cflags = Py.getCompilerFlags(cflags, dont_inherit);<NEW_LINE>mod ast = py2node(source);<NEW_LINE>if (ast == null) {<NEW_LINE>if (!(source instanceof PyString)) {<NEW_LINE>throw Py.TypeError("expected a readable buffer object");<NEW_LINE>}<NEW_LINE>cflags.source_is_utf8 = source instanceof PyUnicode;<NEW_LINE>String data = source.toString();<NEW_LINE>if (data.contains("\0")) {<NEW_LINE>throw Py.TypeError("compile() expected string without null bytes");<NEW_LINE>}<NEW_LINE>if (cflags != null && cflags.dont_imply_dedent) {<NEW_LINE>data += "\n";<NEW_LINE>} else {<NEW_LINE>data += "\n\n";<NEW_LINE>}<NEW_LINE>ast = ParserFacade.parse(data, kind, filename, cflags);<NEW_LINE>}<NEW_LINE>if (cflags.only_ast) {<NEW_LINE>return Py.java2py(ast);<NEW_LINE>} else {<NEW_LINE>return Py.compile_flags(<MASK><NEW_LINE>}<NEW_LINE>} | ast, filename, kind, cflags); |
1,141,750 | private void convertToDomain(ItemGroup pmItem, List<RequestContainer> requests, List<Folder> folders, Folder curFolder) {<NEW_LINE>if (pmItem.getItem() != null) {<NEW_LINE>// it is a folder<NEW_LINE>Folder folder = new Folder(UUID.randomUUID().toString(), pmItem.getName(), new LinkedList<>(), new LinkedList<>());<NEW_LINE>folders.add(folder);<NEW_LINE>pmItem.getItem().forEach(itm -> convertToDomain(itm, requests, folder<MASK><NEW_LINE>} else {<NEW_LINE>// it is a request<NEW_LINE>RestRequestContainer request = new RestRequestContainer(pmItem.getName(), pmItem.getRequest().getUrl().getRaw(), pmItem.getRequest().getMethod().toString());<NEW_LINE>// TODO: this should happen automatically...<NEW_LINE>request.setId(UUID.randomUUID().toString());<NEW_LINE>request.setInStorage(true);<NEW_LINE>// adding headers<NEW_LINE>RestHeaderAspect headers = new RestHeaderAspect();<NEW_LINE>pmItem.getRequest().getHeader().forEach(h -> headers.getEntries().add(new HeaderEntry(UUID.randomUUID().toString(), h.getKey(), h.getValue(), true)));<NEW_LINE>request.addAspect(headers);<NEW_LINE>// adding bodies<NEW_LINE>RestBodyAspect body = new RestBodyAspect();<NEW_LINE>if (pmItem.getRequest().getBody() != null) {<NEW_LINE>body.setBody(pmItem.getRequest().getBody().getRaw());<NEW_LINE>}<NEW_LINE>request.addAspect(body);<NEW_LINE>requests.add(request);<NEW_LINE>if (curFolder != null)<NEW_LINE>curFolder.getRequests().add(request.getId());<NEW_LINE>}<NEW_LINE>} | .getFolders(), folder)); |
565,049 | public static GoConfigDao createTestingDao() {<NEW_LINE>SystemEnvironment systemEnvironment = new SystemEnvironment();<NEW_LINE>try {<NEW_LINE>MaintenanceModeService maintenanceModeService = new MaintenanceModeService(new TimeProvider(), systemEnvironment);<NEW_LINE>ServerHealthService serverHealthService = new ServerHealthService();<NEW_LINE>ConfigRepository configRepository = new ConfigRepository(systemEnvironment);<NEW_LINE>configRepository.initialize();<NEW_LINE>ConfigCache configCache = new ConfigCache();<NEW_LINE>ConfigElementImplementationRegistry configElementImplementationRegistry = ConfigElementImplementationRegistryMother.withNoPlugins();<NEW_LINE>CachedGoPartials cachedGoPartials = new CachedGoPartials(serverHealthService);<NEW_LINE>FullConfigSaveNormalFlow normalFlow = new FullConfigSaveNormalFlow(configCache, configElementImplementationRegistry, systemEnvironment, new TimeProvider(), configRepository, cachedGoPartials);<NEW_LINE>GoFileConfigDataSource dataSource = new GoFileConfigDataSource(new DoNotUpgrade(), configRepository, systemEnvironment, new TimeProvider(), configCache, configElementImplementationRegistry, cachedGoPartials, null, normalFlow, mock(PartialConfigHelper.class));<NEW_LINE>GoConfigMigration goConfigMigration = new GoConfigMigration(new TimeProvider(), configElementImplementationRegistry);<NEW_LINE>GoConfigMigrator goConfigMigrator = new GoConfigMigrator(goConfigMigration, new SystemEnvironment(), configCache, configElementImplementationRegistry, normalFlow, configRepository, serverHealthService);<NEW_LINE>FileUtils.writeStringToFile(dataSource.fileLocation(), ConfigFileFixture.configWithSecurity(""), UTF_8);<NEW_LINE>goConfigMigrator.migrate();<NEW_LINE>CachedGoConfig cachedConfigService = new CachedGoConfig(serverHealthService, <MASK><NEW_LINE>cachedConfigService.loadConfigIfNull();<NEW_LINE>return new GoConfigDao(cachedConfigService);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | dataSource, cachedGoPartials, null, maintenanceModeService); |
846,668 | public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {<NEW_LINE>cleanUpInferenceContexts();<NEW_LINE>if (!valueRequired)<NEW_LINE>currentScope.problemReporter().unusedObjectAllocation(this);<NEW_LINE>int pc = codeStream.position;<NEW_LINE>MethodBinding codegenBinding = this.binding.original();<NEW_LINE>ReferenceBinding allocatedType = codegenBinding.declaringClass;<NEW_LINE>codeStream.new_(this.type, allocatedType);<NEW_LINE>boolean isUnboxing = (this.implicitConversion & TypeIds.UNBOXING) != 0;<NEW_LINE>if (valueRequired || isUnboxing) {<NEW_LINE>codeStream.dup();<NEW_LINE>}<NEW_LINE>// better highlight for allocation: display the type individually<NEW_LINE>if (this.type != null) {<NEW_LINE>// null for enum constant body<NEW_LINE>codeStream.recordPositionsFrom(pc, this.type.sourceStart);<NEW_LINE>} else {<NEW_LINE>// push enum constant name and ordinal<NEW_LINE>codeStream.ldc(String.valueOf(this.enumConstant.name));<NEW_LINE>codeStream.generateInlinedValue(this.enumConstant.binding.id);<NEW_LINE>}<NEW_LINE>// handling innerclass instance allocation - enclosing instance arguments<NEW_LINE>if (allocatedType.isNestedType()) {<NEW_LINE>codeStream.generateSyntheticEnclosingInstanceValues(currentScope, allocatedType, enclosingInstance(), this);<NEW_LINE>}<NEW_LINE>// generate the arguments for constructor<NEW_LINE>generateArguments(this.binding, this.arguments, currentScope, codeStream);<NEW_LINE>// handling innerclass instance allocation - outer local arguments<NEW_LINE>if (allocatedType.isNestedType()) {<NEW_LINE>codeStream.<MASK><NEW_LINE>}<NEW_LINE>// invoke constructor<NEW_LINE>if (this.syntheticAccessor == null) {<NEW_LINE>codeStream.invoke(Opcodes.OPC_invokespecial, codegenBinding, null, /* default declaringClass */<NEW_LINE>this.typeArguments);<NEW_LINE>} else {<NEW_LINE>// synthetic accessor got some extra arguments appended to its signature, which need values<NEW_LINE>for (int i = 0, max = this.syntheticAccessor.parameters.length - codegenBinding.parameters.length; i < max; i++) {<NEW_LINE>codeStream.aconst_null();<NEW_LINE>}<NEW_LINE>codeStream.invoke(Opcodes.OPC_invokespecial, this.syntheticAccessor, null, /* default declaringClass */<NEW_LINE>this.typeArguments);<NEW_LINE>}<NEW_LINE>if (valueRequired) {<NEW_LINE>codeStream.generateImplicitConversion(this.implicitConversion);<NEW_LINE>} else if (isUnboxing) {<NEW_LINE>// conversion only generated if unboxing<NEW_LINE>codeStream.generateImplicitConversion(this.implicitConversion);<NEW_LINE>switch(postConversionType(currentScope).id) {<NEW_LINE>case T_long:<NEW_LINE>case T_double:<NEW_LINE>codeStream.pop2();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>codeStream.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>codeStream.recordPositionsFrom(pc, this.sourceStart);<NEW_LINE>} | generateSyntheticOuterArgumentValues(currentScope, allocatedType, this); |
535,336 | public com.amazonaws.services.glacier.model.InsufficientCapacityException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.glacier.model.InsufficientCapacityException insufficientCapacityException = new com.amazonaws.services.glacier.model.InsufficientCapacityException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insufficientCapacityException.setType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insufficientCapacityException.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return insufficientCapacityException;<NEW_LINE>} | class).unmarshall(context)); |
719,632 | private void buildMSCPServiceComponents(MonitorDataFrame mdf, Map<String, Object> pi, String appid, Map<String, Set<String>> compServices) {<NEW_LINE>// http comp<NEW_LINE>Map<String, Object> mscpHttp = mdf.getElemInstValues(appid, "cpt", "com.creditease.agent.spi.AbstractBaseHttpServComponent");<NEW_LINE>if (mscpHttp != null && mscpHttp.size() > 0) {<NEW_LINE>pi.put("cpt.mscp.http", LAZY_INFO);<NEW_LINE>for (String mscpCompName : mscpHttp.keySet()) {<NEW_LINE>Map<String, Object> info = (Map<String, Object>) mscpHttp.get(mscpCompName);<NEW_LINE>Set<String> compServicesURLs = compServices.get(mscpCompName);<NEW_LINE>if (compServicesURLs == null) {<NEW_LINE>compServicesURLs = new HashSet<String>();<NEW_LINE>compServices.put(mscpCompName, compServicesURLs);<NEW_LINE>}<NEW_LINE>String httpRootPath = (String) info.get("path");<NEW_LINE>Map<String, Object> handlers = (Map<String, Object>) info.get("handlers");<NEW_LINE>for (String handlerName : handlers.keySet()) {<NEW_LINE>Map<String, Object> handlerInfo = (Map<String, Object>) handlers.get(handlerName);<NEW_LINE>String handlerPath = (<MASK><NEW_LINE>String serviceURL = httpRootPath + handlerPath;<NEW_LINE>compServicesURLs.add(serviceURL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// timer work<NEW_LINE>Map<String, Object> mscpTimeWork = mdf.getElemInstValues(appid, "cpt", "com.creditease.agent.spi.AbstractTimerWork");<NEW_LINE>if (mscpTimeWork != null && mscpTimeWork.size() > 0) {<NEW_LINE>pi.put("cpt.mscp.timework", LAZY_INFO);<NEW_LINE>}<NEW_LINE>} | String) handlerInfo.get("path"); |
1,034,814 | private void updateResult() {<NEW_LINE>String cssName = shouldCreateCSS() ? getNewCSSName() : getExistingCSSName();<NEW_LINE>if (cssName == null) {<NEW_LINE>fileTextField.setText(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (shouldCreateCSS()) {<NEW_LINE>final Object selectedItem = createdLocationComboBox.getSelectedItem();<NEW_LINE>String createdFileName;<NEW_LINE>if (selectedItem instanceof SourceGroupSupport.SourceGroupProxy) {<NEW_LINE>SourceGroupSupport.SourceGroupProxy <MASK><NEW_LINE>String packageName = getPackageName();<NEW_LINE>support.setCurrentSourceGroup(g);<NEW_LINE>support.setCurrentPackageName(packageName);<NEW_LINE>support.setCurrentFileName(cssName);<NEW_LINE>String path = support.getCurrentPackagePath();<NEW_LINE>createdFileName = path == null ? "" : path.replace(".", "/") + cssName;<NEW_LINE>} else {<NEW_LINE>// May be null if nothing selected<NEW_LINE>// NOI18N<NEW_LINE>createdFileName = "";<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>fileTextField.setText(createdFileName.replace('/', File.separatorChar));<NEW_LINE>} else {<NEW_LINE>fileTextField.setText(getPathForExistingCSS(cssName));<NEW_LINE>}<NEW_LINE>} | g = (SourceGroupSupport.SourceGroupProxy) selectedItem; |
1,498,084 | private void createUserClass() {<NEW_LINE>schema.createEAttribute(user, "name", ecorePackage.getEString(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "passwordHash", ecorePackage.getEByteArray(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "passwordSalt", ecorePackage.<MASK><NEW_LINE>userHasRightsOn = schema.createEReference(user, "hasRightsOn", project, Multiplicity.MANY);<NEW_LINE>schema.createEAttribute(user, "state", objectStateEnum, Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "createdOn", ecorePackage.getEDate(), Multiplicity.SINGLE);<NEW_LINE>schema.createEReference(user, "createdBy", user, Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "userType", userTypeEnum, Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "username", ecorePackage.getEString(), Multiplicity.SINGLE).getEAnnotations().add(createUniqueAnnotation());<NEW_LINE>schema.createEAttribute(user, "lastSeen", ecorePackage.getEDate(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "token", ecorePackage.getEString(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "validationToken", ecorePackage.getEByteArray(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(user, "validationTokenCreated", ecorePackage.getEDate(), Multiplicity.SINGLE);<NEW_LINE>schema.createEReference(user, "userSettings", userSettings, Multiplicity.SINGLE);<NEW_LINE>} | getEByteArray(), Multiplicity.SINGLE); |
519,933 | // Verify that it is not possible to cancel tasks that are done.<NEW_LINE>@Test<NEW_LINE>public void testCancelAfterDone() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testCancelAfterDone");<NEW_LINE>Future<Integer> successfulFuture = executor.submit((Callable<Integer>) new SharedIncrementTask());<NEW_LINE>assertEquals(Integer.valueOf(1), successfulFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertFalse(successfulFuture.cancel(true));<NEW_LINE>assertFalse(successfulFuture.isCancelled());<NEW_LINE>assertEquals(Integer.valueOf(1), successfulFuture.get(0, TimeUnit.SECONDS));<NEW_LINE>assertTrue(successfulFuture.isDone());<NEW_LINE>// intentionally cause NullPointerException<NEW_LINE>Future<Integer> unsuccessfulFuture = executor.submit((Callable<Integer<MASK><NEW_LINE>try {<NEW_LINE>fail("Expecting ExecutionException. Instead: " + unsuccessfulFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>} catch (ExecutionException x) {<NEW_LINE>if (!(x.getCause() instanceof NullPointerException))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>assertFalse(unsuccessfulFuture.cancel(true));<NEW_LINE>assertFalse(unsuccessfulFuture.isCancelled());<NEW_LINE>try {<NEW_LINE>fail("Still expecting ExecutionException. Instead: " + unsuccessfulFuture.get(0, TimeUnit.SECONDS));<NEW_LINE>} catch (ExecutionException x) {<NEW_LINE>if (!(x.getCause() instanceof NullPointerException))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>assertTrue(unsuccessfulFuture.isDone());<NEW_LINE>executor.shutdown();<NEW_LINE>assertTrue(executor.awaitTermination(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>} | >) new SharedIncrementTask(null)); |
1,627,798 | public void shareQR() {<NEW_LINE>logDebug("shareQR");<NEW_LINE>if (myCodeFragment == null) {<NEW_LINE>logWarning("MyCodeFragment is NULL");<NEW_LINE>myCodeFragment = (MyCodeFragment) qrCodePageAdapter.instantiateItem(viewPagerQRCode, 0);<NEW_LINE>}<NEW_LINE>if (myCodeFragment != null && myCodeFragment.isAdded()) {<NEW_LINE>File qrCodeFile = myCodeFragment.queryIfQRExists();<NEW_LINE>if (qrCodeFile != null && qrCodeFile.exists()) {<NEW_LINE>Intent share = new Intent(<MASK><NEW_LINE>share.setType("image/*");<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {<NEW_LINE>logDebug("Use provider to share");<NEW_LINE>Uri uri = FileProvider.getUriForFile(this, "mega.privacy.android.app.providers.fileprovider", qrCodeFile);<NEW_LINE>share.putExtra(Intent.EXTRA_STREAM, Uri.parse(uri.toString()));<NEW_LINE>share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>} else {<NEW_LINE>share.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + qrCodeFile));<NEW_LINE>}<NEW_LINE>startActivity(Intent.createChooser(share, getString(R.string.context_share)));<NEW_LINE>} else {<NEW_LINE>showSnackbar(rootLevelLayout, getString(R.string.error_share_qr));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | android.content.Intent.ACTION_SEND); |
713,142 | public void executeSimulationStep() throws Exception {<NEW_LINE>if (cityDetector == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SumoVehicleData vehData = (SumoVehicleData) conn.do_job_get(Inductionloop.getVehicleData(name));<NEW_LINE>for (SumoVehicleData.VehicleData d : vehData.ll) {<NEW_LINE>DLRLogger.finest(this, String.format(" veh=%s len=%s entry=%s leave=%s type=%s", d.vehID, d.length, d.entry_time, d.leave_time, d.typeID));<NEW_LINE>double entryTime = d.entry_time;<NEW_LINE>double leaveTime = d.leave_time;<NEW_LINE>if (entryTime == lastEntryTime && leaveTime == -1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!onlyLeave) {<NEW_LINE>onlyLeave = true;<NEW_LINE>lastEntryTime = entryTime;<NEW_LINE>entryTime -= ((int) entryTime);<NEW_LINE>entryTime *= 100;<NEW_LINE>cityDetector<MASK><NEW_LINE>}<NEW_LINE>if (leaveTime != -1) {<NEW_LINE>leaveTime -= ((int) leaveTime);<NEW_LINE>leaveTime *= 100;<NEW_LINE>int leaveTimeInt = (int) leaveTime;<NEW_LINE>leaveTimeInt *= -1;<NEW_LINE>if (leaveTimeInt == 0) {<NEW_LINE>// LISA+ expect negative values for outgoing time values<NEW_LINE>leaveTimeInt = -1;<NEW_LINE>}<NEW_LINE>cityDetector.addFlanke(leaveTimeInt);<NEW_LINE>lastEntryTime = 0L;<NEW_LINE>onlyLeave = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .addFlanke((int) entryTime); |
1,301,682 | public void drawBackground(@Nonnull PoseStack matrix, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>super.drawBackground(matrix, mouseX, mouseY, partialTicks);<NEW_LINE>matrix.pushPose();<NEW_LINE>// TODO: Figure out why we need a translation of 1 to fix the text intersecting for the dictionary but it works just fine<NEW_LINE>// for the QIO item viewer<NEW_LINE>matrix.translate(0, 0, 1);<NEW_LINE>renderBackgroundTexture(matrix, getResource(), GuiInnerScreen.SCREEN_SIZE, GuiInnerScreen.SCREEN_SIZE);<NEW_LINE>int index = getHoveredIndex(mouseX, mouseY);<NEW_LINE>if (index != -1) {<NEW_LINE>GuiUtils.drawOutline(matrix, x + 1, y + 12 + index * 10, width - 2, 10, screenTextColor());<NEW_LINE>}<NEW_LINE>TYPE current = curType.get();<NEW_LINE>if (current.getIcon() != null) {<NEW_LINE>RenderSystem.setShaderTexture(0, current.getIcon());<NEW_LINE>blit(matrix, x + width - 9, y + 3, 0, 0, 6, 6, 6, 6);<NEW_LINE>}<NEW_LINE>if (isOpen) {<NEW_LINE>for (int i = 0; i < options.length; i++) {<NEW_LINE>ResourceLocation icon = <MASK><NEW_LINE>if (icon != null) {<NEW_LINE>RenderSystem.setShaderTexture(0, icon);<NEW_LINE>blit(matrix, x + width - 9, y + 12 + 2 + 10 * i, 0, 0, 6, 6, 6, 6);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matrix.popPose();<NEW_LINE>} | options[i].getIcon(); |
1,002,893 | protected void initView(Bundle savedInstanceState) {<NEW_LINE>super.initView(savedInstanceState);<NEW_LINE>updateEndDrawerContent(R.menu.drawer_menu_issues);<NEW_LINE>setToolbarScrollAble(true);<NEW_LINE>setToolbarBackEnable();<NEW_LINE>if (IssuesFilter.Type.Repo.equals(issuesType)) {<NEW_LINE>setToolbarTitle(getString(R.string.issues), userId.concat("/").concat(repoName));<NEW_LINE>} else {<NEW_LINE>setToolbarTitle(getString(R.string.issues));<NEW_LINE>}<NEW_LINE>addBn.setVisibility(IssuesFilter.Type.Repo.equals(issuesType) ? View.VISIBLE : View.GONE);<NEW_LINE>if (IssuesFilter.Type.User.equals(issuesType)) {<NEW_LINE>pagerAdapter.setPagerList(FragmentPagerModel.createUserIssuesPagerList(getActivity(), getFragments()));<NEW_LINE>} else {<NEW_LINE>List<FragmentPagerModel> fragmentPagerModels = FragmentPagerModel.createRepoIssuesPagerList(getActivity(), userId, repoName, getFragments());<NEW_LINE>pagerAdapter.setPagerList(fragmentPagerModels);<NEW_LINE>navViewEnd.getMenu().findItem(R.id<MASK><NEW_LINE>((ListFragment) fragmentPagerModels.get(0).getFragment()).setListScrollListener(this);<NEW_LINE>}<NEW_LINE>listeners = new ArrayList<>();<NEW_LINE>for (FragmentPagerModel pagerModel : pagerAdapter.getPagerList()) {<NEW_LINE>listeners.add((IssuesListListener) pagerModel.getFragment());<NEW_LINE>}<NEW_LINE>tabLayout.setVisibility(View.VISIBLE);<NEW_LINE>tabLayout.setupWithViewPager(viewPager);<NEW_LINE>viewPager.setAdapter(pagerAdapter);<NEW_LINE>showFirstPager();<NEW_LINE>} | .nav_type_chooser).setVisible(false); |
1,044,551 | public Mono<Void> disposeLater(Duration quietPeriod, Duration timeout) {<NEW_LINE>return Mono.defer(() -> {<NEW_LINE>long quietPeriodMillis = quietPeriod.toMillis();<NEW_LINE>long timeoutMillis = timeout.toMillis();<NEW_LINE>EventLoopGroup serverLoopsGroup = serverLoops.get();<NEW_LINE><MASK><NEW_LINE>EventLoopGroup serverSelectLoopsGroup = serverSelectLoops.get();<NEW_LINE>EventLoopGroup cacheNativeClientGroup = cacheNativeClientLoops.get();<NEW_LINE>EventLoopGroup cacheNativeSelectGroup = cacheNativeSelectLoops.get();<NEW_LINE>EventLoopGroup cacheNativeServerGroup = cacheNativeServerLoops.get();<NEW_LINE>Mono<?> clMono = Mono.empty();<NEW_LINE>Mono<?> sslMono = Mono.empty();<NEW_LINE>Mono<?> slMono = Mono.empty();<NEW_LINE>Mono<?> cnclMono = Mono.empty();<NEW_LINE>Mono<?> cnslMono = Mono.empty();<NEW_LINE>Mono<?> cnsrvlMono = Mono.empty();<NEW_LINE>if (running.compareAndSet(true, false)) {<NEW_LINE>if (clientLoopsGroup != null) {<NEW_LINE>clMono = FutureMono.from((Future) clientLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (serverSelectLoopsGroup != null) {<NEW_LINE>sslMono = FutureMono.from((Future) serverSelectLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (serverLoopsGroup != null) {<NEW_LINE>slMono = FutureMono.from((Future) serverLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeClientGroup != null) {<NEW_LINE>cnclMono = FutureMono.from((Future) cacheNativeClientGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeSelectGroup != null) {<NEW_LINE>cnslMono = FutureMono.from((Future) cacheNativeSelectGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeServerGroup != null) {<NEW_LINE>cnsrvlMono = FutureMono.from((Future) cacheNativeServerGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Mono.when(clMono, sslMono, slMono, cnclMono, cnslMono, cnsrvlMono);<NEW_LINE>});<NEW_LINE>} | EventLoopGroup clientLoopsGroup = clientLoops.get(); |
1,528,513 | public Node visit(final VariableDeclarationExpr n, final A arg) {<NEW_LINE>final List<AnnotationExpr<MASK><NEW_LINE>if (annotations != null) {<NEW_LINE>for (int i = 0; i < annotations.size(); i++) {<NEW_LINE>annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg));<NEW_LINE>}<NEW_LINE>removeNulls(annotations);<NEW_LINE>}<NEW_LINE>final Type type = (Type) n.getType().accept(this, arg);<NEW_LINE>if (type == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>n.setType(type);<NEW_LINE>final List<VariableDeclarator> vars = n.getVars();<NEW_LINE>for (int i = 0; i < vars.size(); ) {<NEW_LINE>final VariableDeclarator decl = (VariableDeclarator) vars.get(i).accept(this, arg);<NEW_LINE>if (decl == null) {<NEW_LINE>vars.remove(i);<NEW_LINE>} else {<NEW_LINE>vars.set(i++, decl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (vars.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return n;<NEW_LINE>} | > annotations = n.getAnnotations(); |
1,546,131 | private void onHandleConnectionRequested(UserConnectionCallback userConnectionCallback, String endpointId, ConnectionInfo connectionInfo) {<NEW_LINE>Log.i(TAG, String.format("onConnectionRequested called: userName=%s userId=%s", connectionInfo.getEndpointName(), endpointId));<NEW_LINE>// check if connection is incoming or not<NEW_LINE>if (connectionInfo.isIncomingConnection()) {<NEW_LINE>Log.d(TAG, "Incoming Connection");<NEW_LINE>if (foundMap.get(endpointId) == null) {<NEW_LINE>Log.d(TAG, "Incoming connection adding user");<NEW_LINE>foundMap.put(endpointId, new Endpoint(endpointId, connectionInfo.getEndpointName()));<NEW_LINE>userConnectionCallback.onConnectionRequested(connectionInfo.getEndpointName(), endpointId, true);<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, "Duplicate connection - accept connection");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Connection is not incoming<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// check for the endpoint and accept<NEW_LINE>if (foundMap.get(endpointId) != null) {<NEW_LINE>Log.d(TAG, "Connection is here you should accept");<NEW_LINE>userConnectionCallback.onConnectionRequested(connectionInfo.getEndpointName(), endpointId, false);<NEW_LINE>}<NEW_LINE>} | Log.d(TAG, "Not incoming connection"); |
287,545 | public void testSubList_lastIndexOf() {<NEW_LINE>List<E> list = getList();<NEW_LINE>int size = list.size();<NEW_LINE>List<E> copy = list.subList(0, size);<NEW_LINE>List<E> head = list.subList(0, size - 1);<NEW_LINE>List<E> tail = list.subList(1, size);<NEW_LINE>assertEquals(size - 1, copy.lastIndexOf(list.get(size - 1)));<NEW_LINE>assertEquals(size - 2, head.lastIndexOf(list.<MASK><NEW_LINE>assertEquals(size - 2, tail.lastIndexOf(list.get(size - 1)));<NEW_LINE>// The following assumes all elements are distinct.<NEW_LINE>assertEquals(0, copy.lastIndexOf(list.get(0)));<NEW_LINE>assertEquals(0, head.lastIndexOf(list.get(0)));<NEW_LINE>assertEquals(0, tail.lastIndexOf(list.get(1)));<NEW_LINE>assertEquals(-1, head.lastIndexOf(list.get(size - 1)));<NEW_LINE>assertEquals(-1, tail.lastIndexOf(list.get(0)));<NEW_LINE>} | get(size - 2))); |
1,028,155 | private LookupValue convertRawFieldValueToLookupValue(final Object fieldValue) {<NEW_LINE>if (fieldValue == null) {<NEW_LINE>return null;<NEW_LINE>} else if (fieldValue instanceof LookupValue) {<NEW_LINE>return (LookupValue) fieldValue;<NEW_LINE>} else if (fieldValue instanceof LocalDate) {<NEW_LINE>final LocalDate date = (LocalDate) fieldValue;<NEW_LINE>return StringLookupValue.of(Values.localDateToJson(date)<MASK><NEW_LINE>} else if (fieldValue instanceof Boolean) {<NEW_LINE>final boolean booleanValue = StringUtils.toBoolean(fieldValue);<NEW_LINE>return StringLookupValue.of(DisplayType.toBooleanString(booleanValue), msgBL.getTranslatableMsgText(booleanValue));<NEW_LINE>} else if (fieldValue instanceof String) {<NEW_LINE>final String stringValue = (String) fieldValue;<NEW_LINE>return StringLookupValue.of(stringValue, stringValue);<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Value not supported: " + fieldValue + " (" + fieldValue.getClass() + ")").appendParametersToMessage().setParameter("fieldName", fieldName);<NEW_LINE>}<NEW_LINE>} | , TranslatableStrings.date(date)); |
653,851 | public ResponseEntity<?> listRecordings() {<NEW_LINE>log.info("REST API: GET {}/recordings", RequestMappings.API);<NEW_LINE>if (!this.openviduConfig.isRecordingModuleEnabled()) {<NEW_LINE>// OpenVidu Server configuration property "OPENVIDU_RECORDING" is set to false<NEW_LINE>return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);<NEW_LINE>}<NEW_LINE>Collection<Recording> recordings <MASK><NEW_LINE>JsonObject json = new JsonObject();<NEW_LINE>JsonArray jsonArray = new JsonArray();<NEW_LINE>recordings.forEach(rec -> {<NEW_LINE>if (io.openvidu.java.client.Recording.Status.started.equals(rec.getStatus()) && recordingManager.getStartingRecording(rec.getId()) != null) {<NEW_LINE>rec.setStatus(io.openvidu.java.client.Recording.Status.starting);<NEW_LINE>}<NEW_LINE>jsonArray.add(rec.toJson(false));<NEW_LINE>});<NEW_LINE>json.addProperty("count", recordings.size());<NEW_LINE>json.add("items", jsonArray);<NEW_LINE>return new ResponseEntity<>(json.toString(), RestUtils.getResponseHeaders(), HttpStatus.OK);<NEW_LINE>} | = this.recordingManager.getAllRecordings(); |
341,559 | public static void registerType(final ModelBuilder modelBuilder) {<NEW_LINE>final ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(BpmnShape.class, BPMNDI_ELEMENT_BPMN_SHAPE).namespaceUri(BPMNDI_NS).extendsType(LabeledShape.class).instanceProvider(new ModelTypeInstanceProvider<BpmnShape>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public BpmnShape newInstance(final ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new BpmnShapeImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>bpmnElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_BPMN_ELEMENT).qNameAttributeReference(BaseElement.class).build();<NEW_LINE>isHorizontalAttribute = typeBuilder.booleanAttribute(BPMNDI_ATTRIBUTE_IS_HORIZONTAL).build();<NEW_LINE>isExpandedAttribute = typeBuilder.booleanAttribute(BPMNDI_ATTRIBUTE_IS_EXPANDED).build();<NEW_LINE>isMarkerVisibleAttribute = typeBuilder.<MASK><NEW_LINE>isMessageVisibleAttribute = typeBuilder.booleanAttribute(BPMNDI_ATTRIBUTE_IS_MESSAGE_VISIBLE).build();<NEW_LINE>participantBandKindAttribute = typeBuilder.enumAttribute(BPMNDI_ATTRIBUTE_PARTICIPANT_BAND_KIND, ParticipantBandKind.class).build();<NEW_LINE>choreographyActivityShapeAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_CHOREOGRAPHY_ACTIVITY_SHAPE).qNameAttributeReference(BpmnShape.class).build();<NEW_LINE>final SequenceBuilder sequenceBuilder = typeBuilder.sequence();<NEW_LINE>bpmnLabelChild = sequenceBuilder.element(BpmnLabel.class).build();<NEW_LINE>typeBuilder.build();<NEW_LINE>} | booleanAttribute(BPMNDI_ATTRIBUTE_IS_MARKER_VISIBLE).build(); |
1,034,598 | public <K, V> Map<K, V> toMap(DataTable dataTable, Type keyType, Type valueType) {<NEW_LINE>requireNonNull(dataTable, "dataTable may not be null");<NEW_LINE>requireNonNull(keyType, "keyType may not be null");<NEW_LINE>requireNonNull(valueType, "valueType may not be null");<NEW_LINE>if (dataTable.isEmpty()) {<NEW_LINE>return emptyMap();<NEW_LINE>}<NEW_LINE>DataTable keyColumn = dataTable.columns(0, 1);<NEW_LINE>DataTable valueColumns = dataTable.columns(1);<NEW_LINE>String firstHeaderCell = keyColumn.cell(0, 0);<NEW_LINE>boolean firstHeaderCellIsBlank = firstHeaderCell == null || firstHeaderCell.isEmpty();<NEW_LINE>List<K> keys = convertEntryKeys(keyType, keyColumn, valueType, firstHeaderCellIsBlank);<NEW_LINE>if (valueColumns.isEmpty()) {<NEW_LINE>return createMap(keyType, keys, valueType, nCopies(keys.size(), null));<NEW_LINE>}<NEW_LINE>boolean keysImplyTableRowTransformer = keys.size() == dataTable.height() - 1;<NEW_LINE>List<V> values = convertEntryValues(valueColumns, keyType, valueType, keysImplyTableRowTransformer);<NEW_LINE>if (keys.size() != values.size()) {<NEW_LINE>throw keyValueMismatchException(firstHeaderCellIsBlank, keys.size(), keyType, values.size(), valueType);<NEW_LINE>}<NEW_LINE>return createMap(<MASK><NEW_LINE>} | keyType, keys, valueType, values); |
1,126,724 | private static void validateBootstrapLabelsAndAnnotations(Set<String> errors, GenericKafkaListener listener) {<NEW_LINE>if (!KafkaListenerType.LOADBALANCER.equals(listener.getType()) && !KafkaListenerType.NODEPORT.equals(listener.getType()) && !KafkaListenerType.ROUTE.equals(listener.getType()) && !KafkaListenerType.INGRESS.equals(listener.getType())) {<NEW_LINE>if (listener.getConfiguration().getBootstrap().getLabels() != null && !listener.getConfiguration().getBootstrap().getLabels().isEmpty()) {<NEW_LINE>errors.add("listener " + listener.getName() + " cannot configure bootstrap.labels because it is not LoadBalancer, NodePort, Route, or Ingress based listener");<NEW_LINE>}<NEW_LINE>if (listener.getConfiguration().getBootstrap().getAnnotations() != null && !listener.getConfiguration().getBootstrap().getAnnotations().isEmpty()) {<NEW_LINE>errors.add("listener " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | listener.getName() + " cannot configure bootstrap.annotations because it is not LoadBalancer, NodePort, Route, or Ingress based listener"); |
305,808 | public TypeSpec generate(DiffSectionSpecModel specModel, EnumSet<RunMode> runMode) {<NEW_LINE>final TypeSpec.Builder typeSpec = TypeSpec.classBuilder(specModel.getComponentName()).superclass(SectionClassNames.SECTION).addTypeVariables(specModel.getTypeVariables());<NEW_LINE>if (SpecModelUtils.isTypeElement(specModel)) {<NEW_LINE>typeSpec.addOriginatingElement((TypeElement) specModel.getRepresentedObject());<NEW_LINE>}<NEW_LINE>if (specModel.isPublic()) {<NEW_LINE>typeSpec.addModifiers(Modifier.PUBLIC);<NEW_LINE>}<NEW_LINE>if (!specModel.hasInjectedDependencies()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>TypeSpecDataHolder.newBuilder().addTypeSpecDataHolder(JavadocGenerator.generate(specModel)).addTypeSpecDataHolder(ClassAnnotationsGenerator.generate(specModel)).addTypeSpecDataHolder(PreambleGenerator.generate(specModel)).addTypeSpecDataHolder(ComponentBodyGenerator.generate(specModel, specModel.getServiceParam(), runMode)).addTypeSpecDataHolder(BuilderGenerator.generate(specModel)).addTypeSpecDataHolder(StateGenerator.generate(specModel)).addTypeSpecDataHolder(EventGenerator.generate(specModel)).addTypeSpecDataHolder(DelegateMethodGenerator.generateDelegates(specModel, DelegateMethodDescriptions.getDiffSectionSpecDelegatesMap(specModel), runMode)).addTypeSpecDataHolder(TriggerGenerator.generate(specModel)).addTypeSpecDataHolder(TagGenerator.generate(specModel, mBlacklistedTagInterfaces)).addTypeSpecDataHolder(CachedValueGenerator.generate(specModel, runMode)).build().addToTypeSpec(typeSpec);<NEW_LINE>return typeSpec.build();<NEW_LINE>} | typeSpec.addModifiers(Modifier.FINAL); |
1,832,861 | final DeregisterRdsDbInstanceResult executeDeregisterRdsDbInstance(DeregisterRdsDbInstanceRequest deregisterRdsDbInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deregisterRdsDbInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeregisterRdsDbInstanceRequest> request = null;<NEW_LINE>Response<DeregisterRdsDbInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeregisterRdsDbInstanceRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeregisterRdsDbInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeregisterRdsDbInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeregisterRdsDbInstanceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(deregisterRdsDbInstanceRequest)); |
1,425,040 | public static void main(String[] args) {<NEW_LINE>Exercise22 exercise22 = new Exercise22();<NEW_LINE>Point2D point2D = exercise22.new Point2D(20, 13);<NEW_LINE>StdOut.println("Point 2D hash code: " + point2D.hashCode());<NEW_LINE>Interval interval = exercise22<MASK><NEW_LINE>StdOut.println("Interval hash code: " + interval.hashCode());<NEW_LINE>Interval1D interval1D1 = new Interval1D(10.2, 30.20);<NEW_LINE>Interval1D interval1D2 = new Interval1D(2, 1000);<NEW_LINE>Interval2D interval2D = exercise22.new Interval2D(interval1D1, interval1D2);<NEW_LINE>StdOut.println("Interval 2D hash code: " + interval2D.hashCode());<NEW_LINE>Date date = exercise22.new Date(18, 4, 1989);<NEW_LINE>StdOut.println("Date hash code: " + date.hashCode());<NEW_LINE>} | .new Interval(1, 999); |
1,725,049 | // OPERATIONS<NEW_LINE>public QueuedMessage[] listQueuedMessages() throws Exception {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "listQueuedMessages");<NEW_LINE>List list = new ArrayList();<NEW_LINE><MASK><NEW_LINE>while (iter != null && iter.hasNext()) {<NEW_LINE>SIMPQueuedMessageControllable o = (SIMPQueuedMessageControllable) iter.next();<NEW_LINE>list.add(o);<NEW_LINE>}<NEW_LINE>List resultList = new ArrayList();<NEW_LINE>iter = list.iterator();<NEW_LINE>int i = 0;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Object o = iter.next();<NEW_LINE>QueuedMessage qm = SIBMBeanResultFactory.createSIBQueuedMessage((SIMPQueuedMessageControllable) o);<NEW_LINE>resultList.add(qm);<NEW_LINE>}<NEW_LINE>QueuedMessage[] retValue = (QueuedMessage[]) resultList.toArray(new QueuedMessage[0]);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "listQueuedMessages", retValue);<NEW_LINE>return retValue;<NEW_LINE>} | Iterator iter = _c.getQueuedMessageIterator(); |
1,826,701 | private <T> void writeObjectArrayField(@Nonnull String fieldName, FieldType fieldType, @Nullable T[] values, Writer<ObjectDataOutput, T> writer) throws IOException {<NEW_LINE>setPosition(fieldName, fieldType);<NEW_LINE>final int len = values == null ? NULL_ARRAY_LENGTH : values.length;<NEW_LINE>out.writeInt(len);<NEW_LINE>if (len > 0) {<NEW_LINE>final int offset = out.position();<NEW_LINE>out.writeZeroBytes(len * INT_SIZE_IN_BYTES);<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE><MASK><NEW_LINE>if (values[i] == null) {<NEW_LINE>throw new HazelcastSerializationException("Array items can not be null");<NEW_LINE>} else {<NEW_LINE>out.writeInt(offset + i * INT_SIZE_IN_BYTES, position);<NEW_LINE>writer.write(out, values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int position = out.position(); |
1,834,970 | static public MPrintFormat createFromTable(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID) {<NEW_LINE>MClient company = MClient.get(ctx);<NEW_LINE>s_log.info("AD_Table_ID=" + AD_Table_ID + " - AD_Client_ID=" + company.get_ID());<NEW_LINE>MPrintFormat pf = new MPrintFormat(ctx, AD_PrintFormat_ID, null);<NEW_LINE>pf.setAD_Table_ID(AD_Table_ID);<NEW_LINE>// Get Info<NEW_LINE>// 1<NEW_LINE>String // 1<NEW_LINE>sql = // 3<NEW_LINE>"SELECT TableName," + " (SELECT COUNT(*) FROM AD_PrintFormat x WHERE x.AD_Table_ID=t.AD_Table_ID AND x.AD_Client_ID=c.AD_Client_ID) AS Count," + " COALESCE (cpc.AD_PrintColor_ID, pc.AD_PrintColor_ID) AS AD_PrintColor_ID," + " COALESCE (cpf.AD_PrintFont_ID, pf.AD_PrintFont_ID) AS AD_PrintFont_ID," + " COALESCE (cpp.AD_PrintPaper_ID, pp.AD_PrintPaper_ID) AS AD_PrintPaper_ID " + "FROM AD_Table t, AD_Client c" + " LEFT OUTER JOIN AD_PrintColor cpc ON (cpc.AD_Client_ID=c.AD_Client_ID AND cpc.IsDefault='Y')" + " LEFT OUTER JOIN AD_PrintFont cpf ON (cpf.AD_Client_ID=c.AD_Client_ID AND cpf.IsDefault='Y')" + " LEFT OUTER JOIN AD_PrintPaper cpp ON (cpp.AD_Client_ID=c.AD_Client_ID AND cpp.IsDefault='Y')," + // #1/2<NEW_LINE>" AD_PrintColor pc, AD_PrintFont pf, AD_PrintPaper pp " + "WHERE t.AD_Table_ID=? AND c.AD_Client_ID=?" + " AND pc.IsDefault='Y' AND pf.IsDefault='Y' AND pp.IsDefault='Y'";<NEW_LINE>boolean error = true;<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, AD_Table_ID);<NEW_LINE>pstmt.setInt(2, company.get_ID());<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>// Name<NEW_LINE>String <MASK><NEW_LINE>String ColumnName = TableName + "_ID";<NEW_LINE>String s = ColumnName;<NEW_LINE>if (!ColumnName.equals("T_Report_ID")) {<NEW_LINE>s = Msg.translate(ctx, ColumnName);<NEW_LINE>if (// not found<NEW_LINE>ColumnName.equals(s))<NEW_LINE>s = Msg.translate(ctx, TableName);<NEW_LINE>}<NEW_LINE>int count = rs.getInt(2);<NEW_LINE>if (count > 0)<NEW_LINE>s += "_" + (count + 1);<NEW_LINE>pf.setName(company.getValue() + " -> " + s);<NEW_LINE>//<NEW_LINE>pf.setAD_PrintColor_ID(rs.getInt(3));<NEW_LINE>pf.setAD_PrintFont_ID(rs.getInt(4));<NEW_LINE>pf.setAD_PrintPaper_ID(rs.getInt(5));<NEW_LINE>//<NEW_LINE>error = false;<NEW_LINE>} else<NEW_LINE>s_log.log(Level.SEVERE, "No info found " + AD_Table_ID);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>s_log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>if (error)<NEW_LINE>return null;<NEW_LINE>// Save & complete<NEW_LINE>if (!pf.save())<NEW_LINE>return null;<NEW_LINE>// pf.dump();<NEW_LINE>pf.setItems(createItems(ctx, pf));<NEW_LINE>//<NEW_LINE>return pf;<NEW_LINE>} | TableName = rs.getString(1); |
980,254 | // http://download.oracle.com/javase/1.3/docs/guide/rmi/spec/rmi-protocol.html<NEW_LINE>public static void main(String[] args) throws Exception {<NEW_LINE>FileOutputStream fos = new FileOutputStream("build/rmipacket");<NEW_LINE>ServerSocket ss = new ServerSocket(11099);<NEW_LINE>Thread t = new Thread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>RMISender.main(new String[] { "file:./rmidummy.jar", "localhost", "11099" });<NEW_LINE>} catch (UnmarshalException ex) {<NEW_LINE>// expected<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>t.setDaemon(true);<NEW_LINE>t.start();<NEW_LINE>Socket s = ss.accept();<NEW_LINE>ss.close();<NEW_LINE>DataInputStream in = new <MASK><NEW_LINE>DataOutputStream out = new DataOutputStream(s.getOutputStream());<NEW_LINE>byte[] hdr = new byte[7];<NEW_LINE>in.readFully(hdr);<NEW_LINE>if (!new String(hdr, "ISO-8859-1").equals("JRMI\0\2K")) {<NEW_LINE>throw new IOException("Unsupported RMI header");<NEW_LINE>}<NEW_LINE>out.write('N');<NEW_LINE>out.writeUTF("127.0.0.1");<NEW_LINE>out.writeInt(11099);<NEW_LINE>out.flush();<NEW_LINE>in.readUTF();<NEW_LINE>in.readInt();<NEW_LINE>s.setSoTimeout(1000);<NEW_LINE>try {<NEW_LINE>byte[] buf = new byte[4096];<NEW_LINE>int len;<NEW_LINE>while ((len = in.read(buf)) != -1) {<NEW_LINE>fos.write(buf, 0, len);<NEW_LINE>}<NEW_LINE>} catch (InterruptedIOException ex) {<NEW_LINE>// we are done<NEW_LINE>}<NEW_LINE>fos.close();<NEW_LINE>} | DataInputStream(s.getInputStream()); |
1,760,160 | protected Collection<Declarable> processListener(MethodRabbitListenerEndpoint endpoint, RabbitListener rabbitListener, Object bean, Object target, String beanName) {<NEW_LINE>final List<Declarable> declarables = new ArrayList<>();<NEW_LINE>endpoint.setBean(bean);<NEW_LINE>endpoint.setMessageHandlerMethodFactory(this.messageHandlerMethodFactory);<NEW_LINE>endpoint.setId(getEndpointId(rabbitListener));<NEW_LINE>List<Object> resolvedQueues = resolveQueues(rabbitListener, declarables);<NEW_LINE>if (!resolvedQueues.isEmpty()) {<NEW_LINE>if (resolvedQueues.get(0) instanceof String) {<NEW_LINE>endpoint.setQueueNames(resolvedQueues.stream().map(o -> (String) o).collect(Collectors.toList()).toArray(new String[0]));<NEW_LINE>} else {<NEW_LINE>endpoint.setQueues(resolvedQueues.stream().map(o -> (Queue) o).collect(Collectors.toList()).toArray(new Queue[0]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>endpoint.setConcurrency(resolveExpressionAsStringOrInteger(rabbitListener.concurrency(), "concurrency"));<NEW_LINE>endpoint.setBeanFactory(this.beanFactory);<NEW_LINE>endpoint.setReturnExceptions(resolveExpressionAsBoolean(rabbitListener.returnExceptions()));<NEW_LINE>resolveErrorHandler(endpoint, rabbitListener);<NEW_LINE><MASK><NEW_LINE>if (StringUtils.hasText(group)) {<NEW_LINE>Object resolvedGroup = resolveExpression(group);<NEW_LINE>if (resolvedGroup instanceof String) {<NEW_LINE>endpoint.setGroup((String) resolvedGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String autoStartup = rabbitListener.autoStartup();<NEW_LINE>if (StringUtils.hasText(autoStartup)) {<NEW_LINE>endpoint.setAutoStartup(resolveExpressionAsBoolean(autoStartup));<NEW_LINE>}<NEW_LINE>endpoint.setExclusive(rabbitListener.exclusive());<NEW_LINE>String priority = resolveExpressionAsString(rabbitListener.priority(), "priority");<NEW_LINE>if (StringUtils.hasText(priority)) {<NEW_LINE>try {<NEW_LINE>endpoint.setPriority(Integer.valueOf(priority));<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new BeanInitializationException("Invalid priority value for " + rabbitListener + " (must be an integer)", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resolveExecutor(endpoint, rabbitListener, target, beanName);<NEW_LINE>resolveAdmin(endpoint, rabbitListener, target);<NEW_LINE>resolveAckMode(endpoint, rabbitListener);<NEW_LINE>resolvePostProcessor(endpoint, rabbitListener, target, beanName);<NEW_LINE>resolveMessageConverter(endpoint, rabbitListener, target, beanName);<NEW_LINE>resolveReplyContentType(endpoint, rabbitListener);<NEW_LINE>RabbitListenerContainerFactory<?> factory = resolveContainerFactory(rabbitListener, target, beanName);<NEW_LINE>this.registrar.registerEndpoint(endpoint, factory);<NEW_LINE>return declarables;<NEW_LINE>} | String group = rabbitListener.group(); |
1,596,400 | private Integer parseLength(String attrValue, CSSName property, Box box, CssContext ctx) {<NEW_LINE>try {<NEW_LINE>return Integer.valueOf(attrValue);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// Not a plain number, probably has a unit (px, cm, etc), so<NEW_LINE>// try with css parser.<NEW_LINE>CSSParser parser = new CSSParser((uri, msg) -> XRLog.log(Level.WARNING, LogMessageId.LogMessageId1Param.GENERAL_INVALID_INTEGER_PASSED_AS_DIMENSION_FOR_SVG, attrValue));<NEW_LINE>PropertyValue value = parser.parsePropertyValue(property, StylesheetInfo.AUTHOR, attrValue);<NEW_LINE>if (value == null) {<NEW_LINE>// CSS parser couldn't deal with value either.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>LengthValue length = new LengthValue(box.getStyle(), property, value);<NEW_LINE>float pixels = length.getFloatProportionalTo(property, box.getContainingBlock() == null ? 0 : box.getContainingBlock(<MASK><NEW_LINE>return (int) Math.round(pixels / this.dotsPerPixel);<NEW_LINE>}<NEW_LINE>} | ).getWidth(), ctx); |
1,157,292 | private void executeInitSql(final String initSql) {<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, "jdbc.execute_init_sql_start");<NEW_LINE>}<NEW_LINE>java.sql.PreparedStatement stmt = null;<NEW_LINE>if (initSql != null && !initSql.equalsIgnoreCase("null") && !initSql.equals("")) {<NEW_LINE>try {<NEW_LINE>stmt = actualConnection.prepareStatement(initSql);<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, "jdbc.executing_init_sql", initSql);<NEW_LINE>}<NEW_LINE>stmt.execute();<NEW_LINE>} catch (SQLException sqle) {<NEW_LINE>_logger.log(Level.WARNING, "jdbc.exc_init_sql_error", initSql);<NEW_LINE>initSqlExecuted = false;<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (stmt != null) {<NEW_LINE>stmt.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>initSqlExecuted = true;<NEW_LINE>}<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, "jdbc.execute_init_sql_end");<NEW_LINE>}<NEW_LINE>} | "jdbc.exc_init_sql_error_stmt_close", e.getMessage()); |
749,366 | public void syncObjects(Object... objects) {<NEW_LINE>if (vm == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Event[] events = new Event[objects.length];<NEW_LINE>for (int i = 0; i < objects.length; i++) {<NEW_LINE>Object object = objects[i];<NEW_LINE>events<MASK><NEW_LINE>}<NEW_LINE>for (Event e : events) {<NEW_LINE>e.waitOn();<NEW_LINE>}<NEW_LINE>if (TornadoOptions.isProfilerEnabled()) {<NEW_LINE>timeProfiler.clean();<NEW_LINE>for (int i = 0; i < events.length; i++) {<NEW_LINE>long value = timeProfiler.getTimer(ProfilerType.COPY_OUT_TIME_SYNC);<NEW_LINE>events[i].waitForEvents();<NEW_LINE>value += events[i].getElapsedTime();<NEW_LINE>timeProfiler.setTimer(ProfilerType.COPY_OUT_TIME_SYNC, value);<NEW_LINE>LocalObjectState localState = executionContext.getObjectState(objects[i]);<NEW_LINE>DeviceObjectState deviceObjectState = localState.getGlobalState().getDeviceState(meta().getLogicDevice());<NEW_LINE>timeProfiler.addValueToMetric(ProfilerType.COPY_OUT_SIZE_BYTES_SYNC, TimeProfiler.NO_TASK_NAME, deviceObjectState.getBuffer().size());<NEW_LINE>}<NEW_LINE>updateProfiler();<NEW_LINE>}<NEW_LINE>} | [i] = syncObjectInner(object); |
794,215 | public void startElement(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Start Element: {}", qName);<NEW_LINE>}<NEW_LINE>if (tagQueue.isEmpty() && !"eef".equalsIgnoreCase(qName)) {<NEW_LINE>throw new GsaConfigException("Invalid format.");<NEW_LINE>}<NEW_LINE>if (COLLECTION.equalsIgnoreCase(qName) && COLLECTIONS.equalsIgnoreCase(tagQueue.peekLast())) {<NEW_LINE>final long now = System.currentTimeMillis();<NEW_LINE>final String name = attributes.getValue("Name");<NEW_LINE>labelType = new LabelType();<NEW_LINE>labelType.setName(name);<NEW_LINE>labelType.setValue(name);<NEW_LINE>labelType.setPermissions(<MASK><NEW_LINE>labelType.setCreatedBy(Constants.SYSTEM_USER);<NEW_LINE>labelType.setCreatedTime(now);<NEW_LINE>labelType.setUpdatedBy(Constants.SYSTEM_USER);<NEW_LINE>labelType.setUpdatedTime(now);<NEW_LINE>}<NEW_LINE>tagQueue.offer(qName);<NEW_LINE>} | new String[] { "Rguest" }); |
1,797,317 | public boolean canScan(TCredentials credentials, TableId tableId, NamespaceId namespaceId, TRange range, List<TColumn> columns, List<IterInfo> ssiList, Map<String, Map<String, String>> ssio, List<ByteBuffer> authorizations) throws ThriftSecurityException {<NEW_LINE>if (shouldAudit(credentials, tableId)) {<NEW_LINE>Range convertedRange = new Range(range);<NEW_LINE>List<String> convertedColumns = truncate(columns.stream().map(Column::new).collect(Collectors.toList()));<NEW_LINE>String tableName = getTableName(tableId);<NEW_LINE>try {<NEW_LINE>boolean canScan = super.canScan(credentials, tableId, namespaceId);<NEW_LINE>audit(credentials, canScan, CAN_SCAN_AUDIT_TEMPLATE, tableName, getAuthString(authorizations), <MASK><NEW_LINE>return canScan;<NEW_LINE>} catch (ThriftSecurityException ex) {<NEW_LINE>audit(credentials, ex, CAN_SCAN_AUDIT_TEMPLATE, getAuthString(authorizations), tableId, convertedRange, convertedColumns, ssiList, ssio);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return super.canScan(credentials, tableId, namespaceId);<NEW_LINE>}<NEW_LINE>} | convertedRange, convertedColumns, ssiList, ssio); |
1,364,908 | public List<ViewAttribute> collect(DrawerLayout view, AttributeTranslator attributeTranslator) {<NEW_LINE>List<ViewAttribute> attributes = new ArrayList<>();<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerElevation"<MASK><NEW_LINE>attributes.add(new ViewAttribute<>("DrawerTitleStart", view.getDrawerTitle(Gravity.START)));<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerTitleEnd", view.isDrawerVisible(Gravity.END)));<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerLockModeStart", new DrawerLayoutLockModeValue(view.getDrawerLockMode(Gravity.START))));<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerLockModeEnd", new DrawerLayoutLockModeValue(view.getDrawerLockMode(Gravity.END))));<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerOpenStart", view.isDrawerOpen(Gravity.START)));<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerOpenEnd", view.isDrawerOpen(Gravity.END)));<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerVisibleStart", view.isDrawerVisible(Gravity.START)));<NEW_LINE>attributes.add(new ViewAttribute<>("DrawerVisibleEnd", view.isDrawerVisible(Gravity.END)));<NEW_LINE>attributes.add(new ViewAttribute<Void>("StatusBarBackgroundDrawable", view.getStatusBarBackgroundDrawable()));<NEW_LINE>return attributes;<NEW_LINE>} | , view.getDrawerElevation())); |
1,542,756 | public JSArrayObject execute(VirtualFrame frame) {<NEW_LINE>Object[] primitiveArray = new Object[elements.length];<NEW_LINE>int holeCount = 0;<NEW_LINE>int holesBeforeLastNonEmpty = 0;<NEW_LINE>int arrayOffset = 0;<NEW_LINE>int lastNonEmpty = -1;<NEW_LINE>for (int i = 0; i < elements.length; i++) {<NEW_LINE>if (elements[i] instanceof EmptyNode) {<NEW_LINE>holeCount++;<NEW_LINE>if (i == arrayOffset) {<NEW_LINE>arrayOffset++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>primitiveArray[i] = elements[i].execute(frame);<NEW_LINE>lastNonEmpty = i;<NEW_LINE>holesBeforeLastNonEmpty = holeCount;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int usedLength = lastNonEmpty + 1 - arrayOffset;<NEW_LINE>int holesInUsedLength = holesBeforeLastNonEmpty - arrayOffset;<NEW_LINE>return JSArray.createZeroBasedHolesObjectArray(context, getRealm(), <MASK><NEW_LINE>} | primitiveArray, usedLength, arrayOffset, holesInUsedLength); |
1,786,440 | public void skipValue() {<NEW_LINE>switch(peek()) {<NEW_LINE>case ENCODED_BYTE:<NEW_LINE>readByte();<NEW_LINE>break;<NEW_LINE>case ENCODED_SHORT:<NEW_LINE>readShort();<NEW_LINE>break;<NEW_LINE>case ENCODED_CHAR:<NEW_LINE>readChar();<NEW_LINE>break;<NEW_LINE>case ENCODED_INT:<NEW_LINE>readInt();<NEW_LINE>break;<NEW_LINE>case ENCODED_LONG:<NEW_LINE>readLong();<NEW_LINE>break;<NEW_LINE>case ENCODED_FLOAT:<NEW_LINE>readFloat();<NEW_LINE>break;<NEW_LINE>case ENCODED_DOUBLE:<NEW_LINE>readDouble();<NEW_LINE>break;<NEW_LINE>case ENCODED_METHOD_TYPE:<NEW_LINE>readMethodType();<NEW_LINE>break;<NEW_LINE>case ENCODED_METHOD_HANDLE:<NEW_LINE>readMethodHandle();<NEW_LINE>break;<NEW_LINE>case ENCODED_STRING:<NEW_LINE>readString();<NEW_LINE>break;<NEW_LINE>case ENCODED_TYPE:<NEW_LINE>readType();<NEW_LINE>break;<NEW_LINE>case ENCODED_FIELD:<NEW_LINE>readField();<NEW_LINE>break;<NEW_LINE>case ENCODED_ENUM:<NEW_LINE>readEnum();<NEW_LINE>break;<NEW_LINE>case ENCODED_METHOD:<NEW_LINE>readMethod();<NEW_LINE>break;<NEW_LINE>case ENCODED_ARRAY:<NEW_LINE>for (int i = 0, size = readArray(); i < size; i++) {<NEW_LINE>skipValue();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ENCODED_ANNOTATION:<NEW_LINE>for (int i = 0, size = readAnnotation(); i < size; i++) {<NEW_LINE>readAnnotationName();<NEW_LINE>skipValue();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ENCODED_NULL:<NEW_LINE>readNull();<NEW_LINE>break;<NEW_LINE>case ENCODED_BOOLEAN:<NEW_LINE>readBoolean();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new DexException("Unexpected type: " <MASK><NEW_LINE>}<NEW_LINE>} | + Integer.toHexString(type)); |
1,411,961 | public MatchmakingRuleSet unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MatchmakingRuleSet matchmakingRuleSet = new MatchmakingRuleSet();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RuleSetName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>matchmakingRuleSet.setRuleSetName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RuleSetArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>matchmakingRuleSet.setRuleSetArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RuleSetBody", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>matchmakingRuleSet.setRuleSetBody(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>matchmakingRuleSet.setCreationTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 matchmakingRuleSet;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
298,196 | public void run() {<NEW_LINE>// init remoting server<NEW_LINE>NettyServerConfig serverConfig = new NettyServerConfig();<NEW_LINE>serverConfig.setListenPort(workerConfig.getListenPort());<NEW_LINE>this.nettyRemotingServer = new NettyRemotingServer(serverConfig);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, taskExecuteProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, taskKillProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RUNNING_ACK, taskExecuteRunningAckProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE_ACK, taskExecuteResponseAckProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.PROCESS_HOST_UPDATE_REQUEST, hostUpdateProcessor);<NEW_LINE>// logger server<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.GET_LOG_BYTES_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.ROLL_VIEW_LOG_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.VIEW_WHOLE_LOG_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.REMOVE_TAK_LOG_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.start();<NEW_LINE>// worker registry<NEW_LINE>try {<NEW_LINE>this.workerRegistryClient.registry();<NEW_LINE>this.workerRegistryClient.setRegistryStoppable(this);<NEW_LINE>Set<String> workerZkPaths <MASK><NEW_LINE>this.workerRegistryClient.handleDeadServer(workerZkPaths, NodeType.WORKER, Constants.DELETE_OP);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// task execute manager<NEW_LINE>this.workerManagerThread.start();<NEW_LINE>// retry report task status<NEW_LINE>this.retryReportTaskStatusThread.start();<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(() -> {<NEW_LINE>if (Stopper.isRunning()) {<NEW_LINE>close("shutdownHook");<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} | = this.workerRegistryClient.getWorkerZkPaths(); |
1,044,943 | public AbstractFile attachDatabase(DataSource dataSource, String dbName, String dbPath, String dbAlias) throws SQLException {<NEW_LINE>try {<NEW_LINE>// find and copy DB files with exact name and path.<NEW_LINE>Collection<AppSQLiteDBFileBundle> dbFileBundles = findAndCopySQLiteDB(dataSource, <MASK><NEW_LINE>if (!dbFileBundles.isEmpty()) {<NEW_LINE>AppSQLiteDBFileBundle dbFileBundle = dbFileBundles.iterator().next();<NEW_LINE>// NON-NLS<NEW_LINE>String attachDbSql = String.format("ATTACH DATABASE '%s' AS '%s'", dbFileBundle.getFileCopy().getPath(), dbAlias);<NEW_LINE>statement.executeUpdate(attachDbSql);<NEW_LINE>return dbFileBundle.getAbstractFile();<NEW_LINE>}<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>Logger.getLogger(AppSQLiteDB.class.getName()).log(Level.SEVERE, String.format("Error attaching to App database files with name = '%s' and path = '%s'.", dbName, dbPath), ex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | dbName, true, dbPath, true); |
1,036,226 | protected List<Suggestion> requestHint(SourceCodeEditor sender, String text, int senderCursorPosition) {<NEW_LINE>String joinStr = joinField.getValue();<NEW_LINE>String whereStr = whereField.getValue();<NEW_LINE>// CAUTION: the magic entity name! The length is three character to match "{E}" length in query<NEW_LINE>String entityAlias = "a39";<NEW_LINE>int queryPosition = -1;<NEW_LINE>String queryStart = "select " + entityAlias + " from " + condition.getEntityMetaClass().getName() + " " + entityAlias + " ";<NEW_LINE>StringBuilder queryBuilder = new StringBuilder(queryStart);<NEW_LINE>if (StringUtils.isNotEmpty(joinStr)) {<NEW_LINE>if (sender == joinField) {<NEW_LINE>queryPosition = queryBuilder.length() + senderCursorPosition - 1;<NEW_LINE>}<NEW_LINE>if (!StringUtils.containsIgnoreCase(joinStr, "join") && !StringUtils.contains(joinStr, ",")) {<NEW_LINE>queryBuilder.append("join ").append(joinStr);<NEW_LINE>queryPosition += "join ".length();<NEW_LINE>} else {<NEW_LINE>queryBuilder.append(joinStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(whereStr)) {<NEW_LINE>if (sender == whereField) {<NEW_LINE>queryPosition = queryBuilder.length() + WHERE.length() + senderCursorPosition - 1;<NEW_LINE>}<NEW_LINE>queryBuilder.append(WHERE).append(whereStr);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>query = query.replace("{E}", entityAlias);<NEW_LINE>return JpqlSuggestionFactory.requestHint(query, queryPosition, sender.getAutoCompleteSupport(), senderCursorPosition);<NEW_LINE>} | String query = queryBuilder.toString(); |
108,486 | private void registerPrimaryVmHeartbeat(RegisterColoPrimaryCheckMsg msg, NoErrorCompletion completion) {<NEW_LINE>RegisterPrimaryVmHeartbeatCmd cmd = new RegisterPrimaryVmHeartbeatCmd();<NEW_LINE>cmd.<MASK><NEW_LINE>cmd.setVmInstanceUuid(msg.getVmInstanceUuid());<NEW_LINE>cmd.setHeartbeatPort(msg.getHeartbeatPort());<NEW_LINE>cmd.setTargetHostIp(msg.getTargetHostIp());<NEW_LINE>cmd.setColoPrimary(msg.isColoPrimary());<NEW_LINE>cmd.setRedirectNum(msg.getRedirectNum());<NEW_LINE>VmInstanceVO vm = dbf.findByUuid(msg.getVmInstanceUuid(), VmInstanceVO.class);<NEW_LINE>List<VolumeInventory> volumes = vm.getAllVolumes().stream().filter(v -> v.getType() == VolumeType.Data || v.getType() == VolumeType.Root).map(VolumeInventory::valueOf).collect(Collectors.toList());<NEW_LINE>cmd.setVolumes(VolumeTO.valueOf(volumes, KVMHostInventory.valueOf(getSelf())));<NEW_LINE>new Http<>(registerPrimaryVmHeartbeatPath, cmd, AgentResponse.class).call(new ReturnValueCompletion<AgentResponse>(msg, completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(AgentResponse ret) {<NEW_LINE>final StartColoSyncReply reply = new StartColoSyncReply();<NEW_LINE>if (!ret.isSuccess()) {<NEW_LINE>reply.setError(operr("unable to register colo heartbeat for vm[uuid:%s] on kvm host [uuid:%s, ip:%s], because %s", msg.getVmInstanceUuid(), self.getUuid(), self.getManagementIp(), ret.getError()));<NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("unable to register colo heartbeat for vm[uuid:%s] on kvm host[uuid:%s] success", msg.getVmInstanceUuid(), self.getUuid()));<NEW_LINE>}<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode err) {<NEW_LINE>final StartColoSyncReply reply = new StartColoSyncReply();<NEW_LINE>reply.setError(err);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setHostUuid(msg.getHostUuid()); |
885,370 | public final void update(EventBean[] newData, EventBean[] oldData) {<NEW_LINE>agentInstanceContext.getAuditProvider().view(<MASK><NEW_LINE>agentInstanceContext.getInstrumentationProvider().qViewProcessIRStream(lengthFirstFactory, newData, oldData);<NEW_LINE>OneEventCollection newDataToPost = null;<NEW_LINE>OneEventCollection oldDataToPost = null;<NEW_LINE>// add data points to the window as long as its not full, ignoring later events<NEW_LINE>if (newData != null) {<NEW_LINE>for (EventBean aNewData : newData) {<NEW_LINE>if (indexedEvents.size() < size) {<NEW_LINE>if (newDataToPost == null) {<NEW_LINE>newDataToPost = new OneEventCollection();<NEW_LINE>}<NEW_LINE>newDataToPost.add(aNewData);<NEW_LINE>indexedEvents.add(aNewData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldData != null) {<NEW_LINE>for (EventBean anOldData : oldData) {<NEW_LINE>boolean removed = indexedEvents.remove(anOldData);<NEW_LINE>if (removed) {<NEW_LINE>if (oldDataToPost == null) {<NEW_LINE>oldDataToPost = new OneEventCollection();<NEW_LINE>}<NEW_LINE>oldDataToPost.add(anOldData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If there are child views, call update method<NEW_LINE>if ((child != null) && ((newDataToPost != null) || (oldDataToPost != null))) {<NEW_LINE>EventBean[] nd = (newDataToPost != null) ? newDataToPost.toArray() : null;<NEW_LINE>EventBean[] od = (oldDataToPost != null) ? oldDataToPost.toArray() : null;<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qViewIndicate(lengthFirstFactory, nd, od);<NEW_LINE>child.update(nd, od);<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aViewIndicate();<NEW_LINE>}<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aViewProcessIRStream();<NEW_LINE>} | newData, oldData, agentInstanceContext, lengthFirstFactory); |
1,386,163 | public void dropPartition(MetastoreContext metastoreContext, String databaseName, String tableName, List<String> parts, boolean deleteData) {<NEW_LINE>Table table = getTableOrElseThrow(metastoreContext, databaseName, tableName);<NEW_LINE>Partition partition = getPartition(metastoreContext, databaseName, tableName, parts).orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), parts));<NEW_LINE>try {<NEW_LINE>stats.getDeletePartition().record(() -> glueClient.deletePartition(new DeletePartitionRequest().withCatalogId(catalogId).withDatabaseName(databaseName).withTableName(tableName).withPartitionValues(parts)));<NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>throw new PrestoException(HIVE_METASTORE_ERROR, e);<NEW_LINE>}<NEW_LINE>String partLocation = partition<MASK><NEW_LINE>if (deleteData && isManagedTable(table) && !isNullOrEmpty(partLocation)) {<NEW_LINE>deleteDir(hdfsContext, hdfsEnvironment, new Path(partLocation), true);<NEW_LINE>}<NEW_LINE>} | .getStorage().getLocation(); |
1,813,872 | public Result apply(AggregationNode node, Captures captures, Context context) {<NEW_LINE>checkState(node.getSource() != null);<NEW_LINE>boolean changed = false;<NEW_LINE>ImmutableMap.Builder<VariableReferenceExpression, AggregationNode<MASK><NEW_LINE>for (Map.Entry<VariableReferenceExpression, AggregationNode.Aggregation> entry : node.getAggregations().entrySet()) {<NEW_LINE>AggregationNode.Aggregation rewritten = rewriteAggregation(entry.getValue(), context);<NEW_LINE>rewrittenAggregation.put(entry.getKey(), rewritten);<NEW_LINE>if (!rewritten.equals(entry.getValue())) {<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>AggregationNode aggregationNode = new AggregationNode(node.getSourceLocation(), node.getId(), node.getSource(), rewrittenAggregation.build(), node.getGroupingSets(), node.getPreGroupedVariables(), node.getStep(), node.getHashVariable(), node.getGroupIdVariable());<NEW_LINE>return Result.ofPlanNode(aggregationNode);<NEW_LINE>}<NEW_LINE>return Result.empty();<NEW_LINE>} | .Aggregation> rewrittenAggregation = builder(); |
930,765 | public final JsonmembersContext jsonmembers() throws RecognitionException {<NEW_LINE>JsonmembersContext _localctx = new JsonmembersContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 522, RULE_jsonmembers);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(3375);<NEW_LINE>jsonpair();<NEW_LINE>setState(3380);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().<MASK><NEW_LINE>while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(3376);<NEW_LINE>match(COMMA);<NEW_LINE>setState(3377);<NEW_LINE>jsonpair();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(3382);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 469, _ctx);<NEW_LINE>}<NEW_LINE>setState(3384);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == COMMA) {<NEW_LINE>{<NEW_LINE>setState(3383);<NEW_LINE>match(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | adaptivePredict(_input, 469, _ctx); |
1,235,003 | public void encodeTerm(DataOutput out, FieldInfo fieldInfo, BlockTermState _state, boolean absolute) throws IOException {<NEW_LINE>IntBlockTermState state = (IntBlockTermState) _state;<NEW_LINE>if (absolute) {<NEW_LINE>lastState = emptyState;<NEW_LINE>assert lastState.docStartFP == 0;<NEW_LINE>}<NEW_LINE>if (lastState.singletonDocID != -1 && state.singletonDocID != -1 && state.docStartFP == lastState.docStartFP) {<NEW_LINE>// With runs of rare values such as ID fields, the increment of pointers in the docs file is<NEW_LINE>// often 0.<NEW_LINE>// Furthermore some ID schemes like auto-increment IDs or Flake IDs are monotonic, so we<NEW_LINE>// encode the delta<NEW_LINE>// between consecutive doc IDs to save space.<NEW_LINE>final long delta = (long) state.singletonDocID - lastState.singletonDocID;<NEW_LINE>out.writeVLong((BitUtil.zigZagEncode(delta) << 1) | 0x01);<NEW_LINE>} else {<NEW_LINE>out.writeVLong((state.docStartFP - lastState.docStartFP) << 1);<NEW_LINE>if (state.singletonDocID != -1) {<NEW_LINE>out.writeVInt(state.singletonDocID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (writePositions) {<NEW_LINE>out.writeVLong(state.posStartFP - lastState.posStartFP);<NEW_LINE>if (writePayloads || writeOffsets) {<NEW_LINE>out.writeVLong(state.payStartFP - lastState.payStartFP);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (writePositions) {<NEW_LINE>if (state.lastPosBlockOffset != -1) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (state.skipOffset != -1) {<NEW_LINE>out.writeVLong(state.skipOffset);<NEW_LINE>}<NEW_LINE>lastState = state;<NEW_LINE>} | out.writeVLong(state.lastPosBlockOffset); |
230,132 | private RelNode aggregateCorrelatorOutput(Correlate correlate, Project project, Set<Integer> isCount) {<NEW_LINE>final RelNode left = correlate.getLeft();<NEW_LINE>final JoinRelType joinType = correlate.getJoinType();<NEW_LINE>// now create the new project<NEW_LINE>final List<Pair<RexNode, String>> newProjects = new ArrayList<>();<NEW_LINE>// Project everything from the LHS and then those from the original<NEW_LINE>// project<NEW_LINE>final List<RelDataTypeField> leftInputFields = left<MASK><NEW_LINE>for (int i = 0; i < leftInputFields.size(); i++) {<NEW_LINE>newProjects.add(RexInputRef.of2(i, leftInputFields));<NEW_LINE>}<NEW_LINE>// Marked where the projected expr is coming from so that the types will<NEW_LINE>// become nullable for the original projections which are now coming out<NEW_LINE>// of the nullable side of the OJ.<NEW_LINE>boolean projectPulledAboveLeftCorrelator = joinType.generatesNullsOnRight();<NEW_LINE>for (Pair<RexNode, String> pair : project.getNamedProjects()) {<NEW_LINE>RexNode newProjExpr = removeCorrelationExpr(pair.left, projectPulledAboveLeftCorrelator, isCount);<NEW_LINE>newProjects.add(Pair.of(newProjExpr, pair.right));<NEW_LINE>}<NEW_LINE>return relBuilder.push(correlate).projectNamed(Pair.left(newProjects), Pair.right(newProjects), true).build();<NEW_LINE>} | .getRowType().getFieldList(); |
94,749 | public void testPurgeMaxSize_3() throws Exception {<NEW_LINE>RemoteFile binaryLogDir = null;<NEW_LINE>RemoteFile binaryTraceDir = null;<NEW_LINE>NumberFormat nf = NumberFormat.getInstance();<NEW_LINE>server.updateServerConfiguration(new File(server.pathToAutoFVTTestFiles, "server-HPELPurgeMaxSizeTest_2.xml"));<NEW_LINE>// Short pause to ensure that the configuration is updated.<NEW_LINE>Thread.sleep(MAX_WAIT_TIME_FOR_CONFIG_UPDATE);<NEW_LINE>// write enough records to new log repository updated.<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "Writing log records to fill binary log repository.");<NEW_LINE>long loopsPerFullRepository = (<MASK><NEW_LINE>logger.info("writing " + nf.format(loopsPerFullRepository) + " log loops to produce " + 200 + " MB of data.");<NEW_LINE>logger.info("Writing FINE Level Trace entries: ");<NEW_LINE>CommonTasks.createLogEntries(server, loggerName, "Sample log record for the test case " + name.getMethodName() + ".", Level.FINE, (int) loopsPerFullRepository, CommonTasks.TRACE, 0);<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "Verifying the repository size ");<NEW_LINE>binaryLogDir = server.getFileFromLibertyServerRoot("logs/logdata");<NEW_LINE>binaryTraceDir = server.getFileFromLibertyServerRoot("logs/tracedata");<NEW_LINE>long binaryLogSize = getSizeOfBinaryLogs(binaryLogDir);<NEW_LINE>long binaryTraceSize = getSizeOfBinaryLogs(binaryTraceDir);<NEW_LINE>logger.info("The current size of BinaryLog files in " + binaryLogDir.getAbsolutePath() + " is " + nf.format(binaryLogSize));<NEW_LINE>assertTrue("BinaryLog Repository size should be less than 50 MB ", binaryLogSize < (MAX_DEFAULT_PURGE_SIZE * 1024 * 1024));<NEW_LINE>logger.info("The current size of BinaryTrace files in " + binaryTraceDir.getAbsolutePath() + " is " + nf.format(binaryTraceSize));<NEW_LINE>assertTrue("Binarytrace Repository size should be less than 200 MB ", binaryTraceSize < (200 * 1024 * 1024));<NEW_LINE>} | 200 * 1024 * 1024) / 200; |
416,506 | public void filterWsdlRequest(SubmitContext context, WsdlRequest wsdlRequest) {<NEW_LINE>HttpRequest postMethod = (HttpRequest) context.getProperty(BaseHttpRequestTransport.HTTP_METHOD);<NEW_LINE>WsdlInterface wsdlInterface = (WsdlInterface) wsdlRequest.getOperation().getInterface();<NEW_LINE>// init content-type and encoding<NEW_LINE>String encoding = System.getProperty("soapui.request.encoding", wsdlRequest.getEncoding());<NEW_LINE>SoapVersion soapVersion = wsdlInterface.getSoapVersion();<NEW_LINE>String soapAction = wsdlRequest.isSkipSoapAction() ? null : wsdlRequest.getAction();<NEW_LINE>postMethod.setHeader("Content-Type", soapVersion.getContentTypeHttpHeader(encoding, soapAction));<NEW_LINE>if (!wsdlRequest.isSkipSoapAction()) {<NEW_LINE>String <MASK><NEW_LINE>if (soapActionHeader != null) {<NEW_LINE>postMethod.setHeader("SOAPAction", soapActionHeader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | soapActionHeader = soapVersion.getSoapActionHeader(soapAction); |
252,757 | int forceVariation(int poolSize, int calculatedAdjustment, long intervalCompleted, boolean lowActivity) {<NEW_LINE>// 08/08/2012: Count intervals without change<NEW_LINE>if (calculatedAdjustment == 0 && intervalCompleted != 0) {<NEW_LINE>consecutiveNoAdjustment++;<NEW_LINE>} else {<NEW_LINE>consecutiveNoAdjustment = 0;<NEW_LINE>}<NEW_LINE>int forcedAdjustment = calculatedAdjustment;<NEW_LINE>if (consecutiveNoAdjustment >= MAX_INTERVALS_WITHOUT_CHANGE) {<NEW_LINE>consecutiveNoAdjustment = 0;<NEW_LINE>if (flipCoin() && poolSize + poolIncrement <= maxThreads) {<NEW_LINE>// don't force an increase when pool activity is low<NEW_LINE>if (!lowActivity) {<NEW_LINE>forcedAdjustment = poolIncrement;<NEW_LINE>if (tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if ((poolSize - poolDecrement) >= currentMinimumPoolSize) {<NEW_LINE>forcedAdjustment = -poolDecrement;<NEW_LINE>if (tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "force variation", (" forced decrease: " + forcedAdjustment));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return forcedAdjustment;<NEW_LINE>} | "force variation", (" forced increase: " + forcedAdjustment)); |
1,634,753 | public static ListQualityRulesResponse unmarshall(ListQualityRulesResponse listQualityRulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listQualityRulesResponse.setRequestId(_ctx.stringValue("ListQualityRulesResponse.RequestId"));<NEW_LINE>listQualityRulesResponse.setHttpStatusCode(_ctx.integerValue("ListQualityRulesResponse.HttpStatusCode"));<NEW_LINE>listQualityRulesResponse.setErrorMessage(_ctx.stringValue("ListQualityRulesResponse.ErrorMessage"));<NEW_LINE>listQualityRulesResponse.setSuccess(_ctx.booleanValue("ListQualityRulesResponse.Success"));<NEW_LINE>listQualityRulesResponse.setErrorCode(_ctx.stringValue("ListQualityRulesResponse.ErrorCode"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListQualityRulesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListQualityRulesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.longValue("ListQualityRulesResponse.Data.TotalCount"));<NEW_LINE>List<RulesItem> rules = new ArrayList<RulesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListQualityRulesResponse.Data.Rules.Length"); i++) {<NEW_LINE>RulesItem rulesItem = new RulesItem();<NEW_LINE>rulesItem.setBlockType(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].BlockType"));<NEW_LINE>rulesItem.setOnDutyAccountName(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].OnDutyAccountName"));<NEW_LINE>rulesItem.setProperty(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].Property"));<NEW_LINE>rulesItem.setWarningThreshold(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].WarningThreshold"));<NEW_LINE>rulesItem.setTableName(_ctx.stringValue<MASK><NEW_LINE>rulesItem.setOnDuty(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].OnDuty"));<NEW_LINE>rulesItem.setComment(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].Comment"));<NEW_LINE>rulesItem.setRuleCheckerRelationId(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].RuleCheckerRelationId"));<NEW_LINE>rulesItem.setFixCheck(_ctx.booleanValue("ListQualityRulesResponse.Data.Rules[" + i + "].FixCheck"));<NEW_LINE>rulesItem.setMethodId(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].MethodId"));<NEW_LINE>rulesItem.setTemplateName(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].TemplateName"));<NEW_LINE>rulesItem.setTrend(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].Trend"));<NEW_LINE>rulesItem.setHistoryWarningThreshold(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].HistoryWarningThreshold"));<NEW_LINE>rulesItem.setRuleType(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].RuleType"));<NEW_LINE>rulesItem.setMatchExpression(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].MatchExpression"));<NEW_LINE>rulesItem.setProjectName(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].ProjectName"));<NEW_LINE>rulesItem.setPropertyKey(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].PropertyKey"));<NEW_LINE>rulesItem.setCriticalThreshold(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].CriticalThreshold"));<NEW_LINE>rulesItem.setHistoryCriticalThreshold(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].HistoryCriticalThreshold"));<NEW_LINE>rulesItem.setMethodName(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].MethodName"));<NEW_LINE>rulesItem.setCheckerId(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].CheckerId"));<NEW_LINE>rulesItem.setEntityId(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].EntityId"));<NEW_LINE>rulesItem.setExpectValue(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].ExpectValue"));<NEW_LINE>rulesItem.setTemplateId(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].TemplateId"));<NEW_LINE>rulesItem.setId(_ctx.integerValue("ListQualityRulesResponse.Data.Rules[" + i + "].Id"));<NEW_LINE>rulesItem.setRuleName(_ctx.stringValue("ListQualityRulesResponse.Data.Rules[" + i + "].RuleName"));<NEW_LINE>rules.add(rulesItem);<NEW_LINE>}<NEW_LINE>data.setRules(rules);<NEW_LINE>listQualityRulesResponse.setData(data);<NEW_LINE>return listQualityRulesResponse;<NEW_LINE>} | ("ListQualityRulesResponse.Data.Rules[" + i + "].TableName")); |
1,485,694 | public void onNewUser(User user) {<NEW_LINE>// New user, direct them to create an account with email/password<NEW_LINE>// if account creation is enabled in SignInIntentBuilder<NEW_LINE>TextInputLayout emailLayout = findViewById(R.id.email_layout);<NEW_LINE>AuthUI.IdpConfig emailConfig = ProviderUtils.getConfigFromIdps(getFlowParams().providers, EmailAuthProvider.PROVIDER_ID);<NEW_LINE>if (emailConfig == null) {<NEW_LINE>emailConfig = ProviderUtils.getConfigFromIdps(getFlowParams().providers, EMAIL_LINK_PROVIDER);<NEW_LINE>}<NEW_LINE>if (emailConfig.getParams().getBoolean(ExtraConstants.ALLOW_NEW_EMAILS, true)) {<NEW_LINE>FragmentTransaction ft = getSupportFragmentManager().beginTransaction();<NEW_LINE>if (emailConfig.getProviderId().equals(EMAIL_LINK_PROVIDER)) {<NEW_LINE>showRegisterEmailLinkFragment(emailConfig, user.getEmail());<NEW_LINE>} else {<NEW_LINE>RegisterEmailFragment fragment = RegisterEmailFragment.newInstance(user);<NEW_LINE>ft.replace(R.id.fragment_register_email, fragment, RegisterEmailFragment.TAG);<NEW_LINE>if (emailLayout != null) {<NEW_LINE>String emailFieldName = getString(R.string.fui_email_field_name);<NEW_LINE>ViewCompat.setTransitionName(emailLayout, emailFieldName);<NEW_LINE>ft.addSharedElement(emailLayout, emailFieldName);<NEW_LINE>}<NEW_LINE>ft.disallowAddToBackStack().commit();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>emailLayout.setError(getString<MASK><NEW_LINE>}<NEW_LINE>} | (R.string.fui_error_email_does_not_exist)); |
368,564 | public JSDynamicObject round(Object thisObj, Object roundToParam, @Cached("create()") JSToNumberNode toNumber, @Cached TruffleString.EqualNode equalNode) {<NEW_LINE>JSTemporalInstantObject instant = requireTemporalInstant(thisObj);<NEW_LINE>if (roundToParam == Undefined.instance) {<NEW_LINE>throw TemporalErrors.createTypeErrorOptionsUndefined();<NEW_LINE>}<NEW_LINE>JSDynamicObject roundTo;<NEW_LINE>if (Strings.isTString(roundToParam)) {<NEW_LINE>roundTo = JSOrdinary.createWithNullPrototype(getContext());<NEW_LINE>JSRuntime.createDataPropertyOrThrow(roundTo, TemporalConstants.SMALLEST_UNIT, JSRuntime.toStringIsString(roundToParam));<NEW_LINE>} else {<NEW_LINE>roundTo = getOptionsObject(roundToParam);<NEW_LINE>}<NEW_LINE>Unit smallestUnit = toSmallestTemporalUnit(roundTo, <MASK><NEW_LINE>if (smallestUnit == Unit.EMPTY) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw TemporalErrors.createRangeErrorSmallestUnitExpected();<NEW_LINE>}<NEW_LINE>RoundingMode roundingMode = toTemporalRoundingMode(roundTo, HALF_EXPAND, equalNode);<NEW_LINE>double maximum;<NEW_LINE>if (Unit.HOUR == smallestUnit) {<NEW_LINE>maximum = 24;<NEW_LINE>} else if (Unit.MINUTE == smallestUnit) {<NEW_LINE>maximum = 1440;<NEW_LINE>} else if (Unit.SECOND == smallestUnit) {<NEW_LINE>maximum = 86400;<NEW_LINE>} else if (Unit.MILLISECOND == smallestUnit) {<NEW_LINE>maximum = 8.64 * 10_000_000;<NEW_LINE>} else if (Unit.MICROSECOND == smallestUnit) {<NEW_LINE>maximum = 8.64 * 10_000_000_000d;<NEW_LINE>} else {<NEW_LINE>assert Unit.NANOSECOND == smallestUnit;<NEW_LINE>maximum = 8.64 * 10_000_000_000_000d;<NEW_LINE>}<NEW_LINE>double roundingIncrement = TemporalUtil.toTemporalRoundingIncrement(roundTo, maximum, true, isObjectNode, toNumber);<NEW_LINE>BigInteger roundedNs = TemporalUtil.roundTemporalInstant(instant.getNanoseconds(), (long) roundingIncrement, smallestUnit, roundingMode);<NEW_LINE>return JSTemporalInstant.create(getContext(), new BigInt(roundedNs));<NEW_LINE>} | TemporalUtil.listYMWD, null, equalNode); |
1,068,017 | public void reportInvalidOptions(EventHandler reporter, BuildOptions buildOptions) {<NEW_LINE>PythonOptions pythonOpts = <MASK><NEW_LINE>Options opts = buildOptions.get(Options.class);<NEW_LINE>if (pythonOpts.incompatibleUsePythonToolchains) {<NEW_LINE>// Forbid deprecated flags.<NEW_LINE>if (opts.python2Path != null) {<NEW_LINE>reporter.handle(Event.error("`--python2_path` is disabled by `--incompatible_use_python_toolchains`. Since " + "`--python2_path` is a deprecated no-op, there is no need to pass it."));<NEW_LINE>}<NEW_LINE>if (opts.python3Path != null) {<NEW_LINE>reporter.handle(Event.error("`--python3_path` is disabled by `--incompatible_use_python_toolchains`. Since " + "`--python3_path` is a deprecated no-op, there is no need to pass it."));<NEW_LINE>}<NEW_LINE>if (opts.pythonTop != null) {<NEW_LINE>reporter.handle(Event.error("`--python_top` is disabled by `--incompatible_use_python_toolchains`. Instead of " + "configuring the Python runtime directly, register a Python toolchain. See " + "https://github.com/bazelbuild/bazel/issues/7899. You can temporarily revert " + "to the legacy flag-based way of specifying toolchains by setting " + "`--incompatible_use_python_toolchains=false`."));<NEW_LINE>}<NEW_LINE>// TODO(#7901): Also prohibit --python_path here.<NEW_LINE>}<NEW_LINE>} | buildOptions.get(PythonOptions.class); |
812,749 | private JsonDeserializer<Object> _findDelegateDeserializer(DeserializationContext ctxt, JavaType delegateType, AnnotatedWithParams delegateCreator) throws JsonMappingException {<NEW_LINE>// Need to create a temporary property to allow contextual deserializers:<NEW_LINE>BeanProperty.Std property = new BeanProperty.Std(TEMP_PROPERTY_NAME, delegateType, null, delegateCreator, PropertyMetadata.STD_OPTIONAL);<NEW_LINE><MASK><NEW_LINE>if (td == null) {<NEW_LINE>td = ctxt.getConfig().findTypeDeserializer(delegateType);<NEW_LINE>}<NEW_LINE>// 04-May-2018, tatu: [databind#2021] check if there's custom deserializer attached<NEW_LINE>// to type (resolved from parameter)<NEW_LINE>JsonDeserializer<Object> dd = delegateType.getValueHandler();<NEW_LINE>if (dd == null) {<NEW_LINE>dd = findDeserializer(ctxt, delegateType, property);<NEW_LINE>} else {<NEW_LINE>dd = (JsonDeserializer<Object>) ctxt.handleSecondaryContextualization(dd, property, delegateType);<NEW_LINE>}<NEW_LINE>if (td != null) {<NEW_LINE>td = td.forProperty(property);<NEW_LINE>return new TypeWrappedDeserializer(td, dd);<NEW_LINE>}<NEW_LINE>return dd;<NEW_LINE>} | TypeDeserializer td = delegateType.getTypeHandler(); |
181,379 | public ExecutionListener parseExecutionListener(Element executionListenerElement, String ancestorElementId) {<NEW_LINE>ExecutionListener executionListener = null;<NEW_LINE>String className = executionListenerElement.attribute(PROPERTYNAME_CLASS);<NEW_LINE>String expression = executionListenerElement.attribute(PROPERTYNAME_EXPRESSION);<NEW_LINE>String delegateExpression = executionListenerElement.attribute(PROPERTYNAME_DELEGATE_EXPRESSION);<NEW_LINE>Element scriptElement = <MASK><NEW_LINE>if (className != null) {<NEW_LINE>if (className.isEmpty()) {<NEW_LINE>addError("Attribute 'class' cannot be empty", executionListenerElement, ancestorElementId);<NEW_LINE>} else {<NEW_LINE>executionListener = new ClassDelegateExecutionListener(className, parseFieldDeclarations(executionListenerElement));<NEW_LINE>}<NEW_LINE>} else if (expression != null) {<NEW_LINE>executionListener = new ExpressionExecutionListener(expressionManager.createExpression(expression));<NEW_LINE>} else if (delegateExpression != null) {<NEW_LINE>if (delegateExpression.isEmpty()) {<NEW_LINE>addError("Attribute 'delegateExpression' cannot be empty", executionListenerElement, ancestorElementId);<NEW_LINE>} else {<NEW_LINE>executionListener = new DelegateExpressionExecutionListener(expressionManager.createExpression(delegateExpression), parseFieldDeclarations(executionListenerElement));<NEW_LINE>}<NEW_LINE>} else if (scriptElement != null) {<NEW_LINE>try {<NEW_LINE>ExecutableScript executableScript = parseCamundaScript(scriptElement);<NEW_LINE>if (executableScript != null) {<NEW_LINE>executionListener = new ScriptExecutionListener(executableScript);<NEW_LINE>}<NEW_LINE>} catch (BpmnParseException e) {<NEW_LINE>addError(e, ancestorElementId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addError("Element 'class', 'expression', 'delegateExpression' or 'script' is mandatory on executionListener", executionListenerElement, ancestorElementId);<NEW_LINE>}<NEW_LINE>return executionListener;<NEW_LINE>} | executionListenerElement.elementNS(CAMUNDA_BPMN_EXTENSIONS_NS, "script"); |
1,201,822 | public Result process(CvPipeline pipeline) throws Exception {<NEW_LINE>Mat mat = pipeline.getWorkingImage();<NEW_LINE>List<Point> points = new ArrayList<>();<NEW_LINE>byte[] rowData = new byte[mat.cols()];<NEW_LINE>for (int row = 0, rows = mat.rows(); row < rows; row++) {<NEW_LINE>mat.<MASK><NEW_LINE>for (int col = 0, cols = mat.cols(); col < cols; col++) {<NEW_LINE>int pixel = ((int) rowData[col]) & 0xff;<NEW_LINE>if (pixel >= thresholdMin && pixel <= thresholdMax) {<NEW_LINE>points.add(new Point(col, row));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (points.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>MatOfPoint2f pointsMat = new MatOfPoint2f(points.toArray(new Point[] {}));<NEW_LINE>RotatedRect r = Imgproc.minAreaRect(pointsMat);<NEW_LINE>pointsMat.release();<NEW_LINE>return new Result(null, r);<NEW_LINE>} | get(row, 0, rowData); |
1,086,070 | public HollowHashIndexResult findMatches(Object... query) {<NEW_LINE>int hashCode = 0;<NEW_LINE>for (int i = 0; i < query.length; i++) {<NEW_LINE>if (query[i] == null)<NEW_LINE>throw new IllegalArgumentException("querying by null unsupported; i=" + i);<NEW_LINE>hashCode ^= HashCodes.hashInt(keyHashCode(query[i], i));<NEW_LINE>}<NEW_LINE>HollowHashIndexResult result;<NEW_LINE>HollowHashIndexState hashState;<NEW_LINE>do {<NEW_LINE>result = null;<NEW_LINE>hashState = hashStateVolatile;<NEW_LINE>long bucket <MASK><NEW_LINE>long hashBucketBit = bucket * hashState.getBitsPerMatchHashEntry();<NEW_LINE>boolean bucketIsEmpty = hashState.getMatchHashTable().getElementValue(hashBucketBit, hashState.getBitsPerTraverserField()[0]) == 0;<NEW_LINE>while (!bucketIsEmpty) {<NEW_LINE>if (matchIsEqual(hashState.getMatchHashTable(), hashBucketBit, query)) {<NEW_LINE>int selectSize = (int) hashState.getMatchHashTable().getElementValue(hashBucketBit + hashState.getBitsPerMatchHashKey(), hashState.getBitsPerSelectTableSize());<NEW_LINE>long selectBucketPointer = hashState.getMatchHashTable().getElementValue(hashBucketBit + hashState.getBitsPerMatchHashKey() + hashState.getBitsPerSelectTableSize(), hashState.getBitsPerSelectTablePointer());<NEW_LINE>result = new HollowHashIndexResult(hashState, selectBucketPointer, selectSize);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>bucket = (bucket + 1) & hashState.getMatchHashMask();<NEW_LINE>hashBucketBit = bucket * hashState.getBitsPerMatchHashEntry();<NEW_LINE>bucketIsEmpty = hashState.getMatchHashTable().getElementValue(hashBucketBit, hashState.getBitsPerTraverserField()[0]) == 0;<NEW_LINE>}<NEW_LINE>} while (hashState != hashStateVolatile);<NEW_LINE>return result;<NEW_LINE>} | = hashCode & hashState.getMatchHashMask(); |
1,613,102 | @Produces({ MediaType.APPLICATION_JSON })<NEW_LINE>@Operation(operationId = "deleteServiceConfig", summary = "Deletes a service configuration for given service ID and returns the old configuration.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = String.class))), @ApiResponse(responseCode = "204", description = "No old configuration"), @ApiResponse(responseCode = "500", description = "Configuration can not be deleted due to internal error") })<NEW_LINE>public Response deleteConfiguration(@PathParam("serviceId") @Parameter(description = "service ID") String serviceId) {<NEW_LINE>try {<NEW_LINE>Configuration <MASK><NEW_LINE>configurationService.delete(serviceId);<NEW_LINE>return oldConfiguration != null ? Response.ok(oldConfiguration).build() : Response.noContent().build();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.error("Cannot delete configuration for service {}: {}", serviceId, ex.getMessage(), ex);<NEW_LINE>return Response.status(Status.INTERNAL_SERVER_ERROR).build();<NEW_LINE>}<NEW_LINE>} | oldConfiguration = configurationService.get(serviceId); |
177,763 | void drawAverage(Graphics g) {<NEW_LINE>ScopePlot plot = visiblePlots.firstElement();<NEW_LINE>int i;<NEW_LINE>double avg = 0;<NEW_LINE>int ipa = plot.ptr + scopePointCount - rect.width;<NEW_LINE>double[] maxV = plot.maxValues;<NEW_LINE>double[] minV = plot.minValues;<NEW_LINE>double mid = (maxValue + minValue) / 2;<NEW_LINE>int state = -1;<NEW_LINE>// skip zeroes<NEW_LINE>for (i = 0; i != rect.width; i++) {<NEW_LINE>int ip = (i + <MASK><NEW_LINE>if (maxV[ip] != 0) {<NEW_LINE>if (maxV[ip] > mid)<NEW_LINE>state = 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int firstState = -state;<NEW_LINE>int start = i;<NEW_LINE>int end = 0;<NEW_LINE>int waveCount = 0;<NEW_LINE>double endAvg = 0;<NEW_LINE>for (; i != rect.width; i++) {<NEW_LINE>int ip = (i + ipa) & (scopePointCount - 1);<NEW_LINE>boolean sw = false;<NEW_LINE>// switching polarity?<NEW_LINE>if (state == 1) {<NEW_LINE>if (maxV[ip] < mid)<NEW_LINE>sw = true;<NEW_LINE>} else if (minV[ip] > mid)<NEW_LINE>sw = true;<NEW_LINE>if (sw) {<NEW_LINE>state = -state;<NEW_LINE>// completed a full cycle?<NEW_LINE>if (firstState == state) {<NEW_LINE>if (waveCount == 0) {<NEW_LINE>start = i;<NEW_LINE>firstState = state;<NEW_LINE>avg = 0;<NEW_LINE>}<NEW_LINE>waveCount++;<NEW_LINE>end = i;<NEW_LINE>endAvg = avg;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (waveCount > 0) {<NEW_LINE>double m = (maxV[ip] + minV[ip]) * .5;<NEW_LINE>avg += m;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (waveCount > 1) {<NEW_LINE>avg = (endAvg / (end - start));<NEW_LINE>drawInfoText(g, plot.getUnitText(avg) + CirSim.LS(" average"));<NEW_LINE>}<NEW_LINE>} | ipa) & (scopePointCount - 1); |
1,666,064 | public void filter(String url, byte[] content, DocumentFragment doc, ParseResult parse) {<NEW_LINE>// check whether the metadata already contains a lang value<NEW_LINE>// in which case we normalise its value and use it<NEW_LINE>Metadata m = parse.get(url).getMetadata();<NEW_LINE>String extractedValue = m.getFirstValue(extractedKeyName);<NEW_LINE>if (StringUtils.isNotBlank(extractedValue) && extractedValue.length() > 1) {<NEW_LINE>extractedValue = extractedValue.substring(0, 2).toLowerCase(Locale.ENGLISH);<NEW_LINE>LOG.info("Lang: {} extracted from page for {}", extractedValue, url);<NEW_LINE>m.setValue(mdKey, extractedValue);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String text = parse.get(url).getText();<NEW_LINE>if (StringUtils.isBlank(text)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (text.length() > maxTextLength) {<NEW_LINE>text = <MASK><NEW_LINE>}<NEW_LINE>TextObject textObject = textObjectFactory.forText(text);<NEW_LINE>synchronized (languageDetector) {<NEW_LINE>List<DetectedLanguage> probs = languageDetector.getProbabilities(textObject);<NEW_LINE>if (probs == null || probs.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (DetectedLanguage lang : probs) {<NEW_LINE>if (lang.getProbability() >= minProb) {<NEW_LINE>String code = lang.getLocale().getLanguage();<NEW_LINE>parse.get(url).getMetadata().addValue(mdKey, code);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | text.substring(0, maxTextLength); |
1,123,540 | private AuthnRequest createAuthnRequest(Saml2AuthenticationRequestContext context) {<NEW_LINE>String issuer = context.getIssuer();<NEW_LINE>String destination = context.getDestination();<NEW_LINE>String assertionConsumerServiceUrl = context.getAssertionConsumerServiceUrl();<NEW_LINE>Saml2MessageBinding protocolBinding = <MASK><NEW_LINE>AuthnRequest auth = this.authnRequestBuilder.buildObject();<NEW_LINE>if (auth.getID() == null) {<NEW_LINE>auth.setID("ARQ" + UUID.randomUUID().toString().substring(1));<NEW_LINE>}<NEW_LINE>if (auth.getIssueInstant() == null) {<NEW_LINE>auth.setIssueInstant(new DateTime(this.clock.millis()));<NEW_LINE>}<NEW_LINE>if (auth.isForceAuthn() == null) {<NEW_LINE>auth.setForceAuthn(Boolean.FALSE);<NEW_LINE>}<NEW_LINE>if (auth.isPassive() == null) {<NEW_LINE>auth.setIsPassive(Boolean.FALSE);<NEW_LINE>}<NEW_LINE>if (auth.getProtocolBinding() == null) {<NEW_LINE>auth.setProtocolBinding(protocolBinding.getUrn());<NEW_LINE>}<NEW_LINE>Issuer iss = this.issuerBuilder.buildObject();<NEW_LINE>iss.setValue(issuer);<NEW_LINE>auth.setIssuer(iss);<NEW_LINE>auth.setDestination(destination);<NEW_LINE>auth.setAssertionConsumerServiceURL(assertionConsumerServiceUrl);<NEW_LINE>return auth;<NEW_LINE>} | this.protocolBindingResolver.convert(context); |
1,737,911 | private void extractPoiAdditionals(Collection<PoiType> poiAdditionals, Map<String, List<PoiType>> additionalsMap, Set<String> excludedPoiAdditionalCategories, boolean extractAll) {<NEW_LINE>for (PoiType poiType : poiAdditionals) {<NEW_LINE>String category = poiType.getPoiAdditionalCategory();<NEW_LINE>if (category == null) {<NEW_LINE>category = "";<NEW_LINE>}<NEW_LINE>if (excludedPoiAdditionalCategories != null && excludedPoiAdditionalCategories.contains(category)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (collapsedCategories.contains(category) && !extractAll) {<NEW_LINE>if (!additionalsMap.containsKey(category)) {<NEW_LINE>additionalsMap.put(category, new ArrayList<PoiType>());<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean showAll = showAllCategories.contains(category) || extractAll;<NEW_LINE>String keyName = poiType.getKeyName().replace('_', ':').toLowerCase();<NEW_LINE>if (!poiAdditionalsTranslations.containsKey(poiType)) {<NEW_LINE>poiAdditionalsTranslations.put(poiType, poiType.getTranslation());<NEW_LINE>}<NEW_LINE>if (showAll || poiType.isTopVisible() || selectedPoiAdditionals.contains(keyName.replace(' ', ':'))) {<NEW_LINE>List<PoiType> <MASK><NEW_LINE>if (adds == null) {<NEW_LINE>adds = new ArrayList<>();<NEW_LINE>additionalsMap.put(category, adds);<NEW_LINE>}<NEW_LINE>if (!adds.contains(poiType)) {<NEW_LINE>adds.add(poiType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | adds = additionalsMap.get(category); |
1,535,749 | public IStatus switchBranch(String branchName, IProgressMonitor monitor) {<NEW_LINE>if (branchName == null) {<NEW_LINE>return new Status(IStatus.ERROR, GitPlugin.PLUGIN_ID, Messages.GitRepository_ERR_BranchNotProvided);<NEW_LINE>}<NEW_LINE>SubMonitor sub = SubMonitor.convert(monitor, 4);<NEW_LINE>try {<NEW_LINE>// Before switching branches, check for existence of every open project attached to this repo on the new<NEW_LINE>// branch!<NEW_LINE>// If it doesn't exist, close the project first!<NEW_LINE>// if we fail to switch branches, re-open the ones we auto-closed!<NEW_LINE>final Set<IProject> projectsNotExistingOnNewBranch = getProjectsThatDontExistOnBranch(branchName<MASK><NEW_LINE>// Now close all of the affectedProjects.<NEW_LINE>closeProjects(projectsNotExistingOnNewBranch, sub.newChild(1));<NEW_LINE>String oldBranchName = currentBranch.simpleRef().shortName();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IStatus result = execute(GitRepository.ReadWrite.WRITE, "checkout", branchName);<NEW_LINE>sub.worked(1);<NEW_LINE>if (result == null || !result.isOK()) {<NEW_LINE>openProjects(projectsNotExistingOnNewBranch, sub.newChild(1));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>_headRef = null;<NEW_LINE>readCurrentBranch();<NEW_LINE>fireBranchChangeEvent(oldBranchName, branchName);<NEW_LINE>sub.worked(1);<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>sub.done();<NEW_LINE>}<NEW_LINE>} | , sub.newChild(1)); |
414,733 | final private static DirContext syntaxDescs2SyntaxDefs(Attribute syntaxDescAttr, LdapSchemaCtx schemaRoot) throws NamingException {<NEW_LINE>NamingEnumeration<?> syntaxDescs;<NEW_LINE>Attributes syntaxDef;<NEW_LINE>LdapSchemaCtx syntaxDefTree;<NEW_LINE>// create the SyntaxDef subtree<NEW_LINE>Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);<NEW_LINE>attrs.put(SYNTAX_DEF_ATTRS[0], SYNTAX_DEF_ATTRS[1]);<NEW_LINE>syntaxDefTree = schemaRoot.setup(LdapSchemaCtx.SYNTAX_ROOT, SYNTAX_DEFINITION_NAME, attrs);<NEW_LINE>syntaxDescs = syntaxDescAttr.getAll();<NEW_LINE>String currentName;<NEW_LINE>while (syntaxDescs.hasMore()) {<NEW_LINE>String syntaxDesc = <MASK><NEW_LINE>try {<NEW_LINE>Object[] def = desc2Def(syntaxDesc);<NEW_LINE>currentName = (String) def[0];<NEW_LINE>syntaxDef = (Attributes) def[1];<NEW_LINE>syntaxDefTree.setup(LdapSchemaCtx.SYNTAX, currentName, syntaxDef);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>// error occurred while parsing, ignore current entry<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return syntaxDefTree;<NEW_LINE>} | (String) syntaxDescs.next(); |
583,874 | public WordprocessingMLPackage preprocess() throws Docx4JException {<NEW_LINE>Set<ContentAccessor> partList = getParts(wordMLPackage);<NEW_LINE>// Process repeats and conditionals.<NEW_LINE>try {<NEW_LINE>for (ContentAccessor part : partList) {<NEW_LINE>new TraversalUtil(part, shallowTraversor);<NEW_LINE>}<NEW_LINE>} catch (InputIntegrityException iie) {<NEW_LINE>// RuntimeException<NEW_LINE>throw new Docx4JException(iie.getMessage(), iie);<NEW_LINE>}<NEW_LINE>// Write our maps back to their parts<NEW_LINE>// XPaths<NEW_LINE>if (wordMLPackage.getMainDocumentPart().getXPathsPart() == null) {<NEW_LINE>// OpenDoPE XPaths part missing is ok if you are just processing w15 repeatingSection)");<NEW_LINE>log.info("No XPaths part; ok if you are just processing w15 repeatingSection");<NEW_LINE>} else {<NEW_LINE>wordMLPackage.getMainDocumentPart().getXPathsPart().getContents().getXpath().clear();<NEW_LINE>wordMLPackage.getMainDocumentPart().getXPathsPart().getContents().getXpath().addAll(xpathsMap.values());<NEW_LINE>}<NEW_LINE>// Conditions<NEW_LINE>if (wordMLPackage.getMainDocumentPart().getConditionsPart() != null) {<NEW_LINE>wordMLPackage.getMainDocumentPart().getConditionsPart().getContents().getCondition().clear();<NEW_LINE>wordMLPackage.getMainDocumentPart().getConditionsPart().getContents().getCondition().<MASK><NEW_LINE>}<NEW_LINE>log.debug(this.conditionTiming.toString());<NEW_LINE>// in seconds<NEW_LINE>log.debug("conditions in total: " + this.conditionTimingTotal / 1000);<NEW_LINE>return wordMLPackage;<NEW_LINE>} | addAll(conditionsMap.values()); |
580,110 | public void process(Version indexCreatedVersion, @Nullable MappingMetadata mappingMd, String concreteIndex) {<NEW_LINE>if (mappingMd != null) {<NEW_LINE>// might as well check for routing here<NEW_LINE>if (mappingMd.routingRequired() && routing == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ("".equals(id)) {<NEW_LINE>throw new IllegalArgumentException("if _id is specified it must not be empty");<NEW_LINE>}<NEW_LINE>// generate id if not already provided<NEW_LINE>if (id == null) {<NEW_LINE>assert autoGeneratedTimestamp == UNSET_AUTO_GENERATED_TIMESTAMP : "timestamp has already been generated!";<NEW_LINE>assert ifSeqNo == UNASSIGNED_SEQ_NO;<NEW_LINE>assert ifPrimaryTerm == UNASSIGNED_PRIMARY_TERM;<NEW_LINE>// extra paranoia<NEW_LINE>autoGeneratedTimestamp = Math.max(0, System.currentTimeMillis());<NEW_LINE>id(UUIDs.base64UUID());<NEW_LINE>}<NEW_LINE>} | throw new RoutingMissingException(concreteIndex, id); |
1,069,887 | final DecreaseStreamRetentionPeriodResult executeDecreaseStreamRetentionPeriod(DecreaseStreamRetentionPeriodRequest decreaseStreamRetentionPeriodRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(decreaseStreamRetentionPeriodRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DecreaseStreamRetentionPeriodRequest> request = null;<NEW_LINE>Response<DecreaseStreamRetentionPeriodResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DecreaseStreamRetentionPeriodRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(decreaseStreamRetentionPeriodRequest));<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, "Kinesis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DecreaseStreamRetentionPeriod");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DecreaseStreamRetentionPeriodResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DecreaseStreamRetentionPeriodResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,779,527 | public ListHumanTaskUisResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListHumanTaskUisResult listHumanTaskUisResult = new ListHumanTaskUisResult();<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 listHumanTaskUisResult;<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("HumanTaskUiSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listHumanTaskUisResult.setHumanTaskUiSummaries(new ListUnmarshaller<HumanTaskUiSummary>(HumanTaskUiSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listHumanTaskUisResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listHumanTaskUisResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,334,725 | public PMarkdownOptions addEmojiExtension(@Arg(type = HintType.ARRAY) @Optional("null") Memory options) {<NEW_LINE>parserExtensions.add(EmojiExtension.create());<NEW_LINE>Memory imageType = options.valueOfIndex("imageType");<NEW_LINE>if (!imageType.isNull()) {<NEW_LINE>this.options.set(EmojiExtension.USE_IMAGE_TYPE, EmojiImageType.valueOf(imageType.toString()));<NEW_LINE>}<NEW_LINE>Memory shortcutType = options.valueOfIndex("shortcutType");<NEW_LINE>if (!shortcutType.isNull()) {<NEW_LINE>this.options.set(EmojiExtension.USE_SHORTCUT_TYPE, EmojiShortcutType.valueOf<MASK><NEW_LINE>}<NEW_LINE>Memory imagePath = options.valueOfIndex("imagePath");<NEW_LINE>if (!shortcutType.isNull()) {<NEW_LINE>this.options.set(EmojiExtension.ROOT_IMAGE_PATH, imagePath.toString());<NEW_LINE>}<NEW_LINE>Memory imageClass = options.valueOfIndex("imageClass");<NEW_LINE>if (!shortcutType.isNull()) {<NEW_LINE>this.options.set(EmojiExtension.ATTR_IMAGE_CLASS, imageClass.toString());<NEW_LINE>}<NEW_LINE>Memory imageSize = options.valueOfIndex("imageSize");<NEW_LINE>if (!shortcutType.isNull()) {<NEW_LINE>this.options.set(EmojiExtension.ATTR_IMAGE_SIZE, imageSize.toString());<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | (shortcutType.toString())); |
1,268,845 | private TreeItem<Object> findOrCreateTreeItem(final TreeItem<Object> parent, final Object value) {<NEW_LINE>ObservableList<TreeItem<Object><MASK><NEW_LINE>TreeItem<Object> found = null;<NEW_LINE>int placeToInsert = 0;<NEW_LINE>boolean foundInsertPos = false;<NEW_LINE>for (TreeItem<Object> child : children) {<NEW_LINE>int stringCompare = child.getValue().toString().compareTo(value.toString());<NEW_LINE>if (stringCompare == 0) {<NEW_LINE>found = child;<NEW_LINE>break;<NEW_LINE>} else if (!foundInsertPos && stringCompare < 0) {<NEW_LINE>// make sure sub packages listed before classes in this package<NEW_LINE>if (not(child.getValue() instanceof MetaPackage && value instanceof MetaClass)) {<NEW_LINE>placeToInsert++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (child.getValue() instanceof MetaPackage && value instanceof MetaClass) {<NEW_LINE>placeToInsert++;<NEW_LINE>} else {<NEW_LINE>foundInsertPos = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (found == null) {<NEW_LINE>found = new TreeItem<>(value);<NEW_LINE>children.add(placeToInsert, found);<NEW_LINE>if (value instanceof MetaPackage) {<NEW_LINE>final String packageName = value.toString();<NEW_LINE>found.expandedProperty().addListener(new ChangeListener<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {<NEW_LINE>if (newValue != null) {<NEW_LINE>if (newValue == true) {<NEW_LINE>openPackageNodes.add(packageName);<NEW_LINE>} else {<NEW_LINE>openPackageNodes.remove(packageName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (sameVmCommand && openPackageNodes.contains(packageName)) {<NEW_LINE>found.setExpanded(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean hasCompiledChildren = false;<NEW_LINE>if (value instanceof MetaPackage && ((MetaPackage) value).hasCompiledClasses()) {<NEW_LINE>hasCompiledChildren = true;<NEW_LINE>} else if (value instanceof MetaClass && ((MetaClass) value).hasCompiledMethods()) {<NEW_LINE>hasCompiledChildren = true;<NEW_LINE>}<NEW_LINE>if (UserInterfaceUtil.IMAGE_TICK != null && hasCompiledChildren) {<NEW_LINE>found.setGraphic(new ImageView(UserInterfaceUtil.IMAGE_TICK));<NEW_LINE>}<NEW_LINE>return found;<NEW_LINE>} | > children = parent.getChildren(); |
84,934 | static void compileInternal(ModuleContext moduleContext, CompilerContext compilerContext) {<NEW_LINE>PackageID moduleCompilationId = moduleContext<MASK><NEW_LINE>String bootstrapLangLibName = System.getProperty("BOOTSTRAP_LANG_LIB");<NEW_LINE>if (bootstrapLangLibName != null) {<NEW_LINE>moduleContext.bootstrap.loadLangLib(compilerContext, moduleCompilationId);<NEW_LINE>}<NEW_LINE>org.wso2.ballerinalang.compiler.PackageCache packageCache = org.wso2.ballerinalang.compiler.PackageCache.getInstance(compilerContext);<NEW_LINE>SymbolEnter symbolEnter = SymbolEnter.getInstance(compilerContext);<NEW_LINE>CompilerPhaseRunner compilerPhaseRunner = CompilerPhaseRunner.getInstance(compilerContext);<NEW_LINE>BLangPackage pkgNode = (BLangPackage) TreeBuilder.createPackageNode();<NEW_LINE>pkgNode.moduleContextDataHolder = new ModuleContextDataHolder(moduleContext.isExported(), moduleContext.descriptor(), moduleContext.project.kind(), moduleContext.project.buildOptions().skipTests());<NEW_LINE>packageCache.put(moduleCompilationId, pkgNode);<NEW_LINE>// Parse source files<NEW_LINE>for (DocumentContext documentContext : moduleContext.srcDocContextMap.values()) {<NEW_LINE>pkgNode.addCompilationUnit(documentContext.compilationUnit(compilerContext, moduleCompilationId, REGULAR_SOURCE));<NEW_LINE>}<NEW_LINE>if (!moduleContext.testSrcDocumentIds().isEmpty()) {<NEW_LINE>PackageID moduleTestCompilationId = moduleContext.descriptor().moduleTestCompilationId();<NEW_LINE>moduleContext.parseTestSources(pkgNode, moduleTestCompilationId, compilerContext);<NEW_LINE>}<NEW_LINE>pkgNode.pos = new BLangDiagnosticLocation(moduleContext.moduleName().toString(), 0, 0, 0, 0);<NEW_LINE>try {<NEW_LINE>symbolEnter.definePackage(pkgNode);<NEW_LINE>packageCache.putSymbol(pkgNode.packageID, pkgNode.symbol);<NEW_LINE>compilerPhaseRunner.performTypeCheckPhases(pkgNode);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>assert false : "Compilation failed due to" + (t.getMessage() != null ? ": " + t.getMessage() : " an unhandled exception");<NEW_LINE>compilerPhaseRunner.addDiagnosticForUnhandledException(pkgNode, t);<NEW_LINE>}<NEW_LINE>moduleContext.bLangPackage = pkgNode;<NEW_LINE>} | .descriptor().moduleCompilationId(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.