idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
3,519
public static OkHttpClient.Builder newBuilder() {<NEW_LINE>Log.d(TAG, "Creating new instance of HTTP client");<NEW_LINE>System.setProperty("http.maxConnections", String.valueOf(MAX_CONNECTIONS));<NEW_LINE>OkHttpClient.Builder builder = new OkHttpClient.Builder();<NEW_LINE>builder.interceptors().add(new BasicAuthorizationInterceptor());<NEW_LINE>builder.networkInterceptors().add(new UserAgentInterceptor());<NEW_LINE>// set cookie handler<NEW_LINE>CookieManager cm = new CookieManager();<NEW_LINE>cm.setCookiePolicy(CookiePolicy.ACCEPT_ORIGINAL_SERVER);<NEW_LINE>builder.cookieJar(new JavaNetCookieJar(cm));<NEW_LINE>// set timeouts<NEW_LINE>builder.connectTimeout(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>builder.readTimeout(READ_TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>builder.writeTimeout(READ_TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>// 20MB<NEW_LINE>builder.cache(new Cache(cacheDirectory, 20L * 1000000));<NEW_LINE>// configure redirects<NEW_LINE>builder.followRedirects(true);<NEW_LINE>builder.followSslRedirects(true);<NEW_LINE>ProxyConfig config = UserPreferences.getProxyConfig();<NEW_LINE>if (config.type != Proxy.Type.DIRECT && !TextUtils.isEmpty(config.host)) {<NEW_LINE>int port = config.port > 0 ? config.port : ProxyConfig.DEFAULT_PORT;<NEW_LINE>SocketAddress address = InetSocketAddress.createUnresolved(config.host, port);<NEW_LINE>builder.proxy(new Proxy(config.type, address));<NEW_LINE>if (!TextUtils.isEmpty(config.username) && config.password != null) {<NEW_LINE>builder.proxyAuthenticator((route, response) -> {<NEW_LINE>String credentials = Credentials.basic(config.username, config.password);<NEW_LINE>return response.request().newBuilder().header(<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SslClientSetup.installCertificates(builder);<NEW_LINE>return builder;<NEW_LINE>}
"Proxy-Authorization", credentials).build();
1,644,578
final PutLogEventsResult executePutLogEvents(PutLogEventsRequest putLogEventsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putLogEventsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutLogEventsRequest> request = null;<NEW_LINE>Response<PutLogEventsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutLogEventsRequestProtocolMarshaller(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, "CloudWatch Logs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutLogEvents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutLogEventsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutLogEventsResultJsonUnmarshaller());<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(putLogEventsRequest));
472,808
private MetaDataRegisterDTO buildMetaDataDTO(final ServiceBean<?> serviceBean, final ShenyuDubboClient shenyuDubboClient, final Method method) {<NEW_LINE>String path = contextPath + shenyuDubboClient.path();<NEW_LINE>String desc = shenyuDubboClient.desc();<NEW_LINE>String serviceName = serviceBean.getInterface();<NEW_LINE>String configRuleName = shenyuDubboClient.ruleName();<NEW_LINE>String ruleName = ("".equals(configRuleName)) ? path : configRuleName;<NEW_LINE>String methodName = method.getName();<NEW_LINE>Class<?>[] parameterTypesClazz = method.getParameterTypes();<NEW_LINE>String parameterTypes = Arrays.stream(parameterTypesClazz).map(Class::getName).collect<MASK><NEW_LINE>return MetaDataRegisterDTO.builder().appName(buildAppName(serviceBean)).serviceName(serviceName).methodName(methodName).contextPath(contextPath).host(buildHost()).port(buildPort(serviceBean)).path(path).ruleName(ruleName).pathDesc(desc).parameterTypes(parameterTypes).rpcExt(buildRpcExt(serviceBean)).rpcType(RpcTypeEnum.DUBBO.getName()).enabled(shenyuDubboClient.enabled()).build();<NEW_LINE>}
(Collectors.joining(","));
1,082,873
public static void horizontal11(Kernel1D_S32 kernel, GrayS16 input, GrayI16 output, int skip) {<NEW_LINE>final short[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int <MASK><NEW_LINE>final int k11 = kernel.data[10];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int widthEnd = UtilDownConvolve.computeMaxSide(input.width, skip, radius);<NEW_LINE>final int height = input.getHeight();<NEW_LINE>final int offsetX = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int i = 0; i < height; i++) {<NEW_LINE>int indexDst = output.startIndex + i * output.stride + offsetX / skip;<NEW_LINE>int j = input.startIndex + i * input.stride - radius;<NEW_LINE>final int jEnd = j + widthEnd;<NEW_LINE>for (j += offsetX; j <= jEnd; j += skip) {<NEW_LINE>int indexSrc = j;<NEW_LINE>int total = (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc++]) * k5;<NEW_LINE>total += (dataSrc[indexSrc++]) * k6;<NEW_LINE>total += (dataSrc[indexSrc++]) * k7;<NEW_LINE>total += (dataSrc[indexSrc++]) * k8;<NEW_LINE>total += (dataSrc[indexSrc++]) * k9;<NEW_LINE>total += (dataSrc[indexSrc++]) * k10;<NEW_LINE>total += (dataSrc[indexSrc]) * k11;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
k10 = kernel.data[9];
1,607,928
public static DescribeVmBackupPlanExecutionsResponse unmarshall(DescribeVmBackupPlanExecutionsResponse describeVmBackupPlanExecutionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVmBackupPlanExecutionsResponse.setRequestId(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.RequestId"));<NEW_LINE>describeVmBackupPlanExecutionsResponse.setSuccess(_ctx.booleanValue("DescribeVmBackupPlanExecutionsResponse.Success"));<NEW_LINE>describeVmBackupPlanExecutionsResponse.setCode(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Code"));<NEW_LINE>describeVmBackupPlanExecutionsResponse.setMessage(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Message"));<NEW_LINE>describeVmBackupPlanExecutionsResponse.setTotalCount(_ctx.integerValue("DescribeVmBackupPlanExecutionsResponse.TotalCount"));<NEW_LINE>describeVmBackupPlanExecutionsResponse.setPageNumber(_ctx.integerValue("DescribeVmBackupPlanExecutionsResponse.PageNumber"));<NEW_LINE>describeVmBackupPlanExecutionsResponse.setPageSize<MASK><NEW_LINE>List<Execution> executions = new ArrayList<Execution>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVmBackupPlanExecutionsResponse.Executions.Length"); i++) {<NEW_LINE>Execution execution = new Execution();<NEW_LINE>execution.setExecutionId(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].ExecutionId"));<NEW_LINE>execution.setVmBackupPlanId(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].VmBackupPlanId"));<NEW_LINE>execution.setBackupType(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].BackupType"));<NEW_LINE>execution.setStatus(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].Status"));<NEW_LINE>execution.setErrorMessage(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].ErrorMessage"));<NEW_LINE>execution.setDetail(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].Detail"));<NEW_LINE>execution.setCreatedTime(_ctx.longValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].CreatedTime"));<NEW_LINE>execution.setUpdatedTime(_ctx.longValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].UpdatedTime"));<NEW_LINE>execution.setVmBackupPlanName(_ctx.stringValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].VmBackupPlanName"));<NEW_LINE>execution.setBackupPlanExisted(_ctx.booleanValue("DescribeVmBackupPlanExecutionsResponse.Executions[" + i + "].BackupPlanExisted"));<NEW_LINE>executions.add(execution);<NEW_LINE>}<NEW_LINE>describeVmBackupPlanExecutionsResponse.setExecutions(executions);<NEW_LINE>return describeVmBackupPlanExecutionsResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeVmBackupPlanExecutionsResponse.PageSize"));
1,539,678
private void redrawBorderForSquareCorners(@NonNull Canvas canvas) {<NEW_LINE>if (all(mCornersRounded)) {<NEW_LINE>// no square corners<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mCornerRadius == 0) {<NEW_LINE>// no round corners<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float left = mDrawableRect.left;<NEW_LINE>float top = mDrawableRect.top;<NEW_LINE>float right <MASK><NEW_LINE>float bottom = top + mDrawableRect.height();<NEW_LINE>float radius = mCornerRadius;<NEW_LINE>float offset = mBorderWidth / 2;<NEW_LINE>if (!mCornersRounded[Corner.TOP_LEFT]) {<NEW_LINE>canvas.drawLine(left - offset, top, left + radius, top, mBorderPaint);<NEW_LINE>canvas.drawLine(left, top - offset, left, top + radius, mBorderPaint);<NEW_LINE>}<NEW_LINE>if (!mCornersRounded[Corner.TOP_RIGHT]) {<NEW_LINE>canvas.drawLine(right - radius - offset, top, right, top, mBorderPaint);<NEW_LINE>canvas.drawLine(right, top - offset, right, top + radius, mBorderPaint);<NEW_LINE>}<NEW_LINE>if (!mCornersRounded[Corner.BOTTOM_RIGHT]) {<NEW_LINE>canvas.drawLine(right - radius - offset, bottom, right + offset, bottom, mBorderPaint);<NEW_LINE>canvas.drawLine(right, bottom - radius, right, bottom, mBorderPaint);<NEW_LINE>}<NEW_LINE>if (!mCornersRounded[Corner.BOTTOM_LEFT]) {<NEW_LINE>canvas.drawLine(left - offset, bottom, left + radius, bottom, mBorderPaint);<NEW_LINE>canvas.drawLine(left, bottom - radius, left, bottom, mBorderPaint);<NEW_LINE>}<NEW_LINE>}
= left + mDrawableRect.width();
612,126
public static void copyImagePullSecret(String namespace) {<NEW_LINE>LOGGER.info("Checking if secret {} is in the default namespace", Environment.SYSTEM_TEST_STRIMZI_IMAGE_PULL_SECRET);<NEW_LINE>if (kubeClient("default").getSecret(Environment.SYSTEM_TEST_STRIMZI_IMAGE_PULL_SECRET) == null) {<NEW_LINE>throw new RuntimeException(Environment.SYSTEM_TEST_STRIMZI_IMAGE_PULL_SECRET + " is not in the default namespace!");<NEW_LINE>}<NEW_LINE>Secret pullSecret = kubeClient("default").getSecret(Environment.SYSTEM_TEST_STRIMZI_IMAGE_PULL_SECRET);<NEW_LINE>kubeClient(namespace).createSecret(new SecretBuilder().withApiVersion("v1").withKind("Secret").withNewMetadata().withName(Environment.SYSTEM_TEST_STRIMZI_IMAGE_PULL_SECRET).endMetadata().withType("kubernetes.io/dockerconfigjson").withData(Collections.singletonMap(".dockerconfigjson", pullSecret.getData().get(".dockerconfigjson"<MASK><NEW_LINE>}
))).build());
1,004,790
protected void loadAllTransGroupList() {<NEW_LINE>List<Group> groups = matrix.getGroups();<NEW_LINE>List<Group> scaleGroups = matrix.getScaleOutGroups();<NEW_LINE>List<String> groupNames = new ArrayList<>(groups.size(<MASK><NEW_LINE>for (Group group : groups) {<NEW_LINE>if (group.getType().isMysql()) {<NEW_LINE>groupNames.add(group.getName());<NEW_LINE>} else {<NEW_LINE>String logMsg = "Ignored non-mysql group: " + group.getName();<NEW_LINE>logger.warn(logMsg);<NEW_LINE>LoggerInit.TDDL_DYNAMIC_CONFIG.warn(logMsg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Group group : scaleGroups) {<NEW_LINE>if (group.getType().isMysql()) {<NEW_LINE>groupNames.add(group.getName());<NEW_LINE>} else {<NEW_LINE>String logMsg = "Ignored non-mysql group: " + group.getName();<NEW_LINE>logger.warn(logMsg);<NEW_LINE>LoggerInit.TDDL_DYNAMIC_CONFIG.warn(logMsg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(groupNames);<NEW_LINE>String logMsg = "All Trans Groups: " + StringUtils.join(groupNames, ", ");<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info(logMsg);<NEW_LINE>}<NEW_LINE>LoggerInit.TDDL_DYNAMIC_CONFIG.info(logMsg);<NEW_LINE>this.allTransGroupList = groupNames;<NEW_LINE>if (topologyChanger != null) {<NEW_LINE>topologyChanger.onTopology(this);<NEW_LINE>}<NEW_LINE>}
) + scaleGroups.size());
1,666,026
public void initialize() {<NEW_LINE>addTitledGroupBg(root, gridRow, 3, Res.get("account.menu.walletInfo.balance.headLine"));<NEW_LINE>addMultilineLabel(root, gridRow, Res.get("account.menu.walletInfo.balance.info"), Layout.FIRST_ROW_DISTANCE, Double.MAX_VALUE);<NEW_LINE>btcTextField = addTopLabelTextField(root, ++gridRow, "BTC", -Layout.FLOATING_LABEL_DISTANCE).second;<NEW_LINE>bsqTextField = addTopLabelTextField(root, ++gridRow, "BSQ", -Layout.FLOATING_LABEL_DISTANCE).second;<NEW_LINE>addTitledGroupBg(root, ++gridRow, 4, Res.get("account.menu.walletInfo.xpub.headLine"), Layout.GROUP_DISTANCE);<NEW_LINE>addXpubKeys(btcWalletService, "BTC", gridRow, Layout.FIRST_ROW_AND_GROUP_DISTANCE);<NEW_LINE>// update gridRow<NEW_LINE>++gridRow;<NEW_LINE>addXpubKeys(bsqWalletService, "BSQ", ++gridRow, -Layout.FLOATING_LABEL_DISTANCE);<NEW_LINE>// update gridRow<NEW_LINE>++gridRow;<NEW_LINE>addTitledGroupBg(root, ++gridRow, 4, Res.get("account.menu.walletInfo.path.headLine"), Layout.GROUP_DISTANCE);<NEW_LINE>addMultilineLabel(root, gridRow, Res.get("account.menu.walletInfo.path.info"), Layout.FIRST_ROW_AND_GROUP_DISTANCE, Double.MAX_VALUE);<NEW_LINE>addTopLabelTextField(root, ++gridRow, Res.get("account.menu.walletInfo.walletSelector", "BTC", "legacy"), "44'/0'/0'", -Layout.FLOATING_LABEL_DISTANCE);<NEW_LINE>addTopLabelTextField(root, ++gridRow, Res.get("account.menu.walletInfo.walletSelector", "BTC", "segwit")<MASK><NEW_LINE>addTopLabelTextField(root, ++gridRow, Res.get("account.menu.walletInfo.walletSelector", "BSQ", ""), "44'/142'/0'", -Layout.FLOATING_LABEL_DISTANCE);<NEW_LINE>openDetailsButton = addButtonAfterGroup(root, ++gridRow, Res.get("account.menu.walletInfo.openDetails"));<NEW_LINE>btcWalletBalanceListener = new BalanceListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onBalanceChanged(Coin balanceAsCoin, Transaction tx) {<NEW_LINE>updateBalances(btcWalletService);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>bsqWalletBalanceListener = new BalanceListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onBalanceChanged(Coin balanceAsCoin, Transaction tx) {<NEW_LINE>updateBalances(bsqWalletService);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
, "44'/0'/1'", -Layout.FLOATING_LABEL_DISTANCE);
835,260
private void initializeOutput(int type) {<NEW_LINE>if (state_ == CHUNK_PRE_OUTPUT) {<NEW_LINE>hasErrors_ = false;<NEW_LINE>state_ = CHUNK_POST_OUTPUT;<NEW_LINE>} else if (state_ == CHUNK_POST_OUTPUT && presenter_ instanceof ChunkOutputStream && (isBlockType(type) || isBlockType(type) != isBlockType(lastOutputType_))) {<NEW_LINE>// we switch to gallery mode when we have either two block-type<NEW_LINE>// outputs (e.g. two plots), or a block-type output combined with<NEW_LINE>// non-block output (e.g. a plot and some text)<NEW_LINE>final ChunkOutputStream stream = (ChunkOutputStream) presenter_;<NEW_LINE>final ChunkOutputGallery gallery = new ChunkOutputGallery(this, chunkOutputSize_);<NEW_LINE>attachPresenter(gallery);<NEW_LINE>setUpEvents(gallery.viewer_.getElement());<NEW_LINE>// extract all the pages from the stream and populate the gallery<NEW_LINE>List<ChunkOutputPage> pages = stream.extractPages();<NEW_LINE><MASK><NEW_LINE>if (ordinal > 0) {<NEW_LINE>// add the stream itself if there's still anything left in it<NEW_LINE>pages.add(new ChunkConsolePage(ordinal, stream, chunkOutputSize_));<NEW_LINE>}<NEW_LINE>// ensure page ordering is correct<NEW_LINE>Collections.sort(pages, new Comparator<ChunkOutputPage>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(ChunkOutputPage o1, ChunkOutputPage o2) {<NEW_LINE>return o1.ordinal() - o2.ordinal();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (ChunkOutputPage page : pages) {<NEW_LINE>gallery.addPage(page);<NEW_LINE>}<NEW_LINE>syncHeight(false, false);<NEW_LINE>}<NEW_LINE>lastOutputType_ = type;<NEW_LINE>}
int ordinal = stream.getContentOrdinal();
1,398,538
// GEN-LAST:event_bnCancelActionPerformed<NEW_LINE>@Messages({ "AddNewOrganizationDialog.bnOk.addFailed.text=Failed to add new organization." })<NEW_LINE>private void bnOKActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_bnOKActionPerformed<NEW_LINE>try {<NEW_LINE>CentralRepository dbManager = CentralRepository.getInstance();<NEW_LINE>if (organizationToEdit != null) {<NEW_LINE>// make a copy in case the update fails<NEW_LINE>newOrg = dbManager.<MASK><NEW_LINE>newOrg.setName(tfOrganizationName.getText());<NEW_LINE>newOrg.setPocName(tfPocName.getText());<NEW_LINE>newOrg.setPocEmail(tfPocEmail.getText());<NEW_LINE>newOrg.setPocPhone(tfPocPhone.getText());<NEW_LINE>dbManager.updateOrganization(newOrg);<NEW_LINE>} else {<NEW_LINE>newOrg = new CentralRepoOrganization(tfOrganizationName.getText(), tfPocName.getText(), tfPocEmail.getText(), tfPocPhone.getText());<NEW_LINE>newOrg = dbManager.newOrganization(newOrg);<NEW_LINE>}<NEW_LINE>hasChanged = true;<NEW_LINE>dispose();<NEW_LINE>} catch (CentralRepoException ex) {<NEW_LINE>lbWarningMsg.setText(Bundle.AddNewOrganizationDialog_bnOk_addFailed_text());<NEW_LINE>logger.log(Level.SEVERE, "Failed adding new organization.", ex);<NEW_LINE>newOrg = null;<NEW_LINE>}<NEW_LINE>}
getOrganizationByID(organizationToEdit.getOrgID());
1,836,538
private static ChangeBlockEvent.Place createAndPostChangeBlockEventPlaceMulti(CauseStackManager.StackFrame frame, ForgeToSpongeEventData eventData) {<NEW_LINE>final BlockEvent.MultiPlaceEvent forgeEvent = (BlockEvent.MultiPlaceEvent) eventData.getForgeEvent();<NEW_LINE>final net.minecraft.world.World world = forgeEvent.getWorld();<NEW_LINE>if (world.isRemote) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<Transaction<BlockSnapshot>> builder = new ImmutableList.Builder<>();<NEW_LINE>for (net.minecraftforge.common.util.BlockSnapshot blockSnapshot : forgeEvent.getReplacedBlockSnapshots()) {<NEW_LINE>final BlockPos snapshotPos = blockSnapshot.getPos();<NEW_LINE>BlockSnapshot originalSnapshot = ((<MASK><NEW_LINE>BlockSnapshot finalSnapshot = ((World) world).createSnapshot(snapshotPos.getX(), snapshotPos.getY(), snapshotPos.getZ());<NEW_LINE>builder.add(new Transaction<>(originalSnapshot, finalSnapshot));<NEW_LINE>}<NEW_LINE>final PhaseContext<?> currentContext = PhaseTracker.getInstance().getCurrentContext();<NEW_LINE>EntityPlayer player = forgeEvent.getPlayer();<NEW_LINE>User owner = currentContext.getOwner().orElse((User) player);<NEW_LINE>User notifier = currentContext.getNotifier().orElse((User) player);<NEW_LINE>if (SpongeImplHooks.isFakePlayer(player)) {<NEW_LINE>frame.addContext(EventContextKeys.FAKE_PLAYER, (Player) player);<NEW_LINE>} else {<NEW_LINE>frame.addContext(EventContextKeys.OWNER, owner);<NEW_LINE>frame.addContext(EventContextKeys.NOTIFIER, notifier);<NEW_LINE>}<NEW_LINE>frame.addContext(EventContextKeys.PLAYER_PLACE, (World) world);<NEW_LINE>final ChangeBlockEvent.Place spongeEvent = SpongeEventFactory.createChangeBlockEventPlace(frame.getCurrentCause(), builder.build());<NEW_LINE>eventData.setSpongeEvent(spongeEvent);<NEW_LINE>eventManager.postEvent(eventData);<NEW_LINE>return spongeEvent;<NEW_LINE>}
ForgeBlockSnapshotBridge_Forge) blockSnapshot).forgeBridge$toSpongeSnapshot();
1,298,245
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>mMapView = findViewById(R.id.mapView);<NEW_LINE>// create a ArcGISMap with basemap streets<NEW_LINE>ArcGISMap map <MASK><NEW_LINE>// set the scale at which this layer can be viewed<NEW_LINE>map.setMinScale(8000);<NEW_LINE>map.setMaxScale(2000);<NEW_LINE>// create a view for this ArcGISMap and set ArcGISMap to it<NEW_LINE>mMapView.setMap(map);<NEW_LINE>// a point where the map view will focus and zoom to<NEW_LINE>mMapView.setViewpoint(new Viewpoint(new Point(-355453, 7548720, SpatialReferences.getWebMercator()), 3000));<NEW_LINE>}
= new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
1,715,657
private static void addDeserializers(SimpleModule module, JsonDeserializer[] replacementJsonDeserializers) {<NEW_LINE>List<JsonDeserializer> jsonDeserializers = // expectation<NEW_LINE>Arrays.// expectation<NEW_LINE>asList(// request<NEW_LINE>new OpenAPIExpectationDTODeserializer(), // times<NEW_LINE>new RequestDefinitionDTODeserializer(), // request body<NEW_LINE>new TimeToLiveDTODeserializer(), // condition<NEW_LINE>new BodyDTODeserializer(), // condition<NEW_LINE>new BodyWithContentTypeDTODeserializer(), // nottable string<NEW_LINE>new VerificationTimesDTODeserializer(), // key and multivalue<NEW_LINE>new NottableStringDeserializer(), new HeadersDeserializer(), new ParametersDeserializer<MASK><NEW_LINE>Map<Class, JsonDeserializer> jsonDeserializersByType = new HashMap<>();<NEW_LINE>for (JsonDeserializer jsonDeserializer : jsonDeserializers) {<NEW_LINE>jsonDeserializersByType.put(jsonDeserializer.handledType(), jsonDeserializer);<NEW_LINE>}<NEW_LINE>// override any existing deserializers<NEW_LINE>for (JsonDeserializer additionJsonDeserializer : replacementJsonDeserializers) {<NEW_LINE>jsonDeserializersByType.put(additionJsonDeserializer.handledType(), additionJsonDeserializer);<NEW_LINE>}<NEW_LINE>for (Map.Entry<Class, JsonDeserializer> additionJsonDeserializer : jsonDeserializersByType.entrySet()) {<NEW_LINE>module.addDeserializer(additionJsonDeserializer.getKey(), additionJsonDeserializer.getValue());<NEW_LINE>}<NEW_LINE>}
(), new CookiesDeserializer());
1,401,172
protected Image resolveIcon() {<NEW_LINE>try {<NEW_LINE>int snapshotType = getLoadedSnapshot().getType();<NEW_LINE>switch(snapshotType) {<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_CPU:<NEW_LINE>return ImageUtilities.mergeImages(CPU_ICON, NODE_BADGE, 0, 0);<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_CPU_JDBC:<NEW_LINE>return ImageUtilities.mergeImages(JDBC_ICON, NODE_BADGE, 0, 0);<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_MEMORY_LIVENESS:<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_MEMORY_ALLOCATIONS:<NEW_LINE>case LoadedSnapshot.SNAPSHOT_TYPE_MEMORY_SAMPLED:<NEW_LINE>return ImageUtilities.mergeImages(<MASK><NEW_LINE>default:<NEW_LINE>// Fallback icon, cannot return null - throws NPE in DataSourceView<NEW_LINE>return ImageUtilities.mergeImages(SNAPSHOT_ICON, NODE_BADGE, 0, 0);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, "Failed to determine profiler snapshot type", e);<NEW_LINE>// Fallback icon, cannot return null - throws NPE in DataSourceView<NEW_LINE>return ImageUtilities.mergeImages(SNAPSHOT_ICON, NODE_BADGE, 0, 0);<NEW_LINE>}<NEW_LINE>}
MEMORY_ICON, NODE_BADGE, 0, 0);
417,672
public void drawSheared(float x, float y, float hshear, float vshear, Color filter) {<NEW_LINE>if (alpha != 1) {<NEW_LINE>if (filter == null) {<NEW_LINE>filter = Color.white;<NEW_LINE>}<NEW_LINE>filter = new Color(filter);<NEW_LINE>filter.a *= alpha;<NEW_LINE>}<NEW_LINE>if (filter != null) {<NEW_LINE>filter.bind();<NEW_LINE>}<NEW_LINE>texture.bind();<NEW_LINE>GL.glTranslatef(x, y, 0);<NEW_LINE>if (angle != 0) {<NEW_LINE>GL.glTranslatef(centerX, centerY, 0.0f);<NEW_LINE>GL.glRotatef(angle, 0.0f, 0.0f, 1.0f);<NEW_LINE>GL.glTranslatef(-centerX, -centerY, 0.0f);<NEW_LINE>}<NEW_LINE>GL.glBegin(SGL.GL_QUADS);<NEW_LINE>init();<NEW_LINE>GL.glTexCoord2f(textureOffsetX, textureOffsetY);<NEW_LINE>GL.glVertex3f(0, 0, 0);<NEW_LINE>GL.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);<NEW_LINE>GL.glVertex3f(hshear, height, 0);<NEW_LINE>GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY + textureHeight);<NEW_LINE>GL.glVertex3f(width + hshear, height + vshear, 0);<NEW_LINE>GL.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY);<NEW_LINE>GL.glVertex3f(width, vshear, 0);<NEW_LINE>GL.glEnd();<NEW_LINE>if (angle != 0) {<NEW_LINE>GL.glTranslatef(centerX, centerY, 0.0f);<NEW_LINE>GL.glRotatef(-angle, 0.0f, 0.0f, 1.0f);<NEW_LINE>GL.glTranslatef(<MASK><NEW_LINE>}<NEW_LINE>GL.glTranslatef(-x, -y, 0);<NEW_LINE>}
-centerX, -centerY, 0.0f);
1,689,584
private void logTimes(long startTime, String sourceIP, long renderStartTime, long commitStartTime, long endTime, String req, String normalizedQuery, Timing t) {<NEW_LINE>// note: intentionally only taking time since request was received<NEW_LINE>long totalTime = endTime - startTime;<NEW_LINE>long timeoutInterval = Long.MAX_VALUE;<NEW_LINE>long requestOverhead = 0;<NEW_LINE>long summaryStartTime = 0;<NEW_LINE>if (t != null) {<NEW_LINE>timeoutInterval = t.getTimeout();<NEW_LINE>long queryStartTime = t.getQueryStartTime();<NEW_LINE>if (queryStartTime > 0) {<NEW_LINE>requestOverhead = queryStartTime - startTime;<NEW_LINE>}<NEW_LINE>summaryStartTime = t.getSummaryStartTime();<NEW_LINE>}<NEW_LINE>if (totalTime <= timeoutInterval) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>b.append(normalizedQuery);<NEW_LINE>b.append(" from ").append(sourceIP).append(". ");<NEW_LINE>if (requestOverhead > 0) {<NEW_LINE>b.append("Time from HTTP connection open to request reception ");<NEW_LINE>b.append(requestOverhead).append(" ms. ");<NEW_LINE>}<NEW_LINE>if (summaryStartTime != 0) {<NEW_LINE>b.append("Request time: ");<NEW_LINE>b.append(summaryStartTime - startTime).append(" ms. ");<NEW_LINE>b.append("Summary fetch time: ");<NEW_LINE>b.append(renderStartTime - summaryStartTime).append(" ms. ");<NEW_LINE>} else {<NEW_LINE>long spentSearching = renderStartTime - startTime;<NEW_LINE>b.append("Processing time: ").append(spentSearching).append(" ms. ");<NEW_LINE>}<NEW_LINE>b.append("Result rendering/transfer: ");<NEW_LINE>b.append(commitStartTime <MASK><NEW_LINE>b.append("End transaction: ");<NEW_LINE>b.append(endTime - commitStartTime).append(" ms. ");<NEW_LINE>b.append("Total: ").append(totalTime).append(" ms. ");<NEW_LINE>b.append("Timeout: ").append(timeoutInterval).append(" ms. ");<NEW_LINE>b.append("Request string: ").append(req);<NEW_LINE>log.log(Level.WARNING, "Slow execution. " + b);<NEW_LINE>}
- renderStartTime).append(" ms. ");
366,994
public static <C> SuiteImpacts newInstance(CheckSuite<C> suite, C checkable) {<NEW_LINE>final List<Check<C>> checks = suite.getChecks();<NEW_LINE>final int nb = checks.size();<NEW_LINE>// Build names & weights<NEW_LINE>String[] names = new String[nb];<NEW_LINE>double[] weights = new double[nb];<NEW_LINE>for (int i = 0; i < nb; i++) {<NEW_LINE>Check check = checks.get(i);<NEW_LINE>names[<MASK><NEW_LINE>weights[i] = suite.getWeights().get(i);<NEW_LINE>}<NEW_LINE>SuiteImpacts impacts = new SuiteImpacts(names, weights, suite.getName());<NEW_LINE>try {<NEW_LINE>// Populate impacts with check results on checkable entity<NEW_LINE>suite.pass(checkable, impacts);<NEW_LINE>return impacts;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.warn("Error computing SuiteImpacts on " + checkable, ex);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
i] = check.getName();
1,480,913
public static CreateSiteMonitorResponse unmarshall(CreateSiteMonitorResponse createSiteMonitorResponse, UnmarshallerContext _ctx) {<NEW_LINE>createSiteMonitorResponse.setRequestId(_ctx.stringValue("CreateSiteMonitorResponse.RequestId"));<NEW_LINE>createSiteMonitorResponse.setCode(_ctx.stringValue("CreateSiteMonitorResponse.Code"));<NEW_LINE>createSiteMonitorResponse.setMessage(_ctx.stringValue("CreateSiteMonitorResponse.Message"));<NEW_LINE>createSiteMonitorResponse.setSuccess(_ctx.stringValue("CreateSiteMonitorResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<Contact> attachAlertResult = new ArrayList<Contact>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateSiteMonitorResponse.Data.AttachAlertResult.Length"); i++) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setCode(_ctx.stringValue("CreateSiteMonitorResponse.Data.AttachAlertResult[" + i + "].Code"));<NEW_LINE>contact.setMessage(_ctx.stringValue("CreateSiteMonitorResponse.Data.AttachAlertResult[" + i + "].Message"));<NEW_LINE>contact.setRequestId(_ctx.stringValue("CreateSiteMonitorResponse.Data.AttachAlertResult[" + i + "].RequestId"));<NEW_LINE>contact.setSuccess(_ctx.stringValue("CreateSiteMonitorResponse.Data.AttachAlertResult[" + i + "].Success"));<NEW_LINE>contact.setRuleId(_ctx.stringValue("CreateSiteMonitorResponse.Data.AttachAlertResult[" + i + "].RuleId"));<NEW_LINE>attachAlertResult.add(contact);<NEW_LINE>}<NEW_LINE>data.setAttachAlertResult(attachAlertResult);<NEW_LINE>createSiteMonitorResponse.setData(data);<NEW_LINE>List<CreateResultListItem> createResultList = new ArrayList<CreateResultListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateSiteMonitorResponse.CreateResultList.Length"); i++) {<NEW_LINE>CreateResultListItem createResultListItem = new CreateResultListItem();<NEW_LINE>createResultListItem.setTaskId(_ctx.stringValue("CreateSiteMonitorResponse.CreateResultList[" + i + "].TaskId"));<NEW_LINE>createResultListItem.setTaskName(_ctx.stringValue<MASK><NEW_LINE>createResultList.add(createResultListItem);<NEW_LINE>}<NEW_LINE>createSiteMonitorResponse.setCreateResultList(createResultList);<NEW_LINE>return createSiteMonitorResponse;<NEW_LINE>}
("CreateSiteMonitorResponse.CreateResultList[" + i + "].TaskName"));
1,012,305
public static void dense3x3(final GrayU8 input, final GrayU8 output) {<NEW_LINE>final int height = input.height - 1;<NEW_LINE>final byte[] src = input.data;<NEW_LINE>// pre-compute offsets to pixels. row-major starting from upper row<NEW_LINE>final int offset0 = -input.stride - 1;<NEW_LINE>final int offset1 = -input.stride;<NEW_LINE>final int offset2 = -input.stride + 1;<NEW_LINE>final int offset3 = -1;<NEW_LINE>final int offset5 = +1;<NEW_LINE>final int offset6 = input.stride - 1;<NEW_LINE>final int offset7 = input.stride;<NEW_LINE>final int offset8 = input.stride + 1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int indexSrc = input.startIndex <MASK><NEW_LINE>int indexDst = output.startIndex + y * output.stride + 1;<NEW_LINE>final int end = indexDst + input.width - 2;<NEW_LINE>// for (int x = 1; x < width-1; x++) {<NEW_LINE>while (indexDst < end) {<NEW_LINE>int center = src[indexSrc] & 0xFF;<NEW_LINE>int census = 0;<NEW_LINE>if ((src[indexSrc + offset0] & 0xFF) > center)<NEW_LINE>census |= 0x01;<NEW_LINE>if ((src[indexSrc + offset1] & 0xFF) > center)<NEW_LINE>census |= 0x02;<NEW_LINE>if ((src[indexSrc + offset2] & 0xFF) > center)<NEW_LINE>census |= 0x04;<NEW_LINE>if ((src[indexSrc + offset3] & 0xFF) > center)<NEW_LINE>census |= 0x08;<NEW_LINE>if ((src[indexSrc + offset5] & 0xFF) > center)<NEW_LINE>census |= 0x10;<NEW_LINE>if ((src[indexSrc + offset6] & 0xFF) > center)<NEW_LINE>census |= 0x20;<NEW_LINE>if ((src[indexSrc + offset7] & 0xFF) > center)<NEW_LINE>census |= 0x40;<NEW_LINE>if ((src[indexSrc + offset8] & 0xFF) > center)<NEW_LINE>census |= 0x80;<NEW_LINE>output.data[indexDst] = (byte) census;<NEW_LINE>indexDst++;<NEW_LINE>indexSrc++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
+ y * input.stride + 1;
210,650
public void marshall(RunJobFlowRequest runJobFlowRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (runJobFlowRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getLogUri(), LOGURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getLogEncryptionKmsKeyId(), LOGENCRYPTIONKMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getAdditionalInfo(), ADDITIONALINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getAmiVersion(), AMIVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getReleaseLabel(), RELEASELABEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getInstances(), INSTANCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getSteps(), STEPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getBootstrapActions(), BOOTSTRAPACTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getSupportedProducts(), SUPPORTEDPRODUCTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getNewSupportedProducts(), NEWSUPPORTEDPRODUCTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getApplications(), APPLICATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getConfigurations(), CONFIGURATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getVisibleToAllUsers(), VISIBLETOALLUSERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getJobFlowRole(), JOBFLOWROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getServiceRole(), SERVICEROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getSecurityConfiguration(), SECURITYCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getScaleDownBehavior(), SCALEDOWNBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getCustomAmiId(), CUSTOMAMIID_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getEbsRootVolumeSize(), EBSROOTVOLUMESIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getRepoUpgradeOnBoot(), REPOUPGRADEONBOOT_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getKerberosAttributes(), KERBEROSATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getStepConcurrencyLevel(), STEPCONCURRENCYLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getManagedScalingPolicy(), MANAGEDSCALINGPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getPlacementGroupConfigs(), PLACEMENTGROUPCONFIGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(runJobFlowRequest.getAutoTerminationPolicy(), AUTOTERMINATIONPOLICY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
runJobFlowRequest.getAutoScalingRole(), AUTOSCALINGROLE_BINDING);
636,525
private synchronized void createGroupIfNecessary(SelectionContext<C> context, Executor executor) {<NEW_LINE>ResourceGroupId id = context.getResourceGroupId();<NEW_LINE>if (!groups.containsKey(id)) {<NEW_LINE>InternalResourceGroup group;<NEW_LINE>if (id.getParent().isPresent()) {<NEW_LINE>createGroupIfNecessary(configurationManager.get()<MASK><NEW_LINE>InternalResourceGroup parent = groups.get(id.getParent().get());<NEW_LINE>requireNonNull(parent, "parent is null");<NEW_LINE>group = parent.getOrCreateSubGroup(id.getLastSegment());<NEW_LINE>} else {<NEW_LINE>InternalResourceGroup root = new InternalResourceGroup(id.getSegments().get(0), this::exportGroup, executor);<NEW_LINE>group = root;<NEW_LINE>rootGroups.add(root);<NEW_LINE>}<NEW_LINE>configurationManager.get().configure(group, context);<NEW_LINE>checkState(groups.put(id, group) == null, "Unexpected existing resource group");<NEW_LINE>}<NEW_LINE>}
.parentGroupContext(context), executor);
168,467
void mergeRealms(OsAccountRealm sourceRealm, OsAccountRealm destRealm, CaseDbTransaction trans) throws TskCoreException {<NEW_LINE>// Update accounts<NEW_LINE>db.getOsAccountManager().mergeOsAccountsForRealms(sourceRealm, destRealm, trans);<NEW_LINE>// Update the sourceRealm realm<NEW_LINE>CaseDbConnection connection = trans.getConnection();<NEW_LINE>try (Statement statement = connection.createStatement()) {<NEW_LINE>String updateStr = "UPDATE tsk_os_account_realms SET db_status = " + OsAccountRealm.RealmDbStatus.MERGED.getId() + ", merged_into = " + destRealm.getRealmId() + ", realm_signature = '" + makeMergedRealmSignature() + "' " + " WHERE id = " + sourceRealm.getRealmId();<NEW_LINE>connection.executeUpdate(statement, updateStr);<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw new TskCoreException("Error updating status of realm with id: " + sourceRealm.getRealmId(), ex);<NEW_LINE>}<NEW_LINE>// Update the destination realm if it doesn't have the name or addr set and the source realm does<NEW_LINE>if (!destRealm.getRealmAddr().isPresent() && sourceRealm.getRealmAddr().isPresent()) {<NEW_LINE>updateRealm(destRealm, sourceRealm.getRealmAddr().get(), <MASK><NEW_LINE>} else if (destRealm.getRealmNames().isEmpty() && !sourceRealm.getRealmNames().isEmpty()) {<NEW_LINE>updateRealm(destRealm, null, sourceRealm.getRealmNames().get(0), trans.getConnection());<NEW_LINE>}<NEW_LINE>}
null, trans.getConnection());
809,032
public static CodegenExpression codegen(ExprNewStructNodeForge forge, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChild(EPTypePremade.MAP.getEPType(), ExprNewStructNodeForgeEval.class, codegenClassScope);<NEW_LINE>CodegenBlock block = methodNode.getBlock().declareVar(EPTypePremade.MAP.getEPType(), "props", newInstance(EPTypePremade.HASHMAP.getEPType()));<NEW_LINE>ExprNode[] nodes = forge.getForgeRenderable().getChildNodes();<NEW_LINE>String[] columnNames = forge.getForgeRenderable().getColumnNames();<NEW_LINE>for (int i = 0; i < nodes.length; i++) {<NEW_LINE>ExprForge child = nodes[i].getForge();<NEW_LINE>block.exprDotMethod(ref("props"), "put", constant(columnNames[i]), child.evaluateCodegen(EPTypePremade.OBJECT.getEPType(), methodNode, exprSymbol, codegenClassScope));<NEW_LINE>}<NEW_LINE>block<MASK><NEW_LINE>return localMethod(methodNode);<NEW_LINE>}
.methodReturn(ref("props"));
972,964
public boolean handleFacadeClick(@Nonnull World world1, @Nonnull BlockPos placeAt, @Nonnull EntityPlayer player, @Nonnull EnumFacing opposite, @Nonnull ItemStack stack, @Nonnull EnumHand hand, float hitX, float hitY, float hitZ) {<NEW_LINE>// Add facade<NEW_LINE>if (player.isSneaking()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>IBlockState facadeID = PaintUtil.getSourceBlock(player.getHeldItem(hand));<NEW_LINE>if (facadeID == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int facadeType1 = player.getHeldItem(hand).getItemDamage();<NEW_LINE>if (hasFacade()) {<NEW_LINE>if (!YetaUtil.isSolidFacadeRendered(this, player) || facadeEquals(facadeID, facadeType1)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!world.isRemote && !player.capabilities.isCreativeMode) {<NEW_LINE>ItemStack drop = new ItemStack(ModObject.itemConduitFacade.getItemNN(), 1, EnumFacadeType<MASK><NEW_LINE>PaintUtil.setSourceBlock(drop, getPaintSource());<NEW_LINE>if (!player.inventory.addItemStackToInventory(drop)) {<NEW_LINE>ItemUtil.spawnItemInWorldWithRandomMotion(world, drop, pos, hitX, hitY, hitZ, 1.2f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setFacadeType(EnumFacadeType.getTypeFromMeta(facadeType1));<NEW_LINE>setPaintSource(facadeID);<NEW_LINE>if (!world.isRemote) {<NEW_LINE>ConduitUtil.playPlaceSound(facadeID.getBlock().getSoundType(), world, pos);<NEW_LINE>}<NEW_LINE>if (!player.capabilities.isCreativeMode) {<NEW_LINE>stack.shrink(1);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.getMetaFromType(getFacadeType()));
1,846,590
private void updateSearchViewState(boolean enter) {<NEW_LINE>int hide = enter ? View.GONE : View.VISIBLE;<NEW_LINE>listView.setVisibility(hide);<NEW_LINE>searchListView.setVisibility(enter ? View.VISIBLE : View.GONE);<NEW_LINE>searchItem.getSearchContainer().setVisibility(enter ? View.VISIBLE : View.GONE);<NEW_LINE>actionBar.onSearchFieldVisibilityChanged(enter);<NEW_LINE>avatarContainer.setVisibility(hide);<NEW_LINE>nameTextView<MASK><NEW_LINE>onlineTextView[1].setVisibility(hide);<NEW_LINE>idTextView.setVisibility(hide);<NEW_LINE>if (otherItem != null) {<NEW_LINE>otherItem.setAlpha(1f);<NEW_LINE>otherItem.setVisibility(hide);<NEW_LINE>}<NEW_LINE>// if (qrItem != null) {<NEW_LINE>// qrItem.setAlpha(1f);<NEW_LINE>// qrItem.setVisibility(enter || !isQrNeedVisible() ? View.GONE : View.VISIBLE);<NEW_LINE>// }<NEW_LINE>searchItem.setVisibility(hide);<NEW_LINE>avatarContainer.setAlpha(1f);<NEW_LINE>nameTextView[1].setAlpha(1f);<NEW_LINE>onlineTextView[1].setAlpha(1f);<NEW_LINE>idTextView.setAlpha(1f);<NEW_LINE>searchItem.setAlpha(1f);<NEW_LINE>listView.setAlpha(1f);<NEW_LINE>searchListView.setAlpha(1f);<NEW_LINE>emptyView.setAlpha(1f);<NEW_LINE>if (enter) {<NEW_LINE>searchListView.setEmptyView(emptyView);<NEW_LINE>} else {<NEW_LINE>emptyView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
[1].setVisibility(hide);
877,020
private static void constructActionGraphAndArtifactList(ListeningExecutorService executorService, MutableActionGraph actionGraph, ConcurrentMap<String, Object> pathFragmentTrieRoot, Sharder<ActionLookupValue> actionLookupValues, boolean strictConflictChecks, ConcurrentMap<ActionAnalysisMetadata, ConflictException> badActionMap) throws InterruptedException {<NEW_LINE>// The max number of shards is NUM_JOBS.<NEW_LINE>List<ListenableFuture<Void>> futures = new ArrayList<>(NUM_JOBS);<NEW_LINE>for (List<ActionLookupValue> shard : actionLookupValues) {<NEW_LINE>futures.add(executorService.submit(() -> actionRegistration(shard, actionGraph, pathFragmentTrieRoot, strictConflictChecks, badActionMap)));<NEW_LINE>}<NEW_LINE>// Now wait on the futures.<NEW_LINE>try {<NEW_LINE>Futures.whenAllComplete(futures).call(() -> null, directExecutor()).get();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new IllegalStateException("Unexpected exception", e);
1,217,521
public void loadDynamicClasses() {<NEW_LINE>final ArrayList<SootClass> dynamicClasses = new ArrayList<>();<NEW_LINE>final Options opts = Options.v();<NEW_LINE>final Map<String, List<String>> temp = new HashMap<>();<NEW_LINE>temp.put(null, opts.dynamic_class());<NEW_LINE>final <MASK><NEW_LINE>for (String path : opts.dynamic_dir()) {<NEW_LINE>temp.putAll(msloc.getClassUnderModulePath(path));<NEW_LINE>}<NEW_LINE>final SourceLocator sloc = SourceLocator.v();<NEW_LINE>for (String pkg : opts.dynamic_package()) {<NEW_LINE>temp.get(null).addAll(sloc.classesInDynamicPackage(pkg));<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, List<String>> entry : temp.entrySet()) {<NEW_LINE>for (String className : entry.getValue()) {<NEW_LINE>dynamicClasses.add(loadClassAndSupport(className, Optional.fromNullable(entry.getKey())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remove non-concrete classes that may accidentally have been loaded<NEW_LINE>for (Iterator<SootClass> iterator = dynamicClasses.iterator(); iterator.hasNext(); ) {<NEW_LINE>SootClass c = iterator.next();<NEW_LINE>if (!c.isConcrete()) {<NEW_LINE>if (opts.verbose()) {<NEW_LINE>logger.warn("dynamic class " + c.getName() + " is abstract or an interface, and it will not be considered.");<NEW_LINE>}<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.dynamicClasses = dynamicClasses;<NEW_LINE>}
ModulePathSourceLocator msloc = ModulePathSourceLocator.v();
337,639
public void snapShort(StringBuilder strBuff, boolean includeZero) {<NEW_LINE>strBuff.append("\"").append(getFullName()).append("\":").append("{\"").append(this.count.getShortName()).append("\":").append(this.count.getAndResetValue()).append(",\"").append(this.min.getShortName()).append("\":").append(this.min.getAndResetValue()).append(",\"").append(this.max.getShortName()).append("\":").append(this.max.getAndResetValue<MASK><NEW_LINE>int count = 0;<NEW_LINE>if (includeZero) {<NEW_LINE>for (int i = 0; i < NUM_BUCKETS; i++) {<NEW_LINE>if (count++ > 0) {<NEW_LINE>strBuff.append(",");<NEW_LINE>}<NEW_LINE>strBuff.append("\"").append(this.buckets[i].getShortName()).append("\":").append(this.buckets[i].getAndResetValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>long tmpValue;<NEW_LINE>for (int i = 0; i < NUM_BUCKETS; i++) {<NEW_LINE>tmpValue = this.buckets[i].getAndResetValue();<NEW_LINE>if (tmpValue > 0) {<NEW_LINE>if (count++ > 0) {<NEW_LINE>strBuff.append(",");<NEW_LINE>}<NEW_LINE>strBuff.append("\"").append(this.buckets[i].getShortName()).append("\":").append(tmpValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>strBuff.append("}}");<NEW_LINE>}
()).append(",\"cells\":{");
1,076,091
private void meetingStarted(MeetingStarted message) {<NEW_LINE>Meeting <MASK><NEW_LINE>if (m != null) {<NEW_LINE>if (m.getStartTime() == 0) {<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>m.setStartTime(now);<NEW_LINE>Map<String, Object> logData = new HashMap<>();<NEW_LINE>logData.put("meetingId", m.getInternalId());<NEW_LINE>logData.put("externalMeetingId", m.getExternalId());<NEW_LINE>if (m.isBreakout()) {<NEW_LINE>logData.put("parentMeetingId", m.getParentMeetingId());<NEW_LINE>}<NEW_LINE>logData.put("name", m.getName());<NEW_LINE>logData.put("duration", m.getDuration());<NEW_LINE>logData.put("record", m.isRecord());<NEW_LINE>logData.put("isBreakout", m.isBreakout());<NEW_LINE>logData.put("logCode", "meeting_started");<NEW_LINE>logData.put("description", "Meeting has started.");<NEW_LINE>Gson gson = new Gson();<NEW_LINE>String logStr = gson.toJson(logData);<NEW_LINE>log.info(" --analytics-- data={}", logStr);<NEW_LINE>} else {<NEW_LINE>Map<String, Object> logData = new HashMap<>();<NEW_LINE>logData.put("meetingId", m.getInternalId());<NEW_LINE>logData.put("externalMeetingId", m.getExternalId());<NEW_LINE>if (m.isBreakout()) {<NEW_LINE>logData.put("parentMeetingId", m.getParentMeetingId());<NEW_LINE>}<NEW_LINE>logData.put("name", m.getName());<NEW_LINE>logData.put("duration", m.getDuration());<NEW_LINE>logData.put("record", m.isRecord());<NEW_LINE>logData.put("isBreakout", m.isBreakout());<NEW_LINE>logData.put("logCode", "meeting_restarted");<NEW_LINE>logData.put("description", "Meeting has restarted.");<NEW_LINE>Gson gson = new Gson();<NEW_LINE>String logStr = gson.toJson(logData);<NEW_LINE>log.info(" --analytics-- data={}", logStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
m = getMeeting(message.meetingId);
808,477
public AutoMLOutputDataConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AutoMLOutputDataConfig autoMLOutputDataConfig = new AutoMLOutputDataConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("KmsKeyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>autoMLOutputDataConfig.setKmsKeyId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("S3OutputPath", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>autoMLOutputDataConfig.setS3OutputPath(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return autoMLOutputDataConfig;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,271,462
// int version - includes support for beyond 16 bit chars.<NEW_LINE>public static boolean int_isUcsChar(int ch) {<NEW_LINE>// RFC 3987<NEW_LINE>// ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF<NEW_LINE>// / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD<NEW_LINE>// / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD<NEW_LINE>// / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD<NEW_LINE>// / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD<NEW_LINE>// / %xD0000-DFFFD / %xE1000-EFFFD<NEW_LINE>boolean b = range(ch, 0xA0, 0xD7FF) || range(ch, 0xF900, 0xFDCF) || range(ch, 0xFDF0, 0xFFEF);<NEW_LINE>if (b)<NEW_LINE>return true;<NEW_LINE>if (ch < 0x10000)<NEW_LINE>return false;<NEW_LINE>// 32 bit checks.<NEW_LINE>return range(ch, 0x10000, 0x1FFFD) || range(ch, 0x20000, 0x2FFFD) || range(ch, 0x30000, 0x3FFFD) || range(ch, 0x40000, 0x4FFFD) || range(ch, 0x50000, 0x5FFFD) || range(ch, 0x60000, 0x6FFFD) || range(ch, 0x70000, 0x7FFFD) || range(ch, 0x80000, 0x8FFFD) || range(ch, 0x90000, 0x9FFFD) || range(ch, 0xA0000, 0xAFFFD) || range(ch, 0xB0000, 0xBFFFD) || range(ch, 0xC0000, 0xCFFFD) || range(ch, 0xD0000, 0xDFFFD) || <MASK><NEW_LINE>}
range(ch, 0xE1000, 0xEFFFD);
4,063
public static com.trilead.ssh2.Connection acquireAuthorizedConnection(String ip, int port, String username, String password, String privateKey) {<NEW_LINE>com.trilead.ssh2.Connection sshConnection = new com.trilead.ssh2.Connection(ip, port);<NEW_LINE>try {<NEW_LINE>sshConnection.connect(null, DEFAULT_CONNECT_TIMEOUT, DEFAULT_KEX_TIMEOUT);<NEW_LINE>if (acquireAuthorizedConnectionWithPublicKey(sshConnection, username, privateKey)) {<NEW_LINE>return sshConnection;<NEW_LINE>}<NEW_LINE>;<NEW_LINE>sshConnection = new com.trilead.<MASK><NEW_LINE>sshConnection.connect(null, DEFAULT_CONNECT_TIMEOUT, DEFAULT_KEX_TIMEOUT);<NEW_LINE>if (!sshConnection.authenticateWithPassword(username, password)) {<NEW_LINE>String[] methods = sshConnection.getRemainingAuthMethods(username);<NEW_LINE>StringBuffer mStr = new StringBuffer();<NEW_LINE>for (int i = 0; i < methods.length; i++) {<NEW_LINE>mStr.append(methods[i]);<NEW_LINE>}<NEW_LINE>s_logger.warn("SSH authorizes failed, support authorized methods are " + mStr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return sshConnection;<NEW_LINE>} catch (IOException e) {<NEW_LINE>s_logger.warn("Get SSH connection failed", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
ssh2.Connection(ip, port);
1,249,507
public static boolean isKeyRegistered(Long userId, PublicKey publicKey) throws SQLException, GeneralSecurityException {<NEW_LINE>boolean isDuplicate = false;<NEW_LINE>Connection con = DBUtils.getConn();<NEW_LINE>PreparedStatement stmt = con.prepareStatement("select * from public_keys where user_id=? and fingerprint like ? and profile_id = ? and id <> ?");<NEW_LINE>stmt.setLong(1, userId);<NEW_LINE>stmt.setString(2, SSHUtil.getFingerprint(publicKey.getPublicKey()));<NEW_LINE>if (publicKey.getProfile() != null && publicKey.getProfile().getId() != null) {<NEW_LINE>stmt.setLong(3, publicKey.getProfile().getId());<NEW_LINE>} else {<NEW_LINE>stmt.setNull(3, Types.NULL);<NEW_LINE>}<NEW_LINE>if (publicKey.getId() != null) {<NEW_LINE>stmt.setLong(4, publicKey.getId());<NEW_LINE>} else {<NEW_LINE>stmt.setNull(4, Types.NULL);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (rs.next()) {<NEW_LINE>isDuplicate = true;<NEW_LINE>}<NEW_LINE>DBUtils.closeRs(rs);<NEW_LINE>DBUtils.closeStmt(stmt);<NEW_LINE>DBUtils.closeConn(con);<NEW_LINE>return isDuplicate;<NEW_LINE>}
ResultSet rs = stmt.executeQuery();
234,378
public void mouseDragged(MouseEvent me) {<NEW_LINE>// Get new mouse coordinates<NEW_LINE>if (selector.isSelectorFrameActive()) {<NEW_LINE>selector.getSelectorFrame().resizeTo(getOffset(me).getX(), getOffset(me).getY());<NEW_LINE>disableElementMovement = true;<NEW_LINE>return;<NEW_LINE>} else if (disableElementMovement()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Point off = getOffset(me);<NEW_LINE>int xNewOffset = off.x;<NEW_LINE>int yNewOffset = off.y;<NEW_LINE>int gridSize = CurrentDiagram.getInstance().getDiagramHandler().getGridSize();<NEW_LINE>new_x_eff = gridSize * ((xNewOffset - gridSize / 2) / gridSize);<NEW_LINE>new_y_eff = gridSize * ((yNewOffset - gridSize / 2) / gridSize);<NEW_LINE>old_x_eff = gridSize * ((_xOffset <MASK><NEW_LINE>old_y_eff = gridSize * ((_yOffset - gridSize / 2) / gridSize);<NEW_LINE>_xOffset = xNewOffset;<NEW_LINE>_yOffset = yNewOffset;<NEW_LINE>}
- gridSize / 2) / gridSize);
45,297
public Object execute(ExecuteCommandContext context) {<NEW_LINE>String documentUri = "";<NEW_LINE>VersionedTextDocumentIdentifier textDocumentIdentifier = new VersionedTextDocumentIdentifier();<NEW_LINE>for (CommandArgument arg : context.getArguments()) {<NEW_LINE>if (CommandConstants.ARG_KEY_DOC_URI.equals(arg.key())) {<NEW_LINE>documentUri = arg.valueAs(String.class);<NEW_LINE>textDocumentIdentifier.setUri(documentUri);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Optional<Path> filePath = CommonUtil.getPathFromURI(documentUri);<NEW_LINE>if (filePath.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>SyntaxTree syntaxTree = context.workspace().syntaxTree(filePath.get()).orElseThrow();<NEW_LINE>List<TextEdit> <MASK><NEW_LINE>((ModulePartNode) syntaxTree.rootNode()).members().stream().filter(node -> !hasDocs(node)).forEach(member -> getDocumentationEditForNode(member, syntaxTree).ifPresent(docs -> textEdits.add(getTextEdit(docs))));<NEW_LINE>TextDocumentEdit textDocumentEdit = new TextDocumentEdit(textDocumentIdentifier, textEdits);<NEW_LINE>LanguageClient languageClient = context.getLanguageClient();<NEW_LINE>return applyWorkspaceEdit(Collections.singletonList(Either.forLeft(textDocumentEdit)), languageClient);<NEW_LINE>}
textEdits = new ArrayList<>();
49,924
public static ValueNode canonicalizeRead(ValueNode read, CanonicalizerTool tool, JavaKind accessKind, ValueNode object, ValueNode offset, LocationIdentity locationIdentity) {<NEW_LINE>if (!tool.canonicalizeReads()) {<NEW_LINE>return read;<NEW_LINE>}<NEW_LINE>NodeView view = NodeView.from(tool);<NEW_LINE>Stamp resultStamp = read.stamp(view);<NEW_LINE>if (!resultStamp.isCompatible(StampFactory.forKind(accessKind))) {<NEW_LINE>return read;<NEW_LINE>}<NEW_LINE>Stamp accessStamp = resultStamp;<NEW_LINE>switch(accessKind) {<NEW_LINE>case Boolean:<NEW_LINE>case Byte:<NEW_LINE>accessStamp = IntegerStamp.OPS.getNarrow().foldStamp(32, 8, accessStamp);<NEW_LINE>break;<NEW_LINE>case Char:<NEW_LINE>case Short:<NEW_LINE>accessStamp = IntegerStamp.OPS.getNarrow().foldStamp(32, 16, accessStamp);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>ValueNode result = ReadNode.canonicalizeRead(read, accessStamp, object, <MASK><NEW_LINE>if (result.isJavaConstant() && accessKind == JavaKind.Char) {<NEW_LINE>PrimitiveStamp primitiveStamp = (PrimitiveStamp) result.stamp(NodeView.DEFAULT);<NEW_LINE>result = NarrowNode.create(result, primitiveStamp.getBits(), accessKind.getBitCount(), view);<NEW_LINE>return ZeroExtendNode.create(result, primitiveStamp.getBits(), NodeView.DEFAULT);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
offset, locationIdentity, tool, view);
1,142,484
final GetOrderResult executeGetOrder(GetOrderRequest getOrderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getOrderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetOrderRequest> request = null;<NEW_LINE>Response<GetOrderResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetOrderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getOrderRequest));<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, "Outposts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetOrder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetOrderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetOrderResultJsonUnmarshaller());<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);
297,250
public void marshall(GetReservationCoverageRequest getReservationCoverageRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (getReservationCoverageRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(getReservationCoverageRequest.getGroupBy(), GROUPBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(getReservationCoverageRequest.getGranularity(), GRANULARITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(getReservationCoverageRequest.getFilter(), FILTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(getReservationCoverageRequest.getMetrics(), METRICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(getReservationCoverageRequest.getNextPageToken(), NEXTPAGETOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(getReservationCoverageRequest.getSortBy(), SORTBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(getReservationCoverageRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
getReservationCoverageRequest.getTimePeriod(), TIMEPERIOD_BINDING);
1,200,066
public ListenerDeclarationNode transform(ListenerDeclarationNode listenerDeclarationNode) {<NEW_LINE>Token visibilityQualifier = formatToken(listenerDeclarationNode.visibilityQualifier().orElse(null), 1, 0);<NEW_LINE>MetadataNode metadata = formatNode(listenerDeclarationNode.metadata().orElse(null), 0, 1);<NEW_LINE>Token listenerKeyword = formatToken(listenerDeclarationNode.listenerKeyword(), 1, 0);<NEW_LINE>TypeDescriptorNode typeDescriptor = formatNode(listenerDeclarationNode.typeDescriptor().orElse(null), 1, 0);<NEW_LINE>Token variableName = formatToken(listenerDeclarationNode.variableName(), 1, 0);<NEW_LINE>Token equalsToken = formatToken(listenerDeclarationNode.equalsToken(), 1, 0);<NEW_LINE>Node initializer = formatNode(listenerDeclarationNode.initializer(), 0, 0);<NEW_LINE>Token semicolonToken = formatToken(listenerDeclarationNode.semicolonToken(), env.trailingWS, env.trailingNL);<NEW_LINE>return listenerDeclarationNode.modify().withMetadata(metadata).withVisibilityQualifier(visibilityQualifier).withListenerKeyword(listenerKeyword).withTypeDescriptor(typeDescriptor).withVariableName(variableName).withEqualsToken(equalsToken).withInitializer(initializer).<MASK><NEW_LINE>}
withSemicolonToken(semicolonToken).apply();
1,249,146
private void scheduleReceiveBatteryLevel() {<NEW_LINE>BroadcastReceiver recv;<NEW_LINE>if (mBatteryLevelRecvRef == null || (recv = mBatteryLevelRecvRef.get()) == null) {<NEW_LINE>if (mBatteryStatusRecvRef == null || (recv = mBatteryStatusRecvRef.get()) == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Intent intent = new Intent("android.intent.action.BATTERY_CHANGED");<NEW_LINE>intent.putExtra(BatteryManager.EXTRA_LEVEL, lastFakeLevel = getFakeBatteryCapacity());<NEW_LINE>intent.putExtra(BatteryManager.EXTRA_SCALE, 100);<NEW_LINE>intent.putExtra(BatteryManager.EXTRA_PRESENT, true);<NEW_LINE>intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, "Li-ion");<NEW_LINE>if (isFakeBatteryCharging()) {<NEW_LINE>intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING);<NEW_LINE>intent.putExtra(<MASK><NEW_LINE>} else {<NEW_LINE>intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_DISCHARGING);<NEW_LINE>intent.putExtra(BatteryManager.EXTRA_PLUGGED, 0);<NEW_LINE>}<NEW_LINE>doPostReceiveEvent(recv, HostInfo.getApplication(), intent);<NEW_LINE>}
BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_AC);
184,113
protected String doIt() throws Exception {<NEW_LINE>int to_ID = super.getRecord_ID();<NEW_LINE>log.info("From PA_ReportColumnSet_ID=" + m_PA_ReportColumnSet_ID + ", To=" + to_ID);<NEW_LINE>if (to_ID < 1)<NEW_LINE>throw new Exception(MSG_SaveErrorRowNotFound);<NEW_LINE>//<NEW_LINE>MReportColumnSet to = new MReportColumnSet(getCtx(), to_ID, get_TrxName());<NEW_LINE>MReportColumnSet rcSet = new MReportColumnSet(getCtx(<MASK><NEW_LINE>MReportColumn[] rcs = rcSet.getColumns();<NEW_LINE>for (int i = 0; i < rcs.length; i++) {<NEW_LINE>MReportColumn rc = MReportColumn.copy(getCtx(), to.getAD_Client_ID(), to.getAD_Org_ID(), to_ID, rcs[i], get_TrxName());<NEW_LINE>rc.save();<NEW_LINE>}<NEW_LINE>// Oper 1/2 were set to Null !<NEW_LINE>return "@Copied@=" + rcs.length;<NEW_LINE>}
), m_PA_ReportColumnSet_ID, get_TrxName());
1,004,658
public SOAPMessage invoke(SOAPMessage request) {<NEW_LINE>SOAPMessage response = null;<NEW_LINE>try {<NEW_LINE>System.out.println("Incoming Client Request as a SOAPMessage:");<NEW_LINE>request.writeTo(System.out);<NEW_LINE>String hdrText = request.getSOAPHeader().getTextContent();<NEW_LINE>System.out.println("Incoming SOAP Header:" + hdrText);<NEW_LINE>StringReader respMsg = new StringReader("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body xmlns=\"http://wssec.basic.cxf.fats/types\"><provider>This is X509EncWebSvc3 Web Service.</provider></soapenv:Body></soapenv:Envelope>");<NEW_LINE><MASK><NEW_LINE>MessageFactory factory = MessageFactory.newInstance();<NEW_LINE>response = factory.createMessage();<NEW_LINE>response.getSOAPPart().setContent(src);<NEW_LINE>response.saveChanges();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
Source src = new StreamSource(respMsg);
27,721
public void createControl(Composite parent) {<NEW_LINE>Composite main = new Composite(parent, SWT.NONE);<NEW_LINE>main.setLayout(GridLayoutFactory.swtDefaults().numColumns(3).create());<NEW_LINE>main.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>GridDataFactory inputData = GridDataFactory.swtDefaults().hint(300, SWT.DEFAULT);<NEW_LINE>// adds control for login credentials<NEW_LINE>userInfoProvider = new GithubAccountPageProvider();<NEW_LINE>userInfoControl = userInfoProvider.createContents(main);<NEW_LINE>userInfoControl.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(3, 1).create());<NEW_LINE>// Owner<NEW_LINE>Label ownerLabel = new Label(main, SWT.NONE);<NEW_LINE>ownerLabel.setText(Messages.GithubRepositorySelectionPage_OwnerLabel);<NEW_LINE>ownerText = new Text(main, <MASK><NEW_LINE>ownerText.setLayoutData(inputData.create());<NEW_LINE>ownerText.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(final ModifyEvent e) {<NEW_LINE>owner = ownerText.getText();<NEW_LINE>validate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// spacer to take up last section of grid<NEW_LINE>new Label(main, SWT.NONE);<NEW_LINE>// Repo<NEW_LINE>Label repoLabel = new Label(main, SWT.NONE);<NEW_LINE>repoLabel.setText(Messages.GithubRepositorySelectionPage_RepoNameLabel);<NEW_LINE>repoText = new Text(main, SWT.BORDER | SWT.SINGLE);<NEW_LINE>repoText.setLayoutData(inputData.create());<NEW_LINE>repoText.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(final ModifyEvent e) {<NEW_LINE>repoName = repoText.getText();<NEW_LINE>validate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// spacer to take up last section of grid<NEW_LINE>new Label(main, SWT.NONE);<NEW_LINE>Label dest = new Label(main, SWT.NONE);<NEW_LINE>dest.setText(Messages.RepositorySelectionPage_Destination_Label);<NEW_LINE>destinationText = new Text(main, SWT.BORDER | SWT.SINGLE);<NEW_LINE>destinationText.setLayoutData(inputData.create());<NEW_LINE>destinationText.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(final ModifyEvent e) {<NEW_LINE>validate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Button destinationButton = new Button(main, SWT.PUSH);<NEW_LINE>destinationButton.setText(StringUtil.ellipsify(CoreStrings.BROWSE));<NEW_LINE>destinationButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(final SelectionEvent e) {<NEW_LINE>FileDialog d = new FileDialog(getShell(), SWT.APPLICATION_MODAL | SWT.SAVE);<NEW_LINE>String text = destinationText.getText();<NEW_LINE>if (!StringUtil.isEmpty(text)) {<NEW_LINE>File file = new File(text).getAbsoluteFile();<NEW_LINE>d.setFilterPath(file.getParent());<NEW_LINE>d.setFileName(file.getName());<NEW_LINE>}<NEW_LINE>String r = d.open();<NEW_LINE>if (r != null) {<NEW_LINE>destinationText.setText(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setErrorMessage(null);<NEW_LINE>setControl(main);<NEW_LINE>}
SWT.BORDER | SWT.SINGLE);
1,787,989
public static String formatDelay(Number data) {<NEW_LINE>if (data == null) {<NEW_LINE>return StringUtils.EMPTY;<NEW_LINE>}<NEW_LINE>long t = data.longValue();<NEW_LINE>if (t < 0) {<NEW_LINE>return String.valueOf(t);<NEW_LINE>}<NEW_LINE>int hour = 0;<NEW_LINE>int minute = 0;<NEW_LINE>while (t >= 60 * 60 * 1000) {<NEW_LINE>hour++;<NEW_LINE>t -= 60 * 60 * 1000;<NEW_LINE>}<NEW_LINE>while (t >= 60 * 1000) {<NEW_LINE>minute++;<NEW_LINE>t -= 60 * 1000;<NEW_LINE>}<NEW_LINE>List<String> result <MASK><NEW_LINE>if (hour > 0) {<NEW_LINE>result.add(hour + " h");<NEW_LINE>}<NEW_LINE>if (minute > 0) {<NEW_LINE>result.add(minute + " m");<NEW_LINE>}<NEW_LINE>if (t > 0) {<NEW_LINE>DecimalFormat format = new DecimalFormat(PATTERN);<NEW_LINE>result.add(format.format((t * 1.0) / 1000) + " s");<NEW_LINE>}<NEW_LINE>if (result.size() == 0) {<NEW_LINE>return "0";<NEW_LINE>}<NEW_LINE>return StringUtils.join(result, " ");<NEW_LINE>}
= new ArrayList<String>();
750,275
public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> executions = new ArrayList<>();<NEW_LINE>executions.add(new ExprFilterOptReboolConstValueRegexpRHS());<NEW_LINE>executions.add(new ExprFilterOptReboolMixedValueRegexpRHS());<NEW_LINE>executions.add(new ExprFilterOptReboolConstValueRegexpRHSPerformance());<NEW_LINE>executions.add(new ExprFilterOptReboolConstValueRegexpLHS());<NEW_LINE>executions.add(new ExprFilterOptReboolNoValueExprRegexpSelf());<NEW_LINE>executions<MASK><NEW_LINE>executions.add(new ExprFilterOptReboolContextValueDeep());<NEW_LINE>executions.add(new ExprFilterOptReboolContextValueWithConst());<NEW_LINE>executions.add(new ExprFilterOptReboolPatternValueWithConst());<NEW_LINE>executions.add(new ExprFilterOptReboolWithEquals());<NEW_LINE>executions.add(new ExprFilterOptReboolMultiple());<NEW_LINE>executions.add(new ExprFilterOptReboolDisqualify());<NEW_LINE>executions.add(new ExprFilterOptReboolDuplicateLike());<NEW_LINE>executions.add(new ExprFilterOptReboolDuplicateRegexp());<NEW_LINE>return executions;<NEW_LINE>}
.add(new ExprFilterOptReboolNoValueConcat());
1,678,665
public void collectAtLocus(final Nucleotide refBase, final ReadPileup pileup, final Locatable locus, final int minBaseQuality) {<NEW_LINE>Utils.nonNull(refBase);<NEW_LINE>Utils.nonNull(pileup);<NEW_LINE>Utils.nonNull(locus);<NEW_LINE>ParamUtils.isPositiveOrZero(minBaseQuality, "Minimum base quality must be zero or higher.");<NEW_LINE>if (!BASES.contains(refBase)) {<NEW_LINE>logger.warn(String.format("The reference position at %s has an unknown base call (value: %s). Skipping...", locus, refBase.toString()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Nucleotide.Counter nucleotideCounter = new Nucleotide.Counter();<NEW_LINE>Utils.stream(pileup.iterator()).filter(r -> !r.isDeletion()).filter(r -> r.getQual() >= minBaseQuality).forEach(r -> nucleotideCounter.add<MASK><NEW_LINE>// only include total ACGT counts (exclude N, etc.)<NEW_LINE>final int totalBaseCount = BASES.stream().mapToInt(b -> (int) nucleotideCounter.get(b)).sum();<NEW_LINE>final int refReadCount = (int) nucleotideCounter.get(refBase);<NEW_LINE>// we take alt = total - ref instead of the actual alt count<NEW_LINE>final int altReadCount = totalBaseCount - refReadCount;<NEW_LINE>final Nucleotide altBase = altReadCount == 0 ? Nucleotide.N : inferAltFromPileupBaseCounts(nucleotideCounter, refBase);<NEW_LINE>allelicCounts.add(new AllelicCount(new SimpleInterval(locus.getContig(), locus.getStart(), locus.getEnd()), refReadCount, altReadCount, refBase, altBase));<NEW_LINE>}
(r.getBase()));
1,816,807
public void appendTo(BitArray bitArray, byte[] text) {<NEW_LINE>for (int i = 0; i < binaryShiftByteCount; i++) {<NEW_LINE>if (i == 0 || (i == 31 && binaryShiftByteCount <= 62)) {<NEW_LINE>// We need a header before the first character, and before<NEW_LINE>// character 31 when the total byte code is <= 62<NEW_LINE>// BINARY_SHIFT<NEW_LINE><MASK><NEW_LINE>if (binaryShiftByteCount > 62) {<NEW_LINE>bitArray.appendBits(binaryShiftByteCount - 31, 16);<NEW_LINE>} else if (i == 0) {<NEW_LINE>// 1 <= binaryShiftByteCode <= 62<NEW_LINE>bitArray.appendBits(Math.min(binaryShiftByteCount, 31), 5);<NEW_LINE>} else {<NEW_LINE>// 32 <= binaryShiftCount <= 62 and i == 31<NEW_LINE>bitArray.appendBits(binaryShiftByteCount - 31, 5);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bitArray.appendBits(text[binaryShiftStart + i], 8);<NEW_LINE>}<NEW_LINE>}
bitArray.appendBits(31, 5);
417,851
public void marshall(DashPackage dashPackage, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (dashPackage == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(dashPackage.getAdTriggers(), ADTRIGGERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getAdsOnDeliveryRestrictions(), ADSONDELIVERYRESTRICTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getEncryption(), ENCRYPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getManifestLayout(), MANIFESTLAYOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getManifestWindowSeconds(), MANIFESTWINDOWSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getMinBufferTimeSeconds(), MINBUFFERTIMESECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getMinUpdatePeriodSeconds(), MINUPDATEPERIODSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(dashPackage.getProfile(), PROFILE_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getSegmentDurationSeconds(), SEGMENTDURATIONSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getSegmentTemplateFormat(), SEGMENTTEMPLATEFORMAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getStreamSelection(), STREAMSELECTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getSuggestedPresentationDelaySeconds(), SUGGESTEDPRESENTATIONDELAYSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getUtcTiming(), UTCTIMING_BINDING);<NEW_LINE>protocolMarshaller.marshall(dashPackage.getUtcTimingUri(), UTCTIMINGURI_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
dashPackage.getPeriodTriggers(), PERIODTRIGGERS_BINDING);
185,295
public void configure(Binder binder) {<NEW_LINE>Jerseys.addResource(binder, ChatHandlerResource.class);<NEW_LINE>LifecycleModule.register(binder, ChatHandlerResource.class);<NEW_LINE>if (properties.containsKey(MAX_CHAT_REQUESTS_PROPERTY)) {<NEW_LINE>final int maxRequests = Integer.parseInt<MASK><NEW_LINE>JettyBindings.addQosFilter(binder, "/druid/worker/v1/chat/*", maxRequests);<NEW_LINE>}<NEW_LINE>Multibinder.newSetBinder(binder, ServletFilterHolder.class).addBinding().to(TaskIdResponseHeaderFilterHolder.class);<NEW_LINE>binder.bind(DruidNode.class).annotatedWith(RemoteChatHandler.class).to(Key.get(DruidNode.class, Self.class));<NEW_LINE>binder.bind(ServerConfig.class).annotatedWith(RemoteChatHandler.class).to(Key.get(ServerConfig.class));<NEW_LINE>binder.bind(TLSServerConfig.class).annotatedWith(RemoteChatHandler.class).to(Key.get(TLSServerConfig.class));<NEW_LINE>}
(properties.getProperty(MAX_CHAT_REQUESTS_PROPERTY));
1,717,960
private void writeRequestValues(CounterRequest request, boolean allChildHitsDisplayed, boolean allocatedKBytesDisplayed) throws IOException {<NEW_LINE>final String nextColumn = "</td><td align='right'>";<NEW_LINE>writeln(nextColumn);<NEW_LINE>writeln(integerFormat.format(request.getMean()));<NEW_LINE>writeln(nextColumn);<NEW_LINE>writeln(integerFormat.format(request.getMaximum()));<NEW_LINE>writeln(nextColumn);<NEW_LINE>writeln(integerFormat.format(request.getStandardDeviation()));<NEW_LINE>writeln(nextColumn);<NEW_LINE>final String nbsp = "&nbsp;";<NEW_LINE>if (request.getCpuTimeMean() >= 0) {<NEW_LINE>writeln(integerFormat.format(request.getCpuTimeMean()));<NEW_LINE>} else {<NEW_LINE>writeln(nbsp);<NEW_LINE>}<NEW_LINE>if (allocatedKBytesDisplayed) {<NEW_LINE>writeln(nextColumn);<NEW_LINE>if (request.getAllocatedKBytesMean() >= 0) {<NEW_LINE>writeln(integerFormat.format<MASK><NEW_LINE>} else {<NEW_LINE>writeln(nbsp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeln(nextColumn);<NEW_LINE>writeln(systemErrorFormat.format(request.getSystemErrorPercentage()));<NEW_LINE>if (allChildHitsDisplayed) {<NEW_LINE>writeln(nextColumn);<NEW_LINE>final boolean childHitsDisplayed = request.hasChildHits();<NEW_LINE>if (childHitsDisplayed) {<NEW_LINE>writeln(integerFormat.format(request.getChildHitsMean()));<NEW_LINE>} else {<NEW_LINE>writeln(nbsp);<NEW_LINE>}<NEW_LINE>writeln(nextColumn);<NEW_LINE>if (childHitsDisplayed) {<NEW_LINE>writeln(integerFormat.format(request.getChildDurationsMean()));<NEW_LINE>} else {<NEW_LINE>writeln(nbsp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(request.getAllocatedKBytesMean()));
734,077
final DescribeDBClusterSnapshotsResult executeDescribeDBClusterSnapshots(DescribeDBClusterSnapshotsRequest describeDBClusterSnapshotsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDBClusterSnapshotsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDBClusterSnapshotsRequest> request = null;<NEW_LINE>Response<DescribeDBClusterSnapshotsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDBClusterSnapshotsRequestMarshaller().marshall(super.beforeMarshalling(describeDBClusterSnapshotsRequest));<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, "DocDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDBClusterSnapshots");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeDBClusterSnapshotsResult> responseHandler = new StaxResponseHandler<DescribeDBClusterSnapshotsResult>(new DescribeDBClusterSnapshotsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
24,495
static int upgradeDbToVersion6(SQLiteDatabase db) {<NEW_LINE>int oldVersion = 5;<NEW_LINE>String addFullAccountNameQuery = " ALTER TABLE " + AccountEntry.TABLE_NAME + " ADD COLUMN " + AccountEntry.COLUMN_FULL_NAME + " varchar(255) ";<NEW_LINE>db.execSQL(addFullAccountNameQuery);<NEW_LINE>// update all existing accounts with their fully qualified name<NEW_LINE>Cursor cursor = db.query(AccountEntry.TABLE_NAME, new String[] { AccountEntry._ID, AccountEntry.COLUMN_UID }, null, null, null, null, null);<NEW_LINE>while (cursor != null && cursor.moveToNext()) {<NEW_LINE>String uid = cursor.getString(cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_UID));<NEW_LINE>String fullName = getFullyQualifiedAccountName(db, uid);<NEW_LINE>if (fullName == null)<NEW_LINE>continue;<NEW_LINE>ContentValues contentValues = new ContentValues();<NEW_LINE>contentValues.put(AccountEntry.COLUMN_FULL_NAME, fullName);<NEW_LINE>long id = cursor.getLong(cursor.getColumnIndexOrThrow(AccountEntry._ID));<NEW_LINE>db.update(AccountEntry.TABLE_NAME, contentValues, AccountEntry.<MASK><NEW_LINE>}<NEW_LINE>if (cursor != null) {<NEW_LINE>cursor.close();<NEW_LINE>}<NEW_LINE>oldVersion = 6;<NEW_LINE>return oldVersion;<NEW_LINE>}
_ID + " = " + id, null);
81,599
Object AroundConstruct(InvocationContext inv) {<NEW_LINE>try {<NEW_LINE>svLogger.info("ChainInterceptor2 Called");<NEW_LINE>InjectedManagedBean bean = (InjectedManagedBean) inv.getParameters()[0];<NEW_LINE>// Make sure InvocationContext.getParameters() in second interceptor returns what was set in first interceptor<NEW_LINE>assertEquals(".getParameters() in Chain2 did not contain bean set in .setParameters() in Chain1", bean.getID(), -1);<NEW_LINE>// InvocationContext.setParameters() add a bean and see if it is returned in third interceptor<NEW_LINE>InjectedManagedBean paramBean = new InjectedManagedBean();<NEW_LINE>paramBean.setID(-2);<NEW_LINE>Object[] parameters = new Object[1];<NEW_LINE>parameters[0] = paramBean;<NEW_LINE>inv.setParameters(parameters);<NEW_LINE>// make sure .getTarget() is null before .proceed();<NEW_LINE>assertNull(<MASK><NEW_LINE>Object o = inv.proceed();<NEW_LINE>// make sure .getTarget() after proceed returns correct object<NEW_LINE>assertEquals("InvocationContext.getTarget() did not return correct object", inv.getTarget().getClass(), ChainManagedBean.class);<NEW_LINE>return o;<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace(System.out);<NEW_LINE>throw new RuntimeException("unexpected Exception", e);<NEW_LINE>}<NEW_LINE>}
"InvocationContext.getTarget() is not null before InvocationContext.proceed()", inv.getTarget());
218,116
private static Response backchannelLogoutClientSession(KeycloakSession session, RealmModel realm, AuthenticatedClientSessionModel clientSession, AuthenticationSessionModel logoutAuthSession, UriInfo uriInfo, HttpHeaders headers) {<NEW_LINE>UserSessionModel userSession = clientSession.getUserSession();<NEW_LINE>ClientModel client = clientSession.getClient();<NEW_LINE>if (client.isFrontchannelLogout() || AuthenticationSessionModel.Action.LOGGED_OUT.name().equals(clientSession.getAction())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final AuthenticationSessionModel.Action logoutState = getClientLogoutAction(logoutAuthSession, client.getId());<NEW_LINE>if (logoutState == AuthenticationSessionModel.Action.LOGGED_OUT || logoutState == AuthenticationSessionModel.Action.LOGGING_OUT) {<NEW_LINE>return Response.ok().build();<NEW_LINE>}<NEW_LINE>if (!client.isEnabled()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>setClientLogoutAction(logoutAuthSession, client.getId(), AuthenticationSessionModel.Action.LOGGING_OUT);<NEW_LINE>String authMethod = clientSession.getProtocol();<NEW_LINE>// must be a keycloak service like account<NEW_LINE>if (authMethod == null)<NEW_LINE>return Response.ok().build();<NEW_LINE>logger.debugv("backchannel logout to: {0}", client.getClientId());<NEW_LINE>LoginProtocol protocol = session.getProvider(LoginProtocol.class, authMethod);<NEW_LINE>protocol.setRealm(realm).setHttpHeaders(headers).setUriInfo(uriInfo);<NEW_LINE>Response clientSessionLogout = protocol.backchannelLogout(userSession, clientSession);<NEW_LINE>setClientLogoutAction(logoutAuthSession, client.getId(<MASK><NEW_LINE>return clientSessionLogout;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ServicesLogger.LOGGER.failedToLogoutClient(ex);<NEW_LINE>return Response.serverError().build();<NEW_LINE>}<NEW_LINE>}
), AuthenticationSessionModel.Action.LOGGED_OUT);
610,623
private void transformCriterion(Example.Criteria exampleCriteria, String condition, String property, Object[] values, String andOr) {<NEW_LINE>if (values.length == 0) {<NEW_LINE>if ("and".equals(andOr)) {<NEW_LINE>exampleCriteria.addCriterion(column(property) + " " + condition);<NEW_LINE>} else {<NEW_LINE>exampleCriteria.addOrCriterion(column<MASK><NEW_LINE>}<NEW_LINE>} else if (values.length == 1) {<NEW_LINE>if ("and".equals(andOr)) {<NEW_LINE>exampleCriteria.addCriterion(column(property) + " " + condition, values[0], property(property));<NEW_LINE>} else {<NEW_LINE>exampleCriteria.addOrCriterion(column(property) + " " + condition, values[0], property(property));<NEW_LINE>}<NEW_LINE>} else if (values.length == 2) {<NEW_LINE>if ("and".equals(andOr)) {<NEW_LINE>exampleCriteria.addCriterion(column(property) + " " + condition, values[0], values[1], property(property));<NEW_LINE>} else {<NEW_LINE>exampleCriteria.addOrCriterion(column(property) + " " + condition, values[0], values[1], property(property));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(property) + " " + condition);
1,797,697
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "dmult");<NEW_LINE>final String sourceRegister1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final String sourceRegister2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final OperandSize qw = OperandSize.QWORD;<NEW_LINE>final OperandSize ow = OperandSize.OWORD;<NEW_LINE>final long baseOffset = ReilHelpers.toReilAddress(instruction.getAddress()).toLong();<NEW_LINE>long offset = baseOffset;<NEW_LINE>final <MASK><NEW_LINE>final String temporaryHiResult = environment.getNextVariableString();<NEW_LINE>Helpers.signedMul(offset, environment, instructions, qw, sourceRegister1, qw, sourceRegister2, ow, tempResult);<NEW_LINE>offset = baseOffset + instructions.size();<NEW_LINE>instructions.add(ReilHelpers.createAnd(offset++, ow, tempResult, qw, String.valueOf(0xFFFFFFFFL), qw, "LO"));<NEW_LINE>instructions.add(ReilHelpers.createBsh(offset, ow, tempResult, qw, String.valueOf(-32L), qw, temporaryHiResult));<NEW_LINE>instructions.add(ReilHelpers.createAnd(offset, qw, temporaryHiResult, qw, String.valueOf(0xFFFFFFFFL), qw, "HI"));<NEW_LINE>}
String tempResult = environment.getNextVariableString();
1,843,022
private static void renderConfigOptionsIfNecessary(FacesContext facesContext) throws IOException {<NEW_LINE>ResponseWriter writer = facesContext.getResponseWriter();<NEW_LINE>MyfacesConfig config = MyfacesConfig.getCurrentInstance(facesContext.getExternalContext());<NEW_LINE>ScriptContext script = new ScriptContext();<NEW_LINE>boolean autoScroll = config.isAutoScroll();<NEW_LINE>boolean autoSave = JavascriptUtils.isSaveFormSubmitLinkIE(facesContext.getExternalContext());<NEW_LINE>if (autoScroll || autoSave) {<NEW_LINE>script.prettyLine();<NEW_LINE>script.increaseIndent();<NEW_LINE>script.append("(!window.myfaces) ? window.myfaces = {} : null;");<NEW_LINE>script.append("(!myfaces.core) ? myfaces.core = {} : null;");<NEW_LINE>script.append("(!myfaces.core.config) ? myfaces.core.config = {} : null;");<NEW_LINE>}<NEW_LINE>if (autoScroll) {<NEW_LINE>script.append("myfaces.core.config.autoScroll = true;");<NEW_LINE>}<NEW_LINE>if (autoSave) {<NEW_LINE>script.append("myfaces.core.config.ieAutoSave = true;");<NEW_LINE>}<NEW_LINE>if (autoScroll || autoSave) {<NEW_LINE>writer.<MASK><NEW_LINE>writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);<NEW_LINE>writer.writeText(script.toString(), null);<NEW_LINE>writer.endElement(HTML.SCRIPT_ELEM);<NEW_LINE>}<NEW_LINE>}
startElement(HTML.SCRIPT_ELEM, null);
486,940
public void groupNameChanged(Group group, String oldName, String newName) {<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("Group name for " + group.getName() + "changed from=" + oldName + " to=" + newName);<NEW_LINE>ContactGroupIcqImpl contactGroup = findContactGroup(group);<NEW_LINE>if (contactGroup == null) {<NEW_LINE>if (logger.isDebugEnabled())<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check whether the name has really changed (the joust sim stack<NEW_LINE>// would call this method even when the name has not really changed<NEW_LINE>// and values of oldName and newName would almost always be null)<NEW_LINE>if (contactGroup.getGroupName().equals(contactGroup.getNameCopy())) {<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("Group name hasn't really changed(" + contactGroup.getGroupName() + "). Ignoring");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// we do have a new name. store a copy of it for our next deteciton<NEW_LINE>// and fire the corresponding event.<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("Dispatching group change event.");<NEW_LINE>contactGroup.initNameCopy();<NEW_LINE>fireGroupEvent(contactGroup, ServerStoredGroupEvent.GROUP_RENAMED_EVENT);<NEW_LINE>}
logger.debug("group name changed event received for unknown group" + group);
987,459
private String issueReceipt(MProject project) {<NEW_LINE>MInOut inOut = new MInOut(getCtx(), getInOutId(), null);<NEW_LINE>if (inOut.isSOTrx() || !inOut.isProcessed() || !(MInOut.DOCSTATUS_Completed.equals(inOut.getDocStatus()) || MInOut.DOCSTATUS_Closed.equals(inOut.getDocStatus())))<NEW_LINE>throw new IllegalArgumentException("Receipt not valid - " + inOut);<NEW_LINE>log.info(inOut.toString());<NEW_LINE>// Set Project of Receipt<NEW_LINE>if (inOut.getC_Project_ID() == 0) {<NEW_LINE>inOut.setC_Project_ID(project.getC_Project_ID());<NEW_LINE>inOut.saveEx();<NEW_LINE>} else if (inOut.getC_Project_ID() != project.getC_Project_ID())<NEW_LINE>throw new IllegalArgumentException("Receipt for other Project (" + inOut.getC_Project_ID() + ")");<NEW_LINE>MInOutLine[] <MASK><NEW_LINE>AtomicInteger counter = new AtomicInteger(0);<NEW_LINE>Arrays.stream(inOut.getLines(false)).filter(// Need to have a Product<NEW_LINE>inOutLine -> // Need to have Quantity<NEW_LINE>inOutLine.getM_Product_ID() != 0 && // not issued yet<NEW_LINE>(inOutLine.getMovementQty() != null || inOutLine.getMovementQty().signum() != 0) && (!projectIssueHasReceipt(project, inOutLine.getM_InOutLine_ID()))).forEach(inOutLine -> {<NEW_LINE>// Create Issue<NEW_LINE>MProjectIssue projectIssue = new MProjectIssue(project);<NEW_LINE>projectIssue.setMandatory(inOutLine.getM_Locator_ID(), inOutLine.getM_Product_ID(), inOutLine.getMovementQty());<NEW_LINE>if (// default today<NEW_LINE>getMovementDate() != null)<NEW_LINE>projectIssue.setMovementDate(getMovementDate());<NEW_LINE>if (getDescription() != null && getDescription().length() > 0)<NEW_LINE>projectIssue.setDescription(getDescription());<NEW_LINE>else if (inOutLine.getDescription() != null)<NEW_LINE>projectIssue.setDescription(inOutLine.getDescription());<NEW_LINE>else if (inOut.getDescription() != null)<NEW_LINE>projectIssue.setDescription(inOut.getDescription());<NEW_LINE>projectIssue.setM_InOutLine_ID(inOutLine.getM_InOutLine_ID());<NEW_LINE>projectIssue.process();<NEW_LINE>// Find/Create Project Line<NEW_LINE>MProjectLine firstProjectLine = project.getLines().stream().filter(projectLine -> projectLine.getC_OrderPO_ID() == inOut.getC_Order_ID() && projectLine.getM_Product_ID() == inOutLine.getM_Product_ID() && projectLine.getC_ProjectIssue_ID() == 0).findFirst().get();<NEW_LINE>if (firstProjectLine == null)<NEW_LINE>firstProjectLine = new MProjectLine(project);<NEW_LINE>// setIssue<NEW_LINE>firstProjectLine.setMProjectIssue(projectIssue);<NEW_LINE>firstProjectLine.saveEx();<NEW_LINE>addLog(projectIssue.getLine(), projectIssue.getMovementDate(), projectIssue.getMovementQty(), null);<NEW_LINE>counter.getAndUpdate(no -> no + 1);<NEW_LINE>});<NEW_LINE>return "@Created@ " + counter.get();<NEW_LINE>}
inOutLines = inOut.getLines(false);
1,728,017
public void traverseComparisonFields(HollowEffigy comparison, int maxDiff) {<NEW_LINE>for (Field field : comparison.getFields()) {<NEW_LINE>if (field.isLeafNode()) {<NEW_LINE>FieldDiffCount <MASK><NEW_LINE>if (fieldCount == null) {<NEW_LINE>if (simDiffCount.diffCount + 1 >= maxDiff) {<NEW_LINE>simDiffCount.diffCount++;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>fieldCount = new FieldDiffCount();<NEW_LINE>map.put(field, fieldCount);<NEW_LINE>}<NEW_LINE>if (fieldCount.incrementComparisonCount(runId)) {<NEW_LINE>if (++simDiffCount.diffCount >= maxDiff)<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>simDiffCount.simCount++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>traverseComparisonFields((HollowEffigy) field.getValue(), maxDiff);<NEW_LINE>if (simDiffCount.diffCount >= maxDiff)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fieldCount = map.get(field);
1,434,465
private void preserveExistingLineBreaks() {<NEW_LINE>// normally n empty lines = n+1 line breaks, but not at the file start and end<NEW_LINE>Token first = this.tm.get(0);<NEW_LINE>int startingBreaks = first.getLineBreaksBefore();<NEW_LINE>first.clearLineBreaksBefore();<NEW_LINE>first.putLineBreaksBefore(startingBreaks - 1);<NEW_LINE>this.tm.traverse(0, new TokenTraverser() {<NEW_LINE><NEW_LINE>boolean join_wrapped_lines = WrapPreparator.this.options.join_wrapped_lines;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean token(Token token, int index) {<NEW_LINE>int lineBreaks = getLineBreaksToPreserve(getPrevious(), token);<NEW_LINE>if (lineBreaks > 1 || (!this.join_wrapped_lines && token.isWrappable()) || index == 0)<NEW_LINE>token.putLineBreaksBefore(lineBreaks);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Token last = this.tm.get(this.<MASK><NEW_LINE>last.clearLineBreaksAfter();<NEW_LINE>int endingBreaks = getLineBreaksToPreserve(last, null);<NEW_LINE>if (endingBreaks > 0) {<NEW_LINE>last.putLineBreaksAfter(endingBreaks);<NEW_LINE>} else if ((this.kind & (CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.K_MODULE_INFO)) != 0 && this.options.insert_new_line_at_end_of_file_if_missing) {<NEW_LINE>last.breakAfter();<NEW_LINE>}<NEW_LINE>}
tm.size() - 1);
1,156,180
private JPopupMenu buildResizePopup() {<NEW_LINE>JPopupMenu res = new JPopupMenu();<NEW_LINE>List<ResizeOption> options = ResizeOptions<MASK><NEW_LINE>options.add(ResizeOption.SIZE_TO_FIT);<NEW_LINE>for (ResizeOption ro : options) {<NEW_LINE>final ResizeOption size = ro;<NEW_LINE>JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(ro.getToolTip());<NEW_LINE>res.add(menuItem);<NEW_LINE>menuItem.setSelected(size.equals(currentSize));<NEW_LINE>menuItem.addItemListener(new ItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>setBrowserSize(size);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>menuItem.setIcon(BrowserResizeButton.toIcon(ro));<NEW_LINE>}<NEW_LINE>res.addSeparator();<NEW_LINE>JMenuItem menu = new JMenuItem(NbBundle.getMessage(DeveloperToolbar.class, "Lbl_CUSTOMIZE"));<NEW_LINE>menu.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>ResizeOptionsCustomizer customizer = new ResizeOptionsCustomizer();<NEW_LINE>if (customizer.showCustomizer()) {<NEW_LINE>List<ResizeOption> newOptions = customizer.getResizeOptions();<NEW_LINE>ResizeOptions.getDefault().saveAll(newOptions);<NEW_LINE>fillResizeBar();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>res.add(menu);<NEW_LINE>return res;<NEW_LINE>}
.getDefault().loadAll();
517,789
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException {<NEW_LINE>try {<NEW_LINE>// MinioClient minioClient =<NEW_LINE>// MinioClient.builder()<NEW_LINE>// .endpoint("https://s3.amazonaws.com")<NEW_LINE>// .credentials("YOUR-ACCESSKEY", "YOUR-SECRETACCESSKEY")<NEW_LINE>// .build();<NEW_LINE>{<NEW_LINE>// Upload 'my-filename' as object 'my-objectname' in 'my-bucketname'.<NEW_LINE>minioClient.uploadObject(UploadObjectArgs.builder().bucket("my-bucketname").object("my-objectname").filename<MASK><NEW_LINE>System.out.println("my-filename is uploaded to my-objectname successfully");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>KeyGenerator keyGen = KeyGenerator.getInstance("AES");<NEW_LINE>keyGen.init(256);<NEW_LINE>ServerSideEncryptionCustomerKey ssec = new ServerSideEncryptionCustomerKey(keyGen.generateKey());<NEW_LINE>// Upload 'my-filename' as object encrypted 'my-objectname' in 'my-bucketname'.<NEW_LINE>minioClient.uploadObject(UploadObjectArgs.builder().bucket("my-bucketname").object("my-objectname").filename("my-filename").sse(ssec).build());<NEW_LINE>System.out.println("my-filename is uploaded to my-objectname successfully");<NEW_LINE>}<NEW_LINE>} catch (MinioException e) {<NEW_LINE>System.out.println("Error occurred: " + e);<NEW_LINE>}<NEW_LINE>}
("my-filename").build());
116,829
private static Value.Builder valueFromCallable(StarlarkCallable x) {<NEW_LINE>// Starlark def statement?<NEW_LINE>if (x instanceof StarlarkFunction) {<NEW_LINE>StarlarkFunction fn = (StarlarkFunction) x;<NEW_LINE>Signature sig = new Signature();<NEW_LINE>sig.name = fn.getName();<NEW_LINE>sig.parameterNames = fn.getParameterNames();<NEW_LINE>sig.hasVarargs = fn.hasVarargs();<NEW_LINE>sig<MASK><NEW_LINE>sig.getDefaultValue = (i) -> {<NEW_LINE>Object v = fn.getDefaultValue(i);<NEW_LINE>return v == null ? null : Starlark.repr(v);<NEW_LINE>};<NEW_LINE>return signatureToValue(sig);<NEW_LINE>}<NEW_LINE>// annotated Java method?<NEW_LINE>if (x instanceof BuiltinFunction) {<NEW_LINE>return valueFromAnnotation(((BuiltinFunction) x).getAnnotation());<NEW_LINE>}<NEW_LINE>// application-defined callable? Treat as def f(**kwargs).<NEW_LINE>Signature sig = new Signature();<NEW_LINE>sig.name = x.getName();<NEW_LINE>sig.parameterNames = ImmutableList.of("kwargs");<NEW_LINE>sig.hasKwargs = true;<NEW_LINE>return signatureToValue(sig);<NEW_LINE>}
.hasKwargs = fn.hasKwargs();
198,122
public void enableAntiAlias(boolean antiAlias) {<NEW_LINE>if (antiAlias) {<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);<NEW_LINE>} else {<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);<NEW_LINE>gr.setRenderingHint(<MASK><NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);<NEW_LINE>gr.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);<NEW_LINE>}<NEW_LINE>}
RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
12,981
public OutputLocation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OutputLocation outputLocation = new OutputLocation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("S3", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>outputLocation.setS3(S3LocationJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return outputLocation;<NEW_LINE>}
().unmarshall(context));
167,192
public static String convertPATH(String rawPATH) {<NEW_LINE>if (rawPATH == null || !PlatformUtil.isWindows()) {<NEW_LINE>return rawPATH;<NEW_LINE>}<NEW_LINE>// Handle if path didn't come from bash/mingw/cygwin, but from system env instead.<NEW_LINE>if (rawPATH.indexOf(';') != -1) {<NEW_LINE>return rawPATH;<NEW_LINE>}<NEW_LINE>// Cygwin - http://www.cygwin.com/cygwin-ug-net/using-utils.html<NEW_LINE>if (// $NON-NLS-1$<NEW_LINE>rawPATH.contains("/cygdrive/")) {<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String cygPathExe = ShellExecutable.getPath().removeLastSegments(1).append("cygpath.exe").toOSString();<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>IStatus result = new ProcessRunner().runInBackground(cygPathExe, "-w", "-p", rawPATH);<NEW_LINE>if (result.isOK()) {<NEW_LINE>return result.getMessage();<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] paths = rawPATH.split(ShellExecutable.PATH_SEPARATOR);<NEW_LINE>for (int i = 0; i < paths.length; ++i) {<NEW_LINE>// MinGW<NEW_LINE>// FIXME See http://www.mingw.org/wiki/Posix_path_conversion<NEW_LINE>Matcher m = MINGW_PATH_REGEXP.matcher(paths[i]);<NEW_LINE>if (m.matches()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>paths[i<MASK><NEW_LINE>} else {<NEW_LINE>// Cygwin - fallback if cygpath failed<NEW_LINE>m = CYGWWIN_PATH_REGEXP.matcher(paths[i]);<NEW_LINE>if (m.matches()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>paths[i] = m.replaceFirst("$1:/$2");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StringUtil.join(File.pathSeparator, paths);<NEW_LINE>}
] = m.replaceFirst("$1:/$2");
28,965
private String splitContent(String data) {<NEW_LINE>int length = data.length();<NEW_LINE>if (length < SPLIT_LINE_LENGTH) {<NEW_LINE>state = SplitState.UNCHANGED;<NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>int pos = data.indexOf(NEWLINE);<NEW_LINE>if (pos == -1) {<NEW_LINE>state = SplitState.SINGLE_LINE;<NEW_LINE>StringBuilder strBuilder = createStringBuilder(length);<NEW_LINE>splitInto(data, strBuilder, 0, length);<NEW_LINE>return strBuilder.toString();<NEW_LINE>}<NEW_LINE>int curr = 0;<NEW_LINE>int maxLineLen = 0;<NEW_LINE>StringBuilder strBuilder = null;<NEW_LINE>do {<NEW_LINE>int lineLenth;<NEW_LINE>if ((lineLenth = pos - curr) > SPLIT_LINE_LENGTH) {<NEW_LINE>if (strBuilder == null) {<NEW_LINE>strBuilder = createStringBuilder(length);<NEW_LINE>strBuilder.append(data, 0, curr);<NEW_LINE>if (data.charAt(curr) == NEWLINE) {<NEW_LINE>curr += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>splitInto(data, strBuilder, curr, pos);<NEW_LINE>} else if (strBuilder != null) {<NEW_LINE>strBuilder.append(data, curr, pos);<NEW_LINE>}<NEW_LINE>maxLineLen = Math.max(lineLenth, maxLineLen);<NEW_LINE>curr = pos;<NEW_LINE>pos = data.indexOf(NEWLINE, curr + 1);<NEW_LINE>if (pos == -1) {<NEW_LINE>pos = length;<NEW_LINE>}<NEW_LINE>} while (curr < length);<NEW_LINE>if (strBuilder == null) {<NEW_LINE>state = length >= DISABLE_WRAP_LENGTH <MASK><NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>state = SplitState.LONG_LINES;<NEW_LINE>return strBuilder.toString();<NEW_LINE>}
? SplitState.LONG_CONTENT : SplitState.UNCHANGED;
1,123,787
protected void initContentBuffer(XMLStringBuffer suiteBuffer) {<NEW_LINE>Properties testAttrs = new Properties();<NEW_LINE><MASK><NEW_LINE>testAttrs.setProperty("verbose", String.valueOf(m_logLevel));<NEW_LINE>suiteBuffer.push("test", testAttrs);<NEW_LINE>if (null != m_groupNames) {<NEW_LINE>suiteBuffer.push("groups");<NEW_LINE>suiteBuffer.push("run");<NEW_LINE>for (String groupName : m_groupNames) {<NEW_LINE>Properties includeAttrs = new Properties();<NEW_LINE>includeAttrs.setProperty("name", groupName);<NEW_LINE>suiteBuffer.addEmptyElement("include", includeAttrs);<NEW_LINE>}<NEW_LINE>suiteBuffer.pop("run");<NEW_LINE>suiteBuffer.pop("groups");<NEW_LINE>}<NEW_LINE>// packages belongs to suite according to the latest DTD<NEW_LINE>if ((m_packageNames != null) && (m_packageNames.size() > 0)) {<NEW_LINE>suiteBuffer.push("packages");<NEW_LINE>for (String packageName : m_packageNames) {<NEW_LINE>Properties packageAttrs = new Properties();<NEW_LINE>packageAttrs.setProperty("name", packageName);<NEW_LINE>suiteBuffer.addEmptyElement("package", packageAttrs);<NEW_LINE>}<NEW_LINE>suiteBuffer.pop("packages");<NEW_LINE>}<NEW_LINE>if ((m_classNames != null) && (m_classNames.size() > 0)) {<NEW_LINE>suiteBuffer.push("classes");<NEW_LINE>for (String className : m_classNames) {<NEW_LINE>Properties classAttrs = new Properties();<NEW_LINE>classAttrs.setProperty("name", className);<NEW_LINE>suiteBuffer.addEmptyElement("class", classAttrs);<NEW_LINE>}<NEW_LINE>suiteBuffer.pop("classes");<NEW_LINE>}<NEW_LINE>suiteBuffer.pop("test");<NEW_LINE>}
testAttrs.setProperty("name", m_projectName);
211,891
final PutTelemetryRecordsResult executePutTelemetryRecords(PutTelemetryRecordsRequest putTelemetryRecordsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putTelemetryRecordsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<PutTelemetryRecordsRequest> request = null;<NEW_LINE>Response<PutTelemetryRecordsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutTelemetryRecordsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putTelemetryRecordsRequest));<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, "XRay");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutTelemetryRecords");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutTelemetryRecordsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutTelemetryRecordsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
882,787
public boolean validateMethodRequest(MethodConfig methodConfig) {<NEW_LINE>if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");<NEW_LINE>}<NEW_LINE>if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet name");<NEW_LINE>}<NEW_LINE>if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {<NEW_LINE>try {<NEW_LINE>if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Unexpected value for table header index. Please use a number starting from 1");<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Unexpected format for table header index. Please use a number starting from 1");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JsonNode bodyNode;<NEW_LINE>try {<NEW_LINE>bodyNode = this.objectMapper.readTree(methodConfig.getRowObjects());<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_JSON_PARSE_ERROR, methodConfig.getRowObjects(), "Unable to parse request body. Expected a list of row objects.");<NEW_LINE>}<NEW_LINE>if (!bodyNode.isArray()) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Request body was not an array.");
670,204
protected QueryDataSet processShowQuery(ShowPlan showPlan, QueryContext context) throws QueryProcessException, MetadataException {<NEW_LINE>switch(showPlan.getShowContentType()) {<NEW_LINE>case TTL:<NEW_LINE>return processShowTTLQuery((ShowTTLPlan) showPlan);<NEW_LINE>case FLUSH_TASK_INFO:<NEW_LINE>return processShowFlushTaskInfo();<NEW_LINE>case VERSION:<NEW_LINE>return processShowVersion();<NEW_LINE>case TIMESERIES:<NEW_LINE>return processShowTimeseries((ShowTimeSeriesPlan) showPlan, context);<NEW_LINE>case STORAGE_GROUP:<NEW_LINE>return processShowStorageGroup((ShowStorageGroupPlan) showPlan);<NEW_LINE>case LOCK_INFO:<NEW_LINE>return processShowLockInfo((ShowLockInfoPlan) showPlan);<NEW_LINE>case DEVICES:<NEW_LINE>return processShowDevices((ShowDevicesPlan) showPlan);<NEW_LINE>case CHILD_PATH:<NEW_LINE>return processShowChildPaths((ShowChildPathsPlan) showPlan);<NEW_LINE>case CHILD_NODE:<NEW_LINE>return processShowChildNodes((ShowChildNodesPlan) showPlan);<NEW_LINE>case COUNT_TIMESERIES:<NEW_LINE>return processCountTimeSeries((CountPlan) showPlan);<NEW_LINE>case COUNT_NODE_TIMESERIES:<NEW_LINE>return processCountNodeTimeSeries((CountPlan) showPlan);<NEW_LINE>case COUNT_DEVICES:<NEW_LINE>return processCountDevices((CountPlan) showPlan);<NEW_LINE>case COUNT_STORAGE_GROUP:<NEW_LINE>return processCountStorageGroup((CountPlan) showPlan);<NEW_LINE>case COUNT_NODES:<NEW_LINE>return processCountNodes((CountPlan) showPlan);<NEW_LINE>case QUERY_PROCESSLIST:<NEW_LINE>return processShowQueryProcesslist();<NEW_LINE>case FUNCTIONS:<NEW_LINE>return processShowFunctions((ShowFunctionsPlan) showPlan);<NEW_LINE>case TRIGGERS:<NEW_LINE>return processShowTriggers();<NEW_LINE>case CONTINUOUS_QUERY:<NEW_LINE>return processShowContinuousQueries();<NEW_LINE>case SCHEMA_TEMPLATE:<NEW_LINE>return processShowSchemaTemplates();<NEW_LINE>case NODES_IN_SCHEMA_TEMPLATE:<NEW_LINE><MASK><NEW_LINE>case PATHS_SET_SCHEMA_TEMPLATE:<NEW_LINE>return processShowPathsSetSchemaTemplate((ShowPathsSetTemplatePlan) showPlan);<NEW_LINE>case PATHS_USING_SCHEMA_TEMPLATE:<NEW_LINE>return processShowPathsUsingSchemaTemplate((ShowPathsUsingTemplatePlan) showPlan);<NEW_LINE>default:<NEW_LINE>throw new QueryProcessException(String.format("Unrecognized show plan %s", showPlan));<NEW_LINE>}<NEW_LINE>}
return processShowNodesInSchemaTemplate((ShowNodesInTemplatePlan) showPlan);
1,106,891
public int compare(BuddyPluginBuddy b1, BuddyPluginBuddy b2) {<NEW_LINE>int res = 0;<NEW_LINE>if (field == FIELD_NAME) {<NEW_LINE>res = b1.getName().compareTo(b2.getName());<NEW_LINE>} else if (field == FIELD_ONLINE) {<NEW_LINE>res = (b1.isOnline(false) ? 1 : 0) - (b2.isOnline(false) ? 1 : 0);<NEW_LINE>} else if (field == FIELD_LAST_SEEN) {<NEW_LINE>res = sortInt(b1.getLastTimeOnline() - b2.getLastTimeOnline());<NEW_LINE>} else if (field == FIELD_YGM) {<NEW_LINE>res = sortInt(b1.getLastMessagePending() - b2.getLastMessagePending());<NEW_LINE>} else if (field == FIELD_LAST_MSG) {<NEW_LINE>res = b1.getLastMessageReceived().compareTo(b2.getLastMessageReceived());<NEW_LINE>} else if (field == FIELD_LOC_CAT) {<NEW_LINE>res = compareStrings(b1.getLocalAuthorisedRSSTagsOrCategoriesAsString(<MASK><NEW_LINE>} else if (field == FIELD_REM_CAT) {<NEW_LINE>res = compareStrings(b1.getRemoteAuthorisedRSSTagsOrCategoriesAsString(), b2.getRemoteAuthorisedRSSTagsOrCategoriesAsString());<NEW_LINE>} else if (field == FIELD_READ_CAT) {<NEW_LINE>res = compareStrings(b1.getLocalReadTagsOrCategoriesAsString(), b2.getLocalReadTagsOrCategoriesAsString());<NEW_LINE>} else if (field == FIELD_CON) {<NEW_LINE>res = b1.getConnectionsString().compareTo(b2.getConnectionsString());<NEW_LINE>} else if (field == FIELD_TRACK) {<NEW_LINE>res = tracker.getTrackingStatus(b1).compareTo(tracker.getTrackingStatus(b2));<NEW_LINE>} else if (field == FIELD_MSG_IN) {<NEW_LINE>res = b1.getMessageInCount() - b2.getMessageInCount();<NEW_LINE>} else if (field == FIELD_MSG_OUT) {<NEW_LINE>res = b1.getMessageOutCount() - b2.getMessageOutCount();<NEW_LINE>} else if (field == FIELD_QUEUED) {<NEW_LINE>res = b1.getMessageHandler().getMessageCount() - b2.getMessageHandler().getMessageCount();<NEW_LINE>} else if (field == FIELD_BYTES_IN) {<NEW_LINE>res = b1.getBytesInCount() - b2.getBytesInCount();<NEW_LINE>} else if (field == FIELD_BYTES_OUT) {<NEW_LINE>res = b1.getBytesOutCount() - b2.getBytesOutCount();<NEW_LINE>} else if (field == FIELD_SS) {<NEW_LINE>res = b1.getSubsystem() - b2.getSubsystem();<NEW_LINE>}<NEW_LINE>return ((ascending ? 1 : -1) * res);<NEW_LINE>}
), b2.getLocalAuthorisedRSSTagsOrCategoriesAsString());
648,617
public Builder mergeFrom(com.google.protobuf.DescriptorProtos.ServiceOptions other) {<NEW_LINE>if (other == com.google.protobuf.DescriptorProtos.ServiceOptions.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (uninterpretedOptionBuilder_ == null) {<NEW_LINE>if (!other.uninterpretedOption_.isEmpty()) {<NEW_LINE>if (uninterpretedOption_.isEmpty()) {<NEW_LINE>uninterpretedOption_ = other.uninterpretedOption_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureUninterpretedOptionIsMutable();<NEW_LINE>uninterpretedOption_.addAll(other.uninterpretedOption_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.uninterpretedOption_.isEmpty()) {<NEW_LINE>if (uninterpretedOptionBuilder_.isEmpty()) {<NEW_LINE>uninterpretedOptionBuilder_.dispose();<NEW_LINE>uninterpretedOptionBuilder_ = null;<NEW_LINE>uninterpretedOption_ = other.uninterpretedOption_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>uninterpretedOptionBuilder_ = com.google.protobuf.GeneratedMessage<MASK><NEW_LINE>} else {<NEW_LINE>uninterpretedOptionBuilder_.addAllMessages(other.uninterpretedOption_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeExtensionFields(other);<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>}
.alwaysUseFieldBuilders ? getUninterpretedOptionFieldBuilder() : null;
656,645
public static void main(String[] args) {<NEW_LINE>String classname = System.getProperty(PARAMETER_NAME);<NEW_LINE>CmdLineParser parser = null;<NEW_LINE>boolean classHasArgument = false;<NEW_LINE>boolean classHasOptions = false;<NEW_LINE>// Check the requirement: must specify the class to start<NEW_LINE>if (classname == null || "".equals(classname)) {<NEW_LINE>System.err.println("The system property '" + PARAMETER_NAME + "' must contain the classname to start.");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class clazz = Class.forName(classname);<NEW_LINE>Object bean = clazz.newInstance();<NEW_LINE>parser = new CmdLineParser(bean);<NEW_LINE>// for help output<NEW_LINE>classHasArgument = hasAnnotation(clazz, Argument.class);<NEW_LINE>classHasOptions = hasAnnotation(clazz, Option.class);<NEW_LINE>parser.parseArgument(args);<NEW_LINE>// try starting run()<NEW_LINE>Method m;<NEW_LINE>boolean couldInvoke = false;<NEW_LINE>try {<NEW_LINE>m = clazz.getMethod("run", (Class[]) null);<NEW_LINE>m.invoke(bean<MASK><NEW_LINE>couldInvoke = true;<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>}<NEW_LINE>// try starting run(String[])<NEW_LINE>if (!couldInvoke)<NEW_LINE>try {<NEW_LINE>m = clazz.getMethod("run", String[].class);<NEW_LINE>m.invoke(bean, new Object[] { args });<NEW_LINE>couldInvoke = true;<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>// wrong classpath setting<NEW_LINE>System.err.println("Cant find the class '" + classname + "' as specified in the system property '" + PARAMETER_NAME + "'.");<NEW_LINE>} catch (CmdLineException e) {<NEW_LINE>// wrong argument enteres, so print the usage message as<NEW_LINE>// supplied by args4j<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>System.err.print(classname);<NEW_LINE>if (classHasOptions)<NEW_LINE>System.err.print(" [options]");<NEW_LINE>if (classHasArgument)<NEW_LINE>System.err.print(" arguments");<NEW_LINE>System.err.println();<NEW_LINE>if (parser != null)<NEW_LINE>parser.printUsage(System.err);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Must be an unhandled business exception, so we can only<NEW_LINE>// print stacktraces.<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
, (Object[]) null);
850,109
public com.amazonaws.services.costandusagereport.model.ValidationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.costandusagereport.model.ValidationException validationException = new com.amazonaws.services.costandusagereport.model.ValidationException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return validationException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,772,987
public void renameField(Model m, JSONObject field, String newName) throws ConfirmModSchemaException {<NEW_LINE>mCol.modSchema();<NEW_LINE>String pat = String.format("\\{\\{([^{}]*)([:#^/]|[^:#/^}][^:}]*?:|)%s\\}\\}", Pattern.quote(<MASK><NEW_LINE>if (newName == null) {<NEW_LINE>newName = "";<NEW_LINE>}<NEW_LINE>String repl = "{{$1$2" + newName + "}}";<NEW_LINE>JSONArray tmpls = m.getJSONArray("tmpls");<NEW_LINE>for (JSONObject t : tmpls.jsonObjectIterable()) {<NEW_LINE>for (String fmt : new String[] { "qfmt", "afmt" }) {<NEW_LINE>if (!"".equals(newName)) {<NEW_LINE>t.put(fmt, t.getString(fmt).replaceAll(pat, repl));<NEW_LINE>} else {<NEW_LINE>t.put(fmt, t.getString(fmt).replaceAll(pat, ""));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>field.put("name", newName);<NEW_LINE>save(m);<NEW_LINE>}
field.getString("name")));
1,086,977
private void onConnect() {<NEW_LINE>Timber.d(<MASK><NEW_LINE>scheduler.scheduleMqttMaybeReconnectAndPing(preferences.getKeepalive());<NEW_LINE>Timber.d("Releasing connectinglock");<NEW_LINE>connectingLock.release();<NEW_LINE>changeState(EndpointState.CONNECTED);<NEW_LINE>// allow new connection attempts from queueMessageForSending<NEW_LINE>sendMessageConnectPressure = 0;<NEW_LINE>scheduler.cancelMqttReconnect();<NEW_LINE>// Check if we're connecting to the same broker that we were already connected to<NEW_LINE>String connectionId = String.format("%s/%s", mqttClient.getServerURI(), mqttClient.getClientId());<NEW_LINE>if (lastConnectionId != null && !connectionId.equals(lastConnectionId)) {<NEW_LINE>eventBus.post(new Events.EndpointChanged());<NEW_LINE>lastConnectionId = connectionId;<NEW_LINE>Timber.v("lastConnectionId changed to: %s", lastConnectionId);<NEW_LINE>}<NEW_LINE>if (// Don't subscribe if base topic is invalid<NEW_LINE>!preferences.getSub())<NEW_LINE>return;<NEW_LINE>Set<String> topics = getTopicsToSubscribeTo(preferences.getSubTopic(), preferences.getInfo(), preferences.getPubTopicInfoPart(), preferences.getPubTopicEventsPart(), preferences.getPubTopicWaypointsPart());<NEW_LINE>// Receive commands for us<NEW_LINE>topics.add(preferences.getPubTopicBase() + preferences.getPubTopicCommandsPart());<NEW_LINE>subscribe(topics.toArray(new String[0]));<NEW_LINE>messageProcessor.resetMessageSleepBlock();<NEW_LINE>}
"MQTT connected!. Running onconnect handler (threadID %s)", Thread.currentThread());
1,145,162
private void updateConfigForCredentialProvider() {<NEW_LINE>String cpPaths = siteConfig.get(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey());<NEW_LINE>if (cpPaths != null && !Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getDefaultValue().equals(cpPaths)) {<NEW_LINE>// Already configured<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File keystoreFile = new File(getConfDir(), "credential-provider.jks");<NEW_LINE>String keystoreUri = "jceks://file" + keystoreFile.getAbsolutePath();<NEW_LINE>Configuration conf = getHadoopConfiguration();<NEW_LINE>HadoopCredentialProvider.setPath(conf, keystoreUri);<NEW_LINE>// Set the URI on the siteCfg<NEW_LINE>siteConfig.put(Property.<MASK><NEW_LINE>Iterator<Entry<String, String>> entries = siteConfig.entrySet().iterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Entry<String, String> entry = entries.next();<NEW_LINE>// Not a @Sensitive Property, ignore it<NEW_LINE>if (!Property.isSensitive(entry.getKey())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Add the @Sensitive Property to the CredentialProvider<NEW_LINE>try {<NEW_LINE>HadoopCredentialProvider.createEntry(conf, entry.getKey(), entry.getValue().toCharArray());<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.warn("Attempted to add " + entry.getKey() + " to CredentialProvider but failed", e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Only remove it from the siteCfg if we succeeded in adding it to the CredentialProvider<NEW_LINE>entries.remove();<NEW_LINE>}<NEW_LINE>}
GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey(), keystoreUri);
1,105,811
public static OptionParser createOptionParser() {<NEW_LINE>OptionParser parser = new OptionParser();<NEW_LINE>// commmon<NEW_LINE>parser.acceptsAll(Arrays.asList("help", "?", "h"), "shows this help").forHelp();<NEW_LINE>parser.acceptsAll(Arrays.asList("n", "iteration"), "vjtop will exit after n output iterations (defaults to unlimit)").withRequiredArg().ofType(Integer.class);<NEW_LINE>parser.acceptsAll(Arrays.asList("i", "interval", "d"), "interval between each output iteration (defaults to 10s)").withRequiredArg().ofType(Integer.class);<NEW_LINE>parser.acceptsAll(Arrays.asList("w", "width"), "Number of columns for the console display (defaults to 100)").withRequiredArg().ofType(Integer.class);<NEW_LINE>parser.acceptsAll(Arrays.asList("l", "limit"), "Number of threads to display ( default to 10 threads)").withRequiredArg().ofType(Integer.class);<NEW_LINE>parser.acceptsAll(Arrays.asList("f", "filter"), "Thread name filter ( no default)").withRequiredArg(<MASK><NEW_LINE>parser.acceptsAll(Arrays.asList("j", "jmxurl"), "give JMX url like 127.0.0.1:7001 when VM attach doesn't work").withRequiredArg().ofType(String.class);<NEW_LINE>// detail mode<NEW_LINE>parser.acceptsAll(Arrays.asList("m", "mode"), "number of thread display mode: \n" + " cpu(default): display thread cpu usage and sort by its delta cpu time\n" + " syscpu: display thread cpu usage and sort by delta syscpu time\n" + " totalcpu: display thread cpu usage and sort by total cpu time\n" + " totalsyscpu: display thread cpu usage and sort by total syscpu time\n" + " memory: display thread memory allocated and sort by delta\n" + " totalmemory: display thread memory allocated and sort by total").withRequiredArg().ofType(String.class);<NEW_LINE>parser.acceptsAll(Arrays.asList("o", "output"), "output format: \n" + " console(default): console with warning and flush ansi code\n" + " clean: console without warning and flush ansi code\n" + " text: plain text like /proc/status for 3rd tools\n").withRequiredArg().ofType(String.class);<NEW_LINE>parser.acceptsAll(Arrays.asList("c", "content"), "output content: \n" + " all(default): jvm info and theads info\n jvm: only jvm info\n thread: only thread info\n").withRequiredArg().ofType(String.class);<NEW_LINE>return parser;<NEW_LINE>}
).ofType(String.class);
1,689,986
public RFuture<Map<String, Map<StreamMessageId, Map<K, V>>>> readGroupAsync(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId id, Map<String, StreamMessageId> keyToId) {<NEW_LINE>List<Object> params = new ArrayList<Object>();<NEW_LINE>params.add("GROUP");<NEW_LINE>params.add(groupName);<NEW_LINE>params.add(consumerName);<NEW_LINE>if (count > 0) {<NEW_LINE>params.add("COUNT");<NEW_LINE>params.add(count);<NEW_LINE>}<NEW_LINE>if (timeout > 0) {<NEW_LINE>params.add("BLOCK");<NEW_LINE>params.add(toSeconds(timeout, unit) * 1000);<NEW_LINE>}<NEW_LINE>params.add("STREAMS");<NEW_LINE>params.add(getRawName());<NEW_LINE>params.<MASK><NEW_LINE>if (id == null) {<NEW_LINE>params.add(">");<NEW_LINE>} else {<NEW_LINE>params.add(id);<NEW_LINE>}<NEW_LINE>for (StreamMessageId nextId : keyToId.values()) {<NEW_LINE>params.add(nextId.toString());<NEW_LINE>}<NEW_LINE>if (timeout > 0) {<NEW_LINE>return commandExecutor.writeAsync(getRawName(), codec, RedisCommands.XREADGROUP_BLOCKING, params.toArray());<NEW_LINE>}<NEW_LINE>return commandExecutor.writeAsync(getRawName(), codec, RedisCommands.XREADGROUP, params.toArray());<NEW_LINE>}
addAll(keyToId.keySet());
305,140
static void artifactNamePatternFromStarlark(StarlarkInfo artifactNamePatternStruct, ArtifactNamePatternAdder adder) throws EvalException {<NEW_LINE>checkRightProviderType(artifactNamePatternStruct, "artifact_name_pattern");<NEW_LINE>String categoryName = getMandatoryFieldFromStarlarkProvider(<MASK><NEW_LINE>if (categoryName == null || categoryName.isEmpty()) {<NEW_LINE>throw infoError(artifactNamePatternStruct, "The 'category_name' field of artifact_name_pattern must be a nonempty string.");<NEW_LINE>}<NEW_LINE>ArtifactCategory foundCategory = null;<NEW_LINE>for (ArtifactCategory artifactCategory : ArtifactCategory.values()) {<NEW_LINE>if (categoryName.equals(artifactCategory.getCategoryName())) {<NEW_LINE>foundCategory = artifactCategory;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (foundCategory == null) {<NEW_LINE>throw infoError(artifactNamePatternStruct, "Artifact category %s not recognized.", categoryName);<NEW_LINE>}<NEW_LINE>String extension = Strings.nullToEmpty(getMandatoryFieldFromStarlarkProvider(artifactNamePatternStruct, "extension", String.class));<NEW_LINE>if (!foundCategory.getAllowedExtensions().contains(extension)) {<NEW_LINE>throw infoError(artifactNamePatternStruct, "Unrecognized file extension '%s', allowed extensions are %s," + " please check artifact_name_pattern configuration for %s in your rule.", extension, StringUtil.joinEnglishList(foundCategory.getAllowedExtensions(), "or", "'"), foundCategory.getCategoryName());<NEW_LINE>}<NEW_LINE>String prefix = Strings.nullToEmpty(getMandatoryFieldFromStarlarkProvider(artifactNamePatternStruct, "prefix", String.class));<NEW_LINE>adder.add(foundCategory, prefix, extension);<NEW_LINE>}
artifactNamePatternStruct, "category_name", String.class);
503,099
protected AstRoot parseEcmascript(final String sourceCode, final List<ParseProblem> parseProblems) throws ParseException {<NEW_LINE>final CompilerEnvirons compilerEnvirons = new CompilerEnvirons();<NEW_LINE>compilerEnvirons.setRecordingComments(parserOptions.isRecordingComments());<NEW_LINE>compilerEnvirons.setRecordingLocalJsDocComments(parserOptions.isRecordingLocalJsDocComments());<NEW_LINE>compilerEnvirons.setLanguageVersion(parserOptions.getRhinoLanguageVersion().getVersion());<NEW_LINE>// Scope's don't appear to get set right without this<NEW_LINE>compilerEnvirons.setIdeMode(true);<NEW_LINE>compilerEnvirons.setWarnTrailingComma(true);<NEW_LINE>// see bug #1150 "EmptyExpression" for valid statements!<NEW_LINE>compilerEnvirons.setReservedKeywordAsIdentifier(true);<NEW_LINE>// TODO We should do something with Rhino errors...<NEW_LINE>final ErrorCollector errorCollector = new ErrorCollector();<NEW_LINE>final Parser parser = new Parser(compilerEnvirons, errorCollector);<NEW_LINE>// TODO Fix hardcode<NEW_LINE>final String sourceURI = "unknown";<NEW_LINE>final int beginLineno = 1;<NEW_LINE>AstRoot astRoot = parser.<MASK><NEW_LINE>parseProblems.addAll(errorCollector.getErrors());<NEW_LINE>return astRoot;<NEW_LINE>}
parse(sourceCode, sourceURI, beginLineno);
171,153
protected <T> Stream<T> doStream(Query query, Class<?> entityType, String collectionName, Class<T> returnType) {<NEW_LINE><MASK><NEW_LINE>Assert.notNull(entityType, "Entity type must not be null!");<NEW_LINE>Assert.hasText(collectionName, "Collection name must not be null or empty!");<NEW_LINE>Assert.notNull(returnType, "ReturnType must not be null!");<NEW_LINE>return execute(collectionName, (CollectionCallback<Stream<T>>) collection -> {<NEW_LINE>MongoPersistentEntity<?> persistentEntity = mappingContext.getPersistentEntity(entityType);<NEW_LINE>QueryContext queryContext = queryOperations.createQueryContext(query);<NEW_LINE>EntityProjection<T, ?> projection = operations.introspectProjection(returnType, entityType);<NEW_LINE>Document mappedQuery = queryContext.getMappedQuery(persistentEntity);<NEW_LINE>Document mappedFields = queryContext.getMappedFields(persistentEntity, projection);<NEW_LINE>FindIterable<Document> cursor = new QueryCursorPreparer(query, entityType).initiateFind(collection, col -> col.find(mappedQuery, Document.class).projection(mappedFields));<NEW_LINE>return new CloseableIterableCursorAdapter<>(cursor, exceptionTranslator, new ProjectingReadCallback<>(mongoConverter, projection, collectionName)).stream();<NEW_LINE>});<NEW_LINE>}
Assert.notNull(query, "Query must not be null!");
1,449,728
private static void generateEditJsp(Project project, CompilationController controller, String entityClass, String simpleEntityName, String managedBean, String fieldName, String linkToIndex, BaseDocument doc, final FileObject jsfRoot, EmbeddedPkSupport embeddedPkSupport, String controllerClass, String styleAndScriptTags, String controllerPackage) throws FileStateInvalidException, IOException {<NEW_LINE>final Charset encoding = JpaControllerUtil.getProjectEncoding(project, jsfRoot);<NEW_LINE>// NOI18N<NEW_LINE>String content = JSFFrameworkProvider.readResource(JSFClientGenerator.class.getClassLoader().getResourceAsStream(TEMPLATE_FOLDER + EDIT_JSP_TEMPLATE), "UTF-8");<NEW_LINE>content = content.replaceAll(ENCODING_VAR, Matcher.quoteReplacement(encoding.name()));<NEW_LINE>content = content.replaceAll(ENTITY_NAME_VAR, Matcher.quoteReplacement(simpleEntityName));<NEW_LINE>content = content.replaceAll(LINK_TO_SS_VAR<MASK><NEW_LINE>content = content.replaceAll(MANAGED_BEAN_NAME_VAR, Matcher.quoteReplacement(managedBean));<NEW_LINE>StringBuffer formBody = new StringBuffer();<NEW_LINE>String utilPackage = controllerPackage == null || controllerPackage.length() == 0 ? PersistenceClientIterator.UTIL_FOLDER_NAME : controllerPackage + "." + PersistenceClientIterator.UTIL_FOLDER_NAME;<NEW_LINE>String jsfUtilClass = utilPackage + "." + PersistenceClientIterator.UTIL_CLASS_NAMES[1];<NEW_LINE>TypeElement typeElement = controller.getElements().getTypeElement(entityClass);<NEW_LINE>JsfForm.createForm(controller, typeElement, JsfForm.FORM_TYPE_EDIT, managedBean + "." + fieldName, formBody, entityClass, embeddedPkSupport, controllerClass, jsfUtilClass);<NEW_LINE>content = content.replaceAll(FORM_BODY_VAR, Matcher.quoteReplacement(formBody.toString()));<NEW_LINE>content = content.replaceAll(FIELD_NAME_VAR, Matcher.quoteReplacement(fieldName));<NEW_LINE>content = content.replaceAll(JSF_UTIL_CLASS_VAR, Matcher.quoteReplacement(jsfUtilClass));<NEW_LINE>content = content.replaceAll(LINK_TO_INDEX_VAR, Matcher.quoteReplacement(linkToIndex));<NEW_LINE>try {<NEW_LINE>content = reformat(content, doc);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>Logger.getLogger(JSFClientGenerator.class.getName()).log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>final String editText = content;<NEW_LINE>createFile(jsfRoot, editText, EDIT_JSP, encoding);<NEW_LINE>}
, Matcher.quoteReplacement(styleAndScriptTags));
1,143,991
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>FunFact fact = (FunFact) Objects.requireNonNull(getArguments()).getSerializable(EXTRA_MESSAGE_FUNFACT_OBJECT);<NEW_LINE>View view = inflater.inflate(R.<MASK><NEW_LINE>ViewHolder holder = new ViewHolder(view);<NEW_LINE>if (fact != null) {<NEW_LINE>(holder.desc).setText(fact.getText());<NEW_LINE>(holder.title).setText(fact.getTitle());<NEW_LINE>if (fact.getSource() != null && !fact.getSource().equals("null")) {<NEW_LINE>(holder.text_source).setVisibility(View.VISIBLE);<NEW_LINE>(holder.text_source).setOnClickListener(view1 -> openURL(fact.getSourceURL()));<NEW_LINE>(holder.source).setText(fact.getSource());<NEW_LINE>(holder.source).setOnClickListener(view1 -> openURL(fact.getSourceURL()));<NEW_LINE>(holder.share).setOnClickListener(view1 -> shareClicked());<NEW_LINE>}<NEW_LINE>Picasso.with(getContext()).load(fact.getImage()).error(R.drawable.placeholder_image).placeholder(R.drawable.placeholder_image).into(holder.image);<NEW_LINE>}<NEW_LINE>return view;<NEW_LINE>}
layout.fragment_funfact, container, false);
108,730
protected void addCalcMemberPropToMeasure(MondrianGuiDef.Measure measure, int parentIndex, TreePath tpath) {<NEW_LINE>MondrianGuiDef.CalculatedMemberProperty property = new MondrianGuiDef.CalculatedMemberProperty();<NEW_LINE>property.name = "";<NEW_LINE>if (measure.memberProperties == null) {<NEW_LINE>measure.memberProperties = new MondrianGuiDef.CalculatedMemberProperty[0];<NEW_LINE>}<NEW_LINE>property.name = getNewName(getResourceConverter().getString("schemaExplorer.newProperty.title", "New Property"), measure.memberProperties);<NEW_LINE>NodeDef[] temp = measure.memberProperties;<NEW_LINE>measure.memberProperties = new MondrianGuiDef.CalculatedMemberProperty[temp.length + 1];<NEW_LINE>for (int i = 0; i < temp.length; i++) {<NEW_LINE>measure.memberProperties[i] = (MondrianGuiDef.CalculatedMemberProperty) temp[i];<NEW_LINE>}<NEW_LINE>measure.memberProperties[measure.memberProperties.length - 1] = property;<NEW_LINE>Object[] parentPathObjs = new Object[parentIndex + 1];<NEW_LINE>for (int i = 0; i <= parentIndex; i++) {<NEW_LINE>parentPathObjs[i<MASK><NEW_LINE>}<NEW_LINE>TreePath parentPath = new TreePath(parentPathObjs);<NEW_LINE>tree.setSelectionPath(parentPath.pathByAddingChild(property));<NEW_LINE>refreshTree(tree.getSelectionPath());<NEW_LINE>setTableCellFocus(0);<NEW_LINE>}
] = tpath.getPathComponent(i);
113,472
public SearchResponse searchWithRetry(SearchRequest searchRequest, String jobId, Supplier<Boolean> shouldRetry, Consumer<String> retryMsgHandler) {<NEW_LINE>final PlainActionFuture<SearchResponse> getResponse = PlainActionFuture.newFuture();<NEW_LINE>final Object key = new Object();<NEW_LINE>final ActionListener<SearchResponse> removeListener = ActionListener.runBefore(getResponse, () <MASK><NEW_LINE>SearchRetryableAction mlRetryableAction = new SearchRetryableAction(jobId, searchRequest, client, () -> (isShutdown == false) && shouldRetry.get(), retryMsgHandler, removeListener);<NEW_LINE>onGoingRetryableSearchActions.put(key, mlRetryableAction);<NEW_LINE>mlRetryableAction.run();<NEW_LINE>if (isShutdown) {<NEW_LINE>mlRetryableAction.cancel(new CancellableThreads.ExecutionCancelledException("Node is shutting down"));<NEW_LINE>}<NEW_LINE>return getResponse.actionGet();<NEW_LINE>}
-> onGoingRetryableSearchActions.remove(key));
674,370
public NodeInterface saveOutgoingMessage(final SecurityContext securityContext, final AdvancedMailContainer amc, final String messageId) {<NEW_LINE>NodeInterface outgoingMessage = null;<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>try (final Tx tx = app.tx()) {<NEW_LINE>PropertyMap props = new PropertyMap();<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "from"), amc.getDisplayName(amc.getFromName(), amc.getFromAddress()));<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "fromMail"), amc.getFromAddress());<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "to"), amc.getCombinedDisplayNames(amc.getTo()));<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "subject"), amc.getSubject());<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "content"), amc.getTextContent());<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "htmlContent"), amc.getHtmlContent());<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "sentDate"), new Date());<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "messageId"), messageId);<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "inReplyTo"<MASK><NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "header"), new Gson().toJson(amc.getCustomHeaders()));<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "replyTo"), amc.getCombinedDisplayNames(amc.getReplyTo()));<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "bcc"), amc.getCombinedDisplayNames(amc.getBcc()));<NEW_LINE>if (amc.getAttachments().size() > 0) {<NEW_LINE>final ArrayList concreteAttachedFiles = new ArrayList();<NEW_LINE>for (final DynamicMailAttachment attachment : amc.getAttachments()) {<NEW_LINE>final File savedFile = handleOutgoingMailAttachment(securityContext, attachment);<NEW_LINE>if (savedFile != null) {<NEW_LINE>concreteAttachedFiles.add(savedFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>props.put(StructrApp.key(EMailMessage.class, "attachedFiles"), concreteAttachedFiles);<NEW_LINE>}<NEW_LINE>// not setting folder/receivedDate<NEW_LINE>// props.put(StructrApp.key(entityType, "folder"), null);<NEW_LINE>// props.put(StructrApp.key(entityType, "receivedDate"), null);<NEW_LINE>outgoingMessage = app.create(EMailMessage.class, props);<NEW_LINE>tx.success();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.warn("Error creating outgoing mail!", t);<NEW_LINE>}<NEW_LINE>return outgoingMessage;<NEW_LINE>}
), amc.getInReplyTo());
1,173,682
static Span generateSpan(SpanData spanData, Endpoint localEndpoint) {<NEW_LINE>SpanContext context = spanData.getContext();<NEW_LINE>long startTimestamp = toEpochMicros(spanData.getStartTimestamp());<NEW_LINE>// TODO(sebright): Fix the Checker Framework warning.<NEW_LINE>@SuppressWarnings("nullness")<NEW_LINE>long endTimestamp = <MASK><NEW_LINE>// TODO(bdrutu): Fix the Checker Framework warning.<NEW_LINE>@SuppressWarnings("nullness")<NEW_LINE>Span.Builder spanBuilder = Span.newBuilder().traceId(context.getTraceId().toLowerBase16()).id(context.getSpanId().toLowerBase16()).kind(toSpanKind(spanData)).name(spanData.getName()).timestamp(toEpochMicros(spanData.getStartTimestamp())).duration(endTimestamp - startTimestamp).localEndpoint(localEndpoint);<NEW_LINE>if (spanData.getParentSpanId() != null && spanData.getParentSpanId().isValid()) {<NEW_LINE>spanBuilder.parentId(spanData.getParentSpanId().toLowerBase16());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, AttributeValue> label : spanData.getAttributes().getAttributeMap().entrySet()) {<NEW_LINE>spanBuilder.putTag(label.getKey(), attributeValueToString(label.getValue()));<NEW_LINE>}<NEW_LINE>Status status = spanData.getStatus();<NEW_LINE>if (status != null) {<NEW_LINE>spanBuilder.putTag(STATUS_CODE, status.getCanonicalCode().toString());<NEW_LINE>if (status.getDescription() != null) {<NEW_LINE>spanBuilder.putTag(STATUS_DESCRIPTION, status.getDescription());<NEW_LINE>}<NEW_LINE>if (!status.isOk()) {<NEW_LINE>spanBuilder.putTag(STATUS_ERROR, status.getCanonicalCode().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TimedEvent<Annotation> annotation : spanData.getAnnotations().getEvents()) {<NEW_LINE>spanBuilder.addAnnotation(toEpochMicros(annotation.getTimestamp()), annotation.getEvent().getDescription());<NEW_LINE>}<NEW_LINE>for (TimedEvent<io.opencensus.trace.MessageEvent> messageEvent : spanData.getMessageEvents().getEvents()) {<NEW_LINE>spanBuilder.addAnnotation(toEpochMicros(messageEvent.getTimestamp()), messageEvent.getEvent().getType().name());<NEW_LINE>}<NEW_LINE>return spanBuilder.build();<NEW_LINE>}
toEpochMicros(spanData.getEndTimestamp());
91,088
public static OfferedPsks parse(InputStream input) throws IOException {<NEW_LINE>Vector identities = new Vector();<NEW_LINE>{<NEW_LINE>int totalLengthIdentities = TlsUtils.readUint16(input);<NEW_LINE>if (totalLengthIdentities < 7) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>byte[] identitiesData = TlsUtils.readFully(totalLengthIdentities, input);<NEW_LINE>ByteArrayInputStream buf = new ByteArrayInputStream(identitiesData);<NEW_LINE>do {<NEW_LINE>PskIdentity identity = PskIdentity.parse(buf);<NEW_LINE>identities.add(identity);<NEW_LINE>} while (buf.available() > 0);<NEW_LINE>}<NEW_LINE>Vector binders = new Vector();<NEW_LINE>int totalLengthBinders = TlsUtils.readUint16(input);<NEW_LINE>{<NEW_LINE>if (totalLengthBinders < 33) {<NEW_LINE>throw new TlsFatalAlert(AlertDescription.decode_error);<NEW_LINE>}<NEW_LINE>byte[] bindersData = TlsUtils.readFully(totalLengthBinders, input);<NEW_LINE>ByteArrayInputStream buf = new ByteArrayInputStream(bindersData);<NEW_LINE>do {<NEW_LINE>byte[] binder = TlsUtils.readOpaque8(buf, 32);<NEW_LINE>binders.add(binder);<NEW_LINE>} while (buf.available() > 0);<NEW_LINE>}<NEW_LINE>return new OfferedPsks(identities, binders, 2 + totalLengthBinders);<NEW_LINE>}
throw new TlsFatalAlert(AlertDescription.decode_error);
245,496
public <T extends JpaObject, W extends Object> List<T> listEqualAndEqualAndIn(Class<T> cls, String firstAttribute, Object firstValue, String secondAttribute, Object secondValue, String thirdAttribute, Collection<W> thirdValues) throws Exception {<NEW_LINE>EntityManager em = this.get(cls);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<T> <MASK><NEW_LINE>Root<T> root = cq.from(cls);<NEW_LINE>Predicate p = cb.equal(root.get(firstAttribute), firstValue);<NEW_LINE>p = cb.and(p, cb.equal(root.get(secondAttribute), secondValue));<NEW_LINE>p = cb.and(p, cb.isMember(root.get(thirdAttribute), cb.literal(thirdValues)));<NEW_LINE>List<T> os = em.createQuery(cq.select(root).where(p)).getResultList();<NEW_LINE>List<T> list = new ArrayList<>(os);<NEW_LINE>return list;<NEW_LINE>}
cq = cb.createQuery(cls);
657,379
private Properties loadProperties(FileObject f) {<NEW_LINE>Source s = Source.create(f);<NEW_LINE>final Document <MASK><NEW_LINE>final Properties props = new Properties();<NEW_LINE>if (doc == null) {<NEW_LINE>LOG.fine("Loading properties from " + f);<NEW_LINE>try (InputStream is = f.getInputStream()) {<NEW_LINE>props.load(is);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// no op<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.fine("Loading properties from document " + doc + " created from " + f);<NEW_LINE>doc.render(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>int l = doc.getLength();<NEW_LINE>try {<NEW_LINE>String s = doc.getText(0, l);<NEW_LINE>props.load(new StringReader(s));<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return props;<NEW_LINE>}
doc = s.getDocument(false);
1,160,922
public void exitRbn_remote_as(Rbn_remote_asContext ctx) {<NEW_LINE>boolean ipv4 = false;<NEW_LINE>boolean ipv6 = false;<NEW_LINE>if (Ip.tryParse(_currentNeighborName).isPresent()) {<NEW_LINE>ipv4 = true;<NEW_LINE>} else if (Ip6.tryParse(_currentNeighborName).isPresent()) {<NEW_LINE>ipv6 = true;<NEW_LINE>} else if (_currentPeerGroup == null) {<NEW_LINE>_w.redFlag(String.format("Cannot assign remote-as to non-existent peer-group: '%s' in: '%s'", _currentNeighborName, getFullText(ctx.getParent().getParent())));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (_currentAbstractNeighbor == null) {<NEW_LINE>_currentAbstractNeighbor = _currentBgpProcess.getNeighbors().computeIfAbsent(_currentNeighborName, BgpNeighbor::new);<NEW_LINE>_c.defineStructure(F5BigipStructureType.BGP_NEIGHBOR, _currentNeighborName, (ParserRuleContext) ctx.parent);<NEW_LINE>_c.referenceStructure(F5BigipStructureType.BGP_NEIGHBOR, _currentNeighborName, F5BigipStructureUsage.BGP_NEIGHBOR_SELF_REFERENCE, ctx.<MASK><NEW_LINE>_currentAbstractNeighbor.getIpv4AddressFamily().setActivate(ipv4);<NEW_LINE>_currentAbstractNeighbor.getIpv6AddressFamily().setActivate(ipv6);<NEW_LINE>}<NEW_LINE>_currentAbstractNeighbor.setRemoteAs(toLong(ctx.remoteas));<NEW_LINE>}
getStart().getLine());
983,462
private void processUpdate(String commandString) {<NEW_LINE>if (COMMAND_PATTERN.matcher(commandString).matches()) {<NEW_LINE>String command = commandString.substring(0, 2);<NEW_LINE>String value = commandString.substring(2, commandString.length()).trim();<NEW_LINE>// Secondary zone commands with a parameter<NEW_LINE>if (ZONE_SUBCOMMAND_PATTERN.matcher(commandString).matches()) {<NEW_LINE>command = commandString.substring(0, 4);<NEW_LINE>value = commandString.substring(4, commandString.length()).trim();<NEW_LINE>}<NEW_LINE>logger.debug("Command: {}, value: {}", command, value);<NEW_LINE>if (value.equals("ON") || value.equals("OFF")) {<NEW_LINE>sendUpdate(command, OnOffType.valueOf(value));<NEW_LINE>} else if (value.equals("STANDBY")) {<NEW_LINE>sendUpdate(command, OnOffType.OFF);<NEW_LINE>} else if (StringUtils.isNumeric(value)) {<NEW_LINE>PercentType percent = new PercentType(fromDenonValue(value));<NEW_LINE>command = translateVolumeCommand(command);<NEW_LINE>sendUpdate(command, percent);<NEW_LINE>} else if (command.equals("SI")) {<NEW_LINE>sendUpdate(DenonProperty.INPUT.getCode(<MASK><NEW_LINE>sendUpdate(commandString, OnOffType.ON);<NEW_LINE>} else if (command.equals("MS")) {<NEW_LINE>sendUpdate(DenonProperty.SURROUND_MODE.getCode(), new StringType(value));<NEW_LINE>} else if (command.equals("NS")) {<NEW_LINE>processTitleCommand(command, value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug("Invalid command: " + commandString);<NEW_LINE>}<NEW_LINE>}
), new StringType(value));
1,099,234
public String create(User user, String userId) throws Exception {<NEW_LINE>// Create the user UUID<NEW_LINE>user.setId(UUID.randomUUID().toString());<NEW_LINE>// Checks for user unicity<NEW_LINE>EntityManager em = ThreadLocalContext.get().getEntityManager();<NEW_LINE>Query q = em.createQuery("select u from User u where u.username = :username and u.deleteDate is null");<NEW_LINE>q.setParameter("username", user.getUsername());<NEW_LINE>List<?<MASK><NEW_LINE>if (l.size() > 0) {<NEW_LINE>throw new Exception("AlreadyExistingUsername");<NEW_LINE>}<NEW_LINE>// Create the user<NEW_LINE>user.setCreateDate(new Date());<NEW_LINE>user.setPassword(hashPassword(user.getPassword()));<NEW_LINE>user.setPrivateKey(EncryptionUtil.generatePrivateKey());<NEW_LINE>user.setStorageCurrent(0L);<NEW_LINE>em.persist(user);<NEW_LINE>// Create audit log<NEW_LINE>AuditLogUtil.create(user, AuditLogType.CREATE, userId);<NEW_LINE>return user.getId();<NEW_LINE>}
> l = q.getResultList();
44,931
final StartContactRecordingResult executeStartContactRecording(StartContactRecordingRequest startContactRecordingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startContactRecordingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartContactRecordingRequest> request = null;<NEW_LINE>Response<StartContactRecordingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartContactRecordingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startContactRecordingRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartContactRecording");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartContactRecordingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartContactRecordingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Connect");
1,412,884
private static String dumpActionMapInfo(ActionMap map, Object q, Lookup prev, Lookup now, Lookup globalContext, Lookup originalLkp) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>sb.append("We really get map from the lookup. Map: ").append(map).append(" returned: ").// NOI18N<NEW_LINE>append(q);<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nprev: ").append(prev == null ? "null prev" : prev.lookupAll(Object.class));<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nnow : ").append(now == null ? "null now" : now.lookupAll(Object.class));<NEW_LINE>// NOI18N<NEW_LINE>sb.append("\nglobal ctx : ").append(globalContext == null ? "null" : globalContext<MASK><NEW_LINE>// NOI18N<NEW_LINE>sb.append("\noriginal lkp : ").append(originalLkp == null ? "null" : originalLkp.lookupAll(Object.class));<NEW_LINE>return sb.toString();<NEW_LINE>}
.lookupAll(Object.class));
677,147
private <E extends Member & AnnotatedElement> Object trace(InvocationContext context, E element, Class<?> declaringClass) throws Exception {<NEW_LINE>if (null != declaringClass.getAnnotation(Path.class)) {<NEW_LINE>return context.proceed();<NEW_LINE>}<NEW_LINE>Traced annotation = <MASK><NEW_LINE>if (null == annotation) {<NEW_LINE>annotation = declaringClass.getAnnotation(Traced.class);<NEW_LINE>if (null == annotation) {<NEW_LINE>return context.proceed();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (annotation.value()) {<NEW_LINE>String newName = annotation.operationName();<NEW_LINE>if (newName.isEmpty()) {<NEW_LINE>newName = spanName(declaringClass, element);<NEW_LINE>}<NEW_LINE>Tracer tracer = locateTracer();<NEW_LINE>Optional<SpanContext> parentSpan = locateParent();<NEW_LINE>Tracer.SpanBuilder spanBuilder = tracer.buildSpan(newName);<NEW_LINE>parentSpan.ifPresent(spanBuilder::asChildOf);<NEW_LINE>Span span = spanBuilder.start();<NEW_LINE>Scope scope = tracer.scopeManager().activate(span);<NEW_LINE>try {<NEW_LINE>return context.proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE>span.setTag("error", true);<NEW_LINE>span.log(Map.of("error.object", e.getClass().getName(), "event", "error"));<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>span.finish();<NEW_LINE>scope.close();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return context.proceed();<NEW_LINE>}<NEW_LINE>}
element.getAnnotation(Traced.class);