idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,316,566
private void populateAgentDisplayTable() throws Exception {<NEW_LINE>dropTableIfExists("agent_display");<NEW_LINE>session.createTableWithLCS("create table if not exists agent_display (agent_rollup_id" + " varchar, display varchar, primary key (agent_rollup_id))");<NEW_LINE>PreparedStatement insertPS = session.prepare("insert into agent_display (agent_rollup_id, display) values (?, ?)");<NEW_LINE>ResultSet results = session.read("select agent_rollup_id, config from agent_config");<NEW_LINE>Queue<ListenableFuture<?>> futures = new ArrayDeque<>();<NEW_LINE>for (Row row : results) {<NEW_LINE>String agentRollupId = row.getString(0);<NEW_LINE>AgentConfig agentConfig;<NEW_LINE>try {<NEW_LINE>agentConfig = AgentConfig.parseFrom(checkNotNull(row.getBytes(1)));<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String display = agentConfig<MASK><NEW_LINE>if (!display.isEmpty()) {<NEW_LINE>BoundStatement boundStatement = insertPS.bind();<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, agentRollupId);<NEW_LINE>boundStatement.setString(i++, display);<NEW_LINE>futures.add(session.writeAsync(boundStatement));<NEW_LINE>waitForSome(futures);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MoreFutures.waitForAll(futures);<NEW_LINE>}
.getGeneralConfig().getDisplay();
81,504
public boolean append(final DirectBuffer srcBuffer, final int srcOffset, final int srcLength) {<NEW_LINE>final int headOffset = (int) head & mask;<NEW_LINE>final int tailOffset = (int) tail & mask;<NEW_LINE>final int alignedLength = BitUtil.align(HEADER_LENGTH + srcLength, HEADER_ALIGNMENT);<NEW_LINE>final int totalRemaining = capacity - (int) (tail - head);<NEW_LINE>if (alignedLength > totalRemaining) {<NEW_LINE>resize(alignedLength);<NEW_LINE>} else if (tailOffset >= headOffset) {<NEW_LINE>final int toEndRemaining = capacity - tailOffset;<NEW_LINE>if (alignedLength > toEndRemaining) {<NEW_LINE>if (alignedLength <= (totalRemaining - toEndRemaining)) {<NEW_LINE>buffer.putInt(tailOffset + MESSAGE_LENGTH_OFFSET, toEndRemaining);<NEW_LINE>buffer.putInt(tailOffset + MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_PADDING);<NEW_LINE>tail += toEndRemaining;<NEW_LINE>} else {<NEW_LINE>resize(alignedLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int newTotalRemaining = capacity - (int) (tail - head);<NEW_LINE>if (alignedLength > newTotalRemaining) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>tail += alignedLength;<NEW_LINE>return true;<NEW_LINE>}
writeMessage(srcBuffer, srcOffset, srcLength);
1,314,242
public BExpressionValue evaluate() throws EvaluationException {<NEW_LINE>// The result of a range-expr is a new object belonging to the object type Iterable<int,()> that will iterate<NEW_LINE>// over a sequence of integers in increasing order, where the sequence includes all integers<NEW_LINE>// that are less than / less than or equal to the value of the second expression.<NEW_LINE>try {<NEW_LINE>BExpressionValue lhsResult = lhsEvaluator.evaluate();<NEW_LINE>BExpressionValue rhsResult = rhsEvaluator.evaluate();<NEW_LINE>BVariable lVar = VariableFactory.getVariable(context, lhsResult.getJdiValue());<NEW_LINE>BVariable rVar = VariableFactory.getVariable(context, rhsResult.getJdiValue());<NEW_LINE>SyntaxKind operatorType = syntaxNode.operator().kind();<NEW_LINE>// Determines the range (whether the end value should be exclusive), based on the operator type.<NEW_LINE>boolean excludeEndValue = operatorType == SyntaxKind.DOUBLE_DOT_LT_TOKEN;<NEW_LINE>Value excludeEndValueMirror = VMUtils.make(context, excludeEndValue).getJdiValue();<NEW_LINE>List<Value> argList = new ArrayList<>();<NEW_LINE>argList.add(getValueAsObject(context, lVar));<NEW_LINE>argList.add(getValueAsObject(context, rVar));<NEW_LINE>argList.add(getValueAsObject(context, excludeEndValueMirror));<NEW_LINE>GeneratedStaticMethod createIntRangeMethod = getGeneratedMethod(context, B_RANGE_EXPR_HELPER_CLASS, CREATE_INT_RANGE_METHOD);<NEW_LINE>createIntRangeMethod.setArgValues(argList);<NEW_LINE>return new BExpressionValue(context, createIntRangeMethod.invokeSafely());<NEW_LINE>} catch (EvaluationException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw createEvaluationException(INTERNAL_ERROR, syntaxNode.<MASK><NEW_LINE>}<NEW_LINE>}
toSourceCode().trim());
551,063
private void drawMarker(Editor editor, Graphics2D g2, int x1, int x2, int y1, int y2, boolean ignoredBackgroundColor) {<NEW_LINE>if (x1 >= x2)<NEW_LINE>return;<NEW_LINE>ColorValue color = myDiffType.getColor(editor);<NEW_LINE>if (y2 - y1 > 2) {<NEW_LINE>if (!myResolved) {<NEW_LINE>g2.setColor(TargetAWT.to(ignoredBackgroundColor ? myDiffType.getIgnoredColor(editor) : color));<NEW_LINE>g2.fillRect(x1, y1, <MASK><NEW_LINE>}<NEW_LINE>DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y1 - 1, color, false, myResolved);<NEW_LINE>DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y2 - 1, color, false, myResolved);<NEW_LINE>} else {<NEW_LINE>// range is empty - insertion or deletion<NEW_LINE>// Draw 2 pixel line in that case<NEW_LINE>DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y1 - 1, color, true, myResolved);<NEW_LINE>}<NEW_LINE>}
x2 - x1, y2 - y1);
1,787,621
// recursively copy a record type<NEW_LINE>private RelDataType copyRecordType(final RelRecordType type, final boolean ignoreNullable, final boolean nullable) {<NEW_LINE>// REVIEW: angel 18-Aug-2005 dtbug336<NEW_LINE>// Shouldn't null refer to the nullability of the record type<NEW_LINE>// not the individual field types?<NEW_LINE>// For flattening and outer joins, it is desirable to change<NEW_LINE>// the nullability of the individual fields.<NEW_LINE>return createStructType(type.getStructKind(), new AbstractList<RelDataType>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RelDataType get(int index) {<NEW_LINE>RelDataType fieldType = type.getFieldList().get(index).getType();<NEW_LINE>if (ignoreNullable) {<NEW_LINE>return copyType(fieldType);<NEW_LINE>} else {<NEW_LINE>return createTypeWithNullability(fieldType, nullable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int size() {<NEW_LINE>return type.getFieldCount();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
}, type.getFieldNames());
1,728,939
public SslConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SslConfiguration sslConfiguration = new SslConfiguration();<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("Certificate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sslConfiguration.setCertificate(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("PrivateKey", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sslConfiguration.setPrivateKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Chain", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sslConfiguration.setChain(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return sslConfiguration;<NEW_LINE>}
class).unmarshall(context));
877,324
public P convert(T thriftObj) {<NEW_LINE>Descriptor protoDesc = protoObj_.getDescriptorForType();<NEW_LINE>Map<? extends org.apache.thrift.TFieldIdEnum, FieldMetaData> fieldMap = FieldMetaData.getStructMetaDataMap(thriftObj.getClass());<NEW_LINE>for (Map.Entry<? extends TFieldIdEnum, FieldMetaData> e : fieldMap.entrySet()) {<NEW_LINE>final TFieldIdEnum tFieldIdEnum = e.getKey();<NEW_LINE>final FieldValueMetaData thriftMetadata <MASK><NEW_LINE>FieldDescriptor protoFieldDesc = protoDesc.findFieldByName(tFieldIdEnum.getFieldName());<NEW_LINE>if (protoFieldDesc == null) {<NEW_LINE>throw new RuntimeException("Field " + tFieldIdEnum.getFieldName() + " not found in " + protoObj_.getClass().getCanonicalName());<NEW_LINE>} else if (!typesMatch(protoFieldDesc, thriftMetadata)) {<NEW_LINE>throw new RuntimeException("Field " + tFieldIdEnum.getFieldName() + " type does not match: " + "thrift " + thriftMetadata.type + "vs " + protoFieldDesc.getType());<NEW_LINE>}<NEW_LINE>Object fieldValue = thriftObj.getFieldValue(tFieldIdEnum);<NEW_LINE>if (protoFieldDesc.getType() == Type.BYTES) {<NEW_LINE>protoBuilder_.setField(protoFieldDesc, (ByteString.copyFrom((byte[]) fieldValue)));<NEW_LINE>} else {<NEW_LINE>protoBuilder_.setField(protoFieldDesc, fieldValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (P) protoBuilder_.build();<NEW_LINE>}
= e.getValue().valueMetaData;
774,424
private static <T> StreamingDeserializer<T> newDeserializer(ObjectReader reader) {<NEW_LINE>final JsonFactory factory = reader.getFactory();<NEW_LINE>final JsonParser parser;<NEW_LINE>try {<NEW_LINE>// TODO(scott): ByteBufferFeeder is currently not supported by jackson, and the current API throws<NEW_LINE>// UnsupportedOperationException if not supported. When jackson does support two NonBlockingInputFeeder<NEW_LINE>// types we need an approach which doesn't involve catching UnsupportedOperationException to try to get<NEW_LINE>// ByteBufferFeeder and then ByteArrayFeeder.<NEW_LINE>parser = factory.createNonBlockingByteArrayParser();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalArgumentException("parser initialization error for factory: " + factory, e);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (rawFeeder instanceof ByteBufferFeeder) {<NEW_LINE>return new ByteBufferJacksonDeserializer<>(reader, parser, (ByteBufferFeeder) rawFeeder);<NEW_LINE>}<NEW_LINE>if (rawFeeder instanceof ByteArrayFeeder) {<NEW_LINE>return new ByteArrayJacksonDeserializer<>(reader, parser, (ByteArrayFeeder) rawFeeder);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("unsupported feeder type: " + rawFeeder);<NEW_LINE>}
NonBlockingInputFeeder rawFeeder = parser.getNonBlockingInputFeeder();
979,178
public static MTAudioProcessingTap create(Callbacks callbacks, MTAudioProcessingTapCreationFlags flags) throws OSStatusException {<NEW_LINE>MTAudioProcessingTap.MTAudioProcessingTapPtr ptr = new MTAudioProcessingTap.MTAudioProcessingTapPtr();<NEW_LINE>long callbackId = MTAudioProcessingTap.callbackId.getAndIncrement();<NEW_LINE>MTAudioProcessingTapCallbacksStruct struct = new MTAudioProcessingTapCallbacksStruct(0, callbackId, new FunctionPtr(cbInit), new FunctionPtr(cbFinalize), new FunctionPtr(cbPrepare), new FunctionPtr(cbUnprepare), new FunctionPtr(cbProcess));<NEW_LINE>OSStatus status = create(<MASK><NEW_LINE>if (OSStatusException.throwIfNecessary(status)) {<NEW_LINE>synchronized (MTAudioProcessingTap.callbacks) {<NEW_LINE>MTAudioProcessingTap.callbacks.put(callbackId, callbacks);<NEW_LINE>}<NEW_LINE>return ptr.get();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
null, struct, flags, ptr);
542,746
private void verifyVersions() {<NEW_LINE>// [#12488] Check if all of jOOQ, jOOQ-meta, jOOQ-codegen are using the same versions and editions<NEW_LINE>try {<NEW_LINE>Field[] f1 = org.jooq.Constants.class.getFields();<NEW_LINE>Field[] f2 = org.jooq.meta.Constants.class.getFields();<NEW_LINE>Field[] f3 = org.jooq.codegen.Constants.class.getFields();<NEW_LINE>Arrays.sort(f1, comparing(Field::getName));<NEW_LINE>Arrays.sort(f2, comparing(Field::getName));<NEW_LINE>Arrays.sort(f3, comparing(Field::getName));<NEW_LINE>if (f1.length != f2.length)<NEW_LINE>log.warn("Version check", "org.jooq.Constants and org.jooq.meta.Constants contents mismatch. Check if you're using the same versions for org.jooq and org.jooq.meta");<NEW_LINE>if (f1.length != f3.length)<NEW_LINE>log.warn("Version check", "org.jooq.Constants and org.jooq.codegen.Constants contents mismatch. Check if you're using the same versions for org.jooq and org.jooq.meta");<NEW_LINE>String v1 = org.jooq.Constants.FULL_VERSION;<NEW_LINE>String v2 = org<MASK><NEW_LINE>String v3 = org.jooq.codegen.Constants.FULL_VERSION;<NEW_LINE>for (int i = 0; i < f1.length && i < f2.length && i < f3.length; i++) {<NEW_LINE>Object c1 = f1[i].get(org.jooq.Constants.class);<NEW_LINE>Object c2 = f2[i].get(org.jooq.meta.Constants.class);<NEW_LINE>Object c3 = f3[i].get(org.jooq.codegen.Constants.class);<NEW_LINE>if (!Objects.equals(c1, c2))<NEW_LINE>log.warn("Version check", "org.jooq.Constants." + f1[i].getName() + " contents mismatch: " + c1 + " vs " + c2 + ". Check if you're using the same versions for org.jooq (" + v1 + ") and org.jooq.meta (" + v2 + ")");<NEW_LINE>if (!Objects.equals(c1, c3))<NEW_LINE>log.warn("Version check", "org.jooq.Constants." + f1[i].getName() + " contents mismatch: " + c1 + " vs " + c3 + ". Check if you're using the same versions for org.jooq (" + v1 + ") and org.jooq.codegen (" + v3 + ")");<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.warn("Version check", "Something went wrong when comparing versions of org.jooq, org.jooq.meta, and org.jooq.codegen", e);<NEW_LINE>}<NEW_LINE>}
.jooq.meta.Constants.FULL_VERSION;
1,339,014
public void fullRedraw() {<NEW_LINE>super.fullRedraw();<NEW_LINE>addCSSClasses(svgp);<NEW_LINE>DBIDSelection selContext = context.getSelection();<NEW_LINE>if (!(selContext instanceof RangeSelection)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HyperBoundingBox range = ((RangeSelection) selContext).getRanges();<NEW_LINE>if (range == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Project:<NEW_LINE>final int dims = range.getDimensionality();<NEW_LINE>double[] min = new double[dims];<NEW_LINE>double[] max = new double[dims];<NEW_LINE>for (int d = 0; d < dims; d++) {<NEW_LINE>min[d] = range.getMin(d);<NEW_LINE>max[d] = range.getMax(d);<NEW_LINE>}<NEW_LINE>min = proj.fastProjectDataToRenderSpace(min);<NEW_LINE>max = proj.fastProjectDataToRenderSpace(max);<NEW_LINE>final <MASK><NEW_LINE>for (int vd = 0; vd < vdim; vd++) {<NEW_LINE>final int ad = proj.getDimForVisibleAxis(vd);<NEW_LINE>final double amin = Math.min(min[ad], max[ad]);<NEW_LINE>final double amax = Math.max(min[ad], max[ad]);<NEW_LINE>if (amin > Double.MIN_VALUE && amax < Double.MAX_VALUE) {<NEW_LINE>Element rect = svgp.svgRect(getVisibleAxisX(vd) - (0.01 * StyleLibrary.SCALE), amin, 0.02 * StyleLibrary.SCALE, amax - amin);<NEW_LINE>SVGUtil.addCSSClass(rect, MARKER);<NEW_LINE>layer.appendChild(rect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int vdim = proj.getVisibleDimensions();
1,473,747
public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "SetWebsiteConfiguration - set the website configuration for an S3 bucket\n\n" + "Usage: SetWebsiteConfiguration <bucket> [indexdoc] [errordoc]\n\n" + "Where:\n" + " bucket - the bucket to set the website configuration on\n" + " indexdoc - (optional) the index document, ex. 'index.html'\n" + " If not specified, 'index.html' will be set.\n" + " errordoc - (optional) the error document, ex. 'notfound.html'\n" + " If not specified, no error doc will be set.\n";<NEW_LINE>if (args.length < 1) {<NEW_LINE>System.out.println(USAGE);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>final String bucket_name = args[0];<NEW_LINE>final String index_doc = (args.length > 1) ? args[1] : "index.html";<NEW_LINE>final String error_doc = (args.length > 2<MASK><NEW_LINE>setWebsiteConfig(bucket_name, index_doc, error_doc);<NEW_LINE>}
) ? args[2] : null;
393,652
public MessageHandler messageReceiver() {<NEW_LINE>return message -> {<NEW_LINE>LOGGER.info("Message arrived! Payload: " + message.getPayload());<NEW_LINE>DfdlDef dfdlDef;<NEW_LINE>try {<NEW_LINE>// Get DFDL Definition Getting from Firestore.<NEW_LINE>dfdlDef = firestoreService.getDfdlDef(dfdlDefName);<NEW_LINE>System.out.println(<MASK><NEW_LINE>// Transform message using the dfdl definition.<NEW_LINE>String messageConverted = dfdlService.convertDataMessage((String) message.getPayload(), dfdlDef);<NEW_LINE>// Republish the message in json format in a new topic<NEW_LINE>messagingGateway.sendToPubsub(pubsubDataJsonTopic, messageConverted);<NEW_LINE>// Acknowledge incoming Pub/Sub message<NEW_LINE>BasicAcknowledgeablePubsubMessage originalMessage = message.getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE, BasicAcknowledgeablePubsubMessage.class);<NEW_LINE>originalMessage.ack();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
"Definition from Firestore: " + dfdlDef.getDefinition());
522,257
private void transcodeSvgToPdfFile(File chosenFile, SVGGraphics2D g2d) {<NEW_LINE>final <MASK><NEW_LINE>final Element rootE = doc.getDocumentElement();<NEW_LINE>g2d.getRoot(rootE);<NEW_LINE>final TranscoderInput input = new TranscoderInput(doc);<NEW_LINE>try {<NEW_LINE>try (final FileOutputStream ostream = new FileOutputStream(chosenFile)) {<NEW_LINE>final BufferedOutputStream bufStream = new BufferedOutputStream(ostream);<NEW_LINE>final TranscoderOutput output = new TranscoderOutput(bufStream);<NEW_LINE>final PDFTranscoder transcoder = createPdfTranscoder();<NEW_LINE>transcoder.transcode(input, output);<NEW_LINE>}<NEW_LINE>LinkController.getController().loadHyperlink(new Hyperlink(chosenFile.toURI()));<NEW_LINE>} catch (TranscoderException | IOException e) {<NEW_LINE>org.freeplane.core.util.LogUtils.warn(e);<NEW_LINE>UITools.errorMessage(e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}
Document doc = g2d.getDOMFactory();
1,057,149
private NavigatableContextAction breakPointActionFactory(String name, String cmd, boolean oneshot, KeyBindingData keyBinding) {<NEW_LINE>NavigatableContextAction breakpoint_action;<NEW_LINE>breakpoint_action = new NavigatableContextAction(name, getName()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(NavigatableActionContext context) {<NEW_LINE>rsplugin.cs.println(String.format("[>] %s", this.getName()));<NEW_LINE>if (rsplugin.syncEnabled) {<NEW_LINE>ProgramLocation loc = rsplugin.cvs.getCurrentLocation();<NEW_LINE>Program pgm = loc.getProgram();<NEW_LINE>if (rsplugin.isRemoteBaseKnown()) {<NEW_LINE>Address dest = rsplugin.rebaseRemote(loc.getAddress());<NEW_LINE>rsplugin.reqHandler.curClient.sendCmd(cmd, String.format("0x%x", dest.getOffset()), oneshot);<NEW_LINE>rsplugin.cs.println(String.format(" local addr: %s, remote: 0x%x", loc.getAddress().toString(), dest.getOffset()));<NEW_LINE>} else {<NEW_LINE>rsplugin.cs.println(String.format("[x] %s failed, remote base of %s program unknown", cmd<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>breakpoint_action.setEnabled(true);<NEW_LINE>breakpoint_action.setKeyBindingData(keyBinding);<NEW_LINE>breakpoint_action.setHelpLocation(new HelpLocation(HelpTopics.NAVIGATION, breakpoint_action.getName()));<NEW_LINE>return breakpoint_action;<NEW_LINE>}
, pgm.getName()));
1,273,496
public static CreateHotParamItemsResponse unmarshall(CreateHotParamItemsResponse createHotParamItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>createHotParamItemsResponse.setRequestId(_ctx.stringValue("CreateHotParamItemsResponse.RequestId"));<NEW_LINE>createHotParamItemsResponse.setCode(_ctx.stringValue("CreateHotParamItemsResponse.Code"));<NEW_LINE>createHotParamItemsResponse.setMessage(_ctx.stringValue("CreateHotParamItemsResponse.Message"));<NEW_LINE>createHotParamItemsResponse.setSuccess(_ctx.booleanValue("CreateHotParamItemsResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setAppName(_ctx.stringValue("CreateHotParamItemsResponse.Data.AppName"));<NEW_LINE>data.setBurstCount(_ctx.integerValue("CreateHotParamItemsResponse.Data.BurstCount"));<NEW_LINE>data.setControlBehavior(_ctx.integerValue("CreateHotParamItemsResponse.Data.ControlBehavior"));<NEW_LINE>data.setEnable(_ctx.booleanValue("CreateHotParamItemsResponse.Data.Enable"));<NEW_LINE>data.setMaxQueueingTimeMs(_ctx.integerValue("CreateHotParamItemsResponse.Data.MaxQueueingTimeMs"));<NEW_LINE>data.setMetricType(_ctx.integerValue("CreateHotParamItemsResponse.Data.MetricType"));<NEW_LINE>data.setNamespace<MASK><NEW_LINE>data.setParamIdx(_ctx.integerValue("CreateHotParamItemsResponse.Data.ParamIdx"));<NEW_LINE>data.setResource(_ctx.stringValue("CreateHotParamItemsResponse.Data.Resource"));<NEW_LINE>data.setRuleId(_ctx.longValue("CreateHotParamItemsResponse.Data.RuleId"));<NEW_LINE>data.setStatDurationSec(_ctx.longValue("CreateHotParamItemsResponse.Data.StatDurationSec"));<NEW_LINE>data.setThreshold(_ctx.floatValue("CreateHotParamItemsResponse.Data.Threshold"));<NEW_LINE>List<ParamFlowItemListItem> paramFlowItemList = new ArrayList<ParamFlowItemListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateHotParamItemsResponse.Data.ParamFlowItemList.Length"); i++) {<NEW_LINE>ParamFlowItemListItem paramFlowItemListItem = new ParamFlowItemListItem();<NEW_LINE>paramFlowItemListItem.setItemType(_ctx.stringValue("CreateHotParamItemsResponse.Data.ParamFlowItemList[" + i + "].ItemType"));<NEW_LINE>paramFlowItemListItem.setItemValue(_ctx.stringValue("CreateHotParamItemsResponse.Data.ParamFlowItemList[" + i + "].ItemValue"));<NEW_LINE>paramFlowItemListItem.setThreshold(_ctx.floatValue("CreateHotParamItemsResponse.Data.ParamFlowItemList[" + i + "].Threshold"));<NEW_LINE>paramFlowItemList.add(paramFlowItemListItem);<NEW_LINE>}<NEW_LINE>data.setParamFlowItemList(paramFlowItemList);<NEW_LINE>createHotParamItemsResponse.setData(data);<NEW_LINE>return createHotParamItemsResponse;<NEW_LINE>}
(_ctx.stringValue("CreateHotParamItemsResponse.Data.Namespace"));
1,116,995
public void enableProgram(GL2 gl) {<NEW_LINE>gl.glUseProgram(st_prog);<NEW_LINE>gl.glActiveTexture(GL.GL_TEXTURE0);<NEW_LINE>gl.glBindTexture(GL.GL_TEXTURE_2D, textures[0]);<NEW_LINE>gl.glActiveTexture(GL.GL_TEXTURE1);<NEW_LINE>gl.glBindTexture(GL<MASK><NEW_LINE>// Reset to Texture0, needed for i945 (otherwise: slow)<NEW_LINE>gl.glActiveTexture(GL.GL_TEXTURE0);<NEW_LINE>float[] eye = camera.getEyePosition();<NEW_LINE>gl.glUniform3f(gl.glGetUniformLocation(st_prog, "eye"), eye[0], eye[1], eye[2]);<NEW_LINE>gl.glUniform1f(gl.glGetUniformLocation(st_prog, "size"), 25.f);<NEW_LINE>// texture<NEW_LINE>gl.glUniform1i(gl.glGetUniformLocation(st_prog, "texAlpha"), 0);<NEW_LINE>// texture<NEW_LINE>gl.glUniform1i(gl.glGetUniformLocation(st_prog, "texColor"), 1);<NEW_LINE>gl.glUniform1f(gl.glGetUniformLocation(st_prog, "alpha"), .8f);<NEW_LINE>gl.glUniform1i(gl.glGetUniformLocation(st_prog, "grid"), texgrid);<NEW_LINE>gl.glUniform1i(gl.glGetUniformLocation(st_prog, "numcolors"), numcolors);<NEW_LINE>}
.GL_TEXTURE_2D, textures[1]);
977,465
final RemoveTagsFromResourceResult executeRemoveTagsFromResource(RemoveTagsFromResourceRequest removeTagsFromResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(removeTagsFromResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RemoveTagsFromResourceRequest> request = null;<NEW_LINE>Response<RemoveTagsFromResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RemoveTagsFromResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(removeTagsFromResourceRequest));<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, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RemoveTagsFromResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RemoveTagsFromResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RemoveTagsFromResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,734,955
public Javalin start() {<NEW_LINE>Util.<MASK><NEW_LINE>JettyUtil.disableJettyLogger();<NEW_LINE>long startupTimer = System.currentTimeMillis();<NEW_LINE>if (jettyServer.started) {<NEW_LINE>String message = "Server already started. If you are trying to call start() on an instance " + "of Javalin that was stopped using stop(), please create a new instance instead.";<NEW_LINE>throw new IllegalStateException(message);<NEW_LINE>}<NEW_LINE>jettyServer.started = true;<NEW_LINE>Util.printHelpfulMessageIfLoggerIsMissing();<NEW_LINE>eventManager.fireEvent(JavalinEvent.SERVER_STARTING);<NEW_LINE>try {<NEW_LINE>JavalinLogger.startup("Starting Javalin ...");<NEW_LINE>Util.logJavalinVersion();<NEW_LINE>jettyServer.start(javalinJettyServlet);<NEW_LINE>JavalinLogger.startup("Javalin started in " + (System.currentTimeMillis() - startupTimer) + "ms \\o/");<NEW_LINE>eventManager.fireEvent(JavalinEvent.SERVER_STARTED);<NEW_LINE>} catch (Exception e) {<NEW_LINE>JavalinLogger.error("Failed to start Javalin");<NEW_LINE>eventManager.fireEvent(JavalinEvent.SERVER_START_FAILED);<NEW_LINE>if (Boolean.TRUE.equals(jettyServer.server().getAttribute("is-default-server"))) {<NEW_LINE>// stop if server is default server; otherwise, the caller is responsible to stop<NEW_LINE>stop();<NEW_LINE>}<NEW_LINE>if (e.getMessage() != null && e.getMessage().contains("Failed to bind to")) {<NEW_LINE>throw new JavalinBindException("Port already in use. Make sure no other process is using port " + Util.getPort(e) + " and try again.", e);<NEW_LINE>} else if (e.getMessage() != null && e.getMessage().contains("Permission denied")) {<NEW_LINE>throw new JavalinBindException("Port 1-1023 require elevated privileges (process must be started by admin).", e);<NEW_LINE>}<NEW_LINE>throw new JavalinException(e);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
logJavalinBanner(this._conf.showJavalinBanner);
1,827,830
private DataStreamSink<?> consume(DataStream<RowData> dataStream, boolean isBounded, DataStructureConverter converter) {<NEW_LINE>checkAcidTable(catalogTable, identifier.toObjectPath());<NEW_LINE>try (HiveMetastoreClientWrapper client = HiveMetastoreClientFactory.create(HiveConfUtils.create(jobConf), hiveVersion)) {<NEW_LINE>Table table = client.getTable(identifier.getDatabaseName(), identifier.getObjectName());<NEW_LINE>StorageDescriptor sd = table.getSd();<NEW_LINE>Class hiveOutputFormatClz = hiveShim.getHiveOutputFormatClass(Class.forName(sd.getOutputFormat()));<NEW_LINE>boolean isCompressed = jobConf.getBoolean(HiveConf.<MASK><NEW_LINE>HiveWriterFactory writerFactory = new HiveWriterFactory(jobConf, hiveOutputFormatClz, sd.getSerdeInfo(), tableSchema, getPartitionKeyArray(), HiveReflectionUtils.getTableMetadata(hiveShim, table), hiveShim, isCompressed);<NEW_LINE>String extension = Utilities.getFileExtension(jobConf, isCompressed, (HiveOutputFormat<?, ?>) hiveOutputFormatClz.newInstance());<NEW_LINE>OutputFileConfig.OutputFileConfigBuilder fileNamingBuilder = OutputFileConfig.builder().withPartPrefix("part-" + UUID.randomUUID().toString()).withPartSuffix(extension == null ? "" : extension);<NEW_LINE>final int parallelism = Optional.ofNullable(configuredParallelism).orElse(dataStream.getParallelism());<NEW_LINE>if (isBounded) {<NEW_LINE>OutputFileConfig fileNaming = fileNamingBuilder.build();<NEW_LINE>return createBatchSink(dataStream, converter, sd, writerFactory, fileNaming, parallelism);<NEW_LINE>} else {<NEW_LINE>if (overwrite) {<NEW_LINE>throw new IllegalStateException("Streaming mode not support overwrite.");<NEW_LINE>}<NEW_LINE>Properties tableProps = HiveReflectionUtils.getTableMetadata(hiveShim, table);<NEW_LINE>return createStreamSink(dataStream, sd, tableProps, writerFactory, fileNamingBuilder, parallelism);<NEW_LINE>}<NEW_LINE>} catch (TException e) {<NEW_LINE>throw new CatalogException("Failed to query Hive metaStore", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new FlinkRuntimeException("Failed to create staging dir", e);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new FlinkHiveException("Failed to get output format class", e);<NEW_LINE>} catch (IllegalAccessException | InstantiationException e) {<NEW_LINE>throw new FlinkHiveException("Failed to instantiate output format instance", e);<NEW_LINE>}<NEW_LINE>}
ConfVars.COMPRESSRESULT.varname, false);
1,844,311
public void createFunctionToCalledConstructorOrDestructorRefAddrPairMapping(Function function) throws CancelledException {<NEW_LINE>List<ReferenceAddressPair> referenceAddressPairs = new ArrayList<ReferenceAddressPair>();<NEW_LINE>Set<Function> calledFunctions = function.getCalledFunctions(monitor);<NEW_LINE>Iterator<Function> calledFunctionIterator = calledFunctions.iterator();<NEW_LINE>while (calledFunctionIterator.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>Function calledFunction = calledFunctionIterator.next();<NEW_LINE>Function referencedFunction = calledFunction;<NEW_LINE>if (calledFunction.isThunk()) {<NEW_LINE>Function <MASK><NEW_LINE>calledFunction = thunkFunction;<NEW_LINE>}<NEW_LINE>// if thunk, need to use the thunked function to see if it is on list of cds<NEW_LINE>// but always need to use the actual called function to get reference address<NEW_LINE>// need to used the thunked function on the hashmap<NEW_LINE>if (allClassFunctionsContainingVftableReference.contains(calledFunction)) {<NEW_LINE>// get list of refs to this function from the calling function<NEW_LINE>List<Address> referencesToFunctionBFromFunctionA = extendedFlatAPI.getReferencesToFunctionBFromFunctionA(function, referencedFunction);<NEW_LINE>// add them to list of ref address pairs<NEW_LINE>Iterator<Address> iterator = referencesToFunctionBFromFunctionA.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>Address sourceRefAddr = iterator.next();<NEW_LINE>referenceAddressPairs.add(new ReferenceAddressPair(sourceRefAddr, calledFunction.getEntryPoint()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add list to global map<NEW_LINE>functionToCalledConsDestRefAddrPairMap.put(function, referenceAddressPairs);<NEW_LINE>}
thunkFunction = calledFunction.getThunkedFunction(true);
111,737
protected void addFurtherParametersToUri(SearchRequest searchRequest, UriComponentsBuilder componentsBuilder, String query) {<NEW_LINE>if (!query.isEmpty()) {<NEW_LINE>componentsBuilder.queryParam("q", query);<NEW_LINE>}<NEW_LINE>if (config.getSupportedSearchTypes().contains(ActionAttribute.TVSEARCH)) {<NEW_LINE>if (searchRequest.getSeason().isPresent()) {<NEW_LINE>componentsBuilder.queryParam("season", searchRequest.getSeason().get());<NEW_LINE>}<NEW_LINE>if (searchRequest.getEpisode().isPresent()) {<NEW_LINE>componentsBuilder.queryParam("ep", searchRequest.getEpisode().get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (config.getSupportedSearchTypes().contains(ActionAttribute.BOOK)) {<NEW_LINE>if (searchRequest.getTitle().isPresent()) {<NEW_LINE>componentsBuilder.queryParam("title", searchRequest.getTitle().get());<NEW_LINE>}<NEW_LINE>if (searchRequest.getAuthor().isPresent()) {<NEW_LINE>componentsBuilder.queryParam("author", searchRequest.getAuthor().get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (searchRequest.getMaxage().isPresent()) {<NEW_LINE>componentsBuilder.queryParam("maxage", searchRequest.getMaxage().get());<NEW_LINE>}<NEW_LINE>if (searchRequest.getMinsize().isPresent()) {<NEW_LINE>componentsBuilder.queryParam("minsize", searchRequest.getMinsize().get());<NEW_LINE>}<NEW_LINE>String passwordParameter = "password";<NEW_LINE>if (config.getHost().toLowerCase().contains("omgwtf")) {<NEW_LINE>passwordParameter = "pw";<NEW_LINE>}<NEW_LINE>if (!configProvider.getBaseConfig().getSearching().isIgnorePassworded() || searchRequest.getInternalData().isIncludePasswords()) {<NEW_LINE>componentsBuilder.queryParam(passwordParameter, "1");<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>calculateAndAddCategories(searchRequest, componentsBuilder);<NEW_LINE>config.getCustomParameters().forEach(x -> {<NEW_LINE>final String[] split = x.split("=");<NEW_LINE>componentsBuilder.queryParam(split[0], split[1]);<NEW_LINE>});<NEW_LINE>}
componentsBuilder.queryParam(passwordParameter, "0");
434,949
public static Collector<CurrencyAmountArray, ?, MultiCurrencyAmountArray> toMultiCurrencyAmountArray() {<NEW_LINE>return // accumulate into a map<NEW_LINE>Collector.<// accumulate into a map<NEW_LINE>CurrencyAmountArray, // accumulate into a map<NEW_LINE>Map<Currency, CurrencyAmountArray>, // accumulate into a map<NEW_LINE>MultiCurrencyAmountArray>// accumulate into a map<NEW_LINE>of(// combine two maps<NEW_LINE>HashMap::new, // combine two maps<NEW_LINE>(map, ca) -> map.merge(ca.getCurrency(), ca, CurrencyAmountArray::plus), (map1, map2) -> {<NEW_LINE>map2.values().forEach((ca2) -> map1.merge(ca2.getCurrency()<MASK><NEW_LINE>return map1;<NEW_LINE>}, // convert to MultiCurrencyAmountArray<NEW_LINE>map -> {<NEW_LINE>Map<Currency, DoubleArray> currencyArrayMap = MapStream.of(map).mapValues(caa -> caa.getValues()).toMap();<NEW_LINE>return MultiCurrencyAmountArray.of(currencyArrayMap);<NEW_LINE>}, UNORDERED);<NEW_LINE>}
, ca2, CurrencyAmountArray::plus));
1,186,082
public boolean checkTrigger(GameEvent event, Game game) {<NEW_LINE>if (!super.checkTrigger(event, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>EntersTheBattlefieldEvent entersEvent = (EntersTheBattlefieldEvent) event;<NEW_LINE>if (entersEvent.getFromZone() == Zone.LIBRARY) {<NEW_LINE>this.getEffects().clear();<NEW_LINE>this.addEffect(new DrawCardSourceControllerEffect(2));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>FblthpTheLostWatcher watcher = game.getState().getWatcher(FblthpTheLostWatcher.class);<NEW_LINE>int zcc = entersEvent.getTarget(<MASK><NEW_LINE>MageObjectReference mor = new MageObjectReference(entersEvent.getTargetId(), zcc, game);<NEW_LINE>if (watcher != null && watcher.spellWasCastFromLibrary(mor)) {<NEW_LINE>this.getEffects().clear();<NEW_LINE>this.addEffect(new DrawCardSourceControllerEffect(2));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>this.getEffects().clear();<NEW_LINE>this.addEffect(new DrawCardSourceControllerEffect(1));<NEW_LINE>return true;<NEW_LINE>}
).getZoneChangeCounter(game) - 1;
7,340
private void drawBuffer(Graphics g, FontMetrics fm, String str, int dispStart, int dispEnd, ArrayList<Integer> specials, Bounds bds) {<NEW_LINE>int x = bds.getX();<NEW_LINE>int y = bds.getY();<NEW_LINE>g.setFont(DEFAULT_FONT);<NEW_LINE>if (fm == null)<NEW_LINE>fm = g.getFontMetrics();<NEW_LINE>final var asc = fm.getAscent();<NEW_LINE>final var x0 = x + 8;<NEW_LINE>final var ys = y + (HEIGHT + asc) / 2;<NEW_LINE>final var dotsWidth = fm.stringWidth("m");<NEW_LINE>int xs;<NEW_LINE>if (dispStart > 0) {<NEW_LINE>g.drawString(str.substring(0, 1), x0, ys);<NEW_LINE>xs = x0 + fm.stringWidth(str.charAt(0) + "m");<NEW_LINE>drawDots(g, xs - dotsWidth, ys, dotsWidth, asc);<NEW_LINE>final var sub = str.substring(dispStart, dispEnd);<NEW_LINE>g.<MASK><NEW_LINE>if (dispEnd < str.length()) {<NEW_LINE>drawDots(g, xs + fm.stringWidth(sub), ys, dotsWidth, asc);<NEW_LINE>}<NEW_LINE>} else if (dispEnd < str.length()) {<NEW_LINE>final var sub = str.substring(dispStart, dispEnd);<NEW_LINE>xs = x0;<NEW_LINE>g.drawString(sub, xs, ys);<NEW_LINE>drawDots(g, xs + fm.stringWidth(sub), ys, dotsWidth, asc);<NEW_LINE>} else {<NEW_LINE>xs = x0;<NEW_LINE>g.drawString(str, xs, ys);<NEW_LINE>}<NEW_LINE>if (specials.size() > 0) {<NEW_LINE>drawSpecials(specials, x0, xs, ys, asc, g, fm, str, dispStart, dispEnd);<NEW_LINE>}<NEW_LINE>}
drawString(sub, xs, ys);
259,451
public void executeTaskAlongWithPingTask(HostInventory inv) {<NEW_LINE>logger.debug(String.format("SimulatorHost[uuid:%s] is tracing vm status", inv.getUuid()));<NEW_LINE>Map<String, VmInstanceState> vms = new HashMap<String, VmInstanceState>();<NEW_LINE>Map<String, VmInstanceState> curr = config.getVmOnHost(inv.getUuid());<NEW_LINE>if (curr == null) {<NEW_LINE>super.reportVmState(inv.getUuid(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, VmInstanceState> e : curr.entrySet()) {<NEW_LINE>if (e.getValue() == VmInstanceState.Running || e.getValue() == VmInstanceState.Unknown) {<NEW_LINE>vms.put(e.getKey(), e.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.reportVmState(inv.getUuid(), vms, null, null);<NEW_LINE>}
), vms, null, null);
999,891
final StartDocumentTextDetectionResult executeStartDocumentTextDetection(StartDocumentTextDetectionRequest startDocumentTextDetectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startDocumentTextDetectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartDocumentTextDetectionRequest> request = null;<NEW_LINE>Response<StartDocumentTextDetectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartDocumentTextDetectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startDocumentTextDetectionRequest));<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, "Textract");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartDocumentTextDetection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartDocumentTextDetectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartDocumentTextDetectionResultJsonUnmarshaller());<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);
469,163
public static Class _TextItemBuilder() {<NEW_LINE>Class tmp;<NEW_LINE>Class mTextItemBuilder = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder");<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$10");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$7");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$6");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$3");<NEW_LINE>mTextItemBuilder = tmp.<MASK><NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$8");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mTextItemBuilder;<NEW_LINE>}
getDeclaredField("this$0").getType();
1,287,147
public void onPlayerWhois(InfoComponent.PlayerWhoisEvent event) {<NEW_LINE>if (event.getPlayer() instanceof Player) {<NEW_LINE>Player player = (Player) event.getPlayer();<NEW_LINE>LocalPlayer <MASK><NEW_LINE>if (WorldGuard.getInstance().getPlatform().getGlobalStateManager().get(localPlayer.getWorld()).useRegions) {<NEW_LINE>ApplicableRegionSet regions = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().getApplicableRegions(localPlayer.getLocation());<NEW_LINE>// Current regions<NEW_LINE>StringBuilder regionStr = new StringBuilder();<NEW_LINE>boolean first = true;<NEW_LINE>for (ProtectedRegion region : regions) {<NEW_LINE>if (!first) {<NEW_LINE>regionStr.append(", ");<NEW_LINE>}<NEW_LINE>if (region.isOwner(localPlayer)) {<NEW_LINE>regionStr.append("+");<NEW_LINE>} else if (region.isMemberOnly(localPlayer)) {<NEW_LINE>regionStr.append("-");<NEW_LINE>}<NEW_LINE>regionStr.append(region.getId());<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>if (regions.size() > 0) {<NEW_LINE>event.addWhoisInformation("Current Regions", regionStr);<NEW_LINE>}<NEW_LINE>event.addWhoisInformation("Can build", regions.testState(localPlayer, Flags.BUILD));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
localPlayer = plugin.wrapPlayer(player);
1,602,641
private boolean observeDo(double secs) {<NEW_LINE>if (regionObserver == null) {<NEW_LINE>Debug.error("Region: observe: Nothing to observe (Region might be invalid): " + this.toStringShort());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (observing) {<NEW_LINE>if (!observingInBackground) {<NEW_LINE>Debug.error("Region: observe: already running for this region. Only one allowed!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log(lvl, "observe: starting in " + this.toStringShort() + " for " + secs + " seconds");<NEW_LINE>int MaxTimePerScan = (int) (1000.0 / observeScanRate);<NEW_LINE>long begin_t = (new <MASK><NEW_LINE>long stop_t;<NEW_LINE>if (secs > Long.MAX_VALUE) {<NEW_LINE>stop_t = Long.MAX_VALUE;<NEW_LINE>} else {<NEW_LINE>stop_t = begin_t + (long) (secs * 1000);<NEW_LINE>}<NEW_LINE>regionObserver.initialize();<NEW_LINE>observing = true;<NEW_LINE>Observing.addRunningObserver(this);<NEW_LINE>while (observing && stop_t > (new Date()).getTime()) {<NEW_LINE>long before_find = (new Date()).getTime();<NEW_LINE>ScreenImage simg = getScreen().capture(x, y, w, h);<NEW_LINE>if (!regionObserver.update(simg)) {<NEW_LINE>observing = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!observing) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>long after_find = (new Date()).getTime();<NEW_LINE>try {<NEW_LINE>if (after_find - before_find < MaxTimePerScan) {<NEW_LINE>Thread.sleep((int) (MaxTimePerScan - (after_find - before_find)));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean observeSuccess = false;<NEW_LINE>if (observing) {<NEW_LINE>observing = false;<NEW_LINE>log(lvl, "observe: stopped due to timeout in " + this.toStringShort() + " for " + secs + " seconds");<NEW_LINE>} else {<NEW_LINE>log(lvl, "observe: ended successfully: " + this.toStringShort());<NEW_LINE>observeSuccess = Observing.hasEvents(this);<NEW_LINE>}<NEW_LINE>return observeSuccess;<NEW_LINE>}
Date()).getTime();
1,165,786
public void symbolAdded(Symbol symbol, int type, Address addr, Object oldValue, Object newValue) {<NEW_LINE>if (recordChanges) {<NEW_LINE>if (!symbol.isDynamic()) {<NEW_LINE>long symbolID = symbol.getID();<NEW_LINE>((ProgramDBChangeSet) changeSet).symbolAdded(symbolID);<NEW_LINE>}<NEW_LINE>if (symbol instanceof VariableSymbolDB) {<NEW_LINE>long nameSpaceID = symbol.getParentNamespace().getID();<NEW_LINE>Function function = getFunctionManager().getFunction(nameSpaceID);<NEW_LINE>if (function != null) {<NEW_LINE>Address entryPoint = function.getEntryPoint();<NEW_LINE>updateChangeSet(entryPoint, entryPoint);<NEW_LINE>fireEvent(new ProgramChangeRecord(DOCR_FUNCTION_CHANGED, entryPoint, entryPoint<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addr != null) {<NEW_LINE>updateChangeSet(addr, addr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>changed = true;<NEW_LINE>fireEvent(new ProgramChangeRecord(type, addr, addr, null, oldValue, newValue));<NEW_LINE>}
, function, null, null));
1,198,558
private static J2ObjcMappingFileProvider depJ2ObjcMappingFileProvider(RuleContext ruleContext) {<NEW_LINE>NestedSetBuilder<Artifact> depsHeaderMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>NestedSetBuilder<Artifact> depsClassMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>NestedSetBuilder<Artifact> depsDependencyMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>NestedSetBuilder<Artifact> depsArchiveSourceMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>for (J2ObjcMappingFileProvider mapping : getJ2ObjCMappings(ruleContext)) {<NEW_LINE>depsHeaderMappingsBuilder.addTransitive(mapping.getHeaderMappingFiles());<NEW_LINE>depsClassMappingsBuilder.addTransitive(mapping.getClassMappingFiles());<NEW_LINE>depsDependencyMappingsBuilder.addTransitive(mapping.getDependencyMappingFiles());<NEW_LINE>depsArchiveSourceMappingsBuilder.addTransitive(mapping.getArchiveSourceMappingFiles());<NEW_LINE>}<NEW_LINE>return new J2ObjcMappingFileProvider(depsHeaderMappingsBuilder.build(), depsClassMappingsBuilder.build(), depsDependencyMappingsBuilder.build(<MASK><NEW_LINE>}
), depsArchiveSourceMappingsBuilder.build());
111,885
public boolean onLongPress(final MotionEvent e, final MapView mapView) {<NEW_LINE>if (Configuration.getInstance().isDebugMapView()) {<NEW_LINE>Log.d(IMapView.LOGTAG, "CirclePlottingOverlay onLongPress");<NEW_LINE>}<NEW_LINE>GeoPoint pt = (GeoPoint) mapView.getProjection().fromPixels((int) e.getX(), (int) <MASK><NEW_LINE>// just in case the point is off the map, let's fix the coordinates<NEW_LINE>if (pt.getLongitude() < -180)<NEW_LINE>pt.setLongitude(pt.getLongitude() + 360);<NEW_LINE>if (pt.getLongitude() > 180)<NEW_LINE>pt.setLongitude(pt.getLongitude() - 360);<NEW_LINE>// latitude is a bit harder. see https://en.wikipedia.org/wiki/Mercator_projection<NEW_LINE>if (pt.getLatitude() > 85.05112877980659)<NEW_LINE>pt.setLatitude(85.05112877980659);<NEW_LINE>if (pt.getLatitude() < -85.05112877980659)<NEW_LINE>pt.setLatitude(-85.05112877980659);<NEW_LINE>List<GeoPoint> circle = Polygon.pointsAsCircle(pt, distanceKm);<NEW_LINE>Polygon p = new Polygon(mapView);<NEW_LINE>p.setPoints(circle);<NEW_LINE>p.setTitle("A circle");<NEW_LINE>mapView.getOverlayManager().add(p);<NEW_LINE>mapView.invalidate();<NEW_LINE>return true;<NEW_LINE>}
e.getY(), null);
1,171,473
private void initLangInfoLink() {<NEW_LINE>if (mLangInfoLink != null) {<NEW_LINE>Spannable link = new SpannableString(getString(R.string.prefs_languages_information_off_link));<NEW_LINE>link.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), UiUtils.getStyledResourceId(getContext(), R.attr.colorAccent))), 0, link.length(), 0);<NEW_LINE>mLangInfoLink.setSummary(link);<NEW_LINE>String TTS_INFO_LINK = getActivity().getString(R.string.tts_info_link);<NEW_LINE>mLangInfoLink.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onPreferenceClick(Preference preference) {<NEW_LINE>final Intent intent <MASK><NEW_LINE>intent.setData(Uri.parse(TTS_INFO_LINK));<NEW_LINE>getContext().startActivity(intent);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>removePreference(getString(R.string.pref_navigation), mLangInfoLink);<NEW_LINE>}<NEW_LINE>}
= new Intent(Intent.ACTION_VIEW);
731,226
private // Images take precedence over background colors.<NEW_LINE>void updateAppearance() {<NEW_LINE>// If there is no background image,<NEW_LINE>// the appearance depends solely on the background color and shape.<NEW_LINE>if (backgroundImageDrawable == null) {<NEW_LINE>if (shape == Component.BUTTON_SHAPE_DEFAULT) {<NEW_LINE>if (backgroundColor == Component.COLOR_DEFAULT) {<NEW_LINE>// If there is no background image and color is default,<NEW_LINE>// restore original 3D bevel appearance.<NEW_LINE>if (isHighContrast || container.$form().HighContrast()) {<NEW_LINE>ViewUtil.setBackgroundDrawable(view, null);<NEW_LINE>ViewUtil.setBackgroundDrawable(view, getSafeBackgroundDrawable());<NEW_LINE>view.getBackground().setColorFilter(Component.COLOR_BLACK, PorterDuff.Mode.SRC_ATOP);<NEW_LINE>} else {<NEW_LINE>ViewUtil.setBackgroundDrawable(view, defaultButtonDrawable);<NEW_LINE>}<NEW_LINE>} else if (backgroundColor == Component.COLOR_NONE) {<NEW_LINE>// Clear the background image.<NEW_LINE>ViewUtil.setBackgroundDrawable(view, null);<NEW_LINE>// Now we set again the default drawable<NEW_LINE>ViewUtil.setBackgroundDrawable(view, getSafeBackgroundDrawable());<NEW_LINE>view.getBackground().setColorFilter(backgroundColor, PorterDuff.Mode.CLEAR);<NEW_LINE>} else {<NEW_LINE>// Clear the background image.<NEW_LINE>ViewUtil.setBackgroundDrawable(view, null);<NEW_LINE>// Now we set again the default drawable<NEW_LINE>ViewUtil.setBackgroundDrawable(view, getSafeBackgroundDrawable());<NEW_LINE>// @Author NMD (Next Mobile Development) [nmdofficialhelp@gmail.com]<NEW_LINE>view.getBackground().setColorFilter(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// If there is no background image and the shape is something other than default,<NEW_LINE>// create a drawable with the appropriate shape and color.<NEW_LINE>setShape();<NEW_LINE>}<NEW_LINE>TextViewUtil.setMinSize(view, defaultButtonMinWidth, defaultButtonMinHeight);<NEW_LINE>} else {<NEW_LINE>// If there is a background image<NEW_LINE>ViewUtil.setBackgroundImage(view, backgroundImageDrawable);<NEW_LINE>TextViewUtil.setMinSize(view, 0, 0);<NEW_LINE>}<NEW_LINE>}
backgroundColor, PorterDuff.Mode.SRC_ATOP);
752,915
public int compare(Viewer viewer, Object e1, Object e2) {<NEW_LINE>final int cat1 = category(e1);<NEW_LINE>final int cat2 = category(e2);<NEW_LINE>if (cat1 != cat2) {<NEW_LINE>return cat1 - cat2;<NEW_LINE>}<NEW_LINE>final String name1 = getLabel(viewer, e1);<NEW_LINE>final String <MASK><NEW_LINE>int result = 0;<NEW_LINE>if (CommonUtils.equalObjects(name1, name2)) {<NEW_LINE>return 0;<NEW_LINE>} else if (name1 == null) {<NEW_LINE>result = -1;<NEW_LINE>} else if (name2 == null) {<NEW_LINE>result = 1;<NEW_LINE>}<NEW_LINE>if (result == 0 && isNumeric(viewer)) {<NEW_LINE>try {<NEW_LINE>final NumberFormat numberFormat = NumberFormat.getInstance();<NEW_LINE>final Number number1 = numberFormat.parse(name1);<NEW_LINE>final Number number2 = numberFormat.parse(name2);<NEW_LINE>result = CommonUtils.compareNumbers(number1, number2);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == 0) {<NEW_LINE>result = getComparator().compare(name1, name2);<NEW_LINE>}<NEW_LINE>return isReversed(viewer) ? -result : result;<NEW_LINE>}
name2 = getLabel(viewer, e2);
1,301,582
private void prepareNetworkInfos(ContainerInfo.Builder containerBuilder, final SingularityContainerInfo containerInfo, final Optional<long[]> ports) {<NEW_LINE>for (SingularityNetworkInfo netInfo : containerInfo.getNetworkInfos().orElse(Collections.emptyList())) {<NEW_LINE>final NetworkInfo.Builder netBuilder = NetworkInfo.newBuilder();<NEW_LINE>if (netInfo.getName().isPresent()) {<NEW_LINE>netBuilder.setName(netInfo.getName().get());<NEW_LINE>}<NEW_LINE>for (String group : netInfo.getGroups().orElse(Collections.emptyList())) {<NEW_LINE>netBuilder.addGroups(group);<NEW_LINE>}<NEW_LINE>for (SingularityPortMapping mapping : netInfo.getPortMappings().orElseGet(defaultPortMappingFor(ports))) {<NEW_LINE>final NetworkInfo.PortMapping.Builder portBuilder = NetworkInfo.PortMapping.newBuilder();<NEW_LINE>final int hostPort = mapping.getHostPort();<NEW_LINE>final int containerPort = mapping.getContainerPort();<NEW_LINE>final long[] offerPorts = ports.orElse(new long[0]);<NEW_LINE>portBuilder.setHostPort(hostPort < offerPorts.length ? (int) offerPorts[hostPort] : hostPort);<NEW_LINE>portBuilder.setContainerPort(containerPort < offerPorts.length ? (int) offerPorts[containerPort] : containerPort);<NEW_LINE>if (mapping.getProtocol().isPresent()) {<NEW_LINE>portBuilder.setProtocol(mapping.<MASK><NEW_LINE>}<NEW_LINE>netBuilder.addPortMappings(portBuilder.build());<NEW_LINE>}<NEW_LINE>containerBuilder.addNetworkInfos(netBuilder.build());<NEW_LINE>}<NEW_LINE>}
getProtocol().get());
1,838,568
private static IRubyObject mkdirCommon(Ruby runtime, String path, IRubyObject[] args) {<NEW_LINE>if (path.startsWith("uri:"))<NEW_LINE>throw runtime.newErrnoEACCESError(path);<NEW_LINE>path = dirFromPath(path, runtime);<NEW_LINE>FileResource res = JRubyFile.createResource(runtime, path);<NEW_LINE>if (res.exists())<NEW_LINE>throw runtime.newErrnoEEXISTError(path);<NEW_LINE>String name = path.replace('\\', '/');<NEW_LINE>boolean <MASK><NEW_LINE>// don't attempt to create a dir for drive letters<NEW_LINE>if (startsWithDriveLetterOnWindows) {<NEW_LINE>// path is just drive letter plus :<NEW_LINE>if (path.length() == 2)<NEW_LINE>return RubyFixnum.zero(runtime);<NEW_LINE>// path is drive letter plus : plus leading or trailing /<NEW_LINE>if (path.length() == 3 && (path.charAt(0) == '/' || path.charAt(2) == '/'))<NEW_LINE>return RubyFixnum.zero(runtime);<NEW_LINE>// path is drive letter plus : plus leading and trailing /<NEW_LINE>if (path.length() == 4 && (path.charAt(0) == '/' && path.charAt(3) == '/'))<NEW_LINE>return RubyFixnum.zero(runtime);<NEW_LINE>}<NEW_LINE>File newDir = res.unwrap(File.class);<NEW_LINE>if (File.separatorChar == '\\')<NEW_LINE>newDir = new File(newDir.getPath());<NEW_LINE>int mode = args.length == 2 ? ((int) args[1].convertToInteger().getLongValue()) : 0777;<NEW_LINE>if (runtime.getPosix().mkdir(newDir.getAbsolutePath(), mode) < 0) {<NEW_LINE>// FIXME: This is a system error based on errno<NEW_LINE>throw runtime.newSystemCallError("mkdir failed");<NEW_LINE>}<NEW_LINE>return RubyFixnum.zero(runtime);<NEW_LINE>}
startsWithDriveLetterOnWindows = RubyFile.startsWithDriveLetterOnWindows(name);
103,175
private void submitForm(boolean fromConfirmAccount) {<NEW_LINE>logDebug("fromConfirmAccount - " + fromConfirmAccount + " email: " + this.emailTemp + "__" + this.passwdTemp);<NEW_LINE>lastEmail = this.emailTemp;<NEW_LINE>lastPassword = this.passwdTemp;<NEW_LINE>imm.hideSoftInputFromWindow(et_user.getWindowToken(), 0);<NEW_LINE>if (!isOnline(context)) {<NEW_LINE>loginLoggingIn.setVisibility(View.GONE);<NEW_LINE>loginLogin.setVisibility(View.VISIBLE);<NEW_LINE>closeCancelDialog();<NEW_LINE>loginCreateAccount.setVisibility(View.VISIBLE);<NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>generatingKeysText.setVisibility(View.GONE);<NEW_LINE>loggingInText.setVisibility(View.GONE);<NEW_LINE>fetchingNodesText.setVisibility(View.GONE);<NEW_LINE>prepareNodesText.setVisibility(View.GONE);<NEW_LINE>serversBusyText.setVisibility(View.GONE);<NEW_LINE>((LoginActivity) context).showSnackbar(getString(R.string.error_server_connection_problem));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>loginLogin.setVisibility(View.GONE);<NEW_LINE><MASK><NEW_LINE>loginLoggingIn.setVisibility(View.VISIBLE);<NEW_LINE>generatingKeysText.setVisibility(View.VISIBLE);<NEW_LINE>loginProgressBar.setVisibility(View.VISIBLE);<NEW_LINE>loginFetchNodesProgressBar.setVisibility(View.GONE);<NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>logDebug("Generating keys");<NEW_LINE>onKeysGenerated(lastEmail, lastPassword);<NEW_LINE>}
loginCreateAccount.setVisibility(View.GONE);
30,853
public LayerDetail mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>LayerDetail layer = new LayerDetail();<NEW_LINE>layer.chunkSize = rs.getInt("int_chunk_size");<NEW_LINE>layer.command = rs.getString("str_cmd");<NEW_LINE>layer.dispatchOrder = rs.getInt("int_dispatch_order");<NEW_LINE>layer.id = rs.getString("pk_layer");<NEW_LINE>layer.jobId = rs.getString("pk_job");<NEW_LINE>layer.showId = rs.getString("pk_show");<NEW_LINE>layer.facilityId = rs.getString("pk_facility");<NEW_LINE>layer.name = rs.getString("str_name");<NEW_LINE>layer.<MASK><NEW_LINE>layer.minimumCores = rs.getInt("int_cores_min");<NEW_LINE>layer.minimumMemory = rs.getLong("int_mem_min");<NEW_LINE>layer.minimumGpus = rs.getInt("int_gpus_min");<NEW_LINE>layer.minimumGpuMemory = rs.getLong("int_gpu_mem_min");<NEW_LINE>layer.type = LayerType.valueOf(rs.getString("str_type"));<NEW_LINE>layer.tags = Sets.newHashSet(rs.getString("str_tags").replaceAll(" ", "").split("\\|"));<NEW_LINE>layer.services.addAll(Lists.newArrayList(rs.getString("str_services").split(",")));<NEW_LINE>layer.timeout = rs.getInt("int_timeout");<NEW_LINE>layer.timeout_llu = rs.getInt("int_timeout_llu");<NEW_LINE>return layer;<NEW_LINE>}
range = rs.getString("str_range");
129,045
MethodReference generateBeanDefinitionMethod(GenerationContext generationContext, BeanRegistrationsCode beanRegistrationsCode) {<NEW_LINE>BeanRegistrationCodeFragments codeFragments = getCodeFragments(beanRegistrationsCode);<NEW_LINE>Class<?> target = codeFragments.getTarget(this.registeredBean, this.constructorOrFactoryMethod);<NEW_LINE>if (!target.getName().startsWith("java.")) {<NEW_LINE>GeneratedClass generatedClass = generationContext.getClassGenerator().getOrGenerateClass(new BeanDefinitionsJavaFileGenerator(target), target, "BeanDefinitions");<NEW_LINE>MethodGenerator methodGenerator = generatedClass.getMethodGenerator().withName(getName());<NEW_LINE>GeneratedMethod generatedMethod = generateBeanDefinitionMethod(generationContext, generatedClass.getName(), methodGenerator, codeFragments, Modifier.PUBLIC);<NEW_LINE>return MethodReference.ofStatic(generatedClass.getName(), generatedMethod.getName());<NEW_LINE>}<NEW_LINE>MethodGenerator methodGenerator = beanRegistrationsCode.getMethodGenerator().withName(getName());<NEW_LINE>GeneratedMethod generatedMethod = generateBeanDefinitionMethod(generationContext, beanRegistrationsCode.getClassName(), methodGenerator, codeFragments, Modifier.PRIVATE);<NEW_LINE>return MethodReference.ofStatic(beanRegistrationsCode.getClassName(), generatedMethod.<MASK><NEW_LINE>}
getName().toString());
1,396,635
public DebugSymbolName next() {<NEW_LINE>try {<NEW_LINE>if (pulMatchSize.getValue().intValue() == 0) {<NEW_LINE>COMUtils.checkRC(jnaSymbols.GetNextSymbolMatch(pullHandle.getValue(), null, new ULONG(0), pulMatchSize, null));<NEW_LINE>}<NEW_LINE>byte[] aBuffer = new byte[pulMatchSize.getValue().intValue()];<NEW_LINE>COMUtils.checkRC(jnaSymbols.GetNextSymbolMatch(pullHandle.getValue(), aBuffer, pulMatchSize.getValue(), null, pullOffset));<NEW_LINE>return new DebugSymbolName(Native.toString(aBuffer), pullOffset.<MASK><NEW_LINE>} catch (COMException e) {<NEW_LINE>if (!COMUtilsExtra.isE_NOINTERFACE(e)) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>pulMatchSize.getValue().setValue(0);<NEW_LINE>}<NEW_LINE>}
getValue().longValue());
702,749
public JsonElement extract() {<NEW_LINE>var enchantsJson = new JsonArray();<NEW_LINE>for (var enchant : Registry.ENCHANTMENT) {<NEW_LINE>var enchantJson = new JsonObject();<NEW_LINE>enchantJson.addProperty("id", Registry.ENCHANTMENT.getRawId(enchant));<NEW_LINE>enchantJson.addProperty("name", Registry.ENCHANTMENT.getId(enchant).getPath());<NEW_LINE>enchantJson.addProperty(<MASK><NEW_LINE>enchantJson.addProperty("min_level", enchant.getMinLevel());<NEW_LINE>enchantJson.addProperty("max_level", enchant.getMaxLevel());<NEW_LINE>enchantJson.addProperty("rarity_weight", enchant.getRarity().getWeight());<NEW_LINE>enchantJson.addProperty("cursed", enchant.isCursed());<NEW_LINE>var enchantmentSources = new JsonObject();<NEW_LINE>enchantmentSources.addProperty("treasure", enchant.isTreasure());<NEW_LINE>enchantmentSources.addProperty("enchantment_table", enchant.isAvailableForEnchantedBookOffer());<NEW_LINE>// All enchants except for 'Soul speed' and 'Swift sneak' are available for random selection and are only obtainable from loot chests.<NEW_LINE>enchantmentSources.addProperty("random_selection", enchant.isAvailableForRandomSelection());<NEW_LINE>enchantJson.add("sources", enchantmentSources);<NEW_LINE>enchantsJson.add(enchantJson);<NEW_LINE>}<NEW_LINE>return enchantsJson;<NEW_LINE>}
"translation_key", enchant.getTranslationKey());
338,891
private void initActive() throws ExecutorManagerException {<NEW_LINE>final Executor executor;<NEW_LINE>final int port;<NEW_LINE>final boolean useSsl = props.<MASK><NEW_LINE>if (useSsl) {<NEW_LINE>port = this.props.getInt(ConfigurationKeys.EXECUTOR_SSL_PORT, -1);<NEW_LINE>} else {<NEW_LINE>port = this.props.getInt(ConfigurationKeys.EXECUTOR_PORT, -1);<NEW_LINE>}<NEW_LINE>if (port != -1) {<NEW_LINE>final String host = requireNonNull(getHost());<NEW_LINE>// Check if this executor exists previously in the DB<NEW_LINE>try {<NEW_LINE>executor = this.executionLoader.fetchExecutor(host, port);<NEW_LINE>} catch (final ExecutorManagerException e) {<NEW_LINE>logger.error("Error fetching executor entry from DB", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (executor == null) {<NEW_LINE>logger.info("This executor wasn't found in the DB. Setting active=false.");<NEW_LINE>getFlowRunnerManager().setActiveInternal(false);<NEW_LINE>} else {<NEW_LINE>logger.info("This executor is already in the DB. Found active=" + executor.isActive());<NEW_LINE>getFlowRunnerManager().setActiveInternal(executor.isActive());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// In case of "pick any free port" executor can't be activated based on the value in DB like above, because port<NEW_LINE>// is only available after the jetty server has started.<NEW_LINE>logger.info(ConfigurationKeys.EXECUTOR_PORT + " wasn't set - free port will be picked automatically. Executor " + "is started with active=false and must be activated separately.");<NEW_LINE>}<NEW_LINE>}
getBoolean(ConfigurationKeys.JETTY_USE_SSL, true);
821,561
private static void parseRoutingRule(XmlPullParser parser, GeneralRouter currentRouter, RouteDataObjectAttribute attr, String parentType, Stack<RoutingRule> stack) {<NEW_LINE>String pname = parser.getName();<NEW_LINE>if (checkTag(pname)) {<NEW_LINE>if (attr == null) {<NEW_LINE>throw new NullPointerException("Select tag filter outside road attribute < " + pname + " > : " + parser.getLineNumber());<NEW_LINE>}<NEW_LINE>RoutingRule rr = new RoutingRule();<NEW_LINE>rr.tagName = pname;<NEW_LINE>rr.t = <MASK><NEW_LINE>rr.v = parser.getAttributeValue("", "v");<NEW_LINE>rr.param = parser.getAttributeValue("", "param");<NEW_LINE>rr.value1 = parser.getAttributeValue("", "value1");<NEW_LINE>rr.value2 = parser.getAttributeValue("", "value2");<NEW_LINE>rr.type = parser.getAttributeValue("", "type");<NEW_LINE>if ((rr.type == null || rr.type.length() == 0) && parentType != null && parentType.length() > 0) {<NEW_LINE>rr.type = parentType;<NEW_LINE>}<NEW_LINE>RouteAttributeContext ctx = currentRouter.getObjContext(attr);<NEW_LINE>if ("select".equals(rr.tagName)) {<NEW_LINE>String val = parser.getAttributeValue("", "value");<NEW_LINE>String type = rr.type;<NEW_LINE>ctx.registerNewRule(val, type);<NEW_LINE>addSubclause(rr, ctx);<NEW_LINE>for (int i = 0; i < stack.size(); i++) {<NEW_LINE>addSubclause(stack.get(i), ctx);<NEW_LINE>}<NEW_LINE>} else if (stack.size() > 0 && "select".equals(stack.peek().tagName)) {<NEW_LINE>addSubclause(rr, ctx);<NEW_LINE>}<NEW_LINE>stack.push(rr);<NEW_LINE>}<NEW_LINE>}
parser.getAttributeValue("", "t");
53,121
public void deserialize(byte[] data) throws IOException {<NEW_LINE>BKDLConfigFormat configFormat = new BKDLConfigFormat();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>TJSONProtocol protocol = new TJSONProtocol(transport);<NEW_LINE>configFormat.read(protocol);<NEW_LINE>} catch (TException e) {<NEW_LINE>throw new IOException("Failed to deserialize data '" + new String(data, UTF_8) + "' : ", e);<NEW_LINE>}<NEW_LINE>// bookkeeper cluster settings<NEW_LINE>if (configFormat.isSetBkZkServers()) {<NEW_LINE>bkZkServersForWriter = configFormat.getBkZkServers();<NEW_LINE>}<NEW_LINE>if (configFormat.isSetBkZkServersForReader()) {<NEW_LINE>bkZkServersForReader = configFormat.getBkZkServersForReader();<NEW_LINE>} else {<NEW_LINE>bkZkServersForReader = bkZkServersForWriter;<NEW_LINE>}<NEW_LINE>if (configFormat.isSetBkLedgersPath()) {<NEW_LINE>bkLedgersPath = configFormat.getBkLedgersPath();<NEW_LINE>}<NEW_LINE>// dl zookeeper cluster settings<NEW_LINE>if (configFormat.isSetDlZkServersForWriter()) {<NEW_LINE>dlZkServersForWriter = configFormat.getDlZkServersForWriter();<NEW_LINE>}<NEW_LINE>if (configFormat.isSetDlZkServersForReader()) {<NEW_LINE>dlZkServersForReader = configFormat.getDlZkServersForReader();<NEW_LINE>} else {<NEW_LINE>dlZkServersForReader = dlZkServersForWriter;<NEW_LINE>}<NEW_LINE>// dl settings<NEW_LINE>sanityCheckTxnID = !configFormat.isSetSanityCheckTxnID() || configFormat.isSanityCheckTxnID();<NEW_LINE>encodeRegionID = configFormat.isSetEncodeRegionID() && configFormat.isEncodeRegionID();<NEW_LINE>if (configFormat.isSetAclRootPath()) {<NEW_LINE>aclRootPath = configFormat.getAclRootPath();<NEW_LINE>}<NEW_LINE>if (configFormat.isSetFirstLogSegmentSeqNo()) {<NEW_LINE>firstLogSegmentSeqNo = configFormat.getFirstLogSegmentSeqNo();<NEW_LINE>}<NEW_LINE>isFederatedNamespace = configFormat.isSetFederatedNamespace() && configFormat.isFederatedNamespace();<NEW_LINE>// Validate the settings<NEW_LINE>if (null == bkZkServersForWriter || null == bkZkServersForReader || null == bkLedgersPath || null == dlZkServersForWriter || null == dlZkServersForReader) {<NEW_LINE>throw new IOException("Missing zk/bk settings in BKDL Config : " + new String(data, UTF_8));<NEW_LINE>}<NEW_LINE>}
TMemoryInputTransport transport = new TMemoryInputTransport(data);
738,938
public AmazonServiceException handle(HttpResponse errorResponse) throws IOException {<NEW_LINE>final InputStream is = errorResponse.getContent();<NEW_LINE>if (is == null) {<NEW_LINE>return newAmazonS3Exception(errorResponse.getStatusText(), errorResponse);<NEW_LINE>}<NEW_LINE>// Try to read the error response<NEW_LINE>String content = "";<NEW_LINE>try {<NEW_LINE>content = IOUtils.toString(is);<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return newAmazonS3Exception(errorResponse.getStatusText(), errorResponse);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// try to parse the error response as XML<NEW_LINE>final Document document = XpathUtils.documentFrom(content);<NEW_LINE>final String message = XpathUtils.asString("Error/Message", document);<NEW_LINE>final String errorCode = XpathUtils.asString("Error/Code", document);<NEW_LINE>final String requestId = XpathUtils.asString("Error/RequestId", document);<NEW_LINE>final String extendedRequestId = XpathUtils.asString("Error/HostId", document);<NEW_LINE>final AmazonS3Exception ase = new AmazonS3Exception(message);<NEW_LINE>final int statusCode = errorResponse.getStatusCode();<NEW_LINE>ase.setStatusCode(statusCode);<NEW_LINE>ase.setErrorType(errorTypeOf(statusCode));<NEW_LINE>ase.setErrorCode(errorCode);<NEW_LINE>ase.setRequestId(requestId);<NEW_LINE>ase.setExtendedRequestId(extendedRequestId);<NEW_LINE>ase.setCloudFrontId(errorResponse.getHeaders().get(Headers.CLOUD_FRONT_ID));<NEW_LINE>return ase;<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Failed in parsing the response as XML: " + content, ex);<NEW_LINE>}<NEW_LINE>return newAmazonS3Exception(content, errorResponse);<NEW_LINE>}<NEW_LINE>}
log.debug("Failed in reading the error response", ex);
1,343,886
public List<FactLine> distribute(final List<FactLine> lines) {<NEW_LINE>// no lines -> nothing to distribute<NEW_LINE>if (lines.isEmpty()) {<NEW_LINE>return lines;<NEW_LINE>}<NEW_LINE>final List<FactLine> newLines = new ArrayList<>();<NEW_LINE>final List<FactLine> newLines_Last = new ArrayList<>();<NEW_LINE>// For all fact lines<NEW_LINE>for (final FactLine line : lines) {<NEW_LINE>final AccountDimension <MASK><NEW_LINE>final I_GL_Distribution distribution = findGL_Distribution(line, lineDimension);<NEW_LINE>if (distribution == null) {<NEW_LINE>// keep the line as is<NEW_LINE>newLines.add(line);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create GL_Distribution fact lines<NEW_LINE>final IPair<Sign, BigDecimal> amountToDistribute = deriveAmountAndSign(line);<NEW_LINE>final GLDistributionResult distributionResult = GLDistributionBuilder.newInstance().setGLDistribution(distribution).setAccountDimension(lineDimension).setAmountSign(amountToDistribute.getLeft()).setAmountToDistribute(amountToDistribute.getRight()).setCurrencyId(line.getCurrencyId()).setQtyToDistribute(line.getQty()).distribute();<NEW_LINE>final List<FactLine> lines_Distributed = createFactLines(line, distributionResult);<NEW_LINE>// FR 2685367 - GL Distribution delete line instead reverse<NEW_LINE>if (distribution.isCreateReversal()) {<NEW_LINE>// keep the original line in it's place<NEW_LINE>newLines.add(line);<NEW_LINE>// Add Reversal<NEW_LINE>final FactLine reversal = line.accrue(distribution.getName());<NEW_LINE>newLines_Last.add(reversal);<NEW_LINE>// Add the "distribution to" lines<NEW_LINE>newLines_Last.addAll(lines_Distributed);<NEW_LINE>} else {<NEW_LINE>// NOTE don't add the original line because we are replacing it<NEW_LINE>// Add the "distribution to" lines<NEW_LINE>newLines.addAll(lines_Distributed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Add last lines to our new lines<NEW_LINE>newLines.addAll(newLines_Last);<NEW_LINE>return newLines;<NEW_LINE>}
lineDimension = factAcctBL.createAccountDimension(line);
1,777,209
private void addCurrentUserOpenWithList(String name, String extKey, String appName, Properties props) throws NativeException {<NEW_LINE>boolean found = false;<NEW_LINE>// =a<NEW_LINE>String freeValue = MRU_VALUES.substring(0, 1);<NEW_LINE>String cuExtKey = CURRENT_USER_FILE_EXT_KEY + SEP + name;<NEW_LINE>if (!registry.keyExists(HKCU, cuExtKey, OPEN_WITH_LIST_KEY_NAME)) {<NEW_LINE>registry.createKey(HKCU, cuExtKey, OPEN_WITH_LIST_KEY_NAME);<NEW_LINE>} else {<NEW_LINE>freeValue = null;<NEW_LINE>for (int i = 0; i < MRU_VALUES.length(); i++) {<NEW_LINE>String s = MRU_VALUES.<MASK><NEW_LINE>if (registry.valueExists(HKCU, cuExtKey + SEP + OPEN_WITH_LIST_KEY_NAME, s)) {<NEW_LINE>String app = registry.getStringValue(HKCU, cuExtKey + SEP + OPEN_WITH_LIST_KEY_NAME, s);<NEW_LINE>if (app.equals(appName)) {<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>} else if (freeValue == null) {<NEW_LINE>freeValue = s;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>registry.setStringValue(HKCU, cuExtKey + SEP + OPEN_WITH_LIST_KEY_NAME, freeValue, appName);<NEW_LINE>setExtProperty(props, name, EXT_HKCU_OPENWITHLIST_PROPERTY, CREATED);<NEW_LINE>String mru = freeValue;<NEW_LINE>if (registry.valueExists(HKCU, cuExtKey + SEP + OPEN_WITH_LIST_KEY_NAME, MRULIST_VALUE_NAME)) {<NEW_LINE>mru = mru + registry.getStringValue(HKCU, cuExtKey + SEP + OPEN_WITH_LIST_KEY_NAME, MRULIST_VALUE_NAME);<NEW_LINE>}<NEW_LINE>registry.setStringValue(HKCU, cuExtKey + SEP + OPEN_WITH_LIST_KEY_NAME, MRULIST_VALUE_NAME, mru);<NEW_LINE>}<NEW_LINE>}
substring(i, i + 1);
1,036,393
public static void addApplicationServer() {<NEW_LINE>String glassfishHome = System.getProperty("glassfish.home");<NEW_LINE>if (glassfishHome == null) {<NEW_LINE>throw new Error("Can't add GlassFish server. glassfish.home property is not set.");<NEW_LINE>}<NEW_LINE>// Add Server...<NEW_LINE>String addServerMenuItem = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.actions.Bundle", "LBL_Add_Server_Instance");<NEW_LINE>// "Add Server Instance"<NEW_LINE>String addServerInstanceDialogTitle = <MASK><NEW_LINE>RuntimeTabOperator rto = RuntimeTabOperator.invoke();<NEW_LINE>Node serversNode = new Node(rto.getRootNode(), "Servers");<NEW_LINE>// Let's check whether GlassFish is already added<NEW_LINE>if (!serversNode.isChildPresent("GlassFish")) {<NEW_LINE>// There is no GlassFish node so we'll add it<NEW_LINE>serversNode.performPopupActionNoBlock(addServerMenuItem);<NEW_LINE>WizardOperator addServerInstanceDialog = new WizardOperator(addServerInstanceDialogTitle);<NEW_LINE>new JListOperator(addServerInstanceDialog, 1).selectItem("GlassFish Server");<NEW_LINE>addServerInstanceDialog.next();<NEW_LINE>new JTextFieldOperator(addServerInstanceDialog).setText(glassfishHome);<NEW_LINE>addServerInstanceDialog.next();<NEW_LINE>addServerInstanceDialog.finish();<NEW_LINE>}<NEW_LINE>}
Bundle.getStringTrimmed("org.netbeans.modules.j2ee.deployment.impl.ui.wizard.Bundle", "LBL_ASIW_Title");
770,058
public static DescribeAiotPersonTablesResponse unmarshall(DescribeAiotPersonTablesResponse describeAiotPersonTablesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAiotPersonTablesResponse.setRequestId(_ctx.stringValue("DescribeAiotPersonTablesResponse.RequestId"));<NEW_LINE>describeAiotPersonTablesResponse.setMessage(_ctx.stringValue("DescribeAiotPersonTablesResponse.Message"));<NEW_LINE>describeAiotPersonTablesResponse.setCode(_ctx.stringValue("DescribeAiotPersonTablesResponse.Code"));<NEW_LINE>List<PersonTableType> personTableList = new ArrayList<PersonTableType>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAiotPersonTablesResponse.PersonTableList.Length"); i++) {<NEW_LINE>PersonTableType personTableType = new PersonTableType();<NEW_LINE>personTableType.setPersonTableId(_ctx.stringValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].PersonTableId"));<NEW_LINE>personTableType.setName(_ctx.stringValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].Name"));<NEW_LINE>personTableType.setType(_ctx.longValue<MASK><NEW_LINE>personTableType.setTotalPersonNum(_ctx.longValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].TotalPersonNum"));<NEW_LINE>personTableType.setPersonNum(_ctx.longValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].PersonNum"));<NEW_LINE>personTableType.setFaceNum(_ctx.longValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].FaceNum"));<NEW_LINE>personTableType.setLastChange(_ctx.stringValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].LastChange"));<NEW_LINE>personTableType.setDeviceId(_ctx.stringValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].DeviceId"));<NEW_LINE>List<Long> verificationModelList = new ArrayList<Long>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].VerificationModelList.Length"); j++) {<NEW_LINE>verificationModelList.add(_ctx.longValue("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].VerificationModelList[" + j + "]"));<NEW_LINE>}<NEW_LINE>personTableType.setVerificationModelList(verificationModelList);<NEW_LINE>personTableList.add(personTableType);<NEW_LINE>}<NEW_LINE>describeAiotPersonTablesResponse.setPersonTableList(personTableList);<NEW_LINE>return describeAiotPersonTablesResponse;<NEW_LINE>}
("DescribeAiotPersonTablesResponse.PersonTableList[" + i + "].Type"));
1,581,301
public static void grayMagnitude(GrayS32 input, int maxAbsValue, Bitmap output, @Nullable DogArray_I8 _storage) {<NEW_LINE>shapeShape(input, output);<NEW_LINE>_storage = ConvertBitmap.resizeStorage(output, _storage);<NEW_LINE>final byte[] storage = _storage.data;<NEW_LINE>if (maxAbsValue < 0)<NEW_LINE>maxAbsValue = ImageStatistics.maxAbs(input);<NEW_LINE>int indexDst = 0;<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexSrc = input.startIndex + y * input.stride;<NEW_LINE>for (int x = 0; x < input.width; x++) {<NEW_LINE>byte gray = (byte) (255 * Math.abs(input.data[indexSrc++]) / maxAbsValue);<NEW_LINE>storage[indexDst++] = gray;<NEW_LINE>storage[indexDst++] = gray;<NEW_LINE>storage[indexDst++] = gray;<NEW_LINE>storage[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.copyPixelsFromBuffer(ByteBuffer.wrap(storage));<NEW_LINE>}
indexDst++] = (byte) 0xFF;
1,174,697
public static ListDeviceGroupsResponse unmarshall(ListDeviceGroupsResponse listDeviceGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDeviceGroupsResponse.setRequestId(_ctx.stringValue("ListDeviceGroupsResponse.RequestId"));<NEW_LINE>listDeviceGroupsResponse.setMessage(_ctx.stringValue("ListDeviceGroupsResponse.Message"));<NEW_LINE>listDeviceGroupsResponse.setCode(_ctx.stringValue("ListDeviceGroupsResponse.Code"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDeviceGroupsResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setTotalCount(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].TotalCount"));<NEW_LINE>List<ListItem> list = new ArrayList<ListItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListDeviceGroupsResponse.Data[" + i + "].List.Length"); j++) {<NEW_LINE>ListItem listItem = new ListItem();<NEW_LINE>listItem.setDeviceStreamStatus(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].DeviceStreamStatus"));<NEW_LINE>listItem.setDeviceName(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i <MASK><NEW_LINE>listItem.setDeviceStatus(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].DeviceStatus"));<NEW_LINE>listItem.setRegionId(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].RegionId"));<NEW_LINE>listItem.setDeviceSn(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].DeviceSn"));<NEW_LINE>listItem.setDeviceComputeStatus(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].DeviceComputeStatus"));<NEW_LINE>listItem.setInstallAddress(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].InstallAddress"));<NEW_LINE>listItem.setDeviceGroup(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].DeviceGroup"));<NEW_LINE>listItem.setRegionName(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].RegionName"));<NEW_LINE>listItem.setDataSourceType(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].DataSourceType"));<NEW_LINE>listItem.setResolvingPower(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].ResolvingPower"));<NEW_LINE>listItem.setDeviceCode(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].DeviceCode"));<NEW_LINE>listItem.setBitRate(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].BitRate"));<NEW_LINE>listItem.setCodingFormat(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].CodingFormat"));<NEW_LINE>listItem.setType(_ctx.stringValue("ListDeviceGroupsResponse.Data[" + i + "].List[" + j + "].Type"));<NEW_LINE>list.add(listItem);<NEW_LINE>}<NEW_LINE>dataItem.setList(list);<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listDeviceGroupsResponse.setData(data);<NEW_LINE>return listDeviceGroupsResponse;<NEW_LINE>}
+ "].List[" + j + "].DeviceName"));
1,429,916
static int encodeCatchupPosition(final UnsafeBuffer encodingBuffer, final int offset, final int captureLength, final int length, final long leadershipTermId, final long logPosition, final int followerMemberId, final String catchupEndpoint) {<NEW_LINE>final int logHeaderLength = encodeLogHeader(encodingBuffer, offset, captureLength, length);<NEW_LINE>final int bodyOffset = offset + logHeaderLength;<NEW_LINE>int bodyLength = 0;<NEW_LINE>encodingBuffer.putLong(bodyOffset + bodyLength, leadershipTermId, LITTLE_ENDIAN);<NEW_LINE>bodyLength += SIZE_OF_LONG;<NEW_LINE>encodingBuffer.putLong(<MASK><NEW_LINE>bodyLength += SIZE_OF_LONG;<NEW_LINE>encodingBuffer.putInt(bodyOffset + bodyLength, followerMemberId, LITTLE_ENDIAN);<NEW_LINE>bodyLength += SIZE_OF_INT;<NEW_LINE>bodyLength += encodeTrailingString(encodingBuffer, bodyOffset + bodyLength, captureLength - bodyLength, catchupEndpoint);<NEW_LINE>return logHeaderLength + bodyLength;<NEW_LINE>}
bodyOffset + bodyLength, logPosition, LITTLE_ENDIAN);
173,169
public Optional<T> process(List<String> values) {<NEW_LINE>if (values.size() != fieldNames.size()) {<NEW_LINE>throw new IllegalArgumentException("values must have the same length as fieldNames. Got values: " + values.size() + " fieldNames: " + fieldNames.size());<NEW_LINE>}<NEW_LINE>List<String> response = new ArrayList<>();<NEW_LINE>for (int i = 0; i < fieldNames.size(); i++) {<NEW_LINE>String value = values.get(i);<NEW_LINE>String prefix = name == null || name.isEmpty() ? fieldNames.get(i) : name;<NEW_LINE>Quartile q = quartiles.get(i);<NEW_LINE>if (value == null) {<NEW_LINE>response.add(prefix + ":NONE");<NEW_LINE>} else {<NEW_LINE>double dv = Double.parseDouble(value);<NEW_LINE>if (dv <= q.getLowerMedian()) {<NEW_LINE>response.add(prefix + ":first");<NEW_LINE>} else if (dv > q.getLowerMedian() && dv <= q.getMedian()) {<NEW_LINE>response.add(prefix + ":second");<NEW_LINE>} else if (dv > q.getMedian() && dv <= q.getUpperMedian()) {<NEW_LINE>response.add(prefix + ":third");<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(outputFactory.generateOutput(response.size() == 1 ? response.get(0) : response));<NEW_LINE>}
response.add(prefix + ":fourth");
1,364,060
public static void main(String[] args) {<NEW_LINE>Set<String> words = new HashSet<>();<NEW_LINE>words.add("sb");<NEW_LINE>words.add("xx");<NEW_LINE><MASK><NEW_LINE>String text1 = "u sb a";<NEW_LINE>Set<String> ss = sensitiveFilter.getSensitiveWords(text1, MatchType.MIN_MATCH);<NEW_LINE>System.out.println(ss.size());<NEW_LINE>text1 = "u xx";<NEW_LINE>ss = sensitiveFilter.getSensitiveWords(text1, MatchType.MIN_MATCH);<NEW_LINE>System.out.println(ss.size());<NEW_LINE>text1 = "a url is https://sdsbhe.com here";<NEW_LINE>ss = sensitiveFilter.getSensitiveWords(text1, MatchType.MIN_MATCH);<NEW_LINE>System.out.println(ss.size());<NEW_LINE>text1 = "a url is https://sdsbhe.com";<NEW_LINE>ss = sensitiveFilter.getSensitiveWords(text1, MatchType.MIN_MATCH);<NEW_LINE>System.out.println(ss.size());<NEW_LINE>text1 = "a url is https://sdsbhe.com\nsb";<NEW_LINE>ss = sensitiveFilter.getSensitiveWords(text1, MatchType.MIN_MATCH);<NEW_LINE>System.out.println(ss.size());<NEW_LINE>}
SensitiveFilter sensitiveFilter = new SensitiveFilter(words);
1,171,941
public static void endKafkaProducer(Object localContext, Throwable thr) {<NEW_LINE>if (localContext == null)<NEW_LINE>return;<NEW_LINE>LocalContext lctx = (LocalContext) localContext;<NEW_LINE>ParameterizedMessageStep step = (ParameterizedMessageStep) lctx.stepSingle;<NEW_LINE>if (step == null)<NEW_LINE>return;<NEW_LINE>TraceContext tctx = lctx.context;<NEW_LINE>if (tctx == null)<NEW_LINE>return;<NEW_LINE>int elapsed = (int) (System.currentTimeMillis() - tctx.startTime) - step.start_time;<NEW_LINE>step.setElapsed(elapsed);<NEW_LINE>String bootstrapServer = step.getTempMessage("bootstrap");<NEW_LINE>String topic = step.getTempMessage("topic");<NEW_LINE>if (StringUtil.isEmpty(bootstrapServer))<NEW_LINE>bootstrapServer = "-";<NEW_LINE>if (StringUtil.isEmpty(topic))<NEW_LINE>topic = "-";<NEW_LINE>if (thr == null) {<NEW_LINE>step.setMessage(DataProxy.sendHashedMessage<MASK><NEW_LINE>step.setLevel(ParameterizedMessageLevel.INFO);<NEW_LINE>} else {<NEW_LINE>String msg = thr.toString();<NEW_LINE>step.setMessage(DataProxy.sendHashedMessage(KAFKA_COMMAND_ERROR_MSG), bootstrapServer, topic, thr.getClass().getName(), msg);<NEW_LINE>step.setLevel(ParameterizedMessageLevel.ERROR);<NEW_LINE>}<NEW_LINE>tctx.profile.pop(step);<NEW_LINE>// [KAFKA] bootstrap : [localhost:9092], topic : scouter-topic2 [0 ms]<NEW_LINE>if (conf.counter_interaction_enabled) {<NEW_LINE>String kafka = (bootstrapServer.length() > 1) ? bootstrapServer : "kafka";<NEW_LINE>int kafkaHash = DataProxy.sendObjName(kafka);<NEW_LINE>MeterInteraction meterInteraction = MeterInteractionManager.getInstance().getKafkaCallMeter(conf.getObjHash(), kafkaHash);<NEW_LINE>if (meterInteraction != null) {<NEW_LINE>meterInteraction.add(elapsed, thr != null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(KAFKA_COMMAND_MSG), bootstrapServer, topic);
215,902
private void writeBlock(BlockBuilder blockBuilder, Type columnType, int columnIndex) {<NEW_LINE>Class<?> javaType = columnType.getJavaType();<NEW_LINE>DataSchema.ColumnDataType pinotColumnType = currentDataTable.getDataTable().getDataSchema().getColumnDataType(columnIndex);<NEW_LINE>if (columnType instanceof ArrayType) {<NEW_LINE><MASK><NEW_LINE>} else if (javaType.equals(boolean.class)) {<NEW_LINE>writeBooleanBlock(blockBuilder, columnType, columnIndex);<NEW_LINE>} else if (javaType.equals(long.class)) {<NEW_LINE>if (pinotColumnType.toDataType().equals(FieldSpec.DataType.TIMESTAMP)) {<NEW_LINE>writeTimestampBlock(blockBuilder, columnType, columnIndex);<NEW_LINE>} else {<NEW_LINE>writeLongBlock(blockBuilder, columnType, columnIndex);<NEW_LINE>}<NEW_LINE>} else if (javaType.equals(double.class)) {<NEW_LINE>writeDoubleBlock(blockBuilder, columnType, columnIndex);<NEW_LINE>} else if (javaType.equals(Slice.class)) {<NEW_LINE>writeSliceBlock(blockBuilder, columnType, columnIndex);<NEW_LINE>} else {<NEW_LINE>throw new PrestoException(PINOT_UNSUPPORTED_COLUMN_TYPE, String.format("Failed to write column %s. pinotColumnType %s, javaType %s", split.getExpectedColumnHandles().get(columnIndex).getColumnName(), pinotColumnType, javaType));<NEW_LINE>}<NEW_LINE>}
writeArrayBlock(blockBuilder, columnType, columnIndex);
600,327
public void markPotentiallyNullBit(LocalVariableBinding local) {<NEW_LINE>if (this != DEAD_END) {<NEW_LINE>this.tagBits |= NULL_FLAG_MASK;<NEW_LINE>int position;<NEW_LINE>long mask;<NEW_LINE>if ((position = local.id + this.maxFieldCount) < BitCacheSize) {<NEW_LINE>// use bits<NEW_LINE>mask = 1L << position;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially null' mark in unexpected state");<NEW_LINE>this.nullBit2 |= mask;<NEW_LINE>if (COVERAGE_TEST_FLAG) {<NEW_LINE>if (CoverageTestId == 40) {<NEW_LINE>this.nullBit2 = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// use extra vector<NEW_LINE>int vectorIndex = (position / BitCacheSize) - 1;<NEW_LINE>if (this.extra == null) {<NEW_LINE>int length = vectorIndex + 1;<NEW_LINE>createExtraSpace(length);<NEW_LINE>} else {<NEW_LINE>// might need to grow the arrays<NEW_LINE>int oldLength;<NEW_LINE>if (vectorIndex >= (oldLength = this.extra[0].length)) {<NEW_LINE>growSpace(vectorIndex + 1, 0, oldLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mask = 1L << (position % BitCacheSize);<NEW_LINE>this.extra<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially null' mark in unexpected state");<NEW_LINE>if (COVERAGE_TEST_FLAG) {<NEW_LINE>if (CoverageTestId == 41) {<NEW_LINE>this.extra[3][vectorIndex] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[3][vectorIndex] |= mask;
1,649,603
static TieredIdentity create(AlluxioConfiguration conf) {<NEW_LINE>TieredIdentity scriptIdentity = fromScript(conf);<NEW_LINE>List<LocalityTier> tiers = new ArrayList<>();<NEW_LINE>List<String> orderedTierNames = conf.getList(PropertyKey.LOCALITY_ORDER);<NEW_LINE>for (int i = 0; i < orderedTierNames.size(); i++) {<NEW_LINE>String tierName = orderedTierNames.get(i);<NEW_LINE>String value = null;<NEW_LINE>if (scriptIdentity != null) {<NEW_LINE>LocalityTier scriptTier = scriptIdentity.getTier(i);<NEW_LINE>Preconditions.checkState(scriptTier.getTierName().equals(tierName));<NEW_LINE>value = scriptTier.getValue();<NEW_LINE>}<NEW_LINE>// Explicit configuration overrides script output.<NEW_LINE>if (conf.isSet(Template.LOCALITY_TIER.format(tierName))) {<NEW_LINE>value = conf.getString(Template.LOCALITY_TIER.format(tierName));<NEW_LINE>}<NEW_LINE>tiers.add(new LocalityTier(tierName, value));<NEW_LINE>}<NEW_LINE>// If the user doesn't specify the value of the "node" tier, we fill in a sensible default.<NEW_LINE>if (tiers.size() > 0 && tiers.get(0).getTierName().equals(Constants.LOCALITY_NODE) && tiers.get(0).getValue() == null) {<NEW_LINE>String name = NetworkAddressUtils.getLocalNodeName(conf);<NEW_LINE>tiers.set(0, new LocalityTier<MASK><NEW_LINE>}<NEW_LINE>return new TieredIdentity(tiers);<NEW_LINE>}
(Constants.LOCALITY_NODE, name));
927,299
private ResponseEntity postEventInternal(final String eventTypeName, final String eventsAsString, final EventTypeMetrics eventTypeMetrics, final Client client, final HttpServletRequest request, final boolean delete) throws AccessDeniedException, ServiceTemporarilyUnavailableException, InternalNakadiException, EventTypeTimeoutException, NoSuchEventTypeException {<NEW_LINE>final long startingNanos = System.nanoTime();<NEW_LINE>try {<NEW_LINE>final EventPublishResult result;<NEW_LINE>final int totalSizeBytes = eventsAsString.getBytes(Charsets.UTF_8).length;<NEW_LINE>TracingService.setTag("slo_bucket", TracingService.getSLOBucketName(totalSizeBytes));<NEW_LINE>if (delete) {<NEW_LINE>result = publisher.delete(eventsAsString, eventTypeName);<NEW_LINE>} else {<NEW_LINE>result = publisher.publish(eventsAsString, eventTypeName);<NEW_LINE>}<NEW_LINE>final int eventCount = result.getResponses().size();<NEW_LINE>reportMetrics(eventTypeMetrics, result, totalSizeBytes, eventCount);<NEW_LINE>reportSLOs(startingNanos, totalSizeBytes, <MASK><NEW_LINE>if (result.getStatus() == EventPublishingStatus.FAILED) {<NEW_LINE>TracingService.setErrorFlag();<NEW_LINE>}<NEW_LINE>return response(result);<NEW_LINE>} finally {<NEW_LINE>eventTypeMetrics.updateTiming(startingNanos, System.nanoTime());<NEW_LINE>}<NEW_LINE>}
eventCount, result, eventTypeName, client);
661,232
public Vector<LocalDate> toDate() {<NEW_LINE>LocalDate[] dates = null;<NEW_LINE>if (type.id() == DataType.ID.DateTime) {<NEW_LINE>dates = stream().map(d -> ((LocalDateTime) d).toLocalDate()).toArray(LocalDate[]::new);<NEW_LINE>} else if (type.id() == DataType.ID.Object) {<NEW_LINE>Class<?> clazz = ((ObjectType) type).getObjectClass();<NEW_LINE>if (clazz == Date.class) {<NEW_LINE>dates = stream().map(d -> ((Date) d).toInstant().atZone(ZoneId.systemDefault()).toLocalDate()).toArray(LocalDate[]::new);<NEW_LINE>} else if (clazz == Instant.class) {<NEW_LINE>dates = stream().map(d -> ((Instant) d).atZone(ZoneId.systemDefault()).toLocalDate()).toArray(LocalDate[]::new);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dates == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return new VectorImpl<>(name, DataTypes.DateType, dates);<NEW_LINE>}
throw new UnsupportedOperationException("Unsupported data type for toDate(): " + type);
1,835,522
private static void addFilesToBuildTarget(@NotNull CompileContext context, @NotNull List<String> sortedDirtyErlangModules) {<NEW_LINE>List<ErlangTargetType> targetTypes = Collections.singletonList(ErlangTargetType.INSTANCE);<NEW_LINE>BuildRootIndex buildRootIndex = context.getProjectDescriptor().getBuildRootIndex();<NEW_LINE>for (String filePath : sortedDirtyErlangModules) {<NEW_LINE>ErlangSourceRootDescriptor root = buildRootIndex.findParentDescriptor(new File(filePath), targetTypes, context);<NEW_LINE>if (root == null) {<NEW_LINE>LOG.error("Source root not found.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ErlangTarget target = (ErlangTarget) root.getTarget();<NEW_LINE>ErlangModuleBuildOrder buildOrder = target.getBuildOrder();<NEW_LINE>if (buildOrder == null) {<NEW_LINE>LOG.error("buildOrder for erlang module target are not set.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (root.isTests()) {<NEW_LINE>buildOrder.myOrderedErlangTestFilePaths.add(filePath);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
buildOrder.myOrderedErlangFilePaths.add(filePath);
463,503
private void updateBufSize() {<NEW_LINE>//<NEW_LINE>// Must be called without any other threads holding the lock to the MulticastSocket!<NEW_LINE>//<NEW_LINE>try {<NEW_LINE>//<NEW_LINE>// Try to set the buffer size. The kernel will silently adjust the size to an acceptable value.<NEW_LINE>// Then read the size back to get the size that was actually set.<NEW_LINE>//<NEW_LINE>_socket.setReceiveBufferSize(_newSize);<NEW_LINE>_size = _socket.getReceiveBufferSize();<NEW_LINE>//<NEW_LINE>// Warn if the size that was set is less than the requested size and we have not already warned.<NEW_LINE>//<NEW_LINE>if (_size < _newSize) {<NEW_LINE>BufSizeWarnInfo winfo = _instance.getBufSizeWarn(com.zeroc.Ice.UDPEndpointType.value);<NEW_LINE>if (!winfo.rcvWarn || winfo.rcvSize != _newSize) {<NEW_LINE>_instance.logger().warning(<MASK><NEW_LINE>_instance.setRcvBufSizeWarn(com.zeroc.Ice.UDPEndpointType.value, _newSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (java.io.IOException ex) {<NEW_LINE>if (_socket != null) {<NEW_LINE>_socket.close();<NEW_LINE>}<NEW_LINE>_socket = null;<NEW_LINE>throw new com.zeroc.Ice.SocketException(ex);<NEW_LINE>}<NEW_LINE>}
"UDP receive buffer size: requested size of " + _newSize + " adjusted to " + _size);
1,845,503
public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor monitor) throws IOException {<NEW_LINE>if (monitor != null && monitor.isCanceled())<NEW_LINE>throw new OperationCanceledException();<NEW_LINE>try {<NEW_LINE>index.startQuery();<NEW_LINE>SearchPattern pattern = currentPattern();<NEW_LINE>EntryResult[] entries = pattern.queryIn(index);<NEW_LINE>if (entries == null)<NEW_LINE>return;<NEW_LINE>String containerPath = index.containerPath;<NEW_LINE>char separator = index.separator;<NEW_LINE>for (int i = 0, l = entries.length; i < l; i++) {<NEW_LINE>if (monitor != null && monitor.isCanceled())<NEW_LINE>throw new OperationCanceledException();<NEW_LINE>EntryResult entry = entries[i];<NEW_LINE><MASK><NEW_LINE>decodedResult.decodeIndexKey(entry.getWord());<NEW_LINE>if (pattern.matchesDecodedKey(decodedResult)) {<NEW_LINE>// TODO (kent) some clients may not need the document names<NEW_LINE>String[] names = entry.getDocumentNames(index);<NEW_LINE>for (int j = 0, n = names.length; j < n; j++) acceptMatch(names[j], containerPath, separator, decodedResult, requestor, participant, scope, monitor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>index.stopQuery();<NEW_LINE>}<NEW_LINE>}
SearchPattern decodedResult = pattern.getBlankPattern();
962,584
public boolean refreshUserSignInState() {<NEW_LINE>final OptionalPendingResult<GoogleSignInResult> opr = <MASK><NEW_LINE>if (opr.isDone()) {<NEW_LINE>// If the user's cached credentials are valid, the OptionalPendingResult will be "done"<NEW_LINE>// and the GoogleSignInResult will be available instantly.<NEW_LINE>final GoogleSignInResult result = opr.get();<NEW_LINE>if (result == null) {<NEW_LINE>Log.d(LOG_TAG, "GoogleSignInResult is null. Not signed-in with Google.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return handleGoogleSignInResultForIsUserSignedIn(result);<NEW_LINE>}<NEW_LINE>final GoogleApiAvailability api = GoogleApiAvailability.getInstance();<NEW_LINE>final int code = api.isGooglePlayServicesAvailable(context.getApplicationContext());<NEW_LINE>if (ConnectionResult.SUCCESS == code) {<NEW_LINE>// If the user has not previously signed in on this device or the sign-in has expired,<NEW_LINE>// this asynchronous branch will attempt to sign in the user silently. Cross-device<NEW_LINE>// single sign-on will occur in this branch.<NEW_LINE>final GoogleSignInResult googleSignInResult = opr.await();<NEW_LINE>return handleGoogleSignInResultForIsUserSignedIn(googleSignInResult);<NEW_LINE>}<NEW_LINE>Log.w(LOG_TAG, "Google Play Services are not available. Assuming not signed-in with Google.");<NEW_LINE>return false;<NEW_LINE>}
Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);
1,046,434
<E> E find(final Class<E> entityClass, final Object primaryKey) {<NEW_LINE>if (primaryKey == null) {<NEW_LINE>throw new IllegalArgumentException("PrimaryKey value must not be null for object you want to find.");<NEW_LINE>}<NEW_LINE>// Locking as it might read from persistence context.<NEW_LINE>EntityMetadata entityMetadata = getMetadata(entityClass);<NEW_LINE>String nodeId = ObjectGraphUtils.getNodeId(primaryKey, entityClass);<NEW_LINE>// TODO all the scrap should go from here.<NEW_LINE>MainCache mainCache = (MainCache) getPersistenceCache().getMainCache();<NEW_LINE>Node node = mainCache.getNodeFromCache(nodeId, this);<NEW_LINE>// if node is not in persistence cache or is dirty, fetch from database<NEW_LINE>if (node == null || node.isDirty()) {<NEW_LINE>node = new Node(nodeId, entityClass, new ManagedState(), getPersistenceCache(), primaryKey, this);<NEW_LINE>node<MASK><NEW_LINE>// TODO ManagedState.java require serious attention.<NEW_LINE>node.setPersistenceDelegator(this);<NEW_LINE>try {<NEW_LINE>lock.readLock().lock();<NEW_LINE>node.find();<NEW_LINE>} finally {<NEW_LINE>lock.readLock().unlock();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>node.setPersistenceDelegator(this);<NEW_LINE>}<NEW_LINE>Object nodeData = node.getData();<NEW_LINE>if (nodeData == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>E e = (E) ObjectUtils.deepCopy(nodeData, getKunderaMetadata());<NEW_LINE>onSetProxyOwners(entityMetadata, e);<NEW_LINE>return e;<NEW_LINE>}<NEW_LINE>}
.setClient(getClient(entityMetadata));
1,512,531
public static void main(String[] args) throws Exception {<NEW_LINE>// Create an HttpClient and wrap it in an abstraction layer<NEW_LINE>final HttpClientFactory http = new HttpClientFactory();<NEW_LINE>final Client r2Client = new TransportClientAdapter(http.getClient(Collections.<String, String>emptyMap()));<NEW_LINE>// Create a RestClient to talk to localhost:8080<NEW_LINE>RestClient restClient <MASK><NEW_LINE>// Generate a random ID for a fortune cookie, in the range 0-5<NEW_LINE>long fortuneId = (long) (Math.random() * 5);<NEW_LINE>// Construct a request for the specified fortune<NEW_LINE>FortunesGetBuilder getBuilder = _fortuneBuilder.get();<NEW_LINE>Request<Fortune> getReq = getBuilder.id(fortuneId).build();<NEW_LINE>// Send the request and wait for a response<NEW_LINE>final ResponseFuture<Fortune> getFuture = restClient.sendRequest(getReq);<NEW_LINE>final Response<Fortune> resp = getFuture.getResponse();<NEW_LINE>// Print the response<NEW_LINE>System.out.println(resp.getEntity().getFortune());<NEW_LINE>// shutdown<NEW_LINE>restClient.shutdown(new FutureCallback<None>());<NEW_LINE>http.shutdown(new FutureCallback<None>());<NEW_LINE>}
= new RestClient(r2Client, "http://localhost:8080/");
1,807,415
public void onBtnRefresh() {<NEW_LINE>if (!TrueTime.isInitialized()) {<NEW_LINE>Toast.makeText(this, "Sorry TrueTime not yet initialized. Trying again.", Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Date trueTime = TrueTime.now();<NEW_LINE>Date deviceTime = new Date();<NEW_LINE>timeGMT.setText(getString(R.string.tt_time_gmt, _formatDate(trueTime, "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT"))));<NEW_LINE>timePST.setText(getString(R.string.tt_time_pst, _formatDate(trueTime, "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT-07:00"))));<NEW_LINE>timeDeviceTime.setText(getString(R.string.tt_time_device, _formatDate(deviceTime, "yyyy-MM-dd HH:mm:ss", TimeZone<MASK><NEW_LINE>}
.getTimeZone("GMT-07:00"))));
1,029,276
public void QueryJDOQL() {<NEW_LINE>PersistenceManagerFactory pmf = new JDOPersistenceManagerFactory(pumd, null);<NEW_LINE><MASK><NEW_LINE>Transaction tx = pm.currentTransaction();<NEW_LINE>try {<NEW_LINE>tx.begin();<NEW_LINE>// Declarative JDOQL :<NEW_LINE>LOGGER.log(Level.INFO, "Declarative JDOQL --------------------------------------------------------------");<NEW_LINE>Query qDJDOQL = pm.newQuery(Product.class);<NEW_LINE>qDJDOQL.setFilter("name == 'Tablet' && price == price_value");<NEW_LINE>qDJDOQL.declareParameters("double price_value");<NEW_LINE>List<Product> resultsqDJDOQL = qDJDOQL.setParameters(80.0).executeList();<NEW_LINE>Iterator<Product> iterDJDOQL = resultsqDJDOQL.iterator();<NEW_LINE>while (iterDJDOQL.hasNext()) {<NEW_LINE>Product p = iterDJDOQL.next();<NEW_LINE>LOGGER.log(Level.WARNING, "Product name: {0} - Price: {1}", new Object[] { p.name, p.price });<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.INFO, "--------------------------------------------------------------");<NEW_LINE>tx.commit();<NEW_LINE>} finally {<NEW_LINE>if (tx.isActive()) {<NEW_LINE>tx.rollback();<NEW_LINE>}<NEW_LINE>pm.close();<NEW_LINE>}<NEW_LINE>}
PersistenceManager pm = pmf.getPersistenceManager();
1,163,772
final CreateUserResult executeCreateUser(CreateUserRequest createUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateUserRequest> request = null;<NEW_LINE>Response<CreateUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateUserRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateUserResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(createUserRequest));
354,802
public CollectSource visitRoutedCollectPhase(RoutedCollectPhase phase, Void context) {<NEW_LINE>if (!phase.isRouted()) {<NEW_LINE>return emptyCollectSource;<NEW_LINE>}<NEW_LINE>String localNodeId = clusterService.state().nodes().getLocalNodeId();<NEW_LINE>Set<String> routingNodes = phase.routing().nodes();<NEW_LINE>if (!routingNodes.contains(localNodeId)) {<NEW_LINE>throw new IllegalStateException("unsupported routing");<NEW_LINE>}<NEW_LINE>if (phase.routing().containsShards(localNodeId)) {<NEW_LINE>return shardCollectSource;<NEW_LINE>}<NEW_LINE>Map<String, Map<String, IntIndexedContainer>> locations = phase.routing().locations();<NEW_LINE>Map<String, IntIndexedContainer> indexShards = locations.get(localNodeId);<NEW_LINE>if (indexShards == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String indexName = Iterables.getFirst(indexShards.keySet(), null);<NEW_LINE>if (indexName == null) {<NEW_LINE>throw new IllegalStateException("Can't resolve CollectService for collectPhase: " + phase);<NEW_LINE>}<NEW_LINE>if (phase.maxRowGranularity() == RowGranularity.DOC && IndexParts.isPartitioned(indexName)) {<NEW_LINE>// partitioned table without any shards; nothing to collect<NEW_LINE>return emptyCollectSource;<NEW_LINE>}<NEW_LINE>assert indexShards.size() == 1 : "routing without shards that operates on non user-tables may only contain 1 index/table";<NEW_LINE>CollectSource collectSource = systemTableSource.get(indexName);<NEW_LINE>if (collectSource == null) {<NEW_LINE>throw new IllegalStateException("Can't resolve CollectService for collectPhase: " + phase);<NEW_LINE>}<NEW_LINE>return collectSource;<NEW_LINE>}
throw new IllegalStateException("Can't resolve CollectService for collectPhase: " + phase);
1,336,419
private void findNextMatch(boolean doHighlight) {<NEW_LINE>int startOffset;<NEW_LINE>if (lastMatch != null && globalFlag) {<NEW_LINE>// next match might be on the same line<NEW_LINE>startOffset = lastMatch.getRightBound().getModelOffset() + replaceOffset;<NEW_LINE>// performing a substitution could change our next starting position<NEW_LINE>// (so we don't match on the replaced string) reset replaceOffset in<NEW_LINE>// case the user hits 'n' and we *don't* modify starting position<NEW_LINE>replaceOffset = 0;<NEW_LINE>} else {<NEW_LINE>// start on next line<NEW_LINE>startOffset = editorAdaptor.getModelContent().getLineInformation(nextLine).getBeginOffset();<NEW_LINE>}<NEW_LINE>SearchOffset afterSearch = new SearchOffset.Begin(startOffset);<NEW_LINE>Search search = new Search(subDef.find, false, caseSensitive, afterSearch, useRegex);<NEW_LINE>SearchAndReplaceService searchService = editorAdaptor.getSearchAndReplaceService();<NEW_LINE>Position start = editorAdaptor.getCursorService().newPositionForModelOffset(startOffset);<NEW_LINE>SearchResult result = searchService.find(search, start);<NEW_LINE>// if no match found or match is outside our range<NEW_LINE>if (result.getStart() == null || result.getRightBound().getModelOffset() > endOffset) {<NEW_LINE>exit();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (result.getLeftBound().getViewOffset() < 0) {<NEW_LINE>editorAdaptor.getViewportService().exposeModelPosition(result.getLeftBound());<NEW_LINE>}<NEW_LINE>editorAdaptor.setPosition(result.getLeftBound(), StickyColumnPolicy.NEVER);<NEW_LINE>if (doHighlight) {<NEW_LINE>// force match to be visible (move scrollbars)<NEW_LINE>// is there a better way to do this?<NEW_LINE>CenterLineCommand.CENTER.execute(editorAdaptor);<NEW_LINE>// highlight match<NEW_LINE>searchService.incSearchhighlight(result.getLeftBound(<MASK><NEW_LINE>}<NEW_LINE>// prepare for next iteration<NEW_LINE>lastMatch = result;<NEW_LINE>nextLine = // next line after match<NEW_LINE>editorAdaptor.getModelContent().getLineInformationOfOffset(lastMatch.getRightBound().getModelOffset()).getNumber() + 1;<NEW_LINE>}
), result.getModelLength());
1,567,503
public static void removeCSSClass(Element e, String cssclass) {<NEW_LINE>String oldval = e.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);<NEW_LINE>if (oldval == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>if (classes.length == 1) {<NEW_LINE>if (cssclass.equals(classes[0])) {<NEW_LINE>e.removeAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);<NEW_LINE>}<NEW_LINE>} else if (classes.length == 2) {<NEW_LINE>if (cssclass.equals(classes[0])) {<NEW_LINE>if (cssclass.equals(classes[1])) {<NEW_LINE>e.removeAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);<NEW_LINE>} else {<NEW_LINE>e.setAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE, classes[1]);<NEW_LINE>}<NEW_LINE>} else if (cssclass.equals(classes[1])) {<NEW_LINE>e.setAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE, classes[0]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>StringBuilder joined = new StringBuilder();<NEW_LINE>for (String c : classes) {<NEW_LINE>if (!c.equals(cssclass)) {<NEW_LINE>if (joined.length() > 0) {<NEW_LINE>joined.append(' ');<NEW_LINE>}<NEW_LINE>joined.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>e.setAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE, joined.toString());<NEW_LINE>}<NEW_LINE>}
classes = oldval.split(" ");
854,033
public QuarkusClassLoader createRuntimeClassLoader(ClassLoader base, Map<String, byte[]> resources, Map<String, byte[]> transformedClasses) {<NEW_LINE>QuarkusClassLoader.Builder builder = QuarkusClassLoader.builder("Quarkus Runtime ClassLoader: " + quarkusBootstrap.getMode() + " restart no:" + runtimeClassLoaderCount.getAndIncrement(), getBaseRuntimeClassLoader(), false).setAssertionsEnabled(quarkusBootstrap.isAssertionsEnabled()).setAggregateParentResources(true);<NEW_LINE>builder.setTransformedClasses(transformedClasses);<NEW_LINE>builder.addElement(new MemoryClassPathElement(resources, true));<NEW_LINE>for (Path root : quarkusBootstrap.getApplicationRoot()) {<NEW_LINE>builder.addElement(ClassPathElement.fromPath(root, true));<NEW_LINE>}<NEW_LINE>for (AdditionalDependency i : getQuarkusBootstrap().getAdditionalApplicationArchives()) {<NEW_LINE>if (i.isHotReloadable()) {<NEW_LINE>for (Path root : i.getResolvedPaths()) {<NEW_LINE>builder.addElement(ClassPathElement<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ResolvedDependency dependency : appModel.getDependencies()) {<NEW_LINE>if (dependency.isRuntimeCp() && dependency.isJar() && (dependency.isReloadable() && appModel.getReloadableWorkspaceDependencies().contains(dependency.getKey()) || configuredClassLoading.reloadableArtifacts.contains(dependency.getKey()))) {<NEW_LINE>processCpElement(dependency, element -> addCpElement(builder, dependency, element));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
.fromPath(root, true));
890,559
public static ListEndpointGroupsResponse unmarshall(ListEndpointGroupsResponse listEndpointGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listEndpointGroupsResponse.setRequestId(_ctx.stringValue("ListEndpointGroupsResponse.RequestId"));<NEW_LINE>listEndpointGroupsResponse.setTotalCount(_ctx.integerValue("ListEndpointGroupsResponse.TotalCount"));<NEW_LINE>listEndpointGroupsResponse.setPageNumber(_ctx.integerValue("ListEndpointGroupsResponse.PageNumber"));<NEW_LINE>listEndpointGroupsResponse.setPageSize(_ctx.integerValue("ListEndpointGroupsResponse.PageSize"));<NEW_LINE>List<EndpointGroupsItem> endpointGroups = new ArrayList<EndpointGroupsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListEndpointGroupsResponse.EndpointGroups.Length"); i++) {<NEW_LINE>EndpointGroupsItem endpointGroupsItem = new EndpointGroupsItem();<NEW_LINE>endpointGroupsItem.setEndpointGroupId(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].EndpointGroupId"));<NEW_LINE>endpointGroupsItem.setName(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].Name"));<NEW_LINE>endpointGroupsItem.setDescription(_ctx.stringValue<MASK><NEW_LINE>endpointGroupsItem.setTrafficPercentage(_ctx.integerValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].TrafficPercentage"));<NEW_LINE>endpointGroupsItem.setEndpointGroupRegion(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].EndpointGroupRegion"));<NEW_LINE>endpointGroupsItem.setState(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].State"));<NEW_LINE>endpointGroupsItem.setListenerId(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].ListenerId"));<NEW_LINE>endpointGroupsItem.setHealthCheckIntervalSeconds(_ctx.integerValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].HealthCheckIntervalSeconds"));<NEW_LINE>endpointGroupsItem.setHealthCheckPath(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].HealthCheckPath"));<NEW_LINE>endpointGroupsItem.setHealthCheckPort(_ctx.integerValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].HealthCheckPort"));<NEW_LINE>endpointGroupsItem.setHealthCheckProtocol(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].HealthCheckProtocol"));<NEW_LINE>endpointGroupsItem.setThresholdCount(_ctx.integerValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].ThresholdCount"));<NEW_LINE>List<EndpointConfigurationsItem> endpointConfigurations = new ArrayList<EndpointConfigurationsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].EndpointConfigurations.Length"); j++) {<NEW_LINE>EndpointConfigurationsItem endpointConfigurationsItem = new EndpointConfigurationsItem();<NEW_LINE>endpointConfigurationsItem.setEndpoint(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].EndpointConfigurations[" + j + "].Endpoint"));<NEW_LINE>endpointConfigurationsItem.setWeight(_ctx.integerValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].EndpointConfigurations[" + j + "].Weight"));<NEW_LINE>endpointConfigurationsItem.setType(_ctx.stringValue("ListEndpointGroupsResponse.EndpointGroups[" + i + "].EndpointConfigurations[" + j + "].Type"));<NEW_LINE>endpointConfigurations.add(endpointConfigurationsItem);<NEW_LINE>}<NEW_LINE>endpointGroupsItem.setEndpointConfigurations(endpointConfigurations);<NEW_LINE>endpointGroups.add(endpointGroupsItem);<NEW_LINE>}<NEW_LINE>listEndpointGroupsResponse.setEndpointGroups(endpointGroups);<NEW_LINE>return listEndpointGroupsResponse;<NEW_LINE>}
("ListEndpointGroupsResponse.EndpointGroups[" + i + "].Description"));
1,384,880
public static double angle(NumberVector v1, NumberVector v2, NumberVector o) {<NEW_LINE>final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality(), dimo = o.getDimensionality();<NEW_LINE>final int mindim = (dim1 <= dim2) ? dim1 : dim2;<NEW_LINE>// Essentially, we want to compute this:<NEW_LINE>// v1' = v1 - o, v2' = v2 - o<NEW_LINE>// v1'.transposeTimes(v2') / (v1'.euclideanLength()*v2'.euclideanLength());<NEW_LINE>// We can just compute all three in parallel.<NEW_LINE>double cross = 0, l1 = 0, l2 = 0;<NEW_LINE>for (int k = 0; k < mindim; k++) {<NEW_LINE>final double ok = k < dimo ? o.doubleValue(k) : 0.;<NEW_LINE>final double r1 = v1.doubleValue(k) - ok;<NEW_LINE>final double r2 = v2.doubleValue(k) - ok;<NEW_LINE>cross += r1 * r2;<NEW_LINE>l1 += r1 * r1;<NEW_LINE>l2 += r2 * r2;<NEW_LINE>}<NEW_LINE>for (int k = mindim; k < dim1; k++) {<NEW_LINE>final double ok = k < dimo ? o.doubleValue(k) : 0.;<NEW_LINE>final double r1 = <MASK><NEW_LINE>l1 += r1 * r1;<NEW_LINE>}<NEW_LINE>for (int k = mindim; k < dim2; k++) {<NEW_LINE>final double ok = k < dimo ? o.doubleValue(k) : 0.;<NEW_LINE>final double r2 = v2.doubleValue(k) - ok;<NEW_LINE>l2 += r2 * r2;<NEW_LINE>}<NEW_LINE>final //<NEW_LINE>double //<NEW_LINE>a = //<NEW_LINE>(cross == 0.) ? //<NEW_LINE>0. : //<NEW_LINE>(l1 == 0. || l2 == 0.) ? 1. : Math.sqrt((cross / l1) * (cross / l2));<NEW_LINE>return (a < 1.) ? a : 1.;<NEW_LINE>}
v1.doubleValue(k) - ok;
1,414,391
public int updateAllFromAcctSchemaDefault(@NonNull final I_C_AcctSchema_Default acctSchemaDefault) {<NEW_LINE>final AcctSchemaId acctSchemaId = AcctSchemaId.ofRepoId(acctSchemaDefault.getC_AcctSchema_ID());<NEW_LINE>final String sql = "UPDATE " + TABLENAME_C_BP_BankAccount_Acct + " a " + "SET B_InTransit_Acct=" + acctSchemaDefault.getB_InTransit_Acct() + ", B_Asset_Acct=" + acctSchemaDefault.getB_Asset_Acct() + ", B_Expense_Acct=" + acctSchemaDefault.getB_Expense_Acct() + ", B_InterestRev_Acct=" + acctSchemaDefault.getB_InterestRev_Acct() + ", B_InterestExp_Acct=" + acctSchemaDefault.getB_InterestExp_Acct() + ", B_Unidentified_Acct=" + acctSchemaDefault.getB_Unidentified_Acct() + ", B_UnallocatedCash_Acct=" + acctSchemaDefault.getB_UnallocatedCash_Acct() + ", B_PaymentSelect_Acct=" + acctSchemaDefault.getB_PaymentSelect_Acct() + ", B_SettlementGain_Acct=" + acctSchemaDefault.getB_SettlementGain_Acct() + ", B_SettlementLoss_Acct=" + acctSchemaDefault.getB_SettlementLoss_Acct() + ", B_RevaluationGain_Acct=" + acctSchemaDefault.getB_RevaluationGain_Acct() + ", B_RevaluationLoss_Acct=" + acctSchemaDefault.getB_RevaluationLoss_Acct<MASK><NEW_LINE>return DB.executeUpdateEx(sql, new Object[] { acctSchemaId }, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>}
() + ", Updated=now(), UpdatedBy=0 " + " WHERE a.C_AcctSchema_ID=?" + " AND EXISTS (SELECT 1 FROM C_BP_BankAccount_Acct x WHERE x.C_BP_BankAccount_ID=a.C_BP_BankAccount_ID)";
1,693,596
private void initTypes(BinaryMapDataObject object) {<NEW_LINE>if (mapIndexFields == null) {<NEW_LINE>mapIndexFields = new MapIndexFields();<NEW_LINE>// mapIndexFields.mapIndex = object.getMapIndex();<NEW_LINE>mapIndexFields.downloadNameType = object.getMapIndex().getRule(FIELD_DOWNLOAD_NAME, null);<NEW_LINE>mapIndexFields.nameType = object.getMapIndex().getRule(FIELD_NAME, null);<NEW_LINE>mapIndexFields.nameEnType = object.getMapIndex(<MASK><NEW_LINE>mapIndexFields.nameLocaleType = object.getMapIndex().getRule(FIELD_NAME + ":" + locale, null);<NEW_LINE>if (locale2 != null) {<NEW_LINE>mapIndexFields.nameLocale2Type = object.getMapIndex().getRule(FIELD_NAME + ":" + locale2, null);<NEW_LINE>}<NEW_LINE>mapIndexFields.parentFullName = object.getMapIndex().getRule(FIELD_REGION_PARENT_NAME, null);<NEW_LINE>mapIndexFields.fullNameType = object.getMapIndex().getRule(FIELD_REGION_FULL_NAME, null);<NEW_LINE>mapIndexFields.langType = object.getMapIndex().getRule(FIELD_LANG, null);<NEW_LINE>mapIndexFields.metricType = object.getMapIndex().getRule(FIELD_METRIC, null);<NEW_LINE>mapIndexFields.leftHandDrivingType = object.getMapIndex().getRule(FIELD_LEFT_HAND_DRIVING, null);<NEW_LINE>mapIndexFields.roadSignsType = object.getMapIndex().getRule(FIELD_ROAD_SIGNS, null);<NEW_LINE>mapIndexFields.wikiLinkType = object.getMapIndex().getRule(FIELD_WIKI_LINK, null);<NEW_LINE>mapIndexFields.populationType = object.getMapIndex().getRule(FIELD_POPULATION, null);<NEW_LINE>}<NEW_LINE>}
).getRule(FIELD_NAME_EN, null);
1,458,751
// Implement JSCoder.validate<NEW_LINE>public Object validate(Object value, int indirect) throws JMFSchemaViolationException, JMFModelNotImplementedException, JMFUninitializedAccessException, JMFMessageCorruptionException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.entry(this, tc, "validate", new Object[] { value, indirect });<NEW_LINE>Object result = null;<NEW_LINE>if (indirect < 0) {<NEW_LINE>indirect = this.indirect;<NEW_LINE>}<NEW_LINE>// If it already is a JMF List, just check its type and use it<NEW_LINE>if (value instanceof JSListImpl) {<NEW_LINE>((JSListImpl) value).checkType(element, indirect);<NEW_LINE>result = value;<NEW_LINE>} else // Otherwise, we need to create/find a JMF List to use<NEW_LINE>if ((value == null) || (value instanceof Collection || value.getClass().isArray())) {<NEW_LINE>// If it is boxed, we always need a new JSVaryingListImpl as it needs state<NEW_LINE>if (indirect > 0) {<NEW_LINE>result = new JSVaryingListImpl(element, indirect, value);<NEW_LINE>} else // If varying==true, we need a JSVaryingListImpl<NEW_LINE>if (varying) {<NEW_LINE>// If we've been passed an empty Collection, just use the appropriate singleton 'EMPTY' for now<NEW_LINE>if ((value == null) || ((value instanceof Collection) && (((Collection) value).size() == 0))) {<NEW_LINE>result = JSVaryingListImpl.EMPTY_UNBOXED_VARYINGLIST;<NEW_LINE>} else {<NEW_LINE>result = new JSVaryingListImpl(element, 0, value);<NEW_LINE>}<NEW_LINE>} else // Otherwise we need a JSFixedListImpl<NEW_LINE>{<NEW_LINE>// If we've been passed an empty Collection, just use the appropriate singleton 'EMPTY' for now<NEW_LINE>if ((value == null) || (value instanceof Collection) && (((Collection) value).size() == 0)) {<NEW_LINE>result = JSFixedListImpl.EMPTY_FIXEDLIST;<NEW_LINE>} else {<NEW_LINE>result = new JSFixedListImpl(element, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new JMFSchemaViolationException(value.<MASK><NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "validate", result);<NEW_LINE>return result;<NEW_LINE>}
getClass().getName());
413,406
public void marshall(ParameterDefinition parameterDefinition, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (parameterDefinition == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getAllowedPattern(), ALLOWEDPATTERN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getConstraintDescription(), CONSTRAINTDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getDefaultValue(), DEFAULTVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMaxLength(), MAXLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMaxValue(), MAXVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMinLength(), MINLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMinValue(), MINVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getNoEcho(), NOECHO_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getReferencedByResources(), REFERENCEDBYRESOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getType(), TYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
parameterDefinition.getAllowedValues(), ALLOWEDVALUES_BINDING);
1,507,374
private Set<StoreTrait> createCurrentTraits(final Store store) {<NEW_LINE>final Set<StoreTrait> traits = Sets.newHashSet(store.getTraits());<NEW_LINE>final Schema schema = store.getSchema();<NEW_LINE>final boolean hasAggregatedGroups = isNotEmpty(schema.getAggregatedGroups());<NEW_LINE>final boolean hasVisibility = nonNull(schema.getVisibilityProperty());<NEW_LINE>boolean hasGroupBy = false;<NEW_LINE>boolean hasValidation = false;<NEW_LINE>for (final SchemaElementDefinition def : new ChainedIterable<SchemaElementDefinition>(schema.getEntities().values(), schema.getEdges().values())) {<NEW_LINE>hasValidation = hasValidation || def.hasValidation();<NEW_LINE>hasGroupBy = hasGroupBy || isNotEmpty(def.getGroupBy());<NEW_LINE>if (hasGroupBy && hasValidation) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasAggregatedGroups) {<NEW_LINE>traits.remove(StoreTrait.INGEST_AGGREGATION);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!hasGroupBy && traits.contains(StoreTrait.INGEST_AGGREGATION)) {<NEW_LINE>traits.remove(StoreTrait.QUERY_AGGREGATION);<NEW_LINE>}<NEW_LINE>if (!hasValidation) {<NEW_LINE>traits.remove(StoreTrait.STORE_VALIDATION);<NEW_LINE>}<NEW_LINE>if (!hasVisibility) {<NEW_LINE>traits.remove(StoreTrait.VISIBILITY);<NEW_LINE>}<NEW_LINE>return traits;<NEW_LINE>}
traits.remove(StoreTrait.QUERY_AGGREGATION);
1,621,901
private static Optional<SmtpConfig> systemSmtpConfig(Config systemConfig) {<NEW_LINE>Optional<String> host = systemConfig.getOptional("config.mail.host", String.class);<NEW_LINE>if (!host.isPresent()) {<NEW_LINE>return Optional.absent();<NEW_LINE>}<NEW_LINE>SmtpConfig config = ImmutableSmtpConfig.builder().host(host.get()).port(systemConfig.get("config.mail.port", int.class)).startTls(systemConfig.get("config.mail.tls", boolean.class, true)).ssl(systemConfig.get("config.mail.ssl", boolean.class, false)).debug(systemConfig.get("config.mail.debug", boolean.class, false)).username(systemConfig.getOptional("config.mail.username", String.class)).password(systemConfig.getOptional("config.mail.password", String<MASK><NEW_LINE>return Optional.of(config);<NEW_LINE>}
.class)).build();
378,096
private Mono<Response<Flux<ByteBuffer>>> createOrUpdateAtSubscriptionScopeWithResponseAsync(String deploymentName, DeploymentInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (deploymentName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter deploymentName 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 (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdateAtSubscriptionScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
220,842
private void updateCompressionRatio(IMemTable memTableToFlush) {<NEW_LINE>try {<NEW_LINE>double compressionRatio = ((double) <MASK><NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("The compression ratio of tsfile {} is {}, totalMemTableSize: {}, the file size: {}", writer.getFile().getAbsolutePath(), compressionRatio, totalMemTableSize, writer.getPos());<NEW_LINE>}<NEW_LINE>if (compressionRatio == 0 && !memTableToFlush.isSignalMemTable()) {<NEW_LINE>logger.error("{} The compression ratio of tsfile {} is 0, totalMemTableSize: {}, the file size: {}", storageGroupName, writer.getFile().getAbsolutePath(), totalMemTableSize, writer.getPos());<NEW_LINE>}<NEW_LINE>CompressionRatio.getInstance().updateRatio(compressionRatio);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("{}: {} update compression ratio failed", storageGroupName, tsFileResource.getTsFile().getName(), e);<NEW_LINE>}<NEW_LINE>}
totalMemTableSize) / writer.getPos();
976,205
public DeleteSecretResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteSecretResult deleteSecretResult = new DeleteSecretResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteSecretResult;<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("ARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteSecretResult.setARN(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteSecretResult.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DeletionDate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteSecretResult.setDeletionDate(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteSecretResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
954,382
public static Trades adaptBleutradeMarketHistory(List<BleutradeTrade> bleutradeTrades, CurrencyPair currencyPair) {<NEW_LINE>List<Trade> <MASK><NEW_LINE>for (BleutradeTrade bleutradeTrade : bleutradeTrades) {<NEW_LINE>Trade.Builder builder = new Trade.Builder();<NEW_LINE>builder.currencyPair(currencyPair);<NEW_LINE>builder.price(bleutradeTrade.getPrice());<NEW_LINE>builder.timestamp(BleutradeUtils.toDate(bleutradeTrade.getTimeStamp()));<NEW_LINE>builder.originalAmount(bleutradeTrade.getQuantity());<NEW_LINE>builder.type(bleutradeTrade.getOrderType().equals("BUY") ? OrderType.BID : OrderType.ASK);<NEW_LINE>trades.add(builder.build());<NEW_LINE>}<NEW_LINE>return new Trades(trades, TradeSortType.SortByTimestamp);<NEW_LINE>}
trades = new ArrayList<>();
663,093
protected void flushUpdates() {<NEW_LINE>for (Entity updatedObject : updatedObjects) {<NEW_LINE>String updateStatement = dbSqlSessionFactory.getUpdateStatement(updatedObject);<NEW_LINE>updateStatement = dbSqlSessionFactory.mapStatement(updateStatement);<NEW_LINE>if (updateStatement == null) {<NEW_LINE>throw new FlowableException("no update statement for " + updatedObject.getClass() + " in the ibatis mapping files");<NEW_LINE>}<NEW_LINE>LOGGER.debug("updating: {}", updatedObject);<NEW_LINE>int updatedRecords = sqlSession.update(updateStatement, updatedObject);<NEW_LINE>if (updatedRecords == 0) {<NEW_LINE>throw new FlowableOptimisticLockingException(updatedObject + " was updated by another transaction concurrently");<NEW_LINE>}<NEW_LINE>// See https://activiti.atlassian.net/browse/ACT-1290<NEW_LINE>if (updatedObject instanceof HasRevision) {<NEW_LINE>((HasRevision) updatedObject).setRevision(((HasRevision<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>updatedObjects.clear();<NEW_LINE>}
) updatedObject).getRevisionNext());
1,418,406
private void insert(QNm field, Sequence value, JsonNodeTrx trx) {<NEW_LINE>final var fieldName = field.getLocalName();<NEW_LINE>if (value instanceof Atomic) {<NEW_LINE>if (value instanceof Str) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new StringValue(((Str) value).stringValue()));<NEW_LINE>} else if (value instanceof Null) {<NEW_LINE>trx.insertObjectRecordAsLastChild<MASK><NEW_LINE>} else if (value instanceof Numeric) {<NEW_LINE>if (value instanceof Int) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new NumberValue(((Int) value).intValue()));<NEW_LINE>} else if (value instanceof Int32) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new NumberValue(((Int32) value).intValue()));<NEW_LINE>} else if (value instanceof Int64) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new NumberValue(((Int64) value).longValue()));<NEW_LINE>} else if (value instanceof Flt) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new NumberValue(((Flt) value).floatValue()));<NEW_LINE>} else if (value instanceof Dbl) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new NumberValue(((Dbl) value).doubleValue()));<NEW_LINE>} else if (value instanceof Dec) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new NumberValue(((Dec) value).decimalValue()));<NEW_LINE>}<NEW_LINE>} else if (value instanceof Bool) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new BooleanValue(value.booleanValue()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Item item = ExprUtil.asItem(value);<NEW_LINE>if (item.itemType() == ArrayType.ARRAY) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new ArrayValue());<NEW_LINE>} else if (item.itemType() == ObjectType.OBJECT) {<NEW_LINE>trx.insertObjectRecordAsLastChild(fieldName, new ObjectValue());<NEW_LINE>}<NEW_LINE>trx.moveToFirstChild();<NEW_LINE>trx.insertSubtreeAsFirstChild(item, JsonNodeTrx.Commit.NO, JsonNodeTrx.CheckParentNode.YES, JsonNodeTrx.SkipRootToken.YES);<NEW_LINE>}<NEW_LINE>}
(fieldName, new NullValue());
577,277
public static boolean isCamelCase(@NonNull final String value, @NullAllowed String separatorRegExp, @NullAllowed String partRegExp) {<NEW_LINE>if (separatorRegExp == null && partRegExp == null) {<NEW_LINE>return DEFAULT_CAMEL_CASE_PATTERN.matcher(value).matches();<NEW_LINE>} else {<NEW_LINE>Pattern p;<NEW_LINE>Pair<Pair<String, <MASK><NEW_LINE>if (val != null && Objects.equals(separatorRegExp, val.first().first()) && Objects.equals(partRegExp, val.first().second())) {<NEW_LINE>p = val.second();<NEW_LINE>} else {<NEW_LINE>if (separatorRegExp == null) {<NEW_LINE>separatorRegExp = DEFAULT_CAMEL_CASE_SEPARATOR;<NEW_LINE>}<NEW_LINE>if (partRegExp == null) {<NEW_LINE>partRegExp = DEFAULT_CAMEL_CASE_PART_CASE_SENSITIVE;<NEW_LINE>}<NEW_LINE>p = Pattern.compile(String.format(CAMEL_CASE_FORMAT, partRegExp, separatorRegExp, partRegExp));<NEW_LINE>cache = Pair.of(Pair.of(separatorRegExp, partRegExp), p);<NEW_LINE>}<NEW_LINE>return p.matcher(value).matches();<NEW_LINE>}<NEW_LINE>}
String>, Pattern> val = cache;
1,854,230
public static void writeTopDocs(StreamOutput out, TopDocsAndMaxScore topDocs) throws IOException {<NEW_LINE>if (topDocs.topDocs instanceof CollapseTopFieldDocs) {<NEW_LINE>out.writeByte((byte) 2);<NEW_LINE>CollapseTopFieldDocs collapseDocs = (CollapseTopFieldDocs) topDocs.topDocs;<NEW_LINE>writeTotalHits(out, topDocs.topDocs.totalHits);<NEW_LINE>out.writeFloat(topDocs.maxScore);<NEW_LINE>out.writeString(collapseDocs.field);<NEW_LINE>out.writeArray(Lucene::writeSortField, collapseDocs.fields);<NEW_LINE>out.writeVInt(topDocs.topDocs.scoreDocs.length);<NEW_LINE>for (int i = 0; i < topDocs.topDocs.scoreDocs.length; i++) {<NEW_LINE>ScoreDoc doc = collapseDocs.scoreDocs[i];<NEW_LINE>writeFieldDoc(out, (FieldDoc) doc);<NEW_LINE>writeSortValue(out, collapseDocs.collapseValues[i]);<NEW_LINE>}<NEW_LINE>} else if (topDocs.topDocs instanceof TopFieldDocs) {<NEW_LINE>out.writeByte((byte) 1);<NEW_LINE>TopFieldDocs topFieldDocs = (TopFieldDocs) topDocs.topDocs;<NEW_LINE>writeTotalHits(out, topDocs.topDocs.totalHits);<NEW_LINE>out.writeFloat(topDocs.maxScore);<NEW_LINE>out.writeArray(Lucene::writeSortField, topFieldDocs.fields);<NEW_LINE>out.writeVInt(topDocs.topDocs.scoreDocs.length);<NEW_LINE>for (ScoreDoc doc : topFieldDocs.scoreDocs) {<NEW_LINE>writeFieldDoc(out, (FieldDoc) doc);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>out.writeByte((byte) 0);<NEW_LINE>writeTotalHits(out, topDocs.topDocs.totalHits);<NEW_LINE><MASK><NEW_LINE>out.writeVInt(topDocs.topDocs.scoreDocs.length);<NEW_LINE>for (ScoreDoc doc : topDocs.topDocs.scoreDocs) {<NEW_LINE>writeScoreDoc(out, doc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
out.writeFloat(topDocs.maxScore);
1,350,073
private void condenseRightSide(final float condensingFactor, final int halfHorizontalGap, final int keyboardWidth, int currentRightX, Deque<Keyboard.Key> rightKeys, Keyboard.Key spaceKey) {<NEW_LINE>// currentRightX holds the rightest x+width point. condensing a bit<NEW_LINE>currentRightX = (int) (keyboardWidth - ((keyboardWidth - currentRightX) * condensingFactor));<NEW_LINE>while (!rightKeys.isEmpty()) {<NEW_LINE>Keyboard.<MASK><NEW_LINE>currentRightX -= halfHorizontalGap;<NEW_LINE>// already holds the new width<NEW_LINE>currentRightX -= rightKey.width;<NEW_LINE>rightKey.x = currentRightX;<NEW_LINE>rightKey.centerX = rightKey.x + rightKey.width / 2;<NEW_LINE>currentRightX -= halfHorizontalGap;<NEW_LINE>}<NEW_LINE>// now to handle the space, which will hold as much as possible<NEW_LINE>if (spaceKey != null) {<NEW_LINE>spaceKey.width = currentRightX - spaceKey.x;<NEW_LINE>}<NEW_LINE>}
Key rightKey = rightKeys.pop();
1,172,473
public DescribeResiliencyPolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeResiliencyPolicyResult describeResiliencyPolicyResult = new DescribeResiliencyPolicyResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeResiliencyPolicyResult;<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("policy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeResiliencyPolicyResult.setPolicy(ResiliencyPolicyJsonUnmarshaller.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 describeResiliencyPolicyResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
650,784
protected void processOneLevelWildcard(IMNode node, int idx, int level) throws MetadataException {<NEW_LINE>boolean multiLevelWildcard = nodes[idx].equals(MULTI_LEVEL_PATH_WILDCARD);<NEW_LINE>String targetNameRegex = nodes[idx + 1<MASK><NEW_LINE>traverseContext.push(node);<NEW_LINE>for (IMNode child : node.getChildren().values()) {<NEW_LINE>if (child.isMeasurement()) {<NEW_LINE>String alias = child.getAsMeasurementMNode().getAlias();<NEW_LINE>if (!Pattern.matches(targetNameRegex, child.getName()) && !(alias != null && Pattern.matches(targetNameRegex, alias))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!Pattern.matches(targetNameRegex, child.getName())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>traverse(child, idx + 1, level + 1);<NEW_LINE>}<NEW_LINE>traverseContext.pop();<NEW_LINE>if (multiLevelWildcard) {<NEW_LINE>traverseContext.push(node);<NEW_LINE>for (IMNode child : node.getChildren().values()) {<NEW_LINE>traverse(child, idx, level + 1);<NEW_LINE>}<NEW_LINE>traverseContext.pop();<NEW_LINE>}<NEW_LINE>if (!node.isUseTemplate()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Template upperTemplate = node.getUpperTemplate();<NEW_LINE>traverseContext.push(node);<NEW_LINE>for (IMNode child : upperTemplate.getDirectNodes()) {<NEW_LINE>if (!Pattern.matches(targetNameRegex, child.getName())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>traverse(child, idx + 1, level + 1);<NEW_LINE>}<NEW_LINE>traverseContext.pop();<NEW_LINE>if (multiLevelWildcard) {<NEW_LINE>traverseContext.push(node);<NEW_LINE>for (IMNode child : upperTemplate.getDirectNodes()) {<NEW_LINE>traverse(child, idx, level + 1);<NEW_LINE>}<NEW_LINE>traverseContext.pop();<NEW_LINE>}<NEW_LINE>}
].replace("*", ".*");
524,861
private void tryArrayConstruction(Statement statement) {<NEW_LINE>if (!(statement instanceof AssignmentStatement)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AssignmentStatement assign = (AssignmentStatement) statement;<NEW_LINE>if (!(assign.getLeftValue() instanceof VariableExpr)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int constructedArrayVariable = ((VariableExpr) assign.<MASK><NEW_LINE>if (!(assign.getRightValue() instanceof NewArrayExpr)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NewArrayExpr constructedArray = (NewArrayExpr) assign.getRightValue();<NEW_LINE>if (!(constructedArray.getLength() instanceof ConstantExpr)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object sizeConst = ((ConstantExpr) constructedArray.getLength()).getValue();<NEW_LINE>if (!(sizeConst instanceof Integer)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int constructedArraySize = (int) sizeConst;<NEW_LINE>ArrayOptimization optimization = new ArrayOptimization();<NEW_LINE>optimization.index = resultSequence.size() - 1;<NEW_LINE>optimization.arrayVariable = constructedArrayVariable;<NEW_LINE>optimization.arraySize = constructedArraySize;<NEW_LINE>optimization.array = constructedArray;<NEW_LINE>pendingArrayOptimizations.add(optimization);<NEW_LINE>}
getLeftValue()).getIndex();
984,516
public void visit(final GroovyCodeVisitor visitor) {<NEW_LINE>if (visitor instanceof AsmClassGenerator) {<NEW_LINE>WriterController controller = ((AsmClassGenerator) visitor).getController();<NEW_LINE>MethodVisitor mv = controller.getMethodVisitor();<NEW_LINE>getLeftExpression().visit(visitor);<NEW_LINE>controller.getOperandStack().box();<NEW_LINE>getRightExpression().visit(visitor);<NEW_LINE>controller.getOperandStack().box();<NEW_LINE>Label l1 = new Label();<NEW_LINE>// GRECLIPSE add -- GROOVY-10377<NEW_LINE>if (!isEq())<NEW_LINE>mv.visitJumpInsn(IF_ACMPEQ, l1);<NEW_LINE>else<NEW_LINE>// GRECLIPSE end<NEW_LINE><MASK><NEW_LINE>mv.visitInsn(ICONST_1);<NEW_LINE>Label l2 = new Label();<NEW_LINE>mv.visitJumpInsn(GOTO, l2);<NEW_LINE>mv.visitLabel(l1);<NEW_LINE>mv.visitInsn(ICONST_0);<NEW_LINE>mv.visitLabel(l2);<NEW_LINE>controller.getOperandStack().replace(ClassHelper.boolean_TYPE, 2);<NEW_LINE>} else {<NEW_LINE>super.visit(visitor);<NEW_LINE>}<NEW_LINE>}
mv.visitJumpInsn(IF_ACMPNE, l1);
1,293,048
public List<Synchronizers> querySynchronizers(JdbcTemplate jdbcTemplate) {<NEW_LINE>List<Synchronizers> synchronizerList = jdbcTemplate.query(SYNCHRONIZERS_SELECT_STATEMENT, new RowMapper<Synchronizers>() {<NEW_LINE><NEW_LINE>public Synchronizers mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>Synchronizers synchronizer = new Synchronizers();<NEW_LINE>synchronizer.setId(rs.getString("id"));<NEW_LINE>synchronizer.setName(rs.getString("name"));<NEW_LINE>synchronizer.setScheduler(rs.getString("scheduler"));<NEW_LINE>synchronizer.setSourceType(rs.getString("sourcetype"));<NEW_LINE>synchronizer.setProviderUrl<MASK><NEW_LINE>synchronizer.setDriverClass(rs.getString("driverclass"));<NEW_LINE>synchronizer.setPrincipal(rs.getString("principal"));<NEW_LINE>synchronizer.setCredentials(PasswordReciprocal.getInstance().decoder(rs.getString("credentials")));<NEW_LINE>synchronizer.setResumeTime(rs.getString("resumetime"));<NEW_LINE>synchronizer.setSuspendTime(rs.getString("suspendtime"));<NEW_LINE>synchronizer.setFilters(rs.getString("filters"));<NEW_LINE>synchronizer.setBasedn(rs.getString("basedn"));<NEW_LINE>synchronizer.setMsadDomain(rs.getString("msaddomain"));<NEW_LINE>synchronizer.setSslSwitch(rs.getString("sslswitch"));<NEW_LINE>synchronizer.setTrustStore(rs.getString("truststore"));<NEW_LINE>synchronizer.setStatus(rs.getString("status"));<NEW_LINE>synchronizer.setDescription(rs.getString("description"));<NEW_LINE>synchronizer.setSyncStartTime(rs.getInt("syncstarttime"));<NEW_LINE>synchronizer.setService(rs.getString("service"));<NEW_LINE>return synchronizer;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return synchronizerList;<NEW_LINE>}
(rs.getString("providerurl"));
1,367,589
public static <DT, MT> DataSet<Tuple2<Long, MT>> pullTrainPush(DataSet<DT> data, DataSet<Tuple2<Long, MT>> model, ApsFuncIndex4Pull<DT> requestIndex, ApsContext context4Index, ApsFuncTrain<DT, MT> trainSubset, ApsContext context4Train, ApsFuncUpdateModel<MT> updateModel, Integer trainNum) {<NEW_LINE>TypeInformation mtType;<NEW_LINE>if (model.getType().isTupleType() && model.getType().getArity() == 2) {<NEW_LINE>mtType = ((TupleTypeInfo) model.getType<MASK><NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unsupported model type. type: " + model.getType().toString());<NEW_LINE>}<NEW_LINE>Tuple2<DataSet<Tuple3<Integer, Integer, DT>>, DataSet<Tuple3<Integer, Long, MT>>> res = pullBase(data, model, requestIndex, context4Index, trainNum);<NEW_LINE>DataSet<Tuple3<Integer, Integer, DT>> t3PidIdxRval = res.f0;<NEW_LINE>DataSet<Tuple3<Integer, Long, MT>> t3PidFidFval = res.f1;<NEW_LINE>DataSet<Tuple2<Long, MT>> t2FidNewFval = null;<NEW_LINE>if (null == context4Train) {<NEW_LINE>t2FidNewFval = t3PidFidFval.coGroup(t3PidIdxRval).where(0).equalTo(0).sortSecondGroup(1, Order.ASCENDING).withPartitioner(new Partitioner<Integer>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = -3770586162489589601L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int partition(Integer key, int numPartitions) {<NEW_LINE>return Math.abs(key) % numPartitions;<NEW_LINE>}<NEW_LINE>}).with(trainSubset).name("ApsTrainSubset");<NEW_LINE>} else {<NEW_LINE>t2FidNewFval = t3PidFidFval.coGroup(t3PidIdxRval).where(0).equalTo(0).sortSecondGroup(1, Order.ASCENDING).withPartitioner(new Partitioner<Integer>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 2234202213103891149L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int partition(Integer key, int numPartitions) {<NEW_LINE>return Math.abs(key) % numPartitions;<NEW_LINE>}<NEW_LINE>}).with(trainSubset).withBroadcastSet(context4Train.getDataSet(), "TrainSubset").name("ApsTrainSubset");<NEW_LINE>}<NEW_LINE>t2FidNewFval = ((CoGroupOperator) t2FidNewFval).returns(new TupleTypeInfo(Types.LONG, mtType));<NEW_LINE>DataSet<Tuple2<Long, MT>> t2FidUpdatedFval = t2FidNewFval.coGroup(model).where(0).equalTo(0).with(updateModel).name("ApsUpdateModel").returns(new TupleTypeInfo(Types.LONG, mtType));<NEW_LINE>return t2FidUpdatedFval;<NEW_LINE>}
()).getTypeAt(1);
900,064
private static Object recurse(Map<String, Object> raw) {<NEW_LINE>if (raw == null || raw.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String key = raw.keySet().iterator().next();<NEW_LINE>Object val = raw.get(key);<NEW_LINE>switch(key) {<NEW_LINE>case "o":<NEW_LINE>List<Map<String, Object>> objectItems = (List) val;<NEW_LINE>Map<String, Object> map = new HashMap(objectItems.size());<NEW_LINE>for (Map<String, Object> entry : objectItems) {<NEW_LINE>String entryKey = (<MASK><NEW_LINE>Map<String, Object> entryValue = (Map) entry.get("v");<NEW_LINE>map.put(entryKey, recurse(entryValue));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>case "a":<NEW_LINE>List<Map<String, Object>> arrayItems = (List) val;<NEW_LINE>List<Object> list = new ArrayList(arrayItems.size());<NEW_LINE>for (Map<String, Object> entry : arrayItems) {<NEW_LINE>list.add(recurse(entry));<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>default:<NEW_LINE>// s: string, n: number, b: boolean<NEW_LINE>return val;<NEW_LINE>}<NEW_LINE>}
String) entry.get("k");
123,851
private long insertArray() {<NEW_LINE>long key = -1;<NEW_LINE>switch(insert) {<NEW_LINE>case AS_FIRST_CHILD:<NEW_LINE>if (parents.peek() == Fixed.NULL_NODE_KEY.getStandardProperty()) {<NEW_LINE>key = wtx.insertArrayAsFirstChild().getNodeKey();<NEW_LINE>} else {<NEW_LINE>key = wtx.insertArrayAsRightSibling().getNodeKey();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case AS_LAST_CHILD:<NEW_LINE>if (parents.peek() == Fixed.NULL_NODE_KEY.getStandardProperty()) {<NEW_LINE>key = wtx.insertArrayAsLastChild().getNodeKey();<NEW_LINE>} else {<NEW_LINE>key = wtx.insertArrayAsRightSibling().getNodeKey();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case AS_LEFT_SIBLING:<NEW_LINE>if (wtx.getKind() == NodeKind.JSON_DOCUMENT || wtx.getParentKey() == Fixed.DOCUMENT_NODE_KEY.getStandardProperty()) {<NEW_LINE>throw new IllegalStateException("Subtree can not be inserted as sibling of document root or the root-object/array/whatever!");<NEW_LINE>}<NEW_LINE>key = wtx<MASK><NEW_LINE>insert = InsertPosition.AS_FIRST_CHILD;<NEW_LINE>break;<NEW_LINE>case AS_RIGHT_SIBLING:<NEW_LINE>if (wtx.getKind() == NodeKind.JSON_DOCUMENT || wtx.getParentKey() == Fixed.DOCUMENT_NODE_KEY.getStandardProperty()) {<NEW_LINE>throw new IllegalStateException("Subtree can not be inserted as sibling of document root or the root-object/array/whatever!");<NEW_LINE>}<NEW_LINE>key = wtx.insertArrayAsRightSibling().getNodeKey();<NEW_LINE>insert = InsertPosition.AS_FIRST_CHILD;<NEW_LINE>break;<NEW_LINE>// $CASES-OMITTED$<NEW_LINE>default:<NEW_LINE>// Must not happen.<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>parents.pop();<NEW_LINE>parents.push(key);<NEW_LINE>parents.push(Fixed.NULL_NODE_KEY.getStandardProperty());<NEW_LINE>return key;<NEW_LINE>}
.insertArrayAsLeftSibling().getNodeKey();