idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
93,639
final CalculateRouteResult executeCalculateRoute(CalculateRouteRequest calculateRouteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(calculateRouteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CalculateRouteRequest> request = null;<NEW_LINE>Response<CalculateRouteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CalculateRouteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(calculateRouteRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Location");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CalculateRoute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "routes.";<NEW_LINE>String resolvedHostPrefix = String.format("routes.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CalculateRouteResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CalculateRouteResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
82,630
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) throws SchedulerConfigException {<NEW_LINE>// Absolutely needs thread-bound DataSource to initialize.<NEW_LINE>this.dataSource = SchedulerFactoryBean.getConfigTimeDataSource();<NEW_LINE>if (this.dataSource == null) {<NEW_LINE>throw new SchedulerConfigException("No local DataSource found for configuration - " + "'dataSource' property must be set on SchedulerFactoryBean");<NEW_LINE>}<NEW_LINE>// Configure transactional connection settings for Quartz.<NEW_LINE>setDataSource(TX_DATA_SOURCE_PREFIX + getInstanceName());<NEW_LINE>setDontSetAutoCommitFalse(true);<NEW_LINE>// Register transactional ConnectionProvider for Quartz.<NEW_LINE>DBConnectionManager.getInstance().addConnectionProvider(TX_DATA_SOURCE_PREFIX + getInstanceName(), new ConnectionProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Connection getConnection() throws SQLException {<NEW_LINE>// Return a transactional Connection, if any.<NEW_LINE>return DataSourceUtils.doGetConnection(dataSource);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void shutdown() {<NEW_LINE>// Do nothing - a Spring-managed DataSource has its own lifecycle.<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void initialize() {<NEW_LINE>// Do nothing - a Spring-managed DataSource has its own lifecycle.<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Non-transactional DataSource is optional: fall back to default<NEW_LINE>// DataSource if not explicitly specified.<NEW_LINE>DataSource nonTxDataSource = SchedulerFactoryBean.getConfigTimeNonTransactionalDataSource();<NEW_LINE>final DataSource nonTxDataSourceToUse = (nonTxDataSource != null ? nonTxDataSource : this.dataSource);<NEW_LINE>// Configure non-transactional connection settings for Quartz.<NEW_LINE>setNonManagedTXDataSource(NON_TX_DATA_SOURCE_PREFIX + getInstanceName());<NEW_LINE>// Register non-transactional ConnectionProvider for Quartz.<NEW_LINE>DBConnectionManager.getInstance().addConnectionProvider(NON_TX_DATA_SOURCE_PREFIX + getInstanceName(), new ConnectionProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Connection getConnection() throws SQLException {<NEW_LINE>// Always return a non-transactional Connection.<NEW_LINE>return nonTxDataSourceToUse.getConnection();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void shutdown() {<NEW_LINE>// Do nothing - a Spring-managed DataSource has its own lifecycle.<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void initialize() {<NEW_LINE>// Do nothing - a Spring-managed DataSource has its own lifecycle.<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// No, if HSQL is the platform, we really don't want to use locks...<NEW_LINE>try {<NEW_LINE>String productName = JdbcUtils.extractDatabaseMetaData(this.dataSource, DatabaseMetaData::getDatabaseProductName);<NEW_LINE><MASK><NEW_LINE>if (productName != null && productName.toLowerCase().contains("hsql")) {<NEW_LINE>setUseDBLocks(false);<NEW_LINE>setLockHandler(new SimpleSemaphore());<NEW_LINE>}<NEW_LINE>} catch (MetaDataAccessException ex) {<NEW_LINE>logWarnIfNonZero(1, "Could not detect database type. Assuming locks can be taken.");<NEW_LINE>}<NEW_LINE>super.initialize(loadHelper, signaler);<NEW_LINE>}
productName = JdbcUtils.commonDatabaseName(productName);
812,587
public int handleTask(ConsoleWrapper stdin, PrintStream stdout, PrintStream stderr, String[] args) throws Exception {<NEW_LINE>setTaskIO(new TaskIO<MASK><NEW_LINE>setTaskArgs(args);<NEW_LINE>JobInstance jobInstance;<NEW_LINE>JobExecution jobExecution;<NEW_LINE>long executionId = resolveJobExecutionId();<NEW_LINE>if (executionId >= 0) {<NEW_LINE>jobExecution = getBatchRestClient().stop(executionId);<NEW_LINE>jobInstance = getBatchRestClient().getJobInstanceForJobExecution(jobExecution.getExecutionId());<NEW_LINE>} else {<NEW_LINE>jobInstance = getBatchRestClient().getJobInstance(getJobInstanceId());<NEW_LINE>jobExecution = getBatchRestClient().stop(jobInstance);<NEW_LINE>}<NEW_LINE>issueJobStopSubmittedMessage(jobInstance);<NEW_LINE>if (shouldWaitForTermination()) {<NEW_LINE>// If there are no job executions, consider the job stopped. If the status has not been updated<NEW_LINE>// because of a database problem, we don't want to sit and wait forever.<NEW_LINE>if (jobExecution.getExecutionId() == -1) {<NEW_LINE>issueJobStoppedMessage(jobInstance, null);<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>jobExecution = waitForTermination(jobInstance, jobExecution);<NEW_LINE>return getProcessReturnCode(jobExecution);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}
(stdin, stdout, stderr));
1,316,985
void buildNumTypes() {<NEW_LINE>Scope bnt = BaseNum.getTable();<NEW_LINE>String[] num_methods_num = { "__abs__", "__add__", "__coerce__", "__div__", "__divmod__", "__eq__", "__float__", "__floordiv__", "__format__", "__ge__", "__getformat__", "__gt__", "__int__", "__le__", "__long__", "__lt__", "__mod__", "__mul__", "__ne__", "__neg__", "__new__", "__nonzero__", "__pos__", "__pow__", "__radd__", "__rdiv__", "__rdivmod__", "__rfloordiv__", "__rmod__", "__rmul__", "__rpow__", "__rsub__", "__rtruediv__", "__setformat__", "__sub__", "__truediv__", "__trunc__", "as_integer_ratio", "fromhex", "is_integer" };<NEW_LINE>for (String m : num_methods_num) {<NEW_LINE>bnt.update(m, numUrl(), newFunc(BaseNum), METHOD);<NEW_LINE>}<NEW_LINE>bnt.update("__getnewargs__", numUrl(), newFunc(newTuple(BaseNum)), METHOD);<NEW_LINE>bnt.update("hex", numUrl(), newFunc(BaseStr), METHOD);<NEW_LINE>bnt.update("conjugate", numUrl(), newFunc(BaseComplex), METHOD);<NEW_LINE>Scope bct = BaseComplex.getTable();<NEW_LINE>String[] complex_methods = { "__abs__", "__add__", "__div__", "__divmod__", "__float__", "__floordiv__", "__format__", "__getformat__", "__int__", "__long__", "__mod__", "__mul__", "__neg__", "__new__", "__pos__", "__pow__", "__radd__", "__rdiv__", "__rdivmod__", "__rfloordiv__", "__rmod__", "__rmul__", "__rpow__", "__rsub__", <MASK><NEW_LINE>for (String c : complex_methods) {<NEW_LINE>bct.update(c, numUrl(), newFunc(BaseComplex), METHOD);<NEW_LINE>}<NEW_LINE>String[] complex_methods_num = { "__eq__", "__ge__", "__gt__", "__le__", "__lt__", "__ne__", "__nonzero__", "__coerce__" };<NEW_LINE>for (String cn : complex_methods_num) {<NEW_LINE>bct.update(cn, numUrl(), newFunc(BaseNum), METHOD);<NEW_LINE>}<NEW_LINE>bct.update("__getnewargs__", numUrl(), newFunc(newTuple(BaseComplex)), METHOD);<NEW_LINE>bct.update("imag", numUrl(), BaseNum, ATTRIBUTE);<NEW_LINE>bct.update("real", numUrl(), BaseNum, ATTRIBUTE);<NEW_LINE>}
"__rtruediv__", "__sub__", "__truediv__", "conjugate" };
798,363
public void changePermissions() {<NEW_LINE>logDebug("changePermissions");<NEW_LINE>notifyDataSetChanged();<NEW_LINE>int nodeType = checkBackupNodeTypeByHandle(megaApi, node);<NEW_LINE>if (nodeType != BACKUP_NONE) {<NEW_LINE>showWarningDialog();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dialogBuilder.setTitle(getString<MASK><NEW_LINE>final CharSequence[] items = { getString(R.string.file_properties_shared_folder_read_only), getString(R.string.file_properties_shared_folder_read_write), getString(R.string.file_properties_shared_folder_full_access) };<NEW_LINE>dialogBuilder.setSingleChoiceItems(items, selectedShare.getAccess(), (dialog, item) -> {<NEW_LINE>statusDialog = createProgressDialog(fileContactListActivity, getString(R.string.context_permissions_changing_folder));<NEW_LINE>permissionsDialog.dismiss();<NEW_LINE>cC.changePermission(selectedShare.getUser(), item, node, new ShareListener(getApplicationContext(), CHANGE_PERMISSIONS_LISTENER, 1));<NEW_LINE>});<NEW_LINE>permissionsDialog = dialogBuilder.create();<NEW_LINE>permissionsDialog.show();<NEW_LINE>}
(R.string.file_properties_shared_folder_permissions));
270,476
public void handle(final ErrorCode errCode, Map data) {<NEW_LINE>extEmitter.failedToRebootVm(VmInstanceInventory.valueOf(self), errCode);<NEW_LINE>if (HostErrors.FAILED_TO_STOP_VM_ON_HYPERVISOR.isEqual(errCode.getCode()) || HostErrors.FAILED_TO_START_VM_ON_HYPERVISOR.isEqual(errCode.getCode())) {<NEW_LINE>checkState(originalCopy.getHostUuid(), new NoErrorCompletion(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void done() {<NEW_LINE>self = refreshVO();<NEW_LINE>if ((originState == VmInstanceState.Running || originState == VmInstanceState.Paused) && self.getState() == VmInstanceState.Stopped) {<NEW_LINE>returnHostCpacity(spec.getDestHost().getUuid());<NEW_LINE>}<NEW_LINE>completion.fail(errCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>VmInstanceState currentState = Q.New(VmInstanceVO.class).select(VmInstanceVO_.state).eq(VmInstanceVO_.uuid, self.getUuid()).findValue();<NEW_LINE>if (currentState == VmInstanceState.Rebooting) {<NEW_LINE>SQL.New(VmInstanceVO.class).set(VmInstanceVO_.state, originState).eq(VmInstanceVO_.uuid, self.<MASK><NEW_LINE>}<NEW_LINE>completion.fail(errCode);<NEW_LINE>}<NEW_LINE>}
getUuid()).update();
1,097,150
final ListUsersResult executeListUsers(ListUsersRequest listUsersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUsersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUsersRequest> request = null;<NEW_LINE>Response<ListUsersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUsersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listUsersRequest));<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, "mq");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUsers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListUsersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListUsersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,293,400
public void addActionsToAdapter(final double latitude, final double longitude, final ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {<NEW_LINE>GpxSelectionHelper gpxHelper = app.getSelectedGpxHelper();<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_ADD_ID).setTitleId(selectedObj instanceof FavouritePoint ? R.string.favourites_context_menu_edit : R.string.shared_string_add, mapActivity).setIcon(selectedObj instanceof FavouritePoint ? R.drawable.ic_action_edit_dark : R.drawable.ic_action_favorite_stroke).setOrder(10));<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_MARKER_ID).setTitleId(selectedObj instanceof MapMarker ? R.string.shared_string_edit : R.string.shared_string_marker, mapActivity).setIcon(selectedObj instanceof MapMarker ? R.drawable.ic_action_edit_dark : R.drawable.ic_action_flag_stroke).setOrder(20));<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_SHARE_ID).setTitleId(R.string.shared_string_share, mapActivity).setIcon(R.drawable.ic_action_gshare_dark).setOrder(30));<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_MORE_ID).setTitleId(R.string.shared_string_actions, mapActivity).setIcon(R.drawable.ic_actions_menu).setOrder(40));<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_DIRECTIONS_FROM_ID).setTitleId(R.string.context_menu_item_directions_from, mapActivity).setIcon(R.drawable.ic_action_route_direction_from_here).setOrder(DIRECTIONS_FROM_ITEM_ORDER));<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_SEARCH_NEARBY).setTitleId(R.string.context_menu_item_search, mapActivity).setIcon(R.drawable.ic_action_search_dark).setOrder(SEARCH_NEAR_ITEM_ORDER));<NEW_LINE>OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj, configureMenu);<NEW_LINE>ItemClickListener listener = (adapter1, resId, pos, isChecked, viewCoordinates) -> {<NEW_LINE>if (resId == R.string.context_menu_item_add_waypoint) {<NEW_LINE>mapActivity.getContextMenu().addWptPt();<NEW_LINE>} else if (resId == R.string.context_menu_item_edit_waypoint) {<NEW_LINE>mapActivity.getContextMenu().editWptPt();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>};<NEW_LINE>ContextMenuItem editGpxItem = new ContextMenuItem(MAP_CONTEXT_MENU_ADD_GPX_WAYPOINT).setTitleId(R.string.context_menu_item_edit_waypoint, mapActivity).setIcon(R.drawable.ic_action_edit_dark).setOrder(EDIT_GPX_WAYPOINT_ITEM_ORDER).setListener(listener);<NEW_LINE>ContextMenuItem addGpxItem = new ContextMenuItem(MAP_CONTEXT_MENU_ADD_GPX_WAYPOINT).setTitleId(R.string.context_menu_item_add_waypoint, mapActivity).setIcon(R.drawable.ic_action_gnew_label_dark).setOrder<MASK><NEW_LINE>if (configureMenu) {<NEW_LINE>adapter.addItem(addGpxItem);<NEW_LINE>} else if (selectedObj instanceof WptPt && gpxHelper.getSelectedGPXFile((WptPt) selectedObj) != null) {<NEW_LINE>adapter.addItem(editGpxItem);<NEW_LINE>} else if (!gpxHelper.getSelectedGPXFiles().isEmpty() || (OsmandPlugin.isActive(OsmandMonitoringPlugin.class))) {<NEW_LINE>adapter.addItem(addGpxItem);<NEW_LINE>}<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_MEASURE_DISTANCE).setTitleId(R.string.plan_route, mapActivity).setIcon(R.drawable.ic_action_ruler).setOrder(MEASURE_DISTANCE_ITEM_ORDER));<NEW_LINE>adapter.addItem(new ContextMenuItem(MAP_CONTEXT_MENU_AVOID_ROAD).setTitleId(R.string.avoid_road, mapActivity).setIcon(R.drawable.ic_action_alert).setOrder(AVOID_ROAD_ITEM_ORDER));<NEW_LINE>}
(ADD_GPX_WAYPOINT_ITEM_ORDER).setListener(listener);
14,712
private void renderVSync(RenderContext ctx, Repainter repainter, Panel panel, VSync vsync) {<NEW_LINE>ctx.trace("VSync", () -> {<NEW_LINE>VSync.Data data = vsync.getData(state.toRequest(), TrackPanel.onUiThread(state, () -> repainter.repaint(new Area(0, 0, width, height))));<NEW_LINE>if (data == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TimeSpan visible = state.getVisibleTime();<NEW_LINE>ctx.setBackgroundColor(colors().vsyncBackground);<NEW_LINE>boolean fill = !data.fillFirst;<NEW_LINE>double lastX = LABEL_WIDTH;<NEW_LINE><MASK><NEW_LINE>for (long time : data.ts) {<NEW_LINE>fill = !fill;<NEW_LINE>if (time < visible.start) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>double x = LABEL_WIDTH + state.timeToPx(time);<NEW_LINE>if (fill) {<NEW_LINE>ctx.fillRect(lastX, 0, x - lastX, h);<NEW_LINE>}<NEW_LINE>lastX = x;<NEW_LINE>if (time > visible.end) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
double h = panel.getPreferredHeight();
509,057
public static void main(final String[] a) {<NEW_LINE>final long n = Long.parseLong(a[0]);<NEW_LINE>final long incr = Long.MAX_VALUE / (n / 2);<NEW_LINE>long start, elapsed;<NEW_LINE>for (int k = 10; k-- != 0; ) {<NEW_LINE>System.out.print("Broadword msb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) mostSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("java.lang msb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) Long.numberOfLeadingZeros(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("MSB-based lsb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) msbBasedLeastSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("Multiplication/lookup lsb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) multLookupLeastSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("Byte-by-byte lsb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) leastSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE><MASK><NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) Long.numberOfTrailingZeros(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>}<NEW_LINE>}
System.out.print("java.lang lsb: ");
1,357,419
protected void read(CompoundTag compound, boolean clientPacket) {<NEW_LINE>super.read(compound, clientPacket);<NEW_LINE>inputInventory.deserializeNBT<MASK><NEW_LINE>outputInventory.deserializeNBT(compound.getCompound("OutputItems"));<NEW_LINE>preferredSpoutput = null;<NEW_LINE>if (compound.contains("PreferredSpoutput"))<NEW_LINE>preferredSpoutput = NBTHelper.readEnum(compound, "PreferredSpoutput", Direction.class);<NEW_LINE>disabledSpoutputs.clear();<NEW_LINE>ListTag disabledList = compound.getList("DisabledSpoutput", Tag.TAG_STRING);<NEW_LINE>disabledList.forEach(d -> disabledSpoutputs.add(Direction.valueOf(((StringTag) d).getAsString())));<NEW_LINE>spoutputBuffer = NBTHelper.readItemList(compound.getList("Overflow", Tag.TAG_COMPOUND));<NEW_LINE>spoutputFluidBuffer = NBTHelper.readCompoundList(compound.getList("FluidOverflow", Tag.TAG_COMPOUND), FluidStack::loadFluidStackFromNBT);<NEW_LINE>if (!clientPacket)<NEW_LINE>return;<NEW_LINE>NBTHelper.iterateCompoundList(compound.getList("VisualizedItems", Tag.TAG_COMPOUND), c -> visualizedOutputItems.add(IntAttached.with(OUTPUT_ANIMATION_TIME, ItemStack.of(c))));<NEW_LINE>NBTHelper.iterateCompoundList(compound.getList("VisualizedFluids", Tag.TAG_COMPOUND), c -> visualizedOutputFluids.add(IntAttached.with(OUTPUT_ANIMATION_TIME, FluidStack.loadFluidStackFromNBT(c))));<NEW_LINE>}
(compound.getCompound("InputItems"));
1,657,675
private void selectCurrentValue() {<NEW_LINE><MASK><NEW_LINE>if (editorControl != null && !editorControl.isDisposed()) {<NEW_LINE>try {<NEW_LINE>Object curValue = valueEditor.extractEditorValue();<NEW_LINE>final String curTextValue = valueController.getValueHandler().getValueDisplayString(((IAttributeController) valueController).getBinding(), curValue, DBDDisplayFormat.EDIT);<NEW_LINE>TableItem curItem = null;<NEW_LINE>int curItemIndex = -1;<NEW_LINE>TableItem[] items = editorSelector.getItems();<NEW_LINE>for (int i = 0; i < items.length; i++) {<NEW_LINE>TableItem item = items[i];<NEW_LINE>if (item.getText(0).equals(curTextValue)) {<NEW_LINE>curItem = item;<NEW_LINE>curItemIndex = i;<NEW_LINE>} else {<NEW_LINE>item.setBackground(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>editorSelector.deselectAll();<NEW_LINE>if (curItem != null) {<NEW_LINE>curItem.setBackground(selectionColor);<NEW_LINE>curItem.setForeground(UIUtils.getContrastColor(selectionColor));<NEW_LINE>editorSelector.showItem(curItem);<NEW_LINE>// Show cur item on top<NEW_LINE>editorSelector.setTopIndex(curItemIndex);<NEW_LINE>}<NEW_LINE>} catch (DBException e) {<NEW_LINE>log.error(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Control editorControl = valueEditor.getControl();
835,046
public int onUpdate(int type) {<NEW_LINE>if (type == Level.BLOCK_UPDATE_RANDOM && (getDamage() & 0b00001100) == 0x00) {<NEW_LINE><MASK><NEW_LINE>getLevel().setBlock(this, this, false, false);<NEW_LINE>} else if (type == Level.BLOCK_UPDATE_RANDOM) {<NEW_LINE>if ((getDamage() & 0b00001100) == 0x08) {<NEW_LINE>setDamage(getDamage() & 0x03);<NEW_LINE>ArrayList<String> visited = new ArrayList<>();<NEW_LINE>int check = 0;<NEW_LINE>LeavesDecayEvent ev = new LeavesDecayEvent(this);<NEW_LINE>Server.getInstance().getPluginManager().callEvent(ev);<NEW_LINE>if (ev.isCancelled() || findLog(this, visited, 0, check)) {<NEW_LINE>getLevel().setBlock(this, this, false, false);<NEW_LINE>} else {<NEW_LINE>getLevel().useBreakOn(this);<NEW_LINE>return Level.BLOCK_UPDATE_NORMAL;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
setDamage(getDamage() | 0x08);
866,204
public void parNewConcurrentModeFailureMeta(GCLogTrace trace, String line) {<NEW_LINE>double totalPause = trace.getPauseTime();<NEW_LINE>double concurrentModeFailurePause = trace.getDoubleGroup(19);<NEW_LINE>double startTimeGap = trace.getDoubleGroup(12) - getClock().getTimeStamp();<NEW_LINE>ParNewPromotionFailed parNewPromotionFailed = new ParNewPromotionFailed(getClock(), trace.gcCause(), totalPause - concurrentModeFailurePause);<NEW_LINE>MemoryPoolSummary heap = new MemoryPoolSummary(trace.getMemoryInKBytes(20), trace.getMemoryInKBytes(24), trace.getMemoryInKBytes(20), trace.getMemoryInKBytes(24));<NEW_LINE>MemoryPoolSummary tenured = new MemoryPoolSummary(trace.getMemoryInKBytes(13), trace.getMemoryInKBytes(17), trace.getMemoryInKBytes(13), trace.getMemoryInKBytes(17));<NEW_LINE>MemoryPoolSummary young = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(5);<NEW_LINE>parNewPromotionFailed.add(young, tenured, heap);<NEW_LINE>record(parNewPromotionFailed);<NEW_LINE>ConcurrentModeFailure concurrentModeFailure = new ConcurrentModeFailure(getClock().add(startTimeGap), GCCause.PROMOTION_FAILED, concurrentModeFailurePause);<NEW_LINE>heap = getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 20);<NEW_LINE><MASK><NEW_LINE>concurrentModeFailure.add(heap.minus(tenured), tenured, heap);<NEW_LINE>concurrentModeFailure.addPermOrMetaSpaceRecord(extractPermOrMetaspaceRecord(line));<NEW_LINE>concurrentModeFailure.add(extractCPUSummary(line));<NEW_LINE>record(concurrentModeFailure);<NEW_LINE>}
tenured = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(13);
1,141,922
private Command newMergedCommand(final Map<Object, Command> mergeCommands, final int mergeCount, final CommandCollector commandCollector, final CommandType commandType) {<NEW_LINE>if (this.protocol == Protocol.Text) {<NEW_LINE>String resultKey = (String) commandCollector.getResult();<NEW_LINE>byte[] keyBytes = ByteUtils.getBytes(resultKey);<NEW_LINE>byte[] cmdBytes = commandType == CommandType.GET_ONE ? Constants.GET : Constants.GETS;<NEW_LINE>final byte[] buf = new byte[cmdBytes.length + 3 + keyBytes.length];<NEW_LINE>ByteUtils.setArguments(buf, 0, cmdBytes, keyBytes);<NEW_LINE>TextGetOneCommand cmd = new TextGetOneCommand(<MASK><NEW_LINE>cmd.setMergeCommands(mergeCommands);<NEW_LINE>cmd.setWriteFuture(new FutureImpl<Boolean>());<NEW_LINE>cmd.setMergeCount(mergeCount);<NEW_LINE>cmd.setIoBuffer(IoBuffer.wrap(buf));<NEW_LINE>return cmd;<NEW_LINE>} else {<NEW_LINE>BinaryGetMultiCommand result = (BinaryGetMultiCommand) commandCollector.getResult();<NEW_LINE>result.setMergeCount(mergeCount);<NEW_LINE>result.setMergeCommands(mergeCommands);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
resultKey, keyBytes, commandType, null);
794,292
private void addAttribute(JTextComponent c, Document d, String text) throws BadLocationException {<NEW_LINE>String nsPrefix = ctx.findFxmlNsPrefix();<NEW_LINE>boolean addNsDecl = false;<NEW_LINE>// declare the namespace, if not yet present<NEW_LINE>if (nsPrefix == null) {<NEW_LINE>nsPrefix = ctx.findPrefixString(<MASK><NEW_LINE>addNsDecl = true;<NEW_LINE>}<NEW_LINE>int start = getStartOffset() + text.length();<NEW_LINE>// fix the position against mutation<NEW_LINE>Position startPos = NbDocument.createPosition(d, start, Position.Bias.Backward);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// tag-attribute separator<NEW_LINE>sb.append(" ");<NEW_LINE>if (ctx.isRootElement() && addNsDecl) {<NEW_LINE>// append NS declaration<NEW_LINE>sb.append(createNsDecl(nsPrefix));<NEW_LINE>}<NEW_LINE>sb.append(ctx.createNSName(nsPrefix, getAttributeName())).append("=\"");<NEW_LINE>int l = sb.length();<NEW_LINE>sb.append("\"");<NEW_LINE>if (!ctx.isTagFinished()) {<NEW_LINE>if (shouldClose) {<NEW_LINE>sb.append("/>");<NEW_LINE>} else {<NEW_LINE>sb.append(">");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>d.insertString(start, sb.toString(), null);<NEW_LINE>if (!ctx.isRootElement() && addNsDecl) {<NEW_LINE>d.insertString(ctx.getRootAttrInsertOffset(), createNsDecl(nsPrefix), null);<NEW_LINE>}<NEW_LINE>// position the caret inside '' for the user to enter the value<NEW_LINE>c.setCaretPosition(startPos.getOffset() + l);<NEW_LINE>}
JavaFXEditorUtils.FXML_FX_NAMESPACE_CURRENT, JavaFXEditorUtils.FXML_FX_PREFIX);
923,501
protected int sigwait(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>Pointer set = context.getPointerArg(0);<NEW_LINE>Pointer sig = context.getPointerArg(1);<NEW_LINE>int mask = set.getInt(0);<NEW_LINE>Task task = emulator.get(Task.TASK_KEY);<NEW_LINE>SigSet sigSet = new UnixSigSet(mask);<NEW_LINE>SignalOps signalOps = task.isMainThread() ? emulator.getThreadDispatcher() : task;<NEW_LINE>SigSet sigPendingSet = signalOps.getSigPendingSet();<NEW_LINE>if (sigPendingSet != null) {<NEW_LINE>for (Integer signum : sigSet) {<NEW_LINE>if (sigPendingSet.containsSigNumber(signum)) {<NEW_LINE>sigPendingSet.removeSigNumber(signum);<NEW_LINE>sig.setInt(0, signum);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!task.isMainThread()) {<NEW_LINE>throw new ThreadContextSwitchException().setReturnValue(-1);<NEW_LINE>}<NEW_LINE>log.info("sigwait set=" + set + ", sig=" + sig);<NEW_LINE>Log log = <MASK><NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>emulator.attach().debug();<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
LogFactory.getLog(AbstractEmulator.class);
289,167
public static void main(final String[] args) {<NEW_LINE>final int numElementsX = (args.length == 2) ? Integer.parseInt(args[0]) : 8;<NEW_LINE>final int numElementsY = (args.length == 2) ? Integer.parseInt(args[1]) : 8;<NEW_LINE>System.out.printf("image: x=%d, y=%d\n", numElementsX, numElementsY);<NEW_LINE>final ImageFloat image1 = new ImageFloat(numElementsX, numElementsY);<NEW_LINE>final ImageFloat image2 = new ImageFloat(numElementsX / 2, numElementsY / 2);<NEW_LINE>final Random rand = new Random();<NEW_LINE>for (int y = 0; y < numElementsY; y++) {<NEW_LINE>for (int x = 0; x < numElementsX; x++) {<NEW_LINE>image1.set(x, y, rand.nextFloat());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (image1.X() < 16 && image1.Y() < 16) {<NEW_LINE><MASK><NEW_LINE>System.out.println(image1.toString());<NEW_LINE>}<NEW_LINE>final long start = System.nanoTime();<NEW_LINE>IntStream.range(0, image2.X() * image2.Y()).parallel().forEach((index) -> {<NEW_LINE>final int x = index % image2.X();<NEW_LINE>final int y = index / image2.X();<NEW_LINE>// co-ords of center pixel<NEW_LINE>int cx = TornadoMath.clamp(2 * x, 0, image1.X() - 1);<NEW_LINE>int cy = TornadoMath.clamp(2 * y, 0, image1.Y() - 1);<NEW_LINE>final float center = image1.get(cx, cy);<NEW_LINE>image2.set(x, y, center);<NEW_LINE>});<NEW_LINE>final long end = System.nanoTime();<NEW_LINE>System.out.printf("time: %.9f s\n", (end - start) * 1e-9);<NEW_LINE>if (image2.X() < 16 && image2.Y() < 16) {<NEW_LINE>System.out.println("Result:");<NEW_LINE>System.out.println(image2.toString());<NEW_LINE>}<NEW_LINE>}
System.out.println("Before:");
1,005,686
static Color[] terrain(int n, float alpha) {<NEW_LINE>int k = n / 2;<NEW_LINE>float[] H = { 4 / 12f, 2 / 12f, 0 / 12f };<NEW_LINE>float[] S = { 1f, 1f, 0f };<NEW_LINE>float[] V = { 0.65f, 0.9f, 0.95f };<NEW_LINE>Color[] palette = new Color[n];<NEW_LINE>float h = H[0];<NEW_LINE>float hw = (H[1] - H[0<MASK><NEW_LINE>float s = S[0];<NEW_LINE>float sw = (S[1] - S[0]) / (k - 1);<NEW_LINE>float v = V[0];<NEW_LINE>float vw = (V[1] - V[0]) / (k - 1);<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>palette[i] = hsv(h, s, v, alpha);<NEW_LINE>h += hw;<NEW_LINE>s += sw;<NEW_LINE>v += vw;<NEW_LINE>}<NEW_LINE>h = H[1];<NEW_LINE>hw = (H[2] - H[1]) / (n - k);<NEW_LINE>s = S[1];<NEW_LINE>sw = (S[2] - S[1]) / (n - k);<NEW_LINE>v = V[1];<NEW_LINE>vw = (V[2] - V[1]) / (n - k);<NEW_LINE>for (int i = k; i < n; i++) {<NEW_LINE>h += hw;<NEW_LINE>s += sw;<NEW_LINE>v += vw;<NEW_LINE>palette[i] = hsv(h, s, v, alpha);<NEW_LINE>}<NEW_LINE>return palette;<NEW_LINE>}
]) / (k - 1);
789,139
public void actionPerformed(ActionEvent e) {<NEW_LINE>if (noproxy.isSelected()) {<NEW_LINE>pref.putInt("proxySel", 1);<NEW_LINE>} else if (systemProxy.isSelected()) {<NEW_LINE>pref.putInt("proxySel", 2);<NEW_LINE>} else if (manual.isSelected()) {<NEW_LINE>pref.putInt("proxySel", 3);<NEW_LINE>pref.put("proxySel-http", http.getText());<NEW_LINE>pref.put(<MASK><NEW_LINE>}<NEW_LINE>proxy.dispose();<NEW_LINE>if (netMonitor != null) {<NEW_LINE>netMonitor.dispose();<NEW_LINE>netMonitor = null;<NEW_LINE>}<NEW_LINE>if (perfMonitor != null) {<NEW_LINE>perfMonitor.dispose();<NEW_LINE>perfMonitor = null;<NEW_LINE>}<NEW_LINE>String mainClass = System.getProperty("MainClass");<NEW_LINE>if (mainClass != null) {<NEW_LINE>Preferences pref = Preferences.userNodeForPackage(JavaSEPort.class);<NEW_LINE>deinitializeSync();<NEW_LINE>frm.dispose();<NEW_LINE>System.setProperty("reload.simulator", "true");<NEW_LINE>} else {<NEW_LINE>refreshSkin(frm);<NEW_LINE>}<NEW_LINE>}
"proxySel-port", port.getText());
44,218
public void execute() throws BuildException {<NEW_LINE>if (name == null)<NEW_LINE>throw new BuildException("Name of property to set have to be specified", this.getLocation());<NEW_LINE>if (propertiesList == null)<NEW_LINE>throw new BuildException("List of clusters have to be specified", this.getLocation());<NEW_LINE>thisModuleName = this<MASK><NEW_LINE>if (!thisModuleName.startsWith("all-"))<NEW_LINE>throw new BuildException("This task could be used only in targets \"all-{modulename}\"", this.getLocation());<NEW_LINE>thisModuleName = thisModuleName.substring("all-".length());<NEW_LINE>StringTokenizer tokens = new StringTokenizer(propertiesList, " \t\n\f\r,");<NEW_LINE>while (tokens.hasMoreTokens()) {<NEW_LINE>String property = tokens.nextToken().trim();<NEW_LINE>String list = this.getProject().getProperty(property);<NEW_LINE>if (list == null)<NEW_LINE>throw new BuildException("Property: " + property + " is not defined anywhere", this.getLocation());<NEW_LINE>StringTokenizer modTokens = new StringTokenizer(list, " \t\n\f\r,");<NEW_LINE>while (modTokens.hasMoreTokens()) {<NEW_LINE>String module = modTokens.nextToken();<NEW_LINE>log(property + " " + module, Project.MSG_VERBOSE);<NEW_LINE>if (module.equals(thisModuleName)) {<NEW_LINE>String clusterDepends = this.getProject().getProperty(property + ".depends");<NEW_LINE>if (clusterDepends == null)<NEW_LINE>throw new BuildException("Property: " + property + ".depends have to be defined", this.getLocation());<NEW_LINE>log("Property: " + name + " will be set to " + clusterDepends, Project.MSG_VERBOSE);<NEW_LINE>this.getProject().setProperty(name, clusterDepends);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log("No cluster list with this module: " + thisModuleName + " was found. Assume that this module " + thisModuleName + " depends on all clusters: " + propertiesList, Project.MSG_WARN);<NEW_LINE>log("Property: " + name + " will be set to " + propertiesList, Project.MSG_VERBOSE);<NEW_LINE>this.getProject().setProperty(name, propertiesList);<NEW_LINE>// throw new BuildException("No cluster list with this module: " + thisModuleName + " was found.",this.getLocation());<NEW_LINE>}
.getOwningTarget().getName();
1,688,755
private void checkAuthnStatement(List<AuthnStatement> authnStatements) {<NEW_LINE>if (authnStatements.size() != 1) {<NEW_LINE>throw samlException("SAML Assertion subject contains [{}] Authn Statements while exactly one was expected.", authnStatements.size());<NEW_LINE>}<NEW_LINE>final AuthnStatement authnStatement = authnStatements.get(0);<NEW_LINE>// "past now" that is now - the maximum skew we will tolerate. Essentially "if our clock is 2min fast, what time is it now?"<NEW_LINE>final Instant now = now();<NEW_LINE>final Instant pastNow = now.minusMillis(maxSkewInMillis());<NEW_LINE>if (authnStatement.getSessionNotOnOrAfter() != null && pastNow.isBefore(authnStatement.getSessionNotOnOrAfter()) == false) {<NEW_LINE>throw samlException("Rejecting SAML assertion's Authentication Statement because [{}] is on/after [{}]", pastNow, authnStatement.getSessionNotOnOrAfter());<NEW_LINE>}<NEW_LINE>List<String> reqAuthnCtxClassRef = this<MASK><NEW_LINE>if (reqAuthnCtxClassRef.isEmpty() == false) {<NEW_LINE>String authnCtxClassRefValue = null;<NEW_LINE>if (authnStatement.getAuthnContext() != null && authnStatement.getAuthnContext().getAuthnContextClassRef() != null) {<NEW_LINE>authnCtxClassRefValue = authnStatement.getAuthnContext().getAuthnContextClassRef().getURI();<NEW_LINE>}<NEW_LINE>if (Strings.isNullOrEmpty(authnCtxClassRefValue) || reqAuthnCtxClassRef.contains(authnCtxClassRefValue) == false) {<NEW_LINE>throw samlException("Rejecting SAML assertion as the AuthnContextClassRef [{}] is not one of the ({}) that were " + "requested in the corresponding AuthnRequest", authnCtxClassRefValue, reqAuthnCtxClassRef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getSpConfiguration().getReqAuthnCtxClassRef();
1,350,507
protected void processHandlerMethodException(HandlerMethod handlerMethod, Exception exception, Message<?> message) {<NEW_LINE>InvocableHandlerMethod invocable = getExceptionHandlerMethod(handlerMethod, exception);<NEW_LINE>if (invocable == null) {<NEW_LINE>logger.error("Unhandled exception from message handler method", exception);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>invocable.setMessageMethodArgumentResolvers(this.argumentResolvers);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Invoking " + invocable.getShortLogMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Throwable cause = exception.getCause();<NEW_LINE>Object returnValue = (cause != null ? invocable.invoke(message, exception, cause, handlerMethod) : invocable.invoke(message, exception, handlerMethod));<NEW_LINE><MASK><NEW_LINE>if (void.class == returnType.getParameterType()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.returnValueHandlers.handleReturnValue(returnValue, returnType, message);<NEW_LINE>} catch (Throwable ex2) {<NEW_LINE>logger.error("Error while processing handler method exception", ex2);<NEW_LINE>}<NEW_LINE>}
MethodParameter returnType = invocable.getReturnType();
744,561
public static void main(String[] args) {<NEW_LINE>if (args.length < minArgs) {<NEW_LINE>System.out.println(usage.toString());<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>TreebankLangParserParams tlpp = new EnglishTreebankParserParams();<NEW_LINE>DiskTreebank tb = null;<NEW_LINE>String encoding = "UTF-8";<NEW_LINE>String puncTag = null;<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>if (args[i].startsWith("-")) {<NEW_LINE>switch(args[i]) {<NEW_LINE>case "-l":<NEW_LINE>Language lang = Language.valueOf(args[++i].trim());<NEW_LINE>tlpp = lang.params;<NEW_LINE>break;<NEW_LINE>case "-e":<NEW_LINE>encoding = args[++i];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println(usage.toString());<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>puncTag = args[i++];<NEW_LINE>if (tb == null) {<NEW_LINE>if (tlpp == null) {<NEW_LINE>System.out.println(usage.toString());<NEW_LINE>System.exit(-1);<NEW_LINE>} else {<NEW_LINE>tlpp.setInputEncoding(encoding);<NEW_LINE>tlpp.setOutputEncoding(encoding);<NEW_LINE>tb = tlpp.diskTreebank();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tb<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Counter<String> puncTypes = new ClassicCounter<>();<NEW_LINE>for (Tree t : tb) {<NEW_LINE>List<CoreLabel> yield = t.taggedLabeledYield();<NEW_LINE>for (CoreLabel word : yield) if (word.tag().equals(puncTag))<NEW_LINE>puncTypes.incrementCount(word.word());<NEW_LINE>}<NEW_LINE>List<String> biggestKeys = new ArrayList<>(puncTypes.keySet());<NEW_LINE>Collections.sort(biggestKeys, Counters.toComparatorDescending(puncTypes));<NEW_LINE>PrintWriter pw = tlpp.pw();<NEW_LINE>for (String wordType : biggestKeys) pw.printf("%s\t%d%n", wordType, (int) puncTypes.getCount(wordType));<NEW_LINE>pw.close();<NEW_LINE>}
.loadPath(args[i]);
1,336,435
/* Copied from BlockProcessor (with modifications). */<NEW_LINE>boolean rewardBeneficiary(final MutableWorldState worldState, final ProcessableBlockHeader header, final List<BlockHeader> ommers, final Address miningBeneficiary, final Wei blockReward, final boolean skipZeroBlockRewards) {<NEW_LINE>// TODO(tmm): Added to make this work, should come from blockProcessor.<NEW_LINE>final int MAX_GENERATION = 6;<NEW_LINE>if (skipZeroBlockRewards && blockReward.isZero()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final Wei coinbaseReward = protocolSpec.getBlockProcessor().getCoinbaseReward(blockReward, header.getNumber(), ommers.size());<NEW_LINE>final WorldUpdater updater = worldState.updater();<NEW_LINE>final EvmAccount beneficiary = updater.getOrCreate(miningBeneficiary);<NEW_LINE>beneficiary.getMutable().incrementBalance(coinbaseReward);<NEW_LINE>for (final BlockHeader ommerHeader : ommers) {<NEW_LINE>if (ommerHeader.getNumber() - header.getNumber() > MAX_GENERATION) {<NEW_LINE>LOG.trace("Block processing error: ommer block number {} more than {} generations current block number {}", ommerHeader.getNumber(), MAX_GENERATION, header.getNumber());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final EvmAccount ommerCoinbase = updater.<MASK><NEW_LINE>final Wei ommerReward = protocolSpec.getBlockProcessor().getOmmerReward(blockReward, header.getNumber(), ommerHeader.getNumber());<NEW_LINE>ommerCoinbase.getMutable().incrementBalance(ommerReward);<NEW_LINE>}<NEW_LINE>updater.commit();<NEW_LINE>return true;<NEW_LINE>}
getOrCreate(ommerHeader.getCoinbase());
1,007,870
private CompiledSelection generateCSForSelectAll() {<NEW_LINE>MetaStreamEvent metaStreamEventForSelectAll = new MetaStreamEvent();<NEW_LINE>for (Attribute attribute : tableDefinition.getAttributeList()) {<NEW_LINE>metaStreamEventForSelectAll.addOutputData(attribute);<NEW_LINE>}<NEW_LINE>metaStreamEventForSelectAll.addInputDefinition(tableDefinition);<NEW_LINE>MetaStateEvent metaStateEventForSelectAll = new MetaStateEvent(1);<NEW_LINE>metaStateEventForSelectAll.addEvent(metaStreamEventForSelectAll);<NEW_LINE>MatchingMetaInfoHolder matchingMetaInfoHolderForSlectAll = new MatchingMetaInfoHolder(metaStateEventForSelectAll, -1, 0, tableDefinition, tableDefinition, 0);<NEW_LINE>List<OutputAttribute> outputAttributesAll = new ArrayList<>();<NEW_LINE>List<Attribute> attributeList = tableDefinition.getAttributeList();<NEW_LINE>for (Attribute attribute : attributeList) {<NEW_LINE>outputAttributesAll.add(new OutputAttribute(new Variable(<MASK><NEW_LINE>}<NEW_LINE>List<SelectAttributeBuilder> selectAttributeBuilders = new ArrayList<>(outputAttributesAll.size());<NEW_LINE>List<VariableExpressionExecutor> variableExpressionExecutors = new ArrayList<>();<NEW_LINE>for (OutputAttribute outputAttribute : outputAttributesAll) {<NEW_LINE>ExpressionBuilder expressionBuilder = new ExpressionBuilder(outputAttribute.getExpression(), matchingMetaInfoHolderForSlectAll, variableExpressionExecutors, tableMap, null, null, null);<NEW_LINE>selectAttributeBuilders.add(new SelectAttributeBuilder(expressionBuilder, outputAttribute.getRename()));<NEW_LINE>}<NEW_LINE>return compileSelection(selectAttributeBuilders, null, null, null, null, null);<NEW_LINE>}
attribute.getName())));
713,629
// findBPartner<NEW_LINE>@Override<NEW_LINE>public void refreshPanel() {<NEW_LINE>logger.fine("RefreshPanel");<NEW_LINE>if (!posPanel.hasOrder()) {<NEW_LINE>// Document Info<NEW_LINE>totalTitle.setTitle(Msg.getMsg(Env.getCtx(), "Totals"));<NEW_LINE>fieldSalesRep.setText(posPanel.getSalesRepName());<NEW_LINE>fieldDocumentType.setText(Msg.getMsg(posPanel.getCtx(), "Order"));<NEW_LINE>fieldDocumentNo.setText(Msg.getMsg(posPanel.getCtx(), "New"));<NEW_LINE>fieldDocumentStatus.setText("");<NEW_LINE>fieldDocumentDate.setText("");<NEW_LINE>fieldTotalLines.setText(posPanel.getNumberFormat().format(Env.ZERO));<NEW_LINE>fieldGrandTotal.setText(posPanel.getNumberFormat().format(Env.ZERO));<NEW_LINE>fieldTaxAmount.setText(posPanel.getNumberFormat().format(Env.ZERO));<NEW_LINE>fieldPartnerName.setText(null);<NEW_LINE>} else {<NEW_LINE>// Set Values<NEW_LINE>// Document Info<NEW_LINE>String currencyISOCode = posPanel.getCurSymbol();<NEW_LINE>totalTitle.setTitle(Msg.getMsg(Env.getCtx(), "Totals") + " (" + currencyISOCode + ")");<NEW_LINE>fieldSalesRep.setText(posPanel.getOrder().getSalesRep().getName());<NEW_LINE>fieldDocumentType.setText(posPanel.getDocumentTypeName());<NEW_LINE>fieldDocumentNo.setText(posPanel.getDocumentNo());<NEW_LINE>fieldDocumentStatus.setText(posPanel.getOrder().getDocStatusName());<NEW_LINE>fieldDocumentDate.setText(posPanel.getDateOrderedForView());<NEW_LINE>fieldTotalLines.setText(posPanel.getTotaLinesForView());<NEW_LINE>fieldGrandTotal.setText(posPanel.getGrandTotalForView());<NEW_LINE>fieldTaxAmount.setText(posPanel.getTaxAmtForView());<NEW_LINE>fieldPartnerName.<MASK><NEW_LINE>}<NEW_LINE>// Repaint<NEW_LINE>totalPanel.invalidate();<NEW_LINE>totalPanel.repaint();<NEW_LINE>}
setText(posPanel.getBPName());
18,946
private JXTitledPanel createImageBox(JPanel p, JDialog dialog, int width, int height, CFrame window) {<NEW_LINE>BufferedImage bi = new // TYPE_INT_ARGB is tinted red<NEW_LINE>BufferedImage(// TYPE_INT_ARGB is tinted red<NEW_LINE>window.getWidth(), // TYPE_INT_ARGB is tinted red<NEW_LINE>window.getHeight(), BufferedImage.TYPE_INT_RGB);<NEW_LINE>window.paintAll(bi.createGraphics());<NEW_LINE>Image image = bi.getScaledInstance(width, height, Image.SCALE_SMOOTH);<NEW_LINE>final JXTitledPanel box = new JXTitledPanel();<NEW_LINE>final Painter painter = box.getTitlePainter();<NEW_LINE>box.setTitlePainter(null);<NEW_LINE>box.setFocusable(true);<NEW_LINE>box.setTitle(window.getTitle());<NEW_LINE>final JXImageView imageView = new JXImageView();<NEW_LINE>imageView.setImage(image);<NEW_LINE>imageView.setEditable(false);<NEW_LINE>box.setContentContainer(imageView);<NEW_LINE>box.setPreferredSize(<MASK><NEW_LINE>box.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));<NEW_LINE>box.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseEntered(MouseEvent e) {<NEW_LINE>box.requestFocus();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>imageView.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseEntered(MouseEvent e) {<NEW_LINE>box.requestFocus();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>PreviewMouseAdapter adapter = new PreviewMouseAdapter(dialog, window);<NEW_LINE>box.addMouseListener(adapter);<NEW_LINE>imageView.addMouseListener(adapter);<NEW_LINE>imageView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));<NEW_LINE>box.addFocusListener(new FocusAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusGained(FocusEvent e) {<NEW_LINE>box.setTitlePainter(painter);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusLost(FocusEvent e) {<NEW_LINE>box.setTitlePainter(null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return box;<NEW_LINE>}
new Dimension(width, height));
623,514
void validateSelf(final boolean shouldIdCheck, final boolean descriptionOptional) throws InvalidToolException {<NEW_LINE>super.validateSelf();<NEW_LINE>// Not the expected type, the wrong Object is in use.<NEW_LINE>if (!objectType.equals(type)) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc, "TYPE_NOT_CORRECT", objectType, type));<NEW_LINE>}<NEW_LINE>// check required fields for this object<NEW_LINE>final String badRQDfields = listNullFields(descriptionOptional);<NEW_LINE>if (badRQDfields.length() != 0) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc, "RQD_FIELDS_MISSING", badRQDfields));<NEW_LINE>}<NEW_LINE>// check for XSS and other malicious data<NEW_LINE>final String badXSSfields = listXSSFields();<NEW_LINE>if (badXSSfields.length() != 0) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc, "XSS_DETECTED", badXSSfields));<NEW_LINE>}<NEW_LINE>// check URL field syntax (url and icon fields)<NEW_LINE>if (!isValidURL(url)) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc, "URL_NOT_VALID", url));<NEW_LINE>}<NEW_LINE>// Check to see if we have an icon set. If not, then configure the default icon.<NEW_LINE>if (!isValidURL(icon)) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc, "ICON_NOT_VALID", icon));<NEW_LINE>}<NEW_LINE>// A URL's id must match its name<NEW_LINE>if (shouldIdCheck && !id.equals(Utils.urlEncode(name))) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc, "ID_NOT_VALID", id, name));<NEW_LINE>}<NEW_LINE>// name does not contain ~ & : ; / \ ? {} < > []<NEW_LINE>if (!containsValidCharacters(name)) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc, "NAME_NOT_VALID", name, INVALID_CHARACTERS));<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>// description does not contain ~ & : ; / \ ? {} < > []<NEW_LINE>if (!containsValidCharacters(description)) {<NEW_LINE>throw new InvalidToolException(RequestNLS.formatMessage(tc<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, "DESCRIPTION_NOT_VALID", description, INVALID_CHARACTERS));
257,031
public void logon(String username, String password, String hostname) throws SHTechnicalException, LoginFailedException {<NEW_LINE>this.hostname = hostname;<NEW_LINE>clientId = UUID.randomUUID().toString();<NEW_LINE>requestId = generateRequestId();<NEW_LINE>passwordEncrypted = generateHashFromPassword(password);<NEW_LINE>final String LOGIN_REQUEST = String.format("<BaseRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"LoginRequest\" Version=\"%s\" RequestId=\"%s\" UserName=\"%s\" Password=\"%s\" />", FIRMWARE_VERSION, requestId, username, passwordEncrypted);<NEW_LINE>String sResponse = "";<NEW_LINE>try {<NEW_LINE>sResponse = executeRequest(LOGIN_REQUEST, "/cmd", true);<NEW_LINE>sessionId = XMLUtil.XPathValueFromString(sResponse, "/BaseResponse/@SessionId");<NEW_LINE>if (sessionId == null || "".equals(sessionId)) {<NEW_LINE>throw new LoginFailedException(String.format("LoginFailed: Authentication with user '%s' was not possible. Session ID is empty.", username));<NEW_LINE>}<NEW_LINE>currentConfigurationVersion = <MASK><NEW_LINE>} catch (ParserConfigurationException ex) {<NEW_LINE>throw new SHTechnicalException("ParserConfigurationException:" + ex.getMessage(), ex);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>throw new SHTechnicalException("SAXException:" + ex.getMessage(), ex);<NEW_LINE>} catch (XPathExpressionException ex) {<NEW_LINE>throw new SHTechnicalException("XPathExpressionException:" + ex.getMessage(), ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new SHTechnicalException(String.format("IOException. Communication with host '%s' was not possible or interrupted: %s", hostname, ex.getMessage()), ex);<NEW_LINE>} catch (RWESmarthomeSessionExpiredException e) {<NEW_LINE>logger.error("SessionExpiredException while login?!? Should never exist...");<NEW_LINE>throw new SHTechnicalException("SessionExpiredException while login?!? Should never exist...");<NEW_LINE>}<NEW_LINE>}
XMLUtil.XPathValueFromString(sResponse, "/BaseResponse/@CurrentConfigurationVersion");
1,318,604
public static ListFileTypeResponse unmarshall(ListFileTypeResponse listFileTypeResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFileTypeResponse.setRequestId(_ctx.stringValue("ListFileTypeResponse.RequestId"));<NEW_LINE>NodeTypeInfoList nodeTypeInfoList = new NodeTypeInfoList();<NEW_LINE>nodeTypeInfoList.setPageNumber(_ctx.integerValue("ListFileTypeResponse.NodeTypeInfoList.PageNumber"));<NEW_LINE>nodeTypeInfoList.setPageSize(_ctx.integerValue("ListFileTypeResponse.NodeTypeInfoList.PageSize"));<NEW_LINE>nodeTypeInfoList.setTotalCount(_ctx.integerValue("ListFileTypeResponse.NodeTypeInfoList.TotalCount"));<NEW_LINE>List<NodeTypeInfoItem> nodeTypeInfo = new ArrayList<NodeTypeInfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFileTypeResponse.NodeTypeInfoList.NodeTypeInfo.Length"); i++) {<NEW_LINE>NodeTypeInfoItem nodeTypeInfoItem = new NodeTypeInfoItem();<NEW_LINE>nodeTypeInfoItem.setNodeType(_ctx.integerValue<MASK><NEW_LINE>nodeTypeInfoItem.setNodeTypeName(_ctx.stringValue("ListFileTypeResponse.NodeTypeInfoList.NodeTypeInfo[" + i + "].NodeTypeName"));<NEW_LINE>nodeTypeInfo.add(nodeTypeInfoItem);<NEW_LINE>}<NEW_LINE>nodeTypeInfoList.setNodeTypeInfo(nodeTypeInfo);<NEW_LINE>listFileTypeResponse.setNodeTypeInfoList(nodeTypeInfoList);<NEW_LINE>return listFileTypeResponse;<NEW_LINE>}
("ListFileTypeResponse.NodeTypeInfoList.NodeTypeInfo[" + i + "].NodeType"));
1,771,346
public Request<ReleaseIpamPoolAllocationRequest> marshall(ReleaseIpamPoolAllocationRequest releaseIpamPoolAllocationRequest) {<NEW_LINE>if (releaseIpamPoolAllocationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ReleaseIpamPoolAllocationRequest> request = new DefaultRequest<ReleaseIpamPoolAllocationRequest>(releaseIpamPoolAllocationRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "ReleaseIpamPoolAllocation");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (releaseIpamPoolAllocationRequest.getIpamPoolId() != null) {<NEW_LINE>request.addParameter("IpamPoolId", StringUtils.fromString(releaseIpamPoolAllocationRequest.getIpamPoolId()));<NEW_LINE>}<NEW_LINE>if (releaseIpamPoolAllocationRequest.getCidr() != null) {<NEW_LINE>request.addParameter("Cidr", StringUtils.fromString(releaseIpamPoolAllocationRequest.getCidr()));<NEW_LINE>}<NEW_LINE>if (releaseIpamPoolAllocationRequest.getIpamPoolAllocationId() != null) {<NEW_LINE>request.addParameter("IpamPoolAllocationId", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(releaseIpamPoolAllocationRequest.getIpamPoolAllocationId()));
511,168
private void addStatsRecursive(List<ColumnStatistics> allStats, int index, Map<Integer, List<ColumnStatistics>> nodeAndSubNodeStats, List<ColumnStatistics> unencryptedStats, Map<Integer, Map<Integer, Slice>> encryptedStats) throws IOException {<NEW_LINE>if (allStats.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ColumnStatistics columnStatistics = allStats.get(index);<NEW_LINE>if (dwrfEncryptionInfo.getGroupByNodeId(index).isPresent()) {<NEW_LINE>int group = dwrfEncryptionInfo.getGroupByNodeId(index).get();<NEW_LINE>boolean isRootNode = dwrfWriterEncryption.get().getWriterEncryptionGroups().get(group).<MASK><NEW_LINE>verify(isRootNode && nodeAndSubNodeStats.isEmpty() || nodeAndSubNodeStats.size() == 1 && nodeAndSubNodeStats.get(group) != null, "nodeAndSubNodeStats should only be present for subnodes of a group");<NEW_LINE>nodeAndSubNodeStats.computeIfAbsent(group, x -> new ArrayList<>()).add(columnStatistics);<NEW_LINE>unencryptedStats.add(new ColumnStatistics(columnStatistics.getNumberOfValues(), null));<NEW_LINE>for (Integer fieldIndex : orcTypes.get(index).getFieldTypeIndexes()) {<NEW_LINE>addStatsRecursive(allStats, fieldIndex, nodeAndSubNodeStats, unencryptedStats, encryptedStats);<NEW_LINE>}<NEW_LINE>if (isRootNode) {<NEW_LINE>Slice encryptedFileStatistics = toEncryptedFileStatistics(nodeAndSubNodeStats.get(group), group);<NEW_LINE>encryptedStats.computeIfAbsent(group, x -> new HashMap<>()).put(index, encryptedFileStatistics);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>unencryptedStats.add(columnStatistics);<NEW_LINE>for (Integer fieldIndex : orcTypes.get(index).getFieldTypeIndexes()) {<NEW_LINE>addStatsRecursive(allStats, fieldIndex, new HashMap<>(), unencryptedStats, encryptedStats);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getNodes().contains(index);
1,355,381
public static void updateProgress(List<FileMeta> list1, boolean updateTime, int limit) {<NEW_LINE>List<FileMeta> list;<NEW_LINE>if (limit != -1 && list1.size() > limit) {<NEW_LINE>list = new ArrayList<>(list1.subList(0, limit));<NEW_LINE>} else {<NEW_LINE>list = list1;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (FileMeta meta : list) {<NEW_LINE>try {<NEW_LINE>AppBook book = SharedBooks.load(meta.getPath());<NEW_LINE>meta.setIsRecentProgress(book.p);<NEW_LINE>if (updateTime) {<NEW_LINE>meta.setIsRecentTime(book.t);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AppDB.get().updateAll(list);<NEW_LINE>long b = System.currentTimeMillis() - a;<NEW_LINE>LOG.d("updateProgress-time:", list.size(), b / 1000.0);<NEW_LINE>}
long a = System.currentTimeMillis();
1,118,409
public static UrlParts parseUrl(String theUrl) {<NEW_LINE>String url = theUrl;<NEW_LINE>UrlParts retVal = new UrlParts();<NEW_LINE>if (url.startsWith("http")) {<NEW_LINE>int qmIdx = url.indexOf('?');<NEW_LINE>if (qmIdx != -1) {<NEW_LINE>retVal.setParams(defaultIfBlank(url.substring(qmIdx + 1), null));<NEW_LINE>url = url.substring(0, qmIdx);<NEW_LINE>}<NEW_LINE>IdDt id = new IdDt(url);<NEW_LINE>retVal.setResourceType(id.getResourceType());<NEW_LINE>retVal.setResourceId(id.getIdPart());<NEW_LINE>retVal.<MASK><NEW_LINE>return retVal;<NEW_LINE>}<NEW_LINE>int parsingStart = 0;<NEW_LINE>if (url.length() > 2) {<NEW_LINE>if (url.charAt(0) == '/') {<NEW_LINE>if (Character.isLetter(url.charAt(1))) {<NEW_LINE>parsingStart = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int nextStart = parsingStart;<NEW_LINE>boolean nextIsHistory = false;<NEW_LINE>for (int idx = parsingStart; idx < url.length(); idx++) {<NEW_LINE>char nextChar = url.charAt(idx);<NEW_LINE>boolean atEnd = (idx + 1) == url.length();<NEW_LINE>if (nextChar == '?' || nextChar == '/' || atEnd) {<NEW_LINE>int endIdx = (atEnd && nextChar != '?') ? idx + 1 : idx;<NEW_LINE>String nextSubstring = url.substring(nextStart, endIdx);<NEW_LINE>if (retVal.getResourceType() == null) {<NEW_LINE>retVal.setResourceType(nextSubstring);<NEW_LINE>} else if (retVal.getResourceId() == null) {<NEW_LINE>retVal.setResourceId(nextSubstring);<NEW_LINE>} else if (nextIsHistory) {<NEW_LINE>retVal.setVersionId(nextSubstring);<NEW_LINE>} else {<NEW_LINE>if (nextSubstring.equals(Constants.URL_TOKEN_HISTORY)) {<NEW_LINE>nextIsHistory = true;<NEW_LINE>} else {<NEW_LINE>throw new InvalidRequestException(Msg.code(1742) + "Invalid FHIR resource URL: " + url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nextChar == '?') {<NEW_LINE>if (url.length() > idx + 1) {<NEW_LINE>retVal.setParams(url.substring(idx + 1));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>nextStart = idx + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
setVersionId(id.getVersionIdPart());
678,681
public void marshall(FsxConfiguration fsxConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (fsxConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(fsxConfiguration.getFileSystemId(), FILESYSTEMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(fsxConfiguration.getFileSystemType(), FILESYSTEMTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(fsxConfiguration.getSecretArn(), SECRETARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fsxConfiguration.getInclusionPatterns(), INCLUSIONPATTERNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fsxConfiguration.getExclusionPatterns(), EXCLUSIONPATTERNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fsxConfiguration.getFieldMappings(), FIELDMAPPINGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
fsxConfiguration.getVpcConfiguration(), VPCCONFIGURATION_BINDING);
1,200,399
protected ProfileStructure saveToData() throws InvalidDataInputException {<NEW_LINE>ProfileStructure.Builder builder = new <MASK><NEW_LINE>builder.setName(editText_profile_name.getText().toString());<NEW_LINE>for (OperationSkillViewContainerFragment<?> fragment : operationViewList) {<NEW_LINE>if (!fragment.isEnabled())<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>OperationData data = fragment.getData();<NEW_LINE>if (!data.isValid())<NEW_LINE>throw new InvalidDataInputException();<NEW_LINE>fragment.setHighlight(false);<NEW_LINE>String id = LocalSkillRegistry.getInstance().operation().findSkill(data).id();<NEW_LINE>builder.put(id, data);<NEW_LINE>} catch (InvalidDataInputException e) {<NEW_LINE>fragment.setHighlight(true);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (RemoteOperationSkillViewContainerFragment fragment : remoteOperationViewList) {<NEW_LINE>if (!fragment.isEnabled())<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>RemoteOperationData data = fragment.getData();<NEW_LINE>fragment.setHighlight(false);<NEW_LINE>String id = fragment.id();<NEW_LINE>builder.put(id, data);<NEW_LINE>} catch (InvalidDataInputException e) {<NEW_LINE>fragment.setHighlight(true);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return builder.build();<NEW_LINE>} catch (BuilderInfoClashedException e) {<NEW_LINE>throw new InvalidDataInputException(e);<NEW_LINE>}<NEW_LINE>}
ProfileStructure.Builder(C.VERSION_CREATED_IN_RUNTIME);
827,575
public void testAnnotations() throws Exception {<NEW_LINE>zp.emptyPod();<NEW_LINE>zp.addOrReplaceZombie(1, "Alex");<NEW_LINE>assertEquals("Andy", zp.getZombie(2, "Andy"));<NEW_LINE>// TODO assertEquals("Andy", zp.getZombie(2, "should-ignore-this-value"));<NEW_LINE>// TODO assertEquals("Alex", zp.getZombie(1, "should-ignore-this-value"));<NEW_LINE>zp.removeZombie(1);<NEW_LINE>assertEquals("Jim", zp.getZombie(1, "Jim"));<NEW_LINE>zp.addOrReplaceZombie(2, "Joe");<NEW_LINE>// TODO assertEquals("Joe", zp.getZombie(2, "should-ignore-this-value"));<NEW_LINE>zp.emptyPod();<NEW_LINE>assertEquals("Mark", zp.getZombie(1, "Mark"));<NEW_LINE>assertEquals("Nathan", zp<MASK><NEW_LINE>}
.getZombie(2, "Nathan"));
595,121
public static void main(String[] args) {<NEW_LINE>SingularBuilderExampleBuilder builder = SingularBuilderExample.builder().age(34);<NEW_LINE>System.out.println(builder.occupations(Arrays.asList("1234", "2345")).build());<NEW_LINE>System.out.println(builder.occupation<MASK><NEW_LINE>System.out.println(builder.occupation2(2.0f).build());<NEW_LINE>System.out.println(builder.occupation2(2.0f).build());<NEW_LINE>System.out.println(builder.cars(new HashMap<Integer, Float>()).build());<NEW_LINE>System.out.println(builder.car(1, 2.0f).build());<NEW_LINE>System.out.println(builder.car2s(new HashMap<String, Float>()).build());<NEW_LINE>System.out.println(builder.car2("1", 2.0f).build());<NEW_LINE>}
("aaa").build());
1,668,356
public HierarchicalPrincipal unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>HierarchicalPrincipal hierarchicalPrincipal = new HierarchicalPrincipal();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("PrincipalList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>hierarchicalPrincipal.setPrincipalList(new ListUnmarshaller<Principal>(PrincipalJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return hierarchicalPrincipal;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
512,214
public GetTemplateResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>GetTemplateResult getTemplateResult = new GetTemplateResult();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return getTemplateResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("TemplateBody", targetDepth)) {<NEW_LINE>getTemplateResult.setTemplateBody(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("StagesAvailable", targetDepth)) {<NEW_LINE>getTemplateResult.withStagesAvailable(new ArrayList<String>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("StagesAvailable/member", targetDepth)) {<NEW_LINE>getTemplateResult.withStagesAvailable(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return getTemplateResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,571,123
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.field(Fields.AVAILABLE_PROCESSORS, availableProcessors);<NEW_LINE>builder.field(Fields.ALLOCATED_PROCESSORS, allocatedProcessors);<NEW_LINE>builder.startArray(Fields.NAMES);<NEW_LINE>{<NEW_LINE>for (ObjectIntCursor<String> name : names) {<NEW_LINE>builder.startObject();<NEW_LINE>{<NEW_LINE>builder.field(Fields.NAME, name.key);<NEW_LINE>builder.field(Fields.COUNT, name.value);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>builder.startArray(Fields.PRETTY_NAMES);<NEW_LINE>{<NEW_LINE>for (final ObjectIntCursor<String> prettyName : prettyNames) {<NEW_LINE>builder.startObject();<NEW_LINE>{<NEW_LINE>builder.field(Fields.PRETTY_NAME, prettyName.key);<NEW_LINE>builder.field(Fields.COUNT, prettyName.value);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE><MASK><NEW_LINE>return builder;<NEW_LINE>}
mem.toXContent(builder, params);
1,216,643
public void realInverseFull(final double[] a, final int offa, boolean scale) {<NEW_LINE>final int twon = 2 * n;<NEW_LINE>switch(plan) {<NEW_LINE>case SPLIT_RADIX:<NEW_LINE>{<NEW_LINE>realInverse2(a, offa, scale);<NEW_LINE>int idx1, idx2;<NEW_LINE>for (int k = 0; k < n / 2; k++) {<NEW_LINE>idx1 = 2 * k;<NEW_LINE>idx2 = offa + (twon - idx1) % twon;<NEW_LINE>a[idx2] = a[offa + idx1];<NEW_LINE>a[idx2 + 1] = -a[offa + idx1 + 1];<NEW_LINE>}<NEW_LINE>a[offa + n] = -a[offa + 1];<NEW_LINE>a[offa + 1] = 0;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MIXED_RADIX:<NEW_LINE>rfftf(a, offa);<NEW_LINE>if (scale) {<NEW_LINE>scale(n, a, offa, false);<NEW_LINE>}<NEW_LINE>int m;<NEW_LINE>if (n % 2 == 0) {<NEW_LINE>m = n / 2;<NEW_LINE>} else {<NEW_LINE>m = (n + 1) / 2;<NEW_LINE>}<NEW_LINE>for (int k = 1; k < m; k++) {<NEW_LINE>int idx1 = offa + 2 * k;<NEW_LINE>int idx2 = offa + twon - 2 * k;<NEW_LINE>a[idx1] = -a[idx1];<NEW_LINE>a[idx2 + 1] = -a[idx1];<NEW_LINE>a[idx2] = a[idx1 - 1];<NEW_LINE>}<NEW_LINE>for (int k = 1; k < n; k++) {<NEW_LINE>int idx = offa + n - k;<NEW_LINE>double tmp = a[idx + 1];<NEW_LINE>a[idx <MASK><NEW_LINE>a[idx] = tmp;<NEW_LINE>}<NEW_LINE>a[offa + 1] = 0;<NEW_LINE>break;<NEW_LINE>case BLUESTEIN:<NEW_LINE>bluestein_real_full(a, offa, 1);<NEW_LINE>if (scale) {<NEW_LINE>scale(n, a, offa, true);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
+ 1] = a[idx];
1,094,668
public java.lang.String[] process(java.lang.String[] args) {<NEW_LINE>@Var<NEW_LINE>int index = 0;<NEW_LINE>while (index < args.length) {<NEW_LINE>@Var<NEW_LINE>int newIndex = index;<NEW_LINE>for (int i = 0; i < options.size(); i++) {<NEW_LINE>CommandOption o = (CommandOption) options.get(i);<NEW_LINE>newIndex = o.process(args, index);<NEW_LINE>if (newIndex != index) {<NEW_LINE>o.postParsing(this);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newIndex == index) {<NEW_LINE>// All of the CommandOptions had their chance to claim the index'th option,,<NEW_LINE>// but none of them did.<NEW_LINE>printUsage(false);<NEW_LINE>throw new IllegalArgumentException("Unrecognized option " + index <MASK><NEW_LINE>}<NEW_LINE>index = newIndex;<NEW_LINE>}<NEW_LINE>return new java.lang.String[0];<NEW_LINE>}
+ ": " + args[index]);
867,099
public static ClientMessage encodeRequest(java.lang.String name, boolean globalOrderingEnabled, boolean statisticsEnabled, boolean multiThreadingEnabled, @Nullable java.util.Collection<com.hazelcast.client.impl.protocol.task.dynamicconfig.ListenerConfigHolder> listenerConfigs) {<NEW_LINE>ClientMessage clientMessage = ClientMessage.createForEncode();<NEW_LINE>clientMessage.setRetryable(false);<NEW_LINE>clientMessage.setOperationName("DynamicConfig.AddTopicConfig");<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);<NEW_LINE>encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);<NEW_LINE>encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);<NEW_LINE>encodeBoolean(<MASK><NEW_LINE>encodeBoolean(initialFrame.content, REQUEST_STATISTICS_ENABLED_FIELD_OFFSET, statisticsEnabled);<NEW_LINE>encodeBoolean(initialFrame.content, REQUEST_MULTI_THREADING_ENABLED_FIELD_OFFSET, multiThreadingEnabled);<NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>StringCodec.encode(clientMessage, name);<NEW_LINE>ListMultiFrameCodec.encodeNullable(clientMessage, listenerConfigs, ListenerConfigHolderCodec::encode);<NEW_LINE>return clientMessage;<NEW_LINE>}
initialFrame.content, REQUEST_GLOBAL_ORDERING_ENABLED_FIELD_OFFSET, globalOrderingEnabled);
1,101,592
public String format(LabelFormatter formatter, int featureIndex) {<NEW_LINE>final char[][] wordsImage = allWords.image;<NEW_LINE>if (featureIndex < wordsImage.length) {<NEW_LINE>return formatter.format(new char[][] { wordsImage[featureIndex] }, new boolean[] { false });<NEW_LINE>} else {<NEW_LINE>final int[] wordIndices = allPhrases.wordIndices[featureIndex - wordsImage.length];<NEW_LINE>final short[] termTypes = allWords.type;<NEW_LINE>char[][] wordImages = new char[wordIndices.length][];<NEW_LINE>boolean[] stopwordFlags = new boolean[wordIndices.length];<NEW_LINE>for (int i = 0; i < wordIndices.length; i++) {<NEW_LINE>final int wordIndex = wordIndices[i];<NEW_LINE>wordImages[i] = wordsImage[wordIndex];<NEW_LINE>stopwordFlags[i] = TokenTypeUtils.isCommon(termTypes[wordIndex]);<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}
formatter.format(wordImages, stopwordFlags);
1,289,036
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "GameLift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<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);
527,292
public static String replaceSystemProperties(String s) {<NEW_LINE>int i = s.indexOf("${");<NEW_LINE>if (i == -1)<NEW_LINE>return s;<NEW_LINE>StringBuilder sb = new StringBuilder(s.length());<NEW_LINE>int j = -1;<NEW_LINE>do {<NEW_LINE>sb.append(s.substring(j + 1, i));<NEW_LINE>if ((j = s.indexOf('}', i + 2)) == -1) {<NEW_LINE>j = i - 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int k = s.lastIndexOf(':', j);<NEW_LINE>String val = s.startsWith("env.", i + 2) ? System.getenv(s.substring(i + 6, k < 0 ? j : k)) : System.getProperty(s.substring(i + 2, k < 0 ? j : k));<NEW_LINE>sb.append(val != null ? val : k < 0 ? s.substring(i, j + 1) : s.substring<MASK><NEW_LINE>i = s.indexOf("${", j + 1);<NEW_LINE>} while (i != -1);<NEW_LINE>sb.append(s.substring(j + 1));<NEW_LINE>return sb.toString();<NEW_LINE>}
(k + 1, j));
753,338
public static List<Member> partiallySortMembers(Evaluator evaluator, List<Member> list, Calc exp, int limit, boolean desc) {<NEW_LINE>assert !list.isEmpty();<NEW_LINE>assert limit <= list.size();<NEW_LINE>evaluator.getTiming().markStart(SORT_EVAL_TIMING_NAME);<NEW_LINE>boolean timingEval = true;<NEW_LINE>boolean timingSort = false;<NEW_LINE>try {<NEW_LINE>MemberComparator comp = new MemberComparator.BreakMemberComparator(evaluator, exp, desc);<NEW_LINE>Map<Member, Object> valueMap = evaluateMembers(evaluator, exp, list, null, false);<NEW_LINE>evaluator.getTiming().markEnd(SORT_EVAL_TIMING_NAME);<NEW_LINE>timingEval = false;<NEW_LINE>evaluator.getTiming().markStart(SORT_TIMING_NAME);<NEW_LINE>timingSort = true;<NEW_LINE>comp.preloadValues(valueMap);<NEW_LINE>return stablePartialSort(list, comp.wrap(), limit);<NEW_LINE>} finally {<NEW_LINE>if (timingEval) {<NEW_LINE>evaluator.<MASK><NEW_LINE>} else if (timingSort) {<NEW_LINE>evaluator.getTiming().markEnd(SORT_TIMING_NAME);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getTiming().markEnd(SORT_EVAL_TIMING_NAME);
134,614
public PaymentsView createView(@NonNull final CreateViewRequest request) {<NEW_LINE>final <MASK><NEW_LINE>viewId.assertWindowId(WINDOW_ID);<NEW_LINE>final BPartnerId bPartnerId = request.getParameterAs(PARAMETER_TYPE_BPARTNER_ID, BPartnerId.class);<NEW_LINE>final Set<PaymentId> paymentIds = request.getParameterAsSet(PARAMETER_TYPE_SET_OF_PAYMENT_IDS, PaymentId.class);<NEW_LINE>final PaymentAndInvoiceRows paymentAndInvoiceRows;<NEW_LINE>if (bPartnerId != null) {<NEW_LINE>paymentAndInvoiceRows = rowsRepo.getByBPartnerId(bPartnerId);<NEW_LINE>} else if (paymentIds != null && !paymentIds.isEmpty()) {<NEW_LINE>paymentAndInvoiceRows = rowsRepo.getByPaymentIds(paymentIds);<NEW_LINE>} else {<NEW_LINE>// if no payments exist, we allow the window to open with no records.<NEW_LINE>// The user can manually add Payments and Invoices, then reconcile them.<NEW_LINE>final ZonedDateTime evaluationDate = SystemTime.asZonedDateTime();<NEW_LINE>paymentAndInvoiceRows = PaymentAndInvoiceRows.builder().invoiceRows(InvoiceRows.builder().repository(rowsRepo).evaluationDate(evaluationDate).initialRows(ImmutableList.of()).build()).paymentRows(PaymentRows.builder().repository(rowsRepo).evaluationDate(evaluationDate).initialRows(ImmutableList.of()).build()).build();<NEW_LINE>}<NEW_LINE>return PaymentsView.builder().paymentViewId(viewId).rows(paymentAndInvoiceRows).paymentsProcesses(getPaymentRelatedProcessDescriptors()).invoicesProcesses(getInvoiceRelatedProcessDescriptors()).build();<NEW_LINE>}
ViewId viewId = request.getViewId();
177,241
static Object doGeneric(HPyArrayWrapper receiver, long index, @Shared("lib") @CachedLibrary(limit = "1") InteropLibrary lib, @Shared("ensureHandleNode") @Cached HPyEnsureHandleNode ensureHandleNode, @Exclusive @Cached GilNode gil) throws UnsupportedMessageException, InvalidArrayIndexException {<NEW_LINE>boolean mustRelease = gil.acquire();<NEW_LINE>try {<NEW_LINE>Object[] delegate = receiver.getDelegate();<NEW_LINE>if (delegate != null) {<NEW_LINE>try {<NEW_LINE>return delegate[PInt.intValueExact(index)];<NEW_LINE>} catch (OverflowException e) {<NEW_LINE>CompilerDirectives.transferToInterpreterAndInvalidate();<NEW_LINE>throw InvalidArrayIndexException.create(index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Object element = lib.readArrayElement(<MASK><NEW_LINE>return ensureHandleNode.execute(receiver.hpyContext, lib.readMember(element, GraalHPyHandle.I));<NEW_LINE>} catch (UnknownIdentifierException e) {<NEW_LINE>throw CompilerDirectives.shouldNotReachHere();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>gil.release(mustRelease);<NEW_LINE>}<NEW_LINE>}
receiver.getNativePointer(), index);
1,088,995
void apply(XTextCursor cursor) {<NEW_LINE>XMultiPropertySet mps = UnoCast.cast(XMultiPropertySet.class, cursor).get();<NEW_LINE>XMultiPropertyStates mpss = UnoCast.cast(XMultiPropertyStates.class, cursor).get();<NEW_LINE>ArrayList<Optional<Object>> topLayer = layers.peek();<NEW_LINE>try {<NEW_LINE>// select values to be set<NEW_LINE>ArrayList<String> names <MASK><NEW_LINE>ArrayList<Object> values = new ArrayList<>(goodSize);<NEW_LINE>// and those to be cleared<NEW_LINE>ArrayList<String> delNames = new ArrayList<>(goodSize);<NEW_LINE>for (int i = 0; i < goodSize; i++) {<NEW_LINE>if (topLayer.get(i).isPresent()) {<NEW_LINE>names.add(goodNames[i]);<NEW_LINE>values.add(topLayer.get(i).get());<NEW_LINE>} else {<NEW_LINE>delNames.add(goodNames[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// namesArray must be alphabetically sorted.<NEW_LINE>String[] namesArray = names.toArray(new String[0]);<NEW_LINE>String[] delNamesArray = delNames.toArray(new String[0]);<NEW_LINE>mpss.setPropertiesToDefault(delNamesArray);<NEW_LINE>mps.setPropertyValues(namesArray, values.toArray());<NEW_LINE>} catch (UnknownPropertyException ex) {<NEW_LINE>LOGGER.warn("UnknownPropertyException in MyPropertyStack.apply", ex);<NEW_LINE>} catch (PropertyVetoException ex) {<NEW_LINE>LOGGER.warn("PropertyVetoException in MyPropertyStack.apply");<NEW_LINE>} catch (WrappedTargetException ex) {<NEW_LINE>LOGGER.warn("WrappedTargetException in MyPropertyStack.apply");<NEW_LINE>}<NEW_LINE>}
= new ArrayList<>(goodSize);
1,540,316
// //////////////////////////////////////////////////////////////////<NEW_LINE>private void processRefs(Address addr, Address[] refs, Address[] offcuts) {<NEW_LINE>if (width < 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (refs.length == 0 && offcuts.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuffer buf = new StringBuffer();<NEW_LINE>Address[] all = new Address[refs.length + offcuts.length];<NEW_LINE>System.arraycopy(refs, 0, all, 0, refs.length);<NEW_LINE>System.arraycopy(offcuts, 0, all, refs.length, offcuts.length);<NEW_LINE>if (displayRefHeader) {<NEW_LINE>if (refs.length > 0 || offcuts.length > 0) {<NEW_LINE>StringBuffer tmp = new StringBuffer();<NEW_LINE>tmp.append(header);<NEW_LINE>tmp.append("[");<NEW_LINE>tmp.append(refs.length);<NEW_LINE>tmp.append(",");<NEW_LINE>tmp.append(offcuts.length);<NEW_LINE>tmp.append("]: ");<NEW_LINE>buf.append(clip(tmp.toString(), headerWidth));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int refsPerLine = width / (all[0].toString().length() + XREFS_DELIM.length());<NEW_LINE>int refsInCurrLine = 0;<NEW_LINE>for (int i = 0; i < all.length; ++i) {<NEW_LINE>// if we are not displaying the xref header,<NEW_LINE>// then we need to append the comment prefix<NEW_LINE>if (i == 0 && !displayRefHeader) {<NEW_LINE>buf.append(getFill(headerWidth));<NEW_LINE>buf.append(prefix);<NEW_LINE>}<NEW_LINE>// if we have started a new line, then<NEW_LINE>// we need to append the comment prefix<NEW_LINE>if (refsInCurrLine == 0 && i != 0) {<NEW_LINE>buf.append(getFill(headerWidth));<NEW_LINE>if (!displayRefHeader) {<NEW_LINE>buf.append(prefix);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if we already appended a ref the line<NEW_LINE>// and we are are about to append one more,<NEW_LINE>// then we need the delim<NEW_LINE>if (refsInCurrLine > 0) {<NEW_LINE>buf.append(XREFS_DELIM);<NEW_LINE>}<NEW_LINE>// does memory contain this address? if so, then hyperlink it<NEW_LINE>boolean isInMem = memory.contains(all[i]);<NEW_LINE>if (isHTML && isInMem) {<NEW_LINE>buf.append("<A HREF=\"#" + getUniqueAddressString(all[i]) + "\">");<NEW_LINE>}<NEW_LINE>buf.append(all<MASK><NEW_LINE>if (isHTML && isInMem) {<NEW_LINE>buf.append("</A>");<NEW_LINE>}<NEW_LINE>refsInCurrLine++;<NEW_LINE>if (refsInCurrLine == refsPerLine) {<NEW_LINE>lines.add((displayRefHeader ? prefix : "") + buf.toString());<NEW_LINE>buf.delete(0, buf.length());<NEW_LINE>refsInCurrLine = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (refsInCurrLine > 0) {<NEW_LINE>lines.add((displayRefHeader ? prefix : "") + buf.toString());<NEW_LINE>buf.delete(0, buf.length());<NEW_LINE>}<NEW_LINE>}
[i].toString());
988,219
/*<NEW_LINE>* Set the slider's listeners<NEW_LINE>*/<NEW_LINE>public void linkTo(final ParametersInfo parametersInfo, final ConfigWindow parametersWindow) {<NEW_LINE>localVerticalGroup.setOnLongClickListener(new OnLongClickListener() {<NEW_LINE><NEW_LINE>public boolean onLongClick(View v) {<NEW_LINE>if (!parametersInfo.locked)<NEW_LINE>parametersWindow.showWindow(parametersInfo, id);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nentry.addTextChangedListener(new TextWatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {<NEW_LINE>if (nentry.getText().length() > 0) {<NEW_LINE>nentry.setSelection(nentry.getText().length());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void afterTextChanged(Editable editable) {<NEW_LINE>String value = nentry.getText().toString();<NEW_LINE>if (nentry.getText().length() == 0)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>float <MASK><NEW_LINE>if (numValue >= min && numValue <= max) {<NEW_LINE>parametersInfo.values[id] = numValue;<NEW_LINE>FaustActivity.dspFaust.setParamValue(address, parametersInfo.values[id]);<NEW_LINE>} else if (numValue < min) {<NEW_LINE>lastvalue = Float.MAX_VALUE;<NEW_LINE>setValue(min);<NEW_LINE>} else if (numValue > max) {<NEW_LINE>lastvalue = Float.MAX_VALUE;<NEW_LINE>setValue(max);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>Log.i("FaustJava", "NumberFormatException ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
numValue = Float.parseFloat(value);
607,774
protected SdkHttpFullRequest.Builder doPresign(SdkHttpFullRequest request, Aws4SignerRequestParams requestParams, U signingParams) {<NEW_LINE>SdkHttpFullRequest.Builder mutableRequest = request.toBuilder();<NEW_LINE>long expirationInSeconds = getSignatureDurationInSeconds(requestParams, signingParams);<NEW_LINE>addHostHeader(mutableRequest);<NEW_LINE>AwsCredentials sanitizedCredentials = sanitizeCredentials(signingParams.awsCredentials());<NEW_LINE>if (sanitizedCredentials instanceof AwsSessionCredentials) {<NEW_LINE>// For SigV4 pre-signing URL, we need to add "X-Amz-Security-Token"<NEW_LINE>// as a query string parameter, before constructing the canonical<NEW_LINE>// request.<NEW_LINE>mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_SECURITY_TOKEN, ((AwsSessionCredentials) sanitizedCredentials).sessionToken());<NEW_LINE>}<NEW_LINE>// Add the important parameters for v4 signing<NEW_LINE>Map<String, List<String>> canonicalizedHeaders = canonicalizeSigningHeaders(mutableRequest.headers());<NEW_LINE>String signedHeadersString = getSignedHeadersString(canonicalizedHeaders);<NEW_LINE>addPreSignInformationToRequest(mutableRequest, signedHeadersString, sanitizedCredentials, requestParams, expirationInSeconds);<NEW_LINE>String contentSha256 = calculateContentHashPresign(mutableRequest, signingParams);<NEW_LINE>String canonicalRequest = createCanonicalRequest(mutableRequest, canonicalizedHeaders, signedHeadersString, <MASK><NEW_LINE>String stringToSign = createStringToSign(canonicalRequest, requestParams);<NEW_LINE>byte[] signingKey = deriveSigningKey(sanitizedCredentials, requestParams);<NEW_LINE>byte[] signature = computeSignature(stringToSign, signingKey);<NEW_LINE>mutableRequest.putRawQueryParameter(SignerConstant.X_AMZ_SIGNATURE, BinaryUtils.toHex(signature));<NEW_LINE>return mutableRequest;<NEW_LINE>}
contentSha256, signingParams.doubleUrlEncode());
1,567,290
public void start() throws Exception {<NEW_LINE>logger.info("Starting FS crawler");<NEW_LINE>if (loop < 0) {<NEW_LINE>logger.info("FS crawler started in watch mode. It will run unless you stop it with CTRL+C.");<NEW_LINE>}<NEW_LINE>if (loop == 0 && !rest) {<NEW_LINE>logger.warn("Number of runs is set to 0 and rest layer has not been started. Exiting");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>managementService.start();<NEW_LINE>documentService.start();<NEW_LINE>documentService.createSchema();<NEW_LINE>// Start the crawler thread - but not if only in rest mode<NEW_LINE>if (loop != 0) {<NEW_LINE>// What is the protocol used?<NEW_LINE>if (settings.getServer() == null || Server.PROTOCOL.LOCAL.equals(settings.getServer().getProtocol())) {<NEW_LINE>// Local FS<NEW_LINE>fsParser = new FsParserLocal(settings, config, managementService, documentService, loop);<NEW_LINE>} else if (Server.PROTOCOL.SSH.equals(settings.getServer().getProtocol())) {<NEW_LINE>// Remote SSH FS<NEW_LINE>fsParser = new FsParserSsh(settings, config, managementService, documentService, loop);<NEW_LINE>} else if (Server.PROTOCOL.FTP.equals(settings.getServer().getProtocol())) {<NEW_LINE>// Remote FTP FS<NEW_LINE>fsParser = new FsParserFTP(settings, <MASK><NEW_LINE>} else {<NEW_LINE>// Non supported protocol<NEW_LINE>throw new RuntimeException(settings.getServer().getProtocol() + " is not supported yet. Please use " + Server.PROTOCOL.LOCAL + " or " + Server.PROTOCOL.SSH);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// We start a No-OP parser<NEW_LINE>fsParser = new FsParserNoop(settings);<NEW_LINE>}<NEW_LINE>fsCrawlerThread = new Thread(fsParser, "fs-crawler");<NEW_LINE>fsCrawlerThread.start();<NEW_LINE>}
config, managementService, documentService, loop);
1,259,975
public static void vertical11(Kernel1D_S32 kernel, GrayS32 src, GrayS32 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dst.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 k10 = kernel.data[9];<NEW_LINE>final int k11 = kernel.data[10];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k7;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k9;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k10;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += <MASK><NEW_LINE>dataDst[indexDst++] = ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
(dataSrc[indexSrc]) * k11;
1,354,157
public double[] multipleLinearRegression(Vector<Double> data, int rows, int cols, boolean interceptTerm) {<NEW_LINE>if (data == null)<NEW_LINE>throw new NullPointerException("Null data");<NEW_LINE>if (rows < 0 || cols < 0)<NEW_LINE>throw new IllegalArgumentException("Number of rows and cols must be greater than 0");<NEW_LINE>b0Term = interceptTerm;<NEW_LINE>Matrix dataX;<NEW_LINE>if (interceptTerm) {<NEW_LINE>// first column of X is filled with 1s if b_0 != 0<NEW_LINE>dataX = new Matrix(rows, cols);<NEW_LINE>coeffs = new double[cols];<NEW_LINE>} else {<NEW_LINE>dataX = new Matrix(rows, cols - 1);<NEW_LINE>coeffs <MASK><NEW_LINE>}<NEW_LINE>double[] datay = new double[rows];<NEW_LINE>// Fill the data in the matrix X (independent variables) and vector y (dependet variable)<NEW_LINE>// number of data points<NEW_LINE>int n = 0;<NEW_LINE>for (int i = 0; i < rows; i++) {<NEW_LINE>if (interceptTerm) {<NEW_LINE>dataX.set(i, 0, 1.0);<NEW_LINE>// first column is the dependent variable<NEW_LINE>datay[i] = data.elementAt(n++);<NEW_LINE>for (int j = 1; j < cols; j++) dataX.set(i, j, data.elementAt(n++));<NEW_LINE>} else {<NEW_LINE>// No interceptTerm so no need to fill the first column with 1s<NEW_LINE>// first column is the dependent variable<NEW_LINE>datay[i] = data.elementAt(n++);<NEW_LINE>for (int j = 0; j < cols - 1; j++) dataX.set(i, j, data.elementAt(n++));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>multipleLinearRegression(datay, dataX);<NEW_LINE>return coeffs;<NEW_LINE>}
= new double[cols - 1];
7,099
private void createProduction() {<NEW_LINE>int noProds = 0;<NEW_LINE>String info = "";<NEW_LINE>//<NEW_LINE>MProduction production = null;<NEW_LINE>MWarehouse wh = null;<NEW_LINE>X_T_Replenish[] replenishs = getReplenish("M_WarehouseSource_ID IS NULL " + "AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=T_Replenish.M_Product_ID " + "AND p.IsBOM='Y' AND p.IsManufactured='Y') ");<NEW_LINE>for (int i = 0; i < replenishs.length; i++) {<NEW_LINE>X_T_Replenish replenish = replenishs[i];<NEW_LINE>if (wh == null || wh.getM_Warehouse_ID() != replenish.getM_Warehouse_ID())<NEW_LINE>wh = MWarehouse.get(getCtx(<MASK><NEW_LINE>BigDecimal batchQty = null;<NEW_LINE>BigDecimal qtyToProduce = replenish.getQtyToOrder();<NEW_LINE>while (qtyToProduce.compareTo(Env.ZERO) > 0) {<NEW_LINE>BigDecimal qty = qtyToProduce;<NEW_LINE>if (batchQty != null && batchQty.compareTo(Env.ZERO) > 0 && qtyToProduce.compareTo(batchQty) > 0) {<NEW_LINE>qty = batchQty;<NEW_LINE>qtyToProduce = qtyToProduce.subtract(batchQty);<NEW_LINE>} else {<NEW_LINE>qtyToProduce = Env.ZERO;<NEW_LINE>}<NEW_LINE>production = new MProduction(getCtx(), 0, get_TrxName());<NEW_LINE>production.setDescription(Msg.getMsg(getCtx(), "Replenishment"));<NEW_LINE>// Set Org/WH<NEW_LINE>production.setAD_Org_ID(wh.getAD_Org_ID());<NEW_LINE>production.setM_Locator_ID(wh.getDefaultLocator().get_ID());<NEW_LINE>production.setM_Product_ID(replenish.getM_Product_ID());<NEW_LINE>production.setProductionQty(qty);<NEW_LINE>production.setMovementDate(Env.getContextAsDate(getCtx(), "#Date"));<NEW_LINE>production.saveEx();<NEW_LINE>// Process<NEW_LINE>production.setDocAction(DocAction.ACTION_Complete);<NEW_LINE>production.processIt(DocAction.ACTION_Complete);<NEW_LINE>production.saveEx(get_TrxName());<NEW_LINE>log.fine(production.toString());<NEW_LINE>noProds++;<NEW_LINE>info += " - " + production.getDocumentNo();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m_info = "#" + noProds + info;<NEW_LINE>log.info(m_info);<NEW_LINE>}
), replenish.getM_Warehouse_ID());
1,734,344
private void processNode(final HdKeyNode hdKeyNode) {<NEW_LINE>int depth = hdKeyNode.getDepth();<NEW_LINE>switch(depth) {<NEW_LINE>case 3:<NEW_LINE>if (_mbwManager.getWalletManager(false).hasAccount(hdKeyNode.getUuid())) {<NEW_LINE>final WalletAccount existingAccount = _mbwManager.getWalletManager(false).getAccount(hdKeyNode.getUuid());<NEW_LINE>if (hdKeyNode.isPrivateHdKeyNode() && !existingAccount.canSpend()) {<NEW_LINE>new AlertDialog.Builder(AddAdvancedAccountActivity.this).setTitle(R.string.priv_key_of_watch_only_account).setMessage(getString(R.string.want_to_add_priv_key_to_watch_account, _mbwManager.getMetadataStorage().getLabelByAccount(hdKeyNode.getUuid()))).setNegativeButton(R.string.cancel, (dialogInterface, i) -> finishAlreadyExist(existingAccount.getReceiveAddress())).setPositiveButton(R.string.ok, (dialogInterface, i) -> returnAccount(hdKeyNode, true)).create().show();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>returnAccount(hdKeyNode);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 0:<NEW_LINE>// This branch is created to support import CoCo from bip32 account<NEW_LINE>if (hdKeyNode.isPrivateHdKeyNode()) {<NEW_LINE>returnBip32Account(hdKeyNode);<NEW_LINE>} else {<NEW_LINE>new Toaster(this).toast(getString(R<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>String errorMessage = getString(R.string.import_xpub_wrong_depth, Integer.toString(depth));<NEW_LINE>new Toaster(this).toast(errorMessage, false);<NEW_LINE>}<NEW_LINE>}
.string.import_xpub_should_xpriv), false);
827,341
// update an existing photo with given entity<NEW_LINE>@Override<NEW_LINE>public UpdateResponse update(Long key, Photo entity) {<NEW_LINE>final Photo currPhoto = _db.getData().get(key);<NEW_LINE>if (currPhoto == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Disallow changing entity ID and URN<NEW_LINE>// ID and URN are required fields, so use a dummy value to denote "empty" fields<NEW_LINE>if ((entity.hasId() && entity.getId() != -1) || (entity.hasUrn() && !entity.getUrn().equals(""))) {<NEW_LINE>throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST, "Photo ID is not acceptable in request");<NEW_LINE>}<NEW_LINE>// make sure the ID in the entity is consistent with the key in the database<NEW_LINE>entity.setId(key);<NEW_LINE>entity.setUrn(String.valueOf(key));<NEW_LINE>_db.getData().put(key, entity);<NEW_LINE>return new UpdateResponse(HttpStatus.S_204_NO_CONTENT);<NEW_LINE>}
return new UpdateResponse(HttpStatus.S_404_NOT_FOUND);
1,674,680
static DTLSRequest readClientRequest(byte[] data, int dataOff, int dataLen, OutputStream dtlsOutput) throws IOException {<NEW_LINE>// TODO Support the possibility of a fragmented ClientHello datagram<NEW_LINE>byte[] message = DTLSRecordLayer.receiveClientHelloRecord(data, dataOff, dataLen);<NEW_LINE>if (null == message || message.length < MESSAGE_HEADER_LENGTH) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long recordSeq = TlsUtils.readUint48(data, dataOff + 5);<NEW_LINE>short msgType = TlsUtils.readUint8(message, 0);<NEW_LINE>if (HandshakeType.client_hello != msgType) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int length = <MASK><NEW_LINE>if (message.length != MESSAGE_HEADER_LENGTH + length) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// TODO Consider stricter HelloVerifyRequest-related checks<NEW_LINE>// int messageSeq = TlsUtils.readUint16(message, 4);<NEW_LINE>// if (messageSeq > 1)<NEW_LINE>// {<NEW_LINE>// return null;<NEW_LINE>// }<NEW_LINE>int fragmentOffset = TlsUtils.readUint24(message, 6);<NEW_LINE>if (0 != fragmentOffset) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int fragmentLength = TlsUtils.readUint24(message, 9);<NEW_LINE>if (length != fragmentLength) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ClientHello clientHello = ClientHello.parse(new ByteArrayInputStream(message, MESSAGE_HEADER_LENGTH, length), dtlsOutput);<NEW_LINE>return new DTLSRequest(recordSeq, message, clientHello);<NEW_LINE>}
TlsUtils.readUint24(message, 1);
1,319,181
public static void deleteKeystoreAlias(String certId, String keystorePath, String keystoreName, String keystorePassword) {<NEW_LINE>try {<NEW_LINE>KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());<NEW_LINE>FileInputStream fis = new FileInputStream(keystorePath + "/" + keystoreName);<NEW_LINE>keystore.load(fis, keystorePassword.toCharArray());<NEW_LINE>fis.close();<NEW_LINE>keystore.deleteEntry(certId);<NEW_LINE>FileOutputStream fos = new FileOutputStream(keystorePath + "/" + keystoreName);<NEW_LINE>keystore.store(fos, keystorePassword.toCharArray());<NEW_LINE>} catch (CertificateException e) {<NEW_LINE><MASK><NEW_LINE>} catch (KeyStoreException e) {<NEW_LINE>throw new AWSIotCertificateException("Error retrieving certificate and key.", e);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new AWSIotCertificateException("Error retrieving certificate and key.", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new AmazonClientException("Error retrieving certificate and key.", e);<NEW_LINE>}<NEW_LINE>}
throw new AWSIotCertificateException("Error retrieving certificate and key.", e);
1,413,354
public void resumePlay(Game game, boolean wasPaused) {<NEW_LINE>activePlayerId = game.getActivePlayerId();<NEW_LINE>UUID priorityPlayerId = game.getPriorityPlayerId();<NEW_LINE>TurnPhase phaseType = game.getPhase().getType();<NEW_LINE>PhaseStep stepType = game.getStep().getType();<NEW_LINE>Iterator<Phase> it = phases.iterator();<NEW_LINE>Phase phase;<NEW_LINE>do {<NEW_LINE>phase = it.next();<NEW_LINE>currentPhase = phase;<NEW_LINE>} while (phase.type != phaseType);<NEW_LINE>if (phase.resumePlay(game, stepType, wasPaused)) {<NEW_LINE>// 20091005 - 500.4/703.4n<NEW_LINE>game.emptyManaPools(null);<NEW_LINE>// game.saveState();<NEW_LINE>// 20091005 - 500.8<NEW_LINE>playExtraPhases(game, phase.getType());<NEW_LINE>}<NEW_LINE>while (it.hasNext()) {<NEW_LINE>phase = it.next();<NEW_LINE>if (game.isPaused() || game.checkIfGameIsOver()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>currentPhase = phase;<NEW_LINE>if (!game.getState().getTurnMods().skipPhase(activePlayerId, currentPhase.getType())) {<NEW_LINE>if (phase.play(game, activePlayerId)) {<NEW_LINE>// 20091005 - 500.4/703.4n<NEW_LINE>game.emptyManaPools(null);<NEW_LINE>// game.saveState();<NEW_LINE>// 20091005 - 500.8<NEW_LINE>playExtraPhases(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!currentPhase.equals(phase)) {<NEW_LINE>// phase was changed from the card<NEW_LINE>game.fireEvent(new PhaseChangedEvent(activePlayerId, null));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
game, phase.getType());
70,562
public final PermissionsBuilder<PermissionType, PermissionsType> addPermission(@NonNull final PermissionType permission, @NonNull final CollisionPolicy collisionPolicy) {<NEW_LINE>assertValidPermissionToAdd(permission);<NEW_LINE>final Map<Resource<MASK><NEW_LINE>final Resource resource = permission.getResource();<NEW_LINE>final PermissionType permissionExisting = permissions.get(resource);<NEW_LINE>if (permissionExisting == null) {<NEW_LINE>permissions.put(resource, permission);<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>final boolean samePermissionAlreadyExists = Objects.equals(permissionExisting, permission);<NEW_LINE>if (collisionPolicy == CollisionPolicy.Override) {<NEW_LINE>permissions.put(resource, permission);<NEW_LINE>} else if (collisionPolicy == CollisionPolicy.Merge) {<NEW_LINE>if (!samePermissionAlreadyExists) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final PermissionType permissionMerged = (PermissionType) permissionExisting.mergeWith(permission);<NEW_LINE>permissions.put(resource, permissionMerged);<NEW_LINE>}<NEW_LINE>} else if (collisionPolicy == CollisionPolicy.Fail) {<NEW_LINE>if (!samePermissionAlreadyExists) {<NEW_LINE>throw new AdempiereException("Found another permission for same resource but with different accesses: " + permissionExisting + ", " + permission);<NEW_LINE>}<NEW_LINE>// NOTE: if they are equals, do nothing<NEW_LINE>} else if (collisionPolicy == CollisionPolicy.Skip) {<NEW_LINE>// do nothing<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Unknown CollisionPolicy: " + collisionPolicy);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
, PermissionType> permissions = getPermissionsInternalMap();
117,449
private IStatus download(ConnectionData data, IProgressMonitor monitor) {<NEW_LINE>// perform the download<NEW_LINE>try {<NEW_LINE>// Use ECF FileTransferJob implementation to get the remote file.<NEW_LINE>FileReader reader = createReader(data);<NEW_LINE>OutputStream <MASK><NEW_LINE>reader.readInto(this.uri, anOutputStream, 0, monitor);<NEW_LINE>// check that job ended ok - throw exceptions otherwise<NEW_LINE>IStatus result = reader.getResult();<NEW_LINE>if (result != null) {<NEW_LINE>if (result.getSeverity() == IStatus.CANCEL) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>if (!result.isOK()) {<NEW_LINE>throw new CoreException(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (OperationCanceledException e) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (monitor != null && monitor.isCanceled()) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>return new Status(IStatus.ERROR, CoreIOPlugin.PLUGIN_ID, t.getMessage(), t);<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}
anOutputStream = createOutputStream(this.saveTo);
1,011,357
private SelectOrSinkPlan toPlan(RelNode rel, List<String> fieldNames, OptimizerContext context, boolean isInfiniteRows) {<NEW_LINE>logger.fine("Before logical opt:\n" + RelOptUtil.toString(rel));<NEW_LINE>LogicalRel logicalRel = optimizeLogical(context, rel);<NEW_LINE>logger.fine("After logical opt:\n" + RelOptUtil.toString(logicalRel));<NEW_LINE>PhysicalRel physicalRel = optimizePhysical(context, logicalRel);<NEW_LINE>logger.fine("After physical opt:\n" + RelOptUtil.toString(physicalRel));<NEW_LINE>boolean isInsert = physicalRel instanceof TableModify;<NEW_LINE>List<Permission> permissions = extractPermissions(physicalRel);<NEW_LINE>if (isInsert) {<NEW_LINE>DAG dag = createDag(physicalRel);<NEW_LINE>return new SelectOrSinkPlan(dag, isInfiniteRows, true, null, planExecutor, permissions);<NEW_LINE>} else {<NEW_LINE>DAG dag = createDag(new JetRootRel(physicalRel, nodeEngine.getThisAddress()));<NEW_LINE>SqlRowMetadata rowMetadata = createRowMetadata(fieldNames, physicalRel.schema().getTypes());<NEW_LINE>return new SelectOrSinkPlan(dag, isInfiniteRows, <MASK><NEW_LINE>}<NEW_LINE>}
false, rowMetadata, planExecutor, permissions);
328,383
private Container or(CharIterator it, final boolean exclusive) {<NEW_LINE>ArrayContainer ac = new ArrayContainer();<NEW_LINE>int myItPos = 0;<NEW_LINE>ac.cardinality = 0;<NEW_LINE>// do a merge. int -1 denotes end of input.<NEW_LINE>int myHead = (myItPos == cardinality) ? -1 : (content[myItPos++]);<NEW_LINE>int hisHead = advance(it);<NEW_LINE>while (myHead != -1 && hisHead != -1) {<NEW_LINE>if (myHead < hisHead) {<NEW_LINE>ac.emit((char) myHead);<NEW_LINE>myHead = (myItPos == cardinality) ? -1 : (content[myItPos++]);<NEW_LINE>} else if (myHead > hisHead) {<NEW_LINE>ac.emit((char) hisHead);<NEW_LINE>hisHead = advance(it);<NEW_LINE>} else {<NEW_LINE>if (!exclusive) {<NEW_LINE>ac.emit((char) hisHead);<NEW_LINE>}<NEW_LINE>hisHead = advance(it);<NEW_LINE>myHead = (myItPos == cardinality) ? -1 : (content[myItPos++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (myHead != -1) {<NEW_LINE>ac.emit((char) myHead);<NEW_LINE>myHead = (myItPos == cardinality) ? -1 : (content[myItPos++]);<NEW_LINE>}<NEW_LINE>while (hisHead != -1) {<NEW_LINE>ac<MASK><NEW_LINE>hisHead = advance(it);<NEW_LINE>}<NEW_LINE>if (ac.cardinality > DEFAULT_MAX_SIZE) {<NEW_LINE>return ac.toBitmapContainer();<NEW_LINE>} else {<NEW_LINE>return ac;<NEW_LINE>}<NEW_LINE>}
.emit((char) hisHead);
1,438,733
private void loadImages() {<NEW_LINE>// try to load icon images<NEW_LINE>iconMap = new HashMap<>();<NEW_LINE>String[] filenames = { // descendants in view<NEW_LINE>DOCS, // descendants in view<NEW_LINE>FRAGMENT, // descendants in view<NEW_LINE>EMPTY_FRAGMENT, // descendants in view<NEW_LINE>VIEWED_FRAGMENT, // descendants in view<NEW_LINE>VIEWED_EMPTY_FRAGMENT, // descendants in view<NEW_LINE>VIEWED_CLOSED_FOLDER, // descendants in view<NEW_LINE>VIEWED_OPEN_FOLDER, // closed folder not in view<NEW_LINE>VIEWED_CLOSED_FOLDER_WITH_DESC, // opened folder not in the view<NEW_LINE>CLOSED_FOLDER, OPEN_FOLDER };<NEW_LINE>String[] disabledFilenames = { DISABLED_DOCS, DISABLED_FRAGMENT, DISABLED_EMPTY_FRAGMENT, DISABLED_VIEWED_EMPTY_FRAGMENT, DISABLED_VIEWED_FRAGMENT, DISABLED_VIEWED_CLOSED_FOLDER, DISABLED_VIEWED_OPEN_FOLDER, DISABLED_VIEWED_CLOSED_FOLDER_WITH_DESC, DISABLED_CLOSED_FOLDER, DISABLED_OPEN_FOLDER };<NEW_LINE>for (int i = 0; i < filenames.length; i++) {<NEW_LINE>ImageIcon icon = ResourceManager.loadImage(filenames[i]);<NEW_LINE>if (icon != null) {<NEW_LINE>iconMap.put(filenames[i], icon);<NEW_LINE>Icon disabledIcon = getDisabledIcon(filenames[i], icon);<NEW_LINE>iconMap.put<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(disabledFilenames[i], disabledIcon);
1,720,626
final DeleteAttachmentResult executeDeleteAttachment(DeleteAttachmentRequest deleteAttachmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAttachmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteAttachmentRequest> request = null;<NEW_LINE>Response<DeleteAttachmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteAttachmentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAttachmentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAttachment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteAttachmentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new DeleteAttachmentResultJsonUnmarshaller());
203,678
public void executeAction(WorkflowProcessor processor, Map<String, WorkflowActionClassParameter> params) throws WorkflowActionFailureException {<NEW_LINE>if (LicenseUtil.getLevel() < LicenseLevel.STANDARD.level)<NEW_LINE>// the apis will do nothing anyway<NEW_LINE>return;<NEW_LINE>WebContext ctx = WebContextFactory.get();<NEW_LINE>HttpServletRequest request = ctx.getHttpServletRequest();<NEW_LINE>User user = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (Exception exx) {<NEW_LINE>throw new WorkflowActionFailureException(exx.getMessage());<NEW_LINE>}<NEW_LINE>Contentlet con = processor.getContentlet();<NEW_LINE>List<InvalidLink> httpResponse = null;<NEW_LINE>try {<NEW_LINE>httpResponse = APILocator.getLinkCheckerAPI().findInvalidLinks(con);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>Logger.error(this, e1.getMessage(), e1);<NEW_LINE>throw new WorkflowActionFailureException(e1.getMessage());<NEW_LINE>}<NEW_LINE>// if there are unreachable URL...<NEW_LINE>if (httpResponse.size() > 0) {<NEW_LINE>String msg = "";<NEW_LINE>try {<NEW_LINE>msg = LanguageUtil.get(user, "checkURL.errorBrokenLinks");<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>throw new WorkflowActionFailureException(LinkCheckerUtil.buildPopupMsgWithLinksList(msg, httpResponse));<NEW_LINE>}<NEW_LINE>}
user = uWebAPI.getLoggedInUser(request);
1,068,092
public int enqueueRead(Object reference, long hostOffset, int[] events, boolean useDeps) {<NEW_LINE>final int returnEvent;<NEW_LINE>if (vectorObject) {<NEW_LINE>final FieldBuffer fieldBuffer = wrappedFields[vectorStorageIndex];<NEW_LINE>returnEvent = fieldBuffer.enqueueRead(reference, (useDeps) ? events : null, useDeps);<NEW_LINE>} else {<NEW_LINE>int index = 0;<NEW_LINE>int[] internalEvents = new int[fields.length];<NEW_LINE>Arrays.fill(internalEvents, -1);<NEW_LINE>for (FieldBuffer fb : wrappedFields) {<NEW_LINE>if (fb != null) {<NEW_LINE>internalEvents[index] = fb.enqueueRead(reference, (useDeps<MASK><NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isFinal) {<NEW_LINE>internalEvents[index] = deviceContext.enqueueReadBuffer(toBuffer(), bufferOffset, bytesToAllocate, buffer.array(), hostOffset, (useDeps) ? events : null);<NEW_LINE>index++;<NEW_LINE>// TODO this needs to run asynchronously<NEW_LINE>deserialise(reference);<NEW_LINE>}<NEW_LINE>switch(index) {<NEW_LINE>case 0:<NEW_LINE>returnEvent = -1;<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>returnEvent = internalEvents[0];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>returnEvent = deviceContext.enqueueMarker(internalEvents);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return useDeps ? returnEvent : -1;<NEW_LINE>}
) ? events : null, useDeps);
1,833,203
protected void handleResourceRequestWithRestLiResponse(RestRequest request, RoutingResult routingResult, Callback<RestLiResponse> callback) {<NEW_LINE>DataMap entityDataMap = null;<NEW_LINE>if (request.getEntity() != null && request.getEntity().length() > 0) {<NEW_LINE>if (UnstructuredDataUtil.isUnstructuredDataRouting(routingResult)) {<NEW_LINE>callback.onError(buildPreRoutingError(new RoutingException("Unstructured Data is not supported in non-streaming Rest.li server", HttpStatus.S_400_BAD_REQUEST.getCode()), request));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final RequestContext requestContext = routingResult<MASK><NEW_LINE>TimingContextUtil.beginTiming(requestContext, FrameworkTimingKeys.SERVER_REQUEST_RESTLI_DESERIALIZATION.key());<NEW_LINE>entityDataMap = DataMapUtils.readMapWithExceptions(request);<NEW_LINE>TimingContextUtil.endTiming(requestContext, FrameworkTimingKeys.SERVER_REQUEST_RESTLI_DESERIALIZATION.key());<NEW_LINE>} catch (IOException e) {<NEW_LINE>callback.onError(buildPreRoutingError(new RoutingException("Cannot parse request entity", HttpStatus.S_400_BAD_REQUEST.getCode(), e), request));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handleResourceRequest(request, routingResult, entityDataMap, callback);<NEW_LINE>}
.getContext().getRawRequestContext();
1,115,954
private void createLockFile() throws IllegalStateException {<NEW_LINE>try {<NEW_LINE>int currentPid = android.os.Process.myPid();<NEW_LINE>if (lockFile.exists()) {<NEW_LINE>int lastPid = -1;<NEW_LINE>// read pid<NEW_LINE>byte[] bytes = new byte[64];<NEW_LINE><MASK><NEW_LINE>int read = fis.read(bytes);<NEW_LINE>fis.close();<NEW_LINE>if (read > 0) {<NEW_LINE>String pidStr = new String(bytes, 0, read);<NEW_LINE>try {<NEW_LINE>lastPid = Integer.parseInt(pidStr);<NEW_LINE>} catch (NumberFormatException ignored) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastPid > 0) {<NEW_LINE>// check if last pid is alive<NEW_LINE>if (new File("/proc/" + lastPid).exists()) {<NEW_LINE>throw new IllegalStateException("RestoreConfigSession is already running at pid: " + lastPid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!lockFile.exists()) {<NEW_LINE>if (!lockFile.createNewFile()) {<NEW_LINE>throw new IllegalStateException("Failed to create lock file: " + lockFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileOutputStream fos = new FileOutputStream(lockFile);<NEW_LINE>fos.write(String.valueOf(currentPid).getBytes());<NEW_LINE>fos.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Failed to create lock file: " + lockFile.getAbsolutePath(), e);<NEW_LINE>}<NEW_LINE>}
FileInputStream fis = new FileInputStream(lockFile);
1,605,661
private static long toLong(Sequence seq, int radix, boolean isBool, boolean bigEnding) {<NEW_LINE>int size = seq.length();<NEW_LINE>long result = 0;<NEW_LINE>if (bigEnding) {<NEW_LINE>for (int i = size; i > 0; --i) {<NEW_LINE>Object obj = seq.getMem(i);<NEW_LINE>if (obj instanceof Number) {<NEW_LINE>int n = ((Number) obj).intValue();<NEW_LINE>if (n < 0 || n >= radix) {<NEW_LINE><MASK><NEW_LINE>throw new RQException("bits" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>result = result * radix + n;<NEW_LINE>} else if (obj instanceof String) {<NEW_LINE>result = result * radix + toNum((String) obj, radix);<NEW_LINE>} else if (isBool && obj instanceof Boolean) {<NEW_LINE>if (((Boolean) obj).booleanValue()) {<NEW_LINE>result = result * 2 + 1;<NEW_LINE>} else {<NEW_LINE>result = result * 2;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("bits" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 1; i <= size; ++i) {<NEW_LINE>Object obj = seq.getMem(i);<NEW_LINE>if (obj instanceof Number) {<NEW_LINE>int n = ((Number) obj).intValue();<NEW_LINE>if (n < 0 || n >= radix) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("bits" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>result = result * radix + n;<NEW_LINE>} else if (obj instanceof String) {<NEW_LINE>result = result * radix + toNum((String) obj, radix);<NEW_LINE>} else if (isBool && obj instanceof Boolean) {<NEW_LINE>if (((Boolean) obj).booleanValue()) {<NEW_LINE>result = result * 2 + 1;<NEW_LINE>} else {<NEW_LINE>result = result * 2;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("bits" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
MessageManager mm = EngineMessage.get();
106,540
protected void generate(StringToStringMap values, ToolHost toolHost, Interface modelItem) throws Exception {<NEW_LINE>String wscompileDir = SoapUI.getSettings().getString(ToolsSettings.JWSDP_WSCOMPILE_LOCATION, null);<NEW_LINE>if (Tools.isEmpty(wscompileDir)) {<NEW_LINE>UISupport.showErrorMessage("wscompile directory must be set in global preferences");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String wscompileExtension = UISupport.isWindows() ? ".bat" : ".sh";<NEW_LINE>File wscompileFile = new File(wscompileDir + File.separatorChar + "wscompile" + wscompileExtension);<NEW_LINE>if (!wscompileFile.exists()) {<NEW_LINE>UISupport.showErrorMessage("Could not find wscompile script at [" + wscompileFile + "]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ProcessBuilder builder = new ProcessBuilder();<NEW_LINE>ArgumentBuilder args = buildArgs(values, <MASK><NEW_LINE>builder.command(args.getArgs());<NEW_LINE>builder.directory(new File(wscompileDir));<NEW_LINE>toolHost.run(new ProcessToolRunner(builder, "JAX-RPC wscompile", modelItem));<NEW_LINE>Analytics.trackAction(USE_JAX_RPC_ARTIFACTS_TOOL);<NEW_LINE>}
UISupport.isWindows(), modelItem);
1,320,139
public static ExecutableDdlJob create(DropGlobalIndexPreparedData preparedData, ExecutionContext executionContext, boolean skipSchemaChange, boolean validate) {<NEW_LINE>// TODO(moyi) merge the if-else path<NEW_LINE>DropGsiJobFactory jobFactory;<NEW_LINE>boolean isNewPartDb = DbInfoManager.getInstance().isNewPartitionDb(preparedData.getSchemaName());<NEW_LINE>if (isNewPartDb) {<NEW_LINE>DropGlobalIndexBuilder builder = DropPartitionGlobalIndexBuilder.createBuilder(preparedData.getSchemaName(), preparedData.getPrimaryTableName(), preparedData.getIndexTableName(), executionContext);<NEW_LINE>if (preparedData.isRepartition()) {<NEW_LINE>// add source partition for drop gsi<NEW_LINE>builder.setPartitionInfo(OptimizerContext.getContext(preparedData.getSchemaName()).getPartitionInfoManager().getPartitionInfo(preparedData.getPrimaryTableName()));<NEW_LINE>}<NEW_LINE>builder.build();<NEW_LINE>PhysicalPlanData physicalPlanData = builder.genPhysicalPlanData();<NEW_LINE>jobFactory = new DropPartitionGsiJobFactory(preparedData.getSchemaName(), preparedData.getPrimaryTableName(), preparedData.<MASK><NEW_LINE>} else {<NEW_LINE>jobFactory = new DropGsiJobFactory(preparedData.getSchemaName(), preparedData.getPrimaryTableName(), preparedData.getIndexTableName(), executionContext);<NEW_LINE>}<NEW_LINE>jobFactory.skipSchemaChange = skipSchemaChange;<NEW_LINE>return jobFactory.create(validate);<NEW_LINE>}
getIndexTableName(), physicalPlanData, executionContext);
1,763,737
protected void init() {<NEW_LINE>myRoot = new Wrapper();<NEW_LINE>OnePixelSplitter splitter = new OnePixelSplitter(false, 0.5f);<NEW_LINE>myRoot.setContent(splitter);<NEW_LINE>myDescriptionPanel = new PluginDescriptionPanel();<NEW_LINE>splitter.setSecondComponent(myDescriptionPanel.getPanel());<NEW_LINE>myTablePanel = new JPanel(new BorderLayout());<NEW_LINE>splitter.setFirstComponent(myTablePanel);<NEW_LINE>PluginTable table = createTable();<NEW_LINE>myPluginTable = table;<NEW_LINE>installTableActions();<NEW_LINE>myTablePanel.add(ScrollPaneFactory.createScrollPane(table, true), BorderLayout.CENTER);<NEW_LINE>final JPanel header = new JPanel(new BorderLayout()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>g.setColor(UIUtil.getPanelBackground());<NEW_LINE>g.fillRect(0, 0, getWidth(), getHeight());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>header.setBorder(new CustomLineBorder(0, 0, JBUI.scale(1), 0));<NEW_LINE>LabelPopup sortLabel = new LabelPopup(LocalizeValue.localizeTODO("Sort by:"), labelPopup -> createSortersGroup());<NEW_LINE>header.add(myFilter, BorderLayout.CENTER);<NEW_LINE>JPanel rightHelpPanel = new JPanel(new HorizontalLayout(JBUI.scale(5)));<NEW_LINE>rightHelpPanel.add(sortLabel);<NEW_LINE>addCustomFilters(rightHelpPanel::add);<NEW_LINE>BorderLayoutPanel botton = new BorderLayoutPanel();<NEW_LINE>botton.setBorder(new CustomLineBorder(JBUI.scale(1), 0, 0, 0));<NEW_LINE>header.add(botton.addToRight(rightHelpPanel), BorderLayout.SOUTH);<NEW_LINE>myTablePanel.<MASK><NEW_LINE>final TableModelListener modelListener = e -> {<NEW_LINE>String text = "name";<NEW_LINE>if (myPluginsModel.isSortByStatus()) {<NEW_LINE>text = "status";<NEW_LINE>} else if (myPluginsModel.isSortByRating()) {<NEW_LINE>text = "rating";<NEW_LINE>} else if (myPluginsModel.isSortByDownloads()) {<NEW_LINE>text = "downloads";<NEW_LINE>} else if (myPluginsModel.isSortByUpdated()) {<NEW_LINE>text = "updated";<NEW_LINE>}<NEW_LINE>sortLabel.setPrefixedText(LocalizeValue.of(text));<NEW_LINE>};<NEW_LINE>myPluginTable.getModel().addTableModelListener(modelListener);<NEW_LINE>modelListener.tableChanged(null);<NEW_LINE>}
add(header, BorderLayout.NORTH);
1,144,503
public void validateUpdateDatastreams(List<Datastream> datastreams, List<Datastream> allDatastreams) throws DatastreamValidationException {<NEW_LINE>for (Datastream newDatastream : datastreams) {<NEW_LINE>List<Datastream> existingDatastreams = allDatastreams.stream().filter(ds -> ds.getName().equals(newDatastream.getName())).collect(Collectors.toList());<NEW_LINE>Validate.isTrue(existingDatastreams.size() == 1, "Bad state: Multiple datastreams exist with the " + "same name " + existingDatastreams);<NEW_LINE>Datastream existingDatastream = existingDatastreams.get(0);<NEW_LINE>if (newDatastream.equals(existingDatastream)) {<NEW_LINE>LOG.info(String.format("Skipping update for datastream {%s} due to no change", existingDatastream));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!doesSourceMatch(newDatastream, existingDatastream) || !doesDestinationMatch(newDatastream, existingDatastream)) {<NEW_LINE>throw new DatastreamValidationException(String.format("Only metadata update is allowed. " + "Source and destination cannot be updated. Old stream: {%s}; New stream: {%s}", existingDatastream, newDatastream));<NEW_LINE>}<NEW_LINE>// Only metadata updates are allowed<NEW_LINE>if (newDatastream.hasMetadata() && existingDatastream.hasMetadata() && newDatastream.getMetadata().equals(existingDatastream.getMetadata())) {<NEW_LINE>throw new DatastreamValidationException(String.format("Only metadata update is allowed. " <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ "Old stream: {%s}; New stream: {%s}", existingDatastream, newDatastream));
511,023
public Rng[] computeFragments(Rng jr) {<NEW_LINE>Rng[] parts = getPartRanges();<NEW_LINE>int partIndex = 0;<NEW_LINE>List<Rng> res = new ArrayList<>();<NEW_LINE>Rng pr = parts[partIndex];<NEW_LINE>assert pr.start <= jr.start;<NEW_LINE>OUT: if (jr.end <= pr.end) {<NEW_LINE>res.add(jr);<NEW_LINE>} else {<NEW_LINE>int l = pr.end - jr.start;<NEW_LINE>res.add(new Rng(jr.start, pr.end));<NEW_LINE>partIndex++;<NEW_LINE>while (jr.end > pr.end) {<NEW_LINE>if (partIndex >= parts.length) {<NEW_LINE>break OUT;<NEW_LINE>}<NEW_LINE>res.add(parts[partIndex++]);<NEW_LINE>}<NEW_LINE>assert partIndex < parts.length;<NEW_LINE>pr = parts[partIndex];<NEW_LINE>if (jr.end == pr.end) {<NEW_LINE>res.add(pr);<NEW_LINE>} else {<NEW_LINE>res.add(new Rng(pr<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res.toArray(new Rng[res.size()]);<NEW_LINE>}
.start, jr.end));
1,001,474
public Object remove(Object sessionKey, boolean removeFromStore) {<NEW_LINE>int hashCode = hash(sessionKey);<NEW_LINE>int index = getIndex(hashCode);<NEW_LINE>CacheItem prev = null, item = null;<NEW_LINE>synchronized (bucketLocks[index]) {<NEW_LINE>for (item = buckets[index]; item != null; item = item.getNext()) {<NEW_LINE>if ((hashCode == item.getHashCode()) && sessionKey.equals(item.getKey())) {<NEW_LINE>if (prev == null) {<NEW_LINE>buckets[<MASK><NEW_LINE>} else {<NEW_LINE>prev.setNext(item.getNext());<NEW_LINE>}<NEW_LINE>item.setNext(null);<NEW_LINE>itemRemoved(item);<NEW_LINE>((LruSessionCacheItem) item).cacheItemState = CACHE_ITEM_REMOVED;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>prev = item;<NEW_LINE>}<NEW_LINE>// remove it from the BackingStore also<NEW_LINE>// In case it had been checkpointed<NEW_LINE>// remove it from BackingStore outside sync block<NEW_LINE>if (removeFromStore) {<NEW_LINE>try {<NEW_LINE>if (backingStore != null) {<NEW_LINE>backingStore.remove((Serializable) sessionKey);<NEW_LINE>}<NEW_LINE>} catch (BackingStoreException sfsbEx) {<NEW_LINE>_logger.log(Level.WARNING, EXCEPTION_BACKING_STORE_REMOVE, new Object[] { cacheName, sessionKey, sfsbEx });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (item != null) {<NEW_LINE>decrementEntryCount();<NEW_LINE>incrementRemovalCount();<NEW_LINE>incrementHitCount();<NEW_LINE>} else {<NEW_LINE>incrementMissCount();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
index] = item.getNext();
1,552,616
final DescribeLoggingConfigurationResult executeDescribeLoggingConfiguration(DescribeLoggingConfigurationRequest describeLoggingConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeLoggingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeLoggingConfigurationRequest> request = null;<NEW_LINE>Response<DescribeLoggingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeLoggingConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLoggingConfigurationRequest));<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, "Network Firewall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLoggingConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeLoggingConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new DescribeLoggingConfigurationResultJsonUnmarshaller());
1,831,842
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String privateZoneName, String ifMatch, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (privateZoneName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter privateZoneName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, privateZoneName, ifMatch, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
this.client.mergeContext(context);
679,481
protected void delete(Context context, UUID uuid) throws AuthorizeException {<NEW_LINE>Group group = null;<NEW_LINE>try {<NEW_LINE>group = gs.find(context, uuid);<NEW_LINE>if (group == null) {<NEW_LINE>throw new ResourceNotFoundException(GroupRest.CATEGORY + "." + GroupRest.NAME + " with id: " + uuid + " not found");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (group.isPermanent()) {<NEW_LINE>throw new UnprocessableEntityException("A permanent group cannot be deleted");<NEW_LINE>}<NEW_LINE>final DSpaceObject parentObject = gs.getParentObject(context, group);<NEW_LINE>if (parentObject != null) {<NEW_LINE>throw new UnprocessableEntityException("This group cannot be deleted" + " as it has a parent " + parentObject.getType() + " with id " + parentObject.getID());<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} catch (SQLException | IOException e) {<NEW_LINE>throw new RuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
gs.delete(context, group);
1,119,230
protected void superPrePassivate(InvocationContext inv) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>results.addPrePassivate(CLASS_NAME, "superPrePassivate");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object> map = inv.getContextData();<NEW_LINE>String data;<NEW_LINE>if (map.containsKey("PrePassivate")) {<NEW_LINE>data = (String) map.get("PrePassivate");<NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("PrePassivate", data);<NEW_LINE>results.setPrePassivateContextData(data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostActivate")) {<NEW_LINE>throw new IllegalStateException("PostActivate context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("AroundInvoke")) {<NEW_LINE>throw new IllegalStateException("AroundInvoke context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("PreDestroy")) {<NEW_LINE>throw new IllegalStateException("PreDestroy context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("PostConstruct")) {<NEW_LINE>throw new IllegalStateException("PostConstruct context data shared with PrePassivate interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each PrePassivate<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (InvocationContext) map.get("InvocationContext");<NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each PrePassivate interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put("InvocationContext", inv);<NEW_LINE>}<NEW_LINE>inv.proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EJBException("unexpected Throwable", e);<NEW_LINE>}<NEW_LINE>}
ResultsLocal results = ResultsLocalBean.getSFBean();
970,828
public void mouseDown(MouseEvent e) {<NEW_LINE>double xValue = xyGraph.primaryXAxis.getPositionValue(e.x, false);<NEW_LINE>double yValue = xyGraph.primaryYAxis.getPositionValue(e.y, false);<NEW_LINE>if (xyGraph.primaryXAxis.getRange().getLower() > xValue || xyGraph.primaryXAxis.getRange().getUpper() < xValue)<NEW_LINE>return;<NEW_LINE>if (xyGraph.primaryYAxis.getRange().getLower() > yValue || xyGraph.primaryYAxis.getRange().getUpper() < yValue)<NEW_LINE>return;<NEW_LINE>List<Trace> sortedTraces = traces.values().stream().sorted(comparingDouble(nearestPointYValueFunc(xValue)).reversed()).collect(toList());<NEW_LINE>ISample topSample = ScouterUtil.getNearestPoint(sortedTraces.get(0).getDataProvider(), xValue);<NEW_LINE>double valueTime = topSample.getXValue();<NEW_LINE>double total = topSample.getYValue();<NEW_LINE>if (yValue > total)<NEW_LINE>return;<NEW_LINE>int i = 0;<NEW_LINE>Trace selectedTrace = null;<NEW_LINE>for (; i < sortedTraces.size(); i++) {<NEW_LINE>Trace t = sortedTraces.get(i);<NEW_LINE>double stackValue = ScouterUtil.getNearestValue(t.getDataProvider(), valueTime);<NEW_LINE>if (stackValue < yValue) {<NEW_LINE>i = i - 1;<NEW_LINE>selectedTrace = sortedTraces.get(i);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (selectedTrace == null) {<NEW_LINE>selectedTrace = <MASK><NEW_LINE>}<NEW_LINE>selectedName = selectedTrace.getName();<NEW_LINE>double value = ScouterUtil.getNearestValue(selectedTrace.getDataProvider(), valueTime);<NEW_LINE>if (i < sortedTraces.size() - 1) {<NEW_LINE>int j = i + 1;<NEW_LINE>double nextStackValue = value;<NEW_LINE>while (nextStackValue == value && j < sortedTraces.size()) {<NEW_LINE>nextStackValue = ScouterUtil.getNearestValue(sortedTraces.get(j).getDataProvider(), valueTime);<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>if (nextStackValue < value) {<NEW_LINE>value = value - nextStackValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double percent = value * 100 / total;<NEW_LINE>selectedTrace.setTraceColor(ColorUtil.getInstance().getColor("dark magenta"));<NEW_LINE>toolTip.setText(DateUtil.format(CastUtil.clong(valueTime), "HH:mm:ss") + "\n" + selectedName + "\n" + FormatUtil.print(value, "#,###0.#") + "(" + FormatUtil.print(percent, "##0.0") + " %)");<NEW_LINE>toolTip.show(new Point(e.x, e.y));<NEW_LINE>}
sortedTraces.get(i - 1);
296,912
static List<PathSegment> parse(String path) {<NEW_LINE>requireNonNull(path, "path");<NEW_LINE>checkArgument(!path.isEmpty(), "path is empty.");<NEW_LINE>final Context context = new Context(path);<NEW_LINE>checkArgument(context.read() == '/', "path: %s (must start with '/')", context.path());<NEW_LINE>final ImmutableList.Builder<PathSegment> segments = ImmutableList.builder();<NEW_LINE>// Parse 'Segments' until the start symbol of 'Verb' part.<NEW_LINE>// Basically, 'parse*' methods stop reading path characters if they see a delimiter. Also, they don't<NEW_LINE>// consume the delimiter so that a caller can check the delimiter.<NEW_LINE>segments.addAll(parseSegments(context, new Delimiters(':')));<NEW_LINE>if (context.hasNext()) {<NEW_LINE>// Consume the start symbol ':'.<NEW_LINE>checkArgument(context.read() == ':', "path: %s (invalid verb part at index %s)", context.path(), context.index());<NEW_LINE>// We don't check 'Verb' part because we don't use it when generating a corresponding path pattern.<NEW_LINE>segments.add(new VerbPathSegment(context.readAll()));<NEW_LINE>}<NEW_LINE>final List<PathSegment> pathSegments = segments.build();<NEW_LINE>checkArgument(!pathSegments.isEmpty(), <MASK><NEW_LINE>return pathSegments;<NEW_LINE>}
"path: %s (must contain at least one segment)", context.path());
1,012,370
private RexNode convertIdentifier(Blackboard bb, SqlIdentifier identifier) {<NEW_LINE>// first check for reserved identifiers like CURRENT_USER<NEW_LINE>final SqlCall call = bb.getValidator().makeNullaryCall(identifier);<NEW_LINE>if (call != null) {<NEW_LINE>return bb.convertExpression(call);<NEW_LINE>}<NEW_LINE>String pv = null;<NEW_LINE>if (bb.isPatternVarRef && identifier.names.size() > 1) {<NEW_LINE>pv = identifier.names.get(0);<NEW_LINE>}<NEW_LINE>final SqlQualified qualified;<NEW_LINE>if (bb.scope != null) {<NEW_LINE>qualified = bb.scope.fullyQualify(identifier);<NEW_LINE>} else {<NEW_LINE>qualified = SqlQualified.create(null, 1, null, identifier);<NEW_LINE>}<NEW_LINE>final Pair<RexNode, Map<String, Integer>> e0 = bb.lookupExp(qualified);<NEW_LINE>RexNode e = e0.left;<NEW_LINE>for (String name : qualified.suffix()) {<NEW_LINE>if (e == e0.left && e0.right != null) {<NEW_LINE>int i = e0.right.get(name);<NEW_LINE>e = rexBuilder.makeFieldAccess(e, i);<NEW_LINE>} else {<NEW_LINE>// name already fully-qualified<NEW_LINE>final boolean caseSensitive = true;<NEW_LINE>if (identifier.isStar() && bb.scope instanceof MatchRecognizeScope) {<NEW_LINE>e = rexBuilder.makeFieldAccess(e, 0);<NEW_LINE>} else {<NEW_LINE>e = rexBuilder.makeFieldAccess(e, name, caseSensitive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e instanceof RexInputRef) {<NEW_LINE>// adjust the type to account for nulls introduced by outer joins<NEW_LINE>e = adjustInputRef<MASK><NEW_LINE>if (pv != null) {<NEW_LINE>e = RexPatternFieldRef.of(pv, (RexInputRef) e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e0.left instanceof RexCorrelVariable) {<NEW_LINE>assert e instanceof RexFieldAccess;<NEW_LINE>final RexNode prev = bb.mapCorrelateToRex.put(((RexCorrelVariable) e0.left).id, (RexFieldAccess) e);<NEW_LINE>assert prev == null;<NEW_LINE>}<NEW_LINE>return e;<NEW_LINE>}
(bb, (RexInputRef) e);
235,094
private boolean requestDecorView(View view, LayoutParams params, int layoutRes) {<NEW_LINE>if (mDecorView != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>mDecorView = new ActivityDecorView();<NEW_LINE>mDecorView.setId(android.R.id.content);<NEW_LINE>mDecorView.setProvider(this);<NEW_LINE>if (view != null) {<NEW_LINE><MASK><NEW_LINE>} else if (layoutRes > 0) {<NEW_LINE>getThemedLayoutInflater().inflate(layoutRes, mDecorView, true);<NEW_LINE>}<NEW_LINE>final LayoutParams p = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);<NEW_LINE>performAddonAction(new AddonCallback<IAddonActivity>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean action(IAddonActivity addon) {<NEW_LINE>return addon.installDecorView(mDecorView, p);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void justPost() {<NEW_LINE>_HoloActivity.super.setContentView(mDecorView, p);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return false;<NEW_LINE>}
mDecorView.addView(view, params);
1,493,533
final GetNetworkInsightsAccessScopeContentResult executeGetNetworkInsightsAccessScopeContent(GetNetworkInsightsAccessScopeContentRequest getNetworkInsightsAccessScopeContentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getNetworkInsightsAccessScopeContentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetNetworkInsightsAccessScopeContentRequest> request = null;<NEW_LINE>Response<GetNetworkInsightsAccessScopeContentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetNetworkInsightsAccessScopeContentRequestMarshaller().marshall(super.beforeMarshalling(getNetworkInsightsAccessScopeContentRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetNetworkInsightsAccessScopeContent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetNetworkInsightsAccessScopeContentResult> responseHandler = new StaxResponseHandler<GetNetworkInsightsAccessScopeContentResult>(new GetNetworkInsightsAccessScopeContentResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,547,508
private BeanRegistrationWriter createScopedProxyBeanRegistrationWriter(String beanName, BeanDefinition beanDefinition) {<NEW_LINE>Object targetBeanName = beanDefinition.getPropertyValues().get("targetBeanName");<NEW_LINE>BeanDefinition targetBeanDefinition = getTargetBeanDefinition(targetBeanName);<NEW_LINE>if (targetBeanDefinition == null) {<NEW_LINE>logger.warn("Could not handle " + ScopedProxyFactoryBean.class.getSimpleName() + ": no target bean definition found with name " + targetBeanName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>RootBeanDefinition processedBeanDefinition = new RootBeanDefinition((RootBeanDefinition) beanDefinition);<NEW_LINE>processedBeanDefinition.setTargetType(targetBeanDefinition.getResolvableType());<NEW_LINE>processedBeanDefinition.getPropertyValues().removePropertyValue("targetBeanName");<NEW_LINE>BeanInstanceDescriptor descriptor = BeanInstanceDescriptor.of(ScopedProxyFactoryBean.class).build();<NEW_LINE>return new DefaultBeanRegistrationWriter(beanName, processedBeanDefinition, descriptor) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void writeInstanceSupplier(Builder code) {<NEW_LINE>MultiStatement statements = new MultiStatement();<NEW_LINE>statements.add("$T factory = new $T()", ScopedProxyFactoryBean.class, ScopedProxyFactoryBean.class);<NEW_LINE><MASK><NEW_LINE>statements.add("factory.setBeanFactory(beanFactory)");<NEW_LINE>statements.add("return factory.getObject()");<NEW_LINE>code.add(statements.toCodeBlock("() -> "));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
statements.add("factory.setTargetBeanName($S)", targetBeanName);
102,586
public ListPiiEntitiesDetectionJobsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPiiEntitiesDetectionJobsResult listPiiEntitiesDetectionJobsResult = new ListPiiEntitiesDetectionJobsResult();<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 listPiiEntitiesDetectionJobsResult;<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("PiiEntitiesDetectionJobPropertiesList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPiiEntitiesDetectionJobsResult.setPiiEntitiesDetectionJobPropertiesList(new ListUnmarshaller<PiiEntitiesDetectionJobProperties>(PiiEntitiesDetectionJobPropertiesJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPiiEntitiesDetectionJobsResult.setNextToken(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 listPiiEntitiesDetectionJobsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
884,133
public /*<NEW_LINE>* When enabled writes to the log will throw LogFileFullException.<NEW_LINE>*<NEW_LINE>* @param boolean if true subsequent writes to the log throw LogFileFullException.<NEW_LINE>* if false subsequent writes may succeed.<NEW_LINE>*/<NEW_LINE>void simulateLogOutputFull(boolean isFull) throws ObjectManagerException {<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.entry(this, cclass, <MASK><NEW_LINE>if (!testInterfaces) {<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.exit(this, cclass, "simulateLogOutputFull", "via InterfaceDisabledException");<NEW_LINE>throw new InterfaceDisabledException(this, "simulateLogOutputFull");<NEW_LINE>}<NEW_LINE>// if (!testInterfaces).<NEW_LINE>((FileLogOutput) objectManagerState.logOutput).simulateLogOutputFull(isFull);<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.exit(this, cclass, "simulateLogOutputFull");<NEW_LINE>}
"simulateLogOutputFull", "isFull=" + isFull + "(boolean)");
364,057
private void writeSingle(final OutputStream out, final String name, final ReadData read) {<NEW_LINE>try {<NEW_LINE>byte[] bases = read.getBases();<NEW_LINE>byte[] quals = read.getQualities();<NEW_LINE>final int len = bases.length;<NEW_LINE>for (int i = 0; i < len; ++i) {<NEW_LINE>quals[i] = (byte) SAMUtils.phredToFastq(quals[i]);<NEW_LINE>}<NEW_LINE>out.write(AT_SYMBOL);<NEW_LINE>out.write(name<MASK><NEW_LINE>out.write(NEW_LINE);<NEW_LINE>out.write(bases);<NEW_LINE>out.write(NEW_LINE);<NEW_LINE>out.write(PLUS);<NEW_LINE>out.write(NEW_LINE);<NEW_LINE>out.write(quals);<NEW_LINE>out.write(NEW_LINE);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new RuntimeIOException(ioe);<NEW_LINE>}<NEW_LINE>}
.getBytes(StandardCharsets.UTF_8));
127,751
private HeaderSymlinkTree createExportedModuleSymlinkTreeBuildRule(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, ActionGraphBuilder graphBuilder, CxxPlatform cxxPlatform, AppleNativeTargetDescriptionArg args) {<NEW_LINE>Path headerPathPrefix = <MASK><NEW_LINE>ImmutableSortedMap.Builder<Path, SourcePath> headers = ImmutableSortedMap.naturalOrder();<NEW_LINE>headers.putAll(CxxPreprocessables.resolveHeaderMap(Paths.get(""), AppleDescriptions.parseAppleHeadersForUseFromOtherTargets(buildTarget, graphBuilder.getSourcePathResolver()::getRelativePath, headerPathPrefix, args.getExportedHeaders())));<NEW_LINE>if (targetContainsSwift(buildTarget, graphBuilder)) {<NEW_LINE>headers.putAll(AppleLibraryDescriptionSwiftEnhancer.getObjCGeneratedHeader(buildTarget, graphBuilder, cxxPlatform, HeaderVisibility.PUBLIC));<NEW_LINE>}<NEW_LINE>return CxxDescriptionEnhancer.createHeaderSymlinkTree(buildTarget, projectFilesystem, getModularHeaderMode(args), headers.build(), HeaderVisibility.PUBLIC);<NEW_LINE>}
AppleDescriptions.getHeaderPathPrefix(args, buildTarget);
1,385,775
public static ListQueuesResponse unmarshall(ListQueuesResponse listQueuesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listQueuesResponse.setRequestId(_ctx.stringValue("ListQueuesResponse.RequestId"));<NEW_LINE>List<QueueInfo> queues = new ArrayList<QueueInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListQueuesResponse.Queues.Length"); i++) {<NEW_LINE>QueueInfo queueInfo = new QueueInfo();<NEW_LINE>queueInfo.setQueueName(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].QueueName"));<NEW_LINE>queueInfo.setType(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].Type"));<NEW_LINE>queueInfo.setResourceGroupId(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].ResourceGroupId"));<NEW_LINE>queueInfo.setHostNamePrefix(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].HostNamePrefix"));<NEW_LINE>queueInfo.setHostNameSuffix(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].HostNameSuffix"));<NEW_LINE>queueInfo.setSpotStrategy(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].SpotStrategy"));<NEW_LINE>queueInfo.setImageId(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].ImageId"));<NEW_LINE>queueInfo.setEnableAutoGrow(_ctx.booleanValue("ListQueuesResponse.Queues[" + i + "].EnableAutoGrow"));<NEW_LINE>List<String> computeInstanceType = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListQueuesResponse.Queues[" + i + "].ComputeInstanceType.Length"); j++) {<NEW_LINE>computeInstanceType.add(_ctx.stringValue("ListQueuesResponse.Queues[" + i <MASK><NEW_LINE>}<NEW_LINE>queueInfo.setComputeInstanceType(computeInstanceType);<NEW_LINE>List<Instance> spotInstanceTypes = new ArrayList<Instance>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListQueuesResponse.Queues[" + i + "].SpotInstanceTypes.Length"); j++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceType(_ctx.stringValue("ListQueuesResponse.Queues[" + i + "].SpotInstanceTypes[" + j + "].InstanceType"));<NEW_LINE>instance.setSpotPriceLimit(_ctx.floatValue("ListQueuesResponse.Queues[" + i + "].SpotInstanceTypes[" + j + "].SpotPriceLimit"));<NEW_LINE>spotInstanceTypes.add(instance);<NEW_LINE>}<NEW_LINE>queueInfo.setSpotInstanceTypes(spotInstanceTypes);<NEW_LINE>queues.add(queueInfo);<NEW_LINE>}<NEW_LINE>listQueuesResponse.setQueues(queues);<NEW_LINE>return listQueuesResponse;<NEW_LINE>}
+ "].ComputeInstanceType[" + j + "]"));
1,611,053
public okhttp3.Call readNamespacedStatefulSetScaleCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
final String[] localVarContentTypes = {};
278,142
public InfinispanUserSessionProvider create(KeycloakSession session) {<NEW_LINE>InfinispanConnectionProvider connections = session.getProvider(InfinispanConnectionProvider.class);<NEW_LINE>Cache<String, SessionEntityWrapper<UserSessionEntity>> cache = connections.getCache(InfinispanConnectionProvider.USER_SESSION_CACHE_NAME);<NEW_LINE>Cache<String, SessionEntityWrapper<UserSessionEntity>> offlineSessionsCache = connections.getCache(InfinispanConnectionProvider.OFFLINE_USER_SESSION_CACHE_NAME);<NEW_LINE>Cache<UUID, SessionEntityWrapper<AuthenticatedClientSessionEntity>> clientSessionCache = connections.getCache(InfinispanConnectionProvider.CLIENT_SESSION_CACHE_NAME);<NEW_LINE>Cache<UUID, SessionEntityWrapper<AuthenticatedClientSessionEntity>> offlineClientSessionsCache = <MASK><NEW_LINE>return new InfinispanUserSessionProvider(session, remoteCacheInvoker, lastSessionRefreshStore, offlineLastSessionRefreshStore, persisterLastSessionRefreshStore, keyGenerator, cache, offlineSessionsCache, clientSessionCache, offlineClientSessionsCache, !preloadOfflineSessionsFromDatabase);<NEW_LINE>}
connections.getCache(InfinispanConnectionProvider.OFFLINE_CLIENT_SESSION_CACHE_NAME);
322,938
public void mousePressed(MouseEvent e, TransferData data) {<NEW_LINE>MageCard cardPanel = data.getComponent().getTopPanelRef();<NEW_LINE>cardPanel.requestFocusInWindow();<NEW_LINE>// for some reason sometime mouseRelease happens before numerous Mouse_Dragged events<NEW_LINE>// that results in not finished dragging<NEW_LINE>clearDragging(this.prevCardPanel);<NEW_LINE>isDragging = false;<NEW_LINE>startedDragging = false;<NEW_LINE>prevCardPanel = null;<NEW_LINE>draggingCards.clear();<NEW_LINE>Point mouse = new Point(e.getX(), e.getY());<NEW_LINE>SwingUtilities.convertPointToScreen(mouse, data.getComponent());<NEW_LINE>initialMousePos = new Point((int) mouse.getX(), (<MASK><NEW_LINE>initialCardPos = cardPanel.getCardLocation().getCardPoint();<NEW_LINE>// Closes popup & enlarged view if a card/Permanent is selected<NEW_LINE>hideTooltipPopup();<NEW_LINE>}
int) mouse.getY());
1,736,880
public void checkConverted() {<NEW_LINE>List<String> keys = null;<NEW_LINE>try {<NEW_LINE>keys = _protoCache.keySet().stream().collect(Collectors.toList());<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to read converted sessions, assuming still in legacy format. Run again without 'check' option to convert.");<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>for (String s : keys) {<NEW_LINE>InfinispanSessionData converted = _protoCache.get(s);<NEW_LINE>if (converted != null) {<NEW_LINE>System.err.println("OK: " + converted);<NEW_LINE>converted.getKeys().stream().forEach((ss) -> System.err.println(ss + ":" + converted.getAttribute(ss)));<NEW_LINE>} else<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>System.err.println("Total converted sessions: " + keys.size());<NEW_LINE>}
err.println("Failed: " + s);