idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
822,384
public com.amazonaws.services.kinesisvideo.model.InvalidResourceFormatException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.kinesisvideo.model.InvalidResourceFormatException invalidResourceFormatException = new com.amazonaws.services.kinesisvideo.model.InvalidResourceFormatException(null);<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>} 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 invalidResourceFormatException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
127,183
public UserNotification save(@NonNull final UserNotificationRequest request) {<NEW_LINE>final I_AD_Note notificationPO = InterfaceWrapperHelper.newInstanceOutOfTrx(I_AD_Note.class);<NEW_LINE>notificationPO.setAD_User_ID(request.getRecipient().getUserId().getRepoId());<NEW_LINE>notificationPO.setIsImportant(request.isImportant());<NEW_LINE>//<NEW_LINE>// contentADMessage -> AD_Message<NEW_LINE>AdMessageId adMessageId = null;<NEW_LINE>final AdMessageKey detailADMessage = request.getContentADMessage();<NEW_LINE>if (detailADMessage != null) {<NEW_LINE>adMessageId = Services.get(IADMessageDAO.class).retrieveIdByValue(detailADMessage).orElse(null);<NEW_LINE>}<NEW_LINE>if (adMessageId == null) {<NEW_LINE>adMessageId = Services.get(IADMessageDAO.class).retrieveIdByValue(DEFAULT_AD_MESSAGE).orElse(null);<NEW_LINE>}<NEW_LINE>notificationPO.setAD_Message_ID(AdMessageId.toRepoId(adMessageId));<NEW_LINE>//<NEW_LINE>// contentADMessageParams<NEW_LINE>final List<Object> detailADMessageParams = request.getContentADMessageParams();<NEW_LINE>if (detailADMessageParams != null && !detailADMessageParams.isEmpty()) {<NEW_LINE>try {<NEW_LINE>final String detailADMessageParamsJSON = jsonMapper.writeValueAsString(detailADMessageParams);<NEW_LINE>notificationPO.setAD_Message_ParamsJSON(detailADMessageParamsJSON);<NEW_LINE>} catch (final JsonProcessingException e) {<NEW_LINE>throw new AdempiereException("Unable to create JSON from the given request's contentADMessageParams", e).appendParametersToMessage().setParameter("detailADMessageParams", detailADMessageParams).setParameter("request", request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// contentPlain<NEW_LINE>final String detailPlain = request.getContentPlain();<NEW_LINE>notificationPO.setTextMsg(detailPlain);<NEW_LINE>//<NEW_LINE>// Target action<NEW_LINE>final TargetAction targetAction = request.getTargetAction();<NEW_LINE>if (targetAction == null) {<NEW_LINE>// no action<NEW_LINE>} else if (targetAction instanceof TargetRecordAction) {<NEW_LINE>final TargetRecordAction targetRecordAction = TargetRecordAction.cast(targetAction);<NEW_LINE>final ITableRecordReference targetRecord = targetRecordAction.getRecord();<NEW_LINE>notificationPO.setAD_Table_ID(targetRecord.getAD_Table_ID());<NEW_LINE>notificationPO.setRecord_ID(targetRecord.getRecord_ID());<NEW_LINE>notificationPO.setAD_Window_ID(targetRecordAction.getAdWindowId().map(AdWindowId::getRepoId).orElse(-1));<NEW_LINE>} else if (targetAction instanceof TargetViewAction) {<NEW_LINE>final TargetViewAction <MASK><NEW_LINE>notificationPO.setViewId(targetViewAction.getViewId());<NEW_LINE>notificationPO.setAD_Window_ID(AdWindowId.toRepoId(targetViewAction.getAdWindowId()));<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Unknown target action: " + targetAction + " (" + targetAction.getClass() + ")");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>InterfaceWrapperHelper.save(notificationPO);<NEW_LINE>final List<Resource> attachments = request.getAttachments();<NEW_LINE>if (!attachments.isEmpty()) {<NEW_LINE>attachmentEntryService.createNewAttachments(notificationPO, AttachmentEntryCreateRequest.fromResources(attachments));<NEW_LINE>}<NEW_LINE>return toUserNotification(notificationPO);<NEW_LINE>}
targetViewAction = TargetViewAction.cast(targetAction);
1,193,579
public void onReceive(Context c, Intent intent) {<NEW_LINE>String action = intent.getAction();<NEW_LINE>if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(action)) {<NEW_LINE>if (isScanEnabled()) {<NEW_LINE>activatePeriodicScan();<NEW_LINE>} else {<NEW_LINE>deactivatePeriodicScan();<NEW_LINE>}<NEW_LINE>} else if (WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.equals(action)) {<NEW_LINE>final List<MASK><NEW_LINE>if (scanResultList == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ArrayList<ScanResult> scanResults = new ArrayList<ScanResult>();<NEW_LINE>for (ScanResult scanResult : scanResultList) {<NEW_LINE>scanResult.BSSID = BSSIDBlockList.canonicalizeBSSID(scanResult.BSSID);<NEW_LINE>if (shouldLog(scanResult)) {<NEW_LINE>// Once we've checked that we want this scan result, we can safely discard<NEW_LINE>// the SSID and capabilities.<NEW_LINE>scanResult.SSID = "";<NEW_LINE>scanResult.capabilities = "";<NEW_LINE>scanResults.add(scanResult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mVisibleAPs.set(scanResults.size());<NEW_LINE>reportScanResults(scanResults);<NEW_LINE>}<NEW_LINE>}
<ScanResult> scanResultList = getScanResults();
1,717,507
private WorkProcessor<Chunk> buildResult(IntIterator groupIds) {<NEW_LINE>List<DataType> types = new ArrayList(groupKeyType.length + aggValueType.length);<NEW_LINE>for (DataType dataType : groupKeyType) {<NEW_LINE>types.add(dataType);<NEW_LINE>}<NEW_LINE>for (DataType dataType : aggValueType) {<NEW_LINE>types.add(dataType);<NEW_LINE>}<NEW_LINE>final ChunkBuilder pageBuilder = new ChunkBuilder(types, chunkSize, context);<NEW_LINE>return WorkProcessor.create(() -> {<NEW_LINE>if (!groupIds.hasNext()) {<NEW_LINE>return WorkProcessor.ProcessState.finished();<NEW_LINE>}<NEW_LINE>pageBuilder.reset();<NEW_LINE>while (!pageBuilder.isFull() && groupIds.hasNext()) {<NEW_LINE>pageBuilder.declarePosition();<NEW_LINE>int groupId = groupIds.nextInt();<NEW_LINE>groupKeyBuffer.appendValuesTo(groupId, pageBuilder);<NEW_LINE>for (int i = 0; i < aggregators.size(); i++) {<NEW_LINE>BlockBuilder output = pageBuilder.getBlockBuilder(groupKeyType.length + i);<NEW_LINE>aggregators.get(i<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return WorkProcessor.ProcessState.ofResult(pageBuilder.build());<NEW_LINE>});<NEW_LINE>}
).writeResultTo(groupId, output);
683,342
void doPrintNotification(final Notification notification) {<NEW_LINE>Editor editor = getConsoleEditor();<NEW_LINE>if (editor.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Document document = editor.getDocument();<NEW_LINE>boolean scroll = document.getTextLength() == editor.getCaretModel().getOffset() || !editor.getContentComponent().hasFocus();<NEW_LINE>if (document.getTextLength() > 0) {<NEW_LINE>append(document, "\n");<NEW_LINE>}<NEW_LINE>String lastDate = DateFormatUtil.formatDate(notification.getTimestamp());<NEW_LINE>if (document.getTextLength() == 0 || !lastDate.equals(myLastDate)) {<NEW_LINE>myLastDate = lastDate;<NEW_LINE>append(document, lastDate + "\n");<NEW_LINE>}<NEW_LINE>int startDateOffset = document.getTextLength();<NEW_LINE>String date = DateFormatUtil.formatTime(notification.getTimestamp()) + "\t";<NEW_LINE>append(document, date);<NEW_LINE>int tabs = calculateTabs(editor, startDateOffset);<NEW_LINE>int titleStartOffset = document.getTextLength();<NEW_LINE>int startLine = document.getLineCount() - 1;<NEW_LINE>EventLog.LogEntry pair = EventLog.formatForLog(notification, StringUtil.repeatSymbol('\t', tabs));<NEW_LINE>final NotificationType type = notification.getType();<NEW_LINE>TextAttributesKey key = type == NotificationType.ERROR ? ConsoleViewContentType.LOG_ERROR_OUTPUT_KEY : type == NotificationType.INFORMATION ? ConsoleViewContentType.NORMAL_OUTPUT_KEY : ConsoleViewContentType.LOG_WARNING_OUTPUT_KEY;<NEW_LINE>int msgStart = document.getTextLength();<NEW_LINE><MASK><NEW_LINE>TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(key);<NEW_LINE>int layer = HighlighterLayer.CARET_ROW + 1;<NEW_LINE>RangeHighlighter highlighter = editor.getMarkupModel().addRangeHighlighter(msgStart, document.getTextLength(), layer, attributes, HighlighterTargetArea.EXACT_RANGE);<NEW_LINE>GROUP_ID.set(highlighter, notification.getGroupId());<NEW_LINE>NOTIFICATION_ID.set(highlighter, notification.id);<NEW_LINE>for (Pair<TextRange, HyperlinkInfo> link : pair.links) {<NEW_LINE>final RangeHighlighter rangeHighlighter = myHyperlinkSupport.getValue().createHyperlink(link.first.getStartOffset() + msgStart, link.first.getEndOffset() + msgStart, null, link.second);<NEW_LINE>if (link.second instanceof EventLog.ShowBalloon) {<NEW_LINE>((EventLog.ShowBalloon) link.second).setRangeHighlighter(rangeHighlighter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>append(document, "\n");<NEW_LINE>if (scroll) {<NEW_LINE>editor.getCaretModel().moveToOffset(document.getTextLength());<NEW_LINE>editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);<NEW_LINE>}<NEW_LINE>if (notification.isImportant()) {<NEW_LINE>highlightNotification(notification, pair.status, startLine, document.getLineCount() - 1, titleStartOffset, pair.titleLength);<NEW_LINE>}<NEW_LINE>}
append(document, pair.message);
1,601,575
final DescribeFileSystemAliasesResult executeDescribeFileSystemAliases(DescribeFileSystemAliasesRequest describeFileSystemAliasesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeFileSystemAliasesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeFileSystemAliasesRequest> request = null;<NEW_LINE>Response<DescribeFileSystemAliasesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeFileSystemAliasesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeFileSystemAliasesRequest));<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, "FSx");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeFileSystemAliases");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeFileSystemAliasesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeFileSystemAliasesResultJsonUnmarshaller());<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);
423,549
private void loadPreferencesFromJson(Map<String, ZipFile.JsonFile> result) {<NEW_LINE>ZipFile.JsonFile <MASK><NEW_LINE>if (jsonFile != null) {<NEW_LINE>Map<String, Object> preferences = new Gson().fromJson(jsonFile.content, Map.class);<NEW_LINE>SharedPreferences allPreferences = SkyTubeApp.getPreferenceManager();<NEW_LINE>SharedPreferences.Editor editor = allPreferences.edit();<NEW_LINE>for (int key : KEY_IDS) {<NEW_LINE>String keyStr = SkyTubeApp.getStr(key);<NEW_LINE>Object newValue = preferences.get(keyStr);<NEW_LINE>if (newValue != null) {<NEW_LINE>Log.i(TAG, String.format("Setting %s to %s", keyStr, newValue));<NEW_LINE>if (newValue instanceof String) {<NEW_LINE>editor.putString(keyStr, (String) newValue);<NEW_LINE>} else if (newValue instanceof Long) {<NEW_LINE>editor.putLong(keyStr, (Long) newValue);<NEW_LINE>} else if (newValue instanceof Collection) {<NEW_LINE>Collection values = (Collection) newValue;<NEW_LINE>Set<String> asSet = new HashSet<>();<NEW_LINE>for (Object value : values) {<NEW_LINE>if (value instanceof String) {<NEW_LINE>asSet.add((String) value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>editor.putStringSet(keyStr, asSet);<NEW_LINE>} else if (newValue instanceof Boolean) {<NEW_LINE>editor.putBoolean(keyStr, (Boolean) newValue);<NEW_LINE>} else {<NEW_LINE>Log.e(TAG, String.format("Failed to set preference: %s from %s (type=%s)", keyStr, newValue, newValue.getClass()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "Removing " + keyStr);<NEW_LINE>editor.remove(keyStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>editor.commit();<NEW_LINE>}<NEW_LINE>}
jsonFile = result.get(PREFERENCES_JSON);
435,984
long appendSessionOpen(final ClusterSession session, final long leadershipTermId, final long timestamp) {<NEW_LINE>long result;<NEW_LINE>final byte[<MASK><NEW_LINE>final String channel = session.responseChannel();<NEW_LINE>sessionOpenEventEncoder.wrapAndApplyHeader(expandableArrayBuffer, 0, messageHeaderEncoder).leadershipTermId(leadershipTermId).clusterSessionId(session.id()).correlationId(session.correlationId()).timestamp(timestamp).responseStreamId(session.responseStreamId()).responseChannel(channel).putEncodedPrincipal(encodedPrincipal, 0, encodedPrincipal.length);<NEW_LINE>final int length = MessageHeaderEncoder.ENCODED_LENGTH + sessionOpenEventEncoder.encodedLength();<NEW_LINE>int attempts = SEND_ATTEMPTS;<NEW_LINE>do {<NEW_LINE>result = publication.offer(expandableArrayBuffer, 0, length, null);<NEW_LINE>if (result > 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>checkResult(result);<NEW_LINE>} while (--attempts > 0);<NEW_LINE>return result;<NEW_LINE>}
] encodedPrincipal = session.encodedPrincipal();
1,562,053
private static String buildHTMLText(List<ValidatableLine> headerLines, TextLine displayName, List<ValidatableLine> bodyLines, TextLine infoLine, boolean trim) {<NEW_LINE>StringBuilder fullHtml = new StringBuilder();<NEW_LINE>StringBuilder truncatedHtml = new StringBuilder();<NEW_LINE>int lineCount = 0;<NEW_LINE>// header<NEW_LINE>Iterator<ValidatableLine> iterator = headerLines.iterator();<NEW_LINE>for (; iterator.hasNext(); ) {<NEW_LINE>TextLine line = (TextLine) iterator.next();<NEW_LINE>String encodedHeaderLine = line.getText();<NEW_LINE>String headerLine = wrapStringInColor(encodedHeaderLine, line.getTextColor());<NEW_LINE>append(fullHtml, truncatedHtml, lineCount, headerLine);<NEW_LINE>lineCount++;<NEW_LINE>}<NEW_LINE>// "<TT> displayName { "<NEW_LINE>String displayNameText = displayName.getText();<NEW_LINE>if (trim) {<NEW_LINE>displayNameText = StringUtilities.trimMiddle(displayNameText, ToolTipUtils.LINE_LENGTH);<NEW_LINE>}<NEW_LINE>displayNameText = HTMLUtilities.friendlyEncodeHTML(displayNameText);<NEW_LINE>displayNameText = wrapStringInColor(displayNameText, displayName.getTextColor());<NEW_LINE>// @formatter:off<NEW_LINE>append(fullHtml, truncatedHtml, lineCount++, TT_OPEN, displayNameText, TT_CLOSE, BR);<NEW_LINE>// TODO: show alignment<NEW_LINE>append(fullHtml, truncatedHtml, lineCount++, INDENT_OPEN, LENGTH_PREFIX, infoLine.getText(), INDENT_CLOSE);<NEW_LINE>append(fullHtml, truncatedHtml, lineCount++, "{", BR);<NEW_LINE>// @formatter:on<NEW_LINE>int length = bodyLines.size();<NEW_LINE>for (int i = 0; i < length; i++, lineCount++) {<NEW_LINE>TextLine textLine = (TextLine) bodyLines.get(i);<NEW_LINE>String text = textLine.getText();<NEW_LINE>String encodedBodyLine = HTMLUtilities.friendlyEncodeHTML(text);<NEW_LINE>text = wrapStringInColor(encodedBodyLine, textLine.getTextColor());<NEW_LINE>StringBuilder lineBuffer = new StringBuilder();<NEW_LINE>lineBuffer.append(TAB).append(text).append(HTML_SPACE);<NEW_LINE>if (i < length - 1) {<NEW_LINE>lineBuffer.append(BR);<NEW_LINE>}<NEW_LINE>String lineString = lineBuffer.toString();<NEW_LINE>append(<MASK><NEW_LINE>}<NEW_LINE>// show ellipses if needed; the truncated html is much shorter than the full html<NEW_LINE>if (lineCount >= MAX_LINE_COUNT) {<NEW_LINE>truncatedHtml.append(TAB).append(ELLIPSES).append(BR);<NEW_LINE>}<NEW_LINE>StringBuilder trailingLines = new StringBuilder();<NEW_LINE>trailingLines.append(BR).append("}").append(BR).append(TT_CLOSE);<NEW_LINE>String trailingString = trailingLines.toString();<NEW_LINE>fullHtml.append(trailingString);<NEW_LINE>truncatedHtml.append(trailingString);<NEW_LINE>if (trim) {<NEW_LINE>return truncatedHtml.toString();<NEW_LINE>}<NEW_LINE>return fullHtml.toString();<NEW_LINE>}
fullHtml, truncatedHtml, lineCount, lineString);
1,508,576
private static MimeMultipart createMultiPartEntity(final ByteString entity, final String entityContentType, String query) throws MessagingException {<NEW_LINE>MimeMultipart multi = new MimeMultipart(MIXED);<NEW_LINE>// Create current entity with the associated type<NEW_LINE>MimeBodyPart dataPart = new MimeBodyPart();<NEW_LINE>ContentType contentType = new ContentType(entityContentType);<NEW_LINE>if (MULTIPART.equals(contentType.getBaseType())) {<NEW_LINE>MimeMultipart nested = new MimeMultipart(new DataSource() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public InputStream getInputStream() throws IOException {<NEW_LINE>return entity.asInputStream();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OutputStream getOutputStream() throws IOException {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getContentType() {<NEW_LINE>return entityContentType;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dataPart.setContent(nested, contentType.getBaseType());<NEW_LINE>} else {<NEW_LINE>dataPart.setContent(entity.copyBytes(<MASK><NEW_LINE>}<NEW_LINE>dataPart.setHeader(HEADER_CONTENT_TYPE, entityContentType);<NEW_LINE>// Encode query params as form-urlencoded<NEW_LINE>MimeBodyPart argPart = new MimeBodyPart();<NEW_LINE>argPart.setContent(query, FORM_URL_ENCODED);<NEW_LINE>argPart.setHeader(HEADER_CONTENT_TYPE, FORM_URL_ENCODED);<NEW_LINE>multi.addBodyPart(argPart);<NEW_LINE>multi.addBodyPart(dataPart);<NEW_LINE>return multi;<NEW_LINE>}
), contentType.getBaseType());
318,075
public Matrix3d mul(Matrix3dc right, Matrix3d dest) {<NEW_LINE>double nm00 = Math.fma(m00, right.m00(), Math.fma(m10, right.m01(), m20 * right.m02()));<NEW_LINE>double nm01 = Math.fma(m01, right.m00(), Math.fma(m11, right.m01(), m21 * right.m02()));<NEW_LINE>double nm02 = Math.fma(m02, right.m00(), Math.fma(m12, right.m01(), m22 * right.m02()));<NEW_LINE>double nm10 = Math.fma(m00, right.m10(), Math.fma(m10, right.m11(), m20 <MASK><NEW_LINE>double nm11 = Math.fma(m01, right.m10(), Math.fma(m11, right.m11(), m21 * right.m12()));<NEW_LINE>double nm12 = Math.fma(m02, right.m10(), Math.fma(m12, right.m11(), m22 * right.m12()));<NEW_LINE>double nm20 = Math.fma(m00, right.m20(), Math.fma(m10, right.m21(), m20 * right.m22()));<NEW_LINE>double nm21 = Math.fma(m01, right.m20(), Math.fma(m11, right.m21(), m21 * right.m22()));<NEW_LINE>double nm22 = Math.fma(m02, right.m20(), Math.fma(m12, right.m21(), m22 * right.m22()));<NEW_LINE>dest.m00 = nm00;<NEW_LINE>dest.m01 = nm01;<NEW_LINE>dest.m02 = nm02;<NEW_LINE>dest.m10 = nm10;<NEW_LINE>dest.m11 = nm11;<NEW_LINE>dest.m12 = nm12;<NEW_LINE>dest.m20 = nm20;<NEW_LINE>dest.m21 = nm21;<NEW_LINE>dest.m22 = nm22;<NEW_LINE>return dest;<NEW_LINE>}
* right.m12()));
1,060,416
public void init() {<NEW_LINE>root.getChildren().remove(dialog);<NEW_LINE>centerButton.setOnAction(action -> {<NEW_LINE>dialog.setTransitionType(DialogTransition.CENTER);<NEW_LINE>dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));<NEW_LINE>});<NEW_LINE>topButton.setOnAction(action -> {<NEW_LINE>dialog.setTransitionType(DialogTransition.TOP);<NEW_LINE>dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));<NEW_LINE>});<NEW_LINE>rightButton.setOnAction(action -> {<NEW_LINE>dialog.setTransitionType(DialogTransition.RIGHT);<NEW_LINE>dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));<NEW_LINE>});<NEW_LINE>bottomButton.setOnAction(action -> {<NEW_LINE>dialog.setTransitionType(DialogTransition.BOTTOM);<NEW_LINE>dialog.show((StackPane<MASK><NEW_LINE>});<NEW_LINE>leftButton.setOnAction(action -> {<NEW_LINE>dialog.setTransitionType(DialogTransition.LEFT);<NEW_LINE>dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));<NEW_LINE>});<NEW_LINE>acceptButton.setOnAction(action -> dialog.close());<NEW_LINE>alertButton.setOnAction(action -> {<NEW_LINE>JFXAlert alert = new JFXAlert((Stage) alertButton.getScene().getWindow());<NEW_LINE>alert.initModality(Modality.APPLICATION_MODAL);<NEW_LINE>alert.setOverlayClose(false);<NEW_LINE>JFXDialogLayout layout = new JFXDialogLayout();<NEW_LINE>layout.setHeading(new Label("Modal Dialog using JFXAlert"));<NEW_LINE>layout.setBody(new Label("Lorem ipsum dolor sit amet, consectetur adipiscing elit," + " sed do eiusmod tempor incididunt ut labore et dolore magna" + " aliqua. Utenim ad minim veniam, quis nostrud exercitation" + " ullamco laboris nisi ut aliquip ex ea commodo consequat."));<NEW_LINE>JFXButton closeButton = new JFXButton("ACCEPT");<NEW_LINE>closeButton.getStyleClass().add("dialog-accept");<NEW_LINE>closeButton.setOnAction(event -> alert.hideWithAnimation());<NEW_LINE>layout.setActions(closeButton);<NEW_LINE>alert.setContent(layout);<NEW_LINE>alert.show();<NEW_LINE>});<NEW_LINE>}
) context.getRegisteredObject(CONTENT_PANE));
1,043,758
protected void doExecute(Task task, GetRollupJobsAction.Request request, ActionListener<GetRollupJobsAction.Response> listener) {<NEW_LINE>final ClusterState state = clusterService.state();<NEW_LINE>final DiscoveryNodes nodes = state.nodes();<NEW_LINE>if (nodes.isLocalNodeElectedMaster()) {<NEW_LINE>if (stateHasRollupJobs(request, state)) {<NEW_LINE>super.<MASK><NEW_LINE>} else {<NEW_LINE>// If we couldn't find the job in the persistent task CS, it means it was deleted prior to this GET<NEW_LINE>// and we can just send an empty response, no need to go looking for the allocated task<NEW_LINE>listener.onResponse(new GetRollupJobsAction.Response(Collections.emptyList()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Delegates GetJobs to elected master node, so it becomes the coordinating node.<NEW_LINE>// Non-master nodes may have a stale cluster state that shows jobs which are cancelled<NEW_LINE>// on the master, which makes testing difficult.<NEW_LINE>if (nodes.getMasterNode() == null) {<NEW_LINE>listener.onFailure(new MasterNotDiscoveredException());<NEW_LINE>} else {<NEW_LINE>transportService.sendRequest(nodes.getMasterNode(), actionName, request, new ActionListenerResponseHandler<>(listener, GetRollupJobsAction.Response::new));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
doExecute(task, request, listener);
723,041
public // [1 CMS-remark: 243393K(9378240K)] 310268K(10375040K), 0.2151395 secs] [Times: user=1.12 sys=0.09, real=0.21 secs]<NEW_LINE>void splitRemarkReference(GCLogTrace trace, String line) {<NEW_LINE>CMSRemark remark = new CMSRemark(getClock(), gcCauseForwardReference, trace.getPauseTime());<NEW_LINE>GCLogTrace remarkClause = REMARK_CLAUSE.parse(line);<NEW_LINE>MemoryPoolSummary tenured = getTotalOccupancyWithTotalHeapSizeSummary(remarkClause, 1);<NEW_LINE>MemoryPoolSummary heap = getTotalOccupancyWithTotalHeapSizeSummary(remarkClause, 5);<NEW_LINE>remark.add(heap.minus(tenured), tenured, heap);<NEW_LINE>recordRescanStepTimes(remark, line);<NEW_LINE>remark<MASK><NEW_LINE>remark.add(extractCPUSummary(line));<NEW_LINE>record(remark);<NEW_LINE>remarkTimeStamp = null;<NEW_LINE>}
.addReferenceGCSummary(extractPrintReferenceGC(line));
185,846
public static QueryGovernanceKubernetesClusterResponse unmarshall(QueryGovernanceKubernetesClusterResponse queryGovernanceKubernetesClusterResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryGovernanceKubernetesClusterResponse.setRequestId(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.RequestId"));<NEW_LINE>queryGovernanceKubernetesClusterResponse.setHttpStatusCode(_ctx.integerValue("QueryGovernanceKubernetesClusterResponse.HttpStatusCode"));<NEW_LINE>queryGovernanceKubernetesClusterResponse.setMessage(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.Message"));<NEW_LINE>queryGovernanceKubernetesClusterResponse.setCode<MASK><NEW_LINE>queryGovernanceKubernetesClusterResponse.setSuccess(_ctx.booleanValue("QueryGovernanceKubernetesClusterResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalSize(_ctx.integerValue("QueryGovernanceKubernetesClusterResponse.Data.TotalSize"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("QueryGovernanceKubernetesClusterResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryGovernanceKubernetesClusterResponse.Data.PageSize"));<NEW_LINE>List<ClusterList> result = new ArrayList<ClusterList>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryGovernanceKubernetesClusterResponse.Data.Result.Length"); i++) {<NEW_LINE>ClusterList clusterList = new ClusterList();<NEW_LINE>clusterList.setClusterName(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.Data.Result[" + i + "].ClusterName"));<NEW_LINE>clusterList.setClusterId(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.Data.Result[" + i + "].ClusterId"));<NEW_LINE>clusterList.setRegion(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.Data.Result[" + i + "].Region"));<NEW_LINE>clusterList.setK8sVersion(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.Data.Result[" + i + "].K8sVersion"));<NEW_LINE>clusterList.setNamespaceInfos(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.Data.Result[" + i + "].NamespaceInfos"));<NEW_LINE>clusterList.setPilotStartTime(_ctx.stringValue("QueryGovernanceKubernetesClusterResponse.Data.Result[" + i + "].PilotStartTime"));<NEW_LINE>result.add(clusterList);<NEW_LINE>}<NEW_LINE>data.setResult(result);<NEW_LINE>queryGovernanceKubernetesClusterResponse.setData(data);<NEW_LINE>return queryGovernanceKubernetesClusterResponse;<NEW_LINE>}
(_ctx.integerValue("QueryGovernanceKubernetesClusterResponse.Code"));
182,731
private void processSettingAnnotation(Setting settingAnnotation, SettingsParameter settingsParameter) {<NEW_LINE>settingsParameter.useServerConfiguration = settingAnnotation.useServerConfiguration();<NEW_LINE>settingsParameter.settingPath = settingAnnotation.settingPath();<NEW_LINE>settingsParameter.shards = settingAnnotation.shards();<NEW_LINE>settingsParameter.replicas = settingAnnotation.replicas();<NEW_LINE>settingsParameter.refreshIntervall = settingAnnotation.refreshInterval();<NEW_LINE>settingsParameter<MASK><NEW_LINE>String[] sortFields = settingAnnotation.sortFields();<NEW_LINE>if (sortFields.length > 0) {<NEW_LINE>String[] fieldNames = new String[sortFields.length];<NEW_LINE>int index = 0;<NEW_LINE>for (String propertyName : sortFields) {<NEW_LINE>ElasticsearchPersistentProperty property = getPersistentProperty(propertyName);<NEW_LINE>if (property == null) {<NEW_LINE>throw new IllegalArgumentException("sortField property " + propertyName + " not found");<NEW_LINE>}<NEW_LINE>Field fieldAnnotation = property.getRequiredAnnotation(Field.class);<NEW_LINE>FieldType fieldType = fieldAnnotation.type();<NEW_LINE>switch(fieldType) {<NEW_LINE>case Boolean:<NEW_LINE>case Long:<NEW_LINE>case Integer:<NEW_LINE>case Short:<NEW_LINE>case Byte:<NEW_LINE>case Float:<NEW_LINE>case Half_Float:<NEW_LINE>case Scaled_Float:<NEW_LINE>case Date:<NEW_LINE>case Date_Nanos:<NEW_LINE>case Keyword:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("field type " + fieldType + " not allowed for sortField");<NEW_LINE>}<NEW_LINE>if (!fieldAnnotation.docValues()) {<NEW_LINE>throw new IllegalArgumentException("doc_values must be set to true for sortField");<NEW_LINE>}<NEW_LINE>fieldNames[index++] = property.getFieldName();<NEW_LINE>}<NEW_LINE>settingsParameter.sortFields = fieldNames;<NEW_LINE>Setting.SortOrder[] sortOrders = settingAnnotation.sortOrders();<NEW_LINE>if (sortOrders.length > 0) {<NEW_LINE>if (sortOrders.length != sortFields.length) {<NEW_LINE>throw new IllegalArgumentException("@Settings parameter sortFields and sortOrders must have the same size");<NEW_LINE>}<NEW_LINE>settingsParameter.sortOrders = sortOrders;<NEW_LINE>}<NEW_LINE>Setting.SortMode[] sortModes = settingAnnotation.sortModes();<NEW_LINE>if (sortModes.length > 0) {<NEW_LINE>if (sortModes.length != sortFields.length) {<NEW_LINE>throw new IllegalArgumentException("@Settings parameter sortFields and sortModes must have the same size");<NEW_LINE>}<NEW_LINE>settingsParameter.sortModes = sortModes;<NEW_LINE>}<NEW_LINE>Setting.SortMissing[] sortMissingValues = settingAnnotation.sortMissingValues();<NEW_LINE>if (sortMissingValues.length > 0) {<NEW_LINE>if (sortMissingValues.length != sortFields.length) {<NEW_LINE>throw new IllegalArgumentException("@Settings parameter sortFields and sortMissingValues must have the same size");<NEW_LINE>}<NEW_LINE>settingsParameter.sortMissingValues = sortMissingValues;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.indexStoreType = settingAnnotation.indexStoreType();
228,949
// ----- package methods -----<NEW_LINE>void deserialize(final Map<String, Object> source) {<NEW_LINE>final Map<String, Object> definitions = (Map<String, Object>) source.get(JsonSchema.KEY_DEFINITIONS);<NEW_LINE>if (definitions != null) {<NEW_LINE>typeDefinitions.deserialize(definitions);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Invalid JSON object for schema definitions, missing value for 'definitions'.");<NEW_LINE>}<NEW_LINE>final List<Map<String, Object>> globalSchemaMethods = (List<Map<String, Object>>) source.get(JsonSchema.KEY_METHODS);<NEW_LINE>if (globalSchemaMethods != null) {<NEW_LINE>globalMethods.deserialize(globalSchemaMethods);<NEW_LINE>} else {<NEW_LINE>final String title = "Deprecation warning";<NEW_LINE>final String text = "This schema snapshot was created with an older version of Structr. More recent versions support global schema methods. Please re-create the snapshot with the latest version to avoid compatibility issues.";<NEW_LINE>final Map<String, Object> deprecationBroadcastData = new TreeMap();<NEW_LINE><MASK><NEW_LINE>deprecationBroadcastData.put("title", title);<NEW_LINE>deprecationBroadcastData.put("text", text);<NEW_LINE>TransactionCommand.simpleBroadcastGenericMessage(deprecationBroadcastData);<NEW_LINE>logger.info(title + ": " + text);<NEW_LINE>}<NEW_LINE>final Object idValue = source.get(JsonSchema.KEY_ID);<NEW_LINE>if (idValue != null) {<NEW_LINE>this.id = URI.create(idValue.toString());<NEW_LINE>}<NEW_LINE>}
deprecationBroadcastData.put("type", "WARNING");
1,293,688
private static void addSentiment(CoreMap sentence, Tree sentimentTree, Element sentElem, String namespaceUri) {<NEW_LINE>int sentiment = RNNCoreAnnotations.getPredictedClass(sentimentTree);<NEW_LINE>sentElem.addAttribute(new Attribute("sentimentValue", Integer.toString(sentiment)));<NEW_LINE>String sentimentClass = sentence.get(SentimentCoreAnnotations.SentimentClass.class);<NEW_LINE>sentElem.addAttribute(new Attribute("sentiment", sentimentClass.replaceAll(" ", "")));<NEW_LINE>Element sentimentElem = new Element("sentiment", namespaceUri);<NEW_LINE>setSingleElement(sentimentElem, "sentiment", namespaceUri, sentimentClass);<NEW_LINE>setSingleElement(sentimentElem, "sentimentValue", namespaceUri<MASK><NEW_LINE>List<Double> sentimentPredictions = RNNCoreAnnotations.getPredictionsAsStringList(sentimentTree);<NEW_LINE>Element predictionsElem = new Element("predictions", namespaceUri);<NEW_LINE>for (int i = 0; i < sentimentPredictions.size(); ++i) {<NEW_LINE>double score = sentimentPredictions.get(i);<NEW_LINE>Element predElem = new Element("prediction", namespaceUri);<NEW_LINE>setSingleElement(predElem, "classIndex", namespaceUri, Integer.toString(i));<NEW_LINE>setSingleElement(predElem, "score", namespaceUri, Double.toString(score));<NEW_LINE>predictionsElem.appendChild(predElem);<NEW_LINE>}<NEW_LINE>sentimentElem.appendChild(predictionsElem);<NEW_LINE>sentElem.appendChild(sentimentElem);<NEW_LINE>}
, Integer.toString(sentiment));
1,702,125
public static void searchSubreddits(@NonNull final CacheManager cm, @NonNull final RedditAccount user, @NonNull final String queryString, @NonNull final Context context, @NonNull final APIResponseHandler.ValueResponseHandler<SubredditListResponse> handler, @NonNull final Optional<String> after) {<NEW_LINE>// 60 seconds<NEW_LINE>final long maxCacheAgeMs = 60 * 1000;<NEW_LINE>final Uri.Builder builder = Constants.Reddit.getUriBuilder("/subreddits/search.json");<NEW_LINE>builder.appendQueryParameter("q", queryString);<NEW_LINE>builder.appendQueryParameter("limit", "100");<NEW_LINE>if (PrefsUtility.pref_behaviour_nsfw()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>after.apply(value -> builder.appendQueryParameter("after", value));<NEW_LINE>final URI uri = Objects.requireNonNull(General.uriFromString(builder.build().toString()));<NEW_LINE>requestSubredditList(cm, uri, user, context, handler, new DownloadStrategyIfTimestampOutsideBounds(TimestampBound.notOlderThan(maxCacheAgeMs)));<NEW_LINE>}
builder.appendQueryParameter("include_over_18", "on");
699,609
public void testSFLFutureGetBlocks() throws Exception {<NEW_LINE>long currentThreadId = 0;<NEW_LINE>ResultsStatefulLocal bean = lookupSFLBean();<NEW_LINE>assertNotNull("Async Stateful Bean created successfully", bean);<NEW_LINE>// call bean asynchronous method using Future<V> object to receive results<NEW_LINE>Future<Boolean> future = bean.test_fireAndReturnResults();<NEW_LINE>svLogger.info("Retrieving results");<NEW_LINE>boolean results = future.get();<NEW_LINE>svLogger.info("Asynchronous method work completed: " + Boolean.toString(results));<NEW_LINE>assertEquals("Async Stateful Bean method completed", true, results);<NEW_LINE>// get current thread Id for comparison to bean method thread id<NEW_LINE>currentThreadId = Thread.currentThread().getId();<NEW_LINE>svLogger.info("Test threadId = " + currentThreadId);<NEW_LINE>svLogger.<MASK><NEW_LINE>assertFalse("Async Stateful Bean method completed on separate thread", (ResultsStatefulLocalFutureBean.beanThreadId == currentThreadId));<NEW_LINE>}
info("Bean threadId = " + ResultsStatefulLocalFutureBean.beanThreadId);
129,228
Map<String, Object> bindParameters(Neo4jParameterAccessor parameterAccessor) {<NEW_LINE>final Parameters<?, ?> formalParameters = parameterAccessor.getParameters();<NEW_LINE>Map<String, Object> resolvedParameters = new HashMap<>();<NEW_LINE>// Values from the parameter accessor can only get converted after evaluation<NEW_LINE>for (Map.Entry<String, Object> evaluatedParam : spelEvaluator.evaluate(parameterAccessor.getValues()).entrySet()) {<NEW_LINE>Object value = evaluatedParam.getValue();<NEW_LINE>if (!(evaluatedParam.getValue() instanceof Neo4jSpelSupport.LiteralReplacement)) {<NEW_LINE>Neo4jQuerySupport.logParameterIfNull(evaluatedParam.getKey(), value);<NEW_LINE>value = super.convertParameter(evaluatedParam.getValue());<NEW_LINE>}<NEW_LINE>resolvedParameters.put(evaluatedParam.getKey(), value);<NEW_LINE>}<NEW_LINE>formalParameters.stream().filter(Parameter::isBindable).forEach(parameter -> {<NEW_LINE>int index = parameter.getIndex();<NEW_LINE>Object <MASK><NEW_LINE>Neo4jQuerySupport.logParameterIfNull(parameter.getName().orElseGet(() -> Integer.toString(index)), value);<NEW_LINE>Object convertedValue = super.convertParameter(value);<NEW_LINE>// Add the parameter under its name when possible<NEW_LINE>parameter.getName().ifPresent(parameterName -> resolvedParameters.put(parameterName, convertedValue));<NEW_LINE>// Always add under its index.<NEW_LINE>resolvedParameters.put(Integer.toString(index), convertedValue);<NEW_LINE>});<NEW_LINE>return resolvedParameters;<NEW_LINE>}
value = parameterAccessor.getBindableValue(index);
196,347
public Paragraph<PS, SEG, S> subSequence(int start) {<NEW_LINE>if (start < 0) {<NEW_LINE>throw new IllegalArgumentException("start must not be negative (was: " + start + ")");<NEW_LINE>} else if (start == 0) {<NEW_LINE>return this;<NEW_LINE>} else if (start == length()) {<NEW_LINE>// in case one is using EitherOps<SegmentOps, SegmentOps>, force the empty segment<NEW_LINE>// to use the left ops' default empty seg, not the right one's empty seg<NEW_LINE>return new Paragraph<>(paragraphStyle, segmentOps, segmentOps.createEmptySeg(), styles.subView(start, start));<NEW_LINE>} else if (start < length()) {<NEW_LINE>Position pos = navigator.offsetToPosition(start, Forward);<NEW_LINE>int segIdx = pos.getMajor();<NEW_LINE>List<SEG> segs = new ArrayList<>(segments.size() - segIdx);<NEW_LINE>segs.add(segmentOps.subSequence(segments.get(segIdx), pos.getMinor()));<NEW_LINE>segs.addAll(segments.subList(segIdx + 1<MASK><NEW_LINE>if (segs.isEmpty()) {<NEW_LINE>segs.add(segmentOps.createEmptySeg());<NEW_LINE>}<NEW_LINE>return new Paragraph<>(paragraphStyle, segmentOps, segs, styles.subView(start, styles.length()));<NEW_LINE>} else {<NEW_LINE>throw new IndexOutOfBoundsException(start + " not in [0, " + length() + "]");<NEW_LINE>}<NEW_LINE>}
, segments.size()));
756,609
boolean pendingChanges() {<NEW_LINE>if (ui != null) {<NEW_LINE>assert SwingUtilities.isEventDispatchThread();<NEW_LINE>// NOI18N<NEW_LINE>String // NOI18N<NEW_LINE>classes = // NOI18N<NEW_LINE>classesArea.showsHint() ? "" : classesArea.getText().trim();<NEW_LINE>// NOI18N<NEW_LINE>if (!classes.equals(readFlag(CLASSES_FLAG, "")))<NEW_LINE>return true;<NEW_LINE>boolean lifecycle = lifecycleCheckbox.isSelected();<NEW_LINE>boolean _lifecycle = Boolean.parseBoolean(readFlag(LIFECYCLE_FLAG, Boolean.TRUE.toString()));<NEW_LINE>if (lifecycle != _lifecycle)<NEW_LINE>return true;<NEW_LINE><MASK><NEW_LINE>boolean _alloc = Boolean.parseBoolean(readFlag(ALLOCATIONS_FLAG, Boolean.TRUE.toString()));<NEW_LINE>if (alloc != _alloc)<NEW_LINE>return true;<NEW_LINE>int limit = Integer.parseInt(readFlag(LIMIT_ALLOCATIONS_FLAG, LIMIT_ALLOCATIONS_DEFAULT.toString()));<NEW_LINE>int _limit = (Integer) outgoingSpinner.getValue();<NEW_LINE>if (limit != _limit)<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
boolean alloc = outgoingCheckbox.isSelected();
633,289
private void updateNavigatorSelection(CompilationInfo ci, TreePath tp) throws Exception {<NEW_LINE>final ClassMemberPanel cmp = ClassMemberPanel.getInstance();<NEW_LINE>if (cmp == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClassMemberPanelUI cmpUi = cmp.getClassMemberPanelUI();<NEW_LINE>if (!cmpUi.isAutomaticRefresh()) {<NEW_LINE>cmpUi.getTask().runImpl(ci, false);<NEW_LINE>lastEhForNavigator = null;<NEW_LINE>}<NEW_LINE>// Try to find the declaration we are in<NEW_LINE>final Pair<Element, TreePath> p = outerElement(ci, tp);<NEW_LINE>if (p != null) {<NEW_LINE>final Element e = p.first();<NEW_LINE>Runnable action = null;<NEW_LINE>if (e == null) {<NEW_LINE>// Directive<NEW_LINE>lastEhForNavigator = null;<NEW_LINE>action = () -> {<NEW_LINE>cmp.selectTreePath(TreePathHandle.create(p.second(), ci));<NEW_LINE>};<NEW_LINE>} else if (e.getKind() != ElementKind.OTHER) {<NEW_LINE>final ElementHandle<Element> <MASK><NEW_LINE>if (lastEhForNavigator != null && eh.signatureEquals(lastEhForNavigator)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lastEhForNavigator = eh;<NEW_LINE>action = () -> {<NEW_LINE>cmp.selectElement(eh);<NEW_LINE>};<NEW_LINE>}<NEW_LINE>if (action != null) {<NEW_LINE>SwingUtilities.invokeLater(action);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
eh = ElementHandle.create(e);
1,513,237
public static void attachIcon(Window frame) {<NEW_LINE>if (allIcons == null) {<NEW_LINE>final var loadedIcons = new ArrayList<Image>();<NEW_LINE>final var loader = LFrame.class.getClassLoader();<NEW_LINE>for (final var size : sizes) {<NEW_LINE>final var url = loader.getResource(pathBasePart + size + ".png");<NEW_LINE>if (url != null) {<NEW_LINE>final <MASK><NEW_LINE>loadedIcons.add(icon.getImage());<NEW_LINE>if (size == defaultSize) {<NEW_LINE>defaultIcon = icon.getImage();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>allIcons = loadedIcons;<NEW_LINE>}<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>if (CollectionUtil.isNotEmpty(allIcons)) {<NEW_LINE>final var set = frame.getClass().getMethod("setIconImages", List.class);<NEW_LINE>set.invoke(frame, allIcons);<NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>if (!success && frame instanceof JFrame && defaultIcon != null) {<NEW_LINE>frame.setIconImage(defaultIcon);<NEW_LINE>}<NEW_LINE>}
var icon = new ImageIcon(url);
716,534
public void restore(final Path file, final LoginCallback prompt) throws BackgroundException {<NEW_LINE>final Path container = session.getFeature(PathContainerService.class).getContainer(file);<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>final AmazonS3 client = client(container);<NEW_LINE>// Standard - S3 Standard retrievals allow you to access any of your archived objects within several hours.<NEW_LINE>// This is the default option for the GLACIER and DEEP_ARCHIVE retrieval requests that do not specify<NEW_LINE>// the retrieval option. S3 Standard retrievals typically complete within 3-5 hours from the GLACIER<NEW_LINE>// storage class and typically complete within 12 hours from the DEEP_ARCHIVE storage class.<NEW_LINE>client.restoreObjectV2(// To restore a specific object version, you can provide a version ID. If you don't provide a version ID, Amazon S3 restores the current version.<NEW_LINE>new RestoreObjectRequest(container.getName(), session.getFeature(PathContainerService.class).getKey(file)).withVersionId(file.attributes().getVersionId()).withExpirationInDays(new HostPreferences(session.getHost()).getInteger("s3.glacier.restore.expiration.days")).withGlacierJobParameters(new GlacierJobParameters().withTier(new HostPreferences(session.getHost()).getProperty("s3.glacier.restore.tier"))));<NEW_LINE>// 200 Reply if already restored<NEW_LINE>} catch (AmazonClientException e) {<NEW_LINE>throw new AmazonServiceExceptionMappingService().<MASK><NEW_LINE>}<NEW_LINE>} catch (ConflictException e) {<NEW_LINE>// 409 when restore is in progress<NEW_LINE>log.warn(String.format("Restore for %s already in progress %s", file, e));<NEW_LINE>}<NEW_LINE>}
map("Failure to write attributes of {0}", e, file);
1,338,993
public SoftwareVersionData requestSoftwareVersion(String xSdsDateFormat) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/public/software/version";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsDateFormat != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Date-Format", apiClient.parameterToString(xSdsDateFormat));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<SoftwareVersionData> localVarReturnType = new GenericType<SoftwareVersionData>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
final String[] localVarContentTypes = {};
1,159,717
public E poll() {<NEW_LINE>if (root == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long winningTicket = ThreadLocalRandom.current().nextLong(root.getTotalTickets());<NEW_LINE>Node<E> candidate = root;<NEW_LINE>while (!candidate.isLeaf()) {<NEW_LINE>long leftTickets = candidate.getLeft().map(Node::getTotalTickets).orElse(0L);<NEW_LINE>if (winningTicket < leftTickets) {<NEW_LINE>candidate = candidate.getLeft().get();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>winningTicket -= leftTickets;<NEW_LINE>if (winningTicket < candidate.getTickets()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>winningTicket -= candidate.getTickets();<NEW_LINE>checkState(candidate.getRight().isPresent(), "Expected right node to contain the winner, but it does not exist");<NEW_LINE>candidate = candidate<MASK><NEW_LINE>}<NEW_LINE>checkState(winningTicket < candidate.getTickets(), "Inconsistent winner");<NEW_LINE>E value = candidate.getValue();<NEW_LINE>remove(value);<NEW_LINE>return value;<NEW_LINE>}
.getRight().get();
177,823
public void paint(Graphics g) {<NEW_LINE>g.drawImage(<MASK><NEW_LINE>Transaction.runVoid(() -> {<NEW_LINE>drawSegments(g, 193, 140, presetLCD.sample(), larges, 5);<NEW_LINE>drawSegments(g, 517, 30, saleCostLCD.sample(), larges, 5);<NEW_LINE>drawSegments(g, 517, 120, saleQuantityLCD.sample(), larges, 5);<NEW_LINE>drawSegments(g, 355, 230, priceLCD1.sample(), smalls, 4);<NEW_LINE>drawSegments(g, 485, 230, priceLCD2.sample(), smalls, 4);<NEW_LINE>drawSegments(g, 615, 230, priceLCD3.sample(), smalls, 4);<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>Rectangle r = nozzleRects[i].sample();<NEW_LINE>g.drawImage(nozzleImgs[i], r.x, r.y, null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Toolkit.getDefaultToolkit().sync();<NEW_LINE>}
background, 0, 0, null);
1,091,126
final DescribeNodeAssociationStatusResult executeDescribeNodeAssociationStatus(DescribeNodeAssociationStatusRequest describeNodeAssociationStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeNodeAssociationStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeNodeAssociationStatusRequest> request = null;<NEW_LINE>Response<DescribeNodeAssociationStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeNodeAssociationStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeNodeAssociationStatusRequest));<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, "OpsWorksCM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeNodeAssociationStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeNodeAssociationStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeNodeAssociationStatusResultJsonUnmarshaller());<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);
825,394
private void updateCurrentTarget(MouseEvent rootEvent, boolean isEnding) {<NEW_LINE>// event related to eventRootPane<NEW_LINE>Component mouseOver = SwingUtilities.getDeepestComponentAt(eventRootPane, rootEvent.getX(<MASK><NEW_LINE>while (mouseOver != null) {<NEW_LINE>if (mouseOver instanceof DragCardTarget) {<NEW_LINE>DragCardTarget target = (DragCardTarget) mouseOver;<NEW_LINE>MouseEvent targetEvent = SwingUtilities.convertMouseEvent(eventRootPane, rootEvent, mouseOver);<NEW_LINE>if (target != currentTarget) {<NEW_LINE>if (currentTarget != null) {<NEW_LINE>MouseEvent oldTargetEvent = SwingUtilities.convertMouseEvent(eventRootPane, rootEvent, (Component) currentTarget);<NEW_LINE>currentTarget.dragCardExit(oldTargetEvent);<NEW_LINE>}<NEW_LINE>currentTarget = target;<NEW_LINE>currentTarget.dragCardEnter(targetEvent);<NEW_LINE>}<NEW_LINE>if (isEnding) {<NEW_LINE>currentTarget.dragCardExit(targetEvent);<NEW_LINE>currentTarget.dragCardDrop(targetEvent, source, currentCards);<NEW_LINE>} else {<NEW_LINE>currentTarget.dragCardMove(targetEvent);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mouseOver = mouseOver.getParent();<NEW_LINE>}<NEW_LINE>if (currentTarget != null) {<NEW_LINE>MouseEvent oldTargetEvent = SwingUtilities.convertMouseEvent(eventRootPane, rootEvent, (Component) currentTarget);<NEW_LINE>currentTarget.dragCardExit(oldTargetEvent);<NEW_LINE>}<NEW_LINE>currentTarget = null;<NEW_LINE>}
), rootEvent.getY());
81,634
public com.amazonaws.services.route53recoveryreadiness.model.ConflictException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.route53recoveryreadiness.model.ConflictException conflictException = new com.amazonaws.services.route53recoveryreadiness.model.ConflictException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return conflictException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,345,274
public void writeTo(OutputStream os) throws IOException {<NEW_LINE>if (recordLocationsByOrdinal.size() == 0)<NEW_LINE>throw new IOException("No data to write!");<NEW_LINE>int locationOfTopRecord = recordLocationsByOrdinal.get(recordLocationsByOrdinal.size() - 1);<NEW_LINE>int schemaIdOfTopRecord = VarInt.readVInt(<MASK><NEW_LINE>HollowSchema schemaOfTopRecord = schemaIdMapper.getSchema(schemaIdOfTopRecord);<NEW_LINE>VarInt.writeVInt(os, locationOfTopRecord);<NEW_LINE>int[] pkFieldValueLocations = null;<NEW_LINE>if (schemaOfTopRecord.getSchemaType() == SchemaType.OBJECT) {<NEW_LINE>PrimaryKey primaryKey = ((HollowObjectSchema) schemaOfTopRecord).getPrimaryKey();<NEW_LINE>if (primaryKey != null) {<NEW_LINE>pkFieldValueLocations = new int[primaryKey.numFields()];<NEW_LINE>// / encode the locations of the primary key fields<NEW_LINE>for (int i = 0; i < primaryKey.numFields(); i++) {<NEW_LINE>int[] fieldPathIndex = primaryKey.getFieldPathIndex(dataset, i);<NEW_LINE>pkFieldValueLocations[i] = locatePrimaryKeyField(locationOfTopRecord, fieldPathIndex, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>VarInt.writeVInt(os, (int) buf.length() - locationOfTopRecord);<NEW_LINE>buf.getUnderlyingArray().writeTo(os, 0, buf.length());<NEW_LINE>if (pkFieldValueLocations != null) {<NEW_LINE>for (int i = 0; i < pkFieldValueLocations.length; i++) {<NEW_LINE>VarInt.writeVInt(os, pkFieldValueLocations[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
buf.getUnderlyingArray(), locationOfTopRecord);
836,335
private static <T> T valueAt(MappedObject root, JsonNode node, Lookup lookup, String expression, Class<T> type) {<NEW_LINE>JsonNode <MASK><NEW_LINE>if (result.isMissingNode() && expression.startsWith("/") && expression.length() > 1 && Character.isLowerCase(expression.charAt(1))) {<NEW_LINE>StringBuilder alternative = new StringBuilder(expression);<NEW_LINE>alternative.setCharAt(1, Character.toUpperCase(alternative.charAt(1)));<NEW_LINE>result = node.at(alternative.toString());<NEW_LINE>}<NEW_LINE>if (type.isInterface() && !type.getName().startsWith("java")) {<NEW_LINE>return (T) Proxy.newProxyInstance(MappedObject.class.getClassLoader(), new Class<?>[] { type }, new MappedInvocationHandler(root, result, lookup));<NEW_LINE>}<NEW_LINE>if (result.isMissingNode()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return SharedObjectMapper.get().treeToValue(result, type);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>}
result = node.at(expression);
780,467
protected void printName0(String text) {<NEW_LINE>if (appender == null || text.length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (printNameQuote) {<NEW_LINE>char c0 = text.charAt(0);<NEW_LINE>if (c0 == quote) {<NEW_LINE>this.appender.append(text);<NEW_LINE>} else if (c0 == '"' && text.charAt(text.length() - 1) == '"') {<NEW_LINE>this.appender.append(quote);<NEW_LINE>this.appender.append(text.substring(1, text.length() - 1));<NEW_LINE>this.appender.append(quote);<NEW_LINE>} else if (c0 == '`' && text.charAt(text.length() - 1) == '`') {<NEW_LINE>this.appender.append(quote);<NEW_LINE>this.appender.append(text.substring(1, text.length() - 1));<NEW_LINE>this.appender.append(quote);<NEW_LINE>} else {<NEW_LINE>this.appender.append(quote);<NEW_LINE>this.appender.append(text);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.appender.append(text);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("println error", e);<NEW_LINE>}<NEW_LINE>}
this.appender.append(quote);
95,706
private QueryResult docToQueryResult(Document doc) throws ParseException {<NEW_LINE>QueryResult result = new QueryResult();<NEW_LINE>result.project = unpackString(doc, Lucene.project);<NEW_LINE>result.repository = unpackString(doc, Lucene.repository);<NEW_LINE>result.number = unpackLong(doc, Lucene.number);<NEW_LINE>result.createdBy = unpackString(doc, Lucene.createdby);<NEW_LINE>result.createdAt = unpackDate(doc, Lucene.created);<NEW_LINE>result.updatedBy = unpackString(doc, Lucene.updatedby);<NEW_LINE>result.updatedAt = unpackDate(doc, Lucene.updated);<NEW_LINE>result.title = unpackString(doc, Lucene.title);<NEW_LINE>result.body = unpackString(doc, Lucene.body);<NEW_LINE>result.status = Status.fromObject(unpackString(doc, Lucene.status), Status.New);<NEW_LINE>result.responsible = unpackString(doc, Lucene.responsible);<NEW_LINE>result.milestone = unpackString(doc, Lucene.milestone);<NEW_LINE>result.topic = unpackString(doc, Lucene.topic);<NEW_LINE>result.type = TicketModel.Type.fromObject(unpackString(doc, Lucene.type), TicketModel.Type.defaultType);<NEW_LINE>result.mergeSha = unpackString(doc, Lucene.mergesha);<NEW_LINE>result.mergeTo = unpackString(doc, Lucene.mergeto);<NEW_LINE>result.commentsCount = unpackInt(doc, Lucene.comments);<NEW_LINE>result.votesCount = unpackInt(doc, Lucene.votes);<NEW_LINE>result.attachments = unpackStrings(doc, Lucene.attachments);<NEW_LINE>result.labels = unpackStrings(doc, Lucene.labels);<NEW_LINE>result.participants = unpackStrings(doc, Lucene.participants);<NEW_LINE>result.watchedby = <MASK><NEW_LINE>result.mentions = unpackStrings(doc, Lucene.mentions);<NEW_LINE>result.priority = TicketModel.Priority.fromObject(unpackInt(doc, Lucene.priority), TicketModel.Priority.defaultPriority);<NEW_LINE>result.severity = TicketModel.Severity.fromObject(unpackInt(doc, Lucene.severity), TicketModel.Severity.defaultSeverity);<NEW_LINE>if (!StringUtils.isEmpty(doc.get(Lucene.patchset.name()))) {<NEW_LINE>// unpack most recent patchset<NEW_LINE>String[] values = doc.get(Lucene.patchset.name()).split(":", 5);<NEW_LINE>Patchset patchset = new Patchset();<NEW_LINE>patchset.number = Integer.parseInt(values[0]);<NEW_LINE>patchset.rev = Integer.parseInt(values[1]);<NEW_LINE>patchset.tip = values[2];<NEW_LINE>patchset.base = values[3];<NEW_LINE>patchset.commits = Integer.parseInt(values[4]);<NEW_LINE>result.patchset = patchset;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
unpackStrings(doc, Lucene.watchedby);
1,193,384
private void updatePorts(Instance instance) {<NEW_LINE>final var ps = new Port[5];<NEW_LINE>if (instance.getAttributeValue(StdAttr.APPEARANCE) == StdAttr.APPEAR_CLASSIC) {<NEW_LINE>ps[OUT] = new Port(0, 0, Port.OUTPUT, StdAttr.WIDTH);<NEW_LINE>ps[IN] = new Port(-30, 0, Port.INPUT, StdAttr.WIDTH);<NEW_LINE>ps[CK] = new Port(-20, 20, Port.INPUT, 1);<NEW_LINE>ps[CLR] = new Port(-10, 20, Port.INPUT, 1);<NEW_LINE>ps[EN] = new Port(-30, 10, Port.INPUT, 1);<NEW_LINE>} else {<NEW_LINE>ps[OUT] = new Port(60, 30, Port.OUTPUT, StdAttr.WIDTH);<NEW_LINE>ps[IN] = new Port(0, 30, Port.INPUT, StdAttr.WIDTH);<NEW_LINE>ps[CK] = new Port(0, 70, Port.INPUT, 1);<NEW_LINE>ps[CLR] = new Port(30, <MASK><NEW_LINE>ps[EN] = new Port(0, 50, Port.INPUT, 1);<NEW_LINE>}<NEW_LINE>ps[OUT].setToolTip(S.getter("registerQTip"));<NEW_LINE>ps[IN].setToolTip(S.getter("registerDTip"));<NEW_LINE>ps[CK].setToolTip(S.getter("registerClkTip"));<NEW_LINE>ps[CLR].setToolTip(S.getter("registerClrTip"));<NEW_LINE>ps[EN].setToolTip(S.getter("registerEnableTip"));<NEW_LINE>instance.setPorts(ps);<NEW_LINE>}
90, Port.INPUT, 1);
937,817
public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {<NEW_LINE>com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(this.getUnknownFields());<NEW_LINE>while (true) {<NEW_LINE>int tag = input.readTag();<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>this.setUnknownFields(unknownFields.build());<NEW_LINE>return this;<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {<NEW_LINE>this.<MASK><NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 8:<NEW_LINE>{<NEW_LINE>addFilterNodeIds(input.readInt32());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 10:<NEW_LINE>{<NEW_LINE>int length = input.readRawVarint32();<NEW_LINE>int limit = input.pushLimit(length);<NEW_LINE>while (input.getBytesUntilLimit() > 0) {<NEW_LINE>addFilterNodeIds(input.readInt32());<NEW_LINE>}<NEW_LINE>input.popLimit(limit);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 16:<NEW_LINE>{<NEW_LINE>setFilterZoneId(input.readInt32());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 26:<NEW_LINE>{<NEW_LINE>addFilterStoreNames(input.readString());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setUnknownFields(unknownFields.build());
1,306,732
protected MapillaryDataLoadResult doInBackground(Integer... radius) {<NEW_LINE>progressHandler.post(progressRunnable);<NEW_LINE>try {<NEW_LINE>// ensure loading visualisation<NEW_LINE>Thread.sleep(2500);<NEW_LINE>} catch (InterruptedException exception) {<NEW_LINE>exception.printStackTrace();<NEW_LINE>}<NEW_LINE>OkHttpClient okHttpClient = new OkHttpClient();<NEW_LINE>try {<NEW_LINE>Point poiPosition = (Point) feature.geometry();<NEW_LINE>@SuppressLint("DefaultLocale")<NEW_LINE>Request request = new Request.Builder().url(String.format(API_URL, poiPosition.longitude(), poiPosition.latitude(), poiPosition.longitude(), poiPosition.latitude(), radius[0])).build();<NEW_LINE>Response response = okHttpClient.newCall(request).execute();<NEW_LINE>FeatureCollection featureCollection = FeatureCollection.fromJson(response.<MASK><NEW_LINE>MapillaryDataLoadResult mapillaryDataLoadResult = new MapillaryDataLoadResult(featureCollection);<NEW_LINE>for (Feature feature : featureCollection.features()) {<NEW_LINE>String imageId = feature.getStringProperty(KEY_UNIQUE_FEATURE);<NEW_LINE>String imageUrl = String.format(URL_IMAGE_PLACEHOLDER, imageId);<NEW_LINE>Bitmap bitmap = picasso.load(imageUrl).resize(IMAGE_SIZE, IMAGE_SIZE).get();<NEW_LINE>// cropping bitmap to be circular<NEW_LINE>bitmap = getCroppedBitmap(bitmap);<NEW_LINE>mapillaryDataLoadResult.add(feature, bitmap);<NEW_LINE>}<NEW_LINE>return mapillaryDataLoadResult;<NEW_LINE>} catch (Exception exception) {<NEW_LINE>Timber.e(exception);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
body().string());
254,338
private Query toMultiPhrasePrefix(final Query query, int phraseSlop, int maxExpansions) {<NEW_LINE>float boost = 1;<NEW_LINE>Query innerQuery = query;<NEW_LINE>while (innerQuery instanceof BoostQuery) {<NEW_LINE>BoostQuery bq = (BoostQuery) innerQuery;<NEW_LINE>boost *= bq.getBoost();<NEW_LINE>innerQuery = bq.getQuery();<NEW_LINE>}<NEW_LINE>if (query instanceof SpanQuery) {<NEW_LINE>return toSpanQueryPrefix((SpanQuery) query, boost);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>prefixQuery.setMaxExpansions(maxExpansions);<NEW_LINE>prefixQuery.setSlop(phraseSlop);<NEW_LINE>if (innerQuery instanceof PhraseQuery) {<NEW_LINE>PhraseQuery pq = (PhraseQuery) innerQuery;<NEW_LINE>Term[] terms = pq.getTerms();<NEW_LINE>int[] positions = pq.getPositions();<NEW_LINE>for (int i = 0; i < terms.length; i++) {<NEW_LINE>prefixQuery.add(new Term[] { terms[i] }, positions[i]);<NEW_LINE>}<NEW_LINE>return boost == 1 ? prefixQuery : new BoostQuery(prefixQuery, boost);<NEW_LINE>} else if (innerQuery instanceof MultiPhraseQuery) {<NEW_LINE>MultiPhraseQuery pq = (MultiPhraseQuery) innerQuery;<NEW_LINE>Term[][] terms = pq.getTermArrays();<NEW_LINE>int[] positions = pq.getPositions();<NEW_LINE>for (int i = 0; i < terms.length; i++) {<NEW_LINE>prefixQuery.add(terms[i], positions[i]);<NEW_LINE>}<NEW_LINE>return boost == 1 ? prefixQuery : new BoostQuery(prefixQuery, boost);<NEW_LINE>} else if (innerQuery instanceof TermQuery) {<NEW_LINE>prefixQuery.add(((TermQuery) innerQuery).getTerm());<NEW_LINE>return boost == 1 ? prefixQuery : new BoostQuery(prefixQuery, boost);<NEW_LINE>}<NEW_LINE>return query;<NEW_LINE>}
final MultiPhrasePrefixQuery prefixQuery = new MultiPhrasePrefixQuery();
19,584
private Mono<PagedResponse<SqlServerInstanceInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
472,529
public void paint(Graphics g) {<NEW_LINE>Label target = (Label) _target;<NEW_LINE>Dimension sz = target.getSize();<NEW_LINE>g.setColor(target.getBackground());<NEW_LINE>g.fillRect(0, 0, sz.width, sz.height);<NEW_LINE>String label = target.getText();<NEW_LINE>if (label == null)<NEW_LINE>return;<NEW_LINE>g.setFont(target.getFont());<NEW_LINE>FontMetrics fm = g.getFontMetrics();<NEW_LINE>int w = fm.stringWidth(label), h = fm.getHeight() - fm.getDescent(), x = 0, y = (sz.height - h) / 2 + h - 2, alignment = target.getAlignment();<NEW_LINE>if (alignment == Label.RIGHT)<NEW_LINE>x = sz.width - w;<NEW_LINE>else if (alignment == Label.CENTER)<NEW_LINE>x = (sz.width - w) / 2;<NEW_LINE>if (target.isEnabled()) {<NEW_LINE>g.setColor(target.getForeground());<NEW_LINE>} else {<NEW_LINE>g.setColor(SystemColor.controlLtHighlight);<NEW_LINE>g.drawString(label, x + 1, y + 1);<NEW_LINE>g.setColor(SystemColor.controlShadow);<NEW_LINE>}<NEW_LINE>g.<MASK><NEW_LINE>}
drawString(label, x, y);
48,074
private static // F743-506<NEW_LINE>Class<?> loadCustomerProvidedBeanClass(BeanMetaData bmd) throws ContainerException, EJBConfigurationException {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(<MASK><NEW_LINE>// enterpriseBeanClass will be null only if loadCustomerProvidedBeanClass<NEW_LINE>// is called prior to loadCustomerProvidedClasses. For example, from<NEW_LINE>// processAutomaticTimerMetaData via processBean if deferred init.<NEW_LINE>if (bmd.enterpriseBeanClass == null) {<NEW_LINE>try {<NEW_LINE>bmd.enterpriseBeanClass = bmd.classLoader.loadClass(bmd.enterpriseBeanClassName);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>FFDCFilter.processException(ex, CLASS_NAME + ".loadCustomerProvidedBeanClass", "6369");<NEW_LINE>Tr.error(tc, "BEANCLASS_NOT_FOUND_CNTR0075E", bmd.enterpriseBeanClassName);<NEW_LINE>String message = "Bean class " + bmd.enterpriseBeanClassName + " could not be found or loaded";<NEW_LINE>if (ex instanceof ClassNotFoundException || ex instanceof LinkageError)<NEW_LINE>throw new EJBConfigurationException(message, ex);<NEW_LINE>throw new ContainerException(message, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "loadCustomerProvidedBeanClass");<NEW_LINE>return bmd.enterpriseBeanClass;<NEW_LINE>}
tc, "loadCustomerProvidedBeanClass : " + bmd.enterpriseBeanClassName);
1,547,128
public static boolean hasBlocks(ItemStack stack, Player player, List<BlockPos> blocks) {<NEW_LINE>if (player.getAbilities().instabuild) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Block block = getBlock(stack);<NEW_LINE>ItemStack reqStack = new ItemStack(block);<NEW_LINE><MASK><NEW_LINE>int current = 0;<NEW_LINE>List<IBlockProvider> providersToCheck = new ArrayList<>();<NEW_LINE>for (int i = 0; i < player.getInventory().getContainerSize(); i++) {<NEW_LINE>ItemStack stackInSlot = player.getInventory().getItem(i);<NEW_LINE>if (!stackInSlot.isEmpty() && stackInSlot.is(reqStack.getItem())) {<NEW_LINE>current += stackInSlot.getCount();<NEW_LINE>if (current >= required) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!stackInSlot.isEmpty()) {<NEW_LINE>var provider = IXplatAbstractions.INSTANCE.findBlockProvider(stackInSlot);<NEW_LINE>if (provider != null) {<NEW_LINE>providersToCheck.add(provider);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (IBlockProvider prov : providersToCheck) {<NEW_LINE>int count = prov.getBlockCount(player, stack, block);<NEW_LINE>if (count == -1) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>current += count;<NEW_LINE>if (current >= required) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
int required = blocks.size();
991,790
private Completable logToImpressionStore() {<NEW_LINE>String campaignId = inAppMessage.getCampaignMetadata().getCampaignId();<NEW_LINE><MASK><NEW_LINE>Completable storeCampaignImpression = impressionStorageClient.storeImpression(CampaignImpression.newBuilder().setImpressionTimestampMillis(clock.now()).setCampaignId(campaignId).build()).doOnError(e -> Logging.loge("Impression store write failure")).doOnComplete(() -> Logging.logd("Impression store write success"));<NEW_LINE>if (InAppMessageStreamManager.isAppForegroundEvent(triggeringEvent)) {<NEW_LINE>Completable incrementAppForegroundRateLimit = // Absorb rate limiter write errors<NEW_LINE>rateLimiterClient.increment(appForegroundRateLimit).doOnError(e -> Logging.loge("Rate limiter client write failure")).doOnComplete(() -> Logging.logd("Rate limiter client write success")).onErrorComplete();<NEW_LINE>return incrementAppForegroundRateLimit.andThen(storeCampaignImpression);<NEW_LINE>}<NEW_LINE>return storeCampaignImpression;<NEW_LINE>}
Logging.logd("Attempting to record message impression in impression store for id: " + campaignId);
1,277,252
public void connect() {<NEW_LINE>final <MASK><NEW_LINE>final ElasticSearchBuilder cb = ElasticSearch.builder().endpoints(clusterNodes.split(",")).protocol(protocol).connectTimeout(connectTimeout).responseTimeout(responseTimeout).socketTimeout(socketTimeout).numHttpClientThread(numHttpClientThread).healthyListener(healthy -> {<NEW_LINE>if (healthy) {<NEW_LINE>healthChecker.health();<NEW_LINE>} else {<NEW_LINE>healthChecker.unHealth("No healthy endpoint");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!Strings.isNullOrEmpty(trustStorePath)) {<NEW_LINE>cb.trustStorePath(trustStorePath);<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(trustStorePass)) {<NEW_LINE>cb.trustStorePass(trustStorePass);<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(user)) {<NEW_LINE>cb.username(user);<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(password)) {<NEW_LINE>cb.password(password);<NEW_LINE>}<NEW_LINE>final ElasticSearch newOne = cb.build();<NEW_LINE>// Only swap the old / new after the new one established a new connection.<NEW_LINE>final CompletableFuture<ElasticSearchVersion> f = newOne.connect();<NEW_LINE>f.whenComplete((ignored, exception) -> {<NEW_LINE>if (exception != null) {<NEW_LINE>log.error("Failed to recreate ElasticSearch client based on config", exception);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (es.compareAndSet(oldOne, newOne)) {<NEW_LINE>oldOne.close();<NEW_LINE>} else {<NEW_LINE>newOne.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>f.join();<NEW_LINE>}
ElasticSearch oldOne = es.get();
1,844,053
final ListArtifactsResult executeListArtifacts(ListArtifactsRequest listArtifactsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listArtifactsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListArtifactsRequest> request = null;<NEW_LINE>Response<ListArtifactsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListArtifactsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listArtifactsRequest));<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, "ListArtifacts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListArtifactsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListArtifactsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,504,888
private boolean loadNextSkip(int level) throws IOException {<NEW_LINE>// we have to skip, the target document is greater than the current<NEW_LINE>// skip list entry<NEW_LINE>setLastSkipData(level);<NEW_LINE>numSkipped[level] += skipInterval[level];<NEW_LINE>// numSkipped may overflow a signed int, so compare as unsigned.<NEW_LINE>if (Integer.compareUnsigned(numSkipped[level], docCount) > 0) {<NEW_LINE>// this skip list is exhausted<NEW_LINE>skipDoc[level] = Integer.MAX_VALUE;<NEW_LINE>if (numberOfSkipLevels > level)<NEW_LINE>numberOfSkipLevels = level;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// read next skip entry<NEW_LINE>skipDoc[level] += readSkipData<MASK><NEW_LINE>if (level != 0) {<NEW_LINE>// read the child pointer if we are not on the leaf level<NEW_LINE>childPointer[level] = readChildPointer(skipStream[level]) + skipPointer[level - 1];<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(level, skipStream[level]);
665,468
protected void onLayout(final boolean changed, final int l, final int t, final int r, final int b) {<NEW_LINE>super.onLayout(changed, l, t, r, b);<NEW_LINE>if (this.config != null && this.config.getSignInUserPoolsEnabled()) {<NEW_LINE>if (userPoolsSignInView != null) {<NEW_LINE>View view = (View) userPoolsSignInView;<NEW_LINE>Object formViewObject = invokeGetCredentialsFormView(USER_POOL_SIGN_IN_VIEW, userPoolsSignInView, USER_POOL_SIGN_IN_IMPORT);<NEW_LINE>final int measuredHeight = ((View) formViewObject).getMeasuredHeight();<NEW_LINE>final int splitPoint = view.getTop<MASK><NEW_LINE>splitBackgroundDrawable.setSplitPointDistanceFromTop(splitPoint);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final int splitPoint = imageView.getTop() + imageView.getMeasuredHeight();<NEW_LINE>splitBackgroundDrawable.setSplitPointDistanceFromTop(splitPoint);<NEW_LINE>}<NEW_LINE>}
() + (measuredHeight / 2);
935,226
public static ListQueryHistoryResponse unmarshall(ListQueryHistoryResponse listQueryHistoryResponse, UnmarshallerContext _ctx) {<NEW_LINE>listQueryHistoryResponse.setRequestId(_ctx.stringValue("ListQueryHistoryResponse.RequestId"));<NEW_LINE>listQueryHistoryResponse.setSuccess(_ctx.booleanValue("ListQueryHistoryResponse.Success"));<NEW_LINE>listQueryHistoryResponse.setTotalCount(_ctx.integerValue("ListQueryHistoryResponse.TotalCount"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListQueryHistoryResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setSql(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].Sql"));<NEW_LINE>dataItem.setJobCompleted(_ctx.booleanValue("ListQueryHistoryResponse.Data[" + i + "].JobCompleted"));<NEW_LINE>dataItem.setProgress(_ctx.integerValue("ListQueryHistoryResponse.Data[" + i + "].Progress"));<NEW_LINE>dataItem.setStartTime(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].StartTime"));<NEW_LINE>dataItem.setEndTime(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].EndTime"));<NEW_LINE>dataItem.setDuration(_ctx.longValue("ListQueryHistoryResponse.Data[" + i + "].Duration"));<NEW_LINE>dataItem.setRowCount(_ctx.integerValue("ListQueryHistoryResponse.Data[" + i + "].RowCount"));<NEW_LINE>dataItem.setGmtCreate(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].GmtCreate"));<NEW_LINE>dataItem.setGmtModified(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].GmtModified"));<NEW_LINE>dataItem.setId(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].Id"));<NEW_LINE>dataItem.setResultTmpTable(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].ResultTmpTable"));<NEW_LINE>dataItem.setOwner(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].Owner"));<NEW_LINE>dataItem.setRegionId(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].RegionId"));<NEW_LINE>dataItem.setResultTmpDb(_ctx.stringValue<MASK><NEW_LINE>dataItem.setStatus(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].Status"));<NEW_LINE>dataItem.setSuccess(_ctx.booleanValue("ListQueryHistoryResponse.Data[" + i + "].Success"));<NEW_LINE>dataItem.setErrorMessage(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].ErrorMessage"));<NEW_LINE>dataItem.setCreator(_ctx.longValue("ListQueryHistoryResponse.Data[" + i + "].Creator"));<NEW_LINE>dataItem.setCreatorLoginName(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].CreatorLoginName"));<NEW_LINE>dataItem.setRowCountOverLimit(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].RowCountOverLimit"));<NEW_LINE>dataItem.setResultOssPath(_ctx.stringValue("ListQueryHistoryResponse.Data[" + i + "].ResultOssPath"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listQueryHistoryResponse.setData(data);<NEW_LINE>return listQueryHistoryResponse;<NEW_LINE>}
("ListQueryHistoryResponse.Data[" + i + "].ResultTmpDb"));
1,446,266
public void run() {<NEW_LINE>final JobExecutorContext jobExecutorContext = new JobExecutorContext();<NEW_LINE>final List<String> currentProcessorJobQueue = jobExecutorContext.getCurrentProcessorJobQueue();<NEW_LINE>ProcessEngineConfigurationImpl engineConfiguration = processEngine.getProcessEngineConfiguration();<NEW_LINE><MASK><NEW_LINE>currentProcessorJobQueue.addAll(jobIds);<NEW_LINE>Context.setJobExecutorContext(jobExecutorContext);<NEW_LINE>ClassLoader classLoaderBeforeExecution = switchClassLoader();<NEW_LINE>try {<NEW_LINE>while (!currentProcessorJobQueue.isEmpty()) {<NEW_LINE>String nextJobId = currentProcessorJobQueue.remove(0);<NEW_LINE>if (jobExecutor.isActive()) {<NEW_LINE>JobFailureCollector jobFailureCollector = new JobFailureCollector(nextJobId);<NEW_LINE>try {<NEW_LINE>executeJob(nextJobId, commandExecutor, jobFailureCollector);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (ProcessEngineLogger.shouldLogJobException(engineConfiguration, jobFailureCollector.getJob())) {<NEW_LINE>ExecuteJobHelper.LOGGING_HANDLER.exceptionWhileExecutingJob(nextJobId, t);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>new ProcessDataContext(engineConfiguration).clearMdc();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>unlockJob(nextJobId, commandExecutor);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.exceptionWhileUnlockingJob(nextJobId, t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if there were only exclusive jobs then the job executor<NEW_LINE>// does a backoff. In order to avoid too much waiting time<NEW_LINE>// we need to tell him to check once more if there were any jobs added.<NEW_LINE>jobExecutor.jobWasAdded();<NEW_LINE>} finally {<NEW_LINE>Context.removeJobExecutorContext();<NEW_LINE>ClassLoaderUtil.setContextClassloader(classLoaderBeforeExecution);<NEW_LINE>}<NEW_LINE>}
CommandExecutor commandExecutor = engineConfiguration.getCommandExecutorTxRequired();
371,586
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {<NEW_LINE>Map<String, Map<String, PropertyMapping>> <MASK><NEW_LINE>Map<String, PropertyMapping> map = new HashMap<>();<NEW_LINE>val broadcast = PropertyMapping.builder().onnxAttrName("indices").tfInputPosition(1).propertyNames(new String[] { "indices" }).build();<NEW_LINE>map.put("indices", broadcast);<NEW_LINE>ret.put(tensorflowNames()[0], map);<NEW_LINE>ret.put(onnxName(), map);<NEW_LINE>Map<String, PropertyMapping> map2 = new HashMap<>();<NEW_LINE>val broadcast2 = PropertyMapping.builder().tfInputPosition(1).propertyNames(new String[] { "indices" }).build();<NEW_LINE>map2.put("indices", broadcast2);<NEW_LINE>val axis2 = PropertyMapping.builder().tfInputPosition(2).propertyNames(new String[] { "axis" }).build();<NEW_LINE>map2.put("axis", axis2);<NEW_LINE>ret.put("GatherV2", map2);<NEW_LINE>return ret;<NEW_LINE>}
ret = new HashMap<>();
226,713
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {<NEW_LINE>// Info packets<NEW_LINE>session.send(new PacketServerTimeNotify());<NEW_LINE>session.send(new PacketWorldPlayerInfoNotify(session.getPlayer<MASK><NEW_LINE>session.send(new PacketWorldDataNotify(session.getPlayer().getWorld()));<NEW_LINE>session.send(new PacketSceneUnlockInfoNotify());<NEW_LINE>session.send(new GenshinPacket(PacketOpcodes.SceneForceUnlockNotify));<NEW_LINE>session.send(new PacketHostPlayerNotify(session.getPlayer().getWorld()));<NEW_LINE>session.send(new PacketSceneTimeNotify(session.getPlayer()));<NEW_LINE>session.send(new PacketPlayerGameTimeNotify(session.getPlayer()));<NEW_LINE>session.send(new PacketPlayerEnterSceneInfoNotify(session.getPlayer()));<NEW_LINE>session.send(new PacketSceneAreaWeatherNotify(session.getPlayer()));<NEW_LINE>session.send(new PacketScenePlayerInfoNotify(session.getPlayer().getWorld()));<NEW_LINE>session.send(new PacketSceneTeamUpdateNotify(session.getPlayer()));<NEW_LINE>session.send(new PacketSyncTeamEntityNotify(session.getPlayer()));<NEW_LINE>session.send(new PacketSyncScenePlayTeamEntityNotify(session.getPlayer()));<NEW_LINE>// Done Packet<NEW_LINE>session.send(new PacketSceneInitFinishRsp(session.getPlayer()));<NEW_LINE>// Set state<NEW_LINE>session.getPlayer().setSceneLoadState(SceneLoadState.INIT);<NEW_LINE>}
().getWorld()));
564,244
public Map<String, Object> createParameterMap(NdbOpenJPADomainFieldHandlerImpl domainFieldHandler, QueryDomainType<?> queryDomainObject, Object oid) {<NEW_LINE>Map<String, Object> result = new HashMap<String, Object>();<NEW_LINE>Predicate predicate = null;<NEW_LINE>for (AbstractDomainFieldHandlerImpl localHandler : domainFieldHandler.compositeDomainFieldHandlers) {<NEW_LINE>String name = localHandler.getColumnName();<NEW_LINE>PredicateOperand parameter = queryDomainObject.param(name);<NEW_LINE>PredicateOperand field = queryDomainObject.get(name);<NEW_LINE>if (predicate == null) {<NEW_LINE>predicate = field.equal(parameter);<NEW_LINE>} else {<NEW_LINE>predicate.and(field.equal(parameter));<NEW_LINE>}<NEW_LINE>// construct a map of parameter binding to the value in oid<NEW_LINE>Object value = domainFieldHandler.getKeyValue(oid);<NEW_LINE>result.put(name, value);<NEW_LINE>if (logger.isDetailEnabled())<NEW_LINE>logger.detail(<MASK><NEW_LINE>}<NEW_LINE>queryDomainObject.where(predicate);<NEW_LINE>return result;<NEW_LINE>}
"Map.Entry key: " + name + ", value: " + value);
399,500
public static void convert(InterleavedF32 input, InterleavedS64 output) {<NEW_LINE>if (input.isSubimage() || output.isSubimage()) {<NEW_LINE>final int N = input.width * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexSrc = input.getIndex(0, y);<NEW_LINE>int indexDst = output.getIndex(0, y);<NEW_LINE>for (int x = 0; x < N; x++) {<NEW_LINE>output.data[indexDst++] = (long) (input.data[indexSrc++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>final int N = input.width * input.height * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,N,(i0,i1)->{<NEW_LINE><MASK><NEW_LINE>for (int i = i0; i < i1; i++) {<NEW_LINE>output.data[i] = (long) (input.data[i]);<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}<NEW_LINE>}
int i0 = 0, i1 = N;
1,454,258
static // loads the curve settings CSV file<NEW_LINE>Map<CurveName, LoadedCurveSettings> parseCurveSettings(CharSource settingsResource) {<NEW_LINE>ImmutableMap.Builder<CurveName, LoadedCurveSettings> builder = ImmutableMap.builder();<NEW_LINE>CsvFile csv = CsvFile.of(settingsResource, true);<NEW_LINE>for (CsvRow row : csv.rows()) {<NEW_LINE>String curveNameStr = row.getField(SETTINGS_CURVE_NAME);<NEW_LINE>String valueTypeStr = row.getField(SETTINGS_VALUE_TYPE);<NEW_LINE>String dayCountStr = row.getField(SETTINGS_DAY_COUNT);<NEW_LINE>String interpolatorStr = row.getField(SETTINGS_INTERPOLATOR);<NEW_LINE>String leftExtrapolatorStr = row.getField(SETTINGS_LEFT_EXTRAPOLATOR);<NEW_LINE>String <MASK><NEW_LINE>if (!VALUE_TYPE_MAP.containsKey(valueTypeStr.toLowerCase(Locale.ENGLISH))) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("Unsupported {} in curve settings: {}", SETTINGS_VALUE_TYPE, valueTypeStr));<NEW_LINE>}<NEW_LINE>CurveName curveName = CurveName.of(curveNameStr);<NEW_LINE>ValueType yValueType = VALUE_TYPE_MAP.get(valueTypeStr.toLowerCase(Locale.ENGLISH));<NEW_LINE>CurveInterpolator interpolator = CurveInterpolator.of(interpolatorStr);<NEW_LINE>CurveExtrapolator leftExtrap = CurveExtrapolator.of(leftExtrapolatorStr);<NEW_LINE>CurveExtrapolator rightExtrap = CurveExtrapolator.of(rightExtrapolatorStr);<NEW_LINE>boolean isPriceIndex = yValueType.equals(ValueType.PRICE_INDEX);<NEW_LINE>ValueType xValueType = isPriceIndex ? ValueType.MONTHS : ValueType.YEAR_FRACTION;<NEW_LINE>DayCount dayCount = isPriceIndex ? ONE_ONE : LoaderUtils.parseDayCount(dayCountStr);<NEW_LINE>LoadedCurveSettings settings = LoadedCurveSettings.of(curveName, xValueType, yValueType, dayCount, interpolator, leftExtrap, rightExtrap);<NEW_LINE>builder.put(curveName, settings);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
rightExtrapolatorStr = row.getField(SETTINGS_RIGHT_EXTRAPOLATOR);
1,385,781
private static ValueMatcher makeDictionaryEncodedValueMatcherGeneric(final DimensionSelector selector, Predicate<String> predicate) {<NEW_LINE>final BitSet checkedIds = new BitSet(selector.getValueCardinality());<NEW_LINE>final BitSet matchingIds = new <MASK><NEW_LINE>final boolean matchNull = predicate.apply(null);<NEW_LINE>// Lazy matcher; only check an id if matches() is called.<NEW_LINE>return new ValueMatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean matches() {<NEW_LINE>final IndexedInts row = selector.getRow();<NEW_LINE>final int size = row.size();<NEW_LINE>if (size == 0) {<NEW_LINE>// null should match empty rows in multi-value columns<NEW_LINE>return matchNull;<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>final int id = row.get(i);<NEW_LINE>final boolean matches;<NEW_LINE>if (checkedIds.get(id)) {<NEW_LINE>matches = matchingIds.get(id);<NEW_LINE>} else {<NEW_LINE>matches = predicate.apply(selector.lookupName(id));<NEW_LINE>checkedIds.set(id);<NEW_LINE>if (matches) {<NEW_LINE>matchingIds.set(id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matches) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void inspectRuntimeShape(RuntimeShapeInspector inspector) {<NEW_LINE>inspector.visit("selector", selector);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
BitSet(selector.getValueCardinality());
102,215
public DescribeReservedDBInstancesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeReservedDBInstancesResult describeReservedDBInstancesResult = new DescribeReservedDBInstancesResult();<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><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeReservedDBInstancesResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Marker", targetDepth)) {<NEW_LINE>describeReservedDBInstancesResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReservedDBInstances", targetDepth)) {<NEW_LINE>describeReservedDBInstancesResult.withReservedDBInstances(new ArrayList<ReservedDBInstance>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReservedDBInstances/ReservedDBInstance", targetDepth)) {<NEW_LINE>describeReservedDBInstancesResult.withReservedDBInstances(ReservedDBInstanceStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeReservedDBInstancesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
50,707
public void endVisit(JMethodCall x, Context ctx) {<NEW_LINE>// Don't do anything if the method binding isn't statically known<NEW_LINE>if (!x.getTarget().isStatic()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JMethod method = x.getTarget();<NEW_LINE>JMethod.Specialization specialization = method.getSpecialization();<NEW_LINE>if (specialization == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<JType<MASK><NEW_LINE>if (params.size() == x.getArgs().size()) {<NEW_LINE>for (int i = 0; i < params.size(); i++) {<NEW_LINE>JType argType = x.getArgs().get(i).getType().getUnderlyingType();<NEW_LINE>if (argType.isNullType()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// see if the args passed to the function can be cast to the<NEW_LINE>// specialization pattern<NEW_LINE>JType qType = params.get(i).getUnderlyingType();<NEW_LINE>if (!program.typeOracle.castSucceedsTrivially(argType, qType)) {<NEW_LINE>// params don't match<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JMethod targetMethod = specialization.getTargetMethod();<NEW_LINE>if (targetMethod != null) {<NEW_LINE>JMethodCall call = new JMethodCall(x.getSourceInfo(), x.getInstance(), targetMethod);<NEW_LINE>call.addArgs(x.getArgs());<NEW_LINE>ctx.replaceMe(call);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> params = specialization.getParams();
859,350
private void append(int line, @Nonnull TextRange range) {<NEW_LINE>LOG.debug("DiffFragmentBuilder.append(" + line + "," + range + "), modified:");<NEW_LINE>DiffString text1 = null;<NEW_LINE>DiffString text2 = null;<NEW_LINE>int start = range.getStartOffset();<NEW_LINE>int end = range.getEndOffset();<NEW_LINE>if (myLastLine1 <= line) {<NEW_LINE>text1 = concatenate(mySource1, myLastLine1, line);<NEW_LINE>}<NEW_LINE>if (myLastLine2 < start) {<NEW_LINE>text2 = concatenate(mySource2, myLastLine2, start - 1);<NEW_LINE>}<NEW_LINE>if (text1 != null || text2 != null) {<NEW_LINE>myData.add(DiffFragment<MASK><NEW_LINE>}<NEW_LINE>myData.add(new DiffFragment(null, concatenate(mySource2, start, end)));<NEW_LINE>myLastLine1 = line + 1;<NEW_LINE>myLastLine2 = end + 1;<NEW_LINE>}
.unchanged(text1, text2));
1,635,647
public void performRecoverableFileDelete(String path) throws PlatformManagerException {<NEW_LINE>File file = new File(path);<NEW_LINE>if (!file.exists()) {<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Cannot find " + file.getName()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class<?> claFileManager = getFileManagerClass();<NEW_LINE>if (claFileManager != null) {<NEW_LINE>Method methMoveToTrash = claFileManager.getMethod("moveToTrash", new Class[] { File.class });<NEW_LINE>if (methMoveToTrash != null) {<NEW_LINE>Object result = methMoveToTrash.invoke(null, <MASK><NEW_LINE>if (result instanceof Boolean) {<NEW_LINE>if (((Boolean) result).booleanValue()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>boolean useOSA = !NativeInvocationBridge.sharedInstance().isEnabled() || !NativeInvocationBridge.sharedInstance().performRecoverableFileDelete(file);<NEW_LINE>if (useOSA) {<NEW_LINE>try {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("tell application \"");<NEW_LINE>sb.append("Finder");<NEW_LINE>sb.append("\" to move (posix file \"");<NEW_LINE>sb.append(path);<NEW_LINE>sb.append("\" as alias) to the trash");<NEW_LINE>performOSAScript(sb);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new PlatformManagerException("Failed to move file", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new Object[] { file });
404,473
private Mono<Response<PolicyCollectionInner>> listByProductWithResponseAsync(String resourceGroupName, String serviceName, String productId, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (productId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByProduct(this.client.getEndpoint(), resourceGroupName, serviceName, productId, this.client.getApiVersion(), this.client.<MASK><NEW_LINE>}
getSubscriptionId(), accept, context);
884,622
private static io.vertx.core.cli.Option createOption(Method method) {<NEW_LINE>TypedOption opt = new TypedOption();<NEW_LINE>// Option<NEW_LINE>Option option = method.getAnnotation(Option.class);<NEW_LINE>opt.setLongName(option.longName()).setShortName(option.shortName()).setMultiValued(option.acceptMultipleValues()).setSingleValued(option.acceptValue()).setArgName(option.argName()).setFlag(option.flag()).setHelp(option.help()).setRequired(option.required());<NEW_LINE>// Description<NEW_LINE>Description description = <MASK><NEW_LINE>if (description != null) {<NEW_LINE>opt.setDescription(description.value());<NEW_LINE>}<NEW_LINE>Hidden hidden = method.getAnnotation(Hidden.class);<NEW_LINE>if (hidden != null) {<NEW_LINE>opt.setHidden(true);<NEW_LINE>}<NEW_LINE>if (ReflectionUtils.isMultiple(method)) {<NEW_LINE>opt.setType(ReflectionUtils.getComponentType(method.getParameters()[0])).setMultiValued(true);<NEW_LINE>} else {<NEW_LINE>final Class<?> type = method.getParameters()[0].getType();<NEW_LINE>opt.setType(type);<NEW_LINE>if (type != Boolean.TYPE && type != Boolean.class) {<NEW_LINE>// In the case of a boolean, it may be a flag, need explicit settings.<NEW_LINE>opt.setSingleValued(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConvertedBy convertedBy = method.getAnnotation(ConvertedBy.class);<NEW_LINE>if (convertedBy != null) {<NEW_LINE>opt.setConverter(ReflectionUtils.newInstance(convertedBy.value()));<NEW_LINE>}<NEW_LINE>ParsedAsList parsedAsList = method.getAnnotation(ParsedAsList.class);<NEW_LINE>if (parsedAsList != null) {<NEW_LINE>opt.setParsedAsList(true).setListSeparator(parsedAsList.separator());<NEW_LINE>}<NEW_LINE>// Default value<NEW_LINE>DefaultValue defaultValue = method.getAnnotation(DefaultValue.class);<NEW_LINE>if (defaultValue != null) {<NEW_LINE>opt.setDefaultValue(defaultValue.value());<NEW_LINE>}<NEW_LINE>opt.ensureValidity();<NEW_LINE>return opt;<NEW_LINE>}
method.getAnnotation(Description.class);
710,684
final GetMultiRegionAccessPointPolicyResult executeGetMultiRegionAccessPointPolicy(GetMultiRegionAccessPointPolicyRequest getMultiRegionAccessPointPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMultiRegionAccessPointPolicyRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMultiRegionAccessPointPolicyRequest> request = null;<NEW_LINE>Response<GetMultiRegionAccessPointPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMultiRegionAccessPointPolicyRequestMarshaller().marshall(super.beforeMarshalling(getMultiRegionAccessPointPolicyRequest));<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, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMultiRegionAccessPointPolicy");<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>ValidationUtils.assertStringNotEmpty(getMultiRegionAccessPointPolicyRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(getMultiRegionAccessPointPolicyRequest.getAccountId(), "AccountId", "getMultiRegionAccessPointPolicyRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", getMultiRegionAccessPointPolicyRequest.getAccountId());<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetMultiRegionAccessPointPolicyResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<GetMultiRegionAccessPointPolicyResult>(new GetMultiRegionAccessPointPolicyResultStaxUnmarshaller());<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>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
243,317
/*<NEW_LINE>* This method will build the initial environment variable context as well as add the environment related variables.<NEW_LINE>* It will also resolve secrets, if any wrt environment config<NEW_LINE>*/<NEW_LINE>EnvironmentVariableContext buildEnvVarContext(String pipelineName) {<NEW_LINE>String pipelineGroupName = goConfigService.findGroupNameByPipeline(new CaseInsensitiveString(pipelineName));<NEW_LINE>EnvironmentVariableContext environmentVariableContext <MASK><NEW_LINE>EnvironmentConfig environmentForPipeline = environmentConfigService.environmentForPipeline(pipelineName);<NEW_LINE>if (environmentForPipeline == null) {<NEW_LINE>return environmentVariableContext;<NEW_LINE>}<NEW_LINE>secretParamResolver.resolve(environmentForPipeline);<NEW_LINE>environmentVariableContext.setProperty(GO_ENVIRONMENT_NAME, CaseInsensitiveString.str(environmentForPipeline.name()), false);<NEW_LINE>environmentForPipeline.getVariables().forEach(variable -> {<NEW_LINE>environmentVariableContext.setProperty(variable.getName(), variable.valueForCommandline(), variable.isSecure() || variable.hasSecretParams());<NEW_LINE>});<NEW_LINE>return environmentVariableContext;<NEW_LINE>}
= new EnvironmentVariableContext(GO_PIPELINE_GROUP_NAME, pipelineGroupName);
1,060,989
public void run() {<NEW_LINE>// transform the reference container into a stream of parsed entries<NEW_LINE>final BlockingQueue<WordReferenceVars> vars = WordReferenceVars.transform(this.container, this.maxtime, this.local);<NEW_LINE>// start the transformation threads<NEW_LINE>final Semaphore termination = new Semaphore(this.threads);<NEW_LINE>final NormalizeWorker[] worker = new NormalizeWorker[this.threads];<NEW_LINE>for (int i = 0; i < this.threads; i++) {<NEW_LINE>worker[i] = new NormalizeWorker(this.out, termination, this.maxtime);<NEW_LINE>worker[i].start();<NEW_LINE>}<NEW_LINE>// fill the queue<NEW_LINE>WordReferenceVars iEntry;<NEW_LINE>int p = 0;<NEW_LINE>long timeout = this.maxtime == Long.MAX_VALUE ? Long.MAX_VALUE : System.currentTimeMillis() + this.maxtime;<NEW_LINE>try {<NEW_LINE>while ((iEntry = vars.take()) != WordReferenceVars.poison) {<NEW_LINE>worker[p % this.threads].add(iEntry);<NEW_LINE>p++;<NEW_LINE>if (System.currentTimeMillis() > timeout) {<NEW_LINE>ConcurrentLog.warn(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>}<NEW_LINE>// insert poison to stop the queues<NEW_LINE>for (int i = 0; i < this.threads; i++) worker[i].add(WordReferenceVars.poison);<NEW_LINE>// wait for termination but not too long to make it possible that this<NEW_LINE>// is called from outside with a join to get some normalization results<NEW_LINE>// before going on<NEW_LINE>for (int i = 0; i < this.threads; i++) try {<NEW_LINE>worker[i].join(100);<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>}<NEW_LINE>}
"NormalizeDistributor", "adding of decoded rows to workers ended with timeout = " + this.maxtime);
206,926
// LATER It's not ideal that currently the web response needs to be parsed twice, once for the search results and once for the completion of the indexer search result. Will need to check how much that impacts performance<NEW_LINE>@Override<NEW_LINE>protected void completeIndexerSearchResult(String response, IndexerSearchResult indexerSearchResult, AcceptorResult acceptorResult, SearchRequest searchRequest, int offset, Integer limit) {<NEW_LINE>Document doc = Jsoup.parse(response);<NEW_LINE>if (doc.select("table.xMenuT").size() > 0) {<NEW_LINE>Element navigationTable = doc.select("table.xMenuT").get(1);<NEW_LINE>Elements pageLinks = navigationTable.select("a");<NEW_LINE>boolean hasMore = !pageLinks.isEmpty() && pageLinks.last().text().equals(">");<NEW_LINE>boolean totalKnown = false;<NEW_LINE>indexerSearchResult.setOffset(searchRequest.getOffset());<NEW_LINE>// Must be at least as many as already loaded<NEW_LINE>int total <MASK><NEW_LINE>if (!hasMore) {<NEW_LINE>// Parsed page contains all the available results<NEW_LINE>total = searchRequest.getOffset() + indexerSearchResult.getSearchResultItems().size();<NEW_LINE>totalKnown = true;<NEW_LINE>}<NEW_LINE>indexerSearchResult.setHasMoreResults(hasMore);<NEW_LINE>indexerSearchResult.setTotalResults(total);<NEW_LINE>indexerSearchResult.setTotalResultsKnown(totalKnown);<NEW_LINE>} else {<NEW_LINE>indexerSearchResult.setHasMoreResults(false);<NEW_LINE>indexerSearchResult.setTotalResults(0);<NEW_LINE>indexerSearchResult.setTotalResultsKnown(true);<NEW_LINE>}<NEW_LINE>indexerSearchResult.setPageSize(100);<NEW_LINE>indexerSearchResult.setOffset(offset);<NEW_LINE>}
= searchRequest.getOffset() + 100;
222,707
private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (namespaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-01-01-preview";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>}
this.client.mergeContext(context);
1,684,886
protected void doRunExample(final Engine engine) throws Exception {<NEW_LINE>final MockService<Integer> service = getService();<NEW_LINE>final SearchTask example = new SearchTask(service);<NEW_LINE>System.out.printf("This com.linkedin.asm.example will issue %d parallel requests\n", REQUEST_LATENCIES.length);<NEW_LINE>System.out.println();<NEW_LINE>for (int i = 0; i < REQUEST_LATENCIES.length; i++) {<NEW_LINE>System.out.printf("Request %d will take %3dms to complete\n", i, REQUEST_LATENCIES[i]);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Latency rules:");<NEW_LINE>System.out.println("--------------");<NEW_LINE>for (int i = 0; i < WAIT_TIMES.length; i++) {<NEW_LINE>System.out.printf("Finish if received %d responses after %3dms\n", i, WAIT_TIMES[i]);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Execution:");<NEW_LINE>System.out.println("----------");<NEW_LINE>final <MASK><NEW_LINE>engine.run(example);<NEW_LINE>example.await();<NEW_LINE>final long endMillis = System.currentTimeMillis();<NEW_LINE>System.out.println("Responses: " + example.get());<NEW_LINE>System.out.println("Execution time: " + (endMillis - startMillis) + "ms");<NEW_LINE>printTracingResults(example);<NEW_LINE>}
long startMillis = System.currentTimeMillis();
1,410,654
public void addToolStats(ToolRebuildContext context, int level, ModifierStatsBuilder builder) {<NEW_LINE>Item item = context.getItem();<NEW_LINE>if (DURABILITY.contains(item)) {<NEW_LINE>ToolStats.DURABILITY.multiply(builder, <MASK><NEW_LINE>}<NEW_LINE>if (MELEE_OR_UNARMED.contains(item)) {<NEW_LINE>ToolStats.ATTACK_DAMAGE.multiply(builder, 1 + (level * 0.20f));<NEW_LINE>}<NEW_LINE>if (HARVEST.contains(item)) {<NEW_LINE>ToolStats.MINING_SPEED.multiply(builder, 1 + (level * 0.25f));<NEW_LINE>ToolStats.HARVEST_TIER.update(builder, Tiers.NETHERITE);<NEW_LINE>}<NEW_LINE>if (ARMOR.contains(item)) {<NEW_LINE>ToolStats.ARMOR_TOUGHNESS.add(builder, level);<NEW_LINE>ToolStats.KNOCKBACK_RESISTANCE.add(builder, level * 0.05f);<NEW_LINE>}<NEW_LINE>}
1 + (level * 0.20f));
558,341
public final TablespaceStorageContext tablespaceStorage() throws RecognitionException {<NEW_LINE>TablespaceStorageContext _localctx = new TablespaceStorageContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 94, RULE_tablespaceStorage);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1755);<NEW_LINE>match(STORAGE);<NEW_LINE>setState(1756);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == DEFAULT || _la == DISK || _la == MEMORY)) {<NEW_LINE>_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>} 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);
1,260,321
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1".split(",");<NEW_LINE>String epl = "@name('s0') select value in (select sum(intPrimitive) from SupportBean#keepall) as c0," + "value not in (select sum(intPrimitive) from SupportBean#keepall) as c1 " + "from SupportValueEvent";<NEW_LINE>env.compileDeployAddListenerMileZero(epl, "s0");<NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { null, null });<NEW_LINE>env.sendEventBean(new SupportBean("E1", 10));<NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { true, false });<NEW_LINE>env.sendEventBean(new SupportBean("E2", 1));<NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { false, true });<NEW_LINE>env.sendEventBean(new <MASK><NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { true, false });<NEW_LINE>env.undeployAll();<NEW_LINE>}
SupportBean("E3", -1));
843,174
public int add(@ParametricNullness E element, int occurrences) {<NEW_LINE>checkNonnegative(occurrences, "occurrences");<NEW_LINE>if (occurrences == 0) {<NEW_LINE>return count(element);<NEW_LINE>}<NEW_LINE>checkArgument(range.contains(element));<NEW_LINE>AvlNode<E> root = rootReference.get();<NEW_LINE>if (root == null) {<NEW_LINE>comparator().compare(element, element);<NEW_LINE>AvlNode<E> newRoot = new AvlNode<E>(element, occurrences);<NEW_LINE>successor(header, newRoot, header);<NEW_LINE>rootReference.checkAndSet(root, newRoot);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// used as a mutable int reference to hold result<NEW_LINE>int[] result = new int[1];<NEW_LINE>AvlNode<E> newRoot = root.add(comparator(<MASK><NEW_LINE>rootReference.checkAndSet(root, newRoot);<NEW_LINE>return result[0];<NEW_LINE>}
), element, occurrences, result);
704,303
private ComponentAnimation replaceComponents(final Component current, final Component next, final Transition t, boolean wait, boolean dropEvents, Runnable onFinish, int growSpeed, int layoutAnimationSpeed, boolean addAnimtion) {<NEW_LINE>if (!contains(current)) {<NEW_LINE>throw new IllegalArgumentException("Component " + current + " is not contained in this Container");<NEW_LINE>}<NEW_LINE>if (t == null || !isVisible() || getComponentForm() == null) {<NEW_LINE>next.setX(current.getX());<NEW_LINE>next.setY(current.getY());<NEW_LINE>next.setWidth(current.getWidth());<NEW_LINE>next.setHeight(current.getHeight());<NEW_LINE>replace(current, next, false);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>setScrollX(0);<NEW_LINE>setScrollY(0);<NEW_LINE>next.<MASK><NEW_LINE>next.setY(current.getY());<NEW_LINE>next.setWidth(current.getWidth());<NEW_LINE>next.setHeight(current.getHeight());<NEW_LINE>next.setParent(this);<NEW_LINE>if (next instanceof Container) {<NEW_LINE>((Container) next).layoutContainer();<NEW_LINE>}<NEW_LINE>final TransitionAnimation anim = new TransitionAnimation(this, current, next, t);<NEW_LINE>anim.growSpeed = growSpeed;<NEW_LINE>anim.layoutAnimationSpeed = layoutAnimationSpeed;<NEW_LINE>// register the transition animation<NEW_LINE>if (addAnimtion) {<NEW_LINE>if (wait) {<NEW_LINE>getAnimationManager().addAnimationAndBlock(anim);<NEW_LINE>} else {<NEW_LINE>if (onFinish != null) {<NEW_LINE>getAnimationManager().addUIMutation(this, anim, onFinish);<NEW_LINE>} else {<NEW_LINE>getAnimationManager().addUIMutation(this, anim);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return anim;<NEW_LINE>}
setX(current.getX());
1,175,251
private AnnotationValuePb.Builder handleNewAnnotationFieldValueNode(AnnotationValuePb.Builder currentAnnotationValue, ArrayStatus currentArrayStatus) {<NEW_LINE>checkState("anno_field_value".equals(xmlStreamReader.getLocalName()), "not an " + "anno_field_value node %s", currentLocation);<NEW_LINE>checkState(null != currentAnnotationValue, "Not building annotation value! %s", currentLocation);<NEW_LINE>if (currentAnnotationValue.getIsArray()) {<NEW_LINE>checkState(null != currentArrayStatus, "processing an array value without array info." + " %s", currentLocation);<NEW_LINE>checkState(null != currentArrayStatus.getCurrentIndex(), "processing array value without " + " index info. %s", currentLocation);<NEW_LINE>} else {<NEW_LINE>checkState(null == currentArrayStatus, "processing a non array value with array status %s", currentLocation);<NEW_LINE>}<NEW_LINE>String fieldType = getAttributeValue("type");<NEW_LINE>String fieldValue = getAttributeValue("value");<NEW_LINE>checkState(null != fieldType, "No type attribute present! %s", currentLocation);<NEW_LINE>checkState(null != fieldValue, "No value attribute present! %s", currentLocation);<NEW_LINE>TestInfo.Type <MASK><NEW_LINE>checkState(null != pbType, "cannot map xml to pb type. %s %s", fieldType, currentLocation);<NEW_LINE>if (currentAnnotationValue.getIsArray()) {<NEW_LINE>if (currentAnnotationValue.hasFieldType()) {<NEW_LINE>checkState(pbType.equals(currentAnnotationValue.getFieldType()), "array with elems of ", "different types! %s", currentLocation);<NEW_LINE>}<NEW_LINE>currentAnnotationValue.setFieldValue(currentArrayStatus.getCurrentIndex(), fieldValue);<NEW_LINE>} else {<NEW_LINE>currentAnnotationValue.addFieldValue(fieldValue);<NEW_LINE>}<NEW_LINE>return currentAnnotationValue.setFieldType(pbType);<NEW_LINE>}
pbType = XML_TO_PB_TYPE.get(fieldType);
1,812,916
private IXDocReport loadReport(InputStream sourceStream, String reportId, String templateEngineKind, ITemplateEngine templateEngine, boolean cacheReport) throws IOException, XDocReportException {<NEW_LINE>initializeIfNeeded();<NEW_LINE>// 2) zip was loaded, create an instance of report<NEW_LINE>IXDocReport report = createReport(sourceStream);<NEW_LINE>// 3) Update the report id if need.<NEW_LINE>if (StringUtils.isEmpty(reportId)) {<NEW_LINE>reportId = report.toString();<NEW_LINE>}<NEW_LINE>report.setId(reportId);<NEW_LINE>// 4) Search or set the template engine.<NEW_LINE>if (templateEngine == null && StringUtils.isNotEmpty(templateEngineKind)) {<NEW_LINE>// Template engine was not forced.<NEW_LINE>// Search template engine<NEW_LINE><MASK><NEW_LINE>templateEngine = TemplateEngineInitializerRegistry.getRegistry().getTemplateEngine(templateEngineKind, documentKind);<NEW_LINE>if (templateEngine == null) {<NEW_LINE>templateEngine = TemplateEngineInitializerRegistry.getRegistry().getTemplateEngine(templateEngineKind, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>report.setTemplateEngine(templateEngine);<NEW_LINE>if (cacheReport) {<NEW_LINE>registerReport(report);<NEW_LINE>}<NEW_LINE>return report;<NEW_LINE>}
String documentKind = report.getKind();
1,540,334
public void processButtonInput(KeyEvent event) {<NEW_LINE>switch(event.getKeyCode()) {<NEW_LINE>case KeyEvent.KEYCODE_BUTTON_A:<NEW_LINE>Toast.makeText(OpenBotApplication.getContext(), "A recognized", Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>case KeyEvent.KEYCODE_BUTTON_B:<NEW_LINE>Toast.makeText(OpenBotApplication.getContext(), "B recognized", Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>case KeyEvent.KEYCODE_BUTTON_Y:<NEW_LINE>Toast.makeText(OpenBotApplication.getContext(), "Y recognized", Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>case KeyEvent.KEYCODE_BUTTON_X:<NEW_LINE>Toast.makeText(OpenBotApplication.getContext(), "X recognized", Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>case KeyEvent.KEYCODE_BUTTON_L1:<NEW_LINE>Toast.makeText(OpenBotApplication.getContext(), "L1 recognized", Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>case KeyEvent.KEYCODE_BUTTON_R1:<NEW_LINE>Toast.makeText(OpenBotApplication.getContext(), "R1 recognized", <MASK><NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>Toast.makeText(OpenBotApplication.getContext(), "Key " + event.getKeyCode() + " not recognized", Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
Toast.LENGTH_SHORT).show();
1,391,682
private void savePresentationSettings() {<NEW_LINE>if ((decorator.getDecoratorFeatures() & IResultSetDecorator.FEATURE_PANELS) != 0) {<NEW_LINE>IDialogSettings pSections = ResultSetUtils.getViewerSettings(SETTINGS_SECTION_PRESENTATIONS);<NEW_LINE>for (Map.Entry<ResultSetPresentationDescriptor, PresentationSettings> pEntry : presentationSettings.entrySet()) {<NEW_LINE>if (pEntry.getKey() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String pId = pEntry.getKey().getId();<NEW_LINE>PresentationSettings settings = pEntry.getValue();<NEW_LINE>IDialogSettings pSection = UIUtils.getSettingsSection(pSections, pId);<NEW_LINE>pSection.put("enabledPanelIds", CommonUtils.joinStrings<MASK><NEW_LINE>pSection.put("activePanelId", settings.activePanelId);<NEW_LINE>pSection.put("panelRatio", settings.panelRatio);<NEW_LINE>pSection.put("panelsVisible", settings.panelsVisible);<NEW_LINE>pSection.put("verticalLayout", settings.verticalLayout);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(",", settings.enabledPanelIds));
1,063,097
private void action_treeAdd(ListItem item) {<NEW_LINE>log.info("Item=" + item);<NEW_LINE>if (item != null) {<NEW_LINE>SimpleTreeModel model = (SimpleTreeModel) centerTree.getModel();<NEW_LINE>SimpleTreeNode stn = model.find(model.getRoot(), item.id);<NEW_LINE>if (stn != null) {<NEW_LINE>MTreeNode tNode = <MASK><NEW_LINE>tNode.setName(item.name);<NEW_LINE>tNode.setAllowsChildren(item.isSummary);<NEW_LINE>tNode.setImageIndicator(item.imageIndicator);<NEW_LINE>model.nodeUpdated(stn);<NEW_LINE>Treeitem ti = centerTree.renderItemByPath(model.getPath(model.getRoot(), stn));<NEW_LINE>ti.setTooltiptext(item.description);<NEW_LINE>} else {<NEW_LINE>stn = new SimpleTreeNode(new MTreeNode(item.id, 0, item.name, item.description, 0, item.isSummary, item.imageIndicator, false, null), new ArrayList<Object>());<NEW_LINE>model.addNode(stn);<NEW_LINE>}<NEW_LINE>// May cause Error if in tree<NEW_LINE>addNode(item);<NEW_LINE>}<NEW_LINE>}
(MTreeNode) stn.getData();
1,230,485
public void dump(DumperContext dumpContext) throws DumpException {<NEW_LINE>ensureInitialized();<NEW_LINE>List<String> args = dumpContext.getArgsAsList();<NEW_LINE>PrintStream writer = dumpContext.getStdout();<NEW_LINE>String cmd = args.isEmpty() ? <MASK><NEW_LINE>List<String> rest = args.isEmpty() ? new ArrayList<String>() : args.subList(1, args.size());<NEW_LINE>if (cmd != null && cmd.equals("memcache")) {<NEW_LINE>memcache(writer, rest);<NEW_LINE>} else if (cmd != null && cmd.equals("diskcache")) {<NEW_LINE>diskcache(mMainFileCache, "Main", writer, rest);<NEW_LINE>diskcache(mSmallFileCache, "Small", writer, rest);<NEW_LINE>} else if (cmd != null && cmd.equals("clear")) {<NEW_LINE>mImagePipeline.clearCaches();<NEW_LINE>} else {<NEW_LINE>usage(writer);<NEW_LINE>if (TextUtils.isEmpty(cmd)) {<NEW_LINE>throw new DumpUsageException("Missing command");<NEW_LINE>} else {<NEW_LINE>throw new DumpUsageException("Unknown command: " + cmd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
null : args.get(0);
812,307
public static void check(String username, String password, List<String> hosts, List<Integer> ports, String connectionString, String url) {<NEW_LINE>if (Config.getConfig().getCloudSwitch() && Config.getConfig().getHookWhiteAll()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashMap<String, Object> params = new HashMap<String, Object>(5);<NEW_LINE>params.put("username", username);<NEW_LINE>params.put("password", password);<NEW_LINE>params.put("hosts", hosts);<NEW_LINE><MASK><NEW_LINE>params.put("connectionString", connectionString);<NEW_LINE>params.put("url", url);<NEW_LINE>Long lastAlarmTime = MongoConnectionChecker.alarmTimeCache.get(url);<NEW_LINE>if (lastAlarmTime == null || (System.currentTimeMillis() - lastAlarmTime) > TimeUtils.DAY_MILLISECOND) {<NEW_LINE>HookHandler.doCheckWithoutRequest(CheckParameter.Type.POLICY_MONGO_CONNECTION, params);<NEW_LINE>}<NEW_LINE>}
params.put("ports", ports);
357,469
public Path run(final Session<?> session) throws BackgroundException {<NEW_LINE>final Touch feature = session.getFeature(Touch.class);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Run with feature %s", feature));<NEW_LINE>}<NEW_LINE>final TransferStatus status = new TransferStatus().withTimestamp(System.currentTimeMillis()).hidden(!SearchFilterFactory.HIDDEN_FILTER.accept(file)).exists(false).withLength(0L).withMime(new MappingMimeTypeService().getMime(file.getName())).withLockId(this.getLockId(file));<NEW_LINE>final Encryption encryption = session.getFeature(Encryption.class);<NEW_LINE>if (encryption != null) {<NEW_LINE>status.setEncryption(encryption.getDefault(file));<NEW_LINE>}<NEW_LINE>final Redundancy redundancy = session.getFeature(Redundancy.class);<NEW_LINE>if (redundancy != null) {<NEW_LINE>status.setStorageClass(redundancy.getDefault());<NEW_LINE>}<NEW_LINE>status.setTimestamp(System.currentTimeMillis());<NEW_LINE>if (PreferencesFactory.get().getBoolean("touch.permissions.change")) {<NEW_LINE>final UnixPermission permission = <MASK><NEW_LINE>if (permission != null) {<NEW_LINE>status.setPermission(permission.getDefault(EnumSet.of(Path.Type.file)));<NEW_LINE>}<NEW_LINE>final AclPermission acl = session.getFeature(AclPermission.class);<NEW_LINE>if (acl != null) {<NEW_LINE>status.setAcl(acl.getDefault(EnumSet.of(Path.Type.file)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Path result = feature.touch(file, status);<NEW_LINE>if (PathAttributes.EMPTY.equals(result.attributes())) {<NEW_LINE>return result.withAttributes(session.getFeature(AttributesFinder.class).find(result));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
session.getFeature(UnixPermission.class);
269,573
final RegisterWorkspaceDirectoryResult executeRegisterWorkspaceDirectory(RegisterWorkspaceDirectoryRequest registerWorkspaceDirectoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerWorkspaceDirectoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RegisterWorkspaceDirectoryRequest> request = null;<NEW_LINE>Response<RegisterWorkspaceDirectoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RegisterWorkspaceDirectoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(registerWorkspaceDirectoryRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RegisterWorkspaceDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RegisterWorkspaceDirectoryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RegisterWorkspaceDirectoryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkSpaces");
752,286
public void change(Event e, @Nullable Object[] delta, ChangeMode mode) {<NEW_LINE>ItemType[] source = items.getArray(e);<NEW_LINE>EnchantmentType[] enchants = new EnchantmentType[delta != null ? delta.length : 0];<NEW_LINE>if (delta != null && delta.length != 0) {<NEW_LINE>for (int i = 0; i < delta.length; i++) {<NEW_LINE>if (delta[i] instanceof EnchantmentType)<NEW_LINE>enchants[i] <MASK><NEW_LINE>else<NEW_LINE>enchants[i] = new EnchantmentType((Enchantment) delta[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>switch(mode) {<NEW_LINE>case ADD:<NEW_LINE>for (ItemType item : source) item.addEnchantments(enchants);<NEW_LINE>break;<NEW_LINE>case REMOVE:<NEW_LINE>case REMOVE_ALL:<NEW_LINE>for (ItemType item : source) {<NEW_LINE>ItemMeta meta = item.getItemMeta();<NEW_LINE>assert meta != null;<NEW_LINE>for (EnchantmentType enchant : enchants) {<NEW_LINE>Enchantment ench = enchant.getType();<NEW_LINE>assert ench != null;<NEW_LINE>if (enchant.getInternalLevel() == -1 || meta.getEnchantLevel(ench) == enchant.getLevel()) {<NEW_LINE>// Remove directly from meta since it's more efficient on this case<NEW_LINE>meta.removeEnchant(ench);<NEW_LINE>}<NEW_LINE>item.setItemMeta(meta);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SET:<NEW_LINE>for (ItemType item : source) {<NEW_LINE>item.clearEnchantments();<NEW_LINE>item.addEnchantments(enchants);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DELETE:<NEW_LINE>case RESET:<NEW_LINE>for (ItemType item : source) item.clearEnchantments();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
= (EnchantmentType) delta[i];
878,552
private IQueryBuilder<I_AD_User_SortPref_Hdr> createSortPreferenceHdrQueryBuilder(final String action, final int recordId, final Object contextProvider) {<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>// Services<NEW_LINE>final IQueryBL queryBL = Services.get(IQueryBL.class);<NEW_LINE>final IQueryBuilder<I_AD_User_SortPref_Hdr> queryBuilder = queryBL.createQueryBuilder(I_AD_User_SortPref_Hdr.class, contextProvider).addOnlyActiveRecordsFilter().addEqualsFilter(I_AD_User_SortPref_Hdr.COLUMN_Action, action);<NEW_LINE>if (X_AD_User_SortPref_Hdr.ACTION_Fenster.equals(action)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_User_SortPref_Hdr.COLUMN_AD_Tab_ID, recordId);<NEW_LINE>} else if (X_AD_User_SortPref_Hdr.ACTION_FensterNichtDynamisch.equals(action)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_User_SortPref_Hdr.COLUMN_AD_Form_ID, recordId);<NEW_LINE>} else if (X_AD_User_SortPref_Hdr.ACTION_Info_Fenster.equals(action)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_User_SortPref_Hdr.COLUMN_AD_InfoWindow_ID, recordId);<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Action not recognized: " + action);<NEW_LINE>}<NEW_LINE>return queryBuilder;<NEW_LINE>}
Check.assumeNotEmpty(action, "action not empty");
55,347
public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>File dataDir = new File("target/h2");<NEW_LINE>String url = "jdbc:h2:tcp://localhost:9092/apiman";<NEW_LINE>if (dataDir.exists()) {<NEW_LINE>FileUtils.deleteDirectory(dataDir);<NEW_LINE>}<NEW_LINE>dataDir.mkdirs();<NEW_LINE>Server.createTcpServer("-tcpPassword", "sa", "-baseDir", dataDir.getAbsolutePath(), "-tcpPort", "9092", "-tcpAllowOthers").start();<NEW_LINE>Class.forName("org.h2.Driver");<NEW_LINE>try (Connection connection = DriverManager.getConnection(url, "sa", "")) {<NEW_LINE>System.out.println("Connection Established: " + connection.getMetaData().getDatabaseProductName() + "/" + connection.getCatalog());<NEW_LINE>executeUpdate(connection, "CREATE TABLE users ( username varchar(255) NOT NULL, password varchar(255) NOT NULL, PRIMARY KEY (username))");<NEW_LINE>executeUpdate(connection, "INSERT INTO users (username, password) VALUES ('bwayne', 'ae2efd698aefdf366736a4eda1bc5241f9fbfec7')");<NEW_LINE>executeUpdate(connection, "INSERT INTO users (username, password) VALUES ('ckent', 'ea59f7ca52a2087c99374caba0ff29be1b2dcdbf')");<NEW_LINE>executeUpdate(connection, "INSERT INTO users (username, password) VALUES ('ballen', 'ea59f7ca52a2087c99374caba0ff29be1b2dcdbf')");<NEW_LINE>executeUpdate(connection, "CREATE TABLE roles (rolename varchar(255) NOT NULL, username varchar(255) NOT NULL)");<NEW_LINE>executeUpdate(connection, "INSERT INTO roles (rolename, username) VALUES ('user', 'bwayne')");<NEW_LINE>executeUpdate(connection, "INSERT INTO roles (rolename, username) VALUES ('admin', 'bwayne')");<NEW_LINE>executeUpdate(connection, "INSERT INTO roles (rolename, username) VALUES ('ckent', 'user')");<NEW_LINE>executeUpdate(connection, "INSERT INTO roles (rolename, username) VALUES ('ballen', 'user')");<NEW_LINE>}<NEW_LINE>System.out.println("======================================================");<NEW_LINE>System.out.println("JDBC (H2) server started successfully.");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" Data: " + dataDir.getAbsolutePath());<NEW_LINE>System.out.println(" JDBC URL: " + url);<NEW_LINE>System.out.println(" JDBC User: sa");<NEW_LINE>System.out.println(" JDBC Password: ");<NEW_LINE>System.out.println(" Authentication Query: SELECT * FROM users u WHERE u.username = ? AND u.password = ?");<NEW_LINE>System.out.println(" Authorization Query: SELECT r.rolename FROM roles r WHERE r.username = ?");<NEW_LINE><MASK><NEW_LINE>System.out.println("");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println("Press Enter to stop the JDBC server.");<NEW_LINE>new BufferedReader(new InputStreamReader(System.in)).readLine();<NEW_LINE>System.out.println("Shutting down the JDBC server...");<NEW_LINE>Server.shutdownTcpServer("tcp://localhost:9092", "", true, true);<NEW_LINE>System.out.println("Done!");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
System.out.println("======================================================");
1,562,941
void displayResults(NodeResults nodeResults) {<NEW_LINE>Document document = Jsoup.parse(EMPTY_HTML);<NEW_LINE>Element body = document.getElementsByTag("body").first();<NEW_LINE>Optional<Element> panelHeader = appendPanelHeader(body, nodeResults.getItemName(), nodeResults.getAggregateScore());<NEW_LINE>// for each analysis result item, display the data.<NEW_LINE>List<ResultDisplayAttributes> displayAttributes = nodeResults.getAnalysisResults();<NEW_LINE>for (int idx = 0; idx < displayAttributes.size(); idx++) {<NEW_LINE>AnalysisResultsViewModel.ResultDisplayAttributes resultAttrs = displayAttributes.get(idx);<NEW_LINE>Element sectionDiv = appendResult(body, idx, resultAttrs);<NEW_LINE>if (idx > 0 || panelHeader.isPresent()) {<NEW_LINE>sectionDiv.attr(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// set the body html<NEW_LINE>ContentViewerHtmlStyles.setStyles(textPanel);<NEW_LINE>textPanel.setText(document.html());<NEW_LINE>// if there is a selected result scroll to it<NEW_LINE>Optional<AnalysisResult> selectedResult = nodeResults.getSelectedResult();<NEW_LINE>if (selectedResult.isPresent()) {<NEW_LINE>textPanel.scrollToReference(getAnchor(selectedResult.get()));<NEW_LINE>} else {<NEW_LINE>// otherwise, scroll to the beginning.<NEW_LINE>textPanel.setCaretPosition(0);<NEW_LINE>}<NEW_LINE>}
"class", ContentViewerHtmlStyles.getSpacedSectionClassName());
70,103
final CancelServiceSoftwareUpdateResult executeCancelServiceSoftwareUpdate(CancelServiceSoftwareUpdateRequest cancelServiceSoftwareUpdateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelServiceSoftwareUpdateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelServiceSoftwareUpdateRequest> request = null;<NEW_LINE>Response<CancelServiceSoftwareUpdateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelServiceSoftwareUpdateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelServiceSoftwareUpdateRequest));<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, "OpenSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelServiceSoftwareUpdate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelServiceSoftwareUpdateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelServiceSoftwareUpdateResultJsonUnmarshaller());<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);
564,244
public Map<String, Object> createParameterMap(NdbOpenJPADomainFieldHandlerImpl domainFieldHandler, QueryDomainType<?> queryDomainObject, Object oid) {<NEW_LINE>Map<String, Object> result = new HashMap<String, Object>();<NEW_LINE>Predicate predicate = null;<NEW_LINE>for (AbstractDomainFieldHandlerImpl localHandler : domainFieldHandler.compositeDomainFieldHandlers) {<NEW_LINE>String name = localHandler.getColumnName();<NEW_LINE>PredicateOperand parameter = queryDomainObject.param(name);<NEW_LINE>PredicateOperand field = queryDomainObject.get(name);<NEW_LINE>if (predicate == null) {<NEW_LINE>predicate = field.equal(parameter);<NEW_LINE>} else {<NEW_LINE>predicate.and(field.equal(parameter));<NEW_LINE>}<NEW_LINE>// construct a map of parameter binding to the value in oid<NEW_LINE>Object <MASK><NEW_LINE>result.put(name, value);<NEW_LINE>if (logger.isDetailEnabled())<NEW_LINE>logger.detail("Map.Entry key: " + name + ", value: " + value);<NEW_LINE>}<NEW_LINE>queryDomainObject.where(predicate);<NEW_LINE>return result;<NEW_LINE>}
value = domainFieldHandler.getKeyValue(oid);
490,316
public List<PlayerStat> readLeaderboard(@Nullable PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException {<NEW_LINE>List<PlayerStat> stats = new ArrayList<>();<NEW_LINE>// Fix for a plugin that people are using that is throwing SQL errors<NEW_LINE>if (skill != null && SkillTools.isChildSkill(skill)) {<NEW_LINE>mcMMO.p.<MASK><NEW_LINE>throw new InvalidSkillException("A plugin hooking into mcMMO that you are using is attempting to read leaderboard skills for child skills, child skills do not have leaderboards! This is NOT an mcMMO error!");<NEW_LINE>}<NEW_LINE>String query = skill == null ? ALL_QUERY_VERSION : skill.name().toLowerCase(Locale.ENGLISH);<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>PreparedStatement statement = null;<NEW_LINE>Connection connection = null;<NEW_LINE>try {<NEW_LINE>connection = getConnection(PoolIdentifier.MISC);<NEW_LINE>statement = connection.prepareStatement("SELECT " + query + ", user FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON (user_id = id) WHERE " + query + " > 0 AND NOT user = '\\_INVALID\\_OLD\\_USERNAME\\_' ORDER BY " + query + " DESC, user LIMIT ?, ?");<NEW_LINE>statement.setInt(1, (pageNumber * statsPerPage) - statsPerPage);<NEW_LINE>statement.setInt(2, statsPerPage);<NEW_LINE>resultSet = statement.executeQuery();<NEW_LINE>while (resultSet.next()) {<NEW_LINE>ArrayList<String> column = new ArrayList<>();<NEW_LINE>for (int i = 1; i <= resultSet.getMetaData().getColumnCount(); i++) {<NEW_LINE>column.add(resultSet.getString(i));<NEW_LINE>}<NEW_LINE>stats.add(new PlayerStat(column.get(1), Integer.parseInt(column.get(0))));<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>printErrors(ex);<NEW_LINE>} finally {<NEW_LINE>tryClose(resultSet);<NEW_LINE>tryClose(statement);<NEW_LINE>tryClose(connection);<NEW_LINE>}<NEW_LINE>return stats;<NEW_LINE>}
getLogger().severe("A plugin hooking into mcMMO is being naughty with our database commands, update all plugins that hook into mcMMO and contact their devs!");
1,080,118
public void solveVelocityConstraints(final SolverData data) {<NEW_LINE>Vec2 vA = data.velocities[m_indexA].v;<NEW_LINE>float wA = data.velocities[m_indexA].w;<NEW_LINE>Vec2 vB = data.velocities[m_indexB].v;<NEW_LINE>float wB = data.velocities[m_indexB].w;<NEW_LINE>final Vec2 vpA = pool.popVec2();<NEW_LINE>final Vec2 vpB = pool.popVec2();<NEW_LINE>final Vec2 PA = pool.popVec2();<NEW_LINE>final Vec2 PB = pool.popVec2();<NEW_LINE>Vec2.crossToOutUnsafe(wA, m_rA, vpA);<NEW_LINE>vpA.addLocal(vA);<NEW_LINE>Vec2.crossToOutUnsafe(wB, m_rB, vpB);<NEW_LINE>vpB.addLocal(vB);<NEW_LINE>float Cdot = -Vec2.dot(m_uA, vpA) - m_ratio * Vec2.dot(m_uB, vpB);<NEW_LINE>float impulse = -m_mass * Cdot;<NEW_LINE>m_impulse += impulse;<NEW_LINE>PA.set(m_uA).mulLocal(-impulse);<NEW_LINE>PB.set(m_uB).mulLocal(-m_ratio * impulse);<NEW_LINE>vA.x += m_invMassA * PA.x;<NEW_LINE>vA.y += m_invMassA * PA.y;<NEW_LINE>wA += m_invIA * Vec2.cross(m_rA, PA);<NEW_LINE>vB<MASK><NEW_LINE>vB.y += m_invMassB * PB.y;<NEW_LINE>wB += m_invIB * Vec2.cross(m_rB, PB);<NEW_LINE>// data.velocities[m_indexA].v.set(vA);<NEW_LINE>data.velocities[m_indexA].w = wA;<NEW_LINE>// data.velocities[m_indexB].v.set(vB);<NEW_LINE>data.velocities[m_indexB].w = wB;<NEW_LINE>pool.pushVec2(4);<NEW_LINE>}
.x += m_invMassB * PB.x;
751,484
public void testNonXAOptionBCommit() throws Exception {<NEW_LINE>prepareTRA();<NEW_LINE>resetData(keyCommit04);<NEW_LINE>String deliveryID = "TX_test1d";<NEW_LINE>// construct a FVTMessage<NEW_LINE>FVTMessage message = new FVTMessage();<NEW_LINE>message.addTestResult("CMTNonJMSRequired");<NEW_LINE>// Add a option A delivery.<NEW_LINE>Method m = MessageListener.class.getMethod("onStringMessage", new Class[] { String.class });<NEW_LINE>message.addDelivery("CMTNonJMSRequired", FVTMessage.BEFORE_DELIVERY, m);<NEW_LINE>message.add("CMTNonJMSRequired", "DB-" + keyCommit04, m);<NEW_LINE>message.addDelivery("CMTNonJMSRequired", FVTMessage.AFTER_DELIVERY, null);<NEW_LINE>System.out.println(message.toString());<NEW_LINE>// d248457.1<NEW_LINE>XidImpl xid = XidImpl.createXid(14, 10);<NEW_LINE>provider.sendMessageWait(deliveryID, message, WorkEvent.WORK_COMPLETED, xid, FVTMessageProvider.DO_WORK);<NEW_LINE>// Now prepare xid<NEW_LINE>XATerminator xaTerm = provider.getXATerminator();<NEW_LINE>if (xaTerm.prepare(xid) == javax.transaction.xa.XAResource.XA_OK) {<NEW_LINE>// Now commit xid<NEW_LINE>xaTerm.commit(xid, false);<NEW_LINE>}<NEW_LINE>// Get the first test result array for the endpoint instance 0<NEW_LINE>MessageEndpointTestResults results = provider.getTestResult(deliveryID);<NEW_LINE>assertTrue("isDeliveryTransacted returns true for a method with the Required attribute.", results.isDeliveryTransacted());<NEW_LINE>assertTrue("Number of messages delivered is 1", results.getNumberOfMessagesDelivered() == 1);<NEW_LINE>assertTrue(<MASK><NEW_LINE>// assertTrue("This message delivery is in a global transaction context.", results.mdbInvokedInGlobalTransactionContext());<NEW_LINE>assertFalse("The RA XAResource is not enlisted in the global transaction.", results.raXaResourceEnlisted());<NEW_LINE>assertFalse("rollback is not driven on the XAResource provided by TRA.", results.raXaResourceRollbackWasDriven());<NEW_LINE>assertFalse("commit is not driven on the XAResource provided by TRA.", results.raXaResourceCommitWasDriven());<NEW_LINE>provider.releaseDeliveryId(deliveryID);<NEW_LINE>// verify Commit04<NEW_LINE>assertTrue(keyCommit04 + " -- intValue is updated.", (verifyData(keyCommit04) == 1000));<NEW_LINE>}
"Delivery option B is used for this test.", results.optionBMessageDeliveryUsed());
1,773,084
private BinaryExpression convert(org.eclipse.jdt.core.dom.InfixExpression expression) {<NEW_LINE>Expression leftOperand = convert(expression.getLeftOperand());<NEW_LINE>Expression rightOperand = convert(expression.getRightOperand());<NEW_LINE>BinaryOperator operator = JdtUtils.getBinaryOperator(expression.getOperator());<NEW_LINE>checkArgument(!expression.hasExtendedOperands() || operator.getPrecedence().getAssociativity() == Associativity.LEFT);<NEW_LINE>BinaryExpression binaryExpression = BinaryExpression.newBuilder().setLeftOperand(leftOperand).setOperator(operator).<MASK><NEW_LINE>for (Object object : expression.extendedOperands()) {<NEW_LINE>org.eclipse.jdt.core.dom.Expression extendedOperand = (org.eclipse.jdt.core.dom.Expression) object;<NEW_LINE>binaryExpression = BinaryExpression.newBuilder().setLeftOperand(binaryExpression).setOperator(operator).setRightOperand(convert(extendedOperand)).build();<NEW_LINE>}<NEW_LINE>return binaryExpression;<NEW_LINE>}
setRightOperand(rightOperand).build();
145,191
final CreateVpcResult executeCreateVpc(CreateVpcRequest createVpcRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createVpcRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateVpcRequest> request = null;<NEW_LINE>Response<CreateVpcResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateVpcRequestMarshaller().marshall(super.beforeMarshalling(createVpcRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateVpc");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateVpcResult> responseHandler = new StaxResponseHandler<CreateVpcResult>(new CreateVpcResultStaxUnmarshaller());<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,166,935
public static CurlOption parse(String cmdLine) {<NEW_LINE>List<String> args = ShellWords.parse(cmdLine);<NEW_LINE>URI url = null;<NEW_LINE>HttpMethod method = HttpMethod.PUT;<NEW_LINE>List<Entry<String, String>> headers = new ArrayList<>();<NEW_LINE>Proxy proxy = NO_PROXY;<NEW_LINE>while (!args.isEmpty()) {<NEW_LINE>String arg = args.remove(0);<NEW_LINE>if (arg.equals("-X")) {<NEW_LINE>String methodArg = removeArgFor(arg, args);<NEW_LINE>method = HttpMethod.parse(methodArg);<NEW_LINE>} else if (arg.equals("-H")) {<NEW_LINE>String headerArg = removeArgFor(arg, args);<NEW_LINE>SimpleEntry<String, <MASK><NEW_LINE>headers.add(e);<NEW_LINE>} else if (arg.equals("-x")) {<NEW_LINE>String proxyArg = removeArgFor(arg, args);<NEW_LINE>proxy = parseProxy(proxyArg);<NEW_LINE>} else {<NEW_LINE>if (url != null) {<NEW_LINE>throw new IllegalArgumentException("'" + cmdLine + "' was not a valid curl command");<NEW_LINE>}<NEW_LINE>url = parseUrl(arg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (url == null) {<NEW_LINE>throw new IllegalArgumentException("'" + cmdLine + "' was not a valid curl command");<NEW_LINE>}<NEW_LINE>return new CurlOption(proxy, method, url, headers);<NEW_LINE>}
String> e = parseHeader(headerArg);
1,167,813
public Maintenance unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Maintenance maintenance = new Maintenance();<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("maintenanceDay", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>maintenance.setMaintenanceDay(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("maintenanceDeadline", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>maintenance.setMaintenanceDeadline(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("maintenanceScheduledDate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>maintenance.setMaintenanceScheduledDate(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("maintenanceStartHour", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>maintenance.setMaintenanceStartHour(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 maintenance;<NEW_LINE>}
class).unmarshall(context));
976,297
synchronized boolean doComplete(HashResponseHeaders headers) {<NEW_LINE>if (state != State.OPEN) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>state = State.COMPLETING;<NEW_LINE>try {<NEW_LINE>// Finish all registered before complete consumers<NEW_LINE>for (Consumer<ResponseHeaders> consumer : beforeCompleteConsumers) {<NEW_LINE>consumer.accept(headers);<NEW_LINE>}<NEW_LINE>// Lock and write response headers<NEW_LINE>rwLock<MASK><NEW_LINE>try {<NEW_LINE>state = State.COMPLETED;<NEW_LINE>Http.ResponseStatus status = (null == headers.httpStatus) ? Http.Status.OK_200 : headers.httpStatus;<NEW_LINE>status = (null == status) ? Http.Status.OK_200 : status;<NEW_LINE>Map<String, List<String>> rawHeaders = filterSpecificHeaders(headers.toMap(), status);<NEW_LINE>bareResponse.writeStatusAndHeaders(status, rawHeaders);<NEW_LINE>} finally {<NEW_LINE>rwLock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>} catch (Throwable th) {<NEW_LINE>bareResponse.onError(th);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.writeLock().lock();
1,361,869
private void addRemove(SourceBuilder code) {<NEW_LINE>code.addLine("").addLine("/**").addLine(" * Removes a single key-value pair with the key {@code key} and the value" + " {@code value}").addLine(" * from the multimap to be returned from %s.", datatype.getType().javadocNoArgMethodLink(property.getGetterName())).addLine(" *").addLine(" * @return this {@code %s} object", datatype.getBuilder().getSimpleName());<NEW_LINE>if (!unboxedKeyType.isPresent() || !unboxedValueType.isPresent()) {<NEW_LINE>code.add(" * @throws NullPointerException if ");<NEW_LINE>if (unboxedKeyType.isPresent()) {<NEW_LINE>code.add("{@code value}");<NEW_LINE>} else if (unboxedValueType.isPresent()) {<NEW_LINE>code.add("{@code key}");<NEW_LINE>} else {<NEW_LINE>code.add("either {@code key} or {@code value}");<NEW_LINE>}<NEW_LINE>code.add(" is null\n");<NEW_LINE>}<NEW_LINE>code.addLine(" */").addLine("public %s %s(%s key, %s value) {", datatype.getBuilder(), removeMethod(property), unboxedKeyType.orElse(keyType), unboxedValueType.orElse(valueType));<NEW_LINE>if (!unboxedKeyType.isPresent()) {<NEW_LINE>code.addLine(" %s.checkNotNull(key);", Preconditions.class);<NEW_LINE>}<NEW_LINE>if (!unboxedValueType.isPresent()) {<NEW_LINE>code.<MASK><NEW_LINE>}<NEW_LINE>code.addLine(" %s.remove(key, value);", property.getField()).addLine(" return (%s) this;", datatype.getBuilder()).addLine("}");<NEW_LINE>}
addLine(" %s.checkNotNull(value);", Preconditions.class);
442,161
public byte[] format(ProfileEvent event, HdfsIdConfig idConfig) {<NEW_LINE>long msgTime = event.getRawLogTime();<NEW_LINE>String partitionFieldValue = idConfig.parsePartitionField(msgTime);<NEW_LINE>String <MASK><NEW_LINE>byte[] partitionFieldBytes = partitionFieldValue.getBytes();<NEW_LINE>byte[] msgTimeFieldBytes = msgTimeFieldValue.getBytes();<NEW_LINE>byte[] formatBytes = new byte[partitionFieldBytes.length + SEPARATOR_LENGTH + msgTimeFieldBytes.length + SEPARATOR_LENGTH + event.getBody().length];<NEW_LINE>int index = 0;<NEW_LINE>System.arraycopy(partitionFieldBytes, 0, formatBytes, index, partitionFieldBytes.length);<NEW_LINE>index += partitionFieldBytes.length;<NEW_LINE>formatBytes[index] = (byte) idConfig.getSeparator().charAt(0);<NEW_LINE>index++;<NEW_LINE>System.arraycopy(msgTimeFieldBytes, 0, formatBytes, index, msgTimeFieldBytes.length);<NEW_LINE>index += msgTimeFieldBytes.length;<NEW_LINE>formatBytes[index] = (byte) idConfig.getSeparator().charAt(0);<NEW_LINE>index++;<NEW_LINE>System.arraycopy(event.getBody(), 0, formatBytes, index, event.getBody().length);<NEW_LINE>return formatBytes;<NEW_LINE>}
msgTimeFieldValue = idConfig.parseMsgTimeField(msgTime);
1,744,967
public static void showChangePathsDialog(final MainActivity mainActivity, final SharedPreferences prefs) {<NEW_LINE>final MainFragment mainFragment = mainActivity.getCurrentMainFragment();<NEW_LINE>Objects.requireNonNull(mainActivity);<NEW_LINE>final MaterialDialog.Builder a = new MaterialDialog.Builder(mainActivity);<NEW_LINE>a.input(null, mainFragment.getCurrentPath(), false, (dialog, charSequence) -> {<NEW_LINE>boolean isAccessible = FileUtils.isPathAccessible(<MASK><NEW_LINE>dialog.getActionButton(DialogAction.POSITIVE).setEnabled(isAccessible);<NEW_LINE>});<NEW_LINE>a.alwaysCallInputCallback();<NEW_LINE>int accentColor = mainActivity.getAccent();<NEW_LINE>a.widgetColor(accentColor);<NEW_LINE>a.theme(mainActivity.getAppTheme().getMaterialDialogTheme(mainActivity.getApplicationContext()));<NEW_LINE>a.title(R.string.enterpath);<NEW_LINE>a.positiveText(R.string.go);<NEW_LINE>a.positiveColor(accentColor);<NEW_LINE>a.negativeText(R.string.cancel);<NEW_LINE>a.negativeColor(accentColor);<NEW_LINE>a.onPositive((dialog, which) -> {<NEW_LINE>mainFragment.loadlist(dialog.getInputEditText().getText().toString(), false, OpenMode.UNKNOWN);<NEW_LINE>});<NEW_LINE>a.show();<NEW_LINE>}
charSequence.toString(), prefs);