idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,089,637
// Use breadth first search to find methods are called more than once in call graph<NEW_LINE>private void finder1(PegCallGraph pcg) {<NEW_LINE>Set clinitMethods = pcg.getClinitMethods();<NEW_LINE>Iterator it = pcg.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object head = it.next();<NEW_LINE>// breadth first scan<NEW_LINE>Set<Object> gray <MASK><NEW_LINE>LinkedList<Object> queue = new LinkedList<Object>();<NEW_LINE>queue.add(head);<NEW_LINE>while (queue.size() > 0) {<NEW_LINE>Object root = queue.getFirst();<NEW_LINE>Iterator succsIt = pcg.getSuccsOf(root).iterator();<NEW_LINE>while (succsIt.hasNext()) {<NEW_LINE>Object succ = succsIt.next();<NEW_LINE>if (!gray.contains(succ)) {<NEW_LINE>gray.add(succ);<NEW_LINE>queue.addLast(succ);<NEW_LINE>} else if (clinitMethods.contains(succ)) {<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>multiCalledMethods.add((SootMethod) succ);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>queue.remove(root);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new HashSet<Object>();
1,577,763
private Table findTable(String alias) {<NEW_LINE>List<String> names = null;<NEW_LINE>if (tableScope == null) {<NEW_LINE>// no tables to find<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (ScopeChild child : tableScope.children) {<NEW_LINE>if (catalogReader.nameMatcher().matches(child.name, alias)) {<NEW_LINE>if (!(child.namespace.getNode() instanceof SqlIdentifier)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>names = ((SqlIdentifier) child.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (names == null || names.size() == 0) {<NEW_LINE>return null;<NEW_LINE>} else if (names.size() == 1) {<NEW_LINE>return findTable(catalogReader.getRootSchema(), names.get(0), catalogReader.nameMatcher().isCaseSensitive());<NEW_LINE>}<NEW_LINE>String schemaName = names.get(0);<NEW_LINE>String tableName = names.get(1);<NEW_LINE>CalciteSchema schema = catalogReader.getRootSchema().getSubSchemaMap().get(schemaName);<NEW_LINE>if (schema == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>CalciteSchema.TableEntry entry = schema.getTable(tableName, catalogReader.nameMatcher().isCaseSensitive());<NEW_LINE>return entry == null ? null : entry.getTable();<NEW_LINE>}
namespace.getNode()).names;
30,670
public static void initCache() {<NEW_LINE>final Instant startTime = Instant.now();<NEW_LINE>for (final PwmSetting pwmSetting : EnumSet.allOf(PwmSetting.class)) {<NEW_LINE>pwmSetting.getProperties();<NEW_LINE>pwmSetting.getFlags();<NEW_LINE>pwmSetting.getOptions();<NEW_LINE>pwmSetting.getLabel(PwmConstants.DEFAULT_LOCALE);<NEW_LINE>pwmSetting.getDescription(PwmConstants.DEFAULT_LOCALE);<NEW_LINE>pwmSetting.getExample(PwmSettingTemplateSet.getDefault());<NEW_LINE>pwmSetting.isRequired();<NEW_LINE>pwmSetting.isHidden();<NEW_LINE>pwmSetting.getLevel();<NEW_LINE>pwmSetting.getRegExPattern();<NEW_LINE>pwmSetting.getLDAPPermissionInfo();<NEW_LINE>pwmSetting.<MASK><NEW_LINE>}<NEW_LINE>for (final PwmSettingCategory pwmSettingCategory : EnumSet.allOf(PwmSettingCategory.class)) {<NEW_LINE>pwmSettingCategory.getLabel(PwmConstants.DEFAULT_LOCALE);<NEW_LINE>pwmSettingCategory.getDescription(PwmConstants.DEFAULT_LOCALE);<NEW_LINE>pwmSettingCategory.isHidden();<NEW_LINE>pwmSettingCategory.getLevel();<NEW_LINE>pwmSettingCategory.toMenuLocationDebug(null, PwmConstants.DEFAULT_LOCALE);<NEW_LINE>pwmSettingCategory.getScope();<NEW_LINE>pwmSettingCategory.getChildren();<NEW_LINE>pwmSettingCategory.getLevel();<NEW_LINE>pwmSettingCategory.getSettings();<NEW_LINE>}<NEW_LINE>LOGGER.trace(() -> "completed PwmSetting xml cache initialization", () -> TimeDuration.fromCurrent(startTime));<NEW_LINE>}
toMenuLocationDebug(null, PwmConstants.DEFAULT_LOCALE);
1,357,920
public int compareSp(Slice str1, Slice str2) {<NEW_LINE>UcaScanner scanner1 = new UcaScanner(str1);<NEW_LINE>UcaScanner scanner2 = new UcaScanner(str2);<NEW_LINE>int weight1, weight2;<NEW_LINE>do {<NEW_LINE>weight1 = scanner1.next();<NEW_LINE>weight2 = scanner2.next();<NEW_LINE>} while (weight1 == weight2 && weight1 > 0);<NEW_LINE>if (weight1 > 0 && weight2 < 0) {<NEW_LINE>weight2 = UCA_WEIGHTS[0][0x20 * UCA_LENGTH[0]];<NEW_LINE>do {<NEW_LINE>if (weight1 != weight2) {<NEW_LINE>return weight1 - weight2;<NEW_LINE>}<NEW_LINE>weight1 = scanner1.next();<NEW_LINE>} while (weight1 > 0);<NEW_LINE>return DIFF_IF_ONLY_ENDSPACE_DIFFERENCE ? 1 : 0;<NEW_LINE>}<NEW_LINE>if (weight1 < 0 && weight2 > 0) {<NEW_LINE>weight1 = UCA_WEIGHTS[0]<MASK><NEW_LINE>do {<NEW_LINE>if (weight1 != weight2) {<NEW_LINE>return weight1 - weight2;<NEW_LINE>}<NEW_LINE>weight2 = scanner2.next();<NEW_LINE>} while (weight2 > 0);<NEW_LINE>return DIFF_IF_ONLY_ENDSPACE_DIFFERENCE ? -1 : 0;<NEW_LINE>}<NEW_LINE>return weight1 - weight2;<NEW_LINE>}
[0x20 * UCA_LENGTH[0]];
81,448
public void detectAPILeaks(ASTNode typeNode, TypeBinding type) {<NEW_LINE>if (environment().useModuleSystem) {<NEW_LINE>// NB: using an ASTVisitor yields more precise locations than a TypeBindingVisitor would<NEW_LINE>ASTVisitor visitor = new ASTVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(SingleTypeReference typeReference, BlockScope scope) {<NEW_LINE>if (typeReference.resolvedType instanceof ReferenceBinding)<NEW_LINE>checkType((ReferenceBinding) typeReference.resolvedType, <MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(QualifiedTypeReference typeReference, BlockScope scope) {<NEW_LINE>if (typeReference.resolvedType instanceof ReferenceBinding)<NEW_LINE>checkType((ReferenceBinding) typeReference.resolvedType, typeReference.sourceStart, typeReference.sourceEnd);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(ArrayTypeReference typeReference, BlockScope scope) {<NEW_LINE>TypeBinding leafComponentType = typeReference.resolvedType.leafComponentType();<NEW_LINE>if (leafComponentType instanceof ReferenceBinding)<NEW_LINE>checkType((ReferenceBinding) leafComponentType, typeReference.sourceStart, typeReference.originalSourceEnd);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>private void checkType(ReferenceBinding referenceBinding, int sourceStart, int sourceEnd) {<NEW_LINE>if (!referenceBinding.isValidBinding())<NEW_LINE>return;<NEW_LINE>ModuleBinding otherModule = referenceBinding.module();<NEW_LINE>if (otherModule == otherModule.environment.javaBaseModule())<NEW_LINE>// always accessible<NEW_LINE>return;<NEW_LINE>if (!isFullyPublic(referenceBinding)) {<NEW_LINE>problemReporter().nonPublicTypeInAPI(referenceBinding, sourceStart, sourceEnd);<NEW_LINE>} else if (!referenceBinding.fPackage.isExported()) {<NEW_LINE>problemReporter().notExportedTypeInAPI(referenceBinding, sourceStart, sourceEnd);<NEW_LINE>} else if (isUnrelatedModule(referenceBinding.fPackage)) {<NEW_LINE>problemReporter().missingRequiresTransitiveForTypeInAPI(referenceBinding, sourceStart, sourceEnd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean isFullyPublic(ReferenceBinding referenceBinding) {<NEW_LINE>if (!referenceBinding.isPublic())<NEW_LINE>return false;<NEW_LINE>if (referenceBinding instanceof NestedTypeBinding)<NEW_LINE>return isFullyPublic(((NestedTypeBinding) referenceBinding).enclosingType);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean isUnrelatedModule(PackageBinding fPackage) {<NEW_LINE>ModuleBinding otherModule = fPackage.enclosingModule;<NEW_LINE>ModuleBinding thisModule = module();<NEW_LINE>if (thisModule != otherModule) {<NEW_LINE>return !thisModule.isTransitivelyRequired(otherModule);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>typeNode.traverse(visitor, this);<NEW_LINE>}<NEW_LINE>}
typeReference.sourceStart, typeReference.sourceEnd);
517,927
private void constructMenu(@Nonnull BlockMenuPreset preset) {<NEW_LINE>for (int i : border) {<NEW_LINE>preset.addItem(i, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());<NEW_LINE>}<NEW_LINE>for (int i : border_1) {<NEW_LINE>preset.addItem(i, new CustomItemStack(Material.LIME_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler());<NEW_LINE>}<NEW_LINE>for (int i : border_3) {<NEW_LINE>preset.addItem(i, new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler());<NEW_LINE>}<NEW_LINE>preset.addItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler());<NEW_LINE>preset.addItem(1, new CustomItemStack(getFuelIcon(), "&7Fuel Slot", "", "&fThis Slot accepts radioactive Fuel such as:", "&2Uranium &for &aNeptunium"), ChestMenuUtils.getEmptyClickHandler());<NEW_LINE>for (int i : border_2) {<NEW_LINE>preset.addItem(i, new CustomItemStack(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler());<NEW_LINE>}<NEW_LINE>if (needsCooling()) {<NEW_LINE>preset.addItem(7, new CustomItemStack(getCoolant(), "&bCoolant Slot", "", "&fThis Slot accepts Coolant Cells", "&4Without any Coolant Cells, your Reactor", "&4will explode"));<NEW_LINE>} else {<NEW_LINE>preset.addItem(7, new CustomItemStack(Material.BARRIER, "&bCoolant Slot", "", "&fThis Slot accepts Coolant Cells"));<NEW_LINE>for (int i : border_4) {<NEW_LINE>preset.addItem(i, new CustomItemStack(Material.BARRIER, "&cNo Coolant Required"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), ChestMenuUtils.getEmptyClickHandler());
654,846
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass());<NEW_LINE>Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>result.setData((List<Wo>) optional.get());<NEW_LINE>} else {<NEW_LINE>final List<Wo> wos = new ArrayList<>();<NEW_LINE>List<Component> os = emc.listAll(Component.class);<NEW_LINE>os.stream().filter(o -> ListTools.contains(Components.SYSTEM_NAME_NAMES, o.getName())).sorted(Comparator.comparing(Component::getOrderNumber, Comparator.nullsLast(Integer::compareTo)).thenComparing(Component::getCreateTime, Comparator.nullsLast(Date::compareTo))).forEach(o -> {<NEW_LINE>try {<NEW_LINE>wos.add(Wo<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>os.stream().filter(o -> !ListTools.contains(Components.SYSTEM_NAME_NAMES, o.getName())).sorted(Comparator.comparing(Component::getOrderNumber, Comparator.nullsLast(Integer::compareTo)).thenComparing(Component::getCreateTime, Comparator.nullsLast(Date::compareTo))).forEach(o -> {<NEW_LINE>try {<NEW_LINE>wos.add(Wo.copier.copy(o));<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>CacheManager.put(cacheCategory, cacheKey, wos);<NEW_LINE>result.setData(wos);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
.copier.copy(o));
1,025,948
protected void exec() {<NEW_LINE>Graph shapesGraph = load(shapesfile, "shapes file");<NEW_LINE>Graph dataGraph;<NEW_LINE>if (datafile.equals(shapesfile))<NEW_LINE>dataGraph = shapesGraph;<NEW_LINE>else<NEW_LINE>dataGraph = load(datafile, "data file");<NEW_LINE>Node node = null;<NEW_LINE>if (targetNode != null) {<NEW_LINE>String x = dataGraph.getPrefixMapping().expandPrefix(targetNode);<NEW_LINE>node = NodeFactory.createURI(x);<NEW_LINE>}<NEW_LINE>if (isVerbose())<NEW_LINE>ValidationContext.VERBOSE = true;<NEW_LINE>ValidationReport report = (node != null) ? ShaclValidator.get().validate(shapesGraph, dataGraph, node) : ShaclValidator.get().validate(shapesGraph, dataGraph);<NEW_LINE>if (textOutput)<NEW_LINE>ShLib.printReport(report);<NEW_LINE>else<NEW_LINE>RDFDataMgr.write(System.out, report.<MASK><NEW_LINE>}
getGraph(), Lang.TTL);
502,456
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {<NEW_LINE>String packageName = packages.get(position);<NEW_LINE>ApplicationInfo info = null;<NEW_LINE>try {<NEW_LINE>info = pm.getApplicationInfo(packageName, 0);<NEW_LINE>} catch (PackageManager.NameNotFoundException ignore) {<NEW_LINE>}<NEW_LINE>imageLoader.displayImage(packageName, info, holder.icon);<NEW_LINE>String label;<NEW_LINE>if (info != null) {<NEW_LINE>label = info.<MASK><NEW_LINE>} else<NEW_LINE>label = packageName;<NEW_LINE>holder.title.setText(label);<NEW_LINE>if (packageName.equals(label)) {<NEW_LINE>holder.subtitle.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>holder.subtitle.setVisibility(View.VISIBLE);<NEW_LINE>holder.subtitle.setText(packageName);<NEW_LINE>}<NEW_LINE>holder.itemView.setOnLongClickListener(v -> {<NEW_LINE>PopupMenu popupMenu = new PopupMenu(activity, holder.itemView);<NEW_LINE>popupMenu.getMenu().add(R.string.delete).setOnMenuItemClickListener(item -> {<NEW_LINE>model.deletePackage(packageName);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>popupMenu.show();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}
loadLabel(pm).toString();
1,786,819
final CreateRateBasedRuleResult executeCreateRateBasedRule(CreateRateBasedRuleRequest createRateBasedRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRateBasedRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRateBasedRuleRequest> request = null;<NEW_LINE>Response<CreateRateBasedRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateRateBasedRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRateBasedRuleRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRateBasedRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRateBasedRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRateBasedRuleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
944,958
final DescribePatchGroupStateResult executeDescribePatchGroupState(DescribePatchGroupStateRequest describePatchGroupStateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePatchGroupStateRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePatchGroupStateRequest> request = null;<NEW_LINE>Response<DescribePatchGroupStateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePatchGroupStateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePatchGroupStateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePatchGroupState");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePatchGroupStateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePatchGroupStateResultJsonUnmarshaller());<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();
1,205,442
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>locationContainer = new javax.swing.JPanel();<NEW_LINE>fill = <MASK><NEW_LINE>setPreferredSize(new java.awt.Dimension(500, 340));<NEW_LINE>setRequestFocusEnabled(false);<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>locationContainer.setLayout(new java.awt.BorderLayout());<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>add(locationContainer, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(fill, gridBagConstraints);<NEW_LINE>}
new javax.swing.JPanel();
1,646,525
public static OSSUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf) throws Exception {<NEW_LINE>String bucketName = UnderFileSystemUtils.getBucketName(uri);<NEW_LINE>Preconditions.checkArgument(conf.isSet(PropertyKey.OSS_ACCESS_KEY<MASK><NEW_LINE>Preconditions.checkArgument(conf.isSet(PropertyKey.OSS_SECRET_KEY), "Property %s is required to connect to OSS", PropertyKey.OSS_SECRET_KEY);<NEW_LINE>Preconditions.checkArgument(conf.isSet(PropertyKey.OSS_ENDPOINT_KEY), "Property %s is required to connect to OSS", PropertyKey.OSS_ENDPOINT_KEY);<NEW_LINE>String accessId = conf.getString(PropertyKey.OSS_ACCESS_KEY);<NEW_LINE>String accessKey = conf.getString(PropertyKey.OSS_SECRET_KEY);<NEW_LINE>String endPoint = conf.getString(PropertyKey.OSS_ENDPOINT_KEY);<NEW_LINE>ClientBuilderConfiguration ossClientConf = initializeOSSClientConfig(conf);<NEW_LINE>OSS ossClient = new OSSClientBuilder().build(endPoint, accessId, accessKey, ossClientConf);<NEW_LINE>return new OSSUnderFileSystem(uri, ossClient, bucketName, conf);<NEW_LINE>}
), "Property %s is required to connect to OSS", PropertyKey.OSS_ACCESS_KEY);
464,146
final DisassociateInstanceEventWindowResult executeDisassociateInstanceEventWindow(DisassociateInstanceEventWindowRequest disassociateInstanceEventWindowRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateInstanceEventWindowRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateInstanceEventWindowRequest> request = null;<NEW_LINE>Response<DisassociateInstanceEventWindowResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateInstanceEventWindowRequestMarshaller().marshall(super.beforeMarshalling(disassociateInstanceEventWindowRequest));<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, "EC2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DisassociateInstanceEventWindowResult> responseHandler = new StaxResponseHandler<DisassociateInstanceEventWindowResult>(new DisassociateInstanceEventWindowResultStaxUnmarshaller());<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.OPERATION_NAME, "DisassociateInstanceEventWindow");
192,498
protected Pair<RegisterSetLatticeElement, RegisterSetLatticeElement> transformAnd(final ReilInstruction ins, final RegisterSetLatticeElement state) {<NEW_LINE>if ((ins.getFirstOperand().getType() == OperandType.INTEGER_LITERAL) && ins.getFirstOperand().getValue().equalsIgnoreCase("0")) {<NEW_LINE>final RegisterSetLatticeElement newState = state.copy();<NEW_LINE>newState.untaint(ins.getThirdOperand().getValue());<NEW_LINE>return new Pair<RegisterSetLatticeElement, RegisterSetLatticeElement>(newState, null);<NEW_LINE>} else if ((ins.getSecondOperand().getType() == OperandType.INTEGER_LITERAL) && ins.getSecondOperand().getValue().equalsIgnoreCase("0")) {<NEW_LINE>final RegisterSetLatticeElement newState = state.copy();<NEW_LINE>newState.untaint(ins.<MASK><NEW_LINE>return new Pair<RegisterSetLatticeElement, RegisterSetLatticeElement>(newState, null);<NEW_LINE>}<NEW_LINE>return transformNormalInstruction(ins, state);<NEW_LINE>}
getThirdOperand().getValue());
1,796,037
private ResponseSpec loginUserRequestCreation(String username, String password) throws WebClientResponseException {<NEW_LINE>Object postBody = null;<NEW_LINE>// verify the required parameter 'username' is set<NEW_LINE>if (username == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'username' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);<NEW_LINE>}<NEW_LINE>// verify the required parameter 'password' is set<NEW_LINE>if (password == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'password' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(<MASK><NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> pathParams = new HashMap<String, Object>();<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username));<NEW_LINE>queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password));<NEW_LINE>final String[] localVarAccepts = { "application/xml", "application/json" };<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/user/login", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
), null, null, null);
1,370,627
private void createDatabase(String dbname) throws Exception {<NEW_LINE>final String method = "createDatabase";<NEW_LINE>Log.info(c, method, "Creating database " + dbname + " on " + dbhostname);<NEW_LINE>if (dbname.length() > SYBASE_MAX_NAME_LENGTH)<NEW_LINE>throw new Exception(DATABASE_NAME_LENGTH_EXCEEDED + SYBASE_MAX_NAME_LENGTH + " characters or less");<NEW_LINE>int numcmdlines = 0;<NEW_LINE>String[<MASK><NEW_LINE>cmd[numcmdlines++] = sybcmd(null, "'CREATE DATABASE " + dbname + " on fvt = " + dbsize + " log on fvtlog = " + logsize + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "'sp_adduser " + dbuser1 + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "'sp_adduser " + dbuser2 + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "'sp_adduser jpaschema" + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "'sp_adduser XMLSchName" + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "'sp_adduser DefSchema" + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(null, "'sp_modifylogin " + dbuser1 + ", defdb, " + dbname + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(null, "'sp_modifylogin " + dbuser2 + ", defdb, " + dbname + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "'grant all to " + dbuser1 + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "'grant all to " + dbuser2 + "'");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "\"sp_role 'grant', dtm_tm_role, " + dbuser1 + "\"");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "\"sp_role 'grant', dtm_tm_role, " + dbuser2 + "\"");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "\"sp_role 'grant', sa_role, " + dbuser1 + "\"");<NEW_LINE>cmd[numcmdlines++] = sybcmd(dbname, "\"sp_role 'grant', sa_role, " + dbuser2 + "\"");<NEW_LINE>cmd[numcmdlines++] = sybcmd(null, "\"sp_dboption " + dbname + ", 'ddl in tran',true\"");<NEW_LINE>for (int cmdline = 0; cmdline < numcmdlines; cmdline++) {<NEW_LINE>Log.finer(c, method, "execute line " + cmd[cmdline]);<NEW_LINE>ProgramOutput result = databaseMachine.execute(cmd[cmdline]);<NEW_LINE>if (result.getReturnCode() != 0) {<NEW_LINE>Log.info(c, method, "Create database returncode: " + result.getReturnCode());<NEW_LINE>Log.info(c, method, "Create database stdout: " + result.getStdout());<NEW_LINE>Log.info(c, method, "Create database stderr: " + result.getStderr());<NEW_LINE>throw new Exception("Creation of database " + dbname + " failed with : " + result.getStderr());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] cmd = new String[20];
1,350,657
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent <MASK><NEW_LINE>if (player == null || permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int power = permanent.getPower().getValue();<NEW_LINE>if (power == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TargetPermanent target = new TargetCreaturesWithDifferentPowers();<NEW_LINE>player.choose(outcome, target, source, game);<NEW_LINE>Cards cards = new CardsImpl(target.getTargets());<NEW_LINE>if (cards.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>game.addEffect(new BoostTargetEffect(power, power).setTargetPointer(new FixedTargets(cards, game)), source);<NEW_LINE>game.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(new FixedTargets(cards, game)), source);<NEW_LINE>return true;<NEW_LINE>}
permanent = source.getSourcePermanentOrLKI(game);
1,315,815
public void upgrade() throws IOException {<NEW_LINE>if (!DirectoryReader.indexExists(dir)) {<NEW_LINE>throw new IndexNotFoundException(dir.toString());<NEW_LINE>}<NEW_LINE>if (!deletePriorCommits) {<NEW_LINE>final Collection<IndexCommit> commits = DirectoryReader.listCommits(dir);<NEW_LINE>if (commits.size() > 1) {<NEW_LINE>throw new IllegalArgumentException("This tool was invoked to not delete prior commit points, but the following commits were found: " + commits);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iwc.setMergePolicy(new UpgradeIndexMergePolicy<MASK><NEW_LINE>iwc.setIndexDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());<NEW_LINE>try (final IndexWriter w = new IndexWriter(dir, iwc)) {<NEW_LINE>InfoStream infoStream = iwc.getInfoStream();<NEW_LINE>if (infoStream.isEnabled(LOG_PREFIX)) {<NEW_LINE>infoStream.message(LOG_PREFIX, "Upgrading all pre-" + Version.LATEST + " segments of index directory '" + dir + "' to version " + Version.LATEST + "...");<NEW_LINE>}<NEW_LINE>w.forceMerge(1);<NEW_LINE>if (infoStream.isEnabled(LOG_PREFIX)) {<NEW_LINE>infoStream.message(LOG_PREFIX, "All segments upgraded to version " + Version.LATEST);<NEW_LINE>infoStream.message(LOG_PREFIX, "Enforcing commit to rewrite all index metadata...");<NEW_LINE>}<NEW_LINE>// fake change to enforce a commit (e.g. if index has no segments)<NEW_LINE>w.// fake change to enforce a commit (e.g. if index has no segments)<NEW_LINE>setLiveCommitData(w.getLiveCommitData());<NEW_LINE>assert w.hasUncommittedChanges();<NEW_LINE>w.commit();<NEW_LINE>if (infoStream.isEnabled(LOG_PREFIX)) {<NEW_LINE>infoStream.message(LOG_PREFIX, "Committed upgraded metadata to index.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(iwc.getMergePolicy()));
445,955
public void channelRead(ChannelHandlerContext ctx, Object msg) {<NEW_LINE>Channel channel = ctx.channel();<NEW_LINE>Attribute<Context> contextAttr = channel.attr(AttributeKeys.SERVER_CONTEXT);<NEW_LINE>Attribute<HttpRequestAndChannel> requestAttr = channel.attr(AttributeKeys.SERVER_REQUEST);<NEW_LINE>if (!(msg instanceof HttpRequest)) {<NEW_LINE><MASK><NEW_LINE>if (serverContext == null) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>} else {<NEW_LINE>try (Scope ignored = serverContext.makeCurrent()) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Context parentContext = contextAttr.get();<NEW_LINE>if (parentContext == null) {<NEW_LINE>parentContext = Context.current();<NEW_LINE>}<NEW_LINE>HttpRequestAndChannel request = HttpRequestAndChannel.create((HttpRequest) msg, channel);<NEW_LINE>if (!instrumenter().shouldStart(parentContext, request)) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Context context = instrumenter().start(parentContext, request);<NEW_LINE>contextAttr.set(context);<NEW_LINE>requestAttr.set(request);<NEW_LINE>try (Scope ignored = context.makeCurrent()) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>// the span is ended normally in HttpServerResponseTracingHandler<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>// make sure to remove the server context on end() call<NEW_LINE>instrumenter().end(contextAttr.getAndRemove(), requestAttr.getAndRemove(), null, throwable);<NEW_LINE>throw throwable;<NEW_LINE>}<NEW_LINE>}
Context serverContext = contextAttr.get();
698,142
public void execute() throws BuildException {<NEW_LINE>String release = getRelease();<NEW_LINE>if (release == null || release.isEmpty()) {<NEW_LINE>String tgr = getTarget();<NEW_LINE>if (tgr.matches("\\d+")) {<NEW_LINE>tgr = "1." + tgr;<NEW_LINE>}<NEW_LINE>if (!isBootclasspathOptionUsed()) {<NEW_LINE>setRelease(tgr.substring(2));<NEW_LINE>}<NEW_LINE>String src = getSource();<NEW_LINE>if (src.matches("\\d+")) {<NEW_LINE>src = "1." + src;<NEW_LINE>}<NEW_LINE>if (!JavaEnvUtils.isAtLeastJavaVersion(src)) {<NEW_LINE>log("Cannot handle -source " + src + <MASK><NEW_LINE>super.setFork(true);<NEW_LINE>super.setExecutable(maybeFork);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!JavaEnvUtils.isAtLeastJavaVersion(release)) {<NEW_LINE>log("Cannot handle -release " + release + " from this VM; forking " + maybeFork, Project.MSG_WARN);<NEW_LINE>super.setFork(true);<NEW_LINE>super.setExecutable(maybeFork);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>generatedClassesDir = new File(getDestdir().getParentFile(), getDestdir().getName() + "-generated");<NEW_LINE>if (!usingExplicitIncludes) {<NEW_LINE>cleanUpStaleClasses();<NEW_LINE>}<NEW_LINE>cleanUpDependDebris();<NEW_LINE>super.execute();<NEW_LINE>}
" from this VM; forking " + maybeFork, Project.MSG_WARN);
255,724
protected void flushPixels() {<NEW_LINE><MASK><NEW_LINE>if (hasPixels) {<NEW_LINE>// If the user has been manipulating individual pixels,<NEW_LINE>// the changes need to be copied to the screen before<NEW_LINE>// drawing any new geometry.<NEW_LINE>int mx1 = getModifiedX1();<NEW_LINE>int mx2 = getModifiedX2();<NEW_LINE>int my1 = getModifiedY1();<NEW_LINE>int my2 = getModifiedY2();<NEW_LINE>int mw = mx2 - mx1;<NEW_LINE>int mh = my2 - my1;<NEW_LINE>if (pixelDensity == 1) {<NEW_LINE>PixelWriter pw = context.getPixelWriter();<NEW_LINE>pw.setPixels(mx1, my1, mw, mh, argbFormat, pixels, mx1 + my1 * pixelWidth, pixelWidth);<NEW_LINE>} else {<NEW_LINE>// The only way to push all the pixels is to draw a scaled-down image<NEW_LINE>if (snapshotImage == null || snapshotImage.getWidth() != pixelWidth || snapshotImage.getHeight() != pixelHeight) {<NEW_LINE>snapshotImage = new WritableImage(pixelWidth, pixelHeight);<NEW_LINE>}<NEW_LINE>PixelWriter pw = snapshotImage.getPixelWriter();<NEW_LINE>pw.setPixels(mx1, my1, mw, mh, argbFormat, pixels, mx1 + my1 * pixelWidth, pixelWidth);<NEW_LINE>context.save();<NEW_LINE>resetMatrix();<NEW_LINE>context.scale(1d / pixelDensity, 1d / pixelDensity);<NEW_LINE>context.drawImage(snapshotImage, mx1, my1, mw, mh, mx1, my1, mw, mh);<NEW_LINE>context.restore();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>modified = false;<NEW_LINE>}
boolean hasPixels = modified && pixels != null;
1,377,282
final GetRequestedServiceQuotaChangeResult executeGetRequestedServiceQuotaChange(GetRequestedServiceQuotaChangeRequest getRequestedServiceQuotaChangeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRequestedServiceQuotaChangeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRequestedServiceQuotaChangeRequest> request = null;<NEW_LINE>Response<GetRequestedServiceQuotaChangeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRequestedServiceQuotaChangeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRequestedServiceQuotaChangeRequest));<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, "Service Quotas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRequestedServiceQuotaChange");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRequestedServiceQuotaChangeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRequestedServiceQuotaChangeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,493,040
public static PubsubTopic fromPath(String path) {<NEW_LINE>if (path.equals(TOPIC_DEV_NULL_TEST_NAME)) {<NEW_LINE>return new PubsubTopic(PubsubTopic.Type.FAKE, "", path);<NEW_LINE>}<NEW_LINE>String projectName, topicName;<NEW_LINE>Matcher v1beta1Match = V1BETA1_TOPIC_REGEXP.matcher(path);<NEW_LINE>if (v1beta1Match.matches()) {<NEW_LINE><MASK><NEW_LINE>projectName = v1beta1Match.group(1);<NEW_LINE>topicName = v1beta1Match.group(2);<NEW_LINE>} else {<NEW_LINE>Matcher match = TOPIC_REGEXP.matcher(path);<NEW_LINE>if (!match.matches()) {<NEW_LINE>throw new IllegalArgumentException("Pubsub topic is not in projects/<project_id>/topics/<topic_name> format: " + path);<NEW_LINE>}<NEW_LINE>projectName = match.group(1);<NEW_LINE>topicName = match.group(2);<NEW_LINE>}<NEW_LINE>validateProjectName(projectName);<NEW_LINE>validatePubsubName(topicName);<NEW_LINE>return new PubsubTopic(PubsubTopic.Type.NORMAL, projectName, topicName);<NEW_LINE>}
LOG.warn("Saw topic in v1beta1 format. Topics should be in the format " + "projects/<project_id>/topics/<topic_name>");
1,415,076
public List<AnnotatedDeclaredType> visitDeclared(AnnotatedDeclaredType type, Void p) {<NEW_LINE>// Set<AnnotationMirror> annotations = type.getAnnotations();<NEW_LINE>TypeElement typeElement = (TypeElement) type.getUnderlyingType().asElement();<NEW_LINE>if (type.getTypeArguments().size() != typeElement.getTypeParameters().size()) {<NEW_LINE>if (!type.isUnderlyingTypeRaw()) {<NEW_LINE>throw new BugInCF("AnnotatedDeclaredType's element has a different number of type parameters than" + " type.%ntype=%s%nelement=%s", type, typeElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<AnnotatedDeclaredType> supertypes = new ArrayList<>();<NEW_LINE>ClassTree classTree = atypeFactory.trees.getTree(typeElement);<NEW_LINE>// Testing against enum and annotation. Ideally we can simply use element!<NEW_LINE>if (classTree != null) {<NEW_LINE>supertypes.addAll(supertypesFromTree(type, classTree));<NEW_LINE>} else {<NEW_LINE>supertypes.addAll<MASK><NEW_LINE>// final Element elem = type.getElement() == null ? typeElement : type.getElement();<NEW_LINE>}<NEW_LINE>if (typeElement.getKind() == ElementKind.ANNOTATION_TYPE) {<NEW_LINE>TypeElement jlaElement = atypeFactory.elements.getTypeElement(Annotation.class.getCanonicalName());<NEW_LINE>AnnotatedDeclaredType jlaAnnotation = atypeFactory.fromElement(jlaElement);<NEW_LINE>jlaAnnotation.addAnnotations(type.getAnnotations());<NEW_LINE>supertypes.add(jlaAnnotation);<NEW_LINE>}<NEW_LINE>Map<TypeVariable, AnnotatedTypeMirror> typeVarToTypeArg = getTypeVarToTypeArg(type);<NEW_LINE>List<AnnotatedDeclaredType> superTypesNew = new ArrayList<>();<NEW_LINE>for (AnnotatedDeclaredType dt : supertypes) {<NEW_LINE>type.atypeFactory.initializeAtm(dt);<NEW_LINE>superTypesNew.add((AnnotatedDeclaredType) atypeFactory.getTypeVarSubstitutor().substitute(typeVarToTypeArg, dt));<NEW_LINE>}<NEW_LINE>return superTypesNew;<NEW_LINE>}
(supertypesFromElement(type, typeElement));
861,902
public ListContactFlowsResult listContactFlows(ListContactFlowsRequest listContactFlowsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listContactFlowsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListContactFlowsRequest> request = null;<NEW_LINE>Response<ListContactFlowsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListContactFlowsRequestMarshaller().marshall(listContactFlowsRequest);<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<ListContactFlowsResult, JsonUnmarshallerContext> unmarshaller = new ListContactFlowsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListContactFlowsResult> responseHandler = <MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
new JsonResponseHandler<ListContactFlowsResult>(unmarshaller);
762,042
private void decodeMacroblocks(Frame[][] refList) {<NEW_LINE>Picture mb = Picture.create(16, 16, activeSps.chromaFormatIdc);<NEW_LINE>int mbWidth = activeSps.picWidthInMbsMinus1 + 1;<NEW_LINE>MBlock mBlock = new MBlock(activeSps.chromaFormatIdc);<NEW_LINE>while (parser.readMacroblock(mBlock)) {<NEW_LINE>int mbAddr = mapper.getAddress(mBlock.mbIdx);<NEW_LINE>int mbX = mbAddr % mbWidth;<NEW_LINE>int mbY = mbAddr / mbWidth;<NEW_LINE>decode(mBlock, parser.getSliceHeader().sliceType, mb, refList);<NEW_LINE>putMacroblock(frameOut, mb, mbX, mbY);<NEW_LINE>di.shs[<MASK><NEW_LINE>di.refsUsed[mbAddr] = refList;<NEW_LINE>fillCoeff(mBlock, mbX, mbY);<NEW_LINE>mb.fill(0);<NEW_LINE>mBlock.clear();<NEW_LINE>}<NEW_LINE>}
mbAddr] = parser.getSliceHeader();
1,390,713
private Geometry createMultiPointFromStreams_() {<NEW_LINE>assert (m_position != null);<NEW_LINE>assert (m_paths == null);<NEW_LINE>assert (m_path_flags == null);<NEW_LINE>MultiPoint multi_point = new MultiPoint();<NEW_LINE>MultiPointImpl multi_point_impl = (MultiPointImpl) multi_point._getImpl();<NEW_LINE>multi_point_impl.setAttributeStreamRef(Semantics.POSITION, m_position);<NEW_LINE>if (m_b_has_zs) {<NEW_LINE>assert (m_zs != null);<NEW_LINE>multi_point_impl.setAttributeStreamRef(Semantics.Z, m_zs);<NEW_LINE>}<NEW_LINE>if (m_b_has_ms) {<NEW_LINE>assert (m_ms != null);<NEW_LINE>multi_point_impl.setAttributeStreamRef(Semantics.M, m_ms);<NEW_LINE>}<NEW_LINE>multi_point_impl.resize(m_position.size() / 2);<NEW_LINE>multi_point_impl.<MASK><NEW_LINE>return multi_point;<NEW_LINE>}
notifyModified(MultiVertexGeometryImpl.DirtyFlags.DirtyAll);
1,002,159
protected void doExecute(Task task, Request request, ActionListener<Response> listener) {<NEW_LINE>final Repository repository = repositoriesService.repository(request.getRepositoryName());<NEW_LINE>if (repository instanceof BlobStoreRepository == false) {<NEW_LINE>throw new IllegalArgumentException("repository [" + request.getRepositoryName() + "] is not a blob-store repository");<NEW_LINE>}<NEW_LINE>if (repository.isReadOnly()) {<NEW_LINE>throw new IllegalArgumentException("repository [" + request.getRepositoryName() + "] is read-only");<NEW_LINE>}<NEW_LINE>final BlobStoreRepository blobStoreRepository = (BlobStoreRepository) repository;<NEW_LINE>final BlobPath path = blobStoreRepository.basePath().add(request.blobPath);<NEW_LINE>final BlobContainer blobContainer = blobStoreRepository.blobStore().blobContainer(path);<NEW_LINE><MASK><NEW_LINE>assert task instanceof CancellableTask;<NEW_LINE>new BlobAnalysis(transportService, (CancellableTask) task, request, blobStoreRepository, blobContainer, listener).run();<NEW_LINE>}
logger.trace("handling [{}]", request);
524,942
public void write(CompoundTag compound, boolean clientPacket) {<NEW_LINE>super.write(compound, clientPacket);<NEW_LINE>compound.put("InputItems", inputInventory.serializeNBT());<NEW_LINE>compound.put("OutputItems", outputInventory.serializeNBT());<NEW_LINE>if (preferredSpoutput != null)<NEW_LINE>NBTHelper.writeEnum(compound, "PreferredSpoutput", preferredSpoutput);<NEW_LINE>ListTag disabledList = new ListTag();<NEW_LINE>disabledSpoutputs.forEach(d -> disabledList.add(StringTag.valueOf(d.name())));<NEW_LINE>compound.put("DisabledSpoutput", disabledList);<NEW_LINE>compound.put("Overflow", NBTHelper.writeItemList(spoutputBuffer));<NEW_LINE>compound.put("FluidOverflow", NBTHelper.writeCompoundList(spoutputFluidBuffer, fs -> fs.writeToNBT(new CompoundTag())));<NEW_LINE>if (!clientPacket)<NEW_LINE>return;<NEW_LINE>compound.put("VisualizedItems", NBTHelper.writeCompoundList(visualizedOutputItems, ia -> ia.getValue<MASK><NEW_LINE>compound.put("VisualizedFluids", NBTHelper.writeCompoundList(visualizedOutputFluids, ia -> ia.getValue().writeToNBT(new CompoundTag())));<NEW_LINE>visualizedOutputItems.clear();<NEW_LINE>visualizedOutputFluids.clear();<NEW_LINE>}
().serializeNBT()));
1,617,225
public FormatterStep newFormatterStep(FormatterStepConfig stepConfig) {<NEW_LINE>Map<String, String> devDependencies = TsFmtFormatterStep.defaultDevDependencies();<NEW_LINE>if (typescriptFormatterVersion != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (typescriptVersion != null) {<NEW_LINE>devDependencies.put("typescript", typescriptVersion);<NEW_LINE>}<NEW_LINE>if (tslintVersion != null) {<NEW_LINE>devDependencies.put("tslint", tslintVersion);<NEW_LINE>}<NEW_LINE>File npm = npmExecutable != null ? stepConfig.getFileLocator().locateFile(npmExecutable) : null;<NEW_LINE>File npmrcFile = npmrc != null ? stepConfig.getFileLocator().locateFile(npmrc) : null;<NEW_LINE>TypedTsFmtConfigFile configFile;<NEW_LINE>Map<String, Object> configInline;<NEW_LINE>// check that there is only 1 config file or inline config<NEW_LINE>if (this.tsconfigFile != null ^ this.tsfmtFile != null ^ this.tslintFile != null ^ this.vscodeFile != null) {<NEW_LINE>if (this.config != null) {<NEW_LINE>throw onlyOneConfig();<NEW_LINE>}<NEW_LINE>configInline = null;<NEW_LINE>if (this.tsconfigFile != null) {<NEW_LINE>configFile = new TypedTsFmtConfigFile(TsConfigFileType.TSCONFIG, stepConfig.getFileLocator().locateFile(tsconfigFile));<NEW_LINE>} else if (this.tsfmtFile != null) {<NEW_LINE>configFile = new TypedTsFmtConfigFile(TsConfigFileType.TSFMT, stepConfig.getFileLocator().locateFile(tsfmtFile));<NEW_LINE>} else if (this.tslintFile != null) {<NEW_LINE>configFile = new TypedTsFmtConfigFile(TsConfigFileType.TSLINT, stepConfig.getFileLocator().locateFile(tslintFile));<NEW_LINE>} else if (this.vscodeFile != null) {<NEW_LINE>configFile = new TypedTsFmtConfigFile(TsConfigFileType.VSCODE, stepConfig.getFileLocator().locateFile(vscodeFile));<NEW_LINE>} else {<NEW_LINE>throw new Error("Programming error: the xors did not match the cases");<NEW_LINE>}<NEW_LINE>} else if (config != null) {<NEW_LINE>configFile = null;<NEW_LINE>configInline = new LinkedHashMap<>();<NEW_LINE>// try to parse string values as integers or booleans<NEW_LINE>for (Map.Entry<String, String> e : config.entrySet()) {<NEW_LINE>try {<NEW_LINE>configInline.put(e.getKey(), Integer.parseInt(e.getValue()));<NEW_LINE>} catch (NumberFormatException ignore) {<NEW_LINE>try {<NEW_LINE>configInline.put(e.getKey(), Boolean.parseBoolean(e.getValue()));<NEW_LINE>} catch (IllegalArgumentException ignore2) {<NEW_LINE>configInline.put(e.getKey(), e.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw onlyOneConfig();<NEW_LINE>}<NEW_LINE>File buildDir = stepConfig.getFileLocator().getBuildDir();<NEW_LINE>NpmPathResolver npmPathResolver = new NpmPathResolver(npm, npmrcFile, stepConfig.getFileLocator().getBaseDir());<NEW_LINE>return TsFmtFormatterStep.create(devDependencies, stepConfig.getProvisioner(), buildDir, npmPathResolver, configFile, configInline);<NEW_LINE>}
devDependencies.put("typescript-formatter", typescriptFormatterVersion);
66,177
public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>Pointer pthread_start = context.getPointerArg(0);<NEW_LINE>Pointer child_stack = context.getPointerArg(1);<NEW_LINE>int flags = context.getIntArg(2);<NEW_LINE>Pointer thread = context.getPointerArg(3);<NEW_LINE>Pointer start_routine = thread.getPointer(0x60);<NEW_LINE>Pointer <MASK><NEW_LINE>log.info("clone start_routine=" + start_routine + ", child_stack=" + child_stack + ", flags=0x" + Integer.toHexString(flags) + ", arg=" + arg + ", pthread_start=" + pthread_start);<NEW_LINE>Backend backend = emulator.getBackend();<NEW_LINE>boolean join = visitor == null || visitor.canJoin(start_routine, ++threadId);<NEW_LINE>UnidbgPointer pointer = UnidbgPointer.register(emulator, Arm64Const.UC_ARM64_REG_SP);<NEW_LINE>try {<NEW_LINE>// threadId<NEW_LINE>pointer = pointer.share(-8, 0);<NEW_LINE>pointer.setLong(0, threadId);<NEW_LINE>if (join) {<NEW_LINE>pointer = pointer.share(-8, 0);<NEW_LINE>pointer.setPointer(0, start_routine);<NEW_LINE>pointer = pointer.share(-8, 0);<NEW_LINE>pointer.setPointer(0, arg);<NEW_LINE>}<NEW_LINE>// can join<NEW_LINE>pointer = pointer.share(-8, 0);<NEW_LINE>pointer.setLong(0, join ? 1 : 0);<NEW_LINE>} finally {<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_SP, pointer.peer);<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
arg = thread.getPointer(0x68);
624,128
final DeleteBrowserSettingsResult executeDeleteBrowserSettings(DeleteBrowserSettingsRequest deleteBrowserSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBrowserSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBrowserSettingsRequest> request = null;<NEW_LINE>Response<DeleteBrowserSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBrowserSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBrowserSettingsRequest));<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, "WorkSpaces Web");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBrowserSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBrowserSettingsResultJsonUnmarshaller());<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.OPERATION_NAME, "DeleteBrowserSettings");
1,471,813
private List<Pair<double[], long[]>> findDimensions(ArrayList<PROCLUSCluster> clusters, Relation<? extends NumberVector> database) {<NEW_LINE>// compute x_ij = avg distance from points in c_i to c_i.centroid<NEW_LINE>final int <MASK><NEW_LINE>final int numc = clusters.size();<NEW_LINE>double[][] averageDistances = new double[numc][];<NEW_LINE>for (int i = 0; i < numc; i++) {<NEW_LINE>PROCLUSCluster c_i = clusters.get(i);<NEW_LINE>double[] x_i = new double[dim];<NEW_LINE>for (DBIDIter iter = c_i.objectIDs.iter(); iter.valid(); iter.advance()) {<NEW_LINE>NumberVector o = database.get(iter);<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>x_i[d] += Math.abs(c_i.centroid[d] - o.doubleValue(d));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>x_i[d] /= c_i.objectIDs.size();<NEW_LINE>}<NEW_LINE>averageDistances[i] = x_i;<NEW_LINE>}<NEW_LINE>List<DoubleIntInt> z_ijs = computeZijs(averageDistances, dim);<NEW_LINE>long[][] dimensionMap = computeDimensionMap(z_ijs, dim, numc);<NEW_LINE>// mapping cluster -> dimensions<NEW_LINE>List<Pair<double[], long[]>> result = new ArrayList<>(numc);<NEW_LINE>for (int i = 0; i < numc; i++) {<NEW_LINE>long[] dims_i = dimensionMap[i];<NEW_LINE>if (dims_i == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.add(new Pair<>(clusters.get(i).centroid, dims_i));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
dim = RelationUtil.dimensionality(database);
491,048
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>findViewById(R.id.btSimpleView).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>startActivity(new Intent(MainActivity<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.btRecyclerView).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>startActivity(new Intent(MainActivity.this, RecyclerViewFlipActivity.class));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.btFlipOnceEg).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>startActivity(new Intent(MainActivity.this, FlipOnceExampleActivity.class));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.this, SimpleViewFlipActivity.class));
1,397,192
protected static List<LayoutDecision> maximalDecisionValues(Map<Element, LayoutDecisionMap> alreadyDecided, LayoutDecision.Kind k, Comparator<LayoutDecision> cmp) {<NEW_LINE>ArrayList<LayoutDecision> currentMax = null;<NEW_LINE>for (Map.Entry<Element, LayoutDecisionMap> eOuter : alreadyDecided.entrySet()) {<NEW_LINE>LayoutDecision decisionToCompare = eOuter.getValue().getDecision(k);<NEW_LINE>Integer compareResult = currentMax == null ? null : cmp.compare(decisionToCompare<MASK><NEW_LINE>if (currentMax == null || compareResult > 0) {<NEW_LINE>// replace the current max with a new equivalence class<NEW_LINE>currentMax = new ArrayList<>(1);<NEW_LINE>currentMax.add(decisionToCompare);<NEW_LINE>} else if (compareResult == 0) {<NEW_LINE>// extend current max equivalence class<NEW_LINE>currentMax.add(decisionToCompare);<NEW_LINE>}<NEW_LINE>// else it's less than the current max, so do nothing<NEW_LINE>}<NEW_LINE>return currentMax;<NEW_LINE>}
, currentMax.get(0));
915,109
public static String transformQueryString(String qs) {<NEW_LINE>// drop characters that are not properly supported by Indri<NEW_LINE>// ('.' is only allowed in between digits)<NEW_LINE>qs = qs.replaceAll("&\\w++;", " ");<NEW_LINE>qs = qs.replaceAll(FORBIDDEN_CHAR, " ");<NEW_LINE>String dotsRemoved = "";<NEW_LINE>for (int i = 0; i < qs.length(); i++) if (qs.charAt(i) != '.' || (i > 0 && i < qs.length() - 1 && Character.isDigit(qs.charAt(i - 1)) && Character.isDigit(qs.charAt(i + 1))))<NEW_LINE>dotsRemoved += qs.charAt(i);<NEW_LINE>qs = dotsRemoved;<NEW_LINE>// replace ... OR ... by #or(... ...)<NEW_LINE>Matcher m = Pattern.compile("((\\([^\\(\\)]*+\\)|\\\"[^\\\"]*+\\\"|[^\\s\\(\\)]++) OR )++" <MASK><NEW_LINE>while (m.find()) qs = qs.replace(m.group(0), "#or(" + m.group(0) + ")");<NEW_LINE>qs = qs.replace(" OR", "");<NEW_LINE>// replace ... AND ... by #combine(... ...)<NEW_LINE>m = Pattern.compile("((\\([^\\(\\)]*+\\)|\\\"[^\\\"]*+\\\"|[^\\s\\(\\)]++) AND )++" + "(\\([^\\(\\)]*+\\)|\\\"[^\\\"]*+\\\"|[^\\s\\(\\)]++)").matcher(qs);<NEW_LINE>while (m.find()) qs = qs.replace(m.group(0), "#combine(" + m.group(0) + ")");<NEW_LINE>qs = qs.replace(" AND", "");<NEW_LINE>// replace "..." by #1(...)<NEW_LINE>m = Pattern.compile("\"([^\"]*+)\"").matcher(qs);<NEW_LINE>while (m.find()) qs = qs.replace(m.group(0), "#1(" + m.group(1) + ")");<NEW_LINE>// form passage query<NEW_LINE>// qs = "#combine[p](" + qs + ")";<NEW_LINE>qs = "#combine(" + qs + ")";<NEW_LINE>return qs;<NEW_LINE>}
+ "(\\([^\\(\\)]*+\\)|\\\"[^\\\"]*+\\\"|[^\\s\\(\\)]++)").matcher(qs);
1,633,134
private Object findObjectToSelectAfterDeletion() {<NEW_LINE>Object firstObject = fSelectedObjects[0];<NEW_LINE>TreeItem item = fViewer.findTreeItem(firstObject);<NEW_LINE>if (item == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TreeItem parentTreeItem = item.getParentItem();<NEW_LINE>// Parent Item not found so must be at top level<NEW_LINE>if (parentTreeItem == null) {<NEW_LINE><MASK><NEW_LINE>int index = tree.indexOf(item);<NEW_LINE>if (index < 1) {<NEW_LINE>// At root or not found<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return tree.getItem(index - 1).getData();<NEW_LINE>}<NEW_LINE>Object selected = null;<NEW_LINE>// Item index is greater than 0 so select previous sibling item<NEW_LINE>int index = parentTreeItem.indexOf(item);<NEW_LINE>if (index > 0) {<NEW_LINE>selected = parentTreeItem.getItem(index - 1).getData();<NEW_LINE>}<NEW_LINE>// Was null so select parent of first object<NEW_LINE>if (selected == null && firstObject instanceof EObject) {<NEW_LINE>selected = ((EObject) firstObject).eContainer();<NEW_LINE>}<NEW_LINE>return selected;<NEW_LINE>}
Tree tree = item.getParent();
79,279
IntTree<V> minus(final long key) {<NEW_LINE>if (size == 0)<NEW_LINE>return this;<NEW_LINE>if (key < this.key)<NEW_LINE>return rebalanced(left.minus(key - this.key), right);<NEW_LINE>if (key > this.key)<NEW_LINE>return rebalanced(left, right.minus(key - this.key));<NEW_LINE>// otherwise key==this.key, so we are killing this node:<NEW_LINE>if (// we can just become right node<NEW_LINE>left.size == 0)<NEW_LINE>// make key 'absolute':<NEW_LINE>return right.withKey(right.key + this.key);<NEW_LINE>if (// we can just become left node<NEW_LINE>right.size == 0)<NEW_LINE>return left.withKey(left.key + this.key);<NEW_LINE>// otherwise replace this with the next key (i.e. the smallest key to the right):<NEW_LINE>// TODO have minNode() instead of minKey to avoid having to call get()<NEW_LINE>// TODO get node from larger subtree, i.e. if left.size>right.size use left.maxNode()<NEW_LINE>// TODO have faster minusMin() instead of just using minus()<NEW_LINE>long newKey = right.minKey() + this.key;<NEW_LINE>// (right.minKey() is relative to this; adding this.key makes it 'absolute'<NEW_LINE>// where 'absolute' really means relative to the parent of this)<NEW_LINE>V newValue = right.get(newKey - this.key);<NEW_LINE>// now that we've got the new stuff, take it out of the right subtree:<NEW_LINE>IntTree<V> newRight = right.minus(newKey - this.key);<NEW_LINE>// lastly, make the subtree keys relative to newKey (currently they are relative to this.key):<NEW_LINE>newRight = newRight.withKey((newRight.key <MASK><NEW_LINE>// left is definitely not empty:<NEW_LINE>IntTree<V> newLeft = left.withKey((left.key + this.key) - newKey);<NEW_LINE>return rebalanced(newKey, newValue, newLeft, newRight);<NEW_LINE>}
+ this.key) - newKey);
1,798,848
final void executeRespondActivityTaskCanceled(RespondActivityTaskCanceledRequest respondActivityTaskCanceledRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(respondActivityTaskCanceledRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RespondActivityTaskCanceledRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RespondActivityTaskCanceledRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(respondActivityTaskCanceledRequest));<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, "SWF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RespondActivityTaskCanceled");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<Void>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), null);<NEW_LINE>invoke(request, responseHandler, executionContext);<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
781,297
public ListSatellitesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListSatellitesResult listSatellitesResult = new ListSatellitesResult();<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 listSatellitesResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSatellitesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("satellites", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSatellitesResult.setSatellites(new ListUnmarshaller<SatelliteListItem>(SatelliteListItemJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listSatellitesResult;<NEW_LINE>}
)).unmarshall(context));
860,988
public void marshall(ResourceDataSyncSourceWithState resourceDataSyncSourceWithState, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (resourceDataSyncSourceWithState == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(resourceDataSyncSourceWithState.getSourceType(), SOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(resourceDataSyncSourceWithState.getSourceRegions(), SOURCEREGIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceDataSyncSourceWithState.getIncludeFutureRegions(), INCLUDEFUTUREREGIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceDataSyncSourceWithState.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceDataSyncSourceWithState.getEnableAllOpsDataSources(), ENABLEALLOPSDATASOURCES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
resourceDataSyncSourceWithState.getAwsOrganizationsSource(), AWSORGANIZATIONSSOURCE_BINDING);
853,661
private //<NEW_LINE>RepairCandidate errorRecovery(int error_token, boolean forcedError) {<NEW_LINE>this.errorToken = error_token;<NEW_LINE>this.errorTokenStart = this.lexStream.start(error_token);<NEW_LINE>int prevtok = this.lexStream.previous(error_token);<NEW_LINE>int prevtokKind = this.lexStream.kind(prevtok);<NEW_LINE>if (forcedError) {<NEW_LINE>int name_index = Parser.terminal_index[TokenNameLBRACE];<NEW_LINE>reportError(INSERTION_CODE, name_index, prevtok, prevtok);<NEW_LINE>RepairCandidate candidate = new RepairCandidate();<NEW_LINE>candidate.symbol = TokenNameLBRACE;<NEW_LINE>candidate.location = error_token;<NEW_LINE>this.lexStream.reset(error_token);<NEW_LINE>this.stateStackTop = this.nextStackTop;<NEW_LINE>for (int j = 0; j <= this.stateStackTop; j++) {<NEW_LINE>this.stack[j] = this.nextStack[j];<NEW_LINE>}<NEW_LINE>this.locationStack[this.stateStackTop] = error_token;<NEW_LINE>this.locationStartStack[this.stateStackTop] = this.lexStream.start(error_token);<NEW_LINE>return candidate;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Try primary phase recoveries. If not successful, try secondary<NEW_LINE>// phase recoveries. If not successful and we are at end of the<NEW_LINE>// file, we issue the end-of-file error and quit. Otherwise, ...<NEW_LINE>//<NEW_LINE>RepairCandidate candidate = primaryPhase(error_token);<NEW_LINE>if (candidate.symbol != 0) {<NEW_LINE>return candidate;<NEW_LINE>}<NEW_LINE>candidate = secondaryPhase(error_token);<NEW_LINE>if (candidate.symbol != 0) {<NEW_LINE>return candidate;<NEW_LINE>}<NEW_LINE>if (this.lexStream.kind(error_token) == EOFT_SYMBOL) {<NEW_LINE>reportError(EOF_CODE, Parser.terminal_index[EOFT_SYMBOL], prevtok, prevtok);<NEW_LINE>candidate.symbol = 0;<NEW_LINE>candidate.location = error_token;<NEW_LINE>return candidate;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// At this point, primary and (initial attempt at) secondary<NEW_LINE>// recovery did not work. We will now get into "panic mode" and<NEW_LINE>// keep trying secondary phase recoveries until we either find<NEW_LINE>// a successful recovery or have consumed the remaining input<NEW_LINE>// tokens.<NEW_LINE>//<NEW_LINE>while (this.lexStream.kind(this.buffer[BUFF_UBOUND]) != EOFT_SYMBOL) {<NEW_LINE>candidate = secondaryPhase(this.buffer<MASK><NEW_LINE>if (candidate.symbol != 0) {<NEW_LINE>return candidate;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// We reached the end of the file while panicking. Delete all<NEW_LINE>// remaining tokens in the input.<NEW_LINE>//<NEW_LINE>int i;<NEW_LINE>for (i = BUFF_UBOUND; this.lexStream.kind(this.buffer[i]) == EOFT_SYMBOL; i--) {
[MAX_DISTANCE - MIN_DISTANCE + 2]);
1,115,567
private Expression newArrayAccess(ArrayAccess arrayAccessNode, TypeMirror componentType, TypeElement iosArrayElement, boolean assignable) {<NEW_LINE>String funcName = ElementUtil.getName(iosArrayElement) + "_Get";<NEW_LINE>TypeMirror returnType = componentType;<NEW_LINE>TypeMirror declaredReturnType = componentType.getKind().isPrimitive() ? componentType : TypeUtil.ID_TYPE;<NEW_LINE>if (assignable) {<NEW_LINE>funcName += "Ref";<NEW_LINE>returnType = declaredReturnType = new PointerType(componentType);<NEW_LINE>}<NEW_LINE>FunctionElement element = new FunctionElement(funcName, declaredReturnType, iosArrayElement).addParameters(iosArrayElement.asType(), typeUtil.getInt());<NEW_LINE>FunctionInvocation invocation <MASK><NEW_LINE>invocation.addArgument(arrayAccessNode.getArray().copy());<NEW_LINE>invocation.addArgument(arrayAccessNode.getIndex().copy());<NEW_LINE>if (assignable) {<NEW_LINE>return new PrefixExpression(componentType, PrefixExpression.Operator.DEREFERENCE, invocation);<NEW_LINE>}<NEW_LINE>return invocation;<NEW_LINE>}
= new FunctionInvocation(element, returnType);
1,359,330
public com.amazonaws.services.redshiftdataapi.model.ValidationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.redshiftdataapi.model.ValidationException validationException = new com.amazonaws.services.redshiftdataapi.model.ValidationException(null);<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>} 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 validationException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,390,275
protected BuildScriptBuilder.SuiteSpec addTestSuite(String name, BuildScriptBuilder buildScriptBuilder, BuildInitTestFramework testFramework, TemplateLibraryVersionProvider libraryVersionProvider) {<NEW_LINE>switch(testFramework) {<NEW_LINE>case JUNIT:<NEW_LINE>return buildScriptBuilder.testing(<MASK><NEW_LINE>case JUNIT_JUPITER:<NEW_LINE>return buildScriptBuilder.testing().junitJupiterSuite(name, libraryVersionProvider);<NEW_LINE>case SPOCK:<NEW_LINE>return buildScriptBuilder.testing().spockSuite(name, libraryVersionProvider);<NEW_LINE>case KOTLINTEST:<NEW_LINE>return buildScriptBuilder.testing().kotlinTestSuite(name, libraryVersionProvider);<NEW_LINE>case TESTNG:<NEW_LINE>return buildScriptBuilder.testing().testNG(name, libraryVersionProvider);<NEW_LINE>case SCALATEST:<NEW_LINE>BuildScriptBuilder.SuiteSpec suiteSpec = buildScriptBuilder.testing().junitSuite(name, libraryVersionProvider);<NEW_LINE>String scalaVersion = libraryVersionProvider.getVersion("scala");<NEW_LINE>String scalaTestVersion = libraryVersionProvider.getVersion("scalatest");<NEW_LINE>String scalaTestPlusJunitVersion = libraryVersionProvider.getVersion("scalatestplus-junit");<NEW_LINE>String scalaXmlVersion = libraryVersionProvider.getVersion("scala-xml");<NEW_LINE>suiteSpec.implementation("Use Scalatest for testing our library", "org.scalatest:scalatest_" + scalaVersion + ":" + scalaTestVersion, "org.scalatestplus:junit-4-13_" + scalaVersion + ":" + scalaTestPlusJunitVersion);<NEW_LINE>suiteSpec.runtimeOnly("Need scala-xml at test runtime", "org.scala-lang.modules:scala-xml_" + scalaVersion + ":" + scalaXmlVersion);<NEW_LINE>return suiteSpec;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException(testFramework + " is not yet supported.");<NEW_LINE>}<NEW_LINE>}
).junitSuite(name, libraryVersionProvider);
290,934
protected JFreeChart createPieChart() throws JRException {<NEW_LINE>ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());<NEW_LINE>JFreeChart jfreeChart = ChartFactory.createPieChart(evaluateTextExpression(getChart().getTitleExpression()), (PieDataset) getDataset(), isShowLegend(), true, false);<NEW_LINE>configureChart(jfreeChart);<NEW_LINE>PiePlot piePlot = (PiePlot) jfreeChart.getPlot();<NEW_LINE>// plot.setStartAngle(290);<NEW_LINE>// plot.setDirection(Rotation.CLOCKWISE);<NEW_LINE>// plot.setNoDataMessage("No data to display");<NEW_LINE>JRPiePlot jrPiePlot = (JRPiePlot) getPlot();<NEW_LINE>boolean isCircular = jrPiePlot.getCircular() == null <MASK><NEW_LINE>piePlot.setCircular(isCircular);<NEW_LINE>boolean isShowLabels = jrPiePlot.getShowLabels() == null ? true : jrPiePlot.getShowLabels();<NEW_LINE>if (isShowLabels) {<NEW_LINE>PieSectionLabelGenerator labelGenerator = (PieSectionLabelGenerator) getLabelGenerator();<NEW_LINE>JRItemLabel itemLabel = jrPiePlot.getItemLabel();<NEW_LINE>if (labelGenerator != null) {<NEW_LINE>piePlot.setLabelGenerator(labelGenerator);<NEW_LINE>} else if (jrPiePlot.getLabelFormat() != null) {<NEW_LINE>piePlot.setLabelGenerator(new StandardPieSectionLabelGenerator(jrPiePlot.getLabelFormat(), NumberFormat.getNumberInstance(getLocale()), NumberFormat.getPercentInstance(getLocale())));<NEW_LINE>}<NEW_LINE>// the default section label is just the key, so there's no need to set localized number formats<NEW_LINE>// else if (itemLabel != null && itemLabel.getMask() != null)<NEW_LINE>// {<NEW_LINE>// piePlot.setLabelGenerator(<NEW_LINE>// new StandardPieSectionLabelGenerator(itemLabel.getMask())<NEW_LINE>// );<NEW_LINE>// }<NEW_LINE>piePlot.setLabelFont(fontUtil.getAwtFont(getFont(itemLabel == null ? null : itemLabel.getFont()), getLocale()));<NEW_LINE>if (itemLabel != null && itemLabel.getColor() != null) {<NEW_LINE>piePlot.setLabelPaint(itemLabel.getColor());<NEW_LINE>} else {<NEW_LINE>piePlot.setLabelPaint(getChart().getForecolor());<NEW_LINE>}<NEW_LINE>if (itemLabel != null && itemLabel.getBackgroundColor() != null) {<NEW_LINE>piePlot.setLabelBackgroundPaint(itemLabel.getBackgroundColor());<NEW_LINE>} else {<NEW_LINE>piePlot.setLabelBackgroundPaint(getChart().getBackcolor());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>piePlot.setLabelGenerator(null);<NEW_LINE>}<NEW_LINE>if (jrPiePlot.getLegendLabelFormat() != null) {<NEW_LINE>piePlot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator(jrPiePlot.getLegendLabelFormat(), NumberFormat.getNumberInstance(getLocale()), NumberFormat.getPercentInstance(getLocale())));<NEW_LINE>}<NEW_LINE>// the default legend label is just the key, so there's no need to set localized number formats<NEW_LINE>return jfreeChart;<NEW_LINE>}
? true : jrPiePlot.getCircular();
975,382
final GetDomainSuggestionsResult executeGetDomainSuggestions(GetDomainSuggestionsRequest getDomainSuggestionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDomainSuggestionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDomainSuggestionsRequest> request = null;<NEW_LINE>Response<GetDomainSuggestionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDomainSuggestionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDomainSuggestionsRequest));<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, "Route 53 Domains");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDomainSuggestionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDomainSuggestionsResultJsonUnmarshaller());<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.OPERATION_NAME, "GetDomainSuggestions");
1,448,660
private void writeTicketsFile(Repository db, String file, String content, String createdBy, String msg) {<NEW_LINE>if (getTicketsBranch(db) == null) {<NEW_LINE>createTicketsBranch(db);<NEW_LINE>}<NEW_LINE>DirCache newIndex = DirCache.newInCore();<NEW_LINE>DirCacheBuilder builder = newIndex.builder();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>// create an index entry for the revised index<NEW_LINE>final DirCacheEntry idIndexEntry = new DirCacheEntry(file);<NEW_LINE>idIndexEntry.setLength(content.length());<NEW_LINE>idIndexEntry.setLastModified(System.currentTimeMillis());<NEW_LINE>idIndexEntry.setFileMode(FileMode.REGULAR_FILE);<NEW_LINE>// insert new ticket index<NEW_LINE>idIndexEntry.setObjectId(inserter.insert(org.eclipse.jgit.lib.Constants.OBJ_BLOB, content.getBytes(Constants.ENCODING)));<NEW_LINE>// add to temporary in-core index<NEW_LINE>builder.add(idIndexEntry);<NEW_LINE>Set<String> ignorePaths = new HashSet<String>();<NEW_LINE>ignorePaths.add(file);<NEW_LINE>for (DirCacheEntry entry : JGitUtils.getTreeEntries(db, BRANCH, ignorePaths)) {<NEW_LINE>builder.add(entry);<NEW_LINE>}<NEW_LINE>// finish temporary in-core index used for this commit<NEW_LINE>builder.finish();<NEW_LINE>// commit the change<NEW_LINE>commitIndex(db, newIndex, createdBy, msg);<NEW_LINE>} catch (ConcurrentRefUpdateException e) {<NEW_LINE>log.error("", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("", e);<NEW_LINE>} finally {<NEW_LINE>inserter.close();<NEW_LINE>}<NEW_LINE>}
ObjectInserter inserter = db.newObjectInserter();
1,297,910
<T> T evictionOrder(boolean hottest, Function<V, V> transformer, Function<Stream<CacheEntry<K, V>>, T> mappingFunction) {<NEW_LINE>Comparator<Node<K, V>> comparator = Comparator.comparingInt(node -> {<NEW_LINE>K key = node.getKey();<NEW_LINE>return (key == null) ? 0 : frequencySketch().frequency(key);<NEW_LINE>});<NEW_LINE>Iterable<Node<K, V>> iterable;<NEW_LINE>if (hottest) {<NEW_LINE>iterable = () -> {<NEW_LINE>var secondary = PeekingIterator.comparing(accessOrderProbationDeque().descendingIterator(), accessOrderWindowDeque().descendingIterator(), comparator);<NEW_LINE>return PeekingIterator.concat(accessOrderProtectedDeque().descendingIterator(), secondary);<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>iterable = () -> {<NEW_LINE>var primary = PeekingIterator.comparing(accessOrderWindowDeque().iterator(), accessOrderProbationDeque().iterator(<MASK><NEW_LINE>return PeekingIterator.concat(primary, accessOrderProtectedDeque().iterator());<NEW_LINE>};<NEW_LINE>}<NEW_LINE>return snapshot(iterable, transformer, mappingFunction);<NEW_LINE>}
), comparator.reversed());
1,361,465
public static int computeMaxAcceptableAlleleCount(final int ploidy, final int maxGenotypeCount) {<NEW_LINE>// a hack to check ploidy makes sense (could duplicate code but choice must be made)<NEW_LINE>checkPloidyAndMaximumAllele(ploidy, ploidy);<NEW_LINE>if (ploidy == 1) {<NEW_LINE>return maxGenotypeCount;<NEW_LINE>}<NEW_LINE>final double log10MaxGenotypeCount = Math.log10(maxGenotypeCount);<NEW_LINE>// Math explanation: genotype count is determined by ${P+A-1 \choose A-1}$, this leads to constraint<NEW_LINE>// $\log(\frac{(P+A-1)!}{(A-1)!}) \le \log(P!G)$,<NEW_LINE>// where $P$ is ploidy, $A$ is allele count, and $G$ is maxGenotypeCount<NEW_LINE>// The upper and lower bounds of the left hand side of the constraint are $P \log(A-1+P)$ and $P \log(A)$<NEW_LINE>// which require $A$ to be searched in interval $[10^{\log(P!G)/P} - (P-1), 10^{\log(P!G)/P}]$<NEW_LINE>// Denote $[10^{\log(P!G)/P}$ as $x$ in the code.<NEW_LINE>final double x = Math.pow(10, (MathUtils.log10Factorial(ploidy) + log10MaxGenotypeCount) / ploidy);<NEW_LINE>final int lower = (int) Math.<MASK><NEW_LINE>final int upper = (int) Math.ceil(x);<NEW_LINE>for (int a = upper; a >= lower; --a) {<NEW_LINE>// check one by one<NEW_LINE>final double log10GTCnt = MathUtils.log10BinomialCoefficient(ploidy + a - 1, a - 1);<NEW_LINE>if (log10MaxGenotypeCount >= log10GTCnt) {<NEW_LINE>return a;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new GATKException("Code should never reach here.");<NEW_LINE>}
floor(x) - ploidy - 1;
199,720
public void verify(Component component, JRVerifier verifier) {<NEW_LINE>ListComponent listComponent = (ListComponent) component;<NEW_LINE>JRDatasetRun datasetRun = listComponent.getDatasetRun();<NEW_LINE>if (datasetRun == null) {<NEW_LINE>verifier.addBrokenRule("No list subdataset run set", listComponent);<NEW_LINE>} else {<NEW_LINE>verifier.verifyDatasetRun(datasetRun);<NEW_LINE>}<NEW_LINE>ListContents listContents = listComponent.getContents();<NEW_LINE>if (listContents == null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>PrintOrderEnum listPrintOrder = listComponent.getPrintOrderValue() == null ? PrintOrderEnum.VERTICAL : listComponent.getPrintOrderValue();<NEW_LINE>Boolean listIgnoreWidth = listComponent.getIgnoreWidth();<NEW_LINE>boolean ignoreWidth = listIgnoreWidth != null && listIgnoreWidth;<NEW_LINE>if (listContents.getHeight() < 0) {<NEW_LINE>verifier.addBrokenRule("List contents height must be positive.", listContents);<NEW_LINE>}<NEW_LINE>int elementWidth = verifier.getCurrentComponentElement().getWidth();<NEW_LINE>Integer width = listContents.getWidth();<NEW_LINE>int contentsWidth;<NEW_LINE>if (width == null) {<NEW_LINE>contentsWidth = elementWidth;<NEW_LINE>if (listPrintOrder == PrintOrderEnum.HORIZONTAL) {<NEW_LINE>verifier.addBrokenRule("List contents width must be set for horizontal lists", listContents);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>contentsWidth = width;<NEW_LINE>if (width <= 0) {<NEW_LINE>verifier.addBrokenRule("List contents width must be positive.", listContents);<NEW_LINE>}<NEW_LINE>if (!ignoreWidth && listPrintOrder == PrintOrderEnum.HORIZONTAL && width > elementWidth) {<NEW_LINE>verifier.addBrokenRule("List contents width is larger than the list element width", listComponent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String subdataset = datasetRun == null ? null : datasetRun.getDatasetName();<NEW_LINE>if (subdataset != null) {<NEW_LINE>verifier.pushSubdatasetContext(subdataset);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>verifyContents(verifier, listContents, contentsWidth);<NEW_LINE>} finally {<NEW_LINE>if (subdataset != null) {<NEW_LINE>verifier.popSubdatasetContext();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
verifier.addBrokenRule("No list contents set", listComponent);
1,297,160
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Choice choice = new ChoiceCreatureType(game.getObject(source));<NEW_LINE>if (controller != null && controller.choose(Outcome.GainControl, choice, game)) {<NEW_LINE>String chosenType = choice.getChoice();<NEW_LINE>game.informPlayers(controller.getLogName() + " has chosen " + chosenType);<NEW_LINE>UUID playerWithMost = null;<NEW_LINE>int maxControlled = 0;<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {<NEW_LINE>FilterPermanent filter = new FilterCreaturePermanent(SubType.byDescription(chosenType), chosenType);<NEW_LINE>filter.<MASK><NEW_LINE>int controlled = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);<NEW_LINE>if (controlled > maxControlled) {<NEW_LINE>maxControlled = controlled;<NEW_LINE>playerWithMost = playerId;<NEW_LINE>} else if (controlled == maxControlled) {<NEW_LINE>// Do nothing in case of tie<NEW_LINE>playerWithMost = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (playerWithMost != null && playerWithMost.equals(controller.getId())) {<NEW_LINE>for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(SubType.byDescription(chosenType), chosenType), controller.getId(), source, game)) {<NEW_LINE>ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame);<NEW_LINE>effect.setTargetPointer(new FixedTarget(permanent, game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
add(new ControllerIdPredicate(playerId));
1,496,542
public void run(ResultIterator resultIterator) throws Exception {<NEW_LINE>final Map<Library, String> importsMap = new LinkedHashMap<>();<NEW_LINE>for (Map.Entry<String, String> entry : context.getDeclarations().entrySet()) {<NEW_LINE>String uri = entry.getKey();<NEW_LINE>String prefix = entry.getValue();<NEW_LINE>Library <MASK><NEW_LINE>if (lib != null) {<NEW_LINE>importsMap.put(lib, prefix);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// do the import under atomic lock in different thread,<NEW_LINE>RequestProcessor.getDefault().post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>((BaseDocument) templateInstanceDoc).runAtomic(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>LibraryUtils.importLibrary(templateInstanceDoc, importsMap, jsfs.isJsf22Plus());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>// save the template instance after imports<NEW_LINE>ec.saveDocument();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>Exceptions.printStackTrace(ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
lib = jsfs.getLibrary(uri);
430,172
public static String toUserDisplayableString(final Uri uri) {<NEW_LINE>if (uri == null) {<NEW_LINE>return "---";<NEW_LINE>}<NEW_LINE>// Handle special File case<NEW_LINE>if (isFileUri(uri)) {<NEW_LINE>return uri.getPath();<NEW_LINE>}<NEW_LINE>String uriString = uri.getLastPathSegment();<NEW_LINE>if (uriString == null) {<NEW_LINE>return "---";<NEW_LINE>}<NEW_LINE>// handle the non-content-case (e.g. web Uris)<NEW_LINE>if (!isContentUri(uri)) {<NEW_LINE>return uri.toString();<NEW_LINE>}<NEW_LINE>String volumeId = null;<NEW_LINE>// check if there'sa volume<NEW_LINE>final int idx = uriString.indexOf(":");<NEW_LINE>if (idx >= 0) {<NEW_LINE>volumeId = uriString.substring(0, idx);<NEW_LINE>uriString = uriString.substring(idx + 1);<NEW_LINE>}<NEW_LINE>// construct base Uri<NEW_LINE>while (uriString.startsWith("/")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>uriString = "/" + uriString;<NEW_LINE>// add volumne name if available/feasible<NEW_LINE>if (volumeId != null) {<NEW_LINE>final String volumeName = VOLUME_MAP.get(volumeId);<NEW_LINE>if (volumeName != null) {<NEW_LINE>uriString = volumeName + uriString;<NEW_LINE>} else if (!"primary".equals(volumeId)) {<NEW_LINE>uriString = volumeId + uriString;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add provider info if available/feasible<NEW_LINE>final String providerId = uri.getAuthority();<NEW_LINE>// default provider would be "com.android.externalstorage.documents", we don't add anything for this one<NEW_LINE>if ("com.android.providers.downloads.documents".equals(providerId)) {<NEW_LINE>uriString = "Downloads:" + uriString;<NEW_LINE>}<NEW_LINE>while (uriString.endsWith("/")) {<NEW_LINE>uriString = uriString.substring(0, uriString.length() - 1);<NEW_LINE>}<NEW_LINE>return uriString;<NEW_LINE>}
uriString = uriString.substring(1);
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>String group = rabbitListener.group();<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.<MASK><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>}
setExclusive(rabbitListener.exclusive());
1,785,363
public static void registerTornadoMathPlugins(final InvocationPlugins plugins) {<NEW_LINE>Registration registration = new Registration(plugins, TornadoMath.class);<NEW_LINE>registerFloatMath1Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerTrigonometric1Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerFloatMath2Plugins(registration, float.class, JavaKind.Float);<NEW_LINE>registerFloatMath3Plugins(registration, <MASK><NEW_LINE>registerFloatMath1Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerFloatMath2Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerFloatMath3Plugins(registration, double.class, JavaKind.Double);<NEW_LINE>registerIntMath1Plugins(registration, int.class, JavaKind.Int);<NEW_LINE>registerIntMath2Plugins(registration, int.class, JavaKind.Int);<NEW_LINE>registerIntMath3Plugins(registration, int.class, JavaKind.Int);<NEW_LINE>registerIntMath1Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath2Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath3Plugins(registration, long.class, JavaKind.Long);<NEW_LINE>registerIntMath1Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath2Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath3Plugins(registration, short.class, JavaKind.Short);<NEW_LINE>registerIntMath1Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>registerIntMath2Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>registerIntMath3Plugins(registration, byte.class, JavaKind.Byte);<NEW_LINE>}
float.class, JavaKind.Float);
489,202
public boolean intersects(List<String> value, ChunkData data) {<NEW_LINE>if (data.getRegion() == null || data.getRegion().getData() == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ChunkFilter chunkFilter = VersionController.getChunkFilter(data.getRegion().getData().getInt("DataVersion"));<NEW_LINE>CompoundTag references = chunkFilter.getStructureReferences(data.<MASK><NEW_LINE>if (references == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (String name : getFilterValue()) {<NEW_LINE>long[] refs = ValidationHelper.silent(() -> references.getLongArray(name), null);<NEW_LINE>if (refs != null && refs.length > 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>refs = ValidationHelper.silent(() -> references.getLongArray(StructureRegistry.getAltName(name)), null);<NEW_LINE>if (refs != null && refs.length > 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getRegion().getData());
163,420
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<ModelMap> allModels) {<NEW_LINE>Map<String, Object> operations = (Map<String, Object>) objs.get("operations");<NEW_LINE>List<CodegenOperation> os = (List<CodegenOperation>) operations.get("operation");<NEW_LINE>List<ExtendedCodegenOperation> newOs = new ArrayList<ExtendedCodegenOperation>();<NEW_LINE>Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}");<NEW_LINE>for (CodegenOperation o : os) {<NEW_LINE>// force http method to lower case<NEW_LINE>o.httpMethod = o.httpMethod.toLowerCase(Locale.ROOT);<NEW_LINE>if (o.isArray) {<NEW_LINE>o.returnType = "[" + o.returnBaseType + "]";<NEW_LINE>}<NEW_LINE>ArrayList<String> pathTemplateNames <MASK><NEW_LINE>Matcher matcher = pattern.matcher(o.path);<NEW_LINE>StringBuffer buffer = new StringBuffer();<NEW_LINE>while (matcher.find()) {<NEW_LINE>String pathTemplateName = matcher.group(1);<NEW_LINE>matcher.appendReplacement(buffer, "\", " + camelize(pathTemplateName) + ", \"");<NEW_LINE>pathTemplateNames.add(pathTemplateName);<NEW_LINE>}<NEW_LINE>matcher.appendTail(buffer);<NEW_LINE>ExtendedCodegenOperation eco = new ExtendedCodegenOperation(o);<NEW_LINE>if (buffer.toString().isEmpty()) {<NEW_LINE>eco.setReplacedPathName(o.path);<NEW_LINE>} else {<NEW_LINE>eco.setReplacedPathName(buffer.toString());<NEW_LINE>}<NEW_LINE>eco.setPathTemplateNames(pathTemplateNames);<NEW_LINE>newOs.add(eco);<NEW_LINE>}<NEW_LINE>operations.put("operation", newOs);<NEW_LINE>return objs;<NEW_LINE>}
= new ArrayList<String>();
1,017,020
public void forceCleanOnlineStatus(String userId, String clientId) {<NEW_LINE>if (m_Server.isShutdowning()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!mMultiPlatformNotification || m_Server.getStore().sessionsStore().isMultiEndpointSupported()) {<NEW_LINE>WFCMessage.UserSettingEntry pcentry = getUserSetting(userId, kUserSettingPCOnline, "PC");<NEW_LINE>if (pcentry != null && !StringUtil.isNullOrEmpty(pcentry.getValue()) && pcentry.getValue().contains(clientId)) {<NEW_LINE>updateUserSettings(userId, WFCMessage.ModifyUserSettingReq.newBuilder().setScope(kUserSettingPCOnline).setKey("PC").setValue("").build(), clientId);<NEW_LINE>}<NEW_LINE>WFCMessage.UserSettingEntry padentry = getUserSetting(userId, kUserSettingPCOnline, "Pad");<NEW_LINE>if (padentry != null && !StringUtil.isNullOrEmpty(padentry.getValue()) && padentry.getValue().contains(clientId)) {<NEW_LINE>updateUserSettings(userId, WFCMessage.ModifyUserSettingReq.newBuilder().setScope(kUserSettingPCOnline).setKey("Pad").setValue(""<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).build(), clientId);
1,810,765
private void customizeComponents() {<NEW_LINE>searchTextField.setComponentPopupMenu(rightClickMenu);<NEW_LINE>ActionListener actList = new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>JMenuItem jmi = <MASK><NEW_LINE>if (jmi.equals(cutMenuItem)) {<NEW_LINE>searchTextField.cut();<NEW_LINE>} else if (jmi.equals(copyMenuItem)) {<NEW_LINE>searchTextField.copy();<NEW_LINE>} else if (jmi.equals(pasteMenuItem)) {<NEW_LINE>searchTextField.paste();<NEW_LINE>} else if (jmi.equals(selectAllMenuItem)) {<NEW_LINE>searchTextField.selectAll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>cutMenuItem.addActionListener(actList);<NEW_LINE>copyMenuItem.addActionListener(actList);<NEW_LINE>pasteMenuItem.addActionListener(actList);<NEW_LINE>selectAllMenuItem.addActionListener(actList);<NEW_LINE>this.searchTextField.getDocument().addDocumentListener(new DocumentListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void insertUpdate(DocumentEvent e) {<NEW_LINE>firePropertyChange(FileSearchPanel.EVENT.CHECKED.toString(), null, null);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void removeUpdate(DocumentEvent e) {<NEW_LINE>firePropertyChange(FileSearchPanel.EVENT.CHECKED.toString(), null, null);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void changedUpdate(DocumentEvent e) {<NEW_LINE>firePropertyChange(FileSearchPanel.EVENT.CHECKED.toString(), null, null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(JMenuItem) e.getSource();
1,632,952
protected Mono<Void> renderInternal(Map<String, Object> model, @Nullable MediaType contentType, ServerWebExchange exchange) {<NEW_LINE>return exchange.getResponse().writeWith(Mono.fromCallable(() -> {<NEW_LINE>try {<NEW_LINE>ScriptEngine engine = getEngine();<NEW_LINE>String url = getUrl();<NEW_LINE>Assert.state(url != null, "'url' not set");<NEW_LINE>String template = getTemplate(url);<NEW_LINE>Function<String, String> templateLoader = path -> {<NEW_LINE>try {<NEW_LINE>return getTemplate(path);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Locale locale = LocaleContextHolder.getLocale(exchange.getLocaleContext());<NEW_LINE>RenderingContext context = new RenderingContext(obtainApplicationContext(), locale, templateLoader, url);<NEW_LINE>Object html;<NEW_LINE>if (this.renderFunction == null) {<NEW_LINE>SimpleBindings bindings = new SimpleBindings();<NEW_LINE>bindings.putAll(model);<NEW_LINE>model.put("renderingContext", context);<NEW_LINE>html = engine.eval(template, bindings);<NEW_LINE>} else if (this.renderObject != null) {<NEW_LINE>Object thiz = engine.eval(this.renderObject);<NEW_LINE>html = ((Invocable) engine).invokeMethod(thiz, this.renderFunction, template, model, context);<NEW_LINE>} else {<NEW_LINE>html = ((Invocable) engine).invokeFunction(this.renderFunction, template, model, context);<NEW_LINE>}<NEW_LINE>byte[] bytes = String.valueOf(html<MASK><NEW_LINE>// just wrapping, no allocation<NEW_LINE>return exchange.getResponse().bufferFactory().wrap(bytes);<NEW_LINE>} catch (ScriptException ex) {<NEW_LINE>throw new IllegalStateException("Failed to render script template", new StandardScriptEvalException(ex));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new IllegalStateException("Failed to render script template", ex);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}
).getBytes(StandardCharsets.UTF_8);
442,172
private StringBuilder innModifyTopicDeployStatusInfo(HttpServletRequest req, StringBuilder sBuffer, ProcessResult result, TopicStsChgType chgType) {<NEW_LINE>// check and get operation info<NEW_LINE>if (!WebParameterUtils.getAUDBaseInfo(req, false, null, sBuffer, result)) {<NEW_LINE>WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());<NEW_LINE>return sBuffer;<NEW_LINE>}<NEW_LINE>BaseEntity opEntity = (BaseEntity) result.getRetData();<NEW_LINE>// check and get topicName info<NEW_LINE>if (!WebParameterUtils.getStringParamValue(req, WebFieldDef.COMPSTOPICNAME, true, null, sBuffer, result)) {<NEW_LINE>WebParameterUtils.buildFailResult(<MASK><NEW_LINE>return sBuffer;<NEW_LINE>}<NEW_LINE>Set<String> topicNameSet = (Set<String>) result.getRetData();<NEW_LINE>// check and get brokerId info<NEW_LINE>if (!WebParameterUtils.getIntParamValue(req, WebFieldDef.COMPSBROKERID, true, sBuffer, result)) {<NEW_LINE>WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());<NEW_LINE>return sBuffer;<NEW_LINE>}<NEW_LINE>Set<Integer> brokerIdSet = (Set<Integer>) result.getRetData();<NEW_LINE>// modify record status<NEW_LINE>List<TopicProcessResult> retInfo = new ArrayList<>();<NEW_LINE>for (Integer brokerId : brokerIdSet) {<NEW_LINE>for (String topicName : topicNameSet) {<NEW_LINE>retInfo.add(defMetaDataService.updTopicDeployStatusInfo(opEntity, brokerId, topicName, chgType, sBuffer, result));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buildRetInfo(retInfo, sBuffer);<NEW_LINE>}
sBuffer, result.getErrMsg());
553,901
public synchronized void draw(Rect rect) {<NEW_LINE>if (mFrame == null || !(mFrame.is(Extension.POINTS)))<NEW_LINE>return;<NEW_LINE>setViewport(rect);<NEW_LINE>GLES10.glMatrixMode(GLES10.GL_PROJECTION);<NEW_LINE>GLES10.glPushMatrix();<NEW_LINE>GLES10.glLoadIdentity();<NEW_LINE>GLES10.glOrthof(1f, -1f, -1f, 1f, -7f, 0f);<NEW_LINE>GLES10.glRotatef(180, 0.0f, 0.0f, 1.0f);<NEW_LINE>GLES10.glRotatef(-mDeltaY * mRotationFactor, 1.0f, 0.0f, 0.0f);<NEW_LINE>GLES10.glRotatef(mDeltaX * mRotationFactor, 0.0f, 1.0f, 0.0f);<NEW_LINE>Points points = <MASK><NEW_LINE>float[] data = points.getVertices();<NEW_LINE>byte[] tex = mTexture == null ? createTexture(data, 1.2f) : createTexture(points);<NEW_LINE>drawPoints(data, tex);<NEW_LINE>GLES10.glMatrixMode(GLES10.GL_PROJECTION);<NEW_LINE>GLES10.glPopMatrix();<NEW_LINE>}
mFrame.as(Extension.POINTS);
711,289
protected void updateContext(Map<String, Object> context) {<NEW_LINE>context.put("showTickLabels", showLabels);<NEW_LINE>context.put("tickLength", length);<NEW_LINE>context.put("tickWidth", width);<NEW_LINE>context.put("tickColor", color);<NEW_LINE>context.put("tickFont", tickFont);<NEW_LINE>context.put("ticks", placement);<NEW_LINE>if (tickText != null) {<NEW_LINE>context.put("tickText", Utils.dataAsString(tickText));<NEW_LINE>}<NEW_LINE>if (nTicks != 0) {<NEW_LINE>context.put("nTicks", nTicks);<NEW_LINE>}<NEW_LINE>if (dTick != null) {<NEW_LINE>context.put("dTick", dTick);<NEW_LINE>}<NEW_LINE>if (tick0 != null) {<NEW_LINE>context.put("tick0", tick0);<NEW_LINE>}<NEW_LINE>if (showExponent != ALL) {<NEW_LINE>context.put("showExponent", showExponent);<NEW_LINE>}<NEW_LINE>if (exponentFormat != B) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (tickValues != null) {<NEW_LINE>context.put("tickValues", Utils.dataAsString(tickValues));<NEW_LINE>}<NEW_LINE>context.put("mirror", mirror);<NEW_LINE>context.put("prefix", prefix);<NEW_LINE>context.put("suffix", suffix);<NEW_LINE>context.put("showPrefix", showPrefix);<NEW_LINE>context.put("showSuffix", showSuffix);<NEW_LINE>context.put("angle", angle);<NEW_LINE>context.put("autoMargin", autoMargin);<NEW_LINE>context.put("tickMode", tickMode);<NEW_LINE>context.put("separateThousands", separateThousands);<NEW_LINE>}
context.put("exponentFormat", exponentFormat);
457,749
final UpdateCertificateResult executeUpdateCertificate(UpdateCertificateRequest updateCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateCertificateRequest> request = null;<NEW_LINE>Response<UpdateCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateCertificateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateCertificateResultJsonUnmarshaller());<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.OPERATION_NAME, "UpdateCertificate");
1,282,168
protected void parseXmlInputStream(DefaultHandler handler, InputStream inputStream) throws IOException {<NEW_LINE>try {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Parsing XML response document with handler: " + handler.getClass());<NEW_LINE>}<NEW_LINE>final BufferedReader breader = new BufferedReader(new InputStreamReader(inputStream, Constants.DEFAULT_ENCODING));<NEW_LINE>xr.setContentHandler(handler);<NEW_LINE>xr.setErrorHandler(handler);<NEW_LINE>xr.parse(new InputSource(breader));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>try {<NEW_LINE>inputStream.close();<NEW_LINE>} catch (final IOException e) {<NEW_LINE>if (log.isErrorEnabled()) {<NEW_LINE>log.error("Unable to close response InputStream up after XML parse failure", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new AmazonClientException("Failed to parse XML document with handler " + <MASK><NEW_LINE>}<NEW_LINE>}
handler.getClass(), t);
717,482
public void run() {<NEW_LINE>if (!LOG.isStatistics()) {<NEW_LINE>LOG.error("Logging level should be at least level STATISTICS (parameter -time) to see any output.");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Relation<O> relation = database.getRelation(distance.getInputTypeRestriction());<NEW_LINE>final String key = getClass().getName();<NEW_LINE>Duration dur = LOG.newDuration(key + ".duration");<NEW_LINE>int hash;<NEW_LINE>MeanVariance mv = new MeanVariance(), mvdist = new MeanVariance();<NEW_LINE>// No query set - use original database.<NEW_LINE>if (queries == null) {<NEW_LINE>KNNSearcher<DBIDRef> knnQuery = new QueryBuilder<>(relation, distance).kNNByDBID(k);<NEW_LINE>logIndexStatistics(database);<NEW_LINE>hash = run(knnQuery, relation, dur, mv, mvdist);<NEW_LINE>} else {<NEW_LINE>// Separate query set.<NEW_LINE>KNNSearcher<O> knnQuery = new QueryBuilder<>(relation, distance).kNNByObject(k);<NEW_LINE>logIndexStatistics(database);<NEW_LINE>hash = run(knnQuery, dur, mv, mvdist);<NEW_LINE>}<NEW_LINE>LOG.statistics(dur.end());<NEW_LINE>if (dur instanceof MillisTimeDuration) {<NEW_LINE>LOG.statistics(new StringStatistic(key + ".duration.avg", dur.getDuration() / mv.getCount() * 1000. + " ns"));<NEW_LINE>}<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".results.mean", mv.getMean()));<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".results.std", mv.getPopulationStddev()));<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".kdist.mean", mvdist.getMean()));<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".kdist.std", mvdist.getPopulationStddev()));<NEW_LINE>logIndexStatistics(database);<NEW_LINE>LOG.statistics(new LongStatistic(key + ".checksum", hash));<NEW_LINE>}
Database database = inputstep.getDatabase();
1,356,199
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>String username = Preferences.getUsername(this);<NEW_LINE>boolean addAccount = getIntent().getBooleanExtra(EXTRA_ADD_ACCOUNT, false);<NEW_LINE>setContentView(R.layout.activity_login);<NEW_LINE>mUsernameLayout = (TextInputLayout) findViewById(R.id.textinput_username);<NEW_LINE>mPasswordLayout = (TextInputLayout) findViewById(R.id.textinput_password);<NEW_LINE>mUsernameEditText = (EditText) findViewById(R.id.edittext_username);<NEW_LINE>mLoginButton = findViewById(R.id.login_button);<NEW_LINE>mRegisterButton = findViewById(R.id.register_button);<NEW_LINE>if (!addAccount && !TextUtils.isEmpty(username)) {<NEW_LINE><MASK><NEW_LINE>mUsernameEditText.setText(username);<NEW_LINE>mRegisterButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mPasswordEditText = (EditText) findViewById(R.id.edittext_password);<NEW_LINE>mLoginButton.setOnClickListener(v -> {<NEW_LINE>if (!validate()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mLoginButton.setEnabled(false);<NEW_LINE>mRegisterButton.setEnabled(false);<NEW_LINE>login(mUsernameEditText.getText().toString(), mPasswordEditText.getText().toString(), false);<NEW_LINE>});<NEW_LINE>mRegisterButton.setOnClickListener(v -> {<NEW_LINE>if (!validate()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mLoginButton.setEnabled(false);<NEW_LINE>mRegisterButton.setEnabled(false);<NEW_LINE>login(mUsernameEditText.getText().toString().trim(), mPasswordEditText.getText().toString().trim(), true);<NEW_LINE>});<NEW_LINE>}
setTitle(R.string.re_enter_password);
754,428
final CreateEnvironmentTemplateResult executeCreateEnvironmentTemplate(CreateEnvironmentTemplateRequest createEnvironmentTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEnvironmentTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEnvironmentTemplateRequest> request = null;<NEW_LINE>Response<CreateEnvironmentTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEnvironmentTemplateRequestProtocolMarshaller(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, "Proton");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEnvironmentTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateEnvironmentTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEnvironmentTemplateResultJsonUnmarshaller());<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(createEnvironmentTemplateRequest));
396,876
public static // but overrides the disk and machine type options in the template.<NEW_LINE>void createInstanceFromTemplateWithOverrides(String projectId, String zone, String instanceName, String instanceTemplateName) throws IOException, ExecutionException, InterruptedException {<NEW_LINE>try (InstancesClient instancesClient = InstancesClient.create();<NEW_LINE>InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.create()) {<NEW_LINE>String machineType = "n1-standard-1";<NEW_LINE>String newDiskSourceImage = "projects/debian-cloud/global/images/family/debian-10";<NEW_LINE>// Retrieve an instance template.<NEW_LINE>InstanceTemplate instanceTemplate = instanceTemplatesClient.get(projectId, instanceTemplateName);<NEW_LINE>AttachedDisk newdisk = AttachedDisk.newBuilder().setInitializeParams(AttachedDiskInitializeParams.newBuilder().setDiskSizeGb(10).setSourceImage(newDiskSourceImage).build()).setAutoDelete(true).setBoot(false).setType(AttachedDisk.Type.PERSISTENT.toString()).build();<NEW_LINE>Instance instance = // If you override a repeated field, all repeated values<NEW_LINE>Instance.newBuilder().setName(instanceName).setMachineType(String.format("zones/%s/machineTypes/%s", zone, machineType)).// for that property are replaced with the<NEW_LINE>// corresponding values provided in the request.<NEW_LINE>// When adding a new disk to existing disks,<NEW_LINE>// insert all existing disks as well.<NEW_LINE>addAllDisks(instanceTemplate.getProperties().getDisksList()).<MASK><NEW_LINE>InsertInstanceRequest insertInstanceRequest = InsertInstanceRequest.newBuilder().setProject(projectId).setZone(zone).setInstanceResource(instance).setSourceInstanceTemplate(instanceTemplate.getSelfLink()).build();<NEW_LINE>Operation response = instancesClient.insertAsync(insertInstanceRequest).get();<NEW_LINE>if (response.hasError()) {<NEW_LINE>System.out.println("Instance creation from template with overrides failed ! ! " + response);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.printf("Instance creation from template with overrides: Operation Status %s: %s ", instanceName, response.getStatus());<NEW_LINE>}<NEW_LINE>}
addDisks(newdisk).build();
422,913
private int parseLine(int startOff, int endOff, Pattern ptn) throws BadLocationException {<NEW_LINE>if (endOff <= startOff) {<NEW_LINE>return endOff;<NEW_LINE>}<NEW_LINE>Document doc = getDocument();<NEW_LINE>while (true) {<NEW_LINE>String line = doc.getText(startOff, endOff - startOff);<NEW_LINE>Matcher m = ptn.matcher(line);<NEW_LINE>// System.out.println("["+line+"]");<NEW_LINE>boolean ptnFound = m.find();<NEW_LINE>if (ptnFound) {<NEW_LINE>int len = m.end() - m.start();<NEW_LINE>boolean replaced = replaceWithImage(startOff + m.start(), startOff + m.end(), ptn);<NEW_LINE>if (replaced) {<NEW_LINE>startOff += m.start() + 1;<NEW_LINE>endOff -= len - 1;<NEW_LINE>} else {<NEW_LINE>startOff <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return endOff;<NEW_LINE>}
+= m.end() + 1;
558,549
private List<Versioned<byte[]>> proxyGetAndLocalPut(ByteArray key, int proxyId, byte[] transforms) throws VoldemortException {<NEW_LINE>List<Versioned<byte[]>> proxyValues = <MASK><NEW_LINE>for (Versioned<byte[]> proxyValue : proxyValues) {<NEW_LINE>try {<NEW_LINE>getInnerStore().put(key, proxyValue, null);<NEW_LINE>} catch (ObsoleteVersionException e) {<NEW_LINE>// TODO this is in TRACE because OVE is expected here, for keys<NEW_LINE>// that are already moved over or proxy got. This will become<NEW_LINE>// ERROR later post redesign<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("OVE in proxy get local put for key " + ByteUtils.toHexString(key.get()) + " Stealer:" + metadata.getNodeId() + " ProxyNode:" + proxyId, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return proxyValues;<NEW_LINE>}
proxyGet(key, proxyId, transforms);
397,186
final SendProjectSessionActionResult executeSendProjectSessionAction(SendProjectSessionActionRequest sendProjectSessionActionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(sendProjectSessionActionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<SendProjectSessionActionRequest> request = null;<NEW_LINE>Response<SendProjectSessionActionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SendProjectSessionActionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(sendProjectSessionActionRequest));<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, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SendProjectSessionAction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SendProjectSessionActionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SendProjectSessionActionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,493,027
private static void findSyntacticRelationsFromDependency(List<Mention> orderedMentions) {<NEW_LINE>if (orderedMentions.size() == 0)<NEW_LINE>return;<NEW_LINE>markListMemberRelation(orderedMentions);<NEW_LINE>SemanticGraph dependency = orderedMentions.get(0).enhancedDependency;<NEW_LINE>// apposition<NEW_LINE>Set<Pair<Integer, Integer>> appos = Generics.newHashSet();<NEW_LINE>List<SemanticGraphEdge> appositions = dependency.findAllRelns(UniversalEnglishGrammaticalRelations.APPOSITIONAL_MODIFIER);<NEW_LINE>for (SemanticGraphEdge edge : appositions) {<NEW_LINE>int sIdx = edge.getSource().index() - 1;<NEW_LINE>int tIdx = edge.getTarget<MASK><NEW_LINE>appos.add(Pair.makePair(sIdx, tIdx));<NEW_LINE>}<NEW_LINE>markMentionRelation(orderedMentions, appos, "APPOSITION");<NEW_LINE>// predicate nominatives<NEW_LINE>Set<Pair<Integer, Integer>> preNomi = Generics.newHashSet();<NEW_LINE>List<SemanticGraphEdge> copula = dependency.findAllRelns(UniversalEnglishGrammaticalRelations.COPULA);<NEW_LINE>for (SemanticGraphEdge edge : copula) {<NEW_LINE>IndexedWord source = edge.getSource();<NEW_LINE>IndexedWord target = dependency.getChildWithReln(source, UniversalEnglishGrammaticalRelations.NOMINAL_SUBJECT);<NEW_LINE>if (target == null)<NEW_LINE>target = dependency.getChildWithReln(source, UniversalEnglishGrammaticalRelations.CLAUSAL_SUBJECT);<NEW_LINE>// TODO<NEW_LINE>if (target == null)<NEW_LINE>continue;<NEW_LINE>// to handle relative clause: e.g., Tim who is a student,<NEW_LINE>if (target.tag().startsWith("W")) {<NEW_LINE>IndexedWord parent = dependency.getParent(source);<NEW_LINE>if (parent != null && dependency.reln(parent, source).equals(UniversalEnglishGrammaticalRelations.RELATIVE_CLAUSE_MODIFIER)) {<NEW_LINE>target = parent;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int sIdx = source.index() - 1;<NEW_LINE>int tIdx = target.index() - 1;<NEW_LINE>preNomi.add(Pair.makePair(tIdx, sIdx));<NEW_LINE>}<NEW_LINE>markMentionRelation(orderedMentions, preNomi, "PREDICATE_NOMINATIVE");<NEW_LINE>// relative pronouns TODO<NEW_LINE>Set<Pair<Integer, Integer>> relativePronounPairs = Generics.newHashSet();<NEW_LINE>markMentionRelation(orderedMentions, relativePronounPairs, "RELATIVE_PRONOUN");<NEW_LINE>}
().index() - 1;
950,812
public static void main(String[] args) throws IOException {<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(System.in));<NEW_LINE>br.readLine();<NEW_LINE>br.readLine();<NEW_LINE>// no. of elements in array<NEW_LINE>int n = Integer.parseInt(br.readLine());<NEW_LINE>int[<MASK><NEW_LINE>String[] input;<NEW_LINE>input = br.readLine().split(" ");<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>sides[i] = Integer.parseInt(input[i]);<NEW_LINE>}<NEW_LINE>Arrays.sort(sides);<NEW_LINE>boolean flag = false;<NEW_LINE>// starting from end, because we have sorted in //ascending order and we want the max element //first, you could also sort in descending order //and start from i=0<NEW_LINE>for (int i = n - 1; i >= 2; i--) {<NEW_LINE>if (sides[i - 2] + sides[i - 1] > sides[i]) {<NEW_LINE>System.out.println(sides[i - 2] + " " + sides[i - 1] + " " + sides[i]);<NEW_LINE>flag = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (flag == false) {<NEW_LINE>System.out.println("-1");<NEW_LINE>}<NEW_LINE>}
] sides = new int[n];
1,812,940
private int[] computeRequiredStemIndices(PreprocessingContext context) {<NEW_LINE>final int[] labelsFeatureIndex = context.allLabels.featureIndex;<NEW_LINE>final int[] wordsStemIndex = context.allWords.stemIndex;<NEW_LINE>final short[] wordsTypes = context.allWords.type;<NEW_LINE>final int[][] phrasesWordIndices = context.allPhrases.wordIndices;<NEW_LINE>final int wordCount = wordsStemIndex.length;<NEW_LINE>final int[][] stemsTfByDocument = context.allStems.tfByDocument;<NEW_LINE>int documentCount = context.documentCount;<NEW_LINE>final BitSet requiredStemIndices <MASK><NEW_LINE>double maxWordDf = this.maxWordDf.get();<NEW_LINE>for (int i = 0; i < labelsFeatureIndex.length; i++) {<NEW_LINE>final int featureIndex = labelsFeatureIndex[i];<NEW_LINE>if (featureIndex < wordCount) {<NEW_LINE>addStemIndex(wordsStemIndex, documentCount, stemsTfByDocument, requiredStemIndices, featureIndex, maxWordDf);<NEW_LINE>} else {<NEW_LINE>final int[] wordIndices = phrasesWordIndices[featureIndex - wordCount];<NEW_LINE>for (int j = 0; j < wordIndices.length; j++) {<NEW_LINE>final int wordIndex = wordIndices[j];<NEW_LINE>if (!TokenTypeUtils.isCommon(wordsTypes[wordIndex])) {<NEW_LINE>addStemIndex(wordsStemIndex, documentCount, stemsTfByDocument, requiredStemIndices, wordIndex, maxWordDf);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return requiredStemIndices.asIntLookupContainer().toArray();<NEW_LINE>}
= new BitSet(labelsFeatureIndex.length);
29,517
public void start() {<NEW_LINE>bootstrap.option(ChannelOption.SO_REUSEADDR, true);<NEW_LINE>bootstrap.childOption(ChannelOption.TCP_NODELAY, true);<NEW_LINE>bootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void initChannel(SocketChannel ch) {<NEW_LINE>ch.pipeline().addLast("connectionHandler", connectionHandler);<NEW_LINE>ch.pipeline().addLast("encoder", new EncodeHandler());<NEW_LINE>ch.pipeline().addLast("decoder", new DecodeHandler(true));<NEW_LINE>ch.pipeline().addLast("dispatcher", serverHandler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>channel = bootstrap.bind(port).await().channel();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>LOG.info("listen on port {}", port);<NEW_LINE>}
LOG.error("server start fail", e);
504,660
public void invoke(@NotNull Project project, @NotNull PsiFile psiFile, @NotNull PsiElement startElement, @NotNull PsiElement endElement) {<NEW_LINE>final PsiClass myClass = (PsiClass) startElement;<NEW_LINE>final Editor editor = CodeInsightUtil.positionCursor(project, psiFile, myClass.getLBrace());<NEW_LINE>if (editor != null) {<NEW_LINE>WriteCommandAction.writeCommandAction(project, psiFile).run(() -> {<NEW_LINE>final PsiElementFactory <MASK><NEW_LINE>final PsiField psiField = psiElementFactory.createField(myName, myType);<NEW_LINE>final PsiModifierList modifierList = psiField.getModifierList();<NEW_LINE>if (null != modifierList) {<NEW_LINE>for (String modifier : myModifiers) {<NEW_LINE>modifierList.setModifierProperty(modifier, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != myInitializerText) {<NEW_LINE>PsiExpression psiInitializer = psiElementFactory.createExpressionFromText(myInitializerText, psiField);<NEW_LINE>psiField.setInitializer(psiInitializer);<NEW_LINE>}<NEW_LINE>final List<PsiGenerationInfo<PsiField>> generationInfos = GenerateMembersUtil.insertMembersAtOffset(myClass.getContainingFile(), editor.getCaretModel().getOffset(), Collections.singletonList(new PsiGenerationInfo<>(psiField)));<NEW_LINE>if (!generationInfos.isEmpty()) {<NEW_LINE>PsiField psiMember = generationInfos.iterator().next().getPsiMember();<NEW_LINE>editor.getCaretModel().moveToOffset(psiMember.getTextRange().getEndOffset());<NEW_LINE>}<NEW_LINE>UndoUtil.markPsiFileForUndo(psiFile);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
psiElementFactory = JavaPsiFacade.getElementFactory(project);
1,589,446
public static ExtDocElement createElementForType(ExtDocElementType elementType, String elementText, int elementTextStartOffset) {<NEW_LINE>switch(elementType.getCategory()) {<NEW_LINE>case DESCRIPTION:<NEW_LINE>return ExtDocDescriptionElement.create(elementType, elementText);<NEW_LINE>case IDENT_SIMPLE:<NEW_LINE>return ExtDocIdentSimpleElement.create(elementType, elementText);<NEW_LINE>case IDENT_DESCRIBED:<NEW_LINE>String[] identAttributes = parseIdentAttributes(elementText);<NEW_LINE>return ExtDocIdentDescribedElement.create(elementType, identAttributes[0], identAttributes[1]);<NEW_LINE>case SIMPLE:<NEW_LINE>return ExtDocSimpleElement.create(elementType);<NEW_LINE>case TYPE_SIMPLE:<NEW_LINE>TypeInformation simpleInfo = parseTypeInformation(elementType, elementText, elementTextStartOffset);<NEW_LINE>return ExtDocTypeSimpleElement.create(elementType, simpleInfo.getType());<NEW_LINE>case TYPE_DESCRIBED:<NEW_LINE>TypeInformation descInfo = parseTypeInformation(elementType, elementText, elementTextStartOffset);<NEW_LINE>return ExtDocTypeDescribedElement.create(elementType, descInfo.getType(), descInfo.getDescription());<NEW_LINE>case TYPE_NAMED:<NEW_LINE>TypeInformation namedInfo = parseTypeInformation(elementType, elementText, elementTextStartOffset);<NEW_LINE>return ExtDocTypeNamedElement.create(elementType, namedInfo.getType(), namedInfo.getDescription(), namedInfo.getName(), namedInfo.isOptional(<MASK><NEW_LINE>default:<NEW_LINE>// unknown extDoc element type<NEW_LINE>return ExtDocDescriptionElement.create(elementType, elementText);<NEW_LINE>}<NEW_LINE>}
), namedInfo.getDefaultValue());
1,432,553
public void visitClass(ClassDescriptor classDescriptor) throws CheckedAnalysisException {<NEW_LINE>IAnalysisCache analysisCache = Global.getAnalysisCache();<NEW_LINE>ObligationFactory factory = database.getFactory();<NEW_LINE>JavaClass jclass = analysisCache.getClassAnalysis(JavaClass.class, classDescriptor);<NEW_LINE>for (Constant c : jclass.getConstantPool().getConstantPool()) {<NEW_LINE>if (c instanceof ConstantNameAndType) {<NEW_LINE>ConstantNameAndType cnt = (ConstantNameAndType) c;<NEW_LINE>String signature = cnt.getSignature(jclass.getConstantPool());<NEW_LINE>if (factory.signatureInvolvesObligations(signature)) {<NEW_LINE>super.visitClass(classDescriptor);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (c instanceof ConstantClass) {<NEW_LINE>String className = ((ConstantClass) c).getBytes(jclass.getConstantPool());<NEW_LINE>if (factory.signatureInvolvesObligations(className)) {<NEW_LINE>super.visitClass(classDescriptor);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (DEBUG) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>}
out.println(classDescriptor + " isn't interesting for obligation analysis");
740,255
public String simulateData(String trxName) {<NEW_LINE>HashMap<String, Object> parameters = new HashMap<String, Object>();<NEW_LINE>// Add Parameters<NEW_LINE>parameters.put("FINANCIAL_PRODUCT_ID", financialProductId);<NEW_LINE>parameters.put("BUSINESS_PARTNER_ID", businessPartnerId);<NEW_LINE>parameters.put("CAPITAL_AMT", capitalAmt);<NEW_LINE>parameters.put("FEES_QTY", feesQty);<NEW_LINE>parameters.put("START_DATE", startDate);<NEW_LINE><MASK><NEW_LINE>parameters.put("PAYMENT_FREQUENCY", paymentFrequency);<NEW_LINE>parameters.put("PAYMENT_DATE", payDate);<NEW_LINE>parameters.put("DUE_FIXED", isDueFixed);<NEW_LINE>//<NEW_LINE>FinancialSetting setting = FinancialSetting.get();<NEW_LINE>// Set Values<NEW_LINE>String errorMsg = setting.fire(Env.getCtx(), financialProductId, MFMFunctionalApplicability.EVENTTYPE_Simulation, parameters, trxName);<NEW_LINE>//<NEW_LINE>HashMap<String, Object> returnValues = setting.getReturnValues();<NEW_LINE>//<NEW_LINE>BigDecimal interestFeeAmt = (BigDecimal) returnValues.get("INTEREST_FEE_AMT");<NEW_LINE>BigDecimal taxAmt = (BigDecimal) returnValues.get("TAX_FEE_AMT");<NEW_LINE>BigDecimal grandTotal = (BigDecimal) returnValues.get("GRAND_TOTAL");<NEW_LINE>//<NEW_LINE>List<AmortizationValue> amortizationList = (List<AmortizationValue>) returnValues.get("AMORTIZATION_LIST");<NEW_LINE>if (interestFeeAmt != null) {<NEW_LINE>setInterestFeeAmt(interestFeeAmt.setScale(currencyPrecision, BigDecimal.ROUND_HALF_UP));<NEW_LINE>}<NEW_LINE>if (taxAmt != null) {<NEW_LINE>setTaxAmt(taxAmt.setScale(currencyPrecision, BigDecimal.ROUND_HALF_UP));<NEW_LINE>}<NEW_LINE>if (grandTotal != null) {<NEW_LINE>setGrandToral(grandTotal.setScale(currencyPrecision, BigDecimal.ROUND_HALF_UP));<NEW_LINE>}<NEW_LINE>// Reload table<NEW_LINE>reloadAmortization(amortizationList);<NEW_LINE>// Set Error<NEW_LINE>return Msg.parseTranslation(Env.getCtx(), errorMsg);<NEW_LINE>}
parameters.put("END_DATE", endDate);
1,548,443
public // The caller need to hold the db write lock<NEW_LINE>void modifyTableReplicationNum(Database db, OlapTable table, Map<String, String> properties) throws DdlException {<NEW_LINE>Preconditions.<MASK><NEW_LINE>ColocateTableIndex colocateTableIndex = Catalog.getCurrentColocateIndex();<NEW_LINE>if (colocateTableIndex.isColocateTable(table.getId())) {<NEW_LINE>throw new DdlException("table " + table.getName() + " is colocate table, cannot change replicationNum");<NEW_LINE>}<NEW_LINE>String defaultReplicationNumName = "default." + PropertyAnalyzer.PROPERTIES_REPLICATION_NUM;<NEW_LINE>PartitionInfo partitionInfo = table.getPartitionInfo();<NEW_LINE>if (partitionInfo.getType() == PartitionType.RANGE) {<NEW_LINE>throw new DdlException("This is a range partitioned table, you should specify partitions with MODIFY PARTITION clause." + " If you want to set default replication number, please use '" + defaultReplicationNumName + "' instead of '" + PropertyAnalyzer.PROPERTIES_REPLICATION_NUM + "' to escape misleading.");<NEW_LINE>}<NEW_LINE>// unpartitioned table<NEW_LINE>// update partition replication num<NEW_LINE>String partitionName = table.getName();<NEW_LINE>Partition partition = table.getPartition(partitionName);<NEW_LINE>if (partition == null) {<NEW_LINE>throw new DdlException("Partition does not exist. name: " + partitionName);<NEW_LINE>}<NEW_LINE>short replicationNum = Short.parseShort(properties.get(PropertyAnalyzer.PROPERTIES_REPLICATION_NUM));<NEW_LINE>boolean isInMemory = partitionInfo.getIsInMemory(partition.getId());<NEW_LINE>DataProperty newDataProperty = partitionInfo.getDataProperty(partition.getId());<NEW_LINE>partitionInfo.setReplicationNum(partition.getId(), replicationNum);<NEW_LINE>// update table default replication num<NEW_LINE>table.setReplicationNum(replicationNum);<NEW_LINE>// log<NEW_LINE>ModifyPartitionInfo info = new ModifyPartitionInfo(db.getId(), table.getId(), partition.getId(), newDataProperty, replicationNum, isInMemory);<NEW_LINE>editLog.logModifyPartition(info);<NEW_LINE>LOG.info("modify partition[{}-{}-{}] replication num to {}", db.getFullName(), table.getName(), partition.getName(), replicationNum);<NEW_LINE>}
checkArgument(db.isWriteLockHeldByCurrentThread());
854,107
public BackgroundException map(final SSLException failure) {<NEW_LINE>final StringBuilder buffer = new StringBuilder();<NEW_LINE>for (Throwable cause : ExceptionUtils.getThrowableList(failure)) {<NEW_LINE>if (cause instanceof SocketException) {<NEW_LINE>// Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Broken pipe<NEW_LINE>return new DefaultSocketExceptionMappingService().map((SocketException) cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>for (Alert alert : Alert.values()) {<NEW_LINE>if (StringUtils.containsIgnoreCase(message, alert.name())) {<NEW_LINE>this.append(buffer, alert.getDescription());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (failure instanceof SSLHandshakeException) {<NEW_LINE>if (ExceptionUtils.getRootCause(failure) instanceof CertificateException) {<NEW_LINE>log.warn(String.format("Ignore certificate failure %s and drop connection", failure.getMessage()));<NEW_LINE>// Server certificate not accepted<NEW_LINE>return new ConnectionCanceledException(failure);<NEW_LINE>}<NEW_LINE>if (ExceptionUtils.getRootCause(failure) instanceof EOFException) {<NEW_LINE>// SSL peer shut down incorrectly<NEW_LINE>return this.wrap(failure, buffer);<NEW_LINE>}<NEW_LINE>return new SSLNegotiateException(buffer.toString(), failure);<NEW_LINE>}<NEW_LINE>if (ExceptionUtils.getRootCause(failure) instanceof GeneralSecurityException) {<NEW_LINE>this.append(buffer, ExceptionUtils.getRootCause(failure).getMessage());<NEW_LINE>return new InteroperabilityException(buffer.toString(), failure);<NEW_LINE>}<NEW_LINE>this.append(buffer, message);<NEW_LINE>return new InteroperabilityException(buffer.toString(), failure);<NEW_LINE>}
String message = failure.getMessage();
1,808,494
private String _findSecondary(int origOffset, int hash, int[] q, int qlen) {<NEW_LINE>int offset = _tertiaryStart + ((origOffset >> (_tertiaryShift + 2)) << _tertiaryShift);<NEW_LINE>final int[] hashArea = _hashArea;<NEW_LINE>final int bucketSize = (1 << _tertiaryShift);<NEW_LINE>for (int end = offset + bucketSize; offset < end; offset += 4) {<NEW_LINE>int len = hashArea[offset + 3];<NEW_LINE>if ((hash == hashArea[offset]) && (qlen == len)) {<NEW_LINE>if (_verifyLongName(q, qlen, hashArea[offset + 1])) {<NEW_LINE>return _names[offset >> 2];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (len == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (offset = _spilloverStart(); offset < _spilloverEnd; offset += 4) {<NEW_LINE>if ((hash == hashArea[offset]) && (qlen == hashArea[offset + 3])) {<NEW_LINE>if (_verifyLongName(q, qlen, hashArea[offset + 1])) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
return _names[offset >> 2];
1,795,029
private void statInit() {<NEW_LINE>label1.setLabelFor(textField1);<NEW_LINE>label1.setText("Label1");<NEW_LINE>label1.setHorizontalAlignment(JLabel.LEADING);<NEW_LINE>textField1.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>label2.setLabelFor(textField2);<NEW_LINE>label2.setText("Label2");<NEW_LINE>label2.setHorizontalAlignment(JLabel.LEADING);<NEW_LINE>textField2.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>label3.setLabelFor(textField3);<NEW_LINE>label3.setText("Label3");<NEW_LINE>label3.setHorizontalAlignment(JLabel.LEADING);<NEW_LINE>textField3.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>label4.setLabelFor(textField4);<NEW_LINE>label4.setText("Label4");<NEW_LINE>label4.setHorizontalAlignment(JLabel.LEADING);<NEW_LINE>textField4.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>//<NEW_LINE>p_criteriaGrid.setLayout(new ALayout());<NEW_LINE>p_criteriaGrid.add(label1, <MASK><NEW_LINE>p_criteriaGrid.add(label2, null);<NEW_LINE>p_criteriaGrid.add(label3, null);<NEW_LINE>p_criteriaGrid.add(label4, null);<NEW_LINE>//<NEW_LINE>p_criteriaGrid.add(textField1, new ALayoutConstraint(1, 0));<NEW_LINE>p_criteriaGrid.add(textField2, null);<NEW_LINE>p_criteriaGrid.add(textField3, null);<NEW_LINE>p_criteriaGrid.add(textField4, null);<NEW_LINE>}
new ALayoutConstraint(0, 0));
52,310
public Polygon roundEdges(int rad) {<NEW_LINE>Polygon newPoly = new Polygon(closed);<NEW_LINE>int len = path.size();<NEW_LINE>if (!closed)<NEW_LINE>len--;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>VectorInterface p0 = path.get(i).getPoint();<NEW_LINE>VectorInterface p1 = path.get(wrapIndex(i <MASK><NEW_LINE>VectorInterface p2 = path.get(wrapIndex(i + 2)).getPoint();<NEW_LINE>VectorInterface d0 = p1.sub(p0);<NEW_LINE>float l0 = d0.len();<NEW_LINE>VectorInterface d1 = p2.sub(p1);<NEW_LINE>float l1 = d1.len();<NEW_LINE>VectorInterface n0 = p0.add(d0.mul(rad / l0));<NEW_LINE>VectorInterface n1 = p0.add(d0.mul((l0 - rad) / l0));<NEW_LINE>VectorInterface n2 = p1.add(d1.mul(rad / l1));<NEW_LINE>if (i == 0) {<NEW_LINE>if (closed)<NEW_LINE>newPoly.add(n0);<NEW_LINE>else<NEW_LINE>newPoly.add(p0);<NEW_LINE>}<NEW_LINE>if (!closed && i == len - 1) {<NEW_LINE>newPoly.add(p1);<NEW_LINE>} else {<NEW_LINE>newPoly.add(n1);<NEW_LINE>newPoly.add(p1, n2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newPoly;<NEW_LINE>}
+ 1)).getPoint();
951,405
protected void printObject(Object o) {<NEW_LINE>if (o == null) {<NEW_LINE>commandOutput.print("null");<NEW_LINE>} else if (o instanceof String) {<NEW_LINE>commandOutput.print('"');<NEW_LINE>commandOutput.print(o);<NEW_LINE>commandOutput.print('"');<NEW_LINE>} else if (o instanceof Date) {<NEW_LINE>DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);<NEW_LINE>commandOutput.print("'");<NEW_LINE>commandOutput.print(df.<MASK><NEW_LINE>commandOutput.print("'");<NEW_LINE>} else if (o instanceof List) {<NEW_LINE>List<Object> l = (List<Object>) o;<NEW_LINE>commandOutput.print("[");<NEW_LINE>for (Object obj : l) {<NEW_LINE>printObject(obj);<NEW_LINE>commandOutput.print(", ");<NEW_LINE>}<NEW_LINE>commandOutput.print("]");<NEW_LINE>} else if (o instanceof Map) {<NEW_LINE>Map<Object, Object> m = (Map<Object, Object>) o;<NEW_LINE>commandOutput.print('{');<NEW_LINE>for (Object key : m.keySet()) {<NEW_LINE>printObject(key);<NEW_LINE>commandOutput.print(':');<NEW_LINE>printObject(m.get(key));<NEW_LINE>commandOutput.print(", ");<NEW_LINE>}<NEW_LINE>commandOutput.print('}');<NEW_LINE>} else if (o instanceof Object[]) {<NEW_LINE>Object[] a = (Object[]) o;<NEW_LINE>commandOutput.print(Arrays.deepToString(a));<NEW_LINE>} else if (o instanceof byte[]) {<NEW_LINE>byte[] a = (byte[]) o;<NEW_LINE>commandOutput.print(Arrays.toString(a));<NEW_LINE>} else if (o instanceof ByteBuffer) {<NEW_LINE>ByteBuffer buffer = (ByteBuffer) o;<NEW_LINE>commandOutput.print(ByteUtils.toHexString(buffer.array()));<NEW_LINE>} else {<NEW_LINE>commandOutput.print(o);<NEW_LINE>}<NEW_LINE>}
format((Date) o));
988,509
private static List<ExecutableElement> disambiguateMethods(Iterable<? extends ExecutableElement> methods) {<NEW_LINE>Multimap<String, ExecutableElement<MASK><NEW_LINE>for (ExecutableElement m : methods) {<NEW_LINE>if (IsParameterlessNonstaticNonobject.PREDICATE.apply(m)) {<NEW_LINE>methodsAlternatives.put(ToSimpleName.FUNCTION.apply(m), m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ExecutableElement> resolvedMethods = Lists.newArrayList();<NEW_LINE>entries: for (Entry<String, Collection<ExecutableElement>> e : methodsAlternatives.asMap().entrySet()) {<NEW_LINE>Collection<ExecutableElement> values = e.getValue();<NEW_LINE>if (values.size() == 1) {<NEW_LINE>resolvedMethods.addAll(values);<NEW_LINE>} else {<NEW_LINE>// Preferably take the one coming from a class rather than interface<NEW_LINE>for (ExecutableElement v : values) {<NEW_LINE>if (v.getEnclosingElement().getKind().isClass()) {<NEW_LINE>resolvedMethods.add(v);<NEW_LINE>continue entries;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// grab just the first among interface names<NEW_LINE>for (ExecutableElement v : values) {<NEW_LINE>resolvedMethods.add(v);<NEW_LINE>continue entries;<NEW_LINE>}<NEW_LINE>// Expect that compilation error in user code<NEW_LINE>// will happen if methods are not compatible, they have to<NEW_LINE>// be resolved either way.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resolvedMethods;<NEW_LINE>}
> methodsAlternatives = HashMultimap.create();
1,833,940
public static GetCompanyLegalCaseThreeResponse unmarshall(GetCompanyLegalCaseThreeResponse getCompanyLegalCaseThreeResponse, UnmarshallerContext _ctx) {<NEW_LINE>getCompanyLegalCaseThreeResponse.setRequestId(_ctx.stringValue("GetCompanyLegalCaseThreeResponse.RequestId"));<NEW_LINE>getCompanyLegalCaseThreeResponse.setCode(_ctx.integerValue("GetCompanyLegalCaseThreeResponse.Code"));<NEW_LINE>getCompanyLegalCaseThreeResponse.setMessage(_ctx.stringValue("GetCompanyLegalCaseThreeResponse.Message"));<NEW_LINE>getCompanyLegalCaseThreeResponse.setTotal(_ctx.integerValue("GetCompanyLegalCaseThreeResponse.Total"));<NEW_LINE>List<String> data <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetCompanyLegalCaseThreeResponse.Data.Length"); i++) {<NEW_LINE>data.add(_ctx.stringValue("GetCompanyLegalCaseThreeResponse.Data[" + i + "]"));<NEW_LINE>}<NEW_LINE>getCompanyLegalCaseThreeResponse.setData(data);<NEW_LINE>return getCompanyLegalCaseThreeResponse;<NEW_LINE>}
= new ArrayList<String>();
1,847,010
public static void merge(ContentImpl from, Content to, boolean override, ApiContext context) {<NEW_LINE>if (from == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, MediaType> fromEntry : from.getMediaTypes().entrySet()) {<NEW_LINE>final String typeName = fromEntry.getKey();<NEW_LINE>final <MASK><NEW_LINE>// Get or create the corresponding media type<NEW_LINE>MediaTypeImpl toMediaType = (MediaTypeImpl) to.getMediaTypes().getOrDefault(typeName, new MediaTypeImpl());<NEW_LINE>to.addMediaType(typeName, toMediaType);<NEW_LINE>// Merge encoding<NEW_LINE>for (Map.Entry<String, Encoding> encoding : fromMediaType.getEncoding().entrySet()) {<NEW_LINE>EncodingImpl.merge(encoding.getKey(), encoding.getValue(), toMediaType.encoding, override, context);<NEW_LINE>}<NEW_LINE>// Merge examples<NEW_LINE>for (Map.Entry<String, Example> example : fromMediaType.getExamples().entrySet()) {<NEW_LINE>ExampleImpl.merge(example.getKey(), example.getValue(), toMediaType.examples, override);<NEW_LINE>}<NEW_LINE>toMediaType.setExample(mergeProperty(toMediaType.getExample(), fromMediaType.getExample(), override));<NEW_LINE>// Merge schema<NEW_LINE>if (fromMediaType.getSchema() != null) {<NEW_LINE>if (toMediaType.getSchema() == null) {<NEW_LINE>toMediaType.setSchema(new SchemaImpl());<NEW_LINE>}<NEW_LINE>Schema schema = toMediaType.getSchema();<NEW_LINE>SchemaImpl.merge(fromMediaType.getSchema(), schema, true, context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
MediaType fromMediaType = fromEntry.getValue();
1,476,842
final CreateIdentityProviderResult executeCreateIdentityProvider(CreateIdentityProviderRequest createIdentityProviderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createIdentityProviderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateIdentityProviderRequest> request = null;<NEW_LINE>Response<CreateIdentityProviderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateIdentityProviderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createIdentityProviderRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateIdentityProvider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateIdentityProviderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateIdentityProviderResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkSpaces Web");
1,816,232
public void exectute() {<NEW_LINE>try {<NEW_LINE>// create a temporary file for the resource editory PDF<NEW_LINE>File f = File.createTempFile("CodenameOneDesigner", ".pdf");<NEW_LINE>FileOutputStream out = new FileOutputStream(f);<NEW_LINE>InputStream input = getClass().getResourceAsStream("/CodenameOne-Designer.pdf");<NEW_LINE>byte[<MASK><NEW_LINE>int size = input.read(buffer);<NEW_LINE>while (size > -1) {<NEW_LINE>out.write(buffer, 0, size);<NEW_LINE>size = input.read(buffer);<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>f.deleteOnExit();<NEW_LINE>try {<NEW_LINE>Desktop.getDesktop().open(f);<NEW_LINE>} catch (Throwable err) {<NEW_LINE>// desktop class isn't available in Java 5...<NEW_LINE>JOptionPane.showMessageDialog(mainPanel, "Help is only available with a Java 6 or newer VM\nit requires Acrobat reader", "Help", JOptionPane.ERROR_MESSAGE);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>JOptionPane.showMessageDialog(mainPanel, "Error creating help file: \n" + ex, "IO Error", JOptionPane.ERROR_MESSAGE);<NEW_LINE>}<NEW_LINE>}
] buffer = new byte[65536];
352,148
public void load(final String name, final int keySize, final OType[] keyTypes, final OBinarySerializer<K> keySerializer, final OEncryption encryption) {<NEW_LINE>acquireExclusiveLock();<NEW_LINE>try {<NEW_LINE>final OAtomicOperation atomicOperation = atomicOperationsManager.getCurrentOperation();<NEW_LINE>fileId = openFile(atomicOperation, getFullName());<NEW_LINE>nullBucketFileId = openFile(atomicOperation, name + nullFileExtension);<NEW_LINE>this.keySize = keySize;<NEW_LINE>this.keyTypes = keyTypes;<NEW_LINE>this.encryption = encryption;<NEW_LINE>this.keySerializer = keySerializer;<NEW_LINE>multiContainer = new OSBTreeV2<>(getName(), containerExtension, null, storage);<NEW_LINE>multiContainer.load(getName(), MultiValueEntrySerializer.INSTANCE, OByteSerializer.INSTANCE, null, 1, false, null);<NEW_LINE>final OCacheEntry entryPointCacheEntry = loadPageForRead(atomicOperation, fileId, ENTRY_POINT_INDEX, false);<NEW_LINE>try {<NEW_LINE>final CellBTreeMultiValueV2EntryPoint<K> entryPoint <MASK><NEW_LINE>mIdCounter.setValue(entryPoint.getEntryId());<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, entryPointCacheEntry);<NEW_LINE>}<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw OException.wrapException(new CellBTreeMultiValueException("Exception during loading of sbtree " + name, this), e);<NEW_LINE>} finally {<NEW_LINE>releaseExclusiveLock();<NEW_LINE>}<NEW_LINE>}
= new CellBTreeMultiValueV2EntryPoint<>(entryPointCacheEntry);
212,506
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.profile_settings_fragment, container, false);<NEW_LINE>adapter = new ProfileSettingsAdapter(getContext(), GlideApp.with<MASK><NEW_LINE>list = ViewUtil.findById(view, R.id.recycler_view);<NEW_LINE>list.setAdapter(adapter);<NEW_LINE>list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));<NEW_LINE>listDecoration = new StickyHeaderDecoration(adapter, false, true);<NEW_LINE>list.addItemDecoration(listDecoration);<NEW_LINE>update();<NEW_LINE>DcEventCenter eventCenter = DcHelper.getEventCenter(getContext());<NEW_LINE>eventCenter.addObserver(DcContext.DC_EVENT_CHAT_MODIFIED, this);<NEW_LINE>eventCenter.addObserver(DcContext.DC_EVENT_CONTACTS_CHANGED, this);<NEW_LINE>eventCenter.addObserver(DcContext.DC_EVENT_MSGS_CHANGED, this);<NEW_LINE>eventCenter.addObserver(DcContext.DC_EVENT_INCOMING_MSG, this);<NEW_LINE>return view;<NEW_LINE>}
(this), locale, this);
1,616,680
public void stopModule(ExtendedModuleInfo moduleInfo) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "stopModule()", ((WebModuleInfo) moduleInfo).getName());<NEW_LINE>}<NEW_LINE>WebModuleInfo webModule = (WebModuleInfo) moduleInfo;<NEW_LINE>try {<NEW_LINE>DeployedModule dMod = this.deployedModuleMap.remove(webModule);<NEW_LINE>if (null == dMod) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "stopModule()", "DeployedModule not known");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "stopModule: " + webModule.getName() + " " + webModule.getContextRoot());<NEW_LINE>}<NEW_LINE>removeContextRootRequirement(dMod);<NEW_LINE>removeModule(dMod);<NEW_LINE>this.vhostManager.purgeHost(dMod.getVirtualHostName());<NEW_LINE>WebModuleMetaData wmmd = (WebModuleMetaData) ((<MASK><NEW_LINE>deregisterMBeans((WebModuleMetaDataImpl) wmmd);<NEW_LINE>WebAppConfiguration appConfig = (WebAppConfiguration) wmmd.getConfiguration();<NEW_LINE>for (Iterator<IServletConfig> servletConfigs = appConfig.getServletInfos(); servletConfigs.hasNext(); ) {<NEW_LINE>IServletConfig servletConfig = servletConfigs.next();<NEW_LINE>metaDataService.fireComponentMetaDataDestroyed(servletConfig.getMetaData());<NEW_LINE>}<NEW_LINE>metaDataService.fireComponentMetaDataDestroyed(appConfig.getDefaultComponentMetaData());<NEW_LINE>metaDataService.fireComponentMetaDataDestroyed(wmmd.getCollaboratorComponentMetaData());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>FFDCWrapper.processException(e, getClass().getName(), "stopModule", new Object[] { webModule, this });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "stopModule: " + webModule.getName() + "; " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "stopModule()");<NEW_LINE>}<NEW_LINE>}
ExtendedModuleInfo) webModule).getMetaData();
1,106,255
private void createActions(final Plugin plugin) {<NEW_LINE>GhidraTable table = threadedPanel.getTable();<NEW_LINE>selectAction = new MakeProgramSelectionAction(tableServicePlugin, table) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected ProgramSelection makeSelection(ActionContext context) {<NEW_LINE>ProgramSelection selection = table.getProgramSelection();<NEW_LINE>navigatable.goTo(program, new ProgramLocation(program<MASK><NEW_LINE>navigatable.setSelection(selection);<NEW_LINE>navigatable.requestFocus();<NEW_LINE>return selection;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>selectAction.setHelpLocation(new HelpLocation(HelpTopics.SEARCH, "Make_Selection"));<NEW_LINE>selectionNavigationAction = new SelectionNavigationAction(plugin, table);<NEW_LINE>selectionNavigationAction.setHelpLocation(new HelpLocation(HelpTopics.SEARCH, "Selection_Navigation"));<NEW_LINE>DockingAction externalGotoAction = new DockingAction("Go to External Location", getName()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionContext context) {<NEW_LINE>gotoExternalAddress(getSelectedExternalAddress());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isEnabledForContext(ActionContext context) {<NEW_LINE>return getSelectedExternalAddress() != null && tool.getService(GoToService.class) != null;<NEW_LINE>}<NEW_LINE><NEW_LINE>private Address getSelectedExternalAddress() {<NEW_LINE>if (table.getSelectedRowCount() != 1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ProgramSelection selection = table.getProgramSelection();<NEW_LINE>Program modelProgram = model.getProgram();<NEW_LINE>if (modelProgram == null || selection.getNumAddresses() != 1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Address addr = selection.getMinAddress();<NEW_LINE>return addr.isExternalAddress() ? addr : null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>externalGotoAction.setDescription("Go to an external location");<NEW_LINE>externalGotoAction.setEnabled(false);<NEW_LINE>Icon icon = ResourceManager.loadImage("images/searchm_obj.gif");<NEW_LINE>externalGotoAction.setPopupMenuData(new MenuData(new String[] { "GoTo External Location" }, icon, null));<NEW_LINE>externalGotoAction.setHelpLocation(new HelpLocation(HelpTopics.SEARCH, "Navigation"));<NEW_LINE>plugin.getTool().addLocalAction(this, selectAction);<NEW_LINE>plugin.getTool().addLocalAction(this, selectionNavigationAction);<NEW_LINE>plugin.getTool().addLocalAction(this, externalGotoAction);<NEW_LINE>}
, selection.getMinAddress()));
1,481,025
private Optional<Node> tryAllocateNodes(List<Node> nodes, List<Node> hosts, Map<Node, AllocationResources> availableResources, Map<Node, List<Allocation>> containedAllocations, boolean withHistory) {<NEW_LINE>for (var node : nodes) {<NEW_LINE>var newParent = tryAllocateNode(node, hosts, availableResources, containedAllocations);<NEW_LINE>if (newParent.isEmpty()) {<NEW_LINE>if (withHistory)<NEW_LINE>allocationHistory.addEntry(node, null, 0);<NEW_LINE>return Optional.of(node);<NEW_LINE>}<NEW_LINE>if (withHistory) {<NEW_LINE>long eligibleParents = hosts.stream().filter(h -> !violatesParentHostPolicy(node, h, containedAllocations) && availableResources.get(h).satisfies(AllocationResources.from(node.resources()))).count();<NEW_LINE>allocationHistory.addEntry(node, newParent.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
get(), eligibleParents + 1);
311,306
private void wrapAssignOrDestructuringInCallToArrow(NodeTraversal t, Node assignment) {<NEW_LINE>String tempVarName = getTempVariableName();<NEW_LINE>Node rhs = assignment.getLastChild().detach();<NEW_LINE>Node tempVarModel = astFactory.createName(tempVarName, type(rhs));<NEW_LINE>// let temp0 = rhs;<NEW_LINE>Node newAssignment = IR.let(<MASK><NEW_LINE>NodeUtil.addFeatureToScript(t.getCurrentScript(), Feature.LET_DECLARATIONS, compiler);<NEW_LINE>// [x, y] = temp0;<NEW_LINE>Node replacementExpr = astFactory.createAssign(assignment.removeFirstChild(), tempVarModel.cloneNode());<NEW_LINE>Node exprResult = IR.exprResult(replacementExpr);<NEW_LINE>// return temp0;<NEW_LINE>Node returnNode = IR.returnNode(tempVarModel.cloneNode());<NEW_LINE>// Create a function to hold these assignments:<NEW_LINE>Node block = IR.block(newAssignment, exprResult, returnNode);<NEW_LINE>Node arrowFn = astFactory.createZeroArgFunction(/* name= */<NEW_LINE>"", block, /* returnType= */<NEW_LINE>null);<NEW_LINE>arrowFn.setIsArrowFunction(true);<NEW_LINE>// Create a call to the function, and replace the pattern with the call.<NEW_LINE>Node call = astFactory.createCall(arrowFn, type(rhs));<NEW_LINE>NodeUtil.addFeatureToScript(t.getCurrentScript(), Feature.ARROW_FUNCTIONS, compiler);<NEW_LINE>call.srcrefTreeIfMissing(assignment);<NEW_LINE>call.putBooleanProp(Node.FREE_CALL, true);<NEW_LINE>assignment.replaceWith(call);<NEW_LINE>NodeUtil.markNewScopesChanged(call, compiler);<NEW_LINE>replacePattern(t, replacementExpr.getFirstChild(), replacementExpr.getLastChild(), replacementExpr, exprResult);<NEW_LINE>}
tempVarModel.cloneNode(), rhs);
748,762
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.sib.admin.JsEngineComponent#stop(int)<NEW_LINE>*/<NEW_LINE>public void stop(final int mode) {<NEW_LINE>final String methodName = "stop";<NEW_LINE>if (TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.entry(this, TRACE, methodName);<NEW_LINE>}<NEW_LINE>final Set listeners;<NEW_LINE>RELOADING_MESSAGING_ENGINES.remove(_messagingEngine.<MASK><NEW_LINE>synchronized (ACTIVE_MESSAGING_ENGINES) {<NEW_LINE>// Get the set of MEs for this ME's bus<NEW_LINE>Set messagingEngines = (Set) ACTIVE_MESSAGING_ENGINES.get(_messagingEngine.getBusName());<NEW_LINE>// Set should always exist if the engine started but<NEW_LINE>// just in case...<NEW_LINE>if (messagingEngines != null) {<NEW_LINE>// Remove the deactivating ME<NEW_LINE>messagingEngines.remove(_messagingEngine);<NEW_LINE>// If the set is now empty, take it out of the map<NEW_LINE>if (messagingEngines.isEmpty()) {<NEW_LINE>ACTIVE_MESSAGING_ENGINES.remove(_messagingEngine.getBusName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (TRACE.isDebugEnabled()) {<NEW_LINE>SibTr.debug(this, TRACE, "Received stop for inactive ME:", _messagingEngine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Get listeners to notify<NEW_LINE>listeners = getListeners(_messagingEngine.getBusName());<NEW_LINE>}<NEW_LINE>// Notify listeners<NEW_LINE>for (final Iterator iterator = listeners.iterator(); iterator.hasNext(); ) {<NEW_LINE>final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator.next();<NEW_LINE>listener.messagingEngineStopping(_messagingEngine, mode);<NEW_LINE>}<NEW_LINE>if (TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.exit(this, TRACE, methodName);<NEW_LINE>}<NEW_LINE>}
getUuid().toString());