idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
751,875
private HTTPResponse adaptToNimbusResponse(ResponseEntity<String> responseEntity) {<NEW_LINE>MediaType contentType = responseEntity<MASK><NEW_LINE>if (contentType == null) {<NEW_LINE>this.logger.trace("Did not receive Content-Type from introspection endpoint in response");<NEW_LINE>throw new OAuth2IntrospectionException("Introspection endpoint response was invalid, as no Content-Type header was provided");<NEW_LINE>}<NEW_LINE>// Nimbus expects JSON, but does not appear to validate this header first.<NEW_LINE>if (!contentType.isCompatibleWith(MediaType.APPLICATION_JSON)) {<NEW_LINE>this.logger.trace("Did not receive JSON-compatible Content-Type from introspection endpoint in response");<NEW_LINE>throw new OAuth2IntrospectionException("Introspection endpoint response was invalid, as content type '" + contentType + "' is not compatible with JSON");<NEW_LINE>}<NEW_LINE>HTTPResponse response = new HTTPResponse(responseEntity.getStatusCodeValue());<NEW_LINE>response.setHeader(HttpHeaders.CONTENT_TYPE, contentType.toString());<NEW_LINE>response.setContent(responseEntity.getBody());<NEW_LINE>if (response.getStatusCode() != HTTPResponse.SC_OK) {<NEW_LINE>this.logger.trace("Introspection endpoint returned non-OK status code");<NEW_LINE>throw new OAuth2IntrospectionException("Introspection endpoint responded with HTTP status code " + response.getStatusCode());<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
.getHeaders().getContentType();
1,600,658
private void loadColors(final Preferences preferences, final OutputOptions diskData) {<NEW_LINE>int rgbStandard = preferences.getInt(PREFIX + PROP_COLOR_STANDARD, getDefaultColorStandard().getRGB());<NEW_LINE>diskData.setColorStandard(new Color(rgbStandard));<NEW_LINE>int rgbError = preferences.getInt(PREFIX + PROP_COLOR_ERROR, getDefaultColorError().getRGB());<NEW_LINE>diskData.setColorError(new Color(rgbError));<NEW_LINE>int rgbInput = preferences.getInt(PREFIX + PROP_COLOR_INPUT, getDefaultColorInput().getRGB());<NEW_LINE>diskData.setColorInput(new Color(rgbInput));<NEW_LINE>int rgbBackground = preferences.getInt(PREFIX + PROP_COLOR_BACKGROUND, getDefaultColorBackground().getRGB());<NEW_LINE>diskData.setColorBackground(new Color(rgbBackground));<NEW_LINE>int rgbLink = preferences.getInt(PREFIX + PROP_COLOR_LINK, getDefaultColorLink().getRGB());<NEW_LINE>diskData.setColorLink(new Color(rgbLink));<NEW_LINE>int rgbLinkImportant = preferences.getInt(PREFIX + PROP_COLOR_LINK_IMPORTANT, getDefaultColorLinkImportant().getRGB());<NEW_LINE>diskData.setColorLinkImportant(new Color(rgbLinkImportant));<NEW_LINE>int rgbDebug = preferences.getInt(PREFIX + PROP_COLOR_DEBUG, <MASK><NEW_LINE>diskData.setColorDebug(new Color(rgbDebug));<NEW_LINE>int rgbWarning = preferences.getInt(PREFIX + PROP_COLOR_WARNING, getDefaultColorWarning().getRGB());<NEW_LINE>diskData.setColorWarning(new Color(rgbWarning));<NEW_LINE>int rgbFailure = preferences.getInt(PREFIX + PROP_COLOR_FAILURE, getDefaultColorFailure().getRGB());<NEW_LINE>diskData.setColorFailure(new Color(rgbFailure));<NEW_LINE>int rgbSuccess = preferences.getInt(PREFIX + PROP_COLOR_SUCCESS, getDefaultColorSuccess().getRGB());<NEW_LINE>diskData.setColorSuccess(new Color(rgbSuccess));<NEW_LINE>}
getDefaultColorDebug().getRGB());
517,031
void fixPartialLastDayAll(Map<String, JurisdictionData> countryData, who.RefreshCaseStatsServlet.JurisdictionData globalData) {<NEW_LINE>// Global last snapshot<NEW_LINE>// Last day snapshot daily cases and deaths may remain as partial<NEW_LINE>StoredCaseStats.StoredStatSnapshot snapshot = globalData.snapshots.get(globalData.lastUpdated);<NEW_LINE>snapshot.totalCases = globalData.totalCases;<NEW_LINE>snapshot.totalDeaths = globalData.totalDeaths;<NEW_LINE>String countriesLastDayRemoved = "";<NEW_LINE>for (Map.Entry<String, JurisdictionData> countryEntry : countryData.entrySet()) {<NEW_LINE>boolean removed = fixPartialLastDayCountry(countryEntry.getValue());<NEW_LINE>if (removed) {<NEW_LINE>countriesLastDayRemoved += countryEntry.getKey() + ", ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
logger.info("Countries last day removed: " + countriesLastDayRemoved);
1,850,036
public static DescribeOssObjectsResponse unmarshall(DescribeOssObjectsResponse describeOssObjectsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeOssObjectsResponse.setRequestId(_ctx.stringValue("DescribeOssObjectsResponse.RequestId"));<NEW_LINE>describeOssObjectsResponse.setPageSize(_ctx.integerValue("DescribeOssObjectsResponse.PageSize"));<NEW_LINE>describeOssObjectsResponse.setCurrentPage<MASK><NEW_LINE>describeOssObjectsResponse.setTotalCount(_ctx.integerValue("DescribeOssObjectsResponse.TotalCount"));<NEW_LINE>List<Column> items = new ArrayList<Column>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeOssObjectsResponse.Items.Length"); i++) {<NEW_LINE>Column column = new Column();<NEW_LINE>column.setId(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].Id"));<NEW_LINE>column.setName(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].Name"));<NEW_LINE>column.setRegionId(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].RegionId"));<NEW_LINE>column.setRiskLevelId(_ctx.longValue("DescribeOssObjectsResponse.Items[" + i + "].RiskLevelId"));<NEW_LINE>column.setCategory(_ctx.longValue("DescribeOssObjectsResponse.Items[" + i + "].Category"));<NEW_LINE>column.setInstanceId(_ctx.longValue("DescribeOssObjectsResponse.Items[" + i + "].InstanceId"));<NEW_LINE>column.setFileId(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].FileId"));<NEW_LINE>column.setRiskLevelName(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].RiskLevelName"));<NEW_LINE>column.setSize(_ctx.longValue("DescribeOssObjectsResponse.Items[" + i + "].Size"));<NEW_LINE>column.setSensitiveCount(_ctx.integerValue("DescribeOssObjectsResponse.Items[" + i + "].SensitiveCount"));<NEW_LINE>column.setRuleCount(_ctx.integerValue("DescribeOssObjectsResponse.Items[" + i + "].RuleCount"));<NEW_LINE>column.setCategoryName(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].CategoryName"));<NEW_LINE>column.setBucketName(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].BucketName"));<NEW_LINE>column.setRegionName(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].RegionName"));<NEW_LINE>column.setLastScanTime(_ctx.longValue("DescribeOssObjectsResponse.Items[" + i + "].LastScanTime"));<NEW_LINE>List<Rule> ruleList = new ArrayList<Rule>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeOssObjectsResponse.Items[" + i + "].RuleList.Length"); j++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setName(_ctx.stringValue("DescribeOssObjectsResponse.Items[" + i + "].RuleList[" + j + "].Name"));<NEW_LINE>rule.setCount(_ctx.longValue("DescribeOssObjectsResponse.Items[" + i + "].RuleList[" + j + "].Count"));<NEW_LINE>rule.setRiskLevelId(_ctx.longValue("DescribeOssObjectsResponse.Items[" + i + "].RuleList[" + j + "].RiskLevelId"));<NEW_LINE>ruleList.add(rule);<NEW_LINE>}<NEW_LINE>column.setRuleList(ruleList);<NEW_LINE>items.add(column);<NEW_LINE>}<NEW_LINE>describeOssObjectsResponse.setItems(items);<NEW_LINE>return describeOssObjectsResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeOssObjectsResponse.CurrentPage"));
1,066,705
public int onUpdate(int type) {<NEW_LINE>if (type == Level.BLOCK_UPDATE_NORMAL) {<NEW_LINE>int[] faces = new int[] { 3, 4, 2, 5, 3, 4, 2, 5, 3, 4, 2, 5 };<NEW_LINE>Block side = this.getSide(BlockFace.fromIndex(faces[this.getDamage()]));<NEW_LINE>if (side.getId() != Block.WOOD && side.getDamage() != BlockWood.JUNGLE) {<NEW_LINE>this.getLevel().useBreakOn(this);<NEW_LINE>return Level.BLOCK_UPDATE_NORMAL;<NEW_LINE>}<NEW_LINE>} else if (type == Level.BLOCK_UPDATE_RANDOM) {<NEW_LINE>if (new Random().nextInt(2) == 1) {<NEW_LINE>if (this.getDamage() / 4 < 2) {<NEW_LINE>BlockCocoa block = (BlockCocoa) this.clone();<NEW_LINE>block.setDamage(block.getDamage() + 4);<NEW_LINE>BlockGrowEvent ev = new BlockGrowEvent(this, block);<NEW_LINE>Server.getInstance().getPluginManager().callEvent(ev);<NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>this.getLevel().setBlock(this, ev.<MASK><NEW_LINE>} else {<NEW_LINE>return Level.BLOCK_UPDATE_RANDOM;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return Level.BLOCK_UPDATE_RANDOM;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
getNewState(), true, true);
1,821,348
public void marshall(UpdateFuotaTaskRequest updateFuotaTaskRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateFuotaTaskRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateFuotaTaskRequest.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFuotaTaskRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFuotaTaskRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFuotaTaskRequest.getLoRaWAN(), LORAWAN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFuotaTaskRequest.getFirmwareUpdateImage(), FIRMWAREUPDATEIMAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFuotaTaskRequest.getFirmwareUpdateRole(), FIRMWAREUPDATEROLE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
153,381
private void initGlobalQpsController() {<NEW_LINE>DynamicProperty globalLimitProperty = DynamicProperty.getInstance(globalLimitKey);<NEW_LINE>DynamicProperty globalBucketProperty = DynamicProperty.getInstance(globalBucketKey);<NEW_LINE>DynamicProperty globalStrategyProperty = DynamicProperty.getInstance(Config.STRATEGY_KEY);<NEW_LINE>globalQpsStrategy = chooseStrategy(globalLimitKey, globalLimitProperty.getLong((long) Integer.MAX_VALUE), globalBucketProperty.getLong(), globalStrategyProperty.getString());<NEW_LINE>globalStrategyProperty.addCallback(() -> {<NEW_LINE>globalQpsStrategy = chooseStrategy(globalLimitKey, globalLimitProperty.getLong((long) Integer.MAX_VALUE), globalBucketProperty.getLong(), globalStrategyProperty.getString());<NEW_LINE>LOGGER.info("Global flow control strategy update, value = [{}]", globalStrategyProperty.getString());<NEW_LINE>});<NEW_LINE>globalLimitProperty.addCallback(() -> {<NEW_LINE>globalQpsStrategy.setQpsLimit(globalLimitProperty.getLong((long) Integer.MAX_VALUE));<NEW_LINE>LOGGER.info(<MASK><NEW_LINE>});<NEW_LINE>globalBucketProperty.addCallback(() -> {<NEW_LINE>globalQpsStrategy.setBucketLimit(globalBucketProperty.getLong());<NEW_LINE>LOGGER.info("Global bucket limit update, value = [{}]", globalBucketProperty.getLong());<NEW_LINE>});<NEW_LINE>}
"Global qps limit update, value = [{}]", globalLimitProperty.getLong());
385,758
public Set<ExplicitGroup> findDirectGroups(RoleAssignee ra, DvObject o) {<NEW_LINE>if (o == null) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>List<ExplicitGroup> groupList = new LinkedList<>();<NEW_LINE>if (ra instanceof ExplicitGroup) {<NEW_LINE>for (DvObject cur = o; cur != null; cur = cur.getOwner()) {<NEW_LINE>groupList.addAll(em.createNamedQuery("ExplicitGroup.findByOwnerAndSubExGroupId", ExplicitGroup.class).setParameter("ownerId", cur.getId()).setParameter("subExGroupId", ((ExplicitGroup) ra).getId<MASK><NEW_LINE>}<NEW_LINE>} else if (ra instanceof AuthenticatedUser) {<NEW_LINE>for (DvObject cur = o; cur != null; cur = cur.getOwner()) {<NEW_LINE>groupList.addAll(em.createNamedQuery("ExplicitGroup.findByOwnerAndAuthUserId", ExplicitGroup.class).setParameter("ownerId", cur.getId()).setParameter("authUserId", ((AuthenticatedUser) ra).getId()).getResultList());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (DvObject cur = o; cur != null; cur = cur.getOwner()) {<NEW_LINE>groupList.addAll(em.createNamedQuery("ExplicitGroup.findByOwnerAndRAIdtf", ExplicitGroup.class).setParameter("ownerId", cur.getId()).setParameter("raIdtf", ra.getIdentifier()).getResultList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return provider.updateProvider(new HashSet<>(groupList));<NEW_LINE>}
()).getResultList());
131,763
void addFieldResources() throws IOException {<NEW_LINE>if (fieldTemplates.isEmpty())<NEW_LINE>return;<NEW_LINE>PdfDictionary catalog = reader.getCatalog();<NEW_LINE>PdfDictionary acroForm = (PdfDictionary) PdfReader.getPdfObject(catalog.get(PdfName.ACROFORM), catalog);<NEW_LINE>if (acroForm == null) {<NEW_LINE>acroForm = new PdfDictionary();<NEW_LINE>catalog.put(PdfName.ACROFORM, acroForm);<NEW_LINE>markUsed(catalog);<NEW_LINE>}<NEW_LINE>PdfDictionary dr = (PdfDictionary) PdfReader.getPdfObject(acroForm.get(PdfName.DR), acroForm);<NEW_LINE>if (dr == null) {<NEW_LINE>dr = new PdfDictionary();<NEW_LINE>acroForm.put(PdfName.DR, dr);<NEW_LINE>markUsed(acroForm);<NEW_LINE>}<NEW_LINE>markUsed(dr);<NEW_LINE>for (PdfTemplate template : fieldTemplates.keySet()) {<NEW_LINE>PdfFormField.mergeResources(dr, (PdfDictionary) <MASK><NEW_LINE>}<NEW_LINE>// if (dr.get(PdfName.ENCODING) == null) dr.put(PdfName.ENCODING, PdfName.WIN_ANSI_ENCODING);<NEW_LINE>PdfDictionary fonts = dr.getAsDict(PdfName.FONT);<NEW_LINE>if (fonts == null) {<NEW_LINE>fonts = new PdfDictionary();<NEW_LINE>dr.put(PdfName.FONT, fonts);<NEW_LINE>}<NEW_LINE>if (!fonts.contains(PdfName.HELV)) {<NEW_LINE>PdfDictionary dic = new PdfDictionary(PdfName.FONT);<NEW_LINE>dic.put(PdfName.BASEFONT, PdfName.HELVETICA);<NEW_LINE>dic.put(PdfName.ENCODING, PdfName.WIN_ANSI_ENCODING);<NEW_LINE>dic.put(PdfName.NAME, PdfName.HELV);<NEW_LINE>dic.put(PdfName.SUBTYPE, PdfName.TYPE1);<NEW_LINE>fonts.put(PdfName.HELV, addToBody(dic).getIndirectReference());<NEW_LINE>}<NEW_LINE>if (!fonts.contains(PdfName.ZADB)) {<NEW_LINE>PdfDictionary dic = new PdfDictionary(PdfName.FONT);<NEW_LINE>dic.put(PdfName.BASEFONT, PdfName.ZAPFDINGBATS);<NEW_LINE>dic.put(PdfName.NAME, PdfName.ZADB);<NEW_LINE>dic.put(PdfName.SUBTYPE, PdfName.TYPE1);<NEW_LINE>fonts.put(PdfName.ZADB, addToBody(dic).getIndirectReference());<NEW_LINE>}<NEW_LINE>if (acroForm.get(PdfName.DA) == null) {<NEW_LINE>acroForm.put(PdfName.DA, new PdfString("/Helv 0 Tf 0 g "));<NEW_LINE>markUsed(acroForm);<NEW_LINE>}<NEW_LINE>}
template.getResources(), this);
364,687
protected void sortRanges() {<NEW_LINE>if (this.isSorted())<NEW_LINE>return;<NEW_LINE>if (this.ranges == null)<NEW_LINE>return;<NEW_LINE>// System.err.println("Do sorting: "+this.ranges.length);<NEW_LINE>// Bubble sort<NEW_LINE>// Why? -- In many cases,<NEW_LINE>// this.ranges has few elements.<NEW_LINE>for (int i = this.ranges.length - 4; i >= 0; i -= 2) {<NEW_LINE>for (int j = 0; j <= i; j += 2) {<NEW_LINE>if (this.ranges[j] > this.ranges[j + 2] || this.ranges[j] == this.ranges[j + 2] && this.ranges[j + 1] > this.ranges[j + 3]) {<NEW_LINE>int tmp;<NEW_LINE>tmp = this.ranges[j + 2];<NEW_LINE>this.ranges[j + 2] = this.ranges[j];<NEW_LINE>this.ranges[j] = tmp;<NEW_LINE>tmp = this.ranges[j + 3];<NEW_LINE>this.ranges[j + 3] = this.ranges[j + 1];<NEW_LINE>this.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.setSorted(true);<NEW_LINE>}
ranges[j + 1] = tmp;
1,546,441
public void renderToBuffer(PoseStack matrixStackIn, VertexConsumer bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) {<NEW_LINE>if (base != null) {<NEW_LINE>base.renderToBuffer(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, <MASK><NEW_LINE>if (ArmorModelHelper.buffer != null) {<NEW_LINE>matrixStackIn.pushPose();<NEW_LINE>matrixStackIn.translate(0.0D, 0.0D, 0.125D);<NEW_LINE>VertexConsumer elytraBuffer = ItemRenderer.getArmorFoilBuffer(ArmorModelHelper.buffer, WING_RENDER_CACHE.computeIfAbsent(material, WING_GETTER), false, hasGlint);<NEW_LINE>getElytraModel().renderToBuffer(matrixStackIn, elytraBuffer, packedLightIn, packedOverlayIn, red, green, blue, alpha);<NEW_LINE>matrixStackIn.popPose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
red, green, blue, alpha);
1,757,128
public void selected(com.biglybt.pif.ui.menus.MenuItem menu, Object target) {<NEW_LINE>Object existing_o = column.getUserData("CustomDate");<NEW_LINE>String existing_text = "";<NEW_LINE>if (existing_o instanceof String) {<NEW_LINE>existing_text = (String) existing_o;<NEW_LINE>} else if (existing_o instanceof byte[]) {<NEW_LINE>try {<NEW_LINE>existing_text = new String((<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SimpleTextEntryWindow entryWindow = new SimpleTextEntryWindow("ConfigView.section.style.customDateFormat", "label.date.formats");<NEW_LINE>entryWindow.setPreenteredText(existing_text, false);<NEW_LINE>entryWindow.prompt(new UIInputReceiverListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void UIInputReceiverClosed(UIInputReceiver entryWindow) {<NEW_LINE>if (!entryWindow.hasSubmittedInput()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String date_format = entryWindow.getSubmittedInput();<NEW_LINE>if (date_format == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>date_format = date_format.trim();<NEW_LINE>column.setUserData("CustomDate", date_format);<NEW_LINE>update();<NEW_LINE>column.invalidateCells();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
byte[]) existing_o, "UTF-8");
1,772,577
private void exportOverallSummary(PrintWriter out, GCModel model) {<NEW_LINE>FormattedValue formed = footprintFormatter.formatToFormatted(model.getFootprint());<NEW_LINE>exportValue(out, "footprint", formed.getValue(), formed.getUnits());<NEW_LINE>formed = footprintFormatter.formatToFormatted(model.getFreedMemory());<NEW_LINE>exportValue(out, "freedMemory", formed.getValue(), formed.getUnits());<NEW_LINE>if (model.hasCorrectTimestamp()) {<NEW_LINE>exportValue(out, "throughput", throughputFormatter.format(model.getThroughput()), "%");<NEW_LINE>formed = totalTimeFormatter.formatToFormatted(new Date((long) model.getRunningTime() * 1000l));<NEW_LINE>exportValue(out, "totalTime", formed.getValue(), formed.getUnits());<NEW_LINE>formed = freedMemoryPerMinFormatter.formatToFormatted(model.getFreedMemory() / model.getRunningTime() * 60.0);<NEW_LINE>exportValue(out, "freedMemoryPerMin", formed.getValue(), formed.getUnits() + "/min");<NEW_LINE>} else {<NEW_LINE>exportValue(out, "throughput", "n.a.", "%");<NEW_LINE>exportValue(out, "totalTime", "n.a.", "s");<NEW_LINE>exportValue(out, "freedMemoryPerMin", "n.a.", "M/min");<NEW_LINE>}<NEW_LINE>final boolean gcDataAvailable = model.getGCPause<MASK><NEW_LINE>if (gcDataAvailable) {<NEW_LINE>formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByGC().getSum() / model.getGCPause().getSum());<NEW_LINE>exportValue(out, "gcPerformance", formed.getValue(), formed.getUnits() + "/s");<NEW_LINE>} else {<NEW_LINE>exportValue(out, "gcPerformance", "n.a.", "M/s");<NEW_LINE>}<NEW_LINE>final boolean fullGCDataAvailable = model.getFullGCPause().getN() > 0;<NEW_LINE>if (fullGCDataAvailable) {<NEW_LINE>formed = footprintFormatter.formatToFormatted(model.getFreedMemoryByFullGC().getSum() / model.getFullGCPause().getSum());<NEW_LINE>exportValue(out, "fullGCPerformance", formed.getValue(), formed.getUnits() + "/s");<NEW_LINE>} else {<NEW_LINE>exportValue(out, "fullGCPerformance", "n.a.", "M/s");<NEW_LINE>}<NEW_LINE>}
().getN() > 0;
339,132
public void validateSystemTag(String resourceUuid, Class resourceType, String systemTag) {<NEW_LINE>Map<String, String> tokens = LoadBalancerSystemTags.BALANCER_WEIGHT.getTokensByTag(systemTag);<NEW_LINE>String nicUuid = tokens.get(LoadBalancerSystemTags.BALANCER_NIC_TOKEN);<NEW_LINE>if (!dbf.isExist(nicUuid, VmNicVO.class)) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("nic[uuid:%s] not found. Please correct your system tag[%s] of loadbalancer", nicUuid, systemTag));<NEW_LINE>}<NEW_LINE>String s = tokens.get(LoadBalancerSystemTags.BALANCER_WEIGHT_TOKEN);<NEW_LINE>try {<NEW_LINE>long weight = Long.parseLong(s);<NEW_LINE>if (weight < LoadBalancerConstants.BALANCER_WEIGHT_MIN || weight > LoadBalancerConstants.BALANCER_WEIGHT_MAX) {<NEW_LINE>throw new OperationFailureException(argerr("invalid balancer weight[%s], %s is not in the range [%d, %d]", systemTag, s, LoadBalancerConstants<MASK><NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new OperationFailureException(argerr("invalid balancer weight[%s], %s is not a number", systemTag, s));<NEW_LINE>}<NEW_LINE>}
.BALANCER_WEIGHT_MIN, LoadBalancerConstants.BALANCER_WEIGHT_MAX));
1,685,720
protected boolean tryBuildWithCurrentNode(List<DMLResponseHandler> subQueryEndHandlers, Set<String> subQueryRouteNodes) {<NEW_LINE>HandlerBuilder builder = new HandlerBuilder(node, session);<NEW_LINE>// use node.copy(),it will replace sub-queries to 'NEED_REPLACE'<NEW_LINE>List<DMLResponseHandler<MASK><NEW_LINE>{<NEW_LINE>BaseHandlerBuilder baseBuilder = builder.getBuilder(session, node.getLeftNode().copy(), isExplain);<NEW_LINE>merges.addAll(baseBuilder.getEndHandler().getMerges());<NEW_LINE>}<NEW_LINE>{<NEW_LINE>BaseHandlerBuilder baseBuilder = builder.getBuilder(session, node.getRightNode().copy(), isExplain);<NEW_LINE>merges.addAll(baseBuilder.getEndHandler().getMerges());<NEW_LINE>}<NEW_LINE>Set<String> routeNodes = HandlerBuilder.canRouteToNodes(merges);<NEW_LINE>if (routeNodes != null && routeNodes.size() > 0) {<NEW_LINE>Set<String> queryRouteNodes = tryRouteWithCurrentNode(subQueryRouteNodes, routeNodes.iterator().next(), routeNodes);<NEW_LINE>if (queryRouteNodes.size() >= 1) {<NEW_LINE>buildMergeHandlerWithSubQueries(subQueryEndHandlers, queryRouteNodes);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
> merges = Lists.newArrayList();
470,224
public void createOrUpdateIndexerSkillsetWithResponseAsync2() {<NEW_LINE>// BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillsetWithResponse#CreateOrUpdateSkillsetOptions<NEW_LINE>searchIndexerAsyncClient.getSkillset("searchIndexerSkillset").flatMap(indexerSkillset -> {<NEW_LINE>indexerSkillset.setDescription("This is new description!");<NEW_LINE>return searchIndexerAsyncClient.createOrUpdateSkillsetWithResponse(new CreateOrUpdateSkillsetOptions(indexerSkillset).setOnlyIfUnchanged(true).setCacheReprocessingChangeDetectionDisabled(false).setCacheResetRequirementsIgnored(true));<NEW_LINE>}).subscribe(updateSkillsetResponse -> System.out.printf("The status code of the response is %s.%nThe indexer skillset name is %s. " + "The description of indexer skillset is %s.%n", updateSkillsetResponse.getStatusCode(), updateSkillsetResponse.getValue().getName(), updateSkillsetResponse.getValue<MASK><NEW_LINE>// END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillsetWithResponse#CreateOrUpdateSkillsetOptions<NEW_LINE>}
().getDescription()));
1,375,816
// Ensure that method annotations are not written on methods they don't apply to.<NEW_LINE>@Override<NEW_LINE>public Void visitMethod(MethodTree node, Void p) {<NEW_LINE>ExecutableElement methElt = TreeUtils.elementFromDeclaration(node);<NEW_LINE>boolean hasCompareToMethodAnno = atypeFactory.getDeclAnnotation(methElt, CompareToMethod.class) != null;<NEW_LINE>boolean hasEqualsMethodAnno = atypeFactory.getDeclAnnotation(methElt, EqualsMethod.class) != null;<NEW_LINE>boolean hasInternMethodAnno = atypeFactory.getDeclAnnotation(methElt, InternMethod.class) != null;<NEW_LINE>int params = methElt.getParameters().size();<NEW_LINE>if (hasCompareToMethodAnno && !(params == 1 || params == 2)) {<NEW_LINE>checker.reportError(node, "invalid.method.annotation", "@CompareToMethod", "1 or 2", methElt, params);<NEW_LINE>} else if (hasEqualsMethodAnno && !(params == 1 || params == 2)) {<NEW_LINE>checker.reportError(node, "invalid.method.annotation", "@EqualsMethod", "1 or 2", methElt, params);<NEW_LINE>} else if (hasInternMethodAnno && !(params == 0)) {<NEW_LINE>checker.reportError(node, "invalid.method.annotation", "@InternMethod", "0", methElt, params);<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
super.visitMethod(node, p);
1,349,841
private Optional<EventStreamInfo> createEventStreamInfo(Model model, OperationShape operation, StructureShape structure, MemberShape member) {<NEW_LINE>Shape eventStreamTarget = model.expectShape(member.getTarget());<NEW_LINE>// Compute the events of the event stream.<NEW_LINE>Map<String, StructureShape> events = new HashMap<>();<NEW_LINE>if (eventStreamTarget.asUnionShape().isPresent()) {<NEW_LINE>for (MemberShape unionMember : eventStreamTarget.asUnionShape().get().getAllMembers().values()) {<NEW_LINE>model.getShape(unionMember.getTarget()).flatMap(Shape::asStructureShape).ifPresent(struct -> {<NEW_LINE>events.put(unionMember.getMemberName(), struct);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else if (eventStreamTarget.asStructureShape().isPresent()) {<NEW_LINE>events.put(member.getMemberName(), eventStreamTarget.asStructureShape().get());<NEW_LINE>} else {<NEW_LINE>// If the event target is an invalid type, then we can't create the indexed result.<NEW_LINE>LOGGER.severe(() -> String.format("Skipping event stream info for %s because the %s member target %s is not a structure or union", operation.getId(), member.getMemberName(), member.getTarget()));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Map<String, MemberShape> initialMembers = new HashMap<>();<NEW_LINE>Map<String, Shape> initialTargets = new HashMap<>();<NEW_LINE>for (MemberShape structureMember : structure.getAllMembers().values()) {<NEW_LINE>if (!structureMember.getMemberName().equals(member.getMemberName())) {<NEW_LINE>model.getShape(structureMember.getTarget()).ifPresent(shapeTarget -> {<NEW_LINE>initialMembers.put(structureMember.getMemberName(), structureMember);<NEW_LINE>initialTargets.put(structureMember.getMemberName(), shapeTarget);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(new EventStreamInfo(operation, eventStreamTarget.expectTrait(StreamingTrait.class), structure, member, eventStreamTarget<MASK><NEW_LINE>}
, initialMembers, initialTargets, events));
1,068,419
private void applyNewSplits(String textureRegionName, int[] splits) {<NEW_LINE>// first need to modify original image<NEW_LINE>FileHandle packAtlas = Gdx.files.internal(plugin.getAPI().getProjectPath() + "/assets/orig/pack/pack.atlas");<NEW_LINE>FileHandle imagesDir = Gdx.files.internal(plugin.getAPI().getProjectPath() + "/assets/orig/pack/");<NEW_LINE>TextureAtlas.TextureAtlasData atlas = new TextureAtlas.TextureAtlasData(packAtlas, imagesDir, false);<NEW_LINE>BufferedImage finalImage = imageUtils.extractImage(atlas, textureRegionName, splits);<NEW_LINE>imageUtils.saveImage(finalImage, plugin.getAPI().getProjectPath(<MASK><NEW_LINE>// now need to modify the pack<NEW_LINE>String content = packAtlas.readString();<NEW_LINE>int regionIndex = content.indexOf(textureRegionName);<NEW_LINE>int splitStart = content.indexOf("split: ", regionIndex) + "split: ".length();<NEW_LINE>int splitEnd = content.indexOf("orig: ", splitStart);<NEW_LINE>String splitStr = splits[0] + ", " + splits[1] + ", " + splits[2] + ", " + splits[3] + "\n ";<NEW_LINE>String newContent = content.substring(0, splitStart) + splitStr + content.substring(splitEnd, content.length());<NEW_LINE>File test = new File(plugin.getAPI().getProjectPath() + "/assets/orig/pack/pack.atlas");<NEW_LINE>writeFile(newContent, test);<NEW_LINE>// reload<NEW_LINE>plugin.getAPI().reLoadProject();<NEW_LINE>}
) + "/assets/orig/images/" + textureRegionName + ".9.png");
1,063,979
final UpdateServiceSpecificCredentialResult executeUpdateServiceSpecificCredential(UpdateServiceSpecificCredentialRequest updateServiceSpecificCredentialRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateServiceSpecificCredentialRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateServiceSpecificCredentialRequest> request = null;<NEW_LINE>Response<UpdateServiceSpecificCredentialResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateServiceSpecificCredentialRequestMarshaller().marshall(super.beforeMarshalling(updateServiceSpecificCredentialRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateServiceSpecificCredential");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateServiceSpecificCredentialResult> responseHandler = new StaxResponseHandler<UpdateServiceSpecificCredentialResult>(new UpdateServiceSpecificCredentialResultStaxUnmarshaller());<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);
667,043
protected LibraryHeader loadHeader(ErrorReporter errorReporter) {<NEW_LINE>if (myConfig.getSourcesDir() != null) {<NEW_LINE>mySourceBasePath = myHeaderFile.getParent().resolve(myConfig.getSourcesDir());<NEW_LINE>}<NEW_LINE>if (myConfig.getTestsDir() != null) {<NEW_LINE>myTestBasePath = myHeaderFile.getParent().resolve(myConfig.getTestsDir());<NEW_LINE>}<NEW_LINE>if (myConfig.getBinariesDir() != null) {<NEW_LINE>myBinaryBasePath = myHeaderFile.getParent().resolve(myConfig.getBinariesDir());<NEW_LINE>}<NEW_LINE>myLibraryHeader = LibraryHeader.fromConfig(myConfig, myHeaderFile.toString(), errorReporter);<NEW_LINE>if (myLibraryHeader == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (myLibraryHeader.modules == null) {<NEW_LINE>myLibraryHeader.modules = new LinkedHashSet<>();<NEW_LINE>if (mySourceBasePath != null) {<NEW_LINE>FileUtils.getModules(mySourceBasePath, FileUtils.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myConfig.getExtensionsDir() != null) {<NEW_LINE>myLibraryHeader.classLoaderDelegate = new FileClassLoaderDelegate(myHeaderFile.getParent().resolve(myConfig.getExtensionsDir()));<NEW_LINE>}<NEW_LINE>if (myTestBasePath != null) {<NEW_LINE>myTestModules = new ArrayList<>();<NEW_LINE>FileUtils.getModules(myTestBasePath, FileUtils.EXTENSION, myTestModules, errorReporter);<NEW_LINE>}<NEW_LINE>return myLibraryHeader;<NEW_LINE>}
EXTENSION, myLibraryHeader.modules, errorReporter);
1,825,090
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {<NEW_LINE>// NON-NLS<NEW_LINE><MASK><NEW_LINE>// NON-NLS<NEW_LINE>Preconditions.checkNotNull(args, "Arguments cannot be null");<NEW_LINE>// NON-NLS<NEW_LINE>Preconditions.checkNotNull(alias, "Alias cannot be null");<NEW_LINE>switch(args.length) {<NEW_LINE>case 1:<NEW_LINE>return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<>(SUBCOMMANDS.size()));<NEW_LINE>case 2:<NEW_LINE>switch(SUBCOMMAND_MAP.get(args[0])) {<NEW_LINE>case PROPERTY:<NEW_LINE>Set<String> propertyNames = System.getProperties().stringPropertyNames();<NEW_LINE>return StringUtil.copyPartialMatches(args[1], propertyNames, new ArrayList<>(propertyNames.size()));<NEW_LINE>case WORLD:<NEW_LINE>if (sender instanceof Player) {<NEW_LINE>Collection<String> worlds = getWorldNames();<NEW_LINE>return StringUtil.copyPartialMatches(args[1], worlds, new ArrayList<>(worlds.size()));<NEW_LINE>}<NEW_LINE>// else fall through<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>// fall through<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
Preconditions.checkNotNull(sender, "Sender cannot be null");
1,411,039
protected boolean okAction() {<NEW_LINE>setMultipleValues(false);<NEW_LINE>if (automaticRadioButton.isChecked()) {<NEW_LINE>property.setValue(CONST_AUTOMATIC);<NEW_LINE>} else if (fillParentRadioButton.isChecked()) {<NEW_LINE>property.setValue(CONST_FILL_PARENT);<NEW_LINE>} else if (customLengthRadioButton.isChecked()) {<NEW_LINE>// Custom length<NEW_LINE>String text = customLengthField.getText();<NEW_LINE>// Make sure it's a non-negative number. It is important<NEW_LINE>// that this check stay within the custom length case because<NEW_LINE>// CONST_AUTOMATIC and CONST_FILL_PARENT are deliberately negative.<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>if (Integer.parseInt(text) >= 0) {<NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// fall through with success == false<NEW_LINE>}<NEW_LINE>if (!success) {<NEW_LINE>Window.alert(MESSAGES.nonnumericInputError());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>property.setValue(text);<NEW_LINE>} else if (percentfillRadioButton.getValue()) {<NEW_LINE>// Percent field!<NEW_LINE><MASK><NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>int v = Integer.parseInt(text);<NEW_LINE>if (v >= 0 && v <= 100) {<NEW_LINE>success = true;<NEW_LINE>property.setValue("" + (-v + MockVisibleComponent.LENGTH_PERCENT_TAG));<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// fall through with success == false<NEW_LINE>}<NEW_LINE>if (!success) {<NEW_LINE>Window.alert(MESSAGES.nonvalidPercentValue());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
String text = percentLengthField.getText();
1,119,808
public void marshall(TransferDomainRequest transferDomainRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (transferDomainRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getDomainName(), DOMAINNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getIdnLangCode(), IDNLANGCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getDurationInYears(), DURATIONINYEARS_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getNameservers(), NAMESERVERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getAuthCode(), AUTHCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getAutoRenew(), AUTORENEW_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getAdminContact(), ADMINCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getTechContact(), TECHCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getPrivacyProtectAdminContact(), PRIVACYPROTECTADMINCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getPrivacyProtectRegistrantContact(), PRIVACYPROTECTREGISTRANTCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getPrivacyProtectTechContact(), PRIVACYPROTECTTECHCONTACT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
transferDomainRequest.getRegistrantContact(), REGISTRANTCONTACT_BINDING);
1,586,508
protected org.activiti.engine.impl.persistence.entity.TaskEntity convertToActiviti5TaskEntity(TaskEntity task) {<NEW_LINE>org.activiti.engine.impl.persistence.entity.TaskEntity activiti5Task = new org.activiti.engine.impl.persistence.entity.TaskEntity();<NEW_LINE>activiti5Task.<MASK><NEW_LINE>activiti5Task.setInitialAssignee(((TaskEntityImpl) task).getOriginalAssignee());<NEW_LINE>activiti5Task.setCategoryWithoutCascade(task.getCategory());<NEW_LINE>activiti5Task.setCreateTime(task.getCreateTime());<NEW_LINE>activiti5Task.setDelegationStateString(((TaskEntityImpl) task).getDelegationStateString());<NEW_LINE>activiti5Task.setDescriptionWithoutCascade(task.getDescription());<NEW_LINE>activiti5Task.setDueDateWithoutCascade(task.getDueDate());<NEW_LINE>activiti5Task.setExecutionId(task.getExecutionId());<NEW_LINE>activiti5Task.setFormKeyWithoutCascade(task.getFormKey());<NEW_LINE>activiti5Task.setId(task.getId());<NEW_LINE>activiti5Task.setNameWithoutCascade(task.getName());<NEW_LINE>activiti5Task.setOwnerWithoutCascade(task.getOwner());<NEW_LINE>activiti5Task.setParentTaskIdWithoutCascade(task.getParentTaskId());<NEW_LINE>activiti5Task.setPriorityWithoutCascade(task.getPriority());<NEW_LINE>activiti5Task.setProcessDefinitionId(task.getProcessDefinitionId());<NEW_LINE>activiti5Task.setProcessInstanceId(task.getProcessInstanceId());<NEW_LINE>activiti5Task.setRevision(task.getRevision());<NEW_LINE>activiti5Task.setTaskDefinitionKeyWithoutCascade(task.getTaskDefinitionKey());<NEW_LINE>activiti5Task.setTenantId(task.getTenantId());<NEW_LINE>return activiti5Task;<NEW_LINE>}
setAssigneeWithoutCascade(task.getAssignee());
1,592,173
public static void main(String[] args) {<NEW_LINE>ImageType type = ImageType.pl(3, GrayU8.class);<NEW_LINE>List<PathLabel> examples = new ArrayList<>();<NEW_LINE>examples.add(new PathLabel("Half Dome 01", UtilIO.pathExample("spherical/equirectangular_half_dome_01.jpg")));<NEW_LINE>examples.add(new PathLabel("Half Dome 02", UtilIO.pathExample("spherical/equirectangular_half_dome_02.jpg")));<NEW_LINE>examples.add(new PathLabel("Glow Sticks", UtilIO.pathExample("spherical/equirectangular_glowsticks.jpg")));<NEW_LINE>EquirectangularRotatingApp app = new EquirectangularRotatingApp(examples, type);<NEW_LINE>app.openFile(new File(examples.get(<MASK><NEW_LINE>app.display("Equirectanglar Rotator");<NEW_LINE>}
0).getPath()));
1,818,802
public void run() {<NEW_LINE>try {<NEW_LINE>preSetup();<NEW_LINE>closed = false;<NEW_LINE>while (!shutdown) {<NEW_LINE>try {<NEW_LINE>LOGGER.<MASK><NEW_LINE>final Socket socket = serverSocket.accept();<NEW_LINE>if (socket != null) {<NEW_LINE>ConnectionHandler ch = new ConnectionHandler(socket);<NEW_LINE>Thread t = new Thread(ch);<NEW_LINE>t.start();<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.debug(ex.getLocalizedMessage(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>closed = true;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.debug(ex.getLocalizedMessage(), ex);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (serverSocket != null && !serverSocket.isClosed()) {<NEW_LINE>serverSocket.close();<NEW_LINE>serverSocket = null;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.debug(e);<NEW_LINE>}<NEW_LINE>LOGGER.info("Shutdown complete");<NEW_LINE>}<NEW_LINE>}
info("Listening on port " + port + "...\n");
1,784,552
public Object childEvaluate(Parser parser, VariableResolver resolver, String functionName, List<Object> args) throws ParserException {<NEW_LINE>if (!MapTool.getParser().isMacroTrusted()) {<NEW_LINE>if (!MapTool.getFrame().getInitiativePanel().hasGMPermission())<NEW_LINE>throw new ParserException(I18N<MASK><NEW_LINE>}<NEW_LINE>if (functionName.equalsIgnoreCase("getCurrentInitiative")) {<NEW_LINE>return getCurrentInitiative();<NEW_LINE>} else if (functionName.equalsIgnoreCase("setCurrentInitiative")) {<NEW_LINE>if (args.size() != 1)<NEW_LINE>throw new ParserException(I18N.getText("macro.function.initiative.oneParam", functionName));<NEW_LINE>setCurrentInitiative(args.get(0));<NEW_LINE>return args.get(0);<NEW_LINE>} else if (functionName.equalsIgnoreCase("getInitiativeToken")) {<NEW_LINE>return getInitiativeToken();<NEW_LINE>}<NEW_LINE>// endif<NEW_LINE>throw new ParserException(I18N.getText("macro.function.general.unknownFunction", functionName));<NEW_LINE>}
.getText("macro.function.initiative.mustBeGM", functionName));
807,365
public Mono<Response<SlotConfigNamesResourceInner>> listSlotConfigurationNamesWithResponseAsync(String resourceGroupName, String name) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listSlotConfigurationNames(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
1,721,154
public void onClick(View v) {<NEW_LINE>final PopupMenu popupMenu = new PopupMenu(v.getContext(), v);<NEW_LINE>popupMenu.getMenu().add(R.string.horizontal).setOnMenuItemClickListener(new OnMenuItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>AppState.get().rotateViewPager = 0;<NEW_LINE>rotateViewPager.setText(AppState.get().rotateViewPager == 0 ? R.string.horizontal : R.string.vertical);<NEW_LINE>TxtUtils.underlineTextView(rotateViewPager);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>popupMenu.getMenu().add(R.string.vertical).setOnMenuItemClickListener(new OnMenuItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>AppState.get().rotateViewPager = 90;<NEW_LINE>rotateViewPager.setText(AppState.get().rotateViewPager == 0 ? R.string.<MASK><NEW_LINE>TxtUtils.underlineTextView(rotateViewPager);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>popupMenu.show();<NEW_LINE>}
horizontal : R.string.vertical);
1,404,164
final TestWirelessDeviceResult executeTestWirelessDevice(TestWirelessDeviceRequest testWirelessDeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(testWirelessDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TestWirelessDeviceRequest> request = null;<NEW_LINE>Response<TestWirelessDeviceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TestWirelessDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(testWirelessDeviceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TestWirelessDevice");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TestWirelessDeviceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TestWirelessDeviceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,200,563
final DBCluster executeModifyDBCluster(ModifyDBClusterRequest modifyDBClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyDBClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyDBClusterRequest> request = null;<NEW_LINE>Response<DBCluster> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ModifyDBClusterRequestMarshaller().marshall(super.beforeMarshalling(modifyDBClusterRequest));<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, "Neptune");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyDBCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBCluster> responseHandler = new StaxResponseHandler<DBCluster>(new DBClusterStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,651,791
// copyLinesFrom<NEW_LINE>@Override<NEW_LINE>public boolean voidIt() {<NEW_LINE>log.info("voidIt - " + toString());<NEW_LINE>// Before Void<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_VOID);<NEW_LINE>if (m_processMsg != null)<NEW_LINE>return false;<NEW_LINE>MRMALine<MASK><NEW_LINE>// Set Qty and Amt on all lines to be Zero<NEW_LINE>for (MRMALine rmaLine : lines) {<NEW_LINE>rmaLine.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + rmaLine.getQty() + ")");<NEW_LINE>rmaLine.setQty(Env.ZERO);<NEW_LINE>rmaLine.setAmt(Env.ZERO);<NEW_LINE>rmaLine.saveEx();<NEW_LINE>}<NEW_LINE>addDescription(Msg.getMsg(getCtx(), "Voided"));<NEW_LINE>setAmt(Env.ZERO);<NEW_LINE>// After Void<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_VOID);<NEW_LINE>if (m_processMsg != null)<NEW_LINE>return false;<NEW_LINE>setProcessed(true);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>return true;<NEW_LINE>}
[] lines = getLines(true);
1,040,086
private void writeElement(XmlItem xmlValue) throws XMLStreamException {<NEW_LINE>// Setup namespace hierarchy<NEW_LINE>Set<String> prevNSSet = this.parentNSSet.peek();<NEW_LINE>HashSet<String> currentNSLevel = prevNSSet == null ? new HashSet<>() : new HashSet<>(prevNSSet);<NEW_LINE>this.parentNSSet.push(currentNSLevel);<NEW_LINE>Map<String, String> <MASK><NEW_LINE>Map<String, String> attributeMap = new LinkedHashMap<>();<NEW_LINE>splitAttributesAndNSPrefixes(xmlValue, nsPrefixMap, attributeMap);<NEW_LINE>QName qName = xmlValue.getQName();<NEW_LINE>writeStartElement(qName, nsPrefixMap, currentNSLevel);<NEW_LINE>setMissingElementPrefix(nsPrefixMap, qName);<NEW_LINE>// Write namespaces<NEW_LINE>writeNamespaceAttributes(currentNSLevel, nsPrefixMap);<NEW_LINE>// Write attributes<NEW_LINE>writeAttributes(currentNSLevel, attributeMap);<NEW_LINE>// Track and override xml text escape when xml text is within an element.<NEW_LINE>boolean prevWithinElementFlag = this.withinElement;<NEW_LINE>this.withinElement = true;<NEW_LINE>xmlValue.getChildrenSeq().serialize(this);<NEW_LINE>this.withinElement = prevWithinElementFlag;<NEW_LINE>xmlStreamWriter.writeEndElement();<NEW_LINE>// Reset namespace decl hierarchy for this node.<NEW_LINE>this.parentNSSet.pop();<NEW_LINE>}
nsPrefixMap = new LinkedHashMap<>();
1,200,682
// parse the trade info<NEW_LINE>private TradeInfo parseTradeInfo(CsvRow row) {<NEW_LINE>TradeInfoBuilder infoBuilder = TradeInfo.builder();<NEW_LINE>String scheme = row.findField(ID_SCHEME_FIELD).orElse(DEFAULT_TRADE_SCHEME);<NEW_LINE>row.findValue(ID_FIELD).ifPresent(id -> infoBuilder.id(StandardId.<MASK><NEW_LINE>String schemeCpty = row.findValue(CPTY_SCHEME_FIELD).orElse(DEFAULT_CPTY_SCHEME);<NEW_LINE>row.findValue(CPTY_FIELD).ifPresent(cpty -> infoBuilder.counterparty(StandardId.of(schemeCpty, cpty)));<NEW_LINE>row.findValue(TRADE_DATE_FIELD).ifPresent(dateStr -> infoBuilder.tradeDate(LoaderUtils.parseDate(dateStr)));<NEW_LINE>row.findValue(TRADE_TIME_FIELD).ifPresent(timeStr -> infoBuilder.tradeTime(LoaderUtils.parseTime(timeStr)));<NEW_LINE>row.findValue(TRADE_ZONE_FIELD).ifPresent(zoneStr -> infoBuilder.zone(ZoneId.of(zoneStr)));<NEW_LINE>row.findValue(SETTLEMENT_DATE_FIELD).ifPresent(dateStr -> infoBuilder.settlementDate(LoaderUtils.parseDate(dateStr)));<NEW_LINE>resolver.parseStandardAttributes(row, infoBuilder);<NEW_LINE>resolver.parseTradeInfo(row, infoBuilder);<NEW_LINE>return infoBuilder.build();<NEW_LINE>}
of(scheme, id)));
1,031,751
public void run() {<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>final boolean completed = ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>session.execute(getIncludedChanges(), getCommitMessage());<NEW_LINE>}<NEW_LINE>}, commitExecutor.getActionText(), true, getProject());<NEW_LINE>if (completed) {<NEW_LINE>for (CheckinHandler handler : myHandlers) {<NEW_LINE>handler.checkinSuccessful();<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>defaultListCleaner.clean();<NEW_LINE>close(OK_EXIT_CODE);<NEW_LINE>} else {<NEW_LINE>session.executionCanceled();<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Messages.showErrorDialog(VcsBundle.message("error.executing.commit", commitExecutor.getActionText(), e.getLocalizedMessage()), commitExecutor.getActionText());<NEW_LINE>for (CheckinHandler handler : myHandlers) {<NEW_LINE>handler.checkinFailed(Collections.singletonList<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (myResultHandler != null) {<NEW_LINE>if (success) {<NEW_LINE>myResultHandler.onSuccess(getCommitMessage());<NEW_LINE>} else {<NEW_LINE>myResultHandler.onFailure();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(new VcsException(e)));
45,728
public static void fhirStoreExecuteBundle(String fhirStoreName, String data) throws IOException, URISyntaxException {<NEW_LINE>// String fhirStoreName =<NEW_LINE>// String.format(<NEW_LINE>// FHIR_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-fhir-id");<NEW_LINE>// String data = "{\"resourceType\": \"Bundle\",\"type\": \"batch\",\"entry\": []}"<NEW_LINE>// Initialize the client, which will be used to interact with the service.<NEW_LINE>CloudHealthcare client = createClient();<NEW_LINE>HttpClient httpClient = HttpClients.createDefault();<NEW_LINE>String baseUri = String.format("%sv1/%s/fhir", client.getRootUrl(), fhirStoreName);<NEW_LINE>URIBuilder uriBuilder = new URIBuilder(baseUri).setParameter("access_token", getAccessToken());<NEW_LINE>StringEntity requestEntity = new StringEntity(data);<NEW_LINE>HttpUriRequest request = RequestBuilder.post().setUri(uriBuilder.build()).setEntity(requestEntity).addHeader("Content-Type", "application/fhir+json").addHeader("Accept-Charset", "utf-8").addHeader("Accept", "application/fhir+json; charset=utf-8").build();<NEW_LINE>// Execute the request and process the results.<NEW_LINE>HttpResponse response = httpClient.execute(request);<NEW_LINE>HttpEntity responseEntity = response.getEntity();<NEW_LINE>if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {<NEW_LINE>System.err.print(String.format("Exception executing FHIR bundle: %s\n", response.getStatusLine().toString()));<NEW_LINE><MASK><NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>System.out.print("FHIR bundle executed: ");<NEW_LINE>responseEntity.writeTo(System.out);<NEW_LINE>}
responseEntity.writeTo(System.err);
191,716
public static GenerateUpgradeRecordResponse unmarshall(GenerateUpgradeRecordResponse generateUpgradeRecordResponse, UnmarshallerContext _ctx) {<NEW_LINE>generateUpgradeRecordResponse.setRequestId(_ctx.stringValue("GenerateUpgradeRecordResponse.RequestId"));<NEW_LINE>List<RecordsItem> records = new ArrayList<RecordsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GenerateUpgradeRecordResponse.Records.Length"); i++) {<NEW_LINE>RecordsItem recordsItem = new RecordsItem();<NEW_LINE>recordsItem.setId(_ctx.longValue("GenerateUpgradeRecordResponse.Records[" + i + "].Id"));<NEW_LINE>recordsItem.setBatchStrategyNo(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].BatchStrategyNo"));<NEW_LINE>recordsItem.setAccountId(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].AccountId"));<NEW_LINE>recordsItem.setDbfsId(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].DbfsId"));<NEW_LINE>recordsItem.setEcsId(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].EcsId"));<NEW_LINE>recordsItem.setTaskId(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].TaskId"));<NEW_LINE>recordsItem.setRegionId(_ctx.stringValue<MASK><NEW_LINE>recordsItem.setZoneId(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].ZoneId"));<NEW_LINE>recordsItem.setState(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].State"));<NEW_LINE>recordsItem.setCurrentVersion(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].CurrentVersion"));<NEW_LINE>recordsItem.setTargetVersion(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].TargetVersion"));<NEW_LINE>recordsItem.setUpgradeStartTime(_ctx.longValue("GenerateUpgradeRecordResponse.Records[" + i + "].UpgradeStartTime"));<NEW_LINE>recordsItem.setUpgradeEndTime(_ctx.longValue("GenerateUpgradeRecordResponse.Records[" + i + "].UpgradeEndTime"));<NEW_LINE>recordsItem.setTaskExecutionCounts(_ctx.integerValue("GenerateUpgradeRecordResponse.Records[" + i + "].TaskExecutionCounts"));<NEW_LINE>recordsItem.setTaskErrorReason(_ctx.stringValue("GenerateUpgradeRecordResponse.Records[" + i + "].TaskErrorReason"));<NEW_LINE>recordsItem.setCreateTime(_ctx.longValue("GenerateUpgradeRecordResponse.Records[" + i + "].CreateTime"));<NEW_LINE>recordsItem.setUpdateTime(_ctx.longValue("GenerateUpgradeRecordResponse.Records[" + i + "].UpdateTime"));<NEW_LINE>records.add(recordsItem);<NEW_LINE>}<NEW_LINE>generateUpgradeRecordResponse.setRecords(records);<NEW_LINE>return generateUpgradeRecordResponse;<NEW_LINE>}
("GenerateUpgradeRecordResponse.Records[" + i + "].RegionId"));
273,607
public com.google.protobuf.DescriptorProtos.EnumOptions buildPartial() {<NEW_LINE>com.google.protobuf.DescriptorProtos.EnumOptions result = new com.google.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.allowAlias_ = allowAlias_;<NEW_LINE>if (uninterpretedOptionBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>uninterpretedOption_ = java.util.Collections.unmodifiableList(uninterpretedOption_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.uninterpretedOption_ = uninterpretedOption_;<NEW_LINE>} else {<NEW_LINE>result.uninterpretedOption_ = uninterpretedOptionBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
protobuf.DescriptorProtos.EnumOptions(this);
1,152,800
private static Feature buildFeature(Object field, String type) {<NEW_LINE>Feature.Builder feature = Feature.newBuilder();<NEW_LINE>ByteString byteString;<NEW_LINE>switch(type) {<NEW_LINE>case "STRING":<NEW_LINE>case "TIME":<NEW_LINE>case "DATE":<NEW_LINE>if (field instanceof GenericData.Array) {<NEW_LINE>buildFeatureFromIterator(String.class, field, feature);<NEW_LINE>} else {<NEW_LINE>byteString = ByteString.copyFromUtf8(field.toString());<NEW_LINE>feature.getBytesListBuilder().addValue(byteString);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "BYTES":<NEW_LINE>byteString = ByteString.copyFrom((byte[]) field);<NEW_LINE>feature.getBytesListBuilder().addValue(byteString);<NEW_LINE>break;<NEW_LINE>case "INTEGER":<NEW_LINE>case "INT64":<NEW_LINE>case "TIMESTAMP":<NEW_LINE>if (field instanceof GenericData.Array) {<NEW_LINE>buildFeatureFromIterator(Long.class, field, feature);<NEW_LINE>} else {<NEW_LINE>feature.getInt64ListBuilder().addValue((long) field);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "FLOAT":<NEW_LINE>case "FLOAT64":<NEW_LINE>if (field instanceof GenericData.Array) {<NEW_LINE>buildFeatureFromIterator(double.class, field, feature);<NEW_LINE>} else {<NEW_LINE>feature.getFloatListBuilder().addValue((float) (double) field);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "BOOLEAN":<NEW_LINE>case "BOOL":<NEW_LINE>if (field instanceof GenericData.Array) {<NEW_LINE>buildFeatureFromIterator(boolean.class, field, feature);<NEW_LINE>} else {<NEW_LINE>int boolAsInt = (boolean) field ? 1 : 0;<NEW_LINE>feature.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unsupported type: " + type);<NEW_LINE>}<NEW_LINE>return feature.build();<NEW_LINE>}
getInt64ListBuilder().addValue(boolAsInt);
1,372,084
public static DeleteEmailVerificationResponse unmarshall(DeleteEmailVerificationResponse deleteEmailVerificationResponse, UnmarshallerContext context) {<NEW_LINE>deleteEmailVerificationResponse.setRequestId(context.stringValue("DeleteEmailVerificationResponse.RequestId"));<NEW_LINE>List<SendResult> successList = new ArrayList<SendResult>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DeleteEmailVerificationResponse.SuccessList.Length"); i++) {<NEW_LINE>SendResult sendResult = new SendResult();<NEW_LINE>sendResult.setEmail(context.stringValue("DeleteEmailVerificationResponse.SuccessList[" + i + "].Email"));<NEW_LINE>sendResult.setCode(context.stringValue("DeleteEmailVerificationResponse.SuccessList[" + i + "].Code"));<NEW_LINE>sendResult.setMessage(context.stringValue<MASK><NEW_LINE>successList.add(sendResult);<NEW_LINE>}<NEW_LINE>deleteEmailVerificationResponse.setSuccessList(successList);<NEW_LINE>List<SendResult> failList = new ArrayList<SendResult>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DeleteEmailVerificationResponse.FailList.Length"); i++) {<NEW_LINE>SendResult sendResult = new SendResult();<NEW_LINE>sendResult.setEmail(context.stringValue("DeleteEmailVerificationResponse.FailList[" + i + "].Email"));<NEW_LINE>sendResult.setCode(context.stringValue("DeleteEmailVerificationResponse.FailList[" + i + "].Code"));<NEW_LINE>sendResult.setMessage(context.stringValue("DeleteEmailVerificationResponse.FailList[" + i + "].Message"));<NEW_LINE>failList.add(sendResult);<NEW_LINE>}<NEW_LINE>deleteEmailVerificationResponse.setFailList(failList);<NEW_LINE>return deleteEmailVerificationResponse;<NEW_LINE>}
("DeleteEmailVerificationResponse.SuccessList[" + i + "].Message"));
330,279
private MInvoice createCounterDoc() {<NEW_LINE>// Is this a counter doc ?<NEW_LINE>if (getRef_Invoice_ID() != 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Org Must be linked to BPartner<NEW_LINE>final MOrg org = MOrg.get(getCtx(), getAD_Org_ID());<NEW_LINE>final int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());<NEW_LINE>if (counterC_BPartner_ID <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Business Partner needs to be linked to Org<NEW_LINE>final I_C_BPartner bp = Services.get(IBPartnerDAO.class).getById(getC_BPartner_ID());<NEW_LINE>final int counterAD_Org_ID = bp.getAD_OrgBP_ID();<NEW_LINE>if (counterAD_Org_ID == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final I_C_BPartner counterBP = Services.get(IBPartnerDAO.class).getById(counterC_BPartner_ID);<NEW_LINE>// MOrgInfo counterOrgInfo = MOrgInfo.get(getCtx(), counterAD_Org_ID);<NEW_LINE>log.debug("Counter BP=" + counterBP.getName());<NEW_LINE>// Document Type<NEW_LINE>int C_DocTypeTarget_ID = 0;<NEW_LINE>final MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID());<NEW_LINE>if (counterDT != null) {<NEW_LINE>log.debug(counterDT.toString());<NEW_LINE>if (!counterDT.isCreateCounter() || !counterDT.isValid()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID();<NEW_LINE>} else // indirect<NEW_LINE>{<NEW_LINE>C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID());<NEW_LINE>log.debug("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID);<NEW_LINE>if (C_DocTypeTarget_ID <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Deep Copy<NEW_LINE>final MInvoice counter = copyFrom(this, getDateInvoiced(), getDateAcct(), C_DocTypeTarget_ID, !isSOTrx(), true, get_TrxName(), true);<NEW_LINE>//<NEW_LINE>counter.setAD_Org_ID(counterAD_Org_ID);<NEW_LINE>// counter.setM_Warehouse_ID(counterOrgInfo.getM_Warehouse_ID());<NEW_LINE>//<NEW_LINE>counter.setBPartner(counterBP);<NEW_LINE>// Refernces (Should not be required<NEW_LINE>counter.setSalesRep_ID(getSalesRep_ID());<NEW_LINE>// metas<NEW_LINE>final IPOService poService = Services.get(IPOService.class);<NEW_LINE>poService.copyValue(this, counter, C_Invoice_INCOTERM);<NEW_LINE>poService.copyValue(this, counter, C_Invoice_INCOTERMLOCATION);<NEW_LINE>poService.copyValue(this, counter, C_Invoice_DESCRIPTION_BOTTOM);<NEW_LINE>// metas end<NEW_LINE>counter.save(get_TrxName());<NEW_LINE>// Update copied lines<NEW_LINE>final MInvoiceLine[] counterLines = counter.getLines(true);<NEW_LINE>for (final MInvoiceLine counterLine : counterLines) {<NEW_LINE>counterLine.setClientOrg(counter);<NEW_LINE>// copies header values (BP, etc.)<NEW_LINE>counterLine.setInvoice(counter);<NEW_LINE>counterLine.setPrice();<NEW_LINE>counterLine.setTax();<NEW_LINE>//<NEW_LINE>counterLine.save(get_TrxName());<NEW_LINE>}<NEW_LINE>log.<MASK><NEW_LINE>// Document Action<NEW_LINE>if (counterDT != null) {<NEW_LINE>if (counterDT.getDocAction() != null) {<NEW_LINE>counter.setDocAction(counterDT.getDocAction());<NEW_LINE>counter.processIt(counterDT.getDocAction());<NEW_LINE>counter.save(get_TrxName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return counter;<NEW_LINE>}
debug(counter.toString());
70,030
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>// Mapbox access token is configured here. This needs to be called either in your application<NEW_LINE>// object or in the same activity which contains the mapview.<NEW_LINE>Mapbox.getInstance(this, getString(R.string.access_token));<NEW_LINE>// This contains the MapView in XML and needs to be called after the access token is configured.<NEW_LINE>setContentView(R.layout.activity_javaservices_directions_profile_toggle);<NEW_LINE>drivingButton = findViewById(R.id.driving_profile_button);<NEW_LINE>drivingButton.setTextColor(Color.WHITE);<NEW_LINE>walkingButton = findViewById(R.id.walking_profile_button);<NEW_LINE>cyclingButton = <MASK><NEW_LINE>// Setup the MapView<NEW_LINE>mapView = findViewById(R.id.mapView);<NEW_LINE>mapView.onCreate(savedInstanceState);<NEW_LINE>mapView.getMapAsync(new OnMapReadyCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMapReady(@NonNull MapboxMap mapboxMap) {<NEW_LINE>mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStyleLoaded(@NonNull Style style) {<NEW_LINE>DirectionsProfileToggleActivity.this.mapboxMap = mapboxMap;<NEW_LINE>initSource(style);<NEW_LINE>initLayers(style);<NEW_LINE>getAllRoutes(false);<NEW_LINE>initButtonClickListeners();<NEW_LINE>mapboxMap.addOnMapClickListener(DirectionsProfileToggleActivity.this);<NEW_LINE>Toast.makeText(DirectionsProfileToggleActivity.this, R.string.instruction, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
findViewById(R.id.cycling_profile_button);
65,758
private ASTParser createParser(int kind) {<NEW_LINE>ASTParser parser = ASTParser.newParser(AST.JLS17);<NEW_LINE>if (kind == K_MODULE_INFO) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>parser.setSource(this.sourceArray);<NEW_LINE>}<NEW_LINE>parser.setKind(FORMAT_TO_PARSER_KIND.get(kind));<NEW_LINE>Map<String, String> parserOptions = JavaCore.getOptions();<NEW_LINE>parserOptions.put(CompilerOptions.OPTION_Source, this.sourceLevel);<NEW_LINE>parserOptions.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.ENABLED);<NEW_LINE>// TODO<NEW_LINE>parserOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);<NEW_LINE>parserOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.IGNORE);<NEW_LINE>parser.setCompilerOptions(parserOptions);<NEW_LINE>return parser;<NEW_LINE>}
parser.setSource(createDummyModuleInfoCompilationUnit());
1,585,672
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>InstrumentClass target = instrumentor.getInstrumentClass(classLoader, className, classfileBuffer);<NEW_LINE>InstrumentMethod constructor = target.getConstructor("org.eclipse.paho.mqttv5.client.internal.ClientComms");<NEW_LINE><MASK><NEW_LINE>InstrumentMethod messageArrivedMethod = target.getDeclaredMethod("messageArrived", "org.eclipse.paho.mqttv5.common.packet.MqttPublish");<NEW_LINE>messageArrivedMethod.addInterceptor(MqttV5CallbackMessageArrivedInterceptor.class);<NEW_LINE>target.addGetter(MqttV5ClientCommsGetter.class, "clientComms");<NEW_LINE>target.addField(BrokerUriFieldAccessor.class);<NEW_LINE>return target.toBytecode();<NEW_LINE>}
constructor.addInterceptor(CommsCallbackV5ConstructorInterceptor.class);
487,283
public void marshall(ApiDestination apiDestination, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (apiDestination == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(apiDestination.getApiDestinationArn(), APIDESTINATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(apiDestination.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(apiDestination.getApiDestinationState(), APIDESTINATIONSTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(apiDestination.getConnectionArn(), CONNECTIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(apiDestination.getHttpMethod(), HTTPMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(apiDestination.getInvocationRateLimitPerSecond(), INVOCATIONRATELIMITPERSECOND_BINDING);<NEW_LINE>protocolMarshaller.marshall(apiDestination.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(apiDestination.getLastModifiedTime(), LASTMODIFIEDTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
apiDestination.getInvocationEndpoint(), INVOCATIONENDPOINT_BINDING);
935,519
public static void main(String[] args) {<NEW_LINE>LinkList ll = new LinkList();<NEW_LINE>Node head = null;<NEW_LINE>head = <MASK><NEW_LINE>head = ll.addNode(2, head);<NEW_LINE>head = ll.addNode(3, head);<NEW_LINE>head = ll.addNode(4, head);<NEW_LINE>head = ll.addNode(5, head);<NEW_LINE>head = ll.addNode(6, head);<NEW_LINE>head = ll.addNode(7, head);<NEW_LINE>head = ll.addNode(8, head);<NEW_LINE>Node node1 = ll.find(head, 8);<NEW_LINE>Node node2 = ll.find(head, 4);<NEW_LINE>node1.next = node2;<NEW_LINE>LoopInLinkList lll = new LoopInLinkList();<NEW_LINE>System.out.println(lll.hasCycle(head));<NEW_LINE>node2.next = null;<NEW_LINE>System.out.println(lll.hasCycle(head));<NEW_LINE>node1 = ll.find(head, 3);<NEW_LINE>node2.next = node1;<NEW_LINE>System.out.println(lll.hasCycle(head));<NEW_LINE>}
ll.addNode(1, head);
1,500,696
public void openInternal(InputSplit inputSplit) {<NEW_LINE>this.inputSplit = (DistributedJdbcInputSplit) inputSplit;<NEW_LINE>this.sourceList = this.inputSplit.getSourceList();<NEW_LINE>if (CollectionUtils.isEmpty(this.sourceList)) {<NEW_LINE>noDataSource = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (FieldConf fieldConf : jdbcConf.getColumn()) {<NEW_LINE>this.columnNameList.add(fieldConf.getName());<NEW_LINE>this.columnTypeList.<MASK><NEW_LINE>}<NEW_LINE>Pair<List<String>, List<String>> columnPair = ColumnBuildUtil.handleColumnList(jdbcConf.getColumn(), this.columnNameList, this.columnTypeList);<NEW_LINE>this.columnNameList = columnPair.getLeft();<NEW_LINE>this.columnTypeList = columnPair.getRight();<NEW_LINE>RowType rowType = TableUtil.createRowType(columnNameList, columnTypeList, jdbcDialect.getRawTypeConverter());<NEW_LINE>setRowConverter(this.rowConverter == null ? jdbcDialect.getColumnConverter(rowType, jdbcConf) : rowConverter);<NEW_LINE>LOG.info("DistributedJdbcInputFormat[{}]open: end", inputSplit);<NEW_LINE>}
add(fieldConf.getType());
927,763
private void constructValue() {<NEW_LINE>if (updating) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updating = true;<NEW_LINE>HighlightItem metaItem = new HighlightItem(metaPrefixes.getText(<MASK><NEW_LINE>String mPrefixes = metaItem.getMetaPrefixes();<NEW_LINE>String mPrefixesExtra = metaItem.getRaw().substring(metaItem.getMetaPrefixes().length()).trim();<NEW_LINE>String newValue = mPrefixes;<NEW_LINE>if (!mPrefixesExtra.isEmpty()) {<NEW_LINE>metaPrefixesError.setText("Not a meta prefix: " + StringUtil.shortenTo(mPrefixesExtra, 20));<NEW_LINE>} else {<NEW_LINE>metaPrefixesError.setText(null);<NEW_LINE>}<NEW_LINE>String main = "";<NEW_LINE>if (!mainText.getText().trim().isEmpty()) {<NEW_LINE>main = mainPrefix.getText() + mainText.getText();<NEW_LINE>}<NEW_LINE>newValue = StringUtil.append(newValue, " ", main);<NEW_LINE>item.setText(newValue);<NEW_LINE>updating = false;<NEW_LINE>}
), "", false, null);
49,807
public void toXML(XMLWriter generatedXML) {<NEW_LINE>generatedXML.writeElement(null, "activelock", XMLWriter.OPENING);<NEW_LINE>generatedXML.writeElement(null, "locktype", XMLWriter.OPENING);<NEW_LINE>generatedXML.writeElement(null, type, XMLWriter.NO_CONTENT);<NEW_LINE>generatedXML.writeElement(null, "locktype", XMLWriter.CLOSING);<NEW_LINE>generatedXML.writeElement(null, "lockscope", XMLWriter.OPENING);<NEW_LINE>generatedXML.writeElement(null, scope, XMLWriter.NO_CONTENT);<NEW_LINE>generatedXML.writeElement(<MASK><NEW_LINE>generatedXML.writeElement(null, "depth", XMLWriter.OPENING);<NEW_LINE>if (depth == INFINITY) {<NEW_LINE>generatedXML.writeText("Infinity");<NEW_LINE>} else {<NEW_LINE>generatedXML.writeText("0");<NEW_LINE>}<NEW_LINE>generatedXML.writeElement(null, "depth", XMLWriter.CLOSING);<NEW_LINE>generatedXML.writeElement(null, "owner", XMLWriter.OPENING);<NEW_LINE>generatedXML.writeText(owner);<NEW_LINE>generatedXML.writeElement(null, "owner", XMLWriter.CLOSING);<NEW_LINE>generatedXML.writeElement(null, "timeout", XMLWriter.OPENING);<NEW_LINE>long timeout = (expiresAt - System.currentTimeMillis()) / 1000;<NEW_LINE>generatedXML.writeText("Second-" + timeout);<NEW_LINE>generatedXML.writeElement(null, "timeout", XMLWriter.CLOSING);<NEW_LINE>generatedXML.writeElement(null, "locktoken", XMLWriter.OPENING);<NEW_LINE>for (String token : tokens) {<NEW_LINE>generatedXML.writeElement(null, "href", XMLWriter.OPENING);<NEW_LINE>generatedXML.writeText("opaquelocktoken:" + token);<NEW_LINE>generatedXML.writeElement(null, "href", XMLWriter.CLOSING);<NEW_LINE>}<NEW_LINE>generatedXML.writeElement(null, "locktoken", XMLWriter.CLOSING);<NEW_LINE>generatedXML.writeElement(null, "activelock", XMLWriter.CLOSING);<NEW_LINE>}
null, "lockscope", XMLWriter.CLOSING);
1,774,081
public void marshall(UpdateControlRequest updateControlRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateControlRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateControlRequest.getControlId(), CONTROLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateControlRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateControlRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateControlRequest.getTestingInformation(), TESTINGINFORMATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateControlRequest.getActionPlanTitle(), ACTIONPLANTITLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateControlRequest.getActionPlanInstructions(), ACTIONPLANINSTRUCTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateControlRequest.getControlMappingSources(), CONTROLMAPPINGSOURCES_BINDING);
1,583,517
protected int _getPixelColor(int x, int y) {<NEW_LINE>NativeScreen screen = NativePlatformFactory.getNativePlatform().getScreen();<NEW_LINE>final int byteDepth = screen.getDepth() >>> 3;<NEW_LINE>final int bwidth = screen.getWidth();<NEW_LINE>final int bheight = screen.getHeight();<NEW_LINE>if (x < 0 || x > bwidth || y < 0 || y > bheight) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>synchronized (NativeScreen.framebufferSwapLock) {<NEW_LINE>ByteBuffer buffer = screen.getScreenCapture();<NEW_LINE>if (byteDepth == 2) {<NEW_LINE>ShortBuffer shortbuf = buffer.asShortBuffer();<NEW_LINE>int v = shortbuf.get((y * bwidth) + x);<NEW_LINE>int red = (int) ((v & 0xF800) >> 11) << 3;<NEW_LINE>int green = (int) ((v & 0x7E0) >> 5) << 2;<NEW_LINE>int blue = (int<MASK><NEW_LINE>int p = (0xff000000 | (red << 16) | (green << 8) | blue);<NEW_LINE>return p;<NEW_LINE>} else if (byteDepth >= 4) {<NEW_LINE>IntBuffer intbuf = buffer.asIntBuffer();<NEW_LINE>return intbuf.get((y * bwidth) + x);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unknown bit depth");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) (v & 0x1F) << 3;
1,453,155
public void initFromOnnx(Onnx.NodeProto node, SameDiff initWith, Map<String, Onnx.AttributeProto> attributesForNode, Onnx.GraphProto graph) {<NEW_LINE>val autoPad = !attributesForNode.containsKey("auto_pad") ? "VALID" : attributesForNode.get("auto_pad").getS().toStringUtf8();<NEW_LINE>val dilations = attributesForNode.get("dilations");<NEW_LINE>val dilationY = dilations == null ? 1 : dilations.getIntsList().get(0).intValue();<NEW_LINE>val dilationX = dilations == null ? 1 : dilations.getIntsList().get(1).intValue();<NEW_LINE>val group = attributesForNode.get("group");<NEW_LINE>val kernelShape = attributesForNode.get("kernel_shape");<NEW_LINE>int kH = kernelShape.getIntsList().get(0).intValue();<NEW_LINE>int kW = kernelShape.getIntsList().size() < 2 ? kH : kernelShape.getIntsList().get(1).intValue();<NEW_LINE>val vertexId = args()[0];<NEW_LINE>INDArray arr = vertexId.getArr();<NEW_LINE>arr = (arr.permute(3, 2, 0, 1).dup('c'));<NEW_LINE>initWith.associateArrayWithVariable(arr, vertexId);<NEW_LINE>String dataFormat = "nhwc";<NEW_LINE>val strides = attributesForNode.get("strides");<NEW_LINE>val sH = strides.<MASK><NEW_LINE>val sW = strides.getIntsList().size() < 2 ? sH : strides.getIntsList().get(1);<NEW_LINE>boolean isSameMode = autoPad.equalsIgnoreCase("SAME");<NEW_LINE>DeConv2DConfig conv2DConfig = DeConv2DConfig.builder().kH(kH).kW(kW).sH(sH.intValue()).sW(sW.intValue()).isSameMode(isSameMode).dataFormat(dataFormat.equalsIgnoreCase("nhwc") ? DeConv2DConfig.NHWC : DeConv2DConfig.NCHW).build();<NEW_LINE>this.config = conv2DConfig;<NEW_LINE>addArgs();<NEW_LINE>addOutputArgument(arr);<NEW_LINE>}
getIntsList().get(0);
1,782,908
public static void validateJsonObject(JsonObject jsonObj) throws IOException {<NEW_LINE>if (jsonObj == null) {<NEW_LINE>if (Drawing.openapiRequiredFields.isEmpty()) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// has required fields<NEW_LINE>throw new IllegalArgumentException(String.format("The required field(s) %s in Drawing is not found in the empty JSON string", Drawing.openapiRequiredFields.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();<NEW_LINE>// check to see if the JSON string contains additional fields<NEW_LINE>for (Entry<String, JsonElement> entry : entries) {<NEW_LINE>if (!Drawing.openapiFields.contains(entry.getKey())) {<NEW_LINE>throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Drawing` properties. JSON: %s", entry.getKey(), jsonObj.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// validate the optional field `mainShape`<NEW_LINE>if (jsonObj.getAsJsonObject("mainShape") != null) {<NEW_LINE>Shape.validateJsonObject(jsonObj.getAsJsonObject("mainShape"));<NEW_LINE>}<NEW_LINE>// validate the optional field `shapeOrNull`<NEW_LINE>if (jsonObj.getAsJsonObject("shapeOrNull") != null) {<NEW_LINE>ShapeOrNull.validateJsonObject<MASK><NEW_LINE>}<NEW_LINE>// validate the optional field `nullableShape`<NEW_LINE>if (jsonObj.getAsJsonObject("nullableShape") != null) {<NEW_LINE>NullableShape.validateJsonObject(jsonObj.getAsJsonObject("nullableShape"));<NEW_LINE>}<NEW_LINE>JsonArray jsonArrayshapes = jsonObj.getAsJsonArray("shapes");<NEW_LINE>// validate the optional field `shapes` (array)<NEW_LINE>if (jsonArrayshapes != null) {<NEW_LINE>for (int i = 0; i < jsonArrayshapes.size(); i++) {<NEW_LINE>Shape.validateJsonObject(jsonArrayshapes.get(i).getAsJsonObject());<NEW_LINE>}<NEW_LINE>;<NEW_LINE>}<NEW_LINE>}
(jsonObj.getAsJsonObject("shapeOrNull"));
884,035
public static void vertical(Kernel1D_F64 kernel, GrayF64 input, GrayF64 output) {<NEW_LINE>final double[] dataSrc = input.data;<NEW_LINE>final double[] dataDst = output.data;<NEW_LINE>final double[] dataKer = kernel.data;<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int offsetL = kernel.getOffset();<NEW_LINE>final int offsetR = kernelWidth - offsetL - 1;<NEW_LINE>final int imgWidth = output.getWidth();<NEW_LINE>final int imgHeight = output.getHeight();<NEW_LINE>final int yEnd = imgHeight - offsetR;<NEW_LINE>for (int y = 0; y < offsetL; y++) {<NEW_LINE>int indexDst = output.startIndex + y * output.stride;<NEW_LINE>int i = input.startIndex + y * input.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>int kStart = offsetL - y;<NEW_LINE>double weight = 0;<NEW_LINE>for (int k = kStart; k < kernelWidth; k++) {<NEW_LINE>weight += dataKer[k];<NEW_LINE>}<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>double total = 0;<NEW_LINE>int indexSrc = i - y * input.stride;<NEW_LINE>for (int k = kStart; k < kernelWidth; k++, indexSrc += input.stride) {<NEW_LINE>total += (dataSrc[indexSrc]) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = (total / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int y = yEnd; y < imgHeight; y++) {<NEW_LINE>int indexDst = output.startIndex + y * output.stride;<NEW_LINE>int i = input<MASK><NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>int kEnd = imgHeight - (y - offsetL);<NEW_LINE>double weight = 0;<NEW_LINE>for (int k = 0; k < kEnd; k++) {<NEW_LINE>weight += dataKer[k];<NEW_LINE>}<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>double total = 0;<NEW_LINE>int indexSrc = i - offsetL * input.stride;<NEW_LINE>for (int k = 0; k < kEnd; k++, indexSrc += input.stride) {<NEW_LINE>total += (dataSrc[indexSrc]) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = (total / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.startIndex + y * input.stride;
759,032
public void doDrawerSubs(int position) {<NEW_LINE>MultiReddit current = usedArray.get(position);<NEW_LINE>LinearLayout l = (LinearLayout) findViewById(R.id.sidebar_scroll);<NEW_LINE>l.removeAllViews();<NEW_LINE>CaseInsensitiveArrayList toSort = new CaseInsensitiveArrayList();<NEW_LINE>for (MultiSubreddit s : current.getSubreddits()) {<NEW_LINE>toSort.add(s.getDisplayName()<MASK><NEW_LINE>}<NEW_LINE>for (String sub : UserSubscriptions.sortNoExtras(toSort)) {<NEW_LINE>final View convertView = getLayoutInflater().inflate(R.layout.subforsublist, l, false);<NEW_LINE>final String subreddit = sub;<NEW_LINE>final TextView t = convertView.findViewById(R.id.name);<NEW_LINE>t.setText(subreddit);<NEW_LINE>final View colorView = convertView.findViewById(R.id.color);<NEW_LINE>colorView.setBackgroundResource(R.drawable.circle);<NEW_LINE>BlendModeUtil.tintDrawableAsModulate(colorView.getBackground(), Palette.getColor(subreddit));<NEW_LINE>convertView.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>Intent inte = new Intent(MultiredditOverview.this, SubredditView.class);<NEW_LINE>inte.putExtra(SubredditView.EXTRA_SUBREDDIT, subreddit);<NEW_LINE>MultiredditOverview.this.startActivityForResult(inte, 4);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>l.addView(convertView);<NEW_LINE>}<NEW_LINE>}
.toLowerCase(Locale.ENGLISH));
1,683,772
public static VipInventory valueOf(VipVO vo) {<NEW_LINE>VipInventory inv = new VipInventory();<NEW_LINE>inv.setName(vo.getName());<NEW_LINE>inv.setDescription(vo.getDescription());<NEW_LINE>inv.setCreateDate(vo.getCreateDate());<NEW_LINE>inv.setGateway(vo.getGateway());<NEW_LINE>inv.<MASK><NEW_LINE>inv.setIpRangeUuid(vo.getIpRangeUuid());<NEW_LINE>inv.setServiceProvider(vo.getServiceProvider());<NEW_LINE>inv.setL3NetworkUuid(vo.getL3NetworkUuid());<NEW_LINE>inv.setLastOpDate(vo.getLastOpDate());<NEW_LINE>inv.setNetmask(vo.getNetmask());<NEW_LINE>inv.setPrefixLen(vo.getPrefixLen());<NEW_LINE>inv.setUuid(vo.getUuid());<NEW_LINE>inv.setState(vo.getState().toString());<NEW_LINE>inv.setUsedIpUuid(vo.getUsedIpUuid());<NEW_LINE>if (vo.getPeerL3NetworkRefs() != null && !vo.getPeerL3NetworkRefs().isEmpty()) {<NEW_LINE>inv.setPeerL3NetworkUuids(vo.getPeerL3NetworkRefs().stream().map(ref -> ref.getL3NetworkUuid()).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>inv.setServicesRefs(VipNetworkServicesRefInventory.valueOf(vo.getServicesRefs()));<NEW_LINE>inv.setUseFor(vo.getUseFor());<NEW_LINE>inv.setSystem(vo.isSystem());<NEW_LINE>return inv;<NEW_LINE>}
setIp(vo.getIp());
1,526,663
public com.jme3.opencl.Buffer.AsyncMapping mapAsync(CommandQueue queue, long size, long offset, MappingAccess access) {<NEW_LINE>Utils.pointerBuffers[0].rewind();<NEW_LINE>Utils.errorBuffer.rewind();<NEW_LINE>CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue();<NEW_LINE>long flags = Utils.getMappingAccessFlags(access);<NEW_LINE>ByteBuffer buf = CL10.clEnqueueMapBuffer(q, buffer, CL10.CL_FALSE, flags, offset, size, null, Utils.pointerBuffers<MASK><NEW_LINE>Utils.checkError(Utils.errorBuffer, "clEnqueueMapBuffer");<NEW_LINE>long event = Utils.pointerBuffers[0].get(0);<NEW_LINE>return new com.jme3.opencl.Buffer.AsyncMapping(new LwjglEvent(q.getCLEvent(event)), buf);<NEW_LINE>}
[0], Utils.errorBuffer);
360,120
public List<Regressor> convertToBatchOutput(Tensor tensor, ImmutableOutputInfo<Regressor> outputIDInfo) {<NEW_LINE>FloatNdArray predictions = getBatchPredictions(tensor, outputIDInfo.size());<NEW_LINE>List<Regressor> output = new ArrayList<>();<NEW_LINE>int batchSize = (int) predictions.shape().asArray()[0];<NEW_LINE>// Similar to convertToOutput, names and values are ordered by<NEW_LINE>// the id, not the natural ordering, but the Regressor constructor<NEW_LINE>// fixes that.<NEW_LINE>String[] names = new String[outputIDInfo.size()];<NEW_LINE>for (Pair<Integer, Regressor> p : outputIDInfo) {<NEW_LINE>int id = p.getA();<NEW_LINE>names[id] = p.getB(<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < batchSize; i++) {<NEW_LINE>double[] values = new double[names.length];<NEW_LINE>for (int j = 0; j < names.length; j++) {<NEW_LINE>values[j] = predictions.getFloat(i, j);<NEW_LINE>}<NEW_LINE>output.add(new Regressor(names, values));<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
).getNames()[0];
1,613,549
private static void cliAttributes(LexerfulGrammarBuilder b) {<NEW_LINE>b.rule(cliAttributes).is(b.oneOrMore(cliAttributeSection));<NEW_LINE>b.rule(cliAttributeSection).is("[", b.optional(cliAttributeTargetSpecifier), cliAttributeList, "]");<NEW_LINE>b.rule(cliAttributeTargetSpecifier).is(cliAttributeTarget, ":");<NEW_LINE>b.rule(cliAttributeTarget).is(b.firstOf("assembly", CxxKeyword.CLASS, "constructor", "delegate", CxxKeyword.ENUM, "event", "field", "interface", "method", "parameter", "property", "returnvalue", CxxKeyword.STRUCT));<NEW_LINE>b.rule(cliAttributeList).is(cliAttribute, b.zeroOrMore(",", cliAttribute));<NEW_LINE>b.rule(cliAttribute).is(b.optional(nestedNameSpecifier), typeName, b.optional(cliAttributeArguments));<NEW_LINE>b.rule(cliAttributeArguments).is("(", b.firstOf(b.optional(cliPositionArgumentList), b.sequence(cliPositionArgumentList, ",", cliNamedArgumentList), cliNamedArgumentList), ")");<NEW_LINE>b.rule(cliPositionArgumentList).is(cliPositionArgument, b.zeroOrMore(",", cliPositionArgument));<NEW_LINE>b.rule(cliPositionArgument).is(cliAttributeArgumentExpression);<NEW_LINE>b.rule(cliNamedArgumentList).is(cliNamedArgument, b.zeroOrMore(",", cliNamedArgument));<NEW_LINE>b.rule(cliNamedArgument).is(IDENTIFIER, "=", cliAttributeArgumentExpression);<NEW_LINE>b.rule<MASK><NEW_LINE>}
(cliAttributeArgumentExpression).is(assignmentExpression);
107,759
public static void main(String[] args) throws Exception {<NEW_LINE>ReferenceConfig<GenericService> reference = new ReferenceConfig<>();<NEW_LINE>ApplicationConfig applicationConfig = new ApplicationConfig("protobuf-demo-consumer");<NEW_LINE>applicationConfig.setQosEnable(false);<NEW_LINE>reference.setApplication(applicationConfig);<NEW_LINE>reference.setInterface("org.apache.dubbo.sample.protobuf.GoogleProtobufService");<NEW_LINE>reference.setGeneric(CommonConstants.GENERIC_SERIALIZATION_PROTOBUF);<NEW_LINE>reference.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));<NEW_LINE>GenericService genericService = reference.get();<NEW_LINE>printServiceData();<NEW_LINE>Map<String, Object> request = new HashMap<>();<NEW_LINE>request.put("string", "message from client");<NEW_LINE>String requestString = new Gson().toJson(request);<NEW_LINE>Object result = genericService.$invoke("callGoogleProtobuf", new String[] { "org.apache.dubbo.sample.protobuf.GoogleProtobufBasic$GooglePBRequestType" }, new Object[] { requestString });<NEW_LINE>System.out.println(new Gson<MASK><NEW_LINE>}
().toJson(result));
1,075,945
private void addMainSession(Session session, InetSocketAddress lastReolvedAddr, InetSocketAddressWrapper addrWrapper) {<NEW_LINE>InetSocketAddress remoteSocketAddress = session.getRemoteSocketAddress();<NEW_LINE>log.info("Add a session: " + SystemUtils.getRawAddress(remoteSocketAddress) + ":" + remoteSocketAddress.getPort());<NEW_LINE>if (lastReolvedAddr != null && !lastReolvedAddr.equals(remoteSocketAddress)) {<NEW_LINE>log.warn("Memcached node {} is resolved into {}.", lastReolvedAddr, remoteSocketAddress);<NEW_LINE>// Remove and closed old resolved address.<NEW_LINE>Queue<Session> sessions = sessionMap.remove(lastReolvedAddr);<NEW_LINE>if (sessions != null) {<NEW_LINE>for (Session s : sessions) {<NEW_LINE>((MemcachedSession) s).setAllowReconnect(false);<NEW_LINE>s.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// updated resolve addr<NEW_LINE>addrWrapper.setResolvedSocketAddress(remoteSocketAddress);<NEW_LINE>}<NEW_LINE>Queue<Session> sessions = this.sessionMap.get(remoteSocketAddress);<NEW_LINE>if (sessions == null) {<NEW_LINE>sessions = new ConcurrentLinkedQueue<Session>();<NEW_LINE>Queue<Session> oldSessions = this.sessionMap.putIfAbsent(remoteSocketAddress, sessions);<NEW_LINE>if (null != oldSessions) {<NEW_LINE>sessions = oldSessions;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If it is in failure mode,remove closed session from list<NEW_LINE>if (this.failureMode) {<NEW_LINE>Iterator<Session> it = sessions.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Session tmp = it.next();<NEW_LINE>if (tmp.isClosed()) {<NEW_LINE>it.remove();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sessions.offer(session);<NEW_LINE>// Remove old session and close it<NEW_LINE>while (sessions.size() > this.connectionPoolSize) {<NEW_LINE>Session oldSession = sessions.poll();<NEW_LINE>((MemcachedSession<MASK><NEW_LINE>oldSession.close();<NEW_LINE>}<NEW_LINE>}
) oldSession).setAllowReconnect(false);
456,724
public void validateRestSimpleParameter(Element element, String requiredClass, String parameterName, ElementValidation validation) {<NEW_LINE>TypeMirror requiredType = annotationHelper.<MASK><NEW_LINE>DeclaredType paramterType = annotationHelper.extractAnnotationClassParameter(element, annotationHelper.getTarget(), parameterName);<NEW_LINE>if (paramterType != null) {<NEW_LINE>if (annotationHelper.isSubtype(paramterType, requiredType)) {<NEW_LINE>Element parameterElement = paramterType.asElement();<NEW_LINE>if (parameterElement.getKind().isClass()) {<NEW_LINE>if (!annotationHelper.isAbstract(parameterElement)) {<NEW_LINE>if (parameterElement.getAnnotation(EBean.class) != null) {<NEW_LINE>typeIsValid(EBean.class, paramterType, validation);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<ExecutableElement> constructors = ElementFilter.constructorsIn(parameterElement.getEnclosedElements());<NEW_LINE>for (ExecutableElement constructor : constructors) {<NEW_LINE>if (annotationHelper.isPublic(constructor) && constructor.getParameters().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>validation.addError(element, "The " + parameterName + " class must have a public no argument constructor or must be annotated with @EBean");<NEW_LINE>} else {<NEW_LINE>validation.addError(element, "The " + parameterName + " class must not be abstract");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>validation.addError(element, "The " + parameterName + " class must be a class");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>validation.addError(element, "The " + parameterName + " class must be a subtype of " + requiredClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
typeElementFromQualifiedName(requiredClass).asType();
1,276,040
private void save(ServerLongIntRow row, PSMatrixSaveContext saveContext, MatrixPartitionMeta meta, DataOutputStream out) throws IOException {<NEW_LINE>long startCol = meta.getStartCol();<NEW_LINE>if (ServerRowUtils.getVector(row) instanceof IntIntVector) {<NEW_LINE>IntIntVector vector = (IntIntVector) ServerRowUtils.getVector(row);<NEW_LINE>if (vector.isDense()) {<NEW_LINE>int[] data = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>out.writeInt(data[i]);<NEW_LINE>}<NEW_LINE>} else if (vector.isSorted()) {<NEW_LINE>int[] indices = vector.getStorage().getIndices();<NEW_LINE>int[] values = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>out.writeLong(indices[i] + startCol);<NEW_LINE>out.writeInt(values[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ObjectIterator<Int2IntMap.Entry> iter = vector.getStorage().entryIterator();<NEW_LINE>Int2IntMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>out.writeLong(<MASK><NEW_LINE>out.writeInt(entry.getIntValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LongIntVector vector = (LongIntVector) ServerRowUtils.getVector(row);<NEW_LINE>if (vector.isSorted()) {<NEW_LINE>long[] indices = vector.getStorage().getIndices();<NEW_LINE>int[] values = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>out.writeLong(indices[i] + startCol);<NEW_LINE>out.writeInt(values[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ObjectIterator<Long2IntMap.Entry> iter = vector.getStorage().entryIterator();<NEW_LINE>Long2IntMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>out.writeLong(entry.getLongKey() + startCol);<NEW_LINE>out.writeInt(entry.getIntValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
entry.getIntKey() + startCol);
1,394,534
public boolean visit(SQLExprTableSource x) {<NEW_LINE>SqlNode table;<NEW_LINE>SQLExpr expr = x.getExpr();<NEW_LINE>SqlNodeList sqlNodes = convertHints((List) x.getHints(), x.computeAlias());<NEW_LINE>if (expr instanceof SQLIdentifierExpr) {<NEW_LINE>table = new SqlTableRef(SqlParserPos.ZERO, (SqlIdentifier) buildIdentifier(<MASK><NEW_LINE>} else if (expr instanceof SQLPropertyExpr) {<NEW_LINE>table = new SqlTableRef(SqlParserPos.ZERO, (SqlIdentifier) buildIdentifier((SQLPropertyExpr) expr), sqlNodes);<NEW_LINE>} else {<NEW_LINE>throw new MycatException("not support : " + expr);<NEW_LINE>}<NEW_LINE>if (x.getAlias() != null) {<NEW_LINE>SqlIdentifier alias = new SqlIdentifier(SQLUtils.normalize(x.computeAlias()), SqlParserPos.ZERO);<NEW_LINE>SqlBasicCall as = new SqlBasicCall(SqlStdOperatorTable.AS, new SqlNode[] { table, alias }, SqlParserPos.ZERO);<NEW_LINE>sqlNode = as;<NEW_LINE>} else {<NEW_LINE>sqlNode = table;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
(SQLIdentifierExpr) expr), sqlNodes);
960,939
public void serialize(final ProcessTask value, final JsonGenerator jsonGenerator, final SerializerProvider provider) throws IOException {<NEW_LINE>final ObjectNode object = OBJECT_MAPPER.createObjectNode();<NEW_LINE>object.put("inputType", this.model.writeObjectAsObjectNode<MASK><NEW_LINE>object.put("outputType", this.model.writeObjectAsObjectNode(value.getOutputPluginType()));<NEW_LINE>object.put("filterTypes", this.model.writeObjectAsObjectNode(value.getFilterPluginTypes()));<NEW_LINE>object.put("inputTask", this.model.writeObjectAsObjectNode(value.getInputTaskSource()));<NEW_LINE>object.put("outputTask", this.model.writeObjectAsObjectNode(value.getOutputTaskSource()));<NEW_LINE>object.put("filterTasks", this.model.writeObjectAsObjectNode(value.getFilterTaskSources()));<NEW_LINE>object.put("schemas", this.model.writeObjectAsObjectNode(value.getFilterSchemas()));<NEW_LINE>object.put("executorSchema", this.model.writeObjectAsObjectNode(value.getExecutorSchema()));<NEW_LINE>object.put("executorTask", this.model.writeObjectAsObjectNode(value.getExecutorTaskSource()));<NEW_LINE>jsonGenerator.writeTree(object);<NEW_LINE>}
(value.getInputPluginType()));
1,215,186
ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>String id = StringTools.uniqueToken();<NEW_LINE>Meta meta = new Meta();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>meta.setId(id);<NEW_LINE>assignmentStringValue(meta);<NEW_LINE>assignmentStringLobValue(meta);<NEW_LINE>assignmentBooleanValue(meta);<NEW_LINE>assignmentDateTimeValue(meta);<NEW_LINE>assignmentDateValue(meta);<NEW_LINE>assignmentTimeValue(meta);<NEW_LINE>assignmentIntegerValue(meta);<NEW_LINE>assignmentLongValue(meta);<NEW_LINE>assignmentFloatValue(meta);<NEW_LINE>assignmentDoubleValue(meta);<NEW_LINE>assignmentListValue(meta);<NEW_LINE>assignmentMapValue(meta);<NEW_LINE>assignmentProperties(meta);<NEW_LINE>emc.beginTransaction(Meta.class);<NEW_LINE>emc.persist(meta, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>}<NEW_LINE>Wo wo = new Wo();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Meta o = emc.find(id, Meta.class);<NEW_LINE>wo.setAssertStringValue(assertStringValue(o, meta));<NEW_LINE>wo.setAssertStringLobValue(assertStringLobValue(o, meta));<NEW_LINE>wo.setAssertBooleanValue(assertBooleanValue(o, meta));<NEW_LINE>wo.setAssertDateTimeValue(assertDateTimeValue(o, meta));<NEW_LINE>wo.setAssertDateValue(assertDateValue(o, meta));<NEW_LINE>wo.setAssertTimeValue<MASK><NEW_LINE>wo.setAssertIntegerValue(assertIntegerValue(o, meta));<NEW_LINE>wo.setAssertLongValue(assertLongValue(o, meta));<NEW_LINE>wo.setAssertFloatValue(assertFloatValue(o, meta));<NEW_LINE>wo.setAssertDoubleValue(assertDoubleValue(o, meta));<NEW_LINE>wo.setAssertListValue(assertListValue(o, meta));<NEW_LINE>wo.setAssertMapValue(assertMapValue(o, meta));<NEW_LINE>wo.setAssertProperties(assertProperties(o, meta));<NEW_LINE>}<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}
(assertTimeValue(o, meta));
1,652,650
public void mouseReleased(Canvas canvas, Graphics g, MouseEvent e) {<NEW_LINE>if (!exists)<NEW_LINE>return;<NEW_LINE>Canvas.snapToGrid(e);<NEW_LINE>final var curX = e.getX();<NEW_LINE>final var curY = e.getY();<NEW_LINE>if (computeMove(curX, curY)) {<NEW_LINE>cur = Location.create(curX, curY);<NEW_LINE>}<NEW_LINE>if (hasDragged) {<NEW_LINE>exists = false;<NEW_LINE>super.mouseReleased(canvas, g, e);<NEW_LINE>final var wires = new ArrayList<Wire>(2);<NEW_LINE>if (cur.getY() == start.getY() || cur.getX() == start.getX()) {<NEW_LINE>var wire = Wire.create(cur, start);<NEW_LINE>wire = checkForRepairs(canvas, wire, wire.getEnd0());<NEW_LINE>wire = checkForRepairs(canvas, wire, wire.getEnd1());<NEW_LINE>if (performShortening(canvas, start, cur))<NEW_LINE>return;<NEW_LINE>if (wire.getLength() > 0)<NEW_LINE>wires.add(wire);<NEW_LINE>} else {<NEW_LINE>Location m;<NEW_LINE>if (direction == HORIZONTAL) {<NEW_LINE>m = Location.create(cur.getX(), start.getY());<NEW_LINE>} else {<NEW_LINE>m = Location.create(start.getX(), cur.getY());<NEW_LINE>}<NEW_LINE>var wire0 = Wire.create(start, m);<NEW_LINE>var wire1 = Wire.create(m, cur);<NEW_LINE>wire0 = checkForRepairs(canvas, wire0, start);<NEW_LINE>wire1 = checkForRepairs(canvas, wire1, cur);<NEW_LINE>if (wire0.getLength() > 0)<NEW_LINE>wires.add(wire0);<NEW_LINE>if (wire1.getLength() > 0)<NEW_LINE>wires.add(wire1);<NEW_LINE>}<NEW_LINE>if (!wires.isEmpty()) {<NEW_LINE>final var mutation = new CircuitMutation(canvas.getCircuit());<NEW_LINE>mutation.addAll(wires);<NEW_LINE>final var desc = (wires.size() == 1) ? S.getter("addWireAction") : S.getter("addWiresAction");<NEW_LINE>final var act = mutation.toAction(desc);<NEW_LINE>canvas.<MASK><NEW_LINE>lastAction = act;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getProject().doAction(act);
1,342,330
private byte[] genCheckImage(int width, int height, int checkSize) {<NEW_LINE>int x, y;<NEW_LINE>byte[] pixels = new byte[width * height * 3];<NEW_LINE>for (y = 0; y < height; y++) for (x = 0; x < width; x++) {<NEW_LINE>byte rColor = 0;<NEW_LINE>byte bColor = 0;<NEW_LINE>if ((x / checkSize) % 2 == 0) {<NEW_LINE>rColor = (byte) (127 * ((y / checkSize) % 2));<NEW_LINE>bColor = (byte) (127 * (1 - ((y / checkSize) % 2)));<NEW_LINE>} else {<NEW_LINE>bColor = (byte) (127 * ((y / checkSize) % 2));<NEW_LINE>rColor = (byte) (127 * (1 - ((y / checkSize) % 2)));<NEW_LINE>}<NEW_LINE>pixels[(y * width + x) * 3] = rColor;<NEW_LINE>pixels[(y * width + x<MASK><NEW_LINE>pixels[(y * width + x) * 3 + 2] = bColor;<NEW_LINE>}<NEW_LINE>return pixels;<NEW_LINE>}
) * 3 + 1] = 0;
395,840
public void handle(AnnotationValues<ToString> annotation, JCAnnotation ast, JavacNode annotationNode) {<NEW_LINE>handleFlagUsage(annotationNode, ConfigurationKeys.TO_STRING_FLAG_USAGE, "@ToString");<NEW_LINE>deleteAnnotationIfNeccessary(annotationNode, ToString.class);<NEW_LINE>ToString ann = annotation.getInstance();<NEW_LINE>boolean onlyExplicitlyIncluded = annotationNode.getAst().getBooleanAnnotationValue(annotation, "onlyExplicitlyIncluded", ConfigurationKeys.TO_STRING_ONLY_EXPLICITLY_INCLUDED);<NEW_LINE>java.util.List<Included<JavacNode, ToString.Include>> members = InclusionExclusionUtils.handleToStringMarking(annotationNode.up(), onlyExplicitlyIncluded, annotation, annotationNode);<NEW_LINE>if (members == null)<NEW_LINE>return;<NEW_LINE>Boolean callSuper = ann.callSuper();<NEW_LINE>if (!annotation.isExplicit("callSuper"))<NEW_LINE>callSuper = null;<NEW_LINE>Boolean doNotUseGettersConfiguration = annotationNode.getAst().readConfiguration(ConfigurationKeys.TO_STRING_DO_NOT_USE_GETTERS);<NEW_LINE>boolean doNotUseGetters = annotation.isExplicit("doNotUseGetters") || doNotUseGettersConfiguration == null <MASK><NEW_LINE>FieldAccess fieldAccess = doNotUseGetters ? FieldAccess.PREFER_FIELD : FieldAccess.GETTER;<NEW_LINE>boolean includeFieldNames = annotationNode.getAst().getBooleanAnnotationValue(annotation, "includeFieldNames", ConfigurationKeys.TO_STRING_INCLUDE_FIELD_NAMES);<NEW_LINE>generateToString(annotationNode.up(), annotationNode, members, includeFieldNames, callSuper, true, fieldAccess);<NEW_LINE>}
? ann.doNotUseGetters() : doNotUseGettersConfiguration;
911,348
public BType inferRecordFieldType(BRecordType recordType) {<NEW_LINE>Map<String, BField> fields = recordType.fields;<NEW_LINE>BUnionType unionType = BUnionType.create(null);<NEW_LINE>if (!recordType.sealed) {<NEW_LINE>unionType.add(recordType.restFieldType);<NEW_LINE>} else if (fields.size() == 0) {<NEW_LINE>unionType.add(symTable.neverType);<NEW_LINE>}<NEW_LINE>for (BField field : fields.values()) {<NEW_LINE>if (isAssignable(field.type, unionType)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (isAssignable(unionType, field.type)) {<NEW_LINE>unionType = BUnionType.create(null);<NEW_LINE>}<NEW_LINE>unionType.add(field.type);<NEW_LINE>}<NEW_LINE>if (unionType.getMemberTypes().size() > 1) {<NEW_LINE>unionType.tsymbol = Symbols.createTypeSymbol(SymTag.UNION_TYPE, Flags.asMask(EnumSet.of(Flag.PUBLIC)), Names.EMPTY, recordType.tsymbol.pkgID, null, recordType.tsymbol.owner, symTable.builtinPos, VIRTUAL);<NEW_LINE>return unionType;<NEW_LINE>}<NEW_LINE>return unionType.getMemberTypes()<MASK><NEW_LINE>}
.iterator().next();
486,597
public void readLiteralSection() throws IOException {<NEW_LINE>if (log.isLoggable(Level.FINE))<NEW_LINE>log.fine("readLiteralSection");<NEW_LINE>final byte[] buf = in.read_size_and_inflate();<NEW_LINE>final EInputStream is = new EInputStream(buf);<NEW_LINE>int nLiterals = is.read4BE();<NEW_LINE>if (log.isLoggable(Level.FINE))<NEW_LINE>log.fine("Number of literals: " + nLiterals);<NEW_LINE>literals = new EObject[nLiterals];<NEW_LINE>for (int i = 0; i < nLiterals; i++) {<NEW_LINE>int lit_length = is.read4BE();<NEW_LINE>int pos_before_lit = is.getPos();<NEW_LINE>literals[<MASK><NEW_LINE>if (log.isLoggable(Level.FINE))<NEW_LINE>log.fine("- #" + i + ": " + literals[i]);<NEW_LINE>int pos_after_lit = is.getPos();<NEW_LINE>assert (pos_after_lit == pos_before_lit + lit_length);<NEW_LINE>}<NEW_LINE>}
i] = is.read_any();
551,008
ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = emc.find(wi.getApplication(), Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ApplicationDictNotExistedException(wi.getApplication());<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(), application.getName(), application.getId());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(ApplicationDict.class);<NEW_LINE>emc.beginTransaction(ApplicationDictItem.class);<NEW_LINE>ApplicationDict applicationDict = new ApplicationDict();<NEW_LINE>Wi.copier.copy(wi, applicationDict);<NEW_LINE>applicationDict.setApplication(application.getId());<NEW_LINE>emc.persist(applicationDict, CheckPersistType.all);<NEW_LINE>DataItemConverter<ApplicationDictItem> converter = new DataItemConverter<>(ApplicationDictItem.class);<NEW_LINE>List<ApplicationDictItem> list = converter.disassemble(wi.getData());<NEW_LINE>for (ApplicationDictItem o : list) {<NEW_LINE>o.setBundle(applicationDict.getId());<NEW_LINE>o.<MASK><NEW_LINE>o.setApplication(application.getId());<NEW_LINE>o.setItemCategory(ItemCategory.pp_dict);<NEW_LINE>emc.persist(o, CheckPersistType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(ApplicationDict.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(applicationDict.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
setDistributeFactor(applicationDict.getDistributeFactor());
1,182,287
protected void doRunCommand(KeycloakSession session) {<NEW_LINE>String realmName = getArg(0);<NEW_LINE>String username = getArg(1);<NEW_LINE>RealmModel realm = session.realms().getRealmByName(realmName);<NEW_LINE>if (realm == null) {<NEW_LINE>log.errorf("Unknown realm: %s", realmName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>UserModel user = session.users().getUserByUsername(realm, username);<NEW_LINE>if (user == null) {<NEW_LINE>log.infof("User '%s' doesn't exist in realm '%s'", username, realmName);<NEW_LINE>} else {<NEW_LINE>List<String> roleMappings = getRoleMappings(user);<NEW_LINE>log.infof("User: ID: '%s', username: '%s', mail: '%s', roles: '%s'", user.getId(), user.getUsername(), user.getEmail(<MASK><NEW_LINE>}<NEW_LINE>}
), roleMappings.toString());
764,077
public static List<String> write(String path, List<String> entities, boolean dynamicFlag) throws Exception {<NEW_LINE>List<String> names = new ArrayList<>();<NEW_LINE>String name = "";<NEW_LINE>try {<NEW_LINE>names.addAll((List<String>) Config.resource(Config.RESOURCE_CONTAINERENTITYNAMES));<NEW_LINE>names = ListTools.includesExcludesWildcard(names, entities, null);<NEW_LINE>Document document = DocumentHelper.createDocument();<NEW_LINE>Element persistence = document.addElement("persistence", "http://java.sun.com/xml/ns/persistence");<NEW_LINE>persistence.addAttribute(QName.get("schemaLocation", "xsi", "http://www.w3.org/2001/XMLSchema-instance"), "http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd");<NEW_LINE>persistence.addAttribute("version", "2.0");<NEW_LINE>List<String> dyClasses = new ArrayList<>();<NEW_LINE>for (String className : names) {<NEW_LINE>name = className;<NEW_LINE>Class<? extends JpaObject> clazz = (Class<JpaObject>) Class.forName(className);<NEW_LINE>Element unit = persistence.addElement("persistence-unit");<NEW_LINE>unit.addAttribute("name", className);<NEW_LINE>unit.addAttribute("transaction-type", "RESOURCE_LOCAL");<NEW_LINE>Element provider = unit.addElement("provider");<NEW_LINE>provider.addText(PersistenceProviderImpl.class.getName());<NEW_LINE>for (Class<?> o : JpaObjectTools.scanMappedSuperclass(clazz)) {<NEW_LINE>Element mapped_element = unit.addElement("class");<NEW_LINE>mapped_element.addText(o.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dynamicFlag) {<NEW_LINE>for (String className : names) {<NEW_LINE>if (className.startsWith(DynamicEntity.CLASS_PACKAGE)) {<NEW_LINE>dyClasses.add(className);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!dyClasses.isEmpty()) {<NEW_LINE>String dyClassName = DynamicBaseEntity.class.getName();<NEW_LINE>names.add(dyClassName);<NEW_LINE>Element unit = persistence.addElement("persistence-unit");<NEW_LINE>unit.addAttribute("name", dyClassName);<NEW_LINE>unit.addAttribute("transaction-type", "RESOURCE_LOCAL");<NEW_LINE>Element provider = unit.addElement("provider");<NEW_LINE>provider.addText(PersistenceProviderImpl.class.getName());<NEW_LINE>for (String dyClass : dyClasses) {<NEW_LINE>Element mapped_element = unit.addElement("class");<NEW_LINE>mapped_element.addText(dyClass);<NEW_LINE>}<NEW_LINE>for (Class<?> o : JpaObjectTools.scanMappedSuperclass(DynamicBaseEntity.class)) {<NEW_LINE>if (!o.getName().equals(DynamicBaseEntity.class.getName())) {<NEW_LINE>Element mapped_element = unit.addElement("class");<NEW_LINE>mapped_element.addText(o.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OutputFormat format = OutputFormat.createPrettyPrint();<NEW_LINE>format.setEncoding("UTF-8");<NEW_LINE>File file = new File(path);<NEW_LINE>FileUtils.touch(file);<NEW_LINE>XMLWriter writer = new XMLWriter(<MASK><NEW_LINE>writer.write(document);<NEW_LINE>writer.close();<NEW_LINE>return names;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new Exception("write error.className:" + name, e);<NEW_LINE>}<NEW_LINE>}
new FileWriter(file), format);
140,422
public void lower(CEntryPointUtilityNode node, LoweringTool tool) {<NEW_LINE>if (tool.getLoweringStage() != LoweringTool.StandardLoweringStage.LOW_TIER) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Arguments args;<NEW_LINE>switch(node.getUtilityAction()) {<NEW_LINE>case IsAttached:<NEW_LINE>args = new Arguments(isAttached, node.graph().getGuardsStage(), tool.getLoweringStage());<NEW_LINE>args.add("isolate", node.getParameter0());<NEW_LINE>break;<NEW_LINE>case FailFatally:<NEW_LINE>args = new Arguments(failFatally, node.graph().getGuardsStage(), tool.getLoweringStage());<NEW_LINE>args.add("code", node.getParameter0());<NEW_LINE>args.add("message", node.getParameter1());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw shouldNotReachHere();<NEW_LINE>}<NEW_LINE>template(node, args).instantiate(providers.getMetaAccess(), <MASK><NEW_LINE>}
node, SnippetTemplate.DEFAULT_REPLACER, args);
373,369
public void listContainers() {<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobServiceClient.listBlobContainers<NEW_LINE>client.listBlobContainers().forEach(container -> System.out.printf("Name: %s%n", container.getName()));<NEW_LINE>// END: com.azure.storage.blob.BlobServiceClient.listBlobContainers<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobServiceClient.listBlobContainers#ListBlobContainersOptions-Duration<NEW_LINE>ListBlobContainersOptions options = new ListBlobContainersOptions().setPrefix("containerNamePrefixToMatch").setDetails(new BlobContainerListDetails<MASK><NEW_LINE>client.listBlobContainers(options, timeout).forEach(container -> System.out.printf("Name: %s%n", container.getName()));<NEW_LINE>// END: com.azure.storage.blob.BlobServiceClient.listBlobContainers#ListBlobContainersOptions-Duration<NEW_LINE>}
().setRetrieveMetadata(true));
336,687
public void updateMapMarkers(NearbyController.NearbyPlacesInfo nearbyPlacesInfo, Marker selectedMarker, boolean shouldTrackPosition) {<NEW_LINE>if (null != nearbyParentFragmentView) {<NEW_LINE>List<NearbyBaseMarker> nearbyBaseMarkers = // Curlatlang will be used to calculate distances<NEW_LINE>NearbyController.// Curlatlang will be used to calculate distances<NEW_LINE>loadAttractionsFromLocationToBaseMarkerOptions(nearbyPlacesInfo.curLatLng, nearbyPlacesInfo.placeList, nearbyParentFragmentView.getContext(), bookmarkLocationDao.getAllBookmarksLocations());<NEW_LINE>nearbyParentFragmentView.updateMapMarkers(nearbyBaseMarkers, selectedMarker);<NEW_LINE><MASK><NEW_LINE>if (shouldTrackPosition) {<NEW_LINE>nearbyParentFragmentView.updateMapToTrackPosition(nearbyPlacesInfo.curLatLng);<NEW_LINE>}<NEW_LINE>// So that new location updates wont come<NEW_LINE>lockUnlockNearby(false);<NEW_LINE>nearbyParentFragmentView.setProgressBarVisibility(false);<NEW_LINE>nearbyParentFragmentView.updateListFragment(nearbyPlacesInfo.placeList);<NEW_LINE>handleCenteringTaskIfAny();<NEW_LINE>nearbyParentFragmentView.centerMapToPosition(nearbyPlacesInfo.searchLatLng);<NEW_LINE>}<NEW_LINE>}
nearbyParentFragmentView.addCurrentLocationMarker(nearbyPlacesInfo.curLatLng);
396,243
public static void cogAsRelay(SceneBuilder scene, SceneBuildingUtil util) {<NEW_LINE><MASK><NEW_LINE>scene.configureBasePlate(0, 0, 5);<NEW_LINE>BlockPos gauge = util.grid.at(4, 1, 1);<NEW_LINE>Selection gaugeSelect = util.select.position(gauge);<NEW_LINE>scene.world.showSection(util.select.layer(0), Direction.UP);<NEW_LINE>scene.world.showSection(gaugeSelect, Direction.UP);<NEW_LINE>scene.world.setKineticSpeed(gaugeSelect, 0);<NEW_LINE>scene.idle(5);<NEW_LINE>scene.world.showSection(util.select.fromTo(1, 1, 3, 1, 1, 5), Direction.DOWN);<NEW_LINE>scene.idle(10);<NEW_LINE>for (int i = 1; i <= 4; i++) {<NEW_LINE>scene.idle(5);<NEW_LINE>if (i == 2)<NEW_LINE>scene.world.showSection(util.select.position(0, 1, 2), Direction.DOWN);<NEW_LINE>scene.world.showSection(util.select.position(i, 1, 2), Direction.DOWN);<NEW_LINE>}<NEW_LINE>scene.world.setKineticSpeed(gaugeSelect, 64);<NEW_LINE>scene.effects.indicateSuccess(gauge);<NEW_LINE>scene.idle(10);<NEW_LINE>scene.overlay.showText(60).text("Cogwheels will relay rotation to other adjacent cogwheels").pointAt(util.vector.blockSurface(util.grid.at(0, 1, 2), Direction.EAST));<NEW_LINE>scene.idle(60);<NEW_LINE>scene.world.showSection(util.select.fromTo(1, 1, 1, 2, 1, 1), Direction.SOUTH);<NEW_LINE>scene.idle(10);<NEW_LINE>scene.effects.rotationDirectionIndicator(util.grid.at(1, 1, 1));<NEW_LINE>scene.effects.rotationDirectionIndicator(util.grid.at(2, 1, 1));<NEW_LINE>scene.idle(20);<NEW_LINE>scene.overlay.showText(100).text("Neighbouring shafts connected like this will rotate in opposite directions").placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.NORTH));<NEW_LINE>}
scene.title("cogwheel", "Relaying rotational force using Cogwheels");
593,779
private void createGetElementPointerExpression(RecordBuffer buffer) {<NEW_LINE>int opCode = buffer.getId();<NEW_LINE>if (opCode == CONSTANT_CE_GEP_WITH_INRANGE_INDEX || buffer.size() % 2 != 0) {<NEW_LINE>// type of pointee<NEW_LINE>buffer.skip();<NEW_LINE>}<NEW_LINE>boolean isInbounds;<NEW_LINE>if (opCode == CONSTANT_CE_GEP_WITH_INRANGE_INDEX) {<NEW_LINE><MASK><NEW_LINE>isInbounds = (op & 0x1) != 0;<NEW_LINE>} else {<NEW_LINE>isInbounds = opCode == CONSTANT_CE_INBOUNDS_GEP;<NEW_LINE>}<NEW_LINE>// type of pointer<NEW_LINE>buffer.skip();<NEW_LINE>int pointer = buffer.readInt();<NEW_LINE>final int[] indices = new int[buffer.remaining() >> 1];<NEW_LINE>for (int j = 0; j < indices.length; j++) {<NEW_LINE>// index type<NEW_LINE>buffer.skip();<NEW_LINE>indices[j] = buffer.readInt();<NEW_LINE>}<NEW_LINE>scope.addSymbol(GetElementPointerConstant.fromSymbols(scope.getSymbols(), type, pointer, indices, isInbounds), type);<NEW_LINE>}
long op = buffer.read();
273,503
final DeleteApiResult executeDeleteApi(DeleteApiRequest deleteApiRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApiRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApiRequest> request = null;<NEW_LINE>Response<DeleteApiResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteApiRequestProtocolMarshaller(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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApi");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApiResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApiResultJsonUnmarshaller());<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(deleteApiRequest));
1,636,656
public ProcessStatus handleEnterCode(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException, ServletException {<NEW_LINE>final PwmDomain pwmDomain = pwmRequest.getPwmDomain();<NEW_LINE>final ActivateUserBean activateUserBean = pwmDomain.getSessionStateService().getBean(pwmRequest, ActivateUserBean.class);<NEW_LINE>final String userEnteredCode = <MASK><NEW_LINE>ErrorInformation errorInformation = null;<NEW_LINE>try {<NEW_LINE>final TokenPayload tokenPayload = TokenUtil.checkEnteredCode(pwmRequest.getPwmRequestContext(), userEnteredCode, activateUserBean.getTokenDestination(), activateUserBean.getUserIdentity(), TokenType.ACTIVATION, TokenService.TokenEntryType.unauthenticated);<NEW_LINE>if (activateUserBean.getUserIdentity() == null) {<NEW_LINE>ActivateUserUtils.initUserActivationBean(pwmRequest, tokenPayload.getUserIdentity());<NEW_LINE>}<NEW_LINE>activateUserBean.setTokenPassed(true);<NEW_LINE>activateUserBean.setTokenSent(true);<NEW_LINE>if (pwmRequest.getDomainConfig().readSettingAsBoolean(PwmSetting.DISPLAY_TOKEN_SUCCESS_BUTTON)) {<NEW_LINE>pwmRequest.setAttribute(PwmRequestAttribute.TokenDestItems, tokenPayload.getDestination());<NEW_LINE>pwmRequest.forwardToJsp(JspUrl.ACTIVATE_USER_TOKEN_SUCCESS);<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}<NEW_LINE>} catch (final PwmUnrecoverableException e) {<NEW_LINE>LOGGER.debug(pwmRequest, () -> "error while checking entered token: ");<NEW_LINE>errorInformation = e.getErrorInformation();<NEW_LINE>}<NEW_LINE>if (!activateUserBean.isTokenPassed()) {<NEW_LINE>if (errorInformation == null) {<NEW_LINE>errorInformation = new ErrorInformation(PwmError.ERROR_TOKEN_INCORRECT);<NEW_LINE>}<NEW_LINE>LOGGER.debug(pwmRequest, errorInformation);<NEW_LINE>setLastError(pwmRequest, errorInformation);<NEW_LINE>}<NEW_LINE>return ProcessStatus.Continue;<NEW_LINE>}
pwmRequest.readParameterAsString(PwmConstants.PARAM_TOKEN);
1,814,131
private static ImmutableList<Pair<String, Path>> renameOutputs(ActionExecutionContext actionExecutionContext, TestRunnerAction action, ImmutableList<Pair<String, Path>> testOutputs, int attemptId) throws IOException {<NEW_LINE>// Rename outputs<NEW_LINE>String namePrefix = FileSystemUtils.removeExtension(action.getTestLog().getExecPath().getBaseName());<NEW_LINE>Path testRoot = actionExecutionContext.getInputPath(action.getTestLog()).getParentDirectory();<NEW_LINE>Path attemptsDir = testRoot.getChild(namePrefix + "_attempts");<NEW_LINE>attemptsDir.createDirectory();<NEW_LINE>String attemptPrefix = "attempt_" + attemptId;<NEW_LINE>Path testLog = attemptsDir.getChild(attemptPrefix + ".log");<NEW_LINE>// Get the normal test output paths, and then update them to use "attempt_N" names, and<NEW_LINE>// attemptDir, before adding them to the outputs.<NEW_LINE>ImmutableList.Builder<Pair<String, Path>> testOutputsBuilder = <MASK><NEW_LINE>for (Pair<String, Path> testOutput : testOutputs) {<NEW_LINE>// e.g. /testRoot/test.dir/file, an example we follow throughout this loop's comments.<NEW_LINE>Path testOutputPath = testOutput.getSecond();<NEW_LINE>Path destinationPath;<NEW_LINE>if (testOutput.getFirst().equals(TestFileNameConstants.TEST_LOG)) {<NEW_LINE>// The rename rules for the test log are different than for all the other files.<NEW_LINE>destinationPath = testLog;<NEW_LINE>} else {<NEW_LINE>// e.g. test.dir/file<NEW_LINE>PathFragment relativeToTestDirectory = testOutputPath.relativeTo(testRoot);<NEW_LINE>// e.g. attempt_1.dir/file<NEW_LINE>String destinationPathFragmentStr = relativeToTestDirectory.getSafePathString().replaceFirst("test", attemptPrefix);<NEW_LINE>PathFragment destinationPathFragment = PathFragment.create(destinationPathFragmentStr);<NEW_LINE>// e.g. /attemptsDir/attempt_1.dir/file<NEW_LINE>destinationPath = attemptsDir.getRelative(destinationPathFragment);<NEW_LINE>destinationPath.getParentDirectory().createDirectory();<NEW_LINE>}<NEW_LINE>// Move to the destination.<NEW_LINE>testOutputPath.renameTo(destinationPath);<NEW_LINE>testOutputsBuilder.add(Pair.of(testOutput.getFirst(), destinationPath));<NEW_LINE>}<NEW_LINE>return testOutputsBuilder.build();<NEW_LINE>}
new ImmutableList.Builder<>();
789,643
private void remove(String name) {<NEW_LINE>IDialogSettings settings = SootPlugin.getDefault().getDialogSettings();<NEW_LINE>int count = 0;<NEW_LINE>try {<NEW_LINE>count = settings.getInt("config_count");<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>}<NEW_LINE>String[] pointers = new String[count];<NEW_LINE>for (int i = 1; i <= count; i++) {<NEW_LINE>pointers[i - 1] = <MASK><NEW_LINE>}<NEW_LINE>int i = 1;<NEW_LINE>int j = 0;<NEW_LINE>while (j < count) {<NEW_LINE>if (!pointers[j].equals(name)) {<NEW_LINE>settings.put("soot_run_config_" + i, pointers[j]);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>settings.put("soot_run_config_" + count, (String) null);<NEW_LINE>count--;<NEW_LINE>if (count < 0) {<NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>settings.put("config_count", count);<NEW_LINE>settings.put(name, (String) null);<NEW_LINE>}
settings.get("soot_run_config_" + i);
322,527
public static boolean searchMazeWrapper(List<List<Integer>> maze, Coordinate s, Coordinate e) throws TestFailure {<NEW_LINE>List<List<Color>> colored = new ArrayList<>();<NEW_LINE>for (List<Integer> col : maze) {<NEW_LINE>List<Color> tmp = new ArrayList<>();<NEW_LINE>for (Integer i : col) {<NEW_LINE>tmp.add(i == 0 ? <MASK><NEW_LINE>}<NEW_LINE>colored.add(tmp);<NEW_LINE>}<NEW_LINE>List<Coordinate> path = searchMaze(colored, s, e);<NEW_LINE>if (path.isEmpty()) {<NEW_LINE>return s.equals(e);<NEW_LINE>}<NEW_LINE>if (!path.get(0).equals(s) || !path.get(path.size() - 1).equals(e)) {<NEW_LINE>throw new TestFailure("Path doesn't lay between start and end points");<NEW_LINE>}<NEW_LINE>for (int i = 1; i < path.size(); i++) {<NEW_LINE>if (!pathElementIsFeasible(maze, path.get(i - 1), path.get(i))) {<NEW_LINE>throw new TestFailure("Path contains invalid segments");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
Color.WHITE : Color.BLACK);
412,850
private String convertDescriptionList(DescriptionList node) {<NEW_LINE>logger.debug("convertDescriptionList");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>appendTitle(node, sb);<NEW_LINE>String style = Optional.ofNullable(node.getStyle()).orElse("");<NEW_LINE>switch(style) {<NEW_LINE>case STYLE_HORIZONTAL:<NEW_LINE>sb.append(ATTRIBUTES_BEGIN).append(STYLE_HORIZONTAL).append<MASK><NEW_LINE>node.getItems().forEach(item -> sb.append(convertDescriptionListEntry(item, node.getLevel(), false)));<NEW_LINE>break;<NEW_LINE>case STYLE_Q_AND_A:<NEW_LINE>sb.append(ATTRIBUTES_BEGIN).append(STYLE_Q_AND_A).append(ATTRIBUTES_END).append(LINE_SEPARATOR);<NEW_LINE>default:<NEW_LINE>node.getItems().forEach(item -> sb.append(convertDescriptionListEntry(item, node.getLevel(), true)));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>appendTrailingNewLine(sb);<NEW_LINE>return sb.toString();<NEW_LINE>}
(ATTRIBUTES_END).append(LINE_SEPARATOR);
926,090
private void resolveHostForOutpostArnRequest(Request<?> request, Arn arn) {<NEW_LINE>S3Resource s3Resource = S3ControlArnConverter.getInstance().convertArn(arn);<NEW_LINE>String signingRegion = request.getHandlerContext(HandlerContextKey.SIGNING_REGION);<NEW_LINE>String arnRegion = arnRegion(arn);<NEW_LINE>String arnPartition = arn.getPartition();<NEW_LINE>S3Resource parentS3Resource = s3Resource.getParentS3Resource();<NEW_LINE>validateIsTrue(!isFipsInvolved(signingRegion<MASK><NEW_LINE>// Even though we validated that we're not *calling* a FIPS region, the client region may still be a FIPS region if we're<NEW_LINE>// using the ARN region. For that reason, we need to strip off the "fips" from the signing region before we get the<NEW_LINE>// partition to make sure we're not making a cross-partition call.<NEW_LINE>signingRegion = removeFipsIfNeeded(signingRegion);<NEW_LINE>String signingPartition = RegionUtils.getRegion(signingRegion).getPartition();<NEW_LINE>S3OutpostResource outpostResource = validateIsInstanceOf(S3OutpostResource.class, parentS3Resource, "The ARN passed must have a parent outpost resource.");<NEW_LINE>validateIsTrue(!isDualstackEnabled(request), "Dual stack endpoints are not supported for outpost requests.");<NEW_LINE>validateIsTrue(arnPartition.equals(signingPartition), "The partition field of the ARN being passed as a bucket parameter to an S3 operation does not match " + "the partition the client has been configured with. Provided partition: '%s'; client partition: '%s'.", arnPartition, signingPartition);<NEW_LINE>validateIsTrue(useArnRegion(request) || arnRegion.equals(signingRegion), "The region field of the ARN being passed as a bucket parameter to an operation does not match the " + "region the client was configured with. Provided region: '%s'; client region: '%s'.", arnRegion, signingRegion);<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, arnRegion);<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_NAME, "s3-outposts");<NEW_LINE>request.addHeader(X_AMZ_OUTPOST_ID_HEADER, outpostResource.getOutpostId());<NEW_LINE>if (isEndpointOverridden(request)) {<NEW_LINE>// Drop endpoint prefix for ARN-based requests<NEW_LINE>replaceHost(request, clientEndpoint(request).getHost());<NEW_LINE>} else {<NEW_LINE>String arnPartitionDnsSuffix = RegionUtils.getRegion(arnRegion).getDomain();<NEW_LINE>request.setEndpoint(URI.create(String.format("%s://s3-outposts.%s.%s", request.getEndpoint().getScheme(), arnRegion, arnPartitionDnsSuffix)));<NEW_LINE>}<NEW_LINE>}
, arnRegion, request), "FIPS is not supported for outpost requests.");
1,801,331
public static Part newPartForContentType(String contentType, String partName) throws InvalidFormatException, PartUnrecognisedException {<NEW_LINE>if (contentType.equals(ContentTypes.PRESENTATIONML_MAIN) || contentType.equals(ContentTypes.PRESENTATIONML_TEMPLATE) || contentType.equals(ContentTypes.PRESENTATIONML_MACROENABLED) || contentType.equals(ContentTypes.PRESENTATIONML_TEMPLATE_MACROENABLED)) {<NEW_LINE>return new MainPresentationPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_SLIDE)) {<NEW_LINE>return new SlidePart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_SLIDE_MASTER)) {<NEW_LINE>return new SlideMasterPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_SLIDE_LAYOUT)) {<NEW_LINE>return new SlideLayoutPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_COMMENTS)) {<NEW_LINE>return new CommentsPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_TABLE_STYLES)) {<NEW_LINE>return new <MASK><NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_PRES_PROPS)) {<NEW_LINE>return new PresentationPropertiesPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_VIEW_PROPS)) {<NEW_LINE>return new ViewPropertiesPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_TAGS)) {<NEW_LINE>return new TagsPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_HANDOUT_MASTER)) {<NEW_LINE>return new HandoutMasterPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_NOTES_MASTER)) {<NEW_LINE>return new NotesMasterPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_NOTES_SLIDE)) {<NEW_LINE>return new NotesSlidePart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_COMMENT_AUTHORS)) {<NEW_LINE>return new CommentAuthorsPart(new PartName(partName));<NEW_LINE>} else {<NEW_LINE>throw new PartUnrecognisedException("No subclass found for " + partName + " (content type '" + contentType + "')");<NEW_LINE>}<NEW_LINE>}
TableStylesPart(new PartName(partName));
1,823,705
final CancelDeploymentJobResult executeCancelDeploymentJob(CancelDeploymentJobRequest cancelDeploymentJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelDeploymentJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelDeploymentJobRequest> request = null;<NEW_LINE>Response<CancelDeploymentJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelDeploymentJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelDeploymentJobRequest));<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, "RoboMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelDeploymentJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelDeploymentJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new CancelDeploymentJobResultJsonUnmarshaller());
1,740,105
public ApiResponse<Order> placeOrderWithHttpInfo(Order body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/store/order";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/xml", "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<Order> localVarReturnType = new GenericType<Order>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false);<NEW_LINE>}
HashMap<String, Object>();
212,131
private boolean canBeReplanted(BlockPos pos) {<NEW_LINE>Item item = plants.get(pos);<NEW_LINE>if (item == Items.WHEAT_SEEDS || item == Items.CARROT || item == Items.POTATO || item == Items.BEETROOT_SEEDS || item == Items.PUMPKIN_SEEDS || item == Items.MELON_SEEDS)<NEW_LINE>return BlockUtils.getBlock(pos.down()) instanceof FarmlandBlock;<NEW_LINE>if (item == Items.NETHER_WART)<NEW_LINE>return BlockUtils.getBlock(<MASK><NEW_LINE>if (item == Items.COCOA_BEANS)<NEW_LINE>return BlockUtils.getState(pos.north()).isIn(BlockTags.JUNGLE_LOGS) || BlockUtils.getState(pos.east()).isIn(BlockTags.JUNGLE_LOGS) || BlockUtils.getState(pos.south()).isIn(BlockTags.JUNGLE_LOGS) || BlockUtils.getState(pos.west()).isIn(BlockTags.JUNGLE_LOGS);<NEW_LINE>return false;<NEW_LINE>}
pos.down()) instanceof SoulSandBlock;
820,545
void interpolateDeformedPoint(float v_x, float v_y, Point2D_F32 deformed) {<NEW_LINE>// sample the closest point and x+1,y+1<NEW_LINE>int x0 = (int) v_x;<NEW_LINE>int y0 = (int) v_y;<NEW_LINE>int x1 = x0 + 1;<NEW_LINE>int y1 = y0 + 1;<NEW_LINE>// make sure the 4 sample points are in bounds<NEW_LINE>if (x1 >= gridCols)<NEW_LINE>x1 = gridCols - 1;<NEW_LINE>if (y1 >= gridRows)<NEW_LINE>y1 = gridRows - 1;<NEW_LINE>// weight along each axis<NEW_LINE>float ax = v_x - x0;<NEW_LINE>float ay = v_y - y0;<NEW_LINE>// bilinear weight for each sample point<NEW_LINE>float w00 = (1.0f - ax) * (1.0f - ay);<NEW_LINE>float w01 = ax * (1.0f - ay);<NEW_LINE>float w11 = ax * ay;<NEW_LINE>float w10 <MASK><NEW_LINE>// apply weights to each sample point<NEW_LINE>Point2D_F32 d00 = getGrid(y0, x0);<NEW_LINE>Point2D_F32 d01 = getGrid(y0, x1);<NEW_LINE>Point2D_F32 d10 = getGrid(y1, x0);<NEW_LINE>Point2D_F32 d11 = getGrid(y1, x1);<NEW_LINE>deformed.setTo(0, 0);<NEW_LINE>deformed.x += w00 * d00.x;<NEW_LINE>deformed.x += w01 * d01.x;<NEW_LINE>deformed.x += w11 * d11.x;<NEW_LINE>deformed.x += w10 * d10.x;<NEW_LINE>deformed.y += w00 * d00.y;<NEW_LINE>deformed.y += w01 * d01.y;<NEW_LINE>deformed.y += w11 * d11.y;<NEW_LINE>deformed.y += w10 * d10.y;<NEW_LINE>}
= (1.0f - ax) * ay;
384,618
synchronized public <T extends ServiceParserInterface> T parser(Class<T> serviceParser) {<NEW_LINE>Symfony2ProjectComponent symfony2ProjectComponent = this.project.getComponent(Symfony2ProjectComponent.class);<NEW_LINE>Collection<File> settingsServiceFiles = symfony2ProjectComponent.getContainerFiles();<NEW_LINE>if (this.serviceParserInstance != null && !this.isModified(settingsServiceFiles)) {<NEW_LINE>return (T) this.serviceParserInstance;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.serviceParserInstance = serviceParser.newInstance();<NEW_LINE>Symfony2ProjectComponent.getLogger().info("new instance: " + serviceParser.getName());<NEW_LINE>} catch (InstantiationException | IllegalAccessException ignored) {<NEW_LINE>}<NEW_LINE>if (this.serviceParserInstance != null) {<NEW_LINE>// extensions<NEW_LINE>if (this.extensions.size() > 0) {<NEW_LINE>CompiledServiceBuilderArguments args = new CompiledServiceBuilderArguments(project);<NEW_LINE>for (CompiledServiceBuilderFactory.Builder builder : this.extensions) {<NEW_LINE>builder.build(args);<NEW_LINE>}<NEW_LINE>for (InputStream inputStream : args.getStreams()) {<NEW_LINE>this.serviceParserInstance.parser(inputStream);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.serviceFiles = new HashMap<>();<NEW_LINE>for (File settingsServiceFile : settingsServiceFiles) {<NEW_LINE>if (!settingsServiceFile.exists()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.serviceParserInstance.parser(new FileInputStream(settingsServiceFile));<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>serviceFiles.put(settingsServiceFile.getAbsolutePath(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Symfony2ProjectComponent.getLogger().info("update: " + serviceParser.getName());<NEW_LINE>return (T) this.serviceParserInstance;<NEW_LINE>}
), settingsServiceFile.lastModified());
744,178
private static void validateScoresDoNotDecreaseWithFreq(Version indexCreatedVersion, Similarity similarity) throws IOException {<NEW_LINE>CollectionStatistics collectionStats = new CollectionStatistics("some_field", 1200, 1100, 3000, 2000);<NEW_LINE>TermStatistics termStats = new TermStatistics(new BytesRef("some_value"), 100, 130);<NEW_LINE>SimWeight simWeight = similarity.computeWeight(2f, collectionStats, termStats);<NEW_LINE>FieldInvertState state = new // length = 20, no overlap<NEW_LINE>FieldInvertState(// length = 20, no overlap<NEW_LINE>indexCreatedVersion.luceneVersion.major, // length = 20, no overlap<NEW_LINE>"some_field", // length = 20, no overlap<NEW_LINE>20, // length = 20, no overlap<NEW_LINE>20, // length = 20, no overlap<NEW_LINE>0, 50);<NEW_LINE>final long norm = similarity.computeNorm(state);<NEW_LINE>LeafReader reader = new SingleNormLeafReader(norm);<NEW_LINE>SimScorer scorer = similarity.simScorer(simWeight, reader.getContext());<NEW_LINE>float previousScore = Float.NEGATIVE_INFINITY;<NEW_LINE>for (int freq = 1; freq <= 10; ++freq) {<NEW_LINE>float score = <MASK><NEW_LINE>if (score < previousScore) {<NEW_LINE>DEPRECATION_LOGGER.deprecated("Similarity scores should not decrease when term frequency increases:\n" + scorer.explain(0, Explanation.match(freq - 1, "term freq")) + "\n" + scorer.explain(0, Explanation.match(freq, "term freq")));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>previousScore = score;<NEW_LINE>}<NEW_LINE>}
scorer.score(0, freq);
1,797,924
private void saveParametersToDB0(@NonNull final PInstanceId pinstanceId, final List<ProcessInfoParameter> piParams) {<NEW_LINE>// exit if this ProcessInfo has no Parameters<NEW_LINE>if (piParams == null || piParams.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Retrieve parameters from the database, indexed by ParameterName<NEW_LINE>final Map<String, I_AD_PInstance_Para> adPInstanceParams = retrieveAD_PInstance_Params(pinstanceId).stream().collect(GuavaCollectors.toImmutableMapByKey(I_AD_PInstance_Para::getParameterName));<NEW_LINE>//<NEW_LINE>// Find out which is the last SeqNo<NEW_LINE>int lastSeqNo = adPInstanceParams.values().stream().mapToInt(I_AD_PInstance_Para::getSeqNo).max().orElse(0);<NEW_LINE>// Iterate through the ProcessInfo's Parameters and decide if they have to be created or can be overwritten.<NEW_LINE>for (final ProcessInfoParameter piParam : piParams) {<NEW_LINE>I_AD_PInstance_Para adPInstanceParam = adPInstanceParams.<MASK><NEW_LINE>if (// if this Parameter is not yet existing in the DB<NEW_LINE>adPInstanceParam == null) {<NEW_LINE>final int seqNo = lastSeqNo + 10;<NEW_LINE>adPInstanceParam = createAD_PInstance_Para(pinstanceId, piParam, seqNo);<NEW_LINE>lastSeqNo = adPInstanceParam.getSeqNo();<NEW_LINE>} else {<NEW_LINE>updateAD_PInstance_Para(adPInstanceParam, piParam);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(piParam.getParameterName());
703,388
private ExternallyReferencedCandidate forRecord(@NonNull final I_C_Invoice_Candidate icRecord) {<NEW_LINE>final ExternallyReferencedCandidateBuilder candidate = ExternallyReferencedCandidate.builder();<NEW_LINE>candidate.orgId(OrgId.ofRepoId(icRecord.getAD_Org_ID())).id(InvoiceCandidateId.ofRepoId(icRecord.getC_Invoice_Candidate_ID())).externalHeaderId(ExternalId.ofOrNull(icRecord.getExternalHeaderId())).externalLineId(ExternalId.ofOrNull(icRecord.getExternalLineId()));<NEW_LINE>candidate.poReference(icRecord.getPOReference());<NEW_LINE>final BPartnerId bpartnerId = BPartnerId.ofRepoId(icRecord.getBill_BPartner_ID());<NEW_LINE>final BPartnerInfo bpartnerInfo = BPartnerInfo.builder().bpartnerId(bpartnerId).bpartnerLocationId(BPartnerLocationId.ofRepoId(bpartnerId, icRecord.getBill_Location_ID())).contactId(BPartnerContactId.ofRepoIdOrNull(bpartnerId, icRecord.getBill_User_ID())).build();<NEW_LINE>candidate.billPartnerInfo(bpartnerInfo);<NEW_LINE>candidate.dateOrdered(TimeUtil.asLocalDate(icRecord.getDateOrdered()));<NEW_LINE>candidate.presetDateInvoiced(TimeUtil.asLocalDate(icRecord.getPresetDateInvoiced()));<NEW_LINE>candidate.invoiceRule(InvoiceRule.ofCode(icRecord.getInvoiceRule())).invoiceRuleOverride(InvoiceRule.ofNullableCode(icRecord.getInvoiceRule_Override()));<NEW_LINE>// the column is not mandatory in the DB, but still<NEW_LINE>final ProductId productId = ProductId.<MASK><NEW_LINE>candidate.productId(productId);<NEW_LINE>candidate.pricingSystemId(PricingSystemId.ofRepoId(icRecord.getM_PricingSystem_ID())).priceListVersionId(PriceListVersionId.ofRepoIdOrNull(icRecord.getM_PriceList_Version_ID()));<NEW_LINE>final ProductPrice priceEntered = invoiceCandBL.getPriceEntered(icRecord);<NEW_LINE>candidate.priceEntered(priceEntered);<NEW_LINE>final ProductPrice priceEnteredOverride = invoiceCandBL.getPriceEnteredOverride(icRecord).orElse(null);<NEW_LINE>candidate.priceEnteredOverride(priceEnteredOverride);<NEW_LINE>candidate.discount(Percent.ofNullable(icRecord.getDiscount())).discountOverride(Percent.ofNullable(icRecord.getDiscount_Override()));<NEW_LINE>candidate.priceActual(invoiceCandBL.getPriceActual(icRecord));<NEW_LINE>final StockQtyAndUOMQty qtyDelivered = StockQtyAndUOMQtys.create(icRecord.getQtyDelivered(), productId, icRecord.getQtyDeliveredInUOM(), UomId.ofRepoId(icRecord.getC_UOM_ID()));<NEW_LINE>candidate.qtyDelivered(qtyDelivered);<NEW_LINE>final StockQtyAndUOMQty qtyOrdered = StockQtyAndUOMQtys.create(icRecord.getQtyOrdered(), productId, icRecord.getQtyEntered(), UomId.ofRepoId(icRecord.getC_UOM_ID()));<NEW_LINE>candidate.qtyOrdered(qtyOrdered);<NEW_LINE>candidate.soTrx(SOTrx.ofBoolean(icRecord.isSOTrx()));<NEW_LINE>candidate.invoiceDocTypeId(DocTypeId.ofRepoIdOrNull(icRecord.getC_DocTypeInvoice_ID()));<NEW_LINE>candidate.invoicingUomId(UomId.ofRepoId(icRecord.getC_UOM_ID()));<NEW_LINE>candidate.lineDescription(icRecord.getDescription());<NEW_LINE>candidate.taxId(TaxId.ofRepoId(icRecord.getC_Tax_ID()));<NEW_LINE>return candidate.build();<NEW_LINE>}
ofRepoId(icRecord.getM_Product_ID());
1,147,779
final EnableMacieResult executeEnableMacie(EnableMacieRequest enableMacieRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableMacieRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableMacieRequest> request = null;<NEW_LINE>Response<EnableMacieResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableMacieRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableMacieRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableMacie");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableMacieResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableMacieResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);
895,550
public void onFogUpdate(EntityViewRenderEvent.RenderFogEvent event) {<NEW_LINE>Entity e = event.getInfo().getEntity();<NEW_LINE>if (e instanceof LivingEntity && ((LivingEntity) e).hasEffect(IEPotions.flashed)) {<NEW_LINE>MobEffectInstance effect = ((LivingEntity) e).getEffect(IEPotions.flashed);<NEW_LINE><MASK><NEW_LINE>// Total Time = 4s + 2s per amplifier<NEW_LINE>float saturation = Math.max(0.25f, 1 - timeLeft / (float) (80 + 40 * effect.getAmplifier()));<NEW_LINE>float f1 = -2.5f + 15.0F * saturation;<NEW_LINE>if (timeLeft < 20)<NEW_LINE>f1 += (event.getFarPlaneDistance() / 4) * (1 - timeLeft / 20f);<NEW_LINE>RenderSystem.fogStart(0.25f * f1);<NEW_LINE>RenderSystem.fogEnd(f1);<NEW_LINE>RenderSystem.fogMode(GlStateManager.FogMode.LINEAR);<NEW_LINE>RenderSystem.setupNvFogDistance();<NEW_LINE>}<NEW_LINE>}
int timeLeft = effect.getDuration();
405,074
static String toJavaName(String opensslName) {<NEW_LINE>if (opensslName == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Matcher matcher = PATTERN.matcher(opensslName);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>String group1 = matcher.group(1);<NEW_LINE>if (group1 != null) {<NEW_LINE>return group1.toUpperCase(Locale.ROOT) + "with" + matcher.group(2<MASK><NEW_LINE>}<NEW_LINE>if (matcher.group(3) != null) {<NEW_LINE>return matcher.group(4).toUpperCase(Locale.ROOT) + "with" + matcher.group(3).toUpperCase(Locale.ROOT);<NEW_LINE>}<NEW_LINE>if (matcher.group(5) != null) {<NEW_LINE>return matcher.group(6).toUpperCase(Locale.ROOT) + "with" + matcher.group(5).toUpperCase(Locale.ROOT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
).toUpperCase(Locale.ROOT);
443,219
final DeleteWorkspaceResult executeDeleteWorkspace(DeleteWorkspaceRequest deleteWorkspaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteWorkspaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteWorkspaceRequest> request = null;<NEW_LINE>Response<DeleteWorkspaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteWorkspaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteWorkspaceRequest));<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, "IoTTwinMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteWorkspace");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = <MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteWorkspaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteWorkspaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);