idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,130,627
public static int wrapPosition(@NonNull AdapterPath path, @Nullable RecyclerView.Adapter originAdapter, @Nullable RecyclerView.Adapter targetAdapter, int position) {<NEW_LINE>final List<AdapterPathSegment> segments = path.segments();<NEW_LINE>final int nSegments = segments.size();<NEW_LINE>int originSegmentIndex = (originAdapter == null) ? nSegments - 1 : -1;<NEW_LINE>int targetSegmentIndex = (targetAdapter <MASK><NEW_LINE>if (originAdapter != null || targetAdapter != null) {<NEW_LINE>for (int i = 0; i < nSegments; i++) {<NEW_LINE>AdapterPathSegment segment = segments.get(i);<NEW_LINE>if (originAdapter != null && segment.adapter == originAdapter) {<NEW_LINE>originSegmentIndex = i;<NEW_LINE>}<NEW_LINE>if (targetAdapter != null && segment.adapter == targetAdapter) {<NEW_LINE>targetSegmentIndex = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!((originSegmentIndex != -1) && (targetSegmentIndex != -1) && (targetSegmentIndex <= originSegmentIndex))) {<NEW_LINE>return RecyclerView.NO_POSITION;<NEW_LINE>}<NEW_LINE>return wrapPosition(path, originSegmentIndex, targetSegmentIndex, position);<NEW_LINE>}
== null) ? 0 : -1;
1,027,909
private Mono<Response<CheckNameAvailabilityResultInner>> checkNameAvailabilityWithResponseAsync(String resourceGroupName, String namespaceName, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (namespaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter namespaceName 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 (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>CheckNameAvailability parameters = new CheckNameAvailability();<NEW_LINE>parameters.withName(name);<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.checkNameAvailability(this.client.getEndpoint(), resourceGroupName, namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,821,320
public static UpdateDictResponse unmarshall(UpdateDictResponse updateDictResponse, UnmarshallerContext _ctx) {<NEW_LINE>updateDictResponse.setRequestId(_ctx.stringValue("UpdateDictResponse.RequestId"));<NEW_LINE>List<DictList> result <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("UpdateDictResponse.Result.Length"); i++) {<NEW_LINE>DictList dictList = new DictList();<NEW_LINE>dictList.setName(_ctx.stringValue("UpdateDictResponse.Result[" + i + "].name"));<NEW_LINE>dictList.setFileSize(_ctx.longValue("UpdateDictResponse.Result[" + i + "].fileSize"));<NEW_LINE>dictList.setType(_ctx.stringValue("UpdateDictResponse.Result[" + i + "].type"));<NEW_LINE>dictList.setSourceType(_ctx.stringValue("UpdateDictResponse.Result[" + i + "].sourceType"));<NEW_LINE>result.add(dictList);<NEW_LINE>}<NEW_LINE>updateDictResponse.setResult(result);<NEW_LINE>return updateDictResponse;<NEW_LINE>}
= new ArrayList<DictList>();
540,824
private void peerRemoved(PEPeerTransport pc) {<NEW_LINE>if (is_running) {<NEW_LINE>updateConnectHealth(pc);<NEW_LINE>}<NEW_LINE>if (is_running && !seeding_mode && (prefer_udp || prefer_udp_default)) {<NEW_LINE>int udp = pc.getUDPListenPort();<NEW_LINE>if (udp != 0 && udp == pc.getTCPListenPort()) {<NEW_LINE>BloomFilter filter = prefer_udp_bloom;<NEW_LINE>if (filter == null) {<NEW_LINE>filter = prefer_udp_bloom = BloomFilterFactory.createAddOnly(PREFER_UDP_BLOOM_SIZE);<NEW_LINE>}<NEW_LINE>if (filter.getEntryCount() < PREFER_UDP_BLOOM_SIZE / 10) {<NEW_LINE>filter.add(pc.getIp().getBytes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int piece = pc.getUniqueAnnounce();<NEW_LINE>if (piece != -1 && superSeedMode) {<NEW_LINE>superSeedModeNumberOfAnnounces--;<NEW_LINE>superSeedPieces[piece].peerLeft();<NEW_LINE>}<NEW_LINE>int[] reserved_pieces = pc.getReservedPieceNumbers();<NEW_LINE>if (reserved_pieces != null) {<NEW_LINE>for (int reserved_piece : reserved_pieces) {<NEW_LINE>PEPiece pe_piece = pePieces[reserved_piece];<NEW_LINE>if (pe_piece != null) {<NEW_LINE>String reserved_by = pe_piece.getReservedBy();<NEW_LINE>if (reserved_by != null && reserved_by.equals(pc.getIp())) {<NEW_LINE>pe_piece.setReservedBy(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pc.isSeed()) {<NEW_LINE>last_seed_disconnect_time = SystemTime.getCurrentTime();<NEW_LINE>if (seeding_mode && disconnectSeedsWhenSeeding()) {<NEW_LINE>String key = pc.getIp() + ":" + pc.getTCPListenPort();<NEW_LINE>synchronized (seeding_seed_disconnects) {<NEW_LINE>seeding_seed_disconnects.put(key, SystemTime.getMonotonousTime());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// async downloadmanager notification<NEW_LINE>adapter.removePeer(pc);<NEW_LINE>// sync peermanager notification<NEW_LINE><MASK><NEW_LINE>for (PEPeerManagerListener peer : peer_manager_listeners) {<NEW_LINE>peer.peerRemoved(this, pc);<NEW_LINE>}<NEW_LINE>}
final ArrayList<PEPeerManagerListener> peer_manager_listeners = peer_manager_listeners_cow;
435,066
public void onFilterChanged(Participant participant, Participant moderator, Integer transactionId, Set<Participant> participants, String streamId, KurentoFilter filter, OpenViduException error, String filterReason) {<NEW_LINE>boolean isRpcFromModerator = transactionId != null && moderator != null;<NEW_LINE>if (isRpcFromModerator) {<NEW_LINE>// A moderator forced the application of the filter<NEW_LINE>if (error != null) {<NEW_LINE>rpcNotificationService.sendErrorResponse(moderator.getParticipantPrivateId(), transactionId, null, error);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>rpcNotificationService.sendResponse(moderator.getParticipantPrivateId()<MASK><NEW_LINE>}<NEW_LINE>JsonObject params = new JsonObject();<NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_CONNECTIONID_PARAM, participant.getParticipantPublicId());<NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_STREAMID_PARAM, streamId);<NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_PROPERTY_PARAM, "filter");<NEW_LINE>JsonObject filterJson = new JsonObject();<NEW_LINE>if (filter != null) {<NEW_LINE>filterJson.addProperty(ProtocolElements.FILTER_TYPE_PARAM, filter.getType());<NEW_LINE>filterJson.add(ProtocolElements.FILTER_OPTIONS_PARAM, filter.getOptions());<NEW_LINE>if (filter.getLastExecMethod() != null) {<NEW_LINE>filterJson.add(ProtocolElements.EXECFILTERMETHOD_LASTEXECMETHOD_PARAM, filter.getLastExecMethod().toJson());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>params.add(ProtocolElements.STREAMPROPERTYCHANGED_NEWVALUE_PARAM, filterJson);<NEW_LINE>params.addProperty(ProtocolElements.STREAMPROPERTYCHANGED_REASON_PARAM, filterReason);<NEW_LINE>for (Participant p : participants) {<NEW_LINE>if (p.getParticipantPrivateId().equals(participant.getParticipantPrivateId())) {<NEW_LINE>// Affected participant<NEW_LINE>if (isRpcFromModerator) {<NEW_LINE>// Force by moderator. Send notification to affected participant<NEW_LINE>rpcNotificationService.sendNotification(p.getParticipantPrivateId(), ProtocolElements.STREAMPROPERTYCHANGED_METHOD, params);<NEW_LINE>} else {<NEW_LINE>// Send response to participant<NEW_LINE>if (error != null) {<NEW_LINE>rpcNotificationService.sendErrorResponse(p.getParticipantPrivateId(), transactionId, null, error);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>rpcNotificationService.sendResponse(p.getParticipantPrivateId(), transactionId, new JsonObject());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Send response to every other user in the session different than the affected<NEW_LINE>// participant or the moderator<NEW_LINE>if (error == null && (moderator == null || !p.getParticipantPrivateId().equals(moderator.getParticipantPrivateId()))) {<NEW_LINE>rpcNotificationService.sendNotification(p.getParticipantPrivateId(), ProtocolElements.STREAMPROPERTYCHANGED_METHOD, params);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, transactionId, new JsonObject());
1,567,709
private void encryptAll(SharedPreferences plainSharedPreferences) {<NEW_LINE>Map<String, ?<MASK><NEW_LINE>SharedPreferences.Editor plainEditor = plainSharedPreferences.edit();<NEW_LINE>for (Map.Entry<String, ?> entry : plainTextMap.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (value instanceof Set) {<NEW_LINE>Set<String> set = (Set<String>) value;<NEW_LINE>Set<String> encryptedSet = new HashSet<>();<NEW_LINE>for (String element : set) {<NEW_LINE>encryptedSet.add(TextUtils.isEmpty(element) ? "" : encryptString(element));<NEW_LINE>}<NEW_LINE>plainSharedPreferences.edit().putStringSet(encryptString(key), encryptedSet).apply();<NEW_LINE>} else {<NEW_LINE>plainEditor.putString(encryptString(key), TextUtils.isEmpty(String.valueOf(value)) ? "" : encryptString(String.valueOf(value)));<NEW_LINE>}<NEW_LINE>// remove the plain key, value pair<NEW_LINE>plainEditor.remove(key);<NEW_LINE>}<NEW_LINE>plainEditor.apply();<NEW_LINE>}
> plainTextMap = plainSharedPreferences.getAll();
1,142,084
protected void annotateSectionInner(@Nonnull AnnotatedBytes out, int itemCount) {<NEW_LINE>String itemName = getItemName();<NEW_LINE>if (itemCount > 0) {<NEW_LINE>out.annotate(0, "");<NEW_LINE><MASK><NEW_LINE>out.annotate(0, "%s section", itemName);<NEW_LINE>out.annotate(0, "-----------------------------");<NEW_LINE>out.annotate(0, "");<NEW_LINE>for (int i = 0; i < itemCount; i++) {<NEW_LINE>out.moveTo(getItemOffset(i, out.getCursor()));<NEW_LINE>String itemIdentity = getItemIdentity(out.getCursor());<NEW_LINE>if (itemIdentity != null) {<NEW_LINE>out.annotate(0, "[%d] %s: %s", i, itemName, itemIdentity);<NEW_LINE>} else {<NEW_LINE>out.annotate(0, "[%d] %s", i, itemName);<NEW_LINE>}<NEW_LINE>out.indent();<NEW_LINE>annotateItem(out, i, itemIdentity);<NEW_LINE>out.deindent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
out.annotate(0, "-----------------------------");
1,186,331
public CreateAppInstanceResult createAppInstance(CreateAppInstanceRequest createAppInstanceRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAppInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAppInstanceRequest> request = null;<NEW_LINE>Response<CreateAppInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAppInstanceRequestMarshaller().marshall(createAppInstanceRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateAppInstanceResult, JsonUnmarshallerContext> unmarshaller = new CreateAppInstanceResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateAppInstanceResult> responseHandler = new JsonResponseHandler<CreateAppInstanceResult>(unmarshaller);<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,542,355
private JMethod addInternalSetMethodJava7(JDefinedClass jclass, JsonNode propertiesNode) {<NEW_LINE>JMethod method = jclass.method(PROTECTED, jclass.owner().BOOLEAN, DEFINED_SETTER_NAME);<NEW_LINE>JVar nameParam = method.param(String.class, "name");<NEW_LINE>JVar valueParam = method.param(Object.class, "value");<NEW_LINE>JBlock body = method.body();<NEW_LINE>JSwitch <MASK><NEW_LINE>if (propertiesNode != null) {<NEW_LINE>for (Iterator<Map.Entry<String, JsonNode>> properties = propertiesNode.fields(); properties.hasNext(); ) {<NEW_LINE>Map.Entry<String, JsonNode> property = properties.next();<NEW_LINE>String propertyName = property.getKey();<NEW_LINE>JsonNode node = property.getValue();<NEW_LINE>String fieldName = ruleFactory.getNameHelper().getPropertyName(propertyName, node);<NEW_LINE>JType propertyType = jclass.fields().get(fieldName).type();<NEW_LINE>addSetPropertyCase(jclass, propertySwitch, propertyName, propertyType, valueParam, node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JBlock defaultBlock = propertySwitch._default().body();<NEW_LINE>JClass extendsType = jclass._extends();<NEW_LINE>if (extendsType != null && extendsType instanceof JDefinedClass) {<NEW_LINE>JDefinedClass parentClass = (JDefinedClass) extendsType;<NEW_LINE>JMethod parentMethod = parentClass.getMethod(DEFINED_SETTER_NAME, new JType[] { parentClass.owner()._ref(String.class), parentClass.owner()._ref(Object.class) });<NEW_LINE>defaultBlock._return(_super().invoke(parentMethod).arg(nameParam).arg(valueParam));<NEW_LINE>} else {<NEW_LINE>defaultBlock._return(FALSE);<NEW_LINE>}<NEW_LINE>return method;<NEW_LINE>}
propertySwitch = body._switch(nameParam);
1,385,573
public void insertAdditionalBuffers(int offset, int count) {<NEW_LINE>boolean[] newCrDone = new boolean[bufferCount + count];<NEW_LINE>// copy before and including offset<NEW_LINE>System.arraycopy(crDone, 0, newCrDone, 0, offset + 1);<NEW_LINE>// copy after offset<NEW_LINE>System.arraycopy(crDone, offset + 1, newCrDone, offset + 1 + count, bufferCount - offset - 1);<NEW_LINE>// init the new elements<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>newCrDone[offset + 1 + i] = true;<NEW_LINE>}<NEW_LINE>crDone = newCrDone;<NEW_LINE>int[] newIndentLevel = new int[bufferCount + count];<NEW_LINE>// copy before and including offset<NEW_LINE>System.arraycopy(indentLevel, 0, newIndentLevel, 0, offset + 1);<NEW_LINE>// copy after offset<NEW_LINE>System.arraycopy(indentLevel, offset + 1, newIndentLevel, offset + 1 + count, bufferCount - offset - 1);<NEW_LINE>// init the new elements<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>newIndentLevel[<MASK><NEW_LINE>}<NEW_LINE>indentLevel = newIndentLevel;<NEW_LINE>super.insertAdditionalBuffers(offset, count);<NEW_LINE>}
offset + 1 + i] = 0;
564,633
public static Expr wrapExpr(Expr expr, List<TupleId> tids, TNullSide nullSide, Analyzer analyzer) throws UserException {<NEW_LINE>if (!requiresNullWrapping(expr, analyzer)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>List<Expr> params = Lists.newArrayList();<NEW_LINE>params.add(<MASK><NEW_LINE>params.add(new NullLiteral());<NEW_LINE>params.add(expr);<NEW_LINE>Expr ifExpr = new FunctionCallExpr("if", params);<NEW_LINE>ifExpr.analyzeNoThrow(analyzer);<NEW_LINE>// The type of function which is different from the type of expr will return the incorrect result in query.<NEW_LINE>// Example:<NEW_LINE>// the type of expr is date<NEW_LINE>// the type of function is int<NEW_LINE>// So, the upper fragment will receive a int value instead of date while the result expr is date.<NEW_LINE>// If there is no cast function, the result of query will be incorrect.<NEW_LINE>if (expr.getType().getPrimitiveType() != ifExpr.getType().getPrimitiveType()) {<NEW_LINE>ifExpr = ifExpr.uncheckedCastTo(expr.getType());<NEW_LINE>}<NEW_LINE>return ifExpr;<NEW_LINE>}
new TupleIsNullPredicate(tids, nullSide));
1,222,146
final DescribeFirewallPolicyResult executeDescribeFirewallPolicy(DescribeFirewallPolicyRequest describeFirewallPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeFirewallPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeFirewallPolicyRequest> request = null;<NEW_LINE>Response<DescribeFirewallPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeFirewallPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeFirewallPolicyRequest));<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, "Network Firewall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeFirewallPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeFirewallPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeFirewallPolicyResultJsonUnmarshaller());<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);
438,479
public FluidStack extract(int amount, Action action, AutomationType automationType) {<NEW_LINE>if (isEmpty() || amount < 1 || !canExtract.test(stored, automationType)) {<NEW_LINE>// "Fail quick" if we don't can never extract from this tank, have a fluid stored, or the amount being requested is less than one<NEW_LINE>return FluidStack.EMPTY;<NEW_LINE>}<NEW_LINE>// Note: While we technically could just return the stack itself if we are removing all that we have, it would require a lot more checks<NEW_LINE>// We also are limiting it by the rate this tank has<NEW_LINE>int size = Math.min(Math.min(getRate(automationType), getFluidAmount()), amount);<NEW_LINE>if (size == 0) {<NEW_LINE>return FluidStack.EMPTY;<NEW_LINE>}<NEW_LINE>FluidStack ret <MASK><NEW_LINE>if (!ret.isEmpty() && action.execute()) {<NEW_LINE>// If shrink gets the size to zero it will update the empty state so that isEmpty() returns true.<NEW_LINE>stored.shrink(ret.getAmount());<NEW_LINE>onContentsChanged();<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
= new FluidStack(stored, size);
76,983
public int readData(FormatHolder formatHolder, DecoderInputBuffer buffer, @ReadFlags int readFlags) {<NEW_LINE>maybeNotifyDownstreamFormat();<NEW_LINE>if (loadingFinished && sampleData == null) {<NEW_LINE>streamState = STREAM_STATE_END_OF_STREAM;<NEW_LINE>}<NEW_LINE>if (streamState == STREAM_STATE_END_OF_STREAM) {<NEW_LINE><MASK><NEW_LINE>return C.RESULT_BUFFER_READ;<NEW_LINE>}<NEW_LINE>if ((readFlags & FLAG_REQUIRE_FORMAT) != 0 || streamState == STREAM_STATE_SEND_FORMAT) {<NEW_LINE>formatHolder.format = format;<NEW_LINE>streamState = STREAM_STATE_SEND_SAMPLE;<NEW_LINE>return C.RESULT_FORMAT_READ;<NEW_LINE>}<NEW_LINE>if (!loadingFinished) {<NEW_LINE>return C.RESULT_NOTHING_READ;<NEW_LINE>}<NEW_LINE>Assertions.checkNotNull(sampleData);<NEW_LINE>buffer.addFlag(C.BUFFER_FLAG_KEY_FRAME);<NEW_LINE>buffer.timeUs = 0;<NEW_LINE>if ((readFlags & FLAG_OMIT_SAMPLE_DATA) == 0) {<NEW_LINE>buffer.ensureSpaceForWrite(sampleSize);<NEW_LINE>buffer.data.put(sampleData, 0, sampleSize);<NEW_LINE>}<NEW_LINE>if ((readFlags & FLAG_PEEK) == 0) {<NEW_LINE>streamState = STREAM_STATE_END_OF_STREAM;<NEW_LINE>}<NEW_LINE>return C.RESULT_BUFFER_READ;<NEW_LINE>}
buffer.addFlag(C.BUFFER_FLAG_END_OF_STREAM);
979,639
public void encode(DexFile file) {<NEW_LINE>finishProcessingIfNecessary();<NEW_LINE>TypeIdsSection typeIds = file.getTypeIds();<NEW_LINE>int size = table.size();<NEW_LINE>handlerOffsets = new TreeMap<CatchHandlerList, Integer>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>handlerOffsets.put(table.get(i).getHandlers(), null);<NEW_LINE>}<NEW_LINE>if (handlerOffsets.size() > 65535) {<NEW_LINE>throw new UnsupportedOperationException("too many catch handlers");<NEW_LINE>}<NEW_LINE>ByteArrayAnnotatedOutput out = new ByteArrayAnnotatedOutput();<NEW_LINE>// Write out the handlers "header" consisting of its size in entries.<NEW_LINE>encodedHandlerHeaderSize = out.writeUleb128(handlerOffsets.size());<NEW_LINE>// Now write the lists out in order, noting the offset of each.<NEW_LINE>for (Map.Entry<CatchHandlerList, Integer> mapping : handlerOffsets.entrySet()) {<NEW_LINE>CatchHandlerList list = mapping.getKey();<NEW_LINE>int listSize = list.size();<NEW_LINE>boolean catchesAll = list.catchesAll();<NEW_LINE>// Set the offset before we do any writing.<NEW_LINE>mapping.setValue(out.getCursor());<NEW_LINE>if (catchesAll) {<NEW_LINE>// A size <= 0 means that the list ends with a catch-all.<NEW_LINE>out.writeSleb128(-(listSize - 1));<NEW_LINE>listSize--;<NEW_LINE>} else {<NEW_LINE>out.writeSleb128(listSize);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < listSize; i++) {<NEW_LINE>CatchHandlerList.Entry entry = list.get(i);<NEW_LINE>out.writeUleb128(typeIds.indexOf(entry.getExceptionType()));<NEW_LINE>out.<MASK><NEW_LINE>}<NEW_LINE>if (catchesAll) {<NEW_LINE>out.writeUleb128(list.get(listSize).getHandler());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>encodedHandlers = out.toByteArray();<NEW_LINE>}
writeUleb128(entry.getHandler());
168,772
public static void login(final JSONObject user, final Response response) {<NEW_LINE>try {<NEW_LINE>final String userId = user.optString(Keys.OBJECT_ID);<NEW_LINE>final JSONObject cookieJSONObject = new JSONObject();<NEW_LINE>cookieJSONObject.put(Keys.OBJECT_ID, userId);<NEW_LINE>final String b3Key = user.optString(UserExt.USER_B3_KEY);<NEW_LINE>final String <MASK><NEW_LINE>cookieJSONObject.put(Keys.TOKEN, b3Key + ":" + random);<NEW_LINE>final String cookieValue = Crypts.encryptByAES(cookieJSONObject.toString(), COOKIE_SECRET);<NEW_LINE>final Cookie cookie = new Cookie(COOKIE_NAME, cookieValue);<NEW_LINE>cookie.setMaxAge(COOKIE_EXPIRY);<NEW_LINE>cookie.setPath("/");<NEW_LINE>cookie.setHttpOnly(true);<NEW_LINE>response.addCookie(cookie);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.log(Level.WARN, "Can not write cookie", e);<NEW_LINE>}<NEW_LINE>}
random = RandomStringUtils.randomAlphanumeric(8);
1,062,645
public static java.util.Map importAll(org.python.types.Module module) {<NEW_LINE>java.util.Map<java.lang.String, org.python.Object> exports = new java.util.HashMap<java.lang.String, org.python.Object>();<NEW_LINE>org.python.Object all_obj = module.__getattribute_null("__all__");<NEW_LINE>if (all_obj == null) {<NEW_LINE>for (java.lang.String name : module.__dict__.keySet()) {<NEW_LINE>if (!name.startsWith("_")) {<NEW_LINE>exports.put(name, module<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>org.python.Object iter = all_obj.__iter__();<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>java.lang.String name = ((org.python.types.Str) iter.__next__()).value;<NEW_LINE>exports.put(name, module.__dict__.get(name));<NEW_LINE>}<NEW_LINE>} catch (org.python.exceptions.StopIteration e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return exports;<NEW_LINE>}
.__dict__.get(name));
1,852,708
public void prepare(Map conf, TopologyContext context, OutputCollector collector) {<NEW_LINE>this.collector = collector;<NEW_LINE>LinkedHashMap copy = new LinkedHashMap(conf);<NEW_LINE>copy.putAll(boltConfig);<NEW_LINE>StormSettings settings = new StormSettings(copy);<NEW_LINE>flushOnTickTuple = settings.getStormTickTupleFlush();<NEW_LINE>ackWrites = settings.getStormBoltAck();<NEW_LINE>// trigger manual flush<NEW_LINE>if (ackWrites) {<NEW_LINE>settings.setProperty(ES_BATCH_FLUSH_MANUAL, Boolean.TRUE.toString());<NEW_LINE>// align Bolt / es-hadoop batch settings<NEW_LINE>numberOfEntries = settings.getStormBulkSize();<NEW_LINE>settings.setProperty(ES_BATCH_SIZE_ENTRIES, String.valueOf(numberOfEntries));<NEW_LINE>inflightTuples = new ArrayList<Tuple>(numberOfEntries + 1);<NEW_LINE>}<NEW_LINE>int totalTasks = context.getComponentTasks(context.getThisComponentId()).size();<NEW_LINE>InitializationUtils.setValueWriterIfNotSet(settings, StormValueWriter.class, log);<NEW_LINE>InitializationUtils.setBytesConverterIfNeeded(settings, StormTupleBytesConverter.class, log);<NEW_LINE>InitializationUtils.setFieldExtractorIfNotSet(<MASK><NEW_LINE>InitializationUtils.setUserProviderIfNotSet(settings, JdkUserProvider.class, log);<NEW_LINE>EsClusterInfoSelector.populate(settings);<NEW_LINE>writer = RestService.createWriter(settings, context.getThisTaskIndex(), totalTasks, log);<NEW_LINE>}
settings, StormTupleFieldExtractor.class, log);
1,512,206
public Resource execute(String[] fields) throws IllegalArgumentException, IOException {<NEW_LINE>if (fields.length < 3) {<NEW_LINE>System.out.println("Wrong TILESET definition");<NEW_LINE>System.out.println("TILESET name \"file\" [compression [opt]]");<NEW_LINE>System.out.println(" name Tileset variable name");<NEW_LINE>System.out.println(" file the image to convert to TileSet structure (indexed colors BMP or PNG image)");<NEW_LINE>System.out.println(" compression compression type, accepted values:");<NEW_LINE>System.out.println(" -1 / BEST / AUTO = use best compression");<NEW_LINE>System.out.println(" 0 / NONE = no compression (default)");<NEW_LINE>System.out.println(" 1 / APLIB = aplib library (good compression ratio but slow)");<NEW_LINE>System.out.println(" 2 / FAST / LZ4W = custom lz4 compression (average compression ratio but fast)");<NEW_LINE><MASK><NEW_LINE>System.out.println(" 0 / NONE = no optimisation, each tile is unique");<NEW_LINE>System.out.println(" 1 / ALL = ignore duplicated and flipped tile (default)");<NEW_LINE>System.out.println(" 2 / DUPLICATE = ignore duplicated tile only");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// get resource id<NEW_LINE>final String id = fields[1];<NEW_LINE>// get input file<NEW_LINE>final String fileIn = FileUtil.adjustPath(Compiler.resDir, fields[2]);<NEW_LINE>// get packed value<NEW_LINE>Compression compression = Compression.NONE;<NEW_LINE>if (fields.length >= 4)<NEW_LINE>compression = Util.getCompression(fields[3]);<NEW_LINE>// get optimization value<NEW_LINE>TileOptimization opt = TileOptimization.ALL;<NEW_LINE>if (fields.length >= 5)<NEW_LINE>opt = Util.getTileOpt(fields[4]);<NEW_LINE>// add resource file (used for deps generation)<NEW_LINE>Compiler.addResourceFile(fileIn);<NEW_LINE>// TILESET resource never optimize tiles and we ignore palette information<NEW_LINE>return Tileset.getTileset(id, fileIn, compression, opt, 256);<NEW_LINE>}
System.out.println(" opt define the optimisation level, accepted values:");
1,333,460
private Mono<Response<PrivateLinkResourceListResultInner>> listByBotResourceWithResponseAsync(String resourceGroupName, String resourceName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByBotResource(this.client.getEndpoint(), resourceGroupName, resourceName, this.client.getApiVersion(), this.client.<MASK><NEW_LINE>}
getSubscriptionId(), accept, context);
410,143
// Jmeter runs once runTest to calculate a thing, it will run repeatedly<NEW_LINE>@Override<NEW_LINE>public SampleResult runTest(JavaSamplerContext context) {<NEW_LINE>SampleResult result = new SampleResult();<NEW_LINE>result.setSampleLabel("producer");<NEW_LINE>try {<NEW_LINE>result.sampleStart();<NEW_LINE>SendResult sendResult = this.weEventClient.publish(this.weEvent);<NEW_LINE>result.sampleEnd();<NEW_LINE>result.setSuccessful(sendResult.getStatus() == SendResult.SendResultStatus.SUCCESS && sendResult.getEventId().length() > 0);<NEW_LINE>result.setResponseMessage(sendResult.getEventId());<NEW_LINE>result.setResponseHeaders(sendResult.getStatus().toString());<NEW_LINE>result.setResponseData(sendResult.toString(), Charset.<MASK><NEW_LINE>getNewLogger().info("sendResult:{}", sendResult);<NEW_LINE>} catch (Exception e) {<NEW_LINE>getNewLogger().error("publish exception", e);<NEW_LINE>result.sampleEnd();<NEW_LINE>result.setSuccessful(false);<NEW_LINE>result.setResponseMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
defaultCharset().name());
223,013
public void add(short bucket, byte positionOf1) {<NEW_LINE>if (storageBuffer.isReadOnly()) {<NEW_LINE>convertToMutableByteBuffer();<NEW_LINE>}<NEW_LINE>byte registerOffset = getRegisterOffset();<NEW_LINE>// discard everything outside of the range we care about<NEW_LINE>if (positionOf1 <= registerOffset) {<NEW_LINE>return;<NEW_LINE>} else if (positionOf1 > (registerOffset + RANGE)) {<NEW_LINE>final byte currMax = getMaxOverflowValue();<NEW_LINE>if (positionOf1 > currMax) {<NEW_LINE>if (currMax <= (registerOffset + RANGE)) {<NEW_LINE>// this could be optimized by having an add without sanity checks<NEW_LINE>add(getMaxOverflowRegister(), currMax);<NEW_LINE>}<NEW_LINE>setMaxOverflowValue(positionOf1);<NEW_LINE>setMaxOverflowRegister(bucket);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// whatever value we add must be stored in 4 bits<NEW_LINE>short numNonZeroRegisters = addNibbleRegister(bucket, (byte) ((<MASK><NEW_LINE>setNumNonZeroRegisters(numNonZeroRegisters);<NEW_LINE>if (numNonZeroRegisters == NUM_BUCKETS) {<NEW_LINE>setRegisterOffset((byte) (registerOffset + 1));<NEW_LINE>setNumNonZeroRegisters(decrementBuckets());<NEW_LINE>}<NEW_LINE>}
0xff & positionOf1) - registerOffset));
1,778,780
public void drawObjects(PlatformImage output) {<NEW_LINE>output.create(image.getWidth(), image.getHeight());<NEW_LINE>ImageUtils.log("Columns:", columns.size());<NEW_LINE>ImageUtils.log(<MASK><NEW_LINE>ImageUtils.log("Words:", words.size());<NEW_LINE>for (int y = 0; y < image.getHeight(); y++) {<NEW_LINE>for (int x = 0; x < image.getWidth(); x++) {<NEW_LINE>output.setPixel(x, y, image.getPixel(x, y));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isDrawColums) {<NEW_LINE>for (Column col : columns) {<NEW_LINE>ImageUtils.drawRect(output, col.x1, col.y1, col.x2, col.y2, PlatformImage.GREEN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isDrawLines) {<NEW_LINE>for (Line l : lines) {<NEW_LINE>ImageUtils.drawRect(output, l.x1, l.y1, l.x2, l.y2, PlatformImage.RED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Word w : words) {<NEW_LINE>if (isDrawChars) {<NEW_LINE>ImageUtils.drawRect(output, w.x1, w.y1, w.x2, w.y2, PlatformImage.BLUE);<NEW_LINE>}<NEW_LINE>int dy = w.y1;<NEW_LINE>ImageUtils.drawRect(output, w.x1 - w.offsetLeft, dy, w.x1, dy + 2, PlatformImage.YELLOW);<NEW_LINE>}<NEW_LINE>for (Word w : wordsLong) {<NEW_LINE>ImageUtils.drawRect(output, w.x1, w.y1, w.x2, w.y2, PlatformImage.MAROON);<NEW_LINE>}<NEW_LINE>}
"Lines:", lines.size());
1,788,241
public boolean apply(Game game, Ability source) {<NEW_LINE>// Store for each player the cards to exile, that's important because all exile shall happen at the same time<NEW_LINE>Map<UUID, Cards> <MASK><NEW_LINE>// Each player chooses 2 cards to discard<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int numberOfCardsToExile = Math.min(2, player.getHand().size());<NEW_LINE>Cards cards = new CardsImpl();<NEW_LINE>Target target = new TargetCardInHand(numberOfCardsToExile, new FilterCard());<NEW_LINE>player.chooseTarget(Outcome.Exile, target, source, game);<NEW_LINE>cards.addAll(target.getTargets());<NEW_LINE>cardsToExile.put(playerId, cards);<NEW_LINE>}<NEW_LINE>// Exile all choosen cards<NEW_LINE>for (UUID playerId : game.getOpponents(source.getControllerId())) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Cards cardsPlayerChoseToExile = cardsToExile.get(playerId);<NEW_LINE>if (cardsPlayerChoseToExile == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>player.moveCards(cardsPlayerChoseToExile.getCards(game), Zone.EXILED, source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
cardsToExile = new HashMap<>();
258,592
/* Compare version strings:<NEW_LINE><NEW_LINE>This function compares strings S1 and S2:<NEW_LINE>1) By PREFIX in the same way as strcmp.<NEW_LINE>2) Then by VERSION (most similarly to version compare of Debian's dpkg).<NEW_LINE>Leading zeros in version numbers are ignored.<NEW_LINE>3) If both (PREFIX and VERSION) are equal, strcmp function is used for<NEW_LINE>comparison. So this function can return 0 if (and only if) strings S1<NEW_LINE>and S2 are identical.<NEW_LINE><NEW_LINE>It returns number >0 for S1 > S2, 0 for S1 == S2 and number <0 for S1 < S2.<NEW_LINE><NEW_LINE>This function compares strings, in a way that if VER1 and VER2 are version<NEW_LINE>numbers and PREFIX and SUFFIX (SUFFIX defined as (\.[A-Za-z~][A-Za-z0-9~]*)*)<NEW_LINE>are strings then VER1 < VER2 implies filevercmp (PREFIX VER1 SUFFIX,<NEW_LINE>PREFIX VER2 SUFFIX) < 0.<NEW_LINE><NEW_LINE>This function is intended to be a replacement for strverscmp. */<NEW_LINE>public static int filevercmp(String s1, String s2) {<NEW_LINE><MASK><NEW_LINE>int s1_len = 0, s2_len = 0;<NEW_LINE>int result = 0;<NEW_LINE>if (s1 == null || s1.length() == 0)<NEW_LINE>return -1;<NEW_LINE>if (s2 == null || s2.length() == 0)<NEW_LINE>return 1;<NEW_LINE>if (0 == strcmp(".", s1))<NEW_LINE>return -1;<NEW_LINE>if (0 == strcmp(".", s2))<NEW_LINE>return 1;<NEW_LINE>if (0 == strcmp("..", s1))<NEW_LINE>return -1;<NEW_LINE>if (0 == strcmp("..", s2))<NEW_LINE>return 1;<NEW_LINE>s1_suffix = match_suffix(s1);<NEW_LINE>s2_suffix = match_suffix(s2);<NEW_LINE>s1_len = s1.length() - s1_suffix.length();<NEW_LINE>s2_len = s2.length() - s2_suffix.length();
String s1_suffix = "", s2_suffix = "";
1,054,404
public static INDArray toArray(DataType dataType, Collection<? extends Writable> record) {<NEW_LINE>List<Writable> l;<NEW_LINE>if (record instanceof List) {<NEW_LINE>l = (List<Writable>) record;<NEW_LINE>} else {<NEW_LINE>l = new ArrayList<>(record);<NEW_LINE>}<NEW_LINE>// Edge case: single NDArrayWritable<NEW_LINE>if (l.size() == 1 && l.get(0) instanceof NDArrayWritable) {<NEW_LINE>return ((NDArrayWritable) l.get(0)).get();<NEW_LINE>}<NEW_LINE>int length = 0;<NEW_LINE>for (Writable w : record) {<NEW_LINE>if (w instanceof NDArrayWritable) {<NEW_LINE>INDArray a = ((<MASK><NEW_LINE>if (!a.isRowVector()) {<NEW_LINE>throw new UnsupportedOperationException("Multiple writables present but NDArrayWritable is " + "not a row vector. Can only concat row vectors with other writables. Shape: " + Arrays.toString(a.shape()));<NEW_LINE>}<NEW_LINE>length += a.length();<NEW_LINE>} else {<NEW_LINE>// Assume all others are single value<NEW_LINE>length++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>INDArray arr = Nd4j.create(dataType, 1, length);<NEW_LINE>int k = 0;<NEW_LINE>for (Writable w : record) {<NEW_LINE>if (w instanceof NDArrayWritable) {<NEW_LINE>INDArray toPut = ((NDArrayWritable) w).get();<NEW_LINE>arr.put(new INDArrayIndex[] { NDArrayIndex.point(0), NDArrayIndex.interval(k, k + toPut.length()) }, toPut);<NEW_LINE>k += toPut.length();<NEW_LINE>} else {<NEW_LINE>arr.putScalar(0, k, w.toDouble());<NEW_LINE>k++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return arr;<NEW_LINE>}
NDArrayWritable) w).get();
1,192,363
public void testLocalMethodwithRemoteExAndSub() throws Exception {<NEW_LINE>SLRemoteExLocal remoteExLocal = lookupSLRemoteExBeanLocal();<NEW_LINE>// verify method with throws exception may be called without an exception<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("none");<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("RemoteException");<NEW_LINE>fail("Expected RemoteException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not RemoteException : " + rootex.getClass().getName(), rootex.getClass() == RemoteException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "RemoteException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("SLRemoteException");<NEW_LINE>fail("Expected SLRemoteException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not SLRemoteException : " + rootex.getClass().getName(), rootex.<MASK><NEW_LINE>assertEquals("Wrong Exception message received", "SLRemoteException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("RuntimeException");<NEW_LINE>fail("Expected RuntimeException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>// (UnknownLocalException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not RuntimeException : " + rootex.getClass().getName(), rootex.getClass() == RuntimeException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "RuntimeException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("IllegalStateException");<NEW_LINE>fail("Expected IllegalStateException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>// (UnknownLocalException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not IllegalStateException : " + rootex.getClass().getName(), rootex.getClass() == IllegalStateException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "IllegalStateException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>}
getClass() == SLRemoteException.class);
405,557
public synchronized void appendURL(URL url) {<NEW_LINE>try {<NEW_LINE>if (url == null) {<NEW_LINE>_logger.log(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>URLEntry entry = new URLEntry(url);<NEW_LINE>if (!urlSet.contains(entry)) {<NEW_LINE>// adds the url entry to the list<NEW_LINE>this.urlSet.add(entry);<NEW_LINE>if (entry.isJar) {<NEW_LINE>// checks the manifest if a jar<NEW_LINE>checkManifest(entry.zip, entry.file);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>_logger.log(Level.FINE, "[ASURLClassLoader] Ignoring duplicate URL: {0}", url);<NEW_LINE>if (entry.zip != null) {<NEW_LINE>try {<NEW_LINE>entry.zip.reallyClose();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>_logger.log(Level.INFO, CULoggerInfo.getString(CULoggerInfo.exceptionClosingDupUrlEntry, url), ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// clears the "not found" cache since we are adding a new url<NEW_LINE>clearNotFoundCaches();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>_logger.log(Level.SEVERE, CULoggerInfo.getString(CULoggerInfo.badUrlEntry, url), ioe);<NEW_LINE>}<NEW_LINE>}
Level.INFO, CULoggerInfo.missingURLEntry);
1,483,636
private static void testExample1() {<NEW_LINE>int n = 9;<NEW_LINE>List<List<Integer>> graph = createGraph(n);<NEW_LINE>addEdge(graph, 0, 1);<NEW_LINE>addEdge(graph, 0, 2);<NEW_LINE>addEdge(graph, 1, 2);<NEW_LINE>addEdge(graph, 2, 3);<NEW_LINE>addEdge(graph, 3, 4);<NEW_LINE>addEdge(graph, 2, 5);<NEW_LINE>addEdge(graph, 5, 6);<NEW_LINE>addEdge(graph, 6, 7);<NEW_LINE><MASK><NEW_LINE>addEdge(graph, 8, 5);<NEW_LINE>ArticulationPointsAdjacencyList solver = new ArticulationPointsAdjacencyList(graph, n);<NEW_LINE>boolean[] isArticulationPoint = solver.findArticulationPoints();<NEW_LINE>// Prints:<NEW_LINE>// Node 2 is an articulation<NEW_LINE>// Node 3 is an articulation<NEW_LINE>// Node 5 is an articulation<NEW_LINE>for (int i = 0; i < n; i++) if (isArticulationPoint[i])<NEW_LINE>System.out.printf("Node %d is an articulation\n", i);<NEW_LINE>}
addEdge(graph, 7, 8);
1,046,526
public void scoreRow(int row, ImageData leftRow, ImageData rightRow, int[] scores, int disparityMin, int disparityMax, int regionWidth, int[] elementScore) {<NEW_LINE>int regionRadius = regionWidth / 2;<NEW_LINE>// image width plus left and right borders<NEW_LINE>int widthAndBorder = left.width + regionRadius * 2;<NEW_LINE>// disparity as the outer loop to maximize common elements in inner loops, reducing redundant calculations<NEW_LINE>for (int d = disparityMin; d <= disparityMax; d++) {<NEW_LINE>int dispFromMin = d - disparityMin;<NEW_LINE>// Compute the scores<NEW_LINE>score(leftRow, rightRow, d, 0, 0, widthAndBorder - d, elementScore);<NEW_LINE>// score at the first column<NEW_LINE>int score = 0;<NEW_LINE>for (int i = 0; i < regionWidth; i<MASK><NEW_LINE>int indexScore = left.width * dispFromMin + dispFromMin;<NEW_LINE>scores[indexScore++] = score;<NEW_LINE>// scores for the remaining columns<NEW_LINE>for (int col = 0; col < left.width - dispFromMin - 1; col++, indexScore++) {<NEW_LINE>scores[indexScore] = score += elementScore[col + regionWidth] - elementScore[col];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
++) score += elementScore[i];
949,878
public static void listener(ClientTabCompletePacket packet, Player player) {<NEW_LINE>final String text = packet.text();<NEW_LINE>String commandString = text.replaceFirst(CommandManager.COMMAND_PREFIX, "");<NEW_LINE>String[] split = commandString.split(StringUtils.SPACE);<NEW_LINE>String commandName = split[0];<NEW_LINE>String args = commandString.replaceFirst(Pattern.quote(commandName), "");<NEW_LINE>final CommandQueryResult commandQueryResult = CommandParser.findCommand(MinecraftServer.getCommandManager(<MASK><NEW_LINE>if (commandQueryResult == null) {<NEW_LINE>// Command not found<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ArgumentQueryResult queryResult = CommandParser.findEligibleArgument(commandQueryResult.command(), commandQueryResult.args(), commandString, text.endsWith(StringUtils.SPACE), false, CommandSyntax::hasSuggestion, Argument::hasSuggestion);<NEW_LINE>if (queryResult == null) {<NEW_LINE>// Suggestible argument not found<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Argument<?> argument = queryResult.argument();<NEW_LINE>final SuggestionCallback suggestionCallback = argument.getSuggestionCallback();<NEW_LINE>if (suggestionCallback != null) {<NEW_LINE>final String input = queryResult.input();<NEW_LINE>final int inputLength = input.length();<NEW_LINE>final int commandLength = Arrays.stream(split).map(String::length).reduce(0, Integer::sum) + StringUtils.countMatches(args, StringUtils.SPACE_CHAR);<NEW_LINE>final int trailingSpaces = !input.isEmpty() ? text.length() - text.trim().length() : 0;<NEW_LINE>final int start = commandLength - inputLength + 1 - trailingSpaces;<NEW_LINE>Suggestion suggestion = new Suggestion(input, start, inputLength);<NEW_LINE>suggestionCallback.apply(player, queryResult.context(), suggestion);<NEW_LINE>player.getPlayerConnection().sendPacket(new TabCompletePacket(packet.transactionId(), suggestion.getStart(), suggestion.getLength(), suggestion.getEntries().stream().map(suggestionEntry -> new TabCompletePacket.Match(suggestionEntry.getEntry(), suggestionEntry.getTooltip())).toList()));<NEW_LINE>}<NEW_LINE>}
).getDispatcher(), commandString);
1,132,472
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_loadmore);<NEW_LINE>toolbar = (Toolbar) findViewById(R.id.tool_bar);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>getSupportActionBar().setDisplayShowTitleEnabled(false);<NEW_LINE>ultimateRecyclerView = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);<NEW_LINE>ultimateRecyclerView.setHasFixedSize(false);<NEW_LINE>List<String> stringList = new ArrayList<>();<NEW_LINE>stringList.add("111");<NEW_LINE>stringList.add("aaa");<NEW_LINE>stringList.add("222");<NEW_LINE>stringList.add("33");<NEW_LINE>stringList.add("44");<NEW_LINE>stringList.add("55");<NEW_LINE>simpleRecyclerViewAdapter = new MultiViewTypesRecyclerViewAdapter(stringList);<NEW_LINE>simpleRecyclerViewAdapter.setCustomLoadMoreView(LayoutInflater.from(this).inflate(R<MASK><NEW_LINE>// stringList.add("66");<NEW_LINE>// stringList.add("11771");<NEW_LINE>linearLayoutManager = new LinearLayoutManager(this);<NEW_LINE>ultimateRecyclerView.setLayoutManager(linearLayoutManager);<NEW_LINE>// ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);<NEW_LINE>ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);<NEW_LINE>ultimateRecyclerView.setDefaultOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRefresh() {<NEW_LINE>new Handler().postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>simpleRecyclerViewAdapter.insert("Refresh things", 0);<NEW_LINE>ultimateRecyclerView.setRefreshing(false);<NEW_LINE>// ultimateRecyclerView.scrollBy(0, -50);<NEW_LINE>linearLayoutManager.scrollToPosition(0);<NEW_LINE>}<NEW_LINE>}, 1000);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setStrokeWidth(5);<NEW_LINE>paint.setColor(Color.BLUE);<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>paint.setPathEffect(new DashPathEffect(new float[] { 25.0f, 25.0f }, 0));<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>ultimateRecyclerView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);<NEW_LINE>}<NEW_LINE>ultimateRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this).paint(paint).build());<NEW_LINE>// simpleRecyclerViewAdapter.ad<NEW_LINE>}
.layout.custom_bottom_progressbar, null));
1,142,070
public void addAbility(Ability ability) {<NEW_LINE>ability.setSourceId(this.getId());<NEW_LINE>abilities.add(ability);<NEW_LINE>abilities.addAll(ability.getSubAbilities());<NEW_LINE>// dynamic check: you can't add ability to the PermanentCard, use permanent.addAbility(a, source, game) instead<NEW_LINE>// reason: triggered abilities are not processing here<NEW_LINE>if (this instanceof PermanentCard) {<NEW_LINE>throw new IllegalArgumentException("Wrong code usage. Don't use that method for permanents, use permanent.addAbility(a, source, game) instead.");<NEW_LINE>}<NEW_LINE>// verify check: draw effect can't be rollback after mana usage (example: Chromatic Sphere)<NEW_LINE>// (player can cheat with cancel button to see next card)<NEW_LINE>// verify test will catch that errors<NEW_LINE>if (ability instanceof ActivatedManaAbilityImpl) {<NEW_LINE>ActivatedManaAbilityImpl manaAbility = (ActivatedManaAbilityImpl) ability;<NEW_LINE>String rule = manaAbility.getRule(<MASK><NEW_LINE>if (manaAbility.getEffects().stream().anyMatch(e -> e.getOutcome().equals(Outcome.DrawCard)) || rule.contains("reveal ") || rule.contains("draw ")) {<NEW_LINE>if (manaAbility.isUndoPossible()) {<NEW_LINE>throw new IllegalArgumentException("Ability contains draw/reveal effect, but isUndoPossible is true. Ability: " + ability.getClass().getSimpleName() + "; " + ability.getRule());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).toLowerCase(Locale.ENGLISH);
98,031
// ----------------------------------------------------------------<NEW_LINE>private static // returns line-counter<NEW_LINE>// returns line-counter<NEW_LINE>int handleStream(BufferedReader reader, String filename, MIH256<String> mihWithCenters, Map<Hash256, Integer> centersToIndices, int distanceThreshold, int lineCounter, int traceCount, boolean doBruteForceQuery) {<NEW_LINE>while (true) {<NEW_LINE>Hash256AndMetadata<String> inputPair = null;<NEW_LINE>try {<NEW_LINE>inputPair = HashReaderUtil.loadHashAndMetadataFromStream(reader, lineCounter);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.printf(<MASK><NEW_LINE>System.exit(1);<NEW_LINE>} catch (PDQHashFormatException e) {<NEW_LINE>System.err.printf("%s: unparseable hash \"%s\" at line %d of file \"%s\".\n", PROGNAME, e.getUnacceptableInput(), lineCounter + 1, filename);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>if (inputPair == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (traceCount > 0) {<NEW_LINE>if ((lineCounter % traceCount) == 0) {<NEW_LINE>System.err.printf("-- %d\n", lineCounter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lineCounter++;<NEW_LINE>Vector<Hash256AndMetadata<String>> matches = new Vector<Hash256AndMetadata<String>>();<NEW_LINE>Hash256AndMetadata<String> centerPair = null;<NEW_LINE>try {<NEW_LINE>centerPair = doBruteForceQuery ? mihWithCenters.bruteForceQueryAny(inputPair.hash, distanceThreshold) : mihWithCenters.queryAny(inputPair.hash, distanceThreshold);<NEW_LINE>} catch (MIHDimensionExceededException e) {<NEW_LINE>System.err.printf("%s: %s\n", PROGNAME, e.getErrorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>boolean isCenter = false;<NEW_LINE>int matchClusterIndex = -1;<NEW_LINE>if (centerPair == null) {<NEW_LINE>isCenter = true;<NEW_LINE>int insertionClusterIndex = mihWithCenters.size();<NEW_LINE>mihWithCenters.insert(inputPair.hash, inputPair.metadata);<NEW_LINE>centersToIndices.put(inputPair.hash, insertionClusterIndex);<NEW_LINE>matchClusterIndex = insertionClusterIndex;<NEW_LINE>centerPair = inputPair;<NEW_LINE>} else {<NEW_LINE>matchClusterIndex = centersToIndices.get(centerPair.hash);<NEW_LINE>}<NEW_LINE>System.out.printf("clidx=%d,hash1=%s,hash2=%s,is_center=%d,d=%d,%s\n", matchClusterIndex, inputPair.hash.toString(), centerPair.hash.toString(), isCenter ? 1 : 0, centerPair.hash.hammingDistance(inputPair.hash), inputPair.metadata);<NEW_LINE>}<NEW_LINE>return lineCounter;<NEW_LINE>}
"%s: could not read line %d of file \"%s\".\n", PROGNAME, lineCounter, filename);
358,286
public AnomalousService unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AnomalousService anomalousService = new AnomalousService();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("ServiceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>anomalousService.setServiceId(ServiceIdJsonUnmarshaller.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 anomalousService;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,145,325
public ListParentsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListParentsResult listParentsResult = new ListParentsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listParentsResult;<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("Parents", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listParentsResult.setParents(new ListUnmarshaller<Parent>(ParentJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listParentsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listParentsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,695,618
public void testBuildApacheConfiguredValidatorFactory(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>if (validatorFactory == null) {<NEW_LINE>throw new IllegalStateException("Injection of ValidatorFactory never occurred.");<NEW_LINE>}<NEW_LINE>boolean isFeature11 = Boolean.parseBoolean(request.getParameter("isFeature11"));<NEW_LINE>MessageInterpolator mi = validatorFactory.getMessageInterpolator();<NEW_LINE>String expectedInterpolator = "org.apache.bval.jsr303.DefaultMessageInterpolator";<NEW_LINE>String actualInterpolator = mi<MASK><NEW_LINE>assertEquals("the correct message interpolator wasn't provided: " + actualInterpolator, expectedInterpolator, actualInterpolator);<NEW_LINE>if (isFeature11) {<NEW_LINE>ClassLoader tccl = Thread.currentThread().getContextClassLoader();<NEW_LINE>Class<?> messageInterpolator = tccl.loadClass("org.apache.bval.jsr.DefaultMessageInterpolator");<NEW_LINE>if (!messageInterpolator.isAssignableFrom(mi.getClass())) {<NEW_LINE>fail("even though the message interpolator returned was the correct " + "class, it's not wrapped properly in bval-1.1: " + messageInterpolator + ".isAssignableFrom(" + mi.getClass() + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getClass().getName();
1,156,697
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.openhab.binding.ebus.connection.EBusConnectorEventListener#onTelegramReceived(org.openhab.binding.ebus.<NEW_LINE>* EbusTelegram)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void onTelegramReceived(EBusTelegram telegram) {<NEW_LINE>// parse the raw telegram to a key/value map<NEW_LINE>final Map<String, Object> results = parser.parse(telegram);<NEW_LINE>if (results == null) {<NEW_LINE>logger.trace("No valid parser result for raw telegram!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Entry<String, Object> entry : results.entrySet()) {<NEW_LINE>State state = StateUtils.<MASK><NEW_LINE>// process if the state is set<NEW_LINE>if (state != null) {<NEW_LINE>// loop over all items to update the state<NEW_LINE>for (EBusBindingProvider provider : providers) {<NEW_LINE>for (String itemName : provider.getItemNames(entry.getKey())) {<NEW_LINE>Byte telegramSource = provider.getTelegramSource(itemName);<NEW_LINE>Byte telegramDestination = provider.getTelegramDestination(itemName);<NEW_LINE>// check if this item has a src or dst defined<NEW_LINE>if (telegramSource == null || telegram.getSource() == telegramSource) {<NEW_LINE>if (telegramDestination == null || telegram.getDestination() == telegramDestination) {<NEW_LINE>eventPublisher.postUpdate(itemName, state);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for<NEW_LINE>}<NEW_LINE>// if<NEW_LINE>}<NEW_LINE>}
convertToState(entry.getValue());
1,623,156
final AcceptReservedInstancesExchangeQuoteResult executeAcceptReservedInstancesExchangeQuote(AcceptReservedInstancesExchangeQuoteRequest acceptReservedInstancesExchangeQuoteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(acceptReservedInstancesExchangeQuoteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AcceptReservedInstancesExchangeQuoteRequest> request = null;<NEW_LINE>Response<AcceptReservedInstancesExchangeQuoteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AcceptReservedInstancesExchangeQuoteRequestMarshaller().marshall(super.beforeMarshalling(acceptReservedInstancesExchangeQuoteRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptReservedInstancesExchangeQuote");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AcceptReservedInstancesExchangeQuoteResult> responseHandler = new StaxResponseHandler<AcceptReservedInstancesExchangeQuoteResult>(new AcceptReservedInstancesExchangeQuoteResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
1,089,258
private static PrivateKey generatePEMPrivateKey(final Path keyPath) throws IOException {<NEW_LINE>String key = Files.readString(keyPath, Charset.defaultCharset());<NEW_LINE>String privateKeyPEM = key.replace("-----BEGIN PRIVATE KEY-----", "").replaceAll(System.lineSeparator(), "").replace("-----END PRIVATE KEY-----", "");<NEW_LINE>byte[] decoded = Base64.getDecoder().decode(privateKeyPEM);<NEW_LINE>PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decoded);<NEW_LINE>PrivateKey privateKey;<NEW_LINE>try {<NEW_LINE>KeyFactory kf = KeyFactory.getInstance("RSA");<NEW_LINE>privateKey = kf.generatePrivate(keySpec);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (InvalidKeySpecException e) {<NEW_LINE>try {<NEW_LINE>KeyFactory kf = KeyFactory.getInstance("EC");<NEW_LINE><MASK><NEW_LINE>} catch (InvalidKeySpecException e1) {<NEW_LINE>try {<NEW_LINE>KeyFactory kf = KeyFactory.getInstance("DSA");<NEW_LINE>privateKey = kf.generatePrivate(keySpec);<NEW_LINE>} catch (InvalidKeySpecException | NoSuchAlgorithmException e2) {<NEW_LINE>throw new RuntimeException(e2);<NEW_LINE>}<NEW_LINE>} catch (NoSuchAlgorithmException e1) {<NEW_LINE>throw new IllegalStateException(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return privateKey;<NEW_LINE>}
privateKey = kf.generatePrivate(keySpec);
1,227,612
public DisassociatePersonasFromEntitiesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DisassociatePersonasFromEntitiesResult disassociatePersonasFromEntitiesResult = new DisassociatePersonasFromEntitiesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 disassociatePersonasFromEntitiesResult;<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("FailedEntityList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>disassociatePersonasFromEntitiesResult.setFailedEntityList(new ListUnmarshaller<FailedEntity>(FailedEntityJsonUnmarshaller.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 disassociatePersonasFromEntitiesResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,576,799
private View inflateRoutingParameter(final int position) {<NEW_LINE>View v = mapActivity.getLayoutInflater().inflate(R.layout.layers_list_activity_item, null);<NEW_LINE>AndroidUtils.setListItemBackground(mapActivity, v, nightMode);<NEW_LINE>final TextView tv = (TextView) v.findViewById(R.id.title);<NEW_LINE>final TextView desc = (TextView) v.findViewById(R.id.description);<NEW_LINE>final CheckBox ch = ((CheckBox) v.findViewById(R.id.toggle_item));<NEW_LINE>final LocalRoutingParameter rp = getItem(position);<NEW_LINE>AndroidUtils.setTextPrimaryColor(mapActivity, tv, nightMode);<NEW_LINE>tv.setText<MASK><NEW_LINE>ch.setOnCheckedChangeListener(null);<NEW_LINE>if (rp instanceof LocalRoutingParameterGroup) {<NEW_LINE>LocalRoutingParameterGroup group = (LocalRoutingParameterGroup) rp;<NEW_LINE>AndroidUtils.setTextPrimaryColor(mapActivity, desc, nightMode);<NEW_LINE>LocalRoutingParameter selected = group.getSelected(settings);<NEW_LINE>if (selected != null) {<NEW_LINE>desc.setText(selected.getText(mapActivity));<NEW_LINE>desc.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>ch.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>if (rp.routingParameter != null && rp.routingParameter.getId().equals(GeneralRouter.USE_SHORTEST_WAY)) {<NEW_LINE>// if short route settings - it should be inverse of fast_route_mode<NEW_LINE>ch.setChecked(!settings.FAST_ROUTE_MODE.getModeValue(routingHelper.getAppMode()));<NEW_LINE>} else {<NEW_LINE>ch.setChecked(rp.isSelected(settings));<NEW_LINE>}<NEW_LINE>ch.setVisibility(View.VISIBLE);<NEW_LINE>ch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {<NEW_LINE>routingOptionsHelper.applyRoutingParameter(rp, isChecked);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>}
(rp.getText(mapActivity));
301,356
static Frame read(final int marker, final DataInput data, final int length) throws IOException {<NEW_LINE>int samplePrecision = data.readUnsignedByte();<NEW_LINE>int lines = data.readUnsignedShort();<NEW_LINE>int samplesPerLine = data.readUnsignedShort();<NEW_LINE>int componentsInFrame = data.readUnsignedByte();<NEW_LINE>int expected = 8 + componentsInFrame * 3;<NEW_LINE>if (length != expected) {<NEW_LINE>throw new IIOException(String.format("Unexpected SOF length: %d != %d", length, expected));<NEW_LINE>}<NEW_LINE>Component[] components = new Component[componentsInFrame];<NEW_LINE>for (int i = 0; i < componentsInFrame; i++) {<NEW_LINE>int id = data.readUnsignedByte();<NEW_LINE>int sub = data.readUnsignedByte();<NEW_LINE><MASK><NEW_LINE>components[i] = new Component(id, ((sub & 0xF0) >> 4), (sub & 0xF), qtSel);<NEW_LINE>}<NEW_LINE>return new Frame(marker, samplePrecision, lines, samplesPerLine, components);<NEW_LINE>}
int qtSel = data.readUnsignedByte();
184,897
public static IndexMetadata readFrom(StreamInput in) throws IOException {<NEW_LINE>Builder builder = new Builder(in.readString());<NEW_LINE>builder.version(in.readLong());<NEW_LINE>builder.mappingVersion(in.readVLong());<NEW_LINE>builder.settingsVersion(in.readVLong());<NEW_LINE>if (in.getVersion().onOrAfter(LegacyESVersion.V_7_2_0)) {<NEW_LINE>builder.aliasesVersion(in.readVLong());<NEW_LINE>} else {<NEW_LINE>builder.aliasesVersion(1);<NEW_LINE>}<NEW_LINE>builder.setRoutingNumShards(in.readInt());<NEW_LINE>builder.state(State.fromId(in.readByte()));<NEW_LINE>builder.settings(readSettingsFromStream(in));<NEW_LINE>builder.primaryTerms(in.readVLongArray());<NEW_LINE>int mappingsSize = in.readVInt();<NEW_LINE>for (int i = 0; i < mappingsSize; i++) {<NEW_LINE>MappingMetadata mappingMd = new MappingMetadata(in);<NEW_LINE>builder.putMapping(mappingMd);<NEW_LINE>}<NEW_LINE>int aliasesSize = in.readVInt();<NEW_LINE>for (int i = 0; i < aliasesSize; i++) {<NEW_LINE>AliasMetadata aliasMd = new AliasMetadata(in);<NEW_LINE>builder.putAlias(aliasMd);<NEW_LINE>}<NEW_LINE>int customSize = in.readVInt();<NEW_LINE>for (int i = 0; i < customSize; i++) {<NEW_LINE>String key = in.readString();<NEW_LINE>DiffableStringMap custom = DiffableStringMap.readFrom(in);<NEW_LINE>builder.putCustom(key, custom);<NEW_LINE>}<NEW_LINE>int inSyncAllocationIdsSize = in.readVInt();<NEW_LINE>for (int i = 0; i < inSyncAllocationIdsSize; i++) {<NEW_LINE>int key = in.readVInt();<NEW_LINE>Set<String> allocationIds = DiffableUtils.StringSetValueSerializer.getInstance().read(in, key);<NEW_LINE>builder.putInSyncAllocationIds(key, allocationIds);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < rolloverAliasesSize; i++) {<NEW_LINE>builder.putRolloverInfo(new RolloverInfo(in));<NEW_LINE>}<NEW_LINE>if (in.getVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) {<NEW_LINE>builder.system(in.readBoolean());<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
int rolloverAliasesSize = in.readVInt();
1,842,602
public Feature mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>String featUid = rs.getString(COL_FEAT_UID);<NEW_LINE>Feature f = new Feature(featUid, rs.getInt(COL_FEAT_ENABLE) > 0);<NEW_LINE>f.setDescription(rs.getString(COL_FEAT_DESCRIPTION));<NEW_LINE>f.setGroup(rs.getString(COL_FEAT_GROUPNAME));<NEW_LINE>// Build Flipping Strategy From DataBase<NEW_LINE>String strategy = rs.getString(COL_FEAT_STRATEGY);<NEW_LINE>if (strategy != null && !"".equals(strategy)) {<NEW_LINE>Map<String, String> initParams = MappingUtil.toMap(rs.getString(COL_FEAT_EXPRESSION));<NEW_LINE>FlippingStrategy flipStrategy = MappingUtil.<MASK><NEW_LINE>f.setFlippingStrategy(flipStrategy);<NEW_LINE>}<NEW_LINE>return f;<NEW_LINE>}
instanceFlippingStrategy(featUid, strategy, initParams);
1,756,943
private void inflateRoutingParameter(final LocalRoutingParameter parameter) {<NEW_LINE>if (parameter != null) {<NEW_LINE>final BottomSheetItemWithCompoundButton[] item = new BottomSheetItemWithCompoundButton[1];<NEW_LINE>BottomSheetItemWithCompoundButton.Builder <MASK><NEW_LINE>builder.setCompoundButtonColor(selectedModeColor);<NEW_LINE>int iconId = -1;<NEW_LINE>if (parameter.routingParameter != null || parameter instanceof RoutingOptionsHelper.OtherLocalRoutingParameter) {<NEW_LINE>builder.setTitle(parameter.getText(mapActivity));<NEW_LINE>iconId = parameter.isSelected(settings) ? parameter.getActiveIconId() : parameter.getDisabledIconId();<NEW_LINE>}<NEW_LINE>if (parameter instanceof LocalRoutingParameterGroup) {<NEW_LINE>final LocalRoutingParameterGroup group = (LocalRoutingParameterGroup) parameter;<NEW_LINE>LocalRoutingParameter selected = group.getSelected(settings);<NEW_LINE>iconId = selected != null ? parameter.getActiveIconId() : parameter.getDisabledIconId();<NEW_LINE>if (selected != null) {<NEW_LINE>builder.setTitle(group.getText(mapActivity));<NEW_LINE>builder.setDescription(selected.getText(mapActivity));<NEW_LINE>}<NEW_LINE>builder.setLayoutId(R.layout.bottom_sheet_item_with_descr_56dp);<NEW_LINE>builder.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>routingOptionsHelper.addNewRouteMenuParameter(applicationMode, parameter);<NEW_LINE>routingOptionsHelper.showLocalRoutingParameterGroupDialog(group, mapActivity, new RoutingOptionsHelper.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick() {<NEW_LINE>LocalRoutingParameter selected = group.getSelected(settings);<NEW_LINE>if (selected != null) {<NEW_LINE>item[0].setDescription(selected.getText(mapActivity));<NEW_LINE>}<NEW_LINE>updateMenu();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>builder.setLayoutId(R.layout.bottom_sheet_item_with_switch_56dp);<NEW_LINE>if (parameter.routingParameter != null && parameter.routingParameter.getId().equals(GeneralRouter.USE_SHORTEST_WAY)) {<NEW_LINE>// if short route settings - it should be inverse of fast_route_mode<NEW_LINE>builder.setChecked(!settings.FAST_ROUTE_MODE.getModeValue(applicationMode));<NEW_LINE>} else {<NEW_LINE>builder.setChecked(parameter.isSelected(settings));<NEW_LINE>}<NEW_LINE>builder.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>applyParameter(item[0], parameter);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (iconId != -1) {<NEW_LINE>builder.setIcon(getContentIcon(iconId));<NEW_LINE>}<NEW_LINE>item[0] = builder.create();<NEW_LINE>items.add(item[0]);<NEW_LINE>}<NEW_LINE>}
builder = new BottomSheetItemWithCompoundButton.Builder();
954,505
protected void createFieldEditors() {<NEW_LINE>// default launch location for scripts<NEW_LINE>addField(new RadioGroupFieldEditor(PreferenceConstants.GROOVY_SCRIPT_DEFAULT_WORKING_DIRECTORY, "Default working directory for running Groovy scripts\n (will not change the working directory of existing scripts)", 1, new String[][] { { "Eclipse home", PreferenceConstants.GROOVY_SCRIPT_ECLIPSE_HOME }, { "Project home", PreferenceConstants.GROOVY_SCRIPT_PROJECT_HOME }, { "Script location", PreferenceConstants.GROOVY_SCRIPT_SCRIPT_LOC } }, getFieldEditorParent()));<NEW_LINE>new Label(getFieldEditorParent(), SWT.NONE).setText("");<NEW_LINE>// JUnit monospace typeface<NEW_LINE>addField(new BooleanFieldEditor(PreferenceConstants.GROOVY_JUNIT_MONOSPACE_FONT, "&Use monospace font for JUnit (deprecated)", getFieldEditorParent()));<NEW_LINE>new Label(getFieldEditorParent(), SWT.LEFT | SWT.WRAP).setText(" This is particularly useful for testing with the assert keyword");<NEW_LINE>// legacy projects<NEW_LINE>IProject[] oldProjects = new ConvertLegacyProject().getAllOldProjects();<NEW_LINE>if (oldProjects.length > 0) {<NEW_LINE>new Label(getFieldEditorParent(), SWT.NONE).setText("");<NEW_LINE>Label label = new Label(getFieldEditorParent(), <MASK><NEW_LINE>label.setText("The following legacy groovy projects exist in the workspace:\n");<NEW_LINE>List oldProjectsList = new List(getFieldEditorParent(), SWT.MULTI | SWT.V_SCROLL);<NEW_LINE>oldProjectsList.setItems(Arrays.stream(oldProjects).map(IProject::getName).toArray(String[]::new));<NEW_LINE>label = new Label(getFieldEditorParent(), SWT.LEFT | SWT.WRAP);<NEW_LINE>label.setText("Select the projects to convert.");<NEW_LINE>Button button = new Button(getFieldEditorParent(), SWT.PUSH);<NEW_LINE>button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));<NEW_LINE>button.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>convertSelectedProjects(oldProjectsList.getSelection());<NEW_LINE>IProject[] oldProjects = new ConvertLegacyProject().getAllOldProjects();<NEW_LINE>oldProjectsList.setItems(Arrays.stream(oldProjects).map(IProject::getName).toArray(String[]::new));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>button.setText("Convert");<NEW_LINE>}<NEW_LINE>}
SWT.LEFT | SWT.WRAP);
460,957
public com.amazonaws.services.codecommit.model.FileModeRequiredException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codecommit.model.FileModeRequiredException fileModeRequiredException = new com.amazonaws.services.<MASK><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>} 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 fileModeRequiredException;<NEW_LINE>}
codecommit.model.FileModeRequiredException(null);
1,846,616
public void marshall(Action action, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (action == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(action.getDynamoDB(), DYNAMODB_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getDynamoDBv2(), DYNAMODBV2_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getLambda(), LAMBDA_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getSns(), SNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getSqs(), SQS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getKinesis(), KINESIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(action.getS3(), S3_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getFirehose(), FIREHOSE_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getCloudwatchMetric(), CLOUDWATCHMETRIC_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getCloudwatchAlarm(), CLOUDWATCHALARM_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getCloudwatchLogs(), CLOUDWATCHLOGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getElasticsearch(), ELASTICSEARCH_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getSalesforce(), SALESFORCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getIotAnalytics(), IOTANALYTICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getIotEvents(), IOTEVENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getIotSiteWise(), IOTSITEWISE_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getStepFunctions(), STEPFUNCTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getTimestream(), TIMESTREAM_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getHttp(), HTTP_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getKafka(), KAFKA_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getOpenSearch(), OPENSEARCH_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
action.getRepublish(), REPUBLISH_BINDING);
1,552,996
public boolean refreshTTL(RefreshOfferMessage refreshTTLMessage, @Nullable NodeAddress sender) {<NEW_LINE>try {<NEW_LINE>ByteArray hashOfPayload = new <MASK><NEW_LINE>ProtectedStorageEntry storedData = map.get(hashOfPayload);<NEW_LINE>if (storedData == null) {<NEW_LINE>log.debug("We don't have data for that refresh message in our map. That is expected if we missed the data publishing.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ProtectedStorageEntry storedEntry = map.get(hashOfPayload);<NEW_LINE>ProtectedStorageEntry updatedEntry = new ProtectedStorageEntry(storedEntry.getProtectedStoragePayload(), storedEntry.getOwnerPubKey(), refreshTTLMessage.getSequenceNumber(), refreshTTLMessage.getSignature(), this.clock);<NEW_LINE>// If we have seen a more recent operation for this payload, we ignore the current one<NEW_LINE>if (!hasSequenceNrIncreased(updatedEntry.getSequenceNumber(), hashOfPayload))<NEW_LINE>return false;<NEW_LINE>// Verify the updated ProtectedStorageEntry is well formed and valid for update<NEW_LINE>if (!updatedEntry.isValidForAddOperation())<NEW_LINE>return false;<NEW_LINE>// Update the hash map with the updated entry<NEW_LINE>map.put(hashOfPayload, updatedEntry);<NEW_LINE>// Record the latest sequence number and persist it<NEW_LINE>sequenceNumberMap.put(hashOfPayload, new MapValue(updatedEntry.getSequenceNumber(), this.clock.millis()));<NEW_LINE>requestPersistence();<NEW_LINE>// Always broadcast refreshes<NEW_LINE>broadcaster.broadcast(refreshTTLMessage, sender);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>log.error("refreshTTL failed, missing data: {}", e.toString());<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
ByteArray(refreshTTLMessage.getHashOfPayload());
450,960
public boolean flushable() throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "flushable");<NEW_LINE>// Short circuit if we've never created a stream<NEW_LINE>if (streamSet == null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "flushable", Boolean.TRUE);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>StreamSet streamSet = getStreamSet();<NEW_LINE>// iterate over the non-null streams<NEW_LINE>Iterator itr = streamSet.iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>SourceStream stream = (SourceStream) itr.next();<NEW_LINE>if (!stream.flushable()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "flushable", Boolean.FALSE);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(<MASK><NEW_LINE>return true;<NEW_LINE>}
tc, "flushable", Boolean.TRUE);
1,739,434
public void contextInitialized(ServletContextEvent event) {<NEW_LINE>ServletContext servletContext = event.getServletContext();<NEW_LINE>String contextName = servletContext.getContextPath().replaceAll("/", "");<NEW_LINE>if ("".equals(contextName)) {<NEW_LINE>contextName = "root";<NEW_LINE>}<NEW_LINE>System.out.printf("Context init: %s%n", contextName);<NEW_LINE>ConfigurableWebApplicationContext appctx = (ConfigurableWebApplicationContext) servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);<NEW_LINE>if (appctx != null) {<NEW_LINE>System.out.printf("ConfigurableWebApplicationContext is not null in ContextLoggingListener for: %s, this indicates a misconfiguration or load order problem%n", contextName);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// get the selector<NEW_LINE>ContextSelector selector = Red5LoggerFactory.getContextSelector();<NEW_LINE>// get the logger context for this servlet / app context by name<NEW_LINE>URL url = servletContext.getResource(String.format("/WEB-INF/classes/logback-%s.xml", contextName));<NEW_LINE>if (url != null && Files.exists(Paths.get(url.toURI()))) {<NEW_LINE>System.out.printf("Context logger config found: %s%n", url.toURI());<NEW_LINE>} else {<NEW_LINE>url = servletContext.getResource("/WEB-INF/classes/logback.xml");<NEW_LINE>if (url != null && Files.exists(Paths.get(url.toURI()))) {<NEW_LINE>System.out.printf("Context logger config found: %s%n", url.toURI());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// get the logger context for the servlet context<NEW_LINE>LoggerContext loggerContext = url != null ? ((LoggingContextSelector) selector).getLoggerContext(contextName, url) : selector.getLoggerContext(contextName);<NEW_LINE>// set the logger context for use elsewhere in the servlet context<NEW_LINE>servletContext.setAttribute(Red5LoggerFactory.LOGGER_CONTEXT_ATTRIBUTE, loggerContext);<NEW_LINE>// get the root logger for this context<NEW_LINE>Logger logger = Red5LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME, contextName);<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.printf("LoggingContextSelector is not the correct type: %s%n", e.getMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
logger.info("Starting up context: {}", contextName);
473,741
public static BaseOperation operation(JsonNode message) {<NEW_LINE>String type = null;<NEW_LINE>if (message.has("type")) {<NEW_LINE>type = message.get("type").asText();<NEW_LINE>}<NEW_LINE>if (type == null) {<NEW_LINE>throw new IllegalArgumentException("Couldn't create Operation, missing 'type' property: " <MASK><NEW_LINE>}<NEW_LINE>Class<? extends BaseOperation> unmarshallClass = OP_CLASSES.get(type);<NEW_LINE>if (unmarshallClass == null) {<NEW_LINE>throw new IllegalArgumentException("Couldn't create Operation, unknown type: " + type);<NEW_LINE>}<NEW_LINE>// Handle batch a bit differently.<NEW_LINE>if ("batch".equals(type)) {<NEW_LINE>final BatchOperation batchOp = batch();<NEW_LINE>if (message.has("operations")) {<NEW_LINE>JsonNode operationsNode = message.get("operations");<NEW_LINE>if (operationsNode.isArray()) {<NEW_LINE>ArrayNode array = (ArrayNode) operationsNode;<NEW_LINE>array.forEach(subop -> {<NEW_LINE>batchOp.getOperations().add(operation(subop));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return batchOp;<NEW_LINE>} else {<NEW_LINE>return JsonUtil.fromJsonToOperation(message, unmarshallClass);<NEW_LINE>}<NEW_LINE>}
+ JsonUtil.toJson(message));
801,290
static KafkaStreams buildWikipediaFeed(final String bootstrapServers, final String schemaRegistryUrl, final String stateDir) {<NEW_LINE>final Properties streamsConfiguration = new Properties();<NEW_LINE>// Give the Streams application a unique name. The name must be unique in the Kafka cluster<NEW_LINE>// against which the application is run.<NEW_LINE>streamsConfiguration.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-avro-lambda-example");<NEW_LINE>streamsConfiguration.put(StreamsConfig.CLIENT_ID_CONFIG, "wordcount-avro-lambda-example-client");<NEW_LINE>// Where to find Kafka broker(s).<NEW_LINE>streamsConfiguration.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);<NEW_LINE>// Where to find the Confluent schema registry instance(s)<NEW_LINE>streamsConfiguration.put(AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryUrl);<NEW_LINE>// Specify default (de)serializers for record keys and for record values.<NEW_LINE>streamsConfiguration.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());<NEW_LINE>streamsConfiguration.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, SpecificAvroSerde.class);<NEW_LINE>streamsConfiguration.put(StreamsConfig.STATE_DIR_CONFIG, stateDir);<NEW_LINE>streamsConfiguration.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");<NEW_LINE>// Records should be flushed every 10 seconds. This is less than the default<NEW_LINE>// in order to keep this example interactive.<NEW_LINE>streamsConfiguration.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 10 * 1000);<NEW_LINE>final Serde<String> stringSerde = Serdes.String();<NEW_LINE>final Serde<Long<MASK><NEW_LINE>final StreamsBuilder builder = new StreamsBuilder();<NEW_LINE>// read the source stream<NEW_LINE>final KStream<String, WikiFeed> feeds = builder.stream(WikipediaFeedAvroExample.WIKIPEDIA_FEED);<NEW_LINE>// aggregate the new feed counts of by user<NEW_LINE>final KTable<String, Long> aggregated = // filter out old feeds<NEW_LINE>feeds.filter(// map the user id as key<NEW_LINE>(dummy, value) -> value.getIsNew()).map(// no need to specify explicit serdes because the resulting key and value types match our default serde settings<NEW_LINE>(key, value) -> new KeyValue<>(value.getUser(), value)).groupByKey().count();<NEW_LINE>// write to the result topic, need to override serdes<NEW_LINE>aggregated.toStream().to(WikipediaFeedAvroExample.WIKIPEDIA_STATS, Produced.with(stringSerde, longSerde));<NEW_LINE>return new KafkaStreams(builder.build(), streamsConfiguration);<NEW_LINE>}
> longSerde = Serdes.Long();
1,285,929
public Object visit(SmtArrayVariable.SmtIntegerArrayVariable n, Void arg) {<NEW_LINE>String varName = n.getName();<NEW_LINE>if (!solution.containsKey(varName)) {<NEW_LINE>throw new IllegalStateException("The variable " + varName + " is not defined in the given solution");<NEW_LINE>}<NEW_LINE>Object <MASK><NEW_LINE>if (value == null) {<NEW_LINE>throw new NullPointerException("The value of variable " + varName + " cannot be null");<NEW_LINE>}<NEW_LINE>if (!(value.getClass().isArray())) {<NEW_LINE>throw new ClassCastException("The value of variable " + varName + " should be an array but found type is " + value.getClass().getName());<NEW_LINE>}<NEW_LINE>if (!(value.getClass().getComponentType().getName().equals(Long.class.getName()))) {<NEW_LINE>throw new ClassCastException("The component class of the array " + varName + " should be Long but found type is " + value.getClass().getComponentType().getName());<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
value = solution.get(varName);
377,203
public void initialize(ExtensionContext context) {<NEW_LINE>// Note: initialize could be called twice in an account migration scenario where we import and<NEW_LINE>// export to the same service provider. So just return rather than throwing if called multiple<NEW_LINE>// times.<NEW_LINE>if (initialized)<NEW_LINE>return;<NEW_LINE>TemporaryPerJobDataStore jobStore = context.getService(TemporaryPerJobDataStore.class);<NEW_LINE>HttpTransport httpTransport = context.getService(HttpTransport.class);<NEW_LINE>JsonFactory jsonFactory = context.getService(JsonFactory.class);<NEW_LINE>TransformerService transformerService = new TransformerServiceImpl();<NEW_LINE>OkHttpClient client = new OkHttpClient.Builder().build();<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>AppCredentials appCredentials;<NEW_LINE>try {<NEW_LINE>appCredentials = context.getService(AppCredentialStore.class).getAppCredentials("MICROSOFT_KEY", "MICROSOFT_SECRET");<NEW_LINE>} catch (IOException e) {<NEW_LINE>Monitor monitor = context.getMonitor();<NEW_LINE>monitor.info(() -> "Unable to retrieve Microsoft AppCredentials. Did you set MICROSOFT_KEY and MICROSOFT_SECRET?");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create the MicrosoftCredentialFactory with the given {@link AppCredentials}.<NEW_LINE>MicrosoftCredentialFactory credentialFactory = new MicrosoftCredentialFactory(httpTransport, jsonFactory, appCredentials);<NEW_LINE><MASK><NEW_LINE>ImmutableMap.Builder<String, Importer> importBuilder = ImmutableMap.builder();<NEW_LINE>importBuilder.put(CONTACTS, new MicrosoftContactsImporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>importBuilder.put(CALENDAR, new MicrosoftCalendarImporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>importBuilder.put(PHOTOS, new MicrosoftPhotosImporter(BASE_GRAPH_URL, client, mapper, jobStore, monitor, credentialFactory));<NEW_LINE>importerMap = importBuilder.build();<NEW_LINE>ImmutableMap.Builder<String, Exporter> exporterBuilder = ImmutableMap.builder();<NEW_LINE>exporterBuilder.put(CONTACTS, new MicrosoftContactsExporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>exporterBuilder.put(CALENDAR, new MicrosoftCalendarExporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>exporterBuilder.put(PHOTOS, new MicrosoftPhotosExporter(credentialFactory, jsonFactory, monitor));<NEW_LINE>exporterBuilder.put(OFFLINE_DATA, new MicrosoftOfflineDataExporter(BASE_GRAPH_URL, client, mapper));<NEW_LINE>exporterMap = exporterBuilder.build();<NEW_LINE>initialized = true;<NEW_LINE>}
Monitor monitor = context.getMonitor();
657,319
private void mergeBrowse(MBrowse browse, MBrowseCustom customBrowse) {<NEW_LINE>// Name<NEW_LINE>if (!Util.isEmpty(customBrowse.getName())) {<NEW_LINE>browse.setName(customBrowse.getName());<NEW_LINE>}<NEW_LINE>// Description<NEW_LINE>if (!Util.isEmpty(customBrowse.getDescription())) {<NEW_LINE>browse.setDescription(customBrowse.getDescription());<NEW_LINE>}<NEW_LINE>// Help<NEW_LINE>if (!Util.isEmpty(customBrowse.getHelp())) {<NEW_LINE>browse.setHelp(customBrowse.getHelp());<NEW_LINE>}<NEW_LINE>// Translation<NEW_LINE>if (!Language.isBaseLanguage(language)) {<NEW_LINE>// Name<NEW_LINE>String value = customBrowse.get_Translation(I_AD_Browse.COLUMNNAME_Name, language);<NEW_LINE>if (Util.isEmpty(value)) {<NEW_LINE>value = browse.get_Translation(I_AD_Browse.COLUMNNAME_Name, language);<NEW_LINE>}<NEW_LINE>if (!Util.isEmpty(value)) {<NEW_LINE>browse.setName(value);<NEW_LINE>}<NEW_LINE>// Description<NEW_LINE>value = customBrowse.get_Translation(I_AD_Browse.COLUMNNAME_Description, language);<NEW_LINE>if (Util.isEmpty(value)) {<NEW_LINE>value = browse.get_Translation(I_AD_Browse.COLUMNNAME_Description, language);<NEW_LINE>}<NEW_LINE>if (!Util.isEmpty(value)) {<NEW_LINE>browse.setDescription(value);<NEW_LINE>}<NEW_LINE>// Help<NEW_LINE>value = customBrowse.get_Translation(I_AD_Browse.COLUMNNAME_Help, language);<NEW_LINE>if (Util.isEmpty(value)) {<NEW_LINE>value = browse.get_Translation(I_AD_Browse.COLUMNNAME_Help, language);<NEW_LINE>}<NEW_LINE>if (!Util.isEmpty(value)) {<NEW_LINE>browse.setHelp(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Process<NEW_LINE>if (customBrowse.getAD_Process_ID() > 0) {<NEW_LINE>browse.setAD_Process_ID(customBrowse.getAD_Process_ID());<NEW_LINE>}<NEW_LINE>// Where Clause<NEW_LINE>if (!Util.isEmpty(customBrowse.getWhereClause())) {<NEW_LINE>browse.setWhereClause(customBrowse.getWhereClause());<NEW_LINE>}<NEW_LINE>// Window<NEW_LINE>if (customBrowse.getAD_Window_ID() > 0) {<NEW_LINE>browse.setAD_Window_ID(customBrowse.getAD_Window_ID());<NEW_LINE>}<NEW_LINE>// Table<NEW_LINE>if (customBrowse.getAD_Table_ID() > 0) {<NEW_LINE>browse.setAD_Table_ID(customBrowse.getAD_Table_ID());<NEW_LINE>}<NEW_LINE>// Updateable<NEW_LINE>if (!Util.isEmpty(customBrowse.getIsUpdateable())) {<NEW_LINE>browse.setIsUpdateable(customBrowse.getIsUpdateable().equals("Y"));<NEW_LINE>}<NEW_LINE>// Deleteable<NEW_LINE>if (!Util.isEmpty(customBrowse.getIsDeleteable())) {<NEW_LINE>browse.setIsDeleteable(customBrowse.getIsDeleteable().equals("Y"));<NEW_LINE>}<NEW_LINE>// Is Selected by Default<NEW_LINE>if (!Util.isEmpty(customBrowse.getIsSelectedByDefault())) {<NEW_LINE>browse.setIsSelectedByDefault(customBrowse.getIsSelectedByDefault().equals("Y"));<NEW_LINE>}<NEW_LINE>// Is Collapsible by Default<NEW_LINE>if (!Util.isEmpty(customBrowse.getIsCollapsibleByDefault())) {<NEW_LINE>browse.setIsCollapsibleByDefault(customBrowse.getIsCollapsibleByDefault().equals("Y"));<NEW_LINE>}<NEW_LINE>// Is Executed by Default<NEW_LINE>if (!Util.isEmpty(customBrowse.getIsExecutedQueryByDefault())) {<NEW_LINE>browse.setIsExecutedQueryByDefault(customBrowse.getIsExecutedQueryByDefault().equals("Y"));<NEW_LINE>}<NEW_LINE>// Show Total<NEW_LINE>if (!Util.isEmpty(customBrowse.getIsShowTotal())) {<NEW_LINE>browse.setIsShowTotal(customBrowse.getIsShowTotal<MASK><NEW_LINE>}<NEW_LINE>}
().equals("Y"));
549,446
protected String replaceBoolean(String statement) {<NEW_LINE>// try start matches<NEW_LINE>statement = statement.replaceAll(BOOLEANTRUEMATCH + "\\s*[,]", TRUE + ",");<NEW_LINE>statement = statement.replaceAll(BOOLEANFALSEMATCH + "\\s*[,]", FALSE + ",");<NEW_LINE>statement = statement.replaceAll(TIMESTAMPMATCH + "\\s*[,]", CURRENT_TIMESTAMP + ",");<NEW_LINE>// try middle matches<NEW_LINE>statement = statement.replaceAll("[,]\\s*" + BOOLEANTRUEMATCH + "\\s*[,]", "," + TRUE + ",");<NEW_LINE>statement = statement.replaceAll("[,]\\s*" + BOOLEANFALSEMATCH + <MASK><NEW_LINE>statement = statement.replaceAll("[,]\\s*" + TIMESTAMPMATCH + "\\s*[,]", "," + CURRENT_TIMESTAMP + ",");<NEW_LINE>// try end matches<NEW_LINE>statement = statement.replaceAll("[,]\\s*" + BOOLEANTRUEMATCH, "," + TRUE);<NEW_LINE>statement = statement.replaceAll("[,]\\s*" + BOOLEANFALSEMATCH, "," + FALSE);<NEW_LINE>statement = statement.replaceAll("[,]\\s*" + TIMESTAMPMATCH, "," + CURRENT_TIMESTAMP);<NEW_LINE>// try matches for updates<NEW_LINE>statement = statement.replaceAll("[=]\\s*" + BOOLEANTRUEMATCH, "=" + TRUE);<NEW_LINE>statement = statement.replaceAll("[=]\\s*" + BOOLEANFALSEMATCH, "=" + FALSE);<NEW_LINE>// remove the double backslashes - sql server does not honor backslash as an escape character<NEW_LINE>statement = statement.replaceAll(DOUBLEBACKSLASHMATCH, "\\\\");<NEW_LINE>return statement;<NEW_LINE>}
"\\s*[,]", "," + FALSE + ",");
1,606,769
public SingularityCreateResult saveDeploy(SingularityRequest request, SingularityDeployMarker deployMarker, SingularityDeploy deploy) {<NEW_LINE><MASK><NEW_LINE>LOG.info("Creating deploy {}", deployMarker);<NEW_LINE>singularityEventListener.deployHistoryEvent(new SingularityDeployUpdate(deployMarker, Optional.of(deploy), DeployEventType.STARTING, Optional.<SingularityDeployResult>empty()));<NEW_LINE>create(getDeployMarkerPath(deploy.getRequestId(), deploy.getId()), deployMarker, deployMarkerTranscoder);<NEW_LINE>final Optional<SingularityRequestDeployState> currentState = getRequestDeployState(deploy.getRequestId());<NEW_LINE>Optional<SingularityDeployMarker> activeDeploy = Optional.empty();<NEW_LINE>Optional<SingularityDeployMarker> pendingDeploy = Optional.empty();<NEW_LINE>if (request.isDeployable()) {<NEW_LINE>if (currentState.isPresent()) {<NEW_LINE>activeDeploy = currentState.get().getActiveDeploy();<NEW_LINE>}<NEW_LINE>pendingDeploy = Optional.of(deployMarker);<NEW_LINE>} else {<NEW_LINE>activeDeploy = Optional.of(deployMarker);<NEW_LINE>}<NEW_LINE>final SingularityRequestDeployState newState = new SingularityRequestDeployState(deploy.getRequestId(), activeDeploy, pendingDeploy);<NEW_LINE>return saveNewRequestDeployState(newState);<NEW_LINE>}
createDeployIfNotExists(request, deployMarker, deploy);
1,521,334
/* (non-Javadoc)<NEW_LINE>* @see org.gudy.bouncycastle.math.ec.ECPoint#twice()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ECPoint twice() {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>// Twice identity element (point at infinity) is identity<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (this.x.toBigInteger().signum() == 0) {<NEW_LINE>// if x1 == 0, then (x1, y1) == (x1, x1 + y1)<NEW_LINE>// and hence this = -this and thus 2(x1, y1) == infinity<NEW_LINE>return this.curve.getInfinity();<NEW_LINE>}<NEW_LINE>ECFieldElement.F2m lambda = (ECFieldElement.F2m) this.x.add(this.y.divide(this.x));<NEW_LINE>ECFieldElement.F2m x3 = (ECFieldElement.F2m) lambda.square().add(lambda).add(this.curve.getA());<NEW_LINE>ECFieldElement ONE = this.<MASK><NEW_LINE>ECFieldElement.F2m y3 = (ECFieldElement.F2m) this.x.square().add(x3.multiply(lambda.add(ONE)));<NEW_LINE>return new ECPoint.F2m(this.curve, x3, y3, withCompression);<NEW_LINE>}
curve.fromBigInteger(ECConstants.ONE);
559,122
public boolean isInInterval(IssueScheduleInfo schedule, IssueScheduleInfo restrictionInterval) {<NEW_LINE>if (restrictionInterval == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Calendar scheduleStart = Calendar.getInstance();<NEW_LINE>scheduleStart.setTime(schedule.getDate());<NEW_LINE>Calendar scheduleEnd = Calendar.getInstance();<NEW_LINE>scheduleEnd.setTime(schedule.getDate());<NEW_LINE>scheduleEnd.add(Calendar.DATE, schedule.getInterval());<NEW_LINE>Calendar intervalStart = Calendar.getInstance();<NEW_LINE>intervalStart.setTime(restrictionInterval.getDate());<NEW_LINE>Calendar intervaEnd = Calendar.getInstance();<NEW_LINE>intervaEnd.setTime(restrictionInterval.getDate());<NEW_LINE>intervaEnd.add(Calendar.DATE, restrictionInterval.getInterval());<NEW_LINE>boolean yearIsLower = intervalStart.get(Calendar.YEAR) < scheduleStart.get(Calendar.YEAR);<NEW_LINE>boolean start = yearIsLower ? yearIsLower : intervalStart.get(Calendar.YEAR) == scheduleStart.get(Calendar.YEAR) && intervalStart.get(Calendar.DAY_OF_YEAR) <= <MASK><NEW_LINE>boolean yearIsHigher = intervaEnd.get(Calendar.YEAR) > scheduleEnd.get(Calendar.YEAR);<NEW_LINE>boolean end = yearIsHigher ? yearIsHigher : intervaEnd.get(Calendar.YEAR) == scheduleEnd.get(Calendar.YEAR) && intervaEnd.get(Calendar.DAY_OF_YEAR) >= scheduleEnd.get(Calendar.DAY_OF_YEAR);<NEW_LINE>return start && end;<NEW_LINE>}
scheduleStart.get(Calendar.DAY_OF_YEAR);
1,242,597
private StringBuilder genQuery() {<NEW_LINE>int columnCount = 0;<NEW_LINE>StringBuilder sb = new StringBuilder(INSERT_INTO);<NEW_LINE>sb.append(keyspace + "." + cfDef.getName());<NEW_LINE>sb.append(OPEN_PARA);<NEW_LINE>Iterator<ColumnDefinition> iter = cfDef.getPartitionKeyColumnDefinitionList().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>sb.append(iter.<MASK><NEW_LINE>columnCount++;<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iter = cfDef.getClusteringKeyColumnDefinitionList().iterator();<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>sb.append(iter.next().getName());<NEW_LINE>columnCount++;<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iter = cfDef.getRegularColumnDefinitionList().iterator();<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>sb.append(iter.next().getName());<NEW_LINE>columnCount++;<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(VALUES);<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>if (i < (columnCount - 1)) {<NEW_LINE>sb.append(BIND_MARKER);<NEW_LINE>} else {<NEW_LINE>sb.append(LAST_BIND_MARKER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(CLOSE_PARA);<NEW_LINE>appendWriteOptions(sb, mutation.getTTL(), mutation.getTimestamp());<NEW_LINE>return sb;<NEW_LINE>}
next().getName());
712,461
private void showUsageView(@Nonnull UsageViewDescriptor viewDescriptor, @Nonnull Factory<UsageSearcher> factory, @Nonnull UsageInfo[] usageInfos) {<NEW_LINE>UsageViewManager viewManager = UsageViewManager.getInstance(myProject);<NEW_LINE>final PsiElement[] initialElements = viewDescriptor.getElements();<NEW_LINE>final UsageTarget[] targets = PsiElement2UsageTargetAdapter.convert(initialElements);<NEW_LINE>final Ref<Usage[]> convertUsagesRef = new Ref<>();<NEW_LINE>if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> ApplicationManager.getApplication().runReadAction(() -> convertUsagesRef.set(UsageInfo2UsageAdapter.convert(usageInfos))), "Preprocess Usages", true, myProject))<NEW_LINE>return;<NEW_LINE>if (convertUsagesRef.isNull())<NEW_LINE>return;<NEW_LINE>final Usage[] usages = convertUsagesRef.get();<NEW_LINE>final UsageViewPresentation presentation = createPresentation(viewDescriptor, usages);<NEW_LINE>if (myUsageView == null) {<NEW_LINE>myUsageView = viewManager.showUsages(<MASK><NEW_LINE>customizeUsagesView(viewDescriptor, myUsageView);<NEW_LINE>} else {<NEW_LINE>myUsageView.removeUsagesBulk(myUsageView.getUsages());<NEW_LINE>((UsageViewImpl) myUsageView).appendUsagesInBulk(Arrays.asList(usages));<NEW_LINE>}<NEW_LINE>Set<UnloadedModuleDescription> unloadedModules = computeUnloadedModulesFromUseScope(viewDescriptor);<NEW_LINE>if (!unloadedModules.isEmpty()) {<NEW_LINE>myUsageView.appendUsage(new UnknownUsagesInUnloadedModules(unloadedModules));<NEW_LINE>}<NEW_LINE>}
targets, usages, presentation, factory);
1,377,706
private void printCateFeatureInfo(StringBuilder sb) {<NEW_LINE>HashMap<Object, HashMap<Object, HashMap<Object, Double>>> cateFeaInfo = getCategoryFeatureInfo();<NEW_LINE>if (cateFeaInfo.size() == 0) {<NEW_LINE>sb.append("There is no category feature.\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map.Entry<Object, HashMap<Object, HashMap<Object, Double>>> featureEntry : cateFeaInfo.entrySet()) {<NEW_LINE>Object featureName = featureEntry.getKey();<NEW_LINE>Object[] featureValues = cateFeatureValue.get(featureName).toArray();<NEW_LINE>int valueNumber = featureValues.length;<NEW_LINE>String[] colName = new String[valueNumber];<NEW_LINE>for (int i = 0; i < valueNumber; i++) {<NEW_LINE>colName[i] = <MASK><NEW_LINE>}<NEW_LINE>String[] rowName = new String[labelSize];<NEW_LINE>for (int i = 0; i < labelSize; i++) {<NEW_LINE>rowName[i] = labels[i].toString();<NEW_LINE>}<NEW_LINE>Double[][] data = new Double[labelSize][valueNumber];<NEW_LINE>for (int i = 0; i < labelSize; i++) {<NEW_LINE>Arrays.fill(data[i], 0.);<NEW_LINE>Object label = labels[i];<NEW_LINE>HashMap<Object, Double> labelValue = featureEntry.getValue().get(label);<NEW_LINE>for (int j = 0; j < valueNumber; j++) {<NEW_LINE>Object featureValue = featureValues[j];<NEW_LINE>if (labelValue.containsKey(featureValue)) {<NEW_LINE>data[i][j] = labelValue.get(featureValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append("The features proportion information of " + featureName.toString() + ":\n");<NEW_LINE>String featureProportions = PrettyDisplayUtils.displayTable(data, labelSize, valueNumber, rowName, colName, null, 3, 3);<NEW_LINE>sb.append(featureProportions + "\n");<NEW_LINE>}<NEW_LINE>}
featureValues[i].toString();
1,390,735
public GSSContext validateSpnegoToken(HttpServletResponse resp, GSSCredential spnGssCredential, @Sensitive final byte[] inToken, Subject clientSubject, SpnegoConfig spnegoConfig) throws AuthenticationException {<NEW_LINE>final GSSContext <MASK><NEW_LINE>byte[] responseToken = null;<NEW_LINE>PrivilegedExceptionAction<byte[]> action = new PrivilegedExceptionAction<byte[]>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public byte[] run() throws Exception {<NEW_LINE>return gssContext.acceptSecContext(inToken, 0, inToken.length);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>responseToken = Subject.doAsPrivileged(clientSubject, action, java.security.AccessController.getContext());<NEW_LINE>} catch (PrivilegedActionException e) {<NEW_LINE>try {<NEW_LINE>throw e.getException();<NEW_LINE>} catch (Exception ee) {<NEW_LINE>throw new AuthenticationException(ee.getLocalizedMessage(), ee);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!gssContext.isEstablished()) {<NEW_LINE>String responsebytes = Krb5Util.showHex(responseToken);<NEW_LINE>Tr.error(tc, "SPNEGO_CAN_NOT_ESTABLISH_GSSCONTEXT_WITH_VALIDATE_TOKEN", new Object[] { responsebytes });<NEW_LINE>}<NEW_LINE>if (responseToken != null) {<NEW_LINE>setServerResponseToken(resp, responseToken);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "client subject: ", (clientSubject != null ? clientSubject : "is null"));<NEW_LINE>}<NEW_LINE>return gssContext;<NEW_LINE>}
gssContext = createGssContext(spnGssCredential, spnegoConfig);
663,429
private void walkJNICallInFrame(WalkState walkState) throws CorruptDataException {<NEW_LINE>J9SFJNICallInFramePointer callInFrame;<NEW_LINE>walkState.bp = walkState.arg0EA;<NEW_LINE>callInFrame = J9SFJNICallInFramePointer.cast(walkState.bp.subOffset(J9SFJNICallInFrame.SIZEOF).addOffset(UDATA.SIZEOF));<NEW_LINE>walkState.unwindSP = UDATAPointer.cast(callInFrame.subOffset(UDATA.cast(walkState.literals)));<NEW_LINE>walkState.frameFlags = callInFrame.specialFrameFlags();<NEW_LINE>printFrameType(walkState, "JNI call-in");<NEW_LINE>if ((walkState.flags & J9_STACKWALK_ITERATE_O_SLOTS) != 0) {<NEW_LINE>try {<NEW_LINE>if (!(walkState.walkSP.eq(walkState.unwindSP))) {<NEW_LINE>if (!walkState.pc.eq(walkState.walkThread.javaVM().callInReturnPC().add(3))) {<NEW_LINE>swPrintf(walkState, 0, "Error: PC should have been advanced in order to push return value, pc = {0}, cipc = {1} !!!", walkState.pc.getHexAddress(), walkState.walkThread.javaVM().callInReturnPC().getHexAddress());<NEW_LINE>}<NEW_LINE>if (walkState.frameFlags.anyBitsIn(J9_SSF_RETURNS_OBJECT)) {<NEW_LINE>swPrintf(walkState, 4, "\tObject push (return value from call-in method)");<NEW_LINE>WALK_O_SLOT(walkState, PointerPointer<MASK><NEW_LINE>} else {<NEW_LINE>swPrintf(walkState, 2, "\tCall-in return value (non-object) takes {0} slots at {1}", UDATA.cast(walkState.unwindSP).sub(UDATA.cast(walkState.walkSP)), walkState.walkSP.getHexAddress());<NEW_LINE>}<NEW_LINE>walkState.walkSP = walkState.unwindSP;<NEW_LINE>}<NEW_LINE>if (walkState.literals.notNull()) {<NEW_LINE>walkObjectPushes(walkState);<NEW_LINE>}<NEW_LINE>} catch (CorruptDataException ex) {<NEW_LINE>handleOSlotsCorruption(walkState, "StackWalker_29_V0", "walkJNICallInFrame", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (J9BuildFlags.interp_nativeSupport) {<NEW_LINE>walkState.walkedEntryLocalStorage = walkState.walkedEntryLocalStorage.oldEntryLocalStorage();<NEW_LINE>walkState.i2jState = walkState.walkedEntryLocalStorage.getAddress() != 0 ? J9I2JStatePointer.cast(walkState.walkedEntryLocalStorage.i2jStateEA()) : J9I2JStatePointer.cast(0);<NEW_LINE>swPrintf(walkState, 2, "\tNew ELS = {0}", walkState.walkedEntryLocalStorage.getHexAddress());<NEW_LINE>}<NEW_LINE>walkState.argCount = new UDATA(0);<NEW_LINE>}
.cast(walkState.walkSP));
1,116,244
public SortState sort(final Comparator<BytesRef> comp, final IntBinaryOperator tieComparator) {<NEW_LINE>final int[] orderedEntries = new int[size()];<NEW_LINE>for (int i = 0; i < orderedEntries.length; i++) {<NEW_LINE>orderedEntries[i] = i;<NEW_LINE>}<NEW_LINE>new IntroSorter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void swap(int i, int j) {<NEW_LINE>final int o = orderedEntries[i];<NEW_LINE>orderedEntries[i] = orderedEntries[j];<NEW_LINE>orderedEntries[j] = o;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected int compare(int i, int j) {<NEW_LINE>final int idx1 = orderedEntries[i], idx2 = orderedEntries[j];<NEW_LINE>setBytesRef(scratch1, scratchBytes1, idx1);<NEW_LINE>setBytesRef(scratch2, scratchBytes2, idx2);<NEW_LINE>return compare(idx1, scratchBytes1, idx2, scratchBytes2);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void setPivot(int i) {<NEW_LINE>pivotIndex = orderedEntries[i];<NEW_LINE>setBytesRef(pivotBuilder, pivot, pivotIndex);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected int comparePivot(int j) {<NEW_LINE><MASK><NEW_LINE>setBytesRef(scratch2, scratchBytes2, index);<NEW_LINE>return compare(pivotIndex, pivot, index, scratchBytes2);<NEW_LINE>}<NEW_LINE><NEW_LINE>private int compare(int i1, BytesRef b1, int i2, BytesRef b2) {<NEW_LINE>int res = comp.compare(b1, b2);<NEW_LINE>return res == 0 ? tieComparator.applyAsInt(i1, i2) : res;<NEW_LINE>}<NEW_LINE><NEW_LINE>private int pivotIndex;<NEW_LINE><NEW_LINE>private final BytesRef pivot = new BytesRef();<NEW_LINE><NEW_LINE>private final BytesRef scratchBytes1 = new BytesRef();<NEW_LINE><NEW_LINE>private final BytesRef scratchBytes2 = new BytesRef();<NEW_LINE><NEW_LINE>private final BytesRefBuilder pivotBuilder = new BytesRefBuilder();<NEW_LINE><NEW_LINE>private final BytesRefBuilder scratch1 = new BytesRefBuilder();<NEW_LINE><NEW_LINE>private final BytesRefBuilder scratch2 = new BytesRefBuilder();<NEW_LINE>}.sort(0, size());<NEW_LINE>return new SortState(orderedEntries);<NEW_LINE>}
final int index = orderedEntries[j];
406,636
public static String doHttpPut(final String url, final String requestBody) throws Exception {<NEW_LINE>try {<NEW_LINE>HttpClient client = HttpClientBuilder.create().build();<NEW_LINE>HttpPut httpPut = new HttpPut(url);<NEW_LINE>httpPut.setHeader(CONTENT_TYPE, APPLICATION_JSON);<NEW_LINE>StringEntity jsonEntity = null;<NEW_LINE>if (requestBody != null) {<NEW_LINE>jsonEntity = new StringEntity(requestBody);<NEW_LINE>}<NEW_LINE>httpPut.setEntity(jsonEntity);<NEW_LINE>HttpResponse httpresponse = client.execute(httpPut);<NEW_LINE>if (httpresponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {<NEW_LINE>return EntityUtils.toString(httpresponse.getEntity());<NEW_LINE>} else {<NEW_LINE>if (AuthManager.getToken() != null) {<NEW_LINE>String accessToken = AuthManager.getToken();<NEW_LINE>if (!Strings.isNullOrEmpty(accessToken)) {<NEW_LINE>httpPut.setHeader(PacmanSdkConstants.AUTH_HEADER, "Bearer " + accessToken);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>httpPut.setEntity(jsonEntity);<NEW_LINE>HttpResponse httpresponse1 = client.execute(httpPut);<NEW_LINE>if (httpresponse1.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {<NEW_LINE>return EntityUtils.toString(httpresponse1.getEntity());<NEW_LINE>} else {<NEW_LINE>throw new Exception("unable to execute put request caused by" + EntityUtils.toString(httpresponse1.getEntity()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ParseException parseException) {<NEW_LINE>LOGGER.error(<MASK><NEW_LINE>} catch (IOException ioException) {<NEW_LINE>LOGGER.error("IOException in getHttpPut :" + ioException.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
"ParseException in getHttpPut :" + parseException.getMessage());
1,506,117
public Observable<ServiceResponse<Integer>> addPhraseListWithServiceResponseAsync(UUID appId, String versionId, PhraselistCreateObject phraselistCreateObject) {<NEW_LINE>if (this.client.endpoint() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (appId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter appId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (versionId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter versionId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (phraselistCreateObject == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter phraselistCreateObject is required and cannot be null.");<NEW_LINE>}<NEW_LINE>Validator.validate(phraselistCreateObject);<NEW_LINE>String parameterizedHost = Joiner.on(", ").join("{Endpoint}", <MASK><NEW_LINE>return service.addPhraseList(appId, versionId, phraselistCreateObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Integer>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponse<Integer>> call(Response<ResponseBody> response) {<NEW_LINE>try {<NEW_LINE>ServiceResponse<Integer> clientResponse = addPhraseListDelegate(response);<NEW_LINE>return Observable.just(clientResponse);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Observable.error(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
this.client.endpoint());
60,549
public Object connect(String url, boolean read, boolean write, int timeout) throws IOException {<NEW_LINE>if (disconnectedMode && url.toLowerCase().startsWith("http")) {<NEW_LINE>throw new IOException("Unreachable");<NEW_LINE>}<NEW_LINE>if (url.toLowerCase().startsWith("http:")) {<NEW_LINE>if (!warnAboutHttpChecked) {<NEW_LINE>warnAboutHttpChecked = true;<NEW_LINE>Map<String, String> m = getProjectBuildHints();<NEW_LINE>if (m != null) {<NEW_LINE>String s = m.get("ios.plistInject");<NEW_LINE>if (s != null && s.contains("NSAppTransportSecurity")) {<NEW_LINE>warnAboutHttp = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (warnAboutHttp && url.indexOf("localhost") < 0 && url.indexOf("127.0.0") < 0) {<NEW_LINE>System.out.println("WARNING: Apple will no longer accept http URL connections from applications you tried to connect to " + url + " to learn more check out https://www.codenameone.com/blog/ios-http-urls.html");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>URL u = new URL(url);<NEW_LINE>URLConnection con = u.openConnection();<NEW_LINE>if (con instanceof HttpURLConnection) {<NEW_LINE>HttpURLConnection c = (HttpURLConnection) con;<NEW_LINE>c.setUseCaches(false);<NEW_LINE>c.setDefaultUseCaches(false);<NEW_LINE>c.setInstanceFollowRedirects(false);<NEW_LINE>if (timeout > -1) {<NEW_LINE>c.setConnectTimeout(timeout);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>con.setDoInput(read);<NEW_LINE>con.setDoOutput(write);<NEW_LINE>if (netMonitor != null) {<NEW_LINE>NetworkRequestObject nr = new NetworkRequestObject();<NEW_LINE>if (nr != null) {<NEW_LINE>nr.setUrl(url);<NEW_LINE>nr.<MASK><NEW_LINE>}<NEW_LINE>netMonitor.addRequest(con, nr);<NEW_LINE>}<NEW_LINE>return con;<NEW_LINE>}
setTimeSent(System.currentTimeMillis());
688,312
private void applyTransforms(PoseStack matrixStackIn, T entityIn, float partialTicks, float entityYaw) {<NEW_LINE>long i = (long) entityIn.getId() * 493286711L;<NEW_LINE>i = i * i * 4392167121L + i * 98761L;<NEW_LINE>float f = (((float) (i >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;<NEW_LINE>float f1 = (((float) (i >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;<NEW_LINE>float f2 = (((float) (i >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;<NEW_LINE>matrixStackIn.translate(f, f1, f2);<NEW_LINE>double d0 = Mth.lerp(partialTicks, entityIn.xOld, entityIn.getX());<NEW_LINE>double d1 = Mth.lerp(partialTicks, entityIn.yOld, entityIn.getY());<NEW_LINE>double d2 = Mth.lerp(partialTicks, entityIn.zOld, entityIn.getZ());<NEW_LINE>Vec3 vec3d = entityIn.getPos(d0, d1, d2);<NEW_LINE>float f3 = Mth.lerp(partialTicks, entityIn.xRotO, entityIn.xRot);<NEW_LINE>if (vec3d != null) {<NEW_LINE>Vec3 vec3d1 = entityIn.getPosOffs(d0, d1, d2, 0.3F);<NEW_LINE>Vec3 vec3d2 = entityIn.getPosOffs(d0<MASK><NEW_LINE>if (vec3d1 == null)<NEW_LINE>vec3d1 = vec3d;<NEW_LINE>if (vec3d2 == null)<NEW_LINE>vec3d2 = vec3d;<NEW_LINE>matrixStackIn.translate(vec3d.x - d0, (vec3d1.y + vec3d2.y) / 2.0D - d1, vec3d.z - d2);<NEW_LINE>Vec3 vec3d3 = vec3d2.add(-vec3d1.x, -vec3d1.y, -vec3d1.z);<NEW_LINE>if (vec3d3.length() != 0.0D) {<NEW_LINE>vec3d3 = vec3d3.normalize();<NEW_LINE>entityYaw = (float) (Math.atan2(vec3d3.z, vec3d3.x) * 180.0D / Math.PI);<NEW_LINE>f3 = (float) (Math.atan(vec3d3.y) * 73.0D);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matrixStackIn.translate(0.0D, 0.375D, 0.0D);<NEW_LINE>matrixStackIn.mulPose(Vector3f.YP.rotationDegrees(180.0F - entityYaw));<NEW_LINE>matrixStackIn.mulPose(Vector3f.ZP.rotationDegrees(-f3));<NEW_LINE>float f5 = (float) entityIn.getHurtTime() - partialTicks;<NEW_LINE>float f6 = entityIn.getDamage() - partialTicks;<NEW_LINE>if (f6 < 0.0F)<NEW_LINE>f6 = 0.0F;<NEW_LINE>if (f5 > 0.0F)<NEW_LINE>matrixStackIn.mulPose(Vector3f.XP.rotationDegrees(Mth.sin(f5) * f5 * f6 / 10.0F * (float) entityIn.getHurtDir()));<NEW_LINE>matrixStackIn.scale(-1.0F, -1.0F, 1.0F);<NEW_LINE>}
, d1, d2, -0.3F);
1,656,080
public static COSUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf) throws Exception {<NEW_LINE>String bucketName = UnderFileSystemUtils.getBucketName(uri);<NEW_LINE>Preconditions.checkArgument(conf.isSet(PropertyKey.COS_ACCESS_KEY), "Property %s is required to connect to COS", PropertyKey.COS_ACCESS_KEY);<NEW_LINE>Preconditions.checkArgument(conf.isSet(PropertyKey.COS_SECRET_KEY), "Property %s is required to connect to COS", PropertyKey.COS_SECRET_KEY);<NEW_LINE>Preconditions.checkArgument(conf.isSet(PropertyKey.COS_REGION), "Property %s is required to connect to COS", PropertyKey.COS_REGION);<NEW_LINE>Preconditions.checkArgument(conf.isSet(PropertyKey.COS_APP_ID), "Property %s is required to connect to COS", PropertyKey.COS_APP_ID);<NEW_LINE>String accessKey = conf.getString(PropertyKey.COS_ACCESS_KEY);<NEW_LINE>String secretKey = conf.getString(PropertyKey.COS_SECRET_KEY);<NEW_LINE>String regionName = conf.getString(PropertyKey.COS_REGION);<NEW_LINE>String appId = <MASK><NEW_LINE>COSCredentials cred = new BasicCOSCredentials(accessKey, secretKey);<NEW_LINE>ClientConfig clientConfig = createCOSClientConfig(regionName, conf);<NEW_LINE>COSClient client = new COSClient(cred, clientConfig);<NEW_LINE>return new COSUnderFileSystem(uri, client, bucketName, appId, conf);<NEW_LINE>}
conf.getString(PropertyKey.COS_APP_ID);
318,307
public void write(ByteBuf output, ClientWorld world, Chunk chunk) throws Exception {<NEW_LINE>output.writeInt(chunk.getX());<NEW_LINE>output.writeInt(chunk.getZ());<NEW_LINE>output.writeBoolean(chunk.isFullChunk());<NEW_LINE>Type.VAR_INT.writePrimitive(output, chunk.getBitmask());<NEW_LINE>ByteBuf buf = output<MASK><NEW_LINE>try {<NEW_LINE>for (int i = 0; i < 16; i++) {<NEW_LINE>ChunkSection section = chunk.getSections()[i];<NEW_LINE>// Section not set<NEW_LINE>if (section == null)<NEW_LINE>continue;<NEW_LINE>Types1_13.CHUNK_SECTION.write(buf, section);<NEW_LINE>section.getLight().writeBlockLight(buf);<NEW_LINE>// No sky light, we're done here.<NEW_LINE>if (!section.getLight().hasSkyLight())<NEW_LINE>continue;<NEW_LINE>section.getLight().writeSkyLight(buf);<NEW_LINE>}<NEW_LINE>buf.readerIndex(0);<NEW_LINE>Type.VAR_INT.writePrimitive(output, buf.readableBytes() + (chunk.isBiomeData() ? 1024 : 0));<NEW_LINE>output.writeBytes(buf);<NEW_LINE>} finally {<NEW_LINE>// release buffer<NEW_LINE>buf.release();<NEW_LINE>}<NEW_LINE>// Write biome data<NEW_LINE>if (chunk.isBiomeData()) {<NEW_LINE>for (int value : chunk.getBiomeData()) {<NEW_LINE>output.writeInt(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Write Block Entities<NEW_LINE>Type.NBT_ARRAY.write(output, chunk.getBlockEntities().toArray(new CompoundTag[0]));<NEW_LINE>}
.alloc().buffer();
1,148,474
protected OrderedTensorType lazyGetType() {<NEW_LINE>if (!allInputTypesPresent(2))<NEW_LINE>return null;<NEW_LINE>OrderedTensorType dataType = inputs.get(0).type().get();<NEW_LINE>OrderedTensorType indicesType = inputs.get(1).type().get();<NEW_LINE>axis = (int) attributeMap.get("axis").orElse(DoubleValue.zero).asDouble();<NEW_LINE>if (axis < 0)<NEW_LINE>axis = dataType.rank() + axis;<NEW_LINE>OrderedTensorType.Builder typeBuilder = new OrderedTensorType.Builder(resultValueType());<NEW_LINE>for (int i = 0; i < axis; ++i) {<NEW_LINE>addDimension(i, dataType.dimensions().get(i).size().orElse(-1L), typeBuilder);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < indicesType.rank(); ++i) {<NEW_LINE>addDimension(i + axis, indicesType.dimensions().get(i).size().orElse(-1L), typeBuilder);<NEW_LINE>}<NEW_LINE>for (int i = axis + 1; i < dataType.rank(); ++i) {<NEW_LINE>addDimension(i + indicesType.rank(), dataType.dimensions().get(i).size().orElse(-1L), typeBuilder);<NEW_LINE>}<NEW_LINE>inputs.<MASK><NEW_LINE>inputs.get(1).exportAsRankingFunction = true;<NEW_LINE>return typeBuilder.build();<NEW_LINE>}
get(0).exportAsRankingFunction = true;
1,439,583
private boolean execute(final ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext, final ExecuteCallback executeCallback, final SQLStatement sqlStatement, final Collection<RouteUnit> routeUnits) throws SQLException {<NEW_LINE>boolean isExceptionThrown = SQLExecutorExceptionHandler.isExceptionThrown();<NEW_LINE>JDBCExecutorCallback<Boolean> jdbcExecutorCallback = new JDBCExecutorCallback<Boolean>(metaDataContexts.getMetaData(connection.getSchema()).getResource().getDatabaseType(), sqlStatement, isExceptionThrown) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Boolean executeSQL(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {<NEW_LINE>return executeCallback.execute(sql, statement);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Optional<Boolean> getSaneResult(final SQLStatement sqlStatement) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return executor.getRegularExecutor().execute(executionGroupContext, executionContext.<MASK><NEW_LINE>}
getLogicSQL(), routeUnits, jdbcExecutorCallback);
626,627
public void exitCfa_set_associated_interface(Cfa_set_associated_interfaceContext ctx) {<NEW_LINE>Optional<String> optName = toString(ctx, ctx.name);<NEW_LINE>if (!optName.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Permitted zone names are a superset of permitted interface names, so at this point we know<NEW_LINE>// the name is a valid zone name, but it may or may not be a valid interface name.<NEW_LINE>String name = optName.get();<NEW_LINE>int line = ctx.start.getLine();<NEW_LINE>if (_c.getZones().containsKey(name)) {<NEW_LINE>_currentAddress.setAssociatedInterfaceZoneUUID(_c.getZones().get(name).getBatfishUUID());<NEW_LINE>_c.referenceStructure(FortiosStructureType.ZONE, name, FortiosStructureUsage.ADDRESS_ASSOCIATED_INTERFACE, line);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (_c.getInterfaces().containsKey(name)) {<NEW_LINE>// Zoned interfaces can't be referenced in this context<NEW_LINE>ImmutableSet<String> zonedIfaceNames = _c.getZones().values().stream().map(Zone::getInterface).flatMap(Collection::stream).collect(ImmutableSet.toImmutableSet());<NEW_LINE>if (zonedIfaceNames.contains(name)) {<NEW_LINE>warn(ctx, "Cannot reference zoned interface " + name);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>_currentAddress.setAssociatedInterface(name);<NEW_LINE>_c.referenceStructure(FortiosStructureType.INTERFACE, name, FortiosStructureUsage.ADDRESS_ASSOCIATED_INTERFACE, line);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>_c.undefined(FortiosStructureType.INTERFACE_OR_ZONE, name, FortiosStructureUsage.ADDRESS_ASSOCIATED_INTERFACE, line);<NEW_LINE>}
warn(ctx, "No interface or zone named " + name);
1,484,185
public void partialUpdate() {<NEW_LINE>// Here's a channel with some custom field data that might be useful<NEW_LINE>ChannelClient channelClient = <MASK><NEW_LINE>List<String> members = Arrays.asList("thierry", "tommaso");<NEW_LINE>Map<String, String> channelDetail = new HashMap<>();<NEW_LINE>channelDetail.put("topic", "Plants and Animals");<NEW_LINE>channelDetail.put("rating", "pg");<NEW_LINE>Map<String, Integer> userId = new HashMap<>();<NEW_LINE>userId.put("user_id", 123);<NEW_LINE>Map<String, Object> extraData = new HashMap<>();<NEW_LINE>extraData.put("source", "user");<NEW_LINE>extraData.put("source_detail", userId);<NEW_LINE>extraData.put("channel_detail", channelDetail);<NEW_LINE>channelClient.create(members, extraData).execute();<NEW_LINE>// let's change the source of this channel<NEW_LINE>Map<String, Object> setField = Collections.singletonMap("source", "system");<NEW_LINE>channelClient.updatePartial(setField, emptyList()).execute();<NEW_LINE>// since it's system generated we no longer need source_detail<NEW_LINE>List<String> unsetField = Collections.singletonList("source_detail");<NEW_LINE>channelClient.updatePartial(emptyMap(), unsetField).execute();<NEW_LINE>// and finally update one of the nested fields in the channel_detail<NEW_LINE>Map<String, Object> setNestedField = Collections.singletonMap("channel_detail.topic", "Nature");<NEW_LINE>channelClient.updatePartial(setNestedField, emptyList()).execute();<NEW_LINE>// and maybe we decide we no longer need a rating<NEW_LINE>List<String> unsetNestedField = Collections.singletonList("channel_detail.rating");<NEW_LINE>channelClient.updatePartial(emptyMap(), unsetNestedField).execute();<NEW_LINE>}
client.channel("messaging", "general");
1,056,263
public void deleteFromBlackList(MethodCall methodCall, final MethodChannel.Result result) {<NEW_LINE>List<String> userIDList = CommonUtil.<MASK><NEW_LINE>V2TIMManager.getFriendshipManager().deleteFromBlackList(userIDList, new V2TIMValueCallback<List<V2TIMFriendOperationResult>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int i, String s) {<NEW_LINE>CommonUtil.returnError(result, i, s);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(List<V2TIMFriendOperationResult> v2TIMFriendOperationResults) {<NEW_LINE>LinkedList<HashMap<String, Object>> list = new LinkedList<HashMap<String, Object>>();<NEW_LINE>for (int i = 0; i < v2TIMFriendOperationResults.size(); i++) {<NEW_LINE>list.add(CommonUtil.convertV2TIMFriendOperationResultToMap(v2TIMFriendOperationResults.get(i)));<NEW_LINE>}<NEW_LINE>CommonUtil.returnSuccess(result, list);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getParam(methodCall, result, "userIDList");
1,422,662
public void saveDownloadList(File file) {<NEW_LINE>int count = downloads.size();<NEW_LINE>BufferedWriter writer = null;<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<NEW_LINE>String newLine = System.getProperty("line.separator");<NEW_LINE>try {<NEW_LINE>writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8")));<NEW_LINE>writer.write(count + "");<NEW_LINE>writer.newLine();<NEW_LINE>Iterator<String> keyIterator = downloads.keySet().iterator();<NEW_LINE>while (keyIterator.hasNext()) {<NEW_LINE>String key = keyIterator.next();<NEW_LINE>DownloadEntry ent = downloads.get(key);<NEW_LINE>int c = 0;<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("id: " + <MASK><NEW_LINE>c++;<NEW_LINE>sb.append("file: " + ent.getFile() + newLine);<NEW_LINE>c++;<NEW_LINE>sb.append("category: " + ent.getCategory() + newLine);<NEW_LINE>c++;<NEW_LINE>sb.append("state: " + ent.getState() + newLine);<NEW_LINE>c++;<NEW_LINE>if (ent.getFolder() != null) {<NEW_LINE>sb.append("folder: " + ent.getFolder() + newLine);<NEW_LINE>c++;<NEW_LINE>}<NEW_LINE>sb.append("date: " + dateFormat.format(new Date(ent.getDate())) + newLine);<NEW_LINE>c++;<NEW_LINE>sb.append("downloaded: " + ent.getDownloaded() + newLine);<NEW_LINE>c++;<NEW_LINE>sb.append("size: " + ent.getSize() + newLine);<NEW_LINE>c++;<NEW_LINE>sb.append("progress: " + ent.getProgress() + newLine);<NEW_LINE>c++;<NEW_LINE>if (ent.getTempFolder() != null) {<NEW_LINE>sb.append("tempfolder: " + ent.getTempFolder() + newLine);<NEW_LINE>c++;<NEW_LINE>}<NEW_LINE>if (ent.getQueueId() != null) {<NEW_LINE>sb.append("queueid: " + ent.getQueueId() + newLine);<NEW_LINE>c++;<NEW_LINE>}<NEW_LINE>sb.append("formatIndex: " + ent.getOutputFormatIndex() + newLine);<NEW_LINE>c++;<NEW_LINE>writer.write(c + newLine);<NEW_LINE>writer.write(sb.toString());<NEW_LINE>}<NEW_LINE>writer.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>try {<NEW_LINE>if (writer != null)<NEW_LINE>writer.close();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ent.getId() + newLine);
643,332
public void marshall(ListStudioLifecycleConfigsRequest listStudioLifecycleConfigsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listStudioLifecycleConfigsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getNameContains(), NAMECONTAINS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getAppTypeEquals(), APPTYPEEQUALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getCreationTimeBefore(), CREATIONTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getCreationTimeAfter(), CREATIONTIMEAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getModifiedTimeBefore(), MODIFIEDTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getModifiedTimeAfter(), MODIFIEDTIMEAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getSortBy(), SORTBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(listStudioLifecycleConfigsRequest.getSortOrder(), SORTORDER_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
listStudioLifecycleConfigsRequest.getMaxResults(), MAXRESULTS_BINDING);
138,296
public void open(Configuration parameters) throws Exception {<NEW_LINE>size = 1;<NEW_LINE>if (hasGroupType) {<NEW_LINE>List<Tuple2<Object, Integer>> types = getRuntimeContext().getBroadcastVariable("w2vGroupTypes");<NEW_LINE>for (Tuple2<Object, Integer> type : types) {<NEW_LINE>typeMap.put(type.f0, type.f1);<NEW_LINE>}<NEW_LINE>size = typeMap.size();<NEW_LINE>}<NEW_LINE>List<Tuple2<Integer, long[]>> instVocabSizeList = getRuntimeContext().getBroadcastVariable("w2vInstVocabSize");<NEW_LINE>LOG.info("w2vInstVocabSize: {}", JsonConverter.gson.toJson(instVocabSizeList));<NEW_LINE>int instId = getRuntimeContext().getIndexOfThisSubtask();<NEW_LINE>isFirstPartition = (0 == instId);<NEW_LINE>startIdx = new long[size];<NEW_LINE>totalCountIdx = new long[size];<NEW_LINE>long[] cumCountIdx = new long[size];<NEW_LINE>for (Tuple2<Integer, long[]> instVocabSize : instVocabSizeList) {<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>if (instVocabSize.f0 < instId) {<NEW_LINE>startIdx[i] += instVocabSize.f1[i];<NEW_LINE>}<NEW_LINE>totalCountIdx[i] += instVocabSize.f1[i];<NEW_LINE>if (i == 0) {<NEW_LINE>cumCountIdx[i] = totalCountIdx[i];<NEW_LINE>} else {<NEW_LINE>cumCountIdx[i] = cumCountIdx[i - 1] + totalCountIdx[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 1; i < size; ++i) {<NEW_LINE>startIdx[i] += cumCountIdx[i - 1];<NEW_LINE>}<NEW_LINE>List<Tuple2<Integer, double[]>> weightInstSumList = getRuntimeContext().getBroadcastVariable("w2vWeightInstSum");<NEW_LINE>weightStart = new double[size];<NEW_LINE>weightTotal = new double[size];<NEW_LINE>curWeightTotal = new double[size];<NEW_LINE>for (Tuple2<Integer, double[]> weightInstSum : weightInstSumList) {<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>if (weightInstSum.f0 < instId) {<NEW_LINE>weightStart[i<MASK><NEW_LINE>}<NEW_LINE>weightTotal[i] += weightInstSum.f1[i];<NEW_LINE>if (weightInstSum.f0 == instId) {<NEW_LINE>curWeightTotal[i] = weightInstSum.f1[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] += weightInstSum.f1[i];
1,272,179
public void run(RegressionEnvironment env) {<NEW_LINE>sendCurrentTime(env, "2002-02-01T09:00:00.000");<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE><MASK><NEW_LINE>env.compileDeploy("@name('s0') context MyCtx select * from SupportBean", path).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean_S1(1));<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>env.milestone(1);<NEW_LINE>sendCurrentTimeWithMinus(env, "2002-03-01T09:00:00.000", 1);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>env.milestone(2);<NEW_LINE>sendCurrentTime(env, "2002-03-01T09:00:00.000");<NEW_LINE>env.sendEventBean(new SupportBean("E3", 3));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>}
env.compileDeploy("@public create context MyCtx start SupportBean_S1 end after 1 month", path);
1,020,733
protected void reflectTabChangeToUrl(boolean userOriginated) {<NEW_LINE>if (!userOriginated) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Component selectedTab = tabbedContainer.getTabSheetBehaviour().getSelectedTab();<NEW_LINE>if (selectedTab == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Window selectedWindow = ((TabWindowContainer) selectedTab).getBreadCrumbs().getCurrentWindow();<NEW_LINE>WebWindow webWindow = (WebWindow) selectedWindow;<NEW_LINE>NavigationState resolvedState = webWindow.getResolvedState();<NEW_LINE>if (resolvedState != null) {<NEW_LINE>int stateMark = generateUrlStateMark();<NEW_LINE>NavigationState newState = new NavigationState(resolvedState.getRoot(), String.valueOf(stateMark), resolvedState.getNestedRoute(), resolvedState.getParams());<NEW_LINE>webWindow.setResolvedState(newState);<NEW_LINE>Screen screen = selectedWindow.getFrameOwner();<NEW_LINE>UrlRouting urlRouting = UiControllerUtils.<MASK><NEW_LINE>urlRouting.pushState(screen, newState.getParams());<NEW_LINE>}<NEW_LINE>}
getScreenContext(screen).getUrlRouting();
94,752
public Node writeDescriptor(Node parent, String nodeName, JMSConnectionFactoryDefinitionDescriptor desc) {<NEW_LINE>Node node = appendChild(parent, nodeName);<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_DESCRIPTION, desc.getDescription());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_NAME, desc.getName());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_INTERFACE_NAME, desc.getInterfaceName());<NEW_LINE>appendTextChild(node, TagNames.<MASK><NEW_LINE>// change the resource adapter name from internal format to standard format<NEW_LINE>String resourceAdapter = desc.getResourceAdapter();<NEW_LINE>if (resourceAdapter != null) {<NEW_LINE>int poundIndex = resourceAdapter.indexOf('#');<NEW_LINE>if (poundIndex > 0) {<NEW_LINE>// the internal format of resource adapter name is "appName#raName", remove the appName part<NEW_LINE>resourceAdapter = resourceAdapter.substring(poundIndex);<NEW_LINE>} else if (poundIndex == 0) {<NEW_LINE>// the resource adapter name should not be the standard format "#raName" here<NEW_LINE>DOLUtils.getDefaultLogger().log(Level.WARNING, RESOURCE_ADAPTER_NAME_INVALID, new Object[] { desc.getName(), desc.getResourceAdapter() });<NEW_LINE>} else {<NEW_LINE>// the resource adapter name represent the standalone RA in this case.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_RESOURCE_ADAPTER, resourceAdapter);<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_USER, desc.getUser());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_PASSWORD, desc.getPassword());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_CLIENT_ID, desc.getClientId());<NEW_LINE>ResourcePropertyNode propertyNode = new ResourcePropertyNode();<NEW_LINE>propertyNode.writeDescriptor(node, desc);<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_TRANSACTIONAL, String.valueOf(desc.isTransactional()));<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_MAX_POOL_SIZE, desc.getMaxPoolSize());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_MIN_POOL_SIZE, desc.getMinPoolSize());<NEW_LINE>return node;<NEW_LINE>}
JMS_CONNECTION_FACTORY_CLASS_NAME, desc.getClassName());
940,053
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<UUID> perms = new ArrayList<>();<NEW_LINE>filter.add(<MASK><NEW_LINE>for (UUID playerId : game.getOpponents(source.getControllerId())) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player != null) {<NEW_LINE>TargetPermanent target = new TargetPermanent(1, 1, filter, true);<NEW_LINE>if (target.canChoose(player.getId(), source, game)) {<NEW_LINE>player.chooseTarget(Outcome.Sacrifice, target, source, game);<NEW_LINE>perms.addAll(target.getTargets());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (UUID permID : perms) {<NEW_LINE>Permanent permanent = game.getPermanent(permID);<NEW_LINE>if (permanent != null) {<NEW_LINE>permanent.sacrifice(source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (UUID playerId : game.getOpponents(source.getControllerId())) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player != null) {<NEW_LINE>player.discardOne(false, false, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filterCard);<NEW_LINE>if (target.canChoose(source.getControllerId(), source, game) && controller.choose(Outcome.ReturnToHand, target, source, game)) {<NEW_LINE>Card card = game.getCard(target.getFirstTarget());<NEW_LINE>if (card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>controller.moveCards(card, Zone.HAND, source, game);<NEW_LINE>}<NEW_LINE>controller.drawCards(1, source, game);<NEW_LINE>return true;<NEW_LINE>}
TargetController.YOU.getControllerPredicate());
784,864
public static AutomaticDependencies parse(URL[] urls) throws SAXException, IOException {<NEW_LINE>LOG.log(Level.FINE, "Parsing automatic dependencies {0}", Arrays.asList(urls));<NEW_LINE>AutomaticDependencies h = new AutomaticDependencies();<NEW_LINE>Parser p = new Parser(h.new Handler());<NEW_LINE>for (URL url : urls) {<NEW_LINE>String id = url.toExternalForm();<NEW_LINE>InputStream inS = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>inS = new BufferedInputStream(url.openStream());<NEW_LINE>is.setByteStream(inS);<NEW_LINE>p.parse(is);<NEW_LINE>} catch (SAXException e) {<NEW_LINE>throw new SAXException("While parsing: " + id, e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>IOException exc = new IOException("While parsing: " + id);<NEW_LINE>exc.initCause(e);<NEW_LINE>throw exc;<NEW_LINE>} finally {<NEW_LINE>if (inS != null) {<NEW_LINE>inS.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return h;<NEW_LINE>}
InputSource is = new InputSource(id);
426,537
public Object listStates(HttpServletRequest request) {<NEW_LINE>String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);<NEW_LINE>JSONObject result = new JSONObject();<NEW_LINE>int page = Integer.parseInt(WebUtils.required(request, "pageNo"));<NEW_LINE>int pageSize = Integer.parseInt(WebUtils.required(request, "pageSize"));<NEW_LINE>String keyword = WebUtils.optional(request, "keyword", StringUtils.EMPTY);<NEW_LINE>String containedInstance = WebUtils.optional(request, "instance", StringUtils.EMPTY);<NEW_LINE>List<RaftPeer> raftPeerLists = new ArrayList<>();<NEW_LINE>int total = serviceManager.getPagedClusterState(namespaceId, page - 1, pageSize, keyword, containedInstance, raftPeerLists, raftPeerSet);<NEW_LINE>if (CollectionUtils.isEmpty(raftPeerLists)) {<NEW_LINE>result.put("clusterStateList", Collections.emptyList());<NEW_LINE>result.put("count", 0);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>JSONArray clusterStateJsonArray = new JSONArray();<NEW_LINE>for (RaftPeer raftPeer : raftPeerLists) {<NEW_LINE>ClusterStateView clusterStateView = new ClusterStateView();<NEW_LINE>clusterStateView.setClusterTerm(raftPeer.term.intValue());<NEW_LINE>clusterStateView.setNodeIp(raftPeer.ip);<NEW_LINE>clusterStateView.setNodeState(raftPeer.state.name());<NEW_LINE>clusterStateView.setVoteFor(raftPeer.voteFor);<NEW_LINE>clusterStateView.setHeartbeatDueMs(raftPeer.heartbeatDueMs);<NEW_LINE>clusterStateView.setLeaderDueMs(raftPeer.leaderDueMs);<NEW_LINE>clusterStateJsonArray.add(clusterStateView);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>result.put("count", total);<NEW_LINE>return result;<NEW_LINE>}
result.put("clusterStateList", clusterStateJsonArray);
259,698
// fetch All Radio Maps except from current floor(floor_number)<NEW_LINE>private void fetchAllRadioMaps(final int index) {<NEW_LINE>if (build.getFloors() != null) {<NEW_LINE>if (index < build.getFloors().size()) {<NEW_LINE>FloorModel f = build.getFloors().get(index);<NEW_LINE>AsyncTask<Void, Void, String> task = new DownloadRadioMapTaskBuid(new DownloadRadioMapTaskBuid.DownloadRadioMapListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(String result) {<NEW_LINE>l.onProgressUpdate(progress_current++, progress_total);<NEW_LINE>fetchAllRadioMaps(index + 1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorOrCancel(String result) {<NEW_LINE>status = Status.STOPPED;<NEW_LINE>l.onErrorOrCancel(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPrepareLongExecute() {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>}<NEW_LINE>}, MyApplication.getAppContext(), build.getLatitudeString(), build.getLongitudeString(), build.buid, f.floor_number, false);<NEW_LINE>int currentapiVersion = android.os.Build.VERSION.SDK_INT;<NEW_LINE>if (currentapiVersion >= android.os.Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>// Execute task parallel with others<NEW_LINE>currentTask = task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>} else {<NEW_LINE>currentTask = task.execute();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>status = Status.SUCCESS;<NEW_LINE>l.onSuccess("Finished loading building");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>l.onErrorOrCancel("Fetch Floor Plans Error", error);<NEW_LINE>}<NEW_LINE>}
result, BackgroundFetchListener.ErrorType.EXCEPTION);
1,828,388
private boolean isIatValid(JSONObject jobj, OidcClientConfig clientConfig, OidcClientRequest oidcClientRequest) {<NEW_LINE>Date currentDate = new Date();<NEW_LINE>Long iat = 0L;<NEW_LINE>if (jobj.get("iat") != null && (iat = getLong(jobj.get("iat"))) != null) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.<MASK><NEW_LINE>}<NEW_LINE>if (!checkIssueatTime(iat, currentDate, clientConfig.getClockSkewInSeconds(), clientConfig, oidcClientRequest)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (clientConfig.requireIatClaimForIntrospection()) {<NEW_LINE>// required field<NEW_LINE>logError(clientConfig, oidcClientRequest, "PROPAGATION_TOKEN_MISSING_REQUIRED_CLAIM_ERR", "iat", "iss, iat, exp");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
debug(tc, "iat = ", iat);
1,697,695
private org.w3c.dom.Node storeCompoundBorder(org.w3c.dom.Document doc) {<NEW_LINE>try {<NEW_LINE>org.w3c.dom.Element <MASK><NEW_LINE>FormProperty prop;<NEW_LINE>// NOI18N<NEW_LINE>prop = (FormProperty) borderSupport.getPropertyOfName("outsideBorder");<NEW_LINE>if (prop != null && prop.isChanged())<NEW_LINE>writeProperty(ATTR_OUTSIDE, prop, el, doc);<NEW_LINE>// NOI18N<NEW_LINE>prop = (FormProperty) borderSupport.getPropertyOfName("insideBorder");<NEW_LINE>if (prop != null && prop.isChanged())<NEW_LINE>writeProperty(ATTR_INSIDE, prop, el, doc);<NEW_LINE>org.w3c.dom.Node nod = createBorderInfoNode(doc, ID_BI_COMPOUND);<NEW_LINE>nod.appendChild(el);<NEW_LINE>return nod;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// should not happen<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
el = doc.createElement(XML_COMPOUND_BORDER);
1,538,674
private static String formatLink(String text, String link) {<NEW_LINE>link = link == null ? "" : link;<NEW_LINE>text = text == null ? "" : text;<NEW_LINE>final String formattedLink;<NEW_LINE>final Matcher linkMatch = Patterns.WEB_URL.matcher(link.trim());<NEW_LINE>if (linkMatch.matches() && !link.trim().matches("\\s") && !text.trim().matches("\\s")) {<NEW_LINE>// Get a resonable default text if one is not present. group 4 is the domain name<NEW_LINE>try {<NEW_LINE>text = TextUtils.isEmpty(text) ? linkMatch.group(4).replaceAll("\\.$", "") : text;<NEW_LINE>} catch (IllegalStateException | IndexOutOfBoundsException e) {<NEW_LINE>text = "";<NEW_LINE>}<NEW_LINE>link = <MASK><NEW_LINE>formattedLink = String.format("[%s](%s )", text.trim().replace("[", "\\[").replace("]", "\\]"), link.trim().replace("(", "\\(").replace(")", "\\)"));<NEW_LINE>} else {<NEW_LINE>formattedLink = text + " " + link;<NEW_LINE>}<NEW_LINE>return formattedLink;<NEW_LINE>}
link.replaceAll("(?m)(?<=&|\\?)(utm_|source|__mk_|ref|sprefix|crid|partner|promo).*?(&|$|\\s|\\))", "");
170,022
final GetExpenseAnalysisResult executeGetExpenseAnalysis(GetExpenseAnalysisRequest getExpenseAnalysisRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getExpenseAnalysisRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetExpenseAnalysisRequest> request = null;<NEW_LINE>Response<GetExpenseAnalysisResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetExpenseAnalysisRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getExpenseAnalysisRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetExpenseAnalysis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetExpenseAnalysisResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetExpenseAnalysisResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Textract");
1,603,106
public ByteBuffer asByteBuffer() {<NEW_LINE>int spsPpsSize = 0;<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {<NEW_LINE>spsPpsSize += len + bytes.limit();<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {<NEW_LINE>spsPpsSize += len + bytes.limit();<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getPictureParameterSets()) {<NEW_LINE>spsPpsSize += len + bytes.limit();<NEW_LINE>}<NEW_LINE>ByteBuffer data = ByteBuffer.allocate(l2i(orignalSample.getSize()) + spsPpsSize);<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {<NEW_LINE>IsoTypeWriterVariable.write(bytes.limit(), data, len);<NEW_LINE>data.put(bytes);<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {<NEW_LINE>IsoTypeWriterVariable.write(bytes.limit(), data, len);<NEW_LINE>data.put(bytes);<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getPictureParameterSets()) {<NEW_LINE>IsoTypeWriterVariable.write(bytes.<MASK><NEW_LINE>data.put(bytes);<NEW_LINE>}<NEW_LINE>data.put(orignalSample.asByteBuffer());<NEW_LINE>return (ByteBuffer) ((Buffer) data).rewind();<NEW_LINE>}
limit(), data, len);
815,296
public DiscordantPairEvidence decode(final Reader<DiscordantPairEvidence> reader) throws IOException {<NEW_LINE>if (!versionChecked) {<NEW_LINE>if (!DiscordantPairEvidence.BCI_VERSION.equals(reader.getVersion())) {<NEW_LINE>throw new UserException("baf.bci file has wrong version: expected " + DiscordantPairEvidence.BCI_VERSION + <MASK><NEW_LINE>}<NEW_LINE>versionChecked = true;<NEW_LINE>}<NEW_LINE>final DataInputStream dis = reader.getStream();<NEW_LINE>final String sample = reader.getSampleNames().get(dis.readInt());<NEW_LINE>final SAMSequenceDictionary dict = reader.getDictionary();<NEW_LINE>final String startContig = dict.getSequence(dis.readInt()).getSequenceName();<NEW_LINE>final int start = dis.readInt();<NEW_LINE>final boolean startStrand = dis.readBoolean();<NEW_LINE>final String endContig = dict.getSequence(dis.readInt()).getSequenceName();<NEW_LINE>final int end = dis.readInt();<NEW_LINE>final boolean endStrand = dis.readBoolean();<NEW_LINE>return new DiscordantPairEvidence(sample, startContig, start, startStrand, endContig, end, endStrand);<NEW_LINE>}
" but found " + reader.getVersion());
639,601
final ListBackupSelectionsResult executeListBackupSelections(ListBackupSelectionsRequest listBackupSelectionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBackupSelectionsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBackupSelectionsRequest> request = null;<NEW_LINE>Response<ListBackupSelectionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBackupSelectionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBackupSelectionsRequest));<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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBackupSelections");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBackupSelectionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListBackupSelectionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,835,364
final InferSNOMEDCTResult executeInferSNOMEDCT(InferSNOMEDCTRequest inferSNOMEDCTRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(inferSNOMEDCTRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<InferSNOMEDCTRequest> request = null;<NEW_LINE>Response<InferSNOMEDCTResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new InferSNOMEDCTRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(inferSNOMEDCTRequest));<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, "ComprehendMedical");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "InferSNOMEDCT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<InferSNOMEDCTResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new InferSNOMEDCTResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
808,198
public void encodeValues(Buffer valueBuffer, List<JoinActiveTraceBo> joinActiveTraceBoList) {<NEW_LINE>if (CollectionUtils.isEmpty(joinActiveTraceBoList)) {<NEW_LINE>throw new IllegalArgumentException("JoinActiveTraceBoList must not be empty");<NEW_LINE>}<NEW_LINE>final int numValues = joinActiveTraceBoList.size();<NEW_LINE>valueBuffer.putVInt(numValues);<NEW_LINE>List<Long> timestamps = new ArrayList<>(numValues);<NEW_LINE>UnsignedShortEncodingStrategy.Analyzer.Builder versionAnalyzerBuilder = new UnsignedShortEncodingStrategy.Analyzer.Builder();<NEW_LINE>UnsignedIntegerEncodingStrategy.Analyzer.Builder schemaTypeAnalyzerBuilder = new UnsignedIntegerEncodingStrategy.Analyzer.Builder();<NEW_LINE>JoinIntFieldStrategyAnalyzer.Builder totalCountAnalyzerBuilder = new JoinIntFieldStrategyAnalyzer.Builder();<NEW_LINE>for (JoinActiveTraceBo joinActiveTraceBo : joinActiveTraceBoList) {<NEW_LINE>timestamps.add(joinActiveTraceBo.getTimestamp());<NEW_LINE>versionAnalyzerBuilder.addValue(joinActiveTraceBo.getVersion());<NEW_LINE>schemaTypeAnalyzerBuilder.addValue(joinActiveTraceBo.getHistogramSchemaType());<NEW_LINE>totalCountAnalyzerBuilder.addValue(joinActiveTraceBo.getTotalCountJoinValue());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>encodeDataPoints(valueBuffer, versionAnalyzerBuilder.build(), schemaTypeAnalyzerBuilder.build(), totalCountAnalyzerBuilder.build());<NEW_LINE>}
codec.encodeTimestamps(valueBuffer, timestamps);
1,094,350
final GetRecommendationPreferencesResult executeGetRecommendationPreferences(GetRecommendationPreferencesRequest getRecommendationPreferencesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRecommendationPreferencesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRecommendationPreferencesRequest> request = null;<NEW_LINE>Response<GetRecommendationPreferencesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRecommendationPreferencesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRecommendationPreferencesRequest));<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, "Compute Optimizer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRecommendationPreferences");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRecommendationPreferencesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRecommendationPreferencesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
125,459
protected void visitJspParamStart(Element jspElement) throws JspCoreException {<NEW_LINE>List specifiedStandardActionAttrs = getAttributeList(jspElement);<NEW_LINE>validateRequiredAttributes(jspElement, specifiedStandardActionAttrs, paramAttrsRequiredAttrs);<NEW_LINE>validateAttributes(specifiedStandardActionAttrs, jspElement, paramAttrNames);<NEW_LINE>ELValidator.validateRuntimeExpressions(jspElement, paramRuntimeAttrNames, java.lang.Object.class, jspConfiguration, result, context, prefixToUriMap);<NEW_LINE>validateEmptyBody(jspElement);<NEW_LINE>// expectedType Object. leave for runtime to fail if wrong type passed in.<NEW_LINE>Node parent = jspElement.getParentNode();<NEW_LINE>String parentName = jspElement.getParentNode().getLocalName();<NEW_LINE>if (parent.getNamespaceURI().equals(Constants.JSP_NAMESPACE)) {<NEW_LINE>if (parentName.equals(Constants.JSP_INCLUDE_TYPE) || parentName.equals(Constants.JSP_FORWARD_TYPE) || parentName.equals(Constants.JSP_PARAMS_TYPE) || parentName.equals(Constants.JSP_BODY_TYPE)) {<NEW_LINE>String <MASK><NEW_LINE>if (name.equals(""))<NEW_LINE>throw new JspTranslationException(jspElement, "jsp.param.name.empty");<NEW_LINE>} else<NEW_LINE>throw new JspTranslationException(jspElement, "jsp.param.invalid.parent");<NEW_LINE>} else {<NEW_LINE>throw new JspTranslationException(jspElement, "jsp.param.invalid.parent");<NEW_LINE>}<NEW_LINE>}
name = getAttributeValue(jspElement, "name");
1,076,956
private void init() throws NullPointerException {<NEW_LINE>try {<NEW_LINE>configuration = new HdfsConfiguration();<NEW_LINE>if (CommonUtils.loadKerberosConf(configuration)) {<NEW_LINE>hdfsUser = "";<NEW_LINE>}<NEW_LINE>String defaultFS = configuration.get(Constants.FS_DEFAULT_FS);<NEW_LINE>// first get key from core-site.xml hdfs-site.xml ,if null ,then try to get from properties file<NEW_LINE>// the default is the local file system<NEW_LINE>if (defaultFS.startsWith("file")) {<NEW_LINE>String defaultFSProp = PropertyUtils.getString(Constants.FS_DEFAULT_FS);<NEW_LINE>if (StringUtils.isNotBlank(defaultFSProp)) {<NEW_LINE>Map<String, String> fsRelatedProps = PropertyUtils.getPrefixedProperties("fs.");<NEW_LINE>configuration.set(Constants.FS_DEFAULT_FS, defaultFSProp);<NEW_LINE>fsRelatedProps.forEach((key, value) -> configuration.set(key, value));<NEW_LINE>} else {<NEW_LINE>logger.error("property:{} can not to be empty, please set!", Constants.FS_DEFAULT_FS);<NEW_LINE>throw new NullPointerException(String.format("property: %s can not to be empty, please set!", Constants.FS_DEFAULT_FS));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.info("get property:{} -> {}, from core-site.xml hdfs-site.xml ", Constants.FS_DEFAULT_FS, defaultFS);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(hdfsUser)) {<NEW_LINE>UserGroupInformation <MASK><NEW_LINE>ugi.doAs((PrivilegedExceptionAction<Boolean>) () -> {<NEW_LINE>fs = FileSystem.get(configuration);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>logger.warn("hdfs.root.user is not set value!");<NEW_LINE>fs = FileSystem.get(configuration);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
ugi = UserGroupInformation.createRemoteUser(hdfsUser);