idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,529,054
final EnableResult executeEnable(EnableRequest enableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableRequest> request = null;<NEW_LINE>Response<EnableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Inspector2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "Enable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
6,987
private void processLine(ResourceFile file, String configLine, int lineNumber) throws IOException {<NEW_LINE>String trimmedLine = configLine.trim();<NEW_LINE>if (trimmedLine.length() == 0) {<NEW_LINE>// ignore empty lines.<NEW_LINE>return;<NEW_LINE>} else if (trimmedLine.startsWith(NAME_IDENTIFIER)) {<NEW_LINE>processNameLine(trimmedLine);<NEW_LINE>} else if (trimmedLine.startsWith(DEPENDENCY_IDENTIFIER)) {<NEW_LINE>// ignore for now<NEW_LINE>} else if (trimmedLine.startsWith(EXCLUDE_FROM_GHIDRA_JAR)) {<NEW_LINE>String[] tokens = trimmedLine.split(":");<NEW_LINE>String value = tokens.length == 2 ? tokens[1].trim() : "";<NEW_LINE><MASK><NEW_LINE>} else if (trimmedLine.startsWith(MODULE_FILE_LICENSE)) {<NEW_LINE>processModuleFileLicense(trimmedLine);<NEW_LINE>} else if (trimmedLine.startsWith(COMMENT_IDENTIFIER)) {<NEW_LINE>// this is a comment line--ignore!<NEW_LINE>} else if (trimmedLine.startsWith(DATA_SEARCH_IGNORE_DIR)) {<NEW_LINE>processDataSearchIgnoreDir(trimmedLine);<NEW_LINE>} else if (trimmedLine.startsWith(MODULE_DIR_IDENTIFIER)) {<NEW_LINE>// do nothing for now<NEW_LINE>} else if (trimmedLine.startsWith(FAT_JAR)) {<NEW_LINE>processFatJar(trimmedLine);<NEW_LINE>} else {<NEW_LINE>String message = "Module manifest file error on line " + (lineNumber + 1) + " of file: " + file + "\n\t-> Invalid line encountered: " + trimmedLine;<NEW_LINE>Msg.debug(this, message);<NEW_LINE>}<NEW_LINE>}
excludeFromGhidraJar = Boolean.valueOf(value);
884,445
public static DescribeModelServiceResponse unmarshall(DescribeModelServiceResponse describeModelServiceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeModelServiceResponse.setRequestId(_ctx.stringValue("DescribeModelServiceResponse.RequestId"));<NEW_LINE>describeModelServiceResponse.setCode(_ctx.stringValue("DescribeModelServiceResponse.Code"));<NEW_LINE>describeModelServiceResponse.setMessage(_ctx.stringValue("DescribeModelServiceResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setModelServiceInstanceId(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelServiceInstanceId"));<NEW_LINE>data.setModelServiceStatus(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelServiceStatus"));<NEW_LINE>data.setModelServiceInstanceName<MASK><NEW_LINE>data.setAlgorithmCode(_ctx.stringValue("DescribeModelServiceResponse.Data.AlgorithmCode"));<NEW_LINE>data.setQps(_ctx.longValue("DescribeModelServiceResponse.Data.Qps"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("DescribeModelServiceResponse.Data.CreateTime"));<NEW_LINE>data.setAppCode(_ctx.stringValue("DescribeModelServiceResponse.Data.AppCode"));<NEW_LINE>List<ModelApi> modelApiList = new ArrayList<ModelApi>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeModelServiceResponse.Data.ModelApiList.Length"); i++) {<NEW_LINE>ModelApi modelApi = new ModelApi();<NEW_LINE>modelApi.setAlgorithmApiCode(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelApiList[" + i + "].AlgorithmApiCode"));<NEW_LINE>modelApi.setApiId(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelApiList[" + i + "].ApiId"));<NEW_LINE>modelApi.setApiName(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelApiList[" + i + "].ApiName"));<NEW_LINE>modelApi.setApiPath(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelApiList[" + i + "].ApiPath"));<NEW_LINE>modelApi.setCreateTime(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelApiList[" + i + "].CreateTime"));<NEW_LINE>modelApiList.add(modelApi);<NEW_LINE>}<NEW_LINE>data.setModelApiList(modelApiList);<NEW_LINE>describeModelServiceResponse.setData(data);<NEW_LINE>return describeModelServiceResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeModelServiceResponse.Data.ModelServiceInstanceName"));
342,514
private boolean checkPreconditions() throws Exception {<NEW_LINE>// Find local changes<NEW_LINE>StatusOperation statusOperation = new StatusOperation(config, options.getStatusOptions());<NEW_LINE>StatusOperationResult statusOperationResult = statusOperation.execute();<NEW_LINE><MASK><NEW_LINE>result.getStatusResult().setChangeSet(localChanges);<NEW_LINE>if (!localChanges.hasChanges()) {<NEW_LINE>logger.log(Level.INFO, "Local database is up-to-date (change set). NOTHING TO DO!");<NEW_LINE>result.setResultCode(UpResultCode.OK_NO_CHANGES);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Check if other operations are running<NEW_LINE>if (otherRemoteOperationsRunning(CleanupOperation.ACTION_ID)) {<NEW_LINE>logger.log(Level.INFO, "* Cleanup running. Skipping down operation.");<NEW_LINE>result.setResultCode(UpResultCode.NOK_UNKNOWN_DATABASES);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Find remote changes (unless --force is enabled)<NEW_LINE>if (!options.forceUploadEnabled()) {<NEW_LINE>LsRemoteOperationResult lsRemoteOperationResult = new LsRemoteOperation(config, transferManager).execute();<NEW_LINE>List<DatabaseRemoteFile> unknownRemoteDatabases = lsRemoteOperationResult.getUnknownRemoteDatabases();<NEW_LINE>if (unknownRemoteDatabases.size() > 0) {<NEW_LINE>logger.log(Level.INFO, "There are remote changes. Call 'down' first or use --force-upload you must, Luke!");<NEW_LINE>logger.log(Level.FINE, "Unknown remote databases are: " + unknownRemoteDatabases);<NEW_LINE>result.setResultCode(UpResultCode.NOK_UNKNOWN_DATABASES);<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>logger.log(Level.INFO, "No remote changes, ready to upload.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.log(Level.INFO, "Force (--force-upload) is enabled, ignoring potential remote changes.");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
ChangeSet localChanges = statusOperationResult.getChangeSet();
1,090,684
default Constraint table(IntVar var1, IntVar var2, Tuples tuples, String algo) {<NEW_LINE>Propagator<IntVar> p;<NEW_LINE>if (tuples.allowUniversalValue()) {<NEW_LINE>p = new PropCompactTableStar(new IntVar[] { var1, var2 }, tuples);<NEW_LINE>} else {<NEW_LINE>switch(algo) {<NEW_LINE>case "CT+":<NEW_LINE>p = new PropCompactTable(new IntVar[] { var1, var2 }, tuples);<NEW_LINE>break;<NEW_LINE>case "AC2001":<NEW_LINE>p = new PropBinAC2001(var1, var2, tuples);<NEW_LINE>break;<NEW_LINE>case "FC":<NEW_LINE>p = new PropBinFC(var1, var2, tuples);<NEW_LINE>break;<NEW_LINE>case "AC3":<NEW_LINE>p = new PropBinAC3(var1, var2, tuples);<NEW_LINE>break;<NEW_LINE>case "AC3rm":<NEW_LINE>p = new <MASK><NEW_LINE>break;<NEW_LINE>case "AC3bit+rm":<NEW_LINE>p = new PropBinAC3bitrm(var1, var2, tuples);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new SolverException("Table algorithm " + algo + " is unkown");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Constraint(ConstraintsName.TABLE, p);<NEW_LINE>}
PropBinAC3rm(var1, var2, tuples);
944,963
private void updateShipmentOrderRequestPO(@NonNull final DeliveryOrder deliveryOrder) {<NEW_LINE>for (// only a single delivery position should exist<NEW_LINE>// only a single delivery position should exist<NEW_LINE>final DeliveryPosition deliveryPosition : deliveryOrder.getDeliveryPositions()) {<NEW_LINE>final ImmutableList<PackageId> packageIdsAsList = deliveryPosition<MASK><NEW_LINE>for (int i = 0; i < deliveryPosition.getNumberOfPackages(); i++) {<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>final DhlCustomDeliveryData customDeliveryData = DhlCustomDeliveryData.cast(deliveryOrder.getCustomDeliveryData());<NEW_LINE>final I_DHL_ShipmentOrder shipmentOrder = getShipmentOrderByRequestIdAndPackageId(deliveryOrder.getId().getRepoId(), packageIdsAsList.get(i).getRepoId());<NEW_LINE>final DhlCustomDeliveryDataDetail deliveryDetail = customDeliveryData.getDetailBySequenceNumber(DhlSequenceNumber.of(shipmentOrder.getDHL_ShipmentOrder_ID()));<NEW_LINE>final String awb = deliveryDetail.getAwb();<NEW_LINE>if (awb != null) {<NEW_LINE>shipmentOrder.setawb(awb);<NEW_LINE>}<NEW_LINE>final byte[] pdfData = deliveryDetail.getPdfLabelData();<NEW_LINE>if (pdfData != null) {<NEW_LINE>shipmentOrder.setPdfLabelData(pdfData);<NEW_LINE>}<NEW_LINE>final String trackingUrl = deliveryDetail.getTrackingUrl();<NEW_LINE>if (trackingUrl != null) {<NEW_LINE>shipmentOrder.setTrackingURL(trackingUrl);<NEW_LINE>}<NEW_LINE>InterfaceWrapperHelper.save(shipmentOrder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getPackageIds().asList();
1,137,175
public static void simulateClickFromTouchEvent(Event touchevent, Widget widget) {<NEW_LINE>Touch touch = touchevent.getChangedTouches().get(0);<NEW_LINE>final NativeEvent createMouseUpEvent = Document.get().createMouseUpEvent(0, touch.getScreenX(), touch.getScreenY(), touch.getClientX(), touch.getClientY(), false, false, false, false, NativeEvent.BUTTON_LEFT);<NEW_LINE>final NativeEvent createMouseDownEvent = Document.get().createMouseDownEvent(0, touch.getScreenX(), touch.getScreenY(), touch.getClientX(), touch.getClientY(), false, false, <MASK><NEW_LINE>final NativeEvent createMouseClickEvent = Document.get().createClickEvent(0, touch.getScreenX(), touch.getScreenY(), touch.getClientX(), touch.getClientY(), false, false, false, false);<NEW_LINE>final Element target = getElementFromPoint(touch.getClientX(), touch.getClientY());<NEW_LINE>Widget targetWidget = findWidget(target);<NEW_LINE>if (targetWidget instanceof com.google.gwt.user.client.ui.Focusable) {<NEW_LINE>final com.google.gwt.user.client.ui.Focusable toBeFocusedWidget = (com.google.gwt.user.client.ui.Focusable) targetWidget;<NEW_LINE>toBeFocusedWidget.setFocus(true);<NEW_LINE>} else if (targetWidget instanceof Focusable) {<NEW_LINE>((Focusable) targetWidget).focus();<NEW_LINE>}<NEW_LINE>Scheduler.get().scheduleDeferred(() -> {<NEW_LINE>try {<NEW_LINE>target.dispatchEvent(createMouseDownEvent);<NEW_LINE>target.dispatchEvent(createMouseUpEvent);<NEW_LINE>target.dispatchEvent(createMouseClickEvent);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
false, false, NativeEvent.BUTTON_LEFT);
1,734,961
// snippet-start:[workdocs.java2.download_user_docs.main]<NEW_LINE>public static void downloadDoc(WorkDocsClient workDocs, String orgId, String userEmail, String workdocsName, String saveDocFullName) {<NEW_LINE>try {<NEW_LINE>Map<String, String> map = getDocInfo(workDocs, orgId, userEmail, workdocsName);<NEW_LINE>if (map.isEmpty()) {<NEW_LINE>System.out.println("Could not get info about workdoc " + workdocsName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String docId = map.get("doc_id");<NEW_LINE>String versionId = map.get("version_id");<NEW_LINE>if (docId.isEmpty() || versionId.isEmpty()) {<NEW_LINE>System.out.println("Could not get info about workdoc " + workdocsName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the URL that is used to download the content.<NEW_LINE>String downloadUrl = getDownloadDocUrl(workDocs, docId, versionId, workdocsName);<NEW_LINE>// Get doc from provided URL.<NEW_LINE>URL docUrl = new URL(downloadUrl);<NEW_LINE>URLConnection urlConn = docUrl.openConnection();<NEW_LINE>Path destination = Paths.get(saveDocFullName);<NEW_LINE>try (final InputStream in = urlConn.getInputStream()) {<NEW_LINE>Files.copy(in, destination);<NEW_LINE>System.out.println(<MASK><NEW_LINE>}<NEW_LINE>} catch (WorkDocsException | MalformedURLException e) {<NEW_LINE>System.out.println(e.getLocalizedMessage());<NEW_LINE>System.exit(1);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
"Downloaded " + workdocsName + " to: " + saveDocFullName);
1,605,719
protected void loadPreferences(DBPPreferenceStore store) {<NEW_LINE>try {<NEW_LINE>csAutoActivationCheck.setSelection(store.getBoolean(SQLPreferenceConstants.ENABLE_AUTO_ACTIVATION));<NEW_LINE>csHippieActivation.setSelection(store.getBoolean(SQLPreferenceConstants.ENABLE_HIPPIE));<NEW_LINE>csAutoActivationDelaySpinner.setSelection(store.getInt(SQLPreferenceConstants.AUTO_ACTIVATION_DELAY));<NEW_LINE>csAutoActivateOnKeystroke.setSelection(store.getBoolean(SQLPreferenceConstants.ENABLE_KEYSTROKE_ACTIVATION));<NEW_LINE>csAutoInsertCheck.setSelection(store.getBoolean(SQLPreferenceConstants.INSERT_SINGLE_PROPOSALS_AUTO));<NEW_LINE>csInsertCase.select(store.getInt(SQLPreferenceConstants.PROPOSAL_INSERT_CASE));<NEW_LINE>csReplaceWordAfter.setSelection(store.getBoolean(SQLPreferenceConstants.PROPOSAL_REPLACE_WORD));<NEW_LINE>csHideDuplicates.setSelection(store.getBoolean(SQLPreferenceConstants.HIDE_DUPLICATE_PROPOSALS));<NEW_LINE>csShortName.setSelection(store.getBoolean(SQLPreferenceConstants.PROPOSAL_SHORT_NAME));<NEW_LINE>csLongName.setSelection(store.getBoolean(SQLPreferenceConstants.PROPOSAL_ALWAYS_FQ));<NEW_LINE>csInsertSpace.setSelection(store<MASK><NEW_LINE>csSortAlphabetically.setSelection(store.getBoolean(SQLPreferenceConstants.PROPOSAL_SORT_ALPHABETICALLY));<NEW_LINE>csShowServerHelpTopics.setSelection(store.getBoolean(SQLPreferenceConstants.SHOW_SERVER_HELP_TOPICS));<NEW_LINE>csInsertTableAlias.select(SQLTableAliasInsertMode.fromPreferences(store).ordinal());<NEW_LINE>csMatchContains.setSelection(store.getBoolean(SQLPreferenceConstants.PROPOSALS_MATCH_CONTAINS));<NEW_LINE>csUseGlobalSearch.setSelection(store.getBoolean(SQLPreferenceConstants.USE_GLOBAL_ASSISTANT));<NEW_LINE>csShowColumnProcedures.setSelection(store.getBoolean(SQLPreferenceConstants.SHOW_COLUMN_PROCEDURES));<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn(e);<NEW_LINE>}<NEW_LINE>}
.getBoolean(SQLPreferenceConstants.INSERT_SPACE_AFTER_PROPOSALS));
1,784,845
private Changes analyse(@NonNull final Context ctx, @NonNull final RootProcessor p, Predicate<ClassFile> accept) throws IOException, IllegalArgumentException {<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("ctx", ctx);<NEW_LINE>if (p.execute(accept)) {<NEW_LINE>if (!p.hasChanges() && timeStampsEmpty()) {<NEW_LINE>assert refs.isEmpty();<NEW_LINE>assert toDelete.isEmpty();<NEW_LINE>return Changes.UP_TO_DATE;<NEW_LINE>}<NEW_LINE>final List<Pair<ElementHandle<TypeElement>, Long>> newState = p.result();<NEW_LINE>final List<Pair<ElementHandle<TypeElement>, Long>> oldState = loadCRCs(cacheRoot);<NEW_LINE>final boolean preBuildArgs = p.preBuildArgs();<NEW_LINE>store();<NEW_LINE>storeCRCs(cacheRoot, newState);<NEW_LINE>storeTimeStamps();<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>writer.rollback();<NEW_LINE>return Changes.FAILURE;<NEW_LINE>}<NEW_LINE>}
diff(oldState, newState, preBuildArgs);
1,803,187
public static ResponseDefinitionBuilder like(ResponseDefinition responseDefinition) {<NEW_LINE>ResponseDefinitionBuilder builder = new ResponseDefinitionBuilder();<NEW_LINE>builder.status = responseDefinition.getStatus();<NEW_LINE>builder.statusMessage = responseDefinition.getStatusMessage();<NEW_LINE>builder.headers = responseDefinition.getHeaders() != null ? newArrayList(responseDefinition.getHeaders().all()) : Lists.<HttpHeader>newArrayList();<NEW_LINE>builder.body = responseDefinition.getReponseBody();<NEW_LINE>builder<MASK><NEW_LINE>builder.fixedDelayMilliseconds = responseDefinition.getFixedDelayMilliseconds();<NEW_LINE>builder.delayDistribution = responseDefinition.getDelayDistribution();<NEW_LINE>builder.chunkedDribbleDelay = responseDefinition.getChunkedDribbleDelay();<NEW_LINE>builder.proxyBaseUrl = responseDefinition.getProxyBaseUrl();<NEW_LINE>builder.fault = responseDefinition.getFault();<NEW_LINE>builder.responseTransformerNames = responseDefinition.getTransformers();<NEW_LINE>builder.transformerParameters = responseDefinition.getTransformerParameters() != null ? Parameters.from(responseDefinition.getTransformerParameters()) : Parameters.empty();<NEW_LINE>builder.wasConfigured = responseDefinition.isFromConfiguredStub();<NEW_LINE>return builder;<NEW_LINE>}
.bodyFileName = responseDefinition.getBodyFileName();
1,666,688
public void replaceBlock(@Sender EntityRef sender, @CommandParam("blockName") String uri, @CommandParam(value = "maxDistance", required = false) Integer maxDistanceParam) {<NEW_LINE>int maxDistance = maxDistanceParam != null ? maxDistanceParam : 12;<NEW_LINE>EntityRef playerEntity = sender.getComponent(ClientComponent.class).character;<NEW_LINE>EntityRef gazeEntity = GazeAuthoritySystem.getGazeEntityForCharacter(playerEntity);<NEW_LINE>LocationComponent gazeLocation = gazeEntity.getComponent(LocationComponent.class);<NEW_LINE>Set<ResourceUrn> matchingUris = Assets.resolveAssetUri(uri, BlockFamilyDefinition.class);<NEW_LINE>targetSystem.updateTarget(gazeLocation.getWorldPosition(new Vector3f()), gazeLocation.getWorldDirection(<MASK><NEW_LINE>EntityRef target = targetSystem.getTarget();<NEW_LINE>BlockComponent targetLocation = target.getComponent(BlockComponent.class);<NEW_LINE>if (matchingUris.size() == 1) {<NEW_LINE>Optional<BlockFamilyDefinition> def = Assets.get(matchingUris.iterator().next(), BlockFamilyDefinition.class);<NEW_LINE>if (def.isPresent()) {<NEW_LINE>BlockFamily blockFamily = blockManager.getBlockFamily(uri);<NEW_LINE>Block block = blockManager.getBlock(blockFamily.getURI());<NEW_LINE>world.setBlock(targetLocation.getPosition(), block);<NEW_LINE>} else if (matchingUris.size() > 1) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Non-unique shape name, possible matches: ");<NEW_LINE>Iterator<ResourceUrn> shapeUris = sortItems(matchingUris).iterator();<NEW_LINE>while (shapeUris.hasNext()) {<NEW_LINE>builder.append(shapeUris.next().toString());<NEW_LINE>if (shapeUris.hasNext()) {<NEW_LINE>builder.append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new Vector3f()), maxDistance);
1,210,130
private HttpRequest.Builder createUserRequestBuilder(User body) throws ApiException {<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");<NEW_LINE>}<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();<NEW_LINE>String localVarPath = "/user";<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));<NEW_LINE>localVarRequestBuilder.header("Content-Type", "application/json");<NEW_LINE>localVarRequestBuilder.header("Accept", "application/json");<NEW_LINE>try {<NEW_LINE>byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);<NEW_LINE>localVarRequestBuilder.method("POST", HttpRequest<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ApiException(e);<NEW_LINE>}<NEW_LINE>if (memberVarReadTimeout != null) {<NEW_LINE>localVarRequestBuilder.timeout(memberVarReadTimeout);<NEW_LINE>}<NEW_LINE>if (memberVarInterceptor != null) {<NEW_LINE>memberVarInterceptor.accept(localVarRequestBuilder);<NEW_LINE>}<NEW_LINE>return localVarRequestBuilder;<NEW_LINE>}
.BodyPublishers.ofByteArray(localVarPostBody));
1,346,791
private void updateContext(Map<String, Object> value) {<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object <MASK><NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>if (values instanceof ContextEntity) {<NEW_LINE>map = ((ContextEntity) values).getContextMap();<NEW_LINE>} else if (values instanceof Model) {<NEW_LINE>map = Mapper.toMap(value);<NEW_LINE>} else if (values instanceof Map) {<NEW_LINE>map = (Map<String, Object>) values;<NEW_LINE>}<NEW_LINE>values = value.get("attrs");<NEW_LINE>if (values instanceof Map) {<NEW_LINE>for (Object key : ((Map<String, Object>) values).keySet()) {<NEW_LINE>String name = key.toString();<NEW_LINE>Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) values).get(key);<NEW_LINE>if (attrs.containsKey("value")) {<NEW_LINE>map.put(name, attrs.get("value"));<NEW_LINE>}<NEW_LINE>if (attrs.containsKey("value:set")) {<NEW_LINE>map.put(name, attrs.get("value:set"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.putAll(map);<NEW_LINE>}
values = value.get("values");
1,346,583
private String loginAndGetId(HttpRequestFactory requestFactory, String tld) throws IOException {<NEW_LINE>logger.atInfo().log("Logging in to MoSAPI.");<NEW_LINE>HttpRequest request = requestFactory.buildGetRequest(new GenericUrl(String.format(LOGIN_URL, tld)));<NEW_LINE>request.getHeaders().setBasicAuthentication(String.format("%s_ry", tld), password);<NEW_LINE>HttpResponse response = request.execute();<NEW_LINE>Optional<HttpCookie> idCookie = response.getHeaders().getHeaderStringValues("Set-Cookie").stream().flatMap(value -> HttpCookie.parse(value).stream()).filter(cookie -> cookie.getName().equals(COOKIE_ID)).findAny();<NEW_LINE>checkState(idCookie.isPresent(), "Didn't get the ID cookie from the login response. Code: %s, headers: %s", response.getStatusCode(), response.getHeaders());<NEW_LINE>return idCookie<MASK><NEW_LINE>}
.get().getValue();
542,087
public void destroyJoint(Joint j) {<NEW_LINE>assertNotLocked();<NEW_LINE>boolean collideConnected = j.getCollideConnected();<NEW_LINE>joints.removeValueByIdentity(j);<NEW_LINE>// Disconnect from island graph.<NEW_LINE><MASK><NEW_LINE>Body bodyB = j.getBodyB();<NEW_LINE>// Wake up connected bodies.<NEW_LINE>bodyA.setAwake(true);<NEW_LINE>bodyB.setAwake(true);<NEW_LINE>// Remove from body 1.<NEW_LINE>if (j.m_edgeA.prev != null) {<NEW_LINE>j.m_edgeA.prev.next = j.m_edgeA.next;<NEW_LINE>}<NEW_LINE>if (j.m_edgeA.next != null) {<NEW_LINE>j.m_edgeA.next.prev = j.m_edgeA.prev;<NEW_LINE>}<NEW_LINE>if (j.m_edgeA == bodyA.m_jointList) {<NEW_LINE>bodyA.m_jointList = j.m_edgeA.next;<NEW_LINE>}<NEW_LINE>j.m_edgeA.prev = null;<NEW_LINE>j.m_edgeA.next = null;<NEW_LINE>// Remove from body 2<NEW_LINE>if (j.m_edgeB.prev != null) {<NEW_LINE>j.m_edgeB.prev.next = j.m_edgeB.next;<NEW_LINE>}<NEW_LINE>if (j.m_edgeB.next != null) {<NEW_LINE>j.m_edgeB.next.prev = j.m_edgeB.prev;<NEW_LINE>}<NEW_LINE>if (j.m_edgeB == bodyB.m_jointList) {<NEW_LINE>bodyB.m_jointList = j.m_edgeB.next;<NEW_LINE>}<NEW_LINE>j.m_edgeB.prev = null;<NEW_LINE>j.m_edgeB.next = null;<NEW_LINE>Joint.destroy(j);<NEW_LINE>--jointCount;<NEW_LINE>// If the joint prevents collisions, then flag any contacts for filtering.<NEW_LINE>if (!collideConnected) {<NEW_LINE>flagContactsForFiltering(bodyA, bodyB);<NEW_LINE>}<NEW_LINE>}
Body bodyA = j.getBodyA();
1,363,778
public AssertionCondition putAssertionCondition(String domainName, String policyName, Long assertionId, String auditRef, AssertionCondition assertionCondition) {<NEW_LINE>WebTarget target = base.path("/domain/{domainName}/policy/{policyName}/assertion/{assertionId}/condition").resolveTemplate("domainName", domainName).resolveTemplate("policyName", policyName).resolveTemplate("assertionId", assertionId);<NEW_LINE>Invocation.Builder invocationBuilder = target.request("application/json");<NEW_LINE>if (credsHeader != null) {<NEW_LINE>invocationBuilder = credsHeader.startsWith("Cookie.") ? invocationBuilder.cookie(credsHeader.substring(7), credsToken) : invocationBuilder.header(credsHeader, credsToken);<NEW_LINE>}<NEW_LINE>if (auditRef != null) {<NEW_LINE>invocationBuilder = invocationBuilder.header("Y-Audit-Ref", auditRef);<NEW_LINE>}<NEW_LINE>Response response = invocationBuilder.put(javax.ws.rs.client.Entity.entity(assertionCondition, "application/json"));<NEW_LINE>int code = response.getStatus();<NEW_LINE>switch(code) {<NEW_LINE>case 200:<NEW_LINE>return response.readEntity(AssertionCondition.class);<NEW_LINE>default:<NEW_LINE>throw new ResourceException(code, response<MASK><NEW_LINE>}<NEW_LINE>}
.readEntity(ResourceError.class));
674,989
private void writeFile(String filenameNoExtension, BufferedWriter writer, int pageNumber, int pageCount, List<String> list) throws Exception {<NEW_LINE>writeHeader(writer);<NEW_LINE>writer.write("<P>\n");<NEW_LINE>writer.write("<TABLE BORDER=\"1\">\n");<NEW_LINE>int start = pageNumber * ITEMS_PER_PAGE;<NEW_LINE>if (start > 0) {<NEW_LINE>// 25 * 0 = 0<NEW_LINE>// 25 * 1 = 25 => 26<NEW_LINE>// each page should start on the next item after the last end<NEW_LINE>start++;<NEW_LINE>}<NEW_LINE>int n = Math.min(ITEMS_PER_PAGE, <MASK><NEW_LINE>int end = start + n;<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>String newFilePath = list.get(i);<NEW_LINE>int originalExtention = newFilePath.indexOf(PNG_EXT);<NEW_LINE>int length = originalExtention + PNG_EXT.length();<NEW_LINE>String oldFilePath = newFilePath.substring(0, length);<NEW_LINE>// @formatter:off<NEW_LINE>writer.write(" <TR>\n");<NEW_LINE>writer.write(" <TD>\n");<NEW_LINE>writer.write(" <IMG SRC=\"" + oldFilePath + "\" ALT=\"" + oldFilePath + ".html\"><BR>\n");<NEW_LINE>writer.write(" <CENTER><FONT COLOR=\"GRAY\">" + oldFilePath + "</FONT></CENTER>\n");<NEW_LINE>writer.write(" </TD>\n");<NEW_LINE>writer.write(" <TD>\n");<NEW_LINE>writer.write(" <IMG SRC=\"" + newFilePath + "\" ALT=\"" + newFilePath + ".html\"><BR>\n");<NEW_LINE>writer.write(" <CENTER><FONT COLOR=\"GRAY\">" + newFilePath + "</FONT></CENTER>\n");<NEW_LINE>writer.write(" </TD>\n");<NEW_LINE>writer.write(" </TR>\n");<NEW_LINE>// @formatter:on<NEW_LINE>}<NEW_LINE>writer.write("</TABLE>\n");<NEW_LINE>writer.write("</P>");<NEW_LINE>writeFooter(filenameNoExtension, writer, pageCount);<NEW_LINE>}
list.size() - start);
226,970
private Mono<PagedResponse<ConfigurationProfileInner>> listChildResourcesSinglePageAsync(String configurationProfileName, String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (configurationProfileName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter configurationProfileName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listChildResources(this.client.getEndpoint(), configurationProfileName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,262,469
public Object executeCommand(String commandId, List<Object> arguments, IProgressMonitor monitor) throws Exception {<NEW_LINE>Map<String, Object> obj = (Map<String, Object>) arguments.get(0);<NEW_LINE>String uri = (String) obj.get("projectUri");<NEW_LINE>URI projectUri = URI.create(uri);<NEW_LINE>String bindingKey = (<MASK><NEW_LINE>Boolean lookInOtherProjects = (Boolean) obj.get("lookInOtherProjects");<NEW_LINE>String content = JavadocUtils.javadoc(JavadocContentAccess2::getMarkdownContentReader, projectUri, bindingKey, JavaDataParams.isLookInOtherProjects(uri, lookInOtherProjects));<NEW_LINE>if (content == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>MarkupContent mc = new MarkupContent();<NEW_LINE>mc.setKind(MarkupKind.MARKDOWN);<NEW_LINE>mc.setValue(content);<NEW_LINE>return mc;<NEW_LINE>}<NEW_LINE>}
String) obj.get("bindingKey");
1,558,258
private static <SectionInfo, SymbolInfo> LLVMSectionInfo<SectionInfo, SymbolInfo> readSection(Path path, SectionName sectionName, SectionReader<SectionInfo> sectionReader, SymbolReader<SymbolInfo> symbolReader) {<NEW_LINE>byte[] bytes;<NEW_LINE>try {<NEW_LINE>bytes = Files.readAllBytes(path);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new GraalError(e);<NEW_LINE>}<NEW_LINE>LLVMMemoryBufferRef buffer = LLVM.LLVMCreateMemoryBufferWithMemoryRangeCopy(new BytePointer(bytes), bytes.length, new BytePointer(""));<NEW_LINE>LLVMObjectFileRef <MASK><NEW_LINE>LLVMSectionIteratorRef sectionIterator;<NEW_LINE>LLVMSectionInfo<SectionInfo, SymbolInfo> result = new LLVMSectionInfo<>();<NEW_LINE>for (sectionIterator = LLVM.LLVMGetSections(objectFile); LLVM.LLVMIsSectionIteratorAtEnd(objectFile, sectionIterator) == FALSE; LLVM.LLVMMoveToNextSection(sectionIterator)) {<NEW_LINE>BytePointer sectionNamePointer = LLVM.LLVMGetSectionName(sectionIterator);<NEW_LINE>String currentSectionName = (sectionNamePointer != null) ? sectionNamePointer.getString() : "";<NEW_LINE>if (currentSectionName.startsWith(sectionName.getFormatDependentName(ObjectFile.getNativeFormat()))) {<NEW_LINE>result.sectionInfo = sectionReader.apply(sectionIterator);<NEW_LINE>if (symbolReader != null) {<NEW_LINE>LLVMSymbolIteratorRef symbolIterator;<NEW_LINE>for (symbolIterator = LLVM.LLVMGetSymbols(objectFile); LLVM.LLVMIsSymbolIteratorAtEnd(objectFile, symbolIterator) == FALSE; LLVM.LLVMMoveToNextSymbol(symbolIterator)) {<NEW_LINE>if (LLVM.LLVMGetSectionContainsSymbol(sectionIterator, symbolIterator) == TRUE) {<NEW_LINE>result.symbolInfo.add(symbolReader.apply(symbolIterator, sectionIterator));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LLVM.LLVMDisposeSymbolIterator(symbolIterator);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LLVM.LLVMDisposeSectionIterator(sectionIterator);<NEW_LINE>LLVM.LLVMDisposeObjectFile(objectFile);<NEW_LINE>return result;<NEW_LINE>}
objectFile = LLVM.LLVMCreateObjectFile(buffer);
436,057
private static void cycleExistingSearch(final Window parent, final ZyGraph graph, final GraphSearcher searcher, final boolean cycleBackwards, final boolean zoomToResult) {<NEW_LINE>// If the searcher didn't change since last time, we only skip to<NEW_LINE>// the previous (CTRL+ENTER) or next (ENTER) search result. (SHIFT zooms to target)<NEW_LINE>if (cycleBackwards) {<NEW_LINE>searcher.getCursor().previous();<NEW_LINE>if (searcher.getCursor().isBeforeFirst()) {<NEW_LINE>CMessageBox.showInformation(parent, "All search results were displayed. Going back to the last one");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>searcher.getCursor().next();<NEW_LINE>if (searcher.getCursor().isAfterLast()) {<NEW_LINE>CMessageBox.showInformation(parent, "All search results were displayed. Going back to the first one");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final SearchResult result = searcher.getCursor().current();<NEW_LINE>if (result == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (result.getObject() instanceof NaviNode) {<NEW_LINE>ZyGraphHelpers.centerNode(graph, (NaviNode) <MASK><NEW_LINE>} else if (result.getObject() instanceof NaviEdge) {<NEW_LINE>ZyGraphHelpers.centerEdgeLabel(graph, (NaviEdge) result.getObject(), zoomToResult);<NEW_LINE>}<NEW_LINE>}
result.getObject(), zoomToResult);
1,398,634
public static void notifyFileDeleted(String path) {<NEW_LINE>Log.d(TAG, "Notifying others about deleted file: " + path);<NEW_LINE>if (VERSION.SDK_INT < VERSION_CODES.KITKAT) {<NEW_LINE>// on older devices, fake a remount of the media<NEW_LINE>// The media mounted broadcast is very taxing on the system, so<NEW_LINE>// we only do this if for 5 seconds there was no same request,<NEW_LINE>// otherwise we wait again.<NEW_LINE>// the broadcast might have been requested already, cancel if so<NEW_LINE>sTimer.cancel();<NEW_LINE>// that timer is of no value any more, create a new one<NEW_LINE>sTimer = new Timer();<NEW_LINE>// and in 5s let it send the broadcast, might never happen if before<NEW_LINE>// that time it gets canceled by this code path<NEW_LINE>sTimer.schedule(new TimerTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Log.d(TAG, "Sending ACTION_MEDIA_MOUNTED broadcast");<NEW_LINE>final Context context = App.getAppContext();<NEW_LINE>Uri uri = Uri.parse("file://" + Environment.getExternalStorageDirectory());<NEW_LINE>Intent intent = new <MASK><NEW_LINE>context.sendBroadcast(intent);<NEW_LINE>}<NEW_LINE>}, 5000);<NEW_LINE>} else {<NEW_LINE>// on newer devices, we hope that this works correctly:<NEW_LINE>Context context = App.getAppContext();<NEW_LINE>MediaScannerConnection.scanFile(context, new String[] { path }, null, new ScanCompletedListener());<NEW_LINE>}<NEW_LINE>}
Intent(Intent.ACTION_MEDIA_MOUNTED, uri);
820,468
public void lookupContent(final byte[] hash, final String[] networks, final RelatedContentLookupListener listener) throws ContentException {<NEW_LINE>if (hash == null) {<NEW_LINE>throw (new ContentException("hash is null"));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (net == 0) {<NEW_LINE>throw (new ContentException("No networks specified"));<NEW_LINE>}<NEW_LINE>if (!initialisation_complete_sem.isReleasedForever() || (public_dht_plugin != null && public_dht_plugin.isInitialising())) {<NEW_LINE>AsyncDispatcher dispatcher = new AsyncDispatcher();<NEW_LINE>dispatcher.dispatch(new AERunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runSupport() {<NEW_LINE>try {<NEW_LINE>initialisation_complete_sem.reserve();<NEW_LINE>lookupContentSupport(hash, 0, net, true, listener);<NEW_LINE>} catch (ContentException e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>lookupContentSupport(hash, 0, net, true, listener);<NEW_LINE>}<NEW_LINE>}
final byte net = convertNetworks(networks);
675,093
public void write(org.apache.thrift.protocol.TProtocol prot, getTableConfiguration_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 3);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>oprot.writeString(struct.tableName);<NEW_LINE>}<NEW_LINE>}
struct.credentials.write(oprot);
858,876
public WebResponse invokeFirstClient(String testcase, WebConversation wc, TestSettings settings, List<validationData> expectations) throws Exception {<NEW_LINE>String thisMethod = "invokeFirstClient";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>WebRequest request = null;<NEW_LINE>WebResponse response = null;<NEW_LINE>try {<NEW_LINE>// set the mark to the end of all logs to ensure that any<NEW_LINE>// checking for<NEW_LINE>// messages is done only for this step of the testing<NEW_LINE>setMarkToEndOfAllServersLogs();<NEW_LINE>// Start the OAuth request by invoking the client<NEW_LINE>Log.info(thisClass, thisMethod, "firstClientUrl: " + settings.getFirstClientURL());<NEW_LINE>request = new GetMethodWebRequest(settings.getFirstClientURL());<NEW_LINE>// Invoke the client<NEW_LINE>response = wc.getResponse(request);<NEW_LINE>msgUtils.printResponseParts(response, thisMethod, "Response from firstClientURL: ");<NEW_LINE>validationTools.validateResult(response, Constants.INVOKE_OAUTH_CLIENT, expectations, settings);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.error(thisClass, <MASK><NEW_LINE>System.err.println("Exception: " + e);<NEW_LINE>validationTools.validateException(expectations, Constants.INVOKE_OAUTH_CLIENT, e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
testcase, e, "Exception occurred in " + thisMethod);
1,534,040
public void write(org.apache.thrift.protocol.TProtocol prot, TKey struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache<MASK><NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetRow()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetColFamily()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetColQualifier()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetColVisibility()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetTimestamp()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 5);<NEW_LINE>if (struct.isSetRow()) {<NEW_LINE>oprot.writeBinary(struct.row);<NEW_LINE>}<NEW_LINE>if (struct.isSetColFamily()) {<NEW_LINE>oprot.writeBinary(struct.colFamily);<NEW_LINE>}<NEW_LINE>if (struct.isSetColQualifier()) {<NEW_LINE>oprot.writeBinary(struct.colQualifier);<NEW_LINE>}<NEW_LINE>if (struct.isSetColVisibility()) {<NEW_LINE>oprot.writeBinary(struct.colVisibility);<NEW_LINE>}<NEW_LINE>if (struct.isSetTimestamp()) {<NEW_LINE>oprot.writeI64(struct.timestamp);<NEW_LINE>}<NEW_LINE>}
.thrift.protocol.TTupleProtocol) prot;
1,001,949
final GetLensVersionDifferenceResult executeGetLensVersionDifference(GetLensVersionDifferenceRequest getLensVersionDifferenceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLensVersionDifferenceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetLensVersionDifferenceRequest> request = null;<NEW_LINE>Response<GetLensVersionDifferenceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLensVersionDifferenceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getLensVersionDifferenceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WellArchitected");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetLensVersionDifference");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetLensVersionDifferenceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLensVersionDifferenceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
135,219
public Rule build() {<NEW_LINE>return logicalJoin().then(join -> {<NEW_LINE>if (!join.getOtherJoinCondition().isPresent()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Expression> otherConjuncts = ExpressionUtils.extractConjunction(join.getOtherJoinCondition().get());<NEW_LINE>List<Expression> leftConjuncts = Lists.newArrayList();<NEW_LINE>List<Expression> rightConjuncts = Lists.newArrayList();<NEW_LINE>for (Expression otherConjunct : otherConjuncts) {<NEW_LINE>if (PUSH_DOWN_LEFT_VALID_TYPE.contains(join.getJoinType()) && allCoveredBy(otherConjunct, join.left().getOutputSet())) {<NEW_LINE>leftConjuncts.add(otherConjunct);<NEW_LINE>}<NEW_LINE>if (PUSH_DOWN_RIGHT_VALID_TYPE.contains(join.getJoinType()) && allCoveredBy(otherConjunct, join.right().getOutputSet())) {<NEW_LINE>rightConjuncts.add(otherConjunct);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (leftConjuncts.isEmpty() && rightConjuncts.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>otherConjuncts.removeAll(leftConjuncts);<NEW_LINE>otherConjuncts.removeAll(rightConjuncts);<NEW_LINE>Plan left = PlanUtils.filterOrSelf(leftConjuncts, join.left());<NEW_LINE>Plan right = PlanUtils.filterOrSelf(rightConjuncts, join.right());<NEW_LINE>return new LogicalJoin<>(join.getJoinType(), join.getHashJoinConjuncts(), ExpressionUtils.optionalAnd(otherConjuncts), left, right);<NEW_LINE>}<MASK><NEW_LINE>}
).toRule(RuleType.PUSHDOWN_JOIN_OTHER_CONDITION);
1,778,052
public void saveSettings(DBWHandlerConfiguration configuration) {<NEW_LINE>credentialsPanel.saveSettings(configuration, "");<NEW_LINE>final String jumpServerSettingsPrefix = SSHImplementationAbstract.getJumpServerSettingsPrefix(0);<NEW_LINE>jumpServerCredentialsPanel.saveSettings(configuration, jumpServerSettingsPrefix);<NEW_LINE>configuration.setProperty(jumpServerSettingsPrefix + RegistryConstants.ATTR_ENABLED, jumpServerEnabledCheck.getSelection());<NEW_LINE>String implLabel = tunnelImplCombo.getText();<NEW_LINE>for (SSHImplementationDescriptor it : SSHImplementationRegistry.getInstance().getDescriptors()) {<NEW_LINE>if (it.getLabel().equals(implLabel)) {<NEW_LINE>configuration.setProperty(SSHConstants.PROP_IMPLEMENTATION, it.getId());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>configuration.setProperty(SSHConstants.PROP_BYPASS_HOST_VERIFICATION, fingerprintVerificationCheck.getSelection());<NEW_LINE>configuration.setProperty(SSHConstants.PROP_LOCAL_HOST, localHostText.getText().trim());<NEW_LINE>int localPort = CommonUtils.toInt(localPortSpinner.getText());<NEW_LINE>if (localPort <= 0) {<NEW_LINE>configuration.setProperty(SSHConstants.PROP_LOCAL_PORT, null);<NEW_LINE>} else {<NEW_LINE>configuration.<MASK><NEW_LINE>}<NEW_LINE>configuration.setProperty(SSHConstants.PROP_REMOTE_HOST, remoteHostText.getText().trim());<NEW_LINE>int remotePort = CommonUtils.toInt(remotePortSpinner.getText());<NEW_LINE>if (remotePort <= 0) {<NEW_LINE>configuration.setProperty(SSHConstants.PROP_REMOTE_PORT, null);<NEW_LINE>} else {<NEW_LINE>configuration.setProperty(SSHConstants.PROP_REMOTE_PORT, remotePort);<NEW_LINE>}<NEW_LINE>int kaInterval = CommonUtils.toInt(keepAliveText.getText());<NEW_LINE>if (kaInterval <= 0) {<NEW_LINE>configuration.setProperty(SSHConstants.PROP_ALIVE_INTERVAL, null);<NEW_LINE>} else {<NEW_LINE>configuration.setProperty(SSHConstants.PROP_ALIVE_INTERVAL, kaInterval);<NEW_LINE>}<NEW_LINE>int conTimeout = CommonUtils.toInt(tunnelTimeout.getText());<NEW_LINE>if (conTimeout != 0 && conTimeout != SSHConstants.DEFAULT_CONNECT_TIMEOUT) {<NEW_LINE>configuration.setProperty(SSHConstants.PROP_CONNECT_TIMEOUT, conTimeout);<NEW_LINE>}<NEW_LINE>}
setProperty(SSHConstants.PROP_LOCAL_PORT, localPort);
442,414
public void mergeType(TransactionType old, TransactionType other) {<NEW_LINE>long totalCountSum = old.getTotalCount() + other.getTotalCount();<NEW_LINE>if (totalCountSum > 0) {<NEW_LINE>double line50Values = old.getLine50Value() * old.getTotalCount() + other.getLine50Value() * other.getTotalCount();<NEW_LINE>double line90Values = old.getLine90Value() * old.getTotalCount() + other.getLine90Value() * other.getTotalCount();<NEW_LINE>double line95Values = old.getLine95Value() * old.getTotalCount() + other.getLine95Value() * other.getTotalCount();<NEW_LINE>double line99Values = old.getLine99Value() * old.getTotalCount() + other.getLine99Value() * other.getTotalCount();<NEW_LINE>double line999Values = old.getLine999Value() * old.getTotalCount() + other.getLine999Value() * other.getTotalCount();<NEW_LINE>double line9999Values = old.getLine9999Value() * old.getTotalCount() + other.getLine9999Value() * other.getTotalCount();<NEW_LINE>old.setLine50Value(line50Values / totalCountSum);<NEW_LINE>old.setLine90Value(line90Values / totalCountSum);<NEW_LINE><MASK><NEW_LINE>old.setLine99Value(line99Values / totalCountSum);<NEW_LINE>old.setLine999Value(line999Values / totalCountSum);<NEW_LINE>old.setLine9999Value(line9999Values / totalCountSum);<NEW_LINE>}<NEW_LINE>old.setTotalCount(totalCountSum);<NEW_LINE>old.setFailCount(old.getFailCount() + other.getFailCount());<NEW_LINE>old.setTps(old.getTps() + other.getTps());<NEW_LINE>if (other.getMin() < old.getMin()) {<NEW_LINE>old.setMin(other.getMin());<NEW_LINE>}<NEW_LINE>if (other.getMax() > old.getMax()) {<NEW_LINE>old.setMax(other.getMax());<NEW_LINE>old.setLongestMessageUrl(other.getLongestMessageUrl());<NEW_LINE>}<NEW_LINE>old.setSum(old.getSum() + other.getSum());<NEW_LINE>old.setSum2(old.getSum2() + other.getSum2());<NEW_LINE>if (old.getTotalCount() > 0) {<NEW_LINE>old.setFailPercent(old.getFailCount() * 100.0 / old.getTotalCount());<NEW_LINE>old.setAvg(old.getSum() / old.getTotalCount());<NEW_LINE>old.setStd(std(old.getTotalCount(), old.getAvg(), old.getSum2(), old.getMax()));<NEW_LINE>}<NEW_LINE>if (old.getSuccessMessageUrl() == null) {<NEW_LINE>old.setSuccessMessageUrl(other.getSuccessMessageUrl());<NEW_LINE>}<NEW_LINE>if (old.getFailMessageUrl() == null) {<NEW_LINE>old.setFailMessageUrl(other.getFailMessageUrl());<NEW_LINE>}<NEW_LINE>}
old.setLine95Value(line95Values / totalCountSum);
409,333
static Credentials editCredentials(Credentials existing, Set<String> registries) {<NEW_LINE>assert SwingUtilities.isEventDispatchThread();<NEW_LINE>try {<NEW_LINE>JButton actionButton = new JButton();<NEW_LINE>Mnemonics.setLocalizedText(actionButton, Bundle.LBL_OK());<NEW_LINE>CredentialsPanel panel = new CredentialsPanel(actionButton, registries);<NEW_LINE>if (existing != null) {<NEW_LINE>panel.setCredentials(existing);<NEW_LINE>}<NEW_LINE>DialogDescriptor descriptor = new DialogDescriptor(panel, Bundle.LBL_CredentialsDetailTitle(), true, new Object[] { actionButton, DialogDescriptor.CANCEL_OPTION }, actionButton, DialogDescriptor.DEFAULT_ALIGN, null, null);<NEW_LINE>descriptor.setClosingOptions(new Object[] <MASK><NEW_LINE>panel.setMessageLine(descriptor.createNotificationLineSupport());<NEW_LINE>Dialog dlg = null;<NEW_LINE>try {<NEW_LINE>dlg = DialogDisplayer.getDefault().createDialog(descriptor);<NEW_LINE>dlg.setVisible(true);<NEW_LINE>if (descriptor.getValue() == actionButton) {<NEW_LINE>Credentials credentials = panel.getCredentials();<NEW_LINE>CredentialsManager.getDefault().setCredentials(credentials);<NEW_LINE>return credentials;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (dlg != null) {<NEW_LINE>dlg.dispose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
{ actionButton, DialogDescriptor.CANCEL_OPTION });
590,711
private void updateHotelRating(@NonNull Sponsored.HotelInfo info) {<NEW_LINE>if (info.mReviews == null || info.mReviews.length == 0) {<NEW_LINE>UiUtils.hide(mHotelReview);<NEW_LINE>} else {<NEW_LINE>UiUtils.show(mHotelReview);<NEW_LINE>mReviewAdapter.setItems(new ArrayList<>(Arrays.asList(info.mReviews)));<NEW_LINE>Objects.requireNonNull(mSponsored);<NEW_LINE>Impress impress = Impress.values(<MASK><NEW_LINE>Context context = getContext();<NEW_LINE>String ratingText = context.getString(R.string.place_page_booking_rating, mSponsored.getRating()).concat(" (").concat(context.getString(impress.getTextId())).concat(")");<NEW_LINE>mHotelRating.setText(ratingText);<NEW_LINE>int reviewsCount = (int) info.mReviewsAmount;<NEW_LINE>String text = getResources().getQuantityString(R.plurals.placepage_summary_rating_description, reviewsCount, reviewsCount);<NEW_LINE>mHotelRatingBase.setText(text);<NEW_LINE>TextView previewReviewCountView = mPreviewRatingInfo.findViewById(R.id.tv__review_count);<NEW_LINE>previewReviewCountView.setText(text);<NEW_LINE>}<NEW_LINE>}
)[mSponsored.getImpress()];
352,790
private Mono<Response<Void>> startWithResponseAsync(String resourceGroupName, String name, 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 (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.start(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.<MASK><NEW_LINE>}
client.getApiVersion(), context);
1,668,207
private boolean readSafeBlock() throws IOException {<NEW_LINE>if (endOfStream)<NEW_LINE>return false;<NEW_LINE>byte[] storedHmac = baseStream.readBytes(32);<NEW_LINE>if (storedHmac == null || storedHmac.length != 32) {<NEW_LINE>throw new IOException("File corrupted");<NEW_LINE>}<NEW_LINE>byte[] pbBlockIndex = LEDataOutputStream.writeLongBuf(blockIndex);<NEW_LINE>byte[] pbBlockSize = baseStream.readBytes(4);<NEW_LINE>if (pbBlockSize == null || pbBlockSize.length != 4) {<NEW_LINE>throw new IOException("File corrupted");<NEW_LINE>}<NEW_LINE>int blockSize = LEDataInputStream.readInt(pbBlockSize, 0);<NEW_LINE>bufferPos = 0;<NEW_LINE>buffer = baseStream.readBytes(blockSize);<NEW_LINE>if (verify) {<NEW_LINE>byte[] cmpHmac;<NEW_LINE>byte[] blockKey = HmacBlockStream.GetHmacKey64(key, blockIndex);<NEW_LINE>Mac hmac;<NEW_LINE>try {<NEW_LINE>hmac = Mac.getInstance("HmacSHA256");<NEW_LINE>SecretKeySpec signingKey = new SecretKeySpec(blockKey, "HmacSHA256");<NEW_LINE>hmac.init(signingKey);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new IOException("Invalid Hmac");<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>throw new IOException("Invalid Hmac");<NEW_LINE>}<NEW_LINE>hmac.update(pbBlockIndex);<NEW_LINE>hmac.update(pbBlockSize);<NEW_LINE>if (buffer.length > 0) {<NEW_LINE>hmac.update(buffer);<NEW_LINE>}<NEW_LINE>cmpHmac = hmac.doFinal();<NEW_LINE>Arrays.fill<MASK><NEW_LINE>if (!Arrays.equals(cmpHmac, storedHmac)) {<NEW_LINE>throw new IOException("Invalid Hmac");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>blockIndex++;<NEW_LINE>if (blockSize == 0) {<NEW_LINE>endOfStream = true;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(blockKey, (byte) 0);
431,170
final DescribeDetectorResult executeDescribeDetector(DescribeDetectorRequest describeDetectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDetectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDetectorRequest> request = null;<NEW_LINE>Response<DescribeDetectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDetectorRequest));<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, "IoT Events Data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDetectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDetectorResultJsonUnmarshaller());<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());
203,880
public ServiceDeclarationNode transform(ServiceDeclarationNode serviceDeclarationNode) {<NEW_LINE>MetadataNode metadata = modifyNode(serviceDeclarationNode.metadata().orElse(null));<NEW_LINE>NodeList<Token> qualifiers = modifyNodeList(serviceDeclarationNode.qualifiers());<NEW_LINE>Token serviceKeyword = modifyToken(serviceDeclarationNode.serviceKeyword());<NEW_LINE>TypeDescriptorNode typeDescriptor = modifyNode(serviceDeclarationNode.typeDescriptor().orElse(null));<NEW_LINE>NodeList<Node> absoluteResourcePath = modifyNodeList(serviceDeclarationNode.absoluteResourcePath());<NEW_LINE>Token onKeyword = modifyToken(serviceDeclarationNode.onKeyword());<NEW_LINE>SeparatedNodeList<ExpressionNode> expressions = <MASK><NEW_LINE>Token openBraceToken = modifyToken(serviceDeclarationNode.openBraceToken());<NEW_LINE>NodeList<Node> members = modifyNodeList(serviceDeclarationNode.members());<NEW_LINE>Token closeBraceToken = modifyToken(serviceDeclarationNode.closeBraceToken());<NEW_LINE>return serviceDeclarationNode.modify(metadata, qualifiers, serviceKeyword, typeDescriptor, absoluteResourcePath, onKeyword, expressions, openBraceToken, members, closeBraceToken);<NEW_LINE>}
modifySeparatedNodeList(serviceDeclarationNode.expressions());
1,486,737
private Object doExecute() {<NEW_LINE>try {<NEW_LINE>if (this.debugger != null) {<NEW_LINE>this.debugger.setGlobalContext(executionContext());<NEW_LINE>}<NEW_LINE>Completion completion = executionContext().execute(program(), this.debugger);<NEW_LINE>if (completion.type == Completion.Type.BREAK || completion.type == Completion.Type.CONTINUE) {<NEW_LINE>throw new ThrowException(executionContext(), executionContext().createSyntaxError("illegal break or continue"));<NEW_LINE>}<NEW_LINE>Object v = completion.value;<NEW_LINE>if (v instanceof Reference) {<NEW_LINE>return ((Reference) v).getValue(context);<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>} catch (SyntaxError e) {<NEW_LINE>throw new ThrowException(executionContext(), executionContext().createSyntaxError<MASK><NEW_LINE>} catch (ParserException e) {<NEW_LINE>throw new ThrowException(executionContext(), e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ThrowException(executionContext(), e);<NEW_LINE>}<NEW_LINE>}
(e.getMessage()));
797,633
public void reset(final BaseActivity activity, final RedditCommentListItem comment, final boolean updateOnly) {<NEW_LINE>if (!updateOnly) {<NEW_LINE>if (!comment.isComment()) {<NEW_LINE>throw new RuntimeException("Not a comment");<NEW_LINE>}<NEW_LINE>if (mComment != comment) {<NEW_LINE>if (mComment != null) {<NEW_LINE>mChangeDataManager.removeListener(mComment.asComment(), this);<NEW_LINE>}<NEW_LINE>mChangeDataManager.addListener(comment.asComment(), this);<NEW_LINE>}<NEW_LINE>mComment = comment;<NEW_LINE>resetSwipeState();<NEW_LINE>}<NEW_LINE>mIndentView.setIndentation(comment.getIndent());<NEW_LINE>final boolean hideLinkButtons = comment.asComment().getParsedComment().getRawComment().author.equalsIgnoreCase("autowikibot");<NEW_LINE>mBodyHolder.removeAllViews();<NEW_LINE>final View commentBody = comment.asComment().getBody(activity, mTheme.rrCommentBodyCol, 13.0f * mBodyFontScale, mShowLinkButtons && !hideLinkButtons);<NEW_LINE>mBodyHolder.addView(commentBody);<NEW_LINE>General.setLayoutMatchWidthWrapHeight(commentBody);<NEW_LINE>((MarginLayoutParams) commentBody.getLayoutParams()).topMargin = General.dpToPixels(activity, 1);<NEW_LINE>final RedditRenderableComment renderableComment = mComment.asComment();<NEW_LINE>final int ageUnits = PrefsUtility.appearance_comment_age_units();<NEW_LINE>final long postTimestamp = (mFragment != null && mFragment.getPost() != null) ? mFragment.getPost().src.getCreatedTimeSecsUTC() : RedditRenderableComment.NO_TIMESTAMP;<NEW_LINE>final long parentCommentTimestamp = mComment.getParent() != null ? mComment.getParent().asComment().getParsedComment().getRawComment().created_utc : RedditRenderableComment.NO_TIMESTAMP;<NEW_LINE>final boolean isCollapsed = mComment.isCollapsed(mChangeDataManager);<NEW_LINE>final CharSequence headerText = renderableComment.getHeader(mTheme, mChangeDataManager, activity, ageUnits, postTimestamp, parentCommentTimestamp);<NEW_LINE>mHeader.setContentDescription(renderableComment.getAccessibilityHeader(mTheme, mChangeDataManager, activity, ageUnits, postTimestamp, parentCommentTimestamp, isCollapsed, Optional.of(<MASK><NEW_LINE>if (isCollapsed) {<NEW_LINE>setFlingingEnabled(false);<NEW_LINE>// noinspection SetTextI18n<NEW_LINE>mHeader.setText(// Note that this removes formatting (which is fine)<NEW_LINE>"[ + ] " + headerText);<NEW_LINE>mBodyHolder.setVisibility(GONE);<NEW_LINE>} else {<NEW_LINE>setFlingingEnabled(true);<NEW_LINE>mHeader.setText(headerText);<NEW_LINE>mBodyHolder.setVisibility(VISIBLE);<NEW_LINE>}<NEW_LINE>}
comment.getIndent())));
162,908
public static VQSLODTranche mergeAndConvertTranches(final List<VQSLODTranche> scatteredTranches, VariantRecalibratorArgumentCollection.Mode mode) {<NEW_LINE>double indexVQSLOD = scatteredTranches.get(0).minVQSLod;<NEW_LINE>int sumNumKnown = 0;<NEW_LINE>double sumKnownTransitions = 0;<NEW_LINE>double sumKnownTransversions = 0;<NEW_LINE>int sumNumNovel = 0;<NEW_LINE>double sumNovelTransitions = 0;<NEW_LINE>double sumNovelTransversions = 0;<NEW_LINE>int sumAccessibleTruthSites = 0;<NEW_LINE>int sumCallsAtTruthSites = 0;<NEW_LINE>for (final VQSLODTranche tranche : scatteredTranches) {<NEW_LINE>if (tranche.minVQSLod != indexVQSLOD)<NEW_LINE>throw new IllegalStateException("Scattered tranches do not contain the same VQSLODs");<NEW_LINE>sumNumKnown += tranche.numKnown;<NEW_LINE>double trancheKnownTransitions = (tranche.knownTiTv * tranche.numKnown) <MASK><NEW_LINE>sumKnownTransitions += trancheKnownTransitions;<NEW_LINE>sumKnownTransversions += (tranche.numKnown - trancheKnownTransitions);<NEW_LINE>sumNumNovel += tranche.numNovel;<NEW_LINE>double trancheNovelTransitions = (tranche.novelTiTv * tranche.numNovel) / (1 + tranche.novelTiTv);<NEW_LINE>sumNovelTransitions += trancheNovelTransitions;<NEW_LINE>sumNovelTransversions += (tranche.numNovel - trancheNovelTransitions);<NEW_LINE>sumAccessibleTruthSites += tranche.accessibleTruthSites;<NEW_LINE>sumCallsAtTruthSites += tranche.callsAtTruthSites;<NEW_LINE>}<NEW_LINE>return new VQSLODTranche(indexVQSLOD, sumNumKnown, sumKnownTransitions / sumKnownTransversions, sumNumNovel, sumNovelTransitions / sumNovelTransversions, sumAccessibleTruthSites, sumCallsAtTruthSites, mode, "gathered" + indexVQSLOD);<NEW_LINE>}
/ (1 + tranche.knownTiTv);
967,909
protected void encodeButton(FacesContext context, DataView dataview, String layout, String icon, boolean isActive) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = dataview.getClientId(context);<NEW_LINE>String buttonClass = isActive ? DataView.BUTTON_CLASS + " ui-state-active" : DataView.BUTTON_CLASS;<NEW_LINE>// button<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("class", buttonClass, null);<NEW_LINE>writer.writeAttribute("tabindex", 0, null);<NEW_LINE>// input<NEW_LINE>writer.startElement("input", null);<NEW_LINE>writer.writeAttribute("id", clientId + "_" + layout, null);<NEW_LINE>writer.writeAttribute("name", clientId, null);<NEW_LINE>writer.writeAttribute("type", "radio", null);<NEW_LINE>writer.writeAttribute("value", layout, null);<NEW_LINE>writer.writeAttribute("class", "ui-helper-hidden-accessible", null);<NEW_LINE>writer.writeAttribute("tabindex", "-1", null);<NEW_LINE>if (isActive) {<NEW_LINE>writer.writeAttribute("checked", "checked", null);<NEW_LINE>}<NEW_LINE>writer.endElement("input");<NEW_LINE>// icon<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", HTML.<MASK><NEW_LINE>writer.endElement("span");<NEW_LINE>// label<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", HTML.BUTTON_TEXT_CLASS, null);<NEW_LINE>writer.write("ui-button");<NEW_LINE>writer.endElement("span");<NEW_LINE>writer.endElement("div");<NEW_LINE>}
BUTTON_LEFT_ICON_CLASS + " " + icon, null);
1,010,012
public Status insert(String table, String key, Map<String, ByteIterator> values) {<NEW_LINE>try {<NEW_LINE>Set<String> fields = values.keySet();<NEW_LINE>PreparedStatement stmt = INSERT_STMTS.get(fields);<NEW_LINE>// Prepare statement on demand<NEW_LINE>if (stmt == null) {<NEW_LINE>Insert insertStmt = QueryBuilder.insertInto(table);<NEW_LINE>// Add key<NEW_LINE>insertStmt.value(YCSB_KEY, QueryBuilder.bindMarker());<NEW_LINE>// Add fields<NEW_LINE>for (String field : fields) {<NEW_LINE>insertStmt.value(<MASK><NEW_LINE>}<NEW_LINE>if (lwt) {<NEW_LINE>insertStmt.ifNotExists();<NEW_LINE>}<NEW_LINE>stmt = session.prepare(insertStmt);<NEW_LINE>stmt.setConsistencyLevel(writeConsistencyLevel);<NEW_LINE>if (trace) {<NEW_LINE>stmt.enableTracing();<NEW_LINE>}<NEW_LINE>PreparedStatement prevStmt = INSERT_STMTS.putIfAbsent(new HashSet<>(fields), stmt);<NEW_LINE>if (prevStmt != null) {<NEW_LINE>stmt = prevStmt;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug(stmt.getQueryString());<NEW_LINE>LOGGER.debug("key = {}", key);<NEW_LINE>for (Map.Entry<String, ByteIterator> entry : values.entrySet()) {<NEW_LINE>LOGGER.debug("{} = {}", entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add key<NEW_LINE>BoundStatement boundStmt = stmt.bind().setString(0, key);<NEW_LINE>// Add fields<NEW_LINE>ColumnDefinitions vars = stmt.getVariables();<NEW_LINE>for (int i = 1; i < vars.size(); i++) {<NEW_LINE>boundStmt.setString(i, values.get(vars.getName(i)).toString());<NEW_LINE>}<NEW_LINE>session.execute(boundStmt);<NEW_LINE>return Status.OK;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(MessageFormatter.format("Error inserting key: {}", key).getMessage(), e);<NEW_LINE>}<NEW_LINE>return Status.ERROR;<NEW_LINE>}
field, QueryBuilder.bindMarker());
632,050
private String decodeName(byte[] b_data, int pos) {<NEW_LINE>try {<NEW_LINE>int Flags = 0;<NEW_LINE>int FlagBits = 0;<NEW_LINE>byte[] Name = b_data;<NEW_LINE>byte[] EncName = b_data;<NEW_LINE>int EncSize = b_data.length;<NEW_LINE>int MaxDecSize = 4096;<NEW_LINE>int[] NameW = new int[MaxDecSize];<NEW_LINE>int EncPos = pos;<NEW_LINE>int DecPos = 0;<NEW_LINE>byte HighByte = EncName[EncPos++];<NEW_LINE>while (EncPos < EncSize && DecPos < MaxDecSize) {<NEW_LINE>if (FlagBits == 0) {<NEW_LINE>Flags = EncName[EncPos++];<NEW_LINE>FlagBits = 8;<NEW_LINE>}<NEW_LINE>switch((Flags >> 6) & 0x03) {<NEW_LINE>case 0:<NEW_LINE>{<NEW_LINE>NameW[DecPos++] = EncName[EncPos++] & 0xff;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>NameW[DecPos++] = (EncName[EncPos++] & 0xff) + ((HighByte << 8) & 0xff00);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>NameW[DecPos++] = (EncName[EncPos++] & 0xff) + ((EncName[EncPos++] << 8) & 0xff00);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 3:<NEW_LINE>{<NEW_LINE>int Length = EncName[EncPos++] & 0xff;<NEW_LINE>if ((Length & 0x80) != 0) {<NEW_LINE>byte Correction = EncName[EncPos++];<NEW_LINE>for (Length = (Length & 0x7f) + 2; Length > 0 && DecPos < MaxDecSize; Length--, DecPos++) {<NEW_LINE>NameW[DecPos] = ((Name[DecPos] + Correction) & 0xff) + (<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Length += 2; Length > 0 && DecPos < MaxDecSize; Length--, DecPos++) {<NEW_LINE>NameW[DecPos] = Name[DecPos] & 0xff;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Flags <<= 2;<NEW_LINE>FlagBits -= 2;<NEW_LINE>}<NEW_LINE>byte[] temp = new byte[DecPos * 2];<NEW_LINE>for (int i = 0; i < DecPos; i++) {<NEW_LINE>temp[i * 2] = (byte) ((NameW[i] >> 8) & 0xff);<NEW_LINE>temp[i * 2 + 1] = (byte) ((NameW[i]) & 0xff);<NEW_LINE>}<NEW_LINE>return (new String(temp, "UTF-16BE"));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.outNoStack("Failed to decode name: " + ByteFormatter.encodeString(b_data) + " - " + Debug.getNestedExceptionMessage(e));<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>}
(HighByte << 8) & 0xff00);
1,552,262
void draw(Graphics g) {<NEW_LINE>setBbox(point1, point2, opheight * 2);<NEW_LINE>setVoltageColor(g, volts[0]);<NEW_LINE>drawThickLine(g, in1p[0], in1p[1]);<NEW_LINE>setVoltageColor(g, volts[1]);<NEW_LINE>drawThickLine(g, in2p[0], in2p[1]);<NEW_LINE>setVoltageColor(g, volts[2]);<NEW_LINE><MASK><NEW_LINE>setVoltageColor(g, volts[3]);<NEW_LINE>drawThickLine(g, rail1p[0], rail1p[1]);<NEW_LINE>setVoltageColor(g, volts[4]);<NEW_LINE>drawThickLine(g, rail2p[0], rail2p[1]);<NEW_LINE>g.setColor(needsHighlight() ? selectColor : lightGrayColor);<NEW_LINE>setPowerColor(g, true);<NEW_LINE>drawThickPolygon(g, triangle);<NEW_LINE>g.setFont(plusFont);<NEW_LINE>drawCenteredText(g, "-", textp[0].x, textp[0].y - 2, true);<NEW_LINE>drawCenteredText(g, "+", textp[1].x, textp[1].y, true);<NEW_LINE>int i;<NEW_LINE>for (i = 0; i != 5; i++) curCounts[i] = updateDotCount(getCurrentIntoNode(i), curCounts[i]);<NEW_LINE>drawDots(g, in1p[1], in1p[0], curCounts[0]);<NEW_LINE>drawDots(g, in2p[1], in2p[0], curCounts[1]);<NEW_LINE>drawDots(g, lead2, point2, curCounts[2]);<NEW_LINE>// these two segments may not be an event multiple of gridSize so we draw them the other way so the dots line up<NEW_LINE>drawDots(g, rail1p[0], rail1p[1], -curCounts[3]);<NEW_LINE>drawDots(g, rail2p[0], rail2p[1], -curCounts[4]);<NEW_LINE>drawPosts(g);<NEW_LINE>}
drawThickLine(g, lead2, point2);
94,310
public PendingDeploymentSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PendingDeploymentSummary pendingDeploymentSummary = new PendingDeploymentSummary();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("EndpointConfigName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>pendingDeploymentSummary.setEndpointConfigName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ProductionVariants", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>pendingDeploymentSummary.setProductionVariants(new ListUnmarshaller<PendingProductionVariantSummary>(PendingProductionVariantSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("StartTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>pendingDeploymentSummary.setStartTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 pendingDeploymentSummary;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
661,733
public Observable<ServiceResponse<PersistedFace>> addFaceFromStreamWithServiceResponseAsync(String faceListId, byte[] image, AddFaceFromStreamOptionalParameter addFaceFromStreamOptionalParameter) {<NEW_LINE>if (this.client.azureRegion() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (faceListId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter faceListId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (image == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter image is required and cannot be null.");<NEW_LINE>}<NEW_LINE>final String userData = addFaceFromStreamOptionalParameter != null ? addFaceFromStreamOptionalParameter.userData() : null;<NEW_LINE>final List<Integer> targetFace = addFaceFromStreamOptionalParameter != null ? addFaceFromStreamOptionalParameter.targetFace() : null;<NEW_LINE>return addFaceFromStreamWithServiceResponseAsync(<MASK><NEW_LINE>}
faceListId, image, userData, targetFace);
850,233
public ListChannelsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListChannelsResult listChannelsResult = new ListChannelsResult();<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 listChannelsResult;<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("channelSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listChannelsResult.setChannelSummaries(new ListUnmarshaller<ChannelSummary>(ChannelSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listChannelsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listChannelsResult;<NEW_LINE>}
class).unmarshall(context));
1,424,420
private void applyBridgeDomainVlanId(BridgeDomain bd, Map<String, Integer> irbVlanIds) {<NEW_LINE><MASK><NEW_LINE>if (vlanId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String routingInterfaceName = bd.getRoutingInterface();<NEW_LINE>if (routingInterfaceName == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: optimize<NEW_LINE>new BridgeDomainVlanIdVoidVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitBridgeDomainVlanIdAll() {<NEW_LINE>// nothing to do for now<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitBridgeDomainVlanIdNone() {<NEW_LINE>// nothing to do for now<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitBridgeDomainVlanIdNumber(BridgeDomainVlanIdNumber bridgeDomainVlanIdNumber) {<NEW_LINE>int vlan = bridgeDomainVlanIdNumber.getVlan();<NEW_LINE>// TODO: Need to determine whether a physical interface is necessary. If so, need to process<NEW_LINE>// several other configuration constructs, at least:<NEW_LINE>// Method 1:<NEW_LINE>// - interfaces <name> unit <num> family bridge interface-mode trunk<NEW_LINE>// - interfaces <name> unit <num> family bridge vlan-id-list <vlan-num><NEW_LINE>// Method 2:<NEW_LINE>// - interfaces <name> encapsulation extended-vlan-bridge<NEW_LINE>// - interfaces <name> unit <num> vlan-id <vlan-num><NEW_LINE>// Method 3:<NEW_LINE>// - routing-options bridge-domains <name> interface<NEW_LINE>// Until then, we disable autostate by modifying normal vlan range.<NEW_LINE>irbVlanIds.put(routingInterfaceName, vlan);<NEW_LINE>_c.setNormalVlanRange(_c.getNormalVlanRange().difference(IntegerSpace.of(vlan)));<NEW_LINE>}<NEW_LINE>}.visit(vlanId);<NEW_LINE>}
BridgeDomainVlanId vlanId = bd.getVlanId();
1,378,911
private LogisimVersion initFromVersionString(String versionString) throws IllegalArgumentException {<NEW_LINE>var major = 0;<NEW_LINE>var minor = 0;<NEW_LINE>var patch = 0;<NEW_LINE>var separator = "";<NEW_LINE>var suffix = "";<NEW_LINE>var pattern = "^(\\d+.\\d+.\\d+)(.*)$";<NEW_LINE>var m = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(versionString);<NEW_LINE>if (m.matches()) {<NEW_LINE>final var verStr = m.group(1);<NEW_LINE>final var sufStr = m.group(2);<NEW_LINE>final var parts = m.group(1).split("\\.");<NEW_LINE>try {<NEW_LINE>if (parts.length >= 1)<NEW_LINE>major = Integer.parseInt(parts[0]);<NEW_LINE>if (parts.length >= 2)<NEW_LINE>minor = Integer.parseInt(parts[1]);<NEW_LINE>if (parts.length >= 3)<NEW_LINE>patch = Integer.parseInt(parts[2]);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new IllegalArgumentException(String.format("Version segments must be non-negative integers, '%s' found.", verStr));<NEW_LINE>}<NEW_LINE>// suffix part<NEW_LINE>if (sufStr != null) {<NEW_LINE>if (sufStr.length() == 1) {<NEW_LINE>pattern = "^[a-z]+$";<NEW_LINE>m = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(sufStr);<NEW_LINE>if (!m.matches()) {<NEW_LINE>throw new IllegalArgumentException(String.format("Suffix must start with a letter, '%s' found.", sufStr));<NEW_LINE>}<NEW_LINE>suffix = sufStr;<NEW_LINE>} else if (sufStr.length() > 1) {<NEW_LINE>pattern = "^(-)?([a-z][a-z\\d]*)$";<NEW_LINE>m = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(sufStr);<NEW_LINE>if (!m.matches()) {<NEW_LINE>throw new IllegalArgumentException(String<MASK><NEW_LINE>}<NEW_LINE>final var sep = m.group(1);<NEW_LINE>separator = (sep != null) ? sep : "";<NEW_LINE>final var s = m.group(2);<NEW_LINE>suffix = (s != null) ? s : "";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.major = major;<NEW_LINE>this.minor = minor;<NEW_LINE>this.patch = patch;<NEW_LINE>this.separator = separator;<NEW_LINE>this.suffix = suffix;<NEW_LINE>return this;<NEW_LINE>}
.format("Invalid version suffix format. '%s' found.", sufStr));
776,425
protected void alterColumnType(DdlWrite writer, AlterColumn alter) {<NEW_LINE>String type = <MASK><NEW_LINE>DB2ColumnOptionsParser parser = new DB2ColumnOptionsParser(type);<NEW_LINE>alterTable(writer, alter.getTableName()).append(alterColumn, alter.getColumnName()).append(columnSetType).append(parser.getType());<NEW_LINE>if (parser.getInlineLength() != null) {<NEW_LINE>alterTable(writer, alter.getTableName()).append(alterColumn, alter.getColumnName()).append("set").appendWithSpace(parser.getInlineLength());<NEW_LINE>}<NEW_LINE>if (parser.hasExtraOptions()) {<NEW_LINE>alterTable(writer, alter.getTableName()).raw("-- ignored options for ").append(alter.getTableName()).append(".").append(alter.getColumnName()).append(": compact=").append(String.valueOf(parser.isCompact())).append(", logged=").append(String.valueOf(parser.isLogged()));<NEW_LINE>}<NEW_LINE>}
convert(alter.getType());
218,997
static // 27th Dec when Tue http://www.gov.za/sites/www.gov.za/files/34881_proc72.pdf<NEW_LINE>ImmutableHolidayCalendar generateJohannesburg() {<NEW_LINE>List<LocalDate> holidays <MASK><NEW_LINE>for (int year = 1950; year <= 2099; year++) {<NEW_LINE>// from 1995 (act of 7 Dec 1994)<NEW_LINE>// older act from 1952 not implemented here<NEW_LINE>// new year<NEW_LINE>holidays.add(bumpSunToMon(date(year, 1, 1)));<NEW_LINE>// human rights day<NEW_LINE>holidays.add(bumpSunToMon(date(year, 3, 21)));<NEW_LINE>// good friday<NEW_LINE>holidays.add(easter(year).minusDays(2));<NEW_LINE>// family day (easter monday)<NEW_LINE>holidays.add(easter(year).plusDays(1));<NEW_LINE>// freedom day<NEW_LINE>holidays.add(bumpSunToMon(date(year, 4, 27)));<NEW_LINE>// workers day<NEW_LINE>holidays.add(bumpSunToMon(date(year, 5, 1)));<NEW_LINE>// youth day<NEW_LINE>holidays.add(bumpSunToMon(date(year, 6, 16)));<NEW_LINE>// womens day<NEW_LINE>holidays.add(bumpSunToMon(date(year, 8, 9)));<NEW_LINE>// heritage day<NEW_LINE>holidays.add(bumpSunToMon(date(year, 9, 24)));<NEW_LINE>// reconcilliation<NEW_LINE>holidays.add(bumpSunToMon(date(year, 12, 16)));<NEW_LINE>// christmas<NEW_LINE>holidays.add(christmasBumpedSun(year));<NEW_LINE>// goodwill<NEW_LINE>holidays.add(boxingDayBumpedSun(year));<NEW_LINE>}<NEW_LINE>// mostly election days<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/40125_proc%2045.pdf<NEW_LINE>holidays.add(date(2016, 8, 3));<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/37376_proc13.pdf<NEW_LINE>holidays.add(date(2014, 5, 7));<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/34127_proc27.pdf<NEW_LINE>holidays.add(date(2011, 5, 18));<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/32039_17.pdf<NEW_LINE>holidays.add(date(2009, 4, 22));<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/30900_7.pdf (moved human rights day)<NEW_LINE>holidays.add(date(2008, 5, 2));<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/28442_0.pdf<NEW_LINE>holidays.add(date(2006, 3, 1));<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/26075.pdf<NEW_LINE>holidays.add(date(2004, 4, 14));<NEW_LINE>// http://www.gov.za/sites/www.gov.za/files/20032_0.pdf<NEW_LINE>holidays.add(date(1999, 12, 31));<NEW_LINE>holidays.add(date(2000, 1, 1));<NEW_LINE>holidays.add(date(2000, 1, 2));<NEW_LINE>removeSatSun(holidays);<NEW_LINE>return ImmutableHolidayCalendar.of(HolidayCalendarId.of("ZAJO"), holidays, SATURDAY, SUNDAY);<NEW_LINE>}
= new ArrayList<>(2000);
446,441
public Response variables(SQL sql, SecurityContext securityContext) {<NEW_LINE>try {<NEW_LINE>RequestValidationHandler.validateSQL(sql);<NEW_LINE>PhysicalPlan physicalPlan = serviceProvider.getPlanner().parseSQLToPhysicalPlan(sql.getSql());<NEW_LINE>if (!(physicalPlan instanceof ShowPlan) && !(physicalPlan instanceof QueryPlan)) {<NEW_LINE>return Response.ok().entity(new ExecutionStatus().code(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode()).message(TSStatusCode.EXECUTE_STATEMENT_ERROR.name())).build();<NEW_LINE>}<NEW_LINE>Response response = authorizationHandler.checkAuthority(securityContext, physicalPlan);<NEW_LINE>if (response != null) {<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>final long queryId = ServiceProvider.SESSION_MANAGER.requestQueryId(true);<NEW_LINE>try {<NEW_LINE>QueryContext queryContext = serviceProvider.genQueryContext(queryId, physicalPlan.isDebug(), System.currentTimeMillis(), sql.getSql(), IoTDBConstant.DEFAULT_CONNECTION_TIMEOUT_MS);<NEW_LINE>QueryDataSet queryDataSet = serviceProvider.createQueryDataSet(queryContext, physicalPlan, IoTDBConstant.DEFAULT_FETCH_SIZE);<NEW_LINE>return <MASK><NEW_LINE>} finally {<NEW_LINE>ServiceProvider.SESSION_MANAGER.releaseQueryResourceNoExceptions(queryId);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return Response.ok().entity(ExceptionHandler.tryCatchException(e)).build();<NEW_LINE>}<NEW_LINE>}
QueryDataSetHandler.fillGrafanaVariablesResult(queryDataSet, physicalPlan);
527,102
public void mouseDragged(Canvas canvas, Graphics g, MouseEvent e) {<NEW_LINE>if (exists) {<NEW_LINE>Canvas.snapToGrid(e);<NEW_LINE>int curX = e.getX();<NEW_LINE>int curY = e.getY();<NEW_LINE>if (!computeMove(curX, curY))<NEW_LINE>return;<NEW_LINE>hasDragged = true;<NEW_LINE><MASK><NEW_LINE>rect.add(start.getX(), start.getY());<NEW_LINE>rect.add(cur.getX(), cur.getY());<NEW_LINE>rect.add(curX, curY);<NEW_LINE>rect.grow(3, 3);<NEW_LINE>cur = Location.create(curX, curY);<NEW_LINE>super.mouseDragged(canvas, g, e);<NEW_LINE>Wire shorten = null;<NEW_LINE>if (startShortening) {<NEW_LINE>for (final var w : canvas.getCircuit().getWires(start)) {<NEW_LINE>if (w.contains(cur)) {<NEW_LINE>shorten = w;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (shorten == null) {<NEW_LINE>for (final var w : canvas.getCircuit().getWires(cur)) {<NEW_LINE>if (w.contains(start)) {<NEW_LINE>shorten = w;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>shortening = shorten;<NEW_LINE>canvas.repaint(rect);<NEW_LINE>}<NEW_LINE>}
final var rect = new Rectangle();
1,504,331
public static PipelineResult run(FileFormatConversionOptions options) {<NEW_LINE>String inputFileFormat = options.getInputFileFormat().toUpperCase();<NEW_LINE>String outputFileFormat = options.getOutputFileFormat().toUpperCase();<NEW_LINE>validFileFormats.<MASK><NEW_LINE>validFileFormats.put(ValidFileFormats.AVRO, "AVRO");<NEW_LINE>validFileFormats.put(ValidFileFormats.PARQUET, "PARQUET");<NEW_LINE>try {<NEW_LINE>if (inputFileFormat.equals(outputFileFormat)) {<NEW_LINE>LOG.error("Input and output file format cannot be the same.");<NEW_LINE>throw new IOException();<NEW_LINE>}<NEW_LINE>if (!validFileFormats.containsValue(inputFileFormat) || !validFileFormats.containsValue(outputFileFormat)) {<NEW_LINE>LOG.error("Invalid input or output file format.");<NEW_LINE>throw new IOException();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("Provide correct input/output file format.");<NEW_LINE>}<NEW_LINE>// Create the pipeline<NEW_LINE>Pipeline pipeline = Pipeline.create(options);<NEW_LINE>pipeline.apply(inputFileFormat + " to " + outputFileFormat, FileFormatConversionFactory.FileFormat.newBuilder().setOptions(options).setInputFileFormat(inputFileFormat).setOutputFileFormat(outputFileFormat).build());<NEW_LINE>return pipeline.run();<NEW_LINE>}
put(ValidFileFormats.CSV, "CSV");
1,339,561
// @since 4.3.0<NEW_LINE>@NonNull<NEW_LINE>private JLatexMathDrawable createInlineDrawable(@NonNull JLatextAsyncDrawable drawable) {<NEW_LINE>final String latex = drawable.getDestination();<NEW_LINE>final JLatexMathTheme theme = config.theme;<NEW_LINE>final JLatexMathTheme.BackgroundProvider backgroundProvider = theme.inlineBackgroundProvider();<NEW_LINE>final JLatexMathTheme.<MASK><NEW_LINE>final int color = theme.inlineTextColor();<NEW_LINE>final JLatexMathDrawable.Builder builder = JLatexMathDrawable.builder(latex).textSize(theme.inlineTextSize());<NEW_LINE>if (backgroundProvider != null) {<NEW_LINE>builder.background(backgroundProvider.provide());<NEW_LINE>}<NEW_LINE>if (padding != null) {<NEW_LINE>builder.padding(padding.left, padding.top, padding.right, padding.bottom);<NEW_LINE>}<NEW_LINE>if (color != 0) {<NEW_LINE>builder.color(color);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
Padding padding = theme.inlinePadding();
677,724
public void processRecord(MetricsRecord record) {<NEW_LINE>LOG.info("metricscache sink processRecord");<NEW_LINE>// Format it into TopologyManager.PublishMetrics<NEW_LINE>// The format of record is "host:port/componentName/instanceId"<NEW_LINE>// So MetricsRecord.getSource().split("/") would be an array with 3 elements:<NEW_LINE>// ["host:port", componentName, instanceId]<NEW_LINE>String[] sources = MetricsUtil.splitRecordSource(record);<NEW_LINE>String hostPort = sources[0];<NEW_LINE>String componentName = sources[1];<NEW_LINE>String instanceId = sources[2];<NEW_LINE>TopologyManager.PublishMetrics.Builder publishMetrics = TopologyManager.PublishMetrics.newBuilder();<NEW_LINE>for (MetricsInfo metricsInfo : tManagerMetricsFilter.filter(record.getMetrics())) {<NEW_LINE>// We would filter out unneeded metrics<NEW_LINE>TopologyManager.MetricDatum metricDatum = TopologyManager.MetricDatum.newBuilder().setComponentName(componentName).setInstanceId(instanceId).setName(metricsInfo.getName()).setValue(metricsInfo.getValue()).setTimestamp(record.getTimestamp()).build();<NEW_LINE>publishMetrics.addMetrics(metricDatum);<NEW_LINE>}<NEW_LINE>for (ExceptionInfo exceptionInfo : record.getExceptions()) {<NEW_LINE>String exceptionStackTrace = exceptionInfo.getStackTrace();<NEW_LINE>String[] exceptionStackTraceLines = <MASK><NEW_LINE>String exceptionStackTraceFirstTwoLines = String.join(System.lineSeparator(), exceptionStackTraceLines[0], exceptionStackTraceLines[1]);<NEW_LINE>TopologyManager.TmanagerExceptionLog exceptionLog = TopologyManager.TmanagerExceptionLog.newBuilder().setComponentName(componentName).setHostname(hostPort).setInstanceId(instanceId).setStacktrace(exceptionStackTraceFirstTwoLines).setLasttime(exceptionInfo.getLastTime()).setFirsttime(exceptionInfo.getFirstTime()).setCount(exceptionInfo.getCount()).setLogging(exceptionInfo.getLogging()).build();<NEW_LINE>publishMetrics.addExceptions(exceptionLog);<NEW_LINE>}<NEW_LINE>metricsCommunicator.offer(publishMetrics.build());<NEW_LINE>// Update metrics<NEW_LINE>sinkContext.exportCountMetric(RECORD_PROCESS_COUNT, 1);<NEW_LINE>sinkContext.exportCountMetric(METRICS_COUNT, publishMetrics.getMetricsCount());<NEW_LINE>sinkContext.exportCountMetric(EXCEPTIONS_COUNT, publishMetrics.getExceptionsCount());<NEW_LINE>checkCommunicator(metricsCommunicator, MAX_COMMUNICATOR_SIZE);<NEW_LINE>}
exceptionStackTrace.split("\r\n|[\r\n]", 3);
1,043,093
private static void eulerTest1() {<NEW_LINE>int n = 2;<NEW_LINE>List<List<Edge>> g = createEmptyGraph(n);<NEW_LINE>addDirectedEdge(g, 0, 0, 0);<NEW_LINE>addDirectedEdge(g, 0, 1, 1);<NEW_LINE>addDirectedEdge(<MASK><NEW_LINE>addDirectedEdge(g, 1, 0, 3);<NEW_LINE>addDirectedEdge(g, 1, 0, 4);<NEW_LINE>addDirectedEdge(g, 1, 1, 5);<NEW_LINE>EulerianPathDirectedEdgesAdjacencyList solver = new EulerianPathDirectedEdgesAdjacencyList(g);<NEW_LINE>List<Edge> path = solver.getEulerianPath();<NEW_LINE>for (Edge edge : path) {<NEW_LINE>System.out.printf("%d -> %d with cost: %f\n", edge.from, edge.to, edge.cost);<NEW_LINE>}<NEW_LINE>}
g, 0, 1, 2);
1,395,890
public void widgetSelected(SelectionEvent event) {<NEW_LINE>String str = readFromClipboard();<NEW_LINE>if (str != null) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>try {<NEW_LINE>sb.append("key: ");<NEW_LINE>sb.append<MASK><NEW_LINE>sb.append("\r\n");<NEW_LINE>byte[] payload = str.getBytes("UTF-8");<NEW_LINE>sb.append("data: ");<NEW_LINE>sb.append(Base32.encode(payload));<NEW_LINE>sb.append("\r\n");<NEW_LINE>byte[] sig = plugin.sign(is_public, payload);<NEW_LINE>sb.append("sig: ");<NEW_LINE>sb.append(Base32.encode(sig));<NEW_LINE>sb.append("\r\n");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>print("sign failed", e);<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>writeToClipboard(sb.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(plugin.getPublicKey(is_public));
1,197,988
public ValueDerivatives swapRateDai1(double x, DoubleArray discountedCashFlowFixed, DoubleArray alphaFixed, DoubleArray discountedCashFlowIbor, DoubleArray alphaIbor) {<NEW_LINE>int sizeIbor = discountedCashFlowIbor.size();<NEW_LINE>int sizeFixed = discountedCashFlowFixed.size();<NEW_LINE>ArgChecker.isTrue(sizeIbor == alphaIbor.size(), "Length should be equal");<NEW_LINE>ArgChecker.isTrue(sizeFixed == <MASK><NEW_LINE>double denominator = 0.0;<NEW_LINE>for (int loopcf = 0; loopcf < sizeFixed; loopcf++) {<NEW_LINE>denominator += discountedCashFlowFixed.get(loopcf) * Math.exp(-alphaFixed.get(loopcf) * x - 0.5 * alphaFixed.get(loopcf) * alphaFixed.get(loopcf));<NEW_LINE>}<NEW_LINE>double numerator = 0.0;<NEW_LINE>double[] swapRateDai1 = new double[sizeIbor];<NEW_LINE>for (int loopcf = 0; loopcf < sizeIbor; loopcf++) {<NEW_LINE>double exp = Math.exp(-alphaIbor.get(loopcf) * x - 0.5 * alphaIbor.get(loopcf) * alphaIbor.get(loopcf));<NEW_LINE>swapRateDai1[loopcf] = discountedCashFlowIbor.get(loopcf) * exp * (x + alphaIbor.get(loopcf)) / denominator;<NEW_LINE>numerator += discountedCashFlowIbor.get(loopcf) * exp;<NEW_LINE>}<NEW_LINE>return ValueDerivatives.of(-numerator / denominator, DoubleArray.ofUnsafe(swapRateDai1));<NEW_LINE>}
alphaFixed.size(), "Length should be equal");
103,830
public void visitSerializableProperties(final Object object, final JavaBeanProvider.Visitor visitor) {<NEW_LINE>final PropertyDescriptor<MASK><NEW_LINE>for (final PropertyDescriptor property : propertyDescriptors) {<NEW_LINE>ErrorWritingException ex = null;<NEW_LINE>try {<NEW_LINE>final Method readMethod = property.getReadMethod();<NEW_LINE>final String name = property.getName();<NEW_LINE>final Class<?> definedIn = readMethod.getDeclaringClass();<NEW_LINE>if (visitor.shouldVisit(name, definedIn)) {<NEW_LINE>final Object value = readMethod.invoke(object);<NEW_LINE>visitor.visit(name, property.getPropertyType(), definedIn, value);<NEW_LINE>}<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>ex = new ConversionException("Cannot get property", e);<NEW_LINE>} catch (final IllegalAccessException e) {<NEW_LINE>ex = new ObjectAccessException("Cannot access property", e);<NEW_LINE>} catch (final InvocationTargetException e) {<NEW_LINE>ex = new ConversionException("Cannot get property", e.getTargetException());<NEW_LINE>}<NEW_LINE>if (ex != null) {<NEW_LINE>ex.add("property", object.getClass() + "." + property.getName());<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[] propertyDescriptors = getSerializableProperties(object);
699,787
public void calc(ComContext context) {<NEW_LINE>if (!addedIndex && seed != null) {<NEW_LINE>random.reSeed(seed);<NEW_LINE>addedIndex = true;<NEW_LINE>}<NEW_LINE>Tuple2<Long, Integer> tuple2 = ((List<Tuple2<Long, Integer>>) context.getObj(LdaVariable.shape)).get(0);<NEW_LINE>int vocabularySize = tuple2.f1;<NEW_LINE>List<Vector> data = context.getObj(LdaVariable.data);<NEW_LINE>DenseMatrix lambda;<NEW_LINE>DenseMatrix alpha;<NEW_LINE>// the first iteration<NEW_LINE>if (context.getStepNo() == 1) {<NEW_LINE>Tuple2<DenseMatrix, DenseMatrix> initGammaAndAlpha = ((List<Tuple2<DenseMatrix, DenseMatrix>>) context.getObj(LdaVariable.initModel)).get(0);<NEW_LINE>lambda = initGammaAndAlpha.f0;<NEW_LINE>alpha = initGammaAndAlpha.f1;<NEW_LINE>} else {<NEW_LINE>lambda = context.getObj(LdaVariable.lambda);<NEW_LINE>alpha = <MASK><NEW_LINE>}<NEW_LINE>if (data == null || data.size() == 0) {<NEW_LINE>context.putObj(LdaVariable.wordTopicStat, new double[numTopic * vocabularySize]);<NEW_LINE>context.putObj(LdaVariable.logPhatPart, new double[numTopic]);<NEW_LINE>context.putObj(LdaVariable.nonEmptyWordCount, new double[] { 0 });<NEW_LINE>context.putObj(LdaVariable.nonEmptyDocCount, new double[] { 0 });<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DenseMatrix gammad = null;<NEW_LINE>Tuple4<DenseMatrix, DenseMatrix, Long, Long> corpusUpdatedData = onlineCorpusUpdate(data, lambda, alpha, gammad, vocabularySize, numTopic, subSamplingRate, random, gammaShape);<NEW_LINE>context.putObj(LdaVariable.wordTopicStat, corpusUpdatedData.f0.getData().clone());<NEW_LINE>context.putObj(LdaVariable.logPhatPart, corpusUpdatedData.f1.getData().clone());<NEW_LINE>context.putObj(LdaVariable.nonEmptyWordCount, new double[] { corpusUpdatedData.f2 });<NEW_LINE>context.putObj(LdaVariable.nonEmptyDocCount, new double[] { corpusUpdatedData.f3 });<NEW_LINE>}
context.getObj(LdaVariable.alpha);
1,582,844
// @Override<NEW_LINE>public void updated(String pid, Dictionary<String, ?> properties) throws ConfigurationException {<NEW_LINE>System.<MASK><NEW_LINE>String id = (String) properties.get("id");<NEW_LINE>_properties = cloneDictionary(properties);<NEW_LINE>System.out.println("pid:" + pid + " id:" + id);<NEW_LINE>if (_context != null) {<NEW_LINE>System.out.println("register ID token mediator service upon pid:" + pid);<NEW_LINE>Dictionary<String, Object> serviceProps = cloneDictionary(properties);<NEW_LINE>String vendor = (String) serviceProps.get("service.vendor");<NEW_LINE>if (vendor == null || vendor.isEmpty()) {<NEW_LINE>vendor = "IBM";<NEW_LINE>}<NEW_LINE>serviceProps.put("service.vendor", vendor);<NEW_LINE>// Lets registere the service<NEW_LINE>IDTokenMediator tokenMediator = new OidcIDtokenMediator(getDefaults());<NEW_LINE>ServiceRegistration<IDTokenMediator> sr = _context.registerService(IDTokenMediator.class, tokenMediator, serviceProps);<NEW_LINE>idtokenMediatorServiceRef.put(pid, sr);<NEW_LINE>}<NEW_LINE>}
out.println("Updating configuration properties:" + properties);
567,585
List<Pair<String, Object>> newEvent(int i, DateTime timestamp) {<NEW_LINE>List<Pair<String, Object>> event = new ArrayList<>();<NEW_LINE>event.add(Pair.of("timestamp", DATE_TIME_FORMATTER.print(timestamp)));<NEW_LINE>event.add(Pair.of("page", "Gypsy Danger"));<NEW_LINE>event.add(Pair.of("language", "en"));<NEW_LINE>event.add(Pair.of("user", "nuclear"));<NEW_LINE>event.add(Pair.of("unpatrolled", "true"));<NEW_LINE>event.add(Pair.of("newPage", "true"));<NEW_LINE>event.add(Pair.of("robot", "false"));<NEW_LINE>event.add(Pair.of("anonymous", "false"));<NEW_LINE>event.add(Pair.of("namespace", "article"));<NEW_LINE>event.add(Pair.of("continent", "North America"));<NEW_LINE>event.add(Pair.of("country", "United States"));<NEW_LINE>event.add(Pair.of("region", "Bay Area"));<NEW_LINE>event.add(Pair<MASK><NEW_LINE>event.add(Pair.of("added", i));<NEW_LINE>event.add(Pair.of("deleted", 0));<NEW_LINE>event.add(Pair.of("delta", i));<NEW_LINE>return Collections.unmodifiableList(event);<NEW_LINE>}
.of("city", "San Francisco"));
1,408,646
public static void removeDictionary(Locale remove) {<NEW_LINE>File toRemove = dictionaryFile(remove.toString(), false);<NEW_LINE>toRemove.delete();<NEW_LINE>toRemove = dictionaryFile(remove.toString(), true);<NEW_LINE>toRemove.delete();<NEW_LINE>if (InstalledFileLocator.getDefault().locate("modules/dict/dictionary_" + remove.toString() + ".description", null, false) != null) {<NEW_LINE>String filename = userdir;<NEW_LINE>// NOI18N<NEW_LINE>filename += File.separator <MASK><NEW_LINE>filename += File.separator + "dictionary";<NEW_LINE>filename += "_" + remove.toString();<NEW_LINE>File hiddenDictionaryFile = new File(filename + ".description_hidden");<NEW_LINE>hiddenDictionaryFile.getParentFile().mkdirs();<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>new FileOutputStream(hiddenDictionaryFile).close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ "modules" + File.separator + "dict";
1,203,942
public static <V> V retryAndWrapExceptionIfNecessary(Callable<V> callable, TokenCallable token, String message, Throwable cause) throws RuntimeException {<NEW_LINE>if (token == null || !token.isRetry()) {<NEW_LINE>throw handleWrapException(message, cause);<NEW_LINE>}<NEW_LINE>if (cause instanceof HttpResponseException) {<NEW_LINE>HttpResponseException httpe = <MASK><NEW_LINE>if (httpe.getStatusCode() == 403) {<NEW_LINE>TokenIntrospectionResponse response = token.getHttp().<TokenIntrospectionResponse>post(token.getServerConfiguration().getIntrospectionEndpoint()).authentication().client().param("token", token.call()).response().json(TokenIntrospectionResponse.class).execute();<NEW_LINE>if (!response.getActive()) {<NEW_LINE>token.clearTokens();<NEW_LINE>try {<NEW_LINE>return callable.call();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw handleWrapException(message, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw handleWrapException(message, cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new RuntimeException(message, cause);<NEW_LINE>}
HttpResponseException.class.cast(cause);
691,596
private void updatePropertySheet() {<NEW_LINE>List<Node> nodes = new ArrayList<Node>(metaSelection.size());<NEW_LINE>for (RADVisualComponent metacomp : metaSelection) {<NEW_LINE>RADComponentNode node = metacomp.getNodeReference();<NEW_LINE>if (node == null) {<NEW_LINE>// "metacomp" was just added and the node reference is not initialized yet<NEW_LINE>EventQueue.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>List<Node> nodes = new ArrayList<Node>(metaSelection.size());<NEW_LINE>for (RADVisualComponent metacomp : metaSelection) {<NEW_LINE>nodes.add(new LayoutConstraintsNode(metacomp.getNodeReference()));<NEW_LINE>}<NEW_LINE>setSelectedNodes(nodes);<NEW_LINE>sheet.setNodes(nodes.toArray(new Node[<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>nodes.add(new LayoutConstraintsNode(node));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setSelectedNodes(nodes);<NEW_LINE>sheet.setNodes(nodes.toArray(new Node[nodes.size()]));<NEW_LINE>}
nodes.size()]));
1,403,878
public void aesDecrypt(final byte[] key, InputStream in, OutputStream out, long inputSize) throws IOException, CryptoError {<NEW_LINE>InputStream decrypted = null;<NEW_LINE>try {<NEW_LINE>byte[] cKey = key;<NEW_LINE><MASK><NEW_LINE>if (macIncluded) {<NEW_LINE>SubKeys subKeys = getSubKeys(bytesToKey(key), true);<NEW_LINE>cKey = subKeys.cKey.getEncoded();<NEW_LINE>ByteArrayOutputStream tempOut = new ByteArrayOutputStream();<NEW_LINE>IOUtils.copyLarge(in, tempOut);<NEW_LINE>byte[] cipherText = tempOut.toByteArray();<NEW_LINE>byte[] cipherTextWithoutMac = Arrays.copyOfRange(cipherText, 1, cipherText.length - 32);<NEW_LINE>byte[] providedMacBytes = Arrays.copyOfRange(cipherText, cipherText.length - 32, cipherText.length);<NEW_LINE>byte[] computedMacBytes = hmac256(subKeys.mKey, cipherTextWithoutMac);<NEW_LINE>if (!Arrays.equals(computedMacBytes, providedMacBytes)) {<NEW_LINE>throw new CryptoError("invalid mac");<NEW_LINE>}<NEW_LINE>in = new ByteArrayInputStream(cipherTextWithoutMac);<NEW_LINE>}<NEW_LINE>byte[] iv = new byte[AES_KEY_LENGTH_BYTES];<NEW_LINE>IOUtils.read(in, iv);<NEW_LINE>Cipher cipher = Cipher.getInstance(AES_MODE_PADDING);<NEW_LINE>IvParameterSpec params = new IvParameterSpec(iv);<NEW_LINE>cipher.init(Cipher.DECRYPT_MODE, bytesToKey(cKey), params);<NEW_LINE>decrypted = getCipherInputStream(in, cipher);<NEW_LINE>IOUtils.copyLarge(decrypted, out, new byte[1024 * 1000]);<NEW_LINE>} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>throw new CryptoError(e);<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(in);<NEW_LINE>IOUtils.closeQuietly(decrypted);<NEW_LINE>IOUtils.closeQuietly(out);<NEW_LINE>}<NEW_LINE>}
boolean macIncluded = inputSize % 2 == 1;
505,369
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2,c3,c4".split(",");<NEW_LINE>SupportEvalBuilder builder = new SupportEvalBuilder("SupportCollection");<NEW_LINE>builder.expression(fields[0], "strvals.arrayOf()");<NEW_LINE>builder.expression(fields[1], "strvals.arrayOf(v => v)");<NEW_LINE>builder.expression(fields[2], "strvals.arrayOf( (v, i) => v || '_' || Integer.toString(i))");<NEW_LINE>builder.expression(fields[3], "strvals.arrayOf( (v, i, s) => v || '_' || Integer.toString(i) || '_' || Integer.toString(s))");<NEW_LINE>builder.expression(fields[4], "strvals.arrayOf( (v, i) => i)");<NEW_LINE>builder.statementConsumer(stmt -> assertTypes(stmt.getEventType(), fields, new EPTypeClass[] { EPTypePremade.STRINGARRAY.getEPType(), EPTypePremade.STRINGARRAY.getEPType(), EPTypePremade.STRINGARRAY.getEPType(), EPTypePremade.STRINGARRAY.getEPType(), EPTypePremade.<MASK><NEW_LINE>builder.assertion(SupportCollection.makeString("A,B,C")).expect(fields, csv("A,B,C"), csv("A,B,C"), csv("A_0,B_1,C_2"), csv("A_0_3,B_1_3,C_2_3"), new Integer[] { 0, 1, 2 });<NEW_LINE>builder.assertion(SupportCollection.makeString("")).expect(fields, csv(""), csv(""), csv(""), csv(""), new Integer[] {});<NEW_LINE>builder.assertion(SupportCollection.makeString("A")).expect(fields, csv("A"), csv("A"), csv("A_0"), csv("A_0_1"), new Integer[] { 0 });<NEW_LINE>builder.assertion(SupportCollection.makeString(null)).expect(fields, null, null, null, null, null);<NEW_LINE>builder.run(env);<NEW_LINE>}
INTEGERBOXEDARRAY.getEPType() }));
1,404,884
public JRStyledText cloneText() {<NEW_LINE>try {<NEW_LINE>JRStyledText clone = <MASK><NEW_LINE>clone.globalAttributes = cloneAttributesMap(globalAttributes);<NEW_LINE>int runsCount = runs.size();<NEW_LINE>if (runsCount == 0) {<NEW_LINE>clone.runs = Collections.emptyList();<NEW_LINE>} else if (runsCount == 1) {<NEW_LINE>clone.runs = Collections.singletonList(runs.get(0).cloneRun());<NEW_LINE>} else {<NEW_LINE>clone.runs = new ArrayList<>(runsCount);<NEW_LINE>for (Iterator<Run> it = runs.iterator(); it.hasNext(); ) {<NEW_LINE>Run run = it.next();<NEW_LINE>Run runClone = run.cloneRun();<NEW_LINE>clone.runs.add(runClone);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return clone;<NEW_LINE>} catch (CloneNotSupportedException e) {<NEW_LINE>// never<NEW_LINE>throw new JRRuntimeException(e);<NEW_LINE>}<NEW_LINE>}
(JRStyledText) super.clone();
906,633
public Request<TagResourceRequest> marshall(TagResourceRequest tagResourceRequest) {<NEW_LINE>if (tagResourceRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(TagResourceRequest)");<NEW_LINE>}<NEW_LINE>Request<TagResourceRequest> request = new DefaultRequest<TagResourceRequest>(tagResourceRequest, "AWSKinesisVideo");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/TagResource";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter <MASK><NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (tagResourceRequest.getResourceARN() != null) {<NEW_LINE>String resourceARN = tagResourceRequest.getResourceARN();<NEW_LINE>jsonWriter.name("ResourceARN");<NEW_LINE>jsonWriter.value(resourceARN);<NEW_LINE>}<NEW_LINE>if (tagResourceRequest.getTags() != null) {<NEW_LINE>java.util.List<Tag> tags = tagResourceRequest.getTags();<NEW_LINE>jsonWriter.name("Tags");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (Tag tagsItem : tags) {<NEW_LINE>if (tagsItem != null) {<NEW_LINE>TagJsonMarshaller.getInstance().marshall(tagsItem, jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
jsonWriter = JsonUtils.getJsonWriter(stringWriter);
962,804
public void render(AbstractJsonTypeManifold tm, StringBuilder sb, int indent, boolean mutable) {<NEW_LINE>setTm(tm);<NEW_LINE>if (getParent() != null) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>String name = getName();<NEW_LINE>String identifier = addActualNameAnnotation(sb, indent, name, false);<NEW_LINE>if (!(getParent() instanceof JsonStructureType) || !((JsonStructureType) getParent()).addSourcePositionAnnotation(sb, indent, identifier)) {<NEW_LINE>if (getToken() != null) {<NEW_LINE>// this is most likely a "definitions" inner class<NEW_LINE>addSourcePositionAnnotation(sb, indent, identifier, getToken());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>indent(sb, indent);<NEW_LINE>sb.append("public enum ").append(identifier).append(" implements ").append(IBindingType.class.getTypeName()).append(" {\n");<NEW_LINE>int i = 0;<NEW_LINE>// Enum constants with values<NEW_LINE>for (String key : getMembers().keySet()) {<NEW_LINE>addSourcePositionAnnotation(sb, indent + 2, key);<NEW_LINE>indent(sb, indent + 2);<NEW_LINE>Object objValue = _enumValues.get(i);<NEW_LINE>sb.append(key).append("(").append(objValue == null ? "null" : SrcElement.makeCompileTimeConstantValue(new SrcType(objValue.getClass()), objValue)).append(")");<NEW_LINE>if (++i == getMembers().size()) {<NEW_LINE>sb.append(";\n\n");<NEW_LINE>} else {<NEW_LINE>sb.append(",\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// static URL field<NEW_LINE>renderFileField(sb, indent + 2, "static final");<NEW_LINE>// _value field<NEW_LINE>indent(sb, indent + 2);<NEW_LINE>sb.append("private final Object _value;\n");<NEW_LINE>// Constructor<NEW_LINE><MASK><NEW_LINE>sb.append(identifier).append("(Object objValue) {\n");<NEW_LINE>indent(sb, indent + 4);<NEW_LINE>sb.append("_value = objValue;\n");<NEW_LINE>indent(sb, indent + 2);<NEW_LINE>sb.append("}\n");<NEW_LINE>// toBindingValue() method<NEW_LINE>indent(sb, indent + 2);<NEW_LINE>sb.append("public Object toBindingValue() {\n");<NEW_LINE>indent(sb, indent + 4);<NEW_LINE>sb.append("return _value;\n");<NEW_LINE>indent(sb, indent + 2);<NEW_LINE>sb.append("}\n");<NEW_LINE>indent(sb, indent);<NEW_LINE>sb.append("}\n");<NEW_LINE>}
indent(sb, indent + 2);
636,673
private boolean createAssociatedVfTables(Program program, List<Address> goodRtti4Locations, TaskMonitor taskMonitor) throws CancelledException {<NEW_LINE>MemoryBytePatternSearcher searcher = new MemoryBytePatternSearcher("RTTI4 Vftables");<NEW_LINE>HashMap<Address, VfTableModel> foundVFtables = new HashMap<>();<NEW_LINE>for (Address rtti4Address : goodRtti4Locations) {<NEW_LINE>byte[] bytes = ProgramMemoryUtil.getDirectAddressBytes(program, rtti4Address);<NEW_LINE>addByteSearchPattern(searcher, foundVFtables, rtti4Address, bytes);<NEW_LINE>}<NEW_LINE>AddressSet searchSet = new AddressSet();<NEW_LINE>for (MemoryBlock block : vfTableBlocks) {<NEW_LINE>searchSet.add(block.getStart(), block.getEnd());<NEW_LINE>}<NEW_LINE>searcher.search(program, searchSet, monitor);<NEW_LINE>// did the search, now process the results<NEW_LINE>boolean didSome = false;<NEW_LINE>for (Address rtti4Address : goodRtti4Locations) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>VfTableModel vfTableModel = foundVFtables.get(rtti4Address);<NEW_LINE>if (vfTableModel == null) {<NEW_LINE>String message = "No vfTable found for " + Rtti4Model.DATA_TYPE_NAME + " @ " + rtti4Address;<NEW_LINE>handleErrorMessage(program, rtti4Address, message);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>CreateVfTableBackgroundCmd cmd <MASK><NEW_LINE>didSome |= cmd.applyTo(program, monitor);<NEW_LINE>}<NEW_LINE>return didSome;<NEW_LINE>}
= new CreateVfTableBackgroundCmd(vfTableModel, applyOptions);
1,407,870
public void waitForConnect() throws ConnectionLostException {<NEW_LINE>while (!abort_) {<NEW_LINE>try {<NEW_LINE>CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(name_);<NEW_LINE>CommPort commPort = identifier.open(this.getClass().getName(), 1000);<NEW_LINE>synchronized (this) {<NEW_LINE>if (!abort_) {<NEW_LINE>serialPort_ = (SerialPort) commPort;<NEW_LINE>serialPort_.enableReceiveThreshold(1);<NEW_LINE>serialPort_.enableReceiveTimeout(500);<NEW_LINE>inputStream_ = new FixedReadBufferedInputStream(new GracefullyClosingInputStream(serialPort_<MASK><NEW_LINE>outputStream_ = new BufferedOutputStream(serialPort_.getOutputStream(), 256);<NEW_LINE>// This is only required on Windows and OSX El Capitan, but otherwise<NEW_LINE>// harmless.<NEW_LINE>serialPort_.setDTR(false);<NEW_LINE>serialPort_.setDTR(true);<NEW_LINE>Thread.sleep(100);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NoSuchPortException e) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException e1) {<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (serialPort_ != null) {<NEW_LINE>serialPort_.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new ConnectionLostException();<NEW_LINE>}
.getInputStream()), 1024);
627,565
// under InjectedLanguageManagerImpl.ourInjectionPsiLock<NEW_LINE>@Nonnull<NEW_LINE>private static PsiFile registerDocument(@Nonnull DocumentWindowImpl newDocumentWindow, @Nonnull PsiFile newInjectedPsi, @Nonnull Place shreds, @Nonnull PsiFile hostPsiFile, @Nonnull PsiDocumentManager documentManager) {<NEW_LINE>List<DocumentWindow> injected = InjectedLanguageUtil.getCachedInjectedDocuments(hostPsiFile);<NEW_LINE>for (int i = injected.size() - 1; i >= 0; i--) {<NEW_LINE>DocumentWindowImpl oldDocument = (DocumentWindowImpl) injected.get(i);<NEW_LINE>final PsiFileImpl oldFile = (PsiFileImpl) documentManager.getCachedPsiFile(oldDocument);<NEW_LINE>FileViewProvider viewProvider;<NEW_LINE>if (oldFile == null || !oldFile.isValid() || !((viewProvider = oldFile.getViewProvider()) instanceof InjectedFileViewProvider) || ((InjectedFileViewProvider) viewProvider).isDisposed()) {<NEW_LINE>injected.remove(i);<NEW_LINE>Disposer.dispose(oldDocument);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final ASTNode newInjectedNode = newInjectedPsi.getNode();<NEW_LINE>final ASTNode oldFileNode = oldFile.getNode();<NEW_LINE>assert newInjectedNode != null : "New node is null";<NEW_LINE>if (oldDocument.areRangesEqual(newDocumentWindow)) {<NEW_LINE>if (oldFile.getFileType() != newInjectedPsi.getFileType() || oldFile.getLanguage() != newInjectedPsi.getLanguage()) {<NEW_LINE>injected.remove(i);<NEW_LINE>Disposer.dispose(oldDocument);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>oldFile.putUserData(FileContextUtil.INJECTED_IN_ELEMENT, newInjectedPsi<MASK><NEW_LINE>assert shreds.isValid();<NEW_LINE>mergePsi(oldFile, oldFileNode, newInjectedPsi, newInjectedNode);<NEW_LINE>assert shreds.isValid();<NEW_LINE>return oldFile;<NEW_LINE>} else if (intersect(oldDocument, newDocumentWindow)) {<NEW_LINE>// injected fragments should not overlap. In the End, there can be only one.<NEW_LINE>injected.remove(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>injected.add(newDocumentWindow);<NEW_LINE>return newInjectedPsi;<NEW_LINE>}
.getUserData(FileContextUtil.INJECTED_IN_ELEMENT));
922,134
final ListNodegroupsResult executeListNodegroups(ListNodegroupsRequest listNodegroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listNodegroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListNodegroupsRequest> request = null;<NEW_LINE>Response<ListNodegroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListNodegroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listNodegroupsRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListNodegroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListNodegroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListNodegroupsResultJsonUnmarshaller());<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());
218,193
public void printTag(String name, HashMap parameters, boolean insertTab, boolean insertNewLine, boolean closeTag) {<NEW_LINE>if (insertTab) {<NEW_LINE>printTabulation();<NEW_LINE>}<NEW_LINE>this.print('<');<NEW_LINE>this.print(name);<NEW_LINE>if (parameters != null) {<NEW_LINE>int length = parameters.size();<NEW_LINE>Map.Entry[] entries = new Map.Entry[length];<NEW_LINE>parameters.entrySet().toArray(entries);<NEW_LINE>Arrays.sort(entries, new Comparator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Object o1, Object o2) {<NEW_LINE>Map.Entry <MASK><NEW_LINE>Map.Entry entry2 = (Map.Entry) o2;<NEW_LINE>return ((String) entry1.getKey()).compareTo((String) entry2.getKey());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>this.print(' ');<NEW_LINE>this.print(entries[i].getKey());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.print("=\"");<NEW_LINE>this.print(getEscaped(String.valueOf(entries[i].getValue())));<NEW_LINE>this.print('\"');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (closeTag) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.print("/>");<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.print(">");<NEW_LINE>}<NEW_LINE>if (insertNewLine) {<NEW_LINE>print(this.lineSeparator);<NEW_LINE>}<NEW_LINE>if (parameters != null && !closeTag)<NEW_LINE>this.tab++;<NEW_LINE>}
entry1 = (Map.Entry) o1;
536,439
public EPPreparedQueryResult execute(FAFQueryMethodSelect select, ContextPartitionSelector[] contextPartitionSelectors, FAFQueryMethodAssignerSetter assignerSetter, ContextManagementService contextManagementService) {<NEW_LINE>FireAndForgetProcessor processor = select.getProcessors()[0];<NEW_LINE>FireAndForgetInstance processorInstance = processor.getProcessorInstanceNoContext();<NEW_LINE>Collection<EventBean> events;<NEW_LINE>AgentInstanceContext agentInstanceContext = null;<NEW_LINE>if (processorInstance == null) {<NEW_LINE>events = Collections.emptyList();<NEW_LINE>} else {<NEW_LINE>agentInstanceContext = processorInstance.getAgentInstanceContext();<NEW_LINE>events = snapshot(select.getConsumerFilters()[0], processorInstance, select.getQueryGraph(), select.getAnnotations());<NEW_LINE>}<NEW_LINE>// get RSP<NEW_LINE>ResultSetProcessor resultSetProcessor = processorWithAssign(select.getResultSetProcessorFactoryProvider(), agentInstanceContext, assignerSetter, select.getTableAccesses(), select.getSubselects());<NEW_LINE>if (select.getWhereClause() != null) {<NEW_LINE>events = filtered(events, <MASK><NEW_LINE>}<NEW_LINE>return processedNonJoin(resultSetProcessor, events, select.getDistinctKeyGetter());<NEW_LINE>}
select.getWhereClause(), agentInstanceContext);
387,739
public I_PP_Product_BOM verifyProductBOMAndReturnIt(@NonNull final ProductId ppOrderProductId, @NonNull final Date ppOrderStartSchedule, @NonNull final I_PP_Product_BOM ppOrderProductBOM) {<NEW_LINE>// Product BOM should be completed<NEW_LINE>if (!DocStatus.ofCode(ppOrderProductBOM.getDocStatus()).isCompleted()) {<NEW_LINE>throw new MrpException(StringUtils.formatMessage("Product BOM is not completed; PP_Product_BOM={}", ppOrderProductBOM));<NEW_LINE>}<NEW_LINE>// Product from Order should be same as product from BOM - teo_sarca [ 2817870 ]<NEW_LINE>if (ppOrderProductId.getRepoId() != ppOrderProductBOM.getM_Product_ID()) {<NEW_LINE>throw new MrpException("@NotMatch@ @PP_Product_BOM_ID@ , @M_Product_ID@");<NEW_LINE>}<NEW_LINE>// Product BOM Configuration should be verified - teo_sarca [ 2817870 ]<NEW_LINE>final IProductDAO productsRepo = <MASK><NEW_LINE>final I_M_Product product = productsRepo.getById(ppOrderProductBOM.getM_Product_ID());<NEW_LINE>if (!product.isVerified()) {<NEW_LINE>throw new MrpException(StringUtils.formatMessage("Product with Value={} of Product BOM Configuration not verified; PP_Product_BOM={}; product={}", product.getValue(), ppOrderProductBOM, product));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create BOM Head<NEW_LINE>final IProductBOMBL productBOMBL = Services.get(IProductBOMBL.class);<NEW_LINE>if (!productBOMBL.isValidFromTo(ppOrderProductBOM, ppOrderStartSchedule)) {<NEW_LINE>throw new BOMExpiredException(ppOrderProductBOM, ppOrderStartSchedule);<NEW_LINE>}<NEW_LINE>return ppOrderProductBOM;<NEW_LINE>}
Services.get(IProductDAO.class);
1,012,604
public MfaProvider deserialize(JsonParser p, DeserializationContext ctxt) {<NEW_LINE>MfaProvider result = new MfaProvider();<NEW_LINE>JsonNode node = JsonUtils.readTree(p);<NEW_LINE>MfaProviderType type;<NEW_LINE>try {<NEW_LINE>type = MfaProviderType.forValue(getNodeAsString(node, FIELD_TYPE, "google-authenticator"));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>type = null;<NEW_LINE>}<NEW_LINE>// deserialize based on type<NEW_LINE>JsonNode configNode = node.get("config");<NEW_LINE>String config = configNode != null ? (configNode.isTextual() ? configNode.textValue() : configNode.toString()) : null;<NEW_LINE>AbstractMfaProviderConfig definition = null;<NEW_LINE>if (type != null) {<NEW_LINE>if (type == MfaProviderType.GOOGLE_AUTHENTICATOR) {<NEW_LINE>definition = StringUtils.hasText(config) ? JsonUtils.readValue(config, GoogleMfaProviderConfig.class) : new GoogleMfaProviderConfig();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setConfig(definition);<NEW_LINE>result.setType(type);<NEW_LINE>result.setName(getNodeAsString(node, FIELD_NAME, null));<NEW_LINE>result.setId(getNodeAsString<MASK><NEW_LINE>result.setIdentityZoneId(getNodeAsString(node, FIELD_IDENTITY_ZONE_ID, null));<NEW_LINE>result.setCreated(getNodeAsDate(node, FIELD_CREATED));<NEW_LINE>result.setLastModified(getNodeAsDate(node, FIELD_LAST_MODIFIED));<NEW_LINE>return result;<NEW_LINE>}
(node, FIELD_ID, null));
796,010
private void check(APIChangeResourceOwnerMsg msg, Map<String, Quota.QuotaPair> pairs) {<NEW_LINE>String currentAccountUuid = msg.getSession().getAccountUuid();<NEW_LINE>String resourceTargetOwnerAccountUuid = msg.getAccountUuid();<NEW_LINE>if (new QuotaUtil().isAdminAccount(resourceTargetOwnerAccountUuid)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String resourceType = new QuotaUtil().getResourceType(msg.getResourceUuid());<NEW_LINE>long volumeSnapshotNumAsked;<NEW_LINE>if (resourceType.equals(VmInstanceVO.class.getSimpleName())) {<NEW_LINE>String sql = "select count(s)" + " from VolumeVO v, VolumeSnapshotVO s" + " where s.volumeUuid = v.uuid" + " and v.vmInstanceUuid = :vmInstanceUuid";<NEW_LINE>TypedQuery<Long> q = dbf.getEntityManager().createQuery(sql, Long.class);<NEW_LINE>q.setParameter("vmInstanceUuid", msg.getResourceUuid());<NEW_LINE>volumeSnapshotNumAsked = q.getSingleResult();<NEW_LINE>} else if (resourceType.equals(VolumeVO.class.getSimpleName())) {<NEW_LINE>String sql = "select count(s)" + " from VolumeSnapshotVO s" + " where s.volumeUuid = :volumeUuid";<NEW_LINE>TypedQuery<Long> q = dbf.getEntityManager().<MASK><NEW_LINE>q.setParameter("volumeUuid", msg.getResourceUuid());<NEW_LINE>volumeSnapshotNumAsked = q.getSingleResult();<NEW_LINE>} else if (resourceType.equals(VolumeSnapshotVO.class.getSimpleName())) {<NEW_LINE>volumeSnapshotNumAsked = 1;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkVolumeSnapshotNumQuota(currentAccountUuid, resourceTargetOwnerAccountUuid, volumeSnapshotNumAsked, pairs);<NEW_LINE>}
createQuery(sql, Long.class);
579,227
public void roundedRect(double cx, double cy, double width, double height, double rx, double ry) {<NEW_LINE>double halfWidth = width / 2;<NEW_LINE>double halfHeight = height / 2;<NEW_LINE>double dx = rx;<NEW_LINE>double dy = ry;<NEW_LINE>double left = cx - halfWidth;<NEW_LINE>double right = cx + halfWidth;<NEW_LINE>double top = cy - halfHeight;<NEW_LINE>double bottom = cy + halfHeight;<NEW_LINE>// rx/ry cannot be greater than half of the width of the rectangle<NEW_LINE>// (required by SVG spec)<NEW_LINE>dx = Math.min(dx, width * 0.5);<NEW_LINE>dy = Math.min(dy, height * 0.5);<NEW_LINE>moveto(left + dx, top);<NEW_LINE>if (dx < width * 0.5)<NEW_LINE>lineto(right - rx, top);<NEW_LINE>curveto(right - dx * ONE_MINUS_QUARTER, top, right, top + dy * <MASK><NEW_LINE>if (dy < height * 0.5)<NEW_LINE>lineto(right, bottom - dy);<NEW_LINE>curveto(right, bottom - dy * ONE_MINUS_QUARTER, right - dx * ONE_MINUS_QUARTER, bottom, right - dx, bottom);<NEW_LINE>if (dx < width * 0.5)<NEW_LINE>lineto(left + dx, bottom);<NEW_LINE>curveto(left + dx * ONE_MINUS_QUARTER, bottom, left, bottom - dy * ONE_MINUS_QUARTER, left, bottom - dy);<NEW_LINE>if (dy < height * 0.5)<NEW_LINE>lineto(left, top + dy);<NEW_LINE>curveto(left, top + dy * ONE_MINUS_QUARTER, left + dx * ONE_MINUS_QUARTER, top, left + dx, top);<NEW_LINE>close();<NEW_LINE>}
ONE_MINUS_QUARTER, right, top + dy);
481,580
public com.amazonaws.services.organizations.model.InvalidHandshakeTransitionException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.organizations.model.InvalidHandshakeTransitionException invalidHandshakeTransitionException = new com.amazonaws.services.organizations.model.InvalidHandshakeTransitionException(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 invalidHandshakeTransitionException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,053,425
public int indentNewLine(Document doc, int offset) {<NEW_LINE>// if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("\n+ XMLFormatter::indentNewLine: doc = " + doc); // NOI18N<NEW_LINE>// if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("+ ::indentNewLine: offset = " + offset); // NOI18N<NEW_LINE>if (doc instanceof BaseDocument) {<NEW_LINE>BaseDocument bdoc = (BaseDocument) doc;<NEW_LINE>bdoc.atomicLock();<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>bdoc.insertString(offset, "\n", null);<NEW_LINE>offset++;<NEW_LINE>int fullLine = Utilities.getFirstNonWhiteBwd(bdoc, offset - 1);<NEW_LINE>int indent = Utilities.getRowIndent(bdoc, fullLine);<NEW_LINE>// if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("+ ::indentNewLine: fullLine = " + fullLine); // NOI18N<NEW_LINE>// if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("+ ::indentNewLine: indent = " + indent); // NOI18N<NEW_LINE>//<NEW_LINE>// if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("+ ::indentNewLine: offset = " + offset); // NOI18N<NEW_LINE>// if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("+ ::indentNewLine: sb = '" + sb.toString() + "'"); // NOI18N<NEW_LINE>String indentation = getIndentString(bdoc, indent);<NEW_LINE>bdoc.insertString(offset, indentation, null);<NEW_LINE>offset += indentation.length();<NEW_LINE>// if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("+ ::indentNewLine: offset = " + offset); // NOI18N<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>if (Boolean.getBoolean("netbeans.debug.exceptions")) {<NEW_LINE>// NOI18N<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>bdoc.atomicUnlock();<NEW_LINE>}<NEW_LINE>return offset;<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
super.indentNewLine(doc, offset);
113,366
private void addMetric(Event currentRecord, String topic, boolean result, long sendTime) {<NEW_LINE>Map<String, String> dimensions = new HashMap<>();<NEW_LINE>dimensions.put(SortMetricItem.KEY_CLUSTER_ID, this.sinkContext.getClusterId());<NEW_LINE>// metric<NEW_LINE>SortMetricItem.fillInlongId(currentRecord, dimensions);<NEW_LINE>dimensions.put(SortMetricItem.KEY_SINK_ID, this.cacheClusterName);<NEW_LINE>dimensions.<MASK><NEW_LINE>long msgTime = NumberUtils.toLong(currentRecord.getHeaders().get(Constants.HEADER_KEY_MSG_TIME), sendTime);<NEW_LINE>long auditFormatTime = msgTime - msgTime % CommonPropertiesHolder.getAuditFormatInterval();<NEW_LINE>dimensions.put(SortMetricItem.KEY_MESSAGE_TIME, String.valueOf(auditFormatTime));<NEW_LINE>String taskName = currentRecord.getHeaders().get(SortMetricItem.KEY_TASK_NAME);<NEW_LINE>dimensions.put(SortMetricItem.KEY_TASK_NAME, taskName);<NEW_LINE>SortMetricItem.reportDurations(currentRecord, result, sendTime, dimensions, msgTime, this.sinkContext.getMetricItemSet());<NEW_LINE>if (result) {<NEW_LINE>AuditUtils.add(AuditUtils.AUDIT_ID_SEND_SUCCESS, currentRecord);<NEW_LINE>}<NEW_LINE>}
put(SortMetricItem.KEY_SINK_DATA_ID, topic);
1,127,020
protected void addContent(RepositoryResourceWritable res, File assetFile, String name, ArtifactMetadata metadata, String contentUrl) throws RepositoryException {<NEW_LINE>String downloadUrl = contentUrl;<NEW_LINE>String linkTypeString = null;<NEW_LINE>if (metadata != null && metadata.properties != null) {<NEW_LINE>if (downloadUrl == null) {<NEW_LINE>downloadUrl = metadata.properties.getProperty(PROP_DOWNLOAD_URL);<NEW_LINE>}<NEW_LINE>linkTypeString = metadata.properties.getProperty(LINK_TYPE_PROPERTY_KEY);<NEW_LINE>}<NEW_LINE>if (downloadUrl != null && !downloadUrl.isEmpty()) {<NEW_LINE>AttachmentLinkType linkType = linkTypeString != null ? AttachmentLinkType.valueOf(linkTypeString) : null;<NEW_LINE>res.addContent(<MASK><NEW_LINE>} else if (assetFile != null) {<NEW_LINE>res.addContent(assetFile, name);<NEW_LINE>} else {<NEW_LINE>// No content so set the download policy to installer to hide the<NEW_LINE>// download button in the web UI and display policy hidden to hide it in WDT<NEW_LINE>res.setDownloadPolicy(DownloadPolicy.INSTALLER);<NEW_LINE>res.setDisplayPolicy(DisplayPolicy.HIDDEN);<NEW_LINE>}<NEW_LINE>}
assetFile, name, downloadUrl, linkType);
1,228,800
public List<RecordGroup> splitIntoProcessableSubgroups() {<NEW_LINE>List<RecordGroup> recordGroupList = new LinkedList<>();<NEW_LINE>if (areAllRecordsValid()) {<NEW_LINE>recordGroupList.add(this);<NEW_LINE>return recordGroupList;<NEW_LINE>} else {<NEW_LINE>List<AbstractRecord> recordList = new LinkedList<>();<NEW_LINE>Boolean valid = null;<NEW_LINE>for (AbstractRecord record : records) {<NEW_LINE>boolean tempValid = isRecordInvalid(record);<NEW_LINE>if (valid == null || Objects.equals(tempValid, valid)) {<NEW_LINE>valid = tempValid;<NEW_LINE>recordList.add(record);<NEW_LINE>} else {<NEW_LINE>recordGroupList.add(new RecordGroup(recordList));<NEW_LINE>valid = tempValid;<NEW_LINE><MASK><NEW_LINE>recordList.add(record);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!recordList.isEmpty()) {<NEW_LINE>recordGroupList.add(new RecordGroup(recordList));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return recordGroupList;<NEW_LINE>}
recordList = new LinkedList<>();
1,625,996
public I_M_DeliveryDay retrieveDeliveryDay(final IContextAware context, final IDeliveryDayQueryParams params) {<NEW_LINE>final IQueryBuilder<I_M_DeliveryDay> queryBuilder = Services.get(IQueryBL.class).createQueryBuilder(I_M_DeliveryDay.class, context).filter(createDeliveryDayMatcher(params));<NEW_LINE>// Make sure the deliveryDay is after the time of calculation<NEW_LINE>final ZonedDateTime calculationTime = params.getCalculationTime();<NEW_LINE>if (calculationTime != null) {<NEW_LINE>queryBuilder.addCompareFilter(I_M_DeliveryDay.COLUMNNAME_DeliveryDate, Operator.GREATER_OR_EQUAL, calculationTime);<NEW_LINE>}<NEW_LINE>// the delivery days that are in the same day as the datePromised have priority over the earlier ones.<NEW_LINE>final LocalDate preparationDay = params.getPreparationDay();<NEW_LINE>if (preparationDay != null) {<NEW_LINE>queryBuilder.addCompareFilter(I_M_DeliveryDay.COLUMNNAME_DeliveryDate, Operator.GREATER_OR_EQUAL, preparationDay);<NEW_LINE>queryBuilder.orderBy().addColumn(I_M_DeliveryDay.COLUMNNAME_DeliveryDate, Direction.Ascending, Nulls.Last);<NEW_LINE>} else {<NEW_LINE>// fallback to what it used to be: In case there is no calculation time set, simply fetch the<NEW_LINE>// delivery date that is closest to the promiseDate<NEW_LINE>queryBuilder.orderBy().addColumn(I_M_DeliveryDay.COLUMNNAME_DeliveryDate, Direction.Descending, Nulls.Last);<NEW_LINE>}<NEW_LINE>queryBuilder.orderBy().addColumn(I_M_DeliveryDay.COLUMNNAME_C_BPartner_ID, Direction.Descending, Nulls.Last).addColumn(I_M_DeliveryDay.COLUMNNAME_C_BPartner_Location_ID, <MASK><NEW_LINE>final I_M_DeliveryDay deliveryDay = queryBuilder.create().first();<NEW_LINE>return deliveryDay;<NEW_LINE>}
Direction.Descending, Nulls.Last);
9,870
protected void prepareOval() {<NEW_LINE>if (hasInnerCorner()) {<NEW_LINE>setOvalLeft(getBorderBox().width() - (2 * getOuterCornerRadius() - getPreBorderWidth() / 2));<NEW_LINE>setOvalTop(getBorderBox().height() - (2 * getOuterCornerRadius() <MASK><NEW_LINE>setOvalRight(getBorderBox().width() - (getPreBorderWidth() / 2));<NEW_LINE>setOvalBottom(getBorderBox().height() - (getPostBorderWidth() / 2));<NEW_LINE>} else {<NEW_LINE>setOvalLeft(getBorderBox().width() - 1.5f * getOuterCornerRadius());<NEW_LINE>setOvalTop(getBorderBox().height() - 1.5f * getOuterCornerRadius());<NEW_LINE>setOvalRight(getBorderBox().width() - getOuterCornerRadius() / 2);<NEW_LINE>setOvalBottom(getBorderBox().height() - getOuterCornerRadius() / 2);<NEW_LINE>}<NEW_LINE>}
- getPostBorderWidth() / 2));
714,733
protected AbstractGCEvent<GCEvent> parseLine(String line, ParseInformation pos) throws ParseException {<NEW_LINE>AbstractGCEvent<GCEvent> event = new GCEvent();<NEW_LINE>try {<NEW_LINE>event.setTimestamp(count);<NEW_LINE>count++;<NEW_LINE>StringTokenizer st = new StringTokenizer(line, " ,->()K\r\n");<NEW_LINE>String token = st.nextToken();<NEW_LINE>if (token.equals("Full") && st.nextToken().equals("GC")) {<NEW_LINE>event.<MASK><NEW_LINE>} else if (token.equals("Inc") && st.nextToken().equals("GC")) {<NEW_LINE>event.setType(AbstractGCEvent.Type.INC_GC);<NEW_LINE>} else if (token.equals("GC")) {<NEW_LINE>event.setType(AbstractGCEvent.Type.GC);<NEW_LINE>} else {<NEW_LINE>throw new ParseException("Error parsing entry: " + line);<NEW_LINE>}<NEW_LINE>setMemoryAndPauses((GCEvent) event, line);<NEW_LINE>// debug<NEW_LINE>// System.out.println("Parsed: " + event);<NEW_LINE>// System.out.println("Real : [" + line + "]");<NEW_LINE>return event;<NEW_LINE>} catch (RuntimeException rte) {<NEW_LINE>final ParseException parseException = new ParseException("Error parsing entry: " + line + ", " + rte.toString());<NEW_LINE>parseException.initCause(rte);<NEW_LINE>throw parseException;<NEW_LINE>}<NEW_LINE>}
setType(AbstractGCEvent.Type.FULL_GC);
86,782
public void process(JCas jcas) throws AnalysisEngineProcessException {<NEW_LINE>JCas questionView, resultView, passagesView;<NEW_LINE>try {<NEW_LINE>questionView = jcas.getView("Question");<NEW_LINE><MASK><NEW_LINE>passagesView = jcas.getView("Passages");<NEW_LINE>} catch (CASException e) {<NEW_LINE>throw new AnalysisEngineProcessException(e);<NEW_LINE>}<NEW_LINE>AnswerFV afv = new AnswerFV();<NEW_LINE>afv.setFeature(AF.OriginPsg, 1.0);<NEW_LINE>afv.setFeature(AF.OriginPsgFirst, 1.0);<NEW_LINE>Sentence s2 = (Sentence) copier.copyFs(sentence);<NEW_LINE>s2.addToIndexes();<NEW_LINE>for (Annotation a : JCasUtil.selectCovered(Annotation.class, sentence)) {<NEW_LINE>if (copier.alreadyCopied(a))<NEW_LINE>continue;<NEW_LINE>Annotation a2 = (Annotation) copier.copyFs(a);<NEW_LINE>a2.addToIndexes();<NEW_LINE>}<NEW_LINE>}
resultView = jcas.getView("Result");
1,742,742
void handleMdmUpdate(IAnyResource theTargetResource, MatchedGoldenResourceCandidate theMatchedGoldenResourceCandidate, MdmTransactionContext theMdmTransactionContext) {<NEW_LINE>MdmUpdateContext updateContext = new MdmUpdateContext(theMatchedGoldenResourceCandidate, theTargetResource);<NEW_LINE>myMdmSurvivorshipService.applySurvivorshipRulesToGoldenResource(theTargetResource, updateContext.getMatchedGoldenResource(), theMdmTransactionContext);<NEW_LINE>if (updateContext.isRemainsMatchedToSameGoldenResource()) {<NEW_LINE>// Copy over any new external EIDs which don't already exist.<NEW_LINE>if (!updateContext.isIncomingResourceHasAnEid() || updateContext.isHasEidsInCommon()) {<NEW_LINE>// update to patient that uses internal EIDs only.<NEW_LINE>myMdmLinkSvc.updateLink(updateContext.getMatchedGoldenResource(), theTargetResource, theMatchedGoldenResourceCandidate.getMatchResult(), MdmLinkSourceEnum.AUTO, theMdmTransactionContext);<NEW_LINE>} else if (!updateContext.isHasEidsInCommon()) {<NEW_LINE>handleNoEidsInCommon(theTargetResource, theMatchedGoldenResourceCandidate, theMdmTransactionContext, updateContext);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// This is a new linking scenario. we have to break the existing link and link to the new Golden Resource. For now, we create duplicate.<NEW_LINE>// updated patient has an EID that matches to a new candidate. Link them, and set the Golden Resources possible duplicates<NEW_LINE>linkToNewGoldenResourceAndFlagAsDuplicate(theTargetResource, theMatchedGoldenResourceCandidate.getMatchResult(), updateContext.getExistingGoldenResource(), <MASK><NEW_LINE>myMdmSurvivorshipService.applySurvivorshipRulesToGoldenResource(theTargetResource, updateContext.getMatchedGoldenResource(), theMdmTransactionContext);<NEW_LINE>myMdmResourceDaoSvc.upsertGoldenResource(updateContext.getMatchedGoldenResource(), theMdmTransactionContext.getResourceType());<NEW_LINE>}<NEW_LINE>}
updateContext.getMatchedGoldenResource(), theMdmTransactionContext);
887,614
private static void createSpecSuperset() throws Exception {<NEW_LINE>System.out.println("Creating superset");<NEW_LINE>String[] parts = opts.get(OPT_SRCDIR).split(",");<NEW_LINE>File out = new File(outdir, opts.get(OPT_FILENAME));<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < parts.length; i++) {<NEW_LINE>System.out.println("Scanning source directory for *.superset : " + parts[i]);<NEW_LINE>File srcdir = new File(parts[i]);<NEW_LINE>if (!srcdir.exists() || !srcdir.isDirectory()) {<NEW_LINE>System.err.println("Error : The specified source directory (" + srcdir.getAbsolutePath() + ") does not exist, or is not a directory.");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>File[] files = srcdir.listFiles(new FileFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File pathname) {<NEW_LINE>return pathname.getName().endsWith(".superset");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (0 == files.length) {<NEW_LINE>System.err.println("Error : The source directory (" + srcdir.getAbsolutePath() + ") does not contain any superset files (*.superset).");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>char[] buffer = new char[4096];<NEW_LINE>int charsread = 0;<NEW_LINE>for (File file : files) {<NEW_LINE>System.out.println(("Processing " + file.getName()));<NEW_LINE>FileReader reader = new FileReader(file);<NEW_LINE>while ((charsread = reader.read(buffer)) != -1) {<NEW_LINE>writer.write(buffer, 0, charsread);<NEW_LINE>}<NEW_LINE>reader.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.close();<NEW_LINE>}
FileWriter writer = new FileWriter(out);
53,159
SDChaindcode discoverEndorserEndpoint(TransactionContext transactionContext, final String name) throws ServiceDiscoveryException {<NEW_LINE>Map<String, SDChaindcode> lchaindcodeMap = chaindcodeMap;<NEW_LINE>if (lchaindcodeMap != null) {<NEW_LINE>// check if we have it already.<NEW_LINE>SDChaindcode sdChaindcode = lchaindcodeMap.get(name);<NEW_LINE>if (null != sdChaindcode) {<NEW_LINE>return sdChaindcode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>LinkedList<ServiceDiscoveryChaincodeCalls> cc = new LinkedList<>();<NEW_LINE>cc.add(serviceDiscoveryChaincodeCalls);<NEW_LINE>List<List<ServiceDiscoveryChaincodeCalls>> ccl = new LinkedList<>();<NEW_LINE>ccl.add(cc);<NEW_LINE>Map<String, SDChaindcode> dchaindcodeMap = discoverEndorserEndpoints(transactionContext, ccl);<NEW_LINE>final SDChaindcode sdChaindcode = dchaindcodeMap.get(name);<NEW_LINE>if (null == sdChaindcode) {<NEW_LINE>throw new ServiceDiscoveryException(format("Failed to find any endorsers for chaincode %s. See logs for details", name));<NEW_LINE>}<NEW_LINE>return sdChaindcode;<NEW_LINE>}
ServiceDiscoveryChaincodeCalls serviceDiscoveryChaincodeCalls = new ServiceDiscoveryChaincodeCalls(name);
1,040,747
public GraphExtension init(GraphHopper graphhopper) throws Exception {<NEW_LINE>if (storage != null)<NEW_LINE>throw new Exception("GraphStorageBuilder has been already initialized.");<NEW_LINE>if (this.cbReader == null) {<NEW_LINE>// Read the border shapes from the file<NEW_LINE>// First check if parameters are present<NEW_LINE>String bordersFile = "";<NEW_LINE>String countryIdsFile = "";<NEW_LINE>String openBordersFile = "";<NEW_LINE>if (parameters.containsKey(PARAM_KEY_BOUNDARIES))<NEW_LINE>bordersFile = parameters.get(PARAM_KEY_BOUNDARIES);<NEW_LINE>else {<NEW_LINE>ErrorLoggingUtility.logMissingConfigParameter(BordersGraphStorageBuilder.class, PARAM_KEY_BOUNDARIES);<NEW_LINE>// We cannot continue without the information<NEW_LINE>throw new MissingResourceException("A boundary geometry file is needed to use the borders extended storage!", BordersGraphStorage.<MASK><NEW_LINE>}<NEW_LINE>if (parameters.containsKey("ids"))<NEW_LINE>countryIdsFile = parameters.get("ids");<NEW_LINE>else<NEW_LINE>ErrorLoggingUtility.logMissingConfigParameter(BordersGraphStorageBuilder.class, "ids");<NEW_LINE>if (parameters.containsKey(PARAM_KEY_OPEN_BORDERS))<NEW_LINE>openBordersFile = parameters.get(PARAM_KEY_OPEN_BORDERS);<NEW_LINE>else<NEW_LINE>ErrorLoggingUtility.logMissingConfigParameter(BordersGraphStorageBuilder.class, PARAM_KEY_OPEN_BORDERS);<NEW_LINE>// Read the file containing all of the country border polygons<NEW_LINE>this.cbReader = new CountryBordersReader(bordersFile, countryIdsFile, openBordersFile);<NEW_LINE>}<NEW_LINE>storage = new BordersGraphStorage();<NEW_LINE>return storage;<NEW_LINE>}
class.getName(), PARAM_KEY_BOUNDARIES);
101,473
protected String printMethodArgs(List<Type> args, boolean varArgs, Locale locale) {<NEW_LINE>if (!varArgs) {<NEW_LINE>return visitTypes(args, locale);<NEW_LINE>} else {<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>while (args.tail.nonEmpty()) {<NEW_LINE>buf.append(visit(args.head, locale));<NEW_LINE>args = args.tail;<NEW_LINE>buf.append(',');<NEW_LINE>}<NEW_LINE>if (args.head.unannotatedType().hasTag(TypeTag.ARRAY)) {<NEW_LINE>buf.append(visit(((ArrayType) args.head.unannotatedType()).elemtype, locale));<NEW_LINE>if (args.head.getAnnotationMirrors().nonEmpty()) {<NEW_LINE>buf.append(' ');<NEW_LINE>buf.append(<MASK><NEW_LINE>buf.append(' ');<NEW_LINE>}<NEW_LINE>buf.append("...");<NEW_LINE>} else {<NEW_LINE>buf.append(visit(args.head, locale));<NEW_LINE>}<NEW_LINE>return buf.toString();<NEW_LINE>}<NEW_LINE>}
args.head.getAnnotationMirrors());
1,492,038
ExecutionEnvironment fromExternalForm(String externalForm) {<NEW_LINE>// TODO: remove this check and refactor clients to use getLocal() instead<NEW_LINE>if (HostInfoUtils.LOCALHOST.equals(externalForm) || "127.0.0.1".equals(externalForm) || "::1".contains(externalForm)) {<NEW_LINE>// NOI18N<NEW_LINE>return LOCAL;<NEW_LINE>}<NEW_LINE>String user;<NEW_LINE>String host;<NEW_LINE>String port;<NEW_LINE>int atPos = externalForm.indexOf('@');<NEW_LINE>user = (atPos > 0) ? externalForm.substring(0, atPos) : null;<NEW_LINE>if (user != null) {<NEW_LINE>externalForm = externalForm.substring(user.length() + 1);<NEW_LINE>}<NEW_LINE>int pos = externalForm.lastIndexOf(':');<NEW_LINE>if (pos < 0) {<NEW_LINE>port = null;<NEW_LINE>host = externalForm;<NEW_LINE>} else {<NEW_LINE>port = externalForm.substring(pos + 1);<NEW_LINE>host = <MASK><NEW_LINE>}<NEW_LINE>int sshPort = 0;<NEW_LINE>if (port != null) {<NEW_LINE>try {<NEW_LINE>sshPort = Integer.parseInt(port);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return createNew(user, host, sshPort);<NEW_LINE>}
externalForm.substring(0, pos);
157,136
public void lockInterruptibly() throws InterruptedException {<NEW_LINE>long threadId = getThreadId();<NEW_LINE>UUID invocationUid = newUnsecureUUID();<NEW_LINE>for (; ; ) {<NEW_LINE>long sessionId = acquireSession();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>long fence = doLock(sessionId, threadId, invocationUid).get();<NEW_LINE>if (fence != INVALID_FENCE) {<NEW_LINE>lockedSessionIds.put(threadId, sessionId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new LockAcquireLimitReachedException("Lock[" + objectName + "] reentrant lock limit is already reached!");<NEW_LINE>} catch (SessionExpiredException e) {<NEW_LINE>invalidateSession(sessionId);<NEW_LINE>verifyNoLockedSessionIdPresent(threadId);<NEW_LINE>} catch (WaitKeyCancelledException e) {<NEW_LINE>releaseSession(sessionId);<NEW_LINE>throw new IllegalMonitorStateException("Lock[" + objectName + "] not acquired because the lock call " + "on the CP group is cancelled, possibly because of another indeterminate call from the same thread.");<NEW_LINE>} catch (Throwable t) {<NEW_LINE>releaseSession(sessionId);<NEW_LINE>if (t instanceof InterruptedException) {<NEW_LINE>throw (InterruptedException) t;<NEW_LINE>} else {<NEW_LINE>throw rethrow(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
verifyLockedSessionIdIfPresent(threadId, sessionId, true);
305,233
public void updateState() {<NEW_LINE>ElroConnectsDeviceHandler handler = getHandler();<NEW_LINE>if (handler == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ElroDeviceStatus elroStatus = getStatus();<NEW_LINE>int batteryLevel = 0;<NEW_LINE>String deviceStatus = this.deviceStatus;<NEW_LINE>if (deviceStatus.length() >= 6) {<NEW_LINE>batteryLevel = Integer.parseInt(deviceStatus.substring(2, 4), 16);<NEW_LINE>} else {<NEW_LINE>elroStatus = ElroDeviceStatus.FAULT;<NEW_LINE>logger.debug("Could not decode device status: {}", deviceStatus);<NEW_LINE>}<NEW_LINE>switch(elroStatus) {<NEW_LINE>case UNDEF:<NEW_LINE>handler.updateState(MOTION, UnDefType.UNDEF);<NEW_LINE>handler.updateState(BATTERY_LEVEL, UnDefType.UNDEF);<NEW_LINE>handler.updateState(LOW_BATTERY, UnDefType.UNDEF);<NEW_LINE>handler.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Device " + deviceId + " is not syncing with K1 hub");<NEW_LINE>break;<NEW_LINE>case FAULT:<NEW_LINE>handler.updateState(MOTION, UnDefType.UNDEF);<NEW_LINE>handler.updateState(BATTERY_LEVEL, UnDefType.UNDEF);<NEW_LINE>handler.updateState(LOW_BATTERY, UnDefType.UNDEF);<NEW_LINE>handler.updateStatus(ThingStatus.ONLINE, ThingStatusDetail.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>handler.updateState(MOTION, ElroDeviceStatus.TRIGGERED.equals(elroStatus) ? OnOffType.ON : OnOffType.OFF);<NEW_LINE>handler.updateState(BATTERY_LEVEL, new DecimalType(batteryLevel));<NEW_LINE>handler.updateState(LOW_BATTERY, (batteryLevel < 15) ? OnOffType.ON : OnOffType.OFF);<NEW_LINE>handler.updateStatus(ThingStatus.ONLINE);<NEW_LINE>}<NEW_LINE>}
NONE, "Device " + deviceId + " has a fault");
27,671
public boolean purge() {<NEW_LINE>boolean result = true;<NEW_LINE>final UpdateService service = new UpdateService(serviceClassLoader);<NEW_LINE>final Iterator<CachedWebDataSource<MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>result &= iterator.next().purge(this);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final File cache = new File(settings.getDataDirectory(), "cache");<NEW_LINE>if (cache.exists()) {<NEW_LINE>if (FileUtils.deleteQuietly(cache)) {<NEW_LINE>LOGGER.info("Cache directory purged");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final File cache = new File(settings.getDataDirectory(), "oss_cache");<NEW_LINE>if (cache.exists()) {<NEW_LINE>if (FileUtils.deleteQuietly(cache)) {<NEW_LINE>LOGGER.info("OSS Cache directory purged");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
> iterator = service.getDataSources();
81,904
public Request decodeRequest(Object packet) throws Exception {<NEW_LINE>Request request = new RpcRequest();<NEW_LINE>DubboPacket dubboPacket = (DubboPacket) packet;<NEW_LINE>request.setCorrelationId(dubboPacket.getHeader().getCorrelationId());<NEW_LINE>// check if it is heartbeat request<NEW_LINE>byte flag = dubboPacket.getHeader().getFlag();<NEW_LINE>if ((flag & DubboConstants.FLAG_EVENT) != 0) {<NEW_LINE>Object bodyObject = DubboPacket.decodeEventBody(dubboPacket.getBodyBuf());<NEW_LINE>if (bodyObject == DubboConstants.HEARTBEAT_EVENT) {<NEW_LINE>request.setHeartbeat(true);<NEW_LINE>} else {<NEW_LINE>throw new RpcException("request body not null for event");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DubboRequestBody dubboRequestBody = DubboRequestBody.decodeRequestBody(dubboPacket.getBodyBuf());<NEW_LINE>request.setArgs(dubboRequestBody.getArguments());<NEW_LINE>request.<MASK><NEW_LINE>request.setRpcMethodInfo(dubboRequestBody.getRpcMethodInfo());<NEW_LINE>request.setTarget(dubboRequestBody.getRpcMethodInfo().getTarget());<NEW_LINE>request.setTargetMethod(dubboRequestBody.getRpcMethodInfo().getMethod());<NEW_LINE>if (dubboRequestBody.getAttachments().size() > 0) {<NEW_LINE>Map<String, Object> attachments = new HashMap<String, Object>(dubboRequestBody.getAttachments().size());<NEW_LINE>for (Map.Entry<String, String> entry : dubboRequestBody.getAttachments().entrySet()) {<NEW_LINE>attachments.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>request.setKvAttachment(attachments);<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("dubbo decodeRequest error at {} ", e.getMessage(), e);<NEW_LINE>throw new RpcException("dubbo decodeRequest error", e);<NEW_LINE>}<NEW_LINE>}
setMethodName(dubboRequestBody.getPath());