idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
957,656 | public void paintComponent(Graphics g) {<NEW_LINE>if (g == null)<NEW_LINE>return;<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setPaint(Color.GRAY);<NEW_LINE>g2.fillRect(0, 0, getWidth(), getHeight());<NEW_LINE>if (segDet == null || segDet.getChunkCount() < 1 || length < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>g2.setPaint(ColorResource.getSelectionColor());<NEW_LINE>float r = (float) getWidth() / length;<NEW_LINE>// g2.setPaint(low);// g.setColor(Color.BLACK);<NEW_LINE>// g2.drawRect(0, 0, getWidth() - 1, getHeight() - 1);<NEW_LINE>ArrayList<SegmentInfo> list = segDet.getChunkUpdates();<NEW_LINE>// Logger.log(list.size()+" r: "+r+" width: "+getWidth()+" length: "+length);<NEW_LINE>for (int i = 0; i < segDet.getChunkCount(); i++) {<NEW_LINE>SegmentInfo <MASK><NEW_LINE>int _start = (int) (info.getStart() * r);<NEW_LINE>int _length = (int) (info.getLength() * r);<NEW_LINE>int _dwnld = (int) (info.getDownloaded() * r);<NEW_LINE>if (_dwnld > _length)<NEW_LINE>_dwnld = _length;<NEW_LINE>// g2.drawRect(_start, 0, _length, getHeight() - 1);<NEW_LINE>g2.fillRect(_start, 0, _dwnld + 1, getHeight());<NEW_LINE>// g2.setPaint(low);<NEW_LINE>// g2.fillRect(_start, getHeight() / 2, _dwnld + 1, getHeight() -<NEW_LINE>// 1);<NEW_LINE>// g.setColor(Color.RED);<NEW_LINE>// g.drawLine(_start, 0, _start, getHeight() - 1);<NEW_LINE>// g.setColor(Color.BLACK);<NEW_LINE>}<NEW_LINE>// g2.setColor(Color.GRAY);<NEW_LINE>// g2.drawRect(0, 0, getWidth() - 1, getHeight() - 1);<NEW_LINE>} | info = list.get(i); |
1,718,762 | public void readPermissions(@NonNull ProxyFile libraryDir, int permissionFlag) {<NEW_LINE>// Read permissions from given directory.<NEW_LINE>if (!libraryDir.exists() || !libraryDir.isDirectory()) {<NEW_LINE>if (permissionFlag == ALLOW_ALL) {<NEW_LINE>Log.w(<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Iterate over the files in the directory and scan .xml files<NEW_LINE>ProxyFile platformFile = null;<NEW_LINE>for (ProxyFile f : libraryDir.listFiles()) {<NEW_LINE>if (!f.isFile()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// We'll read platform.xml last<NEW_LINE>if (f.getPath().endsWith("etc/permissions/platform.xml")) {<NEW_LINE>platformFile = f;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!f.getPath().endsWith(".xml")) {<NEW_LINE>Log.i(TAG, "Non-xml file " + f + " in " + libraryDir + " directory, ignoring");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!f.canRead()) {<NEW_LINE>Log.w(TAG, "Permissions library file " + f + " cannot be read");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>readPermissionsFromXml(f, permissionFlag);<NEW_LINE>}<NEW_LINE>// Read platform permissions last so it will take precedence<NEW_LINE>if (platformFile != null) {<NEW_LINE>readPermissionsFromXml(platformFile, permissionFlag);<NEW_LINE>}<NEW_LINE>} | TAG, "No directory " + libraryDir + ", skipping"); |
749,410 | private <T> Future<List<InetSocketAddress>> resolveAddresses(Request request, ProxyServer proxy, NettyResponseFuture<T> future, AsyncHandler<T> asyncHandler) {<NEW_LINE>Uri uri = request.getUri();<NEW_LINE>final Promise<List<InetSocketAddress>> promise = ImmediateEventExecutor.INSTANCE.newPromise();<NEW_LINE>if (proxy != null && !proxy.isIgnoredForHost(uri.getHost()) && proxy.getProxyType().isHttp()) {<NEW_LINE>int port = uri.isSecured() ? proxy.getSecuredPort() : proxy.getPort();<NEW_LINE>InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(proxy.getHost(), port);<NEW_LINE>scheduleRequestTimeout(future, unresolvedRemoteAddress);<NEW_LINE>return RequestHostnameResolver.INSTANCE.resolve(request.<MASK><NEW_LINE>} else {<NEW_LINE>int port = uri.getExplicitPort();<NEW_LINE>InetSocketAddress unresolvedRemoteAddress = InetSocketAddress.createUnresolved(uri.getHost(), port);<NEW_LINE>scheduleRequestTimeout(future, unresolvedRemoteAddress);<NEW_LINE>if (request.getAddress() != null) {<NEW_LINE>// bypass resolution<NEW_LINE>InetSocketAddress inetSocketAddress = new InetSocketAddress(request.getAddress(), port);<NEW_LINE>return promise.setSuccess(singletonList(inetSocketAddress));<NEW_LINE>} else {<NEW_LINE>return RequestHostnameResolver.INSTANCE.resolve(request.getNameResolver(), unresolvedRemoteAddress, asyncHandler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getNameResolver(), unresolvedRemoteAddress, asyncHandler); |
1,760,025 | public void undoAction() {<NEW_LINE>FollowersUIMediator followersUIMediator = Overlap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME);<NEW_LINE>// get the entity<NEW_LINE>Entity entity = EntityUtils.getByUniqueId(entityId);<NEW_LINE>Entity <MASK><NEW_LINE>HashSet<Entity> children = EntityUtils.getChildren(entity);<NEW_LINE>// what will be the position diff of children?<NEW_LINE>Vector2 positionDiff = EntityUtils.getPosition(entity);<NEW_LINE>// rebase children back to root<NEW_LINE>EntityUtils.changeParent(children, oldParentEntity);<NEW_LINE>// reposition children<NEW_LINE>for (Entity tmpEntity : children) {<NEW_LINE>TransformComponent transformComponent = ComponentRetriever.get(tmpEntity, TransformComponent.class);<NEW_LINE>transformComponent.x += positionDiff.x;<NEW_LINE>transformComponent.y += positionDiff.y;<NEW_LINE>// put layer data back<NEW_LINE>ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class);<NEW_LINE>zIndexComponent.layerName = layersBackup.get(EntityUtils.getEntityId(tmpEntity));<NEW_LINE>}<NEW_LINE>// remove composite<NEW_LINE>followersUIMediator.removeFollower(entity);<NEW_LINE>sandbox.getEngine().removeEntity(entity);<NEW_LINE>Overlap2DFacade.getInstance().sendNotification(DONE);<NEW_LINE>sandbox.getSelector().setSelections(children, true);<NEW_LINE>} | oldParentEntity = EntityUtils.getByUniqueId(parentEntityId); |
1,090,607 | /*<NEW_LINE>* Retrieve the server audit log<NEW_LINE>* @param userId userId under which the request is performed<NEW_LINE>* @param serverName The name of the server to interrogate<NEW_LINE>* @param methodName The name of the method being invoked<NEW_LINE>* @return the server type as a String<NEW_LINE>*<NEW_LINE>* Exceptions returned by the server<NEW_LINE>* @throws DinoViewServiceException an error was detected and reported<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>public OMRSAuditLogReport serverGetAuditLog(String userId, String serverName, String platformName, String methodName) throws DinoViewServiceException {<NEW_LINE>try {<NEW_LINE>String platformRootURL = resolvePlatformRootURL(platformName, methodName);<NEW_LINE>AuditLogServicesClient auditLogServicesClient = this.getAuditLogServicesClient(userId, serverName, platformRootURL);<NEW_LINE>return auditLogServicesClient.getAuditLogReport(userId);<NEW_LINE>} catch (RepositoryErrorException exc) {<NEW_LINE>return null;<NEW_LINE>} catch (org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException e) {<NEW_LINE>throw DinoExceptionHandler.mapOMRSInvalidParameterException(this.getClass().getName(), methodName, e);<NEW_LINE>} catch (org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException e) {<NEW_LINE>throw DinoExceptionHandler.mapOMRSUserNotAuthorizedException(this.getClass().<MASK><NEW_LINE>}<NEW_LINE>} | getName(), methodName, e); |
1,274,864 | public RuleGroupSourceStatelessRuleDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RuleGroupSourceStatelessRuleDefinition ruleGroupSourceStatelessRuleDefinition = new RuleGroupSourceStatelessRuleDefinition();<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("Actions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ruleGroupSourceStatelessRuleDefinition.setActions(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MatchAttributes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ruleGroupSourceStatelessRuleDefinition.setMatchAttributes(RuleGroupSourceStatelessRuleMatchAttributesJsonUnmarshaller.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 ruleGroupSourceStatelessRuleDefinition;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
912,052 | private void updateFiles() {<NEW_LINE>if (document == null)<NEW_LINE>return;<NEW_LINE>final View progressBar = findViewById(R.id.progressBar);<NEW_LINE>final TextView filesEmptyView = (TextView) findViewById(R.id.filesEmptyView);<NEW_LINE>fileViewPager = (ViewPager) findViewById(R.id.fileViewPager);<NEW_LINE>fileViewPager.setOffscreenPageLimit(1);<NEW_LINE>fileViewPager.setAdapter(null);<NEW_LINE>progressBar.setVisibility(View.VISIBLE);<NEW_LINE>filesEmptyView.setVisibility(View.GONE);<NEW_LINE>FileResource.list(this, document.optString("id"), new HttpCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(JSONObject response) {<NEW_LINE>JSONArray files = response.optJSONArray("files");<NEW_LINE>filePagerAdapter = new FilePagerAdapter(DocumentViewActivity.this, files);<NEW_LINE>fileViewPager.setAdapter(filePagerAdapter);<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE>if (files.length() == 0)<NEW_LINE>filesEmptyView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(JSONObject json, Exception e) {<NEW_LINE>filesEmptyView.setText(R.string.error_loading_files);<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | filesEmptyView.setVisibility(View.VISIBLE); |
1,224,053 | protected void startUp() {<NEW_LINE>long traceId = LoggerHelpers.traceEnterWithContext(log, this.objectId, "startUp");<NEW_LINE>try {<NEW_LINE>log.info("Attempting to start all event processors in {}", this.toString());<NEW_LINE>eventProcessorMap.entrySet().forEach(entry -> entry.getValue().startAsync());<NEW_LINE>eventProcessorMap.entrySet().forEach(entry -> entry.getValue().awaitStartupComplete());<NEW_LINE>log.info("All event processors in {} started successfully.", this.toString());<NEW_LINE>if (rebalancePeriodMillis > 0 && rebalanceExecutor != null) {<NEW_LINE>rebalanceFuture = rebalanceExecutor.scheduleWithFixedDelay(this::rebalance, rebalancePeriodMillis, rebalancePeriodMillis, TimeUnit.MILLISECONDS);<NEW_LINE>} else {<NEW_LINE>rebalanceFuture = null;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>LoggerHelpers.traceLeave(log, <MASK><NEW_LINE>}<NEW_LINE>} | this.objectId, "startUp", traceId); |
823,414 | private void writeBufferChain(BufferChainOutputStream bufferChain, boolean compressed) {<NEW_LINE>int messageLength = bufferChain.readableBytes();<NEW_LINE>headerScratch.clear();<NEW_LINE>headerScratch.put(compressed ? COMPRESSED : UNCOMPRESSED).putInt(messageLength);<NEW_LINE>WritableBuffer writeableHeader = bufferAllocator.allocate(HEADER_LENGTH);<NEW_LINE>writeableHeader.write(headerScratch.array(), 0, headerScratch.position());<NEW_LINE>if (messageLength == 0) {<NEW_LINE>// the payload had 0 length so make the header the current buffer.<NEW_LINE>buffer = writeableHeader;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Note that we are always delivering a small message to the transport here which<NEW_LINE>// may incur transport framing overhead as it may be sent separately to the contents<NEW_LINE>// of the GRPC frame.<NEW_LINE>// The final message may not be completely written because we do not flush the last buffer.<NEW_LINE>// Do not report the last message as sent.<NEW_LINE>sink.deliverFrame(writeableHeader, false, false, messagesBuffered - 1);<NEW_LINE>messagesBuffered = 1;<NEW_LINE>// Commit all except the last buffer to the sink<NEW_LINE>List<MASK><NEW_LINE>for (int i = 0; i < bufferList.size() - 1; i++) {<NEW_LINE>sink.deliverFrame(bufferList.get(i), false, false, 0);<NEW_LINE>}<NEW_LINE>// Assign the current buffer to the last in the chain so it can be used<NEW_LINE>// for future writes or written with end-of-stream=true on close.<NEW_LINE>buffer = bufferList.get(bufferList.size() - 1);<NEW_LINE>currentMessageWireSize = messageLength;<NEW_LINE>} | <WritableBuffer> bufferList = bufferChain.bufferList; |
218,193 | public void printTag(String name, HashMap parameters, boolean insertTab, boolean insertNewLine, boolean closeTag) {<NEW_LINE>if (insertTab) {<NEW_LINE>printTabulation();<NEW_LINE>}<NEW_LINE>this.print('<');<NEW_LINE>this.print(name);<NEW_LINE>if (parameters != null) {<NEW_LINE>int length = parameters.size();<NEW_LINE>Map.Entry[] entries = new Map.Entry[length];<NEW_LINE>parameters.entrySet().toArray(entries);<NEW_LINE>Arrays.sort(entries, new Comparator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Object o1, Object o2) {<NEW_LINE>Map.Entry entry1 = (Map.Entry) o1;<NEW_LINE>Map.Entry entry2 = (Map.Entry) o2;<NEW_LINE>return ((String) entry1.getKey()).compareTo((<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>this.print(' ');<NEW_LINE>this.print(entries[i].getKey());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.print("=\"");<NEW_LINE>this.print(getEscaped(String.valueOf(entries[i].getValue())));<NEW_LINE>this.print('\"');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (closeTag) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.print("/>");<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.print(">");<NEW_LINE>}<NEW_LINE>if (insertNewLine) {<NEW_LINE>print(this.lineSeparator);<NEW_LINE>}<NEW_LINE>if (parameters != null && !closeTag)<NEW_LINE>this.tab++;<NEW_LINE>} | String) entry2.getKey()); |
494,413 | ReferenceGCSummary extractPrintReferenceGC(String line) {<NEW_LINE>ReferenceGCSummary summary = new ReferenceGCSummary();<NEW_LINE>GCLogTrace trace;<NEW_LINE>if ((trace = extractReferenceBlock(line, SOFT_REFERENCE)) != null)<NEW_LINE>summary.addSoftReferences(trace.getDateTimeStamp(), trace.getIntegerGroup(3), trace.getDuration());<NEW_LINE>if ((trace = extractReferenceBlock(line, WEAK_REFERENCE)) != null)<NEW_LINE>summary.addWeakReferences(trace.getDateTimeStamp(), trace.getIntegerGroup(3), trace.getDuration());<NEW_LINE>if ((trace = extractReferenceBlock(line, FINAL_REFERENCE)) != null)<NEW_LINE>summary.addFinalReferences(trace.getDateTimeStamp(), trace.getIntegerGroup(3), trace.getDuration());<NEW_LINE>if ((trace = extractReferenceBlock(line, PHANTOM_REFERENCE)) != null) {<NEW_LINE>if (trace.groupNotNull(4))<NEW_LINE>summary.addPhantomReferences(trace.getDateTimeStamp(), trace.getIntegerGroup(3), trace.getIntegerGroup(4<MASK><NEW_LINE>else<NEW_LINE>summary.addPhantomReferences(trace.getDateTimeStamp(), trace.getIntegerGroup(3), trace.getDuration());<NEW_LINE>}<NEW_LINE>if ((trace = extractReferenceBlock(line, JNI_REFERENCE)) != null) {<NEW_LINE>if (trace.groupNotNull(3))<NEW_LINE>summary.addJNIWeakReferences(trace.getDateTimeStamp(), trace.getIntegerGroup(3), trace.getDuration());<NEW_LINE>else<NEW_LINE>summary.addJNIWeakReferences(trace.getDateTimeStamp(), trace.getDuration());<NEW_LINE>}<NEW_LINE>return summary;<NEW_LINE>} | ), trace.getDuration()); |
1,363,418 | private static void aggregateDataTierShardStats(NodeStats nodeStats, Index index, RoutingNode node, TierStatsAccumulator accumulator) {<NEW_LINE>// Shard based stats<NEW_LINE>final List<IndexShardStats> allShardStats = nodeStats.getIndices().getShardStats(index);<NEW_LINE>if (allShardStats != null) {<NEW_LINE>for (IndexShardStats shardStat : allShardStats) {<NEW_LINE>accumulator.totalByteCount += shardStat.getTotal().getStore().getSizeInBytes();<NEW_LINE>accumulator.docCount += shardStat.getTotal().getDocs().getCount();<NEW_LINE>// Accumulate stats about started shards<NEW_LINE>if (node.getByShardId(shardStat.getShardId()).state() == ShardRoutingState.STARTED) {<NEW_LINE>accumulator.totalShardCount += 1;<NEW_LINE>// Accumulate stats about started primary shards<NEW_LINE>StoreStats primaryStoreStats = shardStat<MASK><NEW_LINE>if (primaryStoreStats != null) {<NEW_LINE>// if primaryStoreStats is null, it means there is no primary on the node in question<NEW_LINE>accumulator.primaryShardCount++;<NEW_LINE>long primarySize = primaryStoreStats.getSizeInBytes();<NEW_LINE>accumulator.primaryByteCount += primarySize;<NEW_LINE>accumulator.valueSketch.add(primarySize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getPrimary().getStore(); |
1,602,522 | public boolean isAccepted(String fileName) {<NEW_LINE>if (NORMAL_FILE == this) {<NEW_LINE>return fileName.endsWith(addVersionToExt(IndexConstants.BINARY_MAP_INDEX_EXT_ZIP, IndexConstants.BINARY_MAP_VERSION)) || fileName.endsWith(IndexConstants.EXTRA_ZIP_EXT) || fileName.endsWith(IndexConstants.SQLITE_EXT);<NEW_LINE>} else if (ROADS_FILE == this) {<NEW_LINE>return fileName.endsWith(addVersionToExt(IndexConstants.BINARY_ROAD_MAP_INDEX_EXT_ZIP, IndexConstants.BINARY_MAP_VERSION));<NEW_LINE>} else if (VOICE_FILE == this) {<NEW_LINE>return fileName.endsWith(addVersionToExt(IndexConstants.VOICE_INDEX_EXT_ZIP, IndexConstants.VOICE_VERSION));<NEW_LINE>} else if (FONT_FILE == this) {<NEW_LINE>return fileName.endsWith(IndexConstants.FONT_INDEX_EXT_ZIP);<NEW_LINE>} else if (WIKIPEDIA_FILE == this) {<NEW_LINE>return fileName.endsWith(addVersionToExt(IndexConstants.BINARY_WIKI_MAP_INDEX_EXT_ZIP, IndexConstants.BINARY_MAP_VERSION));<NEW_LINE>} else if (WIKIVOYAGE_FILE == this) {<NEW_LINE>return fileName.endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT);<NEW_LINE>} else if (TRAVEL_FILE == this) {<NEW_LINE>return fileName.endsWith(addVersionToExt(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT_ZIP, IndexConstants.BINARY_MAP_VERSION));<NEW_LINE>} else if (SRTM_COUNTRY_FILE == this) {<NEW_LINE>boolean srtm = fileName.endsWith(addVersionToExt(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT_ZIP, IndexConstants.BINARY_MAP_VERSION));<NEW_LINE>boolean srtmf = fileName.endsWith(addVersionToExt(IndexConstants<MASK><NEW_LINE>return srtm || srtmf;<NEW_LINE>} else if (HILLSHADE_FILE == this) {<NEW_LINE>return fileName.endsWith(IndexConstants.SQLITE_EXT);<NEW_LINE>} else if (SLOPE_FILE == this) {<NEW_LINE>return fileName.endsWith(IndexConstants.SQLITE_EXT);<NEW_LINE>} else if (DEPTH_CONTOUR_FILE == this) {<NEW_LINE>return fileName.endsWith(addVersionToExt(IndexConstants.BINARY_MAP_INDEX_EXT_ZIP, IndexConstants.BINARY_MAP_VERSION));<NEW_LINE>} else if (GPX_FILE == this) {<NEW_LINE>return fileName.endsWith(IndexConstants.GPX_FILE_EXT);<NEW_LINE>} else if (SQLITE_FILE == this) {<NEW_LINE>return fileName.endsWith(IndexConstants.SQLITE_EXT);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .BINARY_SRTM_FEET_MAP_INDEX_EXT_ZIP, IndexConstants.BINARY_MAP_VERSION)); |
144,394 | public Flux<CommandResponse<GeoRadiusCommand, Flux<GeoResult<GeoLocation<ByteBuffer>>>>> geoRadius(Publisher<GeoRadiusCommand> commands) {<NEW_LINE>return execute(commands, command -> {<NEW_LINE>Assert.notNull(command.getKey(), "Key must not be null!");<NEW_LINE>Assert.notNull(command.getPoint(), "Point must not be null!");<NEW_LINE>Assert.notNull(command.getDistance(), "Distance must not be null!");<NEW_LINE>GeoRadiusCommandArgs args = command.getArgs().orElse(GeoRadiusCommandArgs.newGeoRadiusArgs());<NEW_LINE>byte[] keyBuf = toByteArray(command.getKey());<NEW_LINE>List<Object> params = new ArrayList<Object>();<NEW_LINE>params.add(keyBuf);<NEW_LINE>params.add(BigDecimal.valueOf(command.getPoint().getX()).toPlainString());<NEW_LINE>params.add(BigDecimal.valueOf(command.getPoint().getY()).toPlainString());<NEW_LINE>params.add(command.getDistance().getValue());<NEW_LINE>params.add(command.getDistance().getMetric().getAbbreviation());<NEW_LINE>RedisCommand<GeoResults<GeoLocation<byte[]>>> cmd;<NEW_LINE>if (args.getFlags().contains(GeoRadiusCommandArgs.Flag.WITHCOORD)) {<NEW_LINE>cmd = new RedisCommand<GeoResults<GeoLocation<byte[]<MASK><NEW_LINE>params.add("WITHCOORD");<NEW_LINE>} else {<NEW_LINE>MultiDecoder<GeoResults<GeoLocation<byte[]>>> distanceDecoder = new ListMultiDecoder2(new ByteBufferGeoResultsDecoder(command.getDistance().getMetric()), new GeoDistanceDecoder());<NEW_LINE>cmd = new RedisCommand<GeoResults<GeoLocation<byte[]>>>("GEORADIUS_RO", distanceDecoder);<NEW_LINE>params.add("WITHDIST");<NEW_LINE>}<NEW_LINE>if (args.getLimit() != null) {<NEW_LINE>params.add("COUNT");<NEW_LINE>params.add(args.getLimit());<NEW_LINE>}<NEW_LINE>if (args.getSortDirection() != null) {<NEW_LINE>params.add(args.getSortDirection().name());<NEW_LINE>}<NEW_LINE>Mono<GeoResults<GeoLocation<ByteBuffer>>> m = read(keyBuf, ByteArrayCodec.INSTANCE, cmd, params.toArray());<NEW_LINE>return m.map(v -> new CommandResponse<>(command, Flux.fromIterable(v.getContent())));<NEW_LINE>});<NEW_LINE>} | >>>("GEORADIUS_RO", postitionDecoder); |
737,219 | final DeleteImageResult executeDeleteImage(DeleteImageRequest deleteImageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteImageRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteImageRequest> request = null;<NEW_LINE>Response<DeleteImageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteImageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteImageRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteImage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteImageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteImageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,077,188 | static List<Mat> applySortedIndsToElements(List<Mat> mats, Mat sortedInds) {<NEW_LINE>int nChannels = mats.get(0).channels();<NEW_LINE>int nRows = mats.get(0).rows();<NEW_LINE>int nCols = mats.get(0).cols();<NEW_LINE>int nImages = mats.size();<NEW_LINE>assert sortedInds.cols() == nImages;<NEW_LINE>assert sortedInds.rows() == nRows * nCols;<NEW_LINE>IntIndexer idx = sortedInds.createIndexer();<NEW_LINE>List<Mat> outputMats = new ArrayList<>();<NEW_LINE>List<FloatIndexer> outputIndexers = new ArrayList<>();<NEW_LINE>List<FloatIndexer> indexers = new ArrayList<>();<NEW_LINE>for (int i = 0; i < nImages; i++) {<NEW_LINE>var temp = new Mat(nRows, nCols, opencv_core.CV_32FC(nChannels));<NEW_LINE>outputMats.add(temp);<NEW_LINE>outputIndexers.<MASK><NEW_LINE>indexers.add(mats.get(i).createIndexer());<NEW_LINE>}<NEW_LINE>long[] inds = new long[3];<NEW_LINE>for (int i = 0; i < nImages; i++) {<NEW_LINE>var outputIdx = outputIndexers.get(i);<NEW_LINE>for (int r = 0; r < nRows; r++) {<NEW_LINE>inds[0] = r;<NEW_LINE>for (int c = 0; c < nCols; c++) {<NEW_LINE>inds[1] = c;<NEW_LINE>int ind = idx.get(r * nCols + c, i);<NEW_LINE>var tempIdx = indexers.get(ind);<NEW_LINE>for (int channel = 0; channel < nChannels; channel++) {<NEW_LINE>inds[2] = channel;<NEW_LINE>outputIdx.put(inds, tempIdx.get(inds));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>outputIndexers.forEach(FloatIndexer::close);<NEW_LINE>indexers.forEach(FloatIndexer::close);<NEW_LINE>return outputMats;<NEW_LINE>} | add(temp.createIndexer()); |
694,965 | public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>tsModelPackage = modelPackage.replaceAll("\\.", "/");<NEW_LINE>String tsApiPackage = apiPackage.replaceAll("\\.", "/");<NEW_LINE>String modelRelativeToRoot = getRelativeToRoot(tsModelPackage);<NEW_LINE>String apiRelativeToRoot = getRelativeToRoot(tsApiPackage);<NEW_LINE>additionalProperties.put("tsModelPackage", tsModelPackage);<NEW_LINE>additionalProperties.put("tsApiPackage", tsApiPackage);<NEW_LINE>additionalProperties.put("apiRelativeToRoot", apiRelativeToRoot);<NEW_LINE>additionalProperties.put("modelRelativeToRoot", modelRelativeToRoot);<NEW_LINE>supportingFiles.add(new SupportingFile("index.mustache", "", "index.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("baseApi.mustache", "", "base.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("common.mustache", "", "common.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("api.mustache", "", "api.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));<NEW_LINE>supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));<NEW_LINE>supportingFiles.add(new SupportingFile("npmignore", "", ".npmignore"));<NEW_LINE>if (additionalProperties.containsKey(SEPARATE_MODELS_AND_API)) {<NEW_LINE>boolean separateModelsAndApi = Boolean.parseBoolean(additionalProperties.get(SEPARATE_MODELS_AND_API).toString());<NEW_LINE>if (separateModelsAndApi) {<NEW_LINE>if (StringUtils.isAnyBlank(modelPackage, apiPackage)) {<NEW_LINE>throw new RuntimeException("apiPackage and modelPackage must be defined");<NEW_LINE>}<NEW_LINE>modelTemplateFiles.put("model.mustache", ".ts");<NEW_LINE>apiTemplateFiles.put("apiInner.mustache", ".ts");<NEW_LINE>supportingFiles.add(new SupportingFile("modelIndex.mustache", tsModelPackage, "index.ts"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(STRING_ENUMS)) {<NEW_LINE>this.stringEnums = Boolean.parseBoolean(additionalProperties.get(STRING_ENUMS).toString());<NEW_LINE>additionalProperties.put("stringEnums", this.stringEnums);<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(NPM_NAME)) {<NEW_LINE>addNpmPackageGeneration();<NEW_LINE>}<NEW_LINE>} | ("configuration.mustache", "", "configuration.ts")); |
1,775,617 | // : 81792K->0K(81856K), 0.0431036 secs] 90187K->11671K(2097088K) icms_dc=5 , 0.0435503 secs]<NEW_LINE>public void iCMSParNewDefNewTenuringDetails(GCLogTrace trace, String line) {<NEW_LINE>if (GarbageCollectionTypes.ParNew == garbageCollectionTypeForwardReference) {<NEW_LINE>ParNew collection = new ParNew(scavengeTimeStamp, gcCauseForwardReference, trace.getDoubleGroup(trace.groupCount()));<NEW_LINE>collection.add(trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(1), getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 8));<NEW_LINE>collection.recordDutyCycle(trace.getIntegerGroup(14));<NEW_LINE>collection.add(extractCPUSummary(line));<NEW_LINE>record(collection);<NEW_LINE>} else if (GarbageCollectionTypes.ParNewPromotionFailed == garbageCollectionTypeForwardReference) {<NEW_LINE>ParNewPromotionFailed collection = new ParNewPromotionFailed(scavengeTimeStamp, gcCauseForwardReference, trace.getDoubleGroup(trace.groupCount()));<NEW_LINE>MemoryPoolSummary young = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(1);<NEW_LINE>MemoryPoolSummary heap = getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 8);<NEW_LINE>collection.add(young, heap.minus(young), heap);<NEW_LINE>collection.recordDutyCycle(trace.getIntegerGroup(trace.groupCount() - 1));<NEW_LINE>record(collection);<NEW_LINE>} else if (GarbageCollectionTypes.FullGC == garbageCollectionTypeForwardReference) {<NEW_LINE>FullGC collection = new FullGC(fullGCTimeStamp, gcCauseForwardReference, trace.getDoubleGroup<MASK><NEW_LINE>MemoryPoolSummary young = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(1);<NEW_LINE>MemoryPoolSummary heap = getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 8);<NEW_LINE>collection.add(young, heap.minus(young), heap);<NEW_LINE>collection.recordDutyCycle(trace.getIntegerGroup(trace.groupCount() - 1));<NEW_LINE>record(collection);<NEW_LINE>} else {<NEW_LINE>LOGGER.warning("Not reported: " + line);<NEW_LINE>}<NEW_LINE>} | (trace.groupCount())); |
1,215,148 | final GetBlockPublicAccessConfigurationResult executeGetBlockPublicAccessConfiguration(GetBlockPublicAccessConfigurationRequest getBlockPublicAccessConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBlockPublicAccessConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBlockPublicAccessConfigurationRequest> request = null;<NEW_LINE>Response<GetBlockPublicAccessConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBlockPublicAccessConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBlockPublicAccessConfigurationRequest));<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, "EMR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBlockPublicAccessConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBlockPublicAccessConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBlockPublicAccessConfigurationResultJsonUnmarshaller());<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); |
355,806 | public void attach(Runnable onSuccess, Consumer<Throwable> onError) {<NEW_LINE>ThreadUtil.run(() -> {<NEW_LINE>Throwable thrown;<NEW_LINE>try {<NEW_LINE>String path = SelfReferenceUtil.get().getPath();<NEW_LINE>Log.info("Attempting to attatch to '{}' with agent '{}'", getPid(), path);<NEW_LINE>PluginsManager.getInstance().ofType(AttachPlugin.class).forEach(plugin -> plugin.onAgentLoad(machine));<NEW_LINE>// Attempt to load<NEW_LINE>machine.loadAgent(path);<NEW_LINE>if (onSuccess != null)<NEW_LINE>Platform.runLater(onSuccess);<NEW_LINE>return;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Log.error(ex, "Recaf failed to connect to target machine '{}'", getPid());<NEW_LINE>thrown = ex;<NEW_LINE>} catch (AgentInitializationException ex) {<NEW_LINE>Log.error(ex, "Recaf agent failed to initialize in the target machine '{}'", getPid());<NEW_LINE>thrown = ex;<NEW_LINE>} catch (AgentLoadException ex) {<NEW_LINE>Log.error(ex, "Recaf agent crashed in the target machine '{}'", getPid());<NEW_LINE>thrown = ex;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Log.error(t, "Recaf agent failed to load due unhandled error '{}'", getPid());<NEW_LINE>thrown = t;<NEW_LINE>}<NEW_LINE>// Handle errors<NEW_LINE>if (onError != null)<NEW_LINE>Platform.runLater(() <MASK><NEW_LINE>});<NEW_LINE>} | -> onError.accept(thrown)); |
1,596,766 | private void addToImageCache(final URI uri, final BufferedImage img) {<NEW_LINE>synchronized (imgmap) {<NEW_LINE>try {<NEW_LINE>while (imagesize > 1000 * 1000 * 50) {<NEW_LINE>URI olduri = imgmapAccessQueue.removeFirst();<NEW_LINE>BufferedImage <MASK><NEW_LINE>imagesize -= oldimg.getWidth() * oldimg.getHeight() * 4;<NEW_LINE>log("removed 1 img from image cache");<NEW_LINE>}<NEW_LINE>imgmap.put(uri, img);<NEW_LINE>imagesize += img.getWidth() * img.getHeight() * 4;<NEW_LINE>imgmapAccessQueue.addLast(uri);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log("Failed to load tile at URL. Tile is null");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// log("added to cache: " + " uncompressed = " + imgmap.keySet().size() + " / " + imagesize / 1000 + "k"<NEW_LINE>// + " compressed = " + bytemap.keySet().size() + " / " + bytesize / 1000 + "k");<NEW_LINE>} | oldimg = imgmap.remove(olduri); |
933,656 | public static void waitForZkMntr(String namespaceName, String clusterName, Pattern pattern, int... podIndexes) {<NEW_LINE>long timeoutMs = 120_000L;<NEW_LINE>long pollMs = 1_000L;<NEW_LINE>for (int podIndex : podIndexes) {<NEW_LINE>String zookeeperPod = <MASK><NEW_LINE>String zookeeperPort = String.valueOf(12181);<NEW_LINE>waitFor("mntr", pollMs, timeoutMs, () -> {<NEW_LINE>try {<NEW_LINE>String output = cmdKubeClient(namespaceName).execInPod(zookeeperPod, "/bin/bash", "-c", "echo mntr | nc localhost " + zookeeperPort).out();<NEW_LINE>if (pattern.matcher(output).find()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (KubeClusterException e) {<NEW_LINE>LOGGER.trace("Exception while waiting for ZK to become leader/follower, ignoring", e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}, () -> LOGGER.info("zookeeper `mntr` output at the point of timeout does not match {}:{}{}", pattern.pattern(), System.lineSeparator(), indent(cmdKubeClient(namespaceName).execInPod(zookeeperPod, "/bin/bash", "-c", "echo mntr | nc localhost " + zookeeperPort).out())));<NEW_LINE>}<NEW_LINE>} | KafkaResources.zookeeperPodName(clusterName, podIndex); |
1,572,900 | private Set<AlarmStatus> toStatusSet(List<AlarmSearchStatus> statusList) {<NEW_LINE>Set<AlarmStatus> result = new HashSet<>();<NEW_LINE>for (AlarmSearchStatus searchStatus : statusList) {<NEW_LINE>switch(searchStatus) {<NEW_LINE>case ACK:<NEW_LINE>result.add(AlarmStatus.ACTIVE_ACK);<NEW_LINE>result.add(AlarmStatus.CLEARED_ACK);<NEW_LINE>break;<NEW_LINE>case UNACK:<NEW_LINE>result.add(AlarmStatus.ACTIVE_UNACK);<NEW_LINE>result.add(AlarmStatus.CLEARED_UNACK);<NEW_LINE>break;<NEW_LINE>case CLEARED:<NEW_LINE>result.add(AlarmStatus.CLEARED_ACK);<NEW_LINE>result.add(AlarmStatus.CLEARED_UNACK);<NEW_LINE>break;<NEW_LINE>case ACTIVE:<NEW_LINE>result.add(AlarmStatus.ACTIVE_ACK);<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (searchStatus == AlarmSearchStatus.ANY || result.size() == AlarmStatus.values().length) {<NEW_LINE>result.clear();<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result.add(AlarmStatus.ACTIVE_UNACK); |
1,082,885 | protected final int waitResult() throws InterruptedException {<NEW_LINE>int result = waitResultImpl();<NEW_LINE>// NOI18N<NEW_LINE>String reportFile = getProcessInfo("REPORT");<NEW_LINE>if (reportFile != null) {<NEW_LINE>// NbNativeProcess works in either *nix or cygwin environment;<NEW_LINE>// So it is safe to call /bin/sh here in any case<NEW_LINE>NativeProcessBuilder npb = NativeProcessBuilder.newProcessBuilder(info.getExecutionEnvironment());<NEW_LINE>// NOI18N<NEW_LINE>npb.setExecutable("/bin/sh");<NEW_LINE>// NOI18N<NEW_LINE>npb.setArguments("-c", "cat " + reportFile + " && rm " + reportFile);<NEW_LINE>ExitStatus st = ProcessUtils.execute(npb);<NEW_LINE>if (st.isOK()) {<NEW_LINE>// NOI18N<NEW_LINE>statusEx = ProcessStatusAccessor.getDefault().create(st.getOutputString<MASK><NEW_LINE>result = statusEx.getExitCode();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ().split("\n")); |
1,168,614 | private static boolean canConvertAbfAclLine(Ipv4AccessListLine line, String aclName, Warnings warnings) {<NEW_LINE>Ipv4Nexthop nexthop1 = line.getNexthop1();<NEW_LINE>if (nexthop1 == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String vrf1 = nexthop1.getVrf();<NEW_LINE>String vrf2 = line.getNexthop2() == null ? vrf1 : line.getNexthop2().getVrf();<NEW_LINE>String vrf3 = line.getNexthop3() == null ? vrf1 : line<MASK><NEW_LINE>if (!Objects.equals(vrf1, vrf2) || !Objects.equals(vrf1, vrf3)) {<NEW_LINE>warnings.redFlag(String.format("Access-list lines with different nexthop VRFs are not yet supported. Line '%s' in" + " ACL %s will be ignored.", line.getName(), aclName));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getNexthop3().getVrf(); |
207,172 | private static LatLon parseCoordinates(@NonNull String url) {<NEW_LINE>if (url.contains(GEO_PARAMS)) {<NEW_LINE>String geoPart = url.substring(url.indexOf(GEO_PARAMS));<NEW_LINE>int firstValueStart = geoPart.indexOf("=");<NEW_LINE>int firstValueEnd = geoPart.indexOf("&");<NEW_LINE>int secondValueStart = geoPart.indexOf("=", firstValueEnd);<NEW_LINE>if (firstValueStart != -1 && firstValueEnd != -1 && secondValueStart != -1 && firstValueEnd > firstValueStart) {<NEW_LINE>String lat = geoPart.substring(firstValueStart + 1, firstValueEnd);<NEW_LINE>String lon = geoPart.substring(secondValueStart + 1);<NEW_LINE>try {<NEW_LINE>return new LatLon(Double.parseDouble(lat)<MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | , Double.parseDouble(lon)); |
820,825 | private void addWebServerHandlers(WebService webService, PulsarPrometheusMetricsServlet metricsServlet, ServiceConfiguration config) throws PulsarServerException, PulsarClientException, MalformedURLException, ServletException, DeploymentException {<NEW_LINE>Map<String, Object> attributeMap = Maps.newHashMap();<NEW_LINE>attributeMap.put(WebService.ATTRIBUTE_PULSAR_NAME, this);<NEW_LINE>Map<String, Object> vipAttributeMap = Maps.newHashMap();<NEW_LINE>vipAttributeMap.put(VipStatus.<MASK><NEW_LINE>vipAttributeMap.put(VipStatus.ATTRIBUTE_IS_READY_PROBE, (Supplier<Boolean>) () -> {<NEW_LINE>// Ensure the VIP status is only visible when the broker is fully initialized<NEW_LINE>return state == State.Started;<NEW_LINE>});<NEW_LINE>// Add admin rest resources<NEW_LINE>webService.addRestResources("/", VipStatus.class.getPackage().getName(), false, vipAttributeMap);<NEW_LINE>webService.addRestResources("/", "org.apache.pulsar.broker.web", false, attributeMap);<NEW_LINE>webService.addRestResources("/admin", "org.apache.pulsar.broker.admin.v1", true, attributeMap);<NEW_LINE>webService.addRestResources("/admin/v2", "org.apache.pulsar.broker.admin.v2", true, attributeMap);<NEW_LINE>webService.addRestResources("/admin/v3", "org.apache.pulsar.broker.admin.v3", true, attributeMap);<NEW_LINE>webService.addRestResources("/lookup", "org.apache.pulsar.broker.lookup", true, attributeMap);<NEW_LINE>webService.addRestResources("/topics", "org.apache.pulsar.broker.rest", true, attributeMap);<NEW_LINE>// Add metrics servlet<NEW_LINE>webService.addServlet("/metrics", new ServletHolder(metricsServlet), false, attributeMap);<NEW_LINE>// Add websocket service<NEW_LINE>addWebSocketServiceHandler(webService, attributeMap, config);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Attempting to add static directory");<NEW_LINE>}<NEW_LINE>// Add static resources<NEW_LINE>webService.addStaticResources("/static", "/static");<NEW_LINE>// Add broker additional servlets<NEW_LINE>addBrokerAdditionalServlets(webService, attributeMap, config);<NEW_LINE>} | ATTRIBUTE_STATUS_FILE_PATH, config.getStatusFilePath()); |
504,561 | public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {<NEW_LINE>// retrieve the event type, e.g. if a link was clicked by the user<NEW_LINE>HyperlinkEvent.EventType typ = evt.getEventType();<NEW_LINE>// get the description, to check whether we have a file or a hyperlink to a website<NEW_LINE>String linktype = evt.getDescription();<NEW_LINE>// if the link was clicked, proceed<NEW_LINE>if (typ == HyperlinkEvent.EventType.ACTIVATED) {<NEW_LINE>// call method that handles the hyperlink-click<NEW_LINE>String returnValue = Tools.openHyperlink(linktype, mainframe, Constants.FRAME_DESKTOP, dataObj, bibtexObj, settingsObj, jEditorPaneMain, -1);<NEW_LINE>// check whether we have a return value. this might be the case either when the user clicked on<NEW_LINE>// a footenote, or on the rating-stars<NEW_LINE>if (returnValue != null && returnValue.startsWith("#z_")) {<NEW_LINE>// show entry<NEW_LINE>zknframe.<MASK><NEW_LINE>}<NEW_LINE>} else if (evt.getEventType() == HyperlinkEvent.EventType.ENTERED) {<NEW_LINE>javax.swing.text.Element elem = evt.getSourceElement();<NEW_LINE>if (elem != null) {<NEW_LINE>AttributeSet attr = elem.getAttributes();<NEW_LINE>AttributeSet a = (AttributeSet) attr.getAttribute(HTML.Tag.A);<NEW_LINE>if (a != null) {<NEW_LINE>jEditorPaneMain.setToolTipText((String) a.getAttribute(HTML.Attribute.TITLE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (evt.getEventType() == HyperlinkEvent.EventType.EXITED) {<NEW_LINE>jEditorPaneMain.setToolTipText(null);<NEW_LINE>}<NEW_LINE>} | showEntry(dataObj.getCurrentZettelPos()); |
1,605,216 | public IRubyObject invoke(ThreadContext context, IRubyObject[] args) {<NEW_LINE>checkArity(context, args.length - 1);<NEW_LINE>final IRubyObject invokee = args[0];<NEW_LINE>final Object[] arguments = convertArguments(args, 1);<NEW_LINE>if (invokee.isNil()) {<NEW_LINE>return invokeWithExceptionHandling(<MASK><NEW_LINE>}<NEW_LINE>final Object javaInvokee;<NEW_LINE>if (!isStatic()) {<NEW_LINE>javaInvokee = JavaUtil.unwrapJavaValue(invokee);<NEW_LINE>if (javaInvokee == null) {<NEW_LINE>throw context.runtime.newTypeError("invokee not a java object");<NEW_LINE>}<NEW_LINE>if (!method.getDeclaringClass().isInstance(javaInvokee)) {<NEW_LINE>throw context.runtime.newTypeError("invokee not instance of method's class" + " (got" + javaInvokee.getClass().getName() + " wanted " + method.getDeclaringClass().getName() + ")");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// this test really means, that this is a ruby-defined subclass of a java class<NEW_LINE>//<NEW_LINE>if (// don't bother to check if final method, it won't<NEW_LINE>javaInvokee instanceof ReifiedJavaProxy && // be there (not generated, can't be!)<NEW_LINE>!isFinal) {<NEW_LINE>JavaProxyClass jpc = ((ReifiedJavaProxy) javaInvokee).___jruby$proxyClass();<NEW_LINE>JavaProxyMethod jpm = jpc.getMethod(method.getName(), parameterTypes);<NEW_LINE>if (jpm != null && jpm.hasSuperImplementation()) {<NEW_LINE>return invokeWithExceptionHandling(context, jpm.getSuperMethod(), javaInvokee, arguments);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>javaInvokee = null;<NEW_LINE>}<NEW_LINE>return invokeWithExceptionHandling(context, method, javaInvokee, arguments);<NEW_LINE>} | context, method, null, arguments); |
1,552,104 | private static void decodeBaggageItemsFromResponse(MultivaluedMap<String, String> headers) {<NEW_LINE>if (!RpcInvokeContext.isBaggageEnable() || headers == null || headers.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, String> baggageItems = new <MASK><NEW_LINE>for (Map.Entry<String, List<String>> entry : headers.entrySet()) {<NEW_LINE>if (!entry.getKey().startsWith(RPC_RESPONSE_BAGGAGE_PREFIX) || entry.getValue() == null || entry.getValue().isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String key = entry.getKey().substring(RPC_RESPONSE_BAGGAGE_PREFIX_LEN);<NEW_LINE>String value = entry.getValue().get(0);<NEW_LINE>baggageItems.put(key, value);<NEW_LINE>}<NEW_LINE>RpcInvokeContext.getContext().putAllResponseBaggage(baggageItems);<NEW_LINE>} | HashMap<String, String>(); |
1,855,259 | public static void initialize() {<NEW_LINE>// Update JavaCore options<NEW_LINE>initializeJavaCoreOptions();<NEW_LINE>// Initialize default preferences<NEW_LINE>IEclipsePreferences defEclipsePrefs = DefaultScope.INSTANCE.getNode(IConstants.PLUGIN_ID);<NEW_LINE>defEclipsePrefs.put("org.eclipse.jdt.ui.typefilter.enabled", "");<NEW_LINE>defEclipsePrefs.put(CodeStyleConfiguration.ORGIMPORTS_IMPORTORDER, String.join(";", Preferences.JAVA_IMPORT_ORDER_DEFAULT));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>defEclipsePrefs.put(MembersOrderPreferenceCacheCommon.APPEARANCE_MEMBER_SORT_ORDER, "T,SF,SI,SM,F,I,C,M");<NEW_LINE>defEclipsePrefs.put(CodeGenerationSettingsConstants.CODEGEN_USE_OVERRIDE_ANNOTATION, Boolean.TRUE.toString());<NEW_LINE>defEclipsePrefs.put(StubUtility.CODEGEN_KEYWORD_THIS, Boolean.FALSE.toString());<NEW_LINE>defEclipsePrefs.put(StubUtility.CODEGEN_IS_FOR_GETTERS, Boolean.TRUE.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>defEclipsePrefs.put(StubUtility.CODEGEN_EXCEPTION_VAR_NAME, "e");<NEW_LINE>defEclipsePrefs.put(StubUtility.CODEGEN_ADD_COMMENTS, <MASK><NEW_LINE>ContextTypeRegistry registry = new ContextTypeRegistry();<NEW_LINE>// Register standard context types from JDT<NEW_LINE>CodeTemplateContextType.registerContextTypes(registry);<NEW_LINE>// Register additional context types<NEW_LINE>registry.addContextType(new CodeTemplateContextType(CodeTemplatePreferences.CLASSSNIPPET_CONTEXTTYPE));<NEW_LINE>registry.addContextType(new CodeTemplateContextType(CodeTemplatePreferences.INTERFACESNIPPET_CONTEXTTYPE));<NEW_LINE>registry.addContextType(new CodeTemplateContextType(CodeTemplatePreferences.RECORDSNIPPET_CONTEXTTYPE));<NEW_LINE>// These should be upstreamed into CodeTemplateContextType & GlobalVariables<NEW_LINE>TemplateContextType tmp = registry.getContextType(CodeTemplateContextType.TYPECOMMENT_CONTEXTTYPE);<NEW_LINE>tmp.addResolver(new CodeTemplatePreferences.Month());<NEW_LINE>tmp.addResolver(new CodeTemplatePreferences.ShortMonth());<NEW_LINE>tmp.addResolver(new CodeTemplatePreferences.Day());<NEW_LINE>tmp.addResolver(new CodeTemplatePreferences.Hour());<NEW_LINE>tmp.addResolver(new CodeTemplatePreferences.Minute());<NEW_LINE>JavaManipulation.setCodeTemplateContextRegistry(registry);<NEW_LINE>// Initialize templates<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_FIELDCOMMENT, CodeGenerationTemplate.FIELDCOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_METHODCOMMENT, CodeGenerationTemplate.METHODCOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_CONSTRUCTORCOMMENT, CodeGenerationTemplate.CONSTRUCTORCOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_CONSTRUCTORBODY, CodeGenerationTemplate.CONSTRUCTORBODY.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_DELEGATECOMMENT, CodeGenerationTemplate.DELEGATECOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_OVERRIDECOMMENT, CodeGenerationTemplate.OVERRIDECOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_TYPECOMMENT, CodeGenerationTemplate.TYPECOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_GETTERCOMMENT, CodeGenerationTemplate.GETTERCOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_SETTERCOMMENT, CodeGenerationTemplate.SETTERCOMMENT.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_GETTERBODY, CodeGenerationTemplate.GETTERBODY.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_SETTERBODY, CodeGenerationTemplate.SETTERBOY.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_CATCHBODY, CodeGenerationTemplate.CATCHBODY.createTemplate());<NEW_LINE>templates.put(CodeTemplatePreferences.CODETEMPLATE_METHODBODY, CodeGenerationTemplate.METHODBODY.createTemplate());<NEW_LINE>reloadTemplateStore();<NEW_LINE>} | Boolean.FALSE.toString()); |
1,142,201 | public static double[] convolve(double[] input, double[] filter) {<NEW_LINE>double[] conv = new double[input.length];<NEW_LINE>// fade in and out<NEW_LINE>if (input.length == filter.length) {<NEW_LINE>for (int i = 0; i < input.length; i++) {<NEW_LINE>conv[i] += input[i] * filter[i];<NEW_LINE>}<NEW_LINE>} else // convolution<NEW_LINE>{<NEW_LINE>for (int i = 0; i < input.length; i++) {<NEW_LINE>double convolutedValue = 0;<NEW_LINE><MASK><NEW_LINE>int offset = 0;<NEW_LINE>for (int j = 0; j < filter.length; j++) {<NEW_LINE>offset = i - halfW + j;<NEW_LINE>if (offset >= input.length)<NEW_LINE>offset = input.length - 1;<NEW_LINE>else if (offset < 0)<NEW_LINE>offset = 0;<NEW_LINE>convolutedValue += input[offset] * filter[j];<NEW_LINE>}<NEW_LINE>conv[i] = convolutedValue / (filter.length / 2) - filter.length / 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return conv;<NEW_LINE>} | int halfW = filter.length / 2; |
692,553 | public void exitWccp_id(Wccp_idContext ctx) {<NEW_LINE>if (ctx.group_list != null) {<NEW_LINE>String name = ctx.group_list.getText();<NEW_LINE>int line = ctx.group_list.getStart().getLine();<NEW_LINE>_configuration.referenceStructure(IP_ACCESS_LIST, name, WCCP_GROUP_LIST, line);<NEW_LINE>}<NEW_LINE>if (ctx.redirect_list != null) {<NEW_LINE>String name <MASK><NEW_LINE>int line = ctx.redirect_list.getStart().getLine();<NEW_LINE>_configuration.referenceStructure(IP_ACCESS_LIST, name, WCCP_REDIRECT_LIST, line);<NEW_LINE>}<NEW_LINE>if (ctx.service_list != null) {<NEW_LINE>String name = ctx.service_list.getText();<NEW_LINE>int line = ctx.service_list.getStart().getLine();<NEW_LINE>_configuration.referenceStructure(IP_ACCESS_LIST, name, WCCP_SERVICE_LIST, line);<NEW_LINE>}<NEW_LINE>} | = ctx.redirect_list.getText(); |
293,326 | public ChangeStatus checkStatus(Database database) {<NEW_LINE>ChangeStatus result = new ChangeStatus();<NEW_LINE>try {<NEW_LINE>Sequence sequence = SnapshotGeneratorFactory.getInstance().createSnapshot(new Sequence(getCatalogName(), getSchemaName(), getSequenceName()), database);<NEW_LINE>result.assertComplete(sequence != null, "Sequence " + getSequenceName() + " does not exist");<NEW_LINE>if (sequence != null) {<NEW_LINE>if (getIncrementBy() != null) {<NEW_LINE>result.assertCorrect(getIncrementBy().equals(sequence.getIncrementBy()), "Increment by has a different value");<NEW_LINE>}<NEW_LINE>if (getMinValue() != null) {<NEW_LINE>result.assertCorrect(getMinValue().equals(sequence<MASK><NEW_LINE>}<NEW_LINE>if (getMaxValue() != null) {<NEW_LINE>result.assertCorrect(getMaxValue().equals(sequence.getMaxValue()), "Max Value is different");<NEW_LINE>}<NEW_LINE>if (isOrdered() != null) {<NEW_LINE>result.assertCorrect(isOrdered().equals(sequence.getOrdered()), "Max Value is different");<NEW_LINE>}<NEW_LINE>if (getCycle() != null) {<NEW_LINE>result.assertCorrect(getCycle().equals(sequence.getWillCycle()), "Will Cycle is different");<NEW_LINE>}<NEW_LINE>if (getCacheSize() != null) {<NEW_LINE>result.assertCorrect(getCacheSize().equals(sequence.getCacheSize()), "Cache size is different");<NEW_LINE>}<NEW_LINE>if (getDataType() != null) {<NEW_LINE>result.assertCorrect(getDataType().equals(sequence.getDataType()), "Data type is different");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return result.unknown(e);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | .getMinValue()), "Min Value is different"); |
1,287,472 | private static void addDynamicLayer(ShaderRegistryEntry entry, String texture, int colour, final BiFunction<ShaderLayer, Vector4f, Vector4f> func_getColour, final Consumer<Boolean> func_modifyRender, boolean translucent) {<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "revolver")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:revolvers/shaders/revolver_" + texture), colour<MASK><NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "drill")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/drill_diesel_" + texture), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "buzzsaw")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/buzzsaw_diesel_" + texture), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "chemthrower")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/chemthrower_" + texture), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "railgun")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/railgun_" + texture), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "shield")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/shield_" + texture), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "minecart")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:textures/models/shaders/minecart_" + texture + ".png"), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "balloon")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:block/shaders/balloon_" + texture), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>entry.getCase(new ResourceLocation(ImmersiveEngineering.MODID, "banner")).addLayers(new InternalDynamicShaderLayer(new ResourceLocation("immersiveengineering:block/shaders/banner_" + texture), colour, func_getColour, func_modifyRender, translucent));<NEW_LINE>} | , func_getColour, func_modifyRender, translucent)); |
1,050,044 | private static String computeExportPolicy(BgpNeighborId bgpNeighborId, Configuration c) {<NEW_LINE>// TODO: support non-IP neighbor-id<NEW_LINE>assert bgpNeighborId instanceof BgpNeighborIdAddress;<NEW_LINE>Conjunction peerExportGuard = new Conjunction();<NEW_LINE>List<BooleanExpr> peerExportConditions = peerExportGuard.getConjuncts();<NEW_LINE>List<Statement> exportStatements = new LinkedList<>();<NEW_LINE>exportStatements.add(new If("peer-export policy main conditional: exitAccept if true / exitReject if false", peerExportGuard, ImmutableList.of(Statements.ExitAccept.toStaticStatement()), ImmutableList.of(Statements.<MASK><NEW_LINE>peerExportConditions.add(new CallExpr(generatedBgpCommonExportPolicyName(DEFAULT_VRF_NAME)));<NEW_LINE>RoutingPolicy exportPolicy = new RoutingPolicy(generatedBgpPeerExportPolicyName(DEFAULT_VRF_NAME, ((BgpNeighborIdAddress) bgpNeighborId).getAddress().toString()), c);<NEW_LINE>exportPolicy.setStatements(exportStatements);<NEW_LINE>c.getRoutingPolicies().put(exportPolicy.getName(), exportPolicy);<NEW_LINE>return exportPolicy.getName();<NEW_LINE>} | ExitReject.toStaticStatement()))); |
976,393 | public void prepare(Map<String, Object> conf, TopologyContext context, OutputCollector collector) {<NEW_LINE>String mdF = ConfUtils.getString(conf, metadataFilterParamName);<NEW_LINE>if (StringUtils.isNotBlank(mdF)) {<NEW_LINE>// split it in key value<NEW_LINE>int equals = mdF.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String key = mdF.substring(0, equals);<NEW_LINE>String value = mdF.substring(equals + 1);<NEW_LINE>filterKeyValue = new String[] { key.trim(), value.trim() };<NEW_LINE>} else {<NEW_LINE>LOG.error("Can't split into key value : {}", mdF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fieldNameForText = ConfUtils.getString(conf, textFieldParamName);<NEW_LINE>maxLengthText = ConfUtils.getInt(conf, textLengthParamName, -1);<NEW_LINE>fieldNameForURL = ConfUtils.getString(conf, urlFieldParamName);<NEW_LINE>canonicalMetadataName = ConfUtils.getString(conf, canonicalMetadataParamName);<NEW_LINE>for (String mapping : ConfUtils.loadListFromConf(metadata2fieldParamName, conf)) {<NEW_LINE>int equals = mapping.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String key = mapping.substring(0, equals).trim();<NEW_LINE>String value = mapping.substring(equals + 1).trim();<NEW_LINE><MASK><NEW_LINE>LOG.info("Mapping key {} to field {}", key, value);<NEW_LINE>} else {<NEW_LINE>mapping = mapping.trim();<NEW_LINE>metadata2field.put(mapping, mapping);<NEW_LINE>LOG.info("Mapping key {} to field {}", mapping, mapping);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | metadata2field.put(key, value); |
819,619 | protected PsiReference[] doGetReferencesFromProviders(PsiElement context, PsiReferenceService.Hints hints) {<NEW_LINE>List<ProviderBinding.ProviderInfo<PsiReferenceProvider, ProcessingContext>> providersForContextLanguage = getRegistrar(context.getLanguage()).getPairsByElement(context, hints);<NEW_LINE>List<ProviderBinding.ProviderInfo<PsiReferenceProvider, ProcessingContext>> providersForAllLanguages = getRegistrar(Language.ANY).getPairsByElement(context, hints);<NEW_LINE>int providersCount = providersForContextLanguage.size() + providersForAllLanguages.size();<NEW_LINE>if (providersCount == 0) {<NEW_LINE>return PsiReference.EMPTY_ARRAY;<NEW_LINE>}<NEW_LINE>if (providersCount == 1) {<NEW_LINE>final ProviderBinding.ProviderInfo<PsiReferenceProvider, ProcessingContext> firstProvider = (providersForAllLanguages.isEmpty() ? providersForContextLanguage : providersForAllLanguages).get(0);<NEW_LINE>return firstProvider.provider.getReferencesByElement(context, firstProvider.processingContext);<NEW_LINE>}<NEW_LINE>List<ProviderBinding.ProviderInfo<PsiReferenceProvider, ProcessingContext>> list = ContainerUtil.concat(providersForContextLanguage, providersForAllLanguages);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>ProviderBinding.ProviderInfo<PsiReferenceProvider, ProcessingContext>[] providers = list.toArray(new ProviderBinding.ProviderInfo[list.size()]);<NEW_LINE>Arrays.sort(providers, PRIORITY_COMPARATOR);<NEW_LINE>List<PsiReference> result = new ArrayList<PsiReference>();<NEW_LINE>final double <MASK><NEW_LINE>next: for (ProviderBinding.ProviderInfo<PsiReferenceProvider, ProcessingContext> trinity : providers) {<NEW_LINE>final PsiReference[] refs;<NEW_LINE>try {<NEW_LINE>refs = trinity.provider.getReferencesByElement(context, trinity.processingContext);<NEW_LINE>} catch (IndexNotReadyException ex) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (trinity.priority != maxPriority) {<NEW_LINE>for (PsiReference ref : refs) {<NEW_LINE>for (PsiReference reference : result) {<NEW_LINE>if (ref != null && ReferenceRange.containsRangeInElement(reference, ref.getRangeInElement())) {<NEW_LINE>continue next;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (PsiReference ref : refs) {<NEW_LINE>if (ref != null) {<NEW_LINE>result.add(ref);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result.isEmpty() ? PsiReference.EMPTY_ARRAY : ContainerUtil.toArray(result, new PsiReference[result.size()]);<NEW_LINE>} | maxPriority = providers[0].priority; |
975,472 | protected double[] multivariateStandardization(double[] raw) {<NEW_LINE>final int len = raw.length / multiplicity;<NEW_LINE>if (len <= 1) {<NEW_LINE>return raw;<NEW_LINE>}<NEW_LINE>// Two pass normalization is numerically most stable,<NEW_LINE>// And Java should optimize this well enough.<NEW_LINE>double[] mean = new double[multiplicity];<NEW_LINE>for (int i = 0, j = 0; i < raw.length; ++i, j = ++j == multiplicity ? 0 : j) {<NEW_LINE>final double v = raw[i];<NEW_LINE>if (v != v) {<NEW_LINE>// NaN guard<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>mean[j] += v;<NEW_LINE>}<NEW_LINE>for (int j = 0; j < multiplicity; ++j) {<NEW_LINE>mean[j] *= multiplicity / (double) len;<NEW_LINE>}<NEW_LINE>// Initially, the sum of squares, later the inverse std.<NEW_LINE>double[] istd = new double[multiplicity];<NEW_LINE>for (int i = 0, j = 0; i < raw.length; ++i, j = ++j == multiplicity ? 0 : j) {<NEW_LINE>final double v = raw[i] - mean[j];<NEW_LINE>if (v != v) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>istd[j] += v * v;<NEW_LINE>}<NEW_LINE>// Compute the INVERSE standard deviation from ssq.<NEW_LINE>for (int j = 0; j < multiplicity; ++j) {<NEW_LINE>istd[j] = istd[j] > 0. ? Math.sqrt(len <MASK><NEW_LINE>}<NEW_LINE>for (int i = 0, j = 0; i < raw.length; ++i, j = ++j == multiplicity ? 0 : j) {<NEW_LINE>raw[i] = (raw[i] - mean[j]) * istd[j];<NEW_LINE>}<NEW_LINE>return raw;<NEW_LINE>} | / istd[j]) : 1; |
897,789 | public void acceptMethodTypeParameter(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, int selectorStart, int selectorEnd, char[] typeParameterName, boolean isDeclaration, int start, int end) {<NEW_LINE>IType type = resolveTypeByLocation(declaringTypePackageName, declaringTypeName, NameLookup.ACCEPT_ALL, selectorStart, selectorEnd);<NEW_LINE>if (type != null) {<NEW_LINE>IMethod method = null;<NEW_LINE>String name = new String(selector);<NEW_LINE>IMethod[] methods = null;<NEW_LINE>try {<NEW_LINE>methods = type.getMethods();<NEW_LINE>done: for (int i = 0; i < methods.length; i++) {<NEW_LINE>ISourceRange range = methods[i].getNameRange();<NEW_LINE>if (range.getOffset() >= selectorStart && range.getOffset() + range.getLength() <= selectorEnd && methods[i].getElementName().equals(name)) {<NEW_LINE>method = methods[i];<NEW_LINE>break done;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// nothing to do<NEW_LINE>}<NEW_LINE>if (method == null) {<NEW_LINE>addElement(type);<NEW_LINE>if (SelectionEngine.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.print("SELECTION - accept type(");<NEW_LINE>System.out.print(type.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(")");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ITypeParameter typeParameter = method.getTypeParameter(new String(typeParameterName));<NEW_LINE>if (typeParameter == null) {<NEW_LINE>addElement(method);<NEW_LINE>if (SelectionEngine.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>System.out.print(method.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(")");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addElement(typeParameter);<NEW_LINE>if (SelectionEngine.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.print("SELECTION - accept method type parameter(");<NEW_LINE>System.out.print(typeParameter.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | System.out.print("SELECTION - accept method("); |
1,329,056 | public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Record12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> newRecord(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12) {<NEW_LINE>return (Record12) newRecord(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9<MASK><NEW_LINE>} | , field10, field11, field12 }); |
1,632,035 | public boolean visit(SQLAlterTableAddPartition x) {<NEW_LINE>boolean printAdd = true;<NEW_LINE>if (x.getParent() instanceof SQLAlterTableStatement) {<NEW_LINE>SQLAlterTableStatement stmt = (SQLAlterTableStatement) x.getParent();<NEW_LINE>int p = stmt.getChildren().indexOf(x);<NEW_LINE>if (p > 0 && stmt.getChildren().get(p - 1) instanceof SQLAlterTableAddPartition) {<NEW_LINE>printAdd = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (printAdd) {<NEW_LINE>print0(ucase ? "ADD " : "add ");<NEW_LINE>if (x.isIfNotExists()) {<NEW_LINE>print0(ucase ? "IF NOT EXISTS " : "if not exists ");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>print('\t');<NEW_LINE>indentCount++;<NEW_LINE>}<NEW_LINE>if (x.getPartitionCount() != null) {<NEW_LINE>print0(ucase ? "PARTITION PARTITIONS " : "partition partitions ");<NEW_LINE>x.getPartitionCount().accept(this);<NEW_LINE>}<NEW_LINE>if (x.getPartitions().size() > 0) {<NEW_LINE>print0(ucase ? "PARTITION (" : "partition (");<NEW_LINE>printAndAccept(<MASK><NEW_LINE>print(')');<NEW_LINE>}<NEW_LINE>SQLExpr location = x.getLocation();<NEW_LINE>if (location != null) {<NEW_LINE>print0(ucase ? " LOCATION " : " locationn ");<NEW_LINE>location.accept(this);<NEW_LINE>}<NEW_LINE>if (!printAdd) {<NEW_LINE>indentCount--;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | x.getPartitions(), ", "); |
1,221,220 | public void onSuccess(EntityStream[] results) {<NEW_LINE>if (// entity stream is less than threshold<NEW_LINE>results.length == 1) {<NEW_LINE>StreamResponse response = res.builder().build(results[0]);<NEW_LINE>nextFilter.onResponse(response, requestContext, wireAttrs);<NEW_LINE>} else {<NEW_LINE>EntityStream compressedStream = compressor.deflate(EntityStreams.newEntityStream(new CompositeWriter(results)));<NEW_LINE><MASK><NEW_LINE>// remove original content-length header if presents.<NEW_LINE>if (builder.getHeader(HttpConstants.CONTENT_LENGTH) != null) {<NEW_LINE>Map<String, String> headers = stripHeaders(builder.getHeaders(), HttpConstants.CONTENT_LENGTH);<NEW_LINE>builder.setHeaders(headers);<NEW_LINE>}<NEW_LINE>StreamResponse response = builder.addHeaderValue(HttpConstants.CONTENT_ENCODING, compressor.getContentEncodingName()).build(compressedStream);<NEW_LINE>nextFilter.onResponse(response, requestContext, wireAttrs);<NEW_LINE>}<NEW_LINE>} | StreamResponseBuilder builder = res.builder(); |
1,082,728 | public static List<OpenSSLX509Certificate> fromPkcs7DerInputStream(InputStream is) throws ParsingException {<NEW_LINE>@SuppressWarnings("resource")<NEW_LINE>OpenSSLBIOInputStream bis <MASK><NEW_LINE>final long[] certRefs;<NEW_LINE>try {<NEW_LINE>certRefs = NativeCrypto.d2i_PKCS7_bio(bis.getBioContext(), NativeCrypto.PKCS7_CERTS);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ParsingException(e);<NEW_LINE>} finally {<NEW_LINE>bis.release();<NEW_LINE>}<NEW_LINE>if (certRefs == null) {<NEW_LINE>// To avoid returning a immutable list in only one path, we create an<NEW_LINE>// empty list here instead of using Collections.emptyList()<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>final List<OpenSSLX509Certificate> certs = new ArrayList<>(certRefs.length);<NEW_LINE>for (long certRef : certRefs) {<NEW_LINE>if (certRef == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>certs.add(new OpenSSLX509Certificate(certRef));<NEW_LINE>}<NEW_LINE>return certs;<NEW_LINE>} | = new OpenSSLBIOInputStream(is, true); |
705,453 | public static SearchTracesResponse unmarshall(SearchTracesResponse searchTracesResponse, UnmarshallerContext _ctx) {<NEW_LINE>searchTracesResponse.setRequestId(_ctx.stringValue("SearchTracesResponse.RequestId"));<NEW_LINE>List<TraceInfo> traceInfos = new ArrayList<TraceInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("SearchTracesResponse.TraceInfos.Length"); i++) {<NEW_LINE>TraceInfo traceInfo = new TraceInfo();<NEW_LINE>traceInfo.setOperationName(_ctx.stringValue("SearchTracesResponse.TraceInfos[" + i + "].OperationName"));<NEW_LINE>traceInfo.setServiceIp(_ctx.stringValue("SearchTracesResponse.TraceInfos[" + i + "].ServiceIp"));<NEW_LINE>traceInfo.setDuration(_ctx.longValue("SearchTracesResponse.TraceInfos[" + i + "].Duration"));<NEW_LINE>traceInfo.setTimestamp(_ctx.longValue<MASK><NEW_LINE>traceInfo.setServiceName(_ctx.stringValue("SearchTracesResponse.TraceInfos[" + i + "].ServiceName"));<NEW_LINE>traceInfo.setTraceID(_ctx.stringValue("SearchTracesResponse.TraceInfos[" + i + "].TraceID"));<NEW_LINE>traceInfos.add(traceInfo);<NEW_LINE>}<NEW_LINE>searchTracesResponse.setTraceInfos(traceInfos);<NEW_LINE>return searchTracesResponse;<NEW_LINE>} | ("SearchTracesResponse.TraceInfos[" + i + "].Timestamp")); |
737,380 | public void put(@NotNull final String clientId, @NotNull final ClientSession newClientSession, final long timestamp, final int bucketIndex) {<NEW_LINE>checkNotNull(clientId, "Client id must not be null");<NEW_LINE>checkNotNull(newClientSession, "Client session must not be null");<NEW_LINE>checkArgument(timestamp > 0, "Timestamp must be greater than 0");<NEW_LINE>ThreadPreConditions.startsWith(SINGLE_WRITER_THREAD_PREFIX);<NEW_LINE>final Map<String, PersistenceEntry<ClientSession>> sessions = getBucket(bucketIndex);<NEW_LINE>final ClientSession usedSession = newClientSession.deepCopy();<NEW_LINE>sessions.compute(clientId, (ignored, storedSession) -> {<NEW_LINE>final boolean addClientIdSize;<NEW_LINE>if (storedSession == null) {<NEW_LINE>sessionsCount.incrementAndGet();<NEW_LINE>addClientIdSize = true;<NEW_LINE>} else {<NEW_LINE>final ClientSession oldSession = storedSession.getObject();<NEW_LINE>currentMemorySize.addAndGet(-storedSession.getEstimatedSize());<NEW_LINE>removeWillReference(oldSession);<NEW_LINE>final boolean oldSessionIsPersistent = isPersistent(oldSession);<NEW_LINE>if (!oldSessionIsPersistent && !oldSession.isConnected()) {<NEW_LINE>sessionsCount.incrementAndGet();<NEW_LINE>}<NEW_LINE>addClientIdSize = false;<NEW_LINE>}<NEW_LINE>final ClientSessionWill newWill = newClientSession.getWillPublish();<NEW_LINE>if (newWill != null) {<NEW_LINE>metricsHolder.getStoredWillMessagesCount().inc();<NEW_LINE>payloadPersistence.add(newWill.getPayload(), 1, newWill.getPublishId());<NEW_LINE>}<NEW_LINE>final PersistenceEntry<ClientSession> newEntry = new PersistenceEntry<>(usedSession, timestamp);<NEW_LINE>currentMemorySize.addAndGet(newEntry.getEstimatedSize());<NEW_LINE>if (addClientIdSize) {<NEW_LINE>currentMemorySize.addAndGet<MASK><NEW_LINE>}<NEW_LINE>return newEntry;<NEW_LINE>});<NEW_LINE>} | (ObjectMemoryEstimation.stringSize(clientId)); |
1,006,147 | private // that we can run it after goog.scope processing, and get rid of the inGoogScope check.<NEW_LINE>void checkForUnusedLocalVar(Var v, Reference unusedAssignment) {<NEW_LINE>if (!v.isLocal()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(unusedAssignment.getNode());<NEW_LINE>if (jsDoc != null && jsDoc.hasTypedefType()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean inGoogScope = false;<NEW_LINE>Scope s = v.getScope();<NEW_LINE>if (s.isFunctionBlockScope()) {<NEW_LINE>Node function = s.getRootNode().getParent();<NEW_LINE>Node callee = function.getPrevious();<NEW_LINE>inGoogScope = callee != null && callee.matchesQualifiedName("goog.scope");<NEW_LINE>}<NEW_LINE>if (inGoogScope) {<NEW_LINE>// No warning.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (s.isModuleScope()) {<NEW_LINE>Node statement = NodeUtil.getEnclosingStatement(v.getNode());<NEW_LINE>if (NodeUtil.isNameDeclaration(statement)) {<NEW_LINE><MASK><NEW_LINE>Node rhs = lhs.getFirstChild();<NEW_LINE>if (rhs != null && (NodeUtil.isCallTo(rhs, "goog.forwardDeclare") || NodeUtil.isCallTo(rhs, "goog.requireType") || NodeUtil.isCallTo(rhs, "goog.require") || rhs.isQualifiedName())) {<NEW_LINE>// No warning. module imports will be caught by the unused-require check, and if the<NEW_LINE>// right side is a qualified name then this is likely an alias used in type annotations.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>compiler.report(JSError.make(unusedAssignment.getNode(), UNUSED_LOCAL_ASSIGNMENT, v.getName()));<NEW_LINE>} | Node lhs = statement.getFirstChild(); |
925,475 | public void onrequest(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "p", required = false) String p) {<NEW_LINE>Payload payload <MASK><NEW_LINE>payload.setPattern("/afx/worker/");<NEW_LINE>String finalURI = payload.getFinalURI();<NEW_LINE>Optional<String> optional = Optional.ofNullable(payload.getRequestURI()).filter(e -> e.endsWith("resource.afx"));<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>finalURI = payload.param("path");<NEW_LINE>}<NEW_LINE>if (finalURI.matches(".*\\.(asc|asciidoc|ad|adoc|md|markdown)$")) {<NEW_LINE>if (controller.getIncludeAsciidocResource()) {<NEW_LINE>payload.write(String.format("link:%s[]", finalURI));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (finalURI.startsWith("//")) {<NEW_LINE>finalURI = finalURI.replace("//", "http://");<NEW_LINE>}<NEW_LINE>if (finalURI.startsWith("http://") || finalURI.startsWith("https://")) {<NEW_LINE>String data = "";<NEW_LINE>try {<NEW_LINE>data = restTemplate.getForObject(finalURI, String.class);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.warn("resource not found or not readable: {}", finalURI);<NEW_LINE>}<NEW_LINE>payload.write(data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>Path found = directoryService.findPathInWorkdirOrLookup(IOHelper.getPath(finalURI));<NEW_LINE>if (Objects.nonNull(found)) {<NEW_LINE>fileService.processFile(request, response, found);<NEW_LINE>} else {<NEW_LINE>Path path = directoryService.findPathInPublic(finalURI);<NEW_LINE>fileService.processFile(request, response, path);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>commonResource.processPayload(payload);<NEW_LINE>} | = new Payload(request, response); |
1,441,256 | public AmazonOpenSearchParameters unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AmazonOpenSearchParameters amazonOpenSearchParameters = new AmazonOpenSearchParameters();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Domain", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>amazonOpenSearchParameters.setDomain(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 amazonOpenSearchParameters;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
520,178 | final GetAttributeGroupResult executeGetAttributeGroup(GetAttributeGroupRequest getAttributeGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAttributeGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAttributeGroupRequest> request = null;<NEW_LINE>Response<GetAttributeGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAttributeGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAttributeGroupRequest));<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, "Service Catalog AppRegistry");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAttributeGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAttributeGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAttributeGroup"); |
1,004,359 | private void sendMarketData(OrderCommand cmd) {<NEW_LINE>final L2MarketData marketData = cmd.marketData;<NEW_LINE>if (marketData != null) {<NEW_LINE>final List<IEventsHandler.OrderBookRecord> asks = new ArrayList<>(marketData.askSize);<NEW_LINE>for (int i = 0; i < marketData.askSize; i++) {<NEW_LINE>asks.add(new IEventsHandler.OrderBookRecord(marketData.askPrices[i], marketData.askVolumes[i], (int) marketData.askOrders[i]));<NEW_LINE>}<NEW_LINE>final List<IEventsHandler.OrderBookRecord> bids = new <MASK><NEW_LINE>for (int i = 0; i < marketData.bidSize; i++) {<NEW_LINE>bids.add(new IEventsHandler.OrderBookRecord(marketData.bidPrices[i], marketData.bidVolumes[i], (int) marketData.bidOrders[i]));<NEW_LINE>}<NEW_LINE>eventsHandler.orderBook(new IEventsHandler.OrderBook(cmd.symbol, asks, bids, cmd.timestamp));<NEW_LINE>}<NEW_LINE>} | ArrayList<>(marketData.bidSize); |
855,331 | public static OnsMessagePageQueryByTopicResponse unmarshall(OnsMessagePageQueryByTopicResponse onsMessagePageQueryByTopicResponse, UnmarshallerContext _ctx) {<NEW_LINE>onsMessagePageQueryByTopicResponse.setRequestId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.RequestId"));<NEW_LINE>onsMessagePageQueryByTopicResponse.setHelpUrl(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.HelpUrl"));<NEW_LINE>MsgFoundDo msgFoundDo = new MsgFoundDo();<NEW_LINE>msgFoundDo.setCurrentPage<MASK><NEW_LINE>msgFoundDo.setMaxPageCount(_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MaxPageCount"));<NEW_LINE>msgFoundDo.setTaskId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.TaskId"));<NEW_LINE>List<OnsRestMessageDo> msgFoundList = new ArrayList<OnsRestMessageDo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList.Length"); i++) {<NEW_LINE>OnsRestMessageDo onsRestMessageDo = new OnsRestMessageDo();<NEW_LINE>onsRestMessageDo.setOffsetId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].OffsetId"));<NEW_LINE>onsRestMessageDo.setStoreSize(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreSize"));<NEW_LINE>onsRestMessageDo.setReconsumeTimes(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].ReconsumeTimes"));<NEW_LINE>onsRestMessageDo.setStoreTimestamp(_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreTimestamp"));<NEW_LINE>onsRestMessageDo.setBody(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].Body"));<NEW_LINE>onsRestMessageDo.setInstanceId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].InstanceId"));<NEW_LINE>onsRestMessageDo.setMsgId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].MsgId"));<NEW_LINE>onsRestMessageDo.setFlag(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].Flag"));<NEW_LINE>onsRestMessageDo.setStoreHost(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreHost"));<NEW_LINE>onsRestMessageDo.setTopic(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].Topic"));<NEW_LINE>onsRestMessageDo.setBornTimestamp(_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].BornTimestamp"));<NEW_LINE>onsRestMessageDo.setBodyCRC(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].BodyCRC"));<NEW_LINE>onsRestMessageDo.setBornHost(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].BornHost"));<NEW_LINE>List<MessageProperty> propertyList = new ArrayList<MessageProperty>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList.Length"); j++) {<NEW_LINE>MessageProperty messageProperty = new MessageProperty();<NEW_LINE>messageProperty.setValue(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList[" + j + "].Value"));<NEW_LINE>messageProperty.setName(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList[" + j + "].Name"));<NEW_LINE>propertyList.add(messageProperty);<NEW_LINE>}<NEW_LINE>onsRestMessageDo.setPropertyList(propertyList);<NEW_LINE>msgFoundList.add(onsRestMessageDo);<NEW_LINE>}<NEW_LINE>msgFoundDo.setMsgFoundList(msgFoundList);<NEW_LINE>onsMessagePageQueryByTopicResponse.setMsgFoundDo(msgFoundDo);<NEW_LINE>return onsMessagePageQueryByTopicResponse;<NEW_LINE>} | (_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.CurrentPage")); |
811,985 | public String[] listOnDeviceMmkvConfig() {<NEW_LINE>checkState();<NEW_LINE>File mmkvBaseDir = new File(MMKV.getRootDir());<NEW_LINE>File[] mmkvConfigListFiles = mmkvBaseDir.listFiles();<NEW_LINE>if (mmkvConfigListFiles == null) {<NEW_LINE>return new String[0];<NEW_LINE>} else {<NEW_LINE>List<String> mmkvConfigList = new ArrayList<>();<NEW_LINE>for (File mmkvConfigListFile : mmkvConfigListFiles) {<NEW_LINE>if (!mmkvConfigListFile.isDirectory()) {<NEW_LINE><MASK><NEW_LINE>if (!name.endsWith(".crc") && !name.endsWith(".zip") && new File(mmkvConfigListFile.getAbsolutePath() + ".crc").exists()) {<NEW_LINE>mmkvConfigList.add(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mmkvConfigList.toArray(new String[0]);<NEW_LINE>}<NEW_LINE>} | String name = mmkvConfigListFile.getName(); |
93,145 | private void editValues(PlayerProfile profile) {<NEW_LINE>mcMMO.p.debug("========================================================================");<NEW_LINE>mcMMO.p.debug("Conversion report for " + profile.getPlayerName() + ":");<NEW_LINE>for (PrimarySkillType primarySkillType : SkillTools.NON_CHILD_SKILLS) {<NEW_LINE>int oldLevel = profile.getSkillLevel(primarySkillType);<NEW_LINE>int oldXPLevel = profile.getSkillXpLevel(primarySkillType);<NEW_LINE>int totalOldXP = mcMMO.getFormulaManager().calculateTotalExperience(oldLevel, oldXPLevel);<NEW_LINE>if (totalOldXP == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int[] newExperienceValues = mcMMO.getFormulaManager().calculateNewLevel(primarySkillType, (int) Math.floor(totalOldXP / ExperienceConfig.getInstance().getExpModifier()), formulaType);<NEW_LINE>int newLevel = newExperienceValues[0];<NEW_LINE>int newXPlevel = newExperienceValues[1];<NEW_LINE>mcMMO.p.debug(" Skill: " + primarySkillType.toString());<NEW_LINE>mcMMO.p.debug(" OLD:");<NEW_LINE>mcMMO.p.debug(" Level: " + oldLevel);<NEW_LINE>mcMMO.p.debug(" XP " + oldXPLevel);<NEW_LINE>mcMMO.<MASK><NEW_LINE>mcMMO.p.debug(" NEW:");<NEW_LINE>mcMMO.p.debug(" Level " + newLevel);<NEW_LINE>mcMMO.p.debug(" XP " + newXPlevel);<NEW_LINE>mcMMO.p.debug("------------------------------------------------------------------------");<NEW_LINE>profile.modifySkill(primarySkillType, newLevel);<NEW_LINE>profile.setSkillXpLevel(primarySkillType, newXPlevel);<NEW_LINE>}<NEW_LINE>} | p.debug(" Total XP " + totalOldXP); |
82,991 | /*<NEW_LINE>* Performs the logging.<NEW_LINE>*<NEW_LINE>* @param format format-able message.<NEW_LINE>* @param args Arguments for the message, if an exception is being logged last argument is the throwable.<NEW_LINE>*/<NEW_LINE>private void performLogging(LogLevel logLevel, String format, Object... args) {<NEW_LINE>Throwable throwable = null;<NEW_LINE>if (doesArgsHaveThrowable(args)) {<NEW_LINE>Object throwableObj = args[args.length - 1];<NEW_LINE>// This is true from before but is needed to appease SpotBugs.<NEW_LINE>if (throwableObj instanceof Throwable) {<NEW_LINE>throwable = (Throwable) throwableObj;<NEW_LINE>}<NEW_LINE>if (!logger.isDebugEnabled()) {<NEW_LINE>args = removeThrowable(args);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FormattingTuple tuple = MessageFormatter.arrayFormat(format, args);<NEW_LINE>String message = getMessageWithContext(<MASK><NEW_LINE>switch(logLevel) {<NEW_LINE>case VERBOSE:<NEW_LINE>logger.debug(message, tuple.getThrowable());<NEW_LINE>break;<NEW_LINE>case INFORMATIONAL:<NEW_LINE>logger.info(message, tuple.getThrowable());<NEW_LINE>break;<NEW_LINE>case WARNING:<NEW_LINE>logger.warn(message, tuple.getThrowable());<NEW_LINE>break;<NEW_LINE>case ERROR:<NEW_LINE>logger.error(message, tuple.getThrowable());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// Don't do anything, this state shouldn't be possible.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | tuple.getMessage(), throwable); |
58,536 | private ObjectNode updateGatewayResponse(Context<? extends Trait> context, CorsTrait trait, Map<CorsHeader, String> sharedHeaders, ObjectNode gatewayResponse) {<NEW_LINE>ObjectNode responseParameters = gatewayResponse.getObjectMember(RESPONSE_PARAMETERS_KEY).orElse(Node.objectNode());<NEW_LINE>// Track all CORS headers of the gateway response.<NEW_LINE>Map<CorsHeader, String> headers = new TreeMap<>(sharedHeaders);<NEW_LINE>// Add the modeled additional headers. These could potentially be added by an<NEW_LINE>// apigateway feature, so they need to be present.<NEW_LINE>Set<String> exposedHeaders = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>exposedHeaders.addAll(trait.getAdditionalExposedHeaders());<NEW_LINE>// Find all headers exposed already in the response. These need to be added to the<NEW_LINE>// Access-Control-Expose-Headers header if any are found.<NEW_LINE>for (String key : responseParameters.getStringMap().keySet()) {<NEW_LINE>if (key.startsWith(HEADER_PREFIX)) {<NEW_LINE>exposedHeaders.add(key.substring(HEADER_PREFIX.length()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!exposedHeaders.isEmpty()) {<NEW_LINE>headers.put(CorsHeader.EXPOSE_HEADERS, String.join(",", exposedHeaders));<NEW_LINE>}<NEW_LINE>// Merge the defined response parameters with the derived CORS headers.<NEW_LINE>ObjectNode.Builder responseBuilder = responseParameters.toBuilder();<NEW_LINE>for (Map.Entry<CorsHeader, String> entry : headers.entrySet()) {<NEW_LINE>String key = HEADER_PREFIX + entry.getKey().toString();<NEW_LINE>if (!responseParameters.getMember(key).isPresent()) {<NEW_LINE>responseBuilder.withMember(key, "'" + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return gatewayResponse.withMember(RESPONSE_PARAMETERS_KEY, responseBuilder.build());<NEW_LINE>} | entry.getValue() + "'"); |
782,236 | public com.amazonaws.services.route53domains.model.UnsupportedTLDException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.route53domains.model.UnsupportedTLDException unsupportedTLDException = new com.amazonaws.services.route53domains.model.UnsupportedTLDException(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>} 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 unsupportedTLDException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,221,295 | public static <T extends ImageGray<T>> T convertFrom(IplImage input, @Nullable T output) {<NEW_LINE>if (input.nChannels() != 1)<NEW_LINE>throw new IllegalArgumentException("Expected 1 channel for gray scale images");<NEW_LINE>ImageDataType dataType = depthToBoofType(input.depth());<NEW_LINE><MASK><NEW_LINE>int height = input.height();<NEW_LINE>if (output != null) {<NEW_LINE>if (output.isSubimage())<NEW_LINE>throw new IllegalArgumentException("Can't handle sub-images");<NEW_LINE>if (output.getDataType() != dataType)<NEW_LINE>throw new IllegalArgumentException("Expected data type of " + dataType + " found " + output.getDataType() + " instead");<NEW_LINE>output.reshape(width, height);<NEW_LINE>} else {<NEW_LINE>output = (T) GeneralizedImageOps.createSingleBand(dataType, width, height);<NEW_LINE>}<NEW_LINE>switch(dataType) {<NEW_LINE>case U8:<NEW_LINE>case S8:<NEW_LINE>convertFrom_G(input, (GrayI8) output);<NEW_LINE>break;<NEW_LINE>case S16:<NEW_LINE>convertFrom_G(input, (GrayS16) output);<NEW_LINE>break;<NEW_LINE>case S32:<NEW_LINE>convertFrom_G(input, (GrayS32) output);<NEW_LINE>break;<NEW_LINE>case F32:<NEW_LINE>convertFrom_G(input, (GrayF32) output);<NEW_LINE>break;<NEW_LINE>case F64:<NEW_LINE>convertFrom_G(input, (GrayF64) output);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Add support for type " + dataType);<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | int width = input.width(); |
1,384,140 | private static IndexRecord indexColumnRecord(String catalog, String schema, String tableName, boolean nonUnique, String indexName, String indexTableName, String nullable, String indexType, int indexLocation, IndexStatus indexStatus, long version, String indexComment, int seqInIndex, SqlIndexColumnName column, boolean clusteredIndex) {<NEW_LINE>final <MASK><NEW_LINE>final String collation = null == column.isAsc() ? null : (column.isAsc() ? "A" : "D");<NEW_LINE>final Long subPart = null == column.getLength() ? null : (RelUtils.longValue(column.getLength()));<NEW_LINE>final String packed = null;<NEW_LINE>final String comment = "INDEX";<NEW_LINE>return new IndexRecord(-1, catalog, schema, tableName, nonUnique, schema, indexName, seqInIndex, columnName, collation, 0, subPart, packed, nullable, indexType, comment, indexComment, IndexColumnType.INDEX.getValue(), indexLocation, indexTableName, indexStatus.getValue(), version, clusteredIndex ? IndexesRecord.FLAG_CLUSTERED : 0L);<NEW_LINE>} | String columnName = column.getColumnNameStr(); |
1,329,651 | String[] list(@Nonnull VirtualFile file) {<NEW_LINE>String path = file.getPath();<NEW_LINE>FileInfo[] fileInfo = myKernel.listChildren(path);<NEW_LINE>if (fileInfo == null || fileInfo.length == 0) {<NEW_LINE>return ArrayUtil.EMPTY_STRING_ARRAY;<NEW_LINE>}<NEW_LINE>String[] names = new String[fileInfo.length];<NEW_LINE>IntObjectMap<Map<String, FileAttributes>> map = getMap();<NEW_LINE>int parentId = ((VirtualFileWithId) file).getId();<NEW_LINE>Map<String, FileAttributes> <MASK><NEW_LINE>if (nestedMap == null) {<NEW_LINE>nestedMap = Maps.newHashMap(fileInfo.length, FileUtil.PATH_HASHING_STRATEGY);<NEW_LINE>map.put(parentId, nestedMap);<NEW_LINE>}<NEW_LINE>for (int i = 0, length = fileInfo.length; i < length; i++) {<NEW_LINE>FileInfo info = fileInfo[i];<NEW_LINE>String name = info.getName();<NEW_LINE>nestedMap.put(name, info.toFileAttributes());<NEW_LINE>names[i] = name;<NEW_LINE>}<NEW_LINE>return names;<NEW_LINE>} | nestedMap = map.get(parentId); |
973,210 | private void loadCustomizedActions(GradleExecConfiguration c) {<NEW_LINE>String id;<NEW_LINE>if (c != null) {<NEW_LINE>id = c.getId();<NEW_LINE>} else {<NEW_LINE>id = GradleExecConfiguration.DEFAULT;<NEW_LINE>}<NEW_LINE>ActionsHolder h = configHolders.get(id);<NEW_LINE>if (h != null) {<NEW_LINE>customActions = h.customActions;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ActionsHolder nh = new ActionsHolder(c);<NEW_LINE>ConfigurableActionProvider configP = project.getLookup().lookup(ConfigurableActionProvider.class);<NEW_LINE>ProjectActionMappingProvider actionP = null;<NEW_LINE>if (configP != null) {<NEW_LINE>actionP = configP.findActionProvider(id);<NEW_LINE>}<NEW_LINE>if (actionP == null) {<NEW_LINE>actionP = project.getLookup().lookup(ProjectActionMappingProvider.class);<NEW_LINE>}<NEW_LINE>if (actionP != null) {<NEW_LINE>ProjectActionMappingProvider fa = actionP;<NEW_LINE>Set<String<MASK><NEW_LINE>customizedActions.forEach((action) -> {<NEW_LINE>ActionMapping ca = fa.findMapping(action);<NEW_LINE>if (ca == null) {<NEW_LINE>ca = DefaultActionMapping.DISABLED;<NEW_LINE>}<NEW_LINE>CustomActionMapping mapping = new CustomActionMapping(ca, action);<NEW_LINE>nh.customActions.put(action, mapping);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>configHolders.put(id, nh);<NEW_LINE>customActions = nh.customActions;<NEW_LINE>} | > customizedActions = actionP.customizedActions(); |
734,287 | public static UpnpHeader newInstance(UpnpHeader.Type type, String headerValue) {<NEW_LINE>// Try all the UPnP headers and see if one matches our value parsers<NEW_LINE>UpnpHeader upnpHeader = null;<NEW_LINE>for (int i = 0; i < type.getHeaderTypes().length && upnpHeader == null; i++) {<NEW_LINE>Class<? extends UpnpHeader> headerClass = type.getHeaderTypes()[i];<NEW_LINE>try {<NEW_LINE>log.finest("Trying to parse '" + type + "' with class: " + headerClass.getSimpleName());<NEW_LINE>upnpHeader = headerClass.newInstance();<NEW_LINE>if (headerValue != null) {<NEW_LINE>upnpHeader.setString(headerValue);<NEW_LINE>}<NEW_LINE>} catch (InvalidHeaderException ex) {<NEW_LINE>log.finest("Invalid header value for tested type: " + headerClass.getSimpleName() + " - " + ex.getMessage());<NEW_LINE>upnpHeader = null;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.severe(<MASK><NEW_LINE>log.log(Level.SEVERE, "Exception root cause: ", Exceptions.unwrap(ex));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return upnpHeader;<NEW_LINE>} | "Error instantiating header of type '" + type + "' with value: " + headerValue); |
528,403 | private static String encrypt(byte[] keyBytes, String plainText) throws Exception {<NEW_LINE><MASK><NEW_LINE>KeyFactory factory = KeyFactory.getInstance("RSA");<NEW_LINE>PrivateKey privateKey = factory.generatePrivate(spec);<NEW_LINE>Cipher cipher = Cipher.getInstance("RSA");<NEW_LINE>try {<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, privateKey);<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>// For IBM JDK<NEW_LINE>RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;<NEW_LINE>RSAPublicKeySpec publicKeySpec = new RSAPublicKeySpec(rsaPrivateKey.getModulus(), rsaPrivateKey.getPrivateExponent());<NEW_LINE>Key fakePublicKey = KeyFactory.getInstance("RSA").generatePublic(publicKeySpec);<NEW_LINE>cipher = Cipher.getInstance("RSA");<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, fakePublicKey);<NEW_LINE>}<NEW_LINE>byte[] encryptedBytes = cipher.doFinal(plainText.getBytes("UTF-8"));<NEW_LINE>return Base64.byteArrayToBase64(encryptedBytes);<NEW_LINE>} | PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(keyBytes); |
1,393,299 | public static MPPOrder createMO(MPPProductPlanning pp, int C_OrderLine_ID, int M_AttributeSetInstance_ID, BigDecimal qty, Timestamp dateOrdered, Timestamp datePromised, String description) {<NEW_LINE>MPPProductBOM bom = pp.getPP_Product_BOM();<NEW_LINE>MWorkflow wf = pp.getAD_Workflow();<NEW_LINE>if (pp.getS_Resource_ID() > 0 && bom != null && wf != null) {<NEW_LINE>// RoutingService routingService = RoutingServiceFactory.get().getRoutingService(pp.getCtx());<NEW_LINE>// int duration = routingService.calculateDuration(wf,MResource.get(pp.getCtx(), pp.getS_Resource_ID()),qty).intValueExact();<NEW_LINE>int duration = MPPMRP.getDurationDays(qty, pp);<NEW_LINE>MPPOrder order = new MPPOrder(pp.getCtx(), 0, pp.get_TrxName());<NEW_LINE>order.setAD_Org_ID(pp.getAD_Org_ID());<NEW_LINE>order.setDescription(description);<NEW_LINE>order.setC_OrderLine_ID(C_OrderLine_ID);<NEW_LINE>order.setS_Resource_ID(pp.getS_Resource_ID());<NEW_LINE>order.setM_Warehouse_ID(pp.getM_Warehouse_ID());<NEW_LINE>order.<MASK><NEW_LINE>order.setM_AttributeSetInstance_ID(M_AttributeSetInstance_ID);<NEW_LINE>order.setPP_Product_BOM_ID(pp.getPP_Product_BOM_ID());<NEW_LINE>order.setAD_Workflow_ID(pp.getAD_Workflow_ID());<NEW_LINE>order.setPlanner_ID(pp.getPlanner_ID());<NEW_LINE>order.setLine(10);<NEW_LINE>order.setDateOrdered(dateOrdered);<NEW_LINE>order.setDatePromised(datePromised);<NEW_LINE>order.setDateStartSchedule(TimeUtil.addDays(datePromised, 0 - duration));<NEW_LINE>order.setDateFinishSchedule(datePromised);<NEW_LINE>order.setC_UOM_ID(pp.getM_Product().getC_UOM_ID());<NEW_LINE>order.setQty(qty);<NEW_LINE>order.setPriorityRule(MPPOrder.PRIORITYRULE_High);<NEW_LINE>order.saveEx();<NEW_LINE>order.setDocStatus(order.prepareIt());<NEW_LINE>order.setDocAction(MPPOrder.ACTION_Complete);<NEW_LINE>order.saveEx();<NEW_LINE>return order;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | setM_Product_ID(pp.getM_Product_ID()); |
560,214 | private void put(Throwable throwable, StackTraceElement[] enclosingTrace, String caption, String prefix, Set<Throwable> dejaVu) {<NEW_LINE>if (dejaVu.contains(throwable)) {<NEW_LINE>put("\t[CIRCULAR REFERENCE:");<NEW_LINE>put0(throwable);<NEW_LINE>put(']');<NEW_LINE>} else {<NEW_LINE>dejaVu.add(throwable);<NEW_LINE>// Compute number of frames in common between this and enclosing trace<NEW_LINE>StackTraceElement[] trace = throwable.getStackTrace();<NEW_LINE>int m = trace.length - 1;<NEW_LINE>int n = enclosingTrace.length - 1;<NEW_LINE>while (m >= 0 && n >= 0 && trace[m].equals(enclosingTrace[n])) {<NEW_LINE>m--;<NEW_LINE>n--;<NEW_LINE>}<NEW_LINE>int framesInCommon = trace.length - 1 - m;<NEW_LINE>put<MASK><NEW_LINE>put0(throwable);<NEW_LINE>put(Misc.EOL);<NEW_LINE>for (int i = 0; i <= m; i++) {<NEW_LINE>put(prefix);<NEW_LINE>put(trace[i]);<NEW_LINE>}<NEW_LINE>if (framesInCommon != 0) {<NEW_LINE>put(prefix).put("\t...").put(framesInCommon).put(" more");<NEW_LINE>}<NEW_LINE>// Print suppressed exceptions, if any<NEW_LINE>Throwable[] suppressed = throwable.getSuppressed();<NEW_LINE>for (int i = 0, k = suppressed.length; i < k; i++) {<NEW_LINE>put(suppressed[i], trace, "Suppressed: ", prefix + '\t', dejaVu);<NEW_LINE>}<NEW_LINE>// Print cause, if any<NEW_LINE>Throwable cause = throwable.getCause();<NEW_LINE>if (cause != null) {<NEW_LINE>put(cause, trace, "Caused by: ", prefix, dejaVu);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (prefix).put(caption); |
1,503,412 | private TypecheckingResult makeNew(TypecheckingResult result, Concrete.NewExpression expr, Expression expectedType, Set<ClassField> pseudoImplemented) {<NEW_LINE>if (result == null)<NEW_LINE>return null;<NEW_LINE>Expression normExpr = result.expression.normalize(NormalizationMode.WHNF);<NEW_LINE>ClassCallExpression classCallExpr = normExpr.cast(ClassCallExpression.class);<NEW_LINE>if (classCallExpr == null) {<NEW_LINE>if (!normExpr.reportIfError(errorReporter, expr.getExpression())) {<NEW_LINE>errorReporter.report(new TypecheckingError("Expected a class", expr.getExpression()));<NEW_LINE>}<NEW_LINE>return new TypecheckingResult(new ErrorExpression(), normExpr);<NEW_LINE>}<NEW_LINE>if (checkAllImplemented(classCallExpr, pseudoImplemented, expr)) {<NEW_LINE>return checkResult(expectedType, new TypecheckingResult(new NewExpression(null, <MASK><NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | classCallExpr), classCallExpr), expr); |
871,675 | protected void run() {<NEW_LINE>try {<NEW_LINE>runInterceptHook();<NEW_LINE>Transaction preparedDelayedPayoutTx = checkNotNull(processModel.getPreparedDelayedPayoutTx());<NEW_LINE>BtcWalletService btcWalletService = processModel.getBtcWalletService();<NEW_LINE>NetworkParameters params = btcWalletService.getParams();<NEW_LINE>Transaction preparedDepositTx = new Transaction(params, processModel.getPreparedDepositTx());<NEW_LINE>String id = processModel.getOffer().getId();<NEW_LINE>byte[<MASK><NEW_LINE>DeterministicKey myMultiSigKeyPair = btcWalletService.getMultiSigKeyPair(id, sellerMultiSigPubKey);<NEW_LINE>checkArgument(Arrays.equals(sellerMultiSigPubKey, btcWalletService.getOrCreateAddressEntry(id, AddressEntry.Context.MULTI_SIG).getPubKey()), "sellerMultiSigPubKey from AddressEntry must match the one from the trade data. trade id =" + id);<NEW_LINE>byte[] buyerMultiSigPubKey = processModel.getTradePeer().getMultiSigPubKey();<NEW_LINE>byte[] delayedPayoutTxSignature = processModel.getTradeWalletService().signDelayedPayoutTx(preparedDelayedPayoutTx, preparedDepositTx, myMultiSigKeyPair, buyerMultiSigPubKey, sellerMultiSigPubKey);<NEW_LINE>processModel.setDelayedPayoutTxSignature(delayedPayoutTxSignature);<NEW_LINE>processModel.getTradeManager().requestPersistence();<NEW_LINE>complete();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>failed(t);<NEW_LINE>}<NEW_LINE>} | ] sellerMultiSigPubKey = processModel.getMyMultiSigPubKey(); |
1,274,079 | public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {<NEW_LINE>if (caller == getUpdateStmtListNoTransform()) {<NEW_LINE>int i = caller.getIndexOfChild(child);<NEW_LINE>{<NEW_LINE>if (// start a circular evaluation here<NEW_LINE>!isDUbeforeCondition(v))<NEW_LINE>return false;<NEW_LINE>if (i == 0) {<NEW_LINE>if (!getStmt().isDUafter(v))<NEW_LINE>return false;<NEW_LINE>for (Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {<NEW_LINE>ContinueStmt stmt = (ContinueStmt) iter.next();<NEW_LINE>if (!stmt.isDUafterReachedFinallyBlocks(v))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else<NEW_LINE>return getUpdateStmt(i - 1).isDUafter(v);<NEW_LINE>}<NEW_LINE>} else if (caller == getStmtNoTransform()) {<NEW_LINE>return isDUbeforeCondition(v) && (hasCondition() ? getCondition().isDUafterTrue(v) : isDUafterInit(v));<NEW_LINE>} else if (caller == getConditionOptNoTransform()) {<NEW_LINE>return isDUbeforeCondition(v);<NEW_LINE>} else if (caller == getInitStmtListNoTransform()) {<NEW_LINE>int childIndex = caller.getIndexOfChild(child);<NEW_LINE>return childIndex == 0 ? isDUbefore(v) : getInitStmt(childIndex - 1).isDUafter(v);<NEW_LINE>} else {<NEW_LINE>return getParent().<MASK><NEW_LINE>}<NEW_LINE>} | Define_boolean_isDUbefore(this, caller, v); |
1,827,175 | public PlanFragment visitPhysicalHiveScan(OptExpression optExpression, ExecPlan context) {<NEW_LINE>PhysicalHiveScanOperator node = (PhysicalHiveScanOperator) optExpression.getOp();<NEW_LINE>ScanOperatorPredicates predicates = node.getScanOperatorPredicates();<NEW_LINE>Table referenceTable = node.getTable();<NEW_LINE>context.getDescTbl().addReferencedTable(referenceTable);<NEW_LINE>TupleDescriptor tupleDescriptor = context.getDescTbl().createTupleDescriptor();<NEW_LINE>tupleDescriptor.setTable(referenceTable);<NEW_LINE>prepareContextSlots(node, context, tupleDescriptor);<NEW_LINE>HdfsScanNode hdfsScanNode = new HdfsScanNode(context.getNextNodeId(), tupleDescriptor, "HdfsScanNode");<NEW_LINE>hdfsScanNode.computeStatistics(optExpression.getStatistics());<NEW_LINE>try {<NEW_LINE>HDFSScanNodePredicates scanNodePredicates = hdfsScanNode.getPredictsExpr();<NEW_LINE>scanNodePredicates.setSelectedPartitionIds(predicates.getSelectedPartitionIds());<NEW_LINE>scanNodePredicates.setIdToPartitionKey(predicates.getIdToPartitionKey());<NEW_LINE>hdfsScanNode.setupScanRangeLocations(context.getDescTbl());<NEW_LINE>prepareCommonExpr(scanNodePredicates, predicates, context);<NEW_LINE>prepareMinMaxExpr(scanNodePredicates, predicates, context);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>throw new StarRocksPlannerException(e.getMessage(), INTERNAL_ERROR);<NEW_LINE>}<NEW_LINE>hdfsScanNode.setLimit(node.getLimit());<NEW_LINE>tupleDescriptor.computeMemLayout();<NEW_LINE>context.getScanNodes().add(hdfsScanNode);<NEW_LINE>PlanFragment fragment = new PlanFragment(context.getNextFragmentId(), hdfsScanNode, DataPartition.RANDOM);<NEW_LINE>context.getFragments().add(fragment);<NEW_LINE>return fragment;<NEW_LINE>} | LOG.warn("Hdfs scan node get scan range locations failed : " + e); |
537,185 | public void marshall(UpdateItemRequest updateItemRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateItemRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getTableName(), TABLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getAttributeUpdates(), ATTRIBUTEUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getExpected(), EXPECTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getConditionalOperator(), CONDITIONALOPERATOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getReturnValues(), RETURNVALUES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getReturnItemCollectionMetrics(), RETURNITEMCOLLECTIONMETRICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getUpdateExpression(), UPDATEEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getConditionExpression(), CONDITIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateItemRequest.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateItemRequest.getKey(), KEY_BINDING); |
1,774,938 | protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap, BpmnJsonConverterContext converterContext) {<NEW_LINE>HttpServiceTask task = new HttpServiceTask();<NEW_LINE>task.setType("http");<NEW_LINE>String parallelInSameTransaction = getPropertyValueAsString(PROPERTY_HTTPTASK_PARALLEL_IN_SAME_TRANSACTION, elementNode);<NEW_LINE>if (StringUtils.isNotEmpty(parallelInSameTransaction)) {<NEW_LINE>task.setParallelInSameTransaction(Boolean.parseBoolean(parallelInSameTransaction));<NEW_LINE>}<NEW_LINE>addField("requestMethod", PROPERTY_HTTPTASK_REQ_METHOD, "GET", elementNode, task);<NEW_LINE>addField("requestUrl", PROPERTY_HTTPTASK_REQ_URL, elementNode, task);<NEW_LINE>addField(<MASK><NEW_LINE>addField("requestBody", PROPERTY_HTTPTASK_REQ_BODY, elementNode, task);<NEW_LINE>addField("requestBodyEncoding", PROPERTY_HTTPTASK_REQ_BODY_ENCODING, elementNode, task);<NEW_LINE>addField("requestTimeout", PROPERTY_HTTPTASK_REQ_TIMEOUT, elementNode, task);<NEW_LINE>addField("disallowRedirects", PROPERTY_HTTPTASK_REQ_DISALLOW_REDIRECTS, elementNode, task);<NEW_LINE>addField("failStatusCodes", PROPERTY_HTTPTASK_REQ_FAIL_STATUS_CODES, elementNode, task);<NEW_LINE>addField("handleStatusCodes", PROPERTY_HTTPTASK_REQ_HANDLE_STATUS_CODES, elementNode, task);<NEW_LINE>addField("responseVariableName", PROPERTY_HTTPTASK_RESPONSE_VARIABLE_NAME, elementNode, task);<NEW_LINE>addField("ignoreException", PROPERTY_HTTPTASK_REQ_IGNORE_EXCEPTION, elementNode, task);<NEW_LINE>addField("saveRequestVariables", PROPERTY_HTTPTASK_SAVE_REQUEST_VARIABLES, elementNode, task);<NEW_LINE>addField("saveResponseParameters", PROPERTY_HTTPTASK_SAVE_RESPONSE_PARAMETERS, elementNode, task);<NEW_LINE>addField("resultVariablePrefix", PROPERTY_HTTPTASK_RESULT_VARIABLE_PREFIX, elementNode, task);<NEW_LINE>addField("saveResponseParametersTransient", PROPERTY_HTTPTASK_SAVE_RESPONSE_TRANSIENT, elementNode, task);<NEW_LINE>addField("saveResponseVariableAsJson", PROPERTY_HTTPTASK_SAVE_RESPONSE_AS_JSON, elementNode, task);<NEW_LINE>task.setSkipExpression(getPropertyValueAsString(PROPERTY_SKIP_EXPRESSION, elementNode));<NEW_LINE>return task;<NEW_LINE>} | "requestHeaders", PROPERTY_HTTPTASK_REQ_HEADERS, elementNode, task); |
49,575 | public static void vertical(GrayF32 src, GrayI16 dst) {<NEW_LINE>if (src.height < dst.height)<NEW_LINE>throw new IllegalArgumentException("src height must be >= dst height");<NEW_LINE>if (src.width != dst.width)<NEW_LINE>throw new IllegalArgumentException("src width must equal dst width");<NEW_LINE>float scale = src.height / (float) dst.height;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.width, x -> {<NEW_LINE>for (int x = 0; x < dst.width; x++) {<NEW_LINE>int indexDst = dst.startIndex + x;<NEW_LINE>for (int y = 0; y < dst.height - 1; y++) {<NEW_LINE>float srcY0 = y * scale;<NEW_LINE>float srcY1 = (y + 1) * scale;<NEW_LINE>int isrcY0 = (int) srcY0;<NEW_LINE>int isrcY1 = (int) srcY1;<NEW_LINE>int index = src.getIndex(x, isrcY0);<NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcY0 - isrcY0));<NEW_LINE>float start = src.data[index];<NEW_LINE>index += src.stride;<NEW_LINE>float middle = 0;<NEW_LINE>for (int i = isrcY0 + 1; i < isrcY1; i++) {<NEW_LINE>middle += src.data[index];<NEW_LINE>index += src.stride;<NEW_LINE>}<NEW_LINE>float endWeight = (srcY1 % 1);<NEW_LINE>float end = src.data[index];<NEW_LINE>dst.data[indexDst] = (short) ((start * startWeight + middle + end * endWeight) / scale + 0.5f);<NEW_LINE>indexDst += dst.stride;<NEW_LINE>}<NEW_LINE>// handle the last area as a special case<NEW_LINE>int y = dst.height - 1;<NEW_LINE>float srcY0 = y * scale;<NEW_LINE>int isrcY0 = (int) srcY0;<NEW_LINE>int isrcY1 = src.height - 1;<NEW_LINE>int index = <MASK><NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcY0 - isrcY0));<NEW_LINE>float start = src.data[index];<NEW_LINE>index += src.stride;<NEW_LINE>float middle = 0;<NEW_LINE>for (int i = isrcY0 + 1; i < isrcY1; i++) {<NEW_LINE>middle += src.data[index];<NEW_LINE>index += src.stride;<NEW_LINE>}<NEW_LINE>float end = isrcY1 != isrcY0 ? src.data[index] : 0;<NEW_LINE>dst.data[indexDst] = (short) ((start * startWeight + middle + end) / scale + 0.5f);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | src.getIndex(x, isrcY0); |
1,450,467 | public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String labName = Utils.getValueFromIdByName(id, "labs");<NEW_LINE>if (labName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id)));<NEW_LINE>}<NEW_LINE>String username = Utils.getValueFromIdByName(id, "users");<NEW_LINE>if (username == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id)));<NEW_LINE>}<NEW_LINE>String name = Utils.getValueFromIdByName(id, "secrets");<NEW_LINE>if (name == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, labName, username, name, context);<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); |
338,393 | private boolean visitDependentLink(DependentLink parameters) {<NEW_LINE>for (DependentLink link = parameters; link.hasNext(); link = link.getNext()) {<NEW_LINE>DependentLink link1 = link.getNextTyped(null);<NEW_LINE>Expression type = acceptSelf(<MASK><NEW_LINE>if (type == null) {<NEW_LINE>if (myKeepVisitor != null) {<NEW_LINE>for (; parameters != link; parameters = parameters.getNext()) {<NEW_LINE>myKeepVisitor.getBindings().remove(parameters);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>link1.setType(type instanceof Type ? (Type) type : new TypeExpression(type, link1.getType().getSortOfType()));<NEW_LINE>if (myKeepVisitor != null) {<NEW_LINE>for (; link != link1; link = link.getNext()) {<NEW_LINE>myKeepVisitor.getBindings().add(link);<NEW_LINE>}<NEW_LINE>myKeepVisitor.getBindings().add(link);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | link1.getTypeExpr(), true); |
305,759 | protected void prepareContext(Host host, ServletContextInitializer[] initializers) {<NEW_LINE>if (host.getState() == LifecycleState.NEW) {<NEW_LINE>super.prepareContext(host, initializers);<NEW_LINE>} else {<NEW_LINE>File documentRoot = getValidDocumentRoot();<NEW_LINE>StandardContext context = new StandardContext();<NEW_LINE>if (documentRoot != null) {<NEW_LINE>context.setResources(new StandardRoot(context));<NEW_LINE>}<NEW_LINE>context.setName(getContextPath());<NEW_LINE>context.setDisplayName(getDisplayName());<NEW_LINE>context.setPath(getContextPath());<NEW_LINE>File docBase = (documentRoot != null) ? documentRoot : createTempDir("tomcat-docbase");<NEW_LINE>context.setDocBase(docBase.getAbsolutePath());<NEW_LINE>context.addLifecycleListener<MASK><NEW_LINE>context.setParentClassLoader(Thread.currentThread().getContextClassLoader());<NEW_LINE>resetDefaultLocaleMapping(context);<NEW_LINE>addLocaleMappings(context);<NEW_LINE>context.setUseRelativeRedirects(false);<NEW_LINE>configureTldSkipPatterns(context);<NEW_LINE>WebappLoader loader = new WebappLoader(context.getParentClassLoader());<NEW_LINE>loader.setLoaderClass("com.alipay.sofa.ark.web.embed.tomcat.ArkTomcatEmbeddedWebappClassLoader");<NEW_LINE>loader.setDelegate(true);<NEW_LINE>context.setLoader(loader);<NEW_LINE>if (isRegisterDefaultServlet()) {<NEW_LINE>addDefaultServlet(context);<NEW_LINE>}<NEW_LINE>if (shouldRegisterJspServlet()) {<NEW_LINE>addJspServlet(context);<NEW_LINE>addJasperInitializer(context);<NEW_LINE>}<NEW_LINE>context.addLifecycleListener(new StaticResourceConfigurer(context));<NEW_LINE>ServletContextInitializer[] initializersToUse = mergeInitializers(initializers);<NEW_LINE>context.setParent(host);<NEW_LINE>configureContext(context, initializersToUse);<NEW_LINE>host.addChild(context);<NEW_LINE>}<NEW_LINE>} | (new Tomcat.FixContextListener()); |
1,743,331 | public static <T extends AzureProperties> void copyAzureCommonPropertiesIgnoreNull(AzureProperties source, T target) {<NEW_LINE>copyPropertiesIgnoreNull(source.getClient(), target.getClient());<NEW_LINE>copyHttpLoggingProperties(source, target, true);<NEW_LINE>copyPropertiesIgnoreNull(source.getProxy(), target.getProxy());<NEW_LINE>copyPropertiesIgnoreNull(source.getProfile(), target.getProfile());<NEW_LINE>BeanUtils.copyProperties(source.getProfile().getEnvironment(), target.getProfile().getEnvironment());<NEW_LINE>copyPropertiesIgnoreNull(source.getCredential(), target.getCredential());<NEW_LINE>if (source instanceof RetryOptionsProvider && target instanceof RetryOptionsProvider) {<NEW_LINE>RetryOptionsProvider.RetryOptions sourceRetry = ((RetryOptionsProvider) source).getRetry();<NEW_LINE>RetryOptionsProvider.RetryOptions targetRetry = ((RetryOptionsProvider) target).getRetry();<NEW_LINE>copyPropertiesIgnoreNull(sourceRetry, targetRetry);<NEW_LINE>copyPropertiesIgnoreNull(sourceRetry.getExponential(), targetRetry.getExponential());<NEW_LINE>copyPropertiesIgnoreNull(sourceRetry.getFixed(<MASK><NEW_LINE>}<NEW_LINE>} | ), targetRetry.getFixed()); |
127,764 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static void resume(com.sun.jdi.event.EventSet a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.IllegalThreadStateExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.ObjectCollectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.event.EventSet", "resume", "JDI CALL: com.sun.jdi.event.EventSet({0}).resume()", new Object[] { a });<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>a.resume();<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.<MASK><NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (java.lang.IllegalThreadStateException ex) {<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.IllegalThreadStateExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.ObjectCollectedException ex) {<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.ObjectCollectedExceptionWrapper(ex);<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.event.EventSet", "resume", org.netbeans.modules.debugger.jpda.JDIExceptionReporter.RET_VOID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jpda.jdi.InternalExceptionWrapper(ex); |
727,248 | private BoundTransportAddress createBoundTransportAddress(ProfileSettings profileSettings, List<InetSocketAddress> boundAddresses) {<NEW_LINE>String[] boundAddressesHostStrings = new String[boundAddresses.size()];<NEW_LINE>TransportAddress[] transportBoundAddresses = new TransportAddress[boundAddresses.size()];<NEW_LINE>for (int i = 0; i < boundAddresses.size(); i++) {<NEW_LINE>InetSocketAddress boundAddress = boundAddresses.get(i);<NEW_LINE>boundAddressesHostStrings[i] = boundAddress.getHostString();<NEW_LINE>transportBoundAddresses[i] = new TransportAddress(boundAddress);<NEW_LINE>}<NEW_LINE>List<String> publishHosts = profileSettings.publishHosts;<NEW_LINE>if (profileSettings.isDefaultProfile == false && publishHosts.isEmpty()) {<NEW_LINE>publishHosts = Arrays.asList(boundAddressesHostStrings);<NEW_LINE>}<NEW_LINE>if (publishHosts.isEmpty()) {<NEW_LINE>publishHosts = <MASK><NEW_LINE>}<NEW_LINE>final InetAddress publishInetAddress;<NEW_LINE>try {<NEW_LINE>publishInetAddress = networkService.resolvePublishHostAddresses(publishHosts.toArray(Strings.EMPTY_ARRAY));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new BindTransportException("Failed to resolve publish address", e);<NEW_LINE>}<NEW_LINE>final int publishPort = resolvePublishPort(profileSettings, boundAddresses, publishInetAddress);<NEW_LINE>final TransportAddress publishAddress = new TransportAddress(new InetSocketAddress(publishInetAddress, publishPort));<NEW_LINE>return new BoundTransportAddress(transportBoundAddresses, publishAddress);<NEW_LINE>} | NetworkService.GLOBAL_NETWORK_PUBLISH_HOST_SETTING.get(settings); |
272,139 | private void prePassivate(InvocationContext inv) {<NEW_LINE>try {<NEW_LINE>Object results = getResultsObject(inv);<NEW_LINE>addPrePassivate(results, CLASS_NAME, "prePassivate");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object> map = inv.getContextData();<NEW_LINE>String data;<NEW_LINE>if (map.containsKey("PrePassivate")) {<NEW_LINE>data = (String) map.get("PrePassivate");<NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("PrePassivate", data);<NEW_LINE>setPrePassivateContextData(results, data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostActivate")) {<NEW_LINE>throw new IllegalStateException("PostActivate context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("AroundInvoke")) {<NEW_LINE>throw new IllegalStateException("AroundInvoke context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("PreDestroy")) {<NEW_LINE>throw new IllegalStateException("PreDestroy context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("PostConstruct")) {<NEW_LINE>throw new IllegalStateException("PostConstruct context data shared with PrePassivate interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each PrePassivate<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (InvocationContext) map.get("InvocationContext");<NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each PrePassivate interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>inv.proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EJBException("unexpected Throwable", e);<NEW_LINE>}<NEW_LINE>} | map.put("InvocationContext", inv); |
380,056 | private Mono<Response<Flux<ByteBuffer>>> redeployWithResponseAsync(String resourceGroupName, String sqlVirtualMachineName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (sqlVirtualMachineName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter sqlVirtualMachineName 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>context = this.client.mergeContext(context);<NEW_LINE>return service.redeploy(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
567,375 | final GetAppValidationOutputResult executeGetAppValidationOutput(GetAppValidationOutputRequest getAppValidationOutputRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAppValidationOutputRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAppValidationOutputRequest> request = null;<NEW_LINE>Response<GetAppValidationOutputResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAppValidationOutputRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SMS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAppValidationOutput");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAppValidationOutputResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAppValidationOutputResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(getAppValidationOutputRequest)); |
1,524,079 | public com.amazonaws.services.elasticfilesystem.model.SecurityGroupLimitExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.elasticfilesystem.model.SecurityGroupLimitExceededException securityGroupLimitExceededException = new com.amazonaws.services.elasticfilesystem.model.SecurityGroupLimitExceededException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ErrorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>securityGroupLimitExceededException.setErrorCode(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 securityGroupLimitExceededException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
119,486 | public static void printCodeInfo(Log log, UntetheredCodeInfo codeInfo, int state, String name, CodePointer codeStart, CodePointer codeEnd, HasInstalledCode hasInstalledCode, long installedCodeAddress, long installedCodeEntryPoint) {<NEW_LINE>log.string("CodeInfo (").zhex(codeInfo).string(" - ").zhex(((UnsignedWord) codeInfo).add(RuntimeCodeInfoAccess.getSizeOfCodeInfo()).subtract(1)).string("), ").string<MASK><NEW_LINE>if (name != null) {<NEW_LINE>log.string(" - ").string(name);<NEW_LINE>}<NEW_LINE>log.string(", ip: (").zhex(codeStart).string(" - ").zhex(codeEnd).string(")");<NEW_LINE>switch(hasInstalledCode) {<NEW_LINE>case Yes:<NEW_LINE>log.string(", installedCode: (address: ").zhex(installedCodeAddress).string(", entryPoint: ").zhex(installedCodeEntryPoint).string(")");<NEW_LINE>break;<NEW_LINE>case No:<NEW_LINE>log.string(", installedCode: null.");<NEW_LINE>break;<NEW_LINE>case Unknown:<NEW_LINE>// nothing to do.<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw VMError.shouldNotReachHere("Unexpected value for HasInstalledCode");<NEW_LINE>}<NEW_LINE>} | (CodeInfoAccess.stateToString(state)); |
1,419,290 | public void marshall(CreateCanaryRequest createCanaryRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createCanaryRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getCode(), CODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getArtifactS3Location(), ARTIFACTS3LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getSchedule(), SCHEDULE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getRunConfig(), RUNCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getSuccessRetentionPeriodInDays(), SUCCESSRETENTIONPERIODINDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getFailureRetentionPeriodInDays(), FAILURERETENTIONPERIODINDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getRuntimeVersion(), RUNTIMEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getVpcConfig(), VPCCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCanaryRequest.getArtifactConfig(), ARTIFACTCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createCanaryRequest.getExecutionRoleArn(), EXECUTIONROLEARN_BINDING); |
299,724 | private void delServicesRef(String uuid, String type) {<NEW_LINE>DebugUtils.Assert((uuid != null) && (type != null), "the parameter can't be null");<NEW_LINE>VipNetworkServicesRefVO vipRef = dbf.findByUuid(uuid, VipNetworkServicesRefVO.class);<NEW_LINE>if (vipRef == null) {<NEW_LINE>logger.error(String.format("the servicesRef [type:%s:uuid:%s] with vip[uuid:%s] doesn't exist", type, uuid, self.getUuid()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dbf.remove(vipRef);<NEW_LINE>refresh();<NEW_LINE>Set<String<MASK><NEW_LINE>if (types == null) {<NEW_LINE>self.setUseFor(null);<NEW_LINE>self = dbf.updateAndRefresh(self);<NEW_LINE>} else if (!types.contains(type)) {<NEW_LINE>self.setUseFor(new VipUseForList(types).toString());<NEW_LINE>self = dbf.updateAndRefresh(self);<NEW_LINE>}<NEW_LINE>logger.debug(String.format("delete the servicesRef [type:%s:uuid:%s] with vip[uuid:%s]", type, uuid, self.getUuid()));<NEW_LINE>} | > types = self.getServicesTypes(); |
1,854,192 | public org.bimserver.plugins.modelmerger.ModelMerger createMerger(DatabaseSession databaseSession, Long currentUoid) throws MergeException, BimserverDatabaseException {<NEW_LINE>User user = databaseSession.get(StorePackage.eINSTANCE.getUser(), currentUoid, OldQuery.getDefault());<NEW_LINE><MASK><NEW_LINE>ModelMergerPluginConfiguration modelMergerObject = userSettings.getDefaultModelMerger();<NEW_LINE>if (modelMergerObject != null) {<NEW_LINE>ModelMergerPlugin modelMergerPlugin = bimServer.getPluginManager().getModelMergerPlugin(modelMergerObject.getPluginDescriptor().getPluginClassName(), true);<NEW_LINE>if (modelMergerPlugin != null) {<NEW_LINE>org.bimserver.plugins.modelmerger.ModelMerger modelMerger = modelMergerPlugin.createModelMerger(bimServer.getPluginSettingsCache().getPluginSettings(modelMergerObject.getOid()));<NEW_LINE>return modelMerger;<NEW_LINE>} else {<NEW_LINE>throw new MergeException("No Model Merger found " + modelMergerObject.getPluginDescriptor().getPluginClassName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new MergeException("No configured Model Merger found");<NEW_LINE>}<NEW_LINE>} | UserSettings userSettings = user.getUserSettings(); |
1,783,296 | private static PackageData loadPackageDataFromBalaFile(Path balaPath, PackageManifest packageManifest) {<NEW_LINE>URI zipURI = URI.create("jar:" + balaPath.toUri().toString());<NEW_LINE>try (FileSystem zipFileSystem = FileSystems.newFileSystem(zipURI, new HashMap<>())) {<NEW_LINE>// Load default module<NEW_LINE>String pkgName = packageManifest.name().toString();<NEW_LINE>Path <MASK><NEW_LINE>ModuleData defaultModule = loadModule(pkgName, pkgName, packageRoot);<NEW_LINE>DocumentData packageMd = loadDocument(zipFileSystem.getPath(BALA_DOCS_DIR).resolve(ProjectConstants.PACKAGE_MD_FILE_NAME));<NEW_LINE>// load other modules<NEW_LINE>List<ModuleData> otherModules = loadOtherModules(pkgName, packageRoot);<NEW_LINE>return PackageData.from(balaPath, defaultModule, otherModules, null, null, null, null, packageMd);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ProjectException("Failed to read bala file:" + balaPath);<NEW_LINE>}<NEW_LINE>} | packageRoot = zipFileSystem.getPath("/"); |
979,950 | private void layoutButtons() {<NEW_LINE>final ButtonBar buttonBar = getSkinnable();<NEW_LINE>final List<? extends Node> buttons = buttonBar.getButtons();<NEW_LINE>final double buttonMinWidth = buttonBar.getButtonMinWidth();<NEW_LINE>String buttonOrder = getSkinnable().getButtonOrder();<NEW_LINE>layout.getChildren().clear();<NEW_LINE>// empty is valid, because it is BUTTON_ORDER_NONE<NEW_LINE>if (buttonOrder == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalStateException("ButtonBar buttonOrder string can not be null");<NEW_LINE>}<NEW_LINE>if (buttonOrder.equals(ButtonBar.BUTTON_ORDER_NONE)) {<NEW_LINE>// when using BUTTON_ORDER_NONE, we just lay out the buttons in the<NEW_LINE>// order they are specified, but we do right-align the buttons by<NEW_LINE>// inserting a dynamic spacer.<NEW_LINE>Spacer.DYNAMIC.add(layout, true);<NEW_LINE>for (Node btn : buttons) {<NEW_LINE>sizeButton(btn, buttonMinWidth, DO_NOT_CHANGE_SIZE, Double.MAX_VALUE);<NEW_LINE>layout.getChildren().add(btn);<NEW_LINE>HBox.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>doButtonOrderLayout(buttonOrder);<NEW_LINE>}<NEW_LINE>} | setHgrow(btn, Priority.NEVER); |
892,765 | final ValidateConfigurationSettingsResult executeValidateConfigurationSettings(ValidateConfigurationSettingsRequest validateConfigurationSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(validateConfigurationSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ValidateConfigurationSettingsRequest> request = null;<NEW_LINE>Response<ValidateConfigurationSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ValidateConfigurationSettingsRequestMarshaller().marshall(super.beforeMarshalling(validateConfigurationSettingsRequest));<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, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ValidateConfigurationSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ValidateConfigurationSettingsResult> responseHandler = new StaxResponseHandler<ValidateConfigurationSettingsResult>(new ValidateConfigurationSettingsResultStaxUnmarshaller());<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()); |
217,728 | public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {<NEW_LINE>Player <MASK><NEW_LINE>if (player == null) {<NEW_LINE>return paid;<NEW_LINE>}<NEW_LINE>int oppCount = game.getOpponents(controllerId).size();<NEW_LINE>TargetCard target = new TargetCardInYourGraveyard(oppCount, StaticFilters.FILTER_CARD);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>player.choose(Outcome.Exile, target, source, game);<NEW_LINE>Cards cards = new CardsImpl(target.getTargets());<NEW_LINE>if (cards.size() < oppCount) {<NEW_LINE>return paid;<NEW_LINE>}<NEW_LINE>player.moveCards(cards, Zone.EXILED, ability, game);<NEW_LINE>paid = cards.stream().map(game.getState()::getZone).filter(Zone.EXILED::equals).count() >= oppCount;<NEW_LINE>return paid;<NEW_LINE>} | player = game.getPlayer(controllerId); |
518,626 | public static void main(String[] args) {<NEW_LINE>int number = 59;<NEW_LINE>System.out.println("Testing with number: " + number);<NEW_LINE>// Get Bit<NEW_LINE>System.out.println("Get Bit");<NEW_LINE>System.out.println(AssortedMethods.toFullBinaryString(number));<NEW_LINE>for (int i = 31; i >= 0; i--) {<NEW_LINE>int res = getBit(number, i) ? 1 : 0;<NEW_LINE>System.out.print(res);<NEW_LINE>}<NEW_LINE>// Update Bit<NEW_LINE>System.out.println("\n\nUpdate Bit");<NEW_LINE>// arbitrary number<NEW_LINE>int num1 = 1578;<NEW_LINE>for (int i = 31; i >= 0; i--) {<NEW_LINE>int res = getBit(number, i) ? 1 : 0;<NEW_LINE>num1 = updateBit(num1, i, res);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// Set and Clear Bit<NEW_LINE>System.out.println("\nSet and Clear Bit");<NEW_LINE>// arbitrary number<NEW_LINE>int num2 = 1578;<NEW_LINE>for (int i = 31; i >= 0; i--) {<NEW_LINE>if (getBit(number, i)) {<NEW_LINE>num2 = setBit(num2, i);<NEW_LINE>} else {<NEW_LINE>num2 = clearBit(num2, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(num2);<NEW_LINE>// Clear Bits MSB through i<NEW_LINE>number = 13242352;<NEW_LINE>System.out.println("\nClear bits MSB through 4");<NEW_LINE>System.out.println(AssortedMethods.toFullBinaryString(number));<NEW_LINE>int num3 = clearBitsMSBthroughI(number, 4);<NEW_LINE>System.out.println(AssortedMethods.toFullBinaryString(num3));<NEW_LINE>// Clear Bits i through 0<NEW_LINE>System.out.println("\nClear bits 6 through 0");<NEW_LINE>number = -1;<NEW_LINE>System.out.println(AssortedMethods.toFullBinaryString(number));<NEW_LINE>int num4 = clearBitsIthrough0(number, 2);<NEW_LINE>System.out.println(AssortedMethods.toFullBinaryString(num4));<NEW_LINE>} | System.out.println(num1); |
519,999 | public boolean isDaylight(TimeZone timeZone) {<NEW_LINE>Date riseDate = getDailyForecast().get(0).sun().getRiseDate();<NEW_LINE>Date setDate = getDailyForecast().get(0).sun().getSetDate();<NEW_LINE>if (riseDate != null && setDate != null) {<NEW_LINE>Calendar calendar = Calendar.getInstance();<NEW_LINE>calendar.setTimeZone(timeZone);<NEW_LINE>int time = 60 * calendar.get(Calendar.HOUR_OF_DAY) + calendar.get(Calendar.MINUTE);<NEW_LINE>calendar.setTimeZone(TimeZone.getDefault());<NEW_LINE>calendar.setTime(riseDate);<NEW_LINE>int sunrise = 60 * calendar.get(Calendar.HOUR_OF_DAY) + calendar.get(Calendar.MINUTE);<NEW_LINE>calendar.setTime(setDate);<NEW_LINE>int sunset = 60 * calendar.get(Calendar.HOUR_OF_DAY) + <MASK><NEW_LINE>return sunrise < time && time < sunset;<NEW_LINE>}<NEW_LINE>return DisplayUtils.isDaylight(timeZone);<NEW_LINE>} | calendar.get(Calendar.MINUTE); |
181,336 | public File persist(final IncrementalIndex index, final Interval dataInterval, File outDir, IndexSpec indexSpec, ProgressIndicator progress, @Nullable SegmentWriteOutMediumFactory segmentWriteOutMediumFactory) throws IOException {<NEW_LINE>if (index.isEmpty()) {<NEW_LINE>throw new IAE("Trying to persist an empty index!");<NEW_LINE>}<NEW_LINE>final DateTime firstTimestamp = index.getMinTime();<NEW_LINE>final DateTime lastTimestamp = index.getMaxTime();<NEW_LINE>if (!(dataInterval.contains(firstTimestamp) && dataInterval.contains(lastTimestamp))) {<NEW_LINE>throw new IAE("interval[%s] does not encapsulate the full range of timestamps[%s, %s]", dataInterval, firstTimestamp, lastTimestamp);<NEW_LINE>}<NEW_LINE>FileUtils.mkdirp(outDir);<NEW_LINE>log.debug("Starting persist for interval[%s], rows[%,d]", dataInterval, index.size());<NEW_LINE>return // if index is not rolled up, then it should be not rollup here<NEW_LINE>multiphaseMerge(// if index is not rolled up, then it should be not rollup here<NEW_LINE>Collections.singletonList(new IncrementalIndexAdapter(dataInterval, index, indexSpec.getBitmapSerdeFactory().getBitmapFactory())), // if index is rolled up, then it is no need to rollup again.<NEW_LINE>// In this case, true/false won't cause reOrdering in merge stage<NEW_LINE>// while merging a single iterable<NEW_LINE>false, index.getMetricAggs(), index.getDimensionsSpec(), outDir, indexSpec, indexSpec<MASK><NEW_LINE>} | , progress, segmentWriteOutMediumFactory, -1); |
1,573,960 | public static TrustedAuthority parse(InputStream input) throws IOException {<NEW_LINE>short <MASK><NEW_LINE>Object identifier;<NEW_LINE>switch(identifier_type) {<NEW_LINE>case IdentifierType.cert_sha1_hash:<NEW_LINE>case IdentifierType.key_sha1_hash:<NEW_LINE>{<NEW_LINE>identifier = TlsUtils.readFully(20, input);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case IdentifierType.pre_agreed:<NEW_LINE>{<NEW_LINE>identifier = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case IdentifierType.x509_name:<NEW_LINE>{<NEW_LINE>byte[] derEncoding = TlsUtils.readOpaque16(input, 1);<NEW_LINE>ASN1Primitive asn1 = TlsUtils.readASN1Object(derEncoding);<NEW_LINE>X500Name x500Name = X500Name.getInstance(asn1);<NEW_LINE>TlsUtils.requireDEREncoding(x500Name, derEncoding);<NEW_LINE>identifier = x500Name;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new TlsFatalAlert(AlertDescription.decode_error);<NEW_LINE>}<NEW_LINE>return new TrustedAuthority(identifier_type, identifier);<NEW_LINE>} | identifier_type = TlsUtils.readUint8(input); |
331,088 | private void ensureRestDevelopmentReadyImpl(RestConfig restConfig) throws IOException {<NEW_LINE>// check whether project EE level or project/server classpath provide<NEW_LINE>// JAX-RS APIs. The value should be false only in case of EE5 specification<NEW_LINE>// and server without any Jersey on its classpath, eg. Tomcat or some<NEW_LINE>// very very old GF (v2? or older)<NEW_LINE>// extend build script if necessary<NEW_LINE>extendBuildScripts();<NEW_LINE>boolean hasJersey2 = hasJersey2(true);<NEW_LINE>boolean hasJaxRsOnClasspath = hasJaxRsOnClasspath(false);<NEW_LINE>final boolean hasJaxRs = isEESpecWithJaxRS() || hasJaxRsOnClasspath || hasJersey1(true) || hasJersey2;<NEW_LINE>if (isEE5() && (hasJersey2 || !hasJaxRs)) {<NEW_LINE>webXmlUpdater.addJersey2ResourceConfigToWebApp(restConfig);<NEW_LINE>}<NEW_LINE>// add latest JAX-RS APIs to project's classpath:<NEW_LINE>if (!hasJaxRs || !hasJaxRsOnClasspath) {<NEW_LINE>boolean jaxRSApiAdded = false;<NEW_LINE>JaxRsStackSupport support = getJaxRsStackSupport();<NEW_LINE>if (support != null) {<NEW_LINE>// in this case server is enhancing project's classpath:<NEW_LINE>jaxRSApiAdded = <MASK><NEW_LINE>}<NEW_LINE>if (!jaxRSApiAdded) {<NEW_LINE>// fallback on IDE's default impl if server does not have its own<NEW_LINE>// jax-rs impl:<NEW_LINE>JaxRsStackSupport.getDefault().addJsr311Api(getProject());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// make sure the project classpath contains Jersey JARs:<NEW_LINE>if (!hasJersey2 && !hasJersey1(true)) {<NEW_LINE>extendJerseyClasspath();<NEW_LINE>}<NEW_LINE>handleSpring();<NEW_LINE>ProjectManager.getDefault().saveProject(getProject());<NEW_LINE>} | support.addJsr311Api(getProject()); |
578,430 | @JSONP<NEW_LINE>@NoCache<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })<NEW_LINE>public Response createFieldVariableByFieldId(@PathParam("typeId") final String typeId, @PathParam("fieldId") final String fieldId, final String fieldVariableJson, @Context final HttpServletRequest req, @Context final HttpServletResponse res) throws DotDataException {<NEW_LINE>final InitDataObject initData = this.webResource.init(null, req, res, false, null);<NEW_LINE>final User user = initData.getUser();<NEW_LINE>final FieldAPI fapi = APILocator.getContentTypeFieldAPI();<NEW_LINE>Response response = null;<NEW_LINE>try {<NEW_LINE>Field field = fapi.find(fieldId);<NEW_LINE>FieldVariable fieldVariable = new JsonFieldVariableTransformer(fieldVariableJson).from();<NEW_LINE>if (UtilMethods.isSet(fieldVariable.id())) {<NEW_LINE>response = ExceptionMapperUtil.createResponse(null, "Field 'id' should not be set");<NEW_LINE>} else if (!UtilMethods.isSet(fieldVariable.fieldId()) || !fieldVariable.fieldId().equals(field.id())) {<NEW_LINE>response = ExceptionMapperUtil.createResponse(null, "Field fieldId '" + fieldVariable.fieldId() + "' does not match a field with id '" + field.id() + "'");<NEW_LINE>} else {<NEW_LINE>fieldVariable = <MASK><NEW_LINE>response = Response.ok(new ResponseEntityView(new JsonFieldVariableTransformer(fieldVariable).mapObject())).build();<NEW_LINE>}<NEW_LINE>} catch (DotStateException e) {<NEW_LINE>response = ExceptionMapperUtil.createResponse(null, "Field variable is not valid (" + e.getMessage() + ")");<NEW_LINE>} catch (NotFoundInDbException e) {<NEW_LINE>response = ExceptionMapperUtil.createResponse(e, Response.Status.NOT_FOUND);<NEW_LINE>} catch (DotSecurityException e) {<NEW_LINE>throw new ForbiddenException(e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>response = ExceptionMapperUtil.createResponse(e, Response.Status.INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | fapi.save(fieldVariable, user); |
787,446 | public JMXServerInfo readJMX(InputStream in) throws ConversionException, IOException {<NEW_LINE>JSONObject json = parseObject(in);<NEW_LINE>JMXServerInfo ret = new JMXServerInfo();<NEW_LINE>ret.version = readIntInternal(json.get(N_VERSION));<NEW_LINE>ret.mbeansURL = readStringInternal(json.get(N_MBEANS));<NEW_LINE>ret.createMBeanURL = readStringInternal(json.get(N_CREATEMBEAN));<NEW_LINE>ret.mbeanCountURL = readStringInternal(json.get(N_MBEANCOUNT));<NEW_LINE>ret.defaultDomainURL = readStringInternal<MASK><NEW_LINE>ret.domainsURL = readStringInternal(json.get(N_DOMAINS));<NEW_LINE>ret.notificationsURL = readStringInternal(json.get(N_NOTIFICATIONS));<NEW_LINE>ret.instanceOfURL = readStringInternal(json.get(N_INSTANCEOF));<NEW_LINE>ret.fileTransferURL = readStringInternal(json.get(N_FILE_TRANSFER));<NEW_LINE>ret.apiURL = readStringInternal(json.get(N_API));<NEW_LINE>ret.graphURL = readStringInternal(json.get(N_GRAPH));<NEW_LINE>return ret;<NEW_LINE>} | (json.get(N_DEFAULTDOMAIN)); |
661,164 | public ResponsePartitionKey unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ResponsePartitionKey responsePartitionKey = new ResponsePartitionKey();<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("Dimensions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>responsePartitionKey.setDimensions(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), 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 responsePartitionKey;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,659,572 | private void pickSongs(Intent intent, final int action) {<NEW_LINE>// mutable copy<NEW_LINE>int effectiveAction = action;<NEW_LINE>long id = intent.getLongExtra("id", LibraryAdapter.INVALID_ID);<NEW_LINE>int type = mCurrentAdapter.getMediaType();<NEW_LINE>// special handling if we pick one song to be played that is already in queue<NEW_LINE>// not invalid, not play all<NEW_LINE>boolean songPicked = (id >= 0 && type == MediaUtils.TYPE_SONG);<NEW_LINE>if (songPicked && effectiveAction == ACTION_PLAY && mJumpToEnqueuedOnPlay) {<NEW_LINE>int songPosInQueue = PlaybackService.get(this).getQueuePositionForSongId(id);<NEW_LINE>if (songPosInQueue > -1) {<NEW_LINE>// we picked for play one song that is already present in the queue, just jump to it<NEW_LINE>PlaybackService.get<MASK><NEW_LINE>Toast.makeText(this, R.string.jumping_to_song, Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean all = false;<NEW_LINE>if (action == ACTION_PLAY_ALL || action == ACTION_ENQUEUE_ALL) {<NEW_LINE>boolean notPlayAllAdapter = (id == LibraryAdapter.HEADER_ID) || !(type <= MediaUtils.TYPE_SONG || type == MediaUtils.TYPE_FILE);<NEW_LINE>if (effectiveAction == ACTION_ENQUEUE_ALL && notPlayAllAdapter) {<NEW_LINE>effectiveAction = ACTION_ENQUEUE;<NEW_LINE>} else if (effectiveAction == ACTION_PLAY_ALL && notPlayAllAdapter) {<NEW_LINE>effectiveAction = ACTION_PLAY;<NEW_LINE>} else {<NEW_LINE>all = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (id == LibraryAdapter.HEADER_ID)<NEW_LINE>// page header was clicked -> force all mode<NEW_LINE>all = true;<NEW_LINE>QueryTask query = buildQueryFromIntent(intent, false, (all ? mCurrentAdapter : null));<NEW_LINE>query.mode = modeForAction[effectiveAction];<NEW_LINE>PlaybackService.get(this).addSongs(query);<NEW_LINE>if (mDefaultAction == ACTION_LAST_USED && mLastAction != action) {<NEW_LINE>mLastAction = action;<NEW_LINE>updateHeaders();<NEW_LINE>}<NEW_LINE>} | (this).jumpToQueuePosition(songPosInQueue); |
55,073 | final DeleteIdentityPoolResult executeDeleteIdentityPool(DeleteIdentityPoolRequest deleteIdentityPoolRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIdentityPoolRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteIdentityPoolRequest> request = null;<NEW_LINE>Response<DeleteIdentityPoolResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteIdentityPoolRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteIdentityPoolRequest));<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, "Cognito Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteIdentityPool");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteIdentityPoolResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteIdentityPoolResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.