idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
726,815
private static void withinStyle(StringBuilder out, CharSequence text, int start, int end) {<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>char c = text.charAt(i);<NEW_LINE>if (c == '<') {<NEW_LINE>out.append("&lt;");<NEW_LINE>} else if (c == '>') {<NEW_LINE>out.append("&gt;");<NEW_LINE>} else if (c == '&') {<NEW_LINE>out.append("&amp;");<NEW_LINE>} else if (c >= 0xD800 && c <= 0xDFFF) {<NEW_LINE>if (c < 0xDC00 && i + 1 < end) {<NEW_LINE>char d = text.charAt(i + 1);<NEW_LINE>if (d >= 0xDC00 && d <= 0xDFFF) {<NEW_LINE>i++;<NEW_LINE>int codepoint = 0x010000 | c <MASK><NEW_LINE>out.append("&#").append(codepoint).append(";");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (c > 0x7E || c < ' ') {<NEW_LINE>out.append("&#").append((int) c).append(";");<NEW_LINE>} else if (c == ' ') {<NEW_LINE>while (i + 1 < end && text.charAt(i + 1) == ' ') {<NEW_LINE>out.append("&nbsp;");<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>out.append(' ');<NEW_LINE>} else {<NEW_LINE>out.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
- 0xD800 << 10 | d - 0xDC00;
1,250,509
private static BakedQuad putQuad(Transformation transform, Direction side, TextureAtlasSprite sprite, int color, int tint, float x1, float y1, float x2, float y2, float z, float u1, float v1, float u2, float v2, int luminosity) {<NEW_LINE>BakedQuadBuilder builder = new BakedQuadBuilder(sprite);<NEW_LINE>builder.setQuadTint(tint);<NEW_LINE>builder.setQuadOrientation(side);<NEW_LINE>builder.setApplyDiffuseLighting(luminosity == 0);<NEW_LINE>// only apply the transform if it's not identity<NEW_LINE>boolean hasTransform = !transform.isIdentity();<NEW_LINE>IVertexConsumer consumer = hasTransform ? new TRSRTransformer(builder, transform) : builder;<NEW_LINE>if (side == Direction.SOUTH) {<NEW_LINE>putVertex(consumer, side, x1, y1, z, u1, v2, color, luminosity);<NEW_LINE>putVertex(consumer, side, x2, y1, z, u2, v2, color, luminosity);<NEW_LINE>putVertex(consumer, side, x2, y2, z, u2, v1, color, luminosity);<NEW_LINE>putVertex(consumer, side, x1, y2, z, u1, v1, color, luminosity);<NEW_LINE>} else {<NEW_LINE>putVertex(consumer, side, x1, y1, z, u1, v2, color, luminosity);<NEW_LINE>putVertex(consumer, side, x1, y2, z, u1, v1, color, luminosity);<NEW_LINE>putVertex(consumer, side, x2, y2, z, u2, v1, color, luminosity);<NEW_LINE>putVertex(consumer, side, x2, y1, z, <MASK><NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
u2, v2, color, luminosity);
601,542
private CallTree selectInRootNodeList(final NodeList rootNodeList, boolean bestMatchingState) {<NEW_LINE>// in root list<NEW_LINE>if (rootNodeList.size() == 1) {<NEW_LINE>logger.info("Select root span in top node list");<NEW_LINE>final Node node = rootNodeList.get(0);<NEW_LINE>if (bestMatchingState) {<NEW_LINE>traceState.complete();<NEW_LINE>} else {<NEW_LINE>traceState.progress();<NEW_LINE>}<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>}<NEW_LINE>// find focus<NEW_LINE>final NodeList focusNodeList = <MASK><NEW_LINE>if (focusNodeList.size() == 1) {<NEW_LINE>logger.info("Select root & focus span in top node list");<NEW_LINE>final Node node = focusNodeList.get(0);<NEW_LINE>traceState.progress();<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>} else if (focusNodeList.size() > 1) {<NEW_LINE>logger.info("Select first root & focus span in top node list");<NEW_LINE>final Node node = focusNodeList.get(0);<NEW_LINE>traceState.progress();<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>}<NEW_LINE>// not found focus<NEW_LINE>logger.info("Select first root span in top node list, not found focus span");<NEW_LINE>final Node node = rootNodeList.get(0);<NEW_LINE>traceState.progress();<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>}
rootNodeList.filter(this.focusFilter);
405,768
final CancelHandshakeResult executeCancelHandshake(CancelHandshakeRequest cancelHandshakeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelHandshakeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelHandshakeRequest> request = null;<NEW_LINE>Response<CancelHandshakeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelHandshakeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelHandshakeRequest));<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, "Organizations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelHandshake");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelHandshakeResult>> 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 CancelHandshakeResultJsonUnmarshaller());
708,997
public void dragEnter(DropTargetEvent event) {<NEW_LINE>// no event.data on dragOver, use drag_drop_line_start to determine<NEW_LINE>// if ours<NEW_LINE>lastScrollTime = 0;<NEW_LINE>if (drag_drop_location_start < 0) {<NEW_LINE>if (event.detail != DND.DROP_COPY) {<NEW_LINE>if ((event.operations & DND.DROP_LINK) > 0)<NEW_LINE>event.detail = DND.DROP_LINK;<NEW_LINE>else if ((event.operations & DND.DROP_COPY) > 0)<NEW_LINE>event.detail = DND.DROP_COPY;<NEW_LINE>}<NEW_LINE>} else if (TextTransfer.getInstance().isSupportedType(event.currentDataType)) {<NEW_LINE>event.detail = tv.getTableRowWithCursor() == null <MASK><NEW_LINE>// DND.FEEDBACK_SCROLL;<NEW_LINE>event.feedback = DND.FEEDBACK_NONE;<NEW_LINE>enterPoint = new Point(event.x, event.y);<NEW_LINE>}<NEW_LINE>}
? DND.DROP_NONE : DND.DROP_MOVE;
392,195
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.skill_condition__ringer_mode, container, false);<NEW_LINE>rg_ringer_mode = view.findViewById(R.id.rg_ringer_mode);<NEW_LINE>rb_ringer_mode_silent = view.findViewById(R.id.rb_ringer_mode_silent);<NEW_LINE>rb_ringer_mode_vibrate = view.findViewById(R.id.rb_ringer_mode_vibrate);<NEW_LINE>rb_ringer_mode_normal = view.<MASK><NEW_LINE>rg_volume_match_type = view.findViewById(R.id.rg_volume_match_type);<NEW_LINE>rb_volume_match_above = view.findViewById(R.id.rb_volume_match_above);<NEW_LINE>rb_volume_match_below = view.findViewById(R.id.rb_volume_match_below);<NEW_LINE>rb_volume_match_equals = view.findViewById(R.id.rb_volume_match_equals);<NEW_LINE>sb_volume_match_value = view.findViewById(R.id.sb_volume_match_value);<NEW_LINE>tv_volume_match_value = view.findViewById(R.id.tv_volume_match_value);<NEW_LINE>AudioManager am = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);<NEW_LINE>setRingerOptionsState();<NEW_LINE>rg_ringer_mode.setOnCheckedChangeListener((group, checkedId) -> {<NEW_LINE>setRingerOptionsState();<NEW_LINE>});<NEW_LINE>int maxVol = (am != null) ? am.getStreamMaxVolume(AudioManager.STREAM_RING) : 0;<NEW_LINE>sb_volume_match_value.setMax(maxVol);<NEW_LINE>sb_volume_match_value.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {<NEW_LINE>tv_volume_match_value.setText(String.valueOf(progress));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStopTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tv_volume_match_value.setText(String.valueOf(sb_volume_match_value.getProgress()));<NEW_LINE>return view;<NEW_LINE>}
findViewById(R.id.rb_ringer_mode_normal);
997,793
public final Result applyFilter(@Nonnull String line, int entireLength) {<NEW_LINE>List<FileHyperlinkRawData> links;<NEW_LINE>try {<NEW_LINE>links = parse(line);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LOG.error("Failed to parse '" + line + "' with " + getClass(), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Filter.ResultItem> items = new ArrayList<>();<NEW_LINE>for (FileHyperlinkRawData link : links) {<NEW_LINE>String filePath = FileUtil.toSystemIndependentName(link.getFilePath());<NEW_LINE>if (StringUtil.isEmptyOrSpaces(filePath))<NEW_LINE>continue;<NEW_LINE>VirtualFile file = findFile(filePath);<NEW_LINE>HyperlinkInfo info = null;<NEW_LINE>boolean grayedHyperLink = false;<NEW_LINE>if (file != null) {<NEW_LINE>info = new OpenFileHyperlinkInfo(myProject, file, link.getDocumentLine(), link.getDocumentColumn());<NEW_LINE>grayedHyperLink = isGrayedHyperlink(file);<NEW_LINE>} else if (supportVfsRefresh()) {<NEW_LINE>File ioFile = findIoFile(filePath);<NEW_LINE>if (ioFile != null) {<NEW_LINE>info = new MyFileHyperlinkInfo(ioFile, link.getDocumentLine(), link.getDocumentColumn());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (info != null) {<NEW_LINE>int offset = entireLength - line.length();<NEW_LINE>items.add(new Filter.ResultItem(offset + link.getHyperlinkStartInd(), offset + link.getHyperlinkEndInd(), info, grayedHyperLink));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return items.isEmpty() <MASK><NEW_LINE>}
? null : new Result(items);
1,037,717
public void doAbout(ActionEvent ae) {<NEW_LINE>Debug.log(3, "doAbout: selected");<NEW_LINE>EditorPane cp = SikulixIDE.get().getCurrentCodePane();<NEW_LINE>final SikulixIDE.PaneContext cx = cp.context;<NEW_LINE>if (cp.isTemp()) {<NEW_LINE>(new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Region at = Mouse.at().offset(100, 52).grow(10);<NEW_LINE>((RobotDesktop) at.getScreen().getRobot()).moveMouse(at.getCenter().x, at.getCenter().y + 20);<NEW_LINE>SX.popup(String.format("%s file --- not yet saved", cx.getRunner().getName()), "IDE: About: script info", "", false, 4, at);<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>} else {<NEW_LINE>String msg;<NEW_LINE>if (cp.isBundle()) {<NEW_LINE>msg = String.format("Bundle: %s\n%s Script: %s\nImages: %s", cx.getFileName(), cx.getRunner().getName(), cx.getFile(), cx.getImageFolder());<NEW_LINE>} else if (!cp.isText()) {<NEW_LINE>msg = String.format("%s script: %s\nin Folder: %s\nImages: %s", cp.getRunner().getName(), cx.getFileName(), cx.getFolder(<MASK><NEW_LINE>} else {<NEW_LINE>msg = String.format("%s file: %s\nin Folder: %s", cp.getRunner().getName(), cx.getFileName(), cx.getFolder());<NEW_LINE>}<NEW_LINE>showAbout(cp, msg);<NEW_LINE>}<NEW_LINE>}
), cx.getImageFolder());
218,177
public void applyParameters(MotionWidget view) {<NEW_LINE>this.mVisibility = view.getVisibility();<NEW_LINE>this.mAlpha = (view.getVisibility() != MotionWidget.VISIBLE) ? 0.0f : view.getAlpha();<NEW_LINE>// TODO figure a way to cache parameters<NEW_LINE>this.mApplyElevation = false;<NEW_LINE>this<MASK><NEW_LINE>this.mRotationX = view.getRotationX();<NEW_LINE>this.rotationY = view.getRotationY();<NEW_LINE>this.mScaleX = view.getScaleX();<NEW_LINE>this.mScaleY = view.getScaleY();<NEW_LINE>this.mPivotX = view.getPivotX();<NEW_LINE>this.mPivotY = view.getPivotY();<NEW_LINE>this.mTranslationX = view.getTranslationX();<NEW_LINE>this.mTranslationY = view.getTranslationY();<NEW_LINE>this.mTranslationZ = view.getTranslationZ();<NEW_LINE>Set<String> at = view.getCustomAttributeNames();<NEW_LINE>for (String s : at) {<NEW_LINE>CustomVariable attr = view.getCustomAttribute(s);<NEW_LINE>if (attr != null && attr.isContinuous()) {<NEW_LINE>this.mCustomVariable.put(s, attr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.mRotation = view.getRotationZ();
551,632
static void dissectCatalogResize(final MutableDirectBuffer buffer, final int offset, final StringBuilder builder) {<NEW_LINE>int absoluteOffset = offset;<NEW_LINE>absoluteOffset += dissectLogHeader(CONTEXT, CATALOG_RESIZE, buffer, absoluteOffset, builder);<NEW_LINE>final int maxEntries = buffer.getInt(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_INT;<NEW_LINE>final long catalogLength = <MASK><NEW_LINE>absoluteOffset += SIZE_OF_LONG;<NEW_LINE>final int newMaxEntries = buffer.getInt(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_INT;<NEW_LINE>final long newCatalogLength = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>builder.append(": ").append(maxEntries);<NEW_LINE>builder.append(" entries (").append(catalogLength).append(" bytes)");<NEW_LINE>builder.append(" => ").append(newMaxEntries);<NEW_LINE>builder.append(" entries (").append(newCatalogLength).append(" bytes)");<NEW_LINE>}
buffer.getLong(absoluteOffset, LITTLE_ENDIAN);
1,186,579
private static ConfiguredFeature<ResizableOreFeatureConfig, ResizableOreFeature> configureOreFeature(OreVeinType oreVeinType, FeatureRegistryObject<ResizableOreFeatureConfig, ? extends ResizableOreFeature> featureRO) {<NEW_LINE>OreVeinConfig oreVeinConfig = MekanismConfig.world.getVeinConfig(oreVeinType);<NEW_LINE>List<TargetBlockState> targetStates = ORE_STONE_TARGETS.computeIfAbsent(oreVeinType.type(), oreType -> {<NEW_LINE>OreBlockType oreBlockType = MekanismBlocks.ORES.get(oreType);<NEW_LINE>return List.of(OreConfiguration.target(OreFeatures.STONE_ORE_REPLACEABLES, oreBlockType.stoneBlock().defaultBlockState()), OreConfiguration.target(OreFeatures.DEEPSLATE_ORE_REPLACEABLES, oreBlockType.deepslateBlock().defaultBlockState()));<NEW_LINE>});<NEW_LINE>return new ConfiguredFeature<>(featureRO.get(), new ResizableOreFeatureConfig(targetStates, oreVeinType, oreVeinConfig.maxVeinSize()<MASK><NEW_LINE>}
, oreVeinConfig.discardChanceOnAirExposure()));
1,445,126
final RestoreServerResult executeRestoreServer(RestoreServerRequest restoreServerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(restoreServerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RestoreServerRequest> request = null;<NEW_LINE>Response<RestoreServerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RestoreServerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(restoreServerRequest));<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, "OpsWorksCM");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RestoreServerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RestoreServerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "RestoreServer");
1,801,397
private void importDatabase(final String airbyteVersion, final String targetSchema, final Map<JobsDatabaseSchema, Stream<JsonNode>> data, final boolean incrementalImport) throws IOException {<NEW_LINE>if (!data.isEmpty()) {<NEW_LINE>createSchema(BACKUP_SCHEMA);<NEW_LINE>jobDatabase.transaction(ctx -> {<NEW_LINE>// obtain locks on all tables first, to prevent deadlocks<NEW_LINE>for (final JobsDatabaseSchema tableType : data.keySet()) {<NEW_LINE>ctx.execute(String.format("LOCK TABLE %s IN ACCESS EXCLUSIVE MODE", tableType.name()));<NEW_LINE>}<NEW_LINE>for (final JobsDatabaseSchema tableType : data.keySet()) {<NEW_LINE>if (!incrementalImport) {<NEW_LINE>truncateTable(ctx, targetSchema, tableType.name(), BACKUP_SCHEMA);<NEW_LINE>}<NEW_LINE>importTable(ctx, targetSchema, tableType<MASK><NEW_LINE>}<NEW_LINE>registerImportMetadata(ctx, airbyteVersion);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// TODO write "import success vXX on now()" to audit log table?<NEW_LINE>}
, data.get(tableType));
988,675
private static Map<String, SearchDefinition> toSearchDefinitions(IndexInfoConfig c) {<NEW_LINE>Map<String, SearchDefinition> searchDefinitions = new HashMap<>();<NEW_LINE>for (Iterator<IndexInfoConfig.Indexinfo> i = c.indexinfo().iterator(); i.hasNext(); ) {<NEW_LINE>IndexInfoConfig.<MASK><NEW_LINE>SearchDefinition sd = new SearchDefinition(info.name());<NEW_LINE>for (Iterator<IndexInfoConfig.Indexinfo.Command> j = info.command().iterator(); j.hasNext(); ) {<NEW_LINE>IndexInfoConfig.Indexinfo.Command command = j.next();<NEW_LINE>sd.addCommand(command.indexname(), command.command());<NEW_LINE>}<NEW_LINE>searchDefinitions.put(info.name(), sd);<NEW_LINE>}<NEW_LINE>for (IndexInfoConfig.Indexinfo info : c.indexinfo()) {<NEW_LINE>SearchDefinition sd = searchDefinitions.get(info.name());<NEW_LINE>for (IndexInfoConfig.Indexinfo.Alias alias : info.alias()) {<NEW_LINE>String aliasString = alias.alias();<NEW_LINE>String indexString = alias.indexname();<NEW_LINE>sd.addAlias(aliasString, indexString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return searchDefinitions;<NEW_LINE>}
Indexinfo info = i.next();
1,567,344
private void okPressed() {<NEW_LINE>if (editable) {<NEW_LINE>X500Name dn = distinguishedNameChooser.getDN();<NEW_LINE>if (dn == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (dn.toString().isEmpty()) {<NEW_LINE>JOptionPane.showMessageDialog(this, res.getString("DDistinguishedNameChooser.ValueReqAtLeastOneField.message"), getTitle(), JOptionPane.WARNING_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (RDN rdn : dn.getRDNs(BCStyle.C)) {<NEW_LINE>String countryCode = rdn.getFirst().getValue().toString();<NEW_LINE>if ((countryCode != null) && (countryCode.length() != 2)) {<NEW_LINE>JOptionPane.showMessageDialog(this, res.getString("DDistinguishedNameChooser.CountryCodeTwoChars.message"), <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>distinguishedName = dn;<NEW_LINE>}<NEW_LINE>closeDialog();<NEW_LINE>}
getTitle(), JOptionPane.WARNING_MESSAGE);
673,463
private void addSortToPipeline(BasicDBObject orderBy, BasicDBObject aggregation, boolean hasLob, List<DBObject> pipeline) {<NEW_LINE>BasicDBObject actual = new BasicDBObject();<NEW_LINE>for (String key : orderBy.keySet()) {<NEW_LINE>if (aggregation.containsField(key)) {<NEW_LINE>actual.put(key, orderBy.get(key));<NEW_LINE>} else if (aggregation.containsField("_id")) {<NEW_LINE>if (((BasicDBObject) aggregation.get("_id")).containsField(key)) {<NEW_LINE>actual.put("_id"<MASK><NEW_LINE>} else if (hasLob && key.startsWith("metadata.")) {<NEW_LINE>// check the key without the "metadata." prefix for GridFS<NEW_LINE>if (((BasicDBObject) aggregation.get("_id")).containsField(key.substring(9))) {<NEW_LINE>actual.put("_id", orderBy.get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (actual.size() > 0) {<NEW_LINE>pipeline.add(new BasicDBObject("$sort", actual));<NEW_LINE>}<NEW_LINE>}
, orderBy.get(key));
1,297,709
public static final long[] readThisLongArrayXml(XmlPullParser parser, String endTag, String[] name) throws XmlPullParserException, java.io.IOException {<NEW_LINE>int num;<NEW_LINE>try {<NEW_LINE>num = Integer.parseInt(parser.getAttributeValue(null, "num"));<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>throw new XmlPullParserException("Need num attribute in long-array");<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new XmlPullParserException("Not a number in num attribute in long-array");<NEW_LINE>}<NEW_LINE>parser.next();<NEW_LINE>long[] array = new long[num];<NEW_LINE>int i = 0;<NEW_LINE>int eventType = parser.getEventType();<NEW_LINE>do {<NEW_LINE>if (eventType == parser.START_TAG) {<NEW_LINE>if (parser.getName().equals("item")) {<NEW_LINE>try {<NEW_LINE>array[i] = Long.parseLong(parser.getAttributeValue(null, "value"));<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>throw new XmlPullParserException("Need value attribute in item");<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new XmlPullParserException("Not a number in value attribute in item");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new XmlPullParserException(<MASK><NEW_LINE>}<NEW_LINE>} else if (eventType == parser.END_TAG) {<NEW_LINE>if (parser.getName().equals(endTag)) {<NEW_LINE>return array;<NEW_LINE>} else if (parser.getName().equals("item")) {<NEW_LINE>i++;<NEW_LINE>} else {<NEW_LINE>throw new XmlPullParserException("Expected " + endTag + " end tag at: " + parser.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>eventType = parser.next();<NEW_LINE>} while (eventType != parser.END_DOCUMENT);<NEW_LINE>throw new XmlPullParserException("Document ended before " + endTag + " end tag");<NEW_LINE>}
"Expected item tag at: " + parser.getName());
1,056,140
private Mono<PagedResponse<WorkspaceInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
761,486
private void loadNode345() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ExclusiveLimitStateMachineType_HighHigh_StateNumber, new QualifiedName(0, "StateNumber"), new LocalizedText("en", "StateNumber"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitStateMachineType_HighHigh_StateNumber, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitStateMachineType_HighHigh_StateNumber, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitStateMachineType_HighHigh_StateNumber, Identifiers.HasProperty, Identifiers.ExclusiveLimitStateMachineType_HighHigh.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
(1), 0.0, false);
799,371
public int extractFluid(IFluidHandler fluidHandler, EnumFacing side) {<NEW_LINE>int amount = fluidToExtract > transport.getFlowRate() ? transport.getFlowRate() : fluidToExtract;<NEW_LINE>FluidTankInfo tankInfo = transport.getTankInfo(side)[0];<NEW_LINE>FluidStack extracted;<NEW_LINE>if (tankInfo.fluid != null) {<NEW_LINE>extracted = fluidHandler.drain(side.getOpposite(), new FluidStack(tankInfo.fluid, amount), false);<NEW_LINE>} else {<NEW_LINE>extracted = fluidHandler.drain(side.getOpposite(), amount, false);<NEW_LINE>}<NEW_LINE>int inserted = 0;<NEW_LINE>if (extracted != null) {<NEW_LINE>inserted = transport.<MASK><NEW_LINE>if (inserted > 0) {<NEW_LINE>extracted.amount = inserted;<NEW_LINE>fluidHandler.drain(side.getOpposite(), extracted, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return inserted;<NEW_LINE>}
fill(side, extracted, true);
1,489,877
private static final int packedNybblesToInt(ByteBuf buffer, int offset, int startNybble, int numberOfNybbles) {<NEW_LINE>int value = 0;<NEW_LINE>int i = startNybble / 2;<NEW_LINE>if ((startNybble % 2) != 0) {<NEW_LINE>// process low nybble of the first byte if necessary.<NEW_LINE>value += buffer.getByte(offset + i) & 0x0F;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (; i < (endNybble + 1) / 2; i++) {<NEW_LINE>// high nybble.<NEW_LINE>value = value * 10 + ((buffer.getByte(offset + i) & 0xF0) >>> 4);<NEW_LINE>// low nybble.<NEW_LINE>value = value * 10 + (buffer.getByte(offset + i) & 0x0F);<NEW_LINE>}<NEW_LINE>if ((endNybble % 2) == 0) {<NEW_LINE>// process high nybble of the last byte if necessary.<NEW_LINE>value = value * 10 + ((buffer.getByte(offset + i) & 0xF0) >>> 4);<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
int endNybble = startNybble + numberOfNybbles - 1;
1,558,696
private void saveSettings(WizardDescriptor wizard) {<NEW_LINE>JUnitSettings settings = JUnitSettings.getDefault();<NEW_LINE>settings.setMembersPublic(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_PUBLIC)));<NEW_LINE>settings.setMembersProtected(Boolean.TRUE.equals(wizard.<MASK><NEW_LINE>settings.setMembersPackage(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_PACKAGE)));<NEW_LINE>settings.setGenerateSetUp(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_SETUP)));<NEW_LINE>settings.setGenerateTearDown(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_TEARDOWN)));<NEW_LINE>settings.setGenerateClassSetUp(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_BEFORE_CLASS)));<NEW_LINE>settings.setGenerateClassTearDown(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_AFTER_CLASS)));<NEW_LINE>settings.setBodyContent(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_METHOD_BODIES)));<NEW_LINE>settings.setJavaDoc(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_JAVADOC)));<NEW_LINE>settings.setBodyComments(Boolean.TRUE.equals(wizard.getProperty(GuiUtils.CHK_HINTS)));<NEW_LINE>}
getProperty(GuiUtils.CHK_PROTECTED)));
99,339
private void paintAvailableColumns(PaintTarget target) throws PaintException {<NEW_LINE>if (columnCollapsingAllowed) {<NEW_LINE>final HashSet<Object> collapsedCols <MASK><NEW_LINE>for (Object colId : visibleColumns) {<NEW_LINE>if (isColumnCollapsed(colId)) {<NEW_LINE>collapsedCols.add(colId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String[] collapsedKeys = new String[collapsedCols.size()];<NEW_LINE>int nextColumn = 0;<NEW_LINE>for (Object colId : visibleColumns) {<NEW_LINE>if (isColumnCollapsed(colId)) {<NEW_LINE>collapsedKeys[nextColumn++] = columnIdMap.key(colId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>target.addVariable(this, "collapsedcolumns", collapsedKeys);<NEW_LINE>final String[] noncollapsibleKeys = new String[noncollapsibleColumns.size()];<NEW_LINE>nextColumn = 0;<NEW_LINE>for (Object colId : noncollapsibleColumns) {<NEW_LINE>noncollapsibleKeys[nextColumn++] = columnIdMap.key(colId);<NEW_LINE>}<NEW_LINE>target.addVariable(this, "noncollapsiblecolumns", noncollapsibleKeys);<NEW_LINE>}<NEW_LINE>}
= new HashSet<Object>();
231,862
private void registerListener(AccessServiceConfig accessServiceConfigurationProperties, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector repositoryConnector, AuditLog auditLog) throws OMAGConfigurationErrorException {<NEW_LINE><MASK><NEW_LINE>String serviceName = accessServiceConfigurationProperties.getAccessServiceName();<NEW_LINE>OpenMetadataTopicConnector outTopicConnector = super.getOutTopicEventBusConnector(outTopicConnection, accessServiceConfigurationProperties.getAccessServiceName(), auditLog);<NEW_LINE>List<String> supportedZones = this.extractSupportedZones(accessServiceConfigurationProperties.getAccessServiceOptions(), serviceName, auditLog);<NEW_LINE>List<String> supportedTypesForSearch = getSupportedTypesForSearchOption(accessServiceConfigurationProperties);<NEW_LINE>AssetCatalogOMRSTopicListener omrsTopicListener = new AssetCatalogOMRSTopicListener(serviceName, auditLog, outTopicConnector, repositoryConnector.getRepositoryHelper(), repositoryConnector.getRepositoryValidator(), serverName, supportedZones, supportedTypesForSearch);<NEW_LINE>super.registerWithEnterpriseTopic(serviceName, serverName, enterpriseOMRSTopicConnector, omrsTopicListener, auditLog);<NEW_LINE>}
Connection outTopicConnection = accessServiceConfigurationProperties.getAccessServiceOutTopic();
137,542
public void deleteCaseDefinitionAndRelatedData(String caseDefinitionId, boolean cascadeHistory) {<NEW_LINE>// Case instances<NEW_LINE>CaseInstanceEntityManager caseInstanceEntityManager = getCaseInstanceEntityManager();<NEW_LINE>CommandContext commandContext = Context.getCommandContext();<NEW_LINE>List<CaseInstance> caseInstances = caseInstanceEntityManager.findByCriteria(new CaseInstanceQueryImpl(commandContext, engineConfiguration).caseDefinitionId(caseDefinitionId));<NEW_LINE>for (CaseInstance caseInstance : caseInstances) {<NEW_LINE>caseInstanceEntityManager.delete(caseInstance.<MASK><NEW_LINE>}<NEW_LINE>if (cascadeHistory) {<NEW_LINE>engineConfiguration.getTaskServiceConfiguration().getHistoricTaskService().deleteHistoricTaskLogEntriesForScopeDefinition(ScopeTypes.CMMN, caseDefinitionId);<NEW_LINE>HistoricIdentityLinkEntityManager historicIdentityLinkEntityManager = getHistoricIdentityLinkEntityManager();<NEW_LINE>historicIdentityLinkEntityManager.deleteHistoricIdentityLinksByScopeDefinitionIdAndScopeType(caseDefinitionId, ScopeTypes.CMMN);<NEW_LINE>// Historic milestone<NEW_LINE>HistoricMilestoneInstanceEntityManager historicMilestoneInstanceEntityManager = getHistoricMilestoneInstanceEntityManager();<NEW_LINE>List<HistoricMilestoneInstance> historicMilestoneInstances = historicMilestoneInstanceEntityManager.findHistoricMilestoneInstancesByQueryCriteria(new HistoricMilestoneInstanceQueryImpl().milestoneInstanceCaseDefinitionId(caseDefinitionId));<NEW_LINE>for (HistoricMilestoneInstance historicMilestoneInstance : historicMilestoneInstances) {<NEW_LINE>historicMilestoneInstanceEntityManager.delete(historicMilestoneInstance.getId());<NEW_LINE>}<NEW_LINE>// Historic tasks<NEW_LINE>HistoricTaskInstanceEntityManager historicTaskInstanceEntityManager = getHistoricTaskInstanceEntityManager();<NEW_LINE>List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceEntityManager.findHistoricTaskInstancesByQueryCriteria(new HistoricTaskInstanceQueryImpl().scopeDefinitionId(caseDefinitionId).scopeType(ScopeTypes.CMMN));<NEW_LINE>for (HistoricTaskInstance historicTaskInstance : historicTaskInstances) {<NEW_LINE>TaskHelper.deleteHistoricTask(historicTaskInstance.getId(), engineConfiguration);<NEW_LINE>}<NEW_LINE>// Historic Plan Items<NEW_LINE>HistoricPlanItemInstanceEntityManager historicPlanItemInstanceEntityManager = getHistoricPlanItemInstanceEntityManager();<NEW_LINE>historicPlanItemInstanceEntityManager.findByCaseDefinitionId(caseDefinitionId).forEach(p -> historicPlanItemInstanceEntityManager.delete(p.getId()));<NEW_LINE>HistoricCaseInstanceEntityManager historicCaseInstanceEntityManager = getHistoricCaseInstanceEntityManager();<NEW_LINE>List<HistoricCaseInstance> historicCaseInstanceEntities = historicCaseInstanceEntityManager.findByCriteria(new HistoricCaseInstanceQueryImpl().caseDefinitionId(caseDefinitionId));<NEW_LINE>for (HistoricCaseInstance historicCaseInstanceEntity : historicCaseInstanceEntities) {<NEW_LINE>CmmnHistoryHelper.deleteHistoricCaseInstance(engineConfiguration, historicCaseInstanceEntity.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CaseDefinitionEntity caseDefinitionEntity = findById(caseDefinitionId);<NEW_LINE>delete(caseDefinitionEntity);<NEW_LINE>}
getId(), true, null);
1,513,198
public Answer dettachIso(final DettachCommand cmd) {<NEW_LINE>final DiskTO disk = cmd.getDisk();<NEW_LINE>final TemplateObjectTO isoTO = <MASK><NEW_LINE>final DataStoreTO store = isoTO.getDataStore();<NEW_LINE>try {<NEW_LINE>String dataStoreUrl = getDataStoreUrlFromStore(store);<NEW_LINE>final Connect conn = LibvirtConnection.getConnectionByVmName(cmd.getVmName());<NEW_LINE>attachOrDetachISO(conn, cmd.getVmName(), dataStoreUrl + File.separator + isoTO.getPath(), false, cmd.getParams());<NEW_LINE>} catch (final LibvirtException e) {<NEW_LINE>return new Answer(cmd, false, e.toString());<NEW_LINE>} catch (final URISyntaxException e) {<NEW_LINE>return new Answer(cmd, false, e.toString());<NEW_LINE>} catch (final InternalErrorException e) {<NEW_LINE>return new Answer(cmd, false, e.toString());<NEW_LINE>} catch (final InvalidParameterValueException e) {<NEW_LINE>return new Answer(cmd, false, e.toString());<NEW_LINE>}<NEW_LINE>return new Answer(cmd);<NEW_LINE>}
(TemplateObjectTO) disk.getData();
1,802,151
public static void addTermToTarget(Urn labelUrn, Urn targetUrn, String subResource, Urn actor, EntityService entityService) throws URISyntaxException {<NEW_LINE>if (subResource == null || subResource.equals("")) {<NEW_LINE>com.linkedin.common.GlossaryTerms terms = (com.linkedin.common.GlossaryTerms) getAspectFromEntity(targetUrn.toString(), GLOSSARY_TERM_ASPECT_NAME, entityService, new GlossaryTerms());<NEW_LINE>terms<MASK><NEW_LINE>if (!terms.hasTerms()) {<NEW_LINE>terms.setTerms(new GlossaryTermAssociationArray());<NEW_LINE>}<NEW_LINE>addTermIfNotExistsToEntity(terms, labelUrn);<NEW_LINE>persistAspect(targetUrn, GLOSSARY_TERM_ASPECT_NAME, terms, actor, entityService);<NEW_LINE>} else {<NEW_LINE>com.linkedin.schema.EditableSchemaMetadata editableSchemaMetadata = (com.linkedin.schema.EditableSchemaMetadata) getAspectFromEntity(targetUrn.toString(), EDITABLE_SCHEMA_METADATA, entityService, new EditableSchemaMetadata());<NEW_LINE>EditableSchemaFieldInfo editableFieldInfo = getFieldInfoFromSchema(editableSchemaMetadata, subResource);<NEW_LINE>if (!editableFieldInfo.hasGlossaryTerms()) {<NEW_LINE>editableFieldInfo.setGlossaryTerms(new GlossaryTerms());<NEW_LINE>}<NEW_LINE>editableFieldInfo.getGlossaryTerms().setAuditStamp(getAuditStamp(actor));<NEW_LINE>addTermIfNotExistsToEntity(editableFieldInfo.getGlossaryTerms(), labelUrn);<NEW_LINE>persistAspect(targetUrn, EDITABLE_SCHEMA_METADATA, editableSchemaMetadata, actor, entityService);<NEW_LINE>}<NEW_LINE>}
.setAuditStamp(getAuditStamp(actor));
40,395
// IFlowItems<NEW_LINE>@Override<NEW_LINE>public int tryExtractItems(int count, EnumFacing from, EnumDyeColor colour, IStackFilter filter, boolean simulate) {<NEW_LINE>if (pipe.getHolder().getPipeWorld().isRemote) {<NEW_LINE>throw new IllegalStateException("Cannot extract items on the client side!");<NEW_LINE>}<NEW_LINE>if (from == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>TileEntity tile = pipe.getConnectedTile(from);<NEW_LINE>IItemTransactor trans = ItemTransactorHelper.getTransactor(<MASK><NEW_LINE>ItemStack possible = trans.extract(filter, 1, count, true);<NEW_LINE>if (possible.isEmpty()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (possible.getCount() > possible.getMaxStackSize()) {<NEW_LINE>possible.setCount(possible.getMaxStackSize());<NEW_LINE>count = possible.getMaxStackSize();<NEW_LINE>}<NEW_LINE>IPipeHolder holder = pipe.getHolder();<NEW_LINE>PipeEventItem.TryInsert tryInsert = new PipeEventItem.TryInsert(holder, this, colour, from, possible);<NEW_LINE>holder.fireEvent(tryInsert);<NEW_LINE>if (tryInsert.isCanceled() || tryInsert.accepted <= 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>count = Math.min(count, tryInsert.accepted);<NEW_LINE>ItemStack stack = trans.extract(filter, count, count, simulate);<NEW_LINE>if (stack.isEmpty()) {<NEW_LINE>throw new IllegalStateException("The transactor " + trans + " returned an empty itemstack from a known good request!");<NEW_LINE>}<NEW_LINE>if (!simulate) {<NEW_LINE>insertItemEvents(stack, colour, EXTRACT_SPEED, from);<NEW_LINE>}<NEW_LINE>return count;<NEW_LINE>}
tile, from.getOpposite());
596,863
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {<NEW_LINE>// TODO for the moment only LAZY read & write is supported<NEW_LINE>if (readType != Type.LAZY || writeType != Type.LAZY) {<NEW_LINE>throw new UnsupportedOperationException("EnumerableTableSpool supports for the moment only LAZY read and LAZY write");<NEW_LINE>}<NEW_LINE>// ModifiableTable t = (ModifiableTable) root.getRootSchema().getTable(tableName);<NEW_LINE>// return lazyCollectionSpool(t.getModifiableCollection(), <inputExp>);<NEW_LINE>BlockBuilder builder = new BlockBuilder();<NEW_LINE>RelNode input = getInput();<NEW_LINE>Result inputResult = implementor.visitChild(this, 0, (EnumerableRel) input, pref);<NEW_LINE>String tableName = table.getQualifiedName().get(table.getQualifiedName().size() - 1);<NEW_LINE>Expression tableExp = Expressions.convert_(Expressions.call(Expressions.call(implementor.getRootExpression(), BuiltInMethod.DATA_CONTEXT_GET_ROOT_SCHEMA.method), BuiltInMethod.SCHEMA_GET_TABLE.method, Expressions.constant(tableName, String.class)), ModifiableTable.class);<NEW_LINE>Expression collectionExp = Expressions.call(tableExp, BuiltInMethod.MODIFIABLE_TABLE_GET_MODIFIABLE_COLLECTION.method);<NEW_LINE>Expression inputExp = builder.<MASK><NEW_LINE>Expression spoolExp = Expressions.call(BuiltInMethod.LAZY_COLLECTION_SPOOL.method, collectionExp, inputExp);<NEW_LINE>builder.add(spoolExp);<NEW_LINE>PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), pref.prefer(inputResult.format));<NEW_LINE>return implementor.result(physType, builder.toBlock());<NEW_LINE>}
append("input", inputResult.block);
640,290
private Mono<Response<Flux<ByteBuffer>>> redeployWithResponseAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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 (vmScaleSetName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vmInstanceIDs != null) {<NEW_LINE>vmInstanceIDs.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-06-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.redeploy(this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), vmInstanceIDs, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
7,315
static ChaiProvider openProxyChaiProvider(final ChaiProviderFactory chaiProviderFactory, final SessionLabel sessionLabel, final LdapProfile ldapProfile, final DomainConfig config, final StatisticsService statisticsManager) throws PwmUnrecoverableException {<NEW_LINE>LOGGER.trace(sessionLabel, () -> "opening new ldap proxy connection");<NEW_LINE>final String proxyDN = ldapProfile.readSettingAsString(PwmSetting.LDAP_PROXY_USER_DN);<NEW_LINE>final PasswordData proxyPW = ldapProfile.readSettingAsPassword(PwmSetting.LDAP_PROXY_USER_PASSWORD);<NEW_LINE>try {<NEW_LINE>return createChaiProvider(chaiProviderFactory, sessionLabel, ldapProfile, config, proxyDN, proxyPW);<NEW_LINE>} catch (final ChaiUnavailableException e) {<NEW_LINE>if (statisticsManager != null) {<NEW_LINE>statisticsManager.incrementValue(Statistic.LDAP_UNAVAILABLE_COUNT);<NEW_LINE>}<NEW_LINE>final StringBuilder errorMsg = new StringBuilder();<NEW_LINE>errorMsg.append("error connecting as proxy user: ");<NEW_LINE>final Optional<PwmError> pwmError = PwmError.forChaiError(e.getErrorCode());<NEW_LINE>if (pwmError.isPresent() && pwmError.get() != PwmError.ERROR_INTERNAL) {<NEW_LINE>errorMsg.append(new ErrorInformation(pwmError.get(), e.getMessage()).toDebugStr());<NEW_LINE>} else {<NEW_LINE>errorMsg.append(e.getMessage());<NEW_LINE>}<NEW_LINE>final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_DIRECTORY_UNAVAILABLE, errorMsg.toString());<NEW_LINE>LOGGER.fatal(sessionLabel, () -> <MASK><NEW_LINE>throw new PwmUnrecoverableException(errorInformation);<NEW_LINE>}<NEW_LINE>}
"check ldap proxy settings: " + errorInformation.toDebugStr());
412,838
private static boolean isNewerVersion(String latestVersion) {<NEW_LINE>int[] oldVersions = versionStringToInt(getThisJarVersion());<NEW_LINE>int[] newVersions = versionStringToInt(latestVersion);<NEW_LINE>if (oldVersions.length < newVersions.length) {<NEW_LINE>System.err.println("Calculated: " + getThisJarVersion() + " < " + latestVersion);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < oldVersions.length; i++) {<NEW_LINE>if (newVersions[i] > oldVersions[i]) {<NEW_LINE>logger.debug("oldVersion " + getThisJarVersion() + " < latestVersion" + latestVersion);<NEW_LINE>return true;<NEW_LINE>} else if (newVersions[i] < oldVersions[i]) {<NEW_LINE>logger.debug("oldVersion " + getThisJarVersion() + " > latestVersion " + latestVersion);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// At this point, the version numbers are exactly the same.<NEW_LINE>// Assume any additional changes to the version text means a new version<NEW_LINE>return !(latestVersion<MASK><NEW_LINE>}
.equals(getThisJarVersion()));
941,651
@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>public void run(@PathParam("name") String name, @Context EventManager events, @Suspended AsyncResponse response) {<NEW_LINE>String id = UUID.randomUUID().toString();<NEW_LINE>EventLog<LeadershipEventListener<String>, LeadershipEvent<String>> eventLog = events.getOrCreateEventLog(AsyncLeaderElection.class, getEventLogName(name, id), l -> e -> l.addEvent(e));<NEW_LINE>getPrimitive(name).thenAccept(election -> election.addListener(eventLog.listener()).whenComplete((listenResult, listenError) -> {<NEW_LINE>if (listenError == null) {<NEW_LINE>election.run(id).whenComplete((runResult, runError) -> {<NEW_LINE>if (runError == null) {<NEW_LINE>response.resume(Response.ok(id).build());<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("{}", runError);<NEW_LINE>response.resume(Response.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("{}", listenError);<NEW_LINE>response.resume(Response.serverError().build());<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}
serverError().build());
114,683
public Set<UsageContext> keySet() {<NEW_LINE>final EnumSet<UsageContext> set = EnumSet.noneOf(UsageContext.class);<NEW_LINE>if (terms > 0L) {<NEW_LINE>set.add(UsageContext.TERMS);<NEW_LINE>}<NEW_LINE>if (postings > 0L) {<NEW_LINE>set.add(UsageContext.POSTINGS);<NEW_LINE>}<NEW_LINE>if (termFrequencies > 0L) {<NEW_LINE>set.add(UsageContext.FREQS);<NEW_LINE>}<NEW_LINE>if (positions > 0L) {<NEW_LINE>set.add(UsageContext.POSITIONS);<NEW_LINE>}<NEW_LINE>if (offsets > 0L) {<NEW_LINE>set.add(UsageContext.OFFSETS);<NEW_LINE>}<NEW_LINE>if (docValues > 0L) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (storedFields > 0L) {<NEW_LINE>set.add(UsageContext.STORED_FIELDS);<NEW_LINE>}<NEW_LINE>if (norms > 0L) {<NEW_LINE>set.add(UsageContext.NORMS);<NEW_LINE>}<NEW_LINE>if (payloads > 0L) {<NEW_LINE>set.add(UsageContext.PAYLOADS);<NEW_LINE>}<NEW_LINE>if (termVectors > 0L) {<NEW_LINE>set.add(UsageContext.TERM_VECTORS);<NEW_LINE>}<NEW_LINE>if (points > 0L) {<NEW_LINE>set.add(UsageContext.POINTS);<NEW_LINE>}<NEW_LINE>if (knnVectors > 0L) {<NEW_LINE>set.add(UsageContext.KNN_VECTORS);<NEW_LINE>}<NEW_LINE>return set;<NEW_LINE>}
set.add(UsageContext.DOC_VALUES);
684,292
public void start(Configuration conf) {<NEW_LINE>boolean httpEnabled = conf.getBoolean(PROMETHEUS_STATS_HTTP_ENABLE, DEFAULT_PROMETHEUS_STATS_HTTP_ENABLE);<NEW_LINE>boolean bkHttpServerEnabled = conf.getBoolean("httpServerEnabled", false);<NEW_LINE>// only start its own http server when prometheus http is enabled and bk http server is not enabled.<NEW_LINE>if (httpEnabled && !bkHttpServerEnabled) {<NEW_LINE>String httpAddr = conf.getString(PROMETHEUS_STATS_HTTP_ADDRESS, DEFAULT_PROMETHEUS_STATS_HTTP_ADDR);<NEW_LINE>int httpPort = conf.getInt(PROMETHEUS_STATS_HTTP_PORT, DEFAULT_PROMETHEUS_STATS_HTTP_PORT);<NEW_LINE>InetSocketAddress httpEndpoint = InetSocketAddress.createUnresolved(httpAddr, httpPort);<NEW_LINE>this.server = new Server(httpEndpoint);<NEW_LINE>ServletContextHandler context = new ServletContextHandler();<NEW_LINE>context.setContextPath("/");<NEW_LINE>server.setHandler(context);<NEW_LINE>context.addServlet(new ServletHolder(new PrometheusServlet(this)), "/metrics");<NEW_LINE>try {<NEW_LINE>server.start();<NEW_LINE>log.info("Started Prometheus stats endpoint at {}", httpEndpoint);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Include standard JVM stats<NEW_LINE>registerMetrics(new StandardExports());<NEW_LINE>registerMetrics(new MemoryPoolsExports());<NEW_LINE>registerMetrics(new GarbageCollectorExports());<NEW_LINE>registerMetrics(new ThreadExports());<NEW_LINE>// Add direct memory allocated through unsafe<NEW_LINE>registerMetrics(Gauge.build("jvm_memory_direct_bytes_used", "-").create().setChild(new Child() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double get() {<NEW_LINE>return directMemoryUsage != null ? directMemoryUsage.longValue() : Double.NaN;<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>registerMetrics(Gauge.build("jvm_memory_direct_bytes_max", "-").create().setChild(new Child() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double get() {<NEW_LINE>return PlatformDependent.maxDirectMemory();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>executor = Executors.newSingleThreadScheduledExecutor(new DefaultThreadFactory("metrics"));<NEW_LINE>int latencyRolloverSeconds = conf.getInt(PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS, DEFAULT_PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS);<NEW_LINE>executor.scheduleAtFixedRate(() -> {<NEW_LINE>rotateLatencyCollection();<NEW_LINE>}, <MASK><NEW_LINE>}
1, latencyRolloverSeconds, TimeUnit.SECONDS);
232,049
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create context TheContext " + "context C0 partition by theString from SupportBean," + "context C1 initiated by SupportBean(intPrimitive=1) terminated by SupportBean(intPrimitive=2)", path);<NEW_LINE>env.compileDeploy("@name('s0') context TheContext select theString, sum(longPrimitive) as theSum from SupportBean output last when terminated", path);<NEW_LINE>env.addListener("s0");<NEW_LINE>sendSupportBean(env, "A", 0, 1);<NEW_LINE>sendSupportBean(env, "B", 0, 2);<NEW_LINE>env.milestone(0);<NEW_LINE>sendSupportBean(env, "C", 1, 3);<NEW_LINE>sendSupportBean(env, "D", 1, 4);<NEW_LINE>env.milestone(1);<NEW_LINE>sendSupportBean(env, "A", 0, 5);<NEW_LINE>sendSupportBean(env, "C", 0, 6);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendSupportBean(env, "C", 2, -10);<NEW_LINE>env.assertPropsNew("s0", "theString,theSum".split(","), new Object[<MASK><NEW_LINE>env.milestone(2);<NEW_LINE>sendSupportBean(env, "D", 2, 5);<NEW_LINE>env.assertPropsNew("s0", "theString,theSum".split(","), new Object[] { "D", 9L });<NEW_LINE>env.undeployAll();<NEW_LINE>}
] { "C", -1L });
1,592,974
public PolicyError validate(RealmModel realm, UserModel user, String password) {<NEW_LINE>PasswordPolicy policy = session.getContext().getRealm().getPasswordPolicy();<NEW_LINE>int passwordHistoryPolicyValue = policy.getPolicyConfig(PasswordPolicy.PASSWORD_HISTORY_ID);<NEW_LINE>if (passwordHistoryPolicyValue != -1) {<NEW_LINE>if (session.userCredentialManager().getStoredCredentialsByTypeStream(realm, user, PasswordCredentialModel.TYPE).map(PasswordCredentialModel::createFromCredentialModel).anyMatch(passwordCredential -> {<NEW_LINE>PasswordHashProvider hash = session.getProvider(PasswordHashProvider.class, passwordCredential.getPasswordCredentialData().getAlgorithm());<NEW_LINE>return hash != null && hash.verify(password, passwordCredential);<NEW_LINE>})) {<NEW_LINE>return new PolicyError(ERROR_MESSAGE, passwordHistoryPolicyValue);<NEW_LINE>}<NEW_LINE>if (passwordHistoryPolicyValue > 0) {<NEW_LINE>if (this.getRecent(session.userCredentialManager().getStoredCredentialsByTypeStream(realm, user, PasswordCredentialModel.PASSWORD_HISTORY), passwordHistoryPolicyValue - 1).map(PasswordCredentialModel::createFromCredentialModel).anyMatch(passwordCredential -> {<NEW_LINE>PasswordHashProvider hash = session.getProvider(PasswordHashProvider.class, passwordCredential.getPasswordCredentialData().getAlgorithm());<NEW_LINE>return <MASK><NEW_LINE>})) {<NEW_LINE>return new PolicyError(ERROR_MESSAGE, passwordHistoryPolicyValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
hash.verify(password, passwordCredential);
215,825
public void writeRawBytes(final ByteString value, int offset, int length) throws IOException {<NEW_LINE>if (limit - position >= length) {<NEW_LINE>// We have room in the current buffer.<NEW_LINE>value.copyTo(buffer, offset, position, length);<NEW_LINE>position += length;<NEW_LINE>} else {<NEW_LINE>// Write extends past current buffer. Fill the rest of this buffer and<NEW_LINE>// flush.<NEW_LINE>final int bytesWritten = limit - position;<NEW_LINE>value.copyTo(buffer, offset, position, bytesWritten);<NEW_LINE>offset += bytesWritten;<NEW_LINE>length -= bytesWritten;<NEW_LINE>position = limit;<NEW_LINE>refreshBuffer();<NEW_LINE>// Now deal with the rest.<NEW_LINE>// Since we have an output stream, this is our buffer<NEW_LINE>// and buffer offset == 0<NEW_LINE>if (length <= limit) {<NEW_LINE>// Fits in new buffer.<NEW_LINE>value.copyTo(buffer, offset, 0, length);<NEW_LINE>position = length;<NEW_LINE>} else {<NEW_LINE>// Write is very big, but we can't do it all at once without allocating<NEW_LINE>// an a copy of the byte array since ByteString does not give us access<NEW_LINE>// to the underlying bytes. Use the InputStream interface on the<NEW_LINE>// ByteString and our buffer to copy between the two.<NEW_LINE>InputStream inputStreamFrom = value.newInput();<NEW_LINE>if (offset != inputStreamFrom.skip(offset)) {<NEW_LINE>throw new IllegalStateException("Skip failed? Should never happen.");<NEW_LINE>}<NEW_LINE>// Use the buffer as the temporary buffer to avoid allocating memory.<NEW_LINE>while (length > 0) {<NEW_LINE>int bytesToRead = Math.min(length, limit);<NEW_LINE>int bytesRead = inputStreamFrom.<MASK><NEW_LINE>if (bytesRead != bytesToRead) {<NEW_LINE>throw new IllegalStateException("Read failed? Should never happen");<NEW_LINE>}<NEW_LINE>output.write(buffer, 0, bytesRead);<NEW_LINE>writtenBytes += bytesRead;<NEW_LINE>length -= bytesRead;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
read(buffer, 0, bytesToRead);
1,378,845
private void manageRunDocumentCommand(boolean active) {<NEW_LINE>boolean runDocFromServerR = false;<NEW_LINE>if (active) {<NEW_LINE>String activePath = activeEditor_ != null ? activeEditor_.getPath() : null;<NEW_LINE>if (activePath != null) {<NEW_LINE>boolean isServerR = activePath.endsWith("server.R"<MASK><NEW_LINE>if (isServerR) {<NEW_LINE>runDocFromServerR = shinyRunDocumentEditor(activePath) != null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getSourceCommand(commands_.runDocumentFromServerDotR()).setVisible(active && runDocFromServerR);<NEW_LINE>if (activeEditor_ != null && activeEditor_.getTextFileType() != null) {<NEW_LINE>getSourceCommand(commands_.compileNotebook()).setVisible(active && activeEditor_.getTextFileType().canCompileNotebook() && !runDocFromServerR);<NEW_LINE>getSourceCommand(commands_.knitDocument()).setVisible(active && activeEditor_.getTextFileType().canKnitToHTML() && !runDocFromServerR);<NEW_LINE>}<NEW_LINE>}
) || activePath.endsWith("global.R");
811,836
private synchronized void checkSecondaryStorageResourceLimit(TemplateOrVolumePostUploadCommand cmd, int contentLengthInGB) {<NEW_LINE>String rootDir = this.getRootDir(cmd.getDataTo(), cmd.getNfsVersion()) + File.separator;<NEW_LINE>long accountId = cmd.getAccountId();<NEW_LINE>long accountTemplateDirSize = 0;<NEW_LINE>File accountTemplateDir = new File(rootDir + getTemplatePathForAccount(accountId));<NEW_LINE>if (accountTemplateDir.exists()) {<NEW_LINE>accountTemplateDirSize = FileUtils.sizeOfDirectory(accountTemplateDir);<NEW_LINE>}<NEW_LINE>long accountVolumeDirSize = 0;<NEW_LINE>File accountVolumeDir = new File(rootDir + getVolumePathForAccount(accountId));<NEW_LINE>if (accountVolumeDir.exists()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>long accountSnapshotDirSize = 0;<NEW_LINE>File accountSnapshotDir = new File(rootDir + getSnapshotPathForAccount(accountId));<NEW_LINE>if (accountSnapshotDir.exists()) {<NEW_LINE>accountSnapshotDirSize = FileUtils.sizeOfDirectory(accountSnapshotDir);<NEW_LINE>}<NEW_LINE>s_logger.debug("accountTemplateDirSize: " + accountTemplateDirSize + " accountSnapshotDirSize: " + accountSnapshotDirSize + " accountVolumeDirSize: " + accountVolumeDirSize);<NEW_LINE>int accountDirSizeInGB = getSizeInGB(accountTemplateDirSize + accountSnapshotDirSize + accountVolumeDirSize);<NEW_LINE>int defaultMaxAccountSecondaryStorageInGB = Integer.parseInt(cmd.getDefaultMaxAccountSecondaryStorage());<NEW_LINE>if (defaultMaxAccountSecondaryStorageInGB != Resource.RESOURCE_UNLIMITED && (accountDirSizeInGB + contentLengthInGB) > defaultMaxAccountSecondaryStorageInGB) {<NEW_LINE>s_logger.error(// extra attention<NEW_LINE>"accountDirSizeInGb: " + accountDirSizeInGB + " defaultMaxAccountSecondaryStorageInGB: " + defaultMaxAccountSecondaryStorageInGB + " contentLengthInGB:" + contentLengthInGB);<NEW_LINE>String errorMessage = "Maximum number of resources of type secondary_storage for account has exceeded";<NEW_LINE>updateStateMapWithError(cmd.getEntityUUID(), errorMessage);<NEW_LINE>throw new InvalidParameterValueException(errorMessage);<NEW_LINE>}<NEW_LINE>}
accountVolumeDirSize = FileUtils.sizeOfDirectory(accountVolumeDir);
968,057
String generateUpdateStatement(DBTable table, int row, Map<Integer, Object> changedRow, DataViewTableUIModel tblModel) throws DBException {<NEW_LINE>List<DBColumn> columns = table.getColumnList();<NEW_LINE>StringBuilder rawUpdateStmt = new StringBuilder();<NEW_LINE>// NOI18N<NEW_LINE>rawUpdateStmt.append("UPDATE ").append(table.getFullyQualifiedName(false)).append(" SET ");<NEW_LINE>// NOI18N<NEW_LINE>String commaStr = ", ";<NEW_LINE>boolean comma = false;<NEW_LINE>for (Integer col : changedRow.keySet()) {<NEW_LINE>DBColumn dbcol = columns.get(col);<NEW_LINE>Object value = changedRow.get(col);<NEW_LINE>int type = dbcol.getJdbcType();<NEW_LINE>if ((value == null || value.equals("<NULL>")) && !dbcol.isNullable()) {<NEW_LINE>// NOI18N<NEW_LINE>throw new DBException(NbBundle.getMessage(SQLStatementGenerator.class, "MSG_nullable_check"));<NEW_LINE>}<NEW_LINE>if (comma) {<NEW_LINE>rawUpdateStmt.append(commaStr);<NEW_LINE>} else {<NEW_LINE>comma = true;<NEW_LINE>}<NEW_LINE>rawUpdateStmt.append<MASK><NEW_LINE>// Check for Constant e.g <NULL>, <DEFAULT>, <CURRENT_TIMESTAMP> etc<NEW_LINE>if (value instanceof SQLConstant) {<NEW_LINE>rawUpdateStmt.append(" = ").append(((SQLConstant) value).name());<NEW_LINE>} else {<NEW_LINE>// ELSE literals<NEW_LINE>rawUpdateStmt.append(" = ").append(getQualifiedValue(type, value).toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>rawUpdateStmt.append(" WHERE ");<NEW_LINE>generateWhereCondition(table, rawUpdateStmt, row, tblModel);<NEW_LINE>return rawUpdateStmt.toString();<NEW_LINE>}
(dbcol.getQualifiedName(true));
276,839
public void onGroupExpand(int groupPosition) {<NEW_LINE>// these shouldn't ever be collapsible<NEW_LINE>if (adapter.isRowRootFolder(groupPosition))<NEW_LINE>return;<NEW_LINE>if (adapter.isRowReadStories(groupPosition))<NEW_LINE>return;<NEW_LINE>if (adapter.isRowSavedSearches(groupPosition))<NEW_LINE>return;<NEW_LINE>String flatGroupName = adapter.getGroupUniqueName(groupPosition);<NEW_LINE>// save the expanded preference, since the widget likes to forget it<NEW_LINE>sharedPreferences.edit().putBoolean(AppConstants.FOLDER_PRE + "_" + flatGroupName, true).commit();<NEW_LINE>if (adapter.isRowSavedStories(groupPosition))<NEW_LINE>return;<NEW_LINE>// trigger display/hide of sub-folders<NEW_LINE><MASK><NEW_LINE>// re-check open/closed state of sub folders, since the list will have forgot them<NEW_LINE>checkOpenFolderPreferences();<NEW_LINE>}
adapter.setFolderClosed(flatGroupName, false);
1,591,793
public void onCreate(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>prefEnableCustomNotif = (SwitchPreference) getPreferenceScreen().findPreference(getString(R.string.custom_notification_enable_key));<NEW_LINE>prefMessagePreview = (SwitchPreference) getPreferenceScreen().findPreference(getString(R.string.custom_notification_preview_key));<NEW_LINE>prefSound = (RingtonePreference) getPreferenceScreen().findPreference(getString(R.string.custom_notification_sound_key));<NEW_LINE>prefVibro = (ListPreference) getPreferenceScreen().findPreference(getString(R.string.custom_notification_vibro_key));<NEW_LINE>prefEnableCustomNotif.setOnPreferenceChangeListener(this);<NEW_LINE>prefMessagePreview.setOnPreferenceChangeListener(this);<NEW_LINE>prefSound.setOnPreferenceChangeListener(this);<NEW_LINE>prefVibro.setOnPreferenceChangeListener(this);<NEW_LINE>}
addPreferencesFromResource(R.xml.preference_custom_notify);
269,839
private void rewriteStringConcat(InfixExpression node) {<NEW_LINE>// Collect all non-string operands that precede the first string operand.<NEW_LINE>// If there are multiple such operands, move them into a sub-expression.<NEW_LINE>List<Expression> nonStringOperands = new ArrayList<>();<NEW_LINE>TypeMirror nonStringExprType = null;<NEW_LINE>for (Expression operand : node.getOperands()) {<NEW_LINE>TypeMirror operandType = operand.getTypeMirror();<NEW_LINE>if (typeUtil.isString(operandType)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>nonStringOperands.add(operand);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (nonStringOperands.size() < 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InfixExpression nonStringExpr = new InfixExpression(nonStringExprType, InfixExpression.Operator.PLUS);<NEW_LINE>for (Expression operand : nonStringOperands) {<NEW_LINE>nonStringExpr.addOperand(TreeUtil.remove(operand));<NEW_LINE>}<NEW_LINE>node.addOperand(0, nonStringExpr);<NEW_LINE>}
nonStringExprType = getAdditionType(nonStringExprType, operandType);
414,728
private void appendBody(ContainerChange change, JsonObject toJson, JsonSerializationContext context) {<NEW_LINE>JsonArray jsonArray = new JsonArray();<NEW_LINE>for (ContainerElementChange elementChange : (List<ContainerElementChange>) change.getChanges()) {<NEW_LINE>JsonObject jsonElement = new JsonObject();<NEW_LINE>jsonElement.addProperty(ELEMENT_CHANGE_TYPE_FIELD, elementChange.getClass().getSimpleName());<NEW_LINE>jsonElement.addProperty(<MASK><NEW_LINE>if (elementChange instanceof ValueAddOrRemove) {<NEW_LINE>ValueAddOrRemove valueAddOrRemove = (ValueAddOrRemove) elementChange;<NEW_LINE>jsonElement.add(VALUE_FIELD, context.serialize(valueAddOrRemove.getValue()));<NEW_LINE>}<NEW_LINE>if (elementChange instanceof ElementValueChange) {<NEW_LINE>ElementValueChange elementValueChange = (ElementValueChange) elementChange;<NEW_LINE>jsonElement.add(LEFT_VALUE_FIELD, context.serialize(elementValueChange.getLeftValue()));<NEW_LINE>jsonElement.add(RIGHT_VALUE_FIELD, context.serialize(elementValueChange.getRightValue()));<NEW_LINE>}<NEW_LINE>jsonArray.add(jsonElement);<NEW_LINE>}<NEW_LINE>toJson.add(CHANGES_FIELD, jsonArray);<NEW_LINE>}
INDEX_FIELD, elementChange.getIndex());
619,909
private void drawPathScreenTicks(Graphics2D g2d, float x, float y, int viewWidth, int viewHeight, int layoutWidth, int layoutHeight) {<NEW_LINE>float x1 = 0;<NEW_LINE>float y1 = 0;<NEW_LINE>float x2 = 1;<NEW_LINE>float y2 = 1;<NEW_LINE>float minx = 0;<NEW_LINE>float maxy = 0;<NEW_LINE>float xgap = x;<NEW_LINE>float ygap = y;<NEW_LINE>// Horizontal line<NEW_LINE>String text = "" + ((int) (0.5 + 100 * (xgap - viewWidth / 2) / (layoutWidth - viewWidth))) / 100.0f;<NEW_LINE>getTextBounds(text, g2d);<NEW_LINE>float off = xgap / 2 - (float) mBounds.getWidth() / 2;<NEW_LINE>g2d.drawString(text, off + minx, y - 20);<NEW_LINE>g2d.drawLine((int) x, (int) y, (int) Math.min(x1, x2), (int) y);<NEW_LINE>// Vertical line<NEW_LINE>text = "" + ((int) (0.5 + 100 * (ygap - viewHeight / 2) / (layoutHeight - viewHeight))) / 100.0f;<NEW_LINE>getTextBounds(text, g2d);<NEW_LINE>off = ygap / 2 - (float) mBounds.getHeight() / 2;<NEW_LINE>g2d.drawString(text, <MASK><NEW_LINE>g2d.drawLine((int) x, (int) y, (int) x, (int) Math.max(y1, y2));<NEW_LINE>}
x + 5, maxy - off);
1,671,531
private <T, U> List<U> transformAll(Collection<T> inputs, ValueOrTransformProvider<T, U> valueOrTransformProvider) {<NEW_LINE>assert !inputs.isEmpty();<NEW_LINE>return cache.useCache(() -> {<NEW_LINE>final List<U> results = new ArrayList<>(inputs.size());<NEW_LINE>final List<Callable<Void>> transforms = new ArrayList<>(inputs.size());<NEW_LINE>final Set<HashCode> seen = new HashSet<>();<NEW_LINE>for (T input : inputs) {<NEW_LINE>valueOrTransformProvider.apply(input, seen).ifPresent(valueOrTransform -> valueOrTransform.apply(value -> results.add(value), transform -> {<NEW_LINE>final <MASK><NEW_LINE>results.add(null);<NEW_LINE>transforms.add(() -> {<NEW_LINE>results.set(index, unchecked(transform));<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>// Execute all transforms at once<NEW_LINE>for (Future<Void> result : unchecked(() -> executor.invokeAll(transforms))) {<NEW_LINE>// Propagate first failure<NEW_LINE>unchecked(result::get);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>});<NEW_LINE>}
int index = results.size();
560,227
private void configureProperties() {<NEW_LINE>PropertyLayout propLayout = find("properties", PropertyLayout.class);<NEW_LINE>propLayout.setOrdering(PropertyOrdering.byLabel());<NEW_LINE>propLayout.clear();<NEW_LINE>WorldConfigurator worldConfig = worldGenerator.getConfigurator();<NEW_LINE>Map<String, Component> params = worldConfig.getProperties();<NEW_LINE>for (String key : params.keySet()) {<NEW_LINE>Class<? extends Component> clazz = params.get(key).getClass();<NEW_LINE>Component comp = config.getModuleConfig(worldGenerator.getUri(), key, clazz);<NEW_LINE>if (comp != null) {<NEW_LINE>// use the data from the config instead of defaults<NEW_LINE>worldConfig.setProperty(key, comp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ComponentLibrary compLib = subContext.get(ComponentLibrary.class);<NEW_LINE>for (String label : params.keySet()) {<NEW_LINE>PropertyProvider provider = new PropertyProvider(context.get(ReflectFactory.class), context.get(OneOfProviderFactory.class)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected <T> Binding<T> createTextBinding(Object target, FieldMetadata<Object, T> fieldMetadata) {<NEW_LINE>return new WorldConfigBinding<>(worldConfig, label, compLib, fieldMetadata);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Binding<Float> createFloatBinding(Object target, FieldMetadata<Object, ?> fieldMetadata) {<NEW_LINE>return new WorldConfigNumberBinding(worldConfig, label, compLib, fieldMetadata);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Component target = params.get(label);<NEW_LINE>List<Property<?, ?>> <MASK><NEW_LINE>propLayout.addProperties(label, properties);<NEW_LINE>}<NEW_LINE>}
properties = provider.createProperties(target);
411,403
private void assertUnfilled(RegressionEnvironment env, EventBean event) {<NEW_LINE>assertNull(collectionValue(event, local -> local.c0));<NEW_LINE>assertNull(collectionValue(event, local -> local.c1));<NEW_LINE>assertNull(collectionValue(event, local -> local.c2));<NEW_LINE>assertNull(collectionValue(event<MASK><NEW_LINE>assertNull(collectionValue(event, local -> local.c4));<NEW_LINE>assertNull(collectionValue(event, local -> local.c5));<NEW_LINE>assertNull(collectionValue(event, local -> local.c6));<NEW_LINE>assertNull(collectionValue(event, local -> local.c7));<NEW_LINE>assertNull(collectionValue(event, local -> local.c8));<NEW_LINE>assertNull(collectionValue(event, local -> local.c9));<NEW_LINE>assertNull(collectionValue(event, local -> local.c10));<NEW_LINE>assertJson(env, event, "{\"local\":{\"c0\":null,\"c1\":null,\"c2\":null,\"c3\":null,\"c4\":null,\"c5\":null,\"c6\":null,\"c7\":null,\"c8\":null,\"c9\":null,\"c10\":null}}");<NEW_LINE>}
, local -> local.c3));
1,091,248
public MdmLink createOrUpdateLinkEntity(IBaseResource theGoldenResource, IBaseResource theSourceResource, MdmMatchOutcome theMatchOutcome, MdmLinkSourceEnum theLinkSource, @Nullable MdmTransactionContext theMdmTransactionContext) {<NEW_LINE>Long goldenResourcePid = myJpaIdHelperService.getPidOrNull(theGoldenResource);<NEW_LINE>Long sourceResourcePid = myJpaIdHelperService.getPidOrNull(theSourceResource);<NEW_LINE>MdmLink mdmLink = getOrCreateMdmLinkByGoldenResourcePidAndSourceResourcePid(goldenResourcePid, sourceResourcePid);<NEW_LINE>mdmLink.setLinkSource(theLinkSource);<NEW_LINE>mdmLink.setMatchResult(theMatchOutcome.getMatchResultEnum());<NEW_LINE>// Preserve these flags for link updates<NEW_LINE>mdmLink.setEidMatch(theMatchOutcome.isEidMatch() | mdmLink.isEidMatchPresent());<NEW_LINE>mdmLink.setHadToCreateNewGoldenResource(theMatchOutcome.isCreatedNewResource() | mdmLink.getHadToCreateNewGoldenResource());<NEW_LINE>mdmLink.setMdmSourceType(myFhirContext.getResourceType(theSourceResource));<NEW_LINE>if (mdmLink.getScore() != null) {<NEW_LINE>mdmLink.setScore(Math.max(theMatchOutcome.score, mdmLink.getScore()));<NEW_LINE>} else {<NEW_LINE>mdmLink.setScore(theMatchOutcome.score);<NEW_LINE>}<NEW_LINE>String message = String.format("Creating MdmLink from %s to %s -> %s", theGoldenResource.getIdElement().toUnqualifiedVersionless(), theSourceResource.getIdElement(<MASK><NEW_LINE>theMdmTransactionContext.addTransactionLogMessage(message);<NEW_LINE>ourLog.debug(message);<NEW_LINE>save(mdmLink);<NEW_LINE>return mdmLink;<NEW_LINE>}
).toUnqualifiedVersionless(), theMatchOutcome);
645,396
public RDSDatabaseCredentials unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RDSDatabaseCredentials rDSDatabaseCredentials = new RDSDatabaseCredentials();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Username", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rDSDatabaseCredentials.setUsername(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Password", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rDSDatabaseCredentials.setPassword(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return rDSDatabaseCredentials;<NEW_LINE>}
class).unmarshall(context));
1,032,999
protected void configure() {<NEW_LINE>bind(SystemMessageService.class).to(SystemMessageServiceImpl.class);<NEW_LINE>bind(AlertService.class).to(AlertServiceImpl.class);<NEW_LINE>bind(NotificationService.class<MASK><NEW_LINE>bind(IndexFailureService.class).to(IndexFailureServiceImpl.class);<NEW_LINE>bind(NodeService.class).to(NodeServiceImpl.class);<NEW_LINE>bind(IndexRangeService.class).to(MongoIndexRangeService.class).asEagerSingleton();<NEW_LINE>bind(InputService.class).to(InputServiceImpl.class);<NEW_LINE>bind(StreamRuleService.class).to(StreamRuleServiceImpl.class);<NEW_LINE>bind(UserService.class).to(UserServiceImpl.class);<NEW_LINE>OptionalBinder.newOptionalBinder(binder(), UserManagementService.class).setDefault().to(UserManagementServiceImpl.class);<NEW_LINE>bind(StreamService.class).to(StreamServiceImpl.class);<NEW_LINE>bind(AccessTokenService.class).to(AccessTokenServiceImpl.class);<NEW_LINE>bind(MongoDBSessionService.class).to(MongoDBSessionServiceImpl.class);<NEW_LINE>bind(InputStatusService.class).to(MongoInputStatusService.class).asEagerSingleton();<NEW_LINE>}
).to(NotificationServiceImpl.class);
199,055
public static Iterable<String> iterateLookupStrings(@Nonnull final LookupElement element) {<NEW_LINE>return new Iterable<String>() {<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public Iterator<String> iterator() {<NEW_LINE>final Iterator<String> original = element<MASK><NEW_LINE>return new UnmodifiableIterator<String>(original) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>try {<NEW_LINE>return super.hasNext();<NEW_LINE>} catch (ConcurrentModificationException e) {<NEW_LINE>throw handleCME(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String next() {<NEW_LINE>try {<NEW_LINE>return super.next();<NEW_LINE>} catch (ConcurrentModificationException e) {<NEW_LINE>throw handleCME(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private RuntimeException handleCME(ConcurrentModificationException cme) {<NEW_LINE>RuntimeExceptionWithAttachments ewa = new RuntimeExceptionWithAttachments("Error while traversing lookup strings of " + element + " of " + element.getClass(), (String) null, new Attachment("threadDump.txt", ThreadDumper.dumpThreadsToString()));<NEW_LINE>ewa.initCause(cme);<NEW_LINE>return ewa;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
.getAllLookupStrings().iterator();
541,151
public static void generateJLCGMODS(ClassWriter cw, String classname) {<NEW_LINE>FieldVisitor fv = cw.visitField(ACC_PUBLIC + ACC_STATIC, "__sljlcgmods", "Ljava/lang/reflect/Method;", null, null);<NEW_LINE>fv.visitEnd();<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC, "__sljlcgmods", "(Ljava/lang/Class;)I", "(Ljava/lang/Class<*>;)I", null);<NEW_LINE>mv.visitCode();<NEW_LINE>Label l0 = new Label();<NEW_LINE>Label l1 = new Label();<NEW_LINE>Label l2 = new Label();<NEW_LINE>mv.visitTryCatchBlock(<MASK><NEW_LINE>Label l3 = new Label();<NEW_LINE>mv.visitLabel(l3);<NEW_LINE>mv.visitFieldInsn(GETSTATIC, classname, "__sljlcgmods", "Ljava/lang/reflect/Method;");<NEW_LINE>mv.visitJumpInsn(IFNONNULL, l0);<NEW_LINE>Label l4 = new Label();<NEW_LINE>mv.visitLabel(l4);<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getModifiers", "()I", false);<NEW_LINE>mv.visitInsn(IRETURN);<NEW_LINE>mv.visitLabel(l0);<NEW_LINE>mv.visitFieldInsn(GETSTATIC, classname, "__sljlcgmods", "Ljava/lang/reflect/Method;");<NEW_LINE>mv.visitInsn(ACONST_NULL);<NEW_LINE>mv.visitInsn(ICONST_1);<NEW_LINE>mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitInsn(ICONST_0);<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitInsn(AASTORE);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/reflect/Method", "invoke", "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;", false);<NEW_LINE>mv.visitTypeInsn(CHECKCAST, "java/lang/Integer");<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false);<NEW_LINE>mv.visitLabel(l1);<NEW_LINE>mv.visitInsn(IRETURN);<NEW_LINE>mv.visitLabel(l2);<NEW_LINE>mv.visitVarInsn(ASTORE, 1);<NEW_LINE>Label l5 = new Label();<NEW_LINE>mv.visitLabel(l5);<NEW_LINE>mv.visitVarInsn(ALOAD, 1);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Exception", "printStackTrace", "()V", false);<NEW_LINE>Label l6 = new Label();<NEW_LINE>mv.visitLabel(l6);<NEW_LINE>mv.visitInsn(ICONST_0);<NEW_LINE>mv.visitInsn(IRETURN);<NEW_LINE>Label l7 = new Label();<NEW_LINE>mv.visitLabel(l7);<NEW_LINE>// mv.visitLocalVariable("clazz", "Ljava/lang/Class;", "Ljava/lang/Class<*>;", l3, l7, 0);<NEW_LINE>// mv.visitLocalVariable("e", "Ljava/lang/Exception;", null, l5, l7, 1);<NEW_LINE>mv.visitMaxs(6, 2);<NEW_LINE>mv.visitEnd();<NEW_LINE>}
l0, l1, l2, "java/lang/Exception");
441,863
protected void startHeartbeat() throws ServiceException {<NEW_LINE>if (master == null) {<NEW_LINE>LOG.error("Master has not been connected");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>clientId = master.getClientId(null, GetClientIdRequest.getDefaultInstance()).getClientId();<NEW_LINE>master.clientRegister(null, ClientRegisterRequest.newBuilder().setClientId(clientId).build());<NEW_LINE>LOG.info("clientId=" + clientId);<NEW_LINE>hbThread = new Thread(() -> {<NEW_LINE>long lastHbTs = System.currentTimeMillis();<NEW_LINE>while (!stopped.get() && !Thread.interrupted()) {<NEW_LINE>try {<NEW_LINE>if (System.currentTimeMillis() - lastHbTs > hbTimeoutMS) {<NEW_LINE>LOG.fatal("can not connect to master in " + hbTimeoutMS + " ms. the client will be killed by itself");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>Thread.sleep(hbIntervalMS);<NEW_LINE>master.keepAlive(null, KeepAliveRequest.newBuilder().setClientId<MASK><NEW_LINE>lastHbTs = System.currentTimeMillis();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (!stopped.get()) {<NEW_LINE>LOG.error("AngelClient " + clientId + " send heartbeat to Master failed ", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>hbThread.setName("client-heartbeat");<NEW_LINE>hbThread.setDaemon(true);<NEW_LINE>hbThread.start();<NEW_LINE>}
(clientId).build());
1,035,362
public Request<UpdateCloudFrontOriginAccessIdentityRequest> marshall(UpdateCloudFrontOriginAccessIdentityRequest updateCloudFrontOriginAccessIdentityRequest) {<NEW_LINE>if (updateCloudFrontOriginAccessIdentityRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<UpdateCloudFrontOriginAccessIdentityRequest> request = new DefaultRequest<UpdateCloudFrontOriginAccessIdentityRequest>(updateCloudFrontOriginAccessIdentityRequest, "AmazonCloudFront");<NEW_LINE>request.setHttpMethod(HttpMethodName.PUT);<NEW_LINE>if (updateCloudFrontOriginAccessIdentityRequest.getIfMatch() != null) {<NEW_LINE>request.addHeader("If-Match", StringUtils.fromString(updateCloudFrontOriginAccessIdentityRequest.getIfMatch()));<NEW_LINE>}<NEW_LINE>String uriResourcePath = "/2020-05-31/origin-access-identity/cloudfront/{Id}/config";<NEW_LINE>uriResourcePath = com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(uriResourcePath, "Id", updateCloudFrontOriginAccessIdentityRequest.getId());<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>XMLWriter xmlWriter <MASK><NEW_LINE>CloudFrontOriginAccessIdentityConfig cloudFrontOriginAccessIdentityConfig = updateCloudFrontOriginAccessIdentityRequest.getCloudFrontOriginAccessIdentityConfig();<NEW_LINE>if (cloudFrontOriginAccessIdentityConfig != null) {<NEW_LINE>xmlWriter.startElement("CloudFrontOriginAccessIdentityConfig");<NEW_LINE>if (cloudFrontOriginAccessIdentityConfig.getCallerReference() != null) {<NEW_LINE>xmlWriter.startElement("CallerReference").value(cloudFrontOriginAccessIdentityConfig.getCallerReference()).endElement();<NEW_LINE>}<NEW_LINE>if (cloudFrontOriginAccessIdentityConfig.getComment() != null) {<NEW_LINE>xmlWriter.startElement("Comment").value(cloudFrontOriginAccessIdentityConfig.getComment()).endElement();<NEW_LINE>}<NEW_LINE>xmlWriter.endElement();<NEW_LINE>}<NEW_LINE>request.setContent(new StringInputStream(stringWriter.getBuffer().toString()));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(stringWriter.getBuffer().toString().getBytes(UTF8).length));<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/xml");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to XML: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
= new XMLWriter(stringWriter, "http://cloudfront.amazonaws.com/doc/2020-05-31/");
1,367,768
private void doLoop(int packetCount, NativeMappings.pcap_handler handler) throws PcapNativeException, InterruptedException, NotOpenException {<NEW_LINE>if (!open) {<NEW_LINE>throw new NotOpenException();<NEW_LINE>}<NEW_LINE>if (!handleLock.readLock().tryLock()) {<NEW_LINE>throw new NotOpenException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!open) {<NEW_LINE>throw new NotOpenException();<NEW_LINE>}<NEW_LINE>logger.info("Starting loop.");<NEW_LINE>int rc = NativeMappings.pcap_loop(handle, packetCount, handler, null);<NEW_LINE>switch(rc) {<NEW_LINE>case 0:<NEW_LINE>logger.info("Finished loop.");<NEW_LINE>break;<NEW_LINE>case -1:<NEW_LINE>throw new PcapNativeException(<MASK><NEW_LINE>case -2:<NEW_LINE>logger.info("Broken.");<NEW_LINE>throw new InterruptedException();<NEW_LINE>default:<NEW_LINE>throw new PcapNativeException("Unexpected error occurred: " + getError(), rc);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>handleLock.readLock().unlock();<NEW_LINE>}<NEW_LINE>}
"Error occurred: " + getError(), rc);
657,411
public static KeyPair loadKeyPairFromKeystore(String keystoreFile, String storePassword, String keyPassword, String keyAlias, KeystoreFormat format) {<NEW_LINE>InputStream stream = FindFile.findFile(keystoreFile);<NEW_LINE>try {<NEW_LINE>KeyStore keyStore = null;<NEW_LINE>if (format == KeystoreFormat.JKS) {<NEW_LINE>keyStore = KeyStore.getInstance(format.toString());<NEW_LINE>} else {<NEW_LINE>keyStore = KeyStore.getInstance(format.toString(), "BC");<NEW_LINE>}<NEW_LINE>keyStore.load(stream, storePassword.toCharArray());<NEW_LINE>PrivateKey privateKey = (PrivateKey) keyStore.getKey(keyAlias, keyPassword.toCharArray());<NEW_LINE>if (privateKey == null) {<NEW_LINE>throw new RuntimeException("Couldn't load key with alias '" + keyAlias + "' from keystore");<NEW_LINE>}<NEW_LINE>PublicKey publicKey = keyStore.<MASK><NEW_LINE>return new KeyPair(publicKey, privateKey);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Failed to load private key: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
getCertificate(keyAlias).getPublicKey();
926,900
public static DescribeDeploymentSetsResponse unmarshall(DescribeDeploymentSetsResponse describeDeploymentSetsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDeploymentSetsResponse.setRequestId(_ctx.stringValue("DescribeDeploymentSetsResponse.RequestId"));<NEW_LINE>describeDeploymentSetsResponse.setPageSize(_ctx.integerValue("DescribeDeploymentSetsResponse.PageSize"));<NEW_LINE>describeDeploymentSetsResponse.setPageNumber(_ctx.integerValue("DescribeDeploymentSetsResponse.PageNumber"));<NEW_LINE>describeDeploymentSetsResponse.setTotalCount(_ctx.integerValue("DescribeDeploymentSetsResponse.TotalCount"));<NEW_LINE>describeDeploymentSetsResponse.setRegionId(_ctx.stringValue("DescribeDeploymentSetsResponse.RegionId"));<NEW_LINE>List<DeploymentSet> deploymentSets = new ArrayList<DeploymentSet>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDeploymentSetsResponse.DeploymentSets.Length"); i++) {<NEW_LINE>DeploymentSet deploymentSet = new DeploymentSet();<NEW_LINE>deploymentSet.setCreationTime(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].CreationTime"));<NEW_LINE>deploymentSet.setStrategy(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].Strategy"));<NEW_LINE>deploymentSet.setDeploymentSetId(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].DeploymentSetId"));<NEW_LINE>deploymentSet.setDeploymentStrategy(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].DeploymentStrategy"));<NEW_LINE>deploymentSet.setDeploymentSetDescription(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].DeploymentSetDescription"));<NEW_LINE>deploymentSet.setDomain(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].Domain"));<NEW_LINE>deploymentSet.setGroupCount(_ctx.integerValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].GroupCount"));<NEW_LINE>deploymentSet.setGranularity(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].Granularity"));<NEW_LINE>deploymentSet.setDeploymentSetName(_ctx.stringValue<MASK><NEW_LINE>deploymentSet.setInstanceAmount(_ctx.integerValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].InstanceAmount"));<NEW_LINE>List<String> instanceIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].InstanceIds.Length"); j++) {<NEW_LINE>instanceIds.add(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].InstanceIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>deploymentSet.setInstanceIds(instanceIds);<NEW_LINE>List<Capacity> capacities = new ArrayList<Capacity>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].Capacities.Length"); j++) {<NEW_LINE>Capacity capacity = new Capacity();<NEW_LINE>capacity.setZoneId(_ctx.stringValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].Capacities[" + j + "].ZoneId"));<NEW_LINE>capacity.setUsedAmount(_ctx.integerValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].Capacities[" + j + "].UsedAmount"));<NEW_LINE>capacity.setAvailableAmount(_ctx.integerValue("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].Capacities[" + j + "].AvailableAmount"));<NEW_LINE>capacities.add(capacity);<NEW_LINE>}<NEW_LINE>deploymentSet.setCapacities(capacities);<NEW_LINE>deploymentSets.add(deploymentSet);<NEW_LINE>}<NEW_LINE>describeDeploymentSetsResponse.setDeploymentSets(deploymentSets);<NEW_LINE>return describeDeploymentSetsResponse;<NEW_LINE>}
("DescribeDeploymentSetsResponse.DeploymentSets[" + i + "].DeploymentSetName"));
1,170,617
public Network implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context) throws InsufficientVirtualNetworkCapacityException {<NEW_LINE>assert network.getState() == State.Implementing : "Why are we implementing " + network;<NEW_LINE>final long dcId = dest.getDataCenter().getId();<NEW_LINE>// get physical network id<NEW_LINE>Long physicalNetworkId = network.getPhysicalNetworkId();<NEW_LINE>// physical network id can be null in Guest Network in Basic zone, so locate the physical network<NEW_LINE>if (physicalNetworkId == null) {<NEW_LINE>physicalNetworkId = _networkModel.findPhysicalNetworkId(dcId, offering.getTags(), offering.getTrafficType());<NEW_LINE>}<NEW_LINE>final NetworkVO implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, network.getDataCenterId(), physicalNetworkId, offering.isRedundantRouter());<NEW_LINE>allocateVnet(network, implemented, dcId, <MASK><NEW_LINE>if (network.getGateway() != null) {<NEW_LINE>implemented.setGateway(network.getGateway());<NEW_LINE>}<NEW_LINE>if (network.getCidr() != null) {<NEW_LINE>implemented.setCidr(network.getCidr());<NEW_LINE>}<NEW_LINE>return implemented;<NEW_LINE>}
physicalNetworkId, context.getReservationId());
623,371
public static DescribeVnNavigationConfigResponse unmarshall(DescribeVnNavigationConfigResponse describeVnNavigationConfigResponse, UnmarshallerContext context) {<NEW_LINE>describeVnNavigationConfigResponse.setRequestId<MASK><NEW_LINE>GreetingConfig greetingConfig = new GreetingConfig();<NEW_LINE>greetingConfig.setGreetingWords(context.stringValue("DescribeVnNavigationConfigResponse.GreetingConfig.GreetingWords"));<NEW_LINE>describeVnNavigationConfigResponse.setGreetingConfig(greetingConfig);<NEW_LINE>UnrecognizingConfig unrecognizingConfig = new UnrecognizingConfig();<NEW_LINE>unrecognizingConfig.setPrompt(context.stringValue("DescribeVnNavigationConfigResponse.UnrecognizingConfig.Prompt"));<NEW_LINE>unrecognizingConfig.setThreshold(context.integerValue("DescribeVnNavigationConfigResponse.UnrecognizingConfig.Threshold"));<NEW_LINE>unrecognizingConfig.setFinalPrompt(context.stringValue("DescribeVnNavigationConfigResponse.UnrecognizingConfig.FinalPrompt"));<NEW_LINE>unrecognizingConfig.setFinalAction(context.stringValue("DescribeVnNavigationConfigResponse.UnrecognizingConfig.FinalAction"));<NEW_LINE>unrecognizingConfig.setFinalActionParams(context.stringValue("DescribeVnNavigationConfigResponse.UnrecognizingConfig.FinalActionParams"));<NEW_LINE>describeVnNavigationConfigResponse.setUnrecognizingConfig(unrecognizingConfig);<NEW_LINE>RepeatingConfig repeatingConfig = new RepeatingConfig();<NEW_LINE>List<String> utterances = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeVnNavigationConfigResponse.RepeatingConfig.Utterances.Length"); i++) {<NEW_LINE>utterances.add(context.stringValue("DescribeVnNavigationConfigResponse.RepeatingConfig.Utterances[" + i + "]"));<NEW_LINE>}<NEW_LINE>repeatingConfig.setUtterances(utterances);<NEW_LINE>describeVnNavigationConfigResponse.setRepeatingConfig(repeatingConfig);<NEW_LINE>AskingBackConfig askingBackConfig = new AskingBackConfig();<NEW_LINE>askingBackConfig.setEnabled(context.booleanValue("DescribeVnNavigationConfigResponse.AskingBackConfig.Enabled"));<NEW_LINE>askingBackConfig.setPrompt(context.stringValue("DescribeVnNavigationConfigResponse.AskingBackConfig.Prompt"));<NEW_LINE>askingBackConfig.setEnableNegativeFeedback(context.booleanValue("DescribeVnNavigationConfigResponse.AskingBackConfig.EnableNegativeFeedback"));<NEW_LINE>askingBackConfig.setNegativeFeedbackPrompt(context.stringValue("DescribeVnNavigationConfigResponse.AskingBackConfig.NegativeFeedbackPrompt"));<NEW_LINE>askingBackConfig.setNegativeFeedbackAction(context.stringValue("DescribeVnNavigationConfigResponse.AskingBackConfig.NegativeFeedbackAction"));<NEW_LINE>askingBackConfig.setNegativeFeedbackActionParams(context.stringValue("DescribeVnNavigationConfigResponse.AskingBackConfig.NegativeFeedbackActionParams"));<NEW_LINE>List<String> negativeFeedbackUtterances = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeVnNavigationConfigResponse.AskingBackConfig.NegativeFeedbackUtterances.Length"); i++) {<NEW_LINE>negativeFeedbackUtterances.add(context.stringValue("DescribeVnNavigationConfigResponse.AskingBackConfig.NegativeFeedbackUtterances[" + i + "]"));<NEW_LINE>}<NEW_LINE>askingBackConfig.setNegativeFeedbackUtterances(negativeFeedbackUtterances);<NEW_LINE>describeVnNavigationConfigResponse.setAskingBackConfig(askingBackConfig);<NEW_LINE>ComplainingConfig complainingConfig = new ComplainingConfig();<NEW_LINE>complainingConfig.setPrompt(context.stringValue("DescribeVnNavigationConfigResponse.ComplainingConfig.Prompt"));<NEW_LINE>complainingConfig.setFinalAction(context.stringValue("DescribeVnNavigationConfigResponse.ComplainingConfig.FinalAction"));<NEW_LINE>complainingConfig.setFinalActionParams(context.stringValue("DescribeVnNavigationConfigResponse.ComplainingConfig.FinalActionParams"));<NEW_LINE>List<String> utterances1 = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeVnNavigationConfigResponse.ComplainingConfig.Utterances.Length"); i++) {<NEW_LINE>utterances1.add(context.stringValue("DescribeVnNavigationConfigResponse.ComplainingConfig.Utterances[" + i + "]"));<NEW_LINE>}<NEW_LINE>complainingConfig.setUtterances1(utterances1);<NEW_LINE>describeVnNavigationConfigResponse.setComplainingConfig(complainingConfig);<NEW_LINE>SilenceTimeoutConfig silenceTimeoutConfig = new SilenceTimeoutConfig();<NEW_LINE>silenceTimeoutConfig.setPrompt(context.stringValue("DescribeVnNavigationConfigResponse.SilenceTimeoutConfig.Prompt"));<NEW_LINE>silenceTimeoutConfig.setTimeout(context.longValue("DescribeVnNavigationConfigResponse.SilenceTimeoutConfig.Timeout"));<NEW_LINE>silenceTimeoutConfig.setThreshold(context.integerValue("DescribeVnNavigationConfigResponse.SilenceTimeoutConfig.Threshold"));<NEW_LINE>silenceTimeoutConfig.setFinalPrompt(context.stringValue("DescribeVnNavigationConfigResponse.SilenceTimeoutConfig.FinalPrompt"));<NEW_LINE>silenceTimeoutConfig.setFinalAction(context.stringValue("DescribeVnNavigationConfigResponse.SilenceTimeoutConfig.FinalAction"));<NEW_LINE>silenceTimeoutConfig.setFinalActionParams(context.stringValue("DescribeVnNavigationConfigResponse.SilenceTimeoutConfig.FinalActionParams"));<NEW_LINE>describeVnNavigationConfigResponse.setSilenceTimeoutConfig(silenceTimeoutConfig);<NEW_LINE>return describeVnNavigationConfigResponse;<NEW_LINE>}
(context.stringValue("DescribeVnNavigationConfigResponse.RequestId"));
1,827,441
private Example applyCustomizationsToExample(Example example, Operation operation) {<NEW_LINE>if (example == null)<NEW_LINE>return null;<NEW_LINE>System.out.println(String.format("Customizing operation example : %s", example.getId()));<NEW_LINE>Input input = operation.getInput();<NEW_LINE>if (input != null) {<NEW_LINE>String inputShapeName = input.getShape();<NEW_LINE>Shape inputShape = serviceModel.getShape(inputShapeName);<NEW_LINE>JsonNode inputValue = example.getInput();<NEW_LINE>example.setInput(applyCustomizationsToShapeJson(inputShapeName, inputShape, inputValue));<NEW_LINE>}<NEW_LINE>Output output = operation.getOutput();<NEW_LINE>if (output != null) {<NEW_LINE>String outputShapeName = output.getShape();<NEW_LINE>Shape <MASK><NEW_LINE>JsonNode outputValue = example.getOutput();<NEW_LINE>example.setOutput(applyCustomizationsToShapeJson(outputShapeName, outputShape, outputValue));<NEW_LINE>}<NEW_LINE>return example;<NEW_LINE>}
outputShape = serviceModel.getShape(outputShapeName);
1,250,956
public LatticeNode concatenate(List<LatticeNode> path, int begin, int end, Lattice lattice, String normalizedForm) {<NEW_LINE>if (begin >= end) {<NEW_LINE>throw new IndexOutOfBoundsException("begin >= end");<NEW_LINE>}<NEW_LINE>int b = path.get(begin).getBegin();<NEW_LINE>int e = path.get(end - 1).getEnd();<NEW_LINE>short posId = path.get(begin).getWordInfo().getPOSId();<NEW_LINE>StringBuilder surface = new StringBuilder();<NEW_LINE>int length = 0;<NEW_LINE>StringBuilder normalizedFormBuilder = new StringBuilder();<NEW_LINE>StringBuilder dictionaryForm = new StringBuilder();<NEW_LINE>StringBuilder readingForm = new StringBuilder();<NEW_LINE>for (int i = begin; i < end; i++) {<NEW_LINE>WordInfo info = path.<MASK><NEW_LINE>surface.append(info.getSurface());<NEW_LINE>length += info.getLength();<NEW_LINE>if (normalizedForm == null) {<NEW_LINE>normalizedFormBuilder.append(info.getNormalizedForm());<NEW_LINE>}<NEW_LINE>dictionaryForm.append(info.getDictionaryForm());<NEW_LINE>readingForm.append(info.getReadingForm());<NEW_LINE>}<NEW_LINE>WordInfo wi = new WordInfo(surface.toString(), (short) length, posId, (normalizedForm == null) ? normalizedFormBuilder.toString() : normalizedForm, dictionaryForm.toString(), readingForm.toString());<NEW_LINE>LatticeNode node = lattice.createNode();<NEW_LINE>node.setRange(b, e);<NEW_LINE>node.setWordInfo(wi);<NEW_LINE>replaceNode(path, begin, end, node);<NEW_LINE>return node;<NEW_LINE>}
get(i).getWordInfo();
657,294
private void fillBuffer(int start) {<NEW_LINE>// adjust start if needed<NEW_LINE>if (start > 0) {<NEW_LINE>if (start + 200 >= m_sort.size()) {<NEW_LINE>start = start - (200 - (m_sort.size() - start));<NEW_LINE>if (start < 0) {<NEW_LINE>start = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder sql = new StringBuilder();<NEW_LINE>sql.append(m_SQL_Select).append(" WHERE ").append(getKeyColumnName()).append(" IN (");<NEW_LINE>m_cacheStart = start;<NEW_LINE>m_cacheEnd = m_cacheStart - 1;<NEW_LINE>Map<Integer, Integer> rowmap = new LinkedHashMap<>(200);<NEW_LINE>for (int i = start; i < start + 200 && i < m_sort.size(); i++) {<NEW_LINE>if (i > start) {<NEW_LINE>sql.append(",");<NEW_LINE>}<NEW_LINE>sql.append(m_sort.get(i).index);<NEW_LINE>rowmap.put(m_sort.get(i).index, i);<NEW_LINE>}<NEW_LINE>sql.append(")");<NEW_LINE>m_buffer = new ArrayList<>(210);<NEW_LINE>for (int i = 0; i < 200; i++) {<NEW_LINE>m_buffer.add(null);<NEW_LINE>}<NEW_LINE>PreparedStatement stmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>stmt = DB.prepareStatement(sql.toString(), null);<NEW_LINE>rs = stmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>final Object[] data = readData(rs, m_fields);<NEW_LINE>final int row = rowmap.remove(data[m_indexKeyColumn]);<NEW_LINE>m_buffer.set(row - m_cacheStart, data);<NEW_LINE>m_cacheEnd++;<NEW_LINE>}<NEW_LINE>if (!rowmap.isEmpty()) {<NEW_LINE>List<Integer> <MASK><NEW_LINE>for (Map.Entry<Integer, Integer> entry : rowmap.entrySet()) {<NEW_LINE>toremove.add(entry.getValue());<NEW_LINE>}<NEW_LINE>Collections.reverse(toremove);<NEW_LINE>for (Integer row : toremove) {<NEW_LINE>m_sort.remove((int) row);<NEW_LINE>m_buffer.remove(row - m_cacheStart);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.error(e.getLocalizedMessage(), e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, stmt);<NEW_LINE>}<NEW_LINE>}
toremove = new ArrayList<>();
1,415,306
protected DataViewComponent createComponent() {<NEW_LINE>GlobalPreferences preferences = GlobalPreferences.sharedInstance();<NEW_LINE>int chartCache = preferences.getMonitoredHostCache() * 60 / preferences.getMonitoredHostPoll();<NEW_LINE>DataViewComponent dvc = new DataViewComponent(new MasterViewSupport((Host) getDataSource()).getMasterView(), new DataViewComponent.MasterViewConfiguration(false));<NEW_LINE>boolean cpuSupported = hostOverview.getSystemLoadAverage() >= 0;<NEW_LINE>final CpuLoadViewSupport cpuLoadViewSupport = new CpuLoadViewSupport(hostOverview, cpuSupported, chartCache);<NEW_LINE>// NOI18N<NEW_LINE>dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration(NbBundle.getMessage(HostOverviewView.class, "LBL_CPU"), true), DataViewComponent.TOP_LEFT);<NEW_LINE>dvc.addDetailsView(cpuLoadViewSupport.getDetailsView(), DataViewComponent.TOP_LEFT);<NEW_LINE>if (!cpuSupported)<NEW_LINE><MASK><NEW_LINE>final PhysicalMemoryViewSupport physicalMemoryViewSupport = new PhysicalMemoryViewSupport(chartCache);<NEW_LINE>// NOI18N<NEW_LINE>dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration(NbBundle.getMessage(HostOverviewView.class, "LBL_Memory"), true), DataViewComponent.TOP_RIGHT);<NEW_LINE>dvc.addDetailsView(physicalMemoryViewSupport.getDetailsView(), DataViewComponent.TOP_RIGHT);<NEW_LINE>final SwapMemoryViewSupport swapMemoryViewSupport = new SwapMemoryViewSupport(chartCache);<NEW_LINE>dvc.addDetailsView(swapMemoryViewSupport.getDetailsView(), DataViewComponent.TOP_RIGHT);<NEW_LINE>timer = new Timer(2000, new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>final long time = System.currentTimeMillis();<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>cpuLoadViewSupport.refresh(hostOverview, time);<NEW_LINE>physicalMemoryViewSupport.refresh(hostOverview, time);<NEW_LINE>swapMemoryViewSupport.refresh(hostOverview, time);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>timer.setInitialDelay(800);<NEW_LINE>timer.start();<NEW_LINE>((Host) getDataSource()).notifyWhenRemoved(this);<NEW_LINE>return dvc;<NEW_LINE>}
dvc.hideDetailsArea(DataViewComponent.TOP_LEFT);
309,813
public final Object read(final InputStream is) {<NEW_LINE>int states = 0;<NEW_LINE>int[] items;<NEW_LINE>double[] pi = null;<NEW_LINE>Matrix transitionProbability = null;<NEW_LINE>Map<String, String> properties = null;<NEW_LINE>List<StateDistribution> distributions = new ArrayList<StateDistribution>();<NEW_LINE>final EncogReadHelper in = new EncogReadHelper(is);<NEW_LINE>EncogFileSection section;<NEW_LINE>while ((section = in.readNextSection()) != null) {<NEW_LINE>if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("PARAMS")) {<NEW_LINE>properties = section.parseParams();<NEW_LINE>}<NEW_LINE>if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("CONFIG")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>states = EncogFileSection.parseInt(params, HiddenMarkovModel.TAG_STATES);<NEW_LINE>if (params.containsKey(HiddenMarkovModel.TAG_ITEMS)) {<NEW_LINE>items = EncogFileSection.parseIntArray(params, HiddenMarkovModel.TAG_ITEMS);<NEW_LINE>}<NEW_LINE>pi = section.parseDoubleArray(params, HiddenMarkovModel.TAG_PI);<NEW_LINE>transitionProbability = section.parseMatrix(params, HiddenMarkovModel.TAG_TRANSITION);<NEW_LINE>} else if (section.getSectionName().equals("HMM") && section.getSubSectionName().startsWith("DISTRIBUTION-")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>String t = params.get(HiddenMarkovModel.TAG_DIST_TYPE);<NEW_LINE>if ("ContinousDistribution".equals(t)) {<NEW_LINE>double[] mean = section.parseDoubleArray(params, HiddenMarkovModel.TAG_MEAN);<NEW_LINE>Matrix cova = section.parseMatrix(params, HiddenMarkovModel.TAG_COVARIANCE);<NEW_LINE>ContinousDistribution dist = new ContinousDistribution(mean, cova.getData());<NEW_LINE>distributions.add(dist);<NEW_LINE>} else if ("DiscreteDistribution".equals(t)) {<NEW_LINE>Matrix prob = section.parseMatrix(params, HiddenMarkovModel.TAG_PROBABILITIES);<NEW_LINE>DiscreteDistribution dist = new <MASK><NEW_LINE>distributions.add(dist);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final HiddenMarkovModel result = new HiddenMarkovModel(states);<NEW_LINE>result.getProperties().putAll(properties);<NEW_LINE>result.setTransitionProbability(transitionProbability.getData());<NEW_LINE>result.setPi(pi);<NEW_LINE>int index = 0;<NEW_LINE>for (StateDistribution dist : distributions) {<NEW_LINE>result.setStateDistribution(index++, dist);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
DiscreteDistribution(prob.getData());
469,947
private static void flush(StringBuilder out, List<Match> matches) {<NEW_LINE>boolean methods = matches.stream().anyMatch(match -> match.code.<MASK><NEW_LINE>if (matches.size() == 1 && methods) {<NEW_LINE>out.append(matches.get(0).original);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Match> distinct = matches.stream().distinct().collect(Collectors.toList());<NEW_LINE>distinct.forEach(match -> out.append("<a id=\"").append(match.link).append("\">").append(match.linkContents).append("</a>\n"));<NEW_LINE>out.append(distinct.get(distinct.size() - 1).block).append("<h4>").append(distinct.stream().map(match -> match.seeAlso == null ? match.name : "<a href=\"" + match.seeAlso + "\">" + match.name + "</a>").distinct().collect(Collectors.joining(", "))).append("</h4>\n");<NEW_LINE>if (methods) {<NEW_LINE>out.append("<pre>").append(distinct.stream().map(match -> match.code + "\n").collect(Collectors.joining("\n"))).append("</pre>\n");<NEW_LINE>}<NEW_LINE>out.append(distinct.get(0).documentation).append("</li></ul>\n");<NEW_LINE>}
indexOf('(') != -1);
89,799
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>MariaDBConfig config = new MariaDBConfig(instrumentor.getProfilerConfig());<NEW_LINE>InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>target.addField(DatabaseInfoAccessor.class);<NEW_LINE>target.addField(ParsingResultAccessor.class);<NEW_LINE><MASK><NEW_LINE>if (config.isTraceSqlBindValue()) {<NEW_LINE>final PreparedStatementBindingMethodFilter excludes = PreparedStatementBindingMethodFilter.excludes("setRowId", "setNClob", "setSQLXML");<NEW_LINE>final List<InstrumentMethod> declaredMethods = target.getDeclaredMethods(excludes);<NEW_LINE>for (InstrumentMethod method : declaredMethods) {<NEW_LINE>method.addScopedInterceptor(PreparedStatementBindVariableInterceptor.class, MARIADB_SCOPE, ExecutionPolicy.BOUNDARY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>}
target.addField(BindValueAccessor.class);
959,198
private void magicParameterExplodedStyleSimpleTypeObject(Parameter parameter) {<NEW_LINE>ObjectTypeValidator objectTypeValidator = ObjectTypeValidator.ObjectTypeValidatorFactory.<MASK><NEW_LINE>this.resolveObjectTypeFields(objectTypeValidator, parameter.getSchema());<NEW_LINE>switch(parameter.getIn()) {<NEW_LINE>case "path":<NEW_LINE>this.addPathParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameter.getName(), objectTypeValidator, !OpenApi3Utils.isRequiredParam(parameter), OpenApi3Utils.resolveAllowEmptyValue(parameter), ParameterLocation.PATH));<NEW_LINE>break;<NEW_LINE>case "header":<NEW_LINE>this.addHeaderParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameter.getName(), objectTypeValidator, !OpenApi3Utils.isRequiredParam(parameter), OpenApi3Utils.resolveAllowEmptyValue(parameter), ParameterLocation.HEADER));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new SpecFeatureNotSupportedException("combination of style, type and location (in) of parameter fields " + "not supported for parameter " + parameter.getName());<NEW_LINE>}<NEW_LINE>}
createObjectTypeValidator(ContainerSerializationStyle.simple_exploded_object, false);
1,213,530
public BatchDetectSyntaxResult batchDetectSyntax(BatchDetectSyntaxRequest batchDetectSyntaxRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDetectSyntaxRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDetectSyntaxRequest> request = null;<NEW_LINE>Response<BatchDetectSyntaxResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchDetectSyntaxRequestMarshaller().marshall(batchDetectSyntaxRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<BatchDetectSyntaxResult, JsonUnmarshallerContext> unmarshaller = new BatchDetectSyntaxResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<BatchDetectSyntaxResult> responseHandler = new JsonResponseHandler<BatchDetectSyntaxResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,213,782
public void refresh(TableCell cell) {<NEW_LINE>DownloadManager dm = (DownloadManager) cell.getDataSource();<NEW_LINE>String text;<NEW_LINE>String tt = null;<NEW_LINE>if (dm == null) {<NEW_LINE>text = null;<NEW_LINE>} else {<NEW_LINE>text = dm.getDownloadState().getAttribute(DownloadManagerState.AT_MOVE_ON_COMPLETE_DIR);<NEW_LINE>if (text == null) {<NEW_LINE>List<Tag> moc_tags = TagUtils.getActiveMoveOnCompleteTags(dm, true, (str) -> {<NEW_LINE>});<NEW_LINE>String str_text = "";<NEW_LINE>String str_tt = "";<NEW_LINE>if (!moc_tags.isEmpty()) {<NEW_LINE>for (Tag tag : moc_tags) {<NEW_LINE>TagFeatureFileLocation fl = (TagFeatureFileLocation) tag;<NEW_LINE>File file = fl.getTagMoveOnCompleteFolder();<NEW_LINE>if (file != null) {<NEW_LINE>str_text += (str_text.isEmpty() ? "" : ", ") + (moc_tags.size() == 1 ? "" : (tag.getTagName(true) + "->"<MASK><NEW_LINE>str_tt += (str_tt.isEmpty() ? "" : ", ") + tag.getTagName(true) + "->" + file.getAbsolutePath();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!str_text.isEmpty()) {<NEW_LINE>text = "(" + str_text + ")";<NEW_LINE>tt = str_tt;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (text == null) {<NEW_LINE>text = "";<NEW_LINE>}<NEW_LINE>cell.setToolTip(tt);<NEW_LINE>if (!cell.setSortValue(text) && cell.isValid()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>cell.setText(text);<NEW_LINE>}
)) + file.getAbsolutePath();
1,090,239
private ImmutableMultimap<Path, PrintingSegment> extractAndAssignPaths(@NonNull final String baseDirectory, @NonNull final PrintingData printingData) {<NEW_LINE>final ImmutableMultimap.Builder<Path, PrintingSegment> path2Segments = new ImmutableMultimap.Builder<>();<NEW_LINE>for (final PrintingSegment segment : printingData.getSegments()) {<NEW_LINE>final HardwarePrinter printer = segment.getPrinter();<NEW_LINE>if (!OutputType.Store.equals(printer.getOutputType())) {<NEW_LINE>logger.debug("Printer with id={} has outputType={}; -> skipping it", printer.getId().getRepoId(), printer.getOutputType());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Path path;<NEW_LINE>if (segment.getTrayId() != null) {<NEW_LINE>final HardwareTray tray = printer.<MASK><NEW_LINE>path = Paths.get(baseDirectory, FileUtil.stripIllegalCharacters(printer.getName()), FileUtil.stripIllegalCharacters(tray.getTrayNumber() + "-" + tray.getName()));<NEW_LINE>} else {<NEW_LINE>path = Paths.get(baseDirectory, FileUtil.stripIllegalCharacters(printer.getName()));<NEW_LINE>}<NEW_LINE>path2Segments.put(path, segment);<NEW_LINE>}<NEW_LINE>return path2Segments.build();<NEW_LINE>}
getTray(segment.getTrayId());
919,957
protected void putMetadataAndHashIndexTask(Transaction t, Map<Long, StreamMetadata> streamIdsToMetadata) {<NEW_LINE>UserPhotosStreamMetadataTable mdTable = tables.getUserPhotosStreamMetadataTable(t);<NEW_LINE>Map<Long, StreamMetadata> prevMetadatas = getMetadata(t, streamIdsToMetadata.keySet());<NEW_LINE>Map<UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow, StreamMetadata> rowsToStoredMetadata = new HashMap<>();<NEW_LINE>Map<UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow, StreamMetadata> rowsToUnstoredMetadata = new HashMap<>();<NEW_LINE>for (Entry<Long, StreamMetadata> e : streamIdsToMetadata.entrySet()) {<NEW_LINE>long streamId = e.getKey();<NEW_LINE>StreamMetadata metadata = e.getValue();<NEW_LINE>StreamMetadata prevMetadata = prevMetadatas.get(streamId);<NEW_LINE>if (metadata.getStatus() == Status.STORED) {<NEW_LINE>if (prevMetadata == null || prevMetadata.getStatus() != Status.STORING) {<NEW_LINE>// This can happen if we cleanup old streams.<NEW_LINE>throw new TransactionFailedRetriableException("Cannot mark a stream as stored that isn't currently storing: " + prevMetadata);<NEW_LINE>}<NEW_LINE>rowsToStoredMetadata.put(UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow.of(streamId), metadata);<NEW_LINE>} else if (metadata.getStatus() == Status.STORING) {<NEW_LINE>// This will prevent two users trying to store the same id.<NEW_LINE>if (prevMetadata != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>rowsToUnstoredMetadata.put(UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow.of(streamId), metadata);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>putHashIndexTask(t, rowsToStoredMetadata);<NEW_LINE>Map<UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow, StreamMetadata> rowsToMetadata = new HashMap<>();<NEW_LINE>rowsToMetadata.putAll(rowsToStoredMetadata);<NEW_LINE>rowsToMetadata.putAll(rowsToUnstoredMetadata);<NEW_LINE>mdTable.putMetadata(rowsToMetadata);<NEW_LINE>}
throw new TransactionFailedRetriableException("Cannot reuse the same stream id: " + streamId);
1,547,138
public static TextView createItemTextView(Context context) {<NEW_LINE>TextView tv = new QMUISpanTouchFixTextView(context);<NEW_LINE>TypedArray a = context.obtainStyledAttributes(null, R.styleable.QMUIDialogMenuTextStyleDef, R.attr.qmui_dialog_menu_item_style, 0);<NEW_LINE>int count = a.getIndexCount();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>int attr = a.getIndex(i);<NEW_LINE>if (attr == R.styleable.QMUIDialogMenuTextStyleDef_android_gravity) {<NEW_LINE>tv.setGravity(a.<MASK><NEW_LINE>} else if (attr == R.styleable.QMUIDialogMenuTextStyleDef_android_textColor) {<NEW_LINE>tv.setTextColor(a.getColorStateList(attr));<NEW_LINE>} else if (attr == R.styleable.QMUIDialogMenuTextStyleDef_android_textSize) {<NEW_LINE>tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, a.getDimensionPixelSize(attr, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>a.recycle();<NEW_LINE>tv.setId(View.generateViewId());<NEW_LINE>tv.setSingleLine(true);<NEW_LINE>tv.setEllipsize(TextUtils.TruncateAt.MIDDLE);<NEW_LINE>tv.setDuplicateParentStateEnabled(false);<NEW_LINE>QMUISkinValueBuilder builder = QMUISkinValueBuilder.acquire();<NEW_LINE>builder.textColor(R.attr.qmui_skin_support_dialog_menu_item_text_color);<NEW_LINE>QMUISkinHelper.setSkinValue(tv, builder);<NEW_LINE>QMUISkinValueBuilder.release(builder);<NEW_LINE>return tv;<NEW_LINE>}
getInt(attr, -1));
195,503
private void drawVerticalGradient(Canvas canvas, int left, int top, int right, int bottom, int color0_R, int color0_G, int color0_B, int color1_R, int color1_G, int color1_B) {<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setAntiAlias(false);<NEW_LINE>paint.setARGB(255, 0, 0, 0);<NEW_LINE>int i;<NEW_LINE>for (i = top; i < bottom; i++) {<NEW_LINE>int ctop = i;<NEW_LINE>int cbottom = i + 1;<NEW_LINE>int cR = color0_R + ((color1_R - color0_R) * (i - top)) / (bottom - top - 1);<NEW_LINE>int cG = color0_G + ((color1_G - color0_G) * (i - top)) <MASK><NEW_LINE>int cB = color0_B + ((color1_B - color0_B) * (i - top)) / (bottom - top - 1);<NEW_LINE>paint.setARGB(255, cR, cG, cB);<NEW_LINE>canvas.drawRect(left, ctop, right, cbottom, paint);<NEW_LINE>}<NEW_LINE>}
/ (bottom - top - 1);
874,673
public static void main(String[] args) {<NEW_LINE>List<PathLabel> examples = new ArrayList<>();<NEW_LINE>examples.add(new PathLabel("Chessboard", UtilIO.pathExample("calibration/mono/Sony_DSC-HX5V_Chess/frame06.jpg")));<NEW_LINE>examples.add(new PathLabel("Square Grid", UtilIO.pathExample("calibration/mono/Sony_DSC-HX5V_Square/frame06.jpg")));<NEW_LINE>examples.add(new PathLabel("Shapes 01", UtilIO.pathExample("shapes/shapes01.png")));<NEW_LINE>examples.add(new PathLabel("Amoeba Shapes", UtilIO.pathExample("amoeba_shapes.jpg")));<NEW_LINE>examples.add(new PathLabel("Sunflowers", UtilIO.pathExample("sunflowers.jpg")));<NEW_LINE>examples.add(new PathLabel("Beach", UtilIO.pathExample("scale/beach02.jpg")));<NEW_LINE>examples.add(new PathLabel("Chessboard Movie", <MASK><NEW_LINE>DemoDetectPointFeaturesApp app = new DemoDetectPointFeaturesApp(examples, GrayF32.class);<NEW_LINE>app.openExample(examples.get(0));<NEW_LINE>app.waitUntilInputSizeIsKnown();<NEW_LINE>app.display("Point Feature Detectors");<NEW_LINE>}
UtilIO.pathExample("fiducial/chessboard/movie.mjpeg")));
17,648
public byte[] decodeMessage() {<NEW_LINE>// Example data<NEW_LINE>// BLINDS1 09 19 00 06 00 B1 8F 01 00 70<NEW_LINE>byte[] data = new byte[10];<NEW_LINE>data[0] = 0x09;<NEW_LINE>data[1] = RFXComBaseMessage.PacketType.BLINDS1.toByte();<NEW_LINE>data[2] = subType.toByte();<NEW_LINE>data[3] = seqNbr;<NEW_LINE>data[4] = (byte) ((<MASK><NEW_LINE>data[5] = (byte) ((sensorId >> 8) & 0xFF);<NEW_LINE>data[6] = (byte) (sensorId & 0xFF);<NEW_LINE>data[7] = unitcode;<NEW_LINE>data[8] = command.toByte();<NEW_LINE>data[9] = (byte) (((signalLevel & 0x0F) << 4) | (batteryLevel & 0x0F));<NEW_LINE>return data;<NEW_LINE>}
sensorId >> 16) & 0xFF);
1,054,431
private Map propertiesToMap(Alert alert) {<NEW_LINE>Map map = new HashMap();<NEW_LINE>map.put("_id", alert.getId());<NEW_LINE>map.put("checkId", alert.getCheckId());<NEW_LINE>map.put("target", alert.getTarget());<NEW_LINE>map.put(<MASK><NEW_LINE>if (alert.getValue() != null) {<NEW_LINE>map.put("value", alert.getValue().toPlainString());<NEW_LINE>}<NEW_LINE>if (alert.getWarn() != null) {<NEW_LINE>map.put("warn", alert.getWarn().toPlainString());<NEW_LINE>}<NEW_LINE>if (alert.getError() != null) {<NEW_LINE>map.put("error", alert.getError().toPlainString());<NEW_LINE>}<NEW_LINE>map.put("fromType", alert.getFromType().toString());<NEW_LINE>map.put("toType", alert.getToType().toString());<NEW_LINE>map.put("timestamp", new Date(alert.getTimestamp().getMillis()));<NEW_LINE>return map;<NEW_LINE>}
"targetHash", alert.getTargetHash());
1,519,971
protected ExecutionStepInfo createExecutionStepInfo(ExecutionContext executionContext, ExecutionStrategyParameters parameters, GraphQLFieldDefinition fieldDefinition, GraphQLObjectType fieldContainer) {<NEW_LINE>MergedField field = parameters.getField();<NEW_LINE>ExecutionStepInfo parentStepInfo = parameters.getExecutionStepInfo();<NEW_LINE>GraphQLOutputType fieldType = fieldDefinition.getType();<NEW_LINE>List<GraphQLArgument> fieldArgDefs = fieldDefinition.getArguments();<NEW_LINE>Map<String, Object> argumentValues = Collections.emptyMap();<NEW_LINE>//<NEW_LINE>// no need to create args at all if there are none on the field def<NEW_LINE>//<NEW_LINE>if (!fieldArgDefs.isEmpty()) {<NEW_LINE>List<Argument> fieldArgs = field.getArguments();<NEW_LINE>GraphQLCodeRegistry codeRegistry = executionContext.getGraphQLSchema().getCodeRegistry();<NEW_LINE>argumentValues = valuesResolver.getArgumentValues(codeRegistry, fieldArgDefs, <MASK><NEW_LINE>}<NEW_LINE>return newExecutionStepInfo().type(fieldType).fieldDefinition(fieldDefinition).fieldContainer(fieldContainer).field(field).path(parameters.getPath()).parentInfo(parentStepInfo).arguments(argumentValues).build();<NEW_LINE>}
fieldArgs, executionContext.getVariables());
1,547,055
public RFuture<Long> fastRemoveAsync(K... keys) {<NEW_LINE>if (keys == null) {<NEW_LINE>throw new NullPointerException();<NEW_LINE>}<NEW_LINE>if (keys.length == 0) {<NEW_LINE>return RedissonPromise.newSucceededFuture(0L);<NEW_LINE>}<NEW_LINE>if (hasNoWriter()) {<NEW_LINE>return fastRemoveOperationAsync(keys);<NEW_LINE>}<NEW_LINE>RFuture<List<Long>> removeFuture = fastRemoveOperationBatchAsync(keys);<NEW_LINE>CompletionStage<Long> f = removeFuture.thenCompose(res -> {<NEW_LINE>if (res.isEmpty()) {<NEW_LINE>return CompletableFuture.completedFuture(0L);<NEW_LINE>}<NEW_LINE>List<K> deletedKeys = new ArrayList<K>();<NEW_LINE>for (int i = 0; i < res.size(); i++) {<NEW_LINE>if (res.get(i) == 1) {<NEW_LINE>deletedKeys<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (options.getWriteMode() == WriteMode.WRITE_BEHIND) {<NEW_LINE>MapWriterTask.Remove task = new MapWriterTask.Remove(deletedKeys);<NEW_LINE>writeBehindTask.addTask(task);<NEW_LINE>return CompletableFuture.completedFuture((long) deletedKeys.size());<NEW_LINE>} else {<NEW_LINE>CompletableFuture<Long> future = new CompletableFuture<>();<NEW_LINE>commandExecutor.getConnectionManager().getExecutor().execute(() -> {<NEW_LINE>try {<NEW_LINE>options.getWriter().delete(deletedKeys);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>future.completeExceptionally(ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>future.complete((long) deletedKeys.size());<NEW_LINE>});<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return new CompletableFutureWrapper<>(f);<NEW_LINE>}
.add(keys[i]);
1,694,075
public SnowconeDeviceConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SnowconeDeviceConfiguration snowconeDeviceConfiguration = new SnowconeDeviceConfiguration();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("WirelessConnection", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>snowconeDeviceConfiguration.setWirelessConnection(WirelessConnectionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return snowconeDeviceConfiguration;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
934,348
public void printLog(int level) {<NEW_LINE>// convert total time to nanoseconds<NEW_LINE>totalTime = (long) (((double) totalTime * (double) 1000000000) / (double) ProfileTimer.getResolution());<NEW_LINE>StringBuffer sb = new StringBuffer(200);<NEW_LINE>for (int i = 0; i < (level * 3); i++) sb.append(' ');<NEW_LINE>sb.append(name);<NEW_LINE>sb.append(" calls=");<NEW_LINE>sb.append(numCalls);<NEW_LINE>if ((totalTime > 0) && (parent != null) && (parent.totalTime > 0)) {<NEW_LINE>long percentTime = (1000L * totalTime) / parent.totalTime;<NEW_LINE>sb.append(", percent=");<NEW_LINE>sb.append((float) percentTime / 10f);<NEW_LINE>sb.append("%, ");<NEW_LINE>}<NEW_LINE>if (numCalls > 0) {<NEW_LINE>sb.append(", avg time=");<NEW_LINE>sb.append(totalTime / numCalls);<NEW_LINE>sb.append("ns (");<NEW_LINE>sb.append(<MASK><NEW_LINE>sb.append("ms)");<NEW_LINE>}<NEW_LINE>Log.profile(channel, sb.toString());<NEW_LINE>ProfileNode child = children;<NEW_LINE>while (child != null) {<NEW_LINE>child.printLog(level + 1);<NEW_LINE>child = child.next;<NEW_LINE>}<NEW_LINE>}
(totalTime / numCalls) / 1000000f);
432,889
public UpdateAssignmentResult updateAssignment(@NonNull final AssignableInvoiceCandidate assignableCandidate, @NonNull final RefundInvoiceCandidate refundCandidateToAssignTo, @NonNull final RefundContract refundContract) {<NEW_LINE>Check.errorUnless(RefundMode.APPLY_TO_ALL_QTIES.equals(refundContract.extractRefundMode()), "refundMode needs to be {}; refundContract={}", RefundMode.APPLY_TO_ALL_QTIES, refundContract);<NEW_LINE>final AssignableInvoiceCandidate assignableCandidateWithoutRefundInvoiceCandidates = assignableCandidate.withoutRefundInvoiceCandidates();<NEW_LINE>//<NEW_LINE>// first part: only assign to the smallest refund config (with minQty=0).<NEW_LINE>final RefundConfig refundConfig = RefundConfigs.smallestMinQty(refundCandidateToAssignTo.getRefundConfigs());<NEW_LINE>Check.assume(refundConfig.getMinQty().signum() == 0, "The first refundConfig of refundCandidateToAssignTo needs to have minQty=0; actual minQty={}; refundConfig={}", refundConfig.getMinQty(), refundConfig);<NEW_LINE>final AssignCandidatesRequest assignCandidatesRequest = AssignCandidatesRequest.builder().assignableInvoiceCandidate(assignableCandidateWithoutRefundInvoiceCandidates).refundInvoiceCandidate(refundCandidateToAssignTo).refundConfig(refundConfig).build();<NEW_LINE>final List<AssignmentToRefundCandidate> createdAssignments = assignCandidate(assignCandidatesRequest, assignableCandidate.getQuantity()).getAssignmentsToRefundCandidates();<NEW_LINE>// the assignableInvoiceCandidate of our assignCandidatesRequest had no assignments, so the result has exactly one assignment.<NEW_LINE>final AssignmentToRefundCandidate createdAssignment = singleElement(createdAssignments);<NEW_LINE>final RefundInvoiceCandidate refundCandidateWithAsignedMoneyAndQty = createdAssignment.getRefundInvoiceCandidate();<NEW_LINE>//<NEW_LINE>// second part: now see if the biggest applicable refund config changed.<NEW_LINE>// if it did change, then add or remove assignments for the respective configs that now apply as well or don't apply anymore<NEW_LINE>final List<RefundConfig> relevantConfigsAfterAssignment = refundContract.getRefundConfigsToApplyForQuantity(refundCandidateWithAsignedMoneyAndQty.getAssignedQuantity().toBigDecimal());<NEW_LINE>final RefundConfig newRefundConfig = RefundConfigs.largestMinQty(relevantConfigsAfterAssignment);<NEW_LINE>final boolean configHasChanged <MASK><NEW_LINE>if (configHasChanged) {<NEW_LINE>refundConfigChangeService.createOrDeleteAdditionalAssignments(refundCandidateWithAsignedMoneyAndQty, refundConfig, newRefundConfig);<NEW_LINE>}<NEW_LINE>final AssignableInvoiceCandidate resultCandidate = // need to reload the assignments<NEW_LINE>assignableCandidate.toBuilder().clearAssignmentsToRefundCandidates().assignmentsToRefundCandidates(assignmentToRefundCandidateRepository.getAssignmentsByAssignableCandidateId(assignableCandidate.getId())).build();<NEW_LINE>return UpdateAssignmentResult.updateDone(resultCandidate, ImmutableList.of());<NEW_LINE>}
= !refundConfig.equals(newRefundConfig);
1,850,980
private static SessionFactory makeSessionFactory(ServiceRegistry serviceRegistry) {<NEW_LINE>MetadataSources metadataSources = new MetadataSources(serviceRegistry);<NEW_LINE>metadataSources.addPackage("com.baeldung.hibernate.pojo");<NEW_LINE>metadataSources.addAnnotatedClass(Employee.class);<NEW_LINE>metadataSources.addAnnotatedClass(Phone.class);<NEW_LINE>metadataSources.addAnnotatedClass(EntityDescription.class);<NEW_LINE>metadataSources.addAnnotatedClass(TemporalValues.class);<NEW_LINE>metadataSources.addAnnotatedClass(DeptEmployee.class);<NEW_LINE>metadataSources.addAnnotatedClass(com.baeldung.hibernate.entities.Department.class);<NEW_LINE>metadataSources.addAnnotatedClass(Animal.class);<NEW_LINE>metadataSources.addAnnotatedClass(Bag.class);<NEW_LINE>metadataSources.addAnnotatedClass(Book.class);<NEW_LINE>metadataSources.addAnnotatedClass(Car.class);<NEW_LINE>metadataSources.addAnnotatedClass(MyEmployee.class);<NEW_LINE>metadataSources.addAnnotatedClass(MyProduct.class);<NEW_LINE><MASK><NEW_LINE>metadataSources.addAnnotatedClass(Pet.class);<NEW_LINE>metadataSources.addAnnotatedClass(Vehicle.class);<NEW_LINE>Metadata metadata = metadataSources.getMetadataBuilder().build();<NEW_LINE>return metadata.getSessionFactoryBuilder().build();<NEW_LINE>}
metadataSources.addAnnotatedClass(Pen.class);
934,046
public static <T> SchemaUserTypeCreator createConstructorCreator(Class<T> clazz, Constructor<T> constructor, Schema schema, List<FieldValueTypeInformation> types, TypeConversionsFactory typeConversionsFactory) {<NEW_LINE>try {<NEW_LINE>DynamicType.Builder<SchemaUserTypeCreator> builder = BYTE_BUDDY.with(new InjectPackageStrategy(clazz)).subclass(SchemaUserTypeCreator.class).method(ElementMatchers.named("create")).intercept(new ConstructorCreateInstruction(types<MASK><NEW_LINE>return builder.visit(new AsmVisitorWrapper.ForDeclaredMethods().writerFlags(ClassWriter.COMPUTE_FRAMES)).make().load(ReflectHelpers.findClassLoader(clazz.getClassLoader()), ClassLoadingStrategy.Default.INJECTION).getLoaded().getDeclaredConstructor().newInstance();<NEW_LINE>} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException("Unable to generate a creator for " + clazz + " with schema " + schema);<NEW_LINE>}<NEW_LINE>}
, clazz, constructor, typeConversionsFactory));
1,027,749
public void parseContentTypesFile(InputStream contentTypes) throws InvalidFormatException {<NEW_LINE>CTTypes types;<NEW_LINE>try {<NEW_LINE>XMLInputFactory xif = XMLInputFactory.newInstance();<NEW_LINE>xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);<NEW_LINE>// a DTD is merely ignored, its presence doesn't cause an exception<NEW_LINE>xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);<NEW_LINE>XMLStreamReader xsr = xif.createXMLStreamReader(contentTypes);<NEW_LINE>Unmarshaller u = Context.jcContentTypes.createUnmarshaller();<NEW_LINE>// u.setSchema(org.docx4j.jaxb.WmlSchema.schema);<NEW_LINE>u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler());<NEW_LINE>log.debug("unmarshalling " + this.getClass().getName());<NEW_LINE>Object res = XmlUtils.unwrap(u.unmarshal(xsr));<NEW_LINE>// types = (CTTypes)((JAXBElement)res).getValue();<NEW_LINE>types = (CTTypes) res;<NEW_LINE>// log.debug( types.getClass().getName() + " unmarshalled" );<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>XmlUtils.marshaltoString(res, <MASK><NEW_LINE>}<NEW_LINE>CTDefault defaultCT;<NEW_LINE>CTOverride overrideCT;<NEW_LINE>for (Object o : types.getDefaultOrOverride()) {<NEW_LINE>if (o instanceof CTDefault) {<NEW_LINE>defaultCT = (CTDefault) o;<NEW_LINE>addDefaultContentType(defaultCT.getExtension(), defaultCT);<NEW_LINE>}<NEW_LINE>if (o instanceof CTOverride) {<NEW_LINE>overrideCT = (CTOverride) o;<NEW_LINE>URI uri = new URI(overrideCT.getPartName());<NEW_LINE>addOverrideContentType(uri, overrideCT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InvalidFormatException("Bad [Content_Types].xml", e);<NEW_LINE>}<NEW_LINE>}
true, true, Context.jcContentTypes);
1,755,030
public void write(DataOutput out) throws IOException {<NEW_LINE>super.write(out);<NEW_LINE>Map<String, String> serializeMap = Maps.newHashMap();<NEW_LINE>serializeMap.put(ODBC_CATALOG_RESOURCE, odbcCatalogResourceName);<NEW_LINE>serializeMap.put(ODBC_HOST, host);<NEW_LINE>serializeMap.put(ODBC_PORT, port);<NEW_LINE>serializeMap.put(ODBC_USER, userName);<NEW_LINE>serializeMap.put(ODBC_PASSWORD, passwd);<NEW_LINE>serializeMap.put(ODBC_DATABASE, odbcDatabaseName);<NEW_LINE>serializeMap.put(ODBC_TABLE, odbcTableName);<NEW_LINE><MASK><NEW_LINE>serializeMap.put(ODBC_TYPE, odbcTableTypeName);<NEW_LINE>serializeMap.put(ODBC_CHARSET, charset);<NEW_LINE>serializeMap.put(ODBC_EXTRA_PARAM, extraParam);<NEW_LINE>int size = (int) serializeMap.values().stream().filter(v -> {<NEW_LINE>return v != null;<NEW_LINE>}).count();<NEW_LINE>out.writeInt(size);<NEW_LINE>for (Map.Entry<String, String> kv : serializeMap.entrySet()) {<NEW_LINE>if (kv.getValue() != null) {<NEW_LINE>Text.writeString(out, kv.getKey());<NEW_LINE>Text.writeString(out, kv.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
serializeMap.put(ODBC_DRIVER, driver);
450,641
private void onNewAndChangeAndDelete(final PO po, int type) {<NEW_LINE>if (!(type == TYPE_AFTER_NEW || type == TYPE_AFTER_CHANGE || type == TYPE_AFTER_DELETE)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final I_C_OrderLine ol = InterfaceWrapperHelper.create(po, I_C_OrderLine.class);<NEW_LINE>//<NEW_LINE>// updating the freight cost amount, if necessary<NEW_LINE>final MOrder orderPO = <MASK><NEW_LINE>final String dontUpdateOrder = Env.getContext(po.getCtx(), OrderFastInput.OL_DONT_UPDATE_ORDER + orderPO.get_ID());<NEW_LINE>if (Check.isEmpty(dontUpdateOrder) || !"Y".equals(dontUpdateOrder)) {<NEW_LINE>final boolean newOrDelete = type == TYPE_AFTER_NEW || type == TYPE_AFTER_DELETE;<NEW_LINE>final boolean lineNetAmtChanged = po.is_ValueChanged(I_C_OrderLine.COLUMNNAME_LineNetAmt);<NEW_LINE>final FreightCostRule freightCostRule = FreightCostRule.ofCode(orderPO.getFreightCostRule());<NEW_LINE>// metas: cg: task US215<NEW_LINE>final boolean isCopy = InterfaceWrapperHelper.isCopy(po);<NEW_LINE>if (!isCopy && (lineNetAmtChanged || freightCostRule.isNotFixPrice() || newOrDelete)) {<NEW_LINE>final OrderFreightCostsService orderFreightCostsService = Adempiere.getBean(OrderFreightCostsService.class);<NEW_LINE>if (orderFreightCostsService.isFreightCostOrderLine(ol)) {<NEW_LINE>final I_C_Order order = InterfaceWrapperHelper.create(orderPO, I_C_Order.class);<NEW_LINE>orderFreightCostsService.updateFreightAmt(order);<NEW_LINE>orderPO.saveEx();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(MOrder) ol.getC_Order();
1,502,036
final GetSessionResult executeGetSession(GetSessionRequest getSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSessionRequest> request = null;<NEW_LINE>Response<GetSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSessionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Glue");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSessionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSession");
61,942
final ListTrainingJobsForHyperParameterTuningJobResult executeListTrainingJobsForHyperParameterTuningJob(ListTrainingJobsForHyperParameterTuningJobRequest listTrainingJobsForHyperParameterTuningJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTrainingJobsForHyperParameterTuningJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTrainingJobsForHyperParameterTuningJobRequest> request = null;<NEW_LINE>Response<ListTrainingJobsForHyperParameterTuningJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTrainingJobsForHyperParameterTuningJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTrainingJobsForHyperParameterTuningJobRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTrainingJobsForHyperParameterTuningJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTrainingJobsForHyperParameterTuningJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTrainingJobsForHyperParameterTuningJobResultJsonUnmarshaller());<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);
834,238
private int recordHashCode(HollowObjectTypeReadState typeState, int ordinal, int[] commonSchemaFieldMapping, boolean fromState) {<NEW_LINE>int hashCode = 0;<NEW_LINE>for (int i = 0; i < commonSchemaFieldMapping.length; i++) {<NEW_LINE>int typeStateFieldIndex = commonSchemaFieldMapping[i];<NEW_LINE>if (commonSchema.getFieldType(i) == FieldType.REFERENCE) {<NEW_LINE>int referencedOrdinal = <MASK><NEW_LINE>int ordinalIdentity = fromState ? commonReferenceFieldEqualOrdinalMaps[i].getIdentityFromOrdinal(referencedOrdinal) : commonReferenceFieldEqualOrdinalMaps[i].getIdentityToOrdinal(referencedOrdinal);<NEW_LINE>if (ordinalIdentity == -1 && referencedOrdinal != -1)<NEW_LINE>return -1;<NEW_LINE>hashCode = hashCode * 31 ^ HashCodes.hashInt(ordinalIdentity);<NEW_LINE>} else {<NEW_LINE>hashCode = hashCode * 31 ^ HashCodes.hashInt(HollowReadFieldUtils.fieldHashCode(typeState, ordinal, typeStateFieldIndex));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hashCode;<NEW_LINE>}
typeState.readOrdinal(ordinal, typeStateFieldIndex);
1,582,845
public static ListRolesResponse unmarshall(ListRolesResponse listRolesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRolesResponse.setRequestId(_ctx.stringValue("ListRolesResponse.RequestId"));<NEW_LINE>listRolesResponse.setTotalCount(_ctx.integerValue("ListRolesResponse.TotalCount"));<NEW_LINE>listRolesResponse.setPageSize(_ctx.integerValue("ListRolesResponse.PageSize"));<NEW_LINE>listRolesResponse.setPageNumber(_ctx.integerValue("ListRolesResponse.PageNumber"));<NEW_LINE>List<Role> roles = new ArrayList<Role>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRolesResponse.Roles.Length"); i++) {<NEW_LINE>Role role = new Role();<NEW_LINE>role.setRolePrincipalName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].RolePrincipalName"));<NEW_LINE>role.setUpdateDate(_ctx.stringValue<MASK><NEW_LINE>role.setDescription(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Description"));<NEW_LINE>role.setMaxSessionDuration(_ctx.longValue("ListRolesResponse.Roles[" + i + "].MaxSessionDuration"));<NEW_LINE>role.setRoleName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].RoleName"));<NEW_LINE>role.setCreateDate(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].CreateDate"));<NEW_LINE>role.setRoleId(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].RoleId"));<NEW_LINE>role.setArn(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Arn"));<NEW_LINE>role.setIsServiceLinkedRole(_ctx.booleanValue("ListRolesResponse.Roles[" + i + "].IsServiceLinkedRole"));<NEW_LINE>LatestDeletionTask latestDeletionTask = new LatestDeletionTask();<NEW_LINE>latestDeletionTask.setDeletionTaskId(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].LatestDeletionTask.DeletionTaskId"));<NEW_LINE>latestDeletionTask.setCreateDate(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].LatestDeletionTask.CreateDate"));<NEW_LINE>role.setLatestDeletionTask(latestDeletionTask);<NEW_LINE>roles.add(role);<NEW_LINE>}<NEW_LINE>listRolesResponse.setRoles(roles);<NEW_LINE>return listRolesResponse;<NEW_LINE>}
("ListRolesResponse.Roles[" + i + "].UpdateDate"));
1,391,034
public static Map<UUID, PartitionIdSet> createPartitionMap(NodeEngine nodeEngine, @Nullable MemberVersion localMemberVersion, boolean failOnUnassignedPartition) {<NEW_LINE>Collection<Partition> parts = nodeEngine.getHazelcastInstance().getPartitionService().getPartitions();<NEW_LINE>int partCnt = parts.size();<NEW_LINE>Map<UUID, PartitionIdSet> partMap = new LinkedHashMap<>();<NEW_LINE>for (Partition part : parts) {<NEW_LINE><MASK><NEW_LINE>if (owner == null) {<NEW_LINE>if (failOnUnassignedPartition) {<NEW_LINE>throw QueryException.error(SqlErrorCode.PARTITION_DISTRIBUTION, "Partition is not assigned to any member: " + part.getPartitionId());<NEW_LINE>} else {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (localMemberVersion != null) {<NEW_LINE>if (!localMemberVersion.equals(owner.getVersion())) {<NEW_LINE>UUID localMemberId = nodeEngine.getLocalMember().getUuid();<NEW_LINE>throw QueryException.error("Cannot execute SQL query when members have different versions " + "(make sure that all members have the same version) {localMemberId=" + localMemberId + ", localMemberVersion=" + localMemberVersion + ", remoteMemberId=" + owner.getUuid() + ", remoteMemberVersion=" + owner.getVersion() + "}");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>partMap.computeIfAbsent(owner.getUuid(), (key) -> new PartitionIdSet(partCnt)).add(part.getPartitionId());<NEW_LINE>}<NEW_LINE>return partMap;<NEW_LINE>}
Member owner = part.getOwner();
970,051
public PlanNode visitAggregation(AggregationNode node, RewriteContext<Set<VariableReferenceExpression>> context) {<NEW_LINE>ImmutableSet.Builder<VariableReferenceExpression> expectedInputs = ImmutableSet.<VariableReferenceExpression>builder().addAll(node.getGroupingKeys());<NEW_LINE>if (node.getHashVariable().isPresent()) {<NEW_LINE>expectedInputs.add(node.getHashVariable().get());<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<VariableReferenceExpression, Aggregation> aggregations = ImmutableMap.builder();<NEW_LINE>for (Map.Entry<VariableReferenceExpression, Aggregation> entry : node.getAggregations().entrySet()) {<NEW_LINE>VariableReferenceExpression variable = entry.getKey();<NEW_LINE>if (context.get().contains(variable)) {<NEW_LINE>Aggregation aggregation = entry.getValue();<NEW_LINE>expectedInputs.addAll(extractAggregationUniqueVariables(aggregation, variableAllocator.getTypes()));<NEW_LINE>aggregation.getMask(<MASK><NEW_LINE>aggregations.put(variable, aggregation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PlanNode source = context.rewrite(node.getSource(), expectedInputs.build());<NEW_LINE>return new AggregationNode(node.getSourceLocation(), node.getId(), source, aggregations.build(), node.getGroupingSets(), ImmutableList.of(), node.getStep(), node.getHashVariable(), node.getGroupIdVariable());<NEW_LINE>}
).ifPresent(expectedInputs::add);
170,046
final void showHelp(long address) {<NEW_LINE>System.out.println("c: continue");<NEW_LINE>System.out.println("n: step over");<NEW_LINE>if (emulator.isRunning()) {<NEW_LINE>System.out.println("bt: back trace");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("st hex: search stack");<NEW_LINE>System.out.println("shw hex: search writable heap");<NEW_LINE>System.out.println("shr hex: search readable heap");<NEW_LINE>System.out.println("shx hex: search executable heap");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("nb: break at next block");<NEW_LINE>System.out.println("s|si: step into");<NEW_LINE>System.out.println("s[decimal]: execute specified amount instruction");<NEW_LINE>System.out.println("s(blx): execute util BLX mnemonic, low performance");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("m(op) [size]: show memory, default size is 0x70, size may hex or decimal");<NEW_LINE>System.out.println("mr0-mr7, mfp, mip, msp [size]: show memory of specified register");<NEW_LINE>System.out.println("m(address) [size]: show memory of specified address, address must start with 0x");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("wr0-wr7, wfp, wip, wsp <value>: write specified register");<NEW_LINE>System.out.println("wb(address), ws(address), wi(address) <value>: write (byte, short, integer) memory of specified address, address must start with 0x");<NEW_LINE>System.out.println("wx(address) <hex>: write bytes to memory at specified address, address must start with 0x");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("b(address): add temporarily breakpoint, address must start with 0x, can be module offset");<NEW_LINE>System.out.println("b: add breakpoint of register PC");<NEW_LINE>System.out.println("r: remove breakpoint of register PC");<NEW_LINE>System.out.println("blr: add temporarily breakpoint of register LR");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("p (assembly): patch assembly at PC address");<NEW_LINE>System.out.println("where: show java stack trace");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("trace [begin end]: Set trace instructions");<NEW_LINE>System.out.println("traceRead [begin end]: Set trace memory read");<NEW_LINE>System.out.println("traceWrite [begin end]: Set trace memory write");<NEW_LINE>System.out.println("vm: view loaded modules");<NEW_LINE>System.out.println("vbs: view breakpoints");<NEW_LINE>System.out.println("d|dis: show disassemble");<NEW_LINE>System.out.println("d(0x): show disassemble at specify address");<NEW_LINE>System.out.println("stop: stop emulation");<NEW_LINE>System.out.println("run [arg]: run test");<NEW_LINE>System.out.println("gc: Run System.gc()");<NEW_LINE><MASK><NEW_LINE>if (emulator.getFamily() == Family.iOS && !emulator.isRunning()) {<NEW_LINE>System.out.println("dump [class name]: dump objc class");<NEW_LINE>System.out.println("search [keywords]: search objc classes");<NEW_LINE>}<NEW_LINE>Module module = emulator.getMemory().findModuleByAddress(address);<NEW_LINE>if (module != null) {<NEW_LINE>System.out.printf("cc size: convert asm from 0x%x - 0x%x + size bytes to c function%n", address, address);<NEW_LINE>}<NEW_LINE>}
System.out.println("threads: show thread list");
1,687,194
public static ListPrefixListsResponse unmarshall(ListPrefixListsResponse listPrefixListsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listPrefixListsResponse.setRequestId(_ctx.stringValue("ListPrefixListsResponse.RequestId"));<NEW_LINE>listPrefixListsResponse.setNextToken(_ctx.stringValue("ListPrefixListsResponse.NextToken"));<NEW_LINE>listPrefixListsResponse.setTotalCount(_ctx.longValue("ListPrefixListsResponse.TotalCount"));<NEW_LINE>listPrefixListsResponse.setMaxResults(_ctx.longValue("ListPrefixListsResponse.MaxResults"));<NEW_LINE>List<PrefixList> prefixLists = new ArrayList<PrefixList>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListPrefixListsResponse.PrefixLists.Length"); i++) {<NEW_LINE>PrefixList prefixList = new PrefixList();<NEW_LINE>prefixList.setPrefixListId(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListId"));<NEW_LINE>prefixList.setPrefixListStatus(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListStatus"));<NEW_LINE>prefixList.setPrefixListName(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListName"));<NEW_LINE>prefixList.setPrefixListDescription(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].PrefixListDescription"));<NEW_LINE>prefixList.setIpVersion(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].IpVersion"));<NEW_LINE>prefixList.setCreationTime(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i + "].CreationTime"));<NEW_LINE>List<String> cidrBlocks = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListPrefixListsResponse.PrefixLists[" + i + "].CidrBlocks.Length"); j++) {<NEW_LINE>cidrBlocks.add(_ctx.stringValue("ListPrefixListsResponse.PrefixLists[" + i <MASK><NEW_LINE>}<NEW_LINE>prefixList.setCidrBlocks(cidrBlocks);<NEW_LINE>prefixLists.add(prefixList);<NEW_LINE>}<NEW_LINE>listPrefixListsResponse.setPrefixLists(prefixLists);<NEW_LINE>return listPrefixListsResponse;<NEW_LINE>}
+ "].CidrBlocks[" + j + "]"));
1,603,919
private void publishNotification(final String arn, @Nullable final String fallbackArn, final SNSMessage<?> message, final QualifiedName name, final String errorMessage, final String counterKey) {<NEW_LINE>this.notificationMetric.recordTime(message, Metrics.TimerNotificationsBeforePublishDelay.getMetricName());<NEW_LINE>try {<NEW_LINE>//<NEW_LINE>// Publish the event to original SNS topic. If we receive an error from SNS, we will then try publishing<NEW_LINE>// to the fallback topic.<NEW_LINE>//<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (final Exception exception) {<NEW_LINE>if (fallbackArn != null) {<NEW_LINE>log.info("Fallback published message to topic {} because of error {}", fallbackArn, exception.getMessage());<NEW_LINE>notificationMetric.counterIncrement(Metrics.CounterSNSNotificationPublishFallback.getMetricName());<NEW_LINE>publishNotification(fallbackArn, message, counterKey);<NEW_LINE>} else {<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>notificationMetric.handleException(name, errorMessage, counterKey, message, e);<NEW_LINE>}<NEW_LINE>}
publishNotification(arn, message, counterKey);
1,655,396
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>Dialog res = super.onCreateDialog(savedInstanceState);<NEW_LINE>res.requestWindowFeature(Window.FEATURE_NO_TITLE);<NEW_LINE>res.setCancelable(false);<NEW_LINE>hanldeOnboardingSteps();<NEW_LINE>mContentView = View.inflate(getActivity(), R.layout.fragment_welcome, null);<NEW_LINE>res.setContentView(mContentView);<NEW_LINE>mAcceptBtn = mContentView.findViewById(R.id.accept_btn);<NEW_LINE>mAcceptBtn.setOnClickListener(this);<NEW_LINE>mImage = mContentView.findViewById(R.id.iv__image);<NEW_LINE>mImage.<MASK><NEW_LINE>mTitle = mContentView.findViewById(R.id.tv__title);<NEW_LINE>List<String> headers = Arrays.asList(getString(R.string.new_onboarding_step1_header), getString(R.string.new_onboarding_step1_header_2));<NEW_LINE>String titleText = TextUtils.join(UiUtils.NEW_STRING_DELIMITER, headers);<NEW_LINE>mTitle.setText(titleText);<NEW_LINE>mSubtitle = mContentView.findViewById(R.id.tv__subtitle1);<NEW_LINE>mSubtitle.setText(R.string.sign_message_gdpr);<NEW_LINE>initUserAgreementViews();<NEW_LINE>bindWelcomeScreenType();<NEW_LINE>if (savedInstanceState == null)<NEW_LINE>trackStatisticEvent(Statistics.EventName.ONBOARDING_SCREEN_SHOW);<NEW_LINE>return res;<NEW_LINE>}
setImageResource(R.drawable.img_welcome);
268,290
public static DeleteUserResponse unmarshall(DeleteUserResponse deleteUserResponse, UnmarshallerContext _ctx) {<NEW_LINE>deleteUserResponse.setRequestId(_ctx.stringValue("DeleteUserResponse.RequestId"));<NEW_LINE>deleteUserResponse.setCode<MASK><NEW_LINE>deleteUserResponse.setData(_ctx.mapValue("DeleteUserResponse.Data"));<NEW_LINE>deleteUserResponse.setMessage(_ctx.stringValue("DeleteUserResponse.Message"));<NEW_LINE>List<ErrorsItem> errors = new ArrayList<ErrorsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DeleteUserResponse.Errors.Length"); i++) {<NEW_LINE>ErrorsItem errorsItem = new ErrorsItem();<NEW_LINE>errorsItem.setField(_ctx.stringValue("DeleteUserResponse.Errors[" + i + "].Field"));<NEW_LINE>errorsItem.setMessage(_ctx.stringValue("DeleteUserResponse.Errors[" + i + "].Message"));<NEW_LINE>errors.add(errorsItem);<NEW_LINE>}<NEW_LINE>deleteUserResponse.setErrors(errors);<NEW_LINE>return deleteUserResponse;<NEW_LINE>}
(_ctx.stringValue("DeleteUserResponse.Code"));
566,415
protected Object decode(ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception {<NEW_LINE>int length = 6;<NEW_LINE>if (buf.readableBytes() >= length) {<NEW_LINE>int type = buf.getUnsignedByte(buf.readerIndex() + 2) & 0x0f;<NEW_LINE>if (type == OrionProtocolDecoder.MSG_USERLOG && buf.readableBytes() >= length + 5) {<NEW_LINE>int index <MASK><NEW_LINE>int count = buf.getUnsignedByte(index) & 0x0f;<NEW_LINE>index += 5;<NEW_LINE>length += 5;<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>if (buf.readableBytes() < length) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int logLength = buf.getUnsignedByte(index + 1);<NEW_LINE>index += logLength;<NEW_LINE>length += logLength;<NEW_LINE>}<NEW_LINE>if (buf.readableBytes() >= length) {<NEW_LINE>return buf.readRetainedSlice(length);<NEW_LINE>}<NEW_LINE>} else if (type == OrionProtocolDecoder.MSG_SYSLOG && buf.readableBytes() >= length + 12) {<NEW_LINE>length += buf.getUnsignedShortLE(buf.readerIndex() + 8);<NEW_LINE>if (buf.readableBytes() >= length) {<NEW_LINE>return buf.readRetainedSlice(length);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
= buf.readerIndex() + 3;