idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,105,011
public int removeImageTypeOwner(ImageType imageType) throws ImageMgmtException {<NEW_LINE>final Set<ImageOwnership> currentOwners = new HashSet<>(getImageTypeOwnership<MASK><NEW_LINE>final Set<ImageOwnership> ownersToRemove = new HashSet<>(imageType.getOwnerships());<NEW_LINE>ownersToRemove.retainAll(currentOwners);<NEW_LINE>currentOwners.removeAll(ownersToRemove);<NEW_LINE>// Check if it's removing all owners<NEW_LINE>if (!(currentOwners.size() > 1)) {<NEW_LINE>throw new ImageMgmtDaoException(ErrorCode.BAD_REQUEST, "Exception while deleting " + " image owners, need greater than two owners to be present");<NEW_LINE>}<NEW_LINE>int imageTypeId = getImageTypeByName(imageType.getName()).map(BaseModel::getId).orElse(0);<NEW_LINE>if (imageTypeId < 1) {<NEW_LINE>log.error(String.format("Exception while removing owner due to invalid " + "imageTypeId: %d.", imageTypeId));<NEW_LINE>throw new ImageMgmtDaoException(ErrorCode.BAD_REQUEST, "Exception while removing " + "image owners. Invalid imageTypeId");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (final ImageOwnership imageOwnership : ownersToRemove) {<NEW_LINE>this.databaseOperator.update(DELETE_IMAGE_OWNERSHIP, imageTypeId, imageOwnership.getOwner());<NEW_LINE>}<NEW_LINE>log.info("Successfully removed owner(s) image type id :" + imageTypeId);<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>log.error("Unable to update the image type metadata", e);<NEW_LINE>handleSqlException(e);<NEW_LINE>}<NEW_LINE>return imageTypeId;<NEW_LINE>}
(imageType.getName()));
733,887
private void initialize() {<NEW_LINE>if (!(doc instanceof StyledDocument)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GuardedSectionManager mgr = GuardedSectionManager.getInstance((StyledDocument) doc);<NEW_LINE>if (mgr == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>len = doc.getLength();<NEW_LINE>int[] arr = new int[10];<NEW_LINE>int p = 0;<NEW_LINE>for (GuardedSection s : mgr.getGuardedSections()) {<NEW_LINE>if (s instanceof InteriorSection) {<NEW_LINE>InteriorSection is = (InteriorSection) s;<NEW_LINE>arr = ensureSize(arr, p + 2);<NEW_LINE>arr[p++] = is.getStartPosition().getOffset();<NEW_LINE>arr[p++] = is<MASK><NEW_LINE>// ???<NEW_LINE>arr[p++] = is.getBodyEndPosition().getOffset() + 1;<NEW_LINE>arr[p++] = is.getEndPosition().getOffset() + 1;<NEW_LINE>} else {<NEW_LINE>arr = ensureSize(arr, p);<NEW_LINE>arr[p++] = s.getStartPosition().getOffset();<NEW_LINE>arr[p++] = s.getEndPosition().getOffset() + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p == 0) {<NEW_LINE>// boundOffsets remain null for further tests.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.max = p;<NEW_LINE>this.boundOffsets = arr;<NEW_LINE>}
.getBodyStartPosition().getOffset();
1,558,488
final GetFindingResult executeGetFinding(GetFindingRequest getFindingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFindingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetFindingRequest> request = null;<NEW_LINE>Response<GetFindingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetFindingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFindingRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AccessAnalyzer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFinding");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetFindingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFindingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,011,659
private void createIORingVerts() {<NEW_LINE>float scale = 0.9f;<NEW_LINE>BoundingBox refBB = CORE_BOUNDS;<NEW_LINE>refBB = refBB.scale(scale, scale, scale);<NEW_LINE>refBB = refBB.scale(scale, 1, 1);<NEW_LINE>double offset = (HWIDTH * scale * scale) + CONNECTOR_DEPTH;<NEW_LINE>EnumFacing dir;<NEW_LINE>Vector3d trans;<NEW_LINE>VertexRotation vrot = new VertexRotation(Math.PI / 2, new Vector3d(0, 1, 0), new Vector3d(0.5, 0.5, 0.5));<NEW_LINE>VertexTranslation vtrans = new VertexTranslation(0, 0, 0);<NEW_LINE>VertexTransformComposite xform = new VertexTransformComposite(vrot, vtrans);<NEW_LINE>dir = EnumFacing.SOUTH;<NEW_LINE>trans = offsetScaled(dir, 0.5);<NEW_LINE>trans.sub(offsetScaled(dir, offset));<NEW_LINE>vtrans.set(trans);<NEW_LINE>IO_RING_VERTS.put(dir, createVerticesForDir(refBB, xform));<NEW_LINE>dir = EnumFacing.NORTH;<NEW_LINE>vrot.setAngle(Math.PI + Math.PI / 2);<NEW_LINE>trans = offsetScaled(dir, 0.5);<NEW_LINE>trans.sub(offsetScaled(dir, offset));<NEW_LINE>vtrans.set(trans);<NEW_LINE>IO_RING_VERTS.put(dir<MASK><NEW_LINE>dir = EnumFacing.EAST;<NEW_LINE>vrot.setAngle(Math.PI);<NEW_LINE>trans = offsetScaled(dir, 0.5);<NEW_LINE>trans.sub(offsetScaled(dir, offset));<NEW_LINE>vtrans.set(trans);<NEW_LINE>IO_RING_VERTS.put(dir, createVerticesForDir(refBB, xform));<NEW_LINE>dir = EnumFacing.WEST;<NEW_LINE>vrot.setAngle(0);<NEW_LINE>trans = offsetScaled(dir, 0.5);<NEW_LINE>trans.sub(offsetScaled(dir, offset));<NEW_LINE>vtrans.set(trans);<NEW_LINE>IO_RING_VERTS.put(dir, createVerticesForDir(refBB, xform));<NEW_LINE>vrot.setAxis(new Vector3d(0, 0, 1));<NEW_LINE>dir = EnumFacing.UP;<NEW_LINE>vrot.setAngle(-Math.PI / 2);<NEW_LINE>trans = offsetScaled(dir, 0.5);<NEW_LINE>trans.sub(offsetScaled(dir, offset));<NEW_LINE>vtrans.set(trans);<NEW_LINE>IO_RING_VERTS.put(dir, createVerticesForDir(refBB, xform));<NEW_LINE>dir = EnumFacing.DOWN;<NEW_LINE>vrot.setAngle(Math.PI / 2);<NEW_LINE>trans = offsetScaled(dir, 0.5);<NEW_LINE>trans.sub(offsetScaled(dir, offset));<NEW_LINE>vtrans.set(trans);<NEW_LINE>IO_RING_VERTS.put(dir, createVerticesForDir(refBB, xform));<NEW_LINE>}
, createVerticesForDir(refBB, xform));
632,720
private HttpResponse tenantInvoice(RestApi.RequestContext requestContext) {<NEW_LINE>var tenantName = TenantName.from(requestContext.pathParameters().getStringOrThrow("tenant"));<NEW_LINE>var tenant = tenants.require(tenantName, CloudTenant.class);<NEW_LINE>var invoiceId = requestContext.pathParameters().getStringOrThrow("invoice");<NEW_LINE>var format = requestContext.queryParameters().getString("format").orElse("json");<NEW_LINE>var invoice = billing.getBillsForTenant(tenant.name()).stream().filter(inv -> inv.id().value().equals(invoiceId)).findAny().<MASK><NEW_LINE>if (format.equals("json")) {<NEW_LINE>var slime = new Slime();<NEW_LINE>toSlime(slime.setObject(), invoice);<NEW_LINE>return new SlimeJsonResponse(slime);<NEW_LINE>}<NEW_LINE>if (format.equals("csv")) {<NEW_LINE>var csv = toCsv(invoice);<NEW_LINE>return new CsvResponse(CSV_INVOICE_HEADER, csv);<NEW_LINE>}<NEW_LINE>throw new RestApiException.BadRequest("Unknown format: " + format);<NEW_LINE>}
orElseThrow(RestApiException.NotFound::new);
33,342
public void registerItemSubtypes(@Nonnull ISubtypeRegistration registry) {<NEW_LINE>IIngredientSubtypeInterpreter<ItemStack> interpreter = (stack, ctx) -> ItemBrewBase.getSubtype(stack);<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.brewVial, interpreter);<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.brewFlask, interpreter);<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.incenseStick, interpreter);<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.bloodPendant, interpreter);<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.flightTiara, (stack, ctx) -> String.valueOf(ItemFlightTiara.getVariant(stack)));<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.lexicon, (stack, ctx) -> String.valueOf(ItemNBTHelper.getBoolean(stack, ItemLexicon.TAG_ELVEN_UNLOCK, false)));<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.laputaShard, (stack, ctx) -> String.valueOf(<MASK><NEW_LINE>registry.registerSubtypeInterpreter(ModItems.terraPick, (stack, ctx) -> {<NEW_LINE>if (ctx == UidContext.Recipe) {<NEW_LINE>return String.valueOf(ItemTerraPick.isTipped(stack));<NEW_LINE>}<NEW_LINE>return String.valueOf(ItemTerraPick.getLevel(stack)) + ItemTerraPick.isTipped(stack);<NEW_LINE>});<NEW_LINE>registry.registerSubtypeInterpreter(ModItems.manaTablet, (stack, ctx) -> {<NEW_LINE>int mana = IXplatAbstractions.INSTANCE.findManaItem(stack).getMana();<NEW_LINE>return String.valueOf(mana) + ItemManaTablet.isStackCreative(stack);<NEW_LINE>});<NEW_LINE>for (Item item : new Item[] { ModItems.manaRing, ModItems.manaRingGreater }) {<NEW_LINE>registry.registerSubtypeInterpreter(item, (stack, ctx) -> {<NEW_LINE>int mana = IXplatAbstractions.INSTANCE.findManaItem(stack).getMana();<NEW_LINE>return String.valueOf(mana);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
ItemLaputaShard.getShardLevel(stack)));
1,211,919
private boolean compareThreadPoolAdapterCacheConfigs(List<ThreadPoolAdapterCacheConfig> newThreadPoolAdapterCacheConfigs, List<ThreadPoolAdapterCacheConfig> oldThreadPoolAdapterCacheConfigs) {<NEW_LINE>boolean registerFlag = false;<NEW_LINE>Map<String, List<ThreadPoolAdapterState>> newThreadPoolAdapterCacheConfigMap = newThreadPoolAdapterCacheConfigs.stream().collect(Collectors.toMap(ThreadPoolAdapterCacheConfig::getMark, ThreadPoolAdapterCacheConfig::getThreadPoolAdapterStates, (k1, k2) -> k2));<NEW_LINE>Map<String, List<ThreadPoolAdapterState>> oldThreadPoolAdapterCacheConfigMap = oldThreadPoolAdapterCacheConfigs.stream().collect(Collectors.toMap(ThreadPoolAdapterCacheConfig::getMark, ThreadPoolAdapterCacheConfig::getThreadPoolAdapterStates, (k1, k2) -> k2));<NEW_LINE>for (Map.Entry<String, List<ThreadPoolAdapterState>> entry : newThreadPoolAdapterCacheConfigMap.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>List<ThreadPoolAdapterState<MASK><NEW_LINE>List<ThreadPoolAdapterState> oldValue = oldThreadPoolAdapterCacheConfigMap.get(key);<NEW_LINE>if (oldValue == null) {<NEW_LINE>registerFlag = true;<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>if (newValue.size() != oldValue.size()) {<NEW_LINE>registerFlag = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return registerFlag;<NEW_LINE>}
> newValue = entry.getValue();
242,217
final UpdateRoutingProfileConcurrencyResult executeUpdateRoutingProfileConcurrency(UpdateRoutingProfileConcurrencyRequest updateRoutingProfileConcurrencyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRoutingProfileConcurrencyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateRoutingProfileConcurrencyRequest> request = null;<NEW_LINE>Response<UpdateRoutingProfileConcurrencyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateRoutingProfileConcurrencyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateRoutingProfileConcurrencyRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateRoutingProfileConcurrency");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateRoutingProfileConcurrencyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateRoutingProfileConcurrencyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
787,741
public void printAnswers(List<CoreLabel> doc, PrintWriter pw) {<NEW_LINE>String prevAnswer = "O";<NEW_LINE>String prevClass = "";<NEW_LINE>String afterLast = "";<NEW_LINE>for (CoreLabel word : doc) {<NEW_LINE>if (!prevAnswer.equals("O") && !prevAnswer.equals(word.get(CoreAnnotations.AnswerAnnotation.class))) {<NEW_LINE>pw.print("</" + prevClass + ">");<NEW_LINE>prevClass = "";<NEW_LINE>}<NEW_LINE>pw.print(word.get(CoreAnnotations.BeforeAnnotation.class));<NEW_LINE>if (!word.get(CoreAnnotations.AnswerAnnotation.class).equals("O") && !word.get(CoreAnnotations.AnswerAnnotation.class).equals(prevAnswer)) {<NEW_LINE>if (word.get(CoreAnnotations.AnswerAnnotation.class).equalsIgnoreCase("PERSON") || word.get(CoreAnnotations.AnswerAnnotation.class).equalsIgnoreCase("ORGANIZATION") || word.get(CoreAnnotations.AnswerAnnotation.class).equalsIgnoreCase("LOCATION")) {<NEW_LINE>prevClass = "ENAMEX";<NEW_LINE>} else if (word.get(CoreAnnotations.AnswerAnnotation.class).equalsIgnoreCase("DATE") || word.get(CoreAnnotations.AnswerAnnotation.class).equalsIgnoreCase("TIME")) {<NEW_LINE>prevClass = "TIMEX";<NEW_LINE>} else if (word.get(CoreAnnotations.AnswerAnnotation.class).equalsIgnoreCase("PERCENT") || word.get(CoreAnnotations.AnswerAnnotation.class).equalsIgnoreCase("MONEY")) {<NEW_LINE>prevClass = "NUMEX";<NEW_LINE>} else {<NEW_LINE>log.info("unknown type: " + word.get(CoreAnnotations.AnswerAnnotation.class));<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>pw.print("<" + prevClass + " TYPE=\"" + word.get(CoreAnnotations.AnswerAnnotation.class) + "\">");<NEW_LINE>}<NEW_LINE>pw.print(word.get(CoreAnnotations.OriginalTextAnnotation.class));<NEW_LINE>afterLast = word.<MASK><NEW_LINE>prevAnswer = word.get(CoreAnnotations.AnswerAnnotation.class);<NEW_LINE>}<NEW_LINE>if (!prevAnswer.equals("O")) {<NEW_LINE>pw.print("</" + prevClass + ">");<NEW_LINE>prevClass = "";<NEW_LINE>}<NEW_LINE>pw.println(afterLast);<NEW_LINE>}
get(CoreAnnotations.AfterAnnotation.class);
748,196
public void run() {<NEW_LINE>String tunnelUrl = getClientParam().getClientTunnelUrl();<NEW_LINE>String tunnelSession = getClientParam().getClientTunnelSession();<NEW_LINE>try {<NEW_LINE>if (tunnelUrl != null && !tunnelUrl.isEmpty() && tunnelSession != null && !tunnelSession.isEmpty()) {<NEW_LINE>URI uri = new URI(tunnelUrl);<NEW_LINE>s_logger.info("Connect to VNC server via tunnel. url: " + tunnelUrl + ", session: " + tunnelSession);<NEW_LINE>ConsoleProxy.ensureRoute(uri.getHost());<NEW_LINE>client.connectTo(uri.getHost(), uri.getPort(), uri.getPath() + "?" + uri.getQuery(), tunnelSession, "https".equalsIgnoreCase(uri.getScheme()), getClientHostPassword());<NEW_LINE>} else {<NEW_LINE>s_logger.info("Connect to VNC server directly. host: " + getClientHostAddress(<MASK><NEW_LINE>ConsoleProxy.ensureRoute(getClientHostAddress());<NEW_LINE>client.connectTo(getClientHostAddress(), getClientHostPort(), getClientHostPassword());<NEW_LINE>}<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>s_logger.error("Unexpected exception", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>s_logger.error("Unexpected exception", e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>s_logger.error("Unexpected exception", e);<NEW_LINE>}<NEW_LINE>s_logger.info("Receiver thread stopped.");<NEW_LINE>workerDone = true;<NEW_LINE>client.getClientListener().onClientClose();<NEW_LINE>}
) + ", port: " + getClientHostPort());
1,698,486
public void optionsChanged(DebugOptions options) {<NEW_LINE>boolean debug = options.getBooleanOption(DEBUG, false);<NEW_LINE>BufferManager.VERBOSE = debug && options.getBooleanOption(BUFFER_MANAGER_DEBUG, false);<NEW_LINE>JavaBuilder.DEBUG = debug && options.getBooleanOption(BUILDER_DEBUG, false);<NEW_LINE>Compiler.DEBUG = debug && options.getBooleanOption(COMPILER_DEBUG, false);<NEW_LINE>JavaBuilder.SHOW_STATS = debug && options.getBooleanOption(BUILDER_STATS_DEBUG, false);<NEW_LINE>CompletionEngine.DEBUG = debug && options.getBooleanOption(COMPLETION_DEBUG, false);<NEW_LINE>JavaModelManager.CP_RESOLVE_VERBOSE = debug && options.getBooleanOption(CP_RESOLVE_DEBUG, false);<NEW_LINE>JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED = debug && options.getBooleanOption(CP_RESOLVE_ADVANCED_DEBUG, false);<NEW_LINE>JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE = debug && options.getBooleanOption(CP_RESOLVE_FAILURE_DEBUG, false);<NEW_LINE>DeltaProcessor.DEBUG = debug && options.getBooleanOption(DELTA_DEBUG, false);<NEW_LINE>DeltaProcessor.VERBOSE = debug && options.getBooleanOption(DELTA_DEBUG_VERBOSE, false);<NEW_LINE>SourceRangeVerifier.DEBUG = debug && options.getBooleanOption(DOM_AST_DEBUG, false);<NEW_LINE>SourceRangeVerifier.DEBUG_THROW = debug && options.getBooleanOption(DOM_AST_DEBUG_THROW, false);<NEW_LINE>SourceRangeVerifier.DEBUG |= SourceRangeVerifier.DEBUG_THROW;<NEW_LINE>RewriteEventStore.DEBUG = debug && options.getBooleanOption(DOM_REWRITE_DEBUG, false);<NEW_LINE>TypeHierarchy.DEBUG = debug && options.getBooleanOption(HIERARCHY_DEBUG, false);<NEW_LINE>JobManager.VERBOSE = debug && options.getBooleanOption(INDEX_MANAGER_DEBUG, false);<NEW_LINE>IndexManager.DEBUG = debug && options.getBooleanOption(INDEX_MANAGER_ADVANCED_DEBUG, false);<NEW_LINE>JavaModelManager.DEBUG_CLASSPATH = debug && options.getBooleanOption(JAVAMODEL_CLASSPATH, false);<NEW_LINE>JavaModelManager.DEBUG_INVALID_ARCHIVES = debug && options.getBooleanOption(JAVAMODEL_INVALID_ARCHIVES, false);<NEW_LINE>JavaModelManager.VERBOSE = debug && options.getBooleanOption(JAVAMODEL_DEBUG, false);<NEW_LINE>JavaModelCache.VERBOSE = debug && options.getBooleanOption(JAVAMODELCACHE_DEBUG, false);<NEW_LINE>JavaModelCache.DEBUG_CACHE_INSERTIONS = debug && options.getBooleanOption(JAVAMODELCACHE_INSERTIONS_DEBUG, false);<NEW_LINE>JavaModelOperation.POST_ACTION_VERBOSE = debug && options.getBooleanOption(POST_ACTION_DEBUG, false);<NEW_LINE>NameLookup.VERBOSE = debug && options.getBooleanOption(RESOLUTION_DEBUG, false);<NEW_LINE>BasicSearchEngine.VERBOSE = debug && options.getBooleanOption(SEARCH_DEBUG, false);<NEW_LINE>SelectionEngine.DEBUG = debug && options.getBooleanOption(SELECTION_DEBUG, false);<NEW_LINE>JavaModelManager.ZIP_ACCESS_VERBOSE = debug && options.getBooleanOption(ZIP_ACCESS_DEBUG, false);<NEW_LINE>SourceMapper.VERBOSE = debug && options.getBooleanOption(SOURCE_MAPPER_DEBUG_VERBOSE, false);<NEW_LINE>DefaultCodeFormatter.DEBUG = debug && options.getBooleanOption(FORMATTER_DEBUG, false);<NEW_LINE>// configure performance options<NEW_LINE>if (PerformanceStats.ENABLED) {<NEW_LINE>CompletionEngine.PERF = PerformanceStats.isEnabled(COMPLETION_PERF);<NEW_LINE>SelectionEngine.PERF = PerformanceStats.isEnabled(SELECTION_PERF);<NEW_LINE>DeltaProcessor.PERF = PerformanceStats.isEnabled(DELTA_LISTENER_PERF);<NEW_LINE>JavaModelManager.PERF_VARIABLE_INITIALIZER = PerformanceStats.isEnabled(VARIABLE_INITIALIZER_PERF);<NEW_LINE>JavaModelManager.PERF_CONTAINER_INITIALIZER = PerformanceStats.isEnabled(CONTAINER_INITIALIZER_PERF);<NEW_LINE>ReconcileWorkingCopyOperation.<MASK><NEW_LINE>}<NEW_LINE>}
PERF = PerformanceStats.isEnabled(RECONCILE_PERF);
484,748
private static Map<String, String> digestCardMsg(String msg) {<NEW_LINE>Map<String, String> prop = new HashMap<>();<NEW_LINE>if (msg.startsWith("<")) {<NEW_LINE>// xml<NEW_LINE>prop.put("type", "xml");<NEW_LINE>prop.put("serviceID", findXmlValueOrEmpty(msg, "serviceID"));<NEW_LINE>prop.put("templateID", findXmlValueOrEmpty(msg, "templateID"));<NEW_LINE>prop.put("action", findXmlValueOrEmpty(msg, "action"));<NEW_LINE>prop.put("brief", findXmlValueOrEmpty(msg, "brief"));<NEW_LINE>prop.put("name", findXmlValueOrEmpty(msg, "name"));<NEW_LINE>} else if (msg.startsWith("{")) {<NEW_LINE>// json<NEW_LINE>prop.put("type", "json");<NEW_LINE>prop.put("app", findJsonValueOrEmpty(msg, "app"));<NEW_LINE>prop.put("desc", findJsonValueOrEmpty(msg, "desc"));<NEW_LINE>prop.put("prompt", findJsonValueOrEmpty(msg, "prompt"));<NEW_LINE>prop.put("appID", findJsonValueOrEmpty(msg, "appID"));<NEW_LINE>prop.put("text", findJsonValueOrEmpty(msg, "text"));<NEW_LINE>prop.put("actionData", findJsonValueOrEmpty(msg, "actionData"));<NEW_LINE>} else {<NEW_LINE>if (msg.length() > 127) {<NEW_LINE>msg = <MASK><NEW_LINE>}<NEW_LINE>prop.put("type", "unknown");<NEW_LINE>prop.put("raw", msg);<NEW_LINE>}<NEW_LINE>return prop;<NEW_LINE>}
msg.substring(0, 127);
1,254,107
private static void adjustTypeDescriptions(Map<Class<?>, ExpandedTypeDescription> types) {<NEW_LINE>ExpandedTypeDescription pathItemTD = types.get(PathItem.class);<NEW_LINE>for (PathItem.HttpMethod m : PathItem.HttpMethod.values()) {<NEW_LINE>pathItemTD.substituteProperty(m.name().toLowerCase(), Operation.class, getter(m), setter(m));<NEW_LINE>pathItemTD.addExcludes(m.name());<NEW_LINE>}<NEW_LINE>Set.<Class<?>>of(Schema.class, ServerVariable.class).forEach(c -> {<NEW_LINE>ExpandedTypeDescription tdWithEnumeration = types.get(c);<NEW_LINE>tdWithEnumeration.substituteProperty("enum", List.class, "getEnumeration", "setEnumeration");<NEW_LINE>tdWithEnumeration.addPropertyParameters("enum", String.class);<NEW_LINE>tdWithEnumeration.addExcludes("enumeration");<NEW_LINE>});<NEW_LINE>for (ExpandedTypeDescription td : types.values()) {<NEW_LINE>if (Extensible.class.isAssignableFrom(td.getType())) {<NEW_LINE>td.addExtensions();<NEW_LINE>}<NEW_LINE>if (td.hasDefaultProperty()) {<NEW_LINE>td.substituteProperty("default", <MASK><NEW_LINE>td.addExcludes("defaultValue");<NEW_LINE>}<NEW_LINE>if (isRef(td)) {<NEW_LINE>td.addRef();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Object.class, "getDefaultValue", "setDefaultValue");
1,724,133
public void decode(FacesContext context, DataTable table) {<NEW_LINE>String clientId = table.getClientId(context);<NEW_LINE>Map<String, String> params = context.getExternalContext().getRequestParameterMap();<NEW_LINE>String sortKey = <MASK><NEW_LINE>String sortDir = params.get(clientId + "_sortDir");<NEW_LINE>String[] sortKeys = sortKey.split(",");<NEW_LINE>String[] sortOrders = sortDir.split(",");<NEW_LINE>if (sortKeys.length != sortOrders.length) {<NEW_LINE>throw new FacesException("sortKeys != sortDirs");<NEW_LINE>}<NEW_LINE>Map<String, SortMeta> sortByMap = table.getSortByAsMap();<NEW_LINE>Map<String, Integer> sortKeysIndexes = IntStream.range(0, sortKeys.length).boxed().collect(Collectors.toMap(i -> sortKeys[i], i -> i));<NEW_LINE>for (Map.Entry<String, SortMeta> entry : sortByMap.entrySet()) {<NEW_LINE>SortMeta sortMeta = entry.getValue();<NEW_LINE>if (sortMeta.isHeaderRow()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Integer index = sortKeysIndexes.get(entry.getKey());<NEW_LINE>if (index != null) {<NEW_LINE>sortMeta.setOrder(SortOrder.of(sortOrders[index]));<NEW_LINE>sortMeta.setPriority(index);<NEW_LINE>} else {<NEW_LINE>sortMeta.setOrder(SortOrder.UNSORTED);<NEW_LINE>sortMeta.setPriority(SortMeta.MIN_PRIORITY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
params.get(clientId + "_sortKey");
1,624,189
private void scheduleSyncMonitoring() {<NEW_LINE>executor.scheduleAtFixedRate(() -> {<NEW_LINE>log.debug("Running the Sync Monitoring.");<NEW_LINE>try {<NEW_LINE>for (Map.Entry<String, DruidServerHolder> e : servers.entrySet()) {<NEW_LINE>DruidServerHolder serverHolder = e.getValue();<NEW_LINE>if (!serverHolder.syncer.isOK()) {<NEW_LINE>synchronized (servers) {<NEW_LINE>// check again that server is still there and only then reset.<NEW_LINE>if (servers.containsKey(e.getKey())) {<NEW_LINE>log.makeAlert("Server[%s] is not syncing properly. Current state is [%s]. Resetting it.", serverHolder.druidServer.getName(), serverHolder.syncer.getDebugInfo()).emit();<NEW_LINE>serverRemoved(serverHolder.druidServer);<NEW_LINE>serverAdded(new DruidServer(serverHolder.druidServer.getName(), serverHolder.druidServer.getHostAndPort(), serverHolder.druidServer.getHostAndTlsPort(), serverHolder.druidServer.getMaxSize(), serverHolder.druidServer.getType(), serverHolder.druidServer.getTier(), serverHolder.druidServer.getPriority()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ex instanceof InterruptedException) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} else {<NEW_LINE>log.makeAlert(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, 1, 5, TimeUnit.MINUTES);<NEW_LINE>}
ex, "Exception in sync monitoring.").emit();
1,100,716
public void emit(SPIRVCompilationResultBuilder crb, SPIRVAssembler asm) {<NEW_LINE>Logger.traceCodeGen(Logger.BACKEND.SPIRV, "emit SPIRVOpSConvert : " + fromBits + " -> " + toBits);<NEW_LINE>SPIRVKind spirvKind = <MASK><NEW_LINE>SPIRVId type = asm.primitives.getTypePrimitive(spirvKind);<NEW_LINE>SPIRVId loadConvert = loadConvertIfNeeded(crb, asm, type, spirvKind);<NEW_LINE>SPIRVId toTypeId;<NEW_LINE>if (toBits == 64) {<NEW_LINE>toTypeId = asm.primitives.getTypePrimitive(SPIRVKind.OP_TYPE_INT_64);<NEW_LINE>} else if (toBits == 32) {<NEW_LINE>toTypeId = asm.primitives.getTypePrimitive(SPIRVKind.OP_TYPE_INT_32);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("to Type not supported: " + toBits);<NEW_LINE>}<NEW_LINE>SPIRVId result = obtainPhiValueIdIfNeeded(asm);<NEW_LINE>asm.currentBlockScope().add(new SPIRVOpSConvert(toTypeId, result, loadConvert));<NEW_LINE>asm.registerLIRInstructionValue(this, result);<NEW_LINE>}
(SPIRVKind) value.getPlatformKind();
857,614
public ClientStream newStream(final MethodDescriptor<?, ?> method, Metadata headers, final CallOptions callOptions, ClientStreamTracer[] tracers) {<NEW_LINE>CallCredentials creds = callOptions.getCredentials();<NEW_LINE>if (creds == null) {<NEW_LINE>creds = channelCallCredentials;<NEW_LINE>} else if (channelCallCredentials != null) {<NEW_LINE>creds = new CompositeCallCredentials(channelCallCredentials, creds);<NEW_LINE>}<NEW_LINE>if (creds != null) {<NEW_LINE>MetadataApplierImpl applier = new MetadataApplierImpl(delegate, method, headers, callOptions, applierListener, tracers);<NEW_LINE>if (pendingApplier.incrementAndGet() > 0) {<NEW_LINE>applierListener.onComplete();<NEW_LINE>return new FailingClientStream(shutdownStatus, tracers);<NEW_LINE>}<NEW_LINE>RequestInfo requestInfo = new RequestInfo() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public MethodDescriptor<?, ?> getMethodDescriptor() {<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SecurityLevel getSecurityLevel() {<NEW_LINE>return firstNonNull(delegate.getAttributes().get(GrpcAttributes<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getAuthority() {<NEW_LINE>return firstNonNull(callOptions.getAuthority(), authority);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Attributes getTransportAttrs() {<NEW_LINE>return delegate.getAttributes();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>creds.applyRequestMetadata(requestInfo, firstNonNull(callOptions.getExecutor(), appExecutor), applier);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>applier.fail(Status.UNAUTHENTICATED.withDescription("Credentials should use fail() instead of throwing exceptions").withCause(t));<NEW_LINE>}<NEW_LINE>return applier.returnStream();<NEW_LINE>} else {<NEW_LINE>if (pendingApplier.get() >= 0) {<NEW_LINE>return new FailingClientStream(shutdownStatus, tracers);<NEW_LINE>}<NEW_LINE>return delegate.newStream(method, headers, callOptions, tracers);<NEW_LINE>}<NEW_LINE>}
.ATTR_SECURITY_LEVEL), SecurityLevel.NONE);
1,812,158
private static long handleWeeklyRepeatAfterComplete(RRule rrule, Date original, boolean hasDueTime) {<NEW_LINE>List<WeekdayNum> byDay = rrule.getByDay();<NEW_LINE>long newDate = original.getTime();<NEW_LINE>newDate += DateUtilities.ONE_WEEK * (rrule.getInterval() - 1);<NEW_LINE>Calendar date = Calendar.getInstance();<NEW_LINE>date.setTimeInMillis(newDate);<NEW_LINE>Collections.sort(byDay, weekdayCompare);<NEW_LINE>WeekdayNum <MASK><NEW_LINE>do {<NEW_LINE>date.add(Calendar.DATE, 1);<NEW_LINE>} while (date.get(Calendar.DAY_OF_WEEK) != next.wday.javaDayNum);<NEW_LINE>long time = date.getTimeInMillis();<NEW_LINE>if (hasDueTime)<NEW_LINE>return Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, time);<NEW_LINE>else<NEW_LINE>return Task.createDueDate(Task.URGENCY_SPECIFIC_DAY, time);<NEW_LINE>}
next = findNextWeekday(byDay, date);
54,693
private void updateInternal() {<NEW_LINE>currentViewList.clear();<NEW_LINE>viewMap.clear();<NEW_LINE>// Plan to show all of the views in order to keep the order<NEW_LINE>for (TokenFilter filter : filterList) {<NEW_LINE>try {<NEW_LINE>if (filter.view.isAdmin && !MapTool.getPlayer().isGM()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>// This seems to happen when there was a problem creating the initial window. Lets just<NEW_LINE>// ignore this filter for now.<NEW_LINE>log.warn("NullPointerException encountered while trying to update TokenPanelTreeModel", e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Add in the appropriate views<NEW_LINE>List<Token> tokenList = new ArrayList<Token>();<NEW_LINE>if (zone != null) {<NEW_LINE>tokenList = zone.getAllTokens();<NEW_LINE>}<NEW_LINE>for (Token token : tokenList) {<NEW_LINE>for (TokenFilter filter : filterList) {<NEW_LINE>filter.filter(token);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clear out any view without any tokens<NEW_LINE>currentViewList.removeIf(view -> !view.isRequired() && (viewMap.get(view) == null || viewMap.get(view).size() == 0));<NEW_LINE>// Sort<NEW_LINE>for (List<Token> tokens : viewMap.values()) {<NEW_LINE>tokens.sort(NAME_AND_STATE_COMPARATOR);<NEW_LINE>}<NEW_LINE>// Keep the expanded branches consistent<NEW_LINE>Enumeration<TreePath> expandedPaths = tree.getExpandedDescendants(new TreePath(root));<NEW_LINE>// @formatter:off<NEW_LINE>fireStructureChangedEvent(new TreeModelEvent(this, new Object[] { getRoot() }, new int[] { currentViewList.size() - 1 }, new Object[] { View.TOKENS }));<NEW_LINE>// @formatter:on<NEW_LINE>while (expandedPaths != null && expandedPaths.hasMoreElements()) {<NEW_LINE>tree.expandPath(expandedPaths.nextElement());<NEW_LINE>}<NEW_LINE>}
currentViewList.add(filter.view);
1,550,475
private Instant estimatedProcessingFinishedInstant(JobStats firstRelevantJobStats, JobStats jobStats) {<NEW_LINE>if (jobStats.getSucceeded() - firstRelevantJobStats.getSucceeded() < 1)<NEW_LINE>return null;<NEW_LINE>BigDecimal durationForAmountSucceededInSeconds = valueOf(Duration.between(firstRelevantJobStats.getTimeStamp(), jobStats.getTimeStamp<MASK><NEW_LINE>if (ZERO.equals(durationForAmountSucceededInSeconds))<NEW_LINE>return null;<NEW_LINE>BigDecimal amountSucceededPerSecond = valueOf(ceil(jobStats.getSucceeded() - firstRelevantJobStats.getSucceeded())).divide(durationForAmountSucceededInSeconds, RoundingMode.CEILING);<NEW_LINE>if (ZERO.equals(amountSucceededPerSecond))<NEW_LINE>return null;<NEW_LINE>BigDecimal processingTimeInSeconds = BigDecimal.valueOf(jobStats.getEnqueued() + jobStats.getProcessing()).divide(amountSucceededPerSecond, RoundingMode.HALF_UP);<NEW_LINE>return Instant.now().plusSeconds(processingTimeInSeconds.longValue());<NEW_LINE>}
()).getSeconds());
217,701
public void addLine(String line) {<NEW_LINE>if (styled_text.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>line = HTMLUtils.expand(line);<NEW_LINE>Object[] url_details = HTMLUtils.getLinks(line);<NEW_LINE>String modified_line = (String) url_details[0];<NEW_LINE>styled_text.append(modified_line + "\n");<NEW_LINE>List urls = (List) url_details[1];<NEW_LINE>for (int i = 0; i < urls.size(); i++) {<NEW_LINE>Object[] entry = (Object[]) urls.get(i);<NEW_LINE>String url = (String) entry[0];<NEW_LINE>int[] det = (int[]) entry[1];<NEW_LINE>if (!url.toLowerCase().startsWith("http") && relative_url_base.length() > 0) {<NEW_LINE>url = relative_url_base + url;<NEW_LINE>}<NEW_LINE>linkInfo info = new linkInfo(ofs + det[0], ofs + det[0] + det[1], url);<NEW_LINE>links.add(info);<NEW_LINE>StyleRange sr = new StyleRange();<NEW_LINE>sr.start = info.ofsStart;<NEW_LINE>sr.length <MASK><NEW_LINE>sr.underline = true;<NEW_LINE>sr.foreground = styled_text.getDisplay().getSystemColor(SWT.COLOR_LINK_FOREGROUND);<NEW_LINE>styled_text.setStyleRange(sr);<NEW_LINE>}<NEW_LINE>ofs += modified_line.length() + 1;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// just in case something borks<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>styled_text.append(line + "\n");<NEW_LINE>}<NEW_LINE>}
= info.ofsEnd - info.ofsStart;
1,711,497
public ConfigurationStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ConfigurationStatus configurationStatus = new ConfigurationStatus();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("state", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>configurationStatus.setState(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("error", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>configurationStatus.setError(ConfigurationErrorDetailsJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return configurationStatus;<NEW_LINE>}
().unmarshall(context));
1,816,673
public static boolean isMatch(URL consumerUrl, URL providerUrl) {<NEW_LINE>String consumerInterface = consumerUrl.getServiceInterface();<NEW_LINE>String providerInterface = providerUrl.getServiceInterface();<NEW_LINE>// FIXME accept providerUrl with '*' as interface name, after carefully thought about all possible scenarios I think it's ok to add this condition.<NEW_LINE>if (!(ANY_VALUE.equals(consumerInterface) || ANY_VALUE.equals(providerInterface) || StringUtils.isEquals(consumerInterface, providerInterface))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!isMatchCategory(providerUrl.getCategory(DEFAULT_CATEGORY), consumerUrl.getCategory(DEFAULT_CATEGORY))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!providerUrl.getParameter(ENABLED_KEY, true) && !ANY_VALUE.equals(consumerUrl.getParameter(ENABLED_KEY))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String consumerGroup = consumerUrl.getGroup();<NEW_LINE>String consumerVersion = consumerUrl.getVersion();<NEW_LINE>String consumerClassifier = consumerUrl.getParameter(CLASSIFIER_KEY, ANY_VALUE);<NEW_LINE>String providerGroup = providerUrl.getGroup();<NEW_LINE>String providerVersion = providerUrl.getVersion();<NEW_LINE>String providerClassifier = providerUrl.getParameter(CLASSIFIER_KEY, ANY_VALUE);<NEW_LINE>return (ANY_VALUE.equals(consumerGroup) || StringUtils.isEquals(consumerGroup, providerGroup) || StringUtils.isContains(consumerGroup, providerGroup)) && (ANY_VALUE.equals(consumerVersion) || StringUtils.isEquals(consumerVersion, providerVersion)) && (consumerClassifier == null || ANY_VALUE.equals(consumerClassifier) || StringUtils<MASK><NEW_LINE>}
.isEquals(consumerClassifier, providerClassifier));
1,816,112
private static Query binaryNameSourceNamePairQuery(final Pair<String, String> binaryNameSourceNamePair) {<NEW_LINE>assert binaryNameSourceNamePair != null;<NEW_LINE>final <MASK><NEW_LINE>final String sourceName = binaryNameSourceNamePair.second();<NEW_LINE>assert binaryName != null || sourceName != null;<NEW_LINE>Query query = null;<NEW_LINE>if (binaryName != null) {<NEW_LINE>query = binaryNameQuery(binaryName);<NEW_LINE>}<NEW_LINE>if (sourceName != null) {<NEW_LINE>if (query == null) {<NEW_LINE>query = new TermQuery(new Term(FIELD_SOURCE, sourceName));<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>assert query instanceof BooleanQuery : "The DocumentUtil.binaryNameQuery was incompatibly changed!";<NEW_LINE>final BooleanQuery bq = (BooleanQuery) query;<NEW_LINE>bq.add(new TermQuery(new Term(FIELD_SOURCE, sourceName)), BooleanClause.Occur.MUST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert query != null;<NEW_LINE>return query;<NEW_LINE>}
String binaryName = binaryNameSourceNamePair.first();
1,337,097
static TranslateTextResponse translateText(String projectId, String location, String text, String sourceLanguageCode, String targetLanguageCode) {<NEW_LINE>try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {<NEW_LINE>LocationName locationName = LocationName.newBuilder().setProject(projectId).<MASK><NEW_LINE>TranslateTextRequest translateTextRequest = TranslateTextRequest.newBuilder().setParent(locationName.toString()).setMimeType("text/plain").setSourceLanguageCode(sourceLanguageCode).setTargetLanguageCode(targetLanguageCode).addContents(text).build();<NEW_LINE>// Call the API<NEW_LINE>TranslateTextResponse response = translationServiceClient.translateText(translateTextRequest);<NEW_LINE>System.out.format("Translated Text: %s", response.getTranslationsList().get(0).getTranslatedText());<NEW_LINE>return response;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Couldn't create client.", e);<NEW_LINE>}<NEW_LINE>}
setLocation(location).build();
705,255
public Entity update(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException {<NEW_LINE>Entity entity = persistencePackage.getEntity();<NEW_LINE>try {<NEW_LINE>PersistencePerspective persistencePerspective = persistencePackage.getPersistencePerspective();<NEW_LINE>Map<String, FieldMetadata> adminProperties = helper.getSimpleMergedProperties(Customer.class.getName(), persistencePerspective);<NEW_LINE>Object primaryKey = helper.getPrimaryKey(entity, adminProperties);<NEW_LINE>Customer adminInstance = (Customer) dynamicEntityDao.retrieve(Class.forName(entity.getType()[0]), primaryKey);<NEW_LINE>Entity errorEntity = validateUniqueUsername(entity, adminInstance, false);<NEW_LINE>if (errorEntity != null) {<NEW_LINE>return errorEntity;<NEW_LINE>}<NEW_LINE>String passwordBefore = adminInstance.getPassword();<NEW_LINE>adminInstance.setPassword(null);<NEW_LINE>adminInstance = (Customer) helper.createPopulatedInstance(adminInstance, entity, adminProperties, false);<NEW_LINE>adminInstance.setPassword(passwordBefore);<NEW_LINE>if (useEmailForLogin) {<NEW_LINE>adminInstance.<MASK><NEW_LINE>}<NEW_LINE>adminInstance = customerService.saveCustomer(adminInstance);<NEW_LINE>Entity adminEntity = helper.getRecord(adminProperties, adminInstance, null, null);<NEW_LINE>return adminEntity;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ServiceException("Unable to update entity for " + entity.getType()[0], e);<NEW_LINE>}<NEW_LINE>}
setUsername(adminInstance.getEmailAddress());
748,766
private void addCommitDetails(RepositoryCommit commit) {<NEW_LINE>adapter.addHeader(commitHeader);<NEW_LINE>commitMessage.setText(commit.getCommit().getMessage());<NEW_LINE>String commitAuthor = CommitUtils.getAuthor(commit);<NEW_LINE>String commitCommitter = CommitUtils.getCommitter(commit);<NEW_LINE>if (commitAuthor != null) {<NEW_LINE>CommitUtils.bindAuthor(commit, avatars, authorAvatar);<NEW_LINE>authorName.setText(commitAuthor);<NEW_LINE>StyledText styledAuthor = new StyledText();<NEW_LINE>styledAuthor.append(getString(R.string.authored));<NEW_LINE>Date commitAuthorDate = CommitUtils.getAuthorDate(commit);<NEW_LINE>if (commitAuthorDate != null)<NEW_LINE>styledAuthor.append(' ').append(commitAuthorDate);<NEW_LINE>authorDate.setText(styledAuthor);<NEW_LINE>ViewUtils.setGone(authorArea, false);<NEW_LINE>} else<NEW_LINE>ViewUtils.setGone(authorArea, true);<NEW_LINE>if (isDifferentCommitter(commitAuthor, commitCommitter)) {<NEW_LINE>CommitUtils.bindCommitter(commit, avatars, committerAvatar);<NEW_LINE>committerName.setText(commitCommitter);<NEW_LINE>StyledText styledCommitter = new StyledText();<NEW_LINE>styledCommitter.append(getString(R.string.committed));<NEW_LINE>Date commitCommitterDate = CommitUtils.getCommitterDate(commit);<NEW_LINE>if (commitCommitterDate != null)<NEW_LINE>styledCommitter.append(' ').append(commitCommitterDate);<NEW_LINE>committerDate.setText(styledCommitter);<NEW_LINE><MASK><NEW_LINE>} else<NEW_LINE>ViewUtils.setGone(committerArea, true);<NEW_LINE>}
ViewUtils.setGone(committerArea, false);
1,476,355
private List<com.intellij.formatting.Block> buildOperatorRuleChildren(@NotNull ASTNode operatorRule, @Nullable Wrap operatorWrap, @Nullable Alignment operatorAlignment, @Nullable Alignment rightCommentAlignment) {<NEW_LINE>final Alignment[] commentAlignment = { operatorAlignment };<NEW_LINE>Indent operatorIndent = Indent.getNoneIndent();<NEW_LINE>final <MASK><NEW_LINE>return buildChildren(operatorRule, (child, childElementType, blockList) -> {<NEW_LINE>if (OPERATOR_TOKEN_SET.contains(childElementType)) {<NEW_LINE>blockList.add(buildChild(child, operatorWrap, operatorAlignment, operatorIndent));<NEW_LINE>commentAlignment[0] = rightCommentAlignment;<NEW_LINE>commentIndent[0] = null;<NEW_LINE>} else {<NEW_LINE>blockList.add(buildChild(child, commentAlignment[0], commentIndent[0]));<NEW_LINE>}<NEW_LINE>return blockList;<NEW_LINE>});<NEW_LINE>}
Indent[] commentIndent = { operatorIndent };
886,591
public Authentication authenticate(Authentication authentication) throws AuthenticationException {<NEW_LINE>OidcUserInfoAuthenticationToken userInfoAuthentication = (OidcUserInfoAuthenticationToken) authentication;<NEW_LINE>AbstractOAuth2TokenAuthenticationToken<?> accessTokenAuthentication = null;<NEW_LINE>if (AbstractOAuth2TokenAuthenticationToken.class.isAssignableFrom(userInfoAuthentication.getPrincipal().getClass())) {<NEW_LINE>accessTokenAuthentication = (AbstractOAuth2TokenAuthenticationToken<?>) userInfoAuthentication.getPrincipal();<NEW_LINE>}<NEW_LINE>if (accessTokenAuthentication == null || !accessTokenAuthentication.isAuthenticated()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String accessTokenValue = accessTokenAuthentication.getToken().getTokenValue();<NEW_LINE>OAuth2Authorization authorization = this.authorizationService.findByToken(accessTokenValue, OAuth2TokenType.ACCESS_TOKEN);<NEW_LINE>if (authorization == null) {<NEW_LINE>throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_TOKEN);<NEW_LINE>}<NEW_LINE>OAuth2Authorization.Token<OAuth2AccessToken> authorizedAccessToken = authorization.getAccessToken();<NEW_LINE>if (!authorizedAccessToken.isActive()) {<NEW_LINE>throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_TOKEN);<NEW_LINE>}<NEW_LINE>if (!authorizedAccessToken.getToken().getScopes().contains(OidcScopes.OPENID)) {<NEW_LINE>throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INSUFFICIENT_SCOPE);<NEW_LINE>}<NEW_LINE>OAuth2Authorization.Token<OidcIdToken> idToken = authorization.getToken(OidcIdToken.class);<NEW_LINE>if (idToken == null) {<NEW_LINE>throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_TOKEN);<NEW_LINE>}<NEW_LINE>OidcUserInfoAuthenticationContext authenticationContext = OidcUserInfoAuthenticationContext.with(userInfoAuthentication).accessToken(authorizedAccessToken.getToken()).authorization(authorization).build();<NEW_LINE>OidcUserInfo userInfo = this.userInfoMapper.apply(authenticationContext);<NEW_LINE>return new OidcUserInfoAuthenticationToken(accessTokenAuthentication, userInfo);<NEW_LINE>}
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_TOKEN);
1,597,910
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {<NEW_LINE>mc.renderEngine.bindTexture(TEXTURE);<NEW_LINE>drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);<NEW_LINE>super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);<NEW_LINE>if (heatExchange != null) {<NEW_LINE><MASK><NEW_LINE>if (craftTicks > 0) {<NEW_LINE>drawTexturedModalRect(guiLeft + 61, guiTop + 11, 176, 71, 54, 71);<NEW_LINE>} else {<NEW_LINE>if (inCoolableTicks > 0) {<NEW_LINE>drawTexturedModalRect(guiLeft + 61, guiTop + 41, 176, 30, 11, 11);<NEW_LINE>}<NEW_LINE>if (inHeatableTicks > 0) {<NEW_LINE>drawTexturedModalRect(guiLeft + 79, guiTop + 67, 194, 56, 11, 11);<NEW_LINE>}<NEW_LINE>if (outCooledTicks > 0) {<NEW_LINE>drawTexturedModalRect(guiLeft + 104, guiTop + 41, 219, 30, 11, 11);<NEW_LINE>}<NEW_LINE>if (outHeatedTicks > 0) {<NEW_LINE>drawTexturedModalRect(guiLeft + 86, guiTop + 15, 201, 4, 11, 11);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mc.renderEngine.bindTexture(TEXTURE);
220,230
protected void initRulesWithWord() {<NEW_LINE>// Add synthetic symbols to the indices<NEW_LINE>int unkWord = wordIndex.addToIndex(UNKNOWN_WORD);<NEW_LINE>int <MASK><NEW_LINE>int boundaryTagId = tagIndex.addToIndex(BOUNDARY_TAG);<NEW_LINE>// Initialize rules table<NEW_LINE>final int numWords = wordIndex.size();<NEW_LINE>rulesWithWord = new List[numWords];<NEW_LINE>for (int w = 0; w < numWords; w++) {<NEW_LINE>rulesWithWord[w] = new ArrayList<>(1);<NEW_LINE>}<NEW_LINE>// Collect rules, indexed by word<NEW_LINE>Set<IntTaggedWord> lexRules = Generics.newHashSet(40000);<NEW_LINE>for (int wordId : wordTag.firstKeySet()) {<NEW_LINE>for (int tagId : wordTag.getCounter(wordId).keySet()) {<NEW_LINE>lexRules.add(new IntTaggedWord(wordId, tagId));<NEW_LINE>lexRules.add(new IntTaggedWord(nullWord, tagId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Known words and signatures<NEW_LINE>for (IntTaggedWord iTW : lexRules) {<NEW_LINE>if (iTW.word() == nullWord) {<NEW_LINE>// Mix in UW signature rules for open class types<NEW_LINE>double types = uwModel.unSeenCounter().getCount(iTW);<NEW_LINE>if (types > trainOptions.openClassTypesThreshold) {<NEW_LINE>IntTaggedWord iTU = new IntTaggedWord(unkWord, iTW.tag);<NEW_LINE>if (!rulesWithWord[unkWord].contains(iTU)) {<NEW_LINE>rulesWithWord[unkWord].add(iTU);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Known word<NEW_LINE>rulesWithWord[iTW.word].add(iTW);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("The " + rulesWithWord[unkWord].size() + " open class tags are: [");<NEW_LINE>for (IntTaggedWord item : rulesWithWord[unkWord]) {<NEW_LINE>log.info(" " + tagIndex.get(item.tag()));<NEW_LINE>}<NEW_LINE>log.info(" ] ");<NEW_LINE>// Boundary symbol has one tagging<NEW_LINE>rulesWithWord[boundaryWordId].add(new IntTaggedWord(boundaryWordId, boundaryTagId));<NEW_LINE>}
boundaryWordId = wordIndex.addToIndex(BOUNDARY);
1,325,223
public WARCRecordInfo buildRecord(CrawlURI curi, URI concurrentTo) throws IOException {<NEW_LINE>final String timestamp = ArchiveUtils.getLog14Date(curi.getFetchBeginTime());<NEW_LINE>String controlConversation = curi.getData().get(A_FTP_CONTROL_CONVERSATION).toString();<NEW_LINE>WARCRecordInfo recordInfo = new WARCRecordInfo();<NEW_LINE><MASK><NEW_LINE>if (concurrentTo != null) {<NEW_LINE>recordInfo.addExtraHeader(HEADER_KEY_CONCURRENT_TO, '<' + concurrentTo.toString() + '>');<NEW_LINE>}<NEW_LINE>recordInfo.setCreate14DigitDate(timestamp);<NEW_LINE>recordInfo.setUrl(curi.toString());<NEW_LINE>recordInfo.setMimetype(FTP_CONTROL_CONVERSATION_MIMETYPE);<NEW_LINE>recordInfo.setEnforceLength(true);<NEW_LINE>recordInfo.setType(WARCRecordType.metadata);<NEW_LINE>if (curi.getServerIP() != null) {<NEW_LINE>recordInfo.addExtraHeader(HEADER_KEY_IP, curi.getServerIP());<NEW_LINE>}<NEW_LINE>byte[] b = controlConversation.getBytes("UTF-8");<NEW_LINE>recordInfo.setContentStream(new ByteArrayInputStream(b));<NEW_LINE>recordInfo.setContentLength((long) b.length);<NEW_LINE>return recordInfo;<NEW_LINE>}
recordInfo.setRecordId(generateRecordID());
1,742,111
private void initTitleBar() {<NEW_LINE>mTitleBar = findViewById(R.id.title_bar);<NEW_LINE>mTitleBar.setListener(new HomeTitleBar.OnTitleBarClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRightClick() {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mSettingList = findViewById(R.id.setting_list);<NEW_LINE>mSettingList.setLayoutManager(new LinearLayoutManager(getContext()));<NEW_LINE>mSettingItemAdapter = new SettingItemAdapter(getContext());<NEW_LINE>mSettingItemAdapter.append(new SettingItem(R.string.dk_kit_align_ruler, AlignRulerConfig.isAlignRulerOpen()));<NEW_LINE>mSettingList.setAdapter(mSettingItemAdapter);<NEW_LINE>mSettingItemAdapter.setOnSettingItemSwitchListener(new SettingItemAdapter.OnSettingItemSwitchListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSettingItemSwitch(View view, SettingItem data, boolean on) {<NEW_LINE>if (data.desc == R.string.dk_kit_align_ruler) {<NEW_LINE>if (on) {<NEW_LINE>DoKit.launchFloating(AlignRulerMarkerDokitView.class);<NEW_LINE>DoKit.launchFloating(AlignRulerLineDokitView.class);<NEW_LINE>} else {<NEW_LINE>DoKit.removeFloating(AlignRulerMarkerDokitView.class);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>AlignRulerConfig.setAlignRulerOpen(on);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
DoKit.removeFloating(AlignRulerLineDokitView.class);
61,140
public Table importTable(VDB vdb, String[] fields, Expression[] filters, Context ctx) throws IOException {<NEW_LINE>if (filters == null) {<NEW_LINE>return importTable(vdb, fields);<NEW_LINE>} else if (filters.length == 1) {<NEW_LINE>return importTable(vdb, fields, filters[0], ctx);<NEW_LINE>}<NEW_LINE>int expCount = filters.length;<NEW_LINE>String[] filterFields = getUsedFields(filters[0], ctx);<NEW_LINE>int filterCount = filterFields.length;<NEW_LINE>ArrayList<String> list = new ArrayList<String>();<NEW_LINE>int[] filterIndex = new int[filterCount];<NEW_LINE>for (String str : fields) {<NEW_LINE>list.add(str);<NEW_LINE>}<NEW_LINE>for (int f = 0; f < filterCount; ++f) {<NEW_LINE>int index = list.indexOf(filterFields[f]);<NEW_LINE>if (index < 0) {<NEW_LINE>filterIndex[f] = list.size();<NEW_LINE>list.add(filterFields[f]);<NEW_LINE>} else {<NEW_LINE>filterIndex[f] = index;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 1; i < expCount; ++i) {<NEW_LINE>filterFields = getUsedFields(filters[i], ctx);<NEW_LINE>for (String field : filterFields) {<NEW_LINE>if (!list.contains(field)) {<NEW_LINE>list.add(field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] totalFields = new String[list.size()];<NEW_LINE>list.toArray(totalFields);<NEW_LINE>int fcount = totalFields.length;<NEW_LINE>DataStruct ds = new DataStruct(totalFields);<NEW_LINE>Object[] values = new Object[fcount];<NEW_LINE>boolean[] signs = new boolean[fcount];<NEW_LINE>IDir dir = getDir();<NEW_LINE>ISection section = this;<NEW_LINE>while (dir != null) {<NEW_LINE>int findex = ds.getFieldIndex(dir.getName());<NEW_LINE>if (findex != -1) {<NEW_LINE>values[<MASK><NEW_LINE>signs[findex] = true;<NEW_LINE>}<NEW_LINE>section = dir.getParent();<NEW_LINE>dir = section.getDir();<NEW_LINE>}<NEW_LINE>Table table = new Table(ds);<NEW_LINE>importTable(vdb, table, values, signs, filters[0], filterIndex, ctx);<NEW_LINE>for (int i = 1; i < expCount; ++i) {<NEW_LINE>table.select(filters[i], "o", ctx);<NEW_LINE>}<NEW_LINE>if (table.length() == 0) {<NEW_LINE>return null;<NEW_LINE>} else if (fields.length == fcount) {<NEW_LINE>return table;<NEW_LINE>} else {<NEW_LINE>return table.fieldsValues(fields);<NEW_LINE>}<NEW_LINE>}
findex] = dir.getValue();
259,401
public Iterator<O> iterator() {<NEW_LINE>Iterator<O> mainResults = retrieveWithIndexOrderingMainResults(query, queryOptions, indexForOrdering, allSortOrders, rangeBoundsFromQuery, attributeCanHaveMoreThanOneValue, primarySortDescending);<NEW_LINE>// Combine the results from the index ordered search, with objects which would be missing from that<NEW_LINE>// index, which is possible in the case that the primary sort attribute is nullable or multi-valued...<NEW_LINE>Iterator<O> combinedResults;<NEW_LINE>if (attributeCanHaveZeroValues) {<NEW_LINE>Iterator<O> missingResults = retrieveWithIndexOrderingMissingResults(query, <MASK><NEW_LINE>// Concatenate the main results and the missing objects, accounting for which batch should come first...<NEW_LINE>if (orderControlAttribute instanceof OrderMissingFirstAttribute) {<NEW_LINE>combinedResults = ConcatenatingIterator.concatenate(Arrays.asList(missingResults, mainResults));<NEW_LINE>} else if (orderControlAttribute instanceof OrderMissingLastAttribute) {<NEW_LINE>combinedResults = ConcatenatingIterator.concatenate(Arrays.asList(mainResults, missingResults));<NEW_LINE>} else if (primarySortOrder.isDescending()) {<NEW_LINE>combinedResults = ConcatenatingIterator.concatenate(Arrays.asList(mainResults, missingResults));<NEW_LINE>} else {<NEW_LINE>combinedResults = ConcatenatingIterator.concatenate(Arrays.asList(missingResults, mainResults));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>combinedResults = mainResults;<NEW_LINE>}<NEW_LINE>if (attributeCanHaveMoreThanOneValue) {<NEW_LINE>// Deduplicate results in case the same object could appear in more than one bucket<NEW_LINE>// and so otherwise could be returned more than once...<NEW_LINE>combinedResults = new MaterializedDeduplicatedIterator<O>(combinedResults);<NEW_LINE>}<NEW_LINE>return combinedResults;<NEW_LINE>}
queryOptions, primarySortAttribute, allSortOrders, attributeCanHaveMoreThanOneValue);
1,680,828
public boolean blockLocation(Location location) {<NEW_LINE>final float inaccuracy = location.getAccuracy();<NEW_LINE>final double altitude = location.getAltitude();<NEW_LINE>final float bearing = location.getBearing();<NEW_LINE>final double latitude = location.getLatitude();<NEW_LINE>final double longitude = location.getLongitude();<NEW_LINE>final float speed = location.getSpeed();<NEW_LINE>final long timestamp = location.getTime();<NEW_LINE>final long tomorrow = System.currentTimeMillis() + MILLISECONDS_PER_DAY;<NEW_LINE>boolean block = false;<NEW_LINE>if (latitude == 0 && longitude == 0) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus latitude,longitude: 0,0");<NEW_LINE>} else {<NEW_LINE>if (latitude < -90 || latitude > 90) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus latitude: " + latitude);<NEW_LINE>}<NEW_LINE>if (longitude < -180 || longitude > 180) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus longitude: " + longitude);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (location.hasAccuracy() && (inaccuracy < 0 || inaccuracy > MIN_ACCURACY)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Insufficient accuracy: " + inaccuracy + " meters");<NEW_LINE>}<NEW_LINE>if (location.hasAltitude() && (altitude < MIN_ALTITUDE || altitude > MAX_ALTITUDE)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(<MASK><NEW_LINE>}<NEW_LINE>if (location.hasBearing() && (bearing < 0 || bearing > 360)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus bearing: " + bearing + " degrees");<NEW_LINE>}<NEW_LINE>if (location.hasSpeed() && (speed < 0 || speed > MAX_SPEED)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus speed: " + speed + " meters/second");<NEW_LINE>}<NEW_LINE>if (timestamp < MIN_TIMESTAMP || timestamp > tomorrow) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus timestamp: " + timestamp);<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>}
LOG_TAG, "Bogus altitude: " + altitude + " meters");
1,700,390
public com.atlassian.jira.rpc.soap.beans.RemoteComment editComment(java.lang.String in0, com.atlassian.jira.rpc.soap.beans.RemoteComment in1) throws java.rmi.RemoteException, com.atlassian.jira.rpc.exception.RemoteException {<NEW_LINE>if (super.cachedEndpoint == null) {<NEW_LINE>throw new org.apache.axis.NoEndPointException();<NEW_LINE>}<NEW_LINE>org.apache.axis.client.Call _call = createCall();<NEW_LINE>_call.setOperation(_operations[71]);<NEW_LINE>_call.setUseSOAPAction(true);<NEW_LINE>_call.setSOAPActionURI("");<NEW_LINE>_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);<NEW_LINE>_call.setOperationName(new javax.xml.namespace.QName("http://soap.rpc.jira.atlassian.com", "editComment"));<NEW_LINE>setRequestHeaders(_call);<NEW_LINE>setAttachments(_call);<NEW_LINE>try {<NEW_LINE>java.lang.Object _resp = _call.invoke(new java.lang.Object[] { in0, in1 });<NEW_LINE>if (_resp instanceof java.rmi.RemoteException) {<NEW_LINE>throw <MASK><NEW_LINE>} else {<NEW_LINE>extractAttachments(_call);<NEW_LINE>try {<NEW_LINE>return (com.atlassian.jira.rpc.soap.beans.RemoteComment) _resp;<NEW_LINE>} catch (java.lang.Exception _exception) {<NEW_LINE>return (com.atlassian.jira.rpc.soap.beans.RemoteComment) org.apache.axis.utils.JavaUtils.convert(_resp, com.atlassian.jira.rpc.soap.beans.RemoteComment.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (org.apache.axis.AxisFault axisFaultException) {<NEW_LINE>if (axisFaultException.detail != null) {<NEW_LINE>if (axisFaultException.detail instanceof java.rmi.RemoteException) {<NEW_LINE>throw (java.rmi.RemoteException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemoteException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemoteException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw axisFaultException;<NEW_LINE>}<NEW_LINE>}
(java.rmi.RemoteException) _resp;
964,805
public PCollection<Row> expand(PInput input) {<NEW_LINE>TableProvider inputTableProvider = new ReadOnlyTableProvider(PCOLLECTION_NAME, toTableMap(input));<NEW_LINE>InMemoryMetaStore metaTableProvider = new InMemoryMetaStore();<NEW_LINE>metaTableProvider.registerProvider(inputTableProvider);<NEW_LINE>BeamSqlEnvBuilder <MASK><NEW_LINE>// TODO: validate duplicate functions.<NEW_LINE>registerFunctions(sqlEnvBuilder);<NEW_LINE>// Load automatic table providers before user ones so the user ones will cause a conflict if<NEW_LINE>// the same names are reused.<NEW_LINE>if (autoLoading()) {<NEW_LINE>sqlEnvBuilder.autoLoadUserDefinedFunctions();<NEW_LINE>ServiceLoader.load(TableProvider.class).forEach(metaTableProvider::registerProvider);<NEW_LINE>}<NEW_LINE>tableProviderMap().forEach(sqlEnvBuilder::addSchema);<NEW_LINE>@Nullable<NEW_LINE>final String defaultTableProvider = defaultTableProvider();<NEW_LINE>if (defaultTableProvider != null) {<NEW_LINE>sqlEnvBuilder.setCurrentSchema(defaultTableProvider);<NEW_LINE>}<NEW_LINE>sqlEnvBuilder.setQueryPlannerClassName(MoreObjects.firstNonNull(queryPlannerClassName(), input.getPipeline().getOptions().as(BeamSqlPipelineOptions.class).getPlannerName()));<NEW_LINE>sqlEnvBuilder.setPipelineOptions(input.getPipeline().getOptions());<NEW_LINE>BeamSqlEnv sqlEnv = sqlEnvBuilder.build();<NEW_LINE>ddlStrings().forEach(sqlEnv::executeDdl);<NEW_LINE>return BeamSqlRelUtils.toPCollection(input.getPipeline(), sqlEnv.parseQuery(queryString(), queryParameters()), errorsTransformer());<NEW_LINE>}
sqlEnvBuilder = BeamSqlEnv.builder(metaTableProvider);
1,369,609
public void dgeqrf(int M, int N, INDArray A, INDArray R, INDArray INFO) {<NEW_LINE>INDArray tau = Nd4j.create(DataType.DOUBLE, N);<NEW_LINE>int status = nativeOps.callInt("LAPACKE_dgeqrf", getColumnOrder(A), M, N, (DoublePointer) A.data().addressPointer(), getLda(A), (DoublePointer) tau.data().addressPointer());<NEW_LINE>if (status != 0) {<NEW_LINE>throw new BlasException("Failed to execute dgeqrf", status);<NEW_LINE>}<NEW_LINE>// Copy R ( upper part of Q ) into result<NEW_LINE>if (R != null) {<NEW_LINE>R.assign(A.get(NDArrayIndex.interval(0, A.columns()), NDArrayIndex.all()));<NEW_LINE>INDArrayIndex[] ix = new INDArrayIndex[2];<NEW_LINE>for (int i = 1; i < Math.min(A.rows(), A.columns()); i++) {<NEW_LINE>ix[0] = NDArrayIndex.point(i);<NEW_LINE>ix[1] = NDArrayIndex.interval(0, i);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>status = nativeOps.callInt("LAPACKE_dorgqr", getColumnOrder(A), M, N, N, (DoublePointer) A.data().addressPointer(), getLda(A), (DoublePointer) tau.data().addressPointer());<NEW_LINE>if (status != 0) {<NEW_LINE>throw new BlasException("Failed to execute dorgqr", status);<NEW_LINE>}<NEW_LINE>}
R.put(ix, 0);
1,277,770
private Mono<Response<Flux<ByteBuffer>>> revokeAccessWithResponseAsync(String resourceGroupName, String snapshotName, 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 (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 (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (snapshotName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-07-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.revokeAccess(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, apiVersion, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null."));
484,004
public ListImagesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListImagesResult listImagesResult = new ListImagesResult();<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 listImagesResult;<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("Images", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagesResult.setImages(new ListUnmarshaller<Image>(ImageJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagesResult.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 listImagesResult;<NEW_LINE>}
)).unmarshall(context));
82,592
private void openVideo() {<NEW_LINE>if (!getSurfaceOps().isPresent() || getSurfaceOps().get().getSurface() == null) {<NEW_LINE>// not ready for playback just yet, will try again later<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mIsAssetRouse) {<NEW_LINE>if (mVideoFilePath == null)<NEW_LINE>return;<NEW_LINE>} else if (mVideoUri == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// this.pausePlaybackService();<NEW_LINE>try {<NEW_LINE>mMediaPlayer.setSurfaceOps(getSurfaceOps().get());<NEW_LINE>// mMediaPlayer.setAudioStreamType(AudioManager.AudioVolumeType.STREAM_MUSIC.getValue());<NEW_LINE>getSurfaceOps().get().setKeepScreenOn(true);<NEW_LINE>if (mIsAssetRouse) {<NEW_LINE>RawFileDescriptor afd = mAbility.getResourceManager().getRawFileEntry(mVideoFilePath).openRawFileDescriptor();<NEW_LINE>mMediaPlayer.setSource(afd);<NEW_LINE>} else {<NEW_LINE>mMediaPlayer.setSource(mVideoUri);<NEW_LINE>}<NEW_LINE>mCurrentState = State.INITIALIZED;<NEW_LINE>// Use Prepare() instead of PrepareAsync to make things easy.<NEW_LINE>// CompletableFuture.runAsync(()->{<NEW_LINE>mMediaPlayer.prepare();<NEW_LINE><MASK><NEW_LINE>// });<NEW_LINE>// mMediaPlayer.prepareAsync();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>HiLog.error(TAG, "Unable to open content: " + mVideoUri + ex);<NEW_LINE>mCurrentState = State.ERROR;<NEW_LINE>mPlayerCallback.onError(Player.PLAYER_ERROR_UNKNOWN, 0);<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>HiLog.error(TAG, "Unable to open content: " + mVideoUri + ex);<NEW_LINE>mCurrentState = State.ERROR;<NEW_LINE>mPlayerCallback.onError(Player.PLAYER_ERROR_UNKNOWN, 0);<NEW_LINE>}<NEW_LINE>}
CocosHelper.ruOnUIThreadSync(this::showFirstFrame);
1,496,882
protected void doAction() {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>KeyStoreState currentState = history.getCurrentState();<NEW_LINE>String alias = kseFrame.getSelectedEntryAlias();<NEW_LINE>Password password = getEntryPassword(alias, currentState);<NEW_LINE>if (password == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>KeyStore keyStore = currentState.getKeyStore();<NEW_LINE>Provider provider = history.getExplicitProvider();<NEW_LINE>PrivateKey privateKey = (PrivateKey) keyStore.getKey(alias, password.toCharArray());<NEW_LINE>KeyPairType keyPairType = KeyPairUtil.getKeyPairType(privateKey);<NEW_LINE>DSignJwt dSignJwt = new DSignJwt(frame, keyPairType, privateKey);<NEW_LINE>dSignJwt.setLocationRelativeTo(frame);<NEW_LINE>dSignJwt.setVisible(true);<NEW_LINE>if (dSignJwt.isOk()) {<NEW_LINE>String encodedJWT = signJwt(dSignJwt, privateKey, provider);<NEW_LINE>DViewJwt dialog = new DViewJwt(frame, encodedJWT);<NEW_LINE>dialog.setLocationRelativeTo(frame);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>DError.displayError(frame, ex);<NEW_LINE>}<NEW_LINE>}
KeyStoreHistory history = kseFrame.getActiveKeyStoreHistory();
703,181
private ManagedExecutorService createExecutor(String name, int poolSize, int queueCapacity, ExecutorType type, ThreadFactory threadFactory) {<NEW_LINE>ManagedExecutorService executor;<NEW_LINE>if (type == ExecutorType.CACHED) {<NEW_LINE>if (threadFactory != null) {<NEW_LINE>throw new IllegalArgumentException("Cached executor can not be used with external thread factory");<NEW_LINE>}<NEW_LINE>executor = new CachedExecutorServiceDelegate(<MASK><NEW_LINE>} else if (type == ExecutorType.CONCRETE) {<NEW_LINE>if (threadFactory == null) {<NEW_LINE>ClassLoader classLoader = nodeEngine.getConfigClassLoader();<NEW_LINE>String hzName = nodeEngine.getHazelcastInstance().getName();<NEW_LINE>String internalName = name.startsWith("hz:") ? name.substring(BEGIN_INDEX) : name;<NEW_LINE>String threadNamePrefix = createThreadPoolName(hzName, internalName);<NEW_LINE>threadFactory = new PoolExecutorThreadFactory(threadNamePrefix, classLoader);<NEW_LINE>}<NEW_LINE>NamedThreadPoolExecutor pool = new NamedThreadPoolExecutor(name, poolSize, poolSize, KEEP_ALIVE_TIME, TimeUnit.SECONDS, new LinkedBlockingQueue<>(queueCapacity), threadFactory);<NEW_LINE>pool.allowCoreThreadTimeOut(true);<NEW_LINE>executor = pool;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown executor type: " + type);<NEW_LINE>}<NEW_LINE>return executor;<NEW_LINE>}
name, cachedExecutorService, poolSize, queueCapacity);
355,712
public void load() {<NEW_LINE>sun = new Planet("sun", null, 4f) {<NEW_LINE><NEW_LINE>{<NEW_LINE>bloom = true;<NEW_LINE>accessible = false;<NEW_LINE>meshLoader = () -> new SunMesh(this, 4, 5, 0.3, 1.7, 1.2, 1, 1.1f, Color.valueOf("ff7a38"), Color.valueOf("ff9638"), Color.valueOf("ffc64c"), Color.valueOf("ffc64c"), Color.valueOf("ffe371")<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>serpulo = new Planet("serpulo", sun, 1f, 3) {<NEW_LINE><NEW_LINE>{<NEW_LINE>generator = new SerpuloPlanetGenerator();<NEW_LINE>meshLoader = () -> new HexMesh(this, 6);<NEW_LINE>cloudMeshLoader = () -> new MultiMesh(new HexSkyMesh(this, 11, 0.15f, 0.13f, 5, new Color().set(Pal.spore).mul(0.9f).a(0.75f), 2, 0.45f, 0.9f, 0.38f), new HexSkyMesh(this, 1, 0.6f, 0.16f, 5, Color.white.cpy().lerp(Pal.spore, 0.55f).a(0.75f), 2, 0.45f, 1f, 0.41f));<NEW_LINE>atmosphereColor = Color.valueOf("3c1b8f");<NEW_LINE>atmosphereRadIn = 0.02f;<NEW_LINE>atmosphereRadOut = 0.3f;<NEW_LINE>startSector = 15;<NEW_LINE>alwaysUnlocked = true;<NEW_LINE>landCloudColor = Pal.spore.cpy().a(0.5f);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
, Color.valueOf("f4ee8e"));
829,958
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {<NEW_LINE>super.drawGuiContainerBackgroundLayer(f, mx, my);<NEW_LINE>drawBackgroundSlots(mx, my);<NEW_LINE>Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);<NEW_LINE>CoreIconProvider[] sprites = new CoreIconProvider[2];<NEW_LINE>int count = 0;<NEW_LINE>CoreIconProvider sprite = CoreIconProvider.getForControlMode(filler.getControlMode());<NEW_LINE>if (filler.getControlMode() != Mode.On && sprite != null)<NEW_LINE>sprites[count++] = sprite;<NEW_LINE>if (filler.isPatternLocked())<NEW_LINE>sprites[count++] = CoreIconProvider.LOCK;<NEW_LINE>int xPos = OPTION_EXTRA_X_POS.getAsInt();<NEW_LINE>int yPos = OPTION_EXTRA_Y_POS.getAsInt();<NEW_LINE>if (count == 1) {<NEW_LINE>CoreIconProvider first = sprites[0] == null ? sprites[1] : sprites[0];<NEW_LINE>drawTexturedModalRect(guiLeft + xPos, guiTop + yPos, first.<MASK><NEW_LINE>} else if (count == 2) {<NEW_LINE>if (!OPTION_EXTRA_MODE_FIRST.getAsBoolean()) {<NEW_LINE>sprite = sprites[0];<NEW_LINE>sprites[0] = sprites[1];<NEW_LINE>sprites[1] = sprite;<NEW_LINE>}<NEW_LINE>drawTexturedModalRect(guiLeft + xPos - 8, guiTop + yPos, sprites[0].getSprite(), 16, 16);<NEW_LINE>drawTexturedModalRect(guiLeft + xPos + 8, guiTop + yPos, sprites[1].getSprite(), 16, 16);<NEW_LINE>}<NEW_LINE>}
getSprite(), 16, 16);
1,751,931
public void doFinally() {<NEW_LINE>if (t[0] == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>org.compiere.model.I_AD_User userInCharge = Services.get(IBPartnerOrgBL.class).retrieveUserInChargeOrNull(ctx, olCand.getAD_Org_ID(), trxName);<NEW_LINE>if (userInCharge == null) {<NEW_LINE>userInCharge = InterfaceWrapperHelper.create(ctx, Env.getAD_User_ID(ctx), I_AD_User.class, trxName);<NEW_LINE>}<NEW_LINE>final MNote note = new MNote(ctx, IOLCandBL.MSG_OL_CAND_PROCESSOR_PROCESSING_ERROR_0P, userInCharge.getAD_User_ID(), trxName);<NEW_LINE>note.setRecord(InterfaceWrapperHelper.getTableId(I_C_OLCand.class<MASK><NEW_LINE>note.setClientOrg(userInCharge.getAD_Client_ID(), userInCharge.getAD_Org_ID());<NEW_LINE>note.setTextMsg(t[0].getLocalizedMessage());<NEW_LINE>note.saveEx();<NEW_LINE>olCand.setIsError(true);<NEW_LINE>olCand.setAD_Note_ID(note.getAD_Note_ID());<NEW_LINE>olCand.setErrorMsg(t[0].getLocalizedMessage());<NEW_LINE>}
), olCand.getC_OLCand_ID());
544,055
// ~ Methods --------------------------------------------------------------------------------------------------------------<NEW_LINE>private String buildInfo() {<NEW_LINE>JmxModel jmx = JmxModelFactory.getJmxModelFor(module.getGlassFishRoot().getApplication());<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>try {<NEW_LINE>ObjectName objName = new ObjectName(module.getObjectName());<NEW_LINE>MBeanServerConnection connection = jmx.getMBeanServerConnection();<NEW_LINE>sb.append("<br/>");<NEW_LINE>sb.append("<b>Context: </b>").append(connection.getAttribute(objName, "path")).append("<br/>");<NEW_LINE>sb.append("<b>Document Base: </b>").append(connection.getAttribute(objName, "docBase")).append("<br/>");<NEW_LINE>sb.append("<b>Working Dir: </b>").append(connection.getAttribute(objName, "workDir")).append("<br/>");<NEW_LINE>sb.append("<br/>");<NEW_LINE>boolean cacheAllowed = (Boolean) <MASK><NEW_LINE>sb.append("<b>Caching: </b>").append(cacheAllowed ? "Allowed" : "Disallowed").append("<br/>");<NEW_LINE>sb.append("<br/>");<NEW_LINE>} catch (MBeanException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (AttributeNotFoundException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (InstanceNotFoundException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (ReflectionException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (MalformedObjectNameException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
connection.getAttribute(objName, "cachingAllowed");
463,293
private BucketSearchResult splitBucket(final List<Long> path, final int keyIndex, final K keyToInsert, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>final long pageIndex = path.get(path.size() - 1);<NEW_LINE>final OCacheEntry bucketEntry = loadPageForWrite(atomicOperation, fileId, pageIndex, false, true);<NEW_LINE>try {<NEW_LINE>final OSBTreeBucketV1<K, V> bucketToSplit = new OSBTreeBucketV1<>(bucketEntry);<NEW_LINE>final boolean splitLeaf = bucketToSplit.isLeaf();<NEW_LINE>final <MASK><NEW_LINE>final int indexToSplit = bucketSize >>> 1;<NEW_LINE>final K separationKey = bucketToSplit.getKey(indexToSplit, encryption, keySerializer);<NEW_LINE>final List<byte[]> rightEntries = new ArrayList<>(indexToSplit);<NEW_LINE>final int startRightIndex = splitLeaf ? indexToSplit : indexToSplit + 1;<NEW_LINE>for (int i = startRightIndex; i < bucketSize; i++) {<NEW_LINE>rightEntries.add(bucketToSplit.getRawEntry(i, encryption != null, keySerializer, valueSerializer));<NEW_LINE>}<NEW_LINE>if (pageIndex != ROOT_INDEX) {<NEW_LINE>return splitNonRootBucket(path, keyIndex, keyToInsert, pageIndex, bucketToSplit, splitLeaf, indexToSplit, separationKey, rightEntries, atomicOperation);<NEW_LINE>} else {<NEW_LINE>return splitRootBucket(path, keyIndex, keyToInsert, bucketEntry, bucketToSplit, splitLeaf, indexToSplit, separationKey, rightEntries, atomicOperation);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, bucketEntry);<NEW_LINE>}<NEW_LINE>}
int bucketSize = bucketToSplit.size();
985,696
@SuppressWarnings("unchecked")<NEW_LINE>public void beforeMethod(final AdviceTargetObject target, final Method method, final Object[] args, final MethodInvocationResult result) {<NEW_LINE>Span root = (Span) ((Map<String, Object>) args[2]).get(JaegerConstants.ROOT_SPAN);<NEW_LINE>Tracer.SpanBuilder builder = GlobalTracer.get().buildSpan(OPERATION_NAME);<NEW_LINE>if (null != root) {<NEW_LINE>builder = builder.asChildOf(root);<NEW_LINE>}<NEW_LINE>JDBCExecutionUnit executionUnit = (JDBCExecutionUnit) args[0];<NEW_LINE>Method getMetaDataMethod = JDBCExecutorCallback.class.<MASK><NEW_LINE>getMetaDataMethod.setAccessible(true);<NEW_LINE>DataSourceMetaData metaData = (DataSourceMetaData) getMetaDataMethod.invoke(target, new Object[] { executionUnit.getStorageResource().getConnection().getMetaData() });<NEW_LINE>builder.withTag(Tags.COMPONENT.getKey(), JaegerConstants.COMPONENT_NAME).withTag(Tags.DB_TYPE.getKey(), JaegerConstants.DB_TYPE_VALUE).withTag(Tags.DB_INSTANCE.getKey(), executionUnit.getExecutionUnit().getDataSourceName()).withTag(Tags.PEER_HOSTNAME.getKey(), metaData.getHostname()).withTag(Tags.PEER_PORT.getKey(), metaData.getPort()).withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT).withTag(Tags.DB_STATEMENT.getKey(), executionUnit.getExecutionUnit().getSqlUnit().getSql()).withTag(JaegerConstants.ShardingSphereTags.DB_BIND_VARIABLES.getKey(), executionUnit.getExecutionUnit().getSqlUnit().getParameters().toString());<NEW_LINE>target.setAttachment(builder.startActive(true));<NEW_LINE>}
getDeclaredMethod("getDataSourceMetaData", DatabaseMetaData.class);
1,763,422
public void testInputStreamIsClosedByUserBeforeSending() throws Exception {<NEW_LINE>List<IAttachment> attachments = new ArrayList<>();<NEW_LINE>CheckableInputStream inputStream = Util.<MASK><NEW_LINE>attachments.add(AttachmentBuilder.newBuilder("file1").inputStream("some.xml", inputStream).contentType(MediaType.APPLICATION_XML).build());<NEW_LINE>inputStream.close();<NEW_LINE>assertTrue("InputStream was closed but is reporting as unclosed...", inputStream.isClosed());<NEW_LINE>try {<NEW_LINE>client.target(URI_CONTEXT_ROOT).path("/app/multi").request(MediaType.TEXT_PLAIN).put(Entity.entity(attachments, MediaType.MULTIPART_FORM_DATA));<NEW_LINE>fail("Did not throw expected ProcessingException when sending a previously-closed input stream");<NEW_LINE>} catch (ProcessingException ex) {<NEW_LINE>// expected<NEW_LINE>} catch (Throwable t) {<NEW_LINE>System.out.println("Caught unexcepted exception: " + t);<NEW_LINE>t.printStackTrace();<NEW_LINE>fail("Caught unexcepted exception: " + t);<NEW_LINE>}<NEW_LINE>}
wrapStream(Util.xmlFile());
1,754,969
private void displayEmailMsg(MesssageArtifactData artifactData) {<NEW_LINE>enableCommonFields();<NEW_LINE>directionText.setEnabled(false);<NEW_LINE>ccLabel.setEnabled(true);<NEW_LINE>this.fromText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_FROM));<NEW_LINE>this.fromText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_FROM));<NEW_LINE>this.toText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_TO));<NEW_LINE>this.toText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_TO));<NEW_LINE>this.directionText.setText("");<NEW_LINE>this.ccText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_CC));<NEW_LINE>this.ccText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_CC));<NEW_LINE>this.subjectText.setText<MASK><NEW_LINE>this.datetimeText.setText(artifactData.getAttributeDisplayString(TSK_DATETIME_RCVD));<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_HEADERS), HDR_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_PLAIN), TEXT_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_HTML), HTML_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_RTF), RTF_TAB_INDEX);<NEW_LINE>configureAttachments(artifactData.getAttachements());<NEW_LINE>}
(artifactData.getAttributeDisplayString(TSK_SUBJECT));
441,152
public JMenu createAxisTitleMenu(final Chart2D chart, final IAxis<?> axis, final int axisDimension, final boolean adaptUI2Chart) {<NEW_LINE>// Axis title -> Axis title text<NEW_LINE>JMenu axisTitle;<NEW_LINE>if (adaptUI2Chart) {<NEW_LINE>axisTitle = new PropertyChangeMenu(chart, "Title", BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());<NEW_LINE>} else {<NEW_LINE>axisTitle = new JMenu("Title");<NEW_LINE>}<NEW_LINE>JMenuItem item;<NEW_LINE>if (adaptUI2Chart) {<NEW_LINE>item = new PropertyChangeMenuItem(chart, new AxisActionSetTitle(chart, "Title", axisDimension), <MASK><NEW_LINE>} else {<NEW_LINE>item = new JMenuItem(new AxisActionSetTitle(chart, "Title", axisDimension));<NEW_LINE>}<NEW_LINE>axisTitle.add(item);<NEW_LINE>// Axis title -> Axis title font<NEW_LINE>JMenu axisTitleFont;<NEW_LINE>if (adaptUI2Chart) {<NEW_LINE>axisTitleFont = new PropertyChangeMenu(chart, "Font", BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());<NEW_LINE>} else {<NEW_LINE>axisTitleFont = new JMenu("Font");<NEW_LINE>}<NEW_LINE>Font[] fonts = LayoutFactory.getSystemFonts(14f);<NEW_LINE>for (int i = fonts.length - 1; i > -1; i--) {<NEW_LINE>if (adaptUI2Chart) {<NEW_LINE>item = new OrderingCheckBoxPropertyChangeMenuItem(chart, new AxisActionSetTitleFont(chart, fonts[i].getName(), axisDimension, fonts[i]), axisTitleFont, false, BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());<NEW_LINE>} else {<NEW_LINE>item = new OrderingCheckBoxMenuItem(new AxisActionSetTitleFont(chart, fonts[i].getName(), axisDimension, fonts[i]), axisTitleFont, false);<NEW_LINE>}<NEW_LINE>item.setFont(fonts[i]);<NEW_LINE>axisTitleFont.add(item);<NEW_LINE>}<NEW_LINE>axisTitle.add(axisTitleFont);<NEW_LINE>return axisTitle;<NEW_LINE>}
BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());
1,216,112
private static byte[] buildPhpObjectPayload(String assertPayload) throws IOException {<NEW_LINE>// This crafted PHP object chains two PHP gadgets available in Joomla (disconnectHandlers in<NEW_LINE>// JDatabaseDriverMysqli and cache_name_function in SimplePie) to execute arbitrary PHP code.<NEW_LINE>String payloadString = "}__fake|O:21:\"JDatabaseDriverMysqli\":3:{" + "s:2:\"fc\";O:17:\"JSimplepieFactory\":0:{}" + "s:21:\"\\0\\0\\0disconnectHandlers\";a:1:{" + "i:0;a:2:{" + "i:0;O:9:\"SimplePie\":5:{" + "s:8:\"sanitize\";O:20:\"JDatabaseDriverMysql\":0:{}" + "s:8:\"feed_url\";s:" + assertPayload.length() + ":\"" + assertPayload + "\";" + "s:19:\"cache_name_function\";s:6:\"assert\";" + "s:5:\"cache\";b:1;" + "s:11:\"cache_class\";O:20:\"JDatabaseDriverMysql\":0:{}}" + "i:1;s:4:\"init\";}}" + "s:13:\"\\0\\0\\0connection\";b:1;}";<NEW_LINE>ByteArrayOutputStream payloadByteArray = new ByteArrayOutputStream();<NEW_LINE>payloadByteArray.write<MASK><NEW_LINE>// Adding this invalid UTF-8 codepoint will truncate the session entry in the database, removing<NEW_LINE>// the right half of the original object that we are replacing.<NEW_LINE>payloadByteArray.write(INVALID_UTF8);<NEW_LINE>return payloadByteArray.toByteArray();<NEW_LINE>}
(payloadString.getBytes(UTF_8));
1,529,840
public boolean analysisWorkerCallback(Program program, Object workerContext, TaskMonitor monitor) throws Exception {<NEW_LINE>Address address = program.getAddressFactory().getAddressSpace(JavaLoader.CONSTANT_POOL).getMinAddress();<NEW_LINE>ByteProvider provider = new MemoryByteProvider(program.getMemory(), address);<NEW_LINE>BinaryReader reader = new BinaryReader(provider, !program.getLanguage().isBigEndian());<NEW_LINE>ClassFileJava classFile = new ClassFileJava(reader);<NEW_LINE>DataType classFileDataType = classFile.toDataType();<NEW_LINE>Data cpClassFileData = createData(program, address, classFileDataType);<NEW_LINE>if (cpClassFileData == null) {<NEW_LINE>log.appendMsg("Unable to create header data.");<NEW_LINE>}<NEW_LINE>Data constantPoolData = cpClassFileData.getComponent(4);<NEW_LINE>markupConstantPoolAndReferences(<MASK><NEW_LINE>createProgramDataTypes(program, classFile, monitor, log);<NEW_LINE>markupFields(program, classFile, monitor);<NEW_LINE>markupMethods(program, classFile, monitor);<NEW_LINE>disassembleMethods(program, classFile, monitor);<NEW_LINE>processInstructions(program, constantPoolData, classFile, monitor);<NEW_LINE>recordJavaVersionInfo(program, classFile);<NEW_LINE>ProgramCompilerSpec.enableJavaLanguageDecompilation(program);<NEW_LINE>return true;<NEW_LINE>}
program, classFile, constantPoolData, monitor);
625,427
void findRelatedPastFrames(Frame current) {<NEW_LINE>// Both values below are needed for early termination of search<NEW_LINE>int currentTrackCount = frames.getTail().featureCount();<NEW_LINE>int oldestFrameConsidered = searchRadius < 0 ? 0 : Math.max(0, frames.size - 1 - searchRadius);<NEW_LINE>// Check the most recent past frames first, up until it hits the limit or there are too few tracks<NEW_LINE>for (int frameCnt = frames.size - 2; frameCnt >= oldestFrameConsidered; frameCnt--) {<NEW_LINE>Frame previous = frames.get(frameCnt);<NEW_LINE>// See if there are any features which have been observed in both frames<NEW_LINE>pairs.reset();<NEW_LINE>final int prevNumObs = previous.featureCount();<NEW_LINE>for (int previousIdx = 0; previousIdx < prevNumObs; previousIdx++) {<NEW_LINE>int currentIdx = current.id_to_index.get(previous.getID(previousIdx));<NEW_LINE>if (currentIdx < 0)<NEW_LINE>continue;<NEW_LINE>pairs.grow().setTo(currentIdx, previousIdx);<NEW_LINE>}<NEW_LINE>// If the number of common tracks is too small, don't consider this pairing<NEW_LINE>// The loop will stop here since there is the simplifying assumption that the number of common<NEW_LINE>// tracks can only go down. The loop closure logic should partially make up for this if it isn't true<NEW_LINE>// otherwise we have to consider the entire history<NEW_LINE>if (pairs.size == 0 || pairs.size < minimumCommonTracks.computeI(Math.min(currentTrackCount, previous.featureCount())))<NEW_LINE>break;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
connectFrames(current, previous, pairs);
1,585,913
public LinkedList<Object> makeEventStream(int numberOfTicks, int ratioOutOfLimit, int numberOfStocks, double priceLimitPctLowerLimit, double priceLimitPctUpperLimit, double priceLowerLimit, double priceUpperLimit, boolean isLastTickOutOfLimit) {<NEW_LINE>LinkedList<Object> stream = new LinkedList<Object>();<NEW_LINE>PriceLimit[] limitBeans = makeLimits(<MASK><NEW_LINE>for (int i = 0; i < limitBeans.length; i++) {<NEW_LINE>stream.add(limitBeans[i]);<NEW_LINE>}<NEW_LINE>// The first stock ticker sets up an initial price<NEW_LINE>StockTick[] initialPrices = makeInitialPriceStockTicks(limitBeans, priceLowerLimit, priceUpperLimit);<NEW_LINE>for (int i = 0; i < initialPrices.length; i++) {<NEW_LINE>stream.add(initialPrices[i]);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < numberOfTicks; i++) {<NEW_LINE>int index = i % limitBeans.length;<NEW_LINE>StockTick tick = makeStockTick(limitBeans[index], initialPrices[index]);<NEW_LINE>// Generate an out-of-limit price<NEW_LINE>if ((i % ratioOutOfLimit) == 0) {<NEW_LINE>tick = new StockTick(tick.getSymbol(), -1);<NEW_LINE>}<NEW_LINE>// Last tick is out-of-limit as well<NEW_LINE>if ((i == (numberOfTicks - 1)) && isLastTickOutOfLimit) {<NEW_LINE>tick = new StockTick(tick.getSymbol(), 9999);<NEW_LINE>}<NEW_LINE>stream.add(tick);<NEW_LINE>}<NEW_LINE>return stream;<NEW_LINE>}
"example_user", numberOfStocks, priceLimitPctLowerLimit, priceLimitPctUpperLimit);
575,922
public static String fillTextBox(TextPaint paint, int fragmentWidth, String source, int start) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>final int length = source.length();<NEW_LINE>int indexLeft = start;<NEW_LINE>int indexRight = start + 1;<NEW_LINE>int lastWhiteSpaceL = 0;<NEW_LINE>int lastWhiteSpaceR = 0;<NEW_LINE>while (paint.measureText(sb.toString()) < fragmentWidth && (indexLeft >= 0 || indexRight < length)) {<NEW_LINE>if (indexLeft >= 0) {<NEW_LINE>char <MASK><NEW_LINE>if (Character.isWhitespace(c))<NEW_LINE>lastWhiteSpaceL = indexLeft;<NEW_LINE>sb.insert(0, c);<NEW_LINE>indexLeft--;<NEW_LINE>}<NEW_LINE>if (indexRight < length) {<NEW_LINE>char c = source.charAt(indexRight);<NEW_LINE>if (Character.isWhitespace(c))<NEW_LINE>lastWhiteSpaceR = indexRight;<NEW_LINE>sb.append(c);<NEW_LINE>indexRight++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (indexLeft >= 0) {<NEW_LINE>// Delete first word part<NEW_LINE>sb.delete(0, lastWhiteSpaceL - indexLeft);<NEW_LINE>sb.insert(0, "...");<NEW_LINE>// Set new index left<NEW_LINE>indexLeft = lastWhiteSpaceL - 3;<NEW_LINE>}<NEW_LINE>if (indexRight < length) {<NEW_LINE>// Delete last word part<NEW_LINE>sb.delete(lastWhiteSpaceR - (indexLeft + 1), sb.length());<NEW_LINE>sb.append("...");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
c = source.charAt(indexLeft);
1,752,481
final ListResourcesInProtectionGroupResult executeListResourcesInProtectionGroup(ListResourcesInProtectionGroupRequest listResourcesInProtectionGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listResourcesInProtectionGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListResourcesInProtectionGroupRequest> request = null;<NEW_LINE>Response<ListResourcesInProtectionGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListResourcesInProtectionGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listResourcesInProtectionGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Shield");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListResourcesInProtectionGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListResourcesInProtectionGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListResourcesInProtectionGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,731,480
private void runAssertion(RegressionEnvironment env, boolean advanced, String filter) {<NEW_LINE>String epl = HOOK + "@name('s0') select * from pattern[every s0=SupportBean_S0 -> " + "SupportBean_S1(" + filter + ")]";<NEW_LINE>SupportFilterPlanHook.reset();<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>SupportFilterPlanPath path = makePathFromSingle("p10", EQUAL, "a");<NEW_LINE>if (advanced) {<NEW_LINE>assertPlanSingleByType("SupportBean_S1", new SupportFilterPlan("s0.p00=\"x\" or s0.p01=\"y\"", null, path));<NEW_LINE>}<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "x", "-"));<NEW_LINE>if (advanced) {<NEW_LINE>assertFilterSvcEmpty(env, "s0", "SupportBean_S1");<NEW_LINE>}<NEW_LINE>sendS1Assert(<MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "-", "y"));<NEW_LINE>if (advanced) {<NEW_LINE>assertFilterSvcEmpty(env, "s0", "SupportBean_S1");<NEW_LINE>}<NEW_LINE>sendS1Assert(env, 20, "-", true);<NEW_LINE>env.sendEventBean(new SupportBean_S0(3, "-", "-"));<NEW_LINE>if (advanced) {<NEW_LINE>assertFilterSvcByTypeSingle(env, "s0", "SupportBean_S1", new FilterItem("p10", EQUAL));<NEW_LINE>}<NEW_LINE>sendS1Assert(env, 30, "-", false);<NEW_LINE>sendS1Assert(env, 31, "a", true);<NEW_LINE>env.undeployAll();<NEW_LINE>}
env, 10, "-", true);
1,664,320
public Integer commit() {<NEW_LINE>int count = this.batchSize();<NEW_LINE>if (count <= 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// TODO: this will not be atomic, to be improved<NEW_LINE>for (Entry<String, List<Row>> action : this.batch.entrySet()) {<NEW_LINE>List<Row> rows = action.getValue();<NEW_LINE>Object[] results = new Object[rows.size()];<NEW_LINE>try (Table table = table(action.getKey())) {<NEW_LINE>table.batch(rows, results);<NEW_LINE>checkBatchResults(results, rows);<NEW_LINE>} catch (InterruptedIOException e) {<NEW_LINE>throw new BackendException("Interrupted, " + "maybe it is timed out", e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// TODO: Mark and delete committed records<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clear batch if write() successfully (retained if failed)<NEW_LINE>this.batch.clear();<NEW_LINE>return count;<NEW_LINE>}
BackendException("Failed to commit, " + "there may be inconsistent states for HBase", e);
1,826,245
private void computeLexicalScopes(AncestorChain<?> ac, LexicalScope parent, List<LexicalScope> scopes) {<NEW_LINE>// Compute the scope for the current node.<NEW_LINE>// Since we create a global scope in the original caller, avoid creating<NEW_LINE>// two scopes for the same object here.<NEW_LINE>LexicalScope scope = parent;<NEW_LINE>if (introducesScope(ac) && scope.root != ac) {<NEW_LINE>scope = new LexicalScope(ac, parent);<NEW_LINE>scopes.add(scope);<NEW_LINE>// Sets up the symbol table.<NEW_LINE>initScope(scope);<NEW_LINE>}<NEW_LINE>assert (ac.node instanceof Identifier || !ac.node.getAttributes().containsKey(CONTAINING_SCOPE)) : "Scope already attached to node";<NEW_LINE>ac.node.getAttributes().set(CONTAINING_SCOPE, scope);<NEW_LINE>// initScope may have set up some symbols, but if this is a declaration,<NEW_LINE>// do the appropriate hoisting and declarations.<NEW_LINE>if (ac.node instanceof Declaration) {<NEW_LINE>AncestorChain<Declaration> d = ac.cast(Declaration.class);<NEW_LINE>LexicalScope definingScope = scope;<NEW_LINE>while (definingScope.parent != null && hoist(d, definingScope)) {<NEW_LINE>definingScope = definingScope.parent;<NEW_LINE>}<NEW_LINE>ac.node.getAttributes().set(DEFINING_SCOPE, definingScope);<NEW_LINE>definingScope.symbols.declare(ac.cast(Declaration.class));<NEW_LINE>}<NEW_LINE>// recurse to children<NEW_LINE>for (ParseTreeNode child : ac.node.children()) {<NEW_LINE>computeLexicalScopes(AncestorChain.instance(ac<MASK><NEW_LINE>}<NEW_LINE>}
, child), scope, scopes);
1,448,510
public com.amazonaws.services.rdsdata.model.BadRequestException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.rdsdata.model.BadRequestException badRequestException = new com.amazonaws.services.rdsdata.model.BadRequestException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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 badRequestException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,533,888
public DescribeImageReplicationStatusResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeImageReplicationStatusResult describeImageReplicationStatusResult = new DescribeImageReplicationStatusResult();<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 describeImageReplicationStatusResult;<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("repositoryName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeImageReplicationStatusResult.setRepositoryName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("imageId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeImageReplicationStatusResult.setImageId(ImageIdentifierJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("replicationStatuses", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeImageReplicationStatusResult.setReplicationStatuses(new ListUnmarshaller<ImageReplicationStatus>(ImageReplicationStatusJsonUnmarshaller.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 describeImageReplicationStatusResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
862,962
PollerFlux<PhoneNumberOperation, PhoneNumberSearchResult> beginSearchAvailablePhoneNumbers(String countryCode, PhoneNumberType phoneNumberType, PhoneNumberAssignmentType assignmentType, PhoneNumberCapabilities capabilities, PhoneNumberSearchOptions searchOptions, Context context) {<NEW_LINE>try {<NEW_LINE>Objects.requireNonNull(countryCode, "'countryCode' cannot be null.");<NEW_LINE>Objects.requireNonNull(phoneNumberType, "'phoneNumberType' cannot be null.");<NEW_LINE>Objects.requireNonNull(assignmentType, "'assignmentType' cannot be null.");<NEW_LINE>Objects.requireNonNull(capabilities, "'capabilities' cannot be null.");<NEW_LINE>String areaCode = null;<NEW_LINE>Integer quantity = null;<NEW_LINE>if (searchOptions != null) {<NEW_LINE>areaCode = searchOptions.getAreaCode();<NEW_LINE>quantity = searchOptions.getQuantity();<NEW_LINE>}<NEW_LINE>PhoneNumberSearchRequest searchRequest = new PhoneNumberSearchRequest();<NEW_LINE>searchRequest.setPhoneNumberType(phoneNumberType).setAssignmentType(assignmentType).setCapabilities(capabilities).setAreaCode(areaCode).setQuantity(quantity);<NEW_LINE>return new PollerFlux<>(defaultPollInterval, searchAvailableNumbersInitOperation(countryCode, searchRequest, context), pollOperation(), <MASK><NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>return PollerFlux.error(ex);<NEW_LINE>}<NEW_LINE>}
cancelOperation(), searchAvailableNumbersFetchFinalResultOperation());
533,869
private static EditorModel initialModel() {<NEW_LINE><MASK><NEW_LINE>EditorElement image = new EditorElement(new UrlRenderer("https://cdn.aarp.net/content/dam/aarp/home-and-family/your-home/2018/06/1140-house-inheriting.imgcache.rev68c065601779c5d76b913cf9ec3a977e.jpg"));<NEW_LINE>image.getFlags().setSelectable(false).persist();<NEW_LINE>model.addElement(image);<NEW_LINE>EditorElement elementC = new EditorElement(new UrlRenderer("https://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/SNice.svg/220px-SNice.svg.png"));<NEW_LINE>elementC.getLocalMatrix().postScale(0.2f, 0.2f);<NEW_LINE>// elementC.getLocalMatrix().postRotate(30);<NEW_LINE>model.addElement(elementC);<NEW_LINE>EditorElement elementE = new EditorElement(new UrlRenderer("https://www.vitalessentialsraw.com/assets/images/background-images/laying-grey-cat.png"));<NEW_LINE>elementE.getLocalMatrix().postScale(0.2f, 0.2f);<NEW_LINE>// elementE.getLocalMatrix().postRotate(60);<NEW_LINE>model.addElement(elementE);<NEW_LINE>EditorElement elementD = new EditorElement(new UrlRenderer("https://petspluslubbocktx.com/files/2016/11/DC-Cat-Weight-Management.png"));<NEW_LINE>elementD.getLocalMatrix().postScale(0.2f, 0.2f);<NEW_LINE>// elementD.getLocalMatrix().postRotate(60);<NEW_LINE>model.addElement(elementD);<NEW_LINE>EditorElement elementF = new EditorElement(new UrlRenderer("https://purepng.com/public/uploads/large/purepng.com-black-top-hathatsstandard-sizeblacktop-14215263591972x0zh.png"));<NEW_LINE>elementF.getLocalMatrix().postScale(0.2f, 0.2f);<NEW_LINE>// elementF.getLocalMatrix().postRotatF(60);<NEW_LINE>model.addElement(elementF);<NEW_LINE>EditorElement elementG = new EditorElement(new UriRenderer(Uri.parse("file:///android_asset/food/apple.png")));<NEW_LINE>elementG.getLocalMatrix().postScale(0.2f, 0.2f);<NEW_LINE>// elementG.getLocalMatrix().postRotatG(60);<NEW_LINE>model.addElement(elementG);<NEW_LINE>EditorElement elementH = new EditorElement(new MultiLineTextRenderer("Hello, World!", 0xff0000ff, MultiLineTextRenderer.Mode.REGULAR));<NEW_LINE>// elementH.getLocalMatrix().postScale(0.2f, 0.2f);<NEW_LINE>model.addElement(elementH);<NEW_LINE>EditorElement elementH2 = new EditorElement(new MultiLineTextRenderer("Hello, World 2!", 0xff0000ff, MultiLineTextRenderer.Mode.REGULAR));<NEW_LINE>// elementH.getLocalMatrix().postScale(0.2f, 0.2f);<NEW_LINE>model.addElement(elementH2);<NEW_LINE>return model;<NEW_LINE>}
EditorModel model = EditorModel.create();
1,409,856
public void complete(ReturnResultsState state, TridentCollector collector) {<NEW_LINE>// only one of the multireducers will receive the tuples<NEW_LINE>if (state.returnInfo != null) {<NEW_LINE>String result = JSONValue.toJSONString(state.results);<NEW_LINE>Map retMap = (Map) JSONValue.parse(state.returnInfo);<NEW_LINE>final String host = (<MASK><NEW_LINE>final int port = Utils.getInt(retMap.get("port"));<NEW_LINE>String id = (String) retMap.get("id");<NEW_LINE>DistributedRPCInvocations.Iface client;<NEW_LINE>if (local) {<NEW_LINE>client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host);<NEW_LINE>} else {<NEW_LINE>List server = new ArrayList() {<NEW_LINE><NEW_LINE>{<NEW_LINE>add(host);<NEW_LINE>add(port);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (!_clients.containsKey(server)) {<NEW_LINE>try {<NEW_LINE>_clients.put(server, new DRPCInvocationsClient(conf, host, port));<NEW_LINE>} catch (TTransportException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>client = _clients.get(server);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>client.result(id, result);<NEW_LINE>} catch (AuthorizationException aze) {<NEW_LINE>collector.reportError(aze);<NEW_LINE>} catch (TException e) {<NEW_LINE>collector.reportError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String) retMap.get("host");
464,578
protected Dialog onCreateDialog(int id) {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(this);<NEW_LINE>LayoutInflater <MASK><NEW_LINE>switch(id) {<NEW_LINE>case DIALOG_ENTER_COORDINATES:<NEW_LINE>builder.setIcon(android.R.drawable.ic_menu_mylocation);<NEW_LINE>builder.setTitle(R.string.dialog_location_title);<NEW_LINE>final View view = factory.inflate(R.layout.dialog_enter_coordinates, null);<NEW_LINE>builder.setView(view);<NEW_LINE>builder.setPositiveButton(R.string.okbutton, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>double lat = Double.parseDouble(((EditText) view.findViewById(R.id.latitude)).getText().toString());<NEW_LINE>double lon = Double.parseDouble(((EditText) view.findViewById(R.id.longitude)).getText().toString());<NEW_LINE>byte zoomLevel = (byte) ((((SeekBar) view.findViewById(R.id.zoomlevel)).getProgress()) + SamplesBaseActivity.this.mapView.getModel().mapViewPosition.getZoomLevelMin());<NEW_LINE>SamplesBaseActivity.this.mapView.getModel().mapViewPosition.setMapPosition(new MapPosition(new LatLong(lat, lon), zoomLevel));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(R.string.cancelbutton, null);<NEW_LINE>return builder.create();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
factory = LayoutInflater.from(this);
1,597,798
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.messaging.security.beans.Permission#addUsersAndGroupsToAllActions(java.util.Set, java.util.Set)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void addUsersAndGroupsToAllActions(Set<String> users, Set<String> groups) {<NEW_LINE>Set<String> tempUsers <MASK><NEW_LINE>Set<String> tempGroups = new HashSet<String>();<NEW_LINE>tempUsers.addAll(users);<NEW_LINE>tempGroups.addAll(groups);<NEW_LINE>addAllUsersToRole(tempUsers, MessagingSecurityConstants.OPERATION_TYPE_SEND);<NEW_LINE>addAllGroupsToRole(tempGroups, MessagingSecurityConstants.OPERATION_TYPE_SEND);<NEW_LINE>addAllUsersToRole(tempUsers, MessagingSecurityConstants.OPERATION_TYPE_RECEIVE);<NEW_LINE>addAllGroupsToRole(tempGroups, MessagingSecurityConstants.OPERATION_TYPE_RECEIVE);<NEW_LINE>}
= new HashSet<String>();
630,204
public static SQLQueryAdapter executeReindex(SQLite3GlobalState globalState) {<NEW_LINE>SQLite3Schema s = globalState.getSchema();<NEW_LINE>StringBuilder sb = new StringBuilder("REINDEX");<NEW_LINE>ExpectedErrors errors = new ExpectedErrors();<NEW_LINE>errors.add("The database file is locked");<NEW_LINE>Target t = Randomly.<MASK><NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>sb.append(" ");<NEW_LINE>switch(t) {<NEW_LINE>case INDEX:<NEW_LINE>sb.append(s.getRandomIndexOrBailout());<NEW_LINE>// temp table<NEW_LINE>errors.add("unable to identify the object to be reindexed");<NEW_LINE>break;<NEW_LINE>case COLLATION_NAME:<NEW_LINE>sb.append(Randomly.fromOptions("BINARY", "NOCASE", "RTRIM"));<NEW_LINE>break;<NEW_LINE>case TABLE:<NEW_LINE>sb.append(" ");<NEW_LINE>sb.append(s.getRandomTableOrBailout(tab -> !tab.isTemp() && !tab.isView()).getName());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SQLQueryAdapter(sb.toString(), errors, true);<NEW_LINE>}
fromOptions(Target.values());
686,910
public Executor select(final String reqClass, final Object reqHeader) {<NEW_LINE>final AppendEntriesRequestHeader header = (AppendEntriesRequestHeader) reqHeader;<NEW_LINE>final String groupId = header.getGroupId();<NEW_LINE>final String peerId = header.getPeerId();<NEW_LINE>final String serverId = header.getServerId();<NEW_LINE>final PeerId peer = new PeerId();<NEW_LINE>if (!peer.parse(peerId)) {<NEW_LINE>return executor();<NEW_LINE>}<NEW_LINE>final Node node = NodeManager.getInstance(<MASK><NEW_LINE>if (node == null || !node.getRaftOptions().isReplicatorPipeline()) {<NEW_LINE>return executor();<NEW_LINE>}<NEW_LINE>// The node enable pipeline, we should ensure bolt support it.<NEW_LINE>RpcFactoryHelper.rpcFactory().ensurePipeline();<NEW_LINE>final PeerRequestContext ctx = getOrCreatePeerRequestContext(groupId, pairOf(peerId, serverId), null);<NEW_LINE>return ctx.executor;<NEW_LINE>}
).get(groupId, peer);
195,817
private CodecMeta toSampleEntry(GenericDescriptor d) {<NEW_LINE>if (track.isVideo()) {<NEW_LINE>GenericPictureEssenceDescriptor ped = (GenericPictureEssenceDescriptor) d;<NEW_LINE><MASK><NEW_LINE>VideoCodecMeta se = VideoCodecMeta.createVideoCodecMeta(MP4Util.getFourcc(track.getCodec().getCodec()), null, new Size(ped.getDisplayWidth(), ped.getDisplayHeight()), new Rational((int) ((1000 * ar.getNum() * ped.getDisplayHeight()) / (ar.getDen() * ped.getDisplayWidth())), 1000));<NEW_LINE>return se;<NEW_LINE>} else if (track.isAudio()) {<NEW_LINE>GenericSoundEssenceDescriptor sed = (GenericSoundEssenceDescriptor) d;<NEW_LINE>int sampleSize = sed.getQuantizationBits() >> 3;<NEW_LINE>MXFCodec codec = track.getCodec();<NEW_LINE>Label[] labels = new Label[sed.getChannelCount()];<NEW_LINE>Arrays.fill(labels, Label.Mono);<NEW_LINE>return AudioCodecMeta.createAudioCodecMeta(sampleSize == 3 ? "in24" : "sowt", sampleSize, sed.getChannelCount(), (int) sed.getAudioSamplingRate().scalar(), codec == MXFCodec.PCM_S16BE ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN, true, labels, null);<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Can't get sample entry");<NEW_LINE>}
Rational ar = ped.getAspectRatio();
1,774,759
private Timestamp computeEndDate(final I_C_Flatrate_Transition transition, final I_C_Flatrate_Term term) {<NEW_LINE>final Timestamp firstDayOfTerm = term.getStartDate();<NEW_LINE>Timestamp lastDayOfTerm = null;<NEW_LINE>// metas: rc: start 03742<NEW_LINE>// Condition added to handle "EnsWithCalendarYear" flag for transitions<NEW_LINE>if (transition.isEndsWithCalendarYear()) {<NEW_LINE>// term duration in years<NEW_LINE>final int termDuration;<NEW_LINE>if (X_C_Flatrate_Transition.TERMDURATIONUNIT_JahrE.equals(transition.getTermDurationUnit())) {<NEW_LINE>termDuration = transition.getTermDuration();<NEW_LINE>} else {<NEW_LINE>// make sure that durationUnit==month and duration==(n times 12); note that we have a model interceptor which enforces this.<NEW_LINE>Check.errorUnless(X_C_Flatrate_Transition.TERMDURATIONUNIT_MonatE.equals(transition.getTermDurationUnit()), "The term duration unit is not suitable for a term that ends with calendar year");<NEW_LINE>Check.errorUnless(transition.getTermDuration() % 12 == 0, "Term duration not suitable for a term that ends with calendar year");<NEW_LINE>termDuration = transition.getTermDuration() / 12;<NEW_LINE>}<NEW_LINE>final I_C_Calendar calendar = transition.getC_Calendar_Contract();<NEW_LINE>// first day of term or first day of new year<NEW_LINE>Timestamp currentFirstDay = firstDayOfTerm;<NEW_LINE>for (int i = 0; i < termDuration; i++) {<NEW_LINE>final List<I_C_Period> periodsContainingDay = Services.get(ICalendarDAO.class).retrievePeriods(InterfaceWrapperHelper.getCtx(transition), calendar, currentFirstDay, currentFirstDay, InterfaceWrapperHelper.getTrxName(transition));<NEW_LINE>Check.errorIf(periodsContainingDay.isEmpty(), "Date {} does not exist in calendar={}", currentFirstDay, calendar);<NEW_LINE>Check.errorIf(periodsContainingDay.size() > 1, "Date {} is contained in more than one period of calendar={}; periodsContainingDay={}", currentFirstDay, calendar, periodsContainingDay);<NEW_LINE>final I_C_Period period = CollectionUtils.singleElement(periodsContainingDay);<NEW_LINE>final I_C_Year year = period.getC_Year();<NEW_LINE>lastDayOfTerm = Services.get(ICalendarBL.class).getLastDayOfYear(year);<NEW_LINE>currentFirstDay = TimeUtil.addDays(lastDayOfTerm, 1);<NEW_LINE>}<NEW_LINE>} else // Case: If TermDuration is ZERO, we shall not calculate the EndDate automatically,<NEW_LINE>// but rely on what was set<NEW_LINE>if (transition.getTermDuration() == 0) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>if (X_C_Flatrate_Transition.TERMDURATIONUNIT_JahrE.equals(transition.getTermDurationUnit())) {<NEW_LINE>lastDayOfTerm = TimeUtil.addDays(TimeUtil.addYears(firstDayOfTerm, transition.getTermDuration()), -1);<NEW_LINE>} else if (X_C_Flatrate_Transition.TERMDURATIONUNIT_MonatE.equals(transition.getTermDurationUnit())) {<NEW_LINE>lastDayOfTerm = TimeUtil.addDays(TimeUtil.addMonths(firstDayOfTerm, transition.getTermDuration()), -1);<NEW_LINE>} else if (X_C_Flatrate_Transition.TERMDURATIONUNIT_WocheN.equals(transition.getTermDurationUnit())) {<NEW_LINE>lastDayOfTerm = TimeUtil.addDays(TimeUtil.addWeeks(firstDayOfTerm, transition.getTermDuration()), -1);<NEW_LINE>} else if (X_C_Flatrate_Transition.TERMDURATIONUNIT_TagE.equals(transition.getTermDurationUnit())) {<NEW_LINE>lastDayOfTerm = TimeUtil.addDays(TimeUtil.addDays(firstDayOfTerm, transition.<MASK><NEW_LINE>} else {<NEW_LINE>Check.assume(false, "TermDurationUnit " + transition.getTermDuration() + " doesn't exist");<NEW_LINE>// code won't be reached<NEW_LINE>lastDayOfTerm = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return lastDayOfTerm;<NEW_LINE>}
getTermDuration()), -1);
1,493,186
public int compareTo(getTopologyId_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.<MASK><NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_success()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_e()).compareTo(other.is_set_e());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_e()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
getClass().getName());
1,158,393
private Position decodeLink(String sentence, Channel channel, SocketAddress remoteAddress) {<NEW_LINE>Parser parser = new Parser(PATTERN_LINK, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, <MASK><NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>DateBuilder dateBuilder = new DateBuilder().setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>position.set(Position.KEY_RSSI, parser.nextInt());<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());<NEW_LINE>position.set(Position.KEY_STEPS, parser.nextInt());<NEW_LINE>position.set("turnovers", parser.nextInt());<NEW_LINE>dateBuilder.setDateReverse(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>getLastLocation(position, dateBuilder.getDate());<NEW_LINE>processStatus(position, parser.nextLong(16, 0));<NEW_LINE>return position;<NEW_LINE>}
remoteAddress, parser.next());
1,705,578
public static Map<String, Map<String, Field>> rowListToMap(List<Row> rowList, List<String> primaryKeyList) {<NEW_LINE>// {value of primaryKey, value of all columns}<NEW_LINE>Map<String, Map<String, Field>> rowMap = new HashMap<>();<NEW_LINE>for (Row row : rowList) {<NEW_LINE>// ensure the order of column<NEW_LINE>List<Field> rowFieldList = row.getFields().stream().sorted(Comparator.comparing(Field::getName)).<MASK><NEW_LINE>// {uppercase fieldName : field}<NEW_LINE>Map<String, Field> colsMap = new HashMap<>();<NEW_LINE>StringBuilder rowKey = new StringBuilder();<NEW_LINE>boolean firstUnderline = false;<NEW_LINE>for (int j = 0; j < rowFieldList.size(); j++) {<NEW_LINE>Field field = rowFieldList.get(j);<NEW_LINE>if (primaryKeyList.stream().anyMatch(e -> field.getName().equals(e))) {<NEW_LINE>if (firstUnderline && j > 0) {<NEW_LINE>rowKey.append("_");<NEW_LINE>}<NEW_LINE>rowKey.append(String.valueOf(field.getValue()));<NEW_LINE>firstUnderline = true;<NEW_LINE>}<NEW_LINE>colsMap.put(field.getName().trim().toUpperCase(), field);<NEW_LINE>}<NEW_LINE>rowMap.put(rowKey.toString(), colsMap);<NEW_LINE>}<NEW_LINE>return rowMap;<NEW_LINE>}
collect(Collectors.toList());
1,586,623
public void addConnectionEventListener(ConnectionEventListener listener) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "addConnectionEventListener", new Object[] { this, listener });<NEW_LINE>if (listener == null)<NEW_LINE>throw new NullPointerException("Cannot add null ConnectionEventListener.");<NEW_LINE>// check if the array is already full<NEW_LINE>if (numListeners >= ivEventListeners.length) {<NEW_LINE>// there is not enough room for the listener in the array<NEW_LINE>// create a new, bigger array<NEW_LINE>ConnectionEventListener[] tempArray = ivEventListeners;<NEW_LINE>ivEventListeners = new ConnectionEventListener[numListeners + 3];<NEW_LINE>// parms: arraycopy(Object source, int srcIndex, Object dest, int<NEW_LINE>// destIndex, int length)<NEW_LINE>System.arraycopy(tempArray, 0, ivEventListeners, 0, tempArray.length);<NEW_LINE>// point out in the trace that we had to do this - consider code<NEW_LINE>// changes if there<NEW_LINE>// are new CELs to handle (change KNOWN_NUMBER_OF_CELS, new events?,<NEW_LINE>// ...)<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(<MASK><NEW_LINE>}<NEW_LINE>// add listener to the array, increment listener counter<NEW_LINE>ivEventListeners[numListeners++] = listener;<NEW_LINE>}
tc, "received more ConnectionEventListeners than expected, increased array size to " + ivEventListeners.length);
963,504
private File buildSegment() throws Exception {<NEW_LINE>Schema schema = new Schema();<NEW_LINE>for (int i = 0; i < NUM_COLUMNS; i++) {<NEW_LINE>String column = "column_" + i;<NEW_LINE>DimensionFieldSpec dimensionFieldSpec = new DimensionFieldSpec(column, FieldSpec.DataType.STRING, true);<NEW_LINE>schema.addField(dimensionFieldSpec);<NEW_LINE>}<NEW_LINE>TableConfig tableConfig = new TableConfigBuilder(TableType.OFFLINE).setTableName("test").build();<NEW_LINE>SegmentGeneratorConfig config = new SegmentGeneratorConfig(tableConfig, schema);<NEW_LINE>config.setRawIndexCreationColumns(Collections.singletonList(_rawIndexColumn));<NEW_LINE>config.setOutDir(SEGMENT_DIR_NAME);<NEW_LINE>config.setSegmentName(SEGMENT_NAME);<NEW_LINE>BufferedReader reader = new BufferedReader(new FileReader(_dataFile));<NEW_LINE>String value;<NEW_LINE>final List<GenericRow> rows = new ArrayList<>();<NEW_LINE>System.out.println("Reading data...");<NEW_LINE>while ((value = reader.readLine()) != null) {<NEW_LINE>HashMap<String, Object> map = new HashMap<>();<NEW_LINE>for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) {<NEW_LINE>map.put(fieldSpec.getName(), value);<NEW_LINE>}<NEW_LINE>GenericRow genericRow = new GenericRow();<NEW_LINE>genericRow.init(map);<NEW_LINE>rows.add(genericRow);<NEW_LINE>_numRows++;<NEW_LINE>if (_numRows % 1000000 == 0) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Generating segment...");<NEW_LINE>SegmentIndexCreationDriverImpl driver = new SegmentIndexCreationDriverImpl();<NEW_LINE>driver.init(config, new GenericRowRecordReader(rows));<NEW_LINE>driver.build();<NEW_LINE>return new File(SEGMENT_DIR_NAME, SEGMENT_NAME);<NEW_LINE>}
out.println("Read rows: " + _numRows);
114,721
protected void initSubscription() {<NEW_LINE>addSubscription(RxEvent.EVENT_COMIC_UPDATE, new Action1<RxEvent>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(RxEvent rxEvent) {<NEW_LINE>if (mComic.getId() != null && mComic.getId() == (long) rxEvent.getData()) {<NEW_LINE>Comic comic = mComicManager.load(mComic.getId());<NEW_LINE>mComic.<MASK><NEW_LINE>mComic.setLast(comic.getLast());<NEW_LINE>mComic.setChapter(comic.getChapter());<NEW_LINE>mBaseView.onLastChange(mComic.getLast());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addSubscription(RxEvent.EVENT_COMIC_UPDATE_INFO, new Action1<RxEvent>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(RxEvent rxEvent) {<NEW_LINE>if (mComic.getId() != null) {<NEW_LINE>Comic comic = (Comic) rxEvent.getData();<NEW_LINE>mComicManager.insertOrReplace(comic);<NEW_LINE>mComic = mComicManager.load(comic.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setPage(comic.getPage());
1,562,331
final AddIpRoutesResult executeAddIpRoutes(AddIpRoutesRequest addIpRoutesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addIpRoutesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddIpRoutesRequest> request = null;<NEW_LINE>Response<AddIpRoutesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddIpRoutesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addIpRoutesRequest));<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, "Directory Service");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddIpRoutesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddIpRoutesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddIpRoutes");
824,326
public void doExport(FacesContext context, DataTable table, ExportConfiguration exportConfiguration, int index) throws IOException {<NEW_LINE>try (OutputStreamWriter osw = new OutputStreamWriter(getOutputStream(), exportConfiguration.getEncodingType());<NEW_LINE>PrintWriter writer = new PrintWriter(osw)) {<NEW_LINE>if (exportConfiguration.getPreProcessor() != null) {<NEW_LINE>// PF 9 - attention: breaking change to PreProcessor (PrintWriter instead of writer)<NEW_LINE>exportConfiguration.getPreProcessor().invoke(context.getELContext(), new Object[] { writer });<NEW_LINE>}<NEW_LINE>writer.append("<?xml version=\"1.0\"?>\n");<NEW_LINE>writer.append("<" + table.getId() + ">\n");<NEW_LINE>if (exportConfiguration.isPageOnly()) {<NEW_LINE>exportPageOnly(context, table, writer);<NEW_LINE>} else if (exportConfiguration.isSelectionOnly()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>exportAll(context, table, writer);<NEW_LINE>}<NEW_LINE>writer.append("</" + table.getId() + ">");<NEW_LINE>table.setRowIndex(-1);<NEW_LINE>if (exportConfiguration.getPostProcessor() != null) {<NEW_LINE>// PF 9 - attention: breaking change to PostProcessor (PrintWriter instead of writer)<NEW_LINE>exportConfiguration.getPostProcessor().invoke(context.getELContext(), new Object[] { writer });<NEW_LINE>}<NEW_LINE>writer.flush();<NEW_LINE>}<NEW_LINE>}
exportSelectionOnly(context, table, writer);
1,444,601
public void finishResponse() throws Exception {<NEW_LINE>super.finishResponse();<NEW_LINE>if (_errorHandled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String exceptionName = RemoteExceptionHandler.getExceptionName(_decorated);<NEW_LINE>Throwable remoteException = _remoteExceptionHandler.getException(_decorated);<NEW_LINE>if (null != remoteException && remoteException instanceof BootstrapDatabaseTooOldException) {<NEW_LINE>_remoteExceptionHandler.handleException(remoteException);<NEW_LINE>} else if (null != exceptionName) {<NEW_LINE>LOG.error("/targetScn response error: " + RemoteExceptionHandler.getExceptionMessage(_decorated));<NEW_LINE>_stateReuse.switchToTargetScnResponseError();<NEW_LINE>} else {<NEW_LINE>InputStream bodyStream = Channels.newInputStream(_decorated);<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>String scnString = mapper.readValue(bodyStream, String.class);<NEW_LINE><MASK><NEW_LINE>long targetScn = Long.parseLong(scnString);<NEW_LINE>_stateReuse.switchToTargetScnSuccess();<NEW_LINE>// make sure we are in the expected mode -- sanity checks<NEW_LINE>Checkpoint ckpt = _checkpoint;<NEW_LINE>if (ckpt.getConsumptionMode() != DbusClientMode.BOOTSTRAP_SNAPSHOT) {<NEW_LINE>throw new InvalidCheckpointException("TargetScnResponseProcessor:" + " expecting in client mode: " + DbusClientMode.BOOTSTRAP_SNAPSHOT, ckpt);<NEW_LINE>} else if (!ckpt.isSnapShotSourceCompleted()) {<NEW_LINE>throw new InvalidCheckpointException("TargetScnResponseProcessor: current snapshot source not completed", ckpt);<NEW_LINE>}<NEW_LINE>LOG.info("Target SCN " + targetScn + " received for bootstrap catchup source " + ckpt.getCatchupSource() + " after completion of snapshot source " + ckpt.getSnapshotSource());<NEW_LINE>ckpt.setBootstrapTargetScn(targetScn);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error("/targetScn response error:" + ex.getMessage(), ex);<NEW_LINE>_stateReuse.switchToTargetScnResponseError();<NEW_LINE>}<NEW_LINE>_callback.enqueueMessage(_stateReuse);<NEW_LINE>}
LOG.info("targetScn:" + scnString);
306,454
final RollbackApplicationResult executeRollbackApplication(RollbackApplicationRequest rollbackApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(rollbackApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RollbackApplicationRequest> request = null;<NEW_LINE>Response<RollbackApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RollbackApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(rollbackApplicationRequest));<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, "Kinesis Analytics V2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RollbackApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RollbackApplicationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "RollbackApplication");
1,091,840
private static Document[] parseSource(final DigestURL location, final String mimeType, final Parser parser, final String charset, final Set<String> ignore_class_name, final VocabularyScraper scraper, final int timezoneOffset, final InputStream sourceStream, final int maxLinks, final long maxBytes) throws Parser.Failure {<NEW_LINE>if (AbstractParser.log.isFine())<NEW_LINE>AbstractParser.log.fine("Parsing '" + location + "' from stream");<NEW_LINE>final String fileExt = MultiProtocolURL.<MASK><NEW_LINE>final String documentCharset = htmlParser.patchCharsetEncoding(charset);<NEW_LINE>assert parser != null;<NEW_LINE>if (AbstractParser.log.isFine())<NEW_LINE>AbstractParser.log.fine("Parsing " + location + " with mimeType '" + mimeType + "' and file extension '" + fileExt + "'.");<NEW_LINE>try {<NEW_LINE>final Document[] docs;<NEW_LINE>if (parser.isParseWithLimitsSupported()) {<NEW_LINE>docs = parser.parseWithLimits(location, mimeType, documentCharset, ignore_class_name, scraper, timezoneOffset, sourceStream, maxLinks, maxBytes);<NEW_LINE>} else {
getFileExtension(location.getFileName());
1,575,848
public DoubleMatrix[] apply(DoubleArray x) {<NEW_LINE>ArgChecker.notNull(x, "x");<NEW_LINE>ArgChecker.isTrue(domain.apply(x), "point {} is not in the function domain", x.toString());<NEW_LINE>int n = x.size();<NEW_LINE>DoubleMatrix[] y = new DoubleMatrix[3];<NEW_LINE>DoubleMatrix[<MASK><NEW_LINE>double[] w;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>double xi = x.get(i);<NEW_LINE>DoubleArray xPlusOneEps = x.with(i, xi + eps);<NEW_LINE>DoubleArray xMinusOneEps = x.with(i, xi - eps);<NEW_LINE>if (!domain.apply(xPlusOneEps)) {<NEW_LINE>DoubleArray xMinusTwoEps = x.with(i, xi - twoEps);<NEW_LINE>if (!domain.apply(xMinusTwoEps)) {<NEW_LINE>throw new MathException("cannot get derivative at point " + x.toString() + " in direction " + i);<NEW_LINE>}<NEW_LINE>y[0] = function.apply(xMinusTwoEps);<NEW_LINE>y[2] = function.apply(x);<NEW_LINE>y[1] = function.apply(xMinusOneEps);<NEW_LINE>w = wBack;<NEW_LINE>} else {<NEW_LINE>if (!domain.apply(xMinusOneEps)) {<NEW_LINE>y[1] = function.apply(xPlusOneEps);<NEW_LINE>y[0] = function.apply(x);<NEW_LINE>y[2] = function.apply(x.with(i, xi + twoEps));<NEW_LINE>w = wFwd;<NEW_LINE>} else {<NEW_LINE>y[2] = function.apply(xPlusOneEps);<NEW_LINE>y[0] = function.apply(xMinusOneEps);<NEW_LINE>w = wCent;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>res[i] = (DoubleMatrix) MA.add(MA.scale(y[0], w[0]), MA.scale(y[2], w[2]));<NEW_LINE>if (w[1] != 0) {<NEW_LINE>res[i] = (DoubleMatrix) MA.add(res[i], MA.scale(y[1], w[1]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
] res = new DoubleMatrix[n];
1,662,729
public NicTO toNicTO(NicProfile profile) {<NEW_LINE>NicTO to = new NicTO();<NEW_LINE>to.setDeviceId(profile.getDeviceId());<NEW_LINE>to.setBroadcastType(profile.getBroadcastType());<NEW_LINE>to.setType(profile.getTrafficType());<NEW_LINE>to.setIp(profile.getIPv4Address());<NEW_LINE>to.setNetmask(profile.getIPv4Netmask());<NEW_LINE>to.setMac(profile.getMacAddress());<NEW_LINE>to.setDns1(profile.getIPv4Dns1());<NEW_LINE>to.setDns2(profile.getIPv4Dns2());<NEW_LINE>to.<MASK><NEW_LINE>to.setDefaultNic(profile.isDefaultNic());<NEW_LINE>to.setBroadcastUri(profile.getBroadCastUri());<NEW_LINE>to.setIsolationuri(profile.getIsolationUri());<NEW_LINE>to.setNetworkRateMbps(profile.getNetworkRate());<NEW_LINE>to.setName(profile.getName());<NEW_LINE>to.setSecurityGroupEnabled(profile.isSecurityGroupEnabled());<NEW_LINE>to.setIp6Address(profile.getIPv6Address());<NEW_LINE>to.setIp6Cidr(profile.getIPv6Cidr());<NEW_LINE>NetworkVO network = _networkDao.findById(profile.getNetworkId());<NEW_LINE>to.setNetworkUuid(network.getUuid());<NEW_LINE>// Workaround to make sure the TO has the UUID we need for Nicira integration<NEW_LINE>NicVO nicVO = _nicDao.findById(profile.getId());<NEW_LINE>if (nicVO != null) {<NEW_LINE>to.setUuid(nicVO.getUuid());<NEW_LINE>// disable pxe on system vm nics to speed up boot time<NEW_LINE>if (nicVO.getVmType() != VirtualMachine.Type.User) {<NEW_LINE>to.setPxeDisable(true);<NEW_LINE>}<NEW_LINE>List<String> secIps = null;<NEW_LINE>if (nicVO.getSecondaryIp()) {<NEW_LINE>secIps = _nicSecIpDao.getSecondaryIpAddressesForNic(nicVO.getId());<NEW_LINE>}<NEW_LINE>to.setNicSecIps(secIps);<NEW_LINE>} else {<NEW_LINE>s_logger.warn("Unabled to load NicVO for NicProfile " + profile.getId());<NEW_LINE>// Workaround for dynamically created nics<NEW_LINE>// FixMe: uuid and secondary IPs can be made part of nic profile<NEW_LINE>to.setUuid(UUID.randomUUID().toString());<NEW_LINE>}<NEW_LINE>to.setDetails(getNicDetails(network));<NEW_LINE>// check whether the this nic has secondary ip addresses set<NEW_LINE>// set nic secondary ip address in NicTO which are used for security group<NEW_LINE>// configuration. Use full when vm stop/start<NEW_LINE>return to;<NEW_LINE>}
setGateway(profile.getIPv4Gateway());
844,597
public void runActionOnPoll() {<NEW_LINE>LOG.trace("Starting disaster detection");<NEW_LINE>clearExpiredDisabledActions();<NEW_LINE>List<SingularityDisasterType> previouslyActiveDisasters = disasterManager.getActiveDisasters();<NEW_LINE>List<SingularityDisasterDataPoint> dataPoints = disasterManager.getDisasterStats().getDataPoints();<NEW_LINE>SingularityDisasterDataPoint newStats = collectDisasterStats();<NEW_LINE>dataPoints.add(0, newStats);<NEW_LINE>if (dataPoints.size() > disasterConfiguration.getStatsHistorySize()) {<NEW_LINE>dataPoints.remove(dataPoints.size() - 1);<NEW_LINE>}<NEW_LINE>LOG.debug("Collected new disaster detection dataPoints: {}", newStats);<NEW_LINE>List<SingularityDisasterType> newActiveDisasters = checkDataPoints(dataPoints);<NEW_LINE>if (!newActiveDisasters.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>disasterManager.updateActiveDisasters(previouslyActiveDisasters, newActiveDisasters);<NEW_LINE>disasterManager.saveDisasterStats(new SingularityDisasterDataPoints(dataPoints));<NEW_LINE>if (!newActiveDisasters.isEmpty()) {<NEW_LINE>if (!disasterManager.isAutomatedDisabledActionsDisabled()) {<NEW_LINE>disasterManager.addDisabledActionsForDisasters(newActiveDisasters);<NEW_LINE>}<NEW_LINE>if (!previouslyActiveDisasters.containsAll(newActiveDisasters)) {<NEW_LINE>queueDisasterEmail(dataPoints, newActiveDisasters);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>disasterManager.clearSystemGeneratedDisabledActions();<NEW_LINE>}<NEW_LINE>}
LOG.warn("Detected new active disasters: {}", newActiveDisasters);
204,544
public void initialize(GlobalContext globalContext, JSObject proto) {<NEW_LINE>// String.foo()<NEW_LINE>defineNonEnumerableProperty(this, "fromCharCode", new FromCharCode(globalContext));<NEW_LINE>// String.prototype.foo()<NEW_LINE>proto.setPrototype(globalContext.getPrototypeFor("Object"));<NEW_LINE>defineNonEnumerableProperty(proto, "constructor", this);<NEW_LINE>defineNonEnumerableProperty(proto, "toString", new ToString(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "valueOf", new ValueOf(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "charAt", new CharAt(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "charCodeAt", new CharCodeAt(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "concat", new Concat(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "indexOf", new IndexOf(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "lastIndexOf", new LastIndexOf(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "localeCompare", new LocaleCompare(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "match", new Match(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "search", new Search(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "slice", new Slice(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "split", new Split(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "substring", new Substring(globalContext));<NEW_LINE>// Alias, 'cause node likes this<NEW_LINE>defineNonEnumerableProperty(proto, "substr", new Substr(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "toLowerCase", new ToLowerCase(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "toUpperCase", new ToUpperCase(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "toLocaleLowerCase", new ToLocaleLowerCase(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, "toLocaleUpperCase", new ToLocaleUpperCase(globalContext));<NEW_LINE>defineNonEnumerableProperty(proto, <MASK><NEW_LINE>// http://es5.github.com/#x15.5.4.11<NEW_LINE>defineNonEnumerableProperty(proto, "replace", new Replace(globalContext));<NEW_LINE>}
"trim", new Trim(globalContext));
1,202,583
public void testFutureGetTimesOut() throws Exception {<NEW_LINE>long currentThreadId = 0;<NEW_LINE>ResultsStatelessRemote bean = lookupSLRBean();<NEW_LINE>assertNotNull("Async Stateless Bean created successfully", bean);<NEW_LINE>// initialize latches<NEW_LINE>ResultsStatelessRemoteFutureBean.svBeanLatch = new CountDownLatch(1);<NEW_LINE>ResultsStatelessRemoteFutureBean.svTestLatch = new CountDownLatch(1);<NEW_LINE>// call bean asynchronous method using Future<V> object to receive results<NEW_LINE>Future<String> future = bean.test_fireAndReturnResults_await();<NEW_LINE>svLogger.info("Retrieving results");<NEW_LINE>try {<NEW_LINE>// get without wait<NEW_LINE>future.get(0, TimeUnit.MILLISECONDS);<NEW_LINE>fail("Expected TimeoutException did not occur");<NEW_LINE>} catch (TimeoutException te) {<NEW_LINE>// timeout exceeded as expected<NEW_LINE>svLogger.info("caught expected TimeoutException");<NEW_LINE>} finally {<NEW_LINE>// allow async method to run<NEW_LINE>ResultsStatelessRemoteFutureBean.svTestLatch.countDown();<NEW_LINE>// wait to ensure async method has completed<NEW_LINE>ResultsStatelessRemoteFutureBean.svBeanLatch.await(ResultsStatelessRemoteFutureBean.MAX_ASYNC_WAIT, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>// get current thread Id for comparison to bean method thread id<NEW_LINE>currentThreadId = Thread.currentThread().getId();<NEW_LINE>svLogger.info("Test threadId = " + currentThreadId);<NEW_LINE>svLogger.info("Bean threadId = " + ResultsStatelessRemoteFutureBean.beanThreadId);<NEW_LINE>assertFalse("Async Stateless Bean method executed on separate thread", <MASK><NEW_LINE>}
(ResultsStatelessRemoteFutureBean.beanThreadId == currentThreadId));
1,813,952
public String oldStyle() {<NEW_LINE>Map<String, Object> oldHint = new HashMap<>();<NEW_LINE>if (fullScan()) {<NEW_LINE>oldHint.put("type", "full");<NEW_LINE>} else {<NEW_LINE>List<String> groupList = this.groups;<NEW_LINE>if (null == groupList || groupList.size() <= 0) {<NEW_LINE>groupList = HintUtil.allGroup();<NEW_LINE>}<NEW_LINE>// scan(node="A_GROUP,B_GROUP")<NEW_LINE>if (groupList.size() > 0) {<NEW_LINE>oldHint.put("type", "direct");<NEW_LINE>oldHint.put("dbid", TStringUtil.join(groupList, ","));<NEW_LINE><MASK><NEW_LINE>if (TStringUtil.isNotBlank(this.table) && this.realTables.size() > 0) {<NEW_LINE>oldHint.put("vtab", this.table);<NEW_LINE>List<String> realTabs = new LinkedList<>();<NEW_LINE>for (List<String> realTab : this.realTables) {<NEW_LINE>realTabs.add(TStringUtil.join(realTab, ","));<NEW_LINE>}<NEW_LINE>oldHint.put("realtabs", realTabs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder result = new StringBuilder("/*+TDDL(");<NEW_LINE>result.append(JSON.toJSONString(oldHint));<NEW_LINE>result.append(")*/");<NEW_LINE>return result.toString();<NEW_LINE>}
oldHint.put("dbindex", "true");
1,387,589
public final void accept(Context<?> ctx) {<NEW_LINE>Field<? extends Number> l = length;<NEW_LINE>if (l != null) {<NEW_LINE>if (SUPPORT_INSERT.contains(ctx.dialect()))<NEW_LINE>ctx.visit(function(N_INSERT, getDataType(), in<MASK><NEW_LINE>else if (NO_SUPPORT.contains(ctx.dialect()))<NEW_LINE>ctx.visit(DSL.substring(in, inline(1), isub(startIndex, inline(1))).concat(placing).concat(DSL.substring(in, iadd(startIndex, l))));<NEW_LINE>else<NEW_LINE>ctx.visit(N_OVERLAY).sql('(').visit(in).sql(' ').visit(K_PLACING).sql(' ').visit(placing).sql(' ').visit(K_FROM).sql(' ').visit(startIndex).sql(' ').visit(K_FOR).sql(' ').visit(l).sql(')');<NEW_LINE>} else {<NEW_LINE>if (SUPPORT_INSERT.contains(ctx.dialect()))<NEW_LINE>ctx.visit(function(N_INSERT, getDataType(), in, startIndex, DSL.length(placing), placing));<NEW_LINE>else if (NO_SUPPORT.contains(ctx.dialect()))<NEW_LINE>ctx.visit(DSL.substring(in, inline(1), isub(startIndex, inline(1))).concat(placing).concat(DSL.substring(in, iadd(startIndex, DSL.length(placing)))));<NEW_LINE>else<NEW_LINE>ctx.visit(N_OVERLAY).sql('(').visit(in).sql(' ').visit(K_PLACING).sql(' ').visit(placing).sql(' ').visit(K_FROM).sql(' ').visit(startIndex).sql(')');<NEW_LINE>}<NEW_LINE>}
, startIndex, l, placing));
1,837,240
public int nearestExit(char[][] maze, int[] entrance) {<NEW_LINE>int m = maze.length;<NEW_LINE>int n = maze[0].length;<NEW_LINE>Deque<int[]> q = new ArrayDeque<>();<NEW_LINE>q.offer(entrance);<NEW_LINE>maze[entrance[0]][entrance[1]] = '+';<NEW_LINE>int ans = 0;<NEW_LINE>int[] dirs = { -1, 0, 1, 0, -1 };<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE>++ans;<NEW_LINE>for (int k = q.size(); k > 0; --k) {<NEW_LINE>int[<MASK><NEW_LINE>int i = p[0], j = p[1];<NEW_LINE>for (int l = 0; l < 4; ++l) {<NEW_LINE>int x = i + dirs[l], y = j + dirs[l + 1];<NEW_LINE>if (x >= 0 && x < m && y >= 0 && y < n && maze[x][y] == '.') {<NEW_LINE>if (x == 0 || x == m - 1 || y == 0 || y == n - 1) {<NEW_LINE>return ans;<NEW_LINE>}<NEW_LINE>q.offer(new int[] { x, y });<NEW_LINE>maze[x][y] = '+';<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
] p = q.poll();
249,692
String swiftDelete(SwiftTO swift, String container, String object) {<NEW_LINE>Script command = new Script("/bin/bash", s_logger);<NEW_LINE>command.add("-c");<NEW_LINE>command.add("/usr/bin/python /usr/local/cloud/systemvm/scripts/storage/secondary/swift -A " + swift.getUrl() + " -U " + swift.getAccount() + ":" + swift.getUserName() + " -K " + swift.getKey() + " delete " + container + " " + object);<NEW_LINE>OutputInterpreter.AllLinesParser <MASK><NEW_LINE>String result = command.execute(parser);<NEW_LINE>if (result != null) {<NEW_LINE>String errMsg = "swiftDelete failed , err=" + result;<NEW_LINE>s_logger.warn(errMsg);<NEW_LINE>return errMsg;<NEW_LINE>}<NEW_LINE>if (parser.getLines() != null) {<NEW_LINE>String[] lines = parser.getLines().split("\\n");<NEW_LINE>for (String line : lines) {<NEW_LINE>if (line.contains("Errno") || line.contains("failed")) {<NEW_LINE>String errMsg = "swiftDelete failed , err=" + parser.getLines();<NEW_LINE>s_logger.warn(errMsg);<NEW_LINE>return errMsg;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
parser = new OutputInterpreter.AllLinesParser();
1,796,600
public void handle(PrimaryStorageInventory dstPsInv, NfsToNfsMigrateBitsMsg msg, ReturnValueCompletion<NfsToNfsMigrateBitsReply> completion) {<NEW_LINE>HostVO hostVO = dbf.findByUuid(msg.getHostUuid(), HostVO.class);<NEW_LINE>if (hostVO == null) {<NEW_LINE>throw new OperationFailureException(operr("The chosen host[uuid:%s] to perform storage migration is lost", msg.getHostUuid()));<NEW_LINE>}<NEW_LINE>HostInventory host = HostInventory.valueOf(hostVO);<NEW_LINE>// check if need to mount ps to host first<NEW_LINE>boolean mounted = Q.New(PrimaryStorageClusterRefVO.class).eq(PrimaryStorageClusterRefVO_.clusterUuid, host.getClusterUuid()).eq(PrimaryStorageClusterRefVO_.primaryStorageUuid, dstPsInv.getUuid()).isExists();<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>if (mounted) {<NEW_LINE>logger.info(String.format("no need to mount nfs ps[uuid:%s] to host[uuid:%s]", dstPsInv.getUuid(), host.getUuid()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NfsToNfsMigrateBitsCmd cmd = new NfsToNfsMigrateBitsCmd();<NEW_LINE>cmd.srcFolderPath = msg.getSrcFolderPath();<NEW_LINE>cmd.dstFolderPath = msg.getDstFolderPath();<NEW_LINE>cmd.filtPaths = trash.findTrashInstallPath(msg.getSrcFolderPath(), msg.getSrcPrimaryStorageUuid());<NEW_LINE>cmd.isMounted = mounted;<NEW_LINE>if (!mounted) {<NEW_LINE>cmd.options = NfsSystemTags.MOUNT_OPTIONS.getTokenByResourceUuid(dstPsInv.getUuid(), NfsSystemTags.MOUNT_OPTIONS_TOKEN);<NEW_LINE>cmd.url = dstPsInv.getUrl();<NEW_LINE>cmd.mountPath = dstPsInv.getMountPath();<NEW_LINE>}<NEW_LINE>new KvmCommandSender(host.getUuid()).send(cmd, NFS_TO_NFS_MIGRATE_BITS_PATH, wrapper -> {<NEW_LINE>NfsToNfsMigrateBitsRsp rsp = <MASK><NEW_LINE>return rsp.isSuccess() ? null : operr("%s", rsp.getError());<NEW_LINE>}, msg.getTimeout(), new ReturnValueCompletion<KvmResponseWrapper>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(KvmResponseWrapper w) {<NEW_LINE>logger.info("successfully copyed volume folder to nfs ps " + dstPsInv.getUuid());<NEW_LINE>NfsToNfsMigrateBitsReply reply = new NfsToNfsMigrateBitsReply();<NEW_LINE>completion.success(reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>logger.error("failed to copy volume folder to nfs ps " + dstPsInv.getUuid());<NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
wrapper.getResponse(NfsToNfsMigrateBitsRsp.class);
1,055,433
private void storeResult(JavaCompileSpec spec, WorkResult result) {<NEW_LINE>ClassSetAnalysisData outputSnapshot = classpathSnapshotter.analyzeOutputFolder(spec.getDestinationDir());<NEW_LINE>ClassSetAnalysisData classpathSnapshot = classpathSnapshotter.getClasspathSnapshot(Iterables.concat(spec.getCompileClasspath()<MASK><NEW_LINE>AnnotationProcessingData annotationProcessingData = getAnnotationProcessingData(spec, result);<NEW_LINE>CompilerApiData compilerApiData = getCompilerApiData(spec, result);<NEW_LINE>ClassSetAnalysisData minimizedClasspathSnapshot = classpathSnapshot.reduceToTypesAffecting(outputSnapshot, compilerApiData);<NEW_LINE>PreviousCompilationData data = new PreviousCompilationData(outputSnapshot, annotationProcessingData, minimizedClasspathSnapshot, compilerApiData);<NEW_LINE>File previousCompilationDataFile = Objects.requireNonNull(spec.getCompileOptions().getPreviousCompilationDataFile());<NEW_LINE>previousCompilationAccess.writePreviousCompilationData(data, previousCompilationDataFile);<NEW_LINE>}
, spec.getModulePath()));
973,848
void populateField(final Object target, final Field field, final RandomizationContext context) throws IllegalAccessException {<NEW_LINE>Randomizer<?> randomizer = getRandomizer(field, context);<NEW_LINE>if (randomizer instanceof SkipRandomizer) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>context.pushStackItem(new RandomizationContextStackItem(target, field));<NEW_LINE>if (randomizer instanceof ContextAwareRandomizer) {<NEW_LINE>((ContextAwareRandomizer<?>) randomizer).setRandomizerContext(context);<NEW_LINE>}<NEW_LINE>if (!context.hasExceededRandomizationDepth()) {<NEW_LINE>Object value;<NEW_LINE>if (randomizer != null) {<NEW_LINE>value = randomizer.getRandomValue();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>value = generateRandomValue(field, context);<NEW_LINE>} catch (ObjectCreationException e) {<NEW_LINE>String exceptionMessage = String.format("Unable to create type: %s for field: %s of class: %s", field.getType().getName(), field.getName(), target.getClass().getName());<NEW_LINE>// FIXME catch ObjectCreationException and throw ObjectCreationException ?<NEW_LINE>throw new ObjectCreationException(exceptionMessage, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (context.getParameters().isBypassSetters()) {<NEW_LINE>setFieldValue(target, field, value);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>setProperty(target, field, value);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>String exceptionMessage = String.format("Unable to invoke setter for field %s of class %s", field.getName(), target.getClass().getName());<NEW_LINE>throw new ObjectCreationException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.popStackItem();<NEW_LINE>}
exceptionMessage, e.getCause());
796,595
public EvaluationResult evaluate(Position position, CalculationFunctions functions, String firstToken, List<String> remainingTokens) {<NEW_LINE>MetaBean metaBean = MetaBean.<MASK><NEW_LINE>// position<NEW_LINE>Optional<String> positionPropertyName = metaBean.metaPropertyMap().keySet().stream().filter(p -> p.equalsIgnoreCase(firstToken)).findFirst();<NEW_LINE>if (positionPropertyName.isPresent()) {<NEW_LINE>Object propertyValue = metaBean.metaProperty(positionPropertyName.get()).get((Bean) position);<NEW_LINE>return propertyValue != null ? EvaluationResult.success(propertyValue, remainingTokens) : EvaluationResult.failure("Property '{}' not set", firstToken);<NEW_LINE>}<NEW_LINE>// position info<NEW_LINE>Optional<String> positionInfoPropertyName = position.getInfo().propertyNames().stream().filter(p -> p.equalsIgnoreCase(firstToken)).findFirst();<NEW_LINE>if (positionInfoPropertyName.isPresent()) {<NEW_LINE>Object propertyValue = position.getInfo().property(positionInfoPropertyName.get()).get();<NEW_LINE>return propertyValue != null ? EvaluationResult.success(propertyValue, remainingTokens) : EvaluationResult.failure("Property '{}' not set", firstToken);<NEW_LINE>}<NEW_LINE>// not found<NEW_LINE>return invalidTokenFailure(position, firstToken);<NEW_LINE>}
of(position.getClass());
1,013,815
public static void init() {<NEW_LINE>// Login setup<NEW_LINE>ServerLoginConnectionEvents.QUERY_START.register((handler, server, sender, synchronizer) -> {<NEW_LINE>// Send early registration packet<NEW_LINE><MASK><NEW_LINE>Collection<Identifier> channelsNames = ServerPlayNetworking.getGlobalReceivers();<NEW_LINE>buf.writeVarInt(channelsNames.size());<NEW_LINE>for (Identifier id : channelsNames) {<NEW_LINE>buf.writeIdentifier(id);<NEW_LINE>}<NEW_LINE>sender.sendPacket(EARLY_REGISTRATION_CHANNEL, buf);<NEW_LINE>NetworkingImpl.LOGGER.debug("Sent accepted channels to the client for \"{}\"", handler.getConnectionInfo());<NEW_LINE>});<NEW_LINE>ServerLoginNetworking.registerGlobalReceiver(EARLY_REGISTRATION_CHANNEL, (server, handler, understood, buf, synchronizer, sender) -> {<NEW_LINE>if (!understood) {<NEW_LINE>// The client is likely a vanilla client.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int n = buf.readVarInt();<NEW_LINE>List<Identifier> ids = new ArrayList<>(n);<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>ids.add(buf.readIdentifier());<NEW_LINE>}<NEW_LINE>((ChannelInfoHolder) handler.getConnection()).getPendingChannelsNames().addAll(ids);<NEW_LINE>NetworkingImpl.LOGGER.debug("Received accepted channels from the client for \"{}\"", handler.getConnectionInfo());<NEW_LINE>});<NEW_LINE>}
PacketByteBuf buf = PacketByteBufs.create();
1,728,876
public static String keyGen(String passphrase) throws IOException, JSchException {<NEW_LINE>FileUtils.forceMkdir(new File(KEY_PATH));<NEW_LINE>deleteGenSSHKeys();<NEW_LINE>if (StringUtils.isEmpty(AppConfig.getProperty(PRIVATE_KEY)) || StringUtils.isEmpty(AppConfig.getProperty(PUBLIC_KEY))) {<NEW_LINE>// set key type<NEW_LINE>int type = KeyPair.RSA;<NEW_LINE>if ("dsa".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.DSA;<NEW_LINE>} else if ("ecdsa".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.ECDSA;<NEW_LINE>} else if ("ed448".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.ED448;<NEW_LINE>} else if ("ed25519".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.ED25519;<NEW_LINE>}<NEW_LINE>String comment = "bastillion@global_key";<NEW_LINE>JSch jsch = new JSch();<NEW_LINE>KeyPair keyPair = KeyPair.genKeyPair(jsch, type, KEY_LENGTH);<NEW_LINE>keyPair.writePrivateKey(PVT_KEY, passphrase.getBytes());<NEW_LINE>keyPair.writePublicKey(PUB_KEY, comment);<NEW_LINE>System.out.println(<MASK><NEW_LINE>keyPair.dispose();<NEW_LINE>}<NEW_LINE>return passphrase;<NEW_LINE>}
"Finger print: " + keyPair.getFingerPrint());
856,380
// Mirrors wkt<NEW_LINE>private static void pointText_(int precision, boolean bFixedPoint, boolean b_export_zs, boolean b_export_ms, AttributeStreamOfDbl zs, AttributeStreamOfDbl ms, AttributeStreamOfDbl position, int point, JsonWriter json_writer) {<NEW_LINE>double x = position.readAsDbl(2 * point);<NEW_LINE>double y = position.readAsDbl(2 * point + 1);<NEW_LINE>double z = NumberUtils.NaN();<NEW_LINE>double m = NumberUtils.NaN();<NEW_LINE>if (b_export_zs)<NEW_LINE>z = (zs != null ? zs.readAsDbl(point) : VertexDescription<MASK><NEW_LINE>if (b_export_ms)<NEW_LINE>m = (ms != null ? ms.readAsDbl(point) : VertexDescription.getDefaultValue(Semantics.M));<NEW_LINE>pointText_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);<NEW_LINE>}
.getDefaultValue(Semantics.Z));