idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
459,789
public ComplexSamples mix(float[] iSamples, float[] qSamples) {<NEW_LINE>VectorUtilities.<MASK><NEW_LINE>// Reuse this complex samples buffer to store the results and return to caller<NEW_LINE>ComplexSamples mixer = generate(iSamples.length);<NEW_LINE>float[] iMixer = mixer.i();<NEW_LINE>float[] qMixer = mixer.q();<NEW_LINE>FloatVector iS, qS, iM, qM;<NEW_LINE>for (int x = 0; x < iSamples.length; x += VECTOR_SPECIES.length()) {<NEW_LINE>iS = FloatVector.fromArray(VECTOR_SPECIES, iSamples, x);<NEW_LINE>qS = FloatVector.fromArray(VECTOR_SPECIES, qSamples, x);<NEW_LINE>iM = FloatVector.fromArray(VECTOR_SPECIES, iMixer, x);<NEW_LINE>qM = FloatVector.fromArray(VECTOR_SPECIES, qMixer, x);<NEW_LINE>// Perform complex mixing and store results back to mixer arrays<NEW_LINE>iM.mul(iS).sub(qM.mul(qS)).intoArray(iMixer, x);<NEW_LINE>qM.mul(iS).add(iM.mul(qS)).intoArray(qMixer, x);<NEW_LINE>}<NEW_LINE>return mixer;<NEW_LINE>}
checkComplexArrayLength(iSamples, qSamples, VECTOR_SPECIES);
1,403,961
public void describe(com.ibm.ws.javaee.ddmodel.DDParser.Diagnostics diag) {<NEW_LINE>if (xmi) {<NEW_LINE>diag.describeIfSet("enterpriseBean", enterpriseBean);<NEW_LINE>} else {<NEW_LINE>diag.describeIfSet("name", name);<NEW_LINE>}<NEW_LINE>diag.describeIfSet(xmi ? "beanCache" : "bean-cache", bean_cache);<NEW_LINE>diag.describeIfSet(xmi ? "localTransaction" : "local-transaction", local_transaction);<NEW_LINE>diag.describeIfSet(xmi ? "globalTransaction" : "global-transaction", global_transaction);<NEW_LINE>diag.describeIfSet(xmi ? "resourceRefExtensions" : "resource-ref", resource_ref);<NEW_LINE>diag.describeIfSet(xmi ? "runAsSettings" : "run-as-mode", run_as_mode);<NEW_LINE>if (xmi) {<NEW_LINE>if (start_at_app_start != null) {<NEW_LINE>start_at_app_start.describe(diag);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>diag.describeIfSet("structure", structure);<NEW_LINE>diag.describeIfSet("internationalization", internationalization);<NEW_LINE>}
diag.describeIfSet("start-at-app-start", start_at_app_start);
1,674,952
private String loadDeobfuscationCode() throws DeobfuscateException {<NEW_LINE>try {<NEW_LINE>final String deobfuscationFunctionName = getDeobfuscationFuncName(playerCode);<NEW_LINE>final String functionPattern = "(" + deobfuscationFunctionName.replace("$", "\\$") + "=function\\([a-zA-Z0-9_]+\\)\\{.+?\\})";<NEW_LINE>final String deobfuscateFunction = "var " + Parser.matchGroup1(functionPattern, playerCode) + ";";<NEW_LINE>final String helperObjectName = <MASK><NEW_LINE>final String helperPattern = "(var " + helperObjectName.replace("$", "\\$") + "=\\{.+?\\}\\};)";<NEW_LINE>final String helperObject = Parser.matchGroup1(helperPattern, playerCode.replace("\n", ""));<NEW_LINE>final String callerFunction = "function " + DEOBFUSCATION_FUNC_NAME + "(a){return " + deobfuscationFunctionName + "(a);}";<NEW_LINE>return helperObject + deobfuscateFunction + callerFunction;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new DeobfuscateException("Could not parse deobfuscate function ", e);<NEW_LINE>}<NEW_LINE>}
Parser.matchGroup1(";([A-Za-z0-9_\\$]{2})\\...\\(", deobfuscateFunction);
1,402,202
public void actionPerformed(ActionEvent e) {<NEW_LINE>List<OWLObject> objects = getCurrentTarget().getObjectsToCopy();<NEW_LINE>if (objects.isEmpty()) {<NEW_LINE>// Shouldn't really happen, but just in case<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Push the objects on to the clip board<NEW_LINE><MASK><NEW_LINE>clipboard.getClipboard().setContents(new TransferableOWLObject(getOWLModelManager(), objects), null);<NEW_LINE>new TransferableOWLObject(getOWLModelManager(), objects);<NEW_LINE>OWLEditorKitShortFormProvider sfp = new OWLEditorKitShortFormProvider(getOWLEditorKit());<NEW_LINE>OWLEditorKitOntologyShortFormProvider ontSfp = new OWLEditorKitOntologyShortFormProvider(getOWLEditorKit());<NEW_LINE>OWLObjectRenderingContext renderingContext = new OWLObjectRenderingContext(sfp, ontSfp);<NEW_LINE>OWLObjectStyledStringRenderer renderer = new OWLObjectStyledStringRenderer(renderingContext);<NEW_LINE>StyledString.Builder complete = new StyledString.Builder();<NEW_LINE>for (OWLObject owlObject : objects) {<NEW_LINE>StyledString styledString = renderer.getRendering(owlObject);<NEW_LINE>complete.appendStyledString(styledString);<NEW_LINE>complete.appendNewLine();<NEW_LINE>}<NEW_LINE>Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StyledStringSelection(complete.build()), null);<NEW_LINE>// Actually, we could put text on to the system clipboard<NEW_LINE>// OWLObject should be serializable!!!<NEW_LINE>}
ViewClipboard clipboard = ViewClipboard.getInstance();
1,451,034
public static IndexOrdinalsFieldData build(final IndexReader indexReader, IndexOrdinalsFieldData indexFieldData, IndexSettings indexSettings, CircuitBreakerService breakerService, Logger logger, Function<SortedSetDocValues, ScriptDocValues<?>> scriptFunction) throws IOException {<NEW_LINE>assert indexReader.leaves().size() > 1;<NEW_LINE>long startTimeNS = System.nanoTime();<NEW_LINE>final AtomicOrdinalsFieldData[] atomicFD = new AtomicOrdinalsFieldData[indexReader.leaves().size()];<NEW_LINE>final SortedSetDocValues[] subs = new SortedSetDocValues[indexReader.leaves().size()];<NEW_LINE>for (int i = 0; i < indexReader.leaves().size(); ++i) {<NEW_LINE>atomicFD[i] = indexFieldData.load(indexReader.leaves().get(i));<NEW_LINE>subs[i] = atomicFD[i].getOrdinalsValues();<NEW_LINE>}<NEW_LINE>final OrdinalMap ordinalMap = OrdinalMap.build(null, subs, PackedInts.DEFAULT);<NEW_LINE>final <MASK><NEW_LINE>breakerService.getBreaker(CircuitBreaker.FIELDDATA).addWithoutBreaking(memorySizeInBytes);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("global-ordinals [{}][{}] took [{}]", indexFieldData.getFieldName(), ordinalMap.getValueCount(), new TimeValue(System.nanoTime() - startTimeNS, TimeUnit.NANOSECONDS));<NEW_LINE>}<NEW_LINE>return new GlobalOrdinalsIndexFieldData(indexSettings, indexFieldData.getFieldName(), atomicFD, ordinalMap, memorySizeInBytes, scriptFunction);<NEW_LINE>}
long memorySizeInBytes = ordinalMap.ramBytesUsed();
1,305,111
public void showClearRubbishBinDialog() {<NEW_LINE>logDebug("showClearRubbishBinDialog");<NEW_LINE>rubbishBinFragment = (RubbishBinFragment) getSupportFragmentManager().findFragmentByTag(FragmentTag.RUBBISH_BIN.getTag());<NEW_LINE>if (rubbishBinFragment != null) {<NEW_LINE>if (rubbishBinFragment.isVisible()) {<NEW_LINE>rubbishBinFragment.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);<NEW_LINE>builder.setTitle(getString(R.string.context_clear_rubbish));<NEW_LINE>builder.setMessage(getString<MASK><NEW_LINE>builder.setPositiveButton(getString(R.string.general_clear), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(DialogInterface dialog, int whichButton) {<NEW_LINE>nC.cleanRubbishBin();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(getString(android.R.string.cancel), null);<NEW_LINE>clearRubbishBinDialog = builder.create();<NEW_LINE>clearRubbishBinDialog.show();<NEW_LINE>}
(R.string.clear_rubbish_confirmation));
314,632
public void onStyleLoaded(@NonNull Style style) {<NEW_LINE>if (isChecked) {<NEW_LINE>List<Feature> featuresFromVectorSource = vectorSource.querySourceFeatures(new String<MASK><NEW_LINE>List<Feature> pointFeatures = new ArrayList<>();<NEW_LINE>for (Feature singleLineFeature : featuresFromVectorSource) {<NEW_LINE>LineString lineString = (LineString) singleLineFeature.geometry();<NEW_LINE>if (lineString != null) {<NEW_LINE>Feature pointFeature = Feature.fromGeometry(lineString.coordinates().get(1));<NEW_LINE>pointFeature.addNumberProperty("result", singleLineFeature.getNumberProperty("result"));<NEW_LINE>pointFeatures.add(pointFeature);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GeoJsonSource geoJsonSource = style.getSourceAs(BASEBALL_ICON_GEOJSON_SOURCE_ID);<NEW_LINE>if (geoJsonSource != null) {<NEW_LINE>geoJsonSource.setGeoJson(FeatureCollection.fromFeatures(pointFeatures));<NEW_LINE>}<NEW_LINE>if (baseballSymbolLayer != null) {<NEW_LINE>baseballSymbolLayer.setFilter(selectedHitResult == 0 ? all() : eq(get("result"), literal(selectedHitResult)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (baseballSymbolLayer != null) {<NEW_LINE>baseballSymbolLayer.withProperties(visibility(isChecked ? VISIBLE : NONE));<NEW_LINE>}<NEW_LINE>if (hitLineLayer != null) {<NEW_LINE>hitLineLayer.withProperties(visibility(isChecked ? NONE : VISIBLE));<NEW_LINE>}<NEW_LINE>}
[] { "baseball_spray_chart_example_dat" }, null);
931,412
public void testNew2ResponseFilter(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE><MASK><NEW_LINE>c.register(ClientResponseFilter1.class, 200);<NEW_LINE>WebTarget t1 = c.target("http://" + serverIP + ":" + serverPort + "/" + moduleName + "/ComplexClientTest/ComplexResource");<NEW_LINE>WebTarget t2 = c.target("http://" + serverIP + ":" + serverPort + "/" + moduleName + "/ComplexClientTest/ComplexResource").register(ClientResponseFilter2.class, 100);<NEW_LINE>Response res1 = t1.path("echo1").path("test1").request().accept("*/*").get(Response.class);<NEW_LINE>Response res2 = t2.path("echo2").path("test2").request().accept("*/*").get(Response.class);<NEW_LINE>System.out.println("config: " + c.getConfiguration().getProperties());<NEW_LINE>c.close();<NEW_LINE>ret.append(res1.getStatus() + "," + res2.getStatus());<NEW_LINE>}
Client c = cb.build();
1,204,485
public void delete(OAtomicOperation atomicOperation) {<NEW_LINE>executeInsideComponentOperation(atomicOperation, operation -> {<NEW_LINE>final Lock <MASK><NEW_LINE>try {<NEW_LINE>final long size = size();<NEW_LINE>if (size > 0) {<NEW_LINE>throw new NotEmptyComponentCanNotBeRemovedException("Ridbag " + getName() + ":" + rootBucketPointer.getPageIndex() + ":" + rootBucketPointer.getPageOffset() + " can not be removed, because it is not empty. Its size is " + size);<NEW_LINE>}<NEW_LINE>final Queue<OBonsaiBucketPointer> subTreesToDelete = new LinkedList<>();<NEW_LINE>subTreesToDelete.add(rootBucketPointer);<NEW_LINE>recycleSubTrees(subTreesToDelete, atomicOperation);<NEW_LINE>final OCacheEntry sysCacheEntry = loadPageForWrite(atomicOperation, fileId, SYS_BUCKET.getPageIndex(), false, true);<NEW_LINE>try {<NEW_LINE>final OSysBucket sysBucket = new OSysBucket(sysCacheEntry);<NEW_LINE>sysBucket.decrementTreesCount();<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, sysCacheEntry);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>atomicOperation.addDeletedRidBag(rootBucketPointer);<NEW_LINE>});<NEW_LINE>}
lock = FILE_LOCK_MANAGER.acquireExclusiveLock(fileId);
328,010
private void drawSimplePolygon() {<NEW_LINE>Exercise25_PointsInThePlane.Point2D point2D1 = new Exercise25_PointsInThePlane.Point2D(70, 55);<NEW_LINE>Exercise25_PointsInThePlane.Point2D point2D2 = new Exercise25_PointsInThePlane.Point2D(50, 20);<NEW_LINE>Exercise25_PointsInThePlane.Point2D point2D3 = new Exercise25_PointsInThePlane.Point2D(20, 90);<NEW_LINE>Exercise25_PointsInThePlane.Point2D point2D4 = new Exercise25_PointsInThePlane.Point2D(90, 75);<NEW_LINE>Exercise25_PointsInThePlane.Point2D point2D5 = new Exercise25_PointsInThePlane.Point2D(40, 60);<NEW_LINE>Exercise25_PointsInThePlane.Point2D point2D6 = new Exercise25_PointsInThePlane.Point2D(30, 40);<NEW_LINE>Exercise25_PointsInThePlane.Point2D[] point2Ds = { point2D1, point2D2, point2D3, point2D4, point2D5, point2D6 };<NEW_LINE>Arrays.sort(point2Ds);<NEW_LINE>StdDraw.setCanvasSize(800, 800);<NEW_LINE>StdDraw.setXscale(0, 100);<NEW_LINE>StdDraw.setYscale(0, 100);<NEW_LINE>StdDraw.setPenRadius(0.005);<NEW_LINE>StdDraw.enableDoubleBuffering();<NEW_LINE>for (int i = 0; i < point2Ds.length; i++) {<NEW_LINE>point2Ds[i].draw();<NEW_LINE>}<NEW_LINE>// Draw the first point in red<NEW_LINE>StdDraw.setPenColor(StdDraw.RED);<NEW_LINE>StdDraw.setPenRadius(0.02);<NEW_LINE>point2Ds[0].draw();<NEW_LINE>Arrays.sort(point2Ds, point2Ds[0].polarAngleFromThisPointComparator);<NEW_LINE>// Draw line segments from the first point to each other point, one at a time, in polar order<NEW_LINE>StdDraw.setPenRadius();<NEW_LINE><MASK><NEW_LINE>for (int i = 1; i < point2Ds.length; i++) {<NEW_LINE>StdDraw.line(point2Ds[i - 1].x(), point2Ds[i - 1].y(), point2Ds[i].x(), point2Ds[i].y());<NEW_LINE>StdDraw.show();<NEW_LINE>StdDraw.pause(100);<NEW_LINE>}<NEW_LINE>// Draw last line and finish the polygon<NEW_LINE>StdDraw.line(point2Ds[point2Ds.length - 1].x(), point2Ds[point2Ds.length - 1].y(), point2Ds[0].x(), point2Ds[0].y());<NEW_LINE>StdDraw.show();<NEW_LINE>}
StdDraw.setPenColor(StdDraw.BLUE);
176,059
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {<NEW_LINE>// include cookies<NEW_LINE>resp.addHeader("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS");<NEW_LINE>// get input parameters<NEW_LINE>Map<String, String> params = Utils.getRequestParameters(req);<NEW_LINE>// enqueue tasks to delete GCE instances<NEW_LINE>Utils.enqueueTask(GAE_QUEUE_NAME_GCE, GAE_TASK_GCE_INSTANCE_REMOVAL, String.format("%s%s", GAE_TASK_GCE_INSTANCE_REMOVAL_BASE_NAME, UUID.randomUUID().toString()), Method.POST, params, TASK_ENQUEUE_DELAY);<NEW_LINE>// enqueue tasks to delete Cloud IoT Core devices<NEW_LINE>Utils.enqueueTask(GAE_QUEUE_NAME_GCE, GAE_TASK_CLOUD_IOT_CORE_DEVICE_REMOVAL, String.format("%s%s", GAE_TASK_CLOUD_IOT_CORE_DEVICE_REMOVAL_BASE_NAME, UUID.randomUUID().toString()), Method.POST, params, TASK_ENQUEUE_DELAY);<NEW_LINE>// return data<NEW_LINE>RestResponse restResponse = new RestResponse();<NEW_LINE>Gson gson = new Gson();<NEW_LINE>resp.setContentType(com.google.common.net.MediaType.JSON_UTF_8.toString());<NEW_LINE>restResponse.setCode(javax.servlet.http.HttpServletResponse.SC_OK);<NEW_LINE>restResponse.setMessage("Task enqueued");<NEW_LINE>resp.setStatus(javax.<MASK><NEW_LINE>resp.getWriter().println(gson.toJson(restResponse));<NEW_LINE>return;<NEW_LINE>}
servlet.http.HttpServletResponse.SC_OK);
296,136
public boolean hookIncomingRequestPostProcessed(RequestDetails theRequestDetails, HttpServletRequest theRequest, HttpServletResponse theResponse) throws AuthenticationException {<NEW_LINE>// We don't support this operation type yet<NEW_LINE>Validate.isTrue(theRequestDetails.<MASK><NEW_LINE>AuthorizedList authorizedList = buildAuthorizedList(theRequestDetails);<NEW_LINE>if (authorizedList == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Add rules to request so that the SearchNarrowingConsentService can pick them up<NEW_LINE>List<AllowedCodeInValueSet> postFilteringList = getPostFilteringList(theRequestDetails);<NEW_LINE>if (authorizedList.getAllowedCodeInValueSets() != null) {<NEW_LINE>postFilteringList.addAll(authorizedList.getAllowedCodeInValueSets());<NEW_LINE>}<NEW_LINE>if (theRequestDetails.getRestOperationType() != RestOperationTypeEnum.SEARCH_TYPE) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>FhirContext ctx = theRequestDetails.getServer().getFhirContext();<NEW_LINE>RuntimeResourceDefinition resDef = ctx.getResourceDefinition(theRequestDetails.getResourceName());<NEW_LINE>Collection<String> compartments = authorizedList.getAllowedCompartments();<NEW_LINE>if (compartments != null) {<NEW_LINE>Map<String, List<String>> parameterToOrValues = processResourcesOrCompartments(theRequestDetails, resDef, compartments, true);<NEW_LINE>applyParametersToRequestDetails(theRequestDetails, parameterToOrValues, true);<NEW_LINE>}<NEW_LINE>Collection<String> resources = authorizedList.getAllowedInstances();<NEW_LINE>if (resources != null) {<NEW_LINE>Map<String, List<String>> parameterToOrValues = processResourcesOrCompartments(theRequestDetails, resDef, resources, false);<NEW_LINE>applyParametersToRequestDetails(theRequestDetails, parameterToOrValues, true);<NEW_LINE>}<NEW_LINE>List<AllowedCodeInValueSet> allowedCodeInValueSet = authorizedList.getAllowedCodeInValueSets();<NEW_LINE>if (allowedCodeInValueSet != null) {<NEW_LINE>Map<String, List<String>> parameterToOrValues = processAllowedCodes(resDef, allowedCodeInValueSet);<NEW_LINE>applyParametersToRequestDetails(theRequestDetails, parameterToOrValues, false);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getRestOperationType() != RestOperationTypeEnum.SEARCH_SYSTEM);
1,836,957
private <P extends Definition, D extends P> Set<D> filterAndLoad(Class<D> defType, Set<DefDescriptor<?>> dependencies, TempFilter extraFilter) {<NEW_LINE>Set<D> out = Sets.newLinkedHashSet();<NEW_LINE>if (dependencies != null) {<NEW_LINE>AuraContext context = contextService.getCurrentContext();<NEW_LINE>for (DefDescriptor<?> descriptor : dependencies) {<NEW_LINE>if (defType.isAssignableFrom(descriptor.getDefType().getPrimaryInterface()) && (extraFilter == null || extraFilter.apply(descriptor))) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>DefDescriptor<D> dd = (DefDescriptor<D>) descriptor;<NEW_LINE>Optional<D> <MASK><NEW_LINE>D def = (optionalDef != null) ? optionalDef.orNull() : null;<NEW_LINE>if (def == null) {<NEW_LINE>try {<NEW_LINE>def = definitionService.getDefinition(dd);<NEW_LINE>} catch (QuickFixException qfe) {<NEW_LINE>//<NEW_LINE>// completely ignore this here, we should have already failed,<NEW_LINE>// actually, we should be able to use 'getLocalDef', but for some<NEW_LINE>// reason that fails in a few spots, will have to dig in to that.<NEW_LINE>//<NEW_LINE>throw new IllegalStateException("Illegal state, missing def for " + dd, qfe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (def == null) {<NEW_LINE>throw new IllegalStateException("Illegal state, missing def for " + dd);<NEW_LINE>}<NEW_LINE>out.add(def);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>}
optionalDef = context.getLocalDef(dd);
1,267,669
private static void deployCustom(ApplicationServer applicationServer, HandlerList handlers, List<String> customNames) {<NEW_LINE>customNames.parallelStream().forEach(name -> {<NEW_LINE>try {<NEW_LINE>Path war = Paths.get(Config.dir_custom().toString(<MASK><NEW_LINE>Path dir = Paths.get(Config.dir_servers_applicationServer_work().toString(), name);<NEW_LINE>if (Files.exists(war)) {<NEW_LINE>modified(war, dir);<NEW_LINE>String className = contextParamProject(dir);<NEW_LINE>Class<?> cls = ClassLoaderTools.urlClassLoader(false, false, false, false, false, Paths.get(dir.toString(), PathTools.WEB_INF_CLASSES)).loadClass(className);<NEW_LINE>QuickStartWebApp webApp = new QuickStartWebApp();<NEW_LINE>webApp.setAutoPreconfigure(false);<NEW_LINE>webApp.setDisplayName(name);<NEW_LINE>webApp.setContextPath("/" + name);<NEW_LINE>webApp.setResourceBase(dir.toAbsolutePath().toString());<NEW_LINE>webApp.setDescriptor(dir.resolve(Paths.get(PathTools.WEB_INF_WEB_XML)).toString());<NEW_LINE>Path ext = dir.resolve("WEB-INF").resolve("ext");<NEW_LINE>if (Files.exists(ext)) {<NEW_LINE>webApp.setExtraClasspath(calculateExtraClassPath(cls, ext));<NEW_LINE>} else {<NEW_LINE>webApp.setExtraClasspath(calculateExtraClassPath(cls));<NEW_LINE>}<NEW_LINE>logger.debug("{} extra class path:{}.", name, webApp.getExtraClasspath());<NEW_LINE>webApp.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", BooleanUtils.toStringTrueFalse(false));<NEW_LINE>webApp.getInitParams().put("org.eclipse.jetty.jsp.precompiled", BooleanUtils.toStringTrueFalse(true));<NEW_LINE>webApp.getInitParams().put("org.eclipse.jetty.servlet.Default.dirAllowed", BooleanUtils.toStringTrueFalse(false));<NEW_LINE>if (BooleanUtils.isTrue(applicationServer.getStatEnable())) {<NEW_LINE>FilterHolder statFilterHolder = new FilterHolder(new WebStatFilter());<NEW_LINE>statFilterHolder.setInitParameter("exclusions", applicationServer.getStatExclusions());<NEW_LINE>webApp.addFilter(statFilterHolder, "/*", EnumSet.of(DispatcherType.REQUEST));<NEW_LINE>ServletHolder statServletHolder = new ServletHolder(StatViewServlet.class);<NEW_LINE>statServletHolder.setInitParameter("sessionStatEnable", BooleanUtils.toStringTrueFalse(false));<NEW_LINE>webApp.addServlet(statServletHolder, "/druid/*");<NEW_LINE>}<NEW_LINE>if (BooleanUtils.isFalse(applicationServer.getExposeJest())) {<NEW_LINE>FilterHolder denialOfServiceFilterHolder = new FilterHolder(new DenialOfServiceFilter());<NEW_LINE>webApp.addFilter(denialOfServiceFilterHolder, "/jest/*", EnumSet.of(DispatcherType.REQUEST));<NEW_LINE>webApp.addFilter(denialOfServiceFilterHolder, "/describe/sources/*", EnumSet.of(DispatcherType.REQUEST));<NEW_LINE>}<NEW_LINE>handlers.addHandler(webApp);<NEW_LINE>} else if (Files.exists(dir)) {<NEW_LINE>PathUtils.cleanDirectory(dir);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
), name + PathTools.DOT_WAR);
1,340,944
public CreateAppInstanceAdminResult createAppInstanceAdmin(CreateAppInstanceAdminRequest createAppInstanceAdminRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAppInstanceAdminRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAppInstanceAdminRequest> request = null;<NEW_LINE>Response<CreateAppInstanceAdminResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAppInstanceAdminRequestMarshaller().marshall(createAppInstanceAdminRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateAppInstanceAdminResult, <MASK><NEW_LINE>JsonResponseHandler<CreateAppInstanceAdminResult> responseHandler = new JsonResponseHandler<CreateAppInstanceAdminResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
JsonUnmarshallerContext> unmarshaller = new CreateAppInstanceAdminResultJsonUnmarshaller();
22,349
private void submitForm() {<NEW_LINE>if (!validateForm()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);<NEW_LINE>imm.hideSoftInputFromWindow(et_user.getWindowToken(), 0);<NEW_LINE>if (!isOnline(this)) {<NEW_LINE>loginLoggingIn.setVisibility(View.GONE);<NEW_LINE>loginLogin.setVisibility(View.VISIBLE);<NEW_LINE>loginCreateAccount.setVisibility(View.INVISIBLE);<NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>generatingKeysText.setVisibility(View.GONE);<NEW_LINE>loggingInText.setVisibility(View.GONE);<NEW_LINE>fetchingNodesText.setVisibility(View.GONE);<NEW_LINE>prepareNodesText.setVisibility(View.GONE);<NEW_LINE>if (serversBusyText != null) {<NEW_LINE>serversBusyText.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>showErrorAlertDialog(getString(R.string.error_server_connection_problem), false, this);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>loginLogin.setVisibility(View.GONE);<NEW_LINE>loginCreateAccount.setVisibility(View.GONE);<NEW_LINE>loginLoggingIn.setVisibility(View.VISIBLE);<NEW_LINE>generatingKeysText.setVisibility(View.VISIBLE);<NEW_LINE><MASK><NEW_LINE>loginFetchNodesProgressBar.setVisibility(View.GONE);<NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>lastEmail = et_user.getText().toString().toLowerCase(Locale.ENGLISH).trim();<NEW_LINE>lastPassword = et_password.getText().toString();<NEW_LINE>logDebug("Generating keys");<NEW_LINE>onKeysGenerated(lastEmail, lastPassword);<NEW_LINE>}
loginProgressBar.setVisibility(View.VISIBLE);
1,193,029
public static MutableRoaringBitmap andNot(final MutableRoaringBitmap x1, final MutableRoaringBitmap x2) {<NEW_LINE>final MutableRoaringBitmap answer = new MutableRoaringBitmap();<NEW_LINE>int pos1 = 0, pos2 = 0;<NEW_LINE>final int length1 = x1.highLowContainer.size(), length2 = x2.highLowContainer.size();<NEW_LINE>while (pos1 < length1 && pos2 < length2) {<NEW_LINE>final char s1 = <MASK><NEW_LINE>final char s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>if (s1 == s2) {<NEW_LINE>final MappeableContainer c1 = x1.highLowContainer.getContainerAtIndex(pos1);<NEW_LINE>final MappeableContainer c2 = x2.highLowContainer.getContainerAtIndex(pos2);<NEW_LINE>final MappeableContainer c = c1.andNot(c2);<NEW_LINE>if (!c.isEmpty()) {<NEW_LINE>answer.getMappeableRoaringArray().append(s1, c);<NEW_LINE>}<NEW_LINE>++pos1;<NEW_LINE>++pos2;<NEW_LINE>} else if (s1 < s2) {<NEW_LINE>final int nextPos1 = x1.highLowContainer.advanceUntil(s2, pos1);<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(x1.highLowContainer, pos1, nextPos1);<NEW_LINE>pos1 = nextPos1;<NEW_LINE>} else {<NEW_LINE>// s1 > s2<NEW_LINE>pos2 = x2.highLowContainer.advanceUntil(s1, pos2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos2 == length2) {<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(x1.highLowContainer, pos1, length1);<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>}
x1.highLowContainer.getKeyAtIndex(pos1);
1,727,387
public static GlassfishInstance create(String displayName, String installRoot, String glassfishRoot, String domainsDir, String domainName, int httpPort, int adminPort, String userName, String password, String target, String url, GlassfishInstanceProvider gip) {<NEW_LINE>Map<String, String> ip = new HashMap<>();<NEW_LINE>ip.put(GlassfishModule.DISPLAY_NAME_ATTR, displayName);<NEW_LINE>ip.put(GlassfishModule.INSTALL_FOLDER_ATTR, installRoot);<NEW_LINE>ip.put(GlassfishModule.GLASSFISH_FOLDER_ATTR, glassfishRoot);<NEW_LINE>ip.put(GlassfishModule.DOMAINS_FOLDER_ATTR, domainsDir);<NEW_LINE>ip.put(GlassfishModule.DOMAIN_NAME_ATTR, domainName);<NEW_LINE>ip.put(GlassfishModule.HTTPPORT_ATTR<MASK><NEW_LINE>ip.put(GlassfishModule.ADMINPORT_ATTR, Integer.toString(adminPort));<NEW_LINE>ip.put(GlassfishModule.TARGET_ATTR, target);<NEW_LINE>ip.put(GlassfishModule.USERNAME_ATTR, userName != null ? userName : DEFAULT_ADMIN_NAME);<NEW_LINE>if (password != null) {<NEW_LINE>ip.put(GlassfishModule.PASSWORD_ATTR, password);<NEW_LINE>}<NEW_LINE>ip.put(GlassfishModule.URL_ATTR, url);<NEW_LINE>// extract the host from the URL<NEW_LINE>String[] bigUrlParts = url.split("]");<NEW_LINE>if (null != bigUrlParts && bigUrlParts.length > 1) {<NEW_LINE>// NOI18N<NEW_LINE>String[] urlParts = bigUrlParts[1].split(":");<NEW_LINE>if (null != urlParts && urlParts.length > 2) {<NEW_LINE>ip.put(GlassfishModule.HOSTNAME_ATTR, urlParts[2]);<NEW_LINE>ip.put(GlassfishModule.HTTPHOST_ATTR, urlParts[2]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return create(ip, gip, true);<NEW_LINE>}
, Integer.toString(httpPort));
308,433
public static synchronized String validateAuthToken(Context c, String token) throws GoogleTasksException {<NEW_LINE>GoogleAccountManager accountManager = new <MASK><NEW_LINE>if (testToken(token))<NEW_LINE>return token;<NEW_LINE>// If fail, token may have expired -- get a new one and return that<NEW_LINE>String accountName = Preferences.getStringValue(GtasksPreferenceService.PREF_USER_NAME);<NEW_LINE>Account a = accountManager.getAccountByName(accountName);<NEW_LINE>if (a == null) {<NEW_LINE>throw new GoogleTasksException(c.getString(R.string.gtasks_error_accountNotFound, accountName), "account-not-found");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < REVALIDATION_TRIES; i++) {<NEW_LINE>accountManager.invalidateAuthToken(token);<NEW_LINE>// try with notify-auth-failure = false<NEW_LINE>AccountManagerFuture<Bundle> future = accountManager.manager.getAuthToken(a, GtasksInvoker.AUTH_TOKEN_TYPE, false, null, null);<NEW_LINE>token = getTokenFromFuture(c, future);<NEW_LINE>if (TOKEN_INTENT_RECEIVED.equals(token))<NEW_LINE>return null;<NEW_LINE>else if (token != null && testToken(token))<NEW_LINE>return token;<NEW_LINE>}<NEW_LINE>throw new GoogleTasksException(c.getString(R.string.gtasks_error_authRefresh), "auth-token-refresh");<NEW_LINE>}
GoogleAccountManager(ContextManager.getContext());
212,890
default Object lookup(final SymbolNode opNode, final Context c, final boolean cutoff, final int forToolId) {<NEW_LINE>final boolean isVarDecl = (opNode.getKind() == ASTConstants.VariableDeclKind);<NEW_LINE>Object result = c.lookup(opNode, cutoff && isVarDecl);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>result = opNode.getToolObject(forToolId);<NEW_LINE>if (result != null) {<NEW_LINE>return WorkerValue.mux(result);<NEW_LINE>}<NEW_LINE>if (opNode.getKind() == ASTConstants.UserDefinedOpKind) {<NEW_LINE>// Changed by LL on 10 Apr 2011 from<NEW_LINE>//<NEW_LINE>// result = ((OpDefNode) opNode).getBody().getToolObject(toolId);<NEW_LINE>//<NEW_LINE>// to the following<NEW_LINE>ExprNode body = ((OpDefNode) opNode).getBody();<NEW_LINE>result = body.getToolObject(forToolId);<NEW_LINE>while ((result == null) && (body.getKind() == ASTConstants.SubstInKind)) {<NEW_LINE>body = ((<MASK><NEW_LINE>result = body.getToolObject(forToolId);<NEW_LINE>}<NEW_LINE>// end change<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return opNode;<NEW_LINE>}
SubstInNode) body).getBody();
137,646
// isOpen<NEW_LINE>@Override<NEW_LINE>protected boolean beforeSave(boolean newRecord) {<NEW_LINE>// Truncate Dates<NEW_LINE>Timestamp date = getStartDate();<NEW_LINE>if (date != null) {<NEW_LINE>setStartDate(TimeUtil.getDay(date));<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>date = getEndDate();<NEW_LINE>if (date != null) {<NEW_LINE>setEndDate<MASK><NEW_LINE>} else {<NEW_LINE>setEndDate(TimeUtil.getMonthLastDay(getStartDate()));<NEW_LINE>}<NEW_LINE>if (getEndDate().before(getStartDate())) {<NEW_LINE>SimpleDateFormat df = DisplayType.getDateFormat(DisplayType.Date);<NEW_LINE>throw new AdempiereException(df.format(getEndDate()) + " < " + df.format(getStartDate()));<NEW_LINE>}<NEW_LINE>MYear year = new MYear(getCtx(), getC_Year_ID(), get_TrxName());<NEW_LINE>final String sqlWhereClause = "C_Year_ID IN (SELECT y.C_Year_ID from C_Year y WHERE" + " y.C_Calendar_ID =?)" + " AND (? BETWEEN StartDate AND EndDate" + " OR ? BETWEEN StartDate AND EndDate)" + " AND PeriodType=?";<NEW_LINE>final List<I_C_Period> periods = new TypedSqlQuery<>(getCtx(), I_C_Period.class, sqlWhereClause, ITrx.TRXNAME_ThreadInherited).setParameters(year.getC_Calendar_ID(), getStartDate(), getEndDate(), getPeriodType()).list(I_C_Period.class);<NEW_LINE>for (I_C_Period period : periods) {<NEW_LINE>if (period.getC_Period_ID() != getC_Period_ID()) {<NEW_LINE>throw new AdempiereException("Period overlaps with: " + period.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(TimeUtil.getDay(date));
135,434
public void marshall(AwsEksClusterDetails awsEksClusterDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsEksClusterDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getCertificateAuthorityData(), CERTIFICATEAUTHORITYDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getEndpoint(), ENDPOINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getResourcesVpcConfig(), RESOURCESVPCCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getVersion(), VERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEksClusterDetails.getLogging(), LOGGING_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
awsEksClusterDetails.getClusterStatus(), CLUSTERSTATUS_BINDING);
1,438,073
public void downloadFileViaTokenPublic(String accessKey, String token, String range, Boolean genericMimetype, Boolean inline) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'accessKey' is set<NEW_LINE>if (accessKey == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'accessKey' when calling downloadFileViaTokenPublic");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'token' is set<NEW_LINE>if (token == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'token' when calling downloadFileViaTokenPublic");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/public/shares/downloads/{access_key}/{token}".replaceAll("\\{" + "access_key" + "\\}", apiClient.escapeString(accessKey.toString())).replaceAll("\\{" + "token" + "\\}", apiClient.escapeString(token.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "generic_mimetype", genericMimetype));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "inline", inline));<NEW_LINE>if (range != null)<NEW_LINE>localVarHeaderParams.put("Range", apiClient.parameterToString(range));<NEW_LINE>final String[] localVarAccepts = { "application/octet-stream" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, <MASK><NEW_LINE>}
localVarAccept, localVarContentType, localVarAuthNames, null);
8,974
public ListenableFuture<SegmentsAndCommitMetadata> push(final Collection<SegmentIdWithShardSpec> identifiers, @Nullable final Committer committer, final boolean useUniquePath) {<NEW_LINE>final Map<SegmentIdWithShardSpec, Sink> theSinks = new HashMap<>();<NEW_LINE>AtomicLong pushedHydrantsCount = new AtomicLong();<NEW_LINE>for (final SegmentIdWithShardSpec identifier : identifiers) {<NEW_LINE>final Sink sink = sinks.get(identifier);<NEW_LINE>if (sink == null) {<NEW_LINE>throw new ISE("No sink for identifier: %s", identifier);<NEW_LINE>}<NEW_LINE>theSinks.put(identifier, sink);<NEW_LINE>if (sink.finishWriting()) {<NEW_LINE>totalRows.addAndGet(-sink.getNumRows());<NEW_LINE>}<NEW_LINE>// count hydrants for stats:<NEW_LINE>pushedHydrantsCount.addAndGet(Iterables.size(sink));<NEW_LINE>}<NEW_LINE>return // We should always persist all segments regardless of the input because metadata should be committed for all<NEW_LINE>Futures.// We should always persist all segments regardless of the input because metadata should be committed for all<NEW_LINE>transform(// segments.<NEW_LINE>persistAll(committer), (Function<Object, SegmentsAndCommitMetadata>) commitMetadata -> {<NEW_LINE>final List<DataSegment> dataSegments = new ArrayList<>();<NEW_LINE>log.info("Preparing to push (stats): processed rows: [%d], sinks: [%d], fireHydrants (across sinks): [%d]", rowIngestionMeters.getProcessed(), theSinks.size(), pushedHydrantsCount.get());<NEW_LINE>log.debug("Building and pushing segments: %s", theSinks.keySet().stream().map(SegmentIdWithShardSpec::toString).collect(Collectors.joining(", ")));<NEW_LINE>for (Map.Entry<SegmentIdWithShardSpec, Sink> entry : theSinks.entrySet()) {<NEW_LINE>if (droppingSinks.contains(entry.getKey())) {<NEW_LINE>log.warn("Skipping push of currently-dropping sink[%s]", entry.getKey());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final DataSegment dataSegment = mergeAndPush(entry.getKey(), entry.getValue(), useUniquePath);<NEW_LINE>if (dataSegment != null) {<NEW_LINE>dataSegments.add(dataSegment);<NEW_LINE>} else {<NEW_LINE>log.warn(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("Push complete...");<NEW_LINE>return new SegmentsAndCommitMetadata(dataSegments, commitMetadata);<NEW_LINE>}, pushExecutor);<NEW_LINE>}
"mergeAndPush[%s] returned null, skipping.", entry.getKey());
1,187,116
private DateTimeResolutionResult parseWeekOfYear(String text, LocalDateTime referenceDate) {<NEW_LINE>DateTimeResolutionResult ret = new DateTimeResolutionResult();<NEW_LINE>String trimmedText = text.trim().toLowerCase();<NEW_LINE>ConditionalMatch match = RegexExtension.matchExact(this.config.getWeekOfYearRegex(), trimmedText, true);<NEW_LINE>if (!match.getSuccess()) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>String cardinalStr = match.getMatch().get().getGroup("cardinal").value;<NEW_LINE>String orderStr = match.getMatch().get().getGroup("order").value.toLowerCase();<NEW_LINE>int year = this.config.getDateExtractor().getYearFromText(match.getMatch().get());<NEW_LINE>if (year == Constants.InvalidYear) {<NEW_LINE>int swift = this.config.getSwiftYear(orderStr);<NEW_LINE>if (swift < -1) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>year = referenceDate.getYear() + swift;<NEW_LINE>}<NEW_LINE>LocalDateTime targetWeekMonday;<NEW_LINE>if (this.config.isLastCardinal(cardinalStr)) {<NEW_LINE>targetWeekMonday = DateUtil.thisDate(getLastThursday(year), DayOfWeek.MONDAY.getValue());<NEW_LINE>ret.setTimex(TimexUtility.generateWeekTimex(targetWeekMonday));<NEW_LINE>} else {<NEW_LINE>int weekNum = this.config.getCardinalMap().get(cardinalStr);<NEW_LINE>targetWeekMonday = DateUtil.thisDate(getFirstThursday(year), DayOfWeek.MONDAY.getValue()).plusDays(Constants.<MASK><NEW_LINE>ret.setTimex(TimexUtility.generateWeekOfYearTimex(year, weekNum));<NEW_LINE>}<NEW_LINE>ret.setFutureValue(inclusiveEndPeriod ? new Pair<>(targetWeekMonday, targetWeekMonday.plusDays(Constants.WeekDayCount - 1)) : new Pair<>(targetWeekMonday, targetWeekMonday.plusDays(Constants.WeekDayCount)));<NEW_LINE>ret.setPastValue(inclusiveEndPeriod ? new Pair<>(targetWeekMonday, targetWeekMonday.plusDays(Constants.WeekDayCount - 1)) : new Pair<>(targetWeekMonday, targetWeekMonday.plusDays(Constants.WeekDayCount)));<NEW_LINE>ret.setSuccess(true);<NEW_LINE>return ret;<NEW_LINE>}
WeekDayCount * (weekNum - 1));
212,386
private void writeStringWithoutLength(char[] chars, int len) {<NEW_LINE>int p = pos;<NEW_LINE>byte[] buff = data;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>int c = chars[i];<NEW_LINE>if (c < 0x80) {<NEW_LINE>buff[p++] = (byte) c;<NEW_LINE>} else if (c >= 0x800) {<NEW_LINE>buff[p++] = (byte) (0xe0 | (c >> 12));<NEW_LINE>buff[p++] = (byte) ((c >> 6) & 0x3f);<NEW_LINE>buff[p++] = (byte) (c & 0x3f);<NEW_LINE>} else {<NEW_LINE>buff[p++] = (byte) (0xc0 | (c >> 6));<NEW_LINE>buff[p++] = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>pos = p;<NEW_LINE>}
(byte) (c & 0x3f);
237,796
public static // [VanillaCopy] ItemRenderer.renderItem with simplifications + color support + custom model<NEW_LINE>void renderItemCustomColor(LivingEntity entity, ItemStack stack, int color, PoseStack ms, MultiBufferSource buffers, int light, int overlay, @Nullable BakedModel model) {<NEW_LINE>ms.pushPose();<NEW_LINE>if (model == null) {<NEW_LINE>model = Minecraft.getInstance().getItemRenderer().getModel(stack, entity.level, entity, entity.getId());<NEW_LINE>}<NEW_LINE>model.getTransforms().getTransform(ItemTransforms.TransformType.NONE).apply(false, ms);<NEW_LINE>ms.translate(-<MASK><NEW_LINE>if (!model.isCustomRenderer() && !stack.is(Items.TRIDENT)) {<NEW_LINE>RenderType rendertype = ItemBlockRenderTypes.getRenderType(stack, true);<NEW_LINE>VertexConsumer ivertexbuilder = ItemRenderer.getFoilBufferDirect(buffers, rendertype, true, stack.hasFoil());<NEW_LINE>renderBakedItemModel(model, stack, color, light, overlay, ms, ivertexbuilder);<NEW_LINE>} else {<NEW_LINE>// todo 1.17 BlockEntityWithoutLevelRenderer.instance.renderByItem(stack, ItemTransforms.TransformType.NONE, ms, buffers, light, overlay);<NEW_LINE>}<NEW_LINE>ms.popPose();<NEW_LINE>}
0.5D, -0.5D, -0.5D);
1,054,250
static void write(TManifest manifest, OutputStream out) throws IOException {<NEW_LINE>CharsetEncoder encoder = Charset.defaultCharset().newEncoder();<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(512);<NEW_LINE>String version = manifest.mainAttributes.getValue(TAttributes.Name.MANIFEST_VERSION);<NEW_LINE>if (version != null) {<NEW_LINE>writeEntry(out, TAttributes.Name.MANIFEST_VERSION, version, encoder, buffer);<NEW_LINE>for (Object o : manifest.mainAttributes.keySet()) {<NEW_LINE>TAttributes.Name name = (TAttributes.Name) o;<NEW_LINE>if (!name.equals(TAttributes.Name.MANIFEST_VERSION)) {<NEW_LINE>writeEntry(out, name, manifest.mainAttributes.getValue(name), encoder, buffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>for (String key : manifest.getEntries().keySet()) {<NEW_LINE>writeEntry(out, NAME_ATTRIBUTE, key, encoder, buffer);<NEW_LINE>TAttributes attrib = manifest.entries.get(key);<NEW_LINE>for (Object o : attrib.keySet()) {<NEW_LINE>TAttributes.Name <MASK><NEW_LINE>writeEntry(out, name, attrib.getValue(name), encoder, buffer);<NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>}<NEW_LINE>}
name = (TAttributes.Name) o;
830,422
protected String addForbiddenWords(SearchRequest searchRequest, String query) {<NEW_LINE>List<String> allForbiddenWords = new ArrayList<>(searchRequest.getInternalData().getForbiddenWords());<NEW_LINE>allForbiddenWords.addAll(configProvider.getBaseConfig().getSearching().getForbiddenWords());<NEW_LINE>allForbiddenWords.addAll(searchRequest.<MASK><NEW_LINE>List<String> allPossibleForbiddenWords = allForbiddenWords.stream().filter(x -> !(x.contains(" ") || x.contains("-") || x.contains("."))).collect(Collectors.toList());<NEW_LINE>if (allForbiddenWords.size() > allPossibleForbiddenWords.size()) {<NEW_LINE>logger.debug("Not using some forbidden words in query because characters forbidden by newznab are contained");<NEW_LINE>}<NEW_LINE>if (!allPossibleForbiddenWords.isEmpty()) {<NEW_LINE>if (config.getBackend().equals(BackendType.NZEDB) || config.getBackend().equals(BackendType.NNTMUX) || config.getHost().toLowerCase().contains("omgwtf")) {<NEW_LINE>query += (query.isEmpty() ? "" : " ") + "!" + Joiner.on(",!").join(allPossibleForbiddenWords);<NEW_LINE>} else {<NEW_LINE>query += (query.isEmpty() ? "" : " ") + "--" + Joiner.on(" --").join(allPossibleForbiddenWords);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return query;<NEW_LINE>}
getCategory().getForbiddenWords());
150,200
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>if (account != null) {<NEW_LINE>builder.field(Field.ACCOUNT.getPreferredName(), account);<NEW_LINE>}<NEW_LINE>if (auth != null) {<NEW_LINE>builder.field(Field.USER.getPreferredName(), auth.user());<NEW_LINE>if (WatcherParams.hideSecrets(params) && auth.password().value().startsWith(CryptoService.ENCRYPTED_TEXT_PREFIX) == false) {<NEW_LINE>builder.field(Field.PASSWORD.getPreferredName(), WatcherXContentParser.REDACTED_PASSWORD);<NEW_LINE>} else {<NEW_LINE>builder.field(Field.PASSWORD.getPreferredName(), auth.password().value());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (profile != null) {<NEW_LINE>builder.field(Field.PROFILE.getPreferredName(), profile.name()<MASK><NEW_LINE>}<NEW_LINE>if (dataAttachment != null) {<NEW_LINE>builder.field(Field.ATTACH_DATA.getPreferredName(), dataAttachment, params);<NEW_LINE>}<NEW_LINE>if (emailAttachments != null) {<NEW_LINE>emailAttachments.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>email.xContentBody(builder, params);<NEW_LINE>return builder.endObject();<NEW_LINE>}
.toLowerCase(Locale.ROOT));
1,586,032
public void execute() {<NEW_LINE>if (src == null) {<NEW_LINE>throw new BuildException("Zip file (src attribute) is not set!");<NEW_LINE>}<NEW_LINE>if (privatekey == null) {<NEW_LINE>throw new BuildException("Private key is not set!");<NEW_LINE>}<NEW_LINE>if (publickey == null) {<NEW_LINE>throw new BuildException("Public key is not set!");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Get all necessary components<NEW_LINE>byte[] zipBytes = readFile(src);<NEW_LINE>byte[] privateKeyBytes = pemToDer(readFile(privatekey));<NEW_LINE>byte[] publicKeyBytes <MASK><NEW_LINE>PrivateKey key = createPrivateKey(privateKeyBytes);<NEW_LINE>byte[] signature = signature(zipBytes, key);<NEW_LINE>// Write the content of the CRX file<NEW_LINE>ByteBuffer bb = ByteBuffer.allocate(4);<NEW_LINE>bb.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>FileOutputStream output = new FileOutputStream(getDestfile());<NEW_LINE>// NOI18N<NEW_LINE>output.write("Cr24".getBytes());<NEW_LINE>output.write(bb.putInt(0, 2).array());<NEW_LINE>output.write(bb.putInt(0, publicKeyBytes.length).array());<NEW_LINE>output.write(bb.putInt(0, signature.length).array());<NEW_LINE>output.write(publicKeyBytes);<NEW_LINE>output.write(signature);<NEW_LINE>output.write(zipBytes);<NEW_LINE>output.close();<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>throw new BuildException(ioex);<NEW_LINE>} catch (GeneralSecurityException gsex) {<NEW_LINE>throw new BuildException(gsex);<NEW_LINE>}<NEW_LINE>}
= pemToDer(readFile(publickey));
417,995
public void marshall(GroupType groupType, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (groupType == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(groupType.getGroupName(), GROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupType.getUserPoolId(), USERPOOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupType.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupType.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupType.getPrecedence(), PRECEDENCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupType.getLastModifiedDate(), LASTMODIFIEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupType.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
895,951
public void removeDiskReferenceFromSnapshot(String diskFileName) {<NEW_LINE>String numSnapshotsStr = _properties.getProperty("snapshot.numSnapshots");<NEW_LINE>if (numSnapshotsStr != null) {<NEW_LINE>int <MASK><NEW_LINE>for (int i = 0; i < numSnaphosts; i++) {<NEW_LINE>String numDisksStr = _properties.getProperty(String.format("snapshot%d.numDisks", i));<NEW_LINE>int numDisks = Integer.parseInt(numDisksStr);<NEW_LINE>boolean diskFound = false;<NEW_LINE>for (int j = 0; j < numDisks; j++) {<NEW_LINE>String keyName = String.format("snapshot%d.disk%d.fileName", i, j);<NEW_LINE>String fileName = _properties.getProperty(keyName);<NEW_LINE>if (!diskFound) {<NEW_LINE>if (fileName.equalsIgnoreCase(diskFileName)) {<NEW_LINE>diskFound = true;<NEW_LINE>_properties.remove(keyName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>_properties.setProperty(String.format("snapshot%d.disk%d.fileName", i, j - 1), fileName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (diskFound)<NEW_LINE>_properties.setProperty(String.format("snapshot%d.numDisks", i), String.valueOf(numDisks - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
numSnaphosts = Integer.parseInt(numSnapshotsStr);
775,282
protected Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>> innerExecute(String name, final CompletionSuggestionContext suggestionContext, final IndexSearcher searcher, CharsRefBuilder spare) throws IOException {<NEW_LINE>if (suggestionContext.getFieldType() != null) {<NEW_LINE>final CompletionFieldMapper.CompletionFieldType fieldType = suggestionContext.getFieldType();<NEW_LINE>CompletionSuggestion completionSuggestion = new CompletionSuggestion(name, suggestionContext.getSize(), suggestionContext.isSkipDuplicates());<NEW_LINE>spare.copyUTF8Bytes(suggestionContext.getText());<NEW_LINE>CompletionSuggestion.Entry completionSuggestEntry = new CompletionSuggestion.Entry(new Text(spare.toString()), <MASK><NEW_LINE>completionSuggestion.addTerm(completionSuggestEntry);<NEW_LINE>int shardSize = suggestionContext.getShardSize() != null ? suggestionContext.getShardSize() : suggestionContext.getSize();<NEW_LINE>TopSuggestGroupDocsCollector collector = new TopSuggestGroupDocsCollector(shardSize, suggestionContext.isSkipDuplicates());<NEW_LINE>suggest(searcher, suggestionContext.toQuery(), collector);<NEW_LINE>int numResult = 0;<NEW_LINE>for (TopSuggestDocs.SuggestScoreDoc suggestDoc : collector.get().scoreLookupDocs()) {<NEW_LINE>// collect contexts<NEW_LINE>Map<String, Set<String>> contexts = Collections.emptyMap();<NEW_LINE>if (fieldType.hasContextMappings()) {<NEW_LINE>List<CharSequence> rawContexts = collector.getContexts(suggestDoc.doc);<NEW_LINE>if (rawContexts.size() > 0) {<NEW_LINE>contexts = fieldType.getContextMappings().getNamedContexts(rawContexts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (numResult++ < suggestionContext.getSize()) {<NEW_LINE>CompletionSuggestion.Entry.Option option = new CompletionSuggestion.Entry.Option(suggestDoc.doc, new Text(suggestDoc.key.toString()), suggestDoc.score, contexts);<NEW_LINE>completionSuggestEntry.addOption(option);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return completionSuggestion;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
0, spare.length());
1,016,732
public String order(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) {<NEW_LINE>Integer C_Order_ID = (Integer) value;<NEW_LINE>if (// assuming it is resetting value<NEW_LINE>isCalloutActive() || C_Order_ID == null || C_Order_ID.intValue() == 0)<NEW_LINE>return "";<NEW_LINE>mTab.setValue("C_Invoice_ID", null);<NEW_LINE>mTab.setValue("C_Charge_ID", null);<NEW_LINE>mTab.setValue("IsPrepayment", Boolean.TRUE);<NEW_LINE>//<NEW_LINE>mTab.setValue("DiscountAmt", Env.ZERO);<NEW_LINE>mTab.setValue("WriteOffAmt", Env.ZERO);<NEW_LINE>mTab.setValue("IsOverUnderPayment", Boolean.FALSE);<NEW_LINE>mTab.setValue("OverUnderAmt", Env.ZERO);<NEW_LINE>// Payment Date<NEW_LINE>Timestamp ts = (Timestamp) mTab.getValue("DateTrx");<NEW_LINE>if (ts == null)<NEW_LINE>ts = new Timestamp(System.currentTimeMillis());<NEW_LINE>//<NEW_LINE>String sql = // #1<NEW_LINE>"SELECT COALESCE(Bill_BPartner_ID, C_BPartner_ID) as C_BPartner_ID " + ", C_Currency_ID " + ", GrandTotal " + "FROM C_Order WHERE C_Order_ID=?";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, C_Order_ID.intValue());<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>mTab.setValue("C_BPartner_ID", new Integer(rs.getInt(1)));<NEW_LINE>// Set Order Currency<NEW_LINE>int C_Currency_ID = rs.getInt(2);<NEW_LINE>mTab.setValue("C_Currency_ID", new Integer(C_Currency_ID));<NEW_LINE>//<NEW_LINE>// Set Pay<NEW_LINE>BigDecimal GrandTotal = rs.getBigDecimal(3);<NEW_LINE>// Amount<NEW_LINE>if (GrandTotal == null)<NEW_LINE>GrandTotal = Env.ZERO;<NEW_LINE>mTab.setValue("PayAmt", GrandTotal);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(<MASK><NEW_LINE>return e.getLocalizedMessage();<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>return docType(ctx, WindowNo, mTab, mField, value);<NEW_LINE>}
Level.SEVERE, sql, e);
731,746
private static ExternalFunctionBodyNode createExternalFunctionBodyNode(BFunction bFunction) {<NEW_LINE>Map<String, List<String>> fields = new LinkedHashMap<>();<NEW_LINE>if (bFunction.getKind() == BFunction.BFunctionKind.METHOD) {<NEW_LINE>JMethod jMethod = (JMethod) bFunction;<NEW_LINE>fields.put(NAME, Collections.singletonList(jMethod.getJavaMethodName()));<NEW_LINE>fields.put(CLASS, Collections.singletonList(jMethod.getDeclaringClass().getName()));<NEW_LINE>fields.put(PARAM_TYPES, getParameterList(jMethod.getParameters()));<NEW_LINE>} else if (bFunction.getKind() == BFunction.BFunctionKind.CONSTRUCTOR) {<NEW_LINE>JConstructor jConstructor = (JConstructor) bFunction;<NEW_LINE>fields.put(CLASS, Collections.singletonList(jConstructor.getDeclaringClass().getName()));<NEW_LINE>fields.put(PARAM_TYPES, getParameterList(jConstructor.getParameters()));<NEW_LINE>} else if (bFunction.getKind() == BFunction.BFunctionKind.FIELD_GET || bFunction.getKind() == BFunction.BFunctionKind.FIELD_SET) {<NEW_LINE>JField jField = (JField) bFunction;<NEW_LINE>fields.put(NAME, Collections.singletonList(jField.getFieldName()));<NEW_LINE>fields.put(CLASS, Collections.singletonList(jField.getDeclaringClass().getName()));<NEW_LINE>}<NEW_LINE>Token equalsToken = <MASK><NEW_LINE>NodeList<AnnotationNode> annotations = AbstractNodeFactory.createNodeList(createAnnotationNode(bFunction.getKind().value(), fields));<NEW_LINE>Token externalToken = AbstractNodeFactory.createToken(SyntaxKind.EXTERNAL_KEYWORD);<NEW_LINE>Token semiColonToken = AbstractNodeFactory.createToken(SyntaxKind.SEMICOLON_TOKEN);<NEW_LINE>return NodeFactory.createExternalFunctionBodyNode(equalsToken, annotations, externalToken, semiColonToken);<NEW_LINE>}
AbstractNodeFactory.createToken(SyntaxKind.EQUAL_TOKEN);
1,690,077
public WebResponse invokeAuthServer(String testcase, WebConversation wc, WebResponse response, TestSettings settings, List<validationData> expectations, String invoke_type) throws Exception {<NEW_LINE>String thisMethod = "invokeAuthServer";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>WebRequest request = 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, "authorization Endpoint: " + settings.getAuthorizeEndpt());<NEW_LINE>request = new GetMethodWebRequest(settings.getAuthorizeEndpt());<NEW_LINE>Log.info(thisClass, thisMethod, "Request before filling is: " + request);<NEW_LINE>request = <MASK><NEW_LINE>Log.info(thisClass, thisMethod, "Request after filling is: " + request);<NEW_LINE>if (invoke_type.equals(Constants.INVOKE_AUTH_SERVER_WITH_BASIC_AUTH)) {<NEW_LINE>cttools.addBasicAuthCredToHeader(request, settings);<NEW_LINE>}<NEW_LINE>Log.info(thisClass, thisMethod, "Request after filling is: " + request);<NEW_LINE>// Invoke the client<NEW_LINE>response = wc.getResponse(request);<NEW_LINE>msgUtils.printResponseParts(response, thisMethod, "Response from Auth server: ");<NEW_LINE>validationTools.validateResult(response, Constants.INVOKE_AUTH_SERVER, expectations, settings);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.error(thisClass, testcase, e, "Exception occurred in " + thisMethod);<NEW_LINE>System.err.println("Exception: " + e);<NEW_LINE>validationTools.validateException(expectations, Constants.INVOKE_AUTH_SERVER, e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
formTools.fillAuthorizationForm(request, settings);
1,806,237
Collection<String> checkForSingleNodeTable(RouteResultset rrs, String clientCharset) throws SQLNonTransientException {<NEW_LINE>Set<Pair<String, String>> tablesSet = new HashSet<>(ctx.getTables());<NEW_LINE>Set<String> involvedNodeSet = new HashSet<>();<NEW_LINE>routeForShardingConditionsToOneNode(rrs, tablesSet, involvedNodeSet, clientCharset);<NEW_LINE>String currentNode = null;<NEW_LINE>for (String x : involvedNodeSet) {<NEW_LINE>currentNode = x;<NEW_LINE>}<NEW_LINE>currentNode = <MASK><NEW_LINE>if (involvedNodeSet.size() > 1 || currentNode == null) {<NEW_LINE>throw new SQLNonTransientException(getErrorMsg());<NEW_LINE>}<NEW_LINE>// check for table remain<NEW_LINE>for (Pair<String, String> table : tablesSet) {<NEW_LINE>String sName = table.getKey();<NEW_LINE>String tName = table.getValue();<NEW_LINE>SchemaConfig tSchema = DbleServer.getInstance().getConfig().getSchemas().get(sName);<NEW_LINE>BaseTableConfig tConfig = tSchema.getTables().get(tName);<NEW_LINE>if (tConfig == null) {<NEW_LINE>if (!currentNode.equals(tSchema.getDefaultSingleNode())) {<NEW_LINE>throw new SQLNonTransientException(getErrorMsg());<NEW_LINE>}<NEW_LINE>} else if (tConfig instanceof SingleTableConfig) {<NEW_LINE>if (!tConfig.getShardingNodes().get(0).equals(currentNode)) {<NEW_LINE>throw new SQLNonTransientException(getErrorMsg());<NEW_LINE>}<NEW_LINE>} else if (tConfig instanceof GlobalTableConfig) {<NEW_LINE>throw new SQLNonTransientException(getErrorMsg());<NEW_LINE>} else {<NEW_LINE>throw new SQLNonTransientException(getErrorMsg());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return involvedNodeSet;<NEW_LINE>}
routeForNoShardingTablesToOneNode(currentNode, tablesSet, involvedNodeSet);
1,805,808
public static JEditorPane createTipBrowser() {<NEW_LINE>JEditorPane browser = new JEditorPane() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setDocument(Document document) {<NEW_LINE>super.setDocument(document);<NEW_LINE>document.putProperty("imageCache", new URLDictionatyLoader());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>browser.setEditable(false);<NEW_LINE>browser.setBackground(UIUtil.getTextFieldBackground());<NEW_LINE>browser.addHyperlinkListener(e -> {<NEW_LINE>if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {<NEW_LINE>BrowserUtil.browse(e.getURL());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>URL resource = ResourceUtil.getResource(TipUIUtil.class, "/tips/css/", UIUtil.isUnderDarcula() ? "tips_darcula.css" : "tips.css");<NEW_LINE>HTMLEditorKit <MASK><NEW_LINE>kit.getStyleSheet().addStyleSheet(UIUtil.loadStyleSheet(resource));<NEW_LINE>browser.setEditorKit(kit);<NEW_LINE>return browser;<NEW_LINE>}
kit = JBHtmlEditorKit.create(false);
504,689
final DisassociateProductFromPortfolioResult executeDisassociateProductFromPortfolio(DisassociateProductFromPortfolioRequest disassociateProductFromPortfolioRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateProductFromPortfolioRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateProductFromPortfolioRequest> request = null;<NEW_LINE>Response<DisassociateProductFromPortfolioResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateProductFromPortfolioRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateProductFromPortfolioRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateProductFromPortfolio");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateProductFromPortfolioResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateProductFromPortfolioResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
695,141
private boolean invokeMethod(Map m, String method, String clazz) {<NEW_LINE>if (theClass == null) {<NEW_LINE>try {<NEW_LINE>theClass = Class.forName(clazz);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object <MASK><NEW_LINE>if (o == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (theMethod == null) {<NEW_LINE>try {<NEW_LINE>theMethod = theClass.getDeclaredMethod(method, null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (theMethod.getReturnType() != Boolean.class && theMethod.getReturnType() != Boolean.TYPE) {<NEW_LINE>throw new IllegalArgumentException(// NOI18N<NEW_LINE>"Method " + method + " on " + clazz + " must return boolean or Boolean and " + "take no arguments");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Boolean result = Boolean.FALSE;<NEW_LINE>try {<NEW_LINE>result = (Boolean) theMethod.invoke(o, null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return result.booleanValue();<NEW_LINE>}
o = m.get(value);
805,339
private void readAttributes(XMLStreamReader reader) throws Exception {<NEW_LINE>String classAtt = "";<NEW_LINE>String typeAtt = "";<NEW_LINE>for (int i = 0; i < reader.getAttributeCount(); i++) {<NEW_LINE>String attName = reader.getAttributeName(i).getLocalPart();<NEW_LINE>if (ATTRIBUTES_CLASS.equalsIgnoreCase(attName)) {<NEW_LINE>classAtt = reader.getAttributeValue(i);<NEW_LINE>} else if (ATTRIBUTES_TYPE.equalsIgnoreCase(attName) || ATTRIBUTES_TYPE2.equalsIgnoreCase(attName)) {<NEW_LINE>typeAtt = reader.getAttributeValue(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean end = false;<NEW_LINE>while (reader.hasNext() && !end) {<NEW_LINE>int type = reader.next();<NEW_LINE>switch(type) {<NEW_LINE>case XMLStreamReader.START_ELEMENT:<NEW_LINE>if (ATTRIBUTE.equalsIgnoreCase(xmlReader.getLocalName())) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case XMLStreamReader.END_ELEMENT:<NEW_LINE>if (ATTRIBUTES.equalsIgnoreCase(xmlReader.getLocalName())) {<NEW_LINE>end = true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
readAttribute(reader, classAtt, typeAtt);
1,529,195
public void addEdge(int threadId, WritableComparable srcId, WritableComparable dstId, Writable value) throws IOException {<NEW_LINE>int bytesEdgeSrcOffset = 0, bytesEdgeDstOffset = 0, bytesDataOffsets = 0;<NEW_LINE>bytesEdgeSrcOffset = (int) -edgeSrcIdOutputStream[threadId].bytesWriten();<NEW_LINE>srcId.write(edgeSrcIdOutputStream[threadId]);<NEW_LINE>bytesEdgeSrcOffset += <MASK><NEW_LINE>edgeSrcIdOffsetArr[threadId].push_back(bytesEdgeSrcOffset);<NEW_LINE>bytesEdgeDstOffset = (int) -edgeDstOutputStream[threadId].bytesWriten();<NEW_LINE>dstId.write(edgeDstOutputStream[threadId]);<NEW_LINE>bytesEdgeDstOffset += edgeDstOutputStream[threadId].bytesWriten();<NEW_LINE>edgeDstIdOffsetArr[threadId].push_back(bytesEdgeDstOffset);<NEW_LINE>bytesDataOffsets = (int) -edgeDataOutStream[threadId].bytesWriten();<NEW_LINE>value.write(edgeDataOutStream[threadId]);<NEW_LINE>bytesDataOffsets += edgeDataOutStream[threadId].bytesWriten();<NEW_LINE>edgeDataOffsetsArr[threadId].push_back(bytesDataOffsets);<NEW_LINE>// logger.debug("worker [{}] adding edge [{}]->[{}], value {}", workerId, srcId,<NEW_LINE>// dstId, value);<NEW_LINE>}
edgeSrcIdOutputStream[threadId].bytesWriten();
424,788
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static boolean canGetInstanceInfo(com.sun.jdi.VirtualMachine a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.VirtualMachine", "canGetInstanceInfo", "JDI CALL: com.sun.jdi.VirtualMachine({0}).canGetInstanceInfo()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>boolean ret;<NEW_LINE>ret = a.canGetInstanceInfo();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.<MASK><NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.VirtualMachine", "canGetInstanceInfo", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Mirror) a).virtualMachine();
1,569,485
public void onDismiss(@NonNull DialogInterface dialog) {<NEW_LINE>boolean checked = false;<NEW_LINE>int selected = 0;<NEW_LINE>for (int i = 0; i < preferences.size(); i++) {<NEW_LINE>boolean active = preferences.get(i).get();<NEW_LINE>checked |= active;<NEW_LINE>if (active) {<NEW_LINE>selected++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (adapter != null) {<NEW_LINE>adapter.getItem(position).setSelected(checked);<NEW_LINE>adapter.getItem(position).setColor(app, checked ? R.<MASK><NEW_LINE>adapter.getItem(position).setDescription(getString(R.string.ltr_or_rtl_combine_via_slash, String.valueOf(selected), String.valueOf(preferences.size())));<NEW_LINE>}<NEW_LINE>if (arrayAdapter != null) {<NEW_LINE>arrayAdapter.notifyDataSetInvalidated();<NEW_LINE>}<NEW_LINE>Activity activity = getActivity();<NEW_LINE>if (activity instanceof MapActivity) {<NEW_LINE>MapActivity mapActivity = (MapActivity) activity;<NEW_LINE>mapActivity.refreshMapComplete();<NEW_LINE>mapActivity.getMapLayers().updateLayers(mapActivity);<NEW_LINE>}<NEW_LINE>super.onDismiss(dialog);<NEW_LINE>}
color.osmand_orange : ContextMenuItem.INVALID_ID);
949,968
public static void main(String[] args) throws InterruptedException {<NEW_LINE>String discoveryURL = args[0];<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>EurekaServerConfig serverConfig = new DefaultEurekaServerConfig("eureka.");<NEW_LINE>JerseyReplicationClient client = JerseyReplicationClient.createReplicationClient(serverConfig, new DefaultServerCodecs(serverConfig), discoveryURL);<NEW_LINE>Applications applications = client.getApplications().getEntity();<NEW_LINE>System.out.println("Applications count=" + applications.getRegisteredApplications().size());<NEW_LINE>System.out.println("Instance count=" + countInstances(applications));<NEW_LINE>while (true) {<NEW_LINE>long delay = System.currentTimeMillis() - startTime;<NEW_LINE>if (delay >= 30000) {<NEW_LINE>System.out.println("Processing delay exceeds 30sec; we may be out of sync");<NEW_LINE>} else {<NEW_LINE>long waitTime = 30 * 1000 - delay;<NEW_LINE>System.out.println("Waiting " + waitTime / 1000 + "sec before next fetch...");<NEW_LINE>Thread.sleep(15 * 1000);<NEW_LINE>}<NEW_LINE>startTime = System.currentTimeMillis();<NEW_LINE>Applications delta = client.getDelta().getEntity();<NEW_LINE>Applications merged = <MASK><NEW_LINE>if (merged.getAppsHashCode().equals(delta.getAppsHashCode())) {<NEW_LINE>System.out.println("Hash codes match: " + delta.getAppsHashCode() + "(delta count=" + countInstances(delta) + ')');<NEW_LINE>applications = merged;<NEW_LINE>} else {<NEW_LINE>System.out.println("ERROR: hash codes do not match (" + delta.getAppsHashCode() + "(delta) != " + merged.getAppsHashCode() + " (merged) != " + applications.getAppsHashCode() + "(old apps)" + "(delta count=" + countInstances(delta) + ')');<NEW_LINE>applications = client.getApplications().getEntity();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
EurekaEntityFunctions.mergeApplications(applications, delta);
1,613,275
private RubyBigDecimal subSpecialCases(ThreadContext context, RubyBigDecimal val) {<NEW_LINE>if (isNaN() || val.isNaN()) {<NEW_LINE>return newNaN(context.runtime);<NEW_LINE>}<NEW_LINE>if (isZero()) {<NEW_LINE>if (val.isZero())<NEW_LINE>return newZero(context.runtime, zeroSign * val.zeroSign);<NEW_LINE>if (val.isInfinity())<NEW_LINE>return newInfinity(context.runtime, val.infinitySign * -1);<NEW_LINE>return new RubyBigDecimal(context.runtime, val.value.negate());<NEW_LINE>}<NEW_LINE>int sign = infinitySign * val.infinitySign;<NEW_LINE>if (sign > 0)<NEW_LINE>return newNaN(context.runtime);<NEW_LINE>if (sign < 0)<NEW_LINE>return <MASK><NEW_LINE>if (sign == 0) {<NEW_LINE>if (isInfinity()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (val.isInfinity()) {<NEW_LINE>return newInfinity(context.runtime, val.infinitySign * -1);<NEW_LINE>}<NEW_LINE>sign = infinitySign + val.infinitySign;<NEW_LINE>if (sign != 0) {<NEW_LINE>return newInfinity(context.runtime, sign);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
newInfinity(context.runtime, infinitySign);
1,654,063
protected void addCartData(Map<String, Object> attrMap) {<NEW_LINE>Order cart = CartState.getCart();<NEW_LINE>int cartQty = 0;<NEW_LINE>List<Long> cartItemIdsWithOptions = new ArrayList<>();<NEW_LINE>List<Long> <MASK><NEW_LINE>if (cart != null && cart.getOrderItems() != null) {<NEW_LINE>cartQty = cart.getItemCount();<NEW_LINE>for (OrderItem item : cart.getOrderItems()) {<NEW_LINE>if (item instanceof SkuAccessor) {<NEW_LINE>Sku sku = ((SkuAccessor) item).getSku();<NEW_LINE>if (sku != null && sku.getProduct() != null && item.getParentOrderItem() == null) {<NEW_LINE>Product product = sku.getProduct();<NEW_LINE>List<ProductOptionXref> optionXrefs = product.getProductOptionXrefs();<NEW_LINE>if (optionXrefs == null || optionXrefs.isEmpty()) {<NEW_LINE>cartItemIdsWithoutOptions.add(product.getId());<NEW_LINE>} else {<NEW_LINE>cartItemIdsWithOptions.add(product.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>attrMap.put("cartItemCount", cartQty);<NEW_LINE>attrMap.put("cartItemIdsWithOptions", cartItemIdsWithOptions);<NEW_LINE>attrMap.put("cartItemIdsWithoutOptions", cartItemIdsWithoutOptions);<NEW_LINE>}
cartItemIdsWithoutOptions = new ArrayList<>();
78,002
private void initComponents() {<NEW_LINE>getAccessibleContext().setAccessibleName(NbBundle.getMessage(Customizer.class, "ACS_Customizer"));<NEW_LINE>getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(Customizer.class, "ACS_Customizer"));<NEW_LINE>// set help ID according to selected tab<NEW_LINE>addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>String helpID = null;<NEW_LINE>switch(getSelectedIndex()) {<NEW_LINE>case // NOI18N<NEW_LINE>0:<NEW_LINE>// NOI18N<NEW_LINE>helpID = "jboss_customizer_platform";<NEW_LINE>break;<NEW_LINE>case // NOI18N<NEW_LINE>1:<NEW_LINE>// NOI18N<NEW_LINE>helpID = "jboss_customizer_classes";<NEW_LINE>break;<NEW_LINE>case // NOI18N<NEW_LINE>2:<NEW_LINE>// NOI18N<NEW_LINE>helpID = "jboss_customizer_sources";<NEW_LINE>break;<NEW_LINE>case // NOI18N<NEW_LINE>3:<NEW_LINE>// NOI18N<NEW_LINE>helpID = "jboss_customizer_javadoc";<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>putClientProperty("HelpID", helpID);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addTab(NbBundle.getMessage(Customizer.class, "TXT_Platform"), new CustomizerJVM(custData));<NEW_LINE>addTab(NbBundle.getMessage(Customizer.class, "TXT_Tab_Classes"), CustomizerSupport.createClassesCustomizer(custData.getClassModel()));<NEW_LINE>addTab(NbBundle.getMessage(Customizer.class, "TXT_Tab_Sources"), CustomizerSupport.createSourcesCustomizer(custData.getSourceModel(), null));<NEW_LINE>addTab(NbBundle.getMessage(Customizer.class, "TXT_Tab_Javadoc"), CustomizerSupport.createJavadocCustomizer(custData<MASK><NEW_LINE>}
.getJavadocsModel(), null));
1,767,724
public void index(Record record) {<NEW_LINE>if (db == null)<NEW_LINE>init();<NEW_LINE>// is there a previous version of this record? if so, remove it<NEW_LINE>String id = getId(record);<NEW_LINE>if (!overwrite && file != null) {<NEW_LINE>Record old = findRecordById(id);<NEW_LINE>if (old != null) {<NEW_LINE>for (KeyFunction keyfunc : functions) {<NEW_LINE>NavigableMap<String, Block> blocks = getBlocks(keyfunc);<NEW_LINE>String key = keyfunc.makeKey(old);<NEW_LINE>Block block = blocks.get(key);<NEW_LINE>block.remove(id);<NEW_LINE>// changed the object, so need to write again<NEW_LINE>blocks.put(key, block);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>indexById(record);<NEW_LINE>// index by key<NEW_LINE>for (KeyFunction keyfunc : functions) {<NEW_LINE>NavigableMap<String, Block> blocks = getBlocks(keyfunc);<NEW_LINE>String key = keyfunc.makeKey(record);<NEW_LINE>Block <MASK><NEW_LINE>if (block == null)<NEW_LINE>block = new Block();<NEW_LINE>block.add(id);<NEW_LINE>// changed the object, so need to write again<NEW_LINE>blocks.put(key, block);<NEW_LINE>}<NEW_LINE>}
block = blocks.get(key);
305,458
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {<NEW_LINE>long start = (long) request.getAttribute("_start");<NEW_LINE>String actionName = request.getRequestURI();<NEW_LINE>String <MASK><NEW_LINE>StringBuilder logString = new StringBuilder();<NEW_LINE>logString.append(clientIp).append("|").append(actionName).append("|");<NEW_LINE>Map<String, String[]> params = request.getParameterMap();<NEW_LINE>params.forEach((key, value) -> {<NEW_LINE>logString.append(key);<NEW_LINE>logString.append("=");<NEW_LINE>for (String paramString : value) {<NEW_LINE>logString.append(paramString);<NEW_LINE>}<NEW_LINE>logString.append("|");<NEW_LINE>});<NEW_LINE>long executionTime = System.currentTimeMillis() - start;<NEW_LINE>logString.append("excitation=").append(executionTime).append("ms");<NEW_LINE>log.info(logString.toString());<NEW_LINE>}
clientIp = IpUtil.getIpAddr(request);
528,130
public static EsShardPartitions findShardPartitions(String indexName, String searchShards) throws DorisEsException {<NEW_LINE>EsShardPartitions partitions = new EsShardPartitions(indexName);<NEW_LINE>JSONObject jsonObject = (<MASK><NEW_LINE>JSONArray shards = (JSONArray) jsonObject.get("shards");<NEW_LINE>int size = shards.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>List<EsShardRouting> singleShardRouting = Lists.newArrayList();<NEW_LINE>JSONArray shardsArray = (JSONArray) shards.get(i);<NEW_LINE>for (Object o : shardsArray) {<NEW_LINE>JSONObject indexShard = (JSONObject) o;<NEW_LINE>String shardState = (String) indexShard.get("state");<NEW_LINE>if ("STARTED".equalsIgnoreCase(shardState) || "RELOCATING".equalsIgnoreCase(shardState)) {<NEW_LINE>try {<NEW_LINE>singleShardRouting.add(new EsShardRouting((String) indexShard.get("index"), ((Long) indexShard.get("shard")).intValue(), (Boolean) indexShard.get("primary"), (String) indexShard.get("node")));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("fetch index [{}] shard partitions failure", indexName, e);<NEW_LINE>throw new DorisEsException("fetch [" + indexName + "] shard partitions failure [" + e.getMessage() + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (singleShardRouting.isEmpty()) {<NEW_LINE>LOG.warn("could not find a healthy allocation for [{}][{}]", indexName, i);<NEW_LINE>}<NEW_LINE>partitions.addShardRouting(i, singleShardRouting);<NEW_LINE>}<NEW_LINE>return partitions;<NEW_LINE>}
JSONObject) JSONValue.parse(searchShards);
582,429
public void handleInvalidTokenExceptions(final Class from, final Throwable e, final HttpServletRequest request, final HttpServletResponse response) {<NEW_LINE>if (Logger.isDebugEnabled(from)) {<NEW_LINE>Logger.debug(from, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (causedBy(e, SignatureException.class, IncorrectClaimException.class)) {<NEW_LINE>Logger.warn(from, () -> String.format("An invalid attempt to use a JWT [%s]", e.getMessage()));<NEW_LINE>} else {<NEW_LINE>// For another type of errors lets show it in the logs as an error<NEW_LINE>if (Logger.isErrorEnabled(from)) {<NEW_LINE>Logger.error(from, "An invalid attempt to use a JWT", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String securityLoggerMessage = null != request ? String.format("An invalid attempt to use an invalid " + "JWT has been made from IP [%s] [%s]", request.getRemoteAddr(), e.getMessage()) : String.format(<MASK><NEW_LINE>SecurityLogger.logInfo(from, () -> securityLoggerMessage);<NEW_LINE>if (null != request && null != response) {<NEW_LINE>try {<NEW_LINE>// Force a clean up of the invalid token cookie<NEW_LINE>APILocator.getLoginServiceAPI().doActionLogout(request, response);<NEW_LINE>} catch (Exception internalException) {<NEW_LINE>if (Logger.isDebugEnabled(from)) {<NEW_LINE>Logger.debug(from, "Unable to apply a logout action when invalid JWT was found.", internalException);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"An invalid attempt to use a JWT [%s]", e.getMessage());
457,681
private ApiResponse<Void> testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'requiredStringGroup' is set<NEW_LINE>if (requiredStringGroup == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredBooleanGroup' is set<NEW_LINE>if (requiredBooleanGroup == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredInt64Group' is set<NEW_LINE>if (requiredInt64Group == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group));<NEW_LINE>if (requiredBooleanGroup != null)<NEW_LINE>localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup));<NEW_LINE>if (booleanGroup != null)<NEW_LINE>localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup));<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "bearer_test" };<NEW_LINE>return apiClient.invokeAPI("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false);<NEW_LINE>}
throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");
725,871
public Iterable<Code> expand(ValueSetInfo valueSet) throws ResourceNotFoundException {<NEW_LINE>// This could possibly be refactored into a single call to the underlying HAPI Terminology service. Need to think through that..,<NEW_LINE>ValueSet vs;<NEW_LINE>if (valueSet.getId().startsWith("http://") || valueSet.getId().startsWith("https://")) {<NEW_LINE>if (valueSet.getVersion() != null || (valueSet.getCodeSystems() != null && valueSet.getCodeSystems().size() > 0)) {<NEW_LINE>if (!(valueSet.getCodeSystems().size() == 1 && valueSet.getCodeSystems().get(0).getVersion() == null)) {<NEW_LINE>throw new UnsupportedOperationException(Msg.code(1667) + String.format("Could not expand value set %s; version and code system bindings are not supported at this time.", valueSet.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IBundleProvider bundleProvider = myValueSetDao.search(SearchParameterMap.newSynchronous().add(ValueSet.SP_URL, new UriParam(valueSet.getId())));<NEW_LINE>List<IBaseResource> valueSets = bundleProvider.getAllResources();<NEW_LINE>if (valueSets.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException(Msg.code(1668) + String.format("Could not resolve value set %s.", valueSet.getId()));<NEW_LINE>} else if (valueSets.size() == 1) {<NEW_LINE>vs = (ValueSet) valueSets.get(0);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(Msg.code(1669) + "Found more than 1 ValueSet with url: " + valueSet.getId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>vs = myValueSetDao.read(new IdType(valueSet.getId()));<NEW_LINE>if (vs == null) {<NEW_LINE>throw new IllegalArgumentException(Msg.code(1670) + String.format("Could not resolve value set %s.", valueSet.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Attempt to expand the ValueSet if it's not already expanded.<NEW_LINE>if (!(vs.hasExpansion() && vs.getExpansion().hasContains())) {<NEW_LINE>vs = myTerminologySvc.expandValueSet(new ValueSetExpansionOptions().setCount(Integer.MAX_VALUE).setFailOnMissingCodeSystem(false), vs);<NEW_LINE>}<NEW_LINE>List<Code> codes = new ArrayList<>();<NEW_LINE>// If expansion was successful, use the codes.<NEW_LINE>if (vs.hasExpansion() && vs.getExpansion().hasContains()) {<NEW_LINE>for (ValueSetExpansionContainsComponent vsecc : vs.getExpansion().getContains()) {<NEW_LINE>codes.add(new Code().withCode(vsecc.getCode()).withSystem(vsecc.getSystem()));<NEW_LINE>}<NEW_LINE>} else // If not, best-effort based on codes. Should probably make this configurable to match the behavior of the<NEW_LINE>// underlying terminology service implementation<NEW_LINE>if (vs.hasCompose() && vs.getCompose().hasInclude()) {<NEW_LINE>for (ValueSet.ConceptSetComponent include : vs.getCompose().getInclude()) {<NEW_LINE>for (ValueSet.ConceptReferenceComponent concept : include.getConcept()) {<NEW_LINE>if (concept.hasCode()) {<NEW_LINE>codes.add(new Code().withCode(concept.getCode()).withSystem<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return codes;<NEW_LINE>}
(include.getSystem()));
535,200
private void resolveSpecialization(JMethod method) {<NEW_LINE>// TODO (cromwellian): Move to GwtAstBuilder eventually<NEW_LINE>if (method.getSpecialization() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Specialization specialization = method.getSpecialization();<NEW_LINE>if (specialization.getParams() == null) {<NEW_LINE>logger.log(Type.ERROR, "Missing 'params' attribute at @SpecializeMethod for method " + method.getQualifiedName());<NEW_LINE>errorsFound = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<JType> resolvedParams = translate(specialization.getParams());<NEW_LINE>JType resolvedReturn = translate(specialization.getReturns());<NEW_LINE>String targetMethodSignature = JjsUtils.computeSignature(specialization.getTarget(), resolvedParams, resolvedReturn, false);<NEW_LINE>JMethod targetMethod = JMethod.getExternalizedMethod(method.getEnclosingType().getName(), targetMethodSignature, false);<NEW_LINE>JMethod resolvedTargetMethod = translate(method.getSourceInfo(), targetMethod);<NEW_LINE>if (resolvedTargetMethod.isExternal()) {<NEW_LINE>error(method.getSourceInfo(), "Unable to locate @SpecializeMethod target " + targetMethodSignature + " for method " + method.getQualifiedName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>flowInto(resolvedTargetMethod);<NEW_LINE>specialization.<MASK><NEW_LINE>}
resolve(resolvedParams, resolvedReturn, resolvedTargetMethod);
127,477
protected void handleGet(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException {<NEW_LINE>try {<NEW_LINE>final Map<String, String> templateVariableToValue = new HashMap<>();<NEW_LINE>if (IMAGE_TYPE_NAME_OR_ID_URI_TEMPLATE.match(req.getRequestURI(), templateVariableToValue)) {<NEW_LINE>getImageTypeDTOByIdOrImageTypeName(resp, session, templateVariableToValue);<NEW_LINE>} else if (GET_IMAGE_TYPE_URI.equals(req.getRequestURI())) {<NEW_LINE>ImageTypeDTO imageTypeDTO;<NEW_LINE>if (req.getQueryString().contains(ImageMgmtConstants.IMAGE_TYPE)) {<NEW_LINE>final String imageTypeName = HttpRequestUtils.<MASK><NEW_LINE>if (!hasImageManagementPermission(imageTypeName, session.getUser(), Type.GET)) {<NEW_LINE>log.info(FORBIDDEN_USER_ERR_MSG);<NEW_LINE>throw new ImageMgmtInvalidPermissionException(ErrorCode.FORBIDDEN, FORBIDDEN_USER_ERR_MSG);<NEW_LINE>}<NEW_LINE>imageTypeDTO = this.imageTypeService.findImageTypeWithOwnershipsByName(imageTypeName);<NEW_LINE>sendResponse(resp, HttpServletResponse.SC_OK, imageTypeDTO);<NEW_LINE>}<NEW_LINE>getAllImageTypeDTOs(resp, session);<NEW_LINE>} else {<NEW_LINE>log.info(PATH_NOT_SUPPORTED);<NEW_LINE>throw new ImageMgmtInvalidInputException(ErrorCode.NOT_FOUND, PATH_NOT_SUPPORTED);<NEW_LINE>}<NEW_LINE>} catch (final ImageMgmtInvalidPermissionException e) {<NEW_LINE>log.error("The user provided does not have permissions to access the resource");<NEW_LINE>resp.setStatus(HttpStatus.SC_FORBIDDEN);<NEW_LINE>sendErrorResponse(resp, HttpServletResponse.SC_FORBIDDEN, "User does not have permissions. Error Message: " + e.getMessage());<NEW_LINE>} catch (final ImageMgmtException e) {<NEW_LINE>int status;<NEW_LINE>if (e.getErrorCode() != null) {<NEW_LINE>log.error("An error has occurred");<NEW_LINE>status = e.getErrorCode().getCode();<NEW_LINE>} else {<NEW_LINE>status = HttpStatus.SC_BAD_REQUEST;<NEW_LINE>}<NEW_LINE>sendErrorResponse(resp, status, "Exception on GET call to /imageTypes. Reason: " + e.getMessage());<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.error("Content is likely not present " + e);<NEW_LINE>resp.setStatus(HttpStatus.SC_NOT_FOUND);<NEW_LINE>sendErrorResponse(resp, HttpServletResponse.SC_NOT_FOUND, "Exception on GET call to /imageTypes. Reason: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
getParam(req, ImageMgmtConstants.IMAGE_TYPE);
708,454
protected void onSuccess() {<NEW_LINE>final long now = RRTime.utcCurrentTimeMillis();<NEW_LINE>switch(action) {<NEW_LINE>case RedditAPI.ACTION_DOWNVOTE:<NEW_LINE>mChangeDataManager.markDownvoted(now, src);<NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_UNVOTE:<NEW_LINE>mChangeDataManager.markUnvoted(now, src);<NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_UPVOTE:<NEW_LINE>mChangeDataManager.markUpvoted(now, src);<NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_SAVE:<NEW_LINE>mChangeDataManager.markSaved(now, src, true);<NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_UNSAVE:<NEW_LINE>mChangeDataManager.markSaved(now, src, false);<NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_HIDE:<NEW_LINE>mChangeDataManager.<MASK><NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_UNHIDE:<NEW_LINE>mChangeDataManager.markHidden(now, src, false);<NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_REPORT:<NEW_LINE>break;<NEW_LINE>case RedditAPI.ACTION_DELETE:<NEW_LINE>General.quickToast(activity, R.string.delete_success);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unknown post action");<NEW_LINE>}<NEW_LINE>}
markHidden(now, src, true);
100,018
public Request<CreatePlatformEndpointRequest> marshall(CreatePlatformEndpointRequest createPlatformEndpointRequest) {<NEW_LINE>if (createPlatformEndpointRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreatePlatformEndpointRequest> request = new DefaultRequest<CreatePlatformEndpointRequest>(createPlatformEndpointRequest, "AmazonSNS");<NEW_LINE>request.addParameter("Action", "CreatePlatformEndpoint");<NEW_LINE>request.addParameter("Version", "2010-03-31");<NEW_LINE><MASK><NEW_LINE>if (createPlatformEndpointRequest.getPlatformApplicationArn() != null) {<NEW_LINE>request.addParameter("PlatformApplicationArn", StringUtils.fromString(createPlatformEndpointRequest.getPlatformApplicationArn()));<NEW_LINE>}<NEW_LINE>if (createPlatformEndpointRequest.getToken() != null) {<NEW_LINE>request.addParameter("Token", StringUtils.fromString(createPlatformEndpointRequest.getToken()));<NEW_LINE>}<NEW_LINE>if (createPlatformEndpointRequest.getCustomUserData() != null) {<NEW_LINE>request.addParameter("CustomUserData", StringUtils.fromString(createPlatformEndpointRequest.getCustomUserData()));<NEW_LINE>}<NEW_LINE>java.util.Map<String, String> attributes = createPlatformEndpointRequest.getAttributes();<NEW_LINE>int attributesListIndex = 1;<NEW_LINE>for (Map.Entry<String, String> entry : attributes.entrySet()) {<NEW_LINE>if (entry != null && entry.getKey() != null) {<NEW_LINE>request.addParameter("Attributes.entry." + attributesListIndex + ".key", StringUtils.fromString(entry.getKey()));<NEW_LINE>}<NEW_LINE>if (entry != null && entry.getValue() != null) {<NEW_LINE>request.addParameter("Attributes.entry." + attributesListIndex + ".value", StringUtils.fromString(entry.getValue()));<NEW_LINE>}<NEW_LINE>attributesListIndex++;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
910,160
public static void refreshProjects(@Nonnull final ImportSpecBuilder specBuilder) {<NEW_LINE>ImportSpec spec = specBuilder.build();<NEW_LINE>ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(spec.getExternalSystemId());<NEW_LINE>if (manager == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AbstractExternalSystemSettings<?, ?, ?> settings = manager.getSettingsProvider().fun(spec.getProject());<NEW_LINE>final Collection<? extends ExternalProjectSettings> projectsSettings = settings.getLinkedProjectsSettings();<NEW_LINE>if (projectsSettings.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ProjectDataManager projectDataManager = ServiceManager.getService(ProjectDataManager.class);<NEW_LINE>final int[<MASK><NEW_LINE>ExternalProjectRefreshCallback callback = new MyMultiExternalProjectRefreshCallback(spec.getProject(), projectDataManager, counter, spec.getExternalSystemId());<NEW_LINE>Map<String, Long> modificationStamps = manager.getLocalSettingsProvider().fun(spec.getProject()).getExternalConfigModificationStamps();<NEW_LINE>Set<String> toRefresh = ContainerUtilRt.newHashSet();<NEW_LINE>for (ExternalProjectSettings setting : projectsSettings) {<NEW_LINE>// don't refresh project when auto-import is disabled if such behavior needed (e.g. on project opening when auto-import is disabled)<NEW_LINE>if (!setting.isUseAutoImport() && spec.isWhenAutoImportEnabled())<NEW_LINE>continue;<NEW_LINE>if (spec.isForceWhenUptodate()) {<NEW_LINE>toRefresh.add(setting.getExternalProjectPath());<NEW_LINE>} else {<NEW_LINE>Long oldModificationStamp = modificationStamps.get(setting.getExternalProjectPath());<NEW_LINE>long currentModificationStamp = getTimeStamp(setting, spec.getExternalSystemId());<NEW_LINE>if (oldModificationStamp == null || oldModificationStamp < currentModificationStamp) {<NEW_LINE>toRefresh.add(setting.getExternalProjectPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!toRefresh.isEmpty()) {<NEW_LINE>ExternalSystemNotificationManager.getInstance(spec.getProject()).clearNotifications(null, NotificationSource.PROJECT_SYNC, spec.getExternalSystemId());<NEW_LINE>counter[0] = toRefresh.size();<NEW_LINE>for (String path : toRefresh) {<NEW_LINE>refreshProject(spec.getProject(), spec.getExternalSystemId(), path, callback, false, spec.getProgressExecutionMode());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] counter = new int[1];
1,313,324
public static String escapeIllegalXmlChars(@Nonnull String text) {<NEW_LINE>StringBuilder b = null;<NEW_LINE>int lastPos = 0;<NEW_LINE>for (int i = 0; i < text.length(); i++) {<NEW_LINE>int c = text.codePointAt(i);<NEW_LINE>if (Character.isSupplementaryCodePoint(c)) {<NEW_LINE>// noinspection AssignmentToForLoopParameter<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>if (c == '#' || !Verifier.isXMLCharacter(c)) {<NEW_LINE>// assuming there's one 'large' char (e.g. 0xFFFF) to escape numerically<NEW_LINE>if (b == null)<NEW_LINE>b = new StringBuilder(text.length() + 5);<NEW_LINE>b.append(text, lastPos<MASK><NEW_LINE>if (c != '#')<NEW_LINE>b.append(Integer.toHexString(c));<NEW_LINE>b.append('#');<NEW_LINE>lastPos = i + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return b == null ? text : b.append(text, lastPos, text.length()).toString();<NEW_LINE>}
, i).append('#');
1,389,615
final GenerateEmbedUrlForRegisteredUserResult executeGenerateEmbedUrlForRegisteredUser(GenerateEmbedUrlForRegisteredUserRequest generateEmbedUrlForRegisteredUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(generateEmbedUrlForRegisteredUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GenerateEmbedUrlForRegisteredUserRequest> request = null;<NEW_LINE>Response<GenerateEmbedUrlForRegisteredUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GenerateEmbedUrlForRegisteredUserRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GenerateEmbedUrlForRegisteredUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GenerateEmbedUrlForRegisteredUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GenerateEmbedUrlForRegisteredUserResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(generateEmbedUrlForRegisteredUserRequest));
28,293
private void registerVertxAndPool(String persistenceUnitName, RuntimeSettings runtimeSettings, PreconfiguredReactiveServiceRegistryBuilder serviceRegistry) {<NEW_LINE>if (runtimeSettings.isConfigured(AvailableSettings.URL)) {<NEW_LINE>// the pool has been defined in the persistence unit, we can bail out<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// for now we only support one pool but this will change<NEW_LINE>InstanceHandle<Pool> poolHandle = Arc.container().instance(Pool.class);<NEW_LINE>if (!poolHandle.isAvailable()) {<NEW_LINE>throw new IllegalStateException("No pool has been defined for persistence unit " + persistenceUnitName);<NEW_LINE>}<NEW_LINE>serviceRegistry.addInitiator(new QuarkusReactiveConnectionPoolInitiator(poolHandle.get()));<NEW_LINE>InstanceHandle<Vertx> vertxHandle = Arc.container().instance(Vertx.class);<NEW_LINE>if (!vertxHandle.isAvailable()) {<NEW_LINE>throw new IllegalStateException("No Vert.x instance has been registered in ArC ?");<NEW_LINE>}<NEW_LINE>serviceRegistry.addInitiator(new VertxInstanceInitiator<MASK><NEW_LINE>}
(vertxHandle.get()));
1,201,373
private void loadNode472() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read<MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Length</Name><DataType><Identifier>i=6</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), false));
1,248,658
private IWeEventFileClient buildIWeEventFileClient(Integer brokerId, String groupId, String nodeAddress) {<NEW_LINE>String clientKey = brokerId + IDENTIFIER + groupId + IDENTIFIER + nodeAddress;<NEW_LINE>if (!this.fileClientMap.containsKey(clientKey)) {<NEW_LINE>FiscoConfig fiscoConfig = new FiscoConfig();<NEW_LINE>fiscoConfig.load("");<NEW_LINE>List<String> nodeList = Arrays.asList(nodeAddress.split(","));<NEW_LINE>fiscoConfig.setFiscoNodes(nodeList);<NEW_LINE>String downloadPath = this.downloadPath + File.separator + nodeAddress2Path(nodeAddress);<NEW_LINE>IWeEventFileClient fileClient = IWeEventFileClient.build(groupId, <MASK><NEW_LINE>this.fileClientMap.put(clientKey, fileClient);<NEW_LINE>}<NEW_LINE>return this.fileClientMap.get(clientKey);<NEW_LINE>}
downloadPath, ConstantProperties.FILE_CHUNK_SIZE, fiscoConfig);
356,854
public static void convolve3(Kernel2D_S32 kernel, GrayU8 input, GrayI16 output, int skip) {<NEW_LINE>final byte[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int widthEnd = UtilDownConvolve.computeMaxSide(input.width, skip, radius);<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offset = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offset; y <= heightEnd; y += skip) {<NEW_LINE>// first time through the value needs to be set<NEW_LINE>int k1 = kernel.data[0];<NEW_LINE>int k2 = kernel.data[1];<NEW_LINE>int k3 = kernel.data[2];<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride + offset / skip;<NEW_LINE>int indexSrcRow = input.startIndex + (y - radius) * input.stride - radius;<NEW_LINE>for (int x = offset; x <= widthEnd; x += skip) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k1;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k2;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>// rest of the convolution rows are an addition<NEW_LINE>for (int i = 1; i < 3; i++) {<NEW_LINE>indexDst = output.startIndex + (y / skip) * output.stride + offset / skip;<NEW_LINE>indexSrcRow = input.startIndex + (y + i - <MASK><NEW_LINE>k1 = kernel.data[i * 3 + 0];<NEW_LINE>k2 = kernel.data[i * 3 + 1];<NEW_LINE>k3 = kernel.data[i * 3 + 2];<NEW_LINE>for (int x = offset; x <= widthEnd; x += skip) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k1;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k2;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>dataDst[indexDst++] += (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
radius) * input.stride - radius;
1,132,191
public Void doCall(final EntitlementApi entitlementApi, final DefaultEntitlementContext updatedPluginContext) throws EntitlementApiException {<NEW_LINE>if (eventsStream.isSubscriptionCancelled()) {<NEW_LINE>throw new EntitlementApiException(ErrorCode.SUB_UNCANCEL_BAD_STATE, getId());<NEW_LINE>}<NEW_LINE>final InternalCallContext contextWithValidAccountRecordId = internalCallContextFactory.createInternalCallContext(getAccountId(), callContext);<NEW_LINE>final Collection<BlockingState> pendingEntitlementCancellationEvents = eventsStream.getPendingEntitlementCancellationEvents();<NEW_LINE>if (eventsStream.isEntitlementCancelled()) {<NEW_LINE>final BlockingState cancellationEvent = eventsStream.getEntitlementCancellationEvent();<NEW_LINE>blockingStateDao.unactiveBlockingState(cancellationEvent.getId(), contextWithValidAccountRecordId);<NEW_LINE>} else if (pendingEntitlementCancellationEvents.size() > 0) {<NEW_LINE>// Reactivate entitlements<NEW_LINE>// See also https://github.com/killbill/killbill/issues/111<NEW_LINE>//<NEW_LINE>// Today we only support cancellation at SUBSCRIPTION level (Not ACCOUNT or BUNDLE), so we should really have only<NEW_LINE>// one future event in the list<NEW_LINE>//<NEW_LINE>for (final BlockingState futureCancellation : pendingEntitlementCancellationEvents) {<NEW_LINE>blockingStateDao.unactiveBlockingState(futureCancellation.getId(), contextWithValidAccountRecordId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Entitlement is NOT cancelled (or future cancelled), there is nothing to do<NEW_LINE>throw new EntitlementApiException(ErrorCode.ENT_UNCANCEL_BAD_STATE, getId());<NEW_LINE>}<NEW_LINE>// If billing was previously cancelled, reactivate<NEW_LINE>if (getSubscriptionBase().getFutureEndDate() != null) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (final SubscriptionBaseApiException e) {<NEW_LINE>throw new EntitlementApiException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getSubscriptionBase().uncancel(callContext);
992,995
public boolean prepareFile(Rule rule, Environment env) throws RepositoryFunctionException, InterruptedException {<NEW_LINE>WorkspaceAttributeMapper mapper = WorkspaceAttributeMapper.of(rule);<NEW_LINE>boolean hasFile = mapper.isAttributeValueExplicitlySpecified(getFileAttrName());<NEW_LINE>boolean hasFileContent = mapper.isAttributeValueExplicitlySpecified(getFileContentAttrName());<NEW_LINE>if (hasFile && hasFileContent) {<NEW_LINE>throw new RepositoryFunctionException(Starlark.errorf("Rule cannot have both a '%s' and '%s' attribute", getFileAttrName(), getFileContentAttrName()), Transience.PERSISTENT);<NEW_LINE>} else if (hasFile) {<NEW_LINE>fileValue = getFileValue(rule, env);<NEW_LINE>if (env.valuesMissing()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (hasFileContent) {<NEW_LINE>try {<NEW_LINE>fileContent = mapper.get(getFileContentAttrName(), Type.STRING);<NEW_LINE>} catch (EvalException e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fileContent = getDefaultContent(rule);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
RepositoryFunctionException(e, Transience.PERSISTENT);
265,754
protected void runAlgo() {<NEW_LINE>EdgeExplorer explorer = outEdgeExplorer;<NEW_LINE>while (true) {<NEW_LINE>visitedNodes++;<NEW_LINE>if (isMaxVisitedNodesExceeded() || finished())<NEW_LINE>break;<NEW_LINE>int baseNode = currEdge.adjNode;<NEW_LINE>EdgeIterator iter = explorer.setBaseNode(baseNode);<NEW_LINE>while (iter.next()) {<NEW_LINE>if (!accept(iter, currEdge.edge))<NEW_LINE>continue;<NEW_LINE>int traversalId = traversalMode.createTraversalId(iter, false);<NEW_LINE>// Modification by Maxim Rylov: use originalEdge as the previousEdgeId<NEW_LINE>double tmpWeight = weighting.calcWeight(iter, reverseDirection, currEdge.originalEdge) + currEdge.weight;<NEW_LINE>// ORS-GH MOD END<NEW_LINE>if (Double.isInfinite(tmpWeight))<NEW_LINE>continue;<NEW_LINE>SPTEntry nEdge = fromMap.get(traversalId);<NEW_LINE>if (nEdge == null) {<NEW_LINE><MASK><NEW_LINE>} else if (nEdge.weight > tmpWeight) {<NEW_LINE>updateEntry(nEdge, iter, tmpWeight);<NEW_LINE>}<NEW_LINE>}
createEntry(iter, traversalId, tmpWeight);
892,111
private void raiseVetoableEvent(Object value, int index, int op) {<NEW_LINE>Object curValue = null;<NEW_LINE>Object newValue = null;<NEW_LINE>// Get the current and new value<NEW_LINE>if (Common.isArray(this.type)) {<NEW_LINE>Object[] arrValue;<NEW_LINE>curValue = this.getValues();<NEW_LINE>switch(op) {<NEW_LINE>case OP_SETTER_SETARRAY:<NEW_LINE>// The new value is the new array<NEW_LINE>newValue = value;<NEW_LINE>break;<NEW_LINE>case OP_SETTER_SETELT:<NEW_LINE>// One element only will change<NEW_LINE>arrValue = this.getObjectArray(0);<NEW_LINE>arrValue[index] = value;<NEW_LINE>newValue = arrValue;<NEW_LINE>break;<NEW_LINE>case OP_SETTER_ADD:<NEW_LINE>// Add the new element at the end of the array<NEW_LINE>arrValue = this.getObjectArray(1);<NEW_LINE>arrValue[this.bindingsSize()] = value;<NEW_LINE>newValue = arrValue;<NEW_LINE>break;<NEW_LINE>case OP_SETTER_REMOVE:<NEW_LINE>// One element removed<NEW_LINE>// This call only allocate the array (no values)<NEW_LINE>int i, j;<NEW_LINE>Object[] curValues = (Object[]) curValue;<NEW_LINE>arrValue = this.getObjectArray(-1);<NEW_LINE>for (i = 0; i < curValues.length; i++) {<NEW_LINE>if (curValues[i].equals(value))<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (i < curValues.length) {<NEW_LINE>// We found it<NEW_LINE>for (i = 0, j = 0; i < curValues.length; i++) if (!curValues[i].equals(value))<NEW_LINE>arrValue[<MASK><NEW_LINE>} else {<NEW_LINE>arrValue = curValues;<NEW_LINE>}<NEW_LINE>newValue = arrValue;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>curValue = this.getValue(0);<NEW_LINE>newValue = value;<NEW_LINE>}<NEW_LINE>// Create the event and wait for an exception<NEW_LINE>PropertyChangeEvent e = this.createEvent(this.bean.binding, curValue, newValue, null);<NEW_LINE>if (DDLogFlags.debug) {<NEW_LINE>TraceLogger.put(TraceLogger.DEBUG, TraceLogger.SVC_DD, DDLogFlags.DBG_EVT, 1, DDLogFlags.VETOABLE, (e == null ? "no-event" : e.getPropertyName()) + " - source " + this.beanName + "\n\t\toldValue is " + (curValue == null ? "<null>" : "<" + curValue.toString() + ">") + "\n\t\tnewValue is " + (newValue == null ? "<null>" : "<" + newValue.toString() + ">"));<NEW_LINE>}<NEW_LINE>// Propagate this vetoable event up to the root<NEW_LINE>this.notifyInternal(new InternalEvent(InternalEvent.VETOABLE, e), true);<NEW_LINE>}
j++] = curValues[i];
1,271,421
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public @buseventtype create objectarray schema MyEvent(c0 int)", path);<NEW_LINE>env.compileDeploy("@public create table windowAndTotal (" + "thewindow window(*) @type(MyEvent), thetotal sum(int))", path);<NEW_LINE>env.compileDeploy("into table windowAndTotal " + "select window(*) as thewindow, sum(c0) as thetotal from MyEvent#length(2)", path);<NEW_LINE>env.compileDeploy("@Name('s0') select windowAndTotal as val0 from SupportBean_S0", path).addListener("s0");<NEW_LINE>Object[] e1 = new Object[] { 10 };<NEW_LINE>env.sendEventObjectArray(e1, "MyEvent");<NEW_LINE>env.milestone(0);<NEW_LINE>String[] <MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEventNew("s0", event -> EPAssertionUtil.assertPropsMap((Map) event.get("val0"), fieldsInner, new Object[][] { e1 }, 10));<NEW_LINE>env.milestone(1);<NEW_LINE>Object[] e2 = new Object[] { 20 };<NEW_LINE>env.sendEventObjectArray(e2, "MyEvent");<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1));<NEW_LINE>env.assertEventNew("s0", event -> EPAssertionUtil.assertPropsMap((Map) event.get("val0"), fieldsInner, new Object[][] { e1, e2 }, 30));<NEW_LINE>env.milestone(3);<NEW_LINE>Object[] e3 = new Object[] { 30 };<NEW_LINE>env.sendEventObjectArray(e3, "MyEvent");<NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean(new SupportBean_S0(2));<NEW_LINE>env.assertEventNew("s0", event -> EPAssertionUtil.assertPropsMap((Map) event.get("val0"), fieldsInner, new Object[][] { e2, e3 }, 50));<NEW_LINE>env.undeployAll();<NEW_LINE>}
fieldsInner = "thewindow,thetotal".split(",");
149,284
public static void main(String[] args) throws Exception {<NEW_LINE>Scanner sc = new Scanner(new File("articulation_in.txt"));<NEW_LINE>int V = sc.nextInt();<NEW_LINE>AL = new ArrayList<>();<NEW_LINE>for (int u = 0; u < V; ++u) {<NEW_LINE>// store blank vector first<NEW_LINE>AL.add(new ArrayList<>());<NEW_LINE>int k = sc.nextInt();<NEW_LINE>while (k-- > 0) {<NEW_LINE>int v = sc.nextInt(), w = sc.nextInt();<NEW_LINE>AL.get(u).add(new IntegerPair(v, w));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.printf("Articulation Points & Bridges (the input graph must be UNDIRECTED)\n");<NEW_LINE>// global variable<NEW_LINE>dfs_num = new ArrayList<>(Collections.nCopies(V, UNVISITED));<NEW_LINE>dfs_low = new ArrayList<>(Collections.nCopies(V, 0));<NEW_LINE>dfs_parent = new ArrayList<>(Collections.nCopies(V, -1));<NEW_LINE>articulation_vertex = new ArrayList<>(Collections<MASK><NEW_LINE>dfsNumberCounter = 0;<NEW_LINE>System.out.printf("Bridges:\n");<NEW_LINE>for (int u = 0; u < V; ++u) if (dfs_num.get(u) == UNVISITED) {<NEW_LINE>dfsRoot = u;<NEW_LINE>rootChildren = 0;<NEW_LINE>articulationPointAndBridge(u);<NEW_LINE>// special case<NEW_LINE>articulation_vertex.set(dfsRoot, (rootChildren > 1) ? 1 : 0);<NEW_LINE>}<NEW_LINE>System.out.printf("Articulation Points:\n");<NEW_LINE>for (int u = 0; u < V; ++u) if (articulation_vertex.get(u) == 1)<NEW_LINE>System.out.printf(" Vertex %d\n", u);<NEW_LINE>}
.nCopies(V, 0));
233,330
PagedFlux<FileSystemItem> listFileSystemsWithOptionalTimeout(ListFileSystemsOptions options, Duration timeout) {<NEW_LINE>PagedFlux<BlobContainerItem> inputPagedFlux = blobServiceAsyncClient.listBlobContainers(Transforms.toListBlobContainersOptions(options));<NEW_LINE>return PagedFlux.create(() -> (continuationToken, pageSize) -> {<NEW_LINE>Flux<PagedResponse<BlobContainerItem>> flux;<NEW_LINE>if (continuationToken != null && pageSize != null) {<NEW_LINE>flux = inputPagedFlux.byPage(continuationToken, pageSize);<NEW_LINE>} else if (continuationToken != null) {<NEW_LINE>flux = inputPagedFlux.byPage(continuationToken);<NEW_LINE>} else if (pageSize != null) {<NEW_LINE>flux = inputPagedFlux.byPage(pageSize);<NEW_LINE>} else {<NEW_LINE>flux = inputPagedFlux.byPage();<NEW_LINE>}<NEW_LINE>flux = flux.onErrorMap(DataLakeImplUtils::transformBlobStorageException);<NEW_LINE>if (timeout != null) {<NEW_LINE>flux = flux.timeout(timeout);<NEW_LINE>}<NEW_LINE>return flux.map(blobsPagedResponse -> new PagedResponseBase<Void, FileSystemItem>(blobsPagedResponse.getRequest(), blobsPagedResponse.getStatusCode(), blobsPagedResponse.getHeaders(), blobsPagedResponse.getValue().stream().map(Transforms::toFileSystemItem).collect(Collectors.toList()), blobsPagedResponse<MASK><NEW_LINE>});<NEW_LINE>}
.getContinuationToken(), null));
493,317
private ListenableFuture<Void> processAttributesUpdate(TenantId tenantId, CustomerId customerId, EntityId entityId, TransportProtos.PostAttributeMsg msg, TbMsgMetaData metaData) {<NEW_LINE>SettableFuture<Void> futureToSet = SettableFuture.create();<NEW_LINE>JsonObject json = JsonUtils.getJsonObject(msg.getKvList());<NEW_LINE>Set<AttributeKvEntry> attributes = JsonConverter.convertToAttributes(json);<NEW_LINE>ListenableFuture<List<Void>> future = attributesService.save(tenantId, entityId, metaData.getValue("scope"), new ArrayList<>(attributes));<NEW_LINE>Futures.addCallback(future, new FutureCallback<List<Void>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(@Nullable List<Void> voids) {<NEW_LINE>Pair<String, RuleChainId> defaultQueueAndRuleChain = getDefaultQueueNameAndRuleChainId(tenantId, entityId);<NEW_LINE><MASK><NEW_LINE>RuleChainId ruleChainId = defaultQueueAndRuleChain.getValue();<NEW_LINE>TbMsg tbMsg = TbMsg.newMsg(queueName, DataConstants.ATTRIBUTES_UPDATED, entityId, customerId, metaData, gson.toJson(json), ruleChainId, null);<NEW_LINE>tbClusterService.pushMsgToRuleEngine(tenantId, tbMsg.getOriginator(), tbMsg, new TbQueueCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(TbQueueMsgMetadata metadata) {<NEW_LINE>futureToSet.set(null);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable t) {<NEW_LINE>log.error("Can't process attributes update [{}]", msg, t);<NEW_LINE>futureToSet.setException(t);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable t) {<NEW_LINE>log.error("Can't process attributes update [{}]", msg, t);<NEW_LINE>futureToSet.setException(t);<NEW_LINE>}<NEW_LINE>}, dbCallbackExecutorService);<NEW_LINE>return futureToSet;<NEW_LINE>}
String queueName = defaultQueueAndRuleChain.getKey();
1,404,555
S3ClientSettings refine(RepositoryMetaData metadata) {<NEW_LINE>final Settings repoSettings = metadata.settings();<NEW_LINE>// Normalize settings to placeholder client settings prefix so that we can use the affix settings directly<NEW_LINE>final Settings normalizedSettings = Settings.builder().put(repoSettings).normalizePrefix(PREFIX + PLACEHOLDER_CLIENT + '.').build();<NEW_LINE>final String newEndpoint = getRepoSettingOrDefault(ENDPOINT_SETTING, normalizedSettings, endpoint);<NEW_LINE>final Protocol newProtocol = getRepoSettingOrDefault(PROTOCOL_SETTING, normalizedSettings, protocol);<NEW_LINE>final String newProxyHost = getRepoSettingOrDefault(PROXY_HOST_SETTING, normalizedSettings, proxyHost);<NEW_LINE>final int newProxyPort = getRepoSettingOrDefault(PROXY_PORT_SETTING, normalizedSettings, proxyPort);<NEW_LINE>final int newReadTimeoutMillis = Math.toIntExact(getRepoSettingOrDefault(READ_TIMEOUT_SETTING, normalizedSettings, TimeValue.timeValueMillis(readTimeoutMillis)).millis());<NEW_LINE>final int newMaxRetries = <MASK><NEW_LINE>final boolean newThrottleRetries = getRepoSettingOrDefault(USE_THROTTLE_RETRIES_SETTING, normalizedSettings, throttleRetries);<NEW_LINE>final S3BasicCredentials newCredentials;<NEW_LINE>if (checkDeprecatedCredentials(repoSettings)) {<NEW_LINE>newCredentials = loadDeprecatedCredentials(repoSettings);<NEW_LINE>} else {<NEW_LINE>newCredentials = credentials;<NEW_LINE>}<NEW_LINE>if (Objects.equals(endpoint, newEndpoint) && protocol == newProtocol && Objects.equals(proxyHost, newProxyHost) && proxyPort == newProxyPort && newReadTimeoutMillis == readTimeoutMillis && maxRetries == newMaxRetries && newThrottleRetries == throttleRetries && Objects.equals(credentials, newCredentials)) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>return new S3ClientSettings(newCredentials, newEndpoint, newProtocol, newProxyHost, newProxyPort, proxyUsername, proxyPassword, newReadTimeoutMillis, newMaxRetries, newThrottleRetries);<NEW_LINE>}
getRepoSettingOrDefault(MAX_RETRIES_SETTING, normalizedSettings, maxRetries);
1,807,288
public void createNewSibling() {<NEW_LINE>OWLClass cls = getTree().getSelectedOWLObject();<NEW_LINE>if (cls == null) {<NEW_LINE>// Shouldn't really get here, because the<NEW_LINE>// action should be disabled<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We need to apply the changes in the active ontology<NEW_LINE>OWLEntityCreationSet<OWLClass> creationSet = getOWLWorkspace().createOWLClass();<NEW_LINE>if (creationSet != null) {<NEW_LINE>OWLObjectTreeNode<OWLClass> parentNode = (OWLObjectTreeNode<OWLClass>) getTree().getSelectionPath().getParentPath().getLastPathComponent();<NEW_LINE>if (parentNode == null || parentNode.getOWLObject() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OWLClass parentCls = parentNode.getOWLObject();<NEW_LINE>// Combine the changes that are required to create the OWLClass, with the<NEW_LINE>// changes that are required to make it a sibling class.<NEW_LINE>List<OWLOntologyChange> changes = new ArrayList<>();<NEW_LINE>changes.addAll(creationSet.getOntologyChanges());<NEW_LINE>OWLModelManager mngr = getOWLModelManager();<NEW_LINE>OWLDataFactory df = mngr.getOWLDataFactory();<NEW_LINE>if (!df.getOWLThing().equals(parentCls)) {<NEW_LINE>changes.add(new AddAxiom(mngr.getActiveOntology(), df.getOWLSubClassOfAxiom(creationSet.getOWLEntity(), parentCls)));<NEW_LINE>}<NEW_LINE>mngr.applyChanges(changes);<NEW_LINE>// Select the new class<NEW_LINE>getTree().<MASK><NEW_LINE>}<NEW_LINE>}
setSelectedOWLObject(creationSet.getOWLEntity());
1,420,935
public void init(BeanManager beanManager, Config config) {<NEW_LINE>super.init(beanManager, config);<NEW_LINE>if (getType().isInvokeAtAssembly()) {<NEW_LINE>processor = new ProxyProcessor(this);<NEW_LINE>} else {<NEW_LINE>switch(getType()) {<NEW_LINE>case PROCESSOR_PUBLISHER_MSG_2_MSG:<NEW_LINE>processor = invokeProcessor(msg -> ReactiveStreams.fromPublisher(invoke(msg)));<NEW_LINE>break;<NEW_LINE>case PROCESSOR_PUBLISHER_PAYL_2_PAYL:<NEW_LINE>processor = invokeProcessor(msg -> ReactiveStreams.fromPublisher(invoke(msg.getPayload())));<NEW_LINE>break;<NEW_LINE>case PROCESSOR_PUBLISHER_BUILDER_MSG_2_MSG:<NEW_LINE>processor = invokeProcessor(this::invoke);<NEW_LINE>break;<NEW_LINE>case PROCESSOR_PUBLISHER_BUILDER_PAYL_2_PAYL:<NEW_LINE>processor = invokeProcessor(msg -> invoke(msg.getPayload()));<NEW_LINE>break;<NEW_LINE>case PROCESSOR_MSG_2_MSG:<NEW_LINE>processor = invokeProcessor(msg -> ReactiveStreams.fromCompletionStageNullable(CompletableFuture.completedStage(invoke(msg))));<NEW_LINE>break;<NEW_LINE>case PROCESSOR_PAYL_2_PAYL:<NEW_LINE>processor = invokeProcessor(msg -> ReactiveStreams.of((Object) invoke(msg.getPayload())));<NEW_LINE>break;<NEW_LINE>case PROCESSOR_COMPL_STAGE_MSG_2_MSG:<NEW_LINE>processor = invokeProcessor(msg -> ReactiveStreams.fromCompletionStageNullable(invoke(msg)));<NEW_LINE>break;<NEW_LINE>case PROCESSOR_COMPL_STAGE_PAYL_2_PAYL:<NEW_LINE>processor = invokeProcessor(msg -> ReactiveStreams.fromCompletionStage(invoke(<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new MessagingDeploymentException("Invalid messaging method signature " + getMethod());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
msg.getPayload())));
1,360,679
protected List<double[]> means(List<? extends ModifiableDBIDs> clusters, List<double[]> means, Relation<DiscreteUncertainObject> database) {<NEW_LINE>List<double[]> newMeans = new ArrayList<>(k);<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>ModifiableDBIDs list = clusters.get(i);<NEW_LINE>double[] mean = null;<NEW_LINE>if (list.size() > 0) {<NEW_LINE><MASK><NEW_LINE>// Initialize with first.<NEW_LINE>mean = ArrayLikeUtil.toPrimitiveDoubleArray(database.get(iter).getCenterOfMass());<NEW_LINE>iter.advance();<NEW_LINE>// Update with remaining instances<NEW_LINE>for (; iter.valid(); iter.advance()) {<NEW_LINE>NumberVector vec = database.get(iter).getCenterOfMass();<NEW_LINE>for (int j = 0; j < mean.length; j++) {<NEW_LINE>mean[j] += vec.doubleValue(j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>timesEquals(mean, 1.0 / list.size());<NEW_LINE>} else {<NEW_LINE>// Keep degenerated means as-is for now.<NEW_LINE>mean = means.get(i);<NEW_LINE>}<NEW_LINE>newMeans.add(mean);<NEW_LINE>}<NEW_LINE>return newMeans;<NEW_LINE>}
DBIDIter iter = list.iter();
1,185,193
Future<ReconciliationState> kafkaIngresses() {<NEW_LINE>if (!pfa.hasIngressV1()) {<NEW_LINE>return Future.succeededFuture(this);<NEW_LINE>}<NEW_LINE>List<Ingress> ingresses = new ArrayList<>(kafkaCluster.generateExternalBootstrapIngresses());<NEW_LINE>int replicas = kafkaCluster.getReplicas();<NEW_LINE>for (int i = 0; i < replicas; i++) {<NEW_LINE>ingresses.addAll(kafkaCluster.generateExternalIngresses(i));<NEW_LINE>}<NEW_LINE>Future fut = ingressOperations.listAsync(namespace, kafkaCluster.getSelectorLabels()).compose(existingIngresses -> {<NEW_LINE>List<Future> ingressFutures = new ArrayList<>(ingresses.size());<NEW_LINE>List<String> existingIngressNames = existingIngresses.stream().map(ingress -> ingress.getMetadata().getName()).collect(Collectors.toList());<NEW_LINE>LOGGER.debugCr(reconciliation, "Reconciling existing Ingresses {} against the desired ingresses", existingIngressNames);<NEW_LINE>// Update desired ingresses<NEW_LINE>for (Ingress ingress : ingresses) {<NEW_LINE>String ingressName = ingress.getMetadata().getName();<NEW_LINE>existingIngressNames.remove(ingressName);<NEW_LINE>ingressFutures.add(ingressOperations.reconcile(reconciliation<MASK><NEW_LINE>}<NEW_LINE>LOGGER.debugCr(reconciliation, "Ingresses {} should be deleted", existingIngressNames);<NEW_LINE>// Delete ingresses which match our selector but are not desired anymore<NEW_LINE>for (String ingressName : existingIngressNames) {<NEW_LINE>ingressFutures.add(ingressOperations.reconcile(reconciliation, namespace, ingressName, null));<NEW_LINE>}<NEW_LINE>return CompositeFuture.join(ingressFutures);<NEW_LINE>});<NEW_LINE>return withVoid(fut);<NEW_LINE>}
, namespace, ingressName, ingress));
727,693
protected void addRunnableTasks(final ImageData<T> imageData, final PathObject parentObject, List<Runnable> tasks) {<NEW_LINE>PixelCalibration cal = imageData == null ? null : imageData<MASK><NEW_LINE>boolean useMicrons = params.getBooleanParameterValue("useMicrons") && cal != null && cal.hasPixelSizeMicrons();<NEW_LINE>double pixelWidth = useMicrons ? cal.getPixelWidthMicrons() : 1;<NEW_LINE>double pixelHeight = useMicrons ? cal.getPixelHeightMicrons() : 1;<NEW_LINE>String unit = useMicrons ? GeneralTools.micrometerSymbol() : "px";<NEW_LINE>boolean doArea = params.getBooleanParameterValue("area");<NEW_LINE>boolean doPerimeter = params.getBooleanParameterValue("perimeter");<NEW_LINE>boolean doCircularity = params.getBooleanParameterValue("circularity");<NEW_LINE>ROI roi = (parentObject.hasROI() && parentObject.getROI().isArea()) ? parentObject.getROI() : null;<NEW_LINE>if (roi != null) {<NEW_LINE>tasks.add(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>MeasurementList measurementList = parentObject.getMeasurementList();<NEW_LINE>ROI roi;<NEW_LINE>if (parentObject instanceof PathCellObject) {<NEW_LINE>roi = ((PathCellObject) parentObject).getNucleusROI();<NEW_LINE>if (roi != null && roi.isArea())<NEW_LINE>addMeasurements(measurementList, roi, "Nucleus Shape: ", pixelWidth, pixelHeight, unit, doArea, doPerimeter, doCircularity);<NEW_LINE>roi = parentObject.getROI();<NEW_LINE>if (roi != null && roi.isArea())<NEW_LINE>addMeasurements(measurementList, roi, "Cell Shape: ", pixelWidth, pixelHeight, unit, doArea, doPerimeter, doCircularity);<NEW_LINE>} else {<NEW_LINE>roi = parentObject.getROI();<NEW_LINE>if (roi != null && roi.isArea())<NEW_LINE>addMeasurements(measurementList, roi, "ROI Shape: ", pixelWidth, pixelHeight, unit, doArea, doPerimeter, doCircularity);<NEW_LINE>}<NEW_LINE>measurementList.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw (e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
.getServer().getPixelCalibration();
249,937
public ContentValues toContentValues() {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(Movies.TMDB_ID, tmdbId);<NEW_LINE>values.put(Movies.IMDB_ID, imdbId);<NEW_LINE>values.put(Movies.TITLE, title);<NEW_LINE>values.put(Movies.TITLE_NOARTICLE, TextTools.trimLeadingArticle(title));<NEW_LINE>values.put(Movies.RELEASED_UTC_MS, releasedUtcMs);<NEW_LINE>values.put(Movies.RUNTIME_MIN, runtimeMin);<NEW_LINE>values.put(Movies.POSTER, poster);<NEW_LINE>values.put(Movies.IN_COLLECTION, inCollection ? 1 : 0);<NEW_LINE>values.put(Movies.IN_WATCHLIST, inWatchlist ? 1 : 0);<NEW_LINE>values.put(Movies.<MASK><NEW_LINE>int playsValue;<NEW_LINE>if (watched && plays >= 1) {<NEW_LINE>playsValue = plays;<NEW_LINE>} else {<NEW_LINE>playsValue = watched ? 1 : 0;<NEW_LINE>}<NEW_LINE>values.put(Movies.PLAYS, playsValue);<NEW_LINE>values.put(Movies.LAST_UPDATED, lastUpdatedMs);<NEW_LINE>// full dump values<NEW_LINE>values.put(Movies.OVERVIEW, overview);<NEW_LINE>// set default values<NEW_LINE>values.put(Movies.RATING_TMDB, 0);<NEW_LINE>values.put(Movies.RATING_VOTES_TMDB, 0);<NEW_LINE>values.put(Movies.RATING_TRAKT, 0);<NEW_LINE>values.put(Movies.RATING_VOTES_TRAKT, 0);<NEW_LINE>return values;<NEW_LINE>}
WATCHED, watched ? 1 : 0);
1,235,156
final UpdateServiceSettingsResult executeUpdateServiceSettings(UpdateServiceSettingsRequest updateServiceSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateServiceSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateServiceSettingsRequest> request = null;<NEW_LINE>Response<UpdateServiceSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateServiceSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateServiceSettingsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateServiceSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateServiceSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new UpdateServiceSettingsResultJsonUnmarshaller());
631,563
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {<NEW_LINE>if (!canInsert[slot] || stack.isEmpty())<NEW_LINE>return stack;<NEW_LINE>if (!inv.isStackValid(this.slotOffset + slot, stack))<NEW_LINE>return stack;<NEW_LINE>int offsetSlot = this.slotOffset + slot;<NEW_LINE>ItemStack currentStack = inv.getInventory().get(offsetSlot);<NEW_LINE>if (currentStack.isEmpty()) {<NEW_LINE>int accepted = Math.min(stack.getMaxStackSize(), inv.getSlotLimit(offsetSlot));<NEW_LINE>if (accepted < stack.getCount()) {<NEW_LINE>stack = stack.copy();<NEW_LINE>if (!simulate) {<NEW_LINE>inv.getInventory().set(offsetSlot, stack.split(accepted));<NEW_LINE>inv.doGraphicalUpdates();<NEW_LINE>} else<NEW_LINE>stack.shrink(accepted);<NEW_LINE>return stack;<NEW_LINE>} else {<NEW_LINE>if (!simulate) {<NEW_LINE>inv.getInventory().set(offsetSlot, stack.copy());<NEW_LINE>inv.doGraphicalUpdates();<NEW_LINE>}<NEW_LINE>return ItemStack.EMPTY;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!ItemHandlerHelper.canItemStacksStack(stack, currentStack))<NEW_LINE>return stack;<NEW_LINE>int accepted = Math.min(stack.getMaxStackSize(), inv.getSlotLimit(offsetSlot)) - currentStack.getCount();<NEW_LINE>if (accepted < stack.getCount()) {<NEW_LINE>stack = stack.copy();<NEW_LINE>if (!simulate) {<NEW_LINE>ItemStack newStack = stack.split(accepted);<NEW_LINE>newStack.grow(currentStack.getCount());<NEW_LINE>inv.getInventory().set(offsetSlot, newStack);<NEW_LINE>inv.doGraphicalUpdates();<NEW_LINE>} else<NEW_LINE>stack.shrink(accepted);<NEW_LINE>return stack;<NEW_LINE>} else {<NEW_LINE>if (!simulate) {<NEW_LINE><MASK><NEW_LINE>newStack.grow(currentStack.getCount());<NEW_LINE>inv.getInventory().set(offsetSlot, newStack);<NEW_LINE>inv.doGraphicalUpdates();<NEW_LINE>}<NEW_LINE>return ItemStack.EMPTY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ItemStack newStack = stack.copy();
295,595
private String contrast() {<NEW_LINE>final ShenyuDictDO before = (ShenyuDictDO) getBefore();<NEW_LINE>Objects.requireNonNull(before);<NEW_LINE>final ShenyuDictDO after = (ShenyuDictDO) getAfter();<NEW_LINE>Objects.requireNonNull(after);<NEW_LINE>if (Objects.equals(before, after)) {<NEW_LINE>return "it no change";<NEW_LINE>}<NEW_LINE>final StringBuilder builder = new StringBuilder();<NEW_LINE>if (!Objects.equals(before.getDictName(), after.getDictName())) {<NEW_LINE>builder.append(String.format("name[%s => %s] ", before.getDictName()<MASK><NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getDictValue(), after.getDictValue())) {<NEW_LINE>builder.append(String.format("value[%s => %s] ", before.getDictValue(), after.getDictValue()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getDesc(), after.getDesc())) {<NEW_LINE>builder.append(String.format("desc[%s => %s] ", before.getDesc(), after.getDesc()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getType(), after.getType())) {<NEW_LINE>builder.append(String.format("type[%s => %s] ", before.getType(), after.getType()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getEnabled(), after.getEnabled())) {<NEW_LINE>builder.append(String.format("enable[%s => %s] ", before.getEnabled(), after.getEnabled()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getSort(), after.getSort())) {<NEW_LINE>builder.append(String.format("sort[%s => %s] ", before.getSort(), after.getSort()));<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>}
, after.getDictName()));
658,308
public static void modConstruction() {<NEW_LINE>WireType.COPPER = COPPER = new ShockingWire(IEWireType.COPPER);<NEW_LINE>WireType.ELECTRUM = ELECTRUM = new ShockingWire(IEWireType.ELECTRUM);<NEW_LINE>WireType.STEEL = STEEL = new ShockingWire(IEWireType.STEEL);<NEW_LINE>WireType.STRUCTURE_ROPE = STRUCTURE_ROPE <MASK><NEW_LINE>WireType.STRUCTURE_STEEL = STRUCTURE_STEEL = new BasicWire(IEWireType.STRUCTURE_STEEL);<NEW_LINE>WireType.REDSTONE = REDSTONE = new BasicWire(IEWireType.REDSTONE);<NEW_LINE>WireType.COPPER_INSULATED = COPPER_INSULATED = new EnergyWire(IEWireType.COPPER_INSULATED);<NEW_LINE>WireType.ELECTRUM_INSULATED = ELECTRUM_INSULATED = new EnergyWire(IEWireType.ELECTRUM_INSULATED);<NEW_LINE>WireType.INTERNAL_CONNECTION = INTERNAL_CONNECTION = new InternalConnection();<NEW_LINE>}
= new BasicWire(IEWireType.STRUCTURE_ROPE);
909,449
private static void initScreens(boolean reset) {<NEW_LINE>if (screens != null && !reset) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log(lvl + 1, "initScreens: entry");<NEW_LINE>primaryScreen = 0;<NEW_LINE>setMouseRobot();<NEW_LINE>if (null == globalRobot) {<NEW_LINE>screens = new Screen[1];<NEW_LINE>screens[0] = null;<NEW_LINE>} else {<NEW_LINE>screens <MASK><NEW_LINE>screens[0] = new Screen(0, runTime.mainMonitor);<NEW_LINE>screens[0].initScreen();<NEW_LINE>int nMonitor = 0;<NEW_LINE>for (int i = 1; i < screens.length; i++) {<NEW_LINE>if (nMonitor == runTime.mainMonitor) {<NEW_LINE>nMonitor++;<NEW_LINE>}<NEW_LINE>screens[i] = new Screen(i, nMonitor);<NEW_LINE>screens[i].initScreen();<NEW_LINE>nMonitor++;<NEW_LINE>}<NEW_LINE>Mouse.init();<NEW_LINE>if (getNumberScreens() > 1) {<NEW_LINE>log(lvl, "initScreens: multi monitor mouse check");<NEW_LINE>Location lnow = Mouse.at();<NEW_LINE>float mmd = Settings.MoveMouseDelay;<NEW_LINE>Settings.MoveMouseDelay = 0f;<NEW_LINE>Location lc = null, lcn = null;<NEW_LINE>for (Screen s : screens) {<NEW_LINE>lc = s.getCenter();<NEW_LINE>Mouse.move(lc);<NEW_LINE>lcn = Mouse.at();<NEW_LINE>if (!lc.equals(lcn)) {<NEW_LINE>log(lvl, "*** multimonitor click check: %s center: (%d, %d) --- NOT OK: (%d, %d)", s.toStringShort(), lc.x, lc.y, lcn.x, lcn.y);<NEW_LINE>} else {<NEW_LINE>log(lvl, "*** checking: %s center: (%d, %d) --- OK", s.toStringShort(), lc.x, lc.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Mouse.move(lnow);<NEW_LINE>Settings.MoveMouseDelay = mmd;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new Screen[runTime.nMonitors];
1,121,600
final GetDeviceMethodsResult executeGetDeviceMethods(GetDeviceMethodsRequest getDeviceMethodsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDeviceMethodsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDeviceMethodsRequest> request = null;<NEW_LINE>Response<GetDeviceMethodsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetDeviceMethodsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDeviceMethodsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT 1Click Devices Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDeviceMethods");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDeviceMethodsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDeviceMethodsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,652,243
public List<Event> findEvents(String hostId, Date fromDate, Date toDate, String tag, String keyword, String categoryInode, final String sortBy, int offset, int limit) throws DotDataException, DotSecurityException, PortalException, SystemException {<NEW_LINE>User <MASK><NEW_LINE>boolean respectCMSAnon = false;<NEW_LINE>if (user == null) {<NEW_LINE>// Assuming is a front-end access<NEW_LINE>respectCMSAnon = true;<NEW_LINE>user = (User) request.getSession().getAttribute(WebKeys.CMS_USER);<NEW_LINE>}<NEW_LINE>List<Category> categories = new ArrayList<Category>();<NEW_LINE>if (UtilMethods.isSet(categoryInode)) {<NEW_LINE>Category cat = categoryAPI.find(categoryInode, user, respectCMSAnon);<NEW_LINE>if (cat != null)<NEW_LINE>categories.add(cat);<NEW_LINE>}<NEW_LINE>String[] tags = null;<NEW_LINE>if (UtilMethods.isSet(tag)) {<NEW_LINE>tags = new String[1];<NEW_LINE>tags[0] = tag;<NEW_LINE>}<NEW_LINE>String[] keywords = null;<NEW_LINE>if (UtilMethods.isSet(keyword)) {<NEW_LINE>keywords = new String[1];<NEW_LINE>keywords[0] = keyword;<NEW_LINE>}<NEW_LINE>List<Event> toReturn = eventAPI.find(hostId, fromDate, toDate, tags, keywords, categories, true, false, offset, limit, user, respectCMSAnon);<NEW_LINE>for (Event event : toReturn) {<NEW_LINE>event.setTags();<NEW_LINE>}<NEW_LINE>if (UtilMethods.isSet(sortBy)) {<NEW_LINE>final boolean isDesc = sortBy.contains("desc");<NEW_LINE>Collections.sort(toReturn, new Comparator<Event>() {<NEW_LINE><NEW_LINE>public int compare(Event event1, Event event2) {<NEW_LINE>if (sortBy.contains("startDate")) {<NEW_LINE>if (isDesc) {<NEW_LINE>return event2.getStartDate().compareTo(event1.getStartDate());<NEW_LINE>}<NEW_LINE>return event1.getStartDate().compareTo(event2.getStartDate());<NEW_LINE>} else if (sortBy.contains("endDate")) {<NEW_LINE>if (isDesc) {<NEW_LINE>return event2.getEndDate().compareTo(event1.getEndDate());<NEW_LINE>}<NEW_LINE>return event1.getEndDate().compareTo(event2.getEndDate());<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return toReturn;<NEW_LINE>}
user = PortalUtil.getUser(request);
357,922
final DeleteDeviceResult executeDeleteDevice(DeleteDeviceRequest deleteDeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDeviceRequest> request = null;<NEW_LINE>Response<DeleteDeviceResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDeviceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDevice");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDeviceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDeviceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
557,594
private static ExplainedOptional<TableRefInfo> retrieveTableRefInfo(final ResultSet rs) throws SQLException {<NEW_LINE>final ReferenceId referenceId = ReferenceId.ofRepoId(rs.getInt("AD_Reference_ID"));<NEW_LINE>final String TableName = rs.getString(1);<NEW_LINE>if (!StringUtils.toBoolean(rs.getString("Ref_IsActive"))) {<NEW_LINE>return ExplainedOptional.emptyBecause("AD_Reference with AD_Reference_ID=" + referenceId.getRepoId() + " is not active");<NEW_LINE>}<NEW_LINE>if (!StringUtils.toBoolean(rs.getString("RefTable_IsActive"))) {<NEW_LINE>return ExplainedOptional.emptyBecause("AD_Ref_Table with AD_Reference_ID=" + referenceId.getRepoId() + " is not active");<NEW_LINE>}<NEW_LINE>if (!StringUtils.toBoolean(rs.getString("Table_IsActive"))) {<NEW_LINE>return ExplainedOptional.<MASK><NEW_LINE>}<NEW_LINE>final String KeyColumn = rs.getString(2);<NEW_LINE>final String DisplayColumn = rs.getString(3);<NEW_LINE>final boolean isValueDisplayed = StringUtils.toBoolean(rs.getString(4));<NEW_LINE>final boolean IsTranslated = StringUtils.toBoolean(rs.getString(5));<NEW_LINE>final String WhereClause = rs.getString(6);<NEW_LINE>final String OrderByClause = rs.getString(7);<NEW_LINE>final AdWindowId zoomSO_Window_ID = AdWindowId.ofRepoIdOrNull(rs.getInt(8));<NEW_LINE>final AdWindowId zoomPO_Window_ID = AdWindowId.ofRepoIdOrNull(rs.getInt(9));<NEW_LINE>// AD_Table_ID = rs.getInt(10);<NEW_LINE>final String displayColumnSQL = rs.getString(11);<NEW_LINE>final AdWindowId zoomAD_Window_ID_Override = AdWindowId.ofRepoIdOrNull(rs.getInt(12));<NEW_LINE>final boolean autoComplete = StringUtils.toBoolean(rs.getString(13));<NEW_LINE>final boolean showInactiveValues = StringUtils.toBoolean(rs.getString(14));<NEW_LINE>final String referenceName = rs.getString("ReferenceName");<NEW_LINE>final TooltipType tooltipType = TooltipType.ofCode(rs.getString("TooltipType"));<NEW_LINE>return ExplainedOptional.of(TableRefInfo.builder().identifier("AD_Reference[ID=" + referenceId.getRepoId() + ",Name=" + referenceName + "]").tableName(TableName).keyColumn(KeyColumn).displayColumn(DisplayColumn).valueDisplayed(isValueDisplayed).displayColumnSQL(displayColumnSQL).translated(IsTranslated).whereClause(WhereClause).orderByClause(OrderByClause).zoomSO_Window_ID(zoomSO_Window_ID).zoomPO_Window_ID(zoomPO_Window_ID).zoomAD_Window_ID_Override(zoomAD_Window_ID_Override).autoComplete(autoComplete).showInactiveValues(showInactiveValues).tooltipType(tooltipType).build());<NEW_LINE>}
emptyBecause("Table " + TableName + " is not active");
396,972
public JavaNode visitIdent(JCIdent ident, TreeContext owner) {<NEW_LINE>TreeContext ctx = owner.down(ident);<NEW_LINE>if (ident.sym == null) {<NEW_LINE>return emitDiagnostic(ctx, "missing identifier symbol", null, null);<NEW_LINE>}<NEW_LINE>EdgeKind edgeKind = EdgeKind.REF;<NEW_LINE>if (ident.sym instanceof ClassSymbol && ident == owner.getNewClassIdentifier()) {<NEW_LINE>// Use ref/id edges for the primary identifier to disambiguate from the constructor.<NEW_LINE>edgeKind = EdgeKind.REF_ID;<NEW_LINE>}<NEW_LINE>JavaNode node = emitSymUsage(ctx, ident.sym, edgeKind);<NEW_LINE>if (node != null && ident.sym instanceof VarSymbol) {<NEW_LINE>// Emit typed edges for "this"/"super" on reference since there is no definition location.<NEW_LINE>// TODO(schroederc): possibly add implicit definition on class declaration<NEW_LINE>if ("this".equals(ident.sym.getSimpleName().toString()) && !emittedIdentType.contains(node.getVName())) {<NEW_LINE>JavaNode typeNode = getRefNode(ctx, ident.sym.enclClass());<NEW_LINE>if (typeNode == null) {<NEW_LINE>return emitDiagnostic(<MASK><NEW_LINE>}<NEW_LINE>entrySets.emitEdge(node.getVName(), EdgeKind.TYPED, typeNode.getVName());<NEW_LINE>emittedIdentType.add(node.getVName());<NEW_LINE>} else if ("super".equals(ident.sym.getSimpleName().toString()) && !emittedIdentType.contains(node.getVName())) {<NEW_LINE>JavaNode typeNode = getRefNode(ctx, ident.sym.enclClass().getSuperclass().asElement());<NEW_LINE>if (typeNode == null) {<NEW_LINE>return emitDiagnostic(ctx, "failed to resolve symbol reference", null, null);<NEW_LINE>}<NEW_LINE>entrySets.emitEdge(node.getVName(), EdgeKind.TYPED, typeNode.getVName());<NEW_LINE>emittedIdentType.add(node.getVName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>}
ctx, "failed to resolve symbol reference", null, null);
1,565,248
private ThreadSnapshotFilter produceConjunctionFilter(Op node) {<NEW_LINE>List<String> pattern = new ArrayList<String>();<NEW_LINE>while (node.toc == TokenType.COMMA && node.right.toc == TokenType.PATTERN) {<NEW_LINE>pattern.add(refinePattern(node.right.body));<NEW_LINE>node = node.left;<NEW_LINE>}<NEW_LINE>if (pattern.isEmpty()) {<NEW_LINE>return filterFactory.conjunction(produceFilter(node.left), produceFilter(node.right));<NEW_LINE>} else {<NEW_LINE>if (node.toc == TokenType.PATTERN) {<NEW_LINE>pattern.add(refinePattern(node.body));<NEW_LINE>node = null;<NEW_LINE>}<NEW_LINE>ThreadSnapshotFilter f = filterFactory.frameFilter(filterFactory.patternFrameMatcher(pattern));<NEW_LINE>return node == null ? f : filterFactory.conjunction<MASK><NEW_LINE>}<NEW_LINE>}
(f, produceFilter(node));
1,388,380
public void executeFix(final String endpointId) throws DotDataException, DotSecurityException {<NEW_LINE>// remove from the index all the content under each conflicted host<NEW_LINE>final DotConnect dc = new DotConnect().setSQL("SELECT remote_working_inode, local_working_inode, remote_live_inode, local_live_inode," + " remote_identifier, local_identifier, language_id, host" + " FROM " + getIntegrityType().getResultsTableName() + " WHERE endpoint_id = ?").addParam(endpointId);<NEW_LINE>final List<Map<String, Object>> results = dc.loadObjectResults();<NEW_LINE>final Map<String, Integer> versionCount = new HashMap<>();<NEW_LINE>results.forEach(result -> {<NEW_LINE>final String oldIdentifier = (String) result.get("local_identifier");<NEW_LINE>final Integer existent = versionCount.get(oldIdentifier);<NEW_LINE>final Integer counter = existent == null ? 1 : existent + 1;<NEW_LINE>versionCount.put(oldIdentifier, counter);<NEW_LINE>});<NEW_LINE>for (final Map<String, Object> result : results) {<NEW_LINE>final String oldHostIdentifier = (String) result.get("local_identifier");<NEW_LINE>final int counter = versionCount.get(oldHostIdentifier);<NEW_LINE>boolean isLastConflict = counter == 1;<NEW_LINE>fixHostConflicts(result, isLastConflict);<NEW_LINE>if (!isLastConflict) {<NEW_LINE>// Decrease version counter if greater than 1<NEW_LINE>versionCount.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
put(oldHostIdentifier, counter - 1);
969,202
public GlobalId createId(Object targetCdo, OwnerContext ownerContext) {<NEW_LINE>Validate.argumentsAreNotNull(targetCdo);<NEW_LINE>Optional<ObjectAccessProxy> cdoProxy = objectAccessHook.createAccessor(targetCdo);<NEW_LINE>Class<?> targetClass = cdoProxy.map((p) -> p.getTargetClass()).orElse(targetCdo.getClass());<NEW_LINE>ManagedType targetManagedType = typeMapper.getJaversManagedType(targetClass);<NEW_LINE>if (targetManagedType instanceof EntityType) {<NEW_LINE>if (cdoProxy.isPresent() && cdoProxy.get().getLocalId().isPresent()) {<NEW_LINE>return createInstanceId(cdoProxy.get().getLocalId().get(), targetClass);<NEW_LINE>} else {<NEW_LINE>return ((EntityType) targetManagedType).createIdFromInstance(targetCdo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (targetManagedType instanceof ValueObjectType && !hasOwner(ownerContext)) {<NEW_LINE>return new UnboundedValueObjectId(targetManagedType.getName());<NEW_LINE>}<NEW_LINE>if (targetManagedType instanceof ValueObjectType && hasOwner(ownerContext)) {<NEW_LINE>Supplier<String> parentFragment = createParentFragment(ownerContext.getOwnerId());<NEW_LINE>String localPath = ownerContext.getPath();<NEW_LINE>if (ownerContext.requiresObjectHasher() || ValueObjectIdWithHash.containsHashPlaceholder(parentFragment.get())) {<NEW_LINE>return new ValueObjectIdWithPlaceholder(targetManagedType.getName(), getRootOwnerId(ownerContext), parentFragment, <MASK><NEW_LINE>} else {<NEW_LINE>return new ValueObjectId(targetManagedType.getName(), getRootOwnerId(ownerContext), parentFragment.get() + localPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new JaversException(JaversExceptionCode.NOT_IMPLEMENTED);<NEW_LINE>}
localPath, ownerContext.requiresObjectHasher());
1,135,600
public static void main(String[] args) throws IOException {<NEW_LINE>if (args.length != 1) {<NEW_LINE>System.out.println("Usage: " + NeededNGramCounter.class.getSimpleName() + " <ngramIndexDir>");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>Language lang = Languages.getLanguageForShortCode(LANG);<NEW_LINE>String path = "/" + lang.getShortCode() + "/confusion_sets.txt";<NEW_LINE>Set<String> ngrams;<NEW_LINE>try (InputStream confSetStream = JLanguageTool.getDataBroker().getFromResourceDirAsStream(path)) {<NEW_LINE>ngrams = new ConfusionSetLoader(new AmericanEnglish()).loadConfusionPairs(confSetStream).keySet();<NEW_LINE>}<NEW_LINE>String ngramIndexDir = args[0];<NEW_LINE>FSDirectory fsDir = FSDirectory.open(new File(ngramIndexDir).toPath());<NEW_LINE>IndexReader reader = DirectoryReader.open(fsDir);<NEW_LINE>Fields fields = MultiFields.getFields(reader);<NEW_LINE>Terms terms = fields.terms("ngram");<NEW_LINE>TermsEnum termsEnum = terms.iterator();<NEW_LINE>int i = 0;<NEW_LINE>int needed = 0;<NEW_LINE>int notNeeded = 0;<NEW_LINE>BytesRef next;<NEW_LINE>while ((next = termsEnum.next()) != null) {<NEW_LINE>String term = next.utf8ToString();<NEW_LINE>String[] tmpTerms = term.split(" ");<NEW_LINE>boolean ngramNeeded = false;<NEW_LINE>for (String tmpTerm : tmpTerms) {<NEW_LINE>if (ngrams.contains(tmpTerm)) {<NEW_LINE>ngramNeeded = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ngramNeeded) {<NEW_LINE>// System.out.println("needed: " + term);<NEW_LINE>needed++;<NEW_LINE>} else {<NEW_LINE>// System.out.println("not needed: " + term);<NEW_LINE>notNeeded++;<NEW_LINE>}<NEW_LINE>if (i % 500_000 == 0) {<NEW_LINE>System.out.println(i + "/" + terms.getDocCount());<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>System.out.println("language : " + LANG);<NEW_LINE>System.out.println("ngram index : " + ngramIndexDir);<NEW_LINE>System.out.println("needed ngrams : " + needed);<NEW_LINE>System.<MASK><NEW_LINE>}
out.println("not needed ngrams: " + notNeeded);
1,768,367
public void marshall(ConnectorRuntimeSetting connectorRuntimeSetting, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (connectorRuntimeSetting == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(connectorRuntimeSetting.getKey(), KEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorRuntimeSetting.getDataType(), DATATYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorRuntimeSetting.getIsRequired(), ISREQUIRED_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorRuntimeSetting.getLabel(), LABEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(connectorRuntimeSetting.getScope(), SCOPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorRuntimeSetting.getConnectorSuppliedValueOptions(), CONNECTORSUPPLIEDVALUEOPTIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
connectorRuntimeSetting.getDescription(), DESCRIPTION_BINDING);
462,559
public SuiteLauncherDiscoveryRequestBuilder suite(Class<?> suiteClass) {<NEW_LINE>Preconditions.notNull(suiteClass, "Suite class must not be null");<NEW_LINE>// Annotations in alphabetical order (except @SelectClasses)<NEW_LINE>// @formatter:off<NEW_LINE>findRepeatableAnnotations(suiteClass, ConfigurationParameter.class).forEach(configuration -> configurationParameter(configuration.key(), configuration.value()));<NEW_LINE>findAnnotation(suiteClass, DisableParentConfigurationParameters.class).ifPresent(__ -> enableParentConfigurationParameters = false);<NEW_LINE>findAnnotationValues(suiteClass, ExcludeClassNamePatterns.class, ExcludeClassNamePatterns::value).flatMap(SuiteLauncherDiscoveryRequestBuilder::trimmed).map(ClassNameFilter::excludeClassNamePatterns).ifPresent(this::filters);<NEW_LINE>findAnnotationValues(suiteClass, ExcludeEngines.class, ExcludeEngines::value).map(EngineFilter::excludeEngines).ifPresent(this::filters);<NEW_LINE>findAnnotationValues(suiteClass, ExcludePackages.class, ExcludePackages::value).map(PackageNameFilter::excludePackageNames).ifPresent(this::filters);<NEW_LINE>findAnnotationValues(suiteClass, ExcludeTags.class, ExcludeTags::value).map(TagFilter::excludeTags).ifPresent(this::filters);<NEW_LINE>// Process @SelectClasses before @IncludeClassNamePatterns, since the names<NEW_LINE>// of selected classes get automatically added to the include filter.<NEW_LINE>findAnnotationValues(suiteClass, SelectClasses.class, SelectClasses::value).map(this::selectClasses).ifPresent(this::selectors);<NEW_LINE>findAnnotationValues(suiteClass, IncludeClassNamePatterns.class, IncludeClassNamePatterns::value).flatMap(SuiteLauncherDiscoveryRequestBuilder::trimmed).map(this::createIncludeClassNameFilter).ifPresent(filters -> {<NEW_LINE>includeClassNamePatternsUsed = true;<NEW_LINE>filters(filters);<NEW_LINE>});<NEW_LINE>findAnnotationValues(suiteClass, IncludeEngines.class, IncludeEngines::value).map(EngineFilter::includeEngines).ifPresent(this::filters);<NEW_LINE>findAnnotationValues(suiteClass, IncludePackages.class, IncludePackages::value).map(PackageNameFilter::includePackageNames).ifPresent(this::filters);<NEW_LINE>findAnnotationValues(suiteClass, IncludeTags.class, IncludeTags::value).map(TagFilter::includeTags<MASK><NEW_LINE>findRepeatableAnnotations(suiteClass, SelectClasspathResource.class).stream().map(annotation -> selectClasspathResource(annotation.value(), annotation.line(), annotation.column())).forEach(this::selectors);<NEW_LINE>findAnnotationValues(suiteClass, SelectDirectories.class, SelectDirectories::value).map(AdditionalDiscoverySelectors::selectDirectories).ifPresent(this::selectors);<NEW_LINE>findRepeatableAnnotations(suiteClass, SelectFile.class).stream().map(annotation -> selectFile(annotation.value(), annotation.line(), annotation.column())).forEach(this::selectors);<NEW_LINE>findAnnotationValues(suiteClass, SelectModules.class, SelectModules::value).map(AdditionalDiscoverySelectors::selectModules).ifPresent(this::selectors);<NEW_LINE>findAnnotationValues(suiteClass, SelectUris.class, SelectUris::value).map(AdditionalDiscoverySelectors::selectUris).ifPresent(this::selectors);<NEW_LINE>findAnnotationValues(suiteClass, SelectPackages.class, SelectPackages::value).map(AdditionalDiscoverySelectors::selectPackages).ifPresent(this::selectors);<NEW_LINE>// @formatter:on<NEW_LINE>return this;<NEW_LINE>}
).ifPresent(this::filters);
1,553,514
public void takeSnapshot(SnapshotInfo snapshotInfo, AsyncCompletionCallback<CreateCmdResult> callback) {<NEW_LINE>LOGGER.debug("Taking PowerFlex volume snapshot");<NEW_LINE>Preconditions.checkArgument(snapshotInfo != null, "snapshotInfo cannot be null");<NEW_LINE>VolumeInfo volumeInfo = snapshotInfo.getBaseVolume();<NEW_LINE>Preconditions.checkArgument(volumeInfo != null, "volumeInfo cannot be null");<NEW_LINE>VolumeVO volumeVO = volumeDao.findById(volumeInfo.getId());<NEW_LINE>long storagePoolId = volumeVO.getPoolId();<NEW_LINE>Preconditions.checkArgument(storagePoolId > 0, "storagePoolId should be > 0");<NEW_LINE>StoragePoolVO <MASK><NEW_LINE>Preconditions.checkArgument(storagePool != null && storagePool.getHostAddress() != null, "storagePool and host address should not be null");<NEW_LINE>CreateCmdResult result;<NEW_LINE>try {<NEW_LINE>SnapshotObjectTO snapshotObjectTo = (SnapshotObjectTO) snapshotInfo.getTO();<NEW_LINE>final ScaleIOGatewayClient client = getScaleIOClient(storagePoolId);<NEW_LINE>final String scaleIOVolumeId = ScaleIOUtil.getVolumePath(volumeVO.getPath());<NEW_LINE>String snapshotName = String.format("%s-%s-%s-%s", ScaleIOUtil.SNAPSHOT_PREFIX, snapshotInfo.getId(), storagePool.getUuid().split("-")[0].substring(4), ManagementServerImpl.customCsIdentifier.value());<NEW_LINE>org.apache.cloudstack.storage.datastore.api.Volume scaleIOVolume = null;<NEW_LINE>scaleIOVolume = client.takeSnapshot(scaleIOVolumeId, snapshotName);<NEW_LINE>if (scaleIOVolume == null) {<NEW_LINE>throw new CloudRuntimeException("Failed to take snapshot on PowerFlex cluster");<NEW_LINE>}<NEW_LINE>snapshotObjectTo.setPath(ScaleIOUtil.updatedPathWithVolumeName(scaleIOVolume.getId(), snapshotName));<NEW_LINE>CreateObjectAnswer createObjectAnswer = new CreateObjectAnswer(snapshotObjectTo);<NEW_LINE>result = new CreateCmdResult(null, createObjectAnswer);<NEW_LINE>result.setResult(null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String errMsg = "Unable to take PowerFlex volume snapshot for volume: " + volumeInfo.getId() + " due to " + e.getMessage();<NEW_LINE>LOGGER.warn(errMsg);<NEW_LINE>result = new CreateCmdResult(null, new CreateObjectAnswer(e.toString()));<NEW_LINE>result.setResult(e.toString());<NEW_LINE>}<NEW_LINE>callback.complete(result);<NEW_LINE>}
storagePool = storagePoolDao.findById(storagePoolId);
175,905
public UserWithRole validateUser(String token) {<NEW_LINE>String username = this.tokenCache.get(IdGenerator.of(token));<NEW_LINE>Claims payload = null;<NEW_LINE>boolean needBuildCache = false;<NEW_LINE>if (username == null) {<NEW_LINE>payload = this.tokenGenerator.verify(token);<NEW_LINE>username = (String) <MASK><NEW_LINE>needBuildCache = true;<NEW_LINE>}<NEW_LINE>HugeUser user = this.findUser(username);<NEW_LINE>if (user == null) {<NEW_LINE>return new UserWithRole(username);<NEW_LINE>} else if (needBuildCache) {<NEW_LINE>long expireAt = payload.getExpiration().getTime();<NEW_LINE>long bornTime = this.tokenCache.expire() - (expireAt - System.currentTimeMillis());<NEW_LINE>this.tokenCache.update(IdGenerator.of(token), username, Math.negateExact(bornTime));<NEW_LINE>}<NEW_LINE>return new UserWithRole(user.id(), username, this.rolePermission(user));<NEW_LINE>}
payload.get(AuthConstant.TOKEN_USER_NAME);
686,390
protected int crossover(final MSeq<G> v, final MSeq<G> w) {<NEW_LINE>final var random = RandomRegistry.random();<NEW_LINE>final double min = v.get(0).min().doubleValue();<NEW_LINE>final double max = v.get(0).max().doubleValue();<NEW_LINE>for (int i = 0, n = min(v.length(), w.length()); i < n; ++i) {<NEW_LINE>final var g1 = v.get(i);<NEW_LINE>final var g2 = w.get(i);<NEW_LINE>if (g1.isValid() && g2.isValid()) {<NEW_LINE>final double vi = g1.doubleValue();<NEW_LINE>final double wi = g2.doubleValue();<NEW_LINE>double t, s;<NEW_LINE>do {<NEW_LINE>final double a = random.nextDouble(-_p, 1 + _p);<NEW_LINE>final double b = random.nextDouble<MASK><NEW_LINE>t = a * vi + (1 - a) * wi;<NEW_LINE>s = b * wi + (1 - b) * vi;<NEW_LINE>} while (t < min || s < min || t >= max || s >= max);<NEW_LINE>v.set(i, v.get(i).newInstance(t));<NEW_LINE>w.set(i, w.get(i).newInstance(s));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 2;<NEW_LINE>}
(-_p, 1 + _p);