idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
560,867
protected Object predictResult(Object input) {<NEW_LINE>if (null == input) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>HashMap<Integer, Integer> wordCount = new HashMap<>(0);<NEW_LINE>String content = (String) input;<NEW_LINE>String[] tokens = content.split(NLPConstant.WORD_DELIMITER);<NEW_LINE>double minTermCount = model.minTF >= 1.0 ? model.minTF : model.minTF * tokens.length;<NEW_LINE>double tokenRatio = 1.0 / tokens.length;<NEW_LINE>for (String token : tokens) {<NEW_LINE>int hashValue = Math.abs(HASH.hashUnencodedChars(token).asInt());<NEW_LINE>int index = Math.floorMod(hashValue, model.numFeatures);<NEW_LINE>if (model.idfMap.containsKey(index)) {<NEW_LINE>wordCount.merge(index, 1, Integer::sum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] indexes = new int[wordCount.size()];<NEW_LINE>double[] values = new double[indexes.length];<NEW_LINE>int pos = 0;<NEW_LINE>for (Map.Entry<Integer, Integer> entry : wordCount.entrySet()) {<NEW_LINE>double count = entry.getValue();<NEW_LINE>if (count >= minTermCount) {<NEW_LINE>indexes[<MASK><NEW_LINE>values[pos++] = featureType.featureValueFunc.apply(model.idfMap.get(entry.getKey()), count, tokenRatio);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SparseVector(model.numFeatures, Arrays.copyOf(indexes, pos), Arrays.copyOf(values, pos));<NEW_LINE>}
pos] = entry.getKey();
1,621,430
public int compareTo(updateCompactionStatus_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTinfo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTinfo()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinfo, other.tinfo);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetCredentials(), other.isSetCredentials());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetCredentials()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, other.credentials);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetExternalCompactionId(), other.isSetExternalCompactionId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetExternalCompactionId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.externalCompactionId, other.externalCompactionId);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetStatus(), other.isSetStatus());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetStatus()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTimestamp()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
), other.isSetTinfo());
512,414
public IBundleProvider registerSearch(final IFhirResourceDao<?> theCallingDao, final SearchParameterMap theParams, String theResourceType, CacheControlDirective theCacheControlDirective, RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId) {<NEW_LINE>final String searchUuid = UUID.randomUUID().toString();<NEW_LINE>final String queryString = theParams.toNormalizedQueryString(myContext);<NEW_LINE>ourLog.debug("Registering new search {}", searchUuid);<NEW_LINE>Search search = new Search();<NEW_LINE>populateSearchEntity(theParams, theResourceType, searchUuid, queryString, search, theRequestPartitionId);<NEW_LINE>// Interceptor call: STORAGE_PRESEARCH_REGISTERED<NEW_LINE>HookParams params = new HookParams().add(ICachedSearchDetails.class, search).add(RequestDetails.class, theRequestDetails).addIfMatchesType(ServletRequestDetails.class, theRequestDetails).add(SearchParameterMap.class, theParams);<NEW_LINE>CompositeInterceptorBroadcaster.doCallHooks(myInterceptorBroadcaster, theRequestDetails, Pointcut.STORAGE_PRESEARCH_REGISTERED, params);<NEW_LINE>validateSearch(theParams);<NEW_LINE>Class<? extends IBaseResource> resourceTypeClass = myContext.getResourceDefinition(theResourceType).getImplementingClass();<NEW_LINE>final ISearchBuilder sb = mySearchBuilderFactory.newSearchBuilder(theCallingDao, theResourceType, resourceTypeClass);<NEW_LINE>sb.setFetchSize(mySyncSize);<NEW_LINE>final Integer loadSynchronousUpTo = getLoadSynchronousUpToOrNull(theCacheControlDirective);<NEW_LINE>boolean isOffsetQuery = theParams.isOffsetQuery();<NEW_LINE>if (theParams.isLoadSynchronous() || loadSynchronousUpTo != null || isOffsetQuery) {<NEW_LINE>ourLog.debug("Search {} is loading in synchronous mode", searchUuid);<NEW_LINE>return executeQuery(theResourceType, theParams, theRequestDetails, searchUuid, sb, loadSynchronousUpTo, theRequestPartitionId);<NEW_LINE>}<NEW_LINE>SearchCacheStatusEnum cacheStatus = SearchCacheStatusEnum.MISS;<NEW_LINE>if (theCacheControlDirective != null && theCacheControlDirective.isNoCache() == true) {<NEW_LINE>cacheStatus = SearchCacheStatusEnum.NOT_TRIED;<NEW_LINE>}<NEW_LINE>if (cacheStatus != SearchCacheStatusEnum.NOT_TRIED) {<NEW_LINE>if (theParams.getEverythingMode() == null) {<NEW_LINE>if (myDaoConfig.getReuseCachedSearchResultsForMillis() != null) {<NEW_LINE>PersistedJpaBundleProvider foundSearchProvider = findCachedQuery(theParams, <MASK><NEW_LINE>if (foundSearchProvider != null) {<NEW_LINE>foundSearchProvider.setCacheStatus(SearchCacheStatusEnum.HIT);<NEW_LINE>return foundSearchProvider;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PersistedJpaSearchFirstPageBundleProvider retVal = submitSearch(theCallingDao, theParams, theResourceType, theRequestDetails, searchUuid, sb, queryString, theRequestPartitionId, search);<NEW_LINE>retVal.setCacheStatus(cacheStatus);<NEW_LINE>return retVal;<NEW_LINE>}
theResourceType, theRequestDetails, queryString, theRequestPartitionId);
1,290,575
private void startAutoAnalyzeNdv() {<NEW_LINE>scheduler.scheduleWithFixedDelay(() -> {<NEW_LINE>MDC.put(MDC.MDC_KEY_APP, <MASK><NEW_LINE>if (!getSds().acquireStatisticConfig().getBoolean(ConnectionParams.ENABLE_HLL)) {<NEW_LINE>StatisticUtils.logInfo(schemaName, "ndv stopped by config: ENABLE_HLL");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StatisticUtils.logInfo(schemaName, "start detecting ndv");<NEW_LINE>Map<String, Set<String>> tableColumnsMap = OptimizerContext.getContext(schemaName).getPlanManager().columnsInvolvedByPlan();<NEW_LINE>for (String t : tableColumnsMap.keySet()) {<NEW_LINE>long rowCount = getCacheLine(t).getRowCount();<NEW_LINE>// small table use cache_line<NEW_LINE>if (rowCount < DEFAULT_SAMPLE_SIZE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Set<String> cols = tableColumnsMap.get(t);<NEW_LINE>for (String col : cols) {<NEW_LINE>getSds().updateColumnCardinality(t, col);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cardinalitySketch.putAll(getSds().syncCardinality());<NEW_LINE>}, 300, 300, TimeUnit.SECONDS);<NEW_LINE>}
getSchemaName().toLowerCase());
1,746,619
protected void assignColorsToLocals(Body body) {<NEW_LINE>if (Options.v().verbose()) {<NEW_LINE>logger.debug("[" + body.getMethod(<MASK><NEW_LINE>}<NEW_LINE>if (Options.v().time()) {<NEW_LINE>Timers.v().packTimer.start();<NEW_LINE>}<NEW_LINE>localToGroup = new HashMap<Local, Object>(body.getLocalCount() * 2 + 1, 0.7f);<NEW_LINE>groupToColorCount = new HashMap<Object, Integer>(body.getLocalCount() * 2 + 1, 0.7f);<NEW_LINE>localToColor = new HashMap<Local, Integer>(body.getLocalCount() * 2 + 1, 0.7f);<NEW_LINE>// Assign each local to a group, and set that group's color count to 0.<NEW_LINE>for (Local l : body.getLocals()) {<NEW_LINE>Object g = (sizeOfType(l.getType()) == 1) ? IntType.v() : LongType.v();<NEW_LINE>localToGroup.put(l, g);<NEW_LINE>groupToColorCount.putIfAbsent(g, 0);<NEW_LINE>}<NEW_LINE>// Assign colors to the parameter locals.<NEW_LINE>for (Unit s : body.getUnits()) {<NEW_LINE>if (s instanceof IdentityStmt) {<NEW_LINE>Value leftOp = ((IdentityStmt) s).getLeftOp();<NEW_LINE>if (leftOp instanceof Local) {<NEW_LINE>Local l = (Local) leftOp;<NEW_LINE>Object group = localToGroup.get(l);<NEW_LINE>int count = groupToColorCount.get(group);<NEW_LINE>localToColor.put(l, count);<NEW_LINE>groupToColorCount.put(group, count + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).getName() + "] Assigning colors to locals...");
1,210,099
private int _kernelrpc_mach_vm_map_trap(Emulator<?> emulator) {<NEW_LINE>Backend backend = emulator.getBackend();<NEW_LINE>int target = backend.reg_read(ArmConst.UC_ARM_REG_R0).intValue();<NEW_LINE>Pointer address = UnidbgPointer.register(emulator, ArmConst.UC_ARM_REG_R1);<NEW_LINE>int r2 = backend.reg_read(ArmConst.UC_ARM_REG_R2).intValue();<NEW_LINE>long r3 = backend.reg_read(ArmConst.UC_ARM_REG_R3).intValue();<NEW_LINE>long size = (r3 << 32) | r2;<NEW_LINE>int r4 = backend.reg_read(ArmConst.UC_ARM_REG_R4).intValue();<NEW_LINE>long r5 = backend.reg_read(ArmConst.UC_ARM_REG_R5).intValue();<NEW_LINE>long mask = (r5 << 32) | r4;<NEW_LINE>int flags = backend.reg_read(ArmConst.UC_ARM_REG_R6).intValue();<NEW_LINE>int cur_protection = backend.reg_read(ArmConst.UC_ARM_REG_R8).intValue();<NEW_LINE>int tag = flags >> 24;<NEW_LINE>boolean anywhere = (flags & MachO.VM_FLAGS_ANYWHERE) != 0;<NEW_LINE>if (!anywhere) {<NEW_LINE>throw new BackendException("_kernelrpc_mach_vm_map_trap fixed");<NEW_LINE>}<NEW_LINE>Pointer value = address.getPointer(0);<NEW_LINE>UnidbgPointer pointer;<NEW_LINE>if (mask != 0) {<NEW_LINE>MachOLoader loader = (MachOLoader) emulator.getMemory();<NEW_LINE>pointer = UnidbgPointer.pointer(emulator, loader.allocate(size, mask));<NEW_LINE>} else {<NEW_LINE>pointer = emulator.getMemory().mmap((int) size, cur_protection);<NEW_LINE>}<NEW_LINE>String msg = "_kernelrpc_mach_vm_map_trap target=" + target + ", address=" + address + ", value=" + value + ", size=0x" + Long.toHexString(size) + ", mask=0x" + Long.toHexString(mask) + ", flags=0x" + Long.toHexString(flags) + ", cur_protection=" + cur_protection + ", pointer=" + pointer + ", anywhere=true, tag=0x" + Integer.toHexString(tag);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(msg);<NEW_LINE>} else {<NEW_LINE>Log <MASK><NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>address.setPointer(0, pointer);<NEW_LINE>return 0;<NEW_LINE>}
log = LogFactory.getLog("com.github.unidbg.ios.malloc");
1,562,781
private void onClose(int code, String reason) {<NEW_LINE>boolean reconnecting = false;<NEW_LINE>if ((code == IWebSocketConnectionHandler.CLOSE_CANNOT_CONNECT) || (code == IWebSocketConnectionHandler.CLOSE_CONNECTION_LOST)) {<NEW_LINE>reconnecting = scheduleReconnect();<NEW_LINE>}<NEW_LINE>// Shutdown the executor so that it stops attempting to send pings.<NEW_LINE>if (mExecutor != null) {<NEW_LINE>mExecutor.shutdown();<NEW_LINE>}<NEW_LINE>mMessenger.cleanup();<NEW_LINE>if (mWsHandler != null) {<NEW_LINE>try {<NEW_LINE>if (reconnecting) {<NEW_LINE>mWsHandler.<MASK><NEW_LINE>} else {<NEW_LINE>mWsHandler.onClose(code, reason);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.v(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>// mWsHandler = null;<NEW_LINE>} else {<NEW_LINE>LOGGER.d("mWsHandler already NULL");<NEW_LINE>}<NEW_LINE>onCloseCalled = true;<NEW_LINE>}
onClose(IWebSocketConnectionHandler.CLOSE_RECONNECT, reason);
491,949
public static SchemaOperationResult extendSchema(final PwmDomain pwmDomain, final ConfigGuideBean configGuideBean, final boolean doSchemaExtension) {<NEW_LINE>final Map<ConfigGuideFormField, String<MASK><NEW_LINE>final boolean ldapServerSecure = ConfigGuideForm.readCheckedFormField(form.get(ConfigGuideFormField.PARAM_LDAP_SECURE));<NEW_LINE>final String ldapUrl = "ldap" + (ldapServerSecure ? "s" : "") + "://" + form.get(ConfigGuideFormField.PARAM_LDAP_HOST) + ":" + form.get(ConfigGuideFormField.PARAM_LDAP_PORT);<NEW_LINE>try {<NEW_LINE>final ChaiConfiguration chaiConfiguration = ChaiConfiguration.builder(ldapUrl, form.get(ConfigGuideFormField.PARAM_LDAP_PROXY_DN), form.get(ConfigGuideFormField.PARAM_LDAP_PROXY_PW)).setSetting(ChaiSetting.PROMISCUOUS_SSL, "true").build();<NEW_LINE>final ChaiProvider chaiProvider = pwmDomain.getLdapConnectionService().getChaiProviderFactory().newProvider(chaiConfiguration);<NEW_LINE>if (doSchemaExtension) {<NEW_LINE>return SchemaManager.extendSchema(chaiProvider);<NEW_LINE>} else {<NEW_LINE>return SchemaManager.checkExistingSchema(chaiProvider);<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error(() -> "unable to create schema extender object: " + e.getMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
> form = configGuideBean.getFormData();
922,014
public void marshall(VpcPeeringConnection vpcPeeringConnection, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (vpcPeeringConnection == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getFleetId(), FLEETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getFleetArn(), FLEETARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getVpcPeeringConnectionId(), VPCPEERINGCONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getPeerVpcId(), PEERVPCID_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getGameLiftVpcId(), GAMELIFTVPCID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
vpcPeeringConnection.getIpV4CidrBlock(), IPV4CIDRBLOCK_BINDING);
1,822,927
private BlockNode processMonitorEnter(IRegion curRegion, BlockNode block, InsnNode insn, RegionStack stack) {<NEW_LINE>SynchronizedRegion synchRegion = new SynchronizedRegion(curRegion, insn);<NEW_LINE>synchRegion.getSubBlocks().add(block);<NEW_LINE>curRegion.<MASK><NEW_LINE>Set<BlockNode> exits = new LinkedHashSet<>();<NEW_LINE>Set<BlockNode> cacheSet = new HashSet<>();<NEW_LINE>traverseMonitorExits(synchRegion, insn.getArg(0), block, exits, cacheSet);<NEW_LINE>for (InsnNode exitInsn : synchRegion.getExitInsns()) {<NEW_LINE>BlockNode insnBlock = BlockUtils.getBlockByInsn(mth, exitInsn);<NEW_LINE>if (insnBlock != null) {<NEW_LINE>insnBlock.add(AFlag.DONT_GENERATE);<NEW_LINE>}<NEW_LINE>// remove arg from MONITOR_EXIT to allow inline in MONITOR_ENTER<NEW_LINE>exitInsn.removeArg(0);<NEW_LINE>exitInsn.add(AFlag.DONT_GENERATE);<NEW_LINE>}<NEW_LINE>BlockNode body = getNextBlock(block);<NEW_LINE>if (body == null) {<NEW_LINE>mth.addWarn("Unexpected end of synchronized block");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>BlockNode exit = null;<NEW_LINE>if (exits.size() == 1) {<NEW_LINE>exit = getNextBlock(exits.iterator().next());<NEW_LINE>} else if (exits.size() > 1) {<NEW_LINE>cacheSet.clear();<NEW_LINE>exit = traverseMonitorExitsCross(body, exits, cacheSet);<NEW_LINE>}<NEW_LINE>stack.push(synchRegion);<NEW_LINE>if (exit != null) {<NEW_LINE>stack.addExit(exit);<NEW_LINE>} else {<NEW_LINE>for (BlockNode exitBlock : exits) {<NEW_LINE>// don't add exit blocks which leads to method end blocks ('return', 'throw', etc)<NEW_LINE>List<BlockNode> list = BlockUtils.buildSimplePath(exitBlock);<NEW_LINE>if (list.isEmpty() || !BlockUtils.isExitBlock(mth, Utils.last(list))) {<NEW_LINE>stack.addExit(exitBlock);<NEW_LINE>// we can still try using this as an exit block to make sure it's visited.<NEW_LINE>exit = exitBlock;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchRegion.getSubBlocks().add(makeRegion(body, stack));<NEW_LINE>stack.pop();<NEW_LINE>return exit;<NEW_LINE>}
getSubBlocks().add(synchRegion);
1,486,283
public void reload() {<NEW_LINE>loadIcon();<NEW_LINE>try {<NEW_LINE>server.getPlayerManager().getIpBanList().load();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.log(Level.WARNING, "Failed to load banned-ips.json, " + ex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>server.getPlayerManager().getUserBanList().load();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.log(Level.WARNING, "Failed to load banned-players.json, " + ex.getMessage());<NEW_LINE>}<NEW_LINE>pluginManager.clearPlugins();<NEW_LINE>commandMap.clearCommands();<NEW_LINE>resetRecipes();<NEW_LINE>reloadData();<NEW_LINE>int pollCount = 0;<NEW_LINE>// Wait for at most 2.5 seconds for plugins to close their threads<NEW_LINE>while (pollCount < 50 && getScheduler().getActiveWorkers().size() > 0) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(50);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>pollCount++;<NEW_LINE>}<NEW_LINE>List<BukkitWorker> overdueWorkers = getScheduler().getActiveWorkers();<NEW_LINE>for (BukkitWorker worker : overdueWorkers) {<NEW_LINE><MASK><NEW_LINE>String author = "<NoAuthorGiven>";<NEW_LINE>if (plugin.getDescription().getAuthors().size() > 0)<NEW_LINE>author = plugin.getDescription().getAuthors().get(0);<NEW_LINE>getLogger().log(Level.SEVERE, "Nag author: '" + author + "' of '" + plugin.getDescription().getName() + "' about the following: " + "This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin");<NEW_LINE>}<NEW_LINE>loadPlugins();<NEW_LINE>enablePlugins(PluginLoadOrder.STARTUP);<NEW_LINE>enablePlugins(PluginLoadOrder.POSTWORLD);<NEW_LINE>getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD));<NEW_LINE>}
Plugin plugin = worker.getOwner();
74,235
private static void populateListObjectsV2RequestParameters(ListObjectsV2Request listObjectsV2Request, Map<String, String> params) {<NEW_LINE>params.put(LIST_TYPE, "2");<NEW_LINE>if (listObjectsV2Request.getPrefix() != null) {<NEW_LINE>params.put(PREFIX, listObjectsV2Request.getPrefix());<NEW_LINE>}<NEW_LINE>if (listObjectsV2Request.getDelimiter() != null) {<NEW_LINE>params.put(DELIMITER, listObjectsV2Request.getDelimiter());<NEW_LINE>}<NEW_LINE>if (listObjectsV2Request.getMaxKeys() != null) {<NEW_LINE>params.put(MAX_KEYS, Integer.toString(listObjectsV2Request.getMaxKeys()));<NEW_LINE>}<NEW_LINE>if (listObjectsV2Request.getEncodingType() != null) {<NEW_LINE>params.put(ENCODING_TYPE, listObjectsV2Request.getEncodingType());<NEW_LINE>}<NEW_LINE>if (listObjectsV2Request.getStartAfter() != null) {<NEW_LINE>params.put(<MASK><NEW_LINE>}<NEW_LINE>if (listObjectsV2Request.isFetchOwner()) {<NEW_LINE>params.put(FETCH_OWNER, Boolean.toString(listObjectsV2Request.isFetchOwner()));<NEW_LINE>}<NEW_LINE>if (listObjectsV2Request.getContinuationToken() != null) {<NEW_LINE>params.put(SUBRESOURCE_CONTINUATION_TOKEN, listObjectsV2Request.getContinuationToken());<NEW_LINE>}<NEW_LINE>}
START_AFTER, listObjectsV2Request.getStartAfter());
419,779
protected void updateWorldBound() {<NEW_LINE>super.updateWorldBound();<NEW_LINE>// for a node, the world bound is a combination of all its children<NEW_LINE>// bounds<NEW_LINE>BoundingVolume resultBound = null;<NEW_LINE>for (Spatial child : children.getArray()) {<NEW_LINE>// child bound is assumed to be updated<NEW_LINE>assert (child.refreshFlags & RF_BOUND) == 0;<NEW_LINE>if (resultBound != null) {<NEW_LINE>// merge current world bound with child world bound<NEW_LINE>resultBound.<MASK><NEW_LINE>} else {<NEW_LINE>// set world bound to first non-null child world bound<NEW_LINE>if (child.getWorldBound() != null) {<NEW_LINE>resultBound = child.getWorldBound().clone(this.worldBound);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resultBound == null) {<NEW_LINE>resultBound = new BoundingBox(getWorldTranslation(), 0f, 0f, 0f);<NEW_LINE>}<NEW_LINE>this.worldBound = resultBound;<NEW_LINE>}
mergeLocal(child.getWorldBound());
1,489,667
final UpdateParameterGroupResult executeUpdateParameterGroup(UpdateParameterGroupRequest updateParameterGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateParameterGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateParameterGroupRequest> request = null;<NEW_LINE>Response<UpdateParameterGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateParameterGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateParameterGroupRequest));<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, "MemoryDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateParameterGroup");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateParameterGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateParameterGroupResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
96,739
public void write(org.apache.thrift.protocol.TProtocol prot, hasNamespacePermission_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetNs()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetTblNspcPerm()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 5);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>oprot.writeString(struct.principal);<NEW_LINE>}<NEW_LINE>if (struct.isSetNs()) {<NEW_LINE>oprot.writeString(struct.ns);<NEW_LINE>}<NEW_LINE>if (struct.isSetTblNspcPerm()) {<NEW_LINE>oprot.writeByte(struct.tblNspcPerm);<NEW_LINE>}<NEW_LINE>}
struct.tinfo.write(oprot);
1,523,720
public void executeNodeStep(final PluginStepContext pluginContext, final Map<String, Object> config, final INodeEntry node) throws NodeStepException {<NEW_LINE>final GeneratedScript script;<NEW_LINE>try {<NEW_LINE>script = plugin.<MASK><NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw new NodeStepException(e.getMessage(), StepFailureReason.PluginFailed, node.getNodename());<NEW_LINE>}<NEW_LINE>// get all plugin config properties, and add to the data context used when executing the remote script<NEW_LINE>final Map<String, String> stringconfig = new HashMap<>();<NEW_LINE>for (final Map.Entry<String, Object> objectEntry : config.entrySet()) {<NEW_LINE>stringconfig.put(objectEntry.getKey(), objectEntry.getValue().toString());<NEW_LINE>}<NEW_LINE>ExecutionContextImpl.Builder builder = ExecutionContextImpl.builder(pluginContext.getExecutionContext()).setContext("config", stringconfig);<NEW_LINE>if (plugin.hasAdditionalConfigVarGroupName()) {<NEW_LINE>// new context variable name<NEW_LINE>builder.setContext("nodestep", stringconfig);<NEW_LINE>}<NEW_LINE>ExecutionContextImpl newContext = builder.build();<NEW_LINE>NodeStepResult nodeStepResult = executeRemoteScript(newContext, node, script, pluginContext.getExecutionContext().getDataContextObject().resolve("job", "execid"), getDescription().getName(), scriptUtils);<NEW_LINE>if (!nodeStepResult.isSuccess()) {<NEW_LINE>throw new NodeStepException(nodeStepResult.getFailureMessage() != null ? nodeStepResult.getFailureMessage() : "Remote script execution failed", nodeStepResult.getFailureReason(), nodeStepResult.getFailureData(), node.getNodename());<NEW_LINE>}<NEW_LINE>}
generateScript(pluginContext, config, node);
447,759
final GetAttendeeResult executeGetAttendee(GetAttendeeRequest getAttendeeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAttendeeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAttendeeRequest> request = null;<NEW_LINE>Response<GetAttendeeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAttendeeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAttendeeRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAttendee");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAttendeeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAttendeeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
270,872
public static void processBndAndExt(Map<JNDIEnvironmentRefType, Map<String, String>> allBindings, Map<String, String> envEntryValues, ResourceRefConfigList resRefList, RefBindingsGroup refBindingsGroup, List<com.ibm.ws.javaee.dd.commonext.ResourceRef> resRefExts) {<NEW_LINE>RefBndAndExtHelper.configureEJBRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.EJBRef));<NEW_LINE>RefBndAndExtHelper.configureMessageDestinationRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.MessageDestinationRef));<NEW_LINE>RefBndAndExtHelper.configureResourceRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.ResourceRef), resRefList);<NEW_LINE>if (resRefExts != null) {<NEW_LINE>RefBndAndExtHelper.configureResourceRefExtensions(resRefExts, resRefList);<NEW_LINE>}<NEW_LINE>RefBndAndExtHelper.configureResourceEnvRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.ResourceEnvRef));<NEW_LINE>RefBndAndExtHelper.configureEnvEntryBindings(refBindingsGroup, envEntryValues, allBindings<MASK><NEW_LINE>RefBndAndExtHelper.configureDataSourceBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.DataSource));<NEW_LINE>}
.get(JNDIEnvironmentRefType.EnvEntry));
329,182
public void refresh() {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>final ArrayList<MapPack> values = new ArrayList<MapPack>();<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("objType", objType);<NEW_LINE>param.put("counter", counter);<NEW_LINE>isActive = false;<NEW_LINE>tcp.process(RequestCmd.COUNTER_TODAY_ALL, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>values.add((MapPack) in.readPack());<NEW_LINE>isActive = true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable t) {<NEW_LINE>ConsoleProxy.errorSafe(t.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>ExUtil.exec(this.canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (isActive) {<NEW_LINE>setActive();<NEW_LINE>} else {<NEW_LINE>setInactive();<NEW_LINE>}<NEW_LINE>String date = DateUtil.yyyymmdd(TimeUtil.getCurrentTime(serverId));<NEW_LINE>try {<NEW_LINE>double max = 0;<NEW_LINE>long stime = DateUtil.getTime(date, "yyyyMMdd");<NEW_LINE>long etime = stime + DateUtil.MILLIS_PER_DAY;<NEW_LINE>xyGraph.primaryXAxis.setRange(stime, etime);<NEW_LINE>long now = TimeUtil.getCurrentTime(serverId);<NEW_LINE>for (MapPack pack : values) {<NEW_LINE>int objHash = pack.getInt("objHash");<NEW_LINE>// String objName = pack.getText("objName");<NEW_LINE>ListValue time = pack.getList("time");<NEW_LINE>ListValue value = pack.getList("value");<NEW_LINE>CircularBufferDataProvider data = getDataProvider(objHash);<NEW_LINE>data.clearTrace();<NEW_LINE>for (int i = 0; time != null && i < time.size(); i++) {<NEW_LINE>long x = CastUtil.clong(time.get(i));<NEW_LINE>double y = CastUtil.cdouble<MASK><NEW_LINE>if (x > now) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>data.addSample(new Sample(x, y));<NEW_LINE>}<NEW_LINE>max = Math.max(ChartUtil.getMax(data.iterator()), max);<NEW_LINE>}<NEW_LINE>if (CounterUtil.isPercentValue(objType, counter)) {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, 100);<NEW_LINE>} else {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, max);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>canvas.redraw();<NEW_LINE>xyGraph.repaint();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>checkSettingChange();<NEW_LINE>}
(value.get(i));
1,317,985
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) {<NEW_LINE>final ServerCall<ReqT, RespT> serverCall = new SerializingServerCall<>(call);<NEW_LINE>ServerCall.Listener<ReqT> listener = <MASK><NEW_LINE>return new ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>(listener) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMessage(ReqT message) {<NEW_LINE>try {<NEW_LINE>super.onMessage(message);<NEW_LINE>} catch (StatusRuntimeException e) {<NEW_LINE>closeWithException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onHalfClose() {<NEW_LINE>try {<NEW_LINE>super.onHalfClose();<NEW_LINE>} catch (StatusRuntimeException e) {<NEW_LINE>closeWithException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancel() {<NEW_LINE>try {<NEW_LINE>super.onCancel();<NEW_LINE>} catch (StatusRuntimeException e) {<NEW_LINE>closeWithException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>try {<NEW_LINE>super.onComplete();<NEW_LINE>} catch (StatusRuntimeException e) {<NEW_LINE>closeWithException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReady() {<NEW_LINE>try {<NEW_LINE>super.onReady();<NEW_LINE>} catch (StatusRuntimeException e) {<NEW_LINE>closeWithException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private void closeWithException(StatusRuntimeException t) {<NEW_LINE>Metadata metadata = t.getTrailers();<NEW_LINE>if (metadata == null) {<NEW_LINE>metadata = new Metadata();<NEW_LINE>}<NEW_LINE>serverCall.close(t.getStatus(), metadata);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
next.startCall(serverCall, headers);
53,159
SDChaindcode discoverEndorserEndpoint(TransactionContext transactionContext, final String name) throws ServiceDiscoveryException {<NEW_LINE>Map<String, SDChaindcode> lchaindcodeMap = chaindcodeMap;<NEW_LINE>if (lchaindcodeMap != null) {<NEW_LINE>// check if we have it already.<NEW_LINE>SDChaindcode sdChaindcode = lchaindcodeMap.get(name);<NEW_LINE>if (null != sdChaindcode) {<NEW_LINE>return sdChaindcode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ServiceDiscoveryChaincodeCalls serviceDiscoveryChaincodeCalls = new ServiceDiscoveryChaincodeCalls(name);<NEW_LINE>LinkedList<ServiceDiscoveryChaincodeCalls> cc = new LinkedList<>();<NEW_LINE>cc.add(serviceDiscoveryChaincodeCalls);<NEW_LINE>List<List<ServiceDiscoveryChaincodeCalls>> ccl = new LinkedList<>();<NEW_LINE>ccl.add(cc);<NEW_LINE>Map<String, SDChaindcode> dchaindcodeMap = discoverEndorserEndpoints(transactionContext, ccl);<NEW_LINE>final SDChaindcode <MASK><NEW_LINE>if (null == sdChaindcode) {<NEW_LINE>throw new ServiceDiscoveryException(format("Failed to find any endorsers for chaincode %s. See logs for details", name));<NEW_LINE>}<NEW_LINE>return sdChaindcode;<NEW_LINE>}
sdChaindcode = dchaindcodeMap.get(name);
592,831
private void dismissDialog() {<NEW_LINE>// Validate.<NEW_LINE>if (this.dialogWrapper == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch the activity that is hosting the dialog.<NEW_LINE>TiBaseActivity activity = this.dialogWrapper.getActivity();<NEW_LINE>if (activity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch the dialog. Will be null if never created/shown.<NEW_LINE>AlertDialog dialog = (AlertDialog) this.dialogWrapper.getDialog();<NEW_LINE>if (dialog == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Don't let the activity remove the dialog in its onStop/onDestroy since we'll be doing it below.<NEW_LINE>activity.removeDialog(dialog);<NEW_LINE>// Dismiss the dialog.<NEW_LINE>// Note: Will throw an exception if the hosting activity is destroyed or about to be destroyed.<NEW_LINE>// If "Do not keep activities" is enabled, then isFinishing() will return false for destroyed activity.<NEW_LINE>boolean wasDismissed = false;<NEW_LINE>try {<NEW_LINE>if (!activity.isFinishing() && !activity.isDestroyed()) {<NEW_LINE>dialog.dismiss();<NEW_LINE>wasDismissed = true;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.<MASK><NEW_LINE>}<NEW_LINE>// If we were not able to dismiss the dialog above, then assume its hosting activity was destroyed.<NEW_LINE>// We need to null out the activity assigned to the dialog so that it can be re-used later.<NEW_LINE>if (!wasDismissed) {<NEW_LINE>this.dialogWrapper.setActivity(null);<NEW_LINE>}<NEW_LINE>}
e(TAG, "Failed to hide AlertDialog.", ex);
642,399
public void run(RegressionEnvironment env) {<NEW_LINE>// declare<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create schema SomeType ()", path);<NEW_LINE>env.compileDeploy("@name('flow') create dataflow MyDataFlowOne " + "DefaultSupportSourceOp -> outstream<SomeType> {}" + "DefaultSupportCaptureOp(outstream) {}", path);<NEW_LINE>// instantiate<NEW_LINE>CountDownLatch latchOne = new CountDownLatch(1);<NEW_LINE>Map<String, Object> ops = new HashMap<String, Object>();<NEW_LINE>ops.put("DefaultSupportSourceOp", new DefaultSupportSourceOp(new Object[] { latchOne, new Object[] { 1 } }));<NEW_LINE>DefaultSupportCaptureOp<Object> output <MASK><NEW_LINE>ops.put("DefaultSupportCaptureOp", output);<NEW_LINE>EPDataFlowInstantiationOptions options = new EPDataFlowInstantiationOptions().operatorProvider(new DefaultSupportGraphOpProviderByOpName(ops));<NEW_LINE>EPDataFlowInstance dfOne = env.runtime().getDataFlowService().instantiate(env.deploymentId("flow"), "MyDataFlowOne", options);<NEW_LINE>dfOne.start();<NEW_LINE>assertEquals(EPDataFlowState.RUNNING, dfOne.getState());<NEW_LINE>dfOne.cancel();<NEW_LINE>latchOne.countDown();<NEW_LINE>sleep(100);<NEW_LINE>assertEquals(EPDataFlowState.CANCELLED, dfOne.getState());<NEW_LINE>assertEquals(0, output.getAndReset().size());<NEW_LINE>env.undeployAll();<NEW_LINE>}
= new DefaultSupportCaptureOp<Object>();
558,638
public Map<String, String> buildCheckProperties() {<NEW_LINE>Map<String, String> properties = Maps.newHashMap();<NEW_LINE>properties.put(JdbcCheckKeys.DRIVER_NAME, getDriverName());<NEW_LINE>properties.put(JdbcCheckKeys.URL_KEY, getDbUrl());<NEW_LINE>properties.put(JdbcCheckKeys.USER_NAME_KEY, getUsername());<NEW_LINE>properties.put(<MASK><NEW_LINE>properties.put(JdbcCheckKeys.SCHEMA_KEY, getSchema());<NEW_LINE>properties.put(JdbcCheckKeys.TABLE_NAME_KEY, getTableName());<NEW_LINE>properties.put(JdbcCheckKeys.OPERATION_NAME_KEY, "jdbcOutputFormat");<NEW_LINE>properties.put(JdbcCheckKeys.TABLE_TYPE_KEY, "sink");<NEW_LINE>properties.put(JdbcCheckKeys.NEED_CHECK, String.valueOf(ResourceCheck.NEED_CHECK));<NEW_LINE>return properties;<NEW_LINE>}
JdbcCheckKeys.PASSWORD_KEY, getPassword());
1,417,322
private void execRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {<NEW_LINE>final String testParm = req.getParameter("targetId");<NEW_LINE>final String testName = req.getParameter("testName");<NEW_LINE>System.out.println("Enter JPARLServlet.execRequest, testName=" + testName + ", targetId = " + testParm);<NEW_LINE>EntityManager em = emf.createEntityManager();<NEW_LINE>try {<NEW_LINE>int id = Integer.valueOf(testParm);<NEW_LINE>String jpql = "SELECT e FROM DefDSEntity e";<NEW_LINE>TypedQuery<DefDSEntity> query = em.createQuery(jpql, DefDSEntity.class);<NEW_LINE>List<DefDSEntity<MASK><NEW_LINE>if (rs == null) {<NEW_LINE>throw new ServletException("rs is null.");<NEW_LINE>}<NEW_LINE>if (rs.size() != 1) {<NEW_LINE>throw new ServletException("rs.size() == " + rs.size());<NEW_LINE>}<NEW_LINE>DefDSEntity entity = rs.get(0);<NEW_LINE>if (entity.getId() != id) {<NEW_LINE>throw new ServletException("rs.getId() == " + entity.getId() + " not " + id);<NEW_LINE>}<NEW_LINE>} catch (ServletException se) {<NEW_LINE>throw se;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} finally {<NEW_LINE>em.close();<NEW_LINE>}<NEW_LINE>System.out.println("TEST GOOD.");<NEW_LINE>resp.getOutputStream().println("TEST GOOD.");<NEW_LINE>}
> rs = query.getResultList();
1,272,186
public OnDemandProvisioningSpecification unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OnDemandProvisioningSpecification onDemandProvisioningSpecification = new OnDemandProvisioningSpecification();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AllocationStrategy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>onDemandProvisioningSpecification.setAllocationStrategy(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CapacityReservationOptions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>onDemandProvisioningSpecification.setCapacityReservationOptions(OnDemandCapacityReservationOptionsJsonUnmarshaller.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 onDemandProvisioningSpecification;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
339,967
private static IStringExpression buildSqlWhere(final MLookupInfo lookupInfo, final LookupScope scope, final IValidationRule validationRuleEffective) {<NEW_LINE>final String tableName = lookupInfo.getTableName();<NEW_LINE>final String lookup_SqlWhere = lookupInfo.getWhereClauseSqlPart();<NEW_LINE>final <MASK><NEW_LINE>final CompositeStringExpression.Builder sqlWhereFinal = IStringExpression.composer();<NEW_LINE>// Static lookup's WHERE<NEW_LINE>if (!Check.isEmpty(lookup_SqlWhere, true)) {<NEW_LINE>sqlWhereFinal.append(" /* lookup where clause */ ").append("(").append(lookup_SqlWhere).append(")");<NEW_LINE>}<NEW_LINE>// Validation Rule's WHERE<NEW_LINE>final IStringExpression validationRuleWhereClause = buildSqlWhereClauseFromValidationRule(validationRuleEffective, scope);<NEW_LINE>if (!validationRuleWhereClause.isNullExpression()) {<NEW_LINE>sqlWhereFinal.appendIfNotEmpty("\n AND ");<NEW_LINE>sqlWhereFinal.append(" /* validation rule */ ").append("(\n").append(validationRuleWhereClause).append("\n)\n");<NEW_LINE>}<NEW_LINE>// Filter's WHERE<NEW_LINE>sqlWhereFinal.appendIfNotEmpty("\n AND ");<NEW_LINE>sqlWhereFinal.append(" /* filter */ ").append(DBConstants.FUNCNAME_unaccent_string).append("(").append(displayColumnSql).append(", 1)").append(" ILIKE ").append(DBConstants.FUNCNAME_unaccent_string).append("(").append(LookupDataSourceContext.PARAM_FilterSql).append(", 1)");<NEW_LINE>// IsActive WHERE<NEW_LINE>if (!lookupInfo.isShowInactiveValues()) {<NEW_LINE>sqlWhereFinal.appendIfNotEmpty("\n AND ");<NEW_LINE>sqlWhereFinal.append(" /* active */ ('").append(SQL_PARAM_ShowInactive).append("'='Y' OR ").append(tableName).append(".IsActive='Y')");<NEW_LINE>}<NEW_LINE>return sqlWhereFinal.build();<NEW_LINE>}
TranslatableParameterizedString displayColumnSql = lookupInfo.getDisplayColumnSql();
613,347
private void scheduleUpdate(Context context) {<NEW_LINE>AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);<NEW_LINE>PendingIntent intent = getAlarmIntent(context);<NEW_LINE>alarmManager.cancel(intent);<NEW_LINE>int intervalMin = AppPreferences.widgetUpdateFrequency(context);<NEW_LINE>long intervalMillis = intervalMin * 60 * 1000;<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE><MASK><NEW_LINE>triggerAt.setTimeInMillis(now);<NEW_LINE>triggerAt.set(Calendar.MILLISECOND, 1);<NEW_LINE>triggerAt.set(Calendar.SECOND, 0);<NEW_LINE>triggerAt.set(Calendar.MINUTE, 0);<NEW_LINE>do {<NEW_LINE>triggerAt.add(Calendar.MINUTE, intervalMin);<NEW_LINE>} while (triggerAt.getTimeInMillis() < now);<NEW_LINE>alarmManager.setInexactRepeating(AlarmManager.RTC, triggerAt.getTimeInMillis(), intervalMillis, intent);<NEW_LINE>if (BuildConfig.LOG_DEBUG)<NEW_LINE>LogUtils.d(TAG, triggerAt.getTimeInMillis(), intervalMillis);<NEW_LINE>}
Calendar triggerAt = Calendar.getInstance();
1,846,723
private void appendTextSingleLine(StringBuilder buffer, int lineNumber, FieldSelection singleLineSelection) {<NEW_LINE>if (singleLineSelection.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FieldRange fieldRange = singleLineSelection.getFieldRange(0);<NEW_LINE>int startColumn = fieldRange.getStart().getCol();<NEW_LINE>int endColumn = fieldRange.getEnd().getCol();<NEW_LINE>int startRow = fieldRange.getStart().getRow();<NEW_LINE>int endRow = fieldRange.getEnd().getRow();<NEW_LINE>LayoutModel model = provider.getDecompilerPanel().getLayoutModel();<NEW_LINE>Layout layout = model.getLayout(BigInteger.valueOf(lineNumber));<NEW_LINE>ClangTextField field = (<MASK><NEW_LINE>int startPos = field.screenLocationToTextOffset(startRow, startColumn);<NEW_LINE>int endPos = field.screenLocationToTextOffset(endRow, endColumn);<NEW_LINE>if (startPos >= 0 && endPos >= startPos) {<NEW_LINE>buffer.append(field.getText().substring(startPos, endPos));<NEW_LINE>}<NEW_LINE>}
ClangTextField) layout.getField(0);
518,031
Path compile() throws IOException, SourceCompilationException {<NEW_LINE>Path compilationStdOut = Files.createTempFile("compilation_stdout_", ".txt");<NEW_LINE>Path compilationStdErr = Files.createTempFile("compilation_stderr_", ".txt");<NEW_LINE>Path compiledRootDir = Files.createTempDirectory("compilation_prodout_");<NEW_LINE>ImmutableList<String> javacOptions = ImmutableList.<String>builder().addAll(customJavacOptions).add("-d " + compiledRootDir).build();<NEW_LINE>final List<Path> compiledFiles;<NEW_LINE>try (OutputStream stdOutStream = Files.newOutputStream(compilationStdOut);<NEW_LINE>OutputStream stdErrStream = Files.newOutputStream(compilationStdErr)) {<NEW_LINE>Splitter splitter = Splitter.on(" ").trimResults().omitEmptyStrings();<NEW_LINE>ImmutableList<String> compilationArguments = ImmutableList.<String>builder().addAll(splitter.split(String.join(" ", javacOptions))).addAll(sourceInputs.stream().map(Path::toString).collect(Collectors.toList())).build();<NEW_LINE>compiler.run(nullInputStream(), stdOutStream, stdErrStream, compilationArguments.toArray(new String[0]));<NEW_LINE>int maxDepth = sourceInputs.stream().mapToInt(Path::getNameCount).max().getAsInt();<NEW_LINE>try (Stream<Path> outputStream = Files.find(compiledRootDir, maxDepth, (path, fileAttr) -> true)) {<NEW_LINE>compiledFiles = outputStream.collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>try (JarOutputStream jarOutputStream = new JarOutputStream(Files.newOutputStream(outputJar))) {<NEW_LINE>for (Path compiledFile : compiledFiles) {<NEW_LINE>try (InputStream inputStream = Files.newInputStream(compiledFile)) {<NEW_LINE>Path <MASK><NEW_LINE>JarEntry jarEntry = new JarEntry(inArchivalPath.toString());<NEW_LINE>jarOutputStream.putNextEntry(jarEntry);<NEW_LINE>if (!Files.isDirectory(compiledFile)) {<NEW_LINE>ByteStreams.copy(inputStream, jarOutputStream);<NEW_LINE>}<NEW_LINE>jarOutputStream.closeEntry();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String compilationStandardErrorMessage = new String(Files.readAllBytes(compilationStdErr), Charset.defaultCharset());<NEW_LINE>if (!compilationStandardErrorMessage.isEmpty()) {<NEW_LINE>throw new SourceCompilationException(compilationStandardErrorMessage);<NEW_LINE>}<NEW_LINE>return outputJar;<NEW_LINE>}
inArchivalPath = compiledRootDir.relativize(compiledFile);
1,346,462
public void acceptMethodNameMatch(MethodNameMatch match) {<NEW_LINE>try {<NEW_LINE>if (maxResults > 0 && symbols.size() >= maxResults) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Location location = null;<NEW_LINE>try {<NEW_LINE>location = JDTUtils.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Unable to determine location for " + match.getMethod().getElementName(), e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (location != null && match.getMethod().getElementName() != null && !match.getMethod().getElementName().isEmpty()) {<NEW_LINE>SymbolInformation symbolInformation = new SymbolInformation();<NEW_LINE>symbolInformation.setContainerName(match.getMethod().getDeclaringType().getFullyQualifiedName());<NEW_LINE>symbolInformation.setName(match.getMethod().getElementName());<NEW_LINE>symbolInformation.setKind(SymbolKind.Method);<NEW_LINE>if (Flags.isDeprecated(match.getMethod().getFlags())) {<NEW_LINE>if (preferenceManager != null && preferenceManager.getClientPreferences().isSymbolTagSupported()) {<NEW_LINE>symbolInformation.setTags(List.of(SymbolTag.Deprecated));<NEW_LINE>} else {<NEW_LINE>symbolInformation.setDeprecated(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>symbolInformation.setLocation(location);<NEW_LINE>symbols.add(symbolInformation);<NEW_LINE>if (maxResults > 0 && symbols.size() >= maxResults) {<NEW_LINE>monitor.setCanceled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Unable to determine location for " + match.getMethod().getElementName(), e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
toLocation(match.getMethod());
610,907
public static PrivateKey fromPemEncodedPrivateKey(String pem) {<NEW_LINE>try (PEMParser parser = new PEMParser(new StringReader(pem))) {<NEW_LINE>List<Object> unknownObjects = new ArrayList<>();<NEW_LINE>Object pemObject;<NEW_LINE>while ((pemObject = parser.readObject()) != null) {<NEW_LINE>if (pemObject instanceof PrivateKeyInfo) {<NEW_LINE>PrivateKeyInfo keyInfo = (PrivateKeyInfo) pemObject;<NEW_LINE>PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyInfo.getEncoded());<NEW_LINE>return createKeyFactory(keyInfo.getPrivateKeyAlgorithm()).generatePrivate(keySpec);<NEW_LINE>} else if (pemObject instanceof PEMKeyPair) {<NEW_LINE>PEMKeyPair pemKeypair = (PEMKeyPair) pemObject;<NEW_LINE>PrivateKeyInfo keyInfo = pemKeypair.getPrivateKeyInfo();<NEW_LINE>return createKeyFactory(keyInfo.getPrivateKeyAlgorithm()).generatePrivate(new PKCS8EncodedKeySpec<MASK><NEW_LINE>} else {<NEW_LINE>unknownObjects.add(pemObject);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Expected a private key, but found " + unknownObjects.toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
(keyInfo.getEncoded()));
520,228
public static ListAggregateRemediationsResponse unmarshall(ListAggregateRemediationsResponse listAggregateRemediationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAggregateRemediationsResponse.setRequestId(_ctx.stringValue("ListAggregateRemediationsResponse.RequestId"));<NEW_LINE>List<Remediation> remediations = new ArrayList<Remediation>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAggregateRemediationsResponse.Remediations.Length"); i++) {<NEW_LINE>Remediation remediation = new Remediation();<NEW_LINE>remediation.setRemediationTemplateId(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].RemediationTemplateId"));<NEW_LINE>remediation.setRemediationDynamicParams(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].RemediationDynamicParams"));<NEW_LINE>remediation.setRemediationSourceType(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].RemediationSourceType"));<NEW_LINE>remediation.setRemediationType(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].RemediationType"));<NEW_LINE>remediation.setLastSuccessfulInvocationId(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].LastSuccessfulInvocationId"));<NEW_LINE>remediation.setAccountId(_ctx.longValue<MASK><NEW_LINE>remediation.setAggregatorId(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].AggregatorId"));<NEW_LINE>remediation.setLastSuccessfulInvocationType(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].LastSuccessfulInvocationType"));<NEW_LINE>remediation.setRemediationId(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].RemediationId"));<NEW_LINE>remediation.setInvokeType(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].InvokeType"));<NEW_LINE>remediation.setConfigRuleId(_ctx.stringValue("ListAggregateRemediationsResponse.Remediations[" + i + "].ConfigRuleId"));<NEW_LINE>remediation.setLastSuccessfulInvocationTime(_ctx.longValue("ListAggregateRemediationsResponse.Remediations[" + i + "].LastSuccessfulInvocationTime"));<NEW_LINE>remediations.add(remediation);<NEW_LINE>}<NEW_LINE>listAggregateRemediationsResponse.setRemediations(remediations);<NEW_LINE>return listAggregateRemediationsResponse;<NEW_LINE>}
("ListAggregateRemediationsResponse.Remediations[" + i + "].AccountId"));
1,728,314
// Connection is automatically released back in case of an exception.<NEW_LINE>private int httpGet(String endpoint, Map<String, ByteIterator> result) throws IOException {<NEW_LINE>requestTimedout.setIsSatisfied(false);<NEW_LINE>Thread timer = new Thread(new Timer(execTimeout, requestTimedout));<NEW_LINE>timer.start();<NEW_LINE>int responseCode = 200;<NEW_LINE>HttpGet request = new HttpGet(endpoint);<NEW_LINE>for (int i = 0; i < headers.length; i = i + 2) {<NEW_LINE>request.setHeader(headers[i], headers[i + 1]);<NEW_LINE>}<NEW_LINE>CloseableHttpResponse response = client.execute(request);<NEW_LINE>responseCode = response.getStatusLine().getStatusCode();<NEW_LINE>HttpEntity responseEntity = response.getEntity();<NEW_LINE>// If null entity don't bother about connection release.<NEW_LINE>if (responseEntity != null) {<NEW_LINE>InputStream stream = responseEntity.getContent();<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));<NEW_LINE>StringBuffer responseContent = new StringBuffer();<NEW_LINE>String line = "";<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>if (requestTimedout.isSatisfied()) {<NEW_LINE>// Must avoid memory leak.<NEW_LINE>reader.close();<NEW_LINE>stream.close();<NEW_LINE>EntityUtils.consumeQuietly(responseEntity);<NEW_LINE>response.close();<NEW_LINE>client.close();<NEW_LINE>throw new TimeoutException();<NEW_LINE>}<NEW_LINE>responseContent.append(line);<NEW_LINE>}<NEW_LINE>timer.interrupt();<NEW_LINE>result.put("response", new StringByteIterator<MASK><NEW_LINE>// Closing the input stream will trigger connection release.<NEW_LINE>stream.close();<NEW_LINE>}<NEW_LINE>EntityUtils.consumeQuietly(responseEntity);<NEW_LINE>response.close();<NEW_LINE>client.close();<NEW_LINE>return responseCode;<NEW_LINE>}
(responseContent.toString()));
1,767,718
public void finishInstall() {<NEW_LINE>WizardOperator installerOper = installer();<NEW_LINE>installerOper.next();<NEW_LINE>// "I accept the terms..."<NEW_LINE>String acceptLabel = Bundle.getStringTrimmed("org.netbeans.modules.autoupdate.ui.wizards.Bundle", "LicenseApprovalPanel.cbAccept.text");<NEW_LINE>JCheckBoxOperator acceptCheckboxOper = new JCheckBoxOperator(installerOper, acceptLabel);<NEW_LINE>if (!acceptCheckboxOper.isEnabled()) {<NEW_LINE>// wait until licence is shown and dialog is re-created<NEW_LINE>acceptCheckboxOper.waitComponentShowing(false);<NEW_LINE>// find check box again<NEW_LINE>acceptCheckboxOper = new JCheckBoxOperator(installerOper, acceptLabel);<NEW_LINE>}<NEW_LINE>acceptCheckboxOper.push();<NEW_LINE>// "Install"<NEW_LINE>String installInDialogLabel = <MASK><NEW_LINE>new JButtonOperator(installerOper, installInDialogLabel).push();<NEW_LINE>// "The NetBeans IDE Installer has successfully installed the following plugins:"<NEW_LINE>String installedLabel = Bundle.getString("org.netbeans.modules.autoupdate.ui.wizards.Bundle", "InstallStep_InstallDone_Text");<NEW_LINE>JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 120000);<NEW_LINE>new JTextAreaOperator(installerOper, installedLabel);<NEW_LINE>// "Restart IDE Now"<NEW_LINE>String restartNowLabel = Bundle.getStringTrimmed("org.netbeans.modules.autoupdate.ui.wizards.Bundle", "InstallUnitWizardModel_Buttons_RestartNow");<NEW_LINE>JRadioButton restartButton = JRadioButtonOperator.findJRadioButton((Container) installerOper.getSource(), restartNowLabel, true, true);<NEW_LINE>if (restartButton == null) {<NEW_LINE>// check Status line<NEW_LINE>// "Turning on modules...done."<NEW_LINE>String turningOnLabel = Bundle.getString("org.netbeans.core.startup.Bundle", "MSG_finish_enable_modules");<NEW_LINE>// increase timeout to 120 seconds<NEW_LINE>MainWindowOperator.getDefault().getTimeouts().setTimeout("Waiter.WaitingTime", 120000);<NEW_LINE>MainWindowOperator.getDefault().waitStatusText(turningOnLabel);<NEW_LINE>}<NEW_LINE>installerOper.finish();<NEW_LINE>}
Bundle.getStringTrimmed("org.netbeans.modules.autoupdate.ui.wizards.Bundle", "InstallUnitWizardModel_Buttons_Install");
634,774
public SourceSinkType filter(ISourceSinkCategory category, SourceSinkType sourceSinkType) {<NEW_LINE>// We cannot compare descriptions to the configuration file<NEW_LINE>if (category instanceof CategoryDefinition) {<NEW_LINE>CategoryDefinition catDef = (CategoryDefinition) category;<NEW_LINE>catDef = catDef.getIdOnlyDescription();<NEW_LINE>CategoryMode sourceMode = config.getSourceCategoriesAndModes().get(category);<NEW_LINE>CategoryMode sinkMode = config.<MASK><NEW_LINE>if (sourceSinkType == SourceSinkType.Source || sourceSinkType == SourceSinkType.Both) {<NEW_LINE>if (config.getSourceFilterMode() == SourceSinkFilterMode.UseAllButExcluded) {<NEW_LINE>if (sourceMode != null && sourceMode == CategoryMode.Exclude)<NEW_LINE>sourceSinkType = sourceSinkType.removeType(SourceSinkType.Source);<NEW_LINE>} else if (config.getSourceFilterMode() == SourceSinkFilterMode.UseOnlyIncluded) {<NEW_LINE>if (sourceMode == null || sourceMode != CategoryMode.Include)<NEW_LINE>sourceSinkType = sourceSinkType.removeType(SourceSinkType.Source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sourceSinkType == SourceSinkType.Sink || sourceSinkType == SourceSinkType.Both) {<NEW_LINE>if (config.getSinkFilterMode() == SourceSinkFilterMode.UseAllButExcluded) {<NEW_LINE>if (sinkMode != null && sinkMode == CategoryMode.Exclude)<NEW_LINE>sourceSinkType = sourceSinkType.removeType(SourceSinkType.Sink);<NEW_LINE>} else if (config.getSinkFilterMode() == SourceSinkFilterMode.UseOnlyIncluded) {<NEW_LINE>if (sinkMode == null || sinkMode != CategoryMode.Include)<NEW_LINE>sourceSinkType = sourceSinkType.removeType(SourceSinkType.Sink);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sourceSinkType;<NEW_LINE>}<NEW_LINE>return SourceSinkType.Undefined;<NEW_LINE>}
getSinkCategoriesAndModes().get(category);
615,694
// Activity related history<NEW_LINE>@Override<NEW_LINE>public void recordActivityStart(ExecutionEntity executionEntity) {<NEW_LINE>if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {<NEW_LINE>if (executionEntity.getActivity() != null) {<NEW_LINE>IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();<NEW_LINE>String processDefinitionId = executionEntity.getProcessDefinitionId();<NEW_LINE>String processInstanceId = executionEntity.getProcessInstanceId();<NEW_LINE>String executionId = executionEntity.getId();<NEW_LINE>HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();<NEW_LINE>historicActivityInstance.setId(idGenerator.getNextId());<NEW_LINE>historicActivityInstance.setProcessDefinitionId(processDefinitionId);<NEW_LINE>historicActivityInstance.setProcessInstanceId(processInstanceId);<NEW_LINE>historicActivityInstance.setExecutionId(executionId);<NEW_LINE>historicActivityInstance.setActivityId(executionEntity.getActivityId());<NEW_LINE>historicActivityInstance.setActivityName((String) executionEntity.getActivity().getProperty("name"));<NEW_LINE>historicActivityInstance.setActivityType((String) executionEntity.getActivity().getProperty("type"));<NEW_LINE>historicActivityInstance.setStartTime(Context.getProcessEngineConfiguration().getClock().getCurrentTime());<NEW_LINE>// Inherit tenant id (if applicable)<NEW_LINE>if (executionEntity.getTenantId() != null) {<NEW_LINE>historicActivityInstance.setTenantId(executionEntity.getTenantId());<NEW_LINE>}<NEW_LINE>getDbSqlSession().insert(historicActivityInstance);<NEW_LINE>// Fire event<NEW_LINE>ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration();<NEW_LINE>if (config != null && config.getEventDispatcher().isEnabled()) {<NEW_LINE>config.getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.HISTORIC_ACTIVITY_INSTANCE_CREATED<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, historicActivityInstance), EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);
382,344
public static void toXContent(Metadata metadata, XContentBuilder builder, ToXContent.Params params) throws IOException {<NEW_LINE>XContentContext context = XContentContext.valueOf(params.param(CONTEXT_MODE_PARAM, CONTEXT_MODE_API));<NEW_LINE>if (context == XContentContext.API) {<NEW_LINE>builder.startObject("metadata");<NEW_LINE>} else {<NEW_LINE>builder.startObject("meta-data");<NEW_LINE>builder.field("version", metadata.version());<NEW_LINE>}<NEW_LINE>builder.field("cluster_uuid", metadata.clusterUUID);<NEW_LINE>builder.<MASK><NEW_LINE>builder.startObject("cluster_coordination");<NEW_LINE>metadata.coordinationMetadata().toXContent(builder, params);<NEW_LINE>builder.endObject();<NEW_LINE>if (context != XContentContext.API && metadata.persistentSettings().isEmpty() == false) {<NEW_LINE>builder.startObject("settings");<NEW_LINE>metadata.persistentSettings().toXContent(builder, new MapParams(Collections.singletonMap("flat_settings", "true")));<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>builder.startObject("templates");<NEW_LINE>for (IndexTemplateMetadata template : metadata.templates().values()) {<NEW_LINE>IndexTemplateMetadata.Builder.toXContentWithTypes(template, builder, params);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>if (context == XContentContext.API) {<NEW_LINE>builder.startObject("indices");<NEW_LINE>for (IndexMetadata indexMetadata : metadata) {<NEW_LINE>IndexMetadata.Builder.toXContent(indexMetadata, builder, params);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Custom> cursor : metadata.customs().entrySet()) {<NEW_LINE>if (cursor.getValue().context().contains(context)) {<NEW_LINE>builder.startObject(cursor.getKey());<NEW_LINE>cursor.getValue().toXContent(builder, params);<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}
field("cluster_uuid_committed", metadata.clusterUUIDCommitted);
1,062,083
public FirehoseAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>FirehoseAction firehoseAction = new FirehoseAction();<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("roleArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>firehoseAction.setRoleArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("deliveryStreamName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>firehoseAction.setDeliveryStreamName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("separator", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>firehoseAction.setSeparator(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("batchMode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>firehoseAction.setBatchMode(context.getUnmarshaller(Boolean.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 firehoseAction;<NEW_LINE>}
class).unmarshall(context));
1,051,910
public Collection<HudsonJob> createJobs(Collection<BuilderConnector.JobData> data) {<NEW_LINE>Collection<HudsonJob> jobList = new ArrayList<HudsonJob>();<NEW_LINE>for (BuilderConnector.JobData jd : data) {<NEW_LINE>HudsonJobImpl job = new HudsonJobImpl(this);<NEW_LINE>if (jd.isSecured()) {<NEW_LINE>job.putProperty(JOB_COLOR, HudsonJob.Color.secured);<NEW_LINE>}<NEW_LINE>job.putProperty(JOB_NAME, jd.getJobName());<NEW_LINE>job.putProperty(JOB_URL, jd.getJobUrl());<NEW_LINE>if (jd.getColor() != null) {<NEW_LINE>// may be null, see #230406<NEW_LINE>job.putProperty(JOB_COLOR, jd.getColor());<NEW_LINE>}<NEW_LINE>job.putProperty(JOB_DISPLAY_NAME, jd.getDisplayName() == null ? jd.getJobName() : jd.getDisplayName());<NEW_LINE>job.putProperty(<MASK><NEW_LINE>job.putProperty(JOB_IN_QUEUE, jd.isInQueue());<NEW_LINE>job.putProperty(JOB_LAST_BUILD, jd.getLastBuild());<NEW_LINE>job.putProperty(JOB_LAST_FAILED_BUILD, jd.getLastFailedBuild());<NEW_LINE>job.putProperty(JOB_LAST_STABLE_BUILD, jd.getLastStableBuild());<NEW_LINE>job.putProperty(JOB_LAST_SUCCESSFUL_BUILD, jd.getLastSuccessfulBuild());<NEW_LINE>job.putProperty(JOB_LAST_COMPLETED_BUILD, jd.getLastCompletedBuild());<NEW_LINE>for (BuilderConnector.ModuleData md : jd.getModules()) {<NEW_LINE>job.addModule(md.getName(), md.getDisplayName(), md.getColor(), md.getUrl());<NEW_LINE>}<NEW_LINE>for (HudsonView v : this.getViews()) {
JOB_BUILDABLE, jd.isBuildable());
1,301,445
public int ladderLength(String beginWord, String endWord, List<String> wordList) {<NEW_LINE>words = new HashSet<>(wordList);<NEW_LINE>if (!words.contains(endWord)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>Queue<String> <MASK><NEW_LINE>Queue<String> q2 = new ArrayDeque<>();<NEW_LINE>Map<String, Integer> m1 = new HashMap<>();<NEW_LINE>Map<String, Integer> m2 = new HashMap<>();<NEW_LINE>q1.offer(beginWord);<NEW_LINE>q2.offer(endWord);<NEW_LINE>m1.put(beginWord, 0);<NEW_LINE>m2.put(endWord, 0);<NEW_LINE>while (!q1.isEmpty() && !q2.isEmpty()) {<NEW_LINE>int t = q1.size() <= q2.size() ? extend(m1, m2, q1) : extend(m2, m1, q2);<NEW_LINE>if (t != -1) {<NEW_LINE>return t + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
q1 = new ArrayDeque<>();
1,033,321
private void initInsert(Bundle savedInstanceState) {<NEW_LINE>mStateInsert = true;<NEW_LINE>findViewById(android.R.id.button2<MASK><NEW_LINE>findViewById(android.R.id.button3).setOnClickListener(this);<NEW_LINE>setTitle(R.string.activity_add_list_title);<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>InputTextDialogFragment dialog = InputTextDialogFragment.newInstance(getString(R.string.task_list_name_dialog_title), getString(R.string.task_list_name_dialog_hint), null, getString(R.string.task_list_no_sync));<NEW_LINE>dialog.show(getSupportFragmentManager(), null);<NEW_LINE>}<NEW_LINE>if (mListColor == NO_COLOR) {<NEW_LINE>RandomPalette palette = new RandomPalette("generate list color", "random colors", 1);<NEW_LINE>mListColor = palette.colorAt(0);<NEW_LINE>}<NEW_LINE>mNameView.setText(mListName);<NEW_LINE>mColorView.setBackgroundColor(mListColor);<NEW_LINE>}
).setVisibility(View.GONE);
54,279
public Path findPathInWorkdirOrLookup(Path uri) {<NEW_LINE>Optional<Path> lookUpFile = pathMapper.lookUpFile(uri);<NEW_LINE>if (lookUpFile.isPresent()) {<NEW_LINE>return lookUpFile.get();<NEW_LINE>}<NEW_LINE>Optional<Path> optional = current.currentPath().map(Path::getParent);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>Path resolve = optional.get().resolve(uri);<NEW_LINE>if (Files.exists(resolve)) {<NEW_LINE>return resolve;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Path workingDirectory = workingDirectory();<NEW_LINE>Path resolve = workingDirectory.resolve(uri);<NEW_LINE>if (Files.exists(resolve)) {<NEW_LINE>return resolve;<NEW_LINE>}<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>Path currentParent = optional.get();<NEW_LINE>while (true) {<NEW_LINE>if (Objects.nonNull(currentParent)) {<NEW_LINE>Path <MASK><NEW_LINE>if (Files.exists(candidate)) {<NEW_LINE>return candidate;<NEW_LINE>} else {<NEW_LINE>currentParent = currentParent.getParent();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
candidate = currentParent.resolve(uri);
1,106,192
public void afterPropertiesSet() throws Exception {<NEW_LINE>String name = this.threadPrefix + "@" + <MASK><NEW_LINE>if (this.executor == null) {<NEW_LINE>QueuedThreadPool threadPool = new QueuedThreadPool();<NEW_LINE>threadPool.setName(name);<NEW_LINE>this.executor = threadPool;<NEW_LINE>}<NEW_LINE>if (this.byteBufferPool == null) {<NEW_LINE>this.byteBufferPool = new MappedByteBufferPool(2048, this.executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool) this.executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2);<NEW_LINE>}<NEW_LINE>if (this.scheduler == null) {<NEW_LINE>this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false);<NEW_LINE>}<NEW_LINE>if (this.executor instanceof LifeCycle) {<NEW_LINE>((LifeCycle) this.executor).start();<NEW_LINE>}<NEW_LINE>this.scheduler.start();<NEW_LINE>}
Integer.toHexString(hashCode());
874,408
/* Build call for apisApiIdThumbnailPost */<NEW_LINE>private com.squareup.okhttp.Call apisApiIdThumbnailPostCall(String apiId, File file, String contentType, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/thumbnail".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "apiId" + "\\}", apiClient.escapeString(apiId.toString()));<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (contentType != null)<NEW_LINE>localVarHeaderParams.put("Content-Type", apiClient.parameterToString(contentType));<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (file != null)<NEW_LINE>localVarFormParams.put("file", file);<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
= new ArrayList<Pair>();
1,750,413
final CreateNamespaceResult executeCreateNamespace(CreateNamespaceRequest createNamespaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createNamespaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateNamespaceRequest> request = null;<NEW_LINE>Response<CreateNamespaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateNamespaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createNamespaceRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNamespace");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateNamespaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateNamespaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,352,157
public boolean execute() {<NEW_LINE>GraphController graphController = Lookup.getDefault().lookup(GraphController.class);<NEW_LINE>GraphModel graphModel = graphController.getGraphModel(workspace);<NEW_LINE>Graph graph = exportVisible ? graphModel.getGraphVisible() : graphModel.getGraph();<NEW_LINE>Progress.start(progress);<NEW_LINE>graph.readLock();<NEW_LINE>// Is it a dynamic graph?<NEW_LINE>exportDynamic = exportDynamic && graphModel.isDynamic();<NEW_LINE>// Calculate min & max<NEW_LINE>calculateMinMax(graph);<NEW_LINE>Progress.switchToDeterminate(progress, graph.getNodeCount() + graph.getEdgeCount());<NEW_LINE>try {<NEW_LINE>XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();<NEW_LINE>outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);<NEW_LINE>XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(writer);<NEW_LINE>xmlWriter = new IndentingXMLStreamWriter(xmlWriter);<NEW_LINE>xmlWriter.writeStartDocument("UTF-8", "1.0");<NEW_LINE>xmlWriter.setPrefix("", GEXF_NAMESPACE);<NEW_LINE><MASK><NEW_LINE>xmlWriter.writeNamespace("", GEXF_NAMESPACE);<NEW_LINE>xmlWriter.writeAttribute(GEXF_VERSION, "1.3");<NEW_LINE>if (exportColors || exportPosition || exportSize) {<NEW_LINE>xmlWriter.writeNamespace(VIZ, VIZ_NAMESPACE);<NEW_LINE>}<NEW_LINE>xmlWriter.writeAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");<NEW_LINE>xmlWriter.writeAttribute("xsi:schemaLocation", GEXF_NAMESPACE_LOCATION);<NEW_LINE>writeMeta(xmlWriter);<NEW_LINE>writeGraph(xmlWriter, graph);<NEW_LINE>xmlWriter.writeEndElement();<NEW_LINE>xmlWriter.writeEndDocument();<NEW_LINE>xmlWriter.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.getLogger(ExporterGEXF.class.getName()).log(Level.SEVERE, null, e);<NEW_LINE>} finally {<NEW_LINE>graph.readUnlock();<NEW_LINE>Progress.finish(progress);<NEW_LINE>}<NEW_LINE>return !cancel;<NEW_LINE>}
xmlWriter.writeStartElement(GEXF_NAMESPACE, GEXF);
820,867
public void addACL(Collection<String> listIPs, int from, int to) {<NEW_LINE>AmazonEC2 client = null;<NEW_LINE>try {<NEW_LINE>client = getEc2Client();<NEW_LINE>List<IpPermission> ipPermissions = new ArrayList<>();<NEW_LINE>ipPermissions.add(new IpPermission().withFromPort(from).withIpProtocol("tcp").withIpRanges(listIPs).withToPort(to));<NEW_LINE>if (isClassic()) {<NEW_LINE>client.authorizeSecurityGroupIngress(new AuthorizeSecurityGroupIngressRequest(config.getACLGroupName(), ipPermissions));<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Done adding ACL to classic: " + StringUtils.join(listIPs, ","));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>AuthorizeSecurityGroupIngressRequest sgIngressRequest = new AuthorizeSecurityGroupIngressRequest();<NEW_LINE><MASK><NEW_LINE>// fetch SG group id for vpc account of the running instance.<NEW_LINE>client.authorizeSecurityGroupIngress(// Adding peers' IPs as ingress to the running<NEW_LINE>sgIngressRequest.// Adding peers' IPs as ingress to the running<NEW_LINE>withIpPermissions(ipPermissions));<NEW_LINE>// instance SG<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Done adding ACL to vpc: " + StringUtils.join(listIPs, ","));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (client != null)<NEW_LINE>client.shutdown();<NEW_LINE>}<NEW_LINE>}
sgIngressRequest.withGroupId(getVpcGoupId());
197,416
public static XMLStreamReader createReader(final Reader reader, final JettisonConfig config) throws XMLStreamException {<NEW_LINE>Reader nonEmptyReader = ensureNonEmptyReader(reader);<NEW_LINE>switch(config.getNotation()) {<NEW_LINE>case MAPPED_JETTISON:<NEW_LINE>try {<NEW_LINE>Configuration jmConfig;<NEW_LINE>if (null == config.getXml2JsonNs()) {<NEW_LINE>jmConfig = new Configuration();<NEW_LINE>} else {<NEW_LINE>jmConfig = new <MASK><NEW_LINE>}<NEW_LINE>return new MappedXMLStreamReader(new JSONObject(new JSONTokener(ReaderWriter.readFromAsString(nonEmptyReader))), new MappedNamespaceConvention(jmConfig));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new XMLStreamException(ex);<NEW_LINE>}<NEW_LINE>case BADGERFISH:<NEW_LINE>try {<NEW_LINE>return new BadgerFishXMLStreamReader(new JSONObject(new JSONTokener(ReaderWriter.readFromAsString(nonEmptyReader))));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new XMLStreamException(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// This should not occur<NEW_LINE>throw new IllegalArgumentException("Unknown JSON config");<NEW_LINE>}
Configuration(config.getXml2JsonNs());
671,821
public boolean validateTopLevelAspectsParameters(ImmutableMap<String, String> aspectsParameters) throws EvalException {<NEW_LINE>Preconditions.checkArgument(aspectsParameters != null, "aspectsParameters cannot be null");<NEW_LINE>ImmutableSet.Builder<String> usedParametersBuilder = ImmutableSet.builder();<NEW_LINE>for (AspectDetails<?> aspectDetails : aspects.values()) {<NEW_LINE>if (aspectDetails instanceof StarlarkAspectDetails) {<NEW_LINE>ImmutableList<Attribute> aspectAttributes = ((StarlarkAspectDetails) aspectDetails).aspect.getAttributes();<NEW_LINE>for (Attribute attr : aspectAttributes) {<NEW_LINE>if (attr.isImplicit() || attr.isLateBound()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String attrName = attr.getName();<NEW_LINE>if (aspectsParameters.containsKey(attrName)) {<NEW_LINE>usedParametersBuilder.add(attrName);<NEW_LINE>} else if (attr.isMandatory()) {<NEW_LINE>throw Starlark.errorf("Missing mandatory attribute '%s' for aspect '%s'.", attrName, aspectDetails.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImmutableSet<String> usedParameters = usedParametersBuilder.build();<NEW_LINE>ImmutableList<String> unusedParameters = aspectsParameters.keySet().stream().filter(p -> !usedParameters.contains(p)<MASK><NEW_LINE>if (!unusedParameters.isEmpty()) {<NEW_LINE>throw Starlark.errorf("Parameters '%s' are not parameters of any of the top-level aspects but they are" + " specified in --aspects_parameters.", unusedParameters);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
).collect(toImmutableList());
255,587
protected Message createMessage(Object object, MessageProperties messageProperties) throws MessageConversionException {<NEW_LINE>byte[] bytes;<NEW_LINE>if (object instanceof String) {<NEW_LINE>try {<NEW_LINE>bytes = ((String) object).getBytes(this.defaultCharset);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new MessageConversionException("failed to convert Message content", e);<NEW_LINE>}<NEW_LINE>messageProperties.setContentType(MessageProperties.CONTENT_TYPE_TEXT_PLAIN);<NEW_LINE>messageProperties.setContentEncoding(this.defaultCharset);<NEW_LINE>} else if (object instanceof byte[]) {<NEW_LINE>bytes = (byte[]) object;<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ByteArrayOutputStream output = new ByteArrayOutputStream();<NEW_LINE>try {<NEW_LINE>this.serializer.serialize(object, output);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MessageConversionException("Cannot convert object to bytes", e);<NEW_LINE>}<NEW_LINE>bytes = output.toByteArray();<NEW_LINE>messageProperties.setContentType(MessageProperties.CONTENT_TYPE_SERIALIZED_OBJECT);<NEW_LINE>}<NEW_LINE>if (bytes != null) {<NEW_LINE>messageProperties.setContentLength(bytes.length);<NEW_LINE>}<NEW_LINE>return new Message(bytes, messageProperties);<NEW_LINE>}
messageProperties.setContentType(MessageProperties.CONTENT_TYPE_BYTES);
1,449,421
protected Void doInBackground(Void... voids) {<NEW_LINE>try {<NEW_LINE>double c = 0.0;<NEW_LINE>BufferedInputStream origin = null;<NEW_LINE>FileOutputStream dest = new FileOutputStream(getAlbums().getSelectedAlbum(0).getParentsFolders().get(1) + "/" + getAlbums().getSelectedAlbum(0).getName() + ".zip");<NEW_LINE>ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest));<NEW_LINE>byte[] data = new byte[BUFFER];<NEW_LINE>for (int i = 0; i < path.size(); i++) {<NEW_LINE>FileInputStream fi = new FileInputStream(path.get(i));<NEW_LINE>origin = new BufferedInputStream(fi, BUFFER);<NEW_LINE>ZipEntry entry = new ZipEntry(path.get(i).substring(path.get(i).lastIndexOf("/") + 1));<NEW_LINE>out.putNextEntry(entry);<NEW_LINE>c++;<NEW_LINE>if ((int) ((c / size) * 100) > 100) {<NEW_LINE>NotificationHandler.actionProgress((int) c, path.size(), 100, R.string.zip_operation);<NEW_LINE>} else {<NEW_LINE>NotificationHandler.actionProgress((int) c, path.size(), (int) ((c / path.size()) * 100), R.string.zip_operation);<NEW_LINE>}<NEW_LINE>int count;<NEW_LINE>while ((count = origin.read(data, 0, BUFFER)) != -1) {<NEW_LINE>out.<MASK><NEW_LINE>}<NEW_LINE>origin.close();<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>if (isCancelled()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
write(data, 0, count);
458,868
private long streamMessagesForRecording() {<NEW_LINE>try (ExclusivePublication publication = aeron.addExclusivePublication(CHANNEL, STREAM_ID)) {<NEW_LINE>final IdleStrategy idleStrategy = YieldingIdleStrategy.INSTANCE;<NEW_LINE>while (!publication.isConnected()) {<NEW_LINE>idleStrategy.idle();<NEW_LINE>}<NEW_LINE>final long startNs = System.nanoTime();<NEW_LINE>final UnsafeBuffer buffer = this.buffer;<NEW_LINE>for (long i = 0; i < NUMBER_OF_MESSAGES; i++) {<NEW_LINE>buffer.putLong(0, i);<NEW_LINE>idleStrategy.reset();<NEW_LINE>while (publication.offer(buffer, 0, MESSAGE_LENGTH) < 0) {<NEW_LINE>idleStrategy.idle();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final long stopPosition = publication.position();<NEW_LINE>final CountersReader counters = aeron.countersReader();<NEW_LINE>final int counterId = RecordingPos.findCounterIdBySession(counters, publication.sessionId());<NEW_LINE>idleStrategy.reset();<NEW_LINE>while (counters.getCounterValue(counterId) < stopPosition) {<NEW_LINE>idleStrategy.idle();<NEW_LINE>}<NEW_LINE>final long durationMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);<NEW_LINE>final double dataRate = (stopPosition * 1000.0d / durationMs) / MEGABYTE;<NEW_LINE>final double recordingMb = stopPosition / MEGABYTE;<NEW_LINE>final long msgRate = (NUMBER_OF_MESSAGES / durationMs) * 1000L;<NEW_LINE>System.out.printf("Recorded %.02f MB @ %.02f MB/s - %,d msg/sec - %d byte payload + 32 byte header%n", <MASK><NEW_LINE>return RecordingPos.getRecordingId(counters, counterId);<NEW_LINE>}<NEW_LINE>}
recordingMb, dataRate, msgRate, MESSAGE_LENGTH);
1,064,995
public ReadinessCheckSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ReadinessCheckSummary readinessCheckSummary = new ReadinessCheckSummary();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("readiness", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>readinessCheckSummary.setReadiness(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("readinessCheckName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>readinessCheckSummary.setReadinessCheckName(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 readinessCheckSummary;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
884,472
public RefreshToken verifyRefreshToken(KeycloakSession session, RealmModel realm, ClientModel client, HttpRequest request, String encodedRefreshToken, boolean checkExpiration) throws OAuthErrorException {<NEW_LINE>try {<NEW_LINE>RefreshToken refreshToken = toRefreshToken(session, encodedRefreshToken);<NEW_LINE>if (!(TokenUtil.TOKEN_TYPE_REFRESH.equals(refreshToken.getType()) || TokenUtil.TOKEN_TYPE_OFFLINE.equals(refreshToken.getType()))) {<NEW_LINE>throw new OAuthErrorException(OAuthErrorException.INVALID_GRANT, "Invalid refresh token");<NEW_LINE>}<NEW_LINE>if (checkExpiration) {<NEW_LINE>try {<NEW_LINE>TokenVerifier.createWithoutSignature(refreshToken).withChecks(NotBeforeCheck.forModel(realm), TokenVerifier.IS_ACTIVE).verify();<NEW_LINE>} catch (VerificationException e) {<NEW_LINE>throw new OAuthErrorException(OAuthErrorException.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!client.getClientId().equals(refreshToken.getIssuedFor())) {<NEW_LINE>throw new OAuthErrorException(OAuthErrorException.INVALID_GRANT, "Invalid refresh token. Token client and authorized client don't match");<NEW_LINE>}<NEW_LINE>// KEYCLOAK-6771 Certificate Bound Token<NEW_LINE>if (OIDCAdvancedConfigWrapper.fromClientModel(client).isUseMtlsHokToken()) {<NEW_LINE>if (!MtlsHoKTokenUtil.verifyTokenBindingWithClientCertificate(refreshToken, request, session)) {<NEW_LINE>throw new OAuthErrorException(OAuthErrorException.UNAUTHORIZED_CLIENT, MtlsHoKTokenUtil.CERT_VERIFY_ERROR_DESC);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return refreshToken;<NEW_LINE>} catch (JWSInputException e) {<NEW_LINE>throw new OAuthErrorException(OAuthErrorException.INVALID_GRANT, "Invalid refresh token", e);<NEW_LINE>}<NEW_LINE>}
INVALID_GRANT, e.getMessage());
1,048,235
protected BatchElementConfiguration collectJobIds(CommandContext commandContext) {<NEW_LINE>Set<String> collectedProcessInstanceIds = new HashSet<>();<NEW_LINE>if (query != null) {<NEW_LINE>collectedProcessInstanceIds.addAll(((ProcessInstanceQueryImpl<MASK><NEW_LINE>}<NEW_LINE>if (historicProcessInstanceQuery != null) {<NEW_LINE>List<String> ids = ((HistoricProcessInstanceQueryImpl) historicProcessInstanceQuery).listIds();<NEW_LINE>collectedProcessInstanceIds.addAll(ids);<NEW_LINE>}<NEW_LINE>if (this.processInstanceIds != null) {<NEW_LINE>collectedProcessInstanceIds.addAll(this.processInstanceIds);<NEW_LINE>}<NEW_LINE>BatchElementConfiguration elementConfiguration = new BatchElementConfiguration();<NEW_LINE>if (!CollectionUtil.isEmpty(collectedProcessInstanceIds)) {<NEW_LINE>JobQueryImpl jobQuery = new JobQueryImpl();<NEW_LINE>jobQuery.processInstanceIds(collectedProcessInstanceIds);<NEW_LINE>elementConfiguration.addDeploymentMappings(commandContext.runWithoutAuthorization(jobQuery::listDeploymentIdMappings));<NEW_LINE>}<NEW_LINE>return elementConfiguration;<NEW_LINE>}
) query).listIds());
1,703,086
public ClassRecord synchronize(Environment env, ClassStmtToken token, Tokenizer tokenizer) {<NEW_LINE>NamespaceRecord namespaceRecord = synchronize(env, token.getNamespace());<NEW_LINE>ClassRecord classRecord = namespaceRecord.getClass(token.getName().getName());<NEW_LINE>if (classRecord == null) {<NEW_LINE>classRecord = new ClassRecord(env);<NEW_LINE>classRecord.setToken(token);<NEW_LINE>}<NEW_LINE>classRecord.setComment(token.getDocComment() == null ? null : token.getDocComment().getComment());<NEW_LINE>classRecord.setName(token.getFulledName());<NEW_LINE>classRecord.setIsAbstract(token.isAbstract());<NEW_LINE>if (token.getExtend() != null) {<NEW_LINE>ClassRecord parent = new ClassRecord(env);<NEW_LINE>parent.setName(token.getExtend().getName().getName());<NEW_LINE>classRecord.setParent(parent);<NEW_LINE>}<NEW_LINE>for (MethodStmtToken methodStmtToken : token.getMethods()) {<NEW_LINE>synchronize(<MASK><NEW_LINE>}<NEW_LINE>for (ClassVarStmtToken varStmtToken : token.getProperties()) {<NEW_LINE>synchronize(env, varStmtToken, classRecord, tokenizer);<NEW_LINE>}<NEW_LINE>namespaceRecord.addClass(classRecord);<NEW_LINE>return classRecord;<NEW_LINE>}
env, methodStmtToken, classRecord, tokenizer);
908,203
void CopyTree(DocumentFile dstFolderDoc, DocumentFile srcFolderDoc) {<NEW_LINE>for (DocumentFile srcFileDoc : srcFolderDoc.listFiles()) {<NEW_LINE>if (srcFileDoc.isDirectory()) {<NEW_LINE>Log.w(Constants.TAG, String.format("Creating directory '%s'...", srcFileDoc.getName()));<NEW_LINE>DocumentFile dstFileDoc = dstFolderDoc.createDirectory(srcFileDoc.getName());<NEW_LINE>CopyTree(dstFileDoc, srcFileDoc);<NEW_LINE>} else {<NEW_LINE>Log.w(Constants.TAG, String.format("Copying file '%s'...", srcFileDoc.getName()));<NEW_LINE>try {<NEW_LINE>if (dstFolderDoc.findFile(srcFileDoc.getName()) != null) {<NEW_LINE>Log.w(Constants.TAG, "Skipping because it already exists.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (_excludedFileNames.contains(srcFileDoc.getName())) {<NEW_LINE>Log.w(Constants.TAG, "Skipping because it is excluded.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>DocumentFile dstFileDoc = dstFolderDoc.createFile(<MASK><NEW_LINE>CopyFile(dstFileDoc, srcFileDoc);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.e(Constants.TAG, "Failed to copy file.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"", srcFileDoc.getName());
1,113,226
private static int errorCheck(TraceContext ctx, Throwable thr) {<NEW_LINE>int error = 0;<NEW_LINE>if (ctx.error != 0) {<NEW_LINE>error = ctx.error;<NEW_LINE>} else if (thr != null) {<NEW_LINE>Configure conf = Configure.getInstance();<NEW_LINE>String emsg = thr.toString();<NEW_LINE>if (conf.profile_fullstack_service_error_enabled) {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append<MASK><NEW_LINE>ThreadUtil.getStackTrace(sb, thr, conf.profile_fullstack_max_lines);<NEW_LINE>Throwable thrCause = thr.getCause();<NEW_LINE>if (thrCause != null) {<NEW_LINE>thr = thrCause;<NEW_LINE>while (thr != null) {<NEW_LINE>sb.append("\nCause...\n");<NEW_LINE>ThreadUtil.getStackTrace(sb, thr, conf.profile_fullstack_max_lines);<NEW_LINE>thr = thr.getCause();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>emsg = sb.toString();<NEW_LINE>}<NEW_LINE>error = DataProxy.sendError(emsg);<NEW_LINE>ServiceSummary.getInstance().process(thr, error, ctx.serviceHash, ctx.txid, 0, 0);<NEW_LINE>} else if (ctx.userTransaction > 0 && conf.xlog_error_check_user_transaction_enabled) {<NEW_LINE>error = DataProxy.sendError("Missing Commit/Rollback Error");<NEW_LINE>ServiceSummary.getInstance().process(userTxNotClose, error, ctx.serviceHash, ctx.txid, 0, 0);<NEW_LINE>}<NEW_LINE>return error;<NEW_LINE>}
(emsg).append("\n");
606,268
private Stream<ChangeStreamRecord> toChangeStreamRecord(PartitionMetadata partition, Struct row, ChangeStreamResultSetMetadata resultSetMetadata) {<NEW_LINE>final Stream<DataChangeRecord> dataChangeRecords = row.getStructList(DATA_CHANGE_RECORD_COLUMN).stream().filter(this::isNonNullDataChangeRecord).map(struct -> toDataChangeRecord(partition, struct, resultSetMetadata));<NEW_LINE>final Stream<HeartbeatRecord> heartbeatRecords = row.getStructList(HEARTBEAT_RECORD_COLUMN).stream().filter(this::isNonNullHeartbeatRecord).map(struct -> toHeartbeatRecord<MASK><NEW_LINE>final Stream<ChildPartitionsRecord> childPartitionsRecords = row.getStructList(CHILD_PARTITIONS_RECORD_COLUMN).stream().filter(this::isNonNullChildPartitionsRecord).map(struct -> toChildPartitionsRecord(partition, struct, resultSetMetadata));<NEW_LINE>return Stream.concat(Stream.concat(dataChangeRecords, heartbeatRecords), childPartitionsRecords);<NEW_LINE>}
(partition, struct, resultSetMetadata));
1,317,731
// Invoke the Janitor on-the-fly for all GET operations and for most payment operations (except notifyPendingPaymentOfStateChanged)<NEW_LINE>public PaymentModelDao invokeJanitor(final PaymentModelDao curPaymentModelDao, final Collection<PaymentTransactionModelDao> curTransactionsModelDao, @Nullable final Iterable<PaymentTransactionInfoPlugin> pluginTransactions, final boolean isApiPayment, final InternalTenantContext internalTenantContext) {<NEW_LINE>PaymentModelDao newPaymentModelDao = curPaymentModelDao;<NEW_LINE>final Collection<PaymentTransactionModelDao> transactionsModelDao <MASK><NEW_LINE>for (final PaymentTransactionModelDao curPaymentTransactionModelDao : curTransactionsModelDao) {<NEW_LINE>PaymentTransactionModelDao newPaymentTransactionModelDao = curPaymentTransactionModelDao;<NEW_LINE>final PaymentTransactionInfoPlugin paymentTransactionInfoPlugin = findPaymentTransactionInfoPlugin(newPaymentTransactionModelDao, pluginTransactions);<NEW_LINE>if (paymentTransactionInfoPlugin != null) {<NEW_LINE>// Make sure to invoke the Janitor task in case the plugin fixes its state on the fly<NEW_LINE>// See https://github.com/killbill/killbill/issues/341<NEW_LINE>final boolean hasChanged = invokeJanitor(newPaymentModelDao.getAccountId(), newPaymentTransactionModelDao, paymentTransactionInfoPlugin, isApiPayment, internalTenantContext);<NEW_LINE>if (hasChanged) {<NEW_LINE>newPaymentModelDao = paymentDao.getPayment(newPaymentModelDao.getId(), internalTenantContext);<NEW_LINE>newPaymentTransactionModelDao = paymentDao.getPaymentTransaction(newPaymentTransactionModelDao.getId(), internalTenantContext);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.debug("Unable to find transaction={} from pluginTransactions={}", curPaymentTransactionModelDao, pluginTransactions);<NEW_LINE>}<NEW_LINE>transactionsModelDao.add(newPaymentTransactionModelDao);<NEW_LINE>}<NEW_LINE>curTransactionsModelDao.clear();<NEW_LINE>curTransactionsModelDao.addAll(transactionsModelDao);<NEW_LINE>return newPaymentModelDao;<NEW_LINE>}
= new LinkedList<PaymentTransactionModelDao>();
58,181
private void processSplit(final String parsed_value) {<NEW_LINE>if (splits == null) {<NEW_LINE>// then this is the first time we're processing the value, so we need to<NEW_LINE>// execute the split if there's a separator, after some validation<NEW_LINE>if (parsed_value == null || parsed_value.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Value was empty for rule: " + rule);<NEW_LINE>}<NEW_LINE>if (rule.getSeparator() == null || rule.getSeparator().isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Separator was empty for rule: " + rule);<NEW_LINE>}<NEW_LINE>// split it<NEW_LINE>splits = parsed_value.split(rule.getSeparator());<NEW_LINE>if (splits.length < 1) {<NEW_LINE>testMessage("Separator did not match, created an empty list on rule: " + rule);<NEW_LINE>// set the index to 1 so the next time through it thinks we're done and<NEW_LINE>// moves on to the next rule<NEW_LINE>split_idx = 1;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>split_idx = 0;<NEW_LINE>setCurrentName<MASK><NEW_LINE>split_idx++;<NEW_LINE>} else {<NEW_LINE>// otherwise we have split values and we just need to grab the next one<NEW_LINE>setCurrentName(parsed_value, splits[split_idx]);<NEW_LINE>split_idx++;<NEW_LINE>}<NEW_LINE>}
(parsed_value, splits[split_idx]);
1,159,108
final CreateCertificateAuthorityAuditReportResult executeCreateCertificateAuthorityAuditReport(CreateCertificateAuthorityAuditReportRequest createCertificateAuthorityAuditReportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCertificateAuthorityAuditReportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCertificateAuthorityAuditReportRequest> request = null;<NEW_LINE>Response<CreateCertificateAuthorityAuditReportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCertificateAuthorityAuditReportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCertificateAuthorityAuditReportRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCertificateAuthorityAuditReport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCertificateAuthorityAuditReportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCertificateAuthorityAuditReportResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "ACM PCA");
267,798
public List<List<Integer>> threeSum(int[] nums) {<NEW_LINE>Arrays.sort(nums);<NEW_LINE>List<List<Integer>> result = new ArrayList<>();<NEW_LINE>for (int i = 0; i < nums.length - 2; i++) {<NEW_LINE>if (i >= 1 && nums[i] == nums[i - 1]) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int left = i + 1;<NEW_LINE>int right = nums.length - 1;<NEW_LINE>while (left < right) {<NEW_LINE>int sum = nums[i] + nums[left] + nums[right];<NEW_LINE>if (sum == 0) {<NEW_LINE>result.add(Arrays.asList(nums[i], nums[left<MASK><NEW_LINE>while (left < right && nums[left] == nums[left + 1]) {<NEW_LINE>left++;<NEW_LINE>}<NEW_LINE>while (left < right && nums[right] == nums[right - 1]) {<NEW_LINE>right--;<NEW_LINE>}<NEW_LINE>// these two lines are critical and easy to forget, if so, it'll TLE<NEW_LINE>left++;<NEW_LINE>right--;<NEW_LINE>} else if (sum > 0) {<NEW_LINE>right--;<NEW_LINE>} else {<NEW_LINE>left++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
], nums[right]));
1,163,494
private static boolean checkArgumentIndex(@NotNull ProblemsHolder holder, @NotNull GoExpression placeholder, @NotNull GoCallExpr callExpr, @NotNull Placeholder fmtPlaceholder, int callArgsNum) {<NEW_LINE><MASK><NEW_LINE>if (argNum < 0)<NEW_LINE>return false;<NEW_LINE>if (argNum == 0) {<NEW_LINE>TextRange range = TextRange.create(fmtPlaceholder.getStartPos() + 3, fmtPlaceholder.getStartPos() + 4);<NEW_LINE>// TODO florin: add quickfix to suggest placeholder value<NEW_LINE>holder.registerProblem(placeholder, "Index value [0] is not allowed #loc", ProblemHighlightType.GENERIC_ERROR_OR_WARNING, range);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (argNum < callArgsNum)<NEW_LINE>return true;<NEW_LINE>if (GoPsiImplUtil.hasVariadic(callExpr.getArgumentList()))<NEW_LINE>return false;<NEW_LINE>if (argNum == callArgsNum)<NEW_LINE>return true;<NEW_LINE>// There are bad indexes in the format or there are fewer arguments than the format needs<NEW_LINE>// This is the argument number relative to the format: Printf("%s", "hi") will give 1 for the "hi"<NEW_LINE>int arg = fmtPlaceholder.getPosition();<NEW_LINE>String message = String.format("Got %d placeholder(s) for %d arguments(s)", arg, callArgsNum);<NEW_LINE>holder.registerProblem(placeholder, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING);<NEW_LINE>return false;<NEW_LINE>}
int argNum = fmtPlaceholder.getPosition();
658,410
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select " + "(select * from SupportBean#keepall).enumPlugInReturnSingleEvent(v => intPrimitive > 0).theString as c0 " + "from SupportBean_S0";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> assertEquals(EPTypePremade.STRING.getEPType(), statement.getEventType().getPropertyEPType("c0")));<NEW_LINE>sendAssert(env, null);<NEW_LINE>env.sendEventBean(new <MASK><NEW_LINE>sendAssert(env, null);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 1));<NEW_LINE>sendAssert(env, "E2");<NEW_LINE>env.sendEventBean(new SupportBean("E3", 0));<NEW_LINE>sendAssert(env, "E2");<NEW_LINE>env.sendEventBean(new SupportBean("E4", 1));<NEW_LINE>sendAssert(env, "E2");<NEW_LINE>env.undeployAll();<NEW_LINE>}
SupportBean("E1", -1));
1,537,880
private Mono<PagedResponse<DeploymentOperationInner>> listAtScopeSinglePageAsync(String scope, String deploymentName, Integer top, 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 (scope == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (deploymentName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.listAtScope(this.client.getEndpoint(), scope, deploymentName, top, this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>}
this.client.mergeContext(context);
605,846
protected void addDecorators(CustomResourceInfo config, TypeDef def, Optional<String> specReplicasPath, Optional<String> statusReplicasPath, Optional<String> labelSelectorPath) {<NEW_LINE>final String name = config.crdName();<NEW_LINE>final String version = config.version();<NEW_LINE>resources.decorate(new AddCustomResourceDefinitionResourceDecorator(name, config.group(), config.kind(), config.scope().value(), config.shortNames(), config.plural(), config.singular()));<NEW_LINE>resources.decorate(new AddCustomResourceDefinitionVersionDecorator(name, version));<NEW_LINE>resources.decorate(new AddSchemaToCustomResourceDefinitionVersionDecorator(name, version, JsonSchema.from(def, "kind", "apiVersion", "metadata")));<NEW_LINE>specReplicasPath.ifPresent(path -> {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddSpecReplicasPathDecorator(name, version, path));<NEW_LINE>});<NEW_LINE>statusReplicasPath.ifPresent(path -> {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddStatusReplicasPathDecorator(name, version, path));<NEW_LINE>});<NEW_LINE>labelSelectorPath.ifPresent(path -> {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddLabelSelectorPathDecorator(name, version, path));<NEW_LINE>});<NEW_LINE>if (config.statusClassName().isPresent()) {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddStatusSubresourceDecorator(name, version));<NEW_LINE>}<NEW_LINE>resources.decorate(new SetServedVersionDecorator(name, version, config.served()));<NEW_LINE>resources.decorate(new SetStorageVersionDecorator(name, version, config.storage()));<NEW_LINE>resources.<MASK><NEW_LINE>resources.decorate(new PromoteSingleVersionAttributesDecorator(name));<NEW_LINE>resources.decorate(new SortPrinterColumnsDecorator(name, version));<NEW_LINE>}
decorate(new EnsureSingleStorageVersionDecorator(name));
1,338,145
// { group name, < ip:port, physical table filter > }<NEW_LINE>private Map<String, Pair<String, String>> generateExecutableGroups(Map<String, Set<String>> topology, Map<String, Set<Pair<String, String>>> groupsByInstance, ExecutionContext executionContext) {<NEW_LINE>Map<String, Pair<String, String>> <MASK><NEW_LINE>// Generate executable groups and their filters.<NEW_LINE>boolean collectByGroup = executionContext.getParamManager().getBoolean(ConnectionParams.INFO_SCHEMA_QUERY_STAT_BY_GROUP);<NEW_LINE>for (String instance : groupsByInstance.keySet()) {<NEW_LINE>StringBuffer physicalTableListByInstance = new StringBuffer();<NEW_LINE>Set<Pair<String, String>> groupsAndDatabases = groupsByInstance.get(instance);<NEW_LINE>for (Pair<String, String> groupAndDatabase : groupsAndDatabases) {<NEW_LINE>StringBuffer physicalTableListByGroup = new StringBuffer();<NEW_LINE>for (String physicalTable : topology.get(groupAndDatabase.getKey())) {<NEW_LINE>physicalTableListByGroup.append("'").append(physicalTable).append("',");<NEW_LINE>}<NEW_LINE>if (collectByGroup) {<NEW_LINE>physicalTableListByGroup.deleteCharAt(physicalTableListByGroup.length() - 1);<NEW_LINE>executableGroups.put(groupAndDatabase.getKey(), new Pair<>(instance, physicalTableListByGroup.toString()));<NEW_LINE>} else {<NEW_LINE>physicalTableListByInstance.append(physicalTableListByGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!collectByGroup) {<NEW_LINE>physicalTableListByInstance.deleteCharAt(physicalTableListByInstance.length() - 1);<NEW_LINE>executableGroups.put(groupsAndDatabases.iterator().next().getKey(), new Pair<>(instance, physicalTableListByInstance.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return executableGroups;<NEW_LINE>}
executableGroups = new HashMap<>();
1,176,618
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>addPreferencesFromResource(R.xml.settings);<NEW_LINE>ActionBar supportActionBar = getSupportActionBar();<NEW_LINE>if (supportActionBar != null) {<NEW_LINE>supportActionBar.setDisplayHomeAsUpEnabled(true);<NEW_LINE>}<NEW_LINE>// initialized pre-installed models<NEW_LINE>preInstalledModelPaths = new ArrayList<String>();<NEW_LINE>preInstalledYamlPaths = new ArrayList<String>();<NEW_LINE>preInstalledImagePaths = new ArrayList<String>();<NEW_LINE>preInstalledCPUThreadNums = new ArrayList<String>();<NEW_LINE>preInstalledCPUPowerModes = new ArrayList<String>();<NEW_LINE>preInstalledModelPaths.add(getString(R.string.MODEL_PATH_DEFAULT));<NEW_LINE>preInstalledYamlPaths.add(getString(R.string.YAML_PATH_DEFAULT));<NEW_LINE>preInstalledImagePaths.add(getString(R.string.IMAGE_PATH_DEFAULT));<NEW_LINE>preInstalledCPUThreadNums.add(getString(R.string.CPU_THREAD_NUM_DEFAULT));<NEW_LINE>preInstalledCPUPowerModes.add(getString(R.string.CPU_POWER_MODE_DEFAULT));<NEW_LINE>// initialize UI components<NEW_LINE>lpChoosePreInstalledModel = (ListPreference) findPreference(getString(R.string.CHOOSE_PRE_INSTALLED_MODEL_KEY));<NEW_LINE>String[] preInstalledModelNames = new String[preInstalledModelPaths.size()];<NEW_LINE>for (int i = 0; i < preInstalledModelPaths.size(); i++) {<NEW_LINE>preInstalledModelNames[i] = preInstalledModelPaths.get(i).substring(preInstalledModelPaths.get(i).lastIndexOf("/") + 1);<NEW_LINE>}<NEW_LINE>lpChoosePreInstalledModel.setEntries(preInstalledModelNames);<NEW_LINE>lpChoosePreInstalledModel.setEntryValues(preInstalledModelPaths.toArray(new String[preInstalledModelPaths.size()]));<NEW_LINE>cbEnableCustomSettings = (CheckBoxPreference) findPreference(getString(R.string.ENABLE_CUSTOM_SETTINGS_KEY));<NEW_LINE>etModelPath = (EditTextPreference) findPreference(getString(R.string.MODEL_PATH_KEY));<NEW_LINE>etModelPath.setTitle("Model Path (SDCard: " + Utils.getSDCardDirectory() + ")");<NEW_LINE>etYamlPath = (EditTextPreference) findPreference(getString(R.string.YAML_PATH_KEY));<NEW_LINE>etImagePath = (EditTextPreference) findPreference(getString(R.string.IMAGE_PATH_KEY));<NEW_LINE>lpCPUThreadNum = (ListPreference) findPreference(getString<MASK><NEW_LINE>lpCPUPowerMode = (ListPreference) findPreference(getString(R.string.CPU_POWER_MODE_KEY));<NEW_LINE>}
(R.string.CPU_THREAD_NUM_KEY));
1,745,478
public static final void main(String[] args) throws IOException {<NEW_LINE>FileManager m = new FileManager(Paths.get("H:\\test123")<MASK><NEW_LINE>String content = "content\nabc\rblah\r\n";<NEW_LINE>m.add("test", "filename", true, new FileContentInfoProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileContentInfo getInfo(String content) {<NEW_LINE>if (content != null && !content.isEmpty()) {<NEW_LINE>return new FileContentInfo(true, content.length() + " characters");<NEW_LINE>}<NEW_LINE>return new FileContentInfo(false, "Empty file");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// m.save("test", content);<NEW_LINE>//<NEW_LINE>// String read = m.loadFromFile(Paths.get("H:\\test123\\filename"));<NEW_LINE>// System.out.println(read.equals(content));<NEW_LINE>// for (FileInfo info : m.getFileInfo()) {<NEW_LINE>// System.out.println(info);<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// System.out.println(getTimestamp("abc"));<NEW_LINE>// System.out.println(getTimestamp("auto_123456__"));<NEW_LINE>// System.out.println(getTimestamp("auto_123456__abc"));<NEW_LINE>// long a = -1;<NEW_LINE>// long b = 3232323232323L;<NEW_LINE>// System.out.println((a - System.currentTimeMillis()));<NEW_LINE>// m.backup((int)DateTime.HOUR, 5);<NEW_LINE>// BackupManager mg = new BackupManager(m);<NEW_LINE>// mg.setModal(true);<NEW_LINE>// mg.setLocationRelativeTo(null);<NEW_LINE>// mg.open();<NEW_LINE>// System.exit(0);<NEW_LINE>}
, Paths.get("H:\\test123\\backupp"));
963,402
public void connect() {<NEW_LINE>RPCHook rpcHook = null;<NEW_LINE>if (null != accessKey && accessKey.length() > 0 && null != secretKey && secretKey.length() > 0) {<NEW_LINE>SessionCredentials sessionCredentials = new SessionCredentials();<NEW_LINE>sessionCredentials.setAccessKey(accessKey);<NEW_LINE>sessionCredentials.setSecretKey(secretKey);<NEW_LINE>rpcHook = new AclClientRPCHook(sessionCredentials);<NEW_LINE>}<NEW_LINE>rocketMQConsumer = new DefaultMQPushConsumer(groupName, rpcHook, new AllocateMessageQueueAveragely(), enableMessageTrace, customizedTraceTopic);<NEW_LINE>rocketMQConsumer.setVipChannelEnabled(false);<NEW_LINE>if (CLOUD_ACCESS_CHANNEL.equals(this.accessChannel)) {<NEW_LINE>rocketMQConsumer.setAccessChannel(AccessChannel.CLOUD);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isEmpty(this.namespace)) {<NEW_LINE>rocketMQConsumer.setNamespace(this.namespace);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isBlank(nameServer)) {<NEW_LINE>rocketMQConsumer.setNamesrvAddr(nameServer);<NEW_LINE>}<NEW_LINE>if (batchSize != -1) {<NEW_LINE>rocketMQConsumer.setConsumeMessageBatchMaxSize(batchSize);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (rocketMQConsumer == null) {<NEW_LINE>this.connect();<NEW_LINE>}<NEW_LINE>rocketMQConsumer.subscribe(this.topic, this.filter);<NEW_LINE>rocketMQConsumer.registerMessageListener((MessageListenerOrderly) (messageExts, context) -> {<NEW_LINE>context.setAutoCommit(true);<NEW_LINE>boolean isSuccess = process(messageExts);<NEW_LINE>if (isSuccess) {<NEW_LINE>return ConsumeOrderlyStatus.SUCCESS;<NEW_LINE>} else {<NEW_LINE>return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>rocketMQConsumer.start();<NEW_LINE>} catch (MQClientException ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
logger.error("Start RocketMQ consumer error", ex);
1,113,121
static double[][] convertToProbabilitiesBySoftMax(double[][] scores) {<NEW_LINE>double[][] probabilities = new double[scores.length][];<NEW_LINE>double[] sum = new double[scores.length];<NEW_LINE>for (int i = 0; i < scores.length; i++) {<NEW_LINE>probabilities[i] = new double<MASK><NEW_LINE>double maxScore = MovingFunctions.max(scores[i]);<NEW_LINE>for (int j = 0; j < scores[i].length; j++) {<NEW_LINE>probabilities[i][j] = Math.exp(scores[i][j] - maxScore);<NEW_LINE>sum[i] += probabilities[i][j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < scores.length; i++) {<NEW_LINE>for (int j = 0; j < scores[i].length; j++) {<NEW_LINE>probabilities[i][j] /= sum[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return probabilities;<NEW_LINE>}
[scores[i].length];
791,168
public void fitSelectionToLines(boolean expand) {<NEW_LINE>Range range = getSession().getSelection().getRange();<NEW_LINE>Position start = range.getStart();<NEW_LINE>Position newStart = start;<NEW_LINE>if (start.getColumn() > 0) {<NEW_LINE>if (expand) {<NEW_LINE>newStart = Position.create(start.getRow(), 0);<NEW_LINE>} else {<NEW_LINE>String firstLine = getSession().getLine(start.getRow());<NEW_LINE>if (firstLine.substring(0, start.getColumn()).trim().length() == 0)<NEW_LINE>newStart = Position.create(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Position end = range.getEnd();<NEW_LINE>Position newEnd = end;<NEW_LINE>if (expand) {<NEW_LINE>int endRow = end.getRow();<NEW_LINE>if (endRow == newStart.getRow() || end.getColumn() > 0) {<NEW_LINE>// If selection ends at the start of a line, keep the selection<NEW_LINE>// there--unless that means less than one line will be selected<NEW_LINE>// in total.<NEW_LINE>newEnd = Position.create(endRow, getSession().getLine(endRow).length());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (newEnd.getRow() != newStart.getRow()) {<NEW_LINE>String line = getSession().getLine(newEnd.getRow());<NEW_LINE>if (line.substring(0, newEnd.getColumn()).trim().length() != 0)<NEW_LINE>break;<NEW_LINE>int prevRow = newEnd.getRow() - 1;<NEW_LINE>int len = getSession().getLine(prevRow).length();<NEW_LINE>newEnd = Position.create(prevRow, len);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getSession().getSelection().setSelectionRange(Range.fromPoints(newStart, newEnd));<NEW_LINE>}
start.getRow(), 0);
170,724
public ByteBuf encodeResponse(Request request, Response response) throws Exception {<NEW_LINE>BaiduRpcEncodePacket responsePacket = new BaiduRpcEncodePacket();<NEW_LINE>BaiduRpcProto.RpcMeta.Builder metaBuilder = BaiduRpcProto.RpcMeta.newBuilder();<NEW_LINE>metaBuilder.setCorrelationId(response.getCorrelationId());<NEW_LINE>int compressType = response.getCompressType();<NEW_LINE>metaBuilder.setCompressType(compressType);<NEW_LINE>BaiduRpcProto.RpcResponseMeta.Builder responseMetaBuilder = BaiduRpcProto.RpcResponseMeta.newBuilder();<NEW_LINE>if (response.getException() != null) {<NEW_LINE>responseMetaBuilder.setErrorCode(BaiduRpcErrno.Errno.EINTERNAL_VALUE);<NEW_LINE>if (StringUtils.isNotBlank(response.getException().getMessage())) {<NEW_LINE>responseMetaBuilder.setErrorText(response.getException().getMessage());<NEW_LINE>}<NEW_LINE>metaBuilder.setResponse(responseMetaBuilder.build());<NEW_LINE>responsePacket.setRpcMeta(metaBuilder.build());<NEW_LINE>} else {<NEW_LINE>responseMetaBuilder.setErrorCode(0);<NEW_LINE>metaBuilder.setResponse(responseMetaBuilder.build());<NEW_LINE>Object responseProto = response.getResult();<NEW_LINE>Compress compress = compressManager.getCompress(compressType);<NEW_LINE>ByteBuf protoBuf = compress.compressOutput(responseProto, response.getRpcMethodInfo());<NEW_LINE>responsePacket.setProto(protoBuf);<NEW_LINE>// attachment<NEW_LINE>if (response.getBinaryAttachment() != null) {<NEW_LINE>responsePacket.setAttachment(response.getBinaryAttachment());<NEW_LINE>metaBuilder.setAttachmentSize(response.<MASK><NEW_LINE>}<NEW_LINE>responsePacket.setRpcMeta(metaBuilder.build());<NEW_LINE>}<NEW_LINE>return encode(responsePacket);<NEW_LINE>}
getBinaryAttachment().readableBytes());
1,620,068
public Credentials unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE><MASK><NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Credentials credentials = new Credentials();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("AccessKeyId")) {<NEW_LINE>credentials.setAccessKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("SecretKey")) {<NEW_LINE>credentials.setSecretKey(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("SessionToken")) {<NEW_LINE>credentials.setSessionToken(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Expiration")) {<NEW_LINE>credentials.setExpiration(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return credentials;<NEW_LINE>}
AwsJsonReader reader = context.getReader();
44,705
private void updateDrawerMode(boolean accountMode) {<NEW_LINE>mLeftDrawerMenu.setGroupVisible(R<MASK><NEW_LINE>mLeftDrawerMenu.setGroupVisible(R.id.navigation, !accountMode);<NEW_LINE>mLeftDrawerMenu.setGroupVisible(R.id.explore, !accountMode);<NEW_LINE>mLeftDrawerMenu.setGroupVisible(R.id.settings, !accountMode);<NEW_LINE>mLeftDrawerMenu.setGroupVisible(R.id.account, accountMode);<NEW_LINE>mLeftDrawerMenu.setGroupVisible(R.id.other_accounts, accountMode);<NEW_LINE>if (accountMode) {<NEW_LINE>// repopulate other account list<NEW_LINE>for (int i = 0; ; i++) {<NEW_LINE>MenuItem item = mLeftDrawerMenu.findItem(OTHER_ACCOUNTS_GROUP_BASE_ID + i);<NEW_LINE>if (item == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>mLeftDrawerMenu.removeItem(item.getItemId());<NEW_LINE>}<NEW_LINE>int id = OTHER_ACCOUNTS_GROUP_BASE_ID;<NEW_LINE>LongSparseArray<String> accounts = Gh4Application.get().getAccounts();<NEW_LINE>for (int i = 0; i < accounts.size(); i++) {<NEW_LINE>String login = accounts.valueAt(i);<NEW_LINE>if (ApiHelpers.loginEquals(mUserLogin, login)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MenuItem item = mLeftDrawerMenu.add(R.id.other_accounts, id++, Menu.NONE, login);<NEW_LINE>AvatarHandler.assignAvatar(this, item, login, accounts.keyAt(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mDrawerSwitcher.setImageResource(accountMode ? R.drawable.drop_up_arrow_white : R.drawable.drop_down_arrow_white);<NEW_LINE>mDrawerInAccountMode = accountMode;<NEW_LINE>}
.id.my_items, !accountMode);
138,072
private ColumnMetadata buildColumnMetadata(String name, Object value) {<NEW_LINE>Class<?> clazz = value.getClass();<NEW_LINE>if (Map.class.isAssignableFrom(clazz)) {<NEW_LINE>return buildMapColumnMetadata(name, (Map<MASK><NEW_LINE>} else if (List.class.isAssignableFrom(clazz)) {<NEW_LINE>List<?> list = (List<?>) value;<NEW_LINE>if (!list.isEmpty()) {<NEW_LINE>Object innerValue = list.iterator().next();<NEW_LINE>return buildListColumnMetadata(name, innerValue);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (clazz.isArray()) {<NEW_LINE>Object[] array = (Object[]) value;<NEW_LINE>if (array.length > 0) {<NEW_LINE>return buildListColumnMetadata(name, array[0]);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return MetadataUtils.newScalar(name, getScalarMinorType(clazz), DataMode.OPTIONAL);<NEW_LINE>}
<String, Object>) value);
238,207
public void onChannelPart(final ChanPartMessage msg) {<NEW_LINE>if (!isThisChatRoom(msg.getChannelName())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IRCUser user = msg.getSource();<NEW_LINE>if (localUser(user)) {<NEW_LINE>leaveChatRoom();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String userNick = msg.getSource().getNick();<NEW_LINE>final ChatRoomMember member = this.chatroom.getChatRoomMember(userNick);<NEW_LINE>if (member != null) {<NEW_LINE>// When the account has been disabled, the chat room may return<NEW_LINE>// null. If that is NOT the case, continue handling.<NEW_LINE>try {<NEW_LINE>this.chatroom.fireMemberPresenceEvent(member, null, ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT, msg.getPartMsg());<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
warn("This should not have happened. Please report this " + "as it is a bug.", e);
1,690,675
public void cellMouseTrigger(TableCellMouseEvent event) {<NEW_LINE>SearchSubsResultBase entry = (SearchSubsResultBase) event.cell.getDataSource();<NEW_LINE>String tooltip = null;<NEW_LINE>boolean invalidateAndRefresh = false;<NEW_LINE>Rectangle bounds = ((TableCellSWT) event.cell).getBounds();<NEW_LINE>String text = (String) event.cell.getTableRow().getData("text");<NEW_LINE>if (text == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GCStringPrinter sp = null;<NEW_LINE>GC gc = new GC(Display.getDefault());<NEW_LINE>try {<NEW_LINE>if (font != null) {<NEW_LINE>gc.setFont(font);<NEW_LINE>}<NEW_LINE>Rectangle drawBounds = getDrawBounds((TableCellSWT) event.cell);<NEW_LINE>sp = new GCStringPrinter(gc, text, drawBounds, true, true, SWT.WRAP | SWT.CENTER);<NEW_LINE>sp.calculateMetrics();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Debug.out(e);<NEW_LINE>} finally {<NEW_LINE>gc.dispose();<NEW_LINE>}<NEW_LINE>if (sp != null) {<NEW_LINE>URLInfo hitUrl = sp.getHitUrl(event.x + bounds.x, event.y + bounds.y);<NEW_LINE>int newCursor;<NEW_LINE>if (hitUrl != null) {<NEW_LINE>if (event.eventType == TableCellMouseEvent.EVENT_MOUSEUP && event.button == 1) {<NEW_LINE>if (hitUrl.url.equals("download")) {<NEW_LINE>SBC_SearchResultsView.downloadAction(entry);<NEW_LINE>} else if (hitUrl.url.equals("details")) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>Utils.launch(new URL(details_url));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (hitUrl.url.equals("download")) {<NEW_LINE>tooltip = entry.getTorrentLink();<NEW_LINE>} else if (hitUrl.url.equals("details")) {<NEW_LINE>tooltip = entry.getDetailsLink();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newCursor = SWT.CURSOR_HAND;<NEW_LINE>} else {<NEW_LINE>newCursor = SWT.CURSOR_ARROW;<NEW_LINE>}<NEW_LINE>int oldCursor = ((TableCellSWT) event.cell).getCursorID();<NEW_LINE>if (oldCursor != newCursor) {<NEW_LINE>invalidateAndRefresh = true;<NEW_LINE>((TableCellSWT) event.cell).setCursorID(newCursor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object o = event.cell.getToolTip();<NEW_LINE>if ((o == null) || (o instanceof String)) {<NEW_LINE>String oldTooltip = (String) o;<NEW_LINE>if (!StringCompareUtils.equals(oldTooltip, tooltip)) {<NEW_LINE>invalidateAndRefresh = true;<NEW_LINE>event.cell.setToolTip(tooltip);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (invalidateAndRefresh) {<NEW_LINE>event.cell.invalidate();<NEW_LINE>((TableCellSWT) event.cell).redraw();<NEW_LINE>}<NEW_LINE>}
String details_url = entry.getDetailsLink();
4,956
private void processCommandAddGroup(String commandLine) {<NEW_LINE>try {<NEW_LINE>CommandLine cmd = CMD_PARSER.parse(addGroupOptions(), commandLine.split(" "));<NEW_LINE>if (cmd.getArgList().size() != 1 || !cmd.hasOption("f") || !cmd.hasOption("g")) {<NEW_LINE>logError("Invalid command, expecting addToGroup[removeFromGroup] -f <featureName> -g <grouName>");<NEW_LINE>} else {<NEW_LINE>String feature = cmd.getOptionValue('f');<NEW_LINE>String group = cmd.getOptionValue('g');<NEW_LINE>if (!currentFF4J.getFeatureStore().exist(feature)) {<NEW_LINE>logWarn("Feature does not exist, nothing updated");<NEW_LINE>} else {<NEW_LINE>if (cmd.getArgList().get(0).equals("addToGroup")) {<NEW_LINE>currentFF4J.getFeatureStore().addToGroup(feature, group);<NEW_LINE>logInfo(FEATURE + feature + " has been added to group " + group);<NEW_LINE>} else if (cmd.getArgList().get(0).equals("removeFromGroup")) {<NEW_LINE>String currentGroup = currentFF4J.getFeatureStore().<MASK><NEW_LINE>if (group.equals(currentGroup)) {<NEW_LINE>currentFF4J.getFeatureStore().removeFromGroup(feature, group);<NEW_LINE>logInfo(FEATURE + feature + " has been removed from group: " + group);<NEW_LINE>} else if (currentGroup == null || currentGroup.isEmpty()) {<NEW_LINE>logWarn("The groupName is invalid expected:" + currentGroup + " but was [" + group + "]");<NEW_LINE>} else {<NEW_LINE>logWarn("Cannot remove group: there are no group on this feature");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ParseException e) {<NEW_LINE>error(e, "Error during addToGroup/removeFromGroup command");<NEW_LINE>}<NEW_LINE>}
read(feature).getGroup();
985,666
public Expression implement(RexToLixTranslator translator, RexCall call, NullAs nullAs) {<NEW_LINE>switch(nullAs) {<NEW_LINE>case IS_NULL:<NEW_LINE>return Expressions.constant(false);<NEW_LINE>case IS_NOT_NULL:<NEW_LINE>return Expressions.constant(true);<NEW_LINE>}<NEW_LINE>final SqlOperator op = call.getOperator();<NEW_LINE>final Expression root = translator.getRoot();<NEW_LINE>if (op == CURRENT_USER || op == SESSION_USER || op == USER) {<NEW_LINE>return Expressions.constant("sa");<NEW_LINE>} else if (op == SYSTEM_USER) {<NEW_LINE>return Expressions.constant(System.getProperty("user.name"));<NEW_LINE>} else if (op == CURRENT_PATH || op == CURRENT_ROLE || op == CURRENT_CATALOG) {<NEW_LINE>// By default, the CURRENT_ROLE and CURRENT_CATALOG functions return the<NEW_LINE>// empty string because a role or a catalog has to be set explicitly.<NEW_LINE>return Expressions.constant("");<NEW_LINE>} else if (op == CURRENT_TIMESTAMP) {<NEW_LINE>return Expressions.call(BuiltInMethod.CURRENT_TIMESTAMP.method, root);<NEW_LINE>} else if (op == CURRENT_TIME) {<NEW_LINE>return Expressions.call(BuiltInMethod.CURRENT_TIME.method, root);<NEW_LINE>} else if (op == CURRENT_DATE) {<NEW_LINE>return Expressions.call(BuiltInMethod.CURRENT_DATE.method, root);<NEW_LINE>} else if (op == LOCALTIMESTAMP) {<NEW_LINE>return Expressions.call(BuiltInMethod.LOCAL_TIMESTAMP.method, root);<NEW_LINE>} else if (op == LOCALTIME) {<NEW_LINE>return Expressions.call(<MASK><NEW_LINE>} else {<NEW_LINE>throw new AssertionError("unknown function " + op);<NEW_LINE>}<NEW_LINE>}
BuiltInMethod.LOCAL_TIME.method, root);
54,544
public static ArrayList<Integer> sieve(int lowerLimit, int upperLimit) {<NEW_LINE>ArrayList<Integer> result = new ArrayList<>();<NEW_LINE>if (upperLimit > 2) {<NEW_LINE>result.add(2);<NEW_LINE>}<NEW_LINE>;<NEW_LINE>if (upperLimit > 3) {<NEW_LINE>result.add(3);<NEW_LINE>}<NEW_LINE>;<NEW_LINE>boolean[] sieve = new boolean[upperLimit];<NEW_LINE>IntStream.range(0, upperLimit).forEach(i -> sieve[i] = false);<NEW_LINE>for (int x = 1; x * x < upperLimit; x++) {<NEW_LINE>for (int y = 1; y * y < upperLimit; y++) {<NEW_LINE>int n = (4 * x * x) + (y * y);<NEW_LINE>if (n <= upperLimit && (n % 12 == 1 || n % 12 == 5))<NEW_LINE>sieve[n] ^= true;<NEW_LINE>n = (3 * x * x) + (y * y);<NEW_LINE>if (n <= upperLimit && n % 12 == 7)<NEW_LINE>sieve[n] ^= true;<NEW_LINE>n = (3 * x * x) - (y * y);<NEW_LINE>if (x > y && n <= upperLimit && n % 12 == 11)<NEW_LINE>sieve[n] ^= true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IntStream.iterate(5, r -> r * r < upperLimit, r -> r + 1).filter(r -> sieve[r]).flatMap(r -> IntStream.iterate(r * r, i -> i < upperLimit, i -> i + r * r)).forEach(i <MASK><NEW_LINE>for (int a = lowerLimit; a < upperLimit; a++) {<NEW_LINE>if (sieve[a]) {<NEW_LINE>result.add(a);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
-> sieve[i] = false);
746,507
public Pair<List<QuotaTariffVO>, Integer> doInTransaction(final TransactionStatus status) {<NEW_LINE>List<QuotaTariffVO> tariffs = new ArrayList<QuotaTariffVO>();<NEW_LINE>final Filter filter = new Filter(QuotaTariffVO.class, "updatedOn", false, 0L, 1L);<NEW_LINE>final SearchCriteria<QuotaTariffVO> sc = listAllIncludedUsageType.create();<NEW_LINE>sc.setParameters("onorbefore", effectiveDate);<NEW_LINE>for (Integer quotaType : QuotaTypes.listQuotaTypes().keySet()) {<NEW_LINE>sc.setParameters("quotatype", quotaType);<NEW_LINE>List<QuotaTariffVO> result = search(sc, filter);<NEW_LINE>if (result != null && !result.isEmpty()) {<NEW_LINE>tariffs.add(result.get(0));<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("ListAllTariffPlans on or before " + effectiveDate + " quota type " + result.get(0).getDescription() + " , effective Date=" + result.get(0).getEffectiveOn() + " val=" + result.get<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Pair<>(paginateList(tariffs, startIndex, pageSize), tariffs.size());<NEW_LINE>}
(0).getCurrencyValue());
1,131,675
public Pair<AfterScanAction, Object> scanPool(Long dataCenterId) {<NEW_LINE>List<SecondaryStorageVmVO> ssVms = _secStorageVmDao.getSecStorageVmListInStates(SecondaryStorageVm.Role.templateProcessor, dataCenterId, State.Running, State.Migrating, State.Starting, State.Stopped, State.Stopping);<NEW_LINE>int vmSize = (ssVms == null) <MASK><NEW_LINE>List<DataStore> ssStores = _dataStoreMgr.getImageStoresByScopeExcludingReadOnly(new ZoneScope(dataCenterId));<NEW_LINE>int storeSize = (ssStores == null) ? 0 : ssStores.size();<NEW_LINE>if (storeSize > vmSize) {<NEW_LINE>s_logger.info(String.format("No secondary storage VM found in zone [%s], starting a new one.", dataCenterId));<NEW_LINE>return new Pair<>(AfterScanAction.expand, SecondaryStorageVm.Role.templateProcessor);<NEW_LINE>}<NEW_LINE>return new Pair<>(AfterScanAction.nop, SecondaryStorageVm.Role.templateProcessor);<NEW_LINE>}
? 0 : ssVms.size();
171,067
private CompletableFuture<HttpResponseStatus> shutdownServerThread(Model model, CompletableFuture<HttpResponseStatus> future) {<NEW_LINE>model.getServerThread().shutdown();<NEW_LINE>WorkerLifeCycle lifecycle = model.getServerThread().getLifeCycle();<NEW_LINE><MASK><NEW_LINE>if (workerProcess.isAlive()) {<NEW_LINE>boolean workerDestroyed = false;<NEW_LINE>workerProcess.destroyForcibly();<NEW_LINE>try {<NEW_LINE>workerDestroyed = workerProcess.waitFor(configManager.getUnregisterModelTimeout(), TimeUnit.SECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.warn("WorkerThread interrupted during waitFor, possible asynch resource cleanup.");<NEW_LINE>future.complete(HttpResponseStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>if (!workerDestroyed) {<NEW_LINE>logger.warn("WorkerThread timed out while cleaning, please resend request.");<NEW_LINE>future.complete(HttpResponseStatus.REQUEST_TIMEOUT);<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>future.complete(HttpResponseStatus.OK);<NEW_LINE>return future;<NEW_LINE>}
Process workerProcess = lifecycle.getProcess();
1,096,827
public void start(Xid xid, int flags) throws XAException {<NEW_LINE>long threadId = currentThreadId();<NEW_LINE>TransactionContext threadContext = threadContextMap.get(currentThreadId());<NEW_LINE>switch(flags) {<NEW_LINE>case TMNOFLAGS:<NEW_LINE>List<TransactionContext> contexts = new CopyOnWriteArrayList<TransactionContext>();<NEW_LINE>List<TransactionContext> currentContexts = xidContextMap.putIfAbsent(xid, contexts);<NEW_LINE>if (currentContexts != null) {<NEW_LINE>throw new XAException("There is already TransactionContexts for the given xid: " + xid);<NEW_LINE>}<NEW_LINE>TransactionContext context = createTransactionContext(xid);<NEW_LINE>contexts.add(context);<NEW_LINE>threadContextMap.put(threadId, context);<NEW_LINE>break;<NEW_LINE>case TMRESUME:<NEW_LINE>case TMJOIN:<NEW_LINE>List<TransactionContext> contextList = xidContextMap.get(xid);<NEW_LINE>if (contextList == null) {<NEW_LINE>throw new XAException("There is no TransactionContexts for the given xid: " + xid);<NEW_LINE>}<NEW_LINE>if (threadContext == null) {<NEW_LINE>threadContext = createTransactionContext(xid);<NEW_LINE>threadContextMap.put(threadId, threadContext);<NEW_LINE>contextList.add(threadContext);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new XAException("Unknown flag! " + flags);
784,864
public static AutomaticDependencies parse(URL[] urls) throws SAXException, IOException {<NEW_LINE>LOG.log(Level.FINE, "Parsing automatic dependencies {0}", Arrays.asList(urls));<NEW_LINE>AutomaticDependencies h = new AutomaticDependencies();<NEW_LINE>Parser p = new Parser(h.new Handler());<NEW_LINE>for (URL url : urls) {<NEW_LINE>String id = url.toExternalForm();<NEW_LINE>InputStream inS = null;<NEW_LINE>try {<NEW_LINE>InputSource is = new InputSource(id);<NEW_LINE>inS = new BufferedInputStream(url.openStream());<NEW_LINE>is.setByteStream(inS);<NEW_LINE>p.parse(is);<NEW_LINE>} catch (SAXException e) {<NEW_LINE>throw new SAXException("While parsing: " + id, e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>IOException exc <MASK><NEW_LINE>exc.initCause(e);<NEW_LINE>throw exc;<NEW_LINE>} finally {<NEW_LINE>if (inS != null) {<NEW_LINE>inS.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return h;<NEW_LINE>}
= new IOException("While parsing: " + id);
1,796,065
public static List<String> doOutgoing(File repository, HgURL toUrl, String revision, String branch, OutputLogger logger, boolean showSaveCredentialsOption) throws HgException {<NEW_LINE>if (repository == null || toUrl == null)<NEW_LINE>return null;<NEW_LINE>InterRepositoryCommand command = new InterRepositoryCommand();<NEW_LINE>command.defaultUrl = new HgConfigFiles(repository).getDefaultPush(false);<NEW_LINE>command.hgCommandType = HG_OUTGOING_CMD;<NEW_LINE>command.logger = logger;<NEW_LINE>command.outputDetails = false;<NEW_LINE>command.remoteUrl = toUrl;<NEW_LINE>command.repository = repository;<NEW_LINE>if (revision != null) {<NEW_LINE>command.additionalOptions.add(HG_FLAG_REV_CMD);<NEW_LINE>command.additionalOptions.add(revision);<NEW_LINE>}<NEW_LINE>if (branch != null) {<NEW_LINE>command.additionalOptions.add(HG_PARAM_BRANCH);<NEW_LINE>command.additionalOptions.add(branch);<NEW_LINE>}<NEW_LINE>command.additionalOptions.add(HG_VERBOSE_CMD);<NEW_LINE>File tempFolder = Utils.getTempFolder(false);<NEW_LINE>try {<NEW_LINE>command.additionalOptions.add(prepareLogTemplate(tempFolder, HG_LOG_BASIC_CHANGESET_NAME));<NEW_LINE>command.showSaveOption = showSaveCredentialsOption;<NEW_LINE>command.urlPathProperties = new String[] { HgConfigFiles.HG_DEFAULT_PUSH };<NEW_LINE>return command.invoke();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Mercurial.LOG.log(<MASK><NEW_LINE>throw new HgException(ex.getMessage());<NEW_LINE>} finally {<NEW_LINE>Utils.deleteRecursively(tempFolder);<NEW_LINE>}<NEW_LINE>}
Level.INFO, null, ex);
1,052,628
private Level determineGradleLogLevel(BuildListener l) {<NEW_LINE>try {<NEW_LINE>project.log("Detected gradle AntLoggingAdapter", Project.MSG_DEBUG);<NEW_LINE>Field loggerField = l.getClass().getDeclaredField("logger");<NEW_LINE>loggerField.setAccessible(true);<NEW_LINE>// org.gradle.internal.logging.slf4j.OutputEventListenerBackedLogger<NEW_LINE>Object <MASK><NEW_LINE>Class<?> gradleLogLevel = l.getClass().getClassLoader().loadClass("org.gradle.api.logging.LogLevel");<NEW_LINE>Method isLevelAtMostMethod = logger.getClass().getDeclaredMethod("isLevelAtMost", gradleLogLevel);<NEW_LINE>isLevelAtMostMethod.setAccessible(true);<NEW_LINE>Object[] logLevels = gradleLogLevel.getEnumConstants();<NEW_LINE>// the log levels in gradle are declared in the order DEBUG, INFO, LIFECYCLE, WARN, QUIET, ERROR<NEW_LINE>Level[] mapping = new Level[] { // DEBUG<NEW_LINE>// INFO<NEW_LINE>Level.FINEST, // LIFECYCLE<NEW_LINE>Level.CONFIG, // WARN<NEW_LINE>Level.INFO, // QUIET<NEW_LINE>Level.WARNING, // ERROR<NEW_LINE>Level.SEVERE, Level.SEVERE };<NEW_LINE>for (int i = 0; i < Math.min(logLevels.length, mapping.length); i++) {<NEW_LINE>boolean enabled = (boolean) isLevelAtMostMethod.invoke(logger, logLevels[i]);<NEW_LINE>if (enabled) {<NEW_LINE>project.log("Current log level: " + logLevels[i] + " -> " + mapping[i], Project.MSG_DEBUG);<NEW_LINE>return mapping[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ReflectiveOperationException ignored) {<NEW_LINE>// ignored<NEW_LINE>}<NEW_LINE>project.log("Could not determine log level, falling back to default: " + DEFAULT_LEVEL, Project.MSG_WARN);<NEW_LINE>return DEFAULT_LEVEL;<NEW_LINE>}
logger = loggerField.get(l);
731,531
public void removeRequiredAction(String action) {<NEW_LINE>// Always update DB<NEW_LINE>super.removeRequiredAction(action);<NEW_LINE>if (ldapProvider.getEditMode() == UserStorageProvider.EditMode.WRITABLE && RequiredAction.UPDATE_PASSWORD.toString().equals(action)) {<NEW_LINE>// Don't set pwdLastSet in MSAD LDS when it is new user<NEW_LINE>if (!Boolean.parseBoolean(ldapUser.getAttributeAsString(LDAPConstants.MSDS_USER_PASSWORD_NOTREQD))) {<NEW_LINE>logger.debugf("Going to remove required action UPDATE_PASSWORD from MSAD LDS for ldap user '%s' ", ldapUser.getDn().toString());<NEW_LINE>// Normally it's read-only<NEW_LINE>ldapUser.removeReadOnlyAttributeName(LDAPConstants.PWD_LAST_SET);<NEW_LINE>ldapUser.setSingleAttribute(LDAPConstants.PWD_LAST_SET, "-1");<NEW_LINE>ldapProvider.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getLdapIdentityStore().update(ldapUser);
1,294,260
// DownloadHelper.Callback implementation.<NEW_LINE>@Override<NEW_LINE>public void onPrepared(DownloadHelper helper) {<NEW_LINE>@Nullable<NEW_LINE>Format format = getFirstFormatWithDrmInitData(helper);<NEW_LINE>if (format == null) {<NEW_LINE>onDownloadPrepared(helper);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// The content is DRM protected. We need to acquire an offline license.<NEW_LINE>if (Util.SDK_INT < 18) {<NEW_LINE>Toast.makeText(context, R.string.error_drm_unsupported_before_api_18, <MASK><NEW_LINE>Log.e(TAG, "Downloading DRM protected content is not supported on API versions below 18");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO(internal b/163107948): Support cases where DrmInitData are not in the manifest.<NEW_LINE>if (!hasSchemaData(format.drmInitData)) {<NEW_LINE>Toast.makeText(context, R.string.download_start_error_offline_license, Toast.LENGTH_LONG).show();<NEW_LINE>Log.e(TAG, "Downloading content where DRM scheme data is not located in the manifest is not" + " supported");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>widevineOfflineLicenseFetchTask = new WidevineOfflineLicenseFetchTask(format, mediaItem.localConfiguration.drmConfiguration, httpDataSourceFactory, /* dialogHelper= */<NEW_LINE>this, helper);<NEW_LINE>widevineOfflineLicenseFetchTask.execute();<NEW_LINE>}
Toast.LENGTH_LONG).show();
1,518,642
public void createInboundPaymentFromJson(@NonNull @RequestBody final JsonInvoicePaymentCreateRequest request) {<NEW_LINE>final LocalDate dateTrx = CoalesceUtil.coalesce(request.getTransactionDate(), SystemTime.asLocalDate());<NEW_LINE>final List<JsonPaymentAllocationLine> lines = request.getLines();<NEW_LINE>if (validateAllocationLineAmounts(lines)) {<NEW_LINE>throw new AdempiereException("At least one of the following allocation amounts are mandatory in every line: amount, discountAmt, writeOffAmt");<NEW_LINE>}<NEW_LINE>final CurrencyId currencyId = currencyService.<MASK><NEW_LINE>if (currencyId == null) {<NEW_LINE>throw new AdempiereException("Wrong currency: " + request.getCurrencyCode());<NEW_LINE>}<NEW_LINE>final OrgId orgId = RestUtils.retrieveOrgIdOrDefault(request.getOrgCode());<NEW_LINE>if (!orgId.isRegular()) {<NEW_LINE>throw new AdempiereException("Cannot find the orgId from either orgCode=" + request.getOrgCode() + " or the current user's context.");<NEW_LINE>}<NEW_LINE>final BankAccountId bankAccountId = paymentService.determineInboundBankAccountId(orgId, currencyId, request.getTargetIBAN()).orElseThrow(() -> new AdempiereException(String.format("Cannot find Bank Account for org-id: %s, currency: %s and iban: %s", orgId, currencyId, request.getTargetIBAN())));<NEW_LINE>final ExternalIdentifier bPartnerExternalIdentifier = ExternalIdentifier.of(request.getBpartnerIdentifier());<NEW_LINE>final BPartnerId bPartnerId = jsonRetrieverService.resolveBPartnerExternalIdentifier(bPartnerExternalIdentifier, orgId).orElseThrow(() -> new AdempiereException("No BPartner could be found for the given external BPartner identifier!").appendParametersToMessage().setParameter("externalBPartnerIdentifier", bPartnerExternalIdentifier.getRawValue()).setParameter("orgId", orgId));<NEW_LINE>trxManager.runInThreadInheritedTrx(() -> {<NEW_LINE>final I_C_Payment payment = paymentService.newInboundReceiptBuilder().bpartnerId(bPartnerId).payAmt(request.getAmount()).discountAmt(request.getDiscountAmt()).writeoffAmt(request.getWriteOffAmt()).currencyId(currencyId).orgBankAccountId(bankAccountId).adOrgId(orgId).tenderType(TenderType.DirectDeposit).dateAcct(dateTrx).dateTrx(dateTrx).externalId(ExternalId.ofOrNull(request.getExternalPaymentId())).isAutoAllocateAvailableAmt(true).createAndProcess();<NEW_LINE>InterfaceWrapperHelper.save(payment);<NEW_LINE>createAllocationsForPayment(payment, lines);<NEW_LINE>});<NEW_LINE>}
getCurrencyId(request.getCurrencyCode());
1,669,950
public void testPrerequisiteContext() throws Exception {<NEW_LINE>Function<Double, Double> totalCost = purchaseAmount -> {<NEW_LINE>return <MASK><NEW_LINE>};<NEW_LINE>Function<Double, Double> totalCostInRochesterMN;<NEW_LINE>Function<Double, Double> totalCostInAmesIA;<NEW_LINE>ThreadContext contextSvc = ThreadContext.builder().propagated(TestContextTypes.CITY, TestContextTypes.STATE).build();<NEW_LINE>try {<NEW_LINE>CurrentLocation.setLocation("Rochester", "Minnesota");<NEW_LINE>totalCostInRochesterMN = contextSvc.contextualFunction(totalCost);<NEW_LINE>CurrentLocation.setLocation("Ames", "Iowa");<NEW_LINE>totalCostInAmesIA = contextSvc.contextualFunction(totalCost);<NEW_LINE>CurrentLocation.setLocation("Madison", "Wisconsin");<NEW_LINE>assertEquals(212.60, totalCostInRochesterMN.apply(198.00), 0.01);<NEW_LINE>assertEquals(211.86, totalCostInAmesIA.apply(198.00), 0.01);<NEW_LINE>// Verify that context is restored<NEW_LINE>assertEquals(208.89, totalCost.apply(198.00), 0.01);<NEW_LINE>} finally {<NEW_LINE>CurrentLocation.clear();<NEW_LINE>}<NEW_LINE>}
purchaseAmount + CurrentLocation.getTotalSalesTax(purchaseAmount);
1,298,624
private Result maybeFilterByZoneOfferings(Set<String> filterByZoneCodes, Provider provider, Map<String, InstanceType> instanceTypesMap) {<NEW_LINE>if (filterByZoneCodes.isEmpty()) {<NEW_LINE>LOG.debug("No zones specified. Skipping filtering by zone.");<NEW_LINE>} else {<NEW_LINE>CloudAPI cloudAPI = cloudAPIFactory.get(provider.code);<NEW_LINE>if (cloudAPI != null) {<NEW_LINE>try {<NEW_LINE>LOG.debug("Full list of instance types: {}. Filtering it based on offerings.", instanceTypesMap.keySet());<NEW_LINE>Map<Region, Set<String>> azByRegionMap = filterByZoneCodes.stream().map(code -> AvailabilityZone.getByCode(provider, code)).collect(groupingBy(az -> az.region, mapping(az -> az.code, toSet())));<NEW_LINE>LOG.debug("AZs looked up from db {}", azByRegionMap);<NEW_LINE>Map<String, Set<String>> offeringsByInstanceType = cloudAPI.offeredZonesByInstanceType(provider, azByRegionMap, instanceTypesMap.keySet());<NEW_LINE>LOG.debug("Instance Type Offerings from cloud: {}.", offeringsByInstanceType);<NEW_LINE>List<InstanceType> filteredInstanceTypes = offeringsByInstanceType.entrySet().stream().filter(kv -> kv.getValue().size() >= filterByZoneCodes.size()).map(Map.Entry::getKey).map(instanceTypesMap::get).collect(Collectors.toList());<NEW_LINE>LOG.info("Num instanceTypes excluded {} because they were not offered in selected AZs.", instanceTypesMap.size() - filteredInstanceTypes.size());<NEW_LINE>return PlatformResults.withData(filteredInstanceTypes);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>LOG.warn("There was an error {} talking to {} cloud API or filtering instance types " + "based on per zone offerings for user selected zones: {}. We won't filter.", exception.toString(), provider.code, filterByZoneCodes);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return PlatformResults.withData(instanceTypesMap.values());<NEW_LINE>}
info("No Cloud API defined for {}. Skipping filtering by zone.", provider.code);
1,089,154
public int frameCount() throws JdiProxyException {<NEW_LINE>checkValid();<NEW_LINE>if (myFrameCount == -1) {<NEW_LINE>final ThreadReference threadReference = getThreadReference();<NEW_LINE>try {<NEW_LINE>myFrameCount = threadReference.frameCount();<NEW_LINE>} catch (ObjectCollectedException ignored) {<NEW_LINE>myFrameCount = 0;<NEW_LINE>} catch (IncompatibleThreadStateException e) {<NEW_LINE>final boolean isSuspended;<NEW_LINE>try {<NEW_LINE>isSuspended = threadReference.isSuspended();<NEW_LINE>} catch (Throwable ignored) {<NEW_LINE>// unable to determine whether the thread is actually suspended, so propagating original exception<NEW_LINE>throw new JdiProxyException(<MASK><NEW_LINE>}<NEW_LINE>if (!isSuspended) {<NEW_LINE>// give up because it seems to be really resumed<NEW_LINE>throw new JdiProxyException(e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>// JDI bug: although isSuspended() == true, frameCount() may throw IncompatibleThreadStateException<NEW_LINE>// see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4783403<NEW_LINE>// unfortunately, impossible to get this information at the moment, so assume frame count is null<NEW_LINE>myFrameCount = 0;<NEW_LINE>}<NEW_LINE>} catch (InternalException e) {<NEW_LINE>LOG.info(e.getMessage());<NEW_LINE>myFrameCount = 0;<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!getVirtualMachine().canBeModified()) {<NEW_LINE>// do not care in read only vms<NEW_LINE>LOG.debug(e.getMessage());<NEW_LINE>myFrameCount = 0;<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return myFrameCount;<NEW_LINE>}
e.getMessage(), e);
1,037,429
public ConfigureConnectionsResult configureConnectionsIfArgsProvided(@Nullable final CommandLineOptions commandLineOptions) {<NEW_LINE>if (commandLineOptions == null) {<NEW_LINE>return new ConfigureConnectionsResult(false);<NEW_LINE>}<NEW_LINE>// CConnection<NEW_LINE>ConfigureConnectionsResult result;<NEW_LINE>if (Check.isNotBlank(commandLineOptions.getDbHost()) || commandLineOptions.getDbPort() != null) {<NEW_LINE>final CConnectionAttributes connectionAttributes = CConnectionAttributes.builder().dbHost(commandLineOptions.getDbHost()).dbPort(commandLineOptions.getDbPort()).dbName(coalesce(commandLineOptions.getDbName(), "metasfresh")).dbUid(coalesce(commandLineOptions.getDbUser(), "metasfresh")).dbPwd(coalesce(commandLineOptions.getDbPassword()<MASK><NEW_LINE>logger.info("!!!!!!!!!!!!!!!!\n" + "!! dbHost and/or dbPort were set from cmdline; -> will ignore DB-Settings from metasfresh.properties and connect to DB with {}\n" + "!!!!!!!!!!!!!!!!", connectionAttributes);<NEW_LINE>CConnection.createInstance(connectionAttributes);<NEW_LINE>result = new ConfigureConnectionsResult(true);<NEW_LINE>} else {<NEW_LINE>result = new ConfigureConnectionsResult(false);<NEW_LINE>}<NEW_LINE>// RabbitMQ<NEW_LINE>if (Check.isNotBlank(commandLineOptions.getRabbitHost())) {<NEW_LINE>System.setProperty("spring.rabbitmq.host", commandLineOptions.getRabbitHost());<NEW_LINE>}<NEW_LINE>if (commandLineOptions.getRabbitPort() != null) {<NEW_LINE>System.setProperty("spring.rabbitmq.port", Integer.toString(commandLineOptions.getRabbitPort()));<NEW_LINE>}<NEW_LINE>if (Check.isNotBlank(commandLineOptions.getRabbitUser())) {<NEW_LINE>System.setProperty("spring.rabbitmq.username", commandLineOptions.getRabbitUser());<NEW_LINE>}<NEW_LINE>if (Check.isNotBlank(commandLineOptions.getRabbitPassword())) {<NEW_LINE>System.setProperty("spring.rabbitmq.password", commandLineOptions.getRabbitPassword());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
, "metasfresh")).build();
1,394,027
protected final void doSave(boolean force, @Nullable List<SaveSession> saveSessions, @Nonnull List<Pair<SaveSession, File>> readonlyFiles) {<NEW_LINE>ProjectStorageUtil.UnableToSaveProjectNotification[] notifications = NotificationsManager.getNotificationsManager().getNotificationsOfType(ProjectStorageUtil.UnableToSaveProjectNotification.class, myProject);<NEW_LINE>if (notifications.length > 0) {<NEW_LINE>throw new SaveCancelledException();<NEW_LINE>}<NEW_LINE>beforeSave(readonlyFiles);<NEW_LINE>super.doSave(force, saveSessions, readonlyFiles);<NEW_LINE>if (!readonlyFiles.isEmpty()) {<NEW_LINE>ReadonlyStatusHandler.OperationStatus status = AccessRule.read(() -> {<NEW_LINE>List<File> filesList = getFilesList(readonlyFiles);<NEW_LINE>VirtualFile[] files = filesList.stream().map(file -> LocalFileSystem.getInstance().findFileByIoFile(file)).<MASK><NEW_LINE>return ReadonlyStatusHandler.getInstance(myProject).ensureFilesWritable(files);<NEW_LINE>});<NEW_LINE>if (status.hasReadonlyFiles()) {<NEW_LINE>ProjectStorageUtil.dropUnableToSaveProjectNotification(myProject, VfsUtil.virtualToIoFiles(Arrays.asList(status.getReadonlyFiles())));<NEW_LINE>throw new SaveCancelledException();<NEW_LINE>} else {<NEW_LINE>List<Pair<SaveSession, File>> oldList = new ArrayList<>(readonlyFiles);<NEW_LINE>readonlyFiles.clear();<NEW_LINE>for (Pair<SaveSession, File> entry : oldList) {<NEW_LINE>executeSave(entry.first, false, readonlyFiles);<NEW_LINE>}<NEW_LINE>if (!readonlyFiles.isEmpty()) {<NEW_LINE>ProjectStorageUtil.dropUnableToSaveProjectNotification(myProject, getFilesList(readonlyFiles));<NEW_LINE>throw new SaveCancelledException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
toArray(VirtualFile[]::new);
95,122
private void init(CellDataSet table, List<ThinHierarchy> filters, ExcelBuilderOptions options) {<NEW_LINE>this.table = table;<NEW_LINE>this.options = options;<NEW_LINE>queryFilters = filters;<NEW_LINE>maxRows = SpreadsheetVersion.EXCEL2007.getMaxRows();<NEW_LINE>maxColumns = SpreadsheetVersion.EXCEL2007.getMaxColumns();<NEW_LINE>if ("xls".equals(SaikuProperties.webExportExcelFormat)) {<NEW_LINE>HSSFWorkbook wb = new HSSFWorkbook();<NEW_LINE>customColorsPalette = wb.getCustomPalette();<NEW_LINE>excelWorkbook = wb;<NEW_LINE>maxRows = SpreadsheetVersion.EXCEL97.getMaxRows();<NEW_LINE>maxColumns = SpreadsheetVersion.EXCEL97.getMaxColumns();<NEW_LINE>} else if ("xlsx".equals(SaikuProperties.webExportExcelFormat)) {<NEW_LINE>excelWorkbook = new XSSFWorkbook();<NEW_LINE>} else {<NEW_LINE>excelWorkbook = new XSSFWorkbook();<NEW_LINE>}<NEW_LINE>colorCodesMap = new HashMap<>();<NEW_LINE>this.sheetName = options.sheetName;<NEW_LINE>rowsetHeader = table.getCellSetHeaders();<NEW_LINE>rowsetBody = table.getCellSetBody();<NEW_LINE>topLeftCornerWidth = findTopLeftCornerWidth();<NEW_LINE>topLeftCornerHeight = findTopLeftCornerHeight();<NEW_LINE>initCellStyles();<NEW_LINE>// Row totals and subtotals<NEW_LINE><MASK><NEW_LINE>colScanTotals = new HashMap<>();<NEW_LINE>scanRowAndColumnAggregations(table.getRowTotalsLists(), rowScanTotals, table.getColTotalsLists(), colScanTotals);<NEW_LINE>}
rowScanTotals = new HashMap<>();
1,577,214
public static <T> T createNewAttributeValue(DBCExecutionContext context, DBDValueHandler valueHandler, DBSTypedObject valueType, Class<T> targetType) throws DBCException {<NEW_LINE>DBRRunnableWithResult<Object> runnable = new DBRRunnableWithResult<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(DBRProgressMonitor monitor) throws InvocationTargetException {<NEW_LINE>try (DBCSession session = context.openSession(monitor, DBCExecutionPurpose.UTIL, "Create new object")) {<NEW_LINE>result = valueHandler.createNewValueObject(session, valueType);<NEW_LINE>} catch (DBCException e) {<NEW_LINE>throw new InvocationTargetException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>DBWorkbench.getPlatformUI().executeWithProgress(runnable);<NEW_LINE>// UIUtils.runInProgressService(runnable);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new DBCException(<MASK><NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new DBCException(e, context);<NEW_LINE>}<NEW_LINE>Object result = runnable.getResult();<NEW_LINE>if (result == null) {<NEW_LINE>throw new DBCException("Internal error - null object created");<NEW_LINE>}<NEW_LINE>if (!targetType.isInstance(result)) {<NEW_LINE>throw new DBCException("Internal error - wrong object type '" + result.getClass().getName() + "' while '" + targetType.getName() + "' was expected");<NEW_LINE>}<NEW_LINE>return targetType.cast(result);<NEW_LINE>}
e.getTargetException(), context);