idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
265,061
public boolean handle(PluginMessage packet) {<NEW_LINE>if (bungeecordMessageResponder.process(packet)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// We need to specially handle REGISTER and UNREGISTER packets. Later on, we'll write them to<NEW_LINE>// the client.<NEW_LINE>if (PluginMessageUtil.isRegister(packet)) {<NEW_LINE>serverConn.getPlayer().getKnownChannels().addAll(PluginMessageUtil.getChannels(packet));<NEW_LINE>return false;<NEW_LINE>} else if (PluginMessageUtil.isUnregister(packet)) {<NEW_LINE>serverConn.getPlayer().getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (PluginMessageUtil.isMcBrand(packet)) {<NEW_LINE>PluginMessage rewritten = PluginMessageUtil.rewriteMinecraftBrand(packet, server.getVersion(), playerConnection.getProtocolVersion());<NEW_LINE>playerConnection.write(rewritten);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (serverConn.getPhase().handle(serverConn, serverConn.getPlayer(), packet)) {<NEW_LINE>// Handled.<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ChannelIdentifier id = server.getChannelRegistrar().getFromId(packet.getChannel());<NEW_LINE>if (id == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>byte[] copy = ByteBufUtil.getBytes(packet.content());<NEW_LINE>PluginMessageEvent event = new PluginMessageEvent(serverConn, serverConn.getPlayer(), id, copy);<NEW_LINE>server.getEventManager().fire(event).thenAcceptAsync(pme -> {<NEW_LINE>if (pme.getResult().isAllowed() && !playerConnection.isClosed()) {<NEW_LINE>PluginMessage copied = new PluginMessage(packet.getChannel(), Unpooled.wrappedBuffer(copy));<NEW_LINE>playerConnection.write(copied);<NEW_LINE>}<NEW_LINE>}, playerConnection.eventLoop()).exceptionally((ex) -> {<NEW_LINE>logger.<MASK><NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
error("Exception while handling plugin message {}", packet, ex);
1,574,353
public final IRubyObject collectStats(final ThreadContext context) throws IOException {<NEW_LINE>final AbstractNamespacedMetricExt pipelineMetric = metric.namespace(context, RubyArray.newArray(context.runtime, Arrays.asList(MetricKeys.STATS_KEY, MetricKeys.PIPELINES_KEY, pipelineId.asString().<MASK><NEW_LINE>pipelineMetric.gauge(context, TYPE_KEY, getSetting(context, "queue.type"));<NEW_LINE>if (queue instanceof JRubyWrappedAckedQueueExt) {<NEW_LINE>final JRubyAckedQueueExt inner = ((JRubyWrappedAckedQueueExt) queue).rubyGetQueue();<NEW_LINE>final RubyString dirPath = inner.ruby_dir_path(context);<NEW_LINE>final AbstractNamespacedMetricExt capacityMetrics = pipelineMetric.namespace(context, CAPACITY_NAMESPACE);<NEW_LINE>capacityMetrics.gauge(context, PAGE_CAPACITY_IN_BYTES, inner.ruby_page_capacity(context));<NEW_LINE>capacityMetrics.gauge(context, MAX_QUEUE_SIZE_IN_BYTES, inner.ruby_max_size_in_bytes(context));<NEW_LINE>capacityMetrics.gauge(context, MAX_QUEUE_UNREAD_EVENTS, inner.ruby_max_unread_events(context));<NEW_LINE>capacityMetrics.gauge(context, QUEUE_SIZE_IN_BYTES, inner.ruby_persisted_size_in_bytes(context));<NEW_LINE>final AbstractNamespacedMetricExt dataMetrics = pipelineMetric.namespace(context, DATA_NAMESPACE);<NEW_LINE>final FileStore fileStore = Files.getFileStore(Paths.get(dirPath.asJavaString()));<NEW_LINE>dataMetrics.gauge(context, FREE_SPACE_IN_BYTES, context.runtime.newFixnum(fileStore.getUnallocatedSpace()));<NEW_LINE>dataMetrics.gauge(context, STORAGE_TYPE, context.runtime.newString(fileStore.type()));<NEW_LINE>dataMetrics.gauge(context, PATH, dirPath);<NEW_LINE>pipelineMetric.gauge(context, MetricKeys.EVENTS_KEY, inner.ruby_unread_count(context));<NEW_LINE>}<NEW_LINE>return context.nil;<NEW_LINE>}
intern(), QUEUE_KEY)));
203,512
public Object value(final Context scope, final Writer writer) throws IOException {<NEW_LINE>boolean blockParam <MASK><NEW_LINE>if (helper != null && !blockParam) {<NEW_LINE>Options options = new Options(handlebars, name, type, scope, emptyVar, Template.EMPTY, params(scope), hash(scope), BPARAMS, writer);<NEW_LINE>options.data(Context.PARAM_SIZE, this.params.size());<NEW_LINE>return helper.apply(determineContext(scope), options);<NEW_LINE>} else {<NEW_LINE>Object value = scope.get(path);<NEW_LINE>if (value == null) {<NEW_LINE>if (missing != null) {<NEW_LINE>Options options = new Options(handlebars, name, type, scope, emptyVar, Template.EMPTY, params(scope), hash(scope), BPARAMS, writer);<NEW_LINE>options.data(Context.PARAM_SIZE, this.params.size());<NEW_LINE>value = missing.apply(determineContext(scope), options);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value instanceof Lambda) {<NEW_LINE>value = Lambdas.merge(handlebars, (Lambda<Object, Object>) value, scope, this);<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>}
= scope.isBlockParams() && noArg;
1,059,003
public void updateSelectionAfterTrashAction() {<NEW_LINE>if (DisplayUtils.isLargeScreenLandscape(getActivity())) {<NEW_LINE>// Try to find the nearest note to the first deleted item<NEW_LINE>List<Integer> deletedNotesPositions = getSelectedNotesPositions();<NEW_LINE>int <MASK><NEW_LINE>int positionToSelect = -1;<NEW_LINE>// Loop through the notes below<NEW_LINE>for (int i = firstDeletedNote + 1; i < mNotesAdapter.getCount(); i++) {<NEW_LINE>if (!deletedNotesPositions.contains(i)) {<NEW_LINE>positionToSelect = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (positionToSelect == -1) {<NEW_LINE>// Loop through the above notes<NEW_LINE>for (int i = firstDeletedNote - 1; i >= 0; i--) {<NEW_LINE>if (!deletedNotesPositions.contains(i)) {<NEW_LINE>positionToSelect = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (positionToSelect != -1) {<NEW_LINE>Note noteToSelect = mNotesAdapter.getItem(positionToSelect + mList.getHeaderViewsCount());<NEW_LINE>mCallbacks.onNoteSelected(noteToSelect.getSimperiumKey(), null, noteToSelect.isMarkdownEnabled(), noteToSelect.isPreviewEnabled());<NEW_LINE>// As we will trigger a list refresh later, save the selectedNoteId<NEW_LINE>mSelectedNoteId = noteToSelect.getSimperiumKey();<NEW_LINE>} else {<NEW_LINE>// The list of notes is empty<NEW_LINE>((NotesActivity) requireActivity()).showDetailPlaceholder();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
firstDeletedNote = deletedNotesPositions.get(0);
1,773,107
public static AbstractButton exportButton(final Component parent, String tooltip, final Exportable... exportables) {<NEW_LINE>PopupButton exportPopup = new PopupButton(Icons.getIcon(GeneralIcons.SAVE_AS)) {<NEW_LINE><NEW_LINE>protected void populatePopup(JPopupMenu popup) {<NEW_LINE>for (final Exportable exportable : exportables) {<NEW_LINE>if (exportable != null && exportable.isEnabled()) {<NEW_LINE>popup.add(new JMenuItem(exportable.getName()) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>JFileChooser fileChooser = new JFileChooser();<NEW_LINE><MASK><NEW_LINE>fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);<NEW_LINE>fileChooser.setMultiSelectionEnabled(false);<NEW_LINE>fileChooser.setDialogTitle(exportable.getName());<NEW_LINE>fileChooser.removeChoosableFileFilter(fileChooser.getAcceptAllFileFilter());<NEW_LINE>ExportProvider[] providers = exportable.getProviders();<NEW_LINE>for (ExportProvider provider : providers) fileChooser.addChoosableFileFilter(provider.getFormatFilter());<NEW_LINE>// returning true means exporting to .nps, don't export other views<NEW_LINE>showExportDialog(fileChooser, parent, providers);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>exportPopup.setToolTipText(tooltip);<NEW_LINE>return exportPopup;<NEW_LINE>}
fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
1,600,702
public void onMessageReceived(MessageEvent messageEvent) {<NEW_LINE>Log.v(TAG, "received message");<NEW_LINE>if (messageEvent.getPath().equals(KeyProperties.PATH_NOTIFICATION)) {<NEW_LINE>final DataMap map = DataMap.fromByteArray(messageEvent.getData());<NEW_LINE>Intent notificationIntent = new Intent(this, WearActivity.class);<NEW_LINE>PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, <MASK><NEW_LINE>Notification notification = new Notification.Builder(this).setSmallIcon(R.mipmap.ic_launcher).setContentTitle(map.getString(KeyProperties.KEY_USER_NAME)).setContentText(map.getString(KeyProperties.KEY_TWEET)).setTicker(map.getString(KeyProperties.KEY_TWEET)).addAction(R.drawable.ic_logo, getString(R.string.view_articles), notificationPendingIntent).build();<NEW_LINE>notification.defaults = Notification.DEFAULT_ALL;<NEW_LINE>NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>manager.notify(NOTIFICATION_ID, notification);<NEW_LINE>}<NEW_LINE>}
0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
710,667
public void actionPerformed(final ActionEvent e) {<NEW_LINE>final FilterController filterController = FilterController.getCurrentFilterController();<NEW_LINE>final Controller controller = Controller.getCurrentController();<NEW_LINE>IMapSelection selection = controller.getSelection();<NEW_LINE>final NodeModel start = selection.getSelected();<NEW_LINE>final IMapViewManager mapViewManager = controller.getMapViewManager();<NEW_LINE>Filter filter = selection.getFilter();<NEW_LINE>final NodeModel next = filterController.findNext(start, null, direction, null, filter);<NEW_LINE>if (next != null) {<NEW_LINE>final MapController mapController = Controller.getCurrentModeController().getMapController();<NEW_LINE>if (!next.hasVisibleContent(filter)) {<NEW_LINE>filter.getFilterInfo(next).reset();<NEW_LINE>mapController.nodeRefresh(next);<NEW_LINE>}<NEW_LINE>final NodeModel[] path = next.getPathToRoot();<NEW_LINE>for (int i = 1; i < path.length; i++) {<NEW_LINE><MASK><NEW_LINE>final NodeModel parentNode = nodeOnPath.getParentNode();<NEW_LINE>if (parentNode.isFolded())<NEW_LINE>mapController.showNextChild(parentNode);<NEW_LINE>else {<NEW_LINE>if (mapViewManager.isChildHidden(nodeOnPath)) {<NEW_LINE>mapController.showNextChild(parentNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Controller.getCurrentController().getSelection().selectAsTheOnlyOneSelected(next);<NEW_LINE>}<NEW_LINE>}
final NodeModel nodeOnPath = path[i];
881,322
static Map<String, ClusterMapUtils.DcZkInfo> parseAndUpdateDcInfoFromArg(String dcs, String zkLayoutPath) throws IOException {<NEW_LINE>Map<String, ClusterMapUtils.DcZkInfo> dataCenterToZkAddress = ClusterMapUtils.parseDcJsonAndPopulateDcInfo(Utils.readStringFromFile(zkLayoutPath));<NEW_LINE>// nothing to do for cloud datacenters in the tool.<NEW_LINE>dataCenterToZkAddress.values().removeIf(dcZkInfo -> dcZkInfo.getReplicaType() == ReplicaType.CLOUD_BACKED);<NEW_LINE>Set<String> parsedDcSet;<NEW_LINE>if (Utils.isNullOrEmpty(dcs)) {<NEW_LINE>throw new IllegalArgumentException("dcs string cannot be null or empty.");<NEW_LINE>}<NEW_LINE>if (dcs.equalsIgnoreCase(ALL)) {<NEW_LINE>parsedDcSet = new HashSet<>(dataCenterToZkAddress.keySet());<NEW_LINE>} else {<NEW_LINE>parsedDcSet = Arrays.stream(dcs.replaceAll("\\p{Space}", "").split(",")).collect(Collectors.toSet());<NEW_LINE>HashSet<String> diff <MASK><NEW_LINE>diff.removeAll(dataCenterToZkAddress.keySet());<NEW_LINE>if (!diff.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Unknown datacenter(s) supplied" + diff);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dataCenterToZkAddress.entrySet().removeIf(e -> !parsedDcSet.contains(e.getKey()));<NEW_LINE>return dataCenterToZkAddress;<NEW_LINE>}
= new HashSet<>(parsedDcSet);
1,723,005
protected void notifyAgentAncestor(Asset<?> asset, PersistenceEvent<Asset<?>> persistenceEvent) {<NEW_LINE>String parentId = asset.getParentId();<NEW_LINE>if ((asset instanceof Agent) || parentId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String ancestorAgentId = null;<NEW_LINE>if (agentMap.containsKey(parentId)) {<NEW_LINE>ancestorAgentId = parentId;<NEW_LINE>} else {<NEW_LINE>// If path is not loaded then get the parents path as the asset might have been deleted<NEW_LINE>if (asset.getPath() == null) {<NEW_LINE>Asset<?> <MASK><NEW_LINE>if (parentAsset != null && parentAsset.getPath() != null) {<NEW_LINE>ancestorAgentId = Arrays.stream(parentAsset.getPath()).filter(assetId -> getAgents().containsKey(assetId)).findFirst().orElse(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ancestorAgentId != null) {<NEW_LINE>notifyChildAssetChange(ancestorAgentId, persistenceEvent);<NEW_LINE>}<NEW_LINE>}
parentAsset = assetStorageService.find(parentId);
970,070
public static void main(String[] arg) throws Exception {<NEW_LINE>// Change the value of bucket to the S3 bucket that contains your image file.<NEW_LINE>// Change the value of photo to your image file name.<NEW_LINE>String photo = "input.png";<NEW_LINE>String bucket = "bucket";<NEW_LINE>int height = 0;<NEW_LINE>int width = 0;<NEW_LINE>// Get the image from an S3 Bucket<NEW_LINE>AmazonS3 s3client = AmazonS3ClientBuilder.defaultClient();<NEW_LINE>com.amazonaws.services.s3.model.S3Object s3object = s3client.getObject(bucket, photo);<NEW_LINE>S3ObjectInputStream inputStream = s3object.getObjectContent();<NEW_LINE>BufferedImage image = ImageIO.read(inputStream);<NEW_LINE>DetectFacesRequest request = new DetectFacesRequest().withImage(new Image().withS3Object(new S3Object().withName(photo<MASK><NEW_LINE>width = image.getWidth();<NEW_LINE>height = image.getHeight();<NEW_LINE>// Call DetectFaces<NEW_LINE>AmazonRekognition amazonRekognition = AmazonRekognitionClientBuilder.defaultClient();<NEW_LINE>DetectFacesResult result = amazonRekognition.detectFaces(request);<NEW_LINE>// Show the bounding box info for each face.<NEW_LINE>List<FaceDetail> faceDetails = result.getFaceDetails();<NEW_LINE>for (FaceDetail face : faceDetails) {<NEW_LINE>BoundingBox box = face.getBoundingBox();<NEW_LINE>float left = width * box.getLeft();<NEW_LINE>float top = height * box.getTop();<NEW_LINE>System.out.println("Face:");<NEW_LINE>System.out.println("Left: " + String.valueOf((int) left));<NEW_LINE>System.out.println("Top: " + String.valueOf((int) top));<NEW_LINE>System.out.println("Face Width: " + String.valueOf((int) (width * box.getWidth())));<NEW_LINE>System.out.println("Face Height: " + String.valueOf((int) (height * box.getHeight())));<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>// Create frame and panel.<NEW_LINE>JFrame frame = new JFrame("RotateImage");<NEW_LINE>frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>DisplayFaces panel = new DisplayFaces(result, image);<NEW_LINE>panel.setPreferredSize(new Dimension(image.getWidth() / scale, image.getHeight() / scale));<NEW_LINE>frame.setContentPane(panel);<NEW_LINE>frame.pack();<NEW_LINE>frame.setVisible(true);<NEW_LINE>}
).withBucket(bucket)));
48,162
public static DescribePatternPerformanceResponse unmarshall(DescribePatternPerformanceResponse describePatternPerformanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePatternPerformanceResponse.setRequestId(_ctx.stringValue("DescribePatternPerformanceResponse.RequestId"));<NEW_LINE>describePatternPerformanceResponse.setEndTime(_ctx.stringValue("DescribePatternPerformanceResponse.EndTime"));<NEW_LINE>describePatternPerformanceResponse.setStartTime<MASK><NEW_LINE>List<PerformanceItem> performances = new ArrayList<PerformanceItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePatternPerformanceResponse.Performances.Length"); i++) {<NEW_LINE>PerformanceItem performanceItem = new PerformanceItem();<NEW_LINE>performanceItem.setKey(_ctx.stringValue("DescribePatternPerformanceResponse.Performances[" + i + "].Key"));<NEW_LINE>performanceItem.setUnit(_ctx.stringValue("DescribePatternPerformanceResponse.Performances[" + i + "].Unit"));<NEW_LINE>List<SeriesItem> series = new ArrayList<SeriesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribePatternPerformanceResponse.Performances[" + i + "].Series.Length"); j++) {<NEW_LINE>SeriesItem seriesItem = new SeriesItem();<NEW_LINE>seriesItem.setName(_ctx.stringValue("DescribePatternPerformanceResponse.Performances[" + i + "].Series[" + j + "].Name"));<NEW_LINE>List<String> values = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DescribePatternPerformanceResponse.Performances[" + i + "].Series[" + j + "].Values.Length"); k++) {<NEW_LINE>values.add(_ctx.stringValue("DescribePatternPerformanceResponse.Performances[" + i + "].Series[" + j + "].Values[" + k + "]"));<NEW_LINE>}<NEW_LINE>seriesItem.setValues(values);<NEW_LINE>series.add(seriesItem);<NEW_LINE>}<NEW_LINE>performanceItem.setSeries(series);<NEW_LINE>performances.add(performanceItem);<NEW_LINE>}<NEW_LINE>describePatternPerformanceResponse.setPerformances(performances);<NEW_LINE>return describePatternPerformanceResponse;<NEW_LINE>}
(_ctx.stringValue("DescribePatternPerformanceResponse.StartTime"));
175,339
protected void updateGoalState(ClusterModel clusterModel, OptimizationOptions optimizationOptions) {<NEW_LINE>List<String> <MASK><NEW_LINE>List<String> disksBelowBalanceLowerLimit = new ArrayList<>();<NEW_LINE>for (Broker broker : brokersToBalance(clusterModel)) {<NEW_LINE>double upperLimit = _balanceUpperThresholdByBroker.get(broker);<NEW_LINE>double lowerLimit = _balanceLowerThresholdByBroker.get(broker);<NEW_LINE>for (Disk disk : broker.disks()) {<NEW_LINE>if (disk.isAlive()) {<NEW_LINE>if (diskUtilizationPercentage(disk) > upperLimit) {<NEW_LINE>disksAboveBalanceUpperLimit.add(broker.id() + ":" + disk.logDir());<NEW_LINE>}<NEW_LINE>if (diskUtilizationPercentage(disk) < lowerLimit) {<NEW_LINE>disksBelowBalanceLowerLimit.add(broker.id() + ":" + disk.logDir());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!disksAboveBalanceUpperLimit.isEmpty()) {<NEW_LINE>LOG.warn("Disks {} are above balance upper limit after optimization.", disksAboveBalanceUpperLimit);<NEW_LINE>_succeeded = false;<NEW_LINE>}<NEW_LINE>if (!disksBelowBalanceLowerLimit.isEmpty()) {<NEW_LINE>LOG.warn("Disks {} are below balance lower limit after optimization.", disksBelowBalanceLowerLimit);<NEW_LINE>_succeeded = false;<NEW_LINE>}<NEW_LINE>finish();<NEW_LINE>}
disksAboveBalanceUpperLimit = new ArrayList<>();
1,372,174
public void writeToParcel(Parcel dest, int flags) {<NEW_LINE>// A map object type must be written first, since it's used in readParcel method to distinguish<NEW_LINE>// what type of object should be read from the parcel.<NEW_LINE>dest.writeInt(mMapObjectType);<NEW_LINE>dest.writeParcelable(mFeatureId, 0);<NEW_LINE>dest.writeString(mTitle);<NEW_LINE>dest.writeString(mSecondaryTitle);<NEW_LINE>dest.writeString(mSubtitle);<NEW_LINE>dest.writeString(mAddress);<NEW_LINE>dest.writeDouble(mLat);<NEW_LINE>dest.writeDouble(mLon);<NEW_LINE>dest.writeParcelable(mMetadata, 0);<NEW_LINE>dest.writeString(mApiId);<NEW_LINE>dest.writeString(mBookingSearchUrl);<NEW_LINE><MASK><NEW_LINE>dest.writeParcelable(mRoutePointInfo, 0);<NEW_LINE>dest.writeInt(mOpeningMode);<NEW_LINE>dest.writeInt(mShouldShowUGC ? 1 : 0);<NEW_LINE>dest.writeInt(mCanBeRated ? 1 : 0);<NEW_LINE>dest.writeInt(mCanBeReviewed ? 1 : 0);<NEW_LINE>dest.writeParcelable(mHotelType, 0);<NEW_LINE>dest.writeInt(mPriceRate);<NEW_LINE>dest.writeParcelable(mPopularity, 0);<NEW_LINE>dest.writeString(mDescription);<NEW_LINE>dest.writeInt(getRoadWarningMarkType().ordinal());<NEW_LINE>dest.writeInt(mIsTopChoice ? 1 : 0);<NEW_LINE>// All collections are deserialized AFTER non-collection and primitive type objects,<NEW_LINE>// so collections must be always serialized at the end.<NEW_LINE>dest.writeTypedList(mBanners);<NEW_LINE>dest.writeList(mReachableByTaxiTypes);<NEW_LINE>dest.writeTypedList(mRatings);<NEW_LINE>dest.writeStringList(mRawTypes);<NEW_LINE>}
dest.writeParcelable(mLocalAdInfo, 0);
504,218
final DeleteExplainabilityResult executeDeleteExplainability(DeleteExplainabilityRequest deleteExplainabilityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteExplainabilityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteExplainabilityRequest> request = null;<NEW_LINE>Response<DeleteExplainabilityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteExplainabilityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteExplainabilityRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteExplainability");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteExplainabilityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteExplainabilityResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,654,035
public // ------------------------------------------------------------------------<NEW_LINE>void childAdded(NodeChangeEvent evt) {<NEW_LINE>NodeChangeListener[] listeners;<NEW_LINE>Preferences childNode;<NEW_LINE>synchronized (tree.treeLock()) {<NEW_LINE>String childName = evt.getChild().name();<NEW_LINE>if (removed || removedChildren.contains(childName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>childNode = children.get(childName);<NEW_LINE>if (childNode != null) {<NEW_LINE>// swap delegates<NEW_LINE>((ProxyPreferencesImpl) childNode).changeDelegate(evt.getChild());<NEW_LINE>} else {<NEW_LINE>childNode = node(evt.getChild().name());<NEW_LINE>}<NEW_LINE>listeners = nodeListeners.toArray(new NodeChangeListener<MASK><NEW_LINE>}<NEW_LINE>NodeChangeEvent myEvt = null;<NEW_LINE>for (NodeChangeListener l : listeners) {<NEW_LINE>if (myEvt == null) {<NEW_LINE>myEvt = new NodeChangeEvent(this, childNode);<NEW_LINE>}<NEW_LINE>l.childAdded(evt);<NEW_LINE>}<NEW_LINE>}
[nodeListeners.size()]);
1,672,740
public FilterLogEventsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>FilterLogEventsResult filterLogEventsResult = new FilterLogEventsResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("events")) {<NEW_LINE>filterLogEventsResult.setEvents(new ListUnmarshaller<FilteredLogEvent>(FilteredLogEventJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("searchedLogStreams")) {<NEW_LINE>filterLogEventsResult.setSearchedLogStreams(new ListUnmarshaller<SearchedLogStream>(SearchedLogStreamJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("nextToken")) {<NEW_LINE>filterLogEventsResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return filterLogEventsResult;<NEW_LINE>}
String name = reader.nextName();
538,595
final GetDeviceInstanceResult executeGetDeviceInstance(GetDeviceInstanceRequest getDeviceInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDeviceInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDeviceInstanceRequest> request = null;<NEW_LINE>Response<GetDeviceInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetDeviceInstanceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDeviceInstanceRequest));<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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDeviceInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDeviceInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDeviceInstanceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
123,236
public void init(Container container) throws Exception {<NEW_LINE>managerIdentityService = container.getService(ManagerIdentityService.class);<NEW_LINE>assetStorageService = container.getService(AssetStorageService.class);<NEW_LINE>// Configure SMTP<NEW_LINE>String host = container.getConfig().getOrDefault(OR_EMAIL_HOST, null);<NEW_LINE>int port = getInteger(container.getConfig(), OR_EMAIL_PORT, OR_EMAIL_PORT_DEFAULT);<NEW_LINE>String user = container.getConfig().getOrDefault(OR_EMAIL_USER, null);<NEW_LINE>String password = container.getConfig().getOrDefault(OR_EMAIL_PASSWORD, null);<NEW_LINE>String headersStr = container.getConfig().getOrDefault(OR_EMAIL_X_HEADERS, null);<NEW_LINE>if (!TextUtil.isNullOrEmpty(headersStr)) {<NEW_LINE>headers = Arrays.stream(headersStr.split("\\R")).map(s -> s.split(":", 2)).collect(Collectors.toMap(arr -> arr[0].trim(), arr -> arr.length == 2 ? arr[1].trim() : ""));<NEW_LINE>}<NEW_LINE>defaultFrom = container.getConfig().getOrDefault(OR_EMAIL_FROM, OR_EMAIL_FROM_DEFAULT);<NEW_LINE>if (!TextUtil.isNullOrEmpty(host) && !TextUtil.isNullOrEmpty(user) && !TextUtil.isNullOrEmpty(password)) {<NEW_LINE>MailerBuilder.MailerRegularBuilder mailerBuilder = MailerBuilder.withSMTPServer(host, port, user, password);<NEW_LINE>boolean startTls = getBoolean(container.getConfig(), OR_EMAIL_TLS, OR_EMAIL_TLS_DEFAULT);<NEW_LINE>mailerBuilder.withTransportStrategy(startTls ? TransportStrategy.SMTP_TLS : TransportStrategy.SMTP);<NEW_LINE>mailer = mailerBuilder.buildMailer();<NEW_LINE>try {<NEW_LINE>mailer.testConnection();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.log(<MASK><NEW_LINE>mailer = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Level.SEVERE, "Failed to connect to SMTP server so disabling email notifications", e);
1,517,401
/*<NEW_LINE>* @see com.ibm.wsspi.tcpchannel.TCPReadRequestContext#read(long,<NEW_LINE>* com.ibm.wsspi.tcpchannel.TCPReadCompletedCallback, boolean, int)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public VirtualConnection read(long numBytes, TCPReadCompletedCallback readCallback, boolean forceQueue, int timeout) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "read(" + numBytes + ",..," + forceQueue + "," + timeout + ")");<NEW_LINE>}<NEW_LINE>getTCPConnLink().incrementNumReads();<NEW_LINE>if (getConfig().getDumpStatsInterval() > 0) {<NEW_LINE>getTCPConnLink().getTCPChannel().totalAsyncReads.incrementAndGet();<NEW_LINE>}<NEW_LINE>// always check external call parms<NEW_LINE>checkForErrors(numBytes, true, timeout);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Socket socket = getTCPConnLink().getSocketIOChannel().getSocket();<NEW_LINE>Tr.event(tc, "read (async) requested for local: " + socket.getLocalSocketAddress() + " remote: " + socket.getRemoteSocketAddress());<NEW_LINE>}<NEW_LINE>VirtualConnection vc = null;<NEW_LINE>if (isAborted()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// async errors can only be passed through the callback, which means<NEW_LINE>// if they didn't provide one then we have no way of reporting the<NEW_LINE>// failure<NEW_LINE>if (null != readCallback) {<NEW_LINE>IOException ioe = new IOException("Connection aborted by program");<NEW_LINE>readCallback.error(getTCPConnLink().getVirtualConnection(), this, ioe);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>vc = readInternal(numBytes, readCallback, forceQueue, timeout);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "read: " + vc);<NEW_LINE>}<NEW_LINE>return vc;<NEW_LINE>}
Tr.event(tc, "Previously aborted, unable to perform read");
1,126,552
final GetSceneResult executeGetScene(GetSceneRequest getSceneRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSceneRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSceneRequest> request = null;<NEW_LINE>Response<GetSceneResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSceneRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSceneRequest));<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, "IoTTwinMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetScene");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSceneResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSceneResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,380,869
public DynamicTableSink createDynamicTableSink(Context context) {<NEW_LINE>final boolean isHiveTable = HiveCatalog.isHiveTable(context.getCatalogTable().getOptions());<NEW_LINE>Map<String, String> options = context.getCatalogTable().getOptions();<NEW_LINE>// temporary table doesn't have the IS_GENERIC flag but we still consider it generic<NEW_LINE>if (isHiveTable) {<NEW_LINE>updateHiveConf(options);<NEW_LINE>// new HiveValidator().validate(properties);<NEW_LINE>Integer configuredParallelism = Configuration.fromMap(context.getCatalogTable().getOptions()<MASK><NEW_LINE>return new HiveTableSink(context.getConfiguration(), new JobConf(hiveConf), context.getObjectIdentifier(), context.getCatalogTable(), configuredParallelism);<NEW_LINE>} else {<NEW_LINE>return // we already in the factory of catalog<NEW_LINE>FactoryUtil.// we already in the factory of catalog<NEW_LINE>createTableSink(null, context.getObjectIdentifier(), context.getCatalogTable(), context.getConfiguration(), context.getClassLoader(), context.isTemporary());<NEW_LINE>}<NEW_LINE>}
).get(FileSystemOptions.SINK_PARALLELISM);
928,125
public void run() {<NEW_LINE>JFileChooser chooser = new JFileChooser();<NEW_LINE>// NOI18N<NEW_LINE>File tmpDir = new File(System.getProperty("java.io.tmpdir"));<NEW_LINE>chooser.setDialogTitle(Bundle.AttachDialog_RemotePackDialogCaption());<NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>chooser.setSelectedFile(tmpDir);<NEW_LINE>chooser.setCurrentDirectory(tmpDir);<NEW_LINE>chooser.setMultiSelectionEnabled(false);<NEW_LINE>if ((JFileChooser.CANCEL_OPTION & chooser.showSaveDialog(chooser)) == 0) {<NEW_LINE>final String path = chooser.getSelectedFile().getAbsolutePath();<NEW_LINE>final String jdkF = currentJDK;<NEW_LINE>RequestProcessor.getDefault().post(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>String packPath = <MASK><NEW_LINE>ProfilerDialogs.displayInfo(Bundle.AttachDialog_RemotePackSaved(packPath));<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NOI18N<NEW_LINE>System.err.println("Exception creating remote pack: " + ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
exportRemotePack(path, settings, jdkF);
1,411,684
public void exitSepctxpm_application(Sepctxpm_applicationContext ctx) {<NEW_LINE>if (ctx.junos_application() != null) {<NEW_LINE>JunosApplication application = toJunosApplication(ctx.junos_application());<NEW_LINE>if (!application.hasDefinition()) {<NEW_LINE>_w.redFlag(String.format("unimplemented pre-defined junos application: '%s'", ctx.junos_application().getText()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (application.getIpv6()) {<NEW_LINE>_currentFwTerm.setIpv6(true);<NEW_LINE>} else {<NEW_LINE>FwFromJunosApplication from = new FwFromJunosApplication(application);<NEW_LINE>_currentFwTerm.getFromApplicationSetMembers().add(from);<NEW_LINE>}<NEW_LINE>} else if (ctx.junos_application_set() != null) {<NEW_LINE>JunosApplicationSet applicationSet = toJunosApplicationSet(ctx.junos_application_set());<NEW_LINE>if (!applicationSet.hasDefinition()) {<NEW_LINE>_w.redFlag(String.format("unimplemented pre-defined junos application-set: '%s'", ctx.junos_application_set().getText()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FwFromJunosApplicationSet from = new FwFromJunosApplicationSet(applicationSet);<NEW_LINE>_currentFwTerm.getFromApplicationSetMembers().add(from);<NEW_LINE>} else {<NEW_LINE>String <MASK><NEW_LINE>_configuration.referenceStructure(APPLICATION_OR_APPLICATION_SET, name, SECURITY_POLICY_MATCH_APPLICATION, getLine(ctx.name.getStart()));<NEW_LINE>FwFromApplicationOrApplicationSet from = new FwFromApplicationOrApplicationSet(name);<NEW_LINE>_currentFwTerm.getFromApplicationSetMembers().add(from);<NEW_LINE>}<NEW_LINE>}
name = toString(ctx.name);
461,235
public ByteBuffer transcode(List<ByteBuffer> data, ByteBuffer _out) {<NEW_LINE>for (ByteBuffer nalUnit : data) {<NEW_LINE>NIOUtils.skip(nalUnit, 4);<NEW_LINE>NALUnit marker = NALUnit.read(nalUnit);<NEW_LINE>_out.putInt(1);<NEW_LINE>marker.write(_out);<NEW_LINE>if (marker.type == NALUnitType.NON_IDR_SLICE || marker.type == NALUnitType.IDR_SLICE) {<NEW_LINE>transcodeSlice(nalUnit, marker);<NEW_LINE>} else {<NEW_LINE>if (marker.type == NALUnitType.SPS) {<NEW_LINE>SeqParameterSet _sps = SeqParameterSet.read(nalUnit.duplicate());<NEW_LINE>sps.put(_sps.seqParameterSetId, _sps);<NEW_LINE>} else if (marker.type == NALUnitType.PPS) {<NEW_LINE>PictureParameterSet _pps = PictureParameterSet.read(nalUnit.duplicate());<NEW_LINE>pps.<MASK><NEW_LINE>}<NEW_LINE>NIOUtils.write(_out, nalUnit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_out.flip();<NEW_LINE>return _out;<NEW_LINE>}
put(_pps.picParameterSetId, _pps);
89,734
public final KillStatementContext killStatement() throws RecognitionException {<NEW_LINE>KillStatementContext _localctx = new KillStatementContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 460, RULE_killStatement);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(5148);<NEW_LINE>match(KILL);<NEW_LINE>setState(5150);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == CONNECTION || _la == QUERY) {<NEW_LINE>{<NEW_LINE>setState(5149);<NEW_LINE>((KillStatementContext) _localctx).connectionFormat = _input.LT(1);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == CONNECTION || _la == QUERY)) {<NEW_LINE>((KillStatementContext) _localctx).connectionFormat = (Token) _errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(5153);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>do {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(5152);<NEW_LINE>decimalLiteral();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(5155);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>} while (((((_la - 1027)) & ~0x3f) == 0 && ((1L << (_la - 1027)) & ((1L << (ZERO_DECIMAL - 1027)) | (1L << (ONE_DECIMAL - 1027)) | (1L << (TWO_DECIMAL - 1027)) | (1L << (DECIMAL_LITERAL - 1027)))) != 0));<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.reportError(this, re);
627,510
public void ffdcDumpDefault(Throwable t, IncidentStream is, Object callerThis, Object[] objs, String sourceId) {<NEW_LINE><MASK><NEW_LINE>captureDefaultInformation(is, t);<NEW_LINE>if (callerThis != null) {<NEW_LINE>// 255802<NEW_LINE>is.writeLine("SibDiagnosticModule :: Dump of callerThis (DiagnosticModule)", toFFDCString(callerThis));<NEW_LINE>// 255802<NEW_LINE>is.introspectAndWriteLine("Introspection of callerThis:", callerThis);<NEW_LINE>}<NEW_LINE>if (objs != null) {<NEW_LINE>for (int i = 0; i < objs.length; i++) {<NEW_LINE>// 255802<NEW_LINE>// 255802<NEW_LINE>is.// 255802<NEW_LINE>writeLine(// 287897<NEW_LINE>"callerArg (DiagnosticModule) [" + i + "]", toFFDCString(objs[i]));<NEW_LINE>// 255802<NEW_LINE>is.introspectAndWriteLine("callerArg [" + i + "] (Introspection)", objs[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
is.writeLine("SIB FFDC dump for:", t);
273,891
private synchronized void initFromContext() {<NEW_LINE>if (context == null)<NEW_LINE>return;<NEW_LINE>synchronized (FILE_LOCK) {<NEW_LINE>DataObject dataObject = context.lookup(DataObject.class);<NEW_LINE>List<VCSFileProxy> filesList = new LinkedList<VCSFileProxy>();<NEW_LINE>if (dataObject instanceof DataShadow) {<NEW_LINE>dataObject = ((DataShadow) dataObject).getOriginal();<NEW_LINE>}<NEW_LINE>if (dataObject != null) {<NEW_LINE>Set<FileObject> daoFiles = dataObject.files();<NEW_LINE>Collection<VCSFileProxy> doFiles = toFileCollection(daoFiles);<NEW_LINE>if (files != null && files.length > 0) {<NEW_LINE>// check for possible changes<NEW_LINE>Set<FileObject> s = new HashSet<FileObject><MASK><NEW_LINE>boolean changed = false;<NEW_LINE>for (FileObject fo : daoFiles) {<NEW_LINE>if (!s.contains(fo)) {<NEW_LINE>changed = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!changed) {<NEW_LINE>registerFileListeners();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filesList.addAll(doFiles);<NEW_LINE>}<NEW_LINE>initFiles(filesList.toArray(new VCSFileProxy[filesList.size()]));<NEW_LINE>}<NEW_LINE>Runnable r = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>resetUI();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (EventQueue.isDispatchThread()) {<NEW_LINE>r.run();<NEW_LINE>} else {<NEW_LINE>SwingUtilities.invokeLater(r);<NEW_LINE>}<NEW_LINE>}
(Arrays.asList(files));
1,500,863
public CacheHitResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CacheHitResult cacheHitResult = new CacheHitResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("SourcePipelineExecutionArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cacheHitResult.setSourcePipelineExecutionArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return cacheHitResult;<NEW_LINE>}
class).unmarshall(context));
277,040
private JClass generateChangeListener(JDefinedClass cls, Map<String, JVar> fieldMap) throws JClassAlreadyExistsException {<NEW_LINE>final JClass changeListenerInterface = getCodeModel().ref(CheckedMap.ChangeListener.class);<NEW_LINE>final JDefinedClass changeListenerClass = cls._class(JMod.PRIVATE | JMod.STATIC, "ChangeListener");<NEW_LINE>changeListenerClass._implements(changeListenerInterface.narrow(String.class, Object.class));<NEW_LINE>final JFieldVar objectRefVar = changeListenerClass.field(JMod.PRIVATE | <MASK><NEW_LINE>final JMethod constructor = changeListenerClass.constructor(JMod.PRIVATE);<NEW_LINE>JVar refParam = constructor.param(cls, "reference");<NEW_LINE>constructor.body().assign(objectRefVar, refParam);<NEW_LINE>final JMethod method = changeListenerClass.method(JMod.PUBLIC, void.class, "onUnderlyingMapChanged");<NEW_LINE>method.annotate(Override.class);<NEW_LINE>final JVar keyParam = method.param(String.class, "key");<NEW_LINE>method.param(_objectClass, "value");<NEW_LINE>JSwitch keySwitch = method.body()._switch(keyParam);<NEW_LINE>fieldMap.forEach((key, field) -> {<NEW_LINE>JCase keyCase = keySwitch._case(JExpr.lit(key));<NEW_LINE>keyCase.body().assign(objectRefVar.ref(field.name()), JExpr._null());<NEW_LINE>keyCase.body()._break();<NEW_LINE>});<NEW_LINE>return changeListenerClass;<NEW_LINE>}
JMod.FINAL, cls, "__objectRef");
156,458
public Object[] resolve(Method method) {<NEW_LINE>// we need to resolve from inside the<NEW_LINE>if (method.getParameterCount() > 0) {<NEW_LINE>ClassLoader old = Thread.currentThread().getContextClassLoader();<NEW_LINE>try {<NEW_LINE>CreationContextHolder holder = getCreationalContext();<NEW_LINE>ClassLoader cl = appClassloader.get() != null ? appClassloader.get() : getClass().getClassLoader();<NEW_LINE>Thread.currentThread().setContextClassLoader(cl);<NEW_LINE>Class<?> c = cl.loadClass(IsolatedEnricher.class.getName());<NEW_LINE>BiFunction<Method, Object, Object[]> function = (BiFunction<Method, Object, Object[]>) c<MASK><NEW_LINE>return function.apply(method, holder.creationalContext);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(old);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Object[0];<NEW_LINE>}
.getDeclaredConstructor().newInstance();
992,961
private Spinner createSpinnerControl(Composite parent, String label, int type) {<NEW_LINE>createLabel(parent, label, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);<NEW_LINE>final Spinner spinner = new Spinner(parent, SWT.BORDER);<NEW_LINE>spinner.setMinimum(0);<NEW_LINE>spinner.setMaximum(255);<NEW_LINE>spinner.setIncrement(5);<NEW_LINE>getWidgetFactory().adapt(spinner, true, true);<NEW_LINE>Listener listener = (e) -> {<NEW_LINE><MASK><NEW_LINE>CompoundCommand result = new CompoundCommand();<NEW_LINE>for (EObject dmo : getEObjects()) {<NEW_LINE>if (isAlive(dmo)) {<NEW_LINE>Command cmd;<NEW_LINE>if (type == 0) {<NEW_LINE>cmd = new DiagramModelObjectAlphaCommand((IDiagramModelObject) dmo, newValue);<NEW_LINE>} else {<NEW_LINE>cmd = new DiagramModelObjectOutlineAlphaCommand((IDiagramModelObject) dmo, newValue);<NEW_LINE>}<NEW_LINE>if (cmd.canExecute()) {<NEW_LINE>result.add(cmd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>executeCommand(result.unwrap());<NEW_LINE>};<NEW_LINE>spinner.addListener(SWT.MouseUp, listener);<NEW_LINE>spinner.addListener(SWT.FocusOut, listener);<NEW_LINE>spinner.addListener(SWT.DefaultSelection, listener);<NEW_LINE>spinner.addDisposeListener((e) -> {<NEW_LINE>if (spinner != null && !spinner.isDisposed()) {<NEW_LINE>spinner.removeListener(SWT.MouseUp, listener);<NEW_LINE>spinner.removeListener(SWT.FocusOut, listener);<NEW_LINE>spinner.removeListener(SWT.DefaultSelection, listener);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return spinner;<NEW_LINE>}
int newValue = spinner.getSelection();
1,736,104
final DBSnapshot executeModifyDBSnapshot(ModifyDBSnapshotRequest modifyDBSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyDBSnapshotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyDBSnapshotRequest> request = null;<NEW_LINE>Response<DBSnapshot> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyDBSnapshotRequestMarshaller().marshall(super.beforeMarshalling(modifyDBSnapshotRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyDBSnapshot");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBSnapshot> responseHandler = new StaxResponseHandler<DBSnapshot>(new DBSnapshotStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,050,507
private JsonResponseUpsertItemBuilder syncJsonContact(@NonNull final JsonRequestContactUpsertItem jsonContact, @NonNull final SyncAdvise parentSyncAdvise, @NonNull final ShortTermContactIndex shortTermIndex) {<NEW_LINE>final IdentifierString contactIdentifier = IdentifierString.of(jsonContact.getContactIdentifier());<NEW_LINE>final BPartnerContact existingContact = shortTermIndex.extract(contactIdentifier);<NEW_LINE>final JsonResponseUpsertItemBuilder result = JsonResponseUpsertItem.builder().identifier(jsonContact.getContactIdentifier());<NEW_LINE>final SyncOutcome syncOutcome;<NEW_LINE>final BPartnerContact contact;<NEW_LINE>if (existingContact != null) {<NEW_LINE>contact = existingContact;<NEW_LINE>syncOutcome = parentSyncAdvise.getIfExists().isUpdate() <MASK><NEW_LINE>} else {<NEW_LINE>if (parentSyncAdvise.isFailIfNotExists()) {<NEW_LINE>throw MissingResourceException.builder().resourceName("contact").resourceIdentifier(jsonContact.getContactIdentifier()).parentResource(jsonContact).build().setParameter("parentSyncAdvise", parentSyncAdvise);<NEW_LINE>} else if (Type.METASFRESH_ID.equals(contactIdentifier.getType())) {<NEW_LINE>throw MissingResourceException.builder().resourceName("contact").resourceIdentifier(jsonContact.getContactIdentifier()).parentResource(jsonContact).detail(TranslatableStrings.constant("With this type, only updates are allowed.")).build().setParameter("parentSyncAdvise", parentSyncAdvise);<NEW_LINE>}<NEW_LINE>contact = shortTermIndex.newContact(contactIdentifier);<NEW_LINE>syncOutcome = SyncOutcome.CREATED;<NEW_LINE>}<NEW_LINE>contact.addHandle(contactIdentifier.getRawIdentifierString());<NEW_LINE>result.syncOutcome(syncOutcome);<NEW_LINE>if (!Objects.equals(SyncOutcome.NOTHING_DONE, syncOutcome)) {<NEW_LINE>syncJsonToContact(contactIdentifier, jsonContact.getContact(), contact, parentSyncAdvise);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
? SyncOutcome.UPDATED : SyncOutcome.NOTHING_DONE;
100,534
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.verify_backup_activity);<NEW_LINE>_mbwManager = MbwManager.getInstance(this.getApplication());<NEW_LINE>findViewById(R.id.btScan).setOnClickListener(new android.view.View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>ScanActivity.callMe(VerifyBackupActivity.this, SCAN_RESULT_CODE, HandleConfigFactory.verifySeedOrKey());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.btClipboard<MASK><NEW_LINE>findViewById(R.id.btClipboard).setOnClickListener(new android.view.View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>String privateKey = Utils.getClipboardString(VerifyBackupActivity.this);<NEW_LINE>verifyClipboardPrivateKey(privateKey);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
).setEnabled(hasPrivateKeyOnClipboard());
1,395,274
public Object visitar(NoRetorne noRetorne) throws ExcecaoVisitaASA {<NEW_LINE>TipoDado tipoRetornoFuncao = TipoDado.VAZIO;<NEW_LINE>if (noRetorne.getExpressao() != null) {<NEW_LINE>TipoDado tipoExpressaoRetorno = TipoDado.VAZIO;<NEW_LINE>try {<NEW_LINE>noRetorne.<MASK><NEW_LINE>tipoExpressaoRetorno = (TipoDado) noRetorne.getExpressao().aceitar(this);<NEW_LINE>tipoRetornoFuncao = tabelaCompatibilidadeTipos.obterTipoRetornoFuncao(funcaoAtual.getTipoDado(), tipoExpressaoRetorno);<NEW_LINE>} catch (ExcecaoValorSeraConvertido e) {<NEW_LINE>notificarAviso(new AvisoValorExpressaoSeraConvertido(noRetorne, e.getTipoEntrada(), e.getTipoSaida(), funcaoAtual.getNome()));<NEW_LINE>tipoRetornoFuncao = e.getTipoSaida();<NEW_LINE>} catch (ExcecaoImpossivelDeterminarTipoDado ex) {<NEW_LINE>notificarErroSemantico(new ErroTiposIncompativeis(noRetorne, new String[] { funcaoAtual.getNome() }, funcaoAtual.getTipoDado(), tipoExpressaoRetorno));<NEW_LINE>throw new ExcecaoVisitaASA(ex, asa, noRetorne);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (tipoRetornoFuncao != funcaoAtual.getOrigemDoSimbolo().getTipoDado()) {<NEW_LINE>notificarErroSemantico(new ErroTiposIncompativeis(noRetorne, new String[] { funcaoAtual.getNome() }, funcaoAtual.getTipoDado(), TipoDado.VAZIO));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tipoRetornoFuncao;<NEW_LINE>}
setPai(funcaoAtual.getOrigemDoSimbolo());
112,793
private void runAssertionMapWithinMapExists(RegressionEnvironment env) {<NEW_LINE>String statementText = "@name('s0') select " + "exists(innermap.int?) as t0, " + "exists(innermap.innerTwo?.nested) as t1, " + "exists(innermap.innerTwo?.innerThree.nestedTwo) as t2, " + "exists(dynamicOne?) as t3, " + "exists(dynamicTwo?) as t4, " + "exists(indexed[1]?) as t5, " + "exists(mapped('keyOne')?) as t6, " + "exists(innermap.indexedTwo[0]?) as t7, " + "exists(innermap.mappedTwo('keyTwo')?) as t8 " + "from MyLevel2#length(5)";<NEW_LINE>env.compileDeploy(statementText).addListener("s0");<NEW_LINE>HashMap map = new <MASK><NEW_LINE>map.put("dynamicTwo", 20L);<NEW_LINE>map.put("innermap", makeMap("int", 10, "indexedTwo", new int[] { -10 }, "mappedTwo", makeMap("keyTwo", "def"), "innerTwo", makeMap("nested", 30d, "innerThree", makeMap("nestedTwo", 99))));<NEW_LINE>map.put("indexed", new float[] { -1, -2, -3 });<NEW_LINE>map.put("mapped", makeMap("keyOne", "abc"));<NEW_LINE>env.sendEventMap(map, "MyLevel2");<NEW_LINE>assertResults(env, new Object[] { true, true, true, false, true, true, true, true, true });<NEW_LINE>map = new HashMap<String, Object>();<NEW_LINE>map.put("innermap", makeMap("indexedTwo", new int[] {}, "mappedTwo", makeMap("yyy", "xxx"), "innerTwo", null));<NEW_LINE>map.put("indexed", new float[] {});<NEW_LINE>map.put("mapped", makeMap("xxx", "yyy"));<NEW_LINE>env.sendEventMap(map, "MyLevel2");<NEW_LINE>assertResults(env, new Object[] { false, false, false, false, false, false, false, false, false });<NEW_LINE>env.sendEventMap(new HashMap<String, Object>(), "MyLevel2");<NEW_LINE>assertResults(env, new Object[] { false, false, false, false, false, false, false, false, false });<NEW_LINE>map = new HashMap<String, Object>();<NEW_LINE>map.put("innermap", "xxx");<NEW_LINE>map.put("indexed", null);<NEW_LINE>map.put("mapped", "xxx");<NEW_LINE>env.sendEventMap(map, "MyLevel2");<NEW_LINE>assertResults(env, new Object[] { false, false, false, false, false, false, false, false, false });<NEW_LINE>env.undeployAll();<NEW_LINE>}
HashMap<String, Object>();
227,689
final CreatePartitionIndexResult executeCreatePartitionIndex(CreatePartitionIndexRequest createPartitionIndexRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPartitionIndexRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePartitionIndexRequest> request = null;<NEW_LINE>Response<CreatePartitionIndexResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePartitionIndexRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPartitionIndexRequest));<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, "Glue");<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<CreatePartitionIndexResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePartitionIndexResultJsonUnmarshaller());<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, "CreatePartitionIndex");
239,915
public void paintIcon(Component c, Graphics g, int x, int y) {<NEW_LINE>x = (c.getWidth() - getIconWidth()) / 2;<NEW_LINE>y = (c.getHeight() - getIconHeight()) / 2;<NEW_LINE>g.setColor(UIManager.getColor("Button.Foreground"));<NEW_LINE>g.drawLine(x + 3, y, x + 3, y);<NEW_LINE>g.drawLine(x + 2, y + 1, x + 2 + 2, y + 1);<NEW_LINE>g.drawLine(x + 1, y + 2, x + 1 + 4, y + 2);<NEW_LINE>g.drawLine(x, y + 3, x + 6, y + 3);<NEW_LINE>g.drawLine(x, y + 7, x + 6, y + 7);<NEW_LINE>g.drawLine(x + 1, y + 8, x + 1 + 4, y + 8);<NEW_LINE>g.drawLine(x + 2, y + 9, x + <MASK><NEW_LINE>g.drawLine(x + 3, y + 10, x + 3, y + 10);<NEW_LINE>}
2 + 2, y + 9);
1,738,989
public List<FileSystemAction> determineFileSystemActions(MemoryDatabase winnersDatabase, boolean cleanupOccurred, List<PartialFileHistory> localFileHistoriesWithLastVersion) throws Exception {<NEW_LINE>this.assembler = new Assembler(config, localDatabase, winnersDatabase);<NEW_LINE>List<FileSystemAction> fileSystemActions = new ArrayList<FileSystemAction>();<NEW_LINE>// Load file history cache<NEW_LINE>logger.log(Level.INFO, "- Loading current file tree...");<NEW_LINE>Map<FileHistoryId, FileVersion> localFileHistoryIdCache = fillFileHistoryIdCache(localFileHistoriesWithLastVersion);<NEW_LINE>logger.log(Level.INFO, "- Determine filesystem actions ...");<NEW_LINE>for (PartialFileHistory winningFileHistory : winnersDatabase.getFileHistories()) {<NEW_LINE>// Get remote file version and content<NEW_LINE>FileVersion winningLastVersion = winningFileHistory.getLastVersion();<NEW_LINE>File winningLastFile = new File(config.getLocalDir(), winningLastVersion.getPath());<NEW_LINE>// Get local file version and content<NEW_LINE>FileVersion localLastVersion = localFileHistoryIdCache.<MASK><NEW_LINE>File localLastFile = (localLastVersion != null) ? new File(config.getLocalDir(), localLastVersion.getPath()) : null;<NEW_LINE>logger.log(Level.INFO, " + Comparing local version: " + localLastVersion);<NEW_LINE>logger.log(Level.INFO, " with winning version : " + winningLastVersion);<NEW_LINE>// Sync algorithm ////<NEW_LINE>// No local file version in local database<NEW_LINE>if (localLastVersion == null) {<NEW_LINE>determineActionNoLocalLastVersion(winningLastVersion, winningLastFile, winnersDatabase, fileSystemActions);<NEW_LINE>} else // Local version found in local database<NEW_LINE>{<NEW_LINE>FileVersionComparison localFileToVersionComparison = fileVersionComparator.compare(localLastVersion, localLastFile, true);<NEW_LINE>// Local file on disk as expected<NEW_LINE>if (localFileToVersionComparison.areEqual()) {<NEW_LINE>determineActionWithLocalVersionAndLocalFileAsExpected(winningLastVersion, winningLastFile, localLastVersion, localLastFile, winnersDatabase, fileSystemActions);<NEW_LINE>} else // Local file NOT what was expected<NEW_LINE>{<NEW_LINE>determineActionWithLocalVersionAndLocalFileDiffers(winningLastVersion, winningLastFile, localLastVersion, localLastFile, winnersDatabase, fileSystemActions, localFileToVersionComparison);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Find file histories that are in the local database and not in the<NEW_LINE>// winner's database. They will be assumed to be deleted.<NEW_LINE>if (cleanupOccurred) {<NEW_LINE>logger.log(Level.INFO, "- Determine filesystem actions (for deleted histories in winner's branch)...");<NEW_LINE>Map<FileHistoryId, FileVersion> winnerFileHistoryIdCache = fillFileHistoryIdCache(winnersDatabase.getFileHistories());<NEW_LINE>for (PartialFileHistory localFileHistoryWithLastVersion : localFileHistoriesWithLastVersion) {<NEW_LINE>boolean localFileHistoryInWinnersDatabase = winnerFileHistoryIdCache.get(localFileHistoryWithLastVersion.getFileHistoryId()) != null;<NEW_LINE>// If the file history is also present in the winner's database, it<NEW_LINE>// has already been processed above. So we'll ignore it here.<NEW_LINE>if (!localFileHistoryInWinnersDatabase) {<NEW_LINE>FileVersion localLastVersion = localFileHistoryWithLastVersion.getLastVersion();<NEW_LINE>File localLastFile = (localLastVersion != null) ? new File(config.getLocalDir(), localLastVersion.getPath()) : null;<NEW_LINE>determineActionFileHistoryNotInWinnerBranch(localLastVersion, localLastFile, fileSystemActions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fileSystemActions;<NEW_LINE>}
get(winningFileHistory.getFileHistoryId());
1,171,949
private Credentials unlock(final PasswordCallback callback, final Host bookmark, final UserKeyPair keypair, String passphrase, final String message) throws LoginCanceledException, CryptoException {<NEW_LINE>final Credentials credentials;<NEW_LINE>if (null == passphrase) {<NEW_LINE>credentials = callback.prompt(bookmark, LocaleFactory.localizedString("Decryption password required", "SDS"), message, new LoginOptions().icon(bookmark.getProtocol<MASK><NEW_LINE>if (credentials.getPassword() == null) {<NEW_LINE>throw new LoginCanceledException();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>credentials = new VaultCredentials(passphrase).withSaved(true);<NEW_LINE>}<NEW_LINE>if (!Crypto.checkUserKeyPair(keypair, credentials.getPassword())) {<NEW_LINE>return this.unlock(callback, bookmark, keypair, null, String.format("%s. %s", LocaleFactory.localizedString("Invalid passphrase", "Credentials"), LocaleFactory.localizedString("Enter your decryption password to access encrypted data rooms.", "SDS")));<NEW_LINE>} else {<NEW_LINE>if (credentials.isSaved()) {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Save encryption password for %s", bookmark));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>keychain.addPassword(this.getServiceName(bookmark, keypair.getUserPublicKey().getVersion()), this.getAccountName(bookmark), credentials.getPassword());<NEW_LINE>} catch (LocalAccessDeniedException e) {<NEW_LINE>log.error(String.format("Failure %s saving credentials for %s in password store", e, bookmark));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return credentials;<NEW_LINE>}<NEW_LINE>}
().disk()));
1,312,824
public InputDestination unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InputDestination inputDestination = new InputDestination();<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("ip", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDestination.setIp(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("port", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDestination.setPort(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("url", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDestination.setUrl(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("vpc", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDestination.setVpc(InputDestinationVpcJsonUnmarshaller.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 inputDestination;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
965,034
List<Inode> createFileInternal(RpcContext rpcContext, LockedInodePath inodePath, CreateFileContext context) throws InvalidPathException, FileAlreadyExistsException, BlockInfoException, IOException, FileDoesNotExistException {<NEW_LINE>if (mWhitelist.inList(inodePath.getUri().toString())) {<NEW_LINE>context.setCacheable(true);<NEW_LINE>}<NEW_LINE>// If the create succeeded, the list of created inodes will not be empty.<NEW_LINE>List<Inode> created = mInodeTree.createPath(rpcContext, inodePath, context);<NEW_LINE>if (context.isPersisted()) {<NEW_LINE>// The path exists in UFS, so it is no longer absent. The ancestors exist in UFS, but the<NEW_LINE>// actual file does not exist in UFS yet.<NEW_LINE>mUfsAbsentPathCache.processExisting(inodePath.<MASK><NEW_LINE>} else {<NEW_LINE>MountTable.Resolution resolution = mMountTable.resolve(inodePath.getUri());<NEW_LINE>Metrics.getUfsOpsSavedCounter(resolution.getUfsMountPointUri(), Metrics.UFSOps.CREATE_FILE).inc();<NEW_LINE>}<NEW_LINE>Metrics.FILES_CREATED.inc();<NEW_LINE>return created;<NEW_LINE>}
getUri().getParent());
395,697
private void releaseMessage(Message<?> message) {<NEW_LINE>String identity = ObjectUtils.getIdentityHexString(message);<NEW_LINE>this.deliveries.putIfAbsent(identity, new AtomicInteger());<NEW_LINE>try {<NEW_LINE>this.releaseHandler.handleMessage(message);<NEW_LINE>this.deliveries.remove(identity);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (getErrorChannel() != null) {<NEW_LINE>ErrorMessage errorMessage = new ErrorMessage(e, Collections.singletonMap(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, new AtomicInteger(this.deliveries.get(identity).get() + 1)), message);<NEW_LINE>try {<NEW_LINE>if (!(getErrorChannel().send(errorMessage))) {<NEW_LINE>this.logger.debug(() -> "Failed to send error message: " + errorMessage);<NEW_LINE>rescheduleForRetry(message, identity);<NEW_LINE>} else {<NEW_LINE>this.deliveries.remove(identity);<NEW_LINE>}<NEW_LINE>} catch (Exception e1) {<NEW_LINE>logger.debug(e1, () -> "Error flow threw an exception for message: " + message);<NEW_LINE>rescheduleForRetry(message, identity);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug(e<MASK><NEW_LINE>if (!rescheduleForRetry(message, identity)) {<NEW_LINE>// there might be an error handler on the scheduler<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, () -> "Release flow threw an exception for message: " + message);
504,489
private void runTest(String testMethod, PrintWriter pw, HttpServletRequest req, HttpServletResponse resp) {<NEW_LINE>try {<NEW_LINE>Method testM = this.getClass().getDeclaredMethod(testMethod, new Class[] { Map.class, StringBuilder.class });<NEW_LINE>Map<String, String> m = new HashMap<String, String>();<NEW_LINE>Iterator<String> itr = req.getParameterMap().keySet().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>String key = itr.next();<NEW_LINE>if (key.indexOf("@") == 0) {<NEW_LINE>m.put(key.substring(1), req.getParameter(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m.put(<MASK><NEW_LINE>m.put("serverPort", String.valueOf(req.getLocalPort()));<NEW_LINE>m.put("context", req.getContextPath());<NEW_LINE>StringBuilder ret = new StringBuilder();<NEW_LINE>testM.invoke(this, m, ret);<NEW_LINE>pw.write(ret.toString());<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace(pw);<NEW_LINE>}<NEW_LINE>}
"serverIP", req.getLocalAddr());
885,095
public void onClick(View v) {<NEW_LINE>if (mTransactionIds == null) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>long dstAccountId = mDestinationAccountSpinner.getSelectedItemId();<NEW_LINE>String dstAccountUID = AccountsDbAdapter.getInstance().getUID(dstAccountId);<NEW_LINE>TransactionsDbAdapter trxnAdapter = TransactionsDbAdapter.getInstance();<NEW_LINE>if (!trxnAdapter.getAccountCurrencyCode(dstAccountUID).equals(trxnAdapter.getAccountCurrencyCode(mOriginAccountUID))) {<NEW_LINE>Toast.makeText(getActivity(), R.string.toast_incompatible_currency, Toast.LENGTH_LONG).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String srcAccountUID = ((TransactionsActivity) getActivity()).getCurrentAccountUID();<NEW_LINE>for (long trxnId : mTransactionIds) {<NEW_LINE>trxnAdapter.moveTransaction(trxnAdapter.getUID<MASK><NEW_LINE>}<NEW_LINE>WidgetConfigurationActivity.updateAllWidgets(getActivity());<NEW_LINE>((Refreshable) getTargetFragment()).refresh();<NEW_LINE>dismiss();<NEW_LINE>}
(trxnId), srcAccountUID, dstAccountUID);
1,367,112
private void updateTopicList() {<NEW_LINE>logger.info("Update topicList");<NEW_LINE>topicList.clear();<NEW_LINE>partitionLeader.clear();<NEW_LINE>// update topicList<NEW_LINE>topicList = helixMirrorMakerManager.getTopicLists();<NEW_LINE>logger.debug("TopicList: {}", topicList);<NEW_LINE>Set<String> topicSet = new HashSet<>(topicList);<NEW_LINE>// update partitionLeader<NEW_LINE>for (String broker : srcBrokerList) {<NEW_LINE>try {<NEW_LINE>SimpleConsumer consumer = getSimpleConsumer(broker);<NEW_LINE>TopicMetadataRequest req = new TopicMetadataRequest(topicList);<NEW_LINE>kafka.javaapi.TopicMetadataResponse resp = consumer.send(req);<NEW_LINE>List<TopicMetadata> metaData = resp.topicsMetadata();<NEW_LINE>for (TopicMetadata tmd : metaData) {<NEW_LINE>for (PartitionMetadata pmd : tmd.partitionsMetadata()) {<NEW_LINE>TopicAndPartition topicAndPartition = new TopicAndPartition(tmd.topic(), pmd.partitionId());<NEW_LINE>if (topicSet.contains(tmd.topic())) {<NEW_LINE>partitionLeader.put(topicAndPartition, pmd.leader());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<Entry<TopicAndPartition, TopicPartitionLag>> iter = noProgressMap<MASK><NEW_LINE>while (iter.hasNext()) {<NEW_LINE>TopicAndPartition tp = iter.next().getKey();<NEW_LINE>if (!topicSet.contains(tp.topic())) {<NEW_LINE>iter.remove();<NEW_LINE>logger.info("Remove non exist topic {} from noProgressMap", tp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Got exception to get metadata from broker=" + broker, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("partitionLeader: {}", partitionLeader);<NEW_LINE>}
.entrySet().iterator();
1,652,924
/*<NEW_LINE>* protected byte[] serialize(Object instance) throws IOException {<NEW_LINE><MASK><NEW_LINE>* ObjectOutputStream out = new ObjectOutputStream(bytes);<NEW_LINE>* out.writeObject(instance);<NEW_LINE>* return bytes.toByteArray();<NEW_LINE>* }<NEW_LINE>*<NEW_LINE>* protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException {<NEW_LINE>* ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));<NEW_LINE>* return in.readObject();<NEW_LINE>* }<NEW_LINE>*/<NEW_LINE>public static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans) {<NEW_LINE>if (beans.size() == 0) {<NEW_LINE>throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);<NEW_LINE>} else if (beans.size() > 1) {<NEW_LINE>throw new AmbiguousResolutionException("More than one bean available for type " + type);<NEW_LINE>}<NEW_LINE>return beans.iterator().next();<NEW_LINE>}
* ByteArrayOutputStream bytes = new ByteArrayOutputStream();
933,009
private void configureJarManifestConventions(Project project) {<NEW_LINE>ExtractResources extractLegalResources = project.getTasks().create("extractLegalResources", ExtractResources.class);<NEW_LINE>extractLegalResources.getDestinationDirectory().set(project.getLayout().getBuildDirectory().dir("legal"));<NEW_LINE>extractLegalResources.setResourcesNames(Arrays.asList("LICENSE.txt", "NOTICE.txt"));<NEW_LINE>extractLegalResources.property("version", project.getVersion().toString());<NEW_LINE>SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);<NEW_LINE>Set<String> sourceJarTaskNames = sourceSets.stream().map(SourceSet::getSourcesJarTaskName).collect(Collectors.toSet());<NEW_LINE>Set<String> javadocJarTaskNames = sourceSets.stream().map(SourceSet::getJavadocJarTaskName).collect(Collectors.toSet());<NEW_LINE>project.getTasks().withType(Jar.class, (jar) -> project.afterEvaluate((evaluated) -> {<NEW_LINE>jar.metaInf((metaInf) -> metaInf.from(extractLegalResources));<NEW_LINE>jar.manifest((manifest) -> {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>attributes.put("Automatic-Module-Name", project.getName().replace("-", "."));<NEW_LINE>attributes.put("Build-Jdk-Spec", SOURCE_AND_TARGET_COMPATIBILITY);<NEW_LINE>attributes.put("Built-By", "Spring");<NEW_LINE>attributes.put("Implementation-Title", determineImplementationTitle(project, sourceJarTaskNames, javadocJarTaskNames, jar));<NEW_LINE>attributes.put("Implementation-Version", project.getVersion());<NEW_LINE>manifest.attributes(attributes);<NEW_LINE>});<NEW_LINE>}));<NEW_LINE>}
attributes = new TreeMap<>();
1,481,492
public boolean beforeSubmit(Submit submit, SubmitContext context) {<NEW_LINE>WsrmContainer container = (WsrmContainer) submit.getRequest();<NEW_LINE>if (container.getWsrmConfig().isWsrmEnabled()) {<NEW_LINE>WsdlInterface iface = request<MASK><NEW_LINE>WsrmUtils utils = new WsrmUtils(iface.getSoapVersion());<NEW_LINE>WsrmSequence sequence = utils.createSequence(request.getEndpoint(), iface.getSoapVersion(), request.getWsrmConfig().getVersionNameSpace(), request.getWsrmConfig().getAckTo(), 0l, request.getOperation(), ((WsdlRequest) submit.getRequest()).getWsaConfig().getTo(), request.getWsrmConfig().getOfferEndpoint());<NEW_LINE>request.getWsrmConfig().setSequenceIdentifier(sequence.getIdentifier());<NEW_LINE>request.getWsrmConfig().setUuid(sequence.getUuid());<NEW_LINE>if (!request.getWsrmConfig().getVersion().equals(WsrmVersionTypeConfig.X_1_0.toString())) {<NEW_LINE>WsmcInjection receiveInjection = new WsmcInjection(request.getEndpoint(), request.getOperation(), iface.getSoapVersion(), request.getWsrmConfig().getUuid());<NEW_LINE>request.setAfterRequestInjection(receiveInjection);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.getOperation().getInterface();
184,863
public void addAndRemoveRows(UIDL partialRowAdditions) {<NEW_LINE>if (partialRowAdditions == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (partialRowAdditions.hasAttribute("hide")) {<NEW_LINE>scrollBody.unlinkAndReindexRows(partialRowAdditions.getIntAttribute("firstprowix"), partialRowAdditions.getIntAttribute("numprows"));<NEW_LINE>scrollBody.ensureCacheFilled();<NEW_LINE>} else {<NEW_LINE>if (partialRowAdditions.hasAttribute("delbelow")) {<NEW_LINE>scrollBody.insertRowsDeleteBelow(partialRowAdditions, partialRowAdditions.getIntAttribute("firstprowix")<MASK><NEW_LINE>} else {<NEW_LINE>scrollBody.insertAndReindexRows(partialRowAdditions, partialRowAdditions.getIntAttribute("firstprowix"), partialRowAdditions.getIntAttribute("numprows"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>discardRowsOutsideCacheWindow();<NEW_LINE>}
, partialRowAdditions.getIntAttribute("numprows"));
80,121
protected RelationPlan visitTable(Table node, Void context) {<NEW_LINE>Query namedQuery = analysis.getNamedQuery(node);<NEW_LINE>Scope scope = analysis.getScope(node);<NEW_LINE>if (namedQuery != null) {<NEW_LINE>RelationPlan subPlan = process(namedQuery, null);<NEW_LINE>// Add implicit coercions if view query produces types that don't match the declared output types<NEW_LINE>// of the view (e.g., if the underlying tables referenced by the view changed)<NEW_LINE>Type[] types = scope.getRelationType().getAllFields().stream().map(Field::getType).toArray(Type[]::new);<NEW_LINE>RelationPlan withCoercions = addCoercions(subPlan, types);<NEW_LINE>return new RelationPlan(withCoercions.getRoot(), scope, withCoercions.getFieldMappings());<NEW_LINE>}<NEW_LINE>TableHandle <MASK><NEW_LINE>ImmutableList.Builder<VariableReferenceExpression> outputVariablesBuilder = ImmutableList.builder();<NEW_LINE>ImmutableMap.Builder<VariableReferenceExpression, ColumnHandle> columns = ImmutableMap.builder();<NEW_LINE>for (Field field : scope.getRelationType().getAllFields()) {<NEW_LINE>VariableReferenceExpression variable = variableAllocator.newVariable(getSourceLocation(node), field.getName().get(), field.getType());<NEW_LINE>outputVariablesBuilder.add(variable);<NEW_LINE>columns.put(variable, analysis.getColumn(field));<NEW_LINE>}<NEW_LINE>List<VariableReferenceExpression> outputVariables = outputVariablesBuilder.build();<NEW_LINE>PlanNode root = new TableScanNode(getSourceLocation(node.getLocation()), idAllocator.getNextId(), handle, outputVariables, columns.build(), TupleDomain.all(), TupleDomain.all());<NEW_LINE>return new RelationPlan(root, scope, outputVariables);<NEW_LINE>}
handle = analysis.getTableHandle(node);
1,321,733
public void marshall(SendDataPoint _sendDataPoint, Request<?> request, String _prefix) {<NEW_LINE>String prefix;<NEW_LINE>if (_sendDataPoint.getTimestamp() != null) {<NEW_LINE>prefix = _prefix + "Timestamp";<NEW_LINE>java.util.Date timestamp = _sendDataPoint.getTimestamp();<NEW_LINE>request.addParameter(prefix, StringUtils.fromDate(timestamp));<NEW_LINE>}<NEW_LINE>if (_sendDataPoint.getDeliveryAttempts() != null) {<NEW_LINE>prefix = _prefix + "DeliveryAttempts";<NEW_LINE>Long deliveryAttempts = _sendDataPoint.getDeliveryAttempts();<NEW_LINE>request.addParameter(prefix, StringUtils.fromLong(deliveryAttempts));<NEW_LINE>}<NEW_LINE>if (_sendDataPoint.getBounces() != null) {<NEW_LINE>prefix = _prefix + "Bounces";<NEW_LINE><MASK><NEW_LINE>request.addParameter(prefix, StringUtils.fromLong(bounces));<NEW_LINE>}<NEW_LINE>if (_sendDataPoint.getComplaints() != null) {<NEW_LINE>prefix = _prefix + "Complaints";<NEW_LINE>Long complaints = _sendDataPoint.getComplaints();<NEW_LINE>request.addParameter(prefix, StringUtils.fromLong(complaints));<NEW_LINE>}<NEW_LINE>if (_sendDataPoint.getRejects() != null) {<NEW_LINE>prefix = _prefix + "Rejects";<NEW_LINE>Long rejects = _sendDataPoint.getRejects();<NEW_LINE>request.addParameter(prefix, StringUtils.fromLong(rejects));<NEW_LINE>}<NEW_LINE>}
Long bounces = _sendDataPoint.getBounces();
473,050
private static String expandRedirectUri(HttpServletRequest request, ClientRegistration clientRegistration, String action) {<NEW_LINE>Map<String, String> uriVariables = new HashMap<>();<NEW_LINE>uriVariables.put(<MASK><NEW_LINE>// @formatter:off<NEW_LINE>UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(UrlUtils.buildFullRequestUrl(request)).replacePath(request.getContextPath()).replaceQuery(null).fragment(null).build();<NEW_LINE>// @formatter:on<NEW_LINE>String scheme = uriComponents.getScheme();<NEW_LINE>uriVariables.put("baseScheme", (scheme != null) ? scheme : "");<NEW_LINE>String host = uriComponents.getHost();<NEW_LINE>uriVariables.put("baseHost", (host != null) ? host : "");<NEW_LINE>// following logic is based on HierarchicalUriComponents#toUriString()<NEW_LINE>int port = uriComponents.getPort();<NEW_LINE>uriVariables.put("basePort", (port == -1) ? "" : ":" + port);<NEW_LINE>String path = uriComponents.getPath();<NEW_LINE>if (StringUtils.hasLength(path)) {<NEW_LINE>if (path.charAt(0) != PATH_DELIMITER) {<NEW_LINE>path = PATH_DELIMITER + path;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>uriVariables.put("basePath", (path != null) ? path : "");<NEW_LINE>uriVariables.put("baseUrl", uriComponents.toUriString());<NEW_LINE>uriVariables.put("action", (action != null) ? action : "");<NEW_LINE>return UriComponentsBuilder.fromUriString(clientRegistration.getRedirectUri()).buildAndExpand(uriVariables).toUriString();<NEW_LINE>}
"registrationId", clientRegistration.getRegistrationId());
252,776
private // This will be called when window resized or font changed.<NEW_LINE>void repaintDisplayPanelBorder() {<NEW_LINE>Dimension size = this.getDisplayPanelTextDimensions();<NEW_LINE>int cols = (int) size.getWidth();<NEW_LINE>int rows = (int) size.getHeight();<NEW_LINE><MASK><NEW_LINE>String stringCaretPosition;<NEW_LINE>// display position as stream or 2D depending on random access<NEW_LINE>if (displayRandomAccessMode) {<NEW_LINE>// if ( caretPosition == rows*(columns+1)+1) {<NEW_LINE>// stringCaretPosition = "(0,0)";<NEW_LINE>// }<NEW_LINE>// else if ( (caretPosition+1) % (columns+1) == 0) {<NEW_LINE>// stringCaretPosition = "(0,"+((caretPosition/(columns+1))+1)+")";<NEW_LINE>// }<NEW_LINE>// else {<NEW_LINE>// stringCaretPosition = "("+(caretPosition%(columns+1))+","+(caretPosition/(columns+1))+")";<NEW_LINE>// }<NEW_LINE>if (((caretPosition + 1) % (columns + 1) != 0)) {<NEW_LINE>stringCaretPosition = "(" + (caretPosition % (columns + 1)) + "," + (caretPosition / (columns + 1)) + ")";<NEW_LINE>} else if (((caretPosition + 1) % (columns + 1) == 0) && ((caretPosition / (columns + 1)) + 1 == rows)) {<NEW_LINE>stringCaretPosition = "(" + (caretPosition % (columns + 1) - 1) + "," + (caretPosition / (columns + 1)) + ")";<NEW_LINE>} else {<NEW_LINE>stringCaretPosition = "(0," + ((caretPosition / (columns + 1)) + 1) + ")";<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>stringCaretPosition = "" + caretPosition;<NEW_LINE>}<NEW_LINE>String title = displayPanelTitle + ", cursor " + stringCaretPosition + ", area " + cols + " x " + rows;<NEW_LINE>((TitledBorder) displayPanel.getBorder()).setTitle(title);<NEW_LINE>displayPanel.repaint();<NEW_LINE>}
int caretPosition = display.getCaretPosition();
1,717,039
private void handleVisualElement(Circuit c, VisualElement ve, Args args, ArrayList<VisualElement> newComponents, ArrayList<Wire> newWires, Globals globals) throws ElementNotFoundException, NodeException {<NEW_LINE><MASK><NEW_LINE>String gen = elementAttributes.get(Keys.GENERIC).trim();<NEW_LINE>try {<NEW_LINE>if (!gen.isEmpty()) {<NEW_LINE>ElementTypeDescription elementTypeDescription = library.getElementType(ve.getElementName(), elementAttributes);<NEW_LINE>boolean isCustom = elementTypeDescription instanceof ElementTypeDescriptionCustom;<NEW_LINE>Statement genS = getStatement(gen);<NEW_LINE>Context mod = createContext(c, newComponents, newWires, args).declareVar(GLOBALS_KEY, globals).declareVar("args", args);<NEW_LINE>if (isCustom)<NEW_LINE>mod.declareFunc("setCircuit", new SetCircuitFunc(ve));<NEW_LINE>else<NEW_LINE>mod.declareVar("this", new SubstituteLibrary.AllowSetAttributes(elementAttributes));<NEW_LINE>genS.execute(mod);<NEW_LINE>elementAttributes.putToCache(GEN_ARGS_KEY, mod);<NEW_LINE>}<NEW_LINE>} catch (HGSEvalException | ParserException | IOException e) {<NEW_LINE>throw new NodeException(Lang.get("err_evaluatingGenericsCode_N_N", ve, gen), e);<NEW_LINE>}<NEW_LINE>}
ElementAttributes elementAttributes = ve.getElementAttributes();
1,221,560
private static IPrestoSparkService createService(SparkProcessType sparkProcessType, PackageSupplier packageSupplier, Map<String, String> configProperties, Map<String, Map<String, String>> catalogProperties, String metadataStorageType, Optional<Map<String, String>> eventListenerProperties, Optional<Map<String, String>> accessControlProperties, Optional<Map<String, String>> sessionPropertyConfigurationProperties, Optional<Map<String, Map<String, String>>> functionNamespaceProperties, Optional<Map<String, Map<String, String>>> tempStorageProperties) {<NEW_LINE>String packagePath = getPackagePath(packageSupplier);<NEW_LINE>File pluginsDirectory = checkDirectory(new File(packagePath, "plugin"));<NEW_LINE>PrestoSparkConfiguration configuration = new PrestoSparkConfiguration(configProperties, pluginsDirectory.getAbsolutePath(), catalogProperties, metadataStorageType, eventListenerProperties, <MASK><NEW_LINE>IPrestoSparkServiceFactory serviceFactory = createServiceFactory(checkDirectory(new File(packagePath, "lib")));<NEW_LINE>return serviceFactory.createService(sparkProcessType, configuration);<NEW_LINE>}
accessControlProperties, sessionPropertyConfigurationProperties, functionNamespaceProperties, tempStorageProperties);
1,139,796
final CreatePackageImportJobResult executeCreatePackageImportJob(CreatePackageImportJobRequest createPackageImportJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPackageImportJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreatePackageImportJobRequest> request = null;<NEW_LINE>Response<CreatePackageImportJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePackageImportJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPackageImportJobRequest));<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, "Panorama");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePackageImportJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePackageImportJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePackageImportJobResultJsonUnmarshaller());<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);
1,598,370
// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public FunctionRequirements requirements(T target, Set<Measure> measures, CalculationParameters parameters, ReferenceData refData) {<NEW_LINE>// extract data from product<NEW_LINE>BondFutureOption option = target.getProduct();<NEW_LINE>BondFuture future = option.getUnderlyingFuture();<NEW_LINE>// use lookup to build requirements<NEW_LINE>QuoteId optionQuoteId = QuoteId.of(option.getSecurityId().getStandardId(), FieldName.SETTLEMENT_PRICE);<NEW_LINE>FunctionRequirements freqs = FunctionRequirements.builder().valueRequirements(optionQuoteId).outputCurrencies(future.getCurrency(), option.getCurrency()).build();<NEW_LINE>LegalEntityDiscountingMarketDataLookup ledLookup = parameters.getParameter(LegalEntityDiscountingMarketDataLookup.class);<NEW_LINE>for (FixedCouponBond bond : future.getDeliveryBasket()) {<NEW_LINE>freqs = freqs.combinedWith(ledLookup.requirements(bond.getSecurityId(), bond.getLegalEntityId(), bond.getCurrency()));<NEW_LINE>}<NEW_LINE>BondFutureOptionMarketDataLookup optionLookup = parameters.getParameter(BondFutureOptionMarketDataLookup.class);<NEW_LINE>FunctionRequirements optionReqs = optionLookup.<MASK><NEW_LINE>return freqs.combinedWith(optionReqs);<NEW_LINE>}
requirements(future.getSecurityId());
207,240
public void putIndexValue(int indexId, final Object key, final Object value) throws OInvalidIndexEngineIdException {<NEW_LINE>final int engineAPIVersion = extractEngineAPIVersion(indexId);<NEW_LINE>final int internalIndexId = extractInternalId(indexId);<NEW_LINE>if (engineAPIVersion != 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (transaction.get() != null) {<NEW_LINE>final OAtomicOperation atomicOperation = atomicOperationsManager.getCurrentOperation();<NEW_LINE>assert atomicOperation != null;<NEW_LINE>putIndexValueInternal(atomicOperation, indexId, key, value);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>stateLock.acquireReadLock();<NEW_LINE>try {<NEW_LINE>interruptionManager.enterCriticalPath();<NEW_LINE>checkOpennessAndMigration();<NEW_LINE>checkIfThreadIsBlocked();<NEW_LINE>makeStorageDirty();<NEW_LINE>atomicOperationsManager.executeInsideAtomicOperation(null, atomicOperation -> putIndexValueInternal(atomicOperation, internalIndexId, key, value));<NEW_LINE>} finally {<NEW_LINE>stateLock.releaseReadLock();<NEW_LINE>interruptionManager.exitCriticalPath();<NEW_LINE>}<NEW_LINE>} catch (final OInvalidIndexEngineIdException ie) {<NEW_LINE>throw logAndPrepareForRethrow(ie);<NEW_LINE>} catch (final RuntimeException ee) {<NEW_LINE>throw logAndPrepareForRethrow(ee);<NEW_LINE>} catch (final Error ee) {<NEW_LINE>throw logAndPrepareForRethrow(ee);<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>throw logAndPrepareForRethrow(t);<NEW_LINE>}<NEW_LINE>}
throw new IllegalStateException("Unsupported version of index engine API. Required 0 but found " + engineAPIVersion);
1,821,126
public static DescribeDBClusterNetInfoResponse unmarshall(DescribeDBClusterNetInfoResponse describeDBClusterNetInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDBClusterNetInfoResponse.setRequestId(_ctx.stringValue("DescribeDBClusterNetInfoResponse.RequestId"));<NEW_LINE>describeDBClusterNetInfoResponse.setClusterNetworkType(_ctx.stringValue("DescribeDBClusterNetInfoResponse.ClusterNetworkType"));<NEW_LINE>List<Address> items = new ArrayList<Address>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDBClusterNetInfoResponse.Items.Length"); i++) {<NEW_LINE>Address address = new Address();<NEW_LINE>address.setVPCId(_ctx.stringValue("DescribeDBClusterNetInfoResponse.Items[" + i + "].VPCId"));<NEW_LINE>address.setPort(_ctx.stringValue<MASK><NEW_LINE>address.setVSwitchId(_ctx.stringValue("DescribeDBClusterNetInfoResponse.Items[" + i + "].VSwitchId"));<NEW_LINE>address.setIPAddress(_ctx.stringValue("DescribeDBClusterNetInfoResponse.Items[" + i + "].IPAddress"));<NEW_LINE>address.setConnectionString(_ctx.stringValue("DescribeDBClusterNetInfoResponse.Items[" + i + "].ConnectionString"));<NEW_LINE>address.setConnectionStringPrefix(_ctx.stringValue("DescribeDBClusterNetInfoResponse.Items[" + i + "].ConnectionStringPrefix"));<NEW_LINE>address.setNetType(_ctx.stringValue("DescribeDBClusterNetInfoResponse.Items[" + i + "].NetType"));<NEW_LINE>items.add(address);<NEW_LINE>}<NEW_LINE>describeDBClusterNetInfoResponse.setItems(items);<NEW_LINE>return describeDBClusterNetInfoResponse;<NEW_LINE>}
("DescribeDBClusterNetInfoResponse.Items[" + i + "].Port"));
1,060,965
public void handleCmd(TelemetryWebSocketSessionRef session, AlarmDataCmd cmd) {<NEW_LINE>TbAlarmDataSubCtx ctx = getSubCtx(session.getSessionId(), cmd.getCmdId());<NEW_LINE>if (ctx == null) {<NEW_LINE>log.debug("[{}][{}] Creating new alarm subscription using: {}", session.getSessionId(), cmd.getCmdId(), cmd);<NEW_LINE>ctx = createSubCtx(session, cmd);<NEW_LINE>}<NEW_LINE>ctx.setAndResolveQuery(cmd.getQuery());<NEW_LINE>AlarmDataQuery adq = ctx.getQuery();<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>ctx.fetchData();<NEW_LINE>long end = System.currentTimeMillis();<NEW_LINE>stats.getRegularQueryInvocationCnt().incrementAndGet();<NEW_LINE>stats.getRegularQueryTimeSpent(<MASK><NEW_LINE>List<EntityData> entities = ctx.getEntitiesData();<NEW_LINE>ctx.cancelTasks();<NEW_LINE>ctx.clearEntitySubscriptions();<NEW_LINE>if (entities.isEmpty()) {<NEW_LINE>AlarmDataUpdate update = new AlarmDataUpdate(cmd.getCmdId(), new PageData<>(), null, 0, 0);<NEW_LINE>wsService.sendWsMsg(ctx.getSessionId(), update);<NEW_LINE>} else {<NEW_LINE>ctx.fetchAlarms();<NEW_LINE>ctx.createLatestValuesSubscriptions(cmd.getQuery().getLatestValues());<NEW_LINE>if (adq.getPageLink().getTimeWindow() > 0) {<NEW_LINE>TbAlarmDataSubCtx finalCtx = ctx;<NEW_LINE>ScheduledFuture<?> task = scheduler.scheduleWithFixedDelay(finalCtx::checkAndResetInvocationCounter, dynamicPageLinkRefreshInterval, dynamicPageLinkRefreshInterval, TimeUnit.SECONDS);<NEW_LINE>finalCtx.setRefreshTask(task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).addAndGet(end - start);
300,228
// Clone new authentication session from the given authSession. New authenticationSession will have same parent (rootSession) and will use same client<NEW_LINE>public static AuthenticationSessionModel clone(KeycloakSession session, AuthenticationSessionModel authSession) {<NEW_LINE>AuthenticationSessionModel clone = authSession.getParentSession().createAuthenticationSession(authSession.getClient());<NEW_LINE>clone.setRedirectUri(authSession.getRedirectUri());<NEW_LINE>clone.<MASK><NEW_LINE>for (Map.Entry<String, String> clientNote : authSession.getClientNotes().entrySet()) {<NEW_LINE>clone.setClientNote(clientNote.getKey(), clientNote.getValue());<NEW_LINE>}<NEW_LINE>clone.setAuthNote(FORKED_FROM, authSession.getTabId());<NEW_LINE>logger.debugf("Forked authSession %s from authSession %s . Client: %s, Root session: %s", clone.getTabId(), authSession.getTabId(), authSession.getClient().getClientId(), authSession.getParentSession().getId());<NEW_LINE>return clone;<NEW_LINE>}
setProtocol(authSession.getProtocol());
1,620,598
void emptyArray(final StructInfo si, final String className) throws IOException {<NEW_LINE>asFormatConverter(si, "ArrayFormatConverter", className, true);<NEW_LINE>List<AttributeInfo> sortedAttributes = sortedAttributes(si, true);<NEW_LINE>writeArray(className, sortedAttributes);<NEW_LINE>code.append("\t\tpublic ").append(className).append(" readContent(final com.dslplatform.json.JsonReader reader) throws java.io.IOException {\n");<NEW_LINE>code.append("\t\t\t").append(className).append(" instance = ");<NEW_LINE>if (si.annotatedFactory != null) {<NEW_LINE>code.append(si.annotatedFactory.getEnclosingElement().toString()).append(".").append(si.annotatedFactory.getSimpleName()).append("();\n ");<NEW_LINE>} else {<NEW_LINE>code.append("new ").append(className).append("();\n ");<NEW_LINE>}<NEW_LINE>code.append("\t\t\tbind(reader, instance);\n");<NEW_LINE>code.append("\t\t\treturn instance;\n");<NEW_LINE>code.append("\t\t}\n");<NEW_LINE>code.append("\t\tpublic ").append(className).append(" bind(final com.dslplatform.json.JsonReader reader, final ");<NEW_LINE>code.append<MASK><NEW_LINE>code.append("\t\t\tif (reader.last() != '[') throw reader.newParseError(\"Expecting '[' for object start\");\n");<NEW_LINE>int i = sortedAttributes.size();<NEW_LINE>for (AttributeInfo attr : sortedAttributes) {<NEW_LINE>code.append("\t\t\treader.getNextToken();\n");<NEW_LINE>processPropertyValue(attr, "\t", true, si.genericSignatures);<NEW_LINE>i--;<NEW_LINE>if (i > 0) {<NEW_LINE>code.append("\t\t\tif (reader.getNextToken() != ',') throw reader.newParseError(\"Expecting ',' for other object elements\");\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>code.append("\t\t\tif (reader.getNextToken() != ']') throw reader.newParseError(\"Expecting ']' for object end\");\n");<NEW_LINE>code.append("\t\t\treturn instance;\n");<NEW_LINE>code.append("\t\t}\n");<NEW_LINE>code.append("\t}\n");<NEW_LINE>}
(className).append(" instance) throws java.io.IOException {\n");
928,666
public void inflate(Context context, ViewGroup container, boolean nightMode) {<NEW_LINE>super.inflate(context, container, nightMode);<NEW_LINE>bottomBtnBgRadius = AndroidUtils.dpToPx(context, 4);<NEW_LINE>bottomBtnTextColor = ColorUtilities.getPrimaryTextColor(context, nightMode);<NEW_LINE>activeColor = ColorUtilities.getActiveColor(context, nightMode);<NEW_LINE>bottomBtnBg = new GradientDrawable();<NEW_LINE>bottomBtnBg.setColor(ColorUtilities.getColorWithAlpha(activeColor, 0.1f));<NEW_LINE>bottomBtnBg.setStroke(AndroidUtils.dpToPx(context, 1), ColorUtilities.getColorWithAlpha(activeColor, 0.5f));<NEW_LINE>bottomButtons = view.findViewById(R.id.bottom_btns);<NEW_LINE>leftBtnContainer = view.findViewById(R.id.left_btn_container);<NEW_LINE>rightBtnContainer = view.<MASK><NEW_LINE>leftBtn = view.findViewById(R.id.left_btn);<NEW_LINE>rightBtn = view.findViewById(R.id.right_btn);<NEW_LINE>AndroidUiHelper.updateVisibility(bottomButtons, isChecked());<NEW_LINE>if (leftBtn != null) {<NEW_LINE>leftBtn.setText(leftBtnTitleRes);<NEW_LINE>leftBtn.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>isLeftBtnSelected = true;<NEW_LINE>if (onBottomBtnClickListener != null) {<NEW_LINE>onBottomBtnClickListener.onBottomBtnClick(true);<NEW_LINE>}<NEW_LINE>updateBottomButtons();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (rightBtn != null) {<NEW_LINE>rightBtn.setText(rightBtnTitleRes);<NEW_LINE>rightBtn.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>isLeftBtnSelected = false;<NEW_LINE>if (onBottomBtnClickListener != null) {<NEW_LINE>onBottomBtnClickListener.onBottomBtnClick(false);<NEW_LINE>}<NEW_LINE>updateBottomButtons();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>updateBottomButtons();<NEW_LINE>}
findViewById(R.id.right_btn_container);
1,354,682
public void accept(final List<BlockWithReceipts> blocksWithReceipts) {<NEW_LINE>final long startTime = System.nanoTime();<NEW_LINE>for (final BlockWithReceipts blockWithReceipts : blocksWithReceipts) {<NEW_LINE>if (!importBlock(blockWithReceipts)) {<NEW_LINE>throw new InvalidBlockException("Failed to import block", blockWithReceipts.getHeader().getNumber(), blockWithReceipts.getHash());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logStartBlock.isEmpty()) {<NEW_LINE>logStartBlock = OptionalLong.of(blocksWithReceipts.get(0).getNumber());<NEW_LINE>}<NEW_LINE>final long lastBlock = blocksWithReceipts.get(blocksWithReceipts.size() - 1).getNumber();<NEW_LINE>// ethContext is not available in tests<NEW_LINE>int peerCount = -1;<NEW_LINE>if (ethContext != null && ethContext.getEthPeers().peerCount() >= 0) {<NEW_LINE>peerCount = ethContext.getEthPeers().peerCount();<NEW_LINE>}<NEW_LINE>final long endTime = System.nanoTime();<NEW_LINE>accumulatedTime += TimeUnit.MILLISECONDS.convert(<MASK><NEW_LINE>if (accumulatedTime > TEN_SECONDS) {<NEW_LINE>LOG.info("Completed importing chain segment {} to {} ({} blocks in {}ms), Peers: {}", logStartBlock.getAsLong(), lastBlock, lastBlock - logStartBlock.getAsLong() + 1, accumulatedTime, peerCount);<NEW_LINE>accumulatedTime = 0L;<NEW_LINE>logStartBlock = OptionalLong.empty();<NEW_LINE>}<NEW_LINE>}
endTime - startTime, TimeUnit.NANOSECONDS);
565,385
public DescribeNotificationConfigurationsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeNotificationConfigurationsResult describeNotificationConfigurationsResult = new DescribeNotificationConfigurationsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeNotificationConfigurationsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("NotificationConfigurations", targetDepth)) {<NEW_LINE>describeNotificationConfigurationsResult.withNotificationConfigurations(new ArrayList<NotificationConfiguration>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("NotificationConfigurations/member", targetDepth)) {<NEW_LINE>describeNotificationConfigurationsResult.withNotificationConfigurations(NotificationConfigurationStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>describeNotificationConfigurationsResult.setNextToken(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeNotificationConfigurationsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
511,604
public final HUEditorView createView(@NonNull final CreateViewRequest request) {<NEW_LINE>final ViewId viewId = request.getViewId();<NEW_LINE>//<NEW_LINE>// Referencing documentPaths and tableName (i.e. from where are we coming, e.g. receipt schedule)<NEW_LINE>final Set<DocumentPath> referencingDocumentPaths = request.getReferencingDocumentPaths();<NEW_LINE><MASK><NEW_LINE>final SqlViewBinding sqlViewBinding = getSqlViewBinding();<NEW_LINE>//<NEW_LINE>// HUEditorView rows repository<NEW_LINE>final HUEditorViewRepository huEditorViewRepository;<NEW_LINE>{<NEW_LINE>final WindowId windowId = viewId.getWindowId();<NEW_LINE>final boolean attributesAlwaysReadonly = rowAttributesAlwaysReadonlyByReferencingTableName.getOrDefault(referencingTableName, Boolean.TRUE);<NEW_LINE>final SqlHUEditorViewRepositoryBuilder huEditorViewRepositoryBuilder = SqlHUEditorViewRepository.builder().windowId(windowId).rowProcessedPredicate(getRowProcessedPredicate(referencingTableName)).attributesProvider(HUEditorRowAttributesProvider.builder().readonly(attributesAlwaysReadonly).isMaterialReceipt(isMaterialReceipt()).build()).sqlViewBinding(sqlViewBinding).huReservationService(huReservationService);<NEW_LINE>customizeHUEditorViewRepository(huEditorViewRepositoryBuilder);<NEW_LINE>huEditorViewRepository = huEditorViewRepositoryBuilder.build();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// HUEditorView<NEW_LINE>{<NEW_LINE>// Filters<NEW_LINE>// as long as the deprecated getFilterOnlyIds() is around we can't ignore it<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>final DocumentFilterList stickyFilters = extractStickyFilters(request.getStickyFilters(), request.getFilterOnlyIds());<NEW_LINE>final DocumentFilterDescriptorsProvider filterDescriptors = getViewFilterDescriptors();<NEW_LINE>final DocumentFilterList userFilters = request.getFiltersUnwrapped(filterDescriptors);<NEW_LINE>// Start building the HUEditorView<NEW_LINE>final HUEditorViewBuilder huViewBuilder = HUEditorView.builder().setParentViewId(request.getParentViewId()).setParentRowId(request.getParentRowId()).setViewId(viewId).setViewType(request.getViewType()).setStickyFilters(stickyFilters).setFilters(userFilters).setFilterDescriptors(filterDescriptors).setReferencingDocumentPaths(referencingTableName, referencingDocumentPaths).orderBys(sqlViewBinding.getDefaultOrderBys()).setActions(request.getActions()).addAdditionalRelatedProcessDescriptors(request.getAdditionalRelatedProcessDescriptors()).setHUEditorViewRepository(huEditorViewRepository).setUseAutoFilters(request.isUseAutoFilters()).setParameters(request.getParameters());<NEW_LINE>//<NEW_LINE>// Call view customizers<NEW_LINE>getViewCustomizers(referencingTableName).forEach(viewCustomizer -> viewCustomizer.beforeCreate(huViewBuilder));<NEW_LINE>customizeHUEditorView(huViewBuilder);<NEW_LINE>return huViewBuilder.build();<NEW_LINE>}<NEW_LINE>}
final String referencingTableName = extractReferencingTablename(referencingDocumentPaths);
1,486,317
private void readElement(IConfigurationElement element, String elementName) {<NEW_LINE>if (!elementName.equals(element.getName())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TAG_CONFIGURATION.equals(element.getName())) {<NEW_LINE>String id = element.getAttribute(ATT_ID);<NEW_LINE>if (id == null || id.length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String name = element.getAttribute(ATT_NAME);<NEW_LINE>if (name == null || name.length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String clazz = element.getAttribute(ATT_CLASS);<NEW_LINE>if (clazz == null || clazz.length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String platform = element.getAttribute(ATT_PLATFORM);<NEW_LINE>if (platform == null || platform.length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (platform.equals(Platform.getOS())) {<NEW_LINE>try {<NEW_LINE>configurations.add((IProcessConfiguration<MASK><NEW_LINE>} catch (CoreException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>TerminalPlugin.log("Process configuration instantiation failed.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) element.createExecutableExtension(ATT_CLASS));
74,535
public void glDrawElements(int mode, int count, int type, Buffer indices) {<NEW_LINE>if (indices instanceof ShortBuffer && type == com.badlogic.gdx.graphics.GL20.GL_UNSIGNED_SHORT) {<NEW_LINE>ShortBuffer sb = (ShortBuffer) indices;<NEW_LINE>int position = sb.position();<NEW_LINE>int oldLimit = sb.limit();<NEW_LINE>sb.limit(position + count);<NEW_LINE>GL11.glDrawElements(mode, sb);<NEW_LINE>sb.limit(oldLimit);<NEW_LINE>} else if (indices instanceof ByteBuffer && type == com.badlogic.gdx.graphics.GL20.GL_UNSIGNED_SHORT) {<NEW_LINE>ShortBuffer sb = ((ByteBuffer) indices).asShortBuffer();<NEW_LINE>int position = sb.position();<NEW_LINE>int oldLimit = sb.limit();<NEW_LINE>sb.limit(position + count);<NEW_LINE>GL11.glDrawElements(mode, sb);<NEW_LINE>sb.limit(oldLimit);<NEW_LINE>} else if (indices instanceof ByteBuffer && type == com.badlogic.gdx.graphics.GL20.GL_UNSIGNED_BYTE) {<NEW_LINE>ByteBuffer bb = (ByteBuffer) indices;<NEW_LINE>int position = bb.position();<NEW_LINE><MASK><NEW_LINE>bb.limit(position + count);<NEW_LINE>GL11.glDrawElements(mode, bb);<NEW_LINE>bb.limit(oldLimit);<NEW_LINE>} else<NEW_LINE>throw new GdxRuntimeException("Can't use " + indices.getClass().getName() + " with this method. Use ShortBuffer or ByteBuffer instead. Blame LWJGL");<NEW_LINE>}
int oldLimit = bb.limit();
43,699
private void scanWithPredicate(Predicate predicate, BiConsumer consumer) {<NEW_LINE>// needed for optimization where key and value are not an instance of Data type<NEW_LINE>final boolean areKeyValueObjectType = !queryCacheConfig.isSerializeKeys() && InMemoryFormat.OBJECT == queryCacheConfig.getInMemoryFormat();<NEW_LINE>CachedQueryEntry queryEntry = new CachedQueryEntry(ss, extractors);<NEW_LINE>Set<Map.Entry<Object, QueryCacheRecord>> entries = recordStore.entrySet();<NEW_LINE>for (Map.Entry<Object, QueryCacheRecord> entry : entries) {<NEW_LINE>Object queryCacheKey = entry.getKey();<NEW_LINE>Object rawValue = entry.getValue().getRawValue();<NEW_LINE>if (areKeyValueObjectType) {<NEW_LINE>queryEntry.initWithObjectKeyValue(queryCacheKey, rawValue);<NEW_LINE>} else {<NEW_LINE>queryEntry.init(queryCacheKey, rawValue);<NEW_LINE>}<NEW_LINE>if (!predicate.apply(queryEntry)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>consumer.accept(<MASK><NEW_LINE>}<NEW_LINE>}
queryCacheKey, queryEntry.getByPrioritizingObjectValue());
1,814,283
public PutRecordsRequestEntry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PutRecordsRequestEntry putRecordsRequestEntry = new PutRecordsRequestEntry();<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("Data", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putRecordsRequestEntry.setData(context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ExplicitHashKey", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putRecordsRequestEntry.setExplicitHashKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PartitionKey", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putRecordsRequestEntry.setPartitionKey(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 putRecordsRequestEntry;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,280,764
private static CodegenExpression makeDeepSupertypes(Set<EventType> deepSuperTypes, CodegenMethodScope parent, ModuleEventTypeInitializeSymbol symbols, CodegenClassScope classScope) {<NEW_LINE>if (deepSuperTypes == null || deepSuperTypes.isEmpty()) {<NEW_LINE>return staticMethod(Collections.class, "emptySet");<NEW_LINE>}<NEW_LINE>if (deepSuperTypes.size() == 1) {<NEW_LINE>return staticMethod(Collections.class, "singleton", EventTypeUtility.resolveTypeCodegen(deepSuperTypes.iterator().next(), symbols.getAddInitSvc(parent)));<NEW_LINE>}<NEW_LINE>CodegenMethod method = parent.makeChild(EPTypePremade.SET.getEPType(), CompilerHelperModuleProvider.class, classScope);<NEW_LINE>method.getBlock().declareVar(EPTypePremade.SET.getEPType(), "dst", newInstance(EPTypePremade.LINKEDHASHSET.getEPType(), constant(CollectionUtil.capacityHashMap(deepSuperTypes<MASK><NEW_LINE>for (EventType eventType : deepSuperTypes) {<NEW_LINE>method.getBlock().exprDotMethod(ref("dst"), "add", EventTypeUtility.resolveTypeCodegen(eventType, symbols.getAddInitSvc(method)));<NEW_LINE>}<NEW_LINE>method.getBlock().methodReturn(ref("dst"));<NEW_LINE>return localMethod(method);<NEW_LINE>}
.size()))));
1,325,734
public static DescribeForwardTableEntriesResponse unmarshall(DescribeForwardTableEntriesResponse describeForwardTableEntriesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeForwardTableEntriesResponse.setRequestId(_ctx.stringValue("DescribeForwardTableEntriesResponse.RequestId"));<NEW_LINE>describeForwardTableEntriesResponse.setPageSize(_ctx.integerValue("DescribeForwardTableEntriesResponse.PageSize"));<NEW_LINE>describeForwardTableEntriesResponse.setPageNumber(_ctx.integerValue("DescribeForwardTableEntriesResponse.PageNumber"));<NEW_LINE>describeForwardTableEntriesResponse.setTotalCount(_ctx.integerValue("DescribeForwardTableEntriesResponse.TotalCount"));<NEW_LINE>List<ForwardTableEntry> forwardTableEntries = new ArrayList<ForwardTableEntry>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeForwardTableEntriesResponse.ForwardTableEntries.Length"); i++) {<NEW_LINE>ForwardTableEntry forwardTableEntry = new ForwardTableEntry();<NEW_LINE>forwardTableEntry.setStatus(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].Status"));<NEW_LINE>forwardTableEntry.setForwardEntryId(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ForwardEntryId"));<NEW_LINE>forwardTableEntry.setInternalIp(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].InternalIp"));<NEW_LINE>forwardTableEntry.setInternalPort(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].InternalPort"));<NEW_LINE>forwardTableEntry.setForwardEntryName(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ForwardEntryName"));<NEW_LINE>forwardTableEntry.setForwardTableId(_ctx.stringValue<MASK><NEW_LINE>forwardTableEntry.setIpProtocol(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].IpProtocol"));<NEW_LINE>forwardTableEntry.setExternalPort(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ExternalPort"));<NEW_LINE>forwardTableEntry.setExternalIp(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ExternalIp"));<NEW_LINE>forwardTableEntries.add(forwardTableEntry);<NEW_LINE>}<NEW_LINE>describeForwardTableEntriesResponse.setForwardTableEntries(forwardTableEntries);<NEW_LINE>return describeForwardTableEntriesResponse;<NEW_LINE>}
("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ForwardTableId"));
771,140
private static Map<String, String> findServiceBeanDefinitions(ConfigurableListableBeanFactory beanFactory) {<NEW_LINE>final Map<String, String> serviceBeanNames = new HashMap<>();<NEW_LINE>for (String beanName : beanFactory.getBeanDefinitionNames()) {<NEW_LINE>AutoJsonRpcServiceImpl autoJsonRpcServiceImplAnnotation = beanFactory.findAnnotationOnBean(beanName, AutoJsonRpcServiceImpl.class);<NEW_LINE>JsonRpcService jsonRpcServiceAnnotation = beanFactory.findAnnotationOnBean(beanName, JsonRpcService.class);<NEW_LINE>if (null != autoJsonRpcServiceImplAnnotation) {<NEW_LINE>if (null == jsonRpcServiceAnnotation) {<NEW_LINE>throw new IllegalStateException("on the bean [" + beanName + "], @" + AutoJsonRpcServiceImpl.class.getSimpleName() + " was found, but not @" + JsonRpcService.class.getSimpleName() + " -- both are required");<NEW_LINE>}<NEW_LINE>List<String> <MASK><NEW_LINE>Collections.addAll(paths, autoJsonRpcServiceImplAnnotation.additionalPaths());<NEW_LINE>paths.add(jsonRpcServiceAnnotation.value());<NEW_LINE>for (String path : paths) {<NEW_LINE>if (!PATTERN_JSONRPC_PATH.matcher(path).matches()) {<NEW_LINE>throw new RuntimeException("the path [" + path + "] for the bean [" + beanName + "] is not valid");<NEW_LINE>}<NEW_LINE>logger.info("exporting bean [{}] ---> [{}]", beanName, path);<NEW_LINE>if (isNotDuplicateService(serviceBeanNames, beanName, path)) {<NEW_LINE>serviceBeanNames.put(path, beanName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>collectFromParentBeans(beanFactory, serviceBeanNames);<NEW_LINE>return serviceBeanNames;<NEW_LINE>}
paths = new ArrayList<>();
1,818,443
private void addCrusherSoapstoneRecipes(Consumer<FinishedRecipe> consumer, String basePath) {<NEW_LINE>// Polished Soapstone -> Soapstone<NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_SOAPSTONE, BYGBlocks.SOAPSTONE, basePath + "from_polished");<NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_SOAPSTONE_SLAB, BYGBlocks.SOAPSTONE_SLAB, basePath + "polished_slabs_to_slabs");<NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_SOAPSTONE_STAIRS, BYGBlocks.SOAPSTONE_STAIRS, basePath + "polished_stairs_to_stairs");<NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_SOAPSTONE_WALL, <MASK><NEW_LINE>// Soapstone Bricks -> Polished Soapstone<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_BRICKS, BYGBlocks.POLISHED_SOAPSTONE, basePath + "brick_to_polished");<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_BRICK_SLAB, BYGBlocks.POLISHED_SOAPSTONE_SLAB, basePath + "brick_slabs_to_polished_slabs");<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_BRICK_STAIRS, BYGBlocks.POLISHED_SOAPSTONE_STAIRS, basePath + "brick_stairs_to_polished_stairs");<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_BRICK_WALL, BYGBlocks.POLISHED_SOAPSTONE_WALL, basePath + "brick_walls_to_polished_walls");<NEW_LINE>// Soapstone Tile -> Soapstone Bricks<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_TILE, BYGBlocks.SOAPSTONE_BRICKS, basePath + "tile_to_brick");<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_TILE_SLAB, BYGBlocks.SOAPSTONE_BRICK_SLAB, basePath + "tile_slabs_to_brick_slabs");<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_TILE_STAIRS, BYGBlocks.SOAPSTONE_BRICK_STAIRS, basePath + "tile_stairs_to_brick_stairs");<NEW_LINE>crushing(consumer, BYGBlocks.SOAPSTONE_TILE_WALL, BYGBlocks.SOAPSTONE_BRICK_WALL, basePath + "tile_walls_to_brick_walls");<NEW_LINE>// Soapstone Pillar -> Soapstone<NEW_LINE>ItemStackToItemStackRecipeBuilder.crushing(IngredientCreatorAccess.item().from(BYGBlocks.SOAPSTONE_PILLAR), new ItemStack(BYGBlocks.SOAPSTONE, 2)).addCondition(modLoaded).build(consumer, Mekanism.rl(basePath + "from_pillar"));<NEW_LINE>}
BYGBlocks.SOAPSTONE_WALL, basePath + "polished_walls_to_walls");
541,162
public JsonNode toDatabaseConfig(final JsonNode config) {<NEW_LINE>final List<String> <MASK><NEW_LINE>additionalParameters.add("oracle.jdbc.useFetchSizeWithLongColumn=true");<NEW_LINE>final Protocol protocol = config.has("encryption") ? obtainConnectionProtocol(config.get("encryption"), additionalParameters) : Protocol.TCP;<NEW_LINE>final String connectionString = String.format("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=%s)(HOST=%s)(PORT=%s))(CONNECT_DATA=(SID=%s)))", protocol, config.get("host").asText(), config.get("port").asText(), config.get("sid").asText());<NEW_LINE>final ImmutableMap.Builder<Object, Object> configBuilder = ImmutableMap.builder().put("username", config.get("username").asText()).put("jdbc_url", connectionString);<NEW_LINE>if (config.has("password")) {<NEW_LINE>configBuilder.put("password", config.get("password").asText());<NEW_LINE>}<NEW_LINE>// Use the upper-cased username by default.<NEW_LINE>schemas = List.of(config.get("username").asText().toUpperCase(Locale.ROOT));<NEW_LINE>if (config.has("schemas") && config.get("schemas").isArray()) {<NEW_LINE>schemas = new ArrayList<>();<NEW_LINE>for (final JsonNode schema : config.get("schemas")) {<NEW_LINE>schemas.add(schema.asText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!additionalParameters.isEmpty()) {<NEW_LINE>final String connectionParams = String.join(";", additionalParameters);<NEW_LINE>configBuilder.put("connection_properties", connectionParams);<NEW_LINE>}<NEW_LINE>return Jsons.jsonNode(configBuilder.build());<NEW_LINE>}
additionalParameters = new ArrayList<>();
483,515
protected final void prepare(ExecuteContext ctx) throws SQLException {<NEW_LINE>if (ctx.statement() == null) {<NEW_LINE>// [#1846] [#2265] [#2299] Users may explicitly specify how ResultSets<NEW_LINE>// created by jOOQ behave. This will override any other default behaviour<NEW_LINE>if (resultSetConcurrency != 0 || resultSetType != 0 || resultSetHoldability != 0) {<NEW_LINE>int type = resultSetType != 0 ? resultSetType : ResultSet.TYPE_FORWARD_ONLY;<NEW_LINE>int concurrency = resultSetConcurrency != 0 ? resultSetConcurrency : ResultSet.CONCUR_READ_ONLY;<NEW_LINE>// Sybase doesn't support holdability. Avoid setting it!<NEW_LINE>if (resultSetHoldability == 0)<NEW_LINE>ctx.statement(ctx.connection().prepareStatement(ctx.sql(), type, concurrency));<NEW_LINE>else<NEW_LINE>ctx.statement(ctx.connection().prepareStatement(ctx.sql(), type, concurrency, resultSetHoldability));<NEW_LINE>} else<NEW_LINE>// Regular behaviour<NEW_LINE>ctx.statement(ctx.connection().prepareStatement<MASK><NEW_LINE>}<NEW_LINE>Tools.setFetchSize(ctx, fetchSize);<NEW_LINE>// [#1854] [#4753] Set the max number of rows for this result query<NEW_LINE>int m = SettingsTools.getMaxRows(maxRows, ctx.settings());<NEW_LINE>if (m != 0)<NEW_LINE>ctx.statement().setMaxRows(m);<NEW_LINE>}
(ctx.sql()));
523,798
public IDocument createCounterDocument(final IDocument document) {<NEW_LINE>final I_C_Order order = InterfaceWrapperHelper.create(document, I_C_Order.class);<NEW_LINE>final MOrder orderPO = LegacyAdapters.convertToPO(order);<NEW_LINE>final I_C_DocType counterDocType = retrieveCounterDocTypeOrNull(document);<NEW_LINE>final I_AD_Org counterOrg = retrieveCounterOrgOrNull(document);<NEW_LINE>final de.metas.adempiere.model.I_C_Order counterOrder = InterfaceWrapperHelper.newInstance(de.metas.adempiere.model.I_C_Order.class, document.getCtx());<NEW_LINE>final MOrder counterOrderPO = LegacyAdapters.convertToPO(counterOrder);<NEW_LINE>// 09700<NEW_LINE>counterOrder.setAD_Org_ID(counterOrg.getAD_Org_ID());<NEW_LINE>//<NEW_LINE>orderBL.setDocTypeTargetIdAndUpdateDescription(counterOrder, DocTypeId.ofRepoId(counterDocType.getC_DocType_ID()));<NEW_LINE>counterOrder.<MASK><NEW_LINE>// the new order needs to figure out the pricing by itself<NEW_LINE>counterOrder.setM_PricingSystem_ID(-1);<NEW_LINE>counterOrder.setM_PriceList_ID(-1);<NEW_LINE>counterOrder.setDateOrdered(order.getDateOrdered());<NEW_LINE>counterOrder.setDateAcct(order.getDateAcct());<NEW_LINE>counterOrder.setDatePromised(order.getDatePromised());<NEW_LINE>counterOrder.setRef_Order_ID(order.getC_Order_ID());<NEW_LINE>final I_C_BPartner counterBP = retrieveCounterPartnerOrNull(document);<NEW_LINE>counterOrderPO.setBPartner(counterBP);<NEW_LINE>final WarehouseId counterWarehouseId = Services.get(IWarehouseAdvisor.class).evaluateOrderWarehouse(counterOrder);<NEW_LINE>counterOrder.setM_Warehouse_ID(counterWarehouseId.getRepoId());<NEW_LINE>// References (should not be required)<NEW_LINE>counterOrder.setSalesRep_ID(order.getSalesRep_ID());<NEW_LINE>InterfaceWrapperHelper.save(counterOrder);<NEW_LINE>order.setRef_Order_ID(counterOrder.getC_Order_ID());<NEW_LINE>InterfaceWrapperHelper.save(order);<NEW_LINE>// copy the order lines<NEW_LINE>final boolean counter = true;<NEW_LINE>final boolean copyASI = true;<NEW_LINE>counterOrderPO.copyLinesFrom(orderPO, counter, copyASI);<NEW_LINE>// Update copied lines<NEW_LINE>final List<MOrderLine> counterLines = counterOrderPO.getLinesRequery();<NEW_LINE>for (final MOrderLine counterLine : counterLines) {<NEW_LINE>// copies header values (BP, etc.)<NEW_LINE>Services.get(IOrderLineBL.class).setOrder(counterLine, counterOrderPO);<NEW_LINE>counterLine.setPrice();<NEW_LINE>counterLine.setTax();<NEW_LINE>InterfaceWrapperHelper.save(counterLine);<NEW_LINE>}<NEW_LINE>logger.debug(counterOrder.toString());<NEW_LINE>// Document Action<NEW_LINE>final MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(document.getCtx(), order.getC_DocType_ID());<NEW_LINE>if (counterDT != null) {<NEW_LINE>if (counterDT.getDocAction() != null) {<NEW_LINE>counterOrder.setDocAction(counterDT.getDocAction());<NEW_LINE>// not expecting a particular docStatus (e.g. for prepay orders, it might be "waiting to payment")<NEW_LINE>Services.get(IDocumentBL.class).// not expecting a particular docStatus (e.g. for prepay orders, it might be "waiting to payment")<NEW_LINE>processEx(// not expecting a particular docStatus (e.g. for prepay orders, it might be "waiting to payment")<NEW_LINE>counterOrder, // not expecting a particular docStatus (e.g. for prepay orders, it might be "waiting to payment")<NEW_LINE>counterDT.getDocAction(), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return counterOrderPO;<NEW_LINE>}
setIsSOTrx(counterDocType.isSOTrx());
1,817,077
public boolean handleLicenses() {<NEW_LINE>if (acceptLicense) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>InstallKernelInteractive installKernel = InstallKernelFactory.getInteractiveInstance();<NEW_LINE>try {<NEW_LINE>installKernel.resolve(this.features, false);<NEW_LINE>featureLicenses = installKernel.getFeatureLicense(Locale.getDefault());<NEW_LINE>Set<InstallLicense> licenseToAccept = InstallUtils.getLicenseToAccept(featureLicenses);<NEW_LINE>if (!acceptLicense) {<NEW_LINE>if (!licenseToAccept.isEmpty()) {<NEW_LINE>showFeaturesForLicenseAcceptance(licenseToAccept);<NEW_LINE>}<NEW_LINE>for (InstallLicense license : licenseToAccept) {<NEW_LINE>if (!!!handleLicenseAcceptance(license)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ProductInfoParseException e) {<NEW_LINE>System.out.println(e.getMessage());<NEW_LINE>return false;<NEW_LINE>} catch (DuplicateProductInfoException e) {<NEW_LINE>System.out.println(e.getMessage());<NEW_LINE>return false;<NEW_LINE>} catch (ProductInfoReplaceException e) {<NEW_LINE>System.out.<MASK><NEW_LINE>return false;<NEW_LINE>} catch (InstallException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
println(e.getMessage());
956,472
private void handleDescribeModel(ChannelHandlerContext ctx, FullHttpRequest req, String modelName, String modelVersion, QueryStringDecoder decoder) throws ModelNotFoundException, ModelVersionNotFoundException {<NEW_LINE>boolean customizedMetadata = Boolean.parseBoolean(NettyUtils.getParameter(decoder, "customized", "false"));<NEW_LINE>if ("all".equals(modelVersion) || !customizedMetadata) {<NEW_LINE>ArrayList<DescribeModelResponse> resp = ApiUtils.getModelDescription(modelName, modelVersion);<NEW_LINE>NettyUtils.sendJsonResponse(ctx, resp);<NEW_LINE>} else {<NEW_LINE>String requestId = NettyUtils.getRequestId(ctx.channel());<NEW_LINE>RequestInput input = new RequestInput(requestId);<NEW_LINE>for (Map.Entry<String, String> entry : req.headers().entries()) {<NEW_LINE>input.updateHeaders(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>RestJob job = new RestJob(ctx, modelName, modelVersion, WorkerCommands.DESCRIBE, input);<NEW_LINE>if (!ModelManager.getInstance().addJob(job)) {<NEW_LINE>String responseMessage = ApiUtils.getDescribeErrorResponseMessage(modelName);<NEW_LINE>throw new ServiceUnavailableException(responseMessage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
input.updateHeaders("describe", "True");
1,554,740
protected Map<TopicPartition, Long> findOffsets(Consumer<Bytes, Bytes> consumer, Map<TopicPartition, Long> seekTo, Collection<TopicPartition> partitions) {<NEW_LINE>final Map<TopicPartition, Long> beginningOffsets = consumer.beginningOffsets(partitions);<NEW_LINE>final Map<TopicPartition, Long> endOffsets = consumer.endOffsets(partitions);<NEW_LINE>final Map<TopicPartition, Long> seekMap = new HashMap<>();<NEW_LINE>final Set<TopicPartition> emptyPartitions = new HashSet<>();<NEW_LINE>for (Map.Entry<TopicPartition, Long> entry : seekTo.entrySet()) {<NEW_LINE>final Long endOffset = endOffsets.get(entry.getKey());<NEW_LINE>final Long beginningOffset = beginningOffsets.<MASK><NEW_LINE>if (beginningOffset != null && endOffset != null && beginningOffset < endOffset && entry.getValue() > beginningOffset) {<NEW_LINE>final Long value;<NEW_LINE>if (entry.getValue() > endOffset) {<NEW_LINE>value = endOffset;<NEW_LINE>} else {<NEW_LINE>value = entry.getValue();<NEW_LINE>}<NEW_LINE>seekMap.put(entry.getKey(), value);<NEW_LINE>} else {<NEW_LINE>emptyPartitions.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<TopicPartition> waiting = new HashSet<>(partitions);<NEW_LINE>waiting.removeAll(emptyPartitions);<NEW_LINE>waiting.removeAll(seekMap.keySet());<NEW_LINE>for (TopicPartition topicPartition : waiting) {<NEW_LINE>seekMap.put(topicPartition, endOffsets.get(topicPartition));<NEW_LINE>}<NEW_LINE>return seekMap;<NEW_LINE>}
get(entry.getKey());
1,148,208
final UpdateRuleMetadataResult executeUpdateRuleMetadata(UpdateRuleMetadataRequest updateRuleMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRuleMetadataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateRuleMetadataRequest> request = null;<NEW_LINE>Response<UpdateRuleMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateRuleMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateRuleMetadataRequest));<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, "FraudDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateRuleMetadata");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateRuleMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateRuleMetadataResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
926,024
final CreateExperienceResult executeCreateExperience(CreateExperienceRequest createExperienceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createExperienceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateExperienceRequest> request = null;<NEW_LINE>Response<CreateExperienceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateExperienceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createExperienceRequest));<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, "kendra");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateExperience");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateExperienceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateExperienceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
813,321
protected Container createStartContentPane() {<NEW_LINE>JPanel pane = new JPanel(new BorderLayout());<NEW_LINE>menuBar = new JMenuBar();<NEW_LINE>pane.add(menuBar, BorderLayout.NORTH);<NEW_LINE>Locale loc = Locale.getDefault();<NEW_LINE>JMenu menu = new JMenu(messages<MASK><NEW_LINE>menuBar.add(menu);<NEW_LINE>JMenuItem item;<NEW_LINE>item = new JMenuItem(messages.getMainMessage("mainMenu.connect", loc));<NEW_LINE>item.addActionListener(e -> showLoginDialog());<NEW_LINE>menu.add(item);<NEW_LINE>item = new JMenuItem(messages.getMainMessage("mainMenu.exit", loc));<NEW_LINE>item.addActionListener(new ValidationAwareActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformedAfterValidation(ActionEvent e) {<NEW_LINE>exit();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>menu.add(item);<NEW_LINE>if (isTestMode()) {<NEW_LINE>menuBar.setName("startMenu");<NEW_LINE>}<NEW_LINE>return pane;<NEW_LINE>}
.getMainMessage("mainMenu.file", loc));
1,035,658
public void finishBatchRequest(com.zeroc.Ice.OutputStream os, com.zeroc.Ice.ObjectPrx proxy, String operation) {<NEW_LINE>//<NEW_LINE>// No need for synchronization, no other threads are supposed<NEW_LINE>// to modify the queue since we set _batchStreamInUse to true.<NEW_LINE>//<NEW_LINE>assert (_batchStreamInUse);<NEW_LINE>_batchStream.swap(os);<NEW_LINE>try {<NEW_LINE>// Allow flush to proceed even if the stream is marked in use.<NEW_LINE>_batchStreamCanFlush = true;<NEW_LINE>if (_maxSize > 0 && _batchStream.size() >= _maxSize) {<NEW_LINE>// Auto flush<NEW_LINE>proxy.ice_flushBatchRequestsAsync();<NEW_LINE>}<NEW_LINE>assert (_batchMarker < _batchStream.size());<NEW_LINE>if (_interceptor != null) {<NEW_LINE>_request.reset(proxy, operation, _batchStream.size() - _batchMarker);<NEW_LINE>_interceptor.<MASK><NEW_LINE>} else {<NEW_LINE>Boolean compress = proxy._getReference().getCompressOverride();<NEW_LINE>if (compress != null) {<NEW_LINE>_batchCompress |= compress.booleanValue();<NEW_LINE>}<NEW_LINE>_batchMarker = _batchStream.size();<NEW_LINE>++_batchRequestNum;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>synchronized (this) {<NEW_LINE>_batchStream.resize(_batchMarker);<NEW_LINE>_batchStreamInUse = false;<NEW_LINE>_batchStreamCanFlush = false;<NEW_LINE>notifyAll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
enqueue(_request, _batchRequestNum, _batchMarker);
803,981
private void findText() {<NEW_LINE>final int lineNumber = NbDocument.findLineNumber(sdoc, info.getSnapshot<MASK><NEW_LINE>lineOffset = NbDocument.findLineOffset(sdoc, lineNumber);<NEW_LINE>if (rangePrepared) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (dobj == null) {<NEW_LINE>sdoc.render(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>javax.swing.text.Element root = NbDocument.findLineRootElement(sdoc);<NEW_LINE>if (root.getElementCount() <= lineNumber) {<NEW_LINE>text = null;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>javax.swing.text.Element line = root.getElement(lineNumber);<NEW_LINE>text = sdoc.getText(line.getStartOffset(), line.getEndOffset() - line.getStartOffset());<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>text = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>LineCookie lc = dobj.getCookie(LineCookie.class);<NEW_LINE>Line line = lc.getLineSet().getCurrent(lineNumber);<NEW_LINE>text = line.getText();<NEW_LINE>}<NEW_LINE>if (text == null) {<NEW_LINE>// #116560, (according to the javadoc, means the document is closed):<NEW_LINE>cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
().getOriginalOffset(startOffset));
434,017
public PiecewisePolynomialResult interpolate(final double[] xValues, final double[] yValues) {<NEW_LINE>ArgChecker.notNull(xValues, "xValues");<NEW_LINE>ArgChecker.notNull(yValues, "yValues");<NEW_LINE>ArgChecker.isTrue(xValues.length == yValues.length | xValues.length + 2 == yValues.length, "(xValues length = yValues length) or (xValues length + 2 = yValues length)");<NEW_LINE>ArgChecker.isTrue(xValues.length > 4, "Data points should be more than 4");<NEW_LINE>final int nDataPts = xValues.length;<NEW_LINE>final int yValuesLen = yValues.length;<NEW_LINE>for (int i = 0; i < nDataPts; ++i) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(<MASK><NEW_LINE>ArgChecker.isFalse(Double.isInfinite(xValues[i]), "xValues containing Infinity");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < yValuesLen; ++i) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(yValues[i]), "yValues containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(yValues[i]), "yValues containing Infinity");<NEW_LINE>}<NEW_LINE>double[] xValuesSrt = Arrays.copyOf(xValues, nDataPts);<NEW_LINE>double[] yValuesSrt;<NEW_LINE>if (nDataPts == yValuesLen) {<NEW_LINE>yValuesSrt = Arrays.copyOf(yValues, nDataPts);<NEW_LINE>} else {<NEW_LINE>yValuesSrt = Arrays.copyOfRange(yValues, 1, nDataPts + 1);<NEW_LINE>}<NEW_LINE>DoubleArrayMath.sortPairs(xValuesSrt, yValuesSrt);<NEW_LINE>ArgChecker.noDuplicatesSorted(xValuesSrt, "xValues");<NEW_LINE>final double[] intervals = _solver.intervalsCalculator(xValuesSrt);<NEW_LINE>final double[] slopes = _solver.slopesCalculator(yValuesSrt, intervals);<NEW_LINE>final PiecewisePolynomialResult result = _method.interpolate(xValues, yValues);<NEW_LINE>ArgChecker.isTrue(result.getOrder() == 4, "Primary interpolant is not cubic");<NEW_LINE>final double[] initialFirst = _function.differentiate(result, xValuesSrt).rowArray(0);<NEW_LINE>final double[] first = firstDerivativeCalculator(intervals, slopes, initialFirst);<NEW_LINE>final double[][] coefs = _solver.solve(yValuesSrt, intervals, slopes, first);<NEW_LINE>for (int i = 0; i < nDataPts - 1; ++i) {<NEW_LINE>for (int j = 0; j < 4; ++j) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(coefs[i][j]), "Too large input");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(coefs[i][j]), "Too large input");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PiecewisePolynomialResult(DoubleArray.copyOf(xValuesSrt), DoubleMatrix.copyOf(coefs), 4, 1);<NEW_LINE>}
xValues[i]), "xValues containing NaN");
62,294
public View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = getActivity().getLayoutInflater().inflate(R.layout.dash_parking_fragment, container, false);<NEW_LINE>Typeface typeface = FontCache.getRobotoMedium(getActivity());<NEW_LINE>Button remove = view.findViewById(R.id.remove_tag);<NEW_LINE>remove.setOnClickListener(v -> {<NEW_LINE>if (plugin != null) {<NEW_LINE>AlertDialog dialog = plugin.showDeleteDialog(getActivity());<NEW_LINE>dialog.setOnDismissListener(d -> updateParkingPosition());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>remove.setTypeface(typeface);<NEW_LINE>view.findViewById(R.id.parking_header).setOnClickListener(v -> {<NEW_LINE>if (plugin == null || plugin.getParkingPosition() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LatLon parkingPosition = plugin.getParkingPosition();<NEW_LINE><MASK><NEW_LINE>double lon = parkingPosition.getLongitude();<NEW_LINE>PointDescription pointDescription = new PointDescription(PointDescription.POINT_TYPE_PARKING_MARKER, getString(R.string.osmand_parking_position_name));<NEW_LINE>getMyApplication().getSettings().setMapLocationToShow(lat, lon, 15, pointDescription, false, parkingPosition);<NEW_LINE>MapActivity.launchMapActivityMoveToTop(getActivity());<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>}
double lat = parkingPosition.getLatitude();
1,446,674
public MockConfigResponse genMockConfig(MockConfigRequest request) {<NEW_LINE>MockConfigResponse returnRsp;<NEW_LINE>MockConfigExample example = new MockConfigExample();<NEW_LINE>MockConfigExample.Criteria criteria = example.createCriteria();<NEW_LINE>if (request.getId() != null) {<NEW_LINE>criteria.andIdEqualTo(request.getId());<NEW_LINE>}<NEW_LINE>if (request.getApiId() != null) {<NEW_LINE>criteria.andApiIdEqualTo(request.getApiId());<NEW_LINE>}<NEW_LINE>if (request.getProjectId() != null) {<NEW_LINE>criteria.andProjectIdEqualTo(request.getProjectId());<NEW_LINE>}<NEW_LINE>List<MockConfig> configList = mockConfigMapper.selectByExample(example);<NEW_LINE>if (configList.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>MockConfig config = new MockConfig();<NEW_LINE>config.setProjectId(request.getProjectId());<NEW_LINE>config.setId(UUID.randomUUID().toString());<NEW_LINE>config.setCreateUserId(SessionUtils.getUserId());<NEW_LINE>config.setCreateTime(createTimeStmp);<NEW_LINE>config.setUpdateTime(createTimeStmp);<NEW_LINE>if (request.getApiId() != null) {<NEW_LINE>config.setApiId(request.getApiId());<NEW_LINE>mockConfigMapper.insert(config);<NEW_LINE>}<NEW_LINE>returnRsp = new MockConfigResponse(config, new ArrayList<>());<NEW_LINE>} else {<NEW_LINE>MockConfig config = configList.get(0);<NEW_LINE>MockExpectConfigExample expectConfigExample = new MockExpectConfigExample();<NEW_LINE>expectConfigExample.createCriteria().andMockConfigIdEqualTo(config.getId());<NEW_LINE>expectConfigExample.setOrderByClause("update_time DESC");<NEW_LINE>List<MockExpectConfigResponse> expectConfigResponseList = new ArrayList<>();<NEW_LINE>List<MockExpectConfigWithBLOBs> expectConfigList = mockExpectConfigMapper.selectByExampleWithBLOBs(expectConfigExample);<NEW_LINE>for (MockExpectConfigWithBLOBs expectConfig : expectConfigList) {<NEW_LINE>MockExpectConfigResponse response = new MockExpectConfigResponse(expectConfig);<NEW_LINE>expectConfigResponseList.add(response);<NEW_LINE>}<NEW_LINE>returnRsp = new MockConfigResponse(config, expectConfigResponseList);<NEW_LINE>}<NEW_LINE>return returnRsp;<NEW_LINE>}
long createTimeStmp = System.currentTimeMillis();
1,672,222
public XmlElement serialize(Object object) {<NEW_LINE>XmlElement struct = new XmlElement(SerializerHandler.TYPE_STRUCT);<NEW_LINE>try {<NEW_LINE>XmlElement entry, name, value;<NEW_LINE>// We can safely cast here, this Serializer should only be called when<NEW_LINE>// the parameter is a map.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> map = (Map<String, Object>) object;<NEW_LINE>for (Map.Entry<String, Object> member : map.entrySet()) {<NEW_LINE>entry = new XmlElement(STRUCT_MEMBER);<NEW_LINE>name = new XmlElement(STRUCT_NAME);<NEW_LINE>value = new XmlElement(STRUCT_VALUE);<NEW_LINE>name.setContent(member.getKey());<NEW_LINE>value.addChildren(serializerHandler.serialize<MASK><NEW_LINE>entry.addChildren(name);<NEW_LINE>entry.addChildren(value);<NEW_LINE>struct.addChildren(entry);<NEW_LINE>}<NEW_LINE>} catch (XMLRPCException ex) {<NEW_LINE>throw new XMLRPCRuntimeException(ex);<NEW_LINE>}<NEW_LINE>return struct;<NEW_LINE>}
(member.getValue()));
1,599,740
@RequestMapping(value = "/otaPackage", method = RequestMethod.POST)<NEW_LINE>@ResponseBody<NEW_LINE>public OtaPackageInfo saveOtaPackageInfo(@ApiParam(value = "A JSON value representing the OTA Package.") @RequestBody SaveOtaPackageInfoRequest otaPackageInfo) throws ThingsboardException {<NEW_LINE>boolean created = otaPackageInfo.getId() == null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>checkEntity(otaPackageInfo.getId(), otaPackageInfo, Resource.OTA_PACKAGE);<NEW_LINE>OtaPackageInfo savedOtaPackageInfo = otaPackageService.saveOtaPackageInfo(new OtaPackageInfo(otaPackageInfo), otaPackageInfo.isUsesUrl());<NEW_LINE>logEntityAction(savedOtaPackageInfo.getId(), savedOtaPackageInfo, null, created ? ActionType.ADDED : ActionType.UPDATED, null);<NEW_LINE>return savedOtaPackageInfo;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logEntityAction(emptyId(EntityType.OTA_PACKAGE), otaPackageInfo, null, created ? ActionType.ADDED : ActionType.UPDATED, e);<NEW_LINE>throw handleException(e);<NEW_LINE>}<NEW_LINE>}
otaPackageInfo.setTenantId(getTenantId());
716,507
public DescribeClustersResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeClustersResult describeClustersResult = new DescribeClustersResult();<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 describeClustersResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeClustersResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Clusters", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeClustersResult.setClusters(new ListUnmarshaller<Cluster>(ClusterJsonUnmarshaller.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 describeClustersResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
845,630
private void runAssertion_A_parenthesisBstar(RegressionEnvironment env, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>String[] fields = "a,b0,b1,b2".split(",");<NEW_LINE>String text = "@name('s0') select * from SupportRecogBean#keepall " + "match_recognize (" + " measures A.theString as a, B[0].theString as b0, B[1].theString as b1, B[2].theString as b2" + " pattern (A (B)*)" + " interval 10 seconds or terminated" + " define" + " A as A.theString like \"A%\"," + " B as B.theString like \"B%\"" + ")";<NEW_LINE>env.compileDeploy(text).addListener("s0");<NEW_LINE>// test output by terminated because of misfit event<NEW_LINE>env.<MASK><NEW_LINE>env.sendEventBean(new SupportRecogBean("B1"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportRecogBean("X1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A1", "B1", null, null });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>sendTimer(env, 20000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>// test output by timer expiry<NEW_LINE>env.sendEventBean(new SupportRecogBean("A2"));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B2"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendTimer(env, 29999);<NEW_LINE>sendTimer(env, 30000);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A2", "B2", null, null });<NEW_LINE>// destroy<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEventBean(new SupportRecogBean("A1"));
405,411
private Map<String, Object> fallbackToCurrentInfo(String resouceId, Map<String, Object> processinfo) {<NEW_LINE>Map<String, Object> hostAsset = null;<NEW_LINE>try {<NEW_LINE>if (currentQualysInfo.get(resouceId) != null) {<NEW_LINE>String strQid = currentQualysInfo.get(resouceId).get("id");<NEW_LINE>Long qualysId = Double.valueOf(strQid).longValue();<NEW_LINE>hostAsset = Util.fetchCurretQualysInfo(type, resouceId);<NEW_LINE>if (hostAsset != null && Util.isScanInfoAvailable(hostAsset, scanThreshold)) {<NEW_LINE>processinfo.put("fallbackInfo", "Existing Match, Id:" + qualysId);<NEW_LINE>} else {<NEW_LINE>hostAsset = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>Map<String, String> errorMap = new HashMap<>();<NEW_LINE>errorMap.put(ERROR, "Error Fetching Current Info");<NEW_LINE>errorMap.put(ERROR_TYPE, WARN);<NEW_LINE>errorMap.put(EXCEPTION, e.getMessage());<NEW_LINE>errorList.add(errorMap);<NEW_LINE>}<NEW_LINE>return hostAsset;<NEW_LINE>}
LOGGER.error("Error Fetching Current Info ", e);
553,522
@Timed<NEW_LINE>@ExceptionMetered<NEW_LINE>public List<String> list(@QueryParam("namePattern") final String namePattern, @QueryParam("selector") final List<String> hostSelectors) {<NEW_LINE>List<String> hosts = namePattern == null ? model.listHosts() : model.listHosts(namePattern);<NEW_LINE>if (!hostSelectors.isEmpty()) {<NEW_LINE>// check that all supplied selectors are parseable/valid<NEW_LINE>final List<HostSelector> selectors = hostSelectors.stream().map(selectorStr -> {<NEW_LINE>final HostSelector parsed = HostSelector.parse(selectorStr);<NEW_LINE>if (parsed == null) {<NEW_LINE>throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity("Invalid host selector: " <MASK><NEW_LINE>}<NEW_LINE>return parsed;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>final Map<String, Map<String, String>> hostsAndLabels = getLabels(hosts);<NEW_LINE>final HostMatcher matcher = new HostMatcher(hostsAndLabels);<NEW_LINE>hosts = matcher.getMatchingHosts(selectors);<NEW_LINE>}<NEW_LINE>return hosts;<NEW_LINE>}
+ selectorStr).build());
337,539
final UpdateVocabularyFilterResult executeUpdateVocabularyFilter(UpdateVocabularyFilterRequest updateVocabularyFilterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateVocabularyFilterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateVocabularyFilterRequest> request = null;<NEW_LINE>Response<UpdateVocabularyFilterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateVocabularyFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateVocabularyFilterRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Transcribe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateVocabularyFilter");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateVocabularyFilterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateVocabularyFilterResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,714,203
protected <E extends Entity> Screen createScreen(LookupBuilder<E> builder, Screens screens) {<NEW_LINE>Screen screen;<NEW_LINE>if (builder instanceof LookupClassBuilder) {<NEW_LINE>LookupClassBuilder lookupClassBuilder = (LookupClassBuilder) builder;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<? extends Screen> screenClass = lookupClassBuilder.getScreenClass();<NEW_LINE>if (screenClass == null) {<NEW_LINE>throw new IllegalArgumentException("Screen class is not set");<NEW_LINE>}<NEW_LINE>screen = screens.create(screenClass, builder.getLaunchMode(), builder.getOptions());<NEW_LINE>} else {<NEW_LINE>String lookupScreenId;<NEW_LINE>if (builder.getScreenId() != null) {<NEW_LINE>lookupScreenId = builder.getScreenId();<NEW_LINE>} else {<NEW_LINE>lookupScreenId = windowConfig.getLookupScreen(builder.<MASK><NEW_LINE>}<NEW_LINE>if (lookupScreenId == null) {<NEW_LINE>throw new IllegalArgumentException("Screen id is not set");<NEW_LINE>}<NEW_LINE>screen = screens.create(lookupScreenId, builder.getLaunchMode(), builder.getOptions());<NEW_LINE>}<NEW_LINE>return screen;<NEW_LINE>}
getEntityClass()).getId();
1,385,140
public void readComplete(int rc, LedgerHandle lh, Enumeration<LedgerEntry> entries, Object ctx) {<NEW_LINE>CompletableFuture<List<Entry.Reader>> promise = (CompletableFuture<List<Entry.Reader>>) ctx;<NEW_LINE>if (BKException.Code.OK == rc) {<NEW_LINE>List<Entry.Reader> entryList = Lists.newArrayList();<NEW_LINE>while (entries.hasMoreElements()) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>entryList.add(processReadEntry(entry));<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// release the buffers<NEW_LINE>while (entries.hasMoreElements()) {<NEW_LINE>LedgerEntry le = entries.nextElement();<NEW_LINE>le.getEntryBuffer().release();<NEW_LINE>}<NEW_LINE>FutureUtils.completeExceptionally(promise, ioe);<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>entry.getEntryBuffer().release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FutureUtils.complete(promise, entryList);<NEW_LINE>} else {<NEW_LINE>FutureUtils.completeExceptionally(promise, new BKTransmitException("Failed to read entries :", rc));<NEW_LINE>}<NEW_LINE>}
LedgerEntry entry = entries.nextElement();
673,832
private boolean isPartitionMatch(Expression filterExpression, PartitionInfo partitionInfo) {<NEW_LINE>Function function = filterExpression.getFunctionCall();<NEW_LINE>FilterKind filterKind = FilterKind.valueOf(function.getOperator());<NEW_LINE>List<Expression> operands = function.getOperands();<NEW_LINE>switch(filterKind) {<NEW_LINE>case AND:<NEW_LINE>for (Expression child : operands) {<NEW_LINE>if (!isPartitionMatch(child, partitionInfo)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>case OR:<NEW_LINE>for (Expression child : operands) {<NEW_LINE>if (isPartitionMatch(child, partitionInfo)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>case EQUALS:<NEW_LINE>{<NEW_LINE>Identifier identifier = operands.get(0).getIdentifier();<NEW_LINE>if (identifier != null && identifier.getName().equals(_partitionColumn)) {<NEW_LINE>return partitionInfo._partitions.contains(partitionInfo._partitionFunction.getPartition(operands.get(1).getLiteral().getFieldValue<MASK><NEW_LINE>} else {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case IN:<NEW_LINE>{<NEW_LINE>Identifier identifier = operands.get(0).getIdentifier();<NEW_LINE>if (identifier != null && identifier.getName().equals(_partitionColumn)) {<NEW_LINE>int numOperands = operands.size();<NEW_LINE>for (int i = 1; i < numOperands; i++) {<NEW_LINE>if (partitionInfo._partitions.contains(partitionInfo._partitionFunction.getPartition(operands.get(i).getLiteral().getFieldValue().toString()))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
().toString()));
398,549
// Write the Work Item Data to the Excel report<NEW_LINE>private int createContent(WritableSheet sheet, List<WorkItem> list) throws WriteException {<NEW_LINE>int size = list.size();<NEW_LINE>// Add customer data to the Excel report<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>WorkItem wi = list.get(i);<NEW_LINE>// Get tne work item values<NEW_LINE>String name = wi.getName();<NEW_LINE>String guide = wi.getGuide();<NEW_LINE>String date = wi.getDate();<NEW_LINE><MASK><NEW_LINE>String status = wi.getStatus();<NEW_LINE>// First column<NEW_LINE>addLabel(sheet, 0, i + 2, name);<NEW_LINE>// Second column<NEW_LINE>addLabel(sheet, 1, i + 2, date);<NEW_LINE>// Third column<NEW_LINE>addLabel(sheet, 2, i + 2, guide);<NEW_LINE>// Forth column<NEW_LINE>addLabel(sheet, 3, i + 2, des);<NEW_LINE>// Fifth column<NEW_LINE>addLabel(sheet, 4, i + 2, status);<NEW_LINE>}<NEW_LINE>return size;<NEW_LINE>}
String des = wi.getDescription();