idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,673,583
final SearchDashboardsResult executeSearchDashboards(SearchDashboardsRequest searchDashboardsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchDashboardsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchDashboardsRequest> request = null;<NEW_LINE>Response<SearchDashboardsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchDashboardsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(searchDashboardsRequest));<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, "SearchDashboards");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchDashboardsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SearchDashboardsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,151,214
private void refreshASTNode() {<NEW_LINE>astNode = parserManager.getAST();<NEW_LINE>if (astNode == null) {<NEW_LINE>root = new NavigatorNode("", "", null, true);<NEW_LINE>fire();<NEW_LINE>} else {<NEW_LINE>List<ASTItem> path = new ArrayList<ASTItem>();<NEW_LINE>path.add(astNode);<NEW_LINE>List rootNodes = root.getNodes(this);<NEW_LINE>if (root instanceof ASTNavigatorNode && ((ASTNavigatorNode) root).document == document && rootNodes != null && rootNodes.size() > 0) {<NEW_LINE>if (parserManager.getState() == State.PARSING)<NEW_LINE>return;<NEW_LINE>ASTNavigatorNode newASTNode = new ASTNavigatorNode(document, astNode, path, "Root", "", null, false);<NEW_LINE>((ASTNavigatorNode) root).refreshNode(this, newASTNode, new LinkedList<ASTNavigatorNode>());<NEW_LINE>} else {<NEW_LINE>ASTNavigatorNode newASTNode = new ASTNavigatorNode(document, astNode, path, <MASK><NEW_LINE>newASTNode.getNodes(this);<NEW_LINE>if (parserManager.getState() == State.PARSING)<NEW_LINE>return;<NEW_LINE>root = newASTNode;<NEW_LINE>fire();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Root", "", null, false);
603,865
public static void main(String[] args) throws Exception {<NEW_LINE>File out_dir = new File("target/compiled");<NEW_LINE>out_dir.mkdirs();<NEW_LINE>BeamLoader beamParser = new ErjangBeamDisLoader();<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>if (args[i].endsWith(".beam")) {<NEW_LINE>File in = new File(args[i]);<NEW_LINE>if (!in.exists() || !in.isFile() || !in.canRead())<NEW_LINE>throw new IOException("bad permissions for " + in);<NEW_LINE>int idx = args[i].lastIndexOf('.');<NEW_LINE>int idx0 = args[i].lastIndexOf(File.separator);<NEW_LINE>String shortName = args[i].<MASK><NEW_LINE>// TODO: don't use the code cache location.<NEW_LINE>File out = new File(out_dir, ErjangCodeCache.moduleJarFileName(shortName, crcFile(in)));<NEW_LINE>JarClassRepo jcp = new JarClassRepo(out);<NEW_LINE>System.out.println("compiling " + in + " -> " + out + " ...");<NEW_LINE>new Compiler(jcp).compile(in, beamParser);<NEW_LINE>jcp.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
substring(idx0 + 1, idx);
545,937
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject <MASK><NEW_LINE>if (controller == null || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card card = controller.getLibrary().getFromTop(game);<NEW_LINE>if (card != null) {<NEW_LINE>Cards cards = new CardsImpl(card);<NEW_LINE>controller.lookAtCards(sourceObject.getIdName(), cards, game);<NEW_LINE>if (card.isLand(game)) {<NEW_LINE>String message = "Put " + card.getLogName() + " onto the battlefield tapped?";<NEW_LINE>if (controller.chooseUse(Outcome.PutLandInPlay, message, source, game)) {<NEW_LINE>controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
sourceObject = source.getSourceObject(game);
1,418,654
public LogicalTable unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>LogicalTable logicalTable = new LogicalTable();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Alias", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>logicalTable.setAlias(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DataTransforms", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>logicalTable.setDataTransforms(new ListUnmarshaller<TransformOperation>(TransformOperationJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Source", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>logicalTable.setSource(LogicalTableSourceJsonUnmarshaller.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 logicalTable;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
308,072
private ListenableFuture<?> rollupOneFromRows(int rollupLevel, String agentRollupId, String syntheticMonitorId, long to, int adjustedTTL, Iterable<Row> rows) throws Exception {<NEW_LINE>double totalDurationNanos = 0;<NEW_LINE>long executionCount = 0;<NEW_LINE>ErrorIntervalCollector errorIntervalCollector = new ErrorIntervalCollector();<NEW_LINE>for (Row row : rows) {<NEW_LINE>int i = 0;<NEW_LINE>totalDurationNanos += row.getDouble(i++);<NEW_LINE>executionCount += row.getLong(i++);<NEW_LINE>ByteBuffer errorIntervalsBytes = row.getBytes(i++);<NEW_LINE>if (errorIntervalsBytes == null) {<NEW_LINE>errorIntervalCollector.addGap();<NEW_LINE>} else {<NEW_LINE>List<Stored.ErrorInterval> errorIntervals = Messages.parseDelimitedFrom(errorIntervalsBytes, Stored.ErrorInterval.parser());<NEW_LINE>errorIntervalCollector.addErrorIntervals(fromProto(errorIntervals));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BoundStatement boundStatement = insertResultPS.get(rollupLevel).bind();<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, agentRollupId);<NEW_LINE>boundStatement.setString(i++, syntheticMonitorId);<NEW_LINE>boundStatement.setTimestamp(i++, new Date(to));<NEW_LINE>boundStatement.setDouble(i++, totalDurationNanos);<NEW_LINE>boundStatement.setLong(i++, executionCount);<NEW_LINE>List<ErrorInterval> mergedErrorIntervals = errorIntervalCollector.getMergedErrorIntervals();<NEW_LINE>if (mergedErrorIntervals.isEmpty()) {<NEW_LINE>boundStatement.setToNull(i++);<NEW_LINE>} else {<NEW_LINE>boundStatement.setBytes(i++, Messages.toByteBuffer(toProto(mergedErrorIntervals)));<NEW_LINE>}<NEW_LINE>boundStatement<MASK><NEW_LINE>return session.writeAsync(boundStatement);<NEW_LINE>}
.setInt(i++, adjustedTTL);
185,078
private void interpolateSegments(Vector<Double> f0) {<NEW_LINE>int i, n, interval;<NEW_LINE>double slope;<NEW_LINE>// check where there are zeros and interpolate<NEW_LINE>int[] index = new int[2];<NEW_LINE>double[] value = new double[2];<NEW_LINE>index[0] = 0;<NEW_LINE>value[0] = 0.0;<NEW_LINE>for (i = 0; i < f0.size(); i++) {<NEW_LINE>if (f0.get(i) > 0.0) {<NEW_LINE>index[1] = i;<NEW_LINE>value[1<MASK><NEW_LINE>interval = index[1] - index[0];<NEW_LINE>if (interval > 1) {<NEW_LINE>// System.out.format("Interval to interpolate index[0]=%d index[1]=%d\n",index[0],index[1]);<NEW_LINE>slope = ((value[1] - value[0]) / interval);<NEW_LINE>for (n = index[0]; n < index[1]; n++) {<NEW_LINE>double newVal = (slope * (n - index[0])) + value[0];<NEW_LINE>f0.set(n, newVal);<NEW_LINE>// System.out.format(" n=%d value:%.1f\n",n,newVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>index[0] = index[1];<NEW_LINE>value[0] = value[1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] = f0.get(i);
1,332,907
final GetCanaryRunsResult executeGetCanaryRuns(GetCanaryRunsRequest getCanaryRunsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCanaryRunsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCanaryRunsRequest> request = null;<NEW_LINE>Response<GetCanaryRunsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCanaryRunsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCanaryRunsRequest));<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, "synthetics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCanaryRuns");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCanaryRunsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCanaryRunsResultJsonUnmarshaller());<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);
752,651
public GetIdentityVerificationAttributesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>GetIdentityVerificationAttributesResult getIdentityVerificationAttributesResult = new GetIdentityVerificationAttributesResult();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return getIdentityVerificationAttributesResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("VerificationAttributes/entry", targetDepth)) {<NEW_LINE>Entry<String, IdentityVerificationAttributes> entry = VerificationAttributesMapEntryUnmarshaller.getInstance().unmarshall(context);<NEW_LINE>getIdentityVerificationAttributesResult.addVerificationAttributesEntry(entry.getKey(), entry.getValue());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return getIdentityVerificationAttributesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,382,024
public boolean copyFile(java.io.File sourceFile, java.io.File destinationFile) {<NEW_LINE>java.io.InputStream inputStream = null;<NEW_LINE>java.io.FileOutputStream outputStream = null;<NEW_LINE>boolean hasSucceeded = false;<NEW_LINE>// Validate arguments.<NEW_LINE>if ((sourceFile == null) || (destinationFile == null)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Do not continue if the source file cannot be found.<NEW_LINE>// Note: We only do this check for external files.<NEW_LINE>if ((isAssetFile(sourceFile.getPath()) == false) && (sourceFile.exists() == false)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Copy the given file.<NEW_LINE>try {<NEW_LINE>inputStream = openFile(sourceFile);<NEW_LINE>if (inputStream != null) {<NEW_LINE>// Create the destination directory tree, if it does not already exist. Only create it if its actually a resource file.<NEW_LINE>destinationFile.getParentFile().mkdirs();<NEW_LINE>outputStream = new java.io.FileOutputStream(destinationFile);<NEW_LINE>if (outputStream != null) {<NEW_LINE>int byteCount = inputStream.available();<NEW_LINE>if (byteCount > 0) {<NEW_LINE>final int BUFFER_SIZE = 1024;<NEW_LINE>byte[] byteBuffer = new byte[BUFFER_SIZE];<NEW_LINE>while (byteCount > 0) {<NEW_LINE>int bytesToCopy = BUFFER_SIZE;<NEW_LINE>if (bytesToCopy > byteCount) {<NEW_LINE>bytesToCopy = byteCount;<NEW_LINE>}<NEW_LINE>bytesToCopy = inputStream.<MASK><NEW_LINE>outputStream.write(byteBuffer, 0, bytesToCopy);<NEW_LINE>byteCount -= bytesToCopy;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>hasSucceeded = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>// Close the streams.<NEW_LINE>if (inputStream != null) {<NEW_LINE>try {<NEW_LINE>inputStream.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outputStream != null) {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasSucceeded) {<NEW_LINE>destinationFile.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hasSucceeded;<NEW_LINE>}
read(byteBuffer, 0, bytesToCopy);
29,140
public static LevelZeroKernel compileSPIRVKernel(LevelZeroDevice device, LevelZeroContext context, String kernelName, String pathToBinary) {<NEW_LINE>ZeModuleHandle module = new ZeModuleHandle();<NEW_LINE>ZeModuleDesc moduleDesc = new ZeModuleDesc();<NEW_LINE>ZeBuildLogHandle buildLog = new ZeBuildLogHandle();<NEW_LINE>moduleDesc.setFormat(ZeModuleFormat.ZE_MODULE_FORMAT_IL_SPIRV);<NEW_LINE>moduleDesc.setBuildFlags("");<NEW_LINE>int result = context.zeModuleCreate(context.getDefaultContextPtr(), device.getDeviceHandlerPtr(), moduleDesc, module, buildLog, pathToBinary);<NEW_LINE>LevelZeroUtils.errorLog("zeModuleCreate", result);<NEW_LINE>if (result != ZeResult.ZE_RESULT_SUCCESS) {<NEW_LINE>// Print Logs<NEW_LINE>int[] sizeLog = new int[1];<NEW_LINE>String[] errorMessage = new String[1];<NEW_LINE>result = context.zeModuleBuildLogGetString(buildLog, sizeLog, errorMessage);<NEW_LINE>System.out.println("LOGS::: " + sizeLog[0] + " -- " + errorMessage[1]);<NEW_LINE>LevelZeroUtils.errorLog("zeModuleBuildLogGetString", result);<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>// Create Module Object<NEW_LINE>LevelZeroModule levelZeroModule = new LevelZeroModule(module, moduleDesc, buildLog);<NEW_LINE>// Destroy Log<NEW_LINE><MASK><NEW_LINE>LevelZeroUtils.errorLog("zeModuleBuildLogDestroy", result);<NEW_LINE>ZeKernelDesc kernelDesc = new ZeKernelDesc();<NEW_LINE>ZeKernelHandle kernel = new ZeKernelHandle();<NEW_LINE>kernelDesc.setKernelName(kernelName);<NEW_LINE>result = levelZeroModule.zeKernelCreate(module.getPtrZeModuleHandle(), kernelDesc, kernel);<NEW_LINE>LevelZeroUtils.errorLog("zeKernelCreate", result);<NEW_LINE>return new LevelZeroKernel(kernelDesc, kernel, levelZeroModule);<NEW_LINE>}
result = levelZeroModule.zeModuleBuildLogDestroy(buildLog);
575,049
public void serialize(ClientTelemetryInfo telemetry, JsonGenerator generator, SerializerProvider serializerProvider) throws IOException {<NEW_LINE>generator.writeStartObject();<NEW_LINE>generator.writeStringField("timeStamp", telemetry.getTimeStamp());<NEW_LINE>generator.writeStringField("machineId", telemetry.getMachineId());<NEW_LINE>generator.writeStringField("clientId", telemetry.getClientId());<NEW_LINE>if (telemetry.getProcessId() != null) {<NEW_LINE>generator.writeStringField("processId", telemetry.getProcessId());<NEW_LINE>}<NEW_LINE>if (telemetry.getUserAgent() != null) {<NEW_LINE>generator.writeStringField("userAgent", telemetry.getUserAgent());<NEW_LINE>}<NEW_LINE>generator.writeStringField("connectionMode", telemetry.<MASK><NEW_LINE>generator.writeStringField("globalDatabaseAccountName", telemetry.getGlobalDatabaseAccountName());<NEW_LINE>if (telemetry.getApplicationRegion() != null) {<NEW_LINE>generator.writeStringField("applicationRegion", telemetry.getApplicationRegion());<NEW_LINE>}<NEW_LINE>if (telemetry.getHostEnvInfo() != null) {<NEW_LINE>generator.writeStringField("hostEnvInfo", telemetry.getHostEnvInfo());<NEW_LINE>}<NEW_LINE>if (telemetry.getAcceleratedNetworking() != null) {<NEW_LINE>generator.writeStringField("acceleratedNetworking", telemetry.getAcceleratedNetworking().toString());<NEW_LINE>}<NEW_LINE>if (telemetry.getPreferredRegions() != null && telemetry.getPreferredRegions().size() > 0) {<NEW_LINE>generator.writeObjectField("preferredRegions", telemetry.getPreferredRegions());<NEW_LINE>}<NEW_LINE>generator.writeNumberField("aggregationIntervalInSec", telemetry.getAggregationIntervalInSec());<NEW_LINE>generator.writeObjectField("systemInfo", telemetry.getSystemInfoMap().keySet());<NEW_LINE>generator.writeObjectField("cacheRefreshInfo", telemetry.getCacheRefreshInfoMap().keySet());<NEW_LINE>generator.writeObjectField("operationInfo", telemetry.getOperationInfoMap().keySet());<NEW_LINE>generator.writeEndObject();<NEW_LINE>}
getConnectionMode().toString());
98,221
static Set<String> requires(Dictionary<?, ?> headers) {<NEW_LINE>Set<String> deps <MASK><NEW_LINE>String v = (String) headers.get(Constants.REQUIRE_BUNDLE);<NEW_LINE>if (v != null) {<NEW_LINE>// PackageAdmin.getRequiredBundles is not suitable for this - it is backwards.<NEW_LINE>// XXX try to follow the spec more closely; this will work at least for headers created by MakeOSGi:<NEW_LINE>for (String item : v.split(", ")) {<NEW_LINE>deps.add("cnb." + item.replaceFirst(";.+", ""));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// XXX also check for BUNDLE_SYMBOLICNAME_ATTRIBUTE in IMPORT_PACKAGE (though not currently used by MakeOSGi)<NEW_LINE>deps.addAll(splitTokens((String) headers.get("OpenIDE-Module-Requires")));<NEW_LINE>return deps;<NEW_LINE>}
= new TreeSet<String>();
799,383
public boolean onCreateOptionsMenu(Menu menu) {<NEW_LINE>// Inflate the menu; this adds items to the action bar if it is present.<NEW_LINE>getMenuInflater().inflate(R.menu.download, menu);<NEW_LINE>getMenuInflater().inflate(<MASK><NEW_LINE>this.optionMenu = menu;<NEW_LINE>setMenuVisibility(menu);<NEW_LINE>searchView = (androidx.appcompat.widget.SearchView) menu.findItem(R.id.search).getActionView();<NEW_LINE>searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextSubmit(String query) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextChange(String newText) {<NEW_LINE>if (recycler.getAdapter() != null)<NEW_LINE>((LocalAdapter) recycler.getAdapter()).getFilter().filter(newText);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Utility.tintMenu(menu);<NEW_LINE>return true;<NEW_LINE>}
R.menu.local_multichoice, menu);
1,245,377
private static VisualVMThreadsDataManager loadDataManager(InputStream is) throws IOException {<NEW_LINE>try (DataInputStream dis = new DataInputStream(is)) {<NEW_LINE>if (!THREADS_SNAPSHOT_HEADER.equals(dis.readUTF()))<NEW_LINE>// NOI18N<NEW_LINE>throw new IOException("Unknown snapshot format");<NEW_LINE>if (THREADS_SNAPSHOT_VERSION != dis.readInt())<NEW_LINE>// NOI18N<NEW_LINE>throw new IOException("Unsupported snapshot version");<NEW_LINE>// Start time<NEW_LINE>long stime = dis.readLong();<NEW_LINE>// End time<NEW_LINE><MASK><NEW_LINE>// Threads count<NEW_LINE>int tcount = dis.readInt();<NEW_LINE>// Daemon threads count<NEW_LINE>int dtcount = dis.readInt();<NEW_LINE>ThreadData[] tdata = new ThreadData[tcount];<NEW_LINE>for (int tidx = 0; tidx < tcount; tidx++) {<NEW_LINE>// NOI18N // Thread name<NEW_LINE>ThreadData td = new ThreadData(dis.readUTF(), "");<NEW_LINE>// Number of thread states<NEW_LINE>int scount = dis.readInt();<NEW_LINE>for (// State timestamp, thread state<NEW_LINE>int sidx = 0; // State timestamp, thread state<NEW_LINE>sidx < scount; // State timestamp, thread state<NEW_LINE>sidx++) td.add(dis.readLong(), dis.readByte());<NEW_LINE>tdata[tidx] = td;<NEW_LINE>}<NEW_LINE>return new SavedThreadsDataManager(stime, etime, dtcount, tdata);<NEW_LINE>}<NEW_LINE>}
long etime = dis.readLong();
177,415
public synchronized void refresh(ApplicationMonitorConfig config) {<NEW_LINE>if (config != null && config.isDropinsMonitored()) {<NEW_LINE>// ApplicationMonitorConfig prevConfig = _config.getAndSet(config);<NEW_LINE>_config.set(config);<NEW_LINE>// keep track of the old monitored directory to see if we need to uninstall apps<NEW_LINE>File previousMonitoredDirectory = null;<NEW_LINE><MASK><NEW_LINE>String newMonitoredFolder = config.getLocation();<NEW_LINE>// if the user set the monitored folder location to be empty or it is somehow null<NEW_LINE>if ((newMonitoredFolder != null) && (!newMonitoredFolder.equals(""))) {<NEW_LINE>previousMonitoredDirectory = updateMonitoredDirectory(newMonitoredFolder);<NEW_LINE>}<NEW_LINE>if (!!!_coreMonitor.isRegistered()) {<NEW_LINE>stopRemovedApplications();<NEW_LINE>// The service has not been started yet.<NEW_LINE>// load the pids for applications already setup before starting the service fully<NEW_LINE>configureCoreMonitor(config);<NEW_LINE>_coreMonitor.register(_ctx, FileMonitor.class, new FileMonitorImpl());<NEW_LINE>Tr.audit(_tc, "APPLICATION_MONITOR_STARTED", newMonitoredFolder);<NEW_LINE>} else if (!!!monitoredDirectory.get().equals(previousMonitoredDirectory)) {<NEW_LINE>// The directory has changed so stop the old applications<NEW_LINE>stopAllStartedApplications();<NEW_LINE>// Need to re-register because file monitor doesn't appear to work from modified events.<NEW_LINE>_coreMonitor.unregister();<NEW_LINE>// Update the registration with new config before registering the service again<NEW_LINE>configureCoreMonitor(config);<NEW_LINE>_coreMonitor.register(_ctx, FileMonitor.class, new FileMonitorImpl());<NEW_LINE>// Tidy up old location if we built it<NEW_LINE>tidyUpMonitoredDirectory(createdPreviousDirectory, previousMonitoredDirectory);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// the monitoring service has been disabled: stop/deregister the service<NEW_LINE>stopAllStartedApplications();<NEW_LINE>stop();<NEW_LINE>}<NEW_LINE>}
boolean createdPreviousDirectory = createdMonitoredDir.get();
1,082,598
protected void initModel() {<NEW_LINE>title = currentPage.getTitle();<NEW_LINE>description = currentPage.getDescription();<NEW_LINE>if (StringUtils.isBlank(title)) {<NEW_LINE>title = currentPage.getName();<NEW_LINE>}<NEW_LINE>Tag[] tags = currentPage.getTags();<NEW_LINE>keywords = new String[tags.length];<NEW_LINE>int index = 0;<NEW_LINE>for (Tag tag : tags) {<NEW_LINE>keywords[index++] = tag.getTitle(currentPage.getLanguage(false));<NEW_LINE>}<NEW_LINE>if (currentDesign != null) {<NEW_LINE><MASK><NEW_LINE>if (!Designer.DEFAULT_DESIGN_PATH.equals(designPath)) {<NEW_LINE>this.designPath = designPath;<NEW_LINE>if (resolver.getResource(designPath + "/static.css") != null) {<NEW_LINE>staticDesignPath = designPath + "/static.css";<NEW_LINE>}<NEW_LINE>loadFavicons(designPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>populateClientlibCategories();<NEW_LINE>templateName = extractTemplateName();<NEW_LINE>brandSlug = Utils.getInheritedValue(currentPage, PN_BRANDSLUG);<NEW_LINE>}
String designPath = currentDesign.getPath();
1,031,567
public World[] updates(@QueryParam("queries") String queriesParam) throws InterruptedException, ExecutionException {<NEW_LINE>final int queries = getQueries(queriesParam);<NEW_LINE>final World[] worlds = new World[queries];<NEW_LINE>Callable<World[]> callable = () -> {<NEW_LINE>Session session = emf.createEntityManager().unwrap(Session.class);<NEW_LINE>session.setDefaultReadOnly(false);<NEW_LINE>Transaction txn = session.beginTransaction();<NEW_LINE>try {<NEW_LINE>// using write batching. See the data source properties provided<NEW_LINE>// in the configuration file<NEW_LINE>// 1. Read and update the entities from the DB<NEW_LINE>final AtomicInteger ii = new AtomicInteger(0);<NEW_LINE>ThreadLocalRandom.current().ints(1, 10001).distinct().limit(queries).forEach((randomValue) -> {<NEW_LINE>final World world = (World) session.byId(World<MASK><NEW_LINE>world.setRandomNumber(randomWorld());<NEW_LINE>worlds[ii.getAndAdd(1)] = world;<NEW_LINE>});<NEW_LINE>// 2. Sort the array to prevent transaction deadlock in the DB<NEW_LINE>Arrays.sort(worlds, Comparator.comparingInt(World::getId));<NEW_LINE>// 3. Actually save the entities<NEW_LINE>for (int i = 0; i < worlds.length; i++) {<NEW_LINE>session.persist(worlds[i]);<NEW_LINE>}<NEW_LINE>session.flush();<NEW_LINE>session.clear();<NEW_LINE>txn.commit();<NEW_LINE>return worlds;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>if (txn != null && txn.isActive())<NEW_LINE>txn.rollback();<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>session.close();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Future<World[]> futureWorlds = Common.EXECUTOR.submit(callable);<NEW_LINE>return futureWorlds.get();<NEW_LINE>}
.class).load(randomValue);
653,853
private void createDispatcherCallingInitCtors() {<NEW_LINE>MethodMember[] ctors = typeDescriptor.getConstructors();<NEW_LINE>for (MethodMember ctor : ctors) {<NEW_LINE>String desc = ctor.getDescriptor();<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "___init___", desc, null, null);<NEW_LINE>mv.visitFieldInsn(GETSTATIC, slashedname, fReloadableTypeFieldName, lReloadableType);<NEW_LINE>mv.visitInsn(ICONST_1);<NEW_LINE>mv.visitMethodInsn(<MASK><NEW_LINE>mv.visitTypeInsn(CHECKCAST, Utils.getInterfaceName(slashedname));<NEW_LINE>String desc2 = new StringBuffer("(L").append(slashedname).append(";").append(desc.substring(1)).toString();<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>Utils.createLoadsBasedOnDescriptor(mv, desc, 1);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, Utils.getInterfaceName(slashedname), "___init___", desc2);<NEW_LINE>mv.visitInsn(RETURN);<NEW_LINE>mv.visitMaxs(3, Utils.getParameterCount(desc) + 1);<NEW_LINE>mv.visitEnd();<NEW_LINE>}<NEW_LINE>}
INVOKEVIRTUAL, tReloadableType, "getLatestDispatcherInstance", "(Z)Ljava/lang/Object;");
1,741,752
private void jaxrpc(String[] args, WsCompile wsCompile, Descriptor desc, ArrayList<String> files) throws Exception {<NEW_LINE>try {<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>debug("---> ARGS = ");<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>logger.fine(args[i] + "; ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean compiled = wsCompile.getCompileTool().run(args);<NEW_LINE>done(wsCompile.getCompileTool());<NEW_LINE>if (compiled) {<NEW_LINE>Iterator generatedFiles = wsCompile.getGeneratedFiles().iterator();<NEW_LINE>while (generatedFiles.hasNext()) {<NEW_LINE>GeneratedFileInfo next = (GeneratedFileInfo) generatedFiles.next();<NEW_LINE>String fileType = next.getType();<NEW_LINE>File file = next.getFile();<NEW_LINE><MASK><NEW_LINE>if (origPath.endsWith(".java")) {<NEW_LINE>int javaIndex = origPath.lastIndexOf(".java");<NEW_LINE>String newPath = origPath.substring(0, javaIndex) + ".class";<NEW_LINE>if (keepJaxrpcGeneratedFile(fileType, desc)) {<NEW_LINE>files.add(newPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new Exception("jaxrpc compilation exception");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Exception ge = new Exception(t.getMessage());<NEW_LINE>ge.initCause(t);<NEW_LINE>throw ge;<NEW_LINE>}<NEW_LINE>}
String origPath = file.getPath();
1,622,913
protected void configureForSourceSet(final SourceSet sourceSet, final Pmd task) {<NEW_LINE>task.setDescription("Run PMD analysis for " + sourceSet.getName() + " classes");<NEW_LINE>task.setSource(sourceSet.getAllJava());<NEW_LINE>ConventionMapping taskMapping = task.getConventionMapping();<NEW_LINE>ConfigurationContainer configurations = project.getConfigurations();<NEW_LINE>Configuration compileClasspath = configurations.getByName(sourceSet.getCompileClasspathConfigurationName());<NEW_LINE>Configuration pmdAdditionalAuxDepsConfiguration = configurations.getByName(PMD_ADDITIONAL_AUX_DEPS_CONFIGURATION);<NEW_LINE>// TODO: Consider checking if the resolution consistency is enabled for compile/runtime.<NEW_LINE>Configuration pmdAuxClasspath = configurations.create(sourceSet.getName() + "PmdAuxClasspath");<NEW_LINE>pmdAuxClasspath.extendsFrom(compileClasspath, pmdAdditionalAuxDepsConfiguration);<NEW_LINE>pmdAuxClasspath.setCanBeConsumed(false);<NEW_LINE>pmdAuxClasspath.setVisible(false);<NEW_LINE>// This is important to get transitive implementation dependencies. PMD may load referenced classes for analysis so it expects the classpath to be "closed" world.<NEW_LINE>getJvmPluginServices().configureAsRuntimeClasspath(pmdAuxClasspath);<NEW_LINE>// We have to explicitly add compileClasspath here because it may contain classes that aren't part of the compileClasspathConfiguration. In particular, compile<NEW_LINE>// classpath of the test sourceSet contains output of the main sourceSet.<NEW_LINE>taskMapping.map("classpath", () -> {<NEW_LINE>// It is important to subtract compileClasspath and not pmdAuxClasspath here because these configurations are resolved differently (as a compile and as a<NEW_LINE>// runtime classpath). Compile and runtime entries for the same dependency may resolve to different files (e.g. compiled classes directory vs. jar).<NEW_LINE>FileCollection nonConfigurationClasspathEntries = sourceSet.<MASK><NEW_LINE>return sourceSet.getOutput().plus(nonConfigurationClasspathEntries).plus(pmdAuxClasspath);<NEW_LINE>});<NEW_LINE>}
getCompileClasspath().minus(compileClasspath);
284,254
Optional<Candidate> fromCandidateRecord(final I_MD_Candidate candidateRecordOrNull) {<NEW_LINE>if (candidateRecordOrNull == null || isNew(candidateRecordOrNull) || candidateRecordOrNull.getMD_Candidate_ID() <= 0) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final CandidateBuilder builder = createAndInitializeBuilder(candidateRecordOrNull);<NEW_LINE>final CandidateBusinessCase businessCase = getBusinesCaseOrNull(candidateRecordOrNull);<NEW_LINE>builder.businessCase(businessCase);<NEW_LINE>final ProductionDetail productionDetailOrNull = createProductionDetailOrNull(candidateRecordOrNull);<NEW_LINE>final DistributionDetail distributionDetailOrNull = createDistributionDetailOrNull(candidateRecordOrNull);<NEW_LINE>final PurchaseDetail purchaseDetailOrNull = PurchaseDetailRepoHelper.getSingleForCandidateRecordOrNull(candidateRecordOrNull);<NEW_LINE>final StockChangeDetail stockChangeDetailOrNull = stockChangeDetailRepo.getSingleForCandidateRecordOrNull(candidateRecordOrNull);<NEW_LINE>final int hasProductionDetail = productionDetailOrNull == null ? 0 : 1;<NEW_LINE>final int hasDistributionDetail = distributionDetailOrNull == null ? 0 : 1;<NEW_LINE>final int hasPurchaseDetail <MASK><NEW_LINE>final int hasStockChangeDetail = stockChangeDetailOrNull == null ? 0 : 1;<NEW_LINE>Check.errorIf(hasProductionDetail + hasDistributionDetail + hasPurchaseDetail + hasStockChangeDetail > 1, "A candidate may not have both a distribution, production, production detail and a hasStockChangeDetail; candidateRecord={}", candidateRecordOrNull);<NEW_LINE>final DemandDetail demandDetailOrNull = createDemandDetailOrNull(candidateRecordOrNull);<NEW_LINE>final BusinessCaseDetail businessCaseDetail = CoalesceUtil.coalesce(productionDetailOrNull, distributionDetailOrNull, purchaseDetailOrNull, demandDetailOrNull, stockChangeDetailOrNull);<NEW_LINE>builder.businessCaseDetail(businessCaseDetail);<NEW_LINE>if (hasProductionDetail > 0 || hasDistributionDetail > 0 || hasPurchaseDetail > 0) {<NEW_LINE>builder.additionalDemandDetail(demandDetailOrNull);<NEW_LINE>}<NEW_LINE>builder.transactionDetails(createTransactionDetails(candidateRecordOrNull));<NEW_LINE>final Dimension candidateDimension = dimensionService.getFromRecord(candidateRecordOrNull);<NEW_LINE>builder.dimension(candidateDimension);<NEW_LINE>return Optional.of(builder.build());<NEW_LINE>}
= purchaseDetailOrNull == null ? 0 : 1;
1,695,768
public Optional<PlaceholderExpansion> register(@NotNull final Class<? extends PlaceholderExpansion> clazz) {<NEW_LINE>try {<NEW_LINE>final PlaceholderExpansion expansion = createExpansionInstance(clazz);<NEW_LINE>if (expansion == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(<MASK><NEW_LINE>Objects.requireNonNull(expansion.getIdentifier(), "The expansion identifier is null!");<NEW_LINE>Objects.requireNonNull(expansion.getVersion(), "The expansion version is null!");<NEW_LINE>if (!expansion.register()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(expansion);<NEW_LINE>} catch (LinkageError | NullPointerException ex) {<NEW_LINE>final String reason;<NEW_LINE>if (ex instanceof LinkageError) {<NEW_LINE>reason = " (Is a dependency missing?)";<NEW_LINE>} else {<NEW_LINE>reason = " - One of its properties is null which is not allowed!";<NEW_LINE>}<NEW_LINE>plugin.getLogger().severe("Failed to load expansion class " + clazz.getSimpleName() + reason);<NEW_LINE>plugin.getLogger().log(Level.SEVERE, "", ex);<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
expansion.getAuthor(), "The expansion author is null!");
121,470
public <T extends JpaObject> List<T> listEqualAndEqualAndSequenceAfter(Class<T> clz, String oneEqualAttribute, Object oneEqualValue, String twoEqualAttribute, Object twoEqualValue, Integer count, String sequence) throws Exception {<NEW_LINE>EntityManager em = this.get(clz);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<T> cq = cb.createQuery(clz);<NEW_LINE>Root<T> root = cq.from(clz);<NEW_LINE>Predicate p = cb.equal(root.get(oneEqualAttribute), oneEqualValue);<NEW_LINE>p = cb.and(p, cb.equal(root.get(twoEqualAttribute), twoEqualValue));<NEW_LINE>if (StringUtils.isNotEmpty(sequence)) {<NEW_LINE>p = cb.and(p, cb.greaterThan(root.get(JpaObject.sequence_FIELDNAME), sequence));<NEW_LINE>}<NEW_LINE>cq.select(root).where(p).orderBy(cb.asc(root.get(JpaObject.sequence_FIELDNAME)));<NEW_LINE>List<T> os = em.createQuery(cq).setMaxResults((count != null && count > 0) ? <MASK><NEW_LINE>List<T> list = new ArrayList<>(os);<NEW_LINE>return list;<NEW_LINE>}
count : 100).getResultList();
601,523
public ParameterGroupStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ParameterGroupStatus parameterGroupStatus = new ParameterGroupStatus();<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("ParameterGroupName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>parameterGroupStatus.setParameterGroupName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ParameterApplyStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>parameterGroupStatus.setParameterApplyStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NodeIdsToReboot", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>parameterGroupStatus.setNodeIdsToReboot(new ListUnmarshaller<String>(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 parameterGroupStatus;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
64,395
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>this.getDialog().setCanceledOnTouchOutside(false);<NEW_LINE>View rootView = inflater.inflate(R.layout.dialog_fragment_release_note, container);<NEW_LINE>RL_release_note = (RelativeLayout) rootView.findViewById(R.id.RL_release_note);<NEW_LINE>RL_release_note.setBackgroundColor(ThemeManager.getInstance()<MASK><NEW_LINE>TV_release_note_text = (TextView) rootView.findViewById(R.id.TV_release_note_text);<NEW_LINE>TV_release_note_text.setText(getString(R.string.release_note));<NEW_LINE>CTV_release_note_knew = (CheckedTextView) rootView.findViewById(R.id.CTV_release_note_knew);<NEW_LINE>CTV_release_note_knew.setOnClickListener(this);<NEW_LINE>But_release_note_ok = (MyDiaryButton) rootView.findViewById(R.id.But_release_note_ok);<NEW_LINE>But_release_note_ok.setOnClickListener(this);<NEW_LINE>return rootView;<NEW_LINE>}
.getThemeMainColor(getActivity()));
82,431
public boolean signalBackgroundJobServerAlive(BackgroundJobServerStatus serverStatus) {<NEW_LINE>try (final Jedis jedis = getJedis()) {<NEW_LINE>final Map<String, String> valueMap = jedis.hgetAll(backgroundJobServerKey(keyPrefix, serverStatus));<NEW_LINE>if (valueMap.isEmpty()) {<NEW_LINE>throw new ServerTimedOutException(serverStatus, new StorageException("BackgroundJobServer with id " + serverStatus.getId() + " was not found"));<NEW_LINE>}<NEW_LINE>jedis.watch(backgroundJobServerKey(keyPrefix, serverStatus));<NEW_LINE>try (final Transaction t = jedis.multi()) {<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_LAST_HEARTBEAT, String.valueOf(serverStatus.getLastHeartbeat()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_SYSTEM_FREE_MEMORY, String.valueOf(serverStatus.getSystemFreeMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_SYSTEM_CPU_LOAD, String.valueOf(serverStatus.getSystemCpuLoad()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_FREE_MEMORY, String.valueOf(serverStatus.getProcessFreeMemory()));<NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_ALLOCATED_MEMORY, String.valueOf<MASK><NEW_LINE>t.hset(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_PROCESS_CPU_LOAD, String.valueOf(serverStatus.getProcessCpuLoad()));<NEW_LINE>t.zadd(backgroundJobServersUpdatedKey(keyPrefix), toMicroSeconds(now()), serverStatus.getId().toString());<NEW_LINE>final Response<String> isRunningResponse = t.hget(backgroundJobServerKey(keyPrefix, serverStatus), BackgroundJobServers.FIELD_IS_RUNNING);<NEW_LINE>t.exec();<NEW_LINE>return Boolean.parseBoolean(isRunningResponse.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(serverStatus.getProcessAllocatedMemory()));
104,819
public void execute() {<NEW_LINE>// remove entity if it is a composition<NEW_LINE>Object value = pickerField.getValue();<NEW_LINE>ValueSource valueSource = pickerField.getValueSource();<NEW_LINE>if (value != null && !value.equals(pickerField.getEmptyValue()) && valueSource instanceof EntityValueSource) {<NEW_LINE>EntityValueSource entityValueSource = (EntityValueSource) pickerField.getValueSource();<NEW_LINE>Entity entity = (Entity) pickerField.getValue();<NEW_LINE>if (entityValueSource.getMetaPropertyPath() != null && entityValueSource.getMetaPropertyPath().getMetaProperty().getType() == MetaProperty.Type.COMPOSITION) {<NEW_LINE>FrameOwner screen = pickerField<MASK><NEW_LINE>DataContext dataContext = UiControllerUtils.getScreenData(screen).getDataContext();<NEW_LINE>dataContext.remove(entity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Set the value as if the user had set it<NEW_LINE>pickerField.setValueFromUser(pickerField.getEmptyValue());<NEW_LINE>}
.getFrame().getFrameOwner();
713,393
private Position decodeLocation2(DeviceSession deviceSession, ByteBuf buf, int type) {<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>Jt600ProtocolDecoder.decodeBinaryLocation(buf, position);<NEW_LINE><MASK><NEW_LINE>position.set(Position.KEY_RSSI, buf.readUnsignedByte());<NEW_LINE>position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());<NEW_LINE>position.set(Position.KEY_ODOMETER, buf.readUnsignedInt() * 1000L);<NEW_LINE>int battery = buf.readUnsignedByte();<NEW_LINE>if (battery <= 100) {<NEW_LINE>position.set(Position.KEY_BATTERY_LEVEL, battery);<NEW_LINE>} else if (battery == 0xAA) {<NEW_LINE>position.set(Position.KEY_CHARGE, true);<NEW_LINE>}<NEW_LINE>position.setNetwork(new Network(CellTower.fromCidLac(buf.readUnsignedInt(), buf.readUnsignedShort())));<NEW_LINE>int product = buf.readUnsignedByte();<NEW_LINE>int status = buf.readUnsignedShort();<NEW_LINE>int alarm = buf.readUnsignedShort();<NEW_LINE>if (product == 1 || product == 2) {<NEW_LINE>if (BitUtil.check(alarm, 0)) {<NEW_LINE>position.set(Position.KEY_ALARM, Position.ALARM_LOW_POWER);<NEW_LINE>}<NEW_LINE>} else if (product == 3) {<NEW_LINE>position.set(Position.KEY_BLOCKED, BitUtil.check(status, 5));<NEW_LINE>if (BitUtil.check(alarm, 1)) {<NEW_LINE>position.set(Position.KEY_ALARM, Position.ALARM_LOW_POWER);<NEW_LINE>}<NEW_LINE>if (BitUtil.check(alarm, 2)) {<NEW_LINE>position.set(Position.KEY_ALARM, Position.ALARM_VIBRATION);<NEW_LINE>}<NEW_LINE>if (BitUtil.check(alarm, 3)) {<NEW_LINE>position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>position.set(Position.KEY_STATUS, status);<NEW_LINE>return position;<NEW_LINE>}
position.setValid(type != MSG_LOCATION_REPORT_BLIND);
1,787,159
public void generateCode() {<NEW_LINE>printPreamble();<NEW_LINE>printAllOps(AutoTypeImage.F32, AutoTypeImage.F32, false);<NEW_LINE>// printAllOps(AutoTypeImage.F32, AutoTypeImage.F32, false, true);<NEW_LINE>printAllOps(AutoTypeImage.F64, AutoTypeImage.F64, false);<NEW_LINE>printAllOps(AutoTypeImage.U8, AutoTypeImage.I16, false);<NEW_LINE>printAllOps(AutoTypeImage.U8, AutoTypeImage.S32, false);<NEW_LINE>printAllOps(AutoTypeImage.U16, AutoTypeImage.I8, true, true);<NEW_LINE>printAllOps(AutoTypeImage.S16, AutoTypeImage.I16, false);<NEW_LINE>printAllOps(AutoTypeImage.U8, AutoTypeImage.I8, true);<NEW_LINE>// printAllOps(AutoTypeImage.U8,AutoTypeImage.I8,false, true);<NEW_LINE>printAllOps(AutoTypeImage.S16, AutoTypeImage.I16, true);<NEW_LINE>printAllOps(AutoTypeImage.U16, AutoTypeImage.I16, false);<NEW_LINE>printAllOps(AutoTypeImage.U16, AutoTypeImage.I16, true);<NEW_LINE>printAllOps(AutoTypeImage.S32, AutoTypeImage.I16, true, true);<NEW_LINE>printAllOps(AutoTypeImage.<MASK><NEW_LINE>printAllOps(AutoTypeImage.S32, AutoTypeImage.S32, true);<NEW_LINE>out.println("}");<NEW_LINE>}
S32, AutoTypeImage.S32, false);
1,280,459
public int compareTo(HealthState o) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "compareTo", new Object<MASK><NEW_LINE>int equal = 0;<NEW_LINE>// A greater state value means a healthier state, so a<NEW_LINE>if (state > ((HealthStateTree) o).state)<NEW_LINE>// This is the healthier state<NEW_LINE>equal = 1;<NEW_LINE>else if (((HealthStateTree) o).state > state)<NEW_LINE>// o is the healthier state<NEW_LINE>equal = -1;<NEW_LINE>else // If the states are the same (e.g. both AMBER), then we need to work out which is the<NEW_LINE>// worse reason for being in this state<NEW_LINE>{<NEW_LINE>// If the reason's match, return zero<NEW_LINE>if (reason.intValue() == ((HealthStateTree) o).reason.intValue())<NEW_LINE>equal = 0;<NEW_LINE>else // The this reason has a greater value that o's reason, this state is worse than o's<NEW_LINE>if (HealthStateListener.orderedReasons[state][reason] > HealthStateListener.orderedReasons[state][((HealthStateTree) o).reason])<NEW_LINE>equal = -1;<NEW_LINE>else<NEW_LINE>// Otherwise, o's reason is worse than us<NEW_LINE>equal = 1;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "compareTo", equal);<NEW_LINE>return equal;<NEW_LINE>}
[] { this, o });
1,328,367
public GraphQLInterfaceType onInterface(GraphQLInterfaceType interfaceType, Parameters params) {<NEW_LINE>List<GraphQLFieldDefinition> startingFields = interfaceType.getFieldDefinitions();<NEW_LINE>List<GraphQLFieldDefinition> newFields = wireFields(interfaceType, interfaceType.getDefinition(), params);<NEW_LINE>GraphQLInterfaceType newInterfaceType = interfaceType;<NEW_LINE>if (isNotTheSameObjects(startingFields, newFields)) {<NEW_LINE>newInterfaceType = interfaceType.transform(builder -> builder.clearFields().fields(newFields));<NEW_LINE>}<NEW_LINE>NodeParentTree<NamedNode<?>> nodeParentTree = <MASK><NEW_LINE>GraphqlElementParentTree elementParentTree = buildRuntimeTree(newInterfaceType);<NEW_LINE>Parameters newParams = params.newParams(newInterfaceType, nodeParentTree, elementParentTree);<NEW_LINE>return wireDirectives(params, newInterfaceType, newInterfaceType.getDirectives(), (outputElement, directives, registeredDirective) -> new SchemaDirectiveWiringEnvironmentImpl<>(outputElement, directives, registeredDirective, newParams), SchemaDirectiveWiring::onInterface);<NEW_LINE>}
buildAstTree(newInterfaceType.getDefinition());
1,808,003
public static PollTaskResultResponse unmarshall(PollTaskResultResponse pollTaskResultResponse, UnmarshallerContext context) {<NEW_LINE>pollTaskResultResponse.setRequestId(context.stringValue("PollTaskResultResponse.RequestId"));<NEW_LINE>pollTaskResultResponse.setTotalItemNum(context.integerValue("PollTaskResultResponse.TotalItemNum"));<NEW_LINE>pollTaskResultResponse.setCurrentPageNum(context.integerValue("PollTaskResultResponse.CurrentPageNum"));<NEW_LINE>pollTaskResultResponse.setTotalPageNum(context.integerValue("PollTaskResultResponse.TotalPageNum"));<NEW_LINE>pollTaskResultResponse.setPageSize(context.integerValue("PollTaskResultResponse.PageSize"));<NEW_LINE>pollTaskResultResponse.setPrePage(context.booleanValue("PollTaskResultResponse.PrePage"));<NEW_LINE>pollTaskResultResponse.setNextPage(context.booleanValue("PollTaskResultResponse.NextPage"));<NEW_LINE>List<TaskDetail> data = new ArrayList<TaskDetail>();<NEW_LINE>for (int i = 0; i < context.lengthValue("PollTaskResultResponse.Data.Length"); i++) {<NEW_LINE>TaskDetail taskDetail = new TaskDetail();<NEW_LINE>taskDetail.setTaskNo(context.stringValue<MASK><NEW_LINE>taskDetail.setTaskDetailNo(context.stringValue("PollTaskResultResponse.Data[" + i + "].TaskDetailNo"));<NEW_LINE>taskDetail.setTaskType(context.stringValue("PollTaskResultResponse.Data[" + i + "].TaskType"));<NEW_LINE>taskDetail.setInstanceId(context.stringValue("PollTaskResultResponse.Data[" + i + "].InstanceId"));<NEW_LINE>taskDetail.setDomainName(context.stringValue("PollTaskResultResponse.Data[" + i + "].DomainName"));<NEW_LINE>taskDetail.setTaskStatus(context.stringValue("PollTaskResultResponse.Data[" + i + "].TaskStatus"));<NEW_LINE>taskDetail.setUpdateTime(context.stringValue("PollTaskResultResponse.Data[" + i + "].UpdateTime"));<NEW_LINE>taskDetail.setCreateTime(context.stringValue("PollTaskResultResponse.Data[" + i + "].CreateTime"));<NEW_LINE>taskDetail.setTryCount(context.integerValue("PollTaskResultResponse.Data[" + i + "].TryCount"));<NEW_LINE>taskDetail.setErrorMsg(context.stringValue("PollTaskResultResponse.Data[" + i + "].ErrorMsg"));<NEW_LINE>taskDetail.setTaskStatusCode(context.integerValue("PollTaskResultResponse.Data[" + i + "].TaskStatusCode"));<NEW_LINE>taskDetail.setTaskResult(context.stringValue("PollTaskResultResponse.Data[" + i + "].TaskResult"));<NEW_LINE>taskDetail.setTaskTypeDescription(context.stringValue("PollTaskResultResponse.Data[" + i + "].TaskTypeDescription"));<NEW_LINE>data.add(taskDetail);<NEW_LINE>}<NEW_LINE>pollTaskResultResponse.setData(data);<NEW_LINE>return pollTaskResultResponse;<NEW_LINE>}
("PollTaskResultResponse.Data[" + i + "].TaskNo"));
614,448
public void select(int mode) {<NEW_LINE>if (searchPoint == null) {<NEW_LINE>Toast.makeText(getActivity(), R.string.please_select_address, Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AddressInformation ai = new AddressInformation();<NEW_LINE>PointDescription pointDescription = ai.getHistoryName();<NEW_LINE>if (!Algorithms.isEmpty(street2) && !Algorithms.isEmpty(street)) {<NEW_LINE>ai = AddressInformation.build2StreetIntersection(getActivity(), osmandSettings);<NEW_LINE>pointDescription.setName(street2);<NEW_LINE>pointDescription.setTypeName(getRegionName() + ", " + city);<NEW_LINE>} else if (!Algorithms.isEmpty(building)) {<NEW_LINE>ai = AddressInformation.buildBuilding(getActivity(), osmandSettings);<NEW_LINE>pointDescription.setName(street + ", " + building);<NEW_LINE>pointDescription.setTypeName(getRegionName() + ", " + city);<NEW_LINE>} else if (!Algorithms.isEmpty(street)) {<NEW_LINE>ai = AddressInformation.buildStreet(getActivity(), osmandSettings);<NEW_LINE>pointDescription.setName(street);<NEW_LINE>pointDescription.setTypeName(getRegionName() + ", " + city);<NEW_LINE>} else if (!Algorithms.isEmpty(city)) {<NEW_LINE>ai = AddressInformation.buildCity(getActivity(), osmandSettings);<NEW_LINE>pointDescription.setName(city);<NEW_LINE>pointDescription.setTypeName(getRegionName());<NEW_LINE>}<NEW_LINE>if (mode == SELECT_POINT) {<NEW_LINE>Intent intent = getActivity().getIntent();<NEW_LINE>intent.<MASK><NEW_LINE>intent.putExtra(SELECT_ADDRESS_POINT_LAT, searchPoint.getLatitude());<NEW_LINE>intent.putExtra(SELECT_ADDRESS_POINT_LON, searchPoint.getLongitude());<NEW_LINE>getActivity().setResult(SELECT_ADDRESS_POINT_RESULT_OK, intent);<NEW_LINE>getActivity().finish();<NEW_LINE>} else {<NEW_LINE>if (mode == SHOW_ON_MAP) {<NEW_LINE>osmandSettings.setMapLocationToShow(searchPoint.getLatitude(), searchPoint.getLongitude(), ai.zoom, pointDescription);<NEW_LINE>MapActivity.launchMapActivityMoveToTop(getActivity());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
putExtra(SELECT_ADDRESS_POINT_INTENT_KEY, ai.objectName);
623,105
private String convertURItoURL(String uri) {<NEW_LINE>int indexScheme = uri.indexOf("://");<NEW_LINE>if (-1 != indexScheme) {<NEW_LINE>int indexQuery = uri.indexOf('?');<NEW_LINE>if (-1 == indexQuery || indexScheme < indexQuery) {<NEW_LINE>// already a full url<NEW_LINE>return uri;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String scheme <MASK><NEW_LINE>sb.append(scheme).append("://");<NEW_LINE>sb.append(this.request.getServerName());<NEW_LINE>int port = this.request.getServerPort();<NEW_LINE>if ("http".equalsIgnoreCase(scheme) && 80 != port) {<NEW_LINE>sb.append(':').append(port);<NEW_LINE>} else if ("https".equalsIgnoreCase(scheme) && 443 != port) {<NEW_LINE>sb.append(':').append(port);<NEW_LINE>}<NEW_LINE>String data = this.request.getContextPath();<NEW_LINE>if (!"".equals(data)) {<NEW_LINE>sb.append(data);<NEW_LINE>}<NEW_LINE>if (0 == uri.length()) {<NEW_LINE>sb.append('/');<NEW_LINE>} else if (uri.charAt(0) == '/') {<NEW_LINE>// relative to servlet container root...<NEW_LINE>sb.append(uri);<NEW_LINE>} else {<NEW_LINE>// relative to current URI,<NEW_LINE>data = this.request.getServletPath();<NEW_LINE>if (!"".equals(data)) {<NEW_LINE>sb.append(data);<NEW_LINE>}<NEW_LINE>data = this.request.getPathInfo();<NEW_LINE>if (null != data) {<NEW_LINE>sb.append(data);<NEW_LINE>}<NEW_LINE>sb.append('/');<NEW_LINE>sb.append(uri);<NEW_LINE>// TODO: webcontainer converted "/./" and "/../" info too<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
= this.request.getScheme();
646,132
private static void runBenchmarks(String clazz) {<NEW_LINE>try {<NEW_LINE>Class<?> task = Class.forName(clazz);<NEW_LINE>Constructor<?> ctor = task.getConstructor();<NEW_LINE>System.out.println("Benchmarking " + task.getClass());<NEW_LINE>Object o = ctor.newInstance();<NEW_LINE>LinkedList<Object> foo = new LinkedList<Object>();<NEW_LINE>foo.add(o);<NEW_LINE>new <MASK><NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>System.out.println("class does not have an empty ctor");<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
BenchmarkHarness(foo).start();
1,019,687
private static boolean hasJavaRuntime(ImageReference imageReference) {<NEW_LINE>if (null == imageReference || null == imageReference.image) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Iterator<?> spaces = imageReference.image.getAddressSpaces();<NEW_LINE>while ((null != spaces) && spaces.hasNext()) {<NEW_LINE>// search address spaces<NEW_LINE>Object obj = spaces.next();<NEW_LINE>if ((null != obj) && (obj instanceof ImageAddressSpace)) {<NEW_LINE>ImageAddressSpace space = (ImageAddressSpace) obj;<NEW_LINE>Iterator<?<MASK><NEW_LINE>while ((null != procs) && procs.hasNext()) {<NEW_LINE>// search processes<NEW_LINE>Object procobj = procs.next();<NEW_LINE>if ((null != procobj) && (procobj instanceof ImageProcess)) {<NEW_LINE>ImageProcess proc = (ImageProcess) procobj;<NEW_LINE>Iterator<?> runtimes = proc.getRuntimes();<NEW_LINE>while ((null != runtimes) && runtimes.hasNext()) {<NEW_LINE>Object rtobj = runtimes.next();<NEW_LINE>if ((null != rtobj) && (rtobj instanceof JavaRuntime)) {<NEW_LINE>// found a non-corrupt java runtime<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
> procs = space.getProcesses();
1,334,492
public void validateOptionalJoin(Join join) {<NEW_LINE>for (ValidationCapability c : getCapabilities()) {<NEW_LINE>validateFeature(c, Feature.join);<NEW_LINE>validateFeature(c, join.isSimple() && join.isOuter(), Feature.joinOuterSimple);<NEW_LINE>validateFeature(c, join.isSimple(), Feature.joinSimple);<NEW_LINE>validateFeature(c, join.isRight(), Feature.joinRight);<NEW_LINE>validateFeature(c, join.isNatural(), Feature.joinNatural);<NEW_LINE>validateFeature(c, join.isFull(), Feature.joinFull);<NEW_LINE>validateFeature(c, join.<MASK><NEW_LINE>validateFeature(c, join.isCross(), Feature.joinCross);<NEW_LINE>validateFeature(c, join.isOuter(), Feature.joinOuter);<NEW_LINE>validateFeature(c, join.isInner(), Feature.joinInner);<NEW_LINE>validateFeature(c, join.isSemi(), Feature.joinSemi);<NEW_LINE>validateFeature(c, join.isStraight(), Feature.joinStraight);<NEW_LINE>validateFeature(c, join.isApply(), Feature.joinApply);<NEW_LINE>validateFeature(c, join.isWindowJoin(), Feature.joinWindow);<NEW_LINE>validateOptionalFeature(c, join.getUsingColumns(), Feature.joinUsingColumns);<NEW_LINE>}<NEW_LINE>validateOptionalFromItem(join.getRightItem());<NEW_LINE>for (Expression onExpression : join.getOnExpressions()) {<NEW_LINE>validateOptionalExpression(onExpression);<NEW_LINE>}<NEW_LINE>validateOptionalExpressions(join.getUsingColumns());<NEW_LINE>}
isLeft(), Feature.joinLeft);
470,167
public void updateRowId(String columnLabel, RowId x) throws SQLException {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (SQLException sqlX) {<NEW_LINE>FFDCFilter.processException(sqlX, getClass().getName() + ".updateRowId", "5107", this);<NEW_LINE>throw WSJdbcUtil.mapException(this, sqlX);<NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>} catch (AbstractMethodError methError) {<NEW_LINE>// No FFDC code needed; wrong JDBC level.<NEW_LINE>throw AdapterUtil.notSupportedX("ResultSet.updateRowId", methError);<NEW_LINE>} catch (RuntimeException runX) {<NEW_LINE>FFDCFilter.processException(runX, getClass().getName() + ".updateRowId", "5123", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "updateRowId", runX);<NEW_LINE>throw runX;<NEW_LINE>} catch (Error err) {<NEW_LINE>FFDCFilter.processException(err, getClass().getName() + ".updateRowId", "5130", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "updateRowId", err);<NEW_LINE>throw err;<NEW_LINE>}<NEW_LINE>}
rsetImpl.updateRowId(columnLabel, x);
365,786
public java.awt.Dimension query_imagesize(String cid, String tid) {<NEW_LINE>java.awt.Dimension dim = null;<NEW_LINE>try {<NEW_LINE>Socket imgdecSocket = new Socket(hostname, portNo);<NEW_LINE>DataOutputStream os = new DataOutputStream(imgdecSocket.getOutputStream());<NEW_LINE>DataInputStream is = new DataInputStream(imgdecSocket.getInputStream());<NEW_LINE>byte[] header = new byte[3];<NEW_LINE>os.writeBytes("SIZ request\n");<NEW_LINE>if (tid == null)<NEW_LINE>os.writeBytes("0\n");<NEW_LINE>else<NEW_LINE><MASK><NEW_LINE>if (cid == null)<NEW_LINE>os.writeBytes("0\n");<NEW_LINE>else<NEW_LINE>os.writeBytes(cid + "\n");<NEW_LINE>read_stream(is, header, 3);<NEW_LINE>if (header[0] == 83 && header[1] == 73 && header[2] == 90) {<NEW_LINE>byte[] data = new byte[3];<NEW_LINE>read_stream(is, data, 3);<NEW_LINE>int w = (data[0] & 0xff) << 16 | (data[1] & 0xff) << 8 | (data[2] & 0xff);<NEW_LINE>read_stream(is, data, 3);<NEW_LINE>int h = (data[0] & 0xff) << 16 | (data[1] & 0xff) << 8 | (data[2] & 0xff);<NEW_LINE>dim = new java.awt.Dimension(w, h);<NEW_LINE>} else<NEW_LINE>System.err.println("Error in query_imagesize(" + cid + ", " + tid + "), wrong to start with " + header);<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>System.err.println("Trying to connect to unknown host: " + e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("IOException: " + e);<NEW_LINE>}<NEW_LINE>return dim;<NEW_LINE>}
os.writeBytes(tid + "\n");
1,271,133
private Map<String, double[]> prepareCustomBaseLines(Date start, Date end, String currentDomain, Map<String, CustomConfig> customConfigs) {<NEW_LINE>Map<String, double[]> baseLineCache = new HashMap<<MASK><NEW_LINE>Map<String, double[]> customBaseLines = new LinkedHashMap<String, double[]>();<NEW_LINE>int totalSize = (int) ((end.getTime() - start.getTime()) / TimeHelper.ONE_MINUTE);<NEW_LINE>for (CustomConfig customConfig : customConfigs.values()) {<NEW_LINE>try {<NEW_LINE>String pattern = customConfig.getPattern();<NEW_LINE>List<CustomInfo> customInfos = m_customDataCalculator.translatePattern(pattern);<NEW_LINE>for (CustomInfo customInfo : customInfos) {<NEW_LINE>String customKey = m_keyHelper.generateKey(customInfo.getKey(), customInfo.getDomain(), customInfo.getType());<NEW_LINE>baseLineCache.put(customKey, queryBaseline(BusinessAnalyzer.ID, customKey, start, end));<NEW_LINE>}<NEW_LINE>double[] baseLine = m_customDataCalculator.calculate(pattern, customInfos, baseLineCache, totalSize);<NEW_LINE>String key = m_keyHelper.generateKey(customConfig.getId(), currentDomain, MetricType.AVG.getName());<NEW_LINE>customBaseLines.put(key, baseLine);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return customBaseLines;<NEW_LINE>}
String, double[]>();
851,351
public IBaseResource loadPackageAssetByUrl(FhirVersionEnum theFhirVersion, String theCanonicalUrl) {<NEW_LINE>String canonicalUrl = theCanonicalUrl;<NEW_LINE>int versionSeparator = canonicalUrl.lastIndexOf('|');<NEW_LINE>Slice<NpmPackageVersionResourceEntity> slice;<NEW_LINE>if (versionSeparator != -1) {<NEW_LINE>String canonicalVersion = canonicalUrl.substring(versionSeparator + 1);<NEW_LINE>canonicalUrl = canonicalUrl.substring(0, versionSeparator);<NEW_LINE>slice = myPackageVersionResourceDao.findCurrentVersionByCanonicalUrlAndVersion(PageRequest.of(0, 1<MASK><NEW_LINE>} else {<NEW_LINE>slice = myPackageVersionResourceDao.findCurrentVersionByCanonicalUrl(PageRequest.of(0, 1), theFhirVersion, canonicalUrl);<NEW_LINE>}<NEW_LINE>if (slice.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>NpmPackageVersionResourceEntity contents = slice.getContent().get(0);<NEW_LINE>return loadPackageEntity(contents);<NEW_LINE>}<NEW_LINE>}
), theFhirVersion, canonicalUrl, canonicalVersion);
579,105
public com.amazonaws.services.lambda.model.InvalidSubnetIDException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.lambda.model.InvalidSubnetIDException invalidSubnetIDException = new com.amazonaws.services.lambda.model.InvalidSubnetIDException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>invalidSubnetIDException.setType(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 invalidSubnetIDException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,756,406
public Message<?> toMessage(MethodArgsHolder holder, @Nullable Map<String, Object> headersToMap) {<NEW_LINE>Object messageOrPayload = null;<NEW_LINE>boolean foundPayloadAnnotation = false;<NEW_LINE>Object[] arguments = holder.getArgs();<NEW_LINE>EvaluationContext methodInvocationEvaluationContext = createMethodInvocationEvaluationContext(arguments);<NEW_LINE>Map<String, Object> headersToPopulate = headersToMap != null ? new HashMap<>(headersToMap) : new HashMap<>();<NEW_LINE>if (GatewayMethodInboundMessageMapper.this.payloadExpression != null) {<NEW_LINE>messageOrPayload = GatewayMethodInboundMessageMapper.this.<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < GatewayMethodInboundMessageMapper.this.parameterList.size(); i++) {<NEW_LINE>Object argumentValue = arguments[i];<NEW_LINE>MethodParameter methodParameter = GatewayMethodInboundMessageMapper.this.parameterList.get(i);<NEW_LINE>Annotation annotation = MessagingAnnotationUtils.findMessagePartAnnotation(methodParameter.getParameterAnnotations(), false);<NEW_LINE>if (annotation != null) {<NEW_LINE>if (annotation.annotationType().equals(Payload.class)) {<NEW_LINE>messageOrPayload = processPayloadAnnotation(messageOrPayload, argumentValue, methodParameter, annotation);<NEW_LINE>foundPayloadAnnotation = true;<NEW_LINE>} else {<NEW_LINE>headerOrHeaders(headersToPopulate, argumentValue, methodParameter, annotation);<NEW_LINE>}<NEW_LINE>} else if (messageOrPayload == null) {<NEW_LINE>messageOrPayload = argumentValue;<NEW_LINE>} else if (Map.class.isAssignableFrom(methodParameter.getParameterType())) {<NEW_LINE>processMapArgument(messageOrPayload, foundPayloadAnnotation, headersToPopulate, (Map<?, ?>) argumentValue);<NEW_LINE>} else if (GatewayMethodInboundMessageMapper.this.payloadExpression == null) {<NEW_LINE>throwExceptionForMultipleMessageOrPayloadParameters(methodParameter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Assert.isTrue(messageOrPayload != null, () -> "The 'payload' (or 'Message') for gateway [" + GatewayMethodInboundMessageMapper.this.method + "] method call cannot be determined (must not be 'null') from the provided arguments: " + Arrays.toString(arguments));<NEW_LINE>populateSendAndReplyTimeoutHeaders(methodInvocationEvaluationContext, holder, headersToPopulate);<NEW_LINE>return buildMessage(holder, headersToPopulate, messageOrPayload, methodInvocationEvaluationContext);<NEW_LINE>}
payloadExpression.getValue(methodInvocationEvaluationContext, holder);
161,186
public static List<ReassignTopicStatusVO> convert2ReassignTopicStatusVOList(List<ReassignStatus> dtoList) {<NEW_LINE>if (ValidateUtils.isNull(dtoList)) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>List<ReassignTopicStatusVO> voList = new ArrayList<>();<NEW_LINE>for (ReassignStatus elem : dtoList) {<NEW_LINE>ReassignTopicStatusVO vo = new ReassignTopicStatusVO();<NEW_LINE>vo.setSubTaskId(elem.getSubTaskId());<NEW_LINE>vo.setClusterId(elem.getClusterId());<NEW_LINE>vo.setClusterName(elem.getClusterName());<NEW_LINE>vo.setTopicName(elem.getTopicName());<NEW_LINE>vo.setStatus(elem.getStatus());<NEW_LINE>vo.setCompletedPartitionNum(0);<NEW_LINE>vo.setRealThrottle(elem.getRealThrottle());<NEW_LINE>vo.<MASK><NEW_LINE>vo.setMinThrottle(elem.getMinThrottle());<NEW_LINE>vo.setTotalPartitionNum(elem.getReassignList().size());<NEW_LINE>vo.setReassignList(new ArrayList<>());<NEW_LINE>if (ValidateUtils.isNull(elem.getReassignStatusMap())) {<NEW_LINE>elem.setReassignStatusMap(new HashMap<>());<NEW_LINE>}<NEW_LINE>for (ReassignmentElemData elemData : elem.getReassignList()) {<NEW_LINE>ReassignPartitionStatusVO partitionStatusVO = new ReassignPartitionStatusVO();<NEW_LINE>partitionStatusVO.setPartitionId(elemData.getPartition());<NEW_LINE>partitionStatusVO.setDestReplicaIdList(elemData.getReplicas());<NEW_LINE>TaskStatusReassignEnum reassignEnum = elem.getReassignStatusMap().get(new TopicAndPartition(elem.getTopicName(), elemData.getPartition()));<NEW_LINE>if (!ValidateUtils.isNull(reassignEnum)) {<NEW_LINE>partitionStatusVO.setStatus(reassignEnum.getCode());<NEW_LINE>}<NEW_LINE>if (!ValidateUtils.isNull(reassignEnum) && TaskStatusReassignEnum.isFinished(reassignEnum.getCode())) {<NEW_LINE>vo.setCompletedPartitionNum(vo.getCompletedPartitionNum() + 1);<NEW_LINE>}<NEW_LINE>vo.getReassignList().add(partitionStatusVO);<NEW_LINE>}<NEW_LINE>voList.add(vo);<NEW_LINE>}<NEW_LINE>return voList;<NEW_LINE>}
setMaxThrottle(elem.getMaxThrottle());
1,228,393
public Authenticator authenticate(Vertx vertx, Map<String, String> config, MultiMap headerMap, Handler<AsyncResult<Void>> resultHandler) {<NEW_LINE>OAuth2FlowType flowType = getFlowType(config.get("flowType"));<NEW_LINE>JsonObject params = new JsonObject();<NEW_LINE>if (config.get("username") != null) {<NEW_LINE>params.put("username"<MASK><NEW_LINE>}<NEW_LINE>if (config.get("password") != null) {<NEW_LINE>params.put("password", config.get("password"));<NEW_LINE>}<NEW_LINE>OAuth2Auth oauth2 = KeycloakAuth.create(vertx, flowType, mapToJson(config));<NEW_LINE>oauth2.getToken(params, tokenResult -> {<NEW_LINE>if (tokenResult.succeeded()) {<NEW_LINE>log.debug("OAuth2 Keycloak exchange succeeded.");<NEW_LINE>AccessToken token = tokenResult.result();<NEW_LINE>headerMap.set("Authorization", "Bearer " + token.principal().getString("access_token"));<NEW_LINE>resultHandler.handle(Future.succeededFuture());<NEW_LINE>} else {<NEW_LINE>log.error("Access Token Error: {0}.", tokenResult.cause().getMessage());<NEW_LINE>resultHandler.handle(Future.failedFuture(tokenResult.cause()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return this;<NEW_LINE>}
, config.get("username"));
894,980
public void buildModel() {<NEW_LINE>model = new Model("CostasArrays");<NEW_LINE>vars = model.intVarArray("v", n, <MASK><NEW_LINE>vectors = new IntVar[(n * (n - 1)) / 2];<NEW_LINE>for (int i = 0, k = 0; i < n; i++) {<NEW_LINE>for (int j = i + 1; j < n; j++, k++) {<NEW_LINE>IntVar d = model.intVar(model.generateName(), -n, n, false);<NEW_LINE>model.arithm(d, "!=", 0).post();<NEW_LINE>model.sum(new IntVar[] { vars[i], d }, "=", vars[j]).post();<NEW_LINE>vectors[k] = model.intOffsetView(d, 2 * n * (j - i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>model.allDifferent(vars, "AC").post();<NEW_LINE>model.allDifferent(vectors, "BC").post();<NEW_LINE>// symmetry-breaking<NEW_LINE>model.arithm(vars[0], "<", vars[n - 1]).post();<NEW_LINE>}
0, n - 1, false);
1,260,276
public void drawBackground(@Nonnull PoseStack matrix, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>super.drawBackground(matrix, mouseX, mouseY, partialTicks);<NEW_LINE>backgroundType.render(this, matrix);<NEW_LINE>if (textScale == 1F) {<NEW_LINE>renderTextField(<MASK><NEW_LINE>} else {<NEW_LINE>// hacky. we should write our own renderer at some point.<NEW_LINE>float reverse = (1 / textScale) - 1;<NEW_LINE>float yAdd = 4 - (textScale * 8) / 2F;<NEW_LINE>matrix.pushPose();<NEW_LINE>matrix.scale(textScale, textScale, textScale);<NEW_LINE>matrix.translate(textField.x * reverse, (textField.y) * reverse + yAdd * (1 / textScale), 0);<NEW_LINE>renderTextField(matrix, mouseX, mouseY, partialTicks);<NEW_LINE>matrix.popPose();<NEW_LINE>}<NEW_LINE>MekanismRenderer.resetColor();<NEW_LINE>if (iconType != null) {<NEW_LINE>RenderSystem.setShaderTexture(0, iconType.getIcon());<NEW_LINE>blit(matrix, x + 2, y + (height / 2) - (int) Math.ceil(iconType.getHeight() / 2F), 0, 0, iconType.getWidth(), iconType.getHeight(), iconType.getWidth(), iconType.getHeight());<NEW_LINE>}<NEW_LINE>}
matrix, mouseX, mouseY, partialTicks);
1,432,175
public boolean addAttackingCreature(UUID creatureId, Game game, UUID playerToAttack) {<NEW_LINE>Set<UUID> possibleDefenders;<NEW_LINE>if (playerToAttack != null) {<NEW_LINE>possibleDefenders = new HashSet<>();<NEW_LINE>for (UUID objectId : defenders) {<NEW_LINE>Permanent <MASK><NEW_LINE>if (planeswalker != null && planeswalker.isControlledBy(playerToAttack)) {<NEW_LINE>possibleDefenders.add(objectId);<NEW_LINE>} else if (playerToAttack.equals(objectId)) {<NEW_LINE>possibleDefenders.add(objectId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>possibleDefenders = new HashSet<>(defenders);<NEW_LINE>}<NEW_LINE>Player player = game.getPlayer(attackingPlayerId);<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (possibleDefenders.size() == 1) {<NEW_LINE>addAttackerToCombat(creatureId, possibleDefenders.iterator().next(), game);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>TargetDefender target = new TargetDefender(possibleDefenders, creatureId);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>target.setRequired(true);<NEW_LINE>player.chooseTarget(Outcome.Damage, target, null, game);<NEW_LINE>if (target.getFirstTarget() != null) {<NEW_LINE>addAttackerToCombat(creatureId, target.getFirstTarget(), game);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
planeswalker = game.getPermanent(objectId);
1,457,655
public void doCallback(int code, Object obj) {<NEW_LINE>if (TextUtils.equals(CALL_ID_NO_CALLBACK, mCallId)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (obj instanceof JSValue) {<NEW_LINE>JSObject jsObject = new JSObject();<NEW_LINE>jsObject.set("result", code);<NEW_LINE>jsObject.set("moduleName", mModuleName);<NEW_LINE>jsObject.set("moduleFunc", mModuleFunc);<NEW_LINE>jsObject.set("callId", mCallId);<NEW_LINE>jsObject.set("params", obj);<NEW_LINE>mContext.getBridgeManager().execCallback(jsObject, transferType);<NEW_LINE>} else {<NEW_LINE>HippyMap hippyMap = new HippyMap();<NEW_LINE><MASK><NEW_LINE>hippyMap.pushString("moduleName", mModuleName);<NEW_LINE>hippyMap.pushString("moduleFunc", mModuleFunc);<NEW_LINE>hippyMap.pushString("callId", mCallId);<NEW_LINE>hippyMap.pushObject("params", obj);<NEW_LINE>mContext.getBridgeManager().execCallback(hippyMap, transferType);<NEW_LINE>}<NEW_LINE>}
hippyMap.pushInt("result", code);
1,692,583
final AttachThingPrincipalResult executeAttachThingPrincipal(AttachThingPrincipalRequest attachThingPrincipalRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(attachThingPrincipalRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AttachThingPrincipalRequest> request = null;<NEW_LINE>Response<AttachThingPrincipalResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AttachThingPrincipalRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(attachThingPrincipalRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachThingPrincipal");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AttachThingPrincipalResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AttachThingPrincipalResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
572,331
private void traverseSubSelectedFields(ExecutableNormalizedField currentNormalisedField, ImmutableList.Builder<SelectedField> immediateFieldsBuilder, String qualifiedFieldPrefix, String simpleFieldPrefix, boolean firstLevel) {<NEW_LINE>List<ExecutableNormalizedField<MASK><NEW_LINE>for (ExecutableNormalizedField normalizedSubSelectedField : children) {<NEW_LINE>String typeQualifiedName = mkTypeQualifiedName(normalizedSubSelectedField);<NEW_LINE>String simpleName = normalizedSubSelectedField.getName();<NEW_LINE>String globQualifiedName = mkFieldGlobName(qualifiedFieldPrefix, typeQualifiedName);<NEW_LINE>String globSimpleName = mkFieldGlobName(simpleFieldPrefix, simpleName);<NEW_LINE>flattenedFieldsForGlobSearching.add(globQualifiedName);<NEW_LINE>// put in entries for the simple names - eg `Invoice.payments/Payment.amount` becomes `payments/amount`<NEW_LINE>flattenedFieldsForGlobSearching.add(globSimpleName);<NEW_LINE>SelectedFieldImpl selectedField = new SelectedFieldImpl(globSimpleName, globQualifiedName, normalizedSubSelectedField, schema);<NEW_LINE>if (firstLevel) {<NEW_LINE>immediateFieldsBuilder.add(selectedField);<NEW_LINE>}<NEW_LINE>normalisedSelectionSetFields.computeIfAbsent(globQualifiedName, newList()).add(selectedField);<NEW_LINE>normalisedSelectionSetFields.computeIfAbsent(globSimpleName, newList()).add(selectedField);<NEW_LINE>if (normalizedSubSelectedField.hasChildren()) {<NEW_LINE>traverseSubSelectedFields(normalizedSubSelectedField, immediateFieldsBuilder, globQualifiedName, globSimpleName, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> children = currentNormalisedField.getChildren();
1,530,748
public CreateAutoMLJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateAutoMLJobResult createAutoMLJobResult = new CreateAutoMLJobResult();<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 createAutoMLJobResult;<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("AutoMLJobArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createAutoMLJobResult.setAutoMLJobArn(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 createAutoMLJobResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
314,023
public BufferedImage filter(final BufferedImage src, BufferedImage dst) {<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>final int type = src.getType();<NEW_LINE>final WritableRaster srcRaster = src.getRaster();<NEW_LINE>if (dst == null) {<NEW_LINE>dst = createCompatibleDestImage(src, null);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>setDimensions(width, height);<NEW_LINE>final int[] inPixels = new int[width];<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>// We try to avoid calling getRGB on images as it causes them to become un-managed, causing horrible performance problems.<NEW_LINE>if (type == BufferedImage.TYPE_INT_ARGB) {<NEW_LINE>srcRaster.getDataElements(0, y, width, 1, inPixels);<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>inPixels[x] = filterRGB(x, y, inPixels[x]);<NEW_LINE>}<NEW_LINE>dstRaster.setDataElements(0, y, width, 1, inPixels);<NEW_LINE>} else {<NEW_LINE>src.getRGB(0, y, width, 1, inPixels, 0, width);<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>inPixels[x] = filterRGB(x, y, inPixels[x]);<NEW_LINE>}<NEW_LINE>dst.setRGB(0, y, width, 1, inPixels, 0, width);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dst;<NEW_LINE>}
WritableRaster dstRaster = dst.getRaster();
849,364
public void buildSearchJs(List<RpcApiDoc> apiDocList, ApiConfig config, JavaProjectBuilder javaProjectBuilder, String template, String outPutFileName) {<NEW_LINE>List<ApiErrorCode> errorCodeList = DocUtil.errorCodeDictToList(config);<NEW_LINE>Template tpl = BeetlTemplateUtil.getByName(template);<NEW_LINE>// directory tree<NEW_LINE>List<RpcApiDoc> apiDocs = new ArrayList<>();<NEW_LINE>RpcApiDoc apiDoc = new RpcApiDoc();<NEW_LINE>apiDoc.setAlias(DEPENDENCY_TITLE);<NEW_LINE>apiDoc.setOrder(1);<NEW_LINE>apiDoc.setDesc(DEPENDENCY_TITLE);<NEW_LINE>apiDoc.setList(new ArrayList<>(0));<NEW_LINE>apiDocs.add(apiDoc);<NEW_LINE>List<RpcApiDoc> apiDocs1 = apiDocList;<NEW_LINE>for (RpcApiDoc apiDoc1 : apiDocs1) {<NEW_LINE>apiDoc1.setOrder(apiDocs.size() + 1);<NEW_LINE>apiDocs.add(apiDoc1);<NEW_LINE>}<NEW_LINE>Map<String, String> titleMap = setDirectoryLanguageVariable(config, tpl);<NEW_LINE>if (CollectionUtil.isNotEmpty(errorCodeList)) {<NEW_LINE>RpcApiDoc apiDoc1 = new RpcApiDoc();<NEW_LINE>apiDoc1.setOrder(apiDocs.size() + 1);<NEW_LINE>apiDoc1.setDesc(titleMap.get(TemplateVariable.ERROR_LIST_TITLE.getVariable()));<NEW_LINE>apiDoc1.setList(new ArrayList<>(0));<NEW_LINE>apiDocs.add(apiDoc1);<NEW_LINE>}<NEW_LINE>// set dict list<NEW_LINE>List<ApiDocDict> apiDocDictList = <MASK><NEW_LINE>tpl.binding(TemplateVariable.DICT_LIST.getVariable(), apiDocDictList);<NEW_LINE>tpl.binding(TemplateVariable.DIRECTORY_TREE.getVariable(), apiDocs);<NEW_LINE>FileUtil.nioWriteFile(tpl.render(), config.getOutPath() + FILE_SEPARATOR + outPutFileName);<NEW_LINE>}
DocUtil.buildDictionary(config, javaProjectBuilder);
1,663,387
final DescribeLifecycleHookTypesResult executeDescribeLifecycleHookTypes(DescribeLifecycleHookTypesRequest describeLifecycleHookTypesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeLifecycleHookTypesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeLifecycleHookTypesRequest> request = null;<NEW_LINE>Response<DescribeLifecycleHookTypesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeLifecycleHookTypesRequestMarshaller().marshall(super.beforeMarshalling(describeLifecycleHookTypesRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLifecycleHookTypes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeLifecycleHookTypesResult> responseHandler = new StaxResponseHandler<DescribeLifecycleHookTypesResult>(new DescribeLifecycleHookTypesResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
137,745
private Multimap<TopicRepository, String> deleteEventTypeWithSubscriptions(final String eventType) {<NEW_LINE>try {<NEW_LINE>return transactionTemplate.execute(action -> {<NEW_LINE>eventTypeRepository.listEventTypesWithRowLock(Set.of(eventType), EventTypeRepository.RowLockMode.UPDATE);<NEW_LINE>final List<Subscription> subscriptions = subscriptionRepository.listSubscriptions(Set.of(eventType), Optional.empty(), Optional.empty(), Optional.empty());<NEW_LINE>if (!(featureToggleService.isFeatureEnabled(DELETE_EVENT_TYPE_WITH_SUBSCRIPTIONS) || onlyDeletableSubscriptions(subscriptions))) {<NEW_LINE>throw new ConflictException("Can't remove event type " + eventType + ", as it has subscriptions");<NEW_LINE>}<NEW_LINE>subscriptions.forEach(s -> {<NEW_LINE>try {<NEW_LINE>subscriptionRepository.<MASK><NEW_LINE>} catch (final NoSuchSubscriptionException e) {<NEW_LINE>// should not happen as we are inside transaction<NEW_LINE>throw new InconsistentStateException("Subscription to be deleted is not found", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return deleteEventType(eventType);<NEW_LINE>});<NEW_LINE>} catch (final TransactionException e) {<NEW_LINE>throw new InconsistentStateException("Failed to delete event-type because of race condition in DB", e);<NEW_LINE>}<NEW_LINE>}
deleteSubscription(s.getId());
1,659,372
public int distance() {<NEW_LINE>// [row][col]<NEW_LINE>matrix = new int[searchTerm.length() + 1][searchText.length() + 1];<NEW_LINE>// first column: start-gap penalties for searchTerm<NEW_LINE>for (int i = 0; i <= searchTerm.length(); i++) matrix[i][0] = i * costIndel;<NEW_LINE>// first row: start-gap penalties for searchText<NEW_LINE>if (type == Type.Global) {<NEW_LINE>for (int j = 1; j <= searchText.length(); j++) matrix[0<MASK><NEW_LINE>} else if (type == Type.SemiGlobal) {<NEW_LINE>Arrays.fill(matrix[0], 0);<NEW_LINE>}<NEW_LINE>// compute the rest of the matrix<NEW_LINE>for (int i = 1; i <= searchTerm.length(); i++) {<NEW_LINE>for (int j = 1; j <= searchText.length(); j++) {<NEW_LINE>int cost_try_match = matrix[i - 1][j - 1] + (isMatch(i, j) ? 0 : costMismatch);<NEW_LINE>int cost_ins = matrix[i - 1][j] + costIndel;<NEW_LINE>int cost_del = matrix[i][j - 1] + costIndel;<NEW_LINE>matrix[i][j] = Math.min(cost_try_match, Math.min(cost_ins, cost_del));<NEW_LINE>if (i >= 2 && j >= 2 && searchTerm.charAt(i - 2) == searchText.charAt(j - 1) && searchTerm.charAt(i - 1) == searchText.charAt(j - 2)) {<NEW_LINE>matrix[i][j] = Math.min(matrix[i][j], matrix[i - 2][j - 2] + costTranspos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// writeMatrix(matrix);<NEW_LINE>if (type == Type.Global) {<NEW_LINE>return matrix[searchTerm.length()][searchText.length()];<NEW_LINE>} else {<NEW_LINE>int min = Integer.MAX_VALUE;<NEW_LINE>for (int j = 1; j <= searchText.length() + 1; j++) {<NEW_LINE>min = Math.min(min, matrix[searchTerm.length()][j - 1]);<NEW_LINE>}<NEW_LINE>return min;<NEW_LINE>}<NEW_LINE>}
][j] = j * costIndel;
415,074
public void applyTo(CompilationUnit compilationUnit) {<NEW_LINE>compilationUnit.accept(new AbstractRewriter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Expression rewriteBinaryExpression(BinaryExpression binaryExpression) {<NEW_LINE>Expression leftOperand = binaryExpression.getLeftOperand();<NEW_LINE>Expression rightOperand = binaryExpression.getRightOperand();<NEW_LINE>TypeDescriptor returnTypeDescriptor = binaryExpression.getTypeDescriptor();<NEW_LINE>// Skips non-long operations.<NEW_LINE>if ((!TypeDescriptors.isPrimitiveLong(leftOperand.getTypeDescriptor()) && !TypeDescriptors.isPrimitiveLong(rightOperand.getTypeDescriptor())) || (!TypeDescriptors.isPrimitiveLong(returnTypeDescriptor) && !TypeDescriptors.isPrimitiveBoolean(returnTypeDescriptor))) {<NEW_LINE>return binaryExpression;<NEW_LINE>}<NEW_LINE>BinaryOperator operator = binaryExpression.getOperator();<NEW_LINE>// Skips assignment because it doesn't need special handling.<NEW_LINE>if (operator == BinaryOperator.ASSIGN) {<NEW_LINE>return binaryExpression;<NEW_LINE>}<NEW_LINE>return RuntimeMethods.createLongUtilsMethodCall(getLongOperationFunctionName(operator), returnTypeDescriptor, leftOperand, rightOperand);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Expression rewritePrefixExpression(PrefixExpression prefixExpression) {<NEW_LINE><MASK><NEW_LINE>// Only interested in longs.<NEW_LINE>if (!TypeDescriptors.isPrimitiveLong(operand.getTypeDescriptor())) {<NEW_LINE>return prefixExpression;<NEW_LINE>}<NEW_LINE>PrefixOperator operator = prefixExpression.getOperator();<NEW_LINE>// Unwrap PLUS operator because it's a NOOP.<NEW_LINE>if (operator == PrefixOperator.PLUS) {<NEW_LINE>return prefixExpression.getOperand();<NEW_LINE>}<NEW_LINE>// LongUtils.someOperation(operand);<NEW_LINE>return RuntimeMethods.createLongUtilsMethodCall(getLongOperationFunctionName(operator), operand);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Expression operand = prefixExpression.getOperand();
1,701,746
final BatchDeleteImageResult executeBatchDeleteImage(BatchDeleteImageRequest batchDeleteImageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDeleteImageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDeleteImageRequest> request = null;<NEW_LINE>Response<BatchDeleteImageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchDeleteImageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchDeleteImageRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECR PUBLIC");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchDeleteImage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchDeleteImageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchDeleteImageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,790,765
public static AnnotatedTypeMirror leastUpperBound(final AnnotatedTypeFactory typeFactory, final Iterable<AnnotatedTypeMirror> types) {<NEW_LINE>final Iterator<AnnotatedTypeMirror> typesIter = types.iterator();<NEW_LINE>if (!typesIter.hasNext()) {<NEW_LINE>throw new BugInCF("Calling LUB on empty list");<NEW_LINE>}<NEW_LINE>AnnotatedTypeMirror lubType = typesIter.next();<NEW_LINE>AnnotatedTypeMirror nextType = null;<NEW_LINE>while (typesIter.hasNext()) {<NEW_LINE>nextType = typesIter.next();<NEW_LINE>if (lubType.getKind().isPrimitive()) {<NEW_LINE>if (!nextType.getKind().isPrimitive()) {<NEW_LINE>lubType = typeFactory.getBoxedType((AnnotatedPrimitiveType) lubType);<NEW_LINE>}<NEW_LINE>} else if (nextType.getKind().isPrimitive()) {<NEW_LINE>if (!lubType.getKind().isPrimitive()) {<NEW_LINE>nextType = typeFactory<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>lubType = AnnotatedTypes.leastUpperBound(typeFactory, lubType, nextType);<NEW_LINE>}<NEW_LINE>return lubType;<NEW_LINE>}
.getBoxedType((AnnotatedPrimitiveType) nextType);
319,446
public static Bigram[] of(Corpus corpus, double p, int minFrequency) {<NEW_LINE>if (p <= 0.0 || p >= 1.0) {<NEW_LINE>throw new IllegalArgumentException("Invalid p = " + p);<NEW_LINE>}<NEW_LINE>double cutoff = chisq.quantile(p);<NEW_LINE>ArrayList<Bigram> <MASK><NEW_LINE>Iterator<smile.nlp.Bigram> iterator = corpus.bigrams();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>smile.nlp.Bigram bigram = iterator.next();<NEW_LINE>int c12 = corpus.count(bigram);<NEW_LINE>if (c12 > minFrequency) {<NEW_LINE>int c1 = corpus.count(bigram.w1);<NEW_LINE>int c2 = corpus.count(bigram.w2);<NEW_LINE>double score = likelihoodRatio(c1, c2, c12, corpus.size());<NEW_LINE>if (score > cutoff) {<NEW_LINE>bigrams.add(new Bigram(bigram.w1, bigram.w2, c12, score));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Bigram[] collocations = bigrams.toArray(new Bigram[0]);<NEW_LINE>Arrays.sort(collocations, Collections.reverseOrder());<NEW_LINE>return collocations;<NEW_LINE>}
bigrams = new ArrayList<>();
119,445
private OrientDBConfig buildConfig(final Map<OGlobalConfiguration, Object> iProperties) {<NEW_LINE>Map<String, Object> pars = new HashMap<>(preopenProperties);<NEW_LINE>if (iProperties != null) {<NEW_LINE>for (Map.Entry<OGlobalConfiguration, Object> par : iProperties.entrySet()) {<NEW_LINE>pars.put(par.getKey().getKey(), par.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OrientDBConfigBuilder builder = OrientDBConfig.builder();<NEW_LINE>final String connectionStrategy = pars != null ? (String) pars.get(OGlobalConfiguration.<MASK><NEW_LINE>if (connectionStrategy != null)<NEW_LINE>builder.addConfig(OGlobalConfiguration.CLIENT_CONNECTION_STRATEGY, connectionStrategy);<NEW_LINE>final String compressionMethod = pars != null ? (String) pars.get(OGlobalConfiguration.STORAGE_COMPRESSION_METHOD.getKey()) : null;<NEW_LINE>if (compressionMethod != null)<NEW_LINE>// SAVE COMPRESSION METHOD IN CONFIGURATION<NEW_LINE>builder.addConfig(OGlobalConfiguration.STORAGE_COMPRESSION_METHOD, compressionMethod);<NEW_LINE>final String encryptionMethod = pars != null ? (String) pars.get(OGlobalConfiguration.STORAGE_ENCRYPTION_METHOD.getKey()) : null;<NEW_LINE>if (encryptionMethod != null)<NEW_LINE>// SAVE ENCRYPTION METHOD IN CONFIGURATION<NEW_LINE>builder.addConfig(OGlobalConfiguration.STORAGE_ENCRYPTION_METHOD, encryptionMethod);<NEW_LINE>final String encryptionKey = pars != null ? (String) pars.get(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY.getKey()) : null;<NEW_LINE>if (encryptionKey != null)<NEW_LINE>// SAVE ENCRYPTION KEY IN CONFIGURATION<NEW_LINE>builder.addConfig(OGlobalConfiguration.STORAGE_ENCRYPTION_KEY, encryptionKey);<NEW_LINE>for (Map.Entry<ATTRIBUTES, Object> attr : preopenAttributes.entrySet()) {<NEW_LINE>builder.addAttribute(attr.getKey(), attr.getValue());<NEW_LINE>}<NEW_LINE>builder.addConfig(OGlobalConfiguration.CREATE_DEFAULT_USERS, true);<NEW_LINE>for (ODatabaseListener oDatabaseListener : preopenListener) {<NEW_LINE>builder.addListener(oDatabaseListener);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
CLIENT_CONNECTION_STRATEGY.getKey()) : null;
175,236
private ResponseSpec logoutUserRequestCreation() throws WebClientResponseException {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> pathParams = new HashMap<String, Object>();<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE><MASK><NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/user/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
final String[] localVarAccepts = {};
1,430,988
public void deletePet(Long petId, String apiKey) throws TimeoutException, ExecutionException, InterruptedException, ApiException {<NEW_LINE>Object postBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling deletePet", new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"));<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>headerParams.put("api_key", ApiInvoker.parameterToString(apiKey));<NEW_LINE>String[] contentTypes = {};<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE><MASK><NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] { "petstore_auth" };<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>if (ex.getCause() instanceof VolleyError) {<NEW_LINE>VolleyError volleyError = (VolleyError) ex.getCause();<NEW_LINE>if (volleyError.networkResponse != null) {<NEW_LINE>throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}
HttpEntity httpEntity = localVarBuilder.build();
1,316,696
private static void populateDetails(FhirContext theCtx, IBase theIssue, String theSeverity, String theDetails, String theLocation, String theCode) {<NEW_LINE>BaseRuntimeElementCompositeDefinition<?> issueElement = (BaseRuntimeElementCompositeDefinition<?>) theCtx.<MASK><NEW_LINE>BaseRuntimeChildDefinition detailsChild;<NEW_LINE>detailsChild = issueElement.getChildByName("diagnostics");<NEW_LINE>BaseRuntimeChildDefinition codeChild = issueElement.getChildByName("code");<NEW_LINE>IPrimitiveType<?> codeElem = (IPrimitiveType<?>) codeChild.getChildByName("code").newInstance(codeChild.getInstanceConstructorArguments());<NEW_LINE>codeElem.setValueAsString(theCode);<NEW_LINE>codeChild.getMutator().addValue(theIssue, codeElem);<NEW_LINE>BaseRuntimeElementDefinition<?> stringDef = detailsChild.getChildByName(detailsChild.getElementName());<NEW_LINE>BaseRuntimeChildDefinition severityChild = issueElement.getChildByName("severity");<NEW_LINE>IPrimitiveType<?> severityElem = (IPrimitiveType<?>) severityChild.getChildByName("severity").newInstance(severityChild.getInstanceConstructorArguments());<NEW_LINE>severityElem.setValueAsString(theSeverity);<NEW_LINE>severityChild.getMutator().addValue(theIssue, severityElem);<NEW_LINE>IPrimitiveType<?> string = (IPrimitiveType<?>) stringDef.newInstance();<NEW_LINE>string.setValueAsString(theDetails);<NEW_LINE>detailsChild.getMutator().setValue(theIssue, string);<NEW_LINE>addLocationToIssue(theCtx, theIssue, theLocation);<NEW_LINE>}
getElementDefinition(theIssue.getClass());
192,267
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>contentView = View.inflate(getContext(), <MASK><NEW_LINE>itemsLayout = contentView.findViewById(R.id.items_layout);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>chatId = savedInstanceState.getLong(CHAT_ID, INVALID_HANDLE);<NEW_LINE>messageId = savedInstanceState.getLong(MESSAGE_ID, INVALID_HANDLE);<NEW_LINE>email = savedInstanceState.getString(EMAIL);<NEW_LINE>MegaChatMessage messageMega = megaChatApi.getMessage(chatId, messageId);<NEW_LINE>if (messageMega != null) {<NEW_LINE>message = new AndroidMegaChatMessage(messageMega);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chatId = ((ContactAttachmentActivity) requireActivity()).chatId;<NEW_LINE>messageId = ((ContactAttachmentActivity) requireActivity()).messageId;<NEW_LINE>email = ((ContactAttachmentActivity) requireActivity()).selectedEmail;<NEW_LINE>}<NEW_LINE>MegaChatMessage messageMega = megaChatApi.getMessage(chatId, messageId);<NEW_LINE>if (messageMega != null) {<NEW_LINE>message = new AndroidMegaChatMessage(messageMega);<NEW_LINE>}<NEW_LINE>logDebug("Chat ID: " + chatId + ", Message ID: " + messageId);<NEW_LINE>chatC = new ChatController(requireActivity());<NEW_LINE>return contentView;<NEW_LINE>}
R.layout.bottom_sheet_contact_attachment_item, null);
752,491
public void register(long uoid, SInternalServicePluginConfiguration internalService, final PluginConfiguration pluginConfiguration) {<NEW_LINE>name = internalService.getName();<NEW_LINE>ServiceDescriptor serviceDescriptor = StoreFactory.eINSTANCE.createServiceDescriptor();<NEW_LINE>serviceDescriptor.setProviderName("BIMserver");<NEW_LINE>serviceDescriptor.setIdentifier("" + internalService.getOid());<NEW_LINE>serviceDescriptor.<MASK><NEW_LINE>serviceDescriptor.setDescription(internalService.getDescription());<NEW_LINE>serviceDescriptor.setNotificationProtocol(AccessMethod.INTERNAL);<NEW_LINE>serviceDescriptor.setTrigger(Trigger.NEW_REVISION);<NEW_LINE>addRequiredRights(serviceDescriptor);<NEW_LINE>serviceDescriptor.setReadRevision(true);<NEW_LINE>registerNewRevisionHandler(uoid, serviceDescriptor, new NewRevisionHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void newRevision(BimServerClientInterface bimServerClientInterface, long poid, long roid, String userToken, long soid, SObjectType settings) throws ServerException, UserException {<NEW_LINE>try {<NEW_LINE>Long topicId = bimServerClientInterface.getRegistry().registerProgressOnRevisionTopic(SProgressTopicType.RUNNING_SERVICE, poid, roid, "Running " + name);<NEW_LINE>RunningService runningService = new RunningService(topicId, bimServerClientInterface, pluginConfiguration, bimServerClientInterface.getAuthInterface().getLoggedInUser().getUsername());<NEW_LINE>try {<NEW_LINE>SLongActionState state = new SLongActionState();<NEW_LINE>state.setProgress(getProgressType() == ProgressType.KNOWN ? 0 : -1);<NEW_LINE>state.setTitle(name);<NEW_LINE>state.setState(SActionState.STARTED);<NEW_LINE>state.setStart(runningService.getStartDate());<NEW_LINE>bimServerClientInterface.getRegistry().updateProgressTopic(topicId, state);<NEW_LINE>AbstractService.this.newRevision(runningService, bimServerClientInterface, poid, roid, userToken, soid, settings);<NEW_LINE>state = new SLongActionState();<NEW_LINE>state.setProgress(100);<NEW_LINE>state.setTitle(name);<NEW_LINE>state.setState(SActionState.FINISHED);<NEW_LINE>state.setStart(runningService.getStartDate());<NEW_LINE>state.setEnd(new Date());<NEW_LINE>bimServerClientInterface.getRegistry().updateProgressTopic(topicId, state);<NEW_LINE>} catch (BimServerClientException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} finally {<NEW_LINE>bimServerClientInterface.getRegistry().unregisterProgressTopic(topicId);<NEW_LINE>}<NEW_LINE>} catch (PublicInterfaceNotFoundException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setName(internalService.getName());
621,325
public List<ConfigObjectProperty> createProperties(Object instance, String prefix, Map<String, Object> parameters) {<NEW_LINE>List<ConfigObjectProperty> properties = new ArrayList<>();<NEW_LINE>JavaType javaType = TypeFactory.defaultInstance().constructType(instance.getClass());<NEW_LINE>BeanDescription beanDescription = JsonUtils.OBJ_MAPPER.getSerializationConfig().introspect(javaType);<NEW_LINE>for (BeanPropertyDefinition propertyDefinition : beanDescription.findProperties()) {<NEW_LINE>if (propertyDefinition.getField() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (propertyDefinition.getSetter() == null && !propertyDefinition.getField().isPublic()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Setter<Object, Object> setter = createObjectSetter(propertyDefinition);<NEW_LINE>PriorityProperty<?> priorityProperty = createPriorityProperty(propertyDefinition.getField().<MASK><NEW_LINE>setter.set(instance, priorityProperty.getValue());<NEW_LINE>properties.add(new ConfigObjectProperty(setter, priorityProperty));<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>}
getAnnotated(), prefix, parameters);
193,317
public void fullRedraw() {<NEW_LINE>makeLayerElement();<NEW_LINE>// addCSSClasses();<NEW_LINE>SilhouettePlot silhouettesplot = silhouette.getSilhouettePlot(context);<NEW_LINE>String ploturi = silhouettesplot.getSVGPlotURI();<NEW_LINE>Element itag = svgp.svgElement(SVGConstants.SVG_IMAGE_TAG);<NEW_LINE>SVGUtil.setAtt(itag, SVGConstants.SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, SVGConstants.SVG_NONE_VALUE);<NEW_LINE>SVGUtil.setAtt(itag, SVGConstants.SVG_IMAGE_RENDERING_ATTRIBUTE, SVGConstants.SVG_OPTIMIZE_SPEED_VALUE);<NEW_LINE>SVGUtil.setAtt(itag, SVGConstants.SVG_X_ATTRIBUTE, 0);<NEW_LINE>SVGUtil.setAtt(itag, SVGConstants.SVG_Y_ATTRIBUTE, 0);<NEW_LINE>SVGUtil.setAtt(itag, SVGConstants.SVG_WIDTH_ATTRIBUTE, plotwidth);<NEW_LINE>SVGUtil.setAtt(itag, SVGConstants.SVG_HEIGHT_ATTRIBUTE, plotheight);<NEW_LINE>itag.setAttributeNS(SVGConstants.XLINK_NAMESPACE_URI, SVGConstants.XLINK_HREF_QNAME, ploturi);<NEW_LINE>layer.appendChild(itag);<NEW_LINE>LinearScale scale = silhouettesplot.getScale();<NEW_LINE>double y1 = plotheight * silhouettesplot.scaleToPixel(scale.getMin()) / silhouettesplot.getHeight();<NEW_LINE>double y2 = plotheight * silhouettesplot.scaleToPixel(scale.getMax(<MASK><NEW_LINE>double y3 = plotheight * silhouettesplot.scaleToPixel(0) / (silhouettesplot.getHeight() - 1);<NEW_LINE>// -1 because in testing the line was a bit off in the thumbnail.<NEW_LINE>try {<NEW_LINE>final StyleLibrary style = context.getStyleLibrary();<NEW_LINE>SVGSimpleLinearAxis.drawAxis(svgp, layer, scale, 0, y1, 0, y2, SVGSimpleLinearAxis.LabelStyle.LEFTHAND, style);<NEW_LINE>SVGSimpleLinearAxis.drawAxis(svgp, layer, scale, plotwidth, y1, plotwidth, y2, SVGSimpleLinearAxis.LabelStyle.RIGHTHAND, style);<NEW_LINE>SVGSimpleLinearAxis.drawAxis(svgp, layer, scale, 0, y3, plotwidth, y3, SVGSimpleLinearAxis.LabelStyle.NOTHING, style);<NEW_LINE>} catch (CSSNamingConflict e) {<NEW_LINE>LoggingUtil.exception("CSS naming conflict for axes on Silhouette plot", e);<NEW_LINE>}<NEW_LINE>}
)) / silhouettesplot.getHeight();
73,170
public void processPayload(FrameReadProcessor frp) throws FrameSizeException {<NEW_LINE>// +---------------+<NEW_LINE>// |Pad Length? (8)| (only present if third flag bit is set)<NEW_LINE>// +---------------+-----------------------------------------------+<NEW_LINE>// |R| Promised Stream ID (31) |<NEW_LINE>// +-+-----------------------------+-------------------------------+<NEW_LINE>// | Header Block Fragment (*) ...<NEW_LINE>// +---------------------------------------------------------------+<NEW_LINE>// | Padding (*) ...<NEW_LINE>// +---------------------------------------------------------------+<NEW_LINE>setFlags();<NEW_LINE>int payloadIndex = 0;<NEW_LINE>int paddingLength = 0;<NEW_LINE>if (PADDED_FLAG) {<NEW_LINE>// The padded field is present; set the paddedLength to represent the actual size of the data we want<NEW_LINE>paddingLength = frp.grabNextByte();<NEW_LINE>payloadIndex++;<NEW_LINE>}<NEW_LINE>// grab the reserved bit<NEW_LINE>byte nextPayloadByte = frp.grabNextByte();<NEW_LINE>payloadIndex++;<NEW_LINE>reservedBit = utils.getReservedBit(nextPayloadByte);<NEW_LINE>// grab the promised stream ID<NEW_LINE>nextPayloadByte = (byte<MASK><NEW_LINE>promisedStreamID = frp.grabNext24BitInt(nextPayloadByte);<NEW_LINE>payloadIndex += 3;<NEW_LINE>// grab the header block fragment<NEW_LINE>int headerBlockLength = payloadLength - payloadIndex - paddingLength;<NEW_LINE>headerBlockFragment = new byte[headerBlockLength];<NEW_LINE>for (int i = 0; payloadIndex++ < payloadLength - paddingLength; ) headerBlockFragment[i++] = frp.grabNextByte();<NEW_LINE>// consume any padding for this frame<NEW_LINE>if (PADDED_FLAG) {<NEW_LINE>for (; payloadIndex++ < payloadLength; ) {<NEW_LINE>frp.grabNextByte();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) (nextPayloadByte & Constants.MASK_7F);
1,835,126
public void doCap(InvokeChainContext context) {<NEW_LINE>String storeKey = (String) context.get(InvokeChainConstants.CLIENT_SPAN_THREADLOCAL_STOREKEY);<NEW_LINE>// in the same thread<NEW_LINE>Span span = this.spanFactory.getRemoveSpanFromContext(storeKey);<NEW_LINE>if (span == null) {<NEW_LINE>// in async thread<NEW_LINE>span = (Span) context.get(InvokeChainConstants.PARAM_SPAN_KEY);<NEW_LINE>}<NEW_LINE>if (span == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>context.put(InvokeChainConstants.PARAM_SPAN_KEY, span);<NEW_LINE>String appid = (String) context.get(CaptureConstants.INFO_CLIENT_APPID);<NEW_LINE>if (appid == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>span.end();<NEW_LINE>span.setAppid(appid);<NEW_LINE>String responseState = (String) context.get(CaptureConstants.INFO_CLIENT_RESPONSESTATE);<NEW_LINE>span.setState(context.get(CaptureConstants.INFO_CLIENT_RESPONSECODE<MASK><NEW_LINE>DataLogger invokeChainLogger = this.getAppInvokeChainLogger(appid);<NEW_LINE>String spanLog = span.toString();<NEW_LINE>invokeChainLogger.logData(spanLog);<NEW_LINE>if (logger.isDebugable()) {<NEW_LINE>logger.debug("doCap:span=" + spanLog, null);<NEW_LINE>}<NEW_LINE>}
).toString(), responseState);
511,490
public List<String> batchSendMail(final List<Email> emailList) {<NEW_LINE>List<String> rtnList = new ArrayList<String>();<NEW_LINE>ExecutorService executor = Executors.newFixedThreadPool(DEFAULT_POOL_SIZE);<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(emailList.size());<NEW_LINE>List<Future<String>> resultList = new ArrayList<Future<String>>();<NEW_LINE>for (int i = 0; i < emailList.size(); i++) {<NEW_LINE>Future<String> f = executor.submit(new SendTask(countDownLatch, emailList.get(i)));<NEW_LINE>resultList.add(f);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>countDownLatch.await();<NEW_LINE>for (Future<String> f : resultList) {<NEW_LINE>rtnList.add(f.get());<NEW_LINE>}<NEW_LINE>executor.shutdown();<NEW_LINE>executor.awaitTermination(SHUTDOWN_WAIT_SECONDS, TimeUnit.SECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>if (!executor.isTerminated()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>executor.shutdownNow();<NEW_LINE>System.out.println("shutdown finished");<NEW_LINE>}<NEW_LINE>return rtnList;<NEW_LINE>}
System.err.println("cancel non-finished tasks");
726,202
// Starts bitcoind and bisq apps (seednode, arbnode, etc...)<NEW_LINE>private void startBackgroundProcesses(ExecutorService executor, CountDownLatch countdownLatch) throws InterruptedException, IOException {<NEW_LINE>log.info("Starting supporting apps {}", config.supportingApps.toString());<NEW_LINE>if (config.hasSupportingApp(bitcoind.name())) {<NEW_LINE>BitcoinDaemon bitcoinDaemon = new BitcoinDaemon(config);<NEW_LINE>bitcoinDaemon.verifyBitcoinPathsExist(true);<NEW_LINE>bitcoindTask = new SetupTask(bitcoinDaemon, countdownLatch);<NEW_LINE><MASK><NEW_LINE>MILLISECONDS.sleep(config.bisqAppInitTime);<NEW_LINE>LinuxProcess bitcoindProcess = bitcoindTask.getLinuxProcess();<NEW_LINE>if (bitcoindProcess.hasStartupExceptions()) {<NEW_LINE>bitcoindProcess.logExceptions(bitcoindProcess.getStartupExceptions(), log);<NEW_LINE>throw new IllegalStateException(bitcoindProcess.getStartupExceptions().get(0));<NEW_LINE>}<NEW_LINE>bitcoinDaemon.verifyBitcoindRunning();<NEW_LINE>}<NEW_LINE>// Start Bisq apps defined by the supportingApps option, in the in proper order.<NEW_LINE>if (config.hasSupportingApp(seednode.name()))<NEW_LINE>startBisqApp(seednode, executor, countdownLatch);<NEW_LINE>if (config.hasSupportingApp(arbdaemon.name()))<NEW_LINE>startBisqApp(arbdaemon, executor, countdownLatch);<NEW_LINE>else if (config.hasSupportingApp(arbdesktop.name()))<NEW_LINE>startBisqApp(arbdesktop, executor, countdownLatch);<NEW_LINE>if (config.hasSupportingApp(alicedaemon.name()))<NEW_LINE>startBisqApp(alicedaemon, executor, countdownLatch);<NEW_LINE>else if (config.hasSupportingApp(alicedesktop.name()))<NEW_LINE>startBisqApp(alicedesktop, executor, countdownLatch);<NEW_LINE>if (config.hasSupportingApp(bobdaemon.name()))<NEW_LINE>startBisqApp(bobdaemon, executor, countdownLatch);<NEW_LINE>else if (config.hasSupportingApp(bobdesktop.name()))<NEW_LINE>startBisqApp(bobdesktop, executor, countdownLatch);<NEW_LINE>}
bitcoindTaskFuture = executor.submit(bitcoindTask);
1,251,015
public static DBTTaskRunStatus makeStatisticsStatus(DBCStatistics statistics) {<NEW_LINE>DBTTaskRunStatus taskResultStatus = new DBTTaskRunStatus();<NEW_LINE>if (statistics.getRowsFetched() > 0 || statistics.getRowsUpdated() > 0 || statistics.getStatementsCount() > 0) {<NEW_LINE>StringJoiner joiner = new StringJoiner(", ");<NEW_LINE>if (statistics.getRowsFetched() > 0) {<NEW_LINE>joiner.add(NLS.bind(ModelMessages.task_rows_fetched_message_part<MASK><NEW_LINE>}<NEW_LINE>if (statistics.getRowsUpdated() > 0) {<NEW_LINE>joiner.add(NLS.bind(ModelMessages.task_rows_modified_message_part, statistics.getRowsUpdated()));<NEW_LINE>}<NEW_LINE>if (statistics.getStatementsCount() > 0) {<NEW_LINE>joiner.add(NLS.bind(ModelMessages.task_statements_executed_message_part, statistics.getStatementsCount()));<NEW_LINE>}<NEW_LINE>taskResultStatus.setResultMessage(joiner.toString());<NEW_LINE>}<NEW_LINE>return taskResultStatus;<NEW_LINE>}
, statistics.getRowsFetched()));
406,636
public static String doHttpPut(final String url, final String requestBody) throws Exception {<NEW_LINE>try {<NEW_LINE>HttpClient client = HttpClientBuilder.create().build();<NEW_LINE>HttpPut httpPut = new HttpPut(url);<NEW_LINE>httpPut.setHeader(CONTENT_TYPE, APPLICATION_JSON);<NEW_LINE>StringEntity jsonEntity = null;<NEW_LINE>if (requestBody != null) {<NEW_LINE>jsonEntity = new StringEntity(requestBody);<NEW_LINE>}<NEW_LINE>httpPut.setEntity(jsonEntity);<NEW_LINE>HttpResponse <MASK><NEW_LINE>if (httpresponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {<NEW_LINE>return EntityUtils.toString(httpresponse.getEntity());<NEW_LINE>} else {<NEW_LINE>if (AuthManager.getToken() != null) {<NEW_LINE>String accessToken = AuthManager.getToken();<NEW_LINE>if (!Strings.isNullOrEmpty(accessToken)) {<NEW_LINE>httpPut.setHeader(PacmanSdkConstants.AUTH_HEADER, "Bearer " + accessToken);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>httpPut.setEntity(jsonEntity);<NEW_LINE>HttpResponse httpresponse1 = client.execute(httpPut);<NEW_LINE>if (httpresponse1.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {<NEW_LINE>return EntityUtils.toString(httpresponse1.getEntity());<NEW_LINE>} else {<NEW_LINE>throw new Exception("unable to execute put request caused by" + EntityUtils.toString(httpresponse1.getEntity()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ParseException parseException) {<NEW_LINE>LOGGER.error("ParseException in getHttpPut :" + parseException.getMessage());<NEW_LINE>} catch (IOException ioException) {<NEW_LINE>LOGGER.error("IOException in getHttpPut :" + ioException.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
httpresponse = client.execute(httpPut);
382,239
public static Application read(final int marker, final String identifier, final DataInput data, final int length) throws IOException {<NEW_LINE>switch(marker) {<NEW_LINE>case JPEG.APP0:<NEW_LINE>// JFIF<NEW_LINE>if ("JFIF".equals(identifier)) {<NEW_LINE>return JFIF.read(data, length);<NEW_LINE>}<NEW_LINE>case JPEG.APP1:<NEW_LINE>// JFXX<NEW_LINE>if ("JFXX".equals(identifier)) {<NEW_LINE>return JFXX.read(data, length);<NEW_LINE>}<NEW_LINE>if ("Exif".equals(identifier)) {<NEW_LINE>return EXIF.read(data, length);<NEW_LINE>}<NEW_LINE>case JPEG.APP2:<NEW_LINE>// ICC_PROFILE<NEW_LINE>if ("ICC_PROFILE".equals(identifier)) {<NEW_LINE>return ICCProfile.read(data, length);<NEW_LINE>}<NEW_LINE>case JPEG.APP14:<NEW_LINE>// Adobe<NEW_LINE>if ("Adobe".equals(identifier)) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>default:<NEW_LINE>// Generic APPn segment<NEW_LINE>byte[] bytes = new byte[Math.max(0, length - 2)];<NEW_LINE>data.readFully(bytes);<NEW_LINE>return new Application(marker, identifier, bytes);<NEW_LINE>}<NEW_LINE>}
AdobeDCT.read(data, length);
1,380,451
public void onClick(View v) {<NEW_LINE>Activity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>Context themedContext = UiUtilities.getThemedContext(activity, nightMode);<NEW_LINE>AlertDialog.Builder b <MASK><NEW_LINE>b.setTitle(R.string.favorite_category_name);<NEW_LINE>final EditText nameEditText = new EditText(themedContext);<NEW_LINE>nameEditText.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));<NEW_LINE>nameEditText.setText(group.getName());<NEW_LINE>LinearLayout container = new LinearLayout(themedContext);<NEW_LINE>int sidePadding = AndroidUtils.dpToPx(activity, 24f);<NEW_LINE>int topPadding = AndroidUtils.dpToPx(activity, 4f);<NEW_LINE>container.setPadding(sidePadding, topPadding, sidePadding, topPadding);<NEW_LINE>container.addView(nameEditText);<NEW_LINE>b.setView(container);<NEW_LINE>b.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>b.setPositiveButton(R.string.shared_string_save, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>String name = nameEditText.getText().toString();<NEW_LINE>boolean nameChanged = !Algorithms.objectEquals(group.getName(), name);<NEW_LINE>if (nameChanged) {<NEW_LINE>app.getFavoritesHelper().editFavouriteGroup(group, name, group.getColor(), group.isVisible());<NEW_LINE>updateParentFragment();<NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>b.show();<NEW_LINE>}<NEW_LINE>}
= new AlertDialog.Builder(themedContext);
1,561,799
public ClusterDescriptor createClusterDescriptor(String yarnConfDir, Configuration flinkConfig) {<NEW_LINE>if (StringUtils.isNotBlank(yarnConfDir)) {<NEW_LINE>try {<NEW_LINE>flinkConfig.setString(ConfigConstants.PATH_HADOOP_CONFIG, yarnConfDir);<NEW_LINE>FileSystem.initialize(flinkConfig, null);<NEW_LINE>SecurityUtils.install(new SecurityConfiguration(flinkConfig));<NEW_LINE>YarnConfiguration yarnConf = getYarnConf(yarnConfDir);<NEW_LINE><MASK><NEW_LINE>yarnClient.init(yarnConf);<NEW_LINE>yarnClient.start();<NEW_LINE>YarnClusterDescriptor clusterDescriptor = new YarnClusterDescriptor(flinkConfig, yarnConf, yarnClient, YarnClientYarnClusterInformationRetriever.create(yarnClient), false);<NEW_LINE>return clusterDescriptor;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("yarn mode must set param of 'yarnconf'!!!");<NEW_LINE>}<NEW_LINE>}
YarnClient yarnClient = YarnClient.createYarnClient();
1,343,676
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see<NEW_LINE>* com.amazonaws.services.s3.AmazonS3#deleteObjects(com.amazonaws.services<NEW_LINE>* .s3.model.DeleteObjectsRequest)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest) {<NEW_LINE>final Request<DeleteObjectsRequest> request = createRequest(deleteObjectsRequest.getBucketName(), null, deleteObjectsRequest, HttpMethodName.POST);<NEW_LINE>request.addParameter("delete", null);<NEW_LINE>if (deleteObjectsRequest.getMfa() != null) {<NEW_LINE>populateRequestWithMfaDetails(request, deleteObjectsRequest.getMfa());<NEW_LINE>}<NEW_LINE>populateRequesterPaysHeader(request, deleteObjectsRequest.isRequesterPays());<NEW_LINE>final byte[] content = new MultiObjectDeleteXmlFactory().convertToXmlByteArray(deleteObjectsRequest);<NEW_LINE>request.addHeader("Content-Length", String.valueOf(content.length));<NEW_LINE>request.addHeader("Content-Type", "application/xml");<NEW_LINE>request.setContent(new ByteArrayInputStream(content));<NEW_LINE>try {<NEW_LINE>final byte[] md5 = Md5Utils.computeMD5Hash(content);<NEW_LINE>final String md5Base64 = BinaryUtils.toBase64(md5);<NEW_LINE>request.addHeader("Content-MD5", md5Base64);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new AmazonClientException("Couldn't compute md5 sum", e);<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final ResponseHeaderHandlerChain<DeleteObjectsResponse> responseHandler = new ResponseHeaderHandlerChain<DeleteObjectsResponse>(new Unmarshallers.DeleteObjectsResultUnmarshaller(), <MASK><NEW_LINE>final DeleteObjectsResponse response = invoke(request, responseHandler, deleteObjectsRequest.getBucketName(), null);<NEW_LINE>if (!response.getErrors().isEmpty()) {<NEW_LINE>final Map<String, String> headers = responseHandler.getResponseHeaders();<NEW_LINE>final MultiObjectDeleteException ex = new MultiObjectDeleteException(response.getErrors(), response.getDeletedObjects());<NEW_LINE>ex.setStatusCode(200);<NEW_LINE>ex.setRequestId(headers.get(Headers.REQUEST_ID));<NEW_LINE>ex.setExtendedRequestId(headers.get(Headers.EXTENDED_REQUEST_ID));<NEW_LINE>ex.setCloudFrontId(headers.get(Headers.CLOUD_FRONT_ID));<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>final DeleteObjectsResult result = new DeleteObjectsResult(response.getDeletedObjects(), response.isRequesterCharged());<NEW_LINE>return result;<NEW_LINE>}
new S3RequesterChargedHeaderHandler<DeleteObjectsResponse>());
860,440
private synchronized void showcasemenu(int option) {<NEW_LINE>if ((myShowcase != null) && (myShowcase.isShowing()))<NEW_LINE>return;<NEW_LINE>if (ShotStateStore.hasShot(option))<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>ProfileViewTarget target = null;<NEW_LINE>String title = "";<NEW_LINE>String message = "";<NEW_LINE>switch(option) {<NEW_LINE>case SHOWCASE_PROFILE_SPLIT:<NEW_LINE>target = new ProfileViewTarget(R.id.profile_recycler_view, this, 40, 40);<NEW_LINE>title = getString(R.string.long_press_to_split_or_delete);<NEW_LINE>message = getString(R.string.press_and_hold_on_the_background_to_split_or_delete);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (target != null) {<NEW_LINE>myShowcase = new ShowcaseView.Builder(this).setTarget(target).setStyle(R.style.CustomShowcaseTheme2).setContentTitle(title).setContentText("\n" + message).setShowcaseDrawer(new JamorhamShowcaseDrawer(getResources(), getTheme(), 90, 14)).singleShot(oneshot ? option : -1).build();<NEW_LINE><MASK><NEW_LINE>myShowcase.show();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, "Exception in showcase: " + e.toString());<NEW_LINE>}<NEW_LINE>}
myShowcase.setBackgroundColor(Color.TRANSPARENT);
1,226,832
public void onResponse(IndexMetadata indexMetaDataToImport) {<NEW_LINE>// This flag is checked at this point so that we always check that the supplied index UUID<NEW_LINE>// does correspond to a dangling index.<NEW_LINE>if (importRequest.isAcceptDataLoss() == false) {<NEW_LINE>importListener.onFailure(new IllegalArgumentException("accept_data_loss must be set to true"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String indexName = indexMetaDataToImport.getIndex().getName();<NEW_LINE>String indexUUID = indexMetaDataToImport.getIndexUUID();<NEW_LINE>danglingIndexAllocator.allocateDangled(List.of(indexMetaDataToImport), new ActionListener<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(LocalAllocateDangledIndices.AllocateDangledResponse allocateDangledResponse) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>logger.debug("Failed to import dangling index [" + indexName + "] [" + indexUUID + "]", e);<NEW_LINE>importListener.onFailure(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
importListener.onResponse(AcknowledgedResponse.TRUE);
1,704,828
public static ChunkMetadata deserializeFrom(ByteBuffer buffer, TimeseriesMetadata timeseriesMetadata) {<NEW_LINE>ChunkMetadata chunkMetaData = new ChunkMetadata();<NEW_LINE>chunkMetaData.measurementUid = timeseriesMetadata.getMeasurementId();<NEW_LINE>chunkMetaData.tsDataType = timeseriesMetadata.getTSDataType();<NEW_LINE>chunkMetaData.offsetOfChunkHeader = ReadWriteIOUtils.readLong(buffer);<NEW_LINE>// if the TimeSeriesMetadataType is not 0, it means it has more than one chunk<NEW_LINE>// and each chunk's metadata has its own statistics<NEW_LINE>if ((timeseriesMetadata.getTimeSeriesMetadataType() & 0x3F) != 0) {<NEW_LINE>chunkMetaData.statistics = Statistics.<MASK><NEW_LINE>} else {<NEW_LINE>// if the TimeSeriesMetadataType is 0, it means it has only one chunk<NEW_LINE>// and that chunk's metadata has no statistic<NEW_LINE>chunkMetaData.statistics = timeseriesMetadata.getStatistics();<NEW_LINE>}<NEW_LINE>return chunkMetaData;<NEW_LINE>}
deserialize(buffer, chunkMetaData.tsDataType);
538,923
private boolean bodyMatches(BodyMatcher bodyMatcher, MatchDifference context, HttpRequest request) {<NEW_LINE>boolean bodyMatches;<NEW_LINE>if (httpRequest.getBody().getOptional() != null && httpRequest.getBody().getOptional() && request.getBody() == null) {<NEW_LINE>bodyMatches = true;<NEW_LINE>} else if (bodyMatcher instanceof BinaryMatcher) {<NEW_LINE>bodyMatches = matches(BODY, context, bodyMatcher, request.getBodyAsRawBytes());<NEW_LINE>} else {<NEW_LINE>if (bodyMatcher instanceof ExactStringMatcher || bodyMatcher instanceof SubStringMatcher || bodyMatcher instanceof RegexStringMatcher) {<NEW_LINE>// string body matcher<NEW_LINE>bodyMatches = matches(BODY, context, bodyMatcher, string(request.getBodyAsString()));<NEW_LINE>} else if (bodyMatcher instanceof XmlStringMatcher || bodyMatcher instanceof XmlSchemaMatcher) {<NEW_LINE>// xml body matcher<NEW_LINE>bodyMatches = matches(BODY, context, bodyMatcher, request.getBodyAsString());<NEW_LINE>} else if (bodyMatcher instanceof JsonStringMatcher || bodyMatcher instanceof JsonSchemaMatcher || bodyMatcher instanceof JsonPathMatcher) {<NEW_LINE>// json body matcher<NEW_LINE>try {<NEW_LINE>bodyMatches = matches(BODY, context, bodyMatcher, jsonSchemaBodyParser.convertToJson(request, bodyMatcher));<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>if (context != null) {<NEW_LINE>context.addDifference(mockServerLogger, iae, iae.getMessage());<NEW_LINE>}<NEW_LINE>bodyMatches = matches(BODY, context, bodyMatcher, request.getBodyAsString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>bodyMatches = matches(BODY, context, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bodyMatches;<NEW_LINE>}
bodyMatcher, request.getBodyAsString());
593,891
protected void configurePegasusSchemaSnapshotGeneration(Project project, SourceSet sourceSet, boolean isExtensionSchema) {<NEW_LINE>File schemaDir = isExtensionSchema ? project.file(getExtensionSchemaPath(project, sourceSet)) : project.file<MASK><NEW_LINE>if ((isExtensionSchema && SharedFileUtils.getSuffixedFiles(project, schemaDir, PDL_FILE_SUFFIX).isEmpty()) || (!isExtensionSchema && SharedFileUtils.getSuffixedFiles(project, schemaDir, DATA_TEMPLATE_FILE_SUFFIXES).isEmpty())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Path publishablePegasusSchemaSnapshotDir = project.getBuildDir().toPath().resolve(sourceSet.getName() + (isExtensionSchema ? PEGASUS_EXTENSION_SCHEMA_SNAPSHOT : PEGASUS_SCHEMA_SNAPSHOT));<NEW_LINE>Task generatePegasusSchemaSnapshot = generatePegasusSchemaSnapshot(project, sourceSet, isExtensionSchema ? PEGASUS_EXTENSION_SCHEMA_SNAPSHOT : PEGASUS_SCHEMA_SNAPSHOT, schemaDir, publishablePegasusSchemaSnapshotDir.toFile(), isExtensionSchema);<NEW_LINE>File pegasusSchemaSnapshotDir = project.file(isExtensionSchema ? getPegasusExtensionSchemaSnapshotPath(project, sourceSet) : getPegasusSchemaSnapshotPath(project, sourceSet));<NEW_LINE>pegasusSchemaSnapshotDir.mkdirs();<NEW_LINE>Task checkSchemaSnapshot = project.getTasks().create(sourceSet.getTaskName("check", isExtensionSchema ? PEGASUS_EXTENSION_SCHEMA_SNAPSHOT : PEGASUS_SCHEMA_SNAPSHOT), CheckPegasusSnapshotTask.class, task -> {<NEW_LINE>task.dependsOn(generatePegasusSchemaSnapshot);<NEW_LINE>task.setCurrentSnapshotDirectory(publishablePegasusSchemaSnapshotDir.toFile());<NEW_LINE>task.setPreviousSnapshotDirectory(pegasusSchemaSnapshotDir);<NEW_LINE>task.setCodegenClasspath(project.getConfigurations().getByName(PEGASUS_PLUGIN_CONFIGURATION).plus(project.getConfigurations().getByName(SCHEMA_ANNOTATION_HANDLER_CONFIGURATION)).plus(project.getConfigurations().getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)));<NEW_LINE>task.setCompatibilityLevel(isExtensionSchema ? PropertyUtil.findCompatLevel(project, FileCompatibilityType.PEGASUS_EXTENSION_SCHEMA_SNAPSHOT) : PropertyUtil.findCompatLevel(project, FileCompatibilityType.PEGASUS_SCHEMA_SNAPSHOT));<NEW_LINE>task.setCompatibilityMode(isExtensionSchema ? COMPATIBILITY_OPTIONS_MODE_EXTENSION : PropertyUtil.findCompatMode(project, PEGASUS_COMPATIBILITY_MODE));<NEW_LINE>task.setExtensionSchema(isExtensionSchema);<NEW_LINE>task.setHandlerJarPath(project.getConfigurations().getByName(SCHEMA_ANNOTATION_HANDLER_CONFIGURATION));<NEW_LINE>task.onlyIf(t -> {<NEW_LINE>String pegasusSnapshotCompatPropertyName = isExtensionSchema ? findProperty(FileCompatibilityType.PEGASUS_EXTENSION_SCHEMA_SNAPSHOT) : findProperty(FileCompatibilityType.PEGASUS_SCHEMA_SNAPSHOT);<NEW_LINE>return !project.hasProperty(pegasusSnapshotCompatPropertyName) || !"off".equalsIgnoreCase((String) project.property(pegasusSnapshotCompatPropertyName));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>Task publishPegasusSchemaSnapshot = publishPegasusSchemaSnapshot(project, sourceSet, isExtensionSchema ? PEGASUS_EXTENSION_SCHEMA_SNAPSHOT : PEGASUS_SCHEMA_SNAPSHOT, checkSchemaSnapshot, publishablePegasusSchemaSnapshotDir.toFile(), pegasusSchemaSnapshotDir);<NEW_LINE>project.getTasks().getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME).dependsOn(publishPegasusSchemaSnapshot);<NEW_LINE>}
(getDataSchemaPath(project, sourceSet));
1,010,373
private JToggleButton createDspButton(String dspType) {<NEW_LINE>JToggleButton dspButton = new JToggleButton();<NEW_LINE>dspButton.setMaximumSize(new java.awt<MASK><NEW_LINE>dspButton.setMinimumSize(new java.awt.Dimension(48, 48));<NEW_LINE>dspButton.setPreferredSize(new java.awt.Dimension(48, 48));<NEW_LINE>dspButton.setName(dspType);<NEW_LINE>dspButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/fileextmismatch/options-icon.png")));<NEW_LINE>dspButton.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/checkbox32.png")));<NEW_LINE>dspButton.setFocusable(false);<NEW_LINE>if (dspType.equals(selectedDsp)) {<NEW_LINE>dspButton.setSelected(true);<NEW_LINE>} else {<NEW_LINE>dspButton.setSelected(false);<NEW_LINE>}<NEW_LINE>return dspButton;<NEW_LINE>}
.Dimension(48, 48));
1,406,521
void read(WizardDescriptor settings) {<NEW_LINE>this.wizardDescriptor = settings;<NEW_LINE>// NOI18N<NEW_LINE>File projectLocation = (File) settings.getProperty("projdir");<NEW_LINE>((FolderList) this.sourcePanel).setProjectFolder(projectLocation);<NEW_LINE>((FolderList) this.testsPanel).setProjectFolder(projectLocation);<NEW_LINE>// NOI18N<NEW_LINE>File[] srcRoot = (File[<MASK><NEW_LINE>// NOI18N<NEW_LINE>assert srcRoot != null : "sourceRoot property must be initialized!";<NEW_LINE>((FolderList) this.sourcePanel).setFiles(srcRoot);<NEW_LINE>// NOI18N<NEW_LINE>File[] testRoot = (File[]) settings.getProperty("testRoot");<NEW_LINE>// NOI18N<NEW_LINE>assert testRoot != null : "testRoot property must be initialized!";<NEW_LINE>((FolderList) this.testsPanel).setFiles(testRoot);<NEW_LINE>// #58489 honor existing source folder<NEW_LINE>File currentDirectory = null;<NEW_LINE>FileObject folder = Templates.getExistingSourcesFolder(wizardDescriptor);<NEW_LINE>if (folder != null) {<NEW_LINE>currentDirectory = FileUtil.toFile(folder);<NEW_LINE>}<NEW_LINE>if (currentDirectory != null && currentDirectory.isDirectory()) {<NEW_LINE>((FolderList) sourcePanel).setLastUsedDir(currentDirectory);<NEW_LINE>((FolderList) testsPanel).setLastUsedDir(currentDirectory);<NEW_LINE>}<NEW_LINE>}
]) settings.getProperty("sourceRoot");
1,685,618
public void actionPerformed(ActionEvent e) {<NEW_LINE>final var source = e.getSource();<NEW_LINE>if (source == editLayout) {<NEW_LINE>proj.setCurrentCircuit(circuit);<NEW_LINE>proj.getFrame().setEditorView(Frame.EDIT_LAYOUT);<NEW_LINE>} else if (source == editAppearance) {<NEW_LINE>proj.setCurrentCircuit(circuit);<NEW_LINE>proj.getFrame().setEditorView(Frame.EDIT_APPEARANCE);<NEW_LINE>} else if (source == analyze) {<NEW_LINE>ProjectCircuitActions.doAnalyze(proj, circuit);<NEW_LINE>} else if (source == stats) {<NEW_LINE>JFrame frame = (JFrame) SwingUtilities.getRoot(this);<NEW_LINE>StatisticsDialog.show(frame, proj.getLogisimFile(), circuit);<NEW_LINE>} else if (source == main) {<NEW_LINE><MASK><NEW_LINE>} else if (source == remove) {<NEW_LINE>ProjectCircuitActions.doRemoveCircuit(proj, circuit);<NEW_LINE>}<NEW_LINE>}
ProjectCircuitActions.doSetAsMainCircuit(proj, circuit);
752,091
public void register(StepListener listener) {<NEW_LINE>if (listener instanceof StepExecutionListener) {<NEW_LINE>this.stepListener.register((StepExecutionListener) listener);<NEW_LINE>}<NEW_LINE>if (listener instanceof ChunkListener) {<NEW_LINE>this.chunkListener.register((ChunkListener) listener);<NEW_LINE>}<NEW_LINE>if (listener instanceof ItemReadListener<?>) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>ItemReadListener<T> itemReadListener = (ItemReadListener<T>) listener;<NEW_LINE>this.itemReadListener.register(itemReadListener);<NEW_LINE>}<NEW_LINE>if (listener instanceof ItemProcessListener<?, ?>) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>ItemProcessListener<T, S> itemProcessListener = (ItemProcessListener<T, S>) listener;<NEW_LINE>this.itemProcessListener.register(itemProcessListener);<NEW_LINE>}<NEW_LINE>if (listener instanceof ItemWriteListener<?>) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>ItemWriteListener<S> itemWriteListener = (ItemWriteListener<S>) listener;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (listener instanceof SkipListener<?, ?>) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>SkipListener<T, S> skipListener = (SkipListener<T, S>) listener;<NEW_LINE>this.skipListener.register(skipListener);<NEW_LINE>}<NEW_LINE>}
this.itemWriteListener.register(itemWriteListener);
1,755,379
public static RestoreModelResponse unmarshall(RestoreModelResponse restoreModelResponse, UnmarshallerContext _ctx) {<NEW_LINE>restoreModelResponse.setRequestId(_ctx.stringValue("RestoreModelResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setAppId(_ctx.stringValue("RestoreModelResponse.Data.AppId"));<NEW_LINE>data.setContent(_ctx.mapValue("RestoreModelResponse.Data.Content"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("RestoreModelResponse.Data.CreateTime"));<NEW_LINE>data.setDescription(_ctx.stringValue("RestoreModelResponse.Data.Description"));<NEW_LINE>data.setId(_ctx.stringValue("RestoreModelResponse.Data.Id"));<NEW_LINE>data.setLinkModelId(_ctx.stringValue("RestoreModelResponse.Data.LinkModelId"));<NEW_LINE>data.setLinkModuleId(_ctx.stringValue("RestoreModelResponse.Data.LinkModuleId"));<NEW_LINE>data.setLinked(_ctx.booleanValue("RestoreModelResponse.Data.Linked"));<NEW_LINE>data.setModelId(_ctx.stringValue("RestoreModelResponse.Data.ModelId"));<NEW_LINE>data.setModifiedTime(_ctx.stringValue("RestoreModelResponse.Data.ModifiedTime"));<NEW_LINE>data.setModuleId(_ctx.stringValue("RestoreModelResponse.Data.ModuleId"));<NEW_LINE>data.setModelName(_ctx.stringValue("RestoreModelResponse.Data.ModelName"));<NEW_LINE>data.setProps(_ctx.mapValue("RestoreModelResponse.Data.Props"));<NEW_LINE>data.setRevision(_ctx.integerValue("RestoreModelResponse.Data.Revision"));<NEW_LINE>data.setSchemaVersion(_ctx.stringValue("RestoreModelResponse.Data.SchemaVersion"));<NEW_LINE>data.setModelStatus(_ctx.stringValue("RestoreModelResponse.Data.ModelStatus"));<NEW_LINE>data.setSubType(_ctx.stringValue("RestoreModelResponse.Data.SubType"));<NEW_LINE>data.setModelType<MASK><NEW_LINE>data.setVisibility(_ctx.stringValue("RestoreModelResponse.Data.Visibility"));<NEW_LINE>List<Map<Object, Object>> attributes = _ctx.listMapValue("RestoreModelResponse.Data.Attributes");<NEW_LINE>data.setAttributes(attributes);<NEW_LINE>restoreModelResponse.setData(data);<NEW_LINE>return restoreModelResponse;<NEW_LINE>}
(_ctx.stringValue("RestoreModelResponse.Data.ModelType"));
1,093,411
public boolean checkTrigger(GameEvent event, Game game) {<NEW_LINE>int damage = event.getAmount();<NEW_LINE>Player player1 = (Player) game.getState().getValue(this.getSourceId() + "_player1");<NEW_LINE>Player player2 = (Player) game.getState().getValue(this.getSourceId() + "_player2");<NEW_LINE>if (player1 == null || player2 == null || damage == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (event.getTargetId().equals(player1.getId())) {<NEW_LINE>this.getEffects().clear();<NEW_LINE>effect.setTargetPointer(new FixedTarget(player2.getId()));<NEW_LINE>this.addEffect(effect);<NEW_LINE>return true;<NEW_LINE>} else if (event.getTargetId().equals(player2.getId())) {<NEW_LINE>this.getEffects().clear();<NEW_LINE>effect.setTargetPointer(new FixedTarget(player1.getId()));<NEW_LINE>this.addEffect(effect);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Effect effect = new LoseLifeTargetEffect(damage);
1,623,646
private void criar_usuario_servidor(String url, String username, InetAddress ip) throws Exception {<NEW_LINE><MASK><NEW_LINE>HttpPost httppost = new HttpPost(url + "/api/users");<NEW_LINE>DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");<NEW_LINE>Date today = Calendar.getInstance().getTime();<NEW_LINE>String date = df.format(today);<NEW_LINE>// Request parameters and other properties.<NEW_LINE>List<BasicNameValuePair> params = new ArrayList<>(3);<NEW_LINE>params.add(new BasicNameValuePair("user", username));<NEW_LINE>params.add(new BasicNameValuePair("operational_system", System.getProperty("os.name")));<NEW_LINE>params.add(new BasicNameValuePair("is_online", "true"));<NEW_LINE>params.add(new BasicNameValuePair("portugol_version", PortugolStudio.getInstancia().getVersao()));<NEW_LINE>params.add(new BasicNameValuePair("last_use", "" + date));<NEW_LINE>params.add(new BasicNameValuePair("ip", ip.toString()));<NEW_LINE>httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));<NEW_LINE>// Execute and get the response.<NEW_LINE>HttpResponse response = httpclient.execute(httppost);<NEW_LINE>HttpEntity entity = response.getEntity();<NEW_LINE>if (entity != null) {<NEW_LINE>InputStream instream = entity.getContent();<NEW_LINE>try {<NEW_LINE>// do something useful<NEW_LINE>} finally {<NEW_LINE>instream.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String id = "undefined";<NEW_LINE>String data = getHTML(url + "/api/users/" + username);<NEW_LINE>String[] dados = data.split(",");<NEW_LINE>for (String dado : dados) {<NEW_LINE>String[] obj = dado.split(":");<NEW_LINE>if (obj[0].contains("_id")) {<NEW_LINE>String aid = obj[1].replaceAll("\"", "");<NEW_LINE>id = aid.replaceAll(" ", "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Configuracoes.getInstancia().setUserAnalyticsID(id);<NEW_LINE>}
HttpClient httpclient = HttpClients.createDefault();
1,707,091
final ListAvailableResourceMetricsResult executeListAvailableResourceMetrics(ListAvailableResourceMetricsRequest listAvailableResourceMetricsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAvailableResourceMetricsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAvailableResourceMetricsRequest> request = null;<NEW_LINE>Response<ListAvailableResourceMetricsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListAvailableResourceMetricsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAvailableResourceMetricsRequest));<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, "PI");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAvailableResourceMetrics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAvailableResourceMetricsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAvailableResourceMetricsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
317,892
public static DescribeDataCountsResponse unmarshall(DescribeDataCountsResponse describeDataCountsResponse, UnmarshallerContext context) {<NEW_LINE>describeDataCountsResponse.setRequestId(context.stringValue("DescribeDataCountsResponse.RequestId"));<NEW_LINE>List<DataCount> dataCountList = new ArrayList<DataCount>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeDataCountsResponse.DataCountList.Length"); i++) {<NEW_LINE>DataCount dataCount = new DataCount();<NEW_LINE>dataCount.setProductId(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].ProductId"));<NEW_LINE>dataCount.setProductCode(context.stringValue("DescribeDataCountsResponse.DataCountList[" + i + "].ProductCode"));<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.TotalCount"));<NEW_LINE>instance.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.Count"));<NEW_LINE>instance.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.SensitiveCount"));<NEW_LINE>instance.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.LastCount"));<NEW_LINE>instance.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.LastSensitiveCount"));<NEW_LINE>dataCount.setInstance(instance);<NEW_LINE>Table table = new Table();<NEW_LINE>table.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.TotalCount"));<NEW_LINE>table.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.Count"));<NEW_LINE>table.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.SensitiveCount"));<NEW_LINE>table.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.LastCount"));<NEW_LINE>table.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.LastSensitiveCount"));<NEW_LINE>dataCount.setTable(table);<NEW_LINE>_Package _package = new _Package();<NEW_LINE>_package.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.TotalCount"));<NEW_LINE>_package.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.Count"));<NEW_LINE>_package.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.SensitiveCount"));<NEW_LINE>_package.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.LastCount"));<NEW_LINE>_package.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.LastSensitiveCount"));<NEW_LINE>dataCount.set_Package(_package);<NEW_LINE>Column column = new Column();<NEW_LINE>column.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.TotalCount"));<NEW_LINE>column.setCount(context.longValue<MASK><NEW_LINE>column.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.SensitiveCount"));<NEW_LINE>column.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.LastCount"));<NEW_LINE>column.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.LastSensitiveCount"));<NEW_LINE>dataCount.setColumn(column);<NEW_LINE>Oss oss = new Oss();<NEW_LINE>oss.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.TotalCount"));<NEW_LINE>oss.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.Count"));<NEW_LINE>oss.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.SensitiveCount"));<NEW_LINE>oss.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.LastCount"));<NEW_LINE>oss.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.LastSensitiveCount"));<NEW_LINE>dataCount.setOss(oss);<NEW_LINE>dataCountList.add(dataCount);<NEW_LINE>}<NEW_LINE>describeDataCountsResponse.setDataCountList(dataCountList);<NEW_LINE>return describeDataCountsResponse;<NEW_LINE>}
("DescribeDataCountsResponse.DataCountList[" + i + "].Column.Count"));
982,873
private void callothersubr(int num) {<NEW_LINE>if (num == 0) {<NEW_LINE>// end flex<NEW_LINE>isFlex = false;<NEW_LINE>if (flexPoints.size() < 7) {<NEW_LINE>Log.w("PdfBox-Android", "flex without moveTo in font " + fontName + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// reference point is relative to start point<NEW_LINE>PointF reference = flexPoints.get(0);<NEW_LINE>reference.set(current.x + reference.x, current.y + reference.y);<NEW_LINE>// first point is relative to reference point<NEW_LINE>PointF first = flexPoints.get(1);<NEW_LINE>first.set(reference.x + first.x, reference.y + first.y);<NEW_LINE>// make the first point relative to the start point<NEW_LINE>first.set(first.x - current.x, first.y - current.y);<NEW_LINE>rrcurveTo(flexPoints.get(1).x, flexPoints.get(1).y, flexPoints.get(2).x, flexPoints.get(2).y, flexPoints.get(3).x, flexPoints.get(3).y);<NEW_LINE>rrcurveTo(flexPoints.get(4).x, flexPoints.get(4).y, flexPoints.get(5).x, flexPoints.get(5).y, flexPoints.get(6).x, flexPoints.get(6).y);<NEW_LINE>flexPoints.clear();<NEW_LINE>} else if (num == 1) {<NEW_LINE>// begin flex<NEW_LINE>isFlex = true;<NEW_LINE>} else {<NEW_LINE>// indicates a PDFBox bug<NEW_LINE>throw new IllegalArgumentException("Unexpected other subroutine: " + num);<NEW_LINE>}<NEW_LINE>}
", glyph " + glyphName + ", command " + commandCount);
1,193,058
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String serviceName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, this.client.getApiVersion(<MASK><NEW_LINE>}
), serviceName, accept, context);
228,428
public static void read(InputStream inputStream, FeedClient feedClient, AtomicInteger numSent) throws Exception {<NEW_LINE>SAXParserFactory parserFactory = SAXParserFactory.newInstance();<NEW_LINE>// XXE prevention:<NEW_LINE>parserFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);<NEW_LINE>parserFactory.setValidating(false);<NEW_LINE>parserFactory.setNamespaceAware(false);<NEW_LINE><MASK><NEW_LINE>SAXClientFeeder saxClientFeeder = new SAXClientFeeder(feedClient, numSent);<NEW_LINE>InputSource inputSource = new InputSource();<NEW_LINE>inputSource.setEncoding(StandardCharsets.UTF_8.displayName());<NEW_LINE>inputSource.setByteStream(inputStream);<NEW_LINE>// This is to send events about CDATA to the saxClientFeeder<NEW_LINE>// (https://docs.oracle.com/javase/tutorial/jaxp/sax/events.html)<NEW_LINE>parser.setProperty("http://xml.org/sax/properties/lexical-handler", saxClientFeeder);<NEW_LINE>parser.parse(inputSource, saxClientFeeder);<NEW_LINE>}
SAXParser parser = parserFactory.newSAXParser();
1,775,395
public void untagLogGroup(UntagLogGroupRequest untagLogGroupRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagLogGroupRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagLogGroupRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagLogGroupRequestMarshaller().marshall(untagLogGroupRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null);<NEW_LINE>invoke(request, responseHandler, executionContext);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
537,034
public static String amount(Currency currency, double value) {<NEW_LINE>BigDecimal dec = BigDecimal.valueOf(value).stripTrailingZeros();<NEW_LINE>String symbol <MASK><NEW_LINE>if (dec.scale() <= -3) {<NEW_LINE>if (Math.abs(dec.longValue()) >= 1_000_000L) {<NEW_LINE>dec = dec.movePointLeft(6);<NEW_LINE>return symbol + dec.toPlainString() + "mm";<NEW_LINE>} else {<NEW_LINE>dec = dec.movePointLeft(3);<NEW_LINE>return symbol + dec.toPlainString() + "k";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dec.scale() > currency.getMinorUnitDigits()) {<NEW_LINE>dec = dec.setScale(currency.getMinorUnitDigits(), RoundingMode.HALF_UP);<NEW_LINE>}<NEW_LINE>DecimalFormat formatter = new DecimalFormat("###,###.###", new DecimalFormatSymbols(Locale.UK));<NEW_LINE>return symbol + formatter.format(dec);<NEW_LINE>}
= currency.getCode() + " ";
1,514,364
Map<List<TableId>, Long> calculateUsage() {<NEW_LINE>// Bitset of tables that contain a file and total usage by all files that share that usage<NEW_LINE>Map<List<Integer>, Long> usage = new HashMap<>();<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("fileSizes {}", fileSizes);<NEW_LINE>}<NEW_LINE>// For each file w/ referenced-table bitset<NEW_LINE>for (Entry<String, Integer[]> entry : tableFiles.entrySet()) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("file {} table bitset {}", entry.getKey(), Arrays.toString(entry.getValue()));<NEW_LINE>}<NEW_LINE>List<Integer> key = Arrays.asList(entry.getValue());<NEW_LINE>Long size = fileSizes.get(entry.getKey());<NEW_LINE>Long tablesUsage = usage.get(key);<NEW_LINE>if (tablesUsage == null)<NEW_LINE>tablesUsage = 0L;<NEW_LINE>tablesUsage += size;<NEW_LINE>usage.put(key, tablesUsage);<NEW_LINE>}<NEW_LINE>Map<List<TableId>, Long> externalUsage = new HashMap<>();<NEW_LINE>for (Entry<List<Integer>, Long> entry : usage.entrySet()) {<NEW_LINE>List<TableId> <MASK><NEW_LINE>List<Integer> key = entry.getKey();<NEW_LINE>// table bitset<NEW_LINE>for (int i = 0; i < key.size(); i++) if (key.get(i) != 0)<NEW_LINE>// Convert by internal id to the table id<NEW_LINE>externalKey.add(externalIds.get(i));<NEW_LINE>// list of table ids and size of files shared across the tables<NEW_LINE>externalUsage.put(externalKey, entry.getValue());<NEW_LINE>}<NEW_LINE>// mapping of all enumerations of files being referenced by tables and total size of files who<NEW_LINE>// share the same reference<NEW_LINE>return externalUsage;<NEW_LINE>}
externalKey = new ArrayList<>();