idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
527,831
private void initDeviceView() {<NEW_LINE>main = new Composite(parent, SWT.NONE);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.numColumns = 1;<NEW_LINE>layout.marginTop = 4;<NEW_LINE>layout.marginBottom = 4;<NEW_LINE>layout.marginHeight = 4;<NEW_LINE>layout.marginWidth = 4;<NEW_LINE>main.setLayout(layout);<NEW_LINE>GridData grid_data;<NEW_LINE>main.setLayoutData(Utils.getFilledFormData());<NEW_LINE>// control<NEW_LINE>Composite control = new Composite(main, SWT.NONE);<NEW_LINE>layout = new GridLayout();<NEW_LINE>layout.numColumns = 3;<NEW_LINE>layout.marginLeft = 0;<NEW_LINE>control.setLayout(layout);<NEW_LINE>// browse to local dir<NEW_LINE>grid_data = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE>grid_data.horizontalSpan = 1;<NEW_LINE>control.setLayoutData(grid_data);<NEW_LINE>Label dir_lab = new Label(control, SWT.NONE);<NEW_LINE>dir_lab.setText("Local directory: " + device.<MASK><NEW_LINE>Button show_folder_button = new Button(control, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(show_folder_button, "MyTorrentsView.menu.explore");<NEW_LINE>show_folder_button.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>ManagerUtils.open(device.getWorkingDirectory());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new Label(control, SWT.NONE);<NEW_LINE>if (device.canFilterFilesView()) {<NEW_LINE>final Button show_xcode_button = new Button(control, SWT.CHECK);<NEW_LINE>Messages.setLanguageText(show_xcode_button, "devices.xcode.only.show");<NEW_LINE>show_xcode_button.setSelection(device.getFilterFilesView());<NEW_LINE>show_xcode_button.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>device.setFilterFilesView(show_xcode_button.getSelection());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>final Button btnReset = new Button(main, SWT.PUSH);<NEW_LINE>btnReset.setText("Forget Default Profile Choice");<NEW_LINE>btnReset.addSelectionListener(new SelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>device.setDefaultTranscodeProfile(null);<NEW_LINE>btnReset.setEnabled(false);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetDefaultSelected(SelectionEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>btnReset.setEnabled(device.getDefaultTranscodeProfile() != null);<NEW_LINE>} catch (TranscodeException e1) {<NEW_LINE>btnReset.setEnabled(false);<NEW_LINE>}<NEW_LINE>btnReset.setLayoutData(new GridData());<NEW_LINE>parent.getParent().layout();<NEW_LINE>}
getWorkingDirectory().getAbsolutePath());
1,626,797
public static void convolve5(Kernel2D_S32 kernel, GrayS16 input, GrayI16 output, int skip) {<NEW_LINE>final short[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final <MASK><NEW_LINE>final int widthEnd = UtilDownConvolve.computeMaxSide(input.width, skip, radius);<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offset = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offset; y <= heightEnd; y += skip) {<NEW_LINE>// first time through the value needs to be set<NEW_LINE>int k1 = kernel.data[0];<NEW_LINE>int k2 = kernel.data[1];<NEW_LINE>int k3 = kernel.data[2];<NEW_LINE>int k4 = kernel.data[3];<NEW_LINE>int k5 = kernel.data[4];<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride + offset / skip;<NEW_LINE>int indexSrcRow = input.startIndex + (y - radius) * input.stride - radius;<NEW_LINE>for (int x = offset; x <= widthEnd; x += skip) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>// rest of the convolution rows are an addition<NEW_LINE>for (int i = 1; i < 5; i++) {<NEW_LINE>indexDst = output.startIndex + (y / skip) * output.stride + offset / skip;<NEW_LINE>indexSrcRow = input.startIndex + (y + i - radius) * input.stride - radius;<NEW_LINE>k1 = kernel.data[i * 5 + 0];<NEW_LINE>k2 = kernel.data[i * 5 + 1];<NEW_LINE>k3 = kernel.data[i * 5 + 2];<NEW_LINE>k4 = kernel.data[i * 5 + 3];<NEW_LINE>k5 = kernel.data[i * 5 + 4];<NEW_LINE>for (int x = offset; x <= widthEnd; x += skip) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] += (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int radius = kernel.getRadius();
1,374,318
public void onNavigationDrawerItemSelected(int position) {<NEW_LINE>switch(position) {<NEW_LINE>case SORT_RECENT:<NEW_LINE>sortMethod = SORT_RECENT;<NEW_LINE>navSubtitle = getString(R.string.file_list_recent);<NEW_LINE>break;<NEW_LINE>case SORT_HOMEBREW:<NEW_LINE>sortMethod = SORT_HOMEBREW;<NEW_LINE>navSubtitle = getString(R.string.file_list_homebrew);<NEW_LINE>break;<NEW_LINE>case SORT_NONE:<NEW_LINE>default:<NEW_LINE>sortMethod = SORT_NONE;<NEW_LINE>navSubtitle = <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>ActionBar actionbar = getSupportActionBar();<NEW_LINE>if (actionbar != null) {<NEW_LINE>actionbar.setSubtitle("Games - " + navSubtitle);<NEW_LINE>}<NEW_LINE>prepareFileListView(false);<NEW_LINE>SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);<NEW_LINE>sp.edit().putInt("sortMethod", sortMethod).apply();<NEW_LINE>}
getString(R.string.file_list_default);
1,842,759
private void init() {<NEW_LINE>selectionField = new DropDownSelectionTextField<>(new DataTypeDropDownSelectionDataModel(dataTypeManagerService));<NEW_LINE>selectionField.addCellEditorListener(new CellEditorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void editingCanceled(ChangeEvent e) {<NEW_LINE>fireEditingCanceled();<NEW_LINE>navigationDirection = null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void editingStopped(ChangeEvent e) {<NEW_LINE>fireEditingStopped();<NEW_LINE>navigationDirection = null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>selectionField.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));<NEW_LINE>browseButton = ButtonPanelFactory.createButton(ButtonPanelFactory.BROWSE_TYPE);<NEW_LINE>browseButton.setToolTipText("Browse the Data Manager");<NEW_LINE>browseButton.addActionListener(e -> showDataTypeBrowser());<NEW_LINE>editorPanel = new JPanel();<NEW_LINE>editorPanel.setLayout(new BoxLayout(editorPanel, BoxLayout.X_AXIS));<NEW_LINE>editorPanel.add(selectionField);<NEW_LINE>editorPanel.add<MASK><NEW_LINE>editorPanel.add(browseButton);<NEW_LINE>keyListener = new KeyAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent e) {<NEW_LINE>int keyCode = e.getKeyCode();<NEW_LINE>if (keyCode == KeyEvent.VK_TAB) {<NEW_LINE>if (e.isShiftDown()) {<NEW_LINE>navigationDirection = NavigationDirection.BACKWARD;<NEW_LINE>} else {<NEW_LINE>navigationDirection = NavigationDirection.FORWARD;<NEW_LINE>}<NEW_LINE>fireEditingStopped();<NEW_LINE>e.consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
(Box.createHorizontalStrut(5));
326,043
public void loadFromFile(byte[] buf, int offset) throws IOException {<NEW_LINE>signature1 = LEDataInputStream.readInt(buf, offset + 0);<NEW_LINE>signature2 = LEDataInputStream.<MASK><NEW_LINE>flags = LEDataInputStream.readInt(buf, offset + 8);<NEW_LINE>version = LEDataInputStream.readInt(buf, offset + 12);<NEW_LINE>System.arraycopy(buf, offset + 16, masterSeed, 0, 16);<NEW_LINE>System.arraycopy(buf, offset + 32, encryptionIV, 0, 16);<NEW_LINE>numGroups = LEDataInputStream.readInt(buf, offset + 48);<NEW_LINE>numEntries = LEDataInputStream.readInt(buf, offset + 52);<NEW_LINE>System.arraycopy(buf, offset + 56, contentsHash, 0, 32);<NEW_LINE>System.arraycopy(buf, offset + 88, transformSeed, 0, 32);<NEW_LINE>numKeyEncRounds = LEDataInputStream.readInt(buf, offset + 120);<NEW_LINE>if (numKeyEncRounds < 0) {<NEW_LINE>// TODO: Really treat this like an unsigned integer<NEW_LINE>throw new IOException("Does not support more than " + Integer.MAX_VALUE + " rounds.");<NEW_LINE>}<NEW_LINE>}
readInt(buf, offset + 4);
1,628,391
private CompletableFuture<WriterFlushResult> flushNormally(boolean force, TimeoutTimer timer) {<NEW_LINE>assert this.state.get() == AggregatorState.Writing : "flushNormally cannot be called if state == " + this.state;<NEW_LINE>long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "flushNormally", force, this.operations.size());<NEW_LINE>WriterFlushResult result = new WriterFlushResult();<NEW_LINE>AtomicBoolean canContinue = new AtomicBoolean(true);<NEW_LINE>return Futures.loop(canContinue::get, () -> flushOnce(force, timer), partialResult -> {<NEW_LINE>canContinue.set(partialResult.getFlushedBytes() + <MASK><NEW_LINE>result.withFlushResult(partialResult);<NEW_LINE>}, this.executor).thenApply(v -> {<NEW_LINE>LoggerHelpers.traceLeave(log, this.traceObjectId, "flushNormally", traceId, result);<NEW_LINE>return result;<NEW_LINE>});<NEW_LINE>}
partialResult.getMergedBytes() > 0);
652,854
public void handleGET(CoapExchange exchange) {<NEW_LINE>Response response = new Response(CONTENT);<NEW_LINE>Integer maxConnections = null;<NEW_LINE>Integer nodeId = null;<NEW_LINE>List<CounterStatisticManager> healths = endpointHealth;<NEW_LINE>Endpoint endpoint = exchange.advanced().getEndpoint();<NEW_LINE>if (endpoint != null) {<NEW_LINE>if (CoAP.COAP_SECURE_URI_SCHEME.equalsIgnoreCase(endpoint.getUri().getScheme())) {<NEW_LINE>Configuration config = endpoint.getConfig();<NEW_LINE>maxConnections = <MASK><NEW_LINE>nodeId = config.get(DtlsConfig.DTLS_CONNECTION_ID_NODE_ID);<NEW_LINE>}<NEW_LINE>if (endpointsHealth != null) {<NEW_LINE>healths = endpointsHealth.get(endpoint.getAddress());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>switch(exchange.getRequestOptions().getAccept()) {<NEW_LINE>case UNDEFINED:<NEW_LINE>case TEXT_PLAIN:<NEW_LINE>response.getOptions().setContentFormat(TEXT_PLAIN);<NEW_LINE>response.setPayload(toText(maxConnections, nodeId, healths));<NEW_LINE>break;<NEW_LINE>case APPLICATION_JSON:<NEW_LINE>response.getOptions().setContentFormat(APPLICATION_JSON);<NEW_LINE>response.setPayload(toJson(maxConnections, nodeId, healths));<NEW_LINE>break;<NEW_LINE>case APPLICATION_CBOR:<NEW_LINE>response.getOptions().setContentFormat(APPLICATION_CBOR);<NEW_LINE>response.setPayload(toCbor(maxConnections, nodeId, healths));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>response = new Response(NOT_ACCEPTABLE);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>exchange.respond(response);<NEW_LINE>}
config.get(DtlsConfig.DTLS_MAX_CONNECTIONS);
1,345,453
public static boolean validate(String ldapURL, String domain, String userName, String password) {<NEW_LINE>Hashtable<String, String> env = new Hashtable<String, String>();<NEW_LINE>env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");<NEW_LINE>// ldap://dc.compiere.org<NEW_LINE>env.put(Context.PROVIDER_URL, ldapURL);<NEW_LINE>env.put(Context.SECURITY_AUTHENTICATION, "simple");<NEW_LINE>// jjanke@compiere.org<NEW_LINE>// For OpenLDAP uncomment the next line<NEW_LINE>// StringBuffer principal = new StringBuffer("uid=").append(userName).append(",").append(domain);<NEW_LINE>StringBuffer principal = new StringBuffer(userName).append("@").append(domain);<NEW_LINE>env.put(Context.<MASK><NEW_LINE>env.put(Context.SECURITY_CREDENTIALS, password);<NEW_LINE>//<NEW_LINE>try {<NEW_LINE>// Create the initial context<NEW_LINE>InitialLdapContext ctx = new InitialLdapContext(env, null);<NEW_LINE>// DirContext ctx = new InitialDirContext(env);<NEW_LINE>// Test - Get the attributes<NEW_LINE>Attributes answer = ctx.getAttributes("");<NEW_LINE>// Print the answer<NEW_LINE>if (false)<NEW_LINE>dump(answer);<NEW_LINE>} catch (AuthenticationException e) {<NEW_LINE>log.info("Error: " + principal + " - " + e.getLocalizedMessage());<NEW_LINE>return false;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, ldapURL + " - " + principal, e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>log.info("OK: " + principal);<NEW_LINE>return true;<NEW_LINE>}
SECURITY_PRINCIPAL, principal.toString());
480,066
private void fillPicks() {<NEW_LINE>// Price List<NEW_LINE>String sql = "SELECT M_PriceList_Version.M_PriceList_Version_ID," + " M_PriceList_Version.Name || ' (' || c.Iso_Code || ')' AS ValueName " + "FROM M_PriceList_Version, M_PriceList pl, C_Currency c " + "WHERE M_PriceList_Version.M_PriceList_ID=pl.M_PriceList_ID" + " AND pl.C_Currency_ID=c.C_Currency_ID" + " AND M_PriceList_Version.IsActive='Y' AND pl.IsActive='Y'";<NEW_LINE>// Add Access & Order<NEW_LINE>// fully qualidfied - RO<NEW_LINE>sql = MRole.getDefault().addAccessSQL(sql, "M_PriceList_Version", true, false) + " ORDER BY M_PriceList_Version.Name";<NEW_LINE>try {<NEW_LINE>pickPriceList.addItem(new KeyNamePair(0, ""));<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, null);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>KeyNamePair kn = new KeyNamePair(rs.getInt(1), rs.getString(2));<NEW_LINE>pickPriceList.addItem(kn);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>// Warehouse<NEW_LINE>sql = "SELECT M_Warehouse_ID, Value || ' - ' || Name AS ValueName " + "FROM M_Warehouse " + "WHERE IsActive='Y'";<NEW_LINE>sql = MRole.getDefault().addAccessSQL(sql, "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) + " ORDER BY Value";<NEW_LINE>pickWarehouse.addItem(<MASK><NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>KeyNamePair kn = new KeyNamePair(rs.getInt("M_Warehouse_ID"), rs.getString("ValueName"));<NEW_LINE>pickWarehouse.addItem(kn);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>}<NEW_LINE>}
new KeyNamePair(0, ""));
1,075,384
private String compileToExplodedBundle(PrintWriter writer) throws IOException, OSGiException {<NEW_LINE>Files.createDirectories(binaryDir);<NEW_LINE>Summary summary = new Summary();<NEW_LINE>List<String> options = new ArrayList<>();<NEW_LINE>options.add("-g");<NEW_LINE>options.add("-d");<NEW_LINE>options.add(binaryDir.toString());<NEW_LINE>options.add("-sourcepath");<NEW_LINE>options.add(getSourceDirectory().toString());<NEW_LINE>options.add("-classpath");<NEW_LINE>options.add(System.getProperty("java.class.path") + File.pathSeparator + binaryDir.toString());<NEW_LINE>options.add("-proc:none");<NEW_LINE>// clear build errors<NEW_LINE>for (ResourceFile sourceFile : newSources) {<NEW_LINE>clearBuildErrors(sourceFile);<NEW_LINE>}<NEW_LINE>try (BundleJavaManager bundleJavaManager = createBundleJavaManager(writer, summary, options)) {<NEW_LINE>final List<ResourceFileJavaFileObject> sourceFiles = newSources.stream().map(sf -> new ResourceFileJavaFileObject(sf.getParentFile(), sf, Kind.SOURCE)).collect(Collectors.toList());<NEW_LINE>Path binaryManifest = getBinaryManifestPath();<NEW_LINE>if (Files.exists(binaryManifest)) {<NEW_LINE>Files.delete(binaryManifest);<NEW_LINE>}<NEW_LINE>// try to compile, if we fail, avoid offenders and try again<NEW_LINE>while (!sourceFiles.isEmpty()) {<NEW_LINE>if (tryBuild(writer, bundleJavaManager, sourceFiles, options)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// buildErrors is now up to date, set status<NEW_LINE>if (getBuildErrorCount() > 0) {<NEW_LINE>int count = getBuildErrorCount();<NEW_LINE>summary.printf("%d source file%s with errors", count, count > 1 ? "s" : "");<NEW_LINE>}<NEW_LINE>ResourceFile sourceManifest = getSourceManifestFile();<NEW_LINE>if (sourceManifest.exists()) {<NEW_LINE>Files.<MASK><NEW_LINE>try (InputStream inStream = sourceManifest.getInputStream()) {<NEW_LINE>Files.copy(inStream, binaryManifest, StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>}<NEW_LINE>return summary.getValue();<NEW_LINE>}<NEW_LINE>return generateManifest(writer, summary, binaryManifest);<NEW_LINE>}<NEW_LINE>}
createDirectories(binaryManifest.getParent());
1,334,259
public boolean isKey(RelOptTable table, List<Integer> columns) {<NEW_LINE>final JdbcTable jdbcTable = table.unwrap(JdbcTable.class);<NEW_LINE>return withBuilder(jdbcTable.jdbcSchema, (cluster, relOptSchema, jdbcSchema, relBuilder) -> {<NEW_LINE>// The collection of columns ['DEPTNO'] is a key for 'EMP' if the<NEW_LINE>// following query returns no rows:<NEW_LINE>//<NEW_LINE>// SELECT 1<NEW_LINE>// FROM `EMP`<NEW_LINE>// GROUP BY `DEPTNO`<NEW_LINE>// HAVING COUNT(*) > 1<NEW_LINE>//<NEW_LINE>final RelOptTable.ToRelContext toRelContext = ViewExpanders.simpleContext(cluster);<NEW_LINE>relBuilder.push(table.toRel(toRelContext)).aggregate(relBuilder.groupKey(relBuilder.fields(columns)), relBuilder.count()).filter(relBuilder.call(SqlStdOperatorTable.GREATER_THAN, Util.last(relBuilder.fields()), relBuilder.literal(1)));<NEW_LINE>final String sql = toSql(relBuilder.build(), jdbcSchema.dialect);<NEW_LINE>final <MASK><NEW_LINE>try (Connection connection = dataSource.getConnection();<NEW_LINE>Statement statement = connection.createStatement();<NEW_LINE>ResultSet resultSet = statement.executeQuery(sql)) {<NEW_LINE>return !resultSet.next();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw handle(e, sql);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
DataSource dataSource = jdbcSchema.getDataSource();
1,643,460
private static <T> T instantiateComponent(Class<? extends T> argumentExtractor, final Annotation annotation, final Class<?> paramType, Injector injector) {<NEW_LINE>// Noarg constructor<NEW_LINE>Constructor noarg = getNoArgConstructor(argumentExtractor);<NEW_LINE>if (noarg != null) {<NEW_LINE>try {<NEW_LINE>return (T) noarg.newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RoutingException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Simple case, just takes the annotation<NEW_LINE>Constructor simple = getSingleArgConstructor(argumentExtractor, annotation.annotationType());<NEW_LINE>if (simple != null) {<NEW_LINE>try {<NEW_LINE>return (T) simple.newInstance(annotation);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RoutingException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Simple case, just takes the parsed class<NEW_LINE>Constructor simpleClass = getSingleArgConstructor(argumentExtractor, Class.class);<NEW_LINE>if (simpleClass != null) {<NEW_LINE>try {<NEW_LINE>return (<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RoutingException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Complex case, use Guice. Create a child injector with the annotation in it.<NEW_LINE>return injector.createChildInjector(new AbstractModule() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void configure() {<NEW_LINE>bind((Class<Annotation>) annotation.annotationType()).toInstance(annotation);<NEW_LINE>bind(ArgumentClassHolder.class).toInstance(new ArgumentClassHolder(paramType));<NEW_LINE>}<NEW_LINE>}).getInstance(argumentExtractor);<NEW_LINE>}
T) simpleClass.newInstance(paramType);
1,410,347
public ResponseEntity<Boolean> sendTicketByEmail(@PathVariable("eventName") String eventName, @PathVariable("ticketIdentifier") String ticketIdentifier) {<NEW_LINE>return ticketReservationManager.fetchCompleteAndAssigned(eventName, ticketIdentifier).map(data -> {<NEW_LINE><MASK><NEW_LINE>TicketReservation reservation = data.getMiddle();<NEW_LINE>Ticket ticket = data.getRight();<NEW_LINE>Locale locale = LocaleUtil.getTicketLanguage(ticket, LocaleUtil.forLanguageTag(reservation.getUserLanguage(), event));<NEW_LINE>TicketCategory category = ticketCategoryRepository.getById(ticket.getCategoryId());<NEW_LINE>notificationManager.sendTicketByEmail(ticket, event, locale, ticketHelper.getConfirmationTextBuilder(locale, event, reservation, ticket, category), reservation, ticketCategoryRepository.getByIdAndActive(ticket.getCategoryId(), event.getId()), () -> ticketReservationManager.retrieveAttendeeAdditionalInfoForTicket(ticket));<NEW_LINE>return ResponseEntity.ok(true);<NEW_LINE>}).orElseGet(() -> ResponseEntity.notFound().build());<NEW_LINE>}
Event event = data.getLeft();
60,406
public boolean validate(Project project, BlazeContext context, BlazeProjectData blazeProjectData) {<NEW_LINE>if (!blazeProjectData.getWorkspaceLanguageSettings().isLanguageActive(LanguageClass.GO) || PluginUtils.isPluginEnabled(GO_PLUGIN_ID)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (PluginUtils.isPluginEnabled(OLD_GO_PLUGIN_ID)) {<NEW_LINE>String error = String.format("The currently installed Go plugin is no longer supported by the %s plugin.\n" + <MASK><NEW_LINE>IssueOutput.error(error).navigatable(new NavigatableAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void navigate(boolean requestFocus) {<NEW_LINE>PluginManager.disablePlugin(OLD_GO_PLUGIN_ID);<NEW_LINE>PluginUtils.installOrEnablePlugin(GO_PLUGIN_ID);<NEW_LINE>}<NEW_LINE>}).submit(context);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>IssueOutput.error("Go support requires the Go plugin. Click here to install/enable the JetBrains Go " + "plugin, then restart the IDE").navigatable(PluginUtils.installOrEnablePluginNavigable(GO_PLUGIN_ID)).submit(context);<NEW_LINE>return true;<NEW_LINE>}
"Click here to install the new JetBrains Go plugin and restart.", Blaze.defaultBuildSystemName());
1,433,623
void computeProjectionTable(int width, int height) {<NEW_LINE>output.reshape(width, height);<NEW_LINE>depthMap.reshape(width, height);<NEW_LINE>ImageMiscOps.fill(depthMap, -1);<NEW_LINE>int samplesPerPixel = renderSampling * renderSampling;<NEW_LINE>int pointingPixelStride = samplesPerPixel * 3;<NEW_LINE>int pointingStride = output.width * pointingPixelStride;<NEW_LINE>pointing = new float[height * pointingStride];<NEW_LINE>double offsetSample = 0.5 / renderSampling;<NEW_LINE>for (int y = 0; y < output.height; y++) {<NEW_LINE>for (int x = 0; x < output.width; x++) {<NEW_LINE>int pointingIndex = y * pointingStride + x * pointingPixelStride;<NEW_LINE>for (int sampleIdx = 0; sampleIdx < samplesPerPixel; sampleIdx++) {<NEW_LINE>int sampleY = sampleIdx / renderSampling;<NEW_LINE>int sampleX = sampleIdx % renderSampling;<NEW_LINE>double <MASK><NEW_LINE>double subX = sampleX / (double) renderSampling;<NEW_LINE>pixelTo3.compute(offsetSample + x + subX, offsetSample + y + subY, p3);<NEW_LINE>if (UtilEjml.isUncountable(p3.x)) {<NEW_LINE>depthMap.unsafe_set(x, y, Float.NaN);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>pointing[pointingIndex++] = (float) p3.x;<NEW_LINE>pointing[pointingIndex++] = (float) p3.y;<NEW_LINE>pointing[pointingIndex++] = (float) p3.z;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
subY = sampleY / (double) renderSampling;
548,937
public void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState) {<NEW_LINE>super.onInflate(context, attrs, savedInstanceState);<NEW_LINE>TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.BlocklyFlyout, 0, 0);<NEW_LINE>try {<NEW_LINE>mCloseable = a.getBoolean(R.styleable.BlocklyFlyout_closeable, mCloseable);<NEW_LINE>mScrollOrientation = a.getInt(R.styleable.BlocklyFlyout_scrollOrientation, mScrollOrientation);<NEW_LINE>} finally {<NEW_LINE>a.recycle();<NEW_LINE>}<NEW_LINE>// Store values in arguments, so fragment resume works (no inflation during resume).<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args == null) {<NEW_LINE>setArguments<MASK><NEW_LINE>}<NEW_LINE>args.putBoolean(ARG_CLOSEABLE, mCloseable);<NEW_LINE>args.putInt(ARG_SCROLL_ORIENTATION, mScrollOrientation);<NEW_LINE>}
(args = new Bundle());
592,967
protected void executeLowLevelRequest() {<NEW_LINE>UpdateItemResult updateItemResult = doUpdateItem();<NEW_LINE>// The UpdateItem request is specified to return ALL_NEW<NEW_LINE>// attributes of the affected item. So if the returned<NEW_LINE>// UpdateItemResult does not include any ReturnedAttributes,<NEW_LINE>// it indicates the UpdateItem failed silently (e.g. the<NEW_LINE>// key-only-put nightmare -<NEW_LINE>// https://forums.aws.amazon.com/thread.jspa?threadID=86798&tstart=25),<NEW_LINE>// in which case we should re-send a PutItem<NEW_LINE>// request instead.<NEW_LINE>if (updateItemResult.getAttributes() == null || updateItemResult.getAttributes().isEmpty()) {<NEW_LINE>// Before we proceed with PutItem, we need to put all<NEW_LINE>// the key attributes (prepared for the<NEW_LINE>// UpdateItemRequest) into the AttributeValueUpdates<NEW_LINE>// collection.<NEW_LINE>for (String keyAttributeName : getPrimaryKeyAttributeValues().keySet()) {<NEW_LINE>getAttributeValueUpdates().put(keyAttributeName, new AttributeValueUpdate().withValue(getPrimaryKeyAttributeValues().get(keyAttributeName<MASK><NEW_LINE>}<NEW_LINE>doPutItem();<NEW_LINE>}<NEW_LINE>}
)).withAction("PUT"));
1,151,022
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>jPanel1 = new javax.swing.JPanel();<NEW_LINE>jLabel1 = <MASK><NEW_LINE>userAgentInput = new javax.swing.JTextField();<NEW_LINE>jLabel2 = new javax.swing.JLabel();<NEW_LINE>cookieJarInput = new javax.swing.JTextField();<NEW_LINE>jButton1 = new javax.swing.JButton();<NEW_LINE>setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);<NEW_LINE>setTitle("JAV L");<NEW_LINE>setLocationByPlatform(true);<NEW_LINE>setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);<NEW_LINE>setPreferredSize(new java.awt.Dimension(500, 150));<NEW_LINE>jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Para"));<NEW_LINE>jPanel1.setLayout(new java.awt.GridLayout(0, 2));<NEW_LINE>jLabel1.setText("User Agent");<NEW_LINE>jPanel1.add(jLabel1);<NEW_LINE>userAgentInput.setToolTipText("The user agent used to generate to cookie jar.\n\nExemple: Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0");<NEW_LINE>jPanel1.add(userAgentInput);<NEW_LINE>jLabel2.setText("Cookie jar file");<NEW_LINE>jPanel1.add(jLabel2);<NEW_LINE>cookieJarInput.setToolTipText("The path to the cookie jar file.\n\nCookie jar is curl formatted. One can use cookies.txt plugin for firefox to generate this file");<NEW_LINE>cookieJarInput.addMouseListener(new java.awt.event.MouseAdapter() {<NEW_LINE><NEW_LINE>public void mouseClicked(java.awt.event.MouseEvent evt) {<NEW_LINE>cookieJarInputMouseClicked(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jPanel1.add(cookieJarInput);<NEW_LINE>getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);<NEW_LINE>jButton1.setText("OK");<NEW_LINE>jButton1.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>jButton1ActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>getContentPane().add(jButton1, java.awt.BorderLayout.SOUTH);<NEW_LINE>pack();<NEW_LINE>}
new javax.swing.JLabel();
552,061
public void init(String title) {<NEW_LINE>assert !htmldoc.getDocumentElement().hasChildNodes();<NEW_LINE>// head<NEW_LINE>Element head = htmldoc.createElement(HTMLUtil.HTML_HEAD_TAG);<NEW_LINE>head.appendChild(htmldoc.createComment(MODIFICATION_WARNING));<NEW_LINE>htmldoc.getDocumentElement().appendChild(head);<NEW_LINE>// meta with charset information<NEW_LINE>Element meta = htmldoc.createElement(HTMLUtil.HTML_META_TAG);<NEW_LINE>meta.setAttribute(HTMLUtil.HTML_HTTP_EQUIV_ATTRIBUTE, HTMLUtil.HTML_HTTP_EQUIV_CONTENT_TYPE);<NEW_LINE>meta.setAttribute(<MASK><NEW_LINE>head.appendChild(meta);<NEW_LINE>// stylesheet<NEW_LINE>Element css = htmldoc.createElement(HTMLUtil.HTML_LINK_TAG);<NEW_LINE>css.setAttribute(HTMLUtil.HTML_REL_ATTRIBUTE, HTMLUtil.HTML_REL_STYLESHEET);<NEW_LINE>css.setAttribute(HTMLUtil.HTML_TYPE_ATTRIBUTE, HTMLUtil.CONTENT_TYPE_CSS);<NEW_LINE>css.setAttribute(HTMLUtil.HTML_HREF_ATTRIBUTE, CSSFILE);<NEW_LINE>head.appendChild(css);<NEW_LINE>// title<NEW_LINE>head.appendChild(htmldoc.createElement(HTMLUtil.HTML_TITLE_TAG)).setTextContent(title);<NEW_LINE>// body<NEW_LINE>Element body = htmldoc.createElement(HTMLUtil.HTML_BODY_TAG);<NEW_LINE>//<NEW_LINE>htmldoc.getDocumentElement().appendChild(body).appendChild(htmldoc.createComment(MODIFICATION_WARNING));<NEW_LINE>body.appendChild(htmldoc.createElement(HTMLUtil.HTML_H1_TAG)).setTextContent(title + ":");<NEW_LINE>// Main definition list<NEW_LINE>maindl = htmldoc.createElement(HTMLUtil.HTML_DL_TAG);<NEW_LINE>body.appendChild(maindl);<NEW_LINE>}
HTMLUtil.HTML_CONTENT_ATTRIBUTE, HTMLUtil.CONTENT_TYPE_HTML_UTF8);
1,542,648
public static FindProjectStatisticalDataResponse unmarshall(FindProjectStatisticalDataResponse findProjectStatisticalDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>findProjectStatisticalDataResponse.setRequestId(_ctx.stringValue("FindProjectStatisticalDataResponse.RequestId"));<NEW_LINE>findProjectStatisticalDataResponse.setCode(_ctx.integerValue("FindProjectStatisticalDataResponse.Code"));<NEW_LINE>findProjectStatisticalDataResponse.setMessage(_ctx.stringValue("FindProjectStatisticalDataResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("FindProjectStatisticalDataResponse.Data.CurrentPage"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("FindProjectStatisticalDataResponse.Data.PageNumber"));<NEW_LINE>data.setTotal(_ctx.longValue("FindProjectStatisticalDataResponse.Data.Total"));<NEW_LINE>List<ServiceStatisticData> monitorStatisticData = new ArrayList<ServiceStatisticData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData.Length"); i++) {<NEW_LINE>ServiceStatisticData serviceStatisticData = new ServiceStatisticData();<NEW_LINE>serviceStatisticData.setAvgRt(_ctx.floatValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].AvgRt"));<NEW_LINE>serviceStatisticData.setMaxRt(_ctx.floatValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].MaxRt"));<NEW_LINE>serviceStatisticData.setMinRt(_ctx.floatValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].MinRt"));<NEW_LINE>Total total = new Total();<NEW_LINE>total.setTotal(_ctx.longValue<MASK><NEW_LINE>total.setErrorNum(_ctx.longValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].Total.ErrorNum"));<NEW_LINE>serviceStatisticData.setTotal(total);<NEW_LINE>ProjectInfoData projectInfoData = new ProjectInfoData();<NEW_LINE>projectInfoData.setProjectName(_ctx.stringValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].ProjectInfoData.ProjectName"));<NEW_LINE>serviceStatisticData.setProjectInfoData(projectInfoData);<NEW_LINE>monitorStatisticData.add(serviceStatisticData);<NEW_LINE>}<NEW_LINE>data.setMonitorStatisticData(monitorStatisticData);<NEW_LINE>findProjectStatisticalDataResponse.setData(data);<NEW_LINE>return findProjectStatisticalDataResponse;<NEW_LINE>}
("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].Total.Total"));
1,737,524
private FinalText concatenateResult(String containingElementName) {<NEW_LINE>// null element means that this is a formatting artifact, not content.<NEW_LINE>if (containingElementName == null) {<NEW_LINE>// at some point, we may want to extract alternate text for some<NEW_LINE>// artifacts.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StringBuilder res = new StringBuilder();<NEW_LINE>if (usePdfMarkupElements && !containingElementName.isEmpty()) {<NEW_LINE>res.append('<').append(containingElementName).append('>');<NEW_LINE>}<NEW_LINE>for (FinalText item : result) {<NEW_LINE>res.append(item.getText());<NEW_LINE>}<NEW_LINE>// important, as the stuff buffered in the result is now used up!<NEW_LINE>result.clear();<NEW_LINE>if (usePdfMarkupElements && !containingElementName.isEmpty()) {<NEW_LINE>res.append("</");<NEW_LINE>int spacePos = containingElementName.indexOf(' ');<NEW_LINE>if (spacePos >= 0) {<NEW_LINE>containingElementName = <MASK><NEW_LINE>}<NEW_LINE>res.append(containingElementName).append('>');<NEW_LINE>}<NEW_LINE>return new FinalText(res.toString());<NEW_LINE>}
containingElementName.substring(0, spacePos);
384,872
private int doSignal(ExecutionEnvironment env, String scope, Signal signal, String... args) {<NEW_LINE>try {<NEW_LINE>String path = getPath(env);<NEW_LINE>if (path == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>StringBuilder cmd = new StringBuilder();<NEW_LINE>try {<NEW_LINE>HostInfo hostInfo = HostInfoUtils.getHostInfo(env);<NEW_LINE>if (HostInfo.OSFamily.WINDOWS.equals(hostInfo.getOSFamily())) {<NEW_LINE>path = WindowsSupport.getInstance().convertToShellPath(path);<NEW_LINE>}<NEW_LINE>if (path == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>} catch (ConnectionManager.CancellationException ex) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>cmd.append('"').append(path).append('"').append(' ');<NEW_LINE>cmd.append(scope).append(' ');<NEW_LINE>// NOI18N<NEW_LINE>cmd.append(signal == Signal.NULL ? "NULL" : signal.name().substring(3)).append(' ');<NEW_LINE>for (String arg : args) {<NEW_LINE>cmd.append(arg).append(' ');<NEW_LINE>}<NEW_LINE>ExitStatus status = ShellSession.execute(<MASK><NEW_LINE>if (!status.getErrorLines().isEmpty()) {<NEW_LINE>// NOI18N<NEW_LINE>log.log(Level.FINE, "doSignal: {0}", status.toString());<NEW_LINE>}<NEW_LINE>return status.exitCode;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NOI18N<NEW_LINE>log.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.FINE, // NOI18N<NEW_LINE>"attempt to send signal " + signal.name() + " to " + scope + " " + Arrays.toString(args) + " failed:", ex);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}
env, cmd.toString());
981,983
public void populateItem(final Item<FederationModel> item) {<NEW_LINE>final FederationModel entry = item.getModelObject();<NEW_LINE>item.add(new LinkPanel("url", "list", entry.url, FederationRegistrationPage.class, WicketUtils.newRegistrationParameter(entry.url, entry.name)));<NEW_LINE>item.add(WicketUtils.getPullStatusImage("statusIcon", entry.getLowestStatus()));<NEW_LINE>item.add(new LinkPanel("name", "list", entry.name, FederationRegistrationPage.class, WicketUtils.newRegistrationParameter(entry.url, entry.name)));<NEW_LINE>item.add(WicketUtils.getRegistrationImage("typeIcon", entry, this));<NEW_LINE>item.add(WicketUtils.createDateLabel("lastPull", entry.lastPull, getTimeZone(), getTimeUtils()));<NEW_LINE>item.add(WicketUtils.createTimestampLabel("nextPull", entry.nextPull, getTimeZone(), getTimeUtils()));<NEW_LINE>item.add(new Label<MASK><NEW_LINE>WicketUtils.setAlternatingBackground(item, counter);<NEW_LINE>counter++;<NEW_LINE>}
("frequency", entry.frequency));
78,605
private static void parseCompoundSortField(XContentParser parser, List<SortBuilder<?>> sortFields) throws IOException {<NEW_LINE>XContentParser.Token token;<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {<NEW_LINE>if (token == XContentParser.Token.FIELD_NAME) {<NEW_LINE>String fieldName = parser.currentName();<NEW_LINE>token = parser.nextToken();<NEW_LINE>if (token == XContentParser.Token.VALUE_STRING) {<NEW_LINE>SortOrder order = SortOrder.fromString(parser.text());<NEW_LINE>sortFields.add(fieldOrScoreSort(<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>SortBuilder<?> sort = parser.namedObject(SortBuilder.class, fieldName, null);<NEW_LINE>sortFields.add(sort);<NEW_LINE>} catch (NamedObjectNotFoundException err) {<NEW_LINE>sortFields.add(FieldSortBuilder.fromXContent(parser, fieldName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fieldName).order(order));
796,838
private void modifySourceElement() throws DataObjectNotFoundException, IOException {<NEW_LINE>final BaseDocument doc = (BaseDocument) getDocument(activeElement.getFile());<NEW_LINE>final AtomicBoolean success = new AtomicBoolean();<NEW_LINE>DataObject dataObject = DataObject.find(activeElement.getFile());<NEW_LINE>boolean modified = dataObject.getLookup().<MASK><NEW_LINE>pos = Integer.MAX_VALUE;<NEW_LINE>diff = -1;<NEW_LINE>doc.runAtomicAsUser(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>if (selectedClazz != null) {<NEW_LINE>updateAttribute(doc, getSelectedElementClass(), selectedClazz.getItemName(), "class");<NEW_LINE>}<NEW_LINE>if (selectedId != null) {<NEW_LINE>updateAttribute(doc, getSelectedElementId(), selectedId.getItemName(), "id");<NEW_LINE>}<NEW_LINE>// better not to do the save from within the atomic modification task<NEW_LINE>success.set(true);<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// possibly save the document if not opened in editor<NEW_LINE>if (success.get()) {<NEW_LINE>if (!modified) {<NEW_LINE>// wasn't modified before applying the changes, save...<NEW_LINE>SaveCookie saveCookie = dataObject.getLookup().lookup(SaveCookie.class);<NEW_LINE>if (saveCookie != null) {<NEW_LINE>// the "changes" may not modify the document<NEW_LINE>saveCookie.save();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
lookup(SaveCookie.class) != null;
342,862
protected void initAppProperties() {<NEW_LINE>AppContext.setProperty(AppConfig.CLIENT_TYPE_PROP, ClientType.DESKTOP.toString());<NEW_LINE>String appPropertiesConfig = System.getProperty(APP_PROPERTIES_CONFIG_SYS_PROP);<NEW_LINE>if (StringUtils.isBlank(appPropertiesConfig))<NEW_LINE>appPropertiesConfig = defaultAppPropertiesConfig;<NEW_LINE>final Properties properties = new Properties();<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(appPropertiesConfig);<NEW_LINE>for (String str : tokenizer.getTokenArray()) {<NEW_LINE>InputStream stream = null;<NEW_LINE>try {<NEW_LINE>stream = getClass().getResourceAsStream(str);<NEW_LINE>if (stream != null) {<NEW_LINE>Reader reader = new InputStreamReader(stream, StandardCharsets.UTF_8.name());<NEW_LINE>properties.load(reader);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(stream);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String arg : args) {<NEW_LINE>arg = arg.trim();<NEW_LINE>int pos = arg.indexOf('=');<NEW_LINE>if (pos > 0) {<NEW_LINE>String key = arg.substring(0, pos);<NEW_LINE>String value = <MASK><NEW_LINE>properties.setProperty(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Object key : properties.keySet()) {<NEW_LINE>AppContext.setProperty((String) key, properties.getProperty((String) key).trim());<NEW_LINE>}<NEW_LINE>List<String> list = new ArrayList<>();<NEW_LINE>for (String key : AppContext.getPropertyNames()) {<NEW_LINE>list.add(key + "=" + AppContext.getProperty(key));<NEW_LINE>}<NEW_LINE>Collections.sort(list);<NEW_LINE>log.info(new TextStringBuilder("AppProperties:\n").appendWithSeparators(list, "\n").toString());<NEW_LINE>}
arg.substring(pos + 1);
647,971
private String skipOrFail(@NonNull final I_C_Order salesOrder, @NonNull final I_C_OrderLine salesOrderLine) {<NEW_LINE>final String onMissingBPartnerProduct = <MASK><NEW_LINE>final boolean log = ON_MISSING_C_B_PARTNER_PRODUCT_LOG.equalsIgnoreCase(onMissingBPartnerProduct);<NEW_LINE>final boolean ignore = ON_MISSING_C_B_PARTNER_PRODUCT_IGNORE.equalsIgnoreCase(onMissingBPartnerProduct);<NEW_LINE>final boolean error = ON_MISSING_C_B_PARTNER_PRODUCT_ERROR.equalsIgnoreCase(onMissingBPartnerProduct);<NEW_LINE>Check.assume(log || error || ignore, "de.metas.order.C_Order_CreatePOFromSOs.OnMissing_C_BPartner_Product has a supported value! Actual value: {}", onMissingBPartnerProduct);<NEW_LINE>String msg = null;<NEW_LINE>if (log || error) {<NEW_LINE>msg = msgBL.getMsg(context.getCtx(), MSG_MISSING_C_B_PARTNER_PRODUCT_ID, new Object[] { salesOrder.getDocumentNo(), salesOrderLine.getLine() });<NEW_LINE>Loggables.withLogger(logger, Level.DEBUG).addLog(msg);<NEW_LINE>}<NEW_LINE>if (log || ignore) {<NEW_LINE>return KEY_SKIP;<NEW_LINE>}<NEW_LINE>// note that msg is != null at this point<NEW_LINE>throw new AdempiereException(msg);<NEW_LINE>}
sysConfigBL.getValue(SYSCONFIG_ON_MISSING_C_B_PARTNER_PRODUCT, ON_MISSING_C_B_PARTNER_PRODUCT_LOG);
1,152,044
public void encodeValue(Block block, int position, SliceOutput output) {<NEW_LINE>Block row = block.getBlock(position);<NEW_LINE>// write values<NEW_LINE>for (int batchStart = 0; batchStart < row.getPositionCount(); batchStart += 8) {<NEW_LINE>int batchEnd = Math.min(batchStart + 8, structFields.size());<NEW_LINE>int nullByte = 0;<NEW_LINE>for (int fieldId = batchStart; fieldId < batchEnd; fieldId++) {<NEW_LINE>if (!row.isNull(fieldId)) {<NEW_LINE>nullByte |= (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.writeByte(nullByte);<NEW_LINE>for (int fieldId = batchStart; fieldId < batchEnd; fieldId++) {<NEW_LINE>if (!row.isNull(fieldId)) {<NEW_LINE>BinaryColumnEncoding field = structFields.get(fieldId);<NEW_LINE>field.encodeValueInto(row, fieldId, output);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
1 << (fieldId % 8));
1,298,466
void assembleMessageParameters() {<NEW_LINE>mAid = SecureUtils.calculateK4(mAppKey.getKey());<NEW_LINE>final ByteBuffer paramsBuffer;<NEW_LINE>LOG.info("State: " + (mState ? "ON" : "OFF"));<NEW_LINE>if (mTransitionSteps == null || mTransitionResolution == null || mDelay == null) {<NEW_LINE>paramsBuffer = ByteBuffer.allocate(GENERIC_ON_OFF_SET_PARAMS_LENGTH).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>paramsBuffer.put((byte) (mState ? 0x01 : 0x00));<NEW_LINE>paramsBuffer<MASK><NEW_LINE>} else {<NEW_LINE>LOG.info("Transition steps: " + mTransitionSteps);<NEW_LINE>LOG.info("Transition step resolution: " + mTransitionResolution);<NEW_LINE>paramsBuffer = ByteBuffer.allocate(GENERIC_ON_OFF_SET_TRANSITION_PARAMS_LENGTH).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>paramsBuffer.put((byte) (mState ? 0x01 : 0x00));<NEW_LINE>paramsBuffer.put((byte) tId);<NEW_LINE>paramsBuffer.put((byte) (mTransitionResolution << 6 | mTransitionSteps));<NEW_LINE>final int delay = mDelay;<NEW_LINE>paramsBuffer.put((byte) delay);<NEW_LINE>}<NEW_LINE>mParameters = paramsBuffer.array();<NEW_LINE>}
.put((byte) tId);
1,191,393
public void onHttpResponseReceive(HttpMessage msg, int initiator, HttpSender sender) {<NEW_LINE>if (initiator != HttpSender.PROXY_INITIATOR && initiator != HttpSender.MANUAL_REQUEST_INITIATOR) {<NEW_LINE>// Not a session we care about<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check if we know the site and add it otherwise<NEW_LINE>String site = msg.getRequestHeader().getHostName() + ":" + msg.getRequestHeader().getHostPort();<NEW_LINE>site = ScanPanel.cleanSiteName(site, true);<NEW_LINE>if (getView() != null) {<NEW_LINE>this.getHttpSessionsPanel().addSiteAsynchronously(site);<NEW_LINE>}<NEW_LINE>// Check if it's enabled for proxy only<NEW_LINE>if (getParam().isEnabledProxyOnly() && initiator != HttpSender.PROXY_INITIATOR) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check for default tokens set in response messages<NEW_LINE>List<HttpCookie> responseCookies = msg.getResponseHeader().getHttpCookies(msg.getRequestHeader().getHostName());<NEW_LINE>for (HttpCookie cookie : responseCookies) {<NEW_LINE>// If it's a default session token and it is not already marked as session token and was<NEW_LINE>// not previously removed by the user<NEW_LINE>if (this.isDefaultSessionToken(cookie.getName()) && !this.isSessionToken(site, cookie.getName()) && !this.isRemovedDefaultSessionToken(site, cookie.getName())) {<NEW_LINE>this.addHttpSessionToken(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Forward the request for proper processing<NEW_LINE>HttpSessionsSite sessionsSite = getHttpSessionsSite(site);<NEW_LINE>sessionsSite.processHttpResponseMessage(msg);<NEW_LINE>}
site, cookie.getName());
1,294,869
public List<Record> signZone(final List<Record> records, final List<DnsSecKeyPair> kskPairs, final List<DnsSecKeyPair> zskPairs, final Date inception, final Date expiration, final ConcurrentMap<RRSIGCacheKey, ConcurrentMap<RRsetKey, RRSIGRecord>> RRSIGCache) throws IOException, GeneralSecurityException {<NEW_LINE>final List<NSECRecord> nsecRecords = createNsecRecords(records);<NEW_LINE>records.addAll(nsecRecords);<NEW_LINE>Collections.sort(records, (record1, record2) -> {<NEW_LINE>if (record1.getType() != Type.SOA && record2.getType() != Type.SOA) {<NEW_LINE>return record1.compareTo(record2);<NEW_LINE>}<NEW_LINE>int x = record1.getName().compareTo(record2.getName());<NEW_LINE>if (x != 0) {<NEW_LINE>return x;<NEW_LINE>}<NEW_LINE>x = record1.getDClass() - record2.getDClass();<NEW_LINE>if (x != 0) {<NEW_LINE>return x;<NEW_LINE>}<NEW_LINE>if (record1.getType() != record2.getType()) {<NEW_LINE>return record1.getType() == Type.SOA ? -1 : 1;<NEW_LINE>}<NEW_LINE>return record1.compareTo(record2);<NEW_LINE>});<NEW_LINE>final List<RRset> rrSets = new RRSetsBuilder().build(records);<NEW_LINE>final List<RRset> signedRrSets = rrSets.stream().map(rRset -> signRRset(rRset, kskPairs, zskPairs, inception, expiration, RRSIGCache)).sorted((rRset1, rRset2) -> rRset1.getName().compareTo(rRset2.getName())).collect(toList());<NEW_LINE>final List<Record> signedZoneRecords = new ArrayList<>();<NEW_LINE>signedRrSets.forEach(rrSet -> {<NEW_LINE>signedZoneRecords.addAll(toRRStream(rrSet).collect(toList()));<NEW_LINE>signedZoneRecords.addAll(toRRSigStream(rrSet)<MASK><NEW_LINE>});<NEW_LINE>return signedZoneRecords;<NEW_LINE>}
.collect(toList()));
1,774,926
public Attachment addAttachment(final String assetId, final AttachmentSummary attSummary) throws IOException, BadVersionException, RequestFailureException {<NEW_LINE>final Attachment attach = attSummary.getAttachment();<NEW_LINE>final String name = attSummary.getName();<NEW_LINE>// Info about the attachment goes into the URL<NEW_LINE>String urlString = "/assets/" + assetId + "/attachments?name=" + name;<NEW_LINE>if (attach.getType() != null) {<NEW_LINE>urlString = urlString + "&type=" + attach<MASK><NEW_LINE>}<NEW_LINE>HttpURLConnection connection = createHttpURLConnectionToMassive(urlString);<NEW_LINE>if (attSummary.getURL() == null) {<NEW_LINE>writeMultiPart(assetId, attSummary, connection);<NEW_LINE>} else {<NEW_LINE>writeSinglePart(assetId, attSummary, connection);<NEW_LINE>}<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>testResponseCode(connection);<NEW_LINE>InputStream is = connection.getInputStream();<NEW_LINE>int len = 0;<NEW_LINE>while ((len = is.read()) != -1) {<NEW_LINE>baos.write((byte) len);<NEW_LINE>}<NEW_LINE>is.close();<NEW_LINE>baos.close();<NEW_LINE>Attachment attachment = JSONAssetConverter.readValue(new ByteArrayInputStream(baos.toByteArray()), Attachment.class);<NEW_LINE>return attachment;<NEW_LINE>}
.getType().toString();
1,113,449
private void handleEndTagElement(JspSyntaxElement.EndTag endTag, Stack<JspSyntaxElement.OpenTag> openTagsStack, List<OffsetRange> tags) {<NEW_LINE>if (openTagsStack.isEmpty()) {<NEW_LINE>// stray end tag<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JspSyntaxElement.OpenTag top = openTagsStack.peek();<NEW_LINE>if (endTag.name().equals(top.name())) {<NEW_LINE>// match<NEW_LINE>tags.add(new OffsetRange(top.from(), endTag.to()));<NEW_LINE>openTagsStack.pop();<NEW_LINE>} else {<NEW_LINE>// I need to save the pop-ed elements for the case that there isn't<NEW_LINE>// any matching start tag found<NEW_LINE>ArrayList<JspSyntaxElement.OpenTag> savedElements = new ArrayList<JspSyntaxElement.OpenTag>();<NEW_LINE>// this semaphore is used behind the loop to detect whether a<NEW_LINE>// matching start has been found<NEW_LINE>boolean foundStartTag = false;<NEW_LINE>while (!openTagsStack.isEmpty()) {<NEW_LINE>JspSyntaxElement.OpenTag start = openTagsStack.pop();<NEW_LINE>savedElements.add(start);<NEW_LINE>if (start.name().equals(endTag.name())) {<NEW_LINE>// found a matching start tag<NEW_LINE>tags.add(new OffsetRange(start.from(), endTag.to()));<NEW_LINE>foundStartTag = true;<NEW_LINE>// break the while loop<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!foundStartTag) {<NEW_LINE>// we didn't find any matching start tag =><NEW_LINE>// return all elements back to the stack<NEW_LINE>for (int i = savedElements.size() - 1; i >= 0; i--) {<NEW_LINE>openTagsStack.push<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(savedElements.get(i));
1,616,457
public void changePfpValidator(ActionRequest request, ActionResponse response) {<NEW_LINE>Integer pfpValidatorUserId = (Integer) request.getContext().get("_userId");<NEW_LINE>LinkedHashMap<String, Object> newPfpValidatorUserMap = (LinkedHashMap<String, Object>) request.<MASK><NEW_LINE>if (newPfpValidatorUserMap == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>UserRepository userRepository = Beans.get(UserRepository.class);<NEW_LINE>User newPfpValidatorUser = userRepository.find(((Integer) newPfpValidatorUserMap.get("id")).longValue());<NEW_LINE>User pfpValidatorUser = userRepository.find(pfpValidatorUserId.longValue());<NEW_LINE>int updateCount = Beans.get(UserServiceAccountImpl.class).changePfpValidator(pfpValidatorUser, newPfpValidatorUser);<NEW_LINE>if (updateCount >= 1) {<NEW_LINE>response.setFlash(I18n.get(IExceptionMessage.USER_PFP_VALIDATOR_UPDATED));<NEW_LINE>response.setCanClose(true);<NEW_LINE>} else if (updateCount == 0) {<NEW_LINE>response.setAlert(String.format(I18n.get(IExceptionMessage.USER_PFP_VALIDATOR_NO_RELATED_ACCOUNTING_SITUATION), pfpValidatorUser.getName()));<NEW_LINE>}<NEW_LINE>}
getContext().get("newPfpValidatorUser");
861,355
private static void assertReceived(RegressionEnvironment env, boolean namedWindow, SupportBean[] beans, int[] indexesAll, int[] indexesWhere, String[] mapKeys, Object[] mapValues) {<NEW_LINE>env.assertListener("select", listener -> {<NEW_LINE>EventBean received = listener.assertOneGetNewAndReset();<NEW_LINE>Object[] expectedAll;<NEW_LINE>Object[] expectedWhere;<NEW_LINE>if (!namedWindow) {<NEW_LINE>expectedAll = SupportBean.getOAStringAndIntPerIndex(beans, indexesAll);<NEW_LINE>expectedWhere = <MASK><NEW_LINE>EPAssertionUtil.assertEqualsAnyOrder(expectedAll, (Object[]) received.get("c0"));<NEW_LINE>Collection receivedColl = (Collection) received.get("c1");<NEW_LINE>EPAssertionUtil.assertEqualsAnyOrder(expectedWhere, receivedColl == null ? null : receivedColl.toArray());<NEW_LINE>} else {<NEW_LINE>expectedAll = SupportBean.getBeansPerIndex(beans, indexesAll);<NEW_LINE>expectedWhere = SupportBean.getBeansPerIndex(beans, indexesWhere);<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expectedAll, (Object[]) received.get("c0"));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expectedWhere, (Collection) received.get("c1"));<NEW_LINE>}<NEW_LINE>EPAssertionUtil.assertPropsMap((Map) received.get("c2"), mapKeys, mapValues);<NEW_LINE>});<NEW_LINE>}
SupportBean.getOAStringAndIntPerIndex(beans, indexesWhere);
868,013
public void onDescriptorRead(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) {<NEW_LINE>final byte[] data = descriptor.getValue();<NEW_LINE>if (status == BluetoothGatt.GATT_SUCCESS) {<NEW_LINE>log(Log.INFO, () -> "Read Response received from descr. " + descriptor.getUuid() + ", value: " + ParserUtils.parse(data));<NEW_LINE>BleManagerHandler.this.onDescriptorRead(gatt, descriptor);<NEW_LINE>if (request instanceof ReadRequest) {<NEW_LINE>final ReadRequest request = (ReadRequest) BleManagerHandler.this.request;<NEW_LINE>request.notifyValueChanged(gatt.getDevice(), data);<NEW_LINE>if (request.hasMore()) {<NEW_LINE>enqueueFirst(request);<NEW_LINE>} else {<NEW_LINE>request.notifySuccess(gatt.getDevice());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (status == BluetoothGatt.GATT_INSUFFICIENT_AUTHENTICATION || status == 8 || /* GATT INSUF AUTHORIZATION */<NEW_LINE>status == 137) /* GATT AUTH FAIL */<NEW_LINE>{<NEW_LINE>log(Log.WARN, () -> "Authentication required (" + status + ")");<NEW_LINE>if (gatt.getDevice().getBondState() != BluetoothDevice.BOND_NONE) {<NEW_LINE>// This should never happen but it used to: http://stackoverflow.com/a/20093695/2115352<NEW_LINE><MASK><NEW_LINE>postCallback(c -> c.onError(gatt.getDevice(), ERROR_AUTH_ERROR_WHILE_BONDED, status));<NEW_LINE>}<NEW_LINE>// The request will be repeated when the bond state changes to BONDED.<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>Log.e(TAG, "onDescriptorRead error " + status);<NEW_LINE>if (request instanceof ReadRequest) {<NEW_LINE>request.notifyFail(gatt.getDevice(), status);<NEW_LINE>}<NEW_LINE>awaitingRequest = null;<NEW_LINE>onError(gatt.getDevice(), ERROR_READ_DESCRIPTOR, status);<NEW_LINE>}<NEW_LINE>checkCondition();<NEW_LINE>nextRequest(true);<NEW_LINE>}
Log.w(TAG, ERROR_AUTH_ERROR_WHILE_BONDED);
488,220
protected FullHttpRequest newHandshakeRequest() {<NEW_LINE>URI wsURL = uri();<NEW_LINE>// Get 16 bit nonce and base 64 encode it<NEW_LINE>byte[] nonce = WebSocketUtil.randomBytes(16);<NEW_LINE>String key = WebSocketUtil.base64(nonce);<NEW_LINE>String acceptSeed = key + MAGIC_GUID;<NEW_LINE>byte[] sha1 = WebSocketUtil.sha1(acceptSeed<MASK><NEW_LINE>expectedChallengeResponseString = WebSocketUtil.base64(sha1);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("WebSocket version 07 client handshake key: {}, expected response: {}", key, expectedChallengeResponseString);<NEW_LINE>}<NEW_LINE>// Format request<NEW_LINE>FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, upgradeUrl(wsURL), Unpooled.EMPTY_BUFFER);<NEW_LINE>HttpHeaders headers = request.headers();<NEW_LINE>if (customHeaders != null) {<NEW_LINE>headers.add(customHeaders);<NEW_LINE>if (!headers.contains(HttpHeaderNames.HOST)) {<NEW_LINE>// Only add HOST header if customHeaders did not contain it.<NEW_LINE>//<NEW_LINE>// See https://github.com/netty/netty/issues/10101<NEW_LINE>headers.set(HttpHeaderNames.HOST, websocketHostValue(wsURL));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>headers.set(HttpHeaderNames.HOST, websocketHostValue(wsURL));<NEW_LINE>}<NEW_LINE>headers.set(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET).set(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE).set(HttpHeaderNames.SEC_WEBSOCKET_KEY, key);<NEW_LINE>if (!headers.contains(HttpHeaderNames.SEC_WEBSOCKET_ORIGIN)) {<NEW_LINE>headers.set(HttpHeaderNames.SEC_WEBSOCKET_ORIGIN, websocketOriginValue(wsURL));<NEW_LINE>}<NEW_LINE>String expectedSubprotocol = expectedSubprotocol();<NEW_LINE>if (expectedSubprotocol != null && !expectedSubprotocol.isEmpty()) {<NEW_LINE>headers.set(HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL, expectedSubprotocol);<NEW_LINE>}<NEW_LINE>headers.set(HttpHeaderNames.SEC_WEBSOCKET_VERSION, version().toAsciiString());<NEW_LINE>return request;<NEW_LINE>}
.getBytes(CharsetUtil.US_ASCII));
785,723
public void createProjectFromTemplate(ActionRequest request, ActionResponse response) {<NEW_LINE>ProjectTemplate projectTemplate = request.getContext().asType(ProjectTemplate.class);<NEW_LINE>AppProject appProject = Beans.get(AppProjectService.class).getAppProject();<NEW_LINE>if (appProject.getGenerateProjectSequence() && !projectTemplate.getIsBusinessProject()) {<NEW_LINE>Project project;<NEW_LINE>try {<NEW_LINE>project = Beans.get(ProjectService.class).createProjectFromTemplate(projectTemplate, null, null);<NEW_LINE>response.setView(ActionView.define(I18n.get("Project")).model(Project.class.getName()).add("form", "project-form").add("grid", "project-grid").param("search-filters", "project-filters").context("_showRecord", project.getId()).map());<NEW_LINE>} catch (AxelorException e) {<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>response.setView(ActionView.define(I18n.get("Create project from this template")).model(Wizard.class.getName()).add("form", "project-template-wizard-form").param("popup", "reload").param("show-toolbar", "false").param("show-confirm", "false").param("width", "large").param("popup-save", "false").context("_projectTemplate", projectTemplate).context("_businessProject", projectTemplate.getIsBusinessProject<MASK><NEW_LINE>}<NEW_LINE>}
()).map());
1,248,411
public Quaternion lookAt(@NonNull Vector3 lookAt, @NonNull Vector3 upDirection) {<NEW_LINE>mTmpVec1.setAll(lookAt);<NEW_LINE>mTmpVec2.setAll(upDirection);<NEW_LINE>// Vectors are parallel/anti-parallel if their dot product magnitude and length product are equal<NEW_LINE>final double dotProduct = Vector3.dot(lookAt, upDirection);<NEW_LINE>final double dotError = Math.abs(Math.abs(dotProduct) - (lookAt.length() * upDirection.length()));<NEW_LINE>if (dotError <= PARALLEL_TOLERANCE) {<NEW_LINE>// The look and up vectors are parallel<NEW_LINE>mTmpVec2.normalize();<NEW_LINE>if (dotProduct < 0) {<NEW_LINE>mTmpVec1.inverse();<NEW_LINE>}<NEW_LINE>fromRotationBetween(WorldParameters.FORWARD_AXIS, mTmpVec1);<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>// Find the forward and up vectors<NEW_LINE><MASK><NEW_LINE>// Create the right vector<NEW_LINE>mTmpVec3.crossAndSet(mTmpVec2, mTmpVec1);<NEW_LINE>fromAxes(mTmpVec3, mTmpVec2, mTmpVec1);<NEW_LINE>return this;<NEW_LINE>}
Vector3.orthoNormalize(mTmpVec1, mTmpVec2);
1,022,066
private List<HandlerParameter> parseHandleMethodParameter() {<NEW_LINE>List<HandlerParameter> params = new LinkedList<>();<NEW_LINE>Parameter[] parameters = handleMethod.getParameters();<NEW_LINE>for (int i = 0; i < parameters.length; i++) {<NEW_LINE>Parameter parameter = parameters[i];<NEW_LINE>Param annotation = <MASK><NEW_LINE>HandlerParameter handlerParameter;<NEW_LINE>RequestBody requestBody;<NEW_LINE>if (null != annotation) {<NEW_LINE>handlerParameter = new HandlerParameter(i, parameter.getType(), annotation.source(), annotation.name(), annotation.required());<NEW_LINE>} else if (null != (requestBody = parameter.getAnnotation(RequestBody.class))) {<NEW_LINE>handlerParameter = new HandlerParameter(i, parameter.getType(), ParamSource.BODY, parameter.getName(), requestBody.required());<NEW_LINE>} else {<NEW_LINE>handlerParameter = new HandlerParameter(i, parameter.getType(), ParamSource.UNKNOWN, parameter.getName(), false);<NEW_LINE>}<NEW_LINE>params.add(handlerParameter);<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(params);<NEW_LINE>}
parameter.getAnnotation(Param.class);
1,644,274
private void migrateOldKeys() {<NEW_LINE>// We only migrate old keys if we don't have any accounts yet - otherwise, migration has already taken place<NEW_LINE>if (!_walletManager.getAccountIds().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the local trader address, may be null<NEW_LINE>BitcoinAddress localTraderAddress = _localTraderManager.getLocalTraderAddress();<NEW_LINE>if (localTraderAddress == null) {<NEW_LINE>_localTraderManager.unsetLocalTraderAccount();<NEW_LINE>}<NEW_LINE>// check which address was the last recently selected one<NEW_LINE>SharedPreferences prefs = _applicationContext.getSharedPreferences("selected", Context.MODE_PRIVATE);<NEW_LINE>String lastAddress = prefs.getString("last", null);<NEW_LINE>// Migrate all existing records to accounts<NEW_LINE>List<Record> records = loadClassicRecords();<NEW_LINE>for (Record record : records) {<NEW_LINE>// Create an account from this record<NEW_LINE>UUID account;<NEW_LINE>if (record.hasPrivateKey()) {<NEW_LINE>account = _walletManager.createAccounts(new PrivateSingleConfig(record.key, AesKeyCipher.defaultKeyCipher(<MASK><NEW_LINE>} else {<NEW_LINE>account = _walletManager.createAccounts(new PublicSingleConfig(record.key.getPublicKey())).get(0);<NEW_LINE>}<NEW_LINE>// check whether this was the selected record<NEW_LINE>if (record.address.toString().equals(lastAddress)) {<NEW_LINE>setSelectedAccount(account);<NEW_LINE>}<NEW_LINE>// check whether the record was archived<NEW_LINE>if (record.tag.equals(Record.Tag.ARCHIVE)) {<NEW_LINE>_walletManager.getAccount(account).archiveAccount();<NEW_LINE>}<NEW_LINE>// See if we need to migrate this account to local trader<NEW_LINE>if (BitcoinAddress.fromString(record.address.toString()).equals(localTraderAddress)) {<NEW_LINE>if (record.hasPrivateKey()) {<NEW_LINE>_localTraderManager.setLocalTraderData(account, record.key, BitcoinAddress.fromString(record.address.toString()), _localTraderManager.getNickname());<NEW_LINE>} else {<NEW_LINE>_localTraderManager.unsetLocalTraderAccount();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
))).get(0);
1,498,367
private void initMaps() {<NEW_LINE>for (BugPattern pattern : allowedPatterns) {<NEW_LINE>BugCode bugCode = DetectorFactoryCollection.instance().getBugCode(pattern.getAbbrev());<NEW_LINE>getPatterns(bugCode).add(pattern);<NEW_LINE>}<NEW_LINE>// Filter out patterns if their types in the list<NEW_LINE>// If at least one child is there, discard it from checked elements<NEW_LINE>// list,<NEW_LINE>// as it is already disabled by disabling parent<NEW_LINE>Iterator<BugPattern> patterns = preSelectedPatterns.iterator();<NEW_LINE>while (patterns.hasNext()) {<NEW_LINE>BugPattern pattern = patterns.next();<NEW_LINE>BugCode bugCode = DetectorFactoryCollection.instance().<MASK><NEW_LINE>if (preSelectedTypes.contains(bugCode)) {<NEW_LINE>patterns.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// merge types and the rest of patterns (without parent type)<NEW_LINE>List<Object> merged = new ArrayList<Object>();<NEW_LINE>merged.addAll(preSelectedTypes);<NEW_LINE>merged.addAll(preSelectedPatterns);<NEW_LINE>// for each type, ALL children should be preselected.<NEW_LINE>for (BugCode bugCode : preSelectedTypes) {<NEW_LINE>preSelectedPatterns.addAll(getPatterns(bugCode));<NEW_LINE>}<NEW_LINE>checkedElements = merged.toArray();<NEW_LINE>sortCheckedElements();<NEW_LINE>initDetectorMaps();<NEW_LINE>}
getBugCode(pattern.getAbbrev());
1,811,310
private static Timer makeTimer(AbstractInstant instant, String closure, JobDataMap dataMap) {<NEW_LINE>Logger logger = <MASK><NEW_LINE>JobKey jobKey = new JobKey(instant.toString() + ": " + closure.toString());<NEW_LINE>Trigger trigger = newTrigger().startAt(instant.toDate()).build();<NEW_LINE>Timer timer = new TimerImpl(jobKey, trigger.getKey(), dataMap, instant);<NEW_LINE>try {<NEW_LINE>JobDetail job = newJob(TimerExecutionJob.class).withIdentity(jobKey).usingJobData(dataMap).build();<NEW_LINE>if (TimerImpl.scheduler.checkExists(job.getKey())) {<NEW_LINE>TimerImpl.scheduler.deleteJob(job.getKey());<NEW_LINE>logger.debug("Deleted existing Job {}", job.getKey().toString());<NEW_LINE>}<NEW_LINE>TimerImpl.scheduler.scheduleJob(job, trigger);<NEW_LINE>logger.debug("Scheduled code for execution at {}", instant.toString());<NEW_LINE>return timer;<NEW_LINE>} catch (SchedulerException e) {<NEW_LINE>logger.error("Failed to schedule code for execution.", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
LoggerFactory.getLogger(ScriptExecution.class);
1,116,667
private void refreshSettings() {<NEW_LINE>int size = cache.getJadxSettings().getSrhResourceSkipSize() * 1048576;<NEW_LINE>if (size != sizeLimit || !cache.getJadxSettings().getSrhResourceFileExt().equals(fileExts)) {<NEW_LINE>clear();<NEW_LINE>sizeLimit = size;<NEW_LINE>fileExts = cache<MASK><NEW_LINE>String[] exts = fileExts.split("\\|");<NEW_LINE>for (String ext : exts) {<NEW_LINE>ext = ext.trim();<NEW_LINE>if (!ext.isEmpty()) {<NEW_LINE>anyExt = ext.equals("*");<NEW_LINE>if (anyExt) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>extSet.add(ext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (ZipFile zipFile = getZipFile(cache.getJRoot())) {<NEW_LINE>// reindex<NEW_LINE>traverseTree(cache.getJRoot(), zipFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to apply settings to resource index", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getJadxSettings().getSrhResourceFileExt();
64,879
public ProjectInvitationResponse newProjectInvitationResponse(ProjectInvitationJoinVO invite) {<NEW_LINE>ProjectInvitationResponse response = new ProjectInvitationResponse();<NEW_LINE>response.setId(invite.getUuid());<NEW_LINE>response.setProjectId(invite.getProjectUuid());<NEW_LINE>response.setProjectName(invite.getProjectName());<NEW_LINE>if (invite.getState() != null) {<NEW_LINE>response.setInvitationState(invite.getState().toString());<NEW_LINE>}<NEW_LINE>if (invite.getAccountName() != null) {<NEW_LINE>response.<MASK><NEW_LINE>}<NEW_LINE>if (invite.getUserId() != null) {<NEW_LINE>response.setUserId(invite.getUserId());<NEW_LINE>}<NEW_LINE>if (invite.getEmail() != null) {<NEW_LINE>response.setEmail(invite.getEmail());<NEW_LINE>}<NEW_LINE>response.setDomainId(invite.getDomainUuid());<NEW_LINE>response.setDomainName(invite.getDomainName());<NEW_LINE>response.setObjectName("projectinvitation");<NEW_LINE>return response;<NEW_LINE>}
setAccountName(invite.getAccountName());
172,954
public void refresh(NodeStatus status) {<NEW_LINE>Require.nonNull("Node status", status);<NEW_LINE>Lock writeLock = lock.writeLock();<NEW_LINE>writeLock.lock();<NEW_LINE>try {<NEW_LINE>Iterator<NodeStatus> iterator = nodes.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>NodeStatus node = iterator.next();<NEW_LINE>if (node.getNodeId().equals(status.getNodeId())) {<NEW_LINE>iterator.remove();<NEW_LINE>// if the node was marked as "down", keep it down until a healthcheck passes:<NEW_LINE>// just because the node can hit the event bus doesn't mean it's reachable<NEW_LINE>if (node.getAvailability() == DOWN) {<NEW_LINE>nodes.add(rewrite(status, DOWN));<NEW_LINE>} else {<NEW_LINE>// Otherwise, trust what it tells us.<NEW_LINE>nodes.add(status);<NEW_LINE>}<NEW_LINE>nodePurgeTimes.put(status.getNodeId(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}
), Instant.now());
89,810
private IFolder addResourceModifications(IPackageFragment rootPackage, RenameArguments args, IPackageFragment pack, boolean renameSubPackages) throws CoreException {<NEW_LINE>IContainer container = (IContainer) pack.getResource();<NEW_LINE>if (container == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IFolder target = computeTargetFolder(rootPackage, args, pack);<NEW_LINE>createIncludingParents(target);<NEW_LINE>MoveArguments arguments = new MoveArguments(<MASK><NEW_LINE>IResource[] resourcesToMove = collectResourcesOfInterest(pack);<NEW_LINE>Set<IResource> allMembers = new HashSet<>(Arrays.asList(container.members()));<NEW_LINE>for (int i = 0; i < resourcesToMove.length; i++) {<NEW_LINE>IResource toMove = resourcesToMove[i];<NEW_LINE>getResourceModifications().addMove(toMove, arguments);<NEW_LINE>allMembers.remove(toMove);<NEW_LINE>}<NEW_LINE>for (Iterator<IResource> iter = allMembers.iterator(); iter.hasNext(); ) {<NEW_LINE>IResource element = iter.next();<NEW_LINE>if (element instanceof IFile) {<NEW_LINE>getResourceModifications().addDelete(element);<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!renameSubPackages && allMembers.isEmpty()) {<NEW_LINE>getResourceModifications().addDelete(container);<NEW_LINE>}<NEW_LINE>return target;<NEW_LINE>}
target, args.getUpdateReferences());
1,592,577
private void renderRing(GL2 gl, RingComponent r) {<NEW_LINE>gl.glRotated(90, 0, 1.0, 0);<NEW_LINE>glu.gluCylinder(q, r.getOuterRadius(), r.getOuterRadius(), r.getLength(), LOD, 1);<NEW_LINE>gl.glRotated(180, 0, 1.0, 0);<NEW_LINE>glu.gluDisk(q, r.getInnerRadius(), r.getOuterRadius(), LOD, 2);<NEW_LINE>gl.glRotated(180, 0, 1.0, 0);<NEW_LINE>gl.glTranslated(0, <MASK><NEW_LINE>glu.gluDisk(q, r.getInnerRadius(), r.getOuterRadius(), LOD, 2);<NEW_LINE>glu.gluQuadricOrientation(q, GLU.GLU_INSIDE);<NEW_LINE>glu.gluCylinder(q, r.getInnerRadius(), r.getInnerRadius(), -r.getLength(), LOD, 1);<NEW_LINE>glu.gluQuadricOrientation(q, GLU.GLU_OUTSIDE);<NEW_LINE>}
0, r.getLength());
808,642
public CodeValidationResult codeSystemValidateCode(IIdType theCodeSystemId, String theCodeSystemUrl, String theVersion, String theCode, String theDisplay, IBaseDatatype theCoding, IBaseDatatype theCodeableConcept) {<NEW_LINE>CodeableConcept codeableConcept = toCanonicalCodeableConcept(theCodeableConcept);<NEW_LINE>boolean haveCodeableConcept = codeableConcept != null && codeableConcept.getCoding().size() > 0;<NEW_LINE>Coding coding = toCanonicalCoding(theCoding);<NEW_LINE>boolean haveCoding = coding != null && coding.isEmpty() == false;<NEW_LINE>boolean haveCode = theCode != null && theCode.isEmpty() == false;<NEW_LINE>if (!haveCodeableConcept && !haveCoding && !haveCode) {<NEW_LINE>throw new InvalidRequestException(Msg.code(906) + "No code, coding, or codeableConcept provided to validate.");<NEW_LINE>}<NEW_LINE>if (!LogicUtil.multiXor(haveCodeableConcept, haveCoding, haveCode)) {<NEW_LINE>throw new InvalidRequestException(Msg.code(907) + "$validate-code can only validate (code) OR (coding) OR (codeableConcept)");<NEW_LINE>}<NEW_LINE>boolean haveIdentifierParam = isNotBlank(theCodeSystemUrl);<NEW_LINE>String codeSystemUrl;<NEW_LINE>if (theCodeSystemId != null) {<NEW_LINE>IBaseResource codeSystem = myDaoRegistry.getResourceDao("CodeSystem").read(theCodeSystemId);<NEW_LINE>codeSystemUrl = CommonCodeSystemsTerminologyService.getCodeSystemUrl(codeSystem);<NEW_LINE>} else if (haveIdentifierParam) {<NEW_LINE>codeSystemUrl = theCodeSystemUrl;<NEW_LINE>} else {<NEW_LINE>throw new InvalidRequestException(Msg<MASK><NEW_LINE>}<NEW_LINE>String code = theCode;<NEW_LINE>String display = theDisplay;<NEW_LINE>if (haveCodeableConcept) {<NEW_LINE>for (int i = 0; i < codeableConcept.getCoding().size(); i++) {<NEW_LINE>Coding nextCoding = codeableConcept.getCoding().get(i);<NEW_LINE>if (nextCoding.hasSystem()) {<NEW_LINE>if (!codeSystemUrl.equalsIgnoreCase(nextCoding.getSystem())) {<NEW_LINE>throw new InvalidRequestException(Msg.code(909) + "Coding.system '" + nextCoding.getSystem() + "' does not equal with CodeSystem.url '" + theCodeSystemUrl + "'. Unable to validate.");<NEW_LINE>}<NEW_LINE>codeSystemUrl = nextCoding.getSystem();<NEW_LINE>}<NEW_LINE>code = nextCoding.getCode();<NEW_LINE>display = nextCoding.getDisplay();<NEW_LINE>CodeValidationResult nextValidation = codeSystemValidateCode(codeSystemUrl, theVersion, code, display);<NEW_LINE>if (nextValidation.isOk() || i == codeableConcept.getCoding().size() - 1) {<NEW_LINE>return nextValidation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (haveCoding) {<NEW_LINE>if (coding.hasSystem()) {<NEW_LINE>if (!codeSystemUrl.equalsIgnoreCase(coding.getSystem())) {<NEW_LINE>throw new InvalidRequestException(Msg.code(910) + "Coding.system '" + coding.getSystem() + "' does not equal with CodeSystem.url '" + theCodeSystemUrl + "'. Unable to validate.");<NEW_LINE>}<NEW_LINE>codeSystemUrl = coding.getSystem();<NEW_LINE>}<NEW_LINE>code = coding.getCode();<NEW_LINE>display = coding.getDisplay();<NEW_LINE>}<NEW_LINE>return codeSystemValidateCode(codeSystemUrl, theVersion, code, display);<NEW_LINE>}
.code(908) + "Either CodeSystem ID or CodeSystem identifier must be provided. Unable to validate.");
419,245
private // isInterrupted() returns false after interruption in p.waitFor<NEW_LINE>void internalRotateNow() {<NEW_LINE>// figure out new file name, then<NEW_LINE>String oldFileName = fileName;<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>fileName = LogFormatter.insertDate(filePattern, now);<NEW_LINE>internalClose();<NEW_LINE>try {<NEW_LINE>checkAndCreateDir(fileName);<NEW_LINE>fileOutput = new PageCacheFriendlyFileOutputStream(nativeIO, Paths.get(fileName), bufferSize);<NEW_LINE>LogFileDb.nowLoggingTo(fileName);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(<MASK><NEW_LINE>}<NEW_LINE>// To compress previous file, if so configured<NEW_LINE>if (oldFileName == null)<NEW_LINE>oldFileName = getOldFileNameFromSymlink();<NEW_LINE>createSymlinkToCurrentFile();<NEW_LINE>// figure it out later (lazy evaluation)<NEW_LINE>nextRotationTime = 0;<NEW_LINE>if ((oldFileName != null)) {<NEW_LINE>Path oldFile = Paths.get(oldFileName);<NEW_LINE>if (Files.exists(oldFile)) {<NEW_LINE>executor.execute(() -> runCompression(nativeIO, oldFile, compression));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Couldn't open log file '" + fileName + "'", e);
617,889
protected void adjacentBorder(GrayS32 pixelToRegion) {<NEW_LINE>for (int y = 0; y < pixelToRegion.height - 1; y++) {<NEW_LINE>int x = pixelToRegion.width - 1;<NEW_LINE>int indexImg = pixelToRegion.startIndex + pixelToRegion.stride * y + x;<NEW_LINE>checkAdjacentAround(x, y, indexImg, pixelToRegion);<NEW_LINE>if (connect.length == 8) {<NEW_LINE>x = 0;<NEW_LINE>indexImg = pixelToRegion.startIndex + pixelToRegion.stride * y + x;<NEW_LINE>checkAdjacentAround(x, y, indexImg, pixelToRegion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int x = 0; x < pixelToRegion.width; x++) {<NEW_LINE>int y = pixelToRegion.height - 1;<NEW_LINE>int indexImg = pixelToRegion.startIndex <MASK><NEW_LINE>checkAdjacentAround(x, y, indexImg, pixelToRegion);<NEW_LINE>}<NEW_LINE>}
+ pixelToRegion.stride * y + x;
496,488
public static String jndiNameToCamelCase(String jndiName, boolean lowerCaseFirstChar, String prefixToStrip) {<NEW_LINE>String strippedJndiName = jndiName;<NEW_LINE>if (prefixToStrip != null && jndiName.startsWith(prefixToStrip)) {<NEW_LINE>strippedJndiName = jndiName.substring(jndiName.indexOf(prefixToStrip<MASK><NEW_LINE>}<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>for (String token : strippedJndiName.split("/")) {<NEW_LINE>if (token.length() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>char firstChar = token.charAt(0);<NEW_LINE>if (lowerCaseFirstChar && result.length() == 0 && !isAllUpperCase(token)) {<NEW_LINE>firstChar = Character.toLowerCase(firstChar);<NEW_LINE>} else {<NEW_LINE>firstChar = Character.toUpperCase(firstChar);<NEW_LINE>}<NEW_LINE>result.append(firstChar);<NEW_LINE>result.append(token.substring(1));<NEW_LINE>}<NEW_LINE>return result.toString();<NEW_LINE>}
) + prefixToStrip.length());
1,295,003
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {<NEW_LINE>LOG.debug("Processing class '{}'", name);<NEW_LINE>JavaClassDescriptor descriptor = JavaClassDescriptorImporter.createFromAsmObjectTypeName(name);<NEW_LINE>if (alreadyImported(descriptor)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> interfaceNames = createInterfaceNames(interfaces);<NEW_LINE>LOG.trace("Found interfaces {} on class '{}'", interfaceNames, name);<NEW_LINE>boolean opCodeForInterfaceIsPresent = (access & Opcodes.ACC_INTERFACE) != 0;<NEW_LINE>boolean opCodeForEnumIsPresent = (access & Opcodes.ACC_ENUM) != 0;<NEW_LINE>boolean opCodeForAnnotationIsPresent = (<MASK><NEW_LINE>Optional<String> superclassName = getSuperclassName(superName, opCodeForInterfaceIsPresent);<NEW_LINE>LOG.trace("Found superclass {} on class '{}'", superclassName.orElse(null), name);<NEW_LINE>javaClassBuilder = new DomainBuilders.JavaClassBuilder().withSourceDescriptor(sourceDescriptor).withDescriptor(descriptor).withInterface(opCodeForInterfaceIsPresent).withEnum(opCodeForEnumIsPresent).withAnnotation(opCodeForAnnotationIsPresent).withModifiers(JavaModifier.getModifiersForClass(access));<NEW_LINE>className = descriptor.getFullyQualifiedClassName();<NEW_LINE>declarationHandler.onNewClass(className, superclassName, interfaceNames);<NEW_LINE>JavaClassSignatureImporter.parseAsmTypeSignature(signature, declarationHandler);<NEW_LINE>}
access & Opcodes.ACC_ANNOTATION) != 0;
1,162,199
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>Preconditions.checkNotNull(environment, "Error: Argument environment can't be null");<NEW_LINE>Preconditions.checkNotNull(instruction, "Error: Argument instruction can't be null");<NEW_LINE>Preconditions.checkNotNull(instructions, "Error: Argument instructions can't be null");<NEW_LINE>Preconditions.checkArgument(instruction.getOperands().size() == 1, "Error: Argument instruction is not a conditional jump instruction (invalid number of operands)");<NEW_LINE>final long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>long offset = baseOffset;<NEW_LINE>// JCC instructions have exactly one operand.<NEW_LINE>final IOperandTree operand = instruction.<MASK><NEW_LINE>// Load the operand.<NEW_LINE>final TranslationResult result = Helpers.translateOperand(environment, offset, operand, true);<NEW_LINE>instructions.addAll(result.getInstructions());<NEW_LINE>final String jumpTarget = result.getRegister();<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>offset = baseOffset + instructions.size();<NEW_LINE>final Pair<OperandSize, String> condition = conditionGenerator.generate(environment, offset, instructions);<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>offset = baseOffset + instructions.size();<NEW_LINE>instructions.add(ReilHelpers.createJcc(offset, condition.first(), condition.second(), environment.getArchitectureSize(), jumpTarget));<NEW_LINE>}
getOperands().get(0);
181,082
protected Representation post(Representation entity, Variant variant) throws ResourceException {<NEW_LINE>if (appCtx == null) {<NEW_LINE>throw new ResourceException(404);<NEW_LINE>}<NEW_LINE>// copy op?<NEW_LINE>Form form = new Form(entity);<NEW_LINE>beanPath = form.getFirstValue("beanPath");<NEW_LINE>String newVal = form.getFirstValue("newVal");<NEW_LINE>if (newVal != null) {<NEW_LINE>int i = beanPath.indexOf(".");<NEW_LINE>String beanName = i < 0 ? beanPath : beanPath.substring(0, i);<NEW_LINE>Object namedBean = appCtx.getBean(beanName);<NEW_LINE>BeanWrapperImpl bwrap = new BeanWrapperImpl(namedBean);<NEW_LINE>String propPath = beanPath.substring(i + 1);<NEW_LINE>Object coercedVal = bwrap.convertIfNecessary(newVal, bwrap.getPropertyValue<MASK><NEW_LINE>bwrap.setPropertyValue(propPath, coercedVal);<NEW_LINE>}<NEW_LINE>Reference ref = getRequest().getResourceRef();<NEW_LINE>ref.setPath(getBeansRefPath());<NEW_LINE>ref.addSegment(beanPath);<NEW_LINE>getResponse().redirectSeeOther(ref);<NEW_LINE>return new EmptyRepresentation();<NEW_LINE>}
(propPath).getClass());
1,032,639
final DescribeGameSessionsResult executeDescribeGameSessions(DescribeGameSessionsRequest describeGameSessionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeGameSessionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeGameSessionsRequest> request = null;<NEW_LINE>Response<DescribeGameSessionsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeGameSessionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeGameSessionsRequest));<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, "DescribeGameSessions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeGameSessionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeGameSessionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,022,671
protected final void compileInternal() {<NEW_LINE>if (isSqlReadyForUse()) {<NEW_LINE>this.callString = resolveSql();<NEW_LINE>} else {<NEW_LINE>StringBuilder callString = new StringBuilder(32);<NEW_LINE>List<MASK><NEW_LINE>int parameterCount = 0;<NEW_LINE>if (isFunction()) {<NEW_LINE>callString.append("{? = call ").append(resolveSql()).append('(');<NEW_LINE>parameterCount = -1;<NEW_LINE>} else {<NEW_LINE>callString.append("{call ").append(resolveSql()).append('(');<NEW_LINE>}<NEW_LINE>for (SqlParameter parameter : parameters) {<NEW_LINE>if (!parameter.isResultsParameter()) {<NEW_LINE>if (parameterCount > 0) {<NEW_LINE>callString.append(", ");<NEW_LINE>}<NEW_LINE>if (parameterCount >= 0) {<NEW_LINE>callString.append('?');<NEW_LINE>}<NEW_LINE>parameterCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>callString.append(")}");<NEW_LINE>this.callString = callString.toString();<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Compiled stored procedure. Call string is [" + this.callString + "]");<NEW_LINE>}<NEW_LINE>this.callableStatementFactory = new CallableStatementCreatorFactory(this.callString, getDeclaredParameters());<NEW_LINE>this.callableStatementFactory.setResultSetType(getResultSetType());<NEW_LINE>this.callableStatementFactory.setUpdatableResults(isUpdatableResults());<NEW_LINE>onCompileInternal();<NEW_LINE>}
<SqlParameter> parameters = getDeclaredParameters();
576,577
private Object convertType(Object value) {<NEW_LINE>if (nullValues.contains(value) || value == null)<NEW_LINE>return null;<NEW_LINE>switch(// Destination Type<NEW_LINE>type) {<NEW_LINE>case STRING:<NEW_LINE>if (value instanceof TemporalAccessor && !dateFormat.isEmpty()) {<NEW_LINE>return dateFormat((TemporalAccessor) value, dateFormat);<NEW_LINE>} else {<NEW_LINE>return value.toString();<NEW_LINE>}<NEW_LINE>case INTEGER:<NEW_LINE>return Util.toLong(value);<NEW_LINE>case FLOAT:<NEW_LINE>return Util.toDouble(value);<NEW_LINE>case BOOLEAN:<NEW_LINE>return Util.toBoolean(value);<NEW_LINE>case NULL:<NEW_LINE>return null;<NEW_LINE>case LIST:<NEW_LINE>return Arrays.stream(arrayPattern.split(value.toString())).map(this::convertType).collect(Collectors.toList());<NEW_LINE>case DATE:<NEW_LINE>return dateParse(value.toString(), LocalDate.class, dateParse);<NEW_LINE>case DATE_TIME:<NEW_LINE>return dateParse(value.toString(), ZonedDateTime.class, dateParse);<NEW_LINE>case LOCAL_DATE_TIME:<NEW_LINE>return dateParse(value.toString(), LocalDateTime.class, dateParse);<NEW_LINE>case LOCAL_TIME:<NEW_LINE>return dateParse(value.toString(<MASK><NEW_LINE>case TIME:<NEW_LINE>return dateParse(value.toString(), OffsetTime.class, dateParse);<NEW_LINE>case DURATION:<NEW_LINE>return durationParse(value.toString());<NEW_LINE>default:<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>}
), LocalTime.class, dateParse);
1,591,299
private Type dotNavigate(int offset, Type type) {<NEW_LINE>if (typeUtil.isMap(type)) {<NEW_LINE>int keyStart = offset + 1;<NEW_LINE>Type domainType = TypeUtil.getDomainType(type);<NEW_LINE>int keyEnd = -1;<NEW_LINE>if (typeUtil.isDotable(domainType)) {<NEW_LINE>// '.' should be interpreted as navigation.<NEW_LINE>keyEnd = nextNavOp(".[", offset + 1);<NEW_LINE>} else {<NEW_LINE>// '.' should *not* be interpreted as navigation.<NEW_LINE>keyEnd = nextNavOp("[", offset + 1);<NEW_LINE>}<NEW_LINE>String key = textBetween(keyStart, keyEnd);<NEW_LINE>Type keyType = typeUtil.getKeyType(type);<NEW_LINE>if (keyType != null) {<NEW_LINE>ValueParser keyParser = typeUtil.getValueParser(keyType);<NEW_LINE>if (keyParser != null) {<NEW_LINE>try {<NEW_LINE>keyParser.parse(key);<NEW_LINE>} catch (Exception e) {<NEW_LINE>problemCollector.accept(problem(ApplicationPropertiesProblemType.PROP_VALUE_TYPE_MISMATCH, "Expecting " + typeUtil.niceTypeName(keyType), keyStart, keyEnd - keyStart));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return navigate(keyEnd, domainType);<NEW_LINE>} else {<NEW_LINE>// dot navigation into object properties<NEW_LINE>int keyStart = offset + 1;<NEW_LINE>int keyEnd = nextNavOp(".[", offset + 1);<NEW_LINE>if (keyEnd < 0) {<NEW_LINE>keyEnd = region.getEnd();<NEW_LINE>}<NEW_LINE>String key = StringUtil.camelCaseToHyphens(textBetween(keyStart, keyEnd));<NEW_LINE>List<TypedProperty> properties = typeUtil.getProperties(type, EnumCaseMode.ALIASED, BeanPropertyNameMode.ALIASED);<NEW_LINE>if (properties != null) {<NEW_LINE>TypedProperty prop = null;<NEW_LINE>for (TypedProperty p : properties) {<NEW_LINE>if (p.getName().equals(key)) {<NEW_LINE>prop = p;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (prop == null) {<NEW_LINE>problemCollector.accept(problem(ApplicationPropertiesProblemType.PROP_INVALID_BEAN_PROPERTY, "Type '" + typeUtil.niceTypeName(type) + "' has no property '" + key + "'"<MASK><NEW_LINE>} else {<NEW_LINE>if (prop.isDeprecated()) {<NEW_LINE>problemCollector.accept(problemDeprecated(type, prop, keyStart, keyEnd - keyStart));<NEW_LINE>}<NEW_LINE>return navigate(keyEnd, prop.getType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
, keyStart, keyEnd - keyStart));
122,631
final DescribeIpRestrictionResult executeDescribeIpRestriction(DescribeIpRestrictionRequest describeIpRestrictionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeIpRestrictionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeIpRestrictionRequest> request = null;<NEW_LINE>Response<DescribeIpRestrictionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeIpRestrictionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeIpRestrictionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeIpRestriction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeIpRestrictionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeIpRestrictionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,698,295
/*<NEW_LINE>* Generate the set of Android permissions needed by this project.<NEW_LINE>*/<NEW_LINE>@VisibleForTesting<NEW_LINE>void generatePermissions() {<NEW_LINE>try {<NEW_LINE>loadJsonInfo(permissionsNeeded, ComponentDescriptorConstants.PERMISSIONS_TARGET);<NEW_LINE>if (project != null) {<NEW_LINE>// Only do this if we have a project (testing doesn't provide one :-( ).<NEW_LINE>LOG.log(Level.INFO, "usesLocation = " + project.getUsesLocation());<NEW_LINE>if (project.getUsesLocation().equals("True")) {<NEW_LINE>// Add location permissions if any WebViewer requests it<NEW_LINE>// via a Property.<NEW_LINE>Set<String> locationPermissions = Sets.newHashSet();<NEW_LINE>// See ProjectEditor.recordLocationSettings()<NEW_LINE>locationPermissions.add("android.permission.ACCESS_FINE_LOCATION");<NEW_LINE>locationPermissions.add("android.permission.ACCESS_COARSE_LOCATION");<NEW_LINE>locationPermissions.add("android.permission.ACCESS_MOCK_LOCATION");<NEW_LINE>permissionsNeeded.put("com.google.appinventor.components.runtime.WebViewer", locationPermissions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// This is fatal.<NEW_LINE>e.printStackTrace();<NEW_LINE>userErrors.print(String.format(ERROR_IN_STAGE, "Permissions"));<NEW_LINE>} catch (JSONException e) {<NEW_LINE>// This is fatal, but shouldn't actually ever happen.<NEW_LINE>e.printStackTrace();<NEW_LINE>userErrors.print(String.format(ERROR_IN_STAGE, "Permissions"));<NEW_LINE>}<NEW_LINE>mergeConditionals(conditionals.get(ComponentDescriptorConstants.PERMISSIONS_TARGET), permissionsNeeded);<NEW_LINE>int n = 0;<NEW_LINE>for (String type : permissionsNeeded.keySet()) {<NEW_LINE>n += permissionsNeeded.<MASK><NEW_LINE>}<NEW_LINE>System.out.println("Permissions needed, n = " + n);<NEW_LINE>}
get(type).size();
195,510
private static Object bindMap(Type type, ParamNode paramNode, BindingAnnotations bindingAnnotations) {<NEW_LINE>Class keyClass = String.class;<NEW_LINE>Class valueClass = String.class;<NEW_LINE>if (type instanceof ParameterizedType) {<NEW_LINE>keyClass = (Class) ((ParameterizedType) type).getActualTypeArguments()[0];<NEW_LINE>valueClass = (Class) ((ParameterizedType) type).getActualTypeArguments()[1];<NEW_LINE>}<NEW_LINE>Map<Object, Object> r = new HashMap<>();<NEW_LINE>for (ParamNode child : paramNode.getAllChildren()) {<NEW_LINE>try {<NEW_LINE>Object keyObject = directBind(paramNode.getOriginalKey(), bindingAnnotations.annotations, child.getName(), keyClass, keyClass);<NEW_LINE>Object valueObject = internalBind(<MASK><NEW_LINE>if (valueObject == NO_BINDING || valueObject == MISSING) {<NEW_LINE>valueObject = null;<NEW_LINE>}<NEW_LINE>r.put(keyObject, valueObject);<NEW_LINE>} catch (ParseException | NumberFormatException e) {<NEW_LINE>// Just ignore the exception and continue on the next item<NEW_LINE>logBindingNormalFailure(paramNode, e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO This is bad catch. I would like to remove it in next version.<NEW_LINE>logBindingUnexpectedFailure(paramNode, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>}
child, valueClass, valueClass, bindingAnnotations);
432,148
<T> T instantiate(Class<T> cls) throws ParameterNotInstantiableException, IllegalAccessException, InvocationTargetException, FactoryMethodReturnsNullException {<NEW_LINE>if (cls.isEnum()) {<NEW_LINE>T[<MASK><NEW_LINE>if (constants.length > 0) {<NEW_LINE>return constants[0];<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TypeToken<T> type = TypeToken.of(cls);<NEW_LINE>List<ParameterNotInstantiableException> paramErrors = Lists.newArrayList();<NEW_LINE>List<InvocationTargetException> instantiationExceptions = Lists.newArrayList();<NEW_LINE>List<FactoryMethodReturnsNullException> nullErrors = Lists.newArrayList();<NEW_LINE>for (Invokable<?, ? extends T> factory : getFactories(type)) {<NEW_LINE>T instance;<NEW_LINE>try {<NEW_LINE>instance = instantiate(factory);<NEW_LINE>} catch (ParameterNotInstantiableException e) {<NEW_LINE>paramErrors.add(e);<NEW_LINE>continue;<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>instantiationExceptions.add(e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (instance == null) {<NEW_LINE>nullErrors.add(new FactoryMethodReturnsNullException(factory));<NEW_LINE>} else {<NEW_LINE>return instance;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throwFirst(paramErrors);<NEW_LINE>throwFirst(instantiationExceptions);<NEW_LINE>throwFirst(nullErrors);<NEW_LINE>return null;<NEW_LINE>}
] constants = cls.getEnumConstants();
537,842
private void createLayout() {<NEW_LINE>RelativeLayout layout = new RelativeLayout(this);<NEW_LINE>ToggleButton traceButton = new ToggleButton(this);<NEW_LINE>ProgressBar progressBar = new ProgressBar(this);<NEW_LINE>layout.setId(RELATIVE_LAYOUT_ID);<NEW_LINE>traceButton.setTextOff("Start tracing");<NEW_LINE>traceButton.setTextOn("Stop tracing");<NEW_LINE>// force the string to update<NEW_LINE>traceButton.setChecked(false);<NEW_LINE>traceButton.setId(TRACING_BUTTON_ID);<NEW_LINE>progressBar.setIndeterminate(true);<NEW_LINE>progressBar.setVisibility(View.INVISIBLE);<NEW_LINE>RelativeLayout.LayoutParams buttonParams = new RelativeLayout.LayoutParams(ViewGroup.MarginLayoutParams.WRAP_CONTENT, ViewGroup.MarginLayoutParams.WRAP_CONTENT);<NEW_LINE>buttonParams.setMargins(20, 20, 20, 20);<NEW_LINE>buttonParams.addRule(RelativeLayout.ALIGN_PARENT_TOP, 1);<NEW_LINE>buttonParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);<NEW_LINE>layout.addView(traceButton, buttonParams);<NEW_LINE>RelativeLayout.LayoutParams spinnerParams = new RelativeLayout.LayoutParams(ViewGroup.MarginLayoutParams.WRAP_CONTENT, ViewGroup.MarginLayoutParams.WRAP_CONTENT);<NEW_LINE>spinnerParams.setMargins(20, 20, 20, 20);<NEW_LINE>spinnerParams.addRule(RelativeLayout.ALIGN_PARENT_TOP, 1);<NEW_LINE>spinnerParams.addRule(RelativeLayout.RIGHT_OF, TRACING_BUTTON_ID);<NEW_LINE>layout.addView(progressBar, spinnerParams);<NEW_LINE>LinearLayout traceConfigLayout = new LinearLayout(this);<NEW_LINE>traceConfigLayout.setId(TRACE_CONFIG_LAYOUT_ID);<NEW_LINE>traceConfigLayout.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>ScrollView.LayoutParams traceConfigParams = new ScrollView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>RelativeLayout.LayoutParams scrollViewParams = new RelativeLayout.LayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT, ViewGroup.MarginLayoutParams.WRAP_CONTENT);<NEW_LINE>scrollViewParams.setMargins(<MASK><NEW_LINE>scrollViewParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);<NEW_LINE>scrollViewParams.addRule(RelativeLayout.BELOW, TRACING_BUTTON_ID);<NEW_LINE>CheckBox memoryOnlyCheckbox = new CheckBox(this);<NEW_LINE>memoryOnlyCheckbox.setText("In-memory trace");<NEW_LINE>traceConfigLayout.addView(memoryOnlyCheckbox, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);<NEW_LINE>HashMap<String, CheckBox> providerViews = createProviderViews(traceConfigLayout);<NEW_LINE>ScrollView scrollView = new ScrollView(this);<NEW_LINE>scrollView.addView(traceConfigLayout, traceConfigParams);<NEW_LINE>layout.addView(scrollView, scrollViewParams);<NEW_LINE>setContentView(layout);<NEW_LINE>mTracingButton = traceButton;<NEW_LINE>mProgressBar = progressBar;<NEW_LINE>mMemoryOnlyCheckbox = memoryOnlyCheckbox;<NEW_LINE>mProviderCheckboxes = providerViews;<NEW_LINE>}
20, 20, 20, 20);
1,019,896
private List<ResourceUsage> resourceUsageFromSnapshots(Plan plan, List<ResourceSnapshot> snapshots) {<NEW_LINE>snapshots.sort(Comparator.comparing(ResourceSnapshot::getTimestamp));<NEW_LINE>return IntStream.range(0, snapshots.size()).mapToObj(idx -> {<NEW_LINE>var a = snapshots.get(idx);<NEW_LINE>var b = (idx + 1) < snapshots.size() ? snapshots.<MASK><NEW_LINE>var start = a.getTimestamp();<NEW_LINE>var end = Optional.ofNullable(b).map(ResourceSnapshot::getTimestamp).orElse(start.plusSeconds(120));<NEW_LINE>var d = BigDecimal.valueOf(Duration.between(start, end).toMillis());<NEW_LINE>return new ResourceUsage(a.getApplicationId(), a.getZoneId(), plan, BigDecimal.valueOf(a.getCpuCores()).multiply(d), BigDecimal.valueOf(a.getMemoryGb()).multiply(d), BigDecimal.valueOf(a.getDiskGb()).multiply(d));<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>}
get(idx + 1) : null;
223,907
public static int staticAdvance(int position, byte[] toneSequence, MidiSequence midiSequence) throws MidiSequenceException {<NEW_LINE>int <MASK><NEW_LINE>if (retVal == 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// it is already checked that there is at least two bytes left<NEW_LINE>byte type = toneSequence[position];<NEW_LINE>byte data = toneSequence[position + 1];<NEW_LINE>if (type == ToneControl.SILENCE) {<NEW_LINE>retVal = processToneEvent(type, data, true, midiSequence);<NEW_LINE>} else if (type >= MidiToneConstants.TONE_MIN_NOTE && type <= MidiToneConstants.TONE_MAX_NOTE) {<NEW_LINE>retVal = processToneEvent(type, data, false, midiSequence);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
retVal = doStaticValidate(position, toneSequence);
486,312
private ByteBuf deserialize(ImmutableList<Cookie> sessionCookies) throws Exception {<NEW_LINE>if (sessionCookies.isEmpty()) {<NEW_LINE>return Unpooled.EMPTY_BUFFER;<NEW_LINE>}<NEW_LINE>StringBuilder sessionCookie = new StringBuilder();<NEW_LINE>for (Cookie cookie : sessionCookies) {<NEW_LINE>sessionCookie.append(cookie.value());<NEW_LINE>}<NEW_LINE>String[] parts = sessionCookie.toString().split(SESSION_SEPARATOR);<NEW_LINE>if (parts.length != 2) {<NEW_LINE>return Unpooled.buffer(0, 0);<NEW_LINE>}<NEW_LINE>ByteBuf payload = null;<NEW_LINE>ByteBuf digest = null;<NEW_LINE>ByteBuf expectedDigest = null;<NEW_LINE>ByteBuf decryptedPayload = null;<NEW_LINE>try {<NEW_LINE>payload = fromBase64(bufferAllocator, parts[0]);<NEW_LINE>digest = fromBase64(bufferAllocator, parts[1]);<NEW_LINE>expectedDigest = signer.sign(payload, bufferAllocator);<NEW_LINE>if (ByteBufUtil.equals(digest, expectedDigest)) {<NEW_LINE>decryptedPayload = crypto.decrypt(<MASK><NEW_LINE>} else {<NEW_LINE>decryptedPayload = Unpooled.buffer(0, 0);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (payload != null) {<NEW_LINE>payload.touch().release();<NEW_LINE>}<NEW_LINE>if (digest != null) {<NEW_LINE>digest.release();<NEW_LINE>}<NEW_LINE>if (expectedDigest != null) {<NEW_LINE>expectedDigest.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return decryptedPayload.touch();<NEW_LINE>}
payload.resetReaderIndex(), bufferAllocator);
320,975
public static double pdf(double x, double mu, double sigma, double k) {<NEW_LINE>if (x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {<NEW_LINE>return 0.;<NEW_LINE>}<NEW_LINE>x = (x - mu) / sigma;<NEW_LINE>if (k > 0 || k < 0) {<NEW_LINE>if (k * x > 1) {<NEW_LINE>return 0.;<NEW_LINE>}<NEW_LINE>double t = FastMath.log(1 - k * x);<NEW_LINE>return //<NEW_LINE>//<NEW_LINE>t == Double.NEGATIVE_INFINITY ? //<NEW_LINE>1. / sigma : //<NEW_LINE>t == Double.POSITIVE_INFINITY ? 0. : FastMath.exp((1 - k) * t / k - FastMath.exp<MASK><NEW_LINE>} else {<NEW_LINE>// Gumbel case:<NEW_LINE>return FastMath.exp(-x - FastMath.exp(-x)) / sigma;<NEW_LINE>}<NEW_LINE>}
(t / k)) / sigma;
724,747
public void marshall(Profile profile, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (profile == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(profile.getProfileId(), PROFILEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getAccountNumber(), ACCOUNTNUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getAdditionalInformation(), ADDITIONALINFORMATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getPartyType(), PARTYTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getBusinessName(), BUSINESSNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getFirstName(), FIRSTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getMiddleName(), MIDDLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getLastName(), LASTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getBirthDate(), BIRTHDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getGender(), GENDER_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getPhoneNumber(), PHONENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getMobilePhoneNumber(), MOBILEPHONENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(profile.getBusinessPhoneNumber(), BUSINESSPHONENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getEmailAddress(), EMAILADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getPersonalEmailAddress(), PERSONALEMAILADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getBusinessEmailAddress(), BUSINESSEMAILADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getAddress(), ADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getShippingAddress(), SHIPPINGADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getMailingAddress(), MAILINGADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getBillingAddress(), BILLINGADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(profile.getAttributes(), ATTRIBUTES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
profile.getHomePhoneNumber(), HOMEPHONENUMBER_BINDING);
491,299
private void onReceivedSuccess(@NotNull final ChannelHandlerContext ctx, @NotNull final AUTH msg, @NotNull final ClientConnection clientConnection) {<NEW_LINE>final String reasonString = String.format(ReasonStrings.DISCONNECT_PROTOCOL_ERROR_REASON_CODE, msg.getType().name());<NEW_LINE>if (clientConnection.getClientState() == ClientState.RE_AUTHENTICATING) {<NEW_LINE>disconnector.disconnect(ctx.channel(), SUCCESS_AUTH_RECEIVED_FROM_CLIENT, "Success reason code set in AUTH", Mqtt5DisconnectReasonCode.PROTOCOL_ERROR, reasonString, Mqtt5UserProperties.NO_USER_PROPERTIES, true, false);<NEW_LINE>} else {<NEW_LINE>connacker.connackError(ctx.channel(), SUCCESS_AUTH_RECEIVED_FROM_CLIENT, "Success reason code set in AUTH", Mqtt5ConnAckReasonCode.PROTOCOL_ERROR, <MASK><NEW_LINE>}<NEW_LINE>}
reasonString, Mqtt5UserProperties.NO_USER_PROPERTIES, true);
1,131,939
protected PdfPTable exportTable(FacesContext context, DataTable table, ExportConfiguration config) {<NEW_LINE>int columnsCount = getColumnsCount(table);<NEW_LINE><MASK><NEW_LINE>ExporterOptions options = config.getOptions();<NEW_LINE>if (options != null) {<NEW_LINE>applyFont(options.getFontName(), config.getEncodingType());<NEW_LINE>applyFacetOptions(options);<NEW_LINE>applyCellOptions(options);<NEW_LINE>} else {<NEW_LINE>applyFont(FontFactory.TIMES, config.getEncodingType());<NEW_LINE>}<NEW_LINE>if (config.getOnTableRender() != null) {<NEW_LINE>config.getOnTableRender().invoke(context.getELContext(), new Object[] { pdfTable, table });<NEW_LINE>}<NEW_LINE>if (config.isExportHeader()) {<NEW_LINE>addTableFacets(context, table, pdfTable, ColumnType.HEADER);<NEW_LINE>boolean headerGroup = addColumnGroup(table, pdfTable, ColumnType.HEADER);<NEW_LINE>if (!headerGroup) {<NEW_LINE>addColumnFacets(table, pdfTable, ColumnType.HEADER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (config.isPageOnly()) {<NEW_LINE>exportPageOnly(context, table, pdfTable);<NEW_LINE>} else if (config.isSelectionOnly()) {<NEW_LINE>exportSelectionOnly(context, table, pdfTable);<NEW_LINE>} else {<NEW_LINE>exportAll(context, table, pdfTable);<NEW_LINE>}<NEW_LINE>if (config.isExportFooter()) {<NEW_LINE>addColumnGroup(table, pdfTable, ColumnType.FOOTER);<NEW_LINE>if (table.hasFooterColumn()) {<NEW_LINE>addColumnFacets(table, pdfTable, ColumnType.FOOTER);<NEW_LINE>}<NEW_LINE>addTableFacets(context, table, pdfTable, ColumnType.FOOTER);<NEW_LINE>}<NEW_LINE>table.setRowIndex(-1);<NEW_LINE>return pdfTable;<NEW_LINE>}
PdfPTable pdfTable = new PdfPTable(columnsCount);
1,484,813
public void onRender(Env env, Scope scope, Writer writer) {<NEW_LINE>String flag = getPara("flag", scope);<NEW_LINE>String style = getPara("style", scope);<NEW_LINE>Boolean hasThumbnail = getParaToBool("hasThumbnail", scope);<NEW_LINE>String orderBy = getPara("orderBy", scope, "id desc");<NEW_LINE>int count = getParaToInt("count", scope, 10);<NEW_LINE>Columns columns = <MASK><NEW_LINE>columns.eq("style", style);<NEW_LINE>columns.eq("status", Product.STATUS_NORMAL);<NEW_LINE>if (hasThumbnail != null) {<NEW_LINE>if (hasThumbnail) {<NEW_LINE>columns.isNotNull("thumbnail");<NEW_LINE>} else {<NEW_LINE>columns.isNull("thumbnail");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Product> products = service.findListByColumns(columns, orderBy, count);<NEW_LINE>if (products == null || products.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>scope.setLocal("products", products);<NEW_LINE>renderBody(env, scope, writer);<NEW_LINE>}
Columns.create("flag", flag);
343,594
private void initializeRecyclerView(final Context ctx) {<NEW_LINE>recyclerView.hasFixedSize();<NEW_LINE>recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));<NEW_LINE>recyclerViewAdapter = new LogDetailRecyclerViewAdapter(getApplicationContext(), logData -> {<NEW_LINE>current_selected_logData = logData;<NEW_LINE>recyclerView.showContextMenu();<NEW_LINE>});<NEW_LINE>recyclerView.setOnCreateContextMenuListener((menu, v, menuInfo) -> {<NEW_LINE>menu.setHeaderTitle(R.string.select_the_action);<NEW_LINE>// groupId, itemId, order, title<NEW_LINE>// menu.add(0, v.getId(), 0, R.string.add_ip_rule);<NEW_LINE>menu.add(0, v.getId(), <MASK><NEW_LINE>menu.add(0, v.getId(), 2, R.string.show_source_address);<NEW_LINE>menu.add(0, v.getId(), 3, R.string.ping_destination);<NEW_LINE>menu.add(0, v.getId(), 4, R.string.ping_source);<NEW_LINE>menu.add(0, v.getId(), 5, R.string.resolve_destination);<NEW_LINE>menu.add(0, v.getId(), 6, R.string.resolve_source);<NEW_LINE>LogPreference logPreference = SQLite.select().from(LogPreference.class).where(LogPreference_Table.uid.eq(uid)).querySingle();<NEW_LINE>if (logPreference != null) {<NEW_LINE>if (logPreference.isDisable()) {<NEW_LINE>menu.add(0, v.getId(), 7, R.string.displayBlockNotification_enable);<NEW_LINE>} else {<NEW_LINE>menu.add(0, v.getId(), 8, R.string.displayBlockNotification);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>menu.add(0, v.getId(), 8, R.string.displayBlockNotification);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>recyclerView.setAdapter(recyclerViewAdapter);<NEW_LINE>}
1, R.string.show_destination_address);
1,260,220
public void decorate(Element element, ParserContext parserContext, BeanDefinitionBuilder builder, RedissonNamespaceParserSupport helper) {<NEW_LINE>NodeList list = element.getElementsByTagNameNS(RedissonNamespaceParserSupport.REDISSON_NAMESPACE, RedissonNamespaceParserSupport.LOCAL_CACHED_MAP_OPTIONS_ELEMENT);<NEW_LINE>Element options = null;<NEW_LINE>String id;<NEW_LINE>if (list.getLength() == 1) {<NEW_LINE>options = (Element) list.item(0);<NEW_LINE>id = invokeOptions(options, parserContext, helper);<NEW_LINE>for (int i = 0; i < options.getAttributes().getLength(); i++) {<NEW_LINE>Attr item = (Attr) options.getAttributes().item(i);<NEW_LINE>if (helper.isEligibleAttribute(item) && !RedissonNamespaceParserSupport.TIME_TO_LIVE_UNIT_ATTRIBUTE.equals(item.getLocalName()) && !RedissonNamespaceParserSupport.MAX_IDLE_UNIT_ATTRIBUTE.equals(item.getLocalName())) {<NEW_LINE>helper.invoker(id, helper.getName(item), new Object[] { item.getValue() }, parserContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>invokeTimeUnitOptions(options, id, parserContext, helper, <MASK><NEW_LINE>invokeTimeUnitOptions(options, id, parserContext, helper, RedissonNamespaceParserSupport.MAX_IDLE_ATTRIBUTE, RedissonNamespaceParserSupport.MAX_IDLE_UNIT_ATTRIBUTE);<NEW_LINE>} else {<NEW_LINE>id = invokeOptions(options, parserContext, helper);<NEW_LINE>}<NEW_LINE>helper.addConstructorArgs(new RuntimeBeanReference(id), LocalCachedMapOptions.class, builder);<NEW_LINE>}
RedissonNamespaceParserSupport.TIME_TO_LIVE_ATTRIBUTE, RedissonNamespaceParserSupport.TIME_TO_LIVE_UNIT_ATTRIBUTE);
1,421,347
public Object propertyMissing(String name) {<NEW_LINE>if (Character.isUpperCase(name.charAt(0))) {<NEW_LINE>logger.error("unresolved class or property {}, missing import?", name);<NEW_LINE>Set<String> packages = delegate.getConfigLoader().getDirectory().getPackages(name);<NEW_LINE>logger.debug("found {} packages with classes named {}", packages.size(), name);<NEW_LINE>if (packages.isEmpty()) {<NEW_LINE>throw new MissingPropertyException(name, getClass());<NEW_LINE>}<NEW_LINE>String message = "Unresolved property in evaluation script: " + name;<NEW_LINE><MASK><NEW_LINE>for (String pkg : packages) {<NEW_LINE>logger.info("consider importing {}.{}", pkg, name);<NEW_LINE>ex.addHint("consider importing %s.%s", pkg, name);<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} else {<NEW_LINE>logger.error("unresolved property {} in configuration script", name);<NEW_LINE>throw new MissingPropertyException(name, getClass());<NEW_LINE>}<NEW_LINE>}
RecommenderConfigurationException ex = new RecommenderConfigurationException(message);
1,027,076
private void doApplyFix(@Nonnull final Project project, @Nonnull final CommonProblemDescriptor[] descriptors, @Nonnull final GlobalInspectionContextImpl context) {<NEW_LINE>final Set<VirtualFile> readOnlyFiles = new HashSet<VirtualFile>();<NEW_LINE>for (CommonProblemDescriptor descriptor : descriptors) {<NEW_LINE>final PsiElement psiElement = descriptor instanceof ProblemDescriptor ? ((ProblemDescriptor) descriptor).getPsiElement() : null;<NEW_LINE>if (psiElement != null && !psiElement.isWritable()) {<NEW_LINE>readOnlyFiles.add(psiElement.getContainingFile().getVirtualFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!FileModificationService.getInstance().prepareVirtualFilesForWrite(project, readOnlyFiles))<NEW_LINE>return;<NEW_LINE>final RefManagerImpl refManager = (RefManagerImpl) context.getRefManager();<NEW_LINE>final boolean initial = refManager.isInProcess();<NEW_LINE>refManager.inspectionReadActionFinished();<NEW_LINE>try {<NEW_LINE>final Set<PsiElement> ignoredElements <MASK><NEW_LINE>CommandProcessor.getInstance().executeCommand(project, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>CommandProcessor.getInstance().markCurrentCommandAsGlobal(project);<NEW_LINE>ApplicationManager.getApplication().runWriteAction(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final SequentialModalProgressTask progressTask = new SequentialModalProgressTask(project, getTemplatePresentation().getText(), false);<NEW_LINE>progressTask.setMinIterationTime(200);<NEW_LINE>progressTask.setTask(new PerformFixesTask(project, descriptors, ignoredElements, progressTask, context));<NEW_LINE>ProgressManager.getInstance().run(progressTask);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}, getTemplatePresentation().getText(), null);<NEW_LINE>refreshViews(project, ignoredElements, myToolWrapper);<NEW_LINE>} finally {<NEW_LINE>// to make offline view lazy<NEW_LINE>if (initial)<NEW_LINE>refManager.inspectionReadActionStarted();<NEW_LINE>}<NEW_LINE>}
= new HashSet<PsiElement>();
295,642
final PutImageRecipePolicyResult executePutImageRecipePolicy(PutImageRecipePolicyRequest putImageRecipePolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putImageRecipePolicyRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutImageRecipePolicyRequest> request = null;<NEW_LINE>Response<PutImageRecipePolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutImageRecipePolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putImageRecipePolicyRequest));<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, "imagebuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutImageRecipePolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutImageRecipePolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutImageRecipePolicyResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,735,772
final ListServiceActionsForProvisioningArtifactResult executeListServiceActionsForProvisioningArtifact(ListServiceActionsForProvisioningArtifactRequest listServiceActionsForProvisioningArtifactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listServiceActionsForProvisioningArtifactRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListServiceActionsForProvisioningArtifactRequest> request = null;<NEW_LINE>Response<ListServiceActionsForProvisioningArtifactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListServiceActionsForProvisioningArtifactRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listServiceActionsForProvisioningArtifactRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServiceActionsForProvisioningArtifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListServiceActionsForProvisioningArtifactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListServiceActionsForProvisioningArtifactResultJsonUnmarshaller());<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);
471,171
// GEN-LAST:event_formattersMoveDownButtonActionPerformed<NEW_LINE>private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_editButtonActionPerformed<NEW_LINE>int index = formattersList.getSelectedIndex();<NEW_LINE>if (index < 0)<NEW_LINE>return;<NEW_LINE>DefaultListModel model = (DefaultListModel) formattersList.getModel();<NEW_LINE>VariablesFormatter f = (VariablesFormatter) model.getElementAt(index);<NEW_LINE>VariableFormatterEditPanel fPanel = new VariableFormatterEditPanel();<NEW_LINE>fPanel.load(f);<NEW_LINE>Set<String> formatterNames = getFormatterNames();<NEW_LINE>formatterNames.remove(f.getName());<NEW_LINE>fPanel.setFormatterNames(formatterNames);<NEW_LINE>DialogDescriptor formatterEditDescriptor = new DialogDescriptor(fPanel, NbBundle.getMessage(CategoryPanelFormatters.class, "TTL_EditFormatter"), true, NotifyDescriptor.<MASK><NEW_LINE>NotificationLineSupport notificationSupport = formatterEditDescriptor.createNotificationLineSupport();<NEW_LINE>fPanel.setValidityObjects(formatterEditDescriptor, notificationSupport, true);<NEW_LINE>// formatterEditDescriptor.setValid(false);<NEW_LINE>Dialog dlg = DialogDisplayer.getDefault().createDialog(formatterEditDescriptor);<NEW_LINE>// NOI18N<NEW_LINE>Properties p = Properties.getDefault().getProperties("debugger.options.JPDA");<NEW_LINE>// NOI18N<NEW_LINE>int w = p.getInt("VariableFormatters_AddEdit_WIDTH", -1);<NEW_LINE>// NOI18N<NEW_LINE>int h = p.getInt("VariableFormatters_AddEdit_HEIGHT", -1);<NEW_LINE>if (w > 0 && h > 0) {<NEW_LINE>dlg.setSize(new Dimension(w, h));<NEW_LINE>}<NEW_LINE>dlg.setVisible(true);<NEW_LINE>Dimension dim = dlg.getSize();<NEW_LINE>// NOI18N<NEW_LINE>p.setInt("VariableFormatters_AddEdit_WIDTH", dim.width);<NEW_LINE>// NOI18N<NEW_LINE>p.setInt("VariableFormatters_AddEdit_HEIGHT", dim.height);<NEW_LINE>if (NotifyDescriptor.OK_OPTION.equals(formatterEditDescriptor.getValue())) {<NEW_LINE>fPanel.store(f);<NEW_LINE>checkBoxComponents.put(f, new JCheckBox(f.getName(), f.isEnabled()));<NEW_LINE>((DefaultListModel) formattersList.getModel()).setElementAt(f, index);<NEW_LINE>// formattersList.repaint();<NEW_LINE>formattersList.setSelectedValue(f, true);<NEW_LINE>loadSelectedFormatter(f);<NEW_LINE>}<NEW_LINE>}
OK_CANCEL_OPTION, NotifyDescriptor.OK_OPTION, null);
364,749
protected byte[] key(@Nullable final Project project) throws PasswordSafeException {<NEW_LINE>if (!isTestMode() && ApplicationManager.getApplication().isHeadlessEnvironment()) {<NEW_LINE>throw new MasterPasswordUnavailableException("The provider is not available in headless environment");<NEW_LINE>}<NEW_LINE>if (key.get() == null) {<NEW_LINE>if (isPasswordEncrypted()) {<NEW_LINE>try {<NEW_LINE>String s = decryptPassword(database.getPasswordInfo());<NEW_LINE>setMasterPassword(s);<NEW_LINE>} catch (PasswordSafeException e) {<NEW_LINE>// ignore exception and ask password<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (key.get() == null) {<NEW_LINE>final Ref<PasswordSafeException> ex = new Ref<PasswordSafeException>();<NEW_LINE>ApplicationManager.getApplication().invokeAndWait(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (key.get() == null) {<NEW_LINE>try {<NEW_LINE>if (isTestMode()) {<NEW_LINE>throw new MasterPasswordUnavailableException("Master password must be specified in test mode.");<NEW_LINE>}<NEW_LINE>if (database.isEmpty()) {<NEW_LINE>if (!ResetPasswordDialog.newPassword(project, MasterKeyPasswordSafe.this)) {<NEW_LINE>throw new MasterPasswordUnavailableException("Master password is required to store passwords in the database.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MasterPasswordDialog.askPassword(project, MasterKeyPasswordSafe.this);<NEW_LINE>}<NEW_LINE>} catch (PasswordSafeException e) {<NEW_LINE>ex.set(e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// noinspection ThrowableInstanceNeverThrown<NEW_LINE>ex.set(new MasterPasswordUnavailableException("The problem with retrieving the password", e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// noinspection ThrowableResultOfMethodCallIgnored<NEW_LINE>if (ex.get() != null) {<NEW_LINE>throw ex.get();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this.key.get();<NEW_LINE>}
}, ModalityState.defaultModalityState());
1,835,554
protected void parseDense(Osmformat.DenseNodes nodes) {<NEW_LINE>long lastId = 0, lastLat = 0, lastLon = 0;<NEW_LINE>// Index into the keysvals array.<NEW_LINE>int j = 0;<NEW_LINE>if (parsePhase != OsmParserPhase.Nodes) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < nodes.getIdCount(); i++) {<NEW_LINE>OSMNode tmp = new OSMNode();<NEW_LINE>long lat = nodes.getLat(i) + lastLat;<NEW_LINE>lastLat = lat;<NEW_LINE>long lon = nodes.getLon(i) + lastLon;<NEW_LINE>lastLon = lon;<NEW_LINE>long id = <MASK><NEW_LINE>lastId = id;<NEW_LINE>double latf = parseLat(lat), lonf = parseLon(lon);<NEW_LINE>tmp.setId(id);<NEW_LINE>tmp.lat = latf;<NEW_LINE>tmp.lon = lonf;<NEW_LINE>// If empty, assume that nothing here has keys or vals.<NEW_LINE>if (nodes.getKeysValsCount() > 0) {<NEW_LINE>while (nodes.getKeysVals(j) != 0) {<NEW_LINE>int keyid = nodes.getKeysVals(j++);<NEW_LINE>int valid = nodes.getKeysVals(j++);<NEW_LINE>OSMTag tag = new OSMTag();<NEW_LINE>String key = internalize(getStringById(keyid));<NEW_LINE>String value = internalize(getStringById(valid));<NEW_LINE>tag.setK(key);<NEW_LINE>tag.setV(value);<NEW_LINE>tmp.addTag(tag);<NEW_LINE>}<NEW_LINE>// Skip over the '0' delimiter.<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>osmdb.addNode(tmp);<NEW_LINE>}<NEW_LINE>}
nodes.getId(i) + lastId;
1,587,306
public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {<NEW_LINE>rabbitMQSourceConfig = RabbitMQSourceConfig.load(config);<NEW_LINE>rabbitMQSourceConfig.validate();<NEW_LINE>ConnectionFactory connectionFactory = rabbitMQSourceConfig.createConnectionFactory();<NEW_LINE>rabbitMQConnection = connectionFactory.newConnection(rabbitMQSourceConfig.getConnectionName());<NEW_LINE>logger.info("A new connection to {}:{} has been opened successfully.", rabbitMQConnection.getAddress().getCanonicalHostName(), rabbitMQConnection.getPort());<NEW_LINE>rabbitMQChannel = rabbitMQConnection.createChannel();<NEW_LINE>if (rabbitMQSourceConfig.isPassive()) {<NEW_LINE>rabbitMQChannel.queueDeclarePassive(rabbitMQSourceConfig.getQueueName());<NEW_LINE>} else {<NEW_LINE>rabbitMQChannel.queueDeclare(rabbitMQSourceConfig.getQueueName(), false, false, false, null);<NEW_LINE>}<NEW_LINE>logger.info("Setting channel.basicQos({}, {}).", rabbitMQSourceConfig.getPrefetchCount(), rabbitMQSourceConfig.isPrefetchGlobal());<NEW_LINE>rabbitMQChannel.basicQos(rabbitMQSourceConfig.getPrefetchCount(), rabbitMQSourceConfig.isPrefetchGlobal());<NEW_LINE>com.rabbitmq.client.Consumer consumer <MASK><NEW_LINE>rabbitMQChannel.basicConsume(rabbitMQSourceConfig.getQueueName(), consumer);<NEW_LINE>logger.info("A consumer for queue {} has been successfully started.", rabbitMQSourceConfig.getQueueName());<NEW_LINE>}
= new RabbitMQConsumer(this, rabbitMQChannel);
808,233
private static JFileChooser createFileChooser() {<NEW_LINE>JFileChooser chooser = new JFileChooser() {<NEW_LINE><NEW_LINE>public void approveSelection() {<NEW_LINE>File file = getSelectedFile();<NEW_LINE>Filter filter = (Filter) getFileFilter();<NEW_LINE>if (!file.getName().endsWith(filter.getExt())) {<NEW_LINE>file = new File(file.getPath(<MASK><NEW_LINE>setSelectedFile(file);<NEW_LINE>}<NEW_LINE>if (!file.isFile()) {<NEW_LINE>super.approveSelection();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean[] ret = new boolean[1];<NEW_LINE>JButton yesB = new JButton("Yes") {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>ret[0] = true;<NEW_LINE>super.fireActionPerformed(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DialogDescriptor desc = new DialogDescriptor("File \"" + file.getName() + "\" already exists.\n" + "Do you want to replace it?", "Replace Existing File", true, new Object[] { yesB, new JButton("No") }, yesB, DialogDescriptor.BOTTOM_ALIGN, null, null);<NEW_LINE>desc.setMessageType(NotifyDescriptor.QUESTION_MESSAGE);<NEW_LINE>Dialog d = DialogDisplayer.getDefault().createDialog(desc);<NEW_LINE>openDialog(d);<NEW_LINE>if (ret[0] == true)<NEW_LINE>super.approveSelection();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>chooser.setDialogTitle("Export Tracer Data");<NEW_LINE>chooser.setDialogType(JFileChooser.SAVE_DIALOG);<NEW_LINE>chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);<NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.addChoosableFileFilter(CSV_FILTER);<NEW_LINE>chooser.addChoosableFileFilter(HTML_FILTER);<NEW_LINE>chooser.addChoosableFileFilter(XML_FILTER);<NEW_LINE>return chooser;<NEW_LINE>}
) + filter.getExt());
1,143,182
// CHECKSTYLE:OFF<NEW_LINE>private void reportOnTomcatInformations() {<NEW_LINE>// NOPMD<NEW_LINE>// CHECKSTYLE:ON<NEW_LINE>final Map<String, TomcatInformations> tcInfos = new LinkedHashMap<>();<NEW_LINE>for (final TomcatInformations tcInfo : javaInformations.getTomcatInformationsList()) {<NEW_LINE>if (tcInfo.getRequestCount() > 0) {<NEW_LINE>final String fields = "{tomcat_name=\"" + sanitizeName(tcInfo.getName()) + "\"}";<NEW_LINE>tcInfos.put(fields, tcInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tcInfos.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>printHeader(MetricType.GAUGE, "tomcat_threads_max", "tomcat max threads");<NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_threads_max", entry.getKey(), entry.getValue().getMaxThreads());<NEW_LINE>}<NEW_LINE>printHeader(MetricType.GAUGE, "tomcat_thread_busy_count", "tomcat currently busy threads");<NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_thread_busy_count", entry.getKey(), entry.getValue().getCurrentThreadsBusy());<NEW_LINE>}<NEW_LINE>printHeader(MetricType.COUNTER, "tomcat_received_bytes", "tomcat total received bytes");<NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_received_bytes", entry.getKey(), entry.getValue().getBytesReceived());<NEW_LINE>}<NEW_LINE>printHeader(MetricType.COUNTER, "tomcat_sent_bytes", "tomcat total sent bytes");<NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_sent_bytes", entry.getKey(), entry.getValue().getBytesSent());<NEW_LINE>}<NEW_LINE>printHeader(MetricType.COUNTER, "tomcat_request_count", "tomcat total request count");<NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_request_count", entry.getKey(), entry.getValue().getRequestCount());<NEW_LINE>}<NEW_LINE>printHeader(<MASK><NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_error_count", entry.getKey(), entry.getValue().getErrorCount());<NEW_LINE>}<NEW_LINE>printHeader(MetricType.COUNTER, "tomcat_processing_time_millis", "tomcat total processing time");<NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_processing_time_millis", entry.getKey(), entry.getValue().getProcessingTime());<NEW_LINE>}<NEW_LINE>printHeader(MetricType.GAUGE, "tomcat_max_time_millis", "tomcat max time for single request");<NEW_LINE>for (final Map.Entry<String, TomcatInformations> entry : tcInfos.entrySet()) {<NEW_LINE>printLongWithFields("tomcat_max_time_millis", entry.getKey(), entry.getValue().getMaxTime());<NEW_LINE>}<NEW_LINE>}
MetricType.COUNTER, "tomcat_error_count", "tomcat total error count");
280,710
public DBParameterGroupStatus unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DBParameterGroupStatus dBParameterGroupStatus = new DBParameterGroupStatus();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return dBParameterGroupStatus;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("DBParameterGroupName", targetDepth)) {<NEW_LINE>dBParameterGroupStatus.setDBParameterGroupName(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ParameterApplyStatus", targetDepth)) {<NEW_LINE>dBParameterGroupStatus.setParameterApplyStatus(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return dBParameterGroupStatus;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
940,412
public void run(FlowTrigger trigger, Map data) {<NEW_LINE>VmInstanceSpec spec = (VmInstanceSpec) data.get(VmInstanceConstant.Params.VmInstanceSpec.toString());<NEW_LINE>ApplianceVmPostLifeCycleInfo info;<NEW_LINE>if (spec.getCurrentVmOperation() == VmOperation.NewCreate) {<NEW_LINE>final ApplianceVmSpec aspec = spec.getExtensionData(ApplianceVmConstant.Params.applianceVmSpec.toString(), ApplianceVmSpec.class);<NEW_LINE>info = new ApplianceVmPostLifeCycleInfo();<NEW_LINE>info.<MASK><NEW_LINE>VmNicInventory mgmtNic = CollectionUtils.find(spec.getDestNics(), new Function<VmNicInventory, VmNicInventory>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public VmNicInventory call(VmNicInventory arg) {<NEW_LINE>return arg.getL3NetworkUuid().equals(aspec.getManagementNic().getL3NetworkUuid()) ? arg : null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>info.setManagementNic(mgmtNic);<NEW_LINE>data.put(Param.IS_NEW_CREATED.toString(), true);<NEW_LINE>} else {<NEW_LINE>info = (ApplianceVmPostLifeCycleInfo) data.get(ApplianceVmConstant.Params.applianceVmInfoForPostLifeCycle.toString());<NEW_LINE>}<NEW_LINE>VirtualRouterVmInventory vrInv = VirtualRouterVmInventory.valueOf(dbf.findByUuid(spec.getVmInventory().getUuid(), VirtualRouterVmVO.class));<NEW_LINE>if (spec.getCurrentVmOperation() == VmOperation.Destroy) {<NEW_LINE>data.put(Param.VR_UUID.toString(), spec.getVmInventory().getUuid());<NEW_LINE>data.put(Param.IS_HA_ROUTER.toString(), vrInv.isHaEnabled());<NEW_LINE>data.put(VirtualRouterConstant.Param.VR.toString(), spec.getVmInventory());<NEW_LINE>} else {<NEW_LINE>data.put(VirtualRouterConstant.Param.VR.toString(), vrInv);<NEW_LINE>data.put(VirtualRouterConstant.Param.VR_NIC.toString(), vrInv.getPublicNic());<NEW_LINE>}<NEW_LINE>trigger.next();<NEW_LINE>}
setDefaultRouteL3Network(aspec.getDefaultRouteL3Network());
1,802,757
public int alterNameAndTypeAndFlag(String tableSchema, String originName, String newName, int tableType, long flag) {<NEW_LINE>try {<NEW_LINE>final Map<Integer, ParameterContext> params = new HashMap<>(12);<NEW_LINE>MetaDbUtil.setParameter(1, params, ParameterMethod.setString, newName);<NEW_LINE>MetaDbUtil.setParameter(2, params, ParameterMethod.setInt, tableType);<NEW_LINE>MetaDbUtil.setParameter(3, params, ParameterMethod.setLong, flag);<NEW_LINE>MetaDbUtil.setParameter(4, params, ParameterMethod.setString, tableSchema);<NEW_LINE>MetaDbUtil.setParameter(5, params, ParameterMethod.setString, originName);<NEW_LINE>DdlMetaLogUtil.logSql(UPDATE_TABLES_EXT_SWITCH_NAME_TYPE_FLAG, params);<NEW_LINE>return MetaDbUtil.update(UPDATE_TABLES_EXT_SWITCH_NAME_TYPE_FLAG, params, connection);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_ACCESS_TO_SYSTEM_TABLE, e, "update", <MASK><NEW_LINE>}<NEW_LINE>}
TABLES_EXT_TABLE, e.getMessage());
443,253
private void runExecutableNode(final ExecutableNode node) throws IOException {<NEW_LINE>// Collect output props from the job's dependencies.<NEW_LINE>prepareJobProperties(node);<NEW_LINE>node.setStatus(Status.QUEUED);<NEW_LINE>// Attach Ramp Props if there is any desired properties<NEW_LINE>final String jobId = node.getId();<NEW_LINE>final String jobType = Optional.ofNullable(node.getInputProps()).map(props -> props.getString("type")).orElse(null);<NEW_LINE>if (jobType != null && jobId != null) {<NEW_LINE>final Props rampProps = this.flow.getRampPropsForJob(jobId, jobType);<NEW_LINE>if (rampProps != null) {<NEW_LINE>this.flowIsRamping = true;<NEW_LINE>this.logger.info(String.format("RAMP_FLOW_ATTACH_PROPS_FOR_JOB : (flow.ExecId = %d, flow.Id = %s, flow.flowName = %s, job.id = %s, job.type = %s, props = %s)", this.flow.getExecutionId(), this.flow.getId(), this.flow.getFlowName(), jobId, jobType<MASK><NEW_LINE>node.setRampProps(rampProps);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.logger.warn(String.format("RAMP_FLOW_ATTACH_PROPS_FOR_JOB : (flow.ExecId = %d, flow.Id = %s, flow.flowName = %s) does not have Job Type or Id", this.flow.getExecutionId(), this.flow.getId(), this.flow.getFlowName()));<NEW_LINE>}<NEW_LINE>final JobRunner runner = createJobRunner(node);<NEW_LINE>this.logger.info("Submitting job '" + node.getNestedId() + "' to run.");<NEW_LINE>try {<NEW_LINE>// Job starts to queue<NEW_LINE>runner.setTimeInQueue(System.currentTimeMillis());<NEW_LINE>this.executorService.submit(runner);<NEW_LINE>this.activeJobRunners.add(runner);<NEW_LINE>} catch (final RejectedExecutionException e) {<NEW_LINE>this.logger.error(e);<NEW_LINE>}<NEW_LINE>}
, rampProps.toString()));
1,476,562
public TimerTask scheduleTask(final Runnable task, final Date firstTime, final long period) {<NEW_LINE>engineLock.readLock().lock();<NEW_LINE>try {<NEW_LINE>final TimerTask timerTask = new TimerTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>task.run();<NEW_LINE>} catch (Exception e) {<NEW_LINE>OLogManager.instance().error(this, "Error during execution of task " + task.getClass().getSimpleName(), e);<NEW_LINE>} catch (Error e) {<NEW_LINE>OLogManager.instance().error(this, "Error during execution of task " + task.getClass().getSimpleName(), e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (active) {<NEW_LINE>if (period > 0) {<NEW_LINE>timer.schedule(timerTask, firstTime, period);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>OLogManager.instance().warn(this, "OrientDB engine is down. Task will not be scheduled.");<NEW_LINE>}<NEW_LINE>return timerTask;<NEW_LINE>} finally {<NEW_LINE>engineLock.readLock().unlock();<NEW_LINE>}<NEW_LINE>}
timer.schedule(timerTask, firstTime);
1,702,378
static LineAction toAction(@Nullable NamedManagementObject obj, Uid uid, Warnings w) {<NEW_LINE>if (obj == null) {<NEW_LINE>w.redFlag(String.format("Cannot convert non-existent object (Uid '%s') into an access-rule action, defaulting" + " to deny action"<MASK><NEW_LINE>return LineAction.DENY;<NEW_LINE>} else if (!(obj instanceof RulebaseAction)) {<NEW_LINE>w.redFlag(String.format("Cannot convert object '%s' (Uid '%s') of type %s into an access-rule action," + " defaulting to deny action", obj.getName(), uid.getValue(), obj.getClass().getSimpleName()));<NEW_LINE>return LineAction.DENY;<NEW_LINE>} else {<NEW_LINE>RulebaseAction ra = (RulebaseAction) obj;<NEW_LINE>switch(ra.getAction()) {<NEW_LINE>case DROP:<NEW_LINE>return LineAction.DENY;<NEW_LINE>case ACCEPT:<NEW_LINE>return LineAction.PERMIT;<NEW_LINE>case UNHANDLED:<NEW_LINE>default:<NEW_LINE>w.redFlag(String.format("Cannot convert action '%s' (Uid '%s') into an access-rule action, defaulting to" + " deny action", ra.getName(), uid.getValue()));<NEW_LINE>return LineAction.DENY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, uid.getValue()));
342,581
/*<NEW_LINE>* header panel represents the selected Date<NEW_LINE>* we keep javaFX original style classes<NEW_LINE>*/<NEW_LINE>protected VBox createHeaderPane() {<NEW_LINE>// Year label<NEW_LINE>selectedYearLabel = new Label();<NEW_LINE>selectedYearLabel.getStyleClass().add(SPINNER_LABEL);<NEW_LINE>selectedYearLabel.setTextFill(Color.rgb(255, 255, 255, 0.67));<NEW_LINE>selectedYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 14));<NEW_LINE>// Year label container<NEW_LINE>HBox yearLabelContainer = new HBox();<NEW_LINE>yearLabelContainer.getStyleClass().add("spinner");<NEW_LINE>yearLabelContainer.getChildren().addAll(selectedYearLabel);<NEW_LINE>yearLabelContainer.setAlignment(Pos.CENTER_LEFT);<NEW_LINE>yearLabelContainer.setFillHeight(false);<NEW_LINE>yearLabelContainer.setOnMouseClicked((click) -> {<NEW_LINE>if (!yearsListView.isVisible()) {<NEW_LINE>scrollToYear();<NEW_LINE>hideTransition.stop();<NEW_LINE>showTransition.play();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// selected date label<NEW_LINE>selectedDateLabel = new Label();<NEW_LINE>selectedDateLabel.getStyleClass().add(SPINNER_LABEL);<NEW_LINE><MASK><NEW_LINE>selectedDateLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 32));<NEW_LINE>// selected date label container<NEW_LINE>HBox selectedDateContainer = new HBox(selectedDateLabel);<NEW_LINE>selectedDateContainer.getStyleClass().add("spinner");<NEW_LINE>selectedDateContainer.setAlignment(Pos.CENTER_LEFT);<NEW_LINE>selectedDateContainer.setOnMouseClicked((click) -> {<NEW_LINE>if (yearsListView.isVisible()) {<NEW_LINE>showTransition.stop();<NEW_LINE>hideTransition.play();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>VBox headerPanel = new VBox();<NEW_LINE>headerPanel.getStyleClass().add("month-year-pane");<NEW_LINE>headerPanel.setBackground(new Background(new BackgroundFill(this.datePicker.getDefaultColor(), CornerRadii.EMPTY, Insets.EMPTY)));<NEW_LINE>headerPanel.setPadding(new Insets(12, 24, 12, 24));<NEW_LINE>headerPanel.getChildren().add(yearLabelContainer);<NEW_LINE>headerPanel.getChildren().add(selectedDateContainer);<NEW_LINE>return headerPanel;<NEW_LINE>}
selectedDateLabel.setTextFill(Color.WHITE);
417,850
public Control createControl(Composite parent) {<NEW_LINE>Composite container = new Composite(parent, SWT.NONE);<NEW_LINE>TableColumnLayout layout = new TableColumnLayout();<NEW_LINE>container.setLayout(layout);<NEW_LINE>tableViewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.MULTI);<NEW_LINE>ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.NO_RECREATE);<NEW_LINE>CopyPasteSupport.enableFor(tableViewer);<NEW_LINE>ShowHideColumnHelper support = new // $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>ShowHideColumnHelper(TransactionsTab.class.getSimpleName() + "@v3", preferences, tableViewer, layout);<NEW_LINE>addColumns(support);<NEW_LINE>support.createColumns();<NEW_LINE>tableViewer.getTable().setHeaderVisible(true);<NEW_LINE>tableViewer.getTable().setLinesVisible(true);<NEW_LINE>tableViewer.setContentProvider(ArrayContentProvider.getInstance());<NEW_LINE>tableViewer.addSelectionChangedListener(event -> {<NEW_LINE>TransactionPair<?> tx = ((TransactionPair<?>) ((IStructuredSelection) event.getSelection()).getFirstElement());<NEW_LINE>view.setInformationPaneInput(tx);<NEW_LINE>if (tx != null && tx.getTransaction().getSecurity() != null)<NEW_LINE>selectionService.setSelection(new SecuritySelection(model.getClient(), tx.getTransaction().getSecurity()));<NEW_LINE>});<NEW_LINE>tableViewer.setInput(model.getTransactions());<NEW_LINE>model.addUpdateListener(() -> tableViewer.setInput<MASK><NEW_LINE>return container;<NEW_LINE>}
(model.getTransactions()));
601,863
static TransformableRowIterator toMergedIndexRowIterator(TransformableRowIterator sourceRowIterator, int indexNumber, final List<DimensionMergerV9> mergers) {<NEW_LINE>RowPointer sourceRowPointer = sourceRowIterator.getPointer();<NEW_LINE>TimeAndDimsPointer markedSourceRowPointer = sourceRowIterator.getMarkedPointer();<NEW_LINE>boolean anySelectorChanged = false;<NEW_LINE>ColumnValueSelector[] convertedDimensionSelectors = new ColumnValueSelector[mergers.size()];<NEW_LINE>ColumnValueSelector[] convertedMarkedDimensionSelectors = new <MASK><NEW_LINE>for (int i = 0; i < mergers.size(); i++) {<NEW_LINE>ColumnValueSelector sourceDimensionSelector = sourceRowPointer.getDimensionSelector(i);<NEW_LINE>ColumnValueSelector convertedDimensionSelector = mergers.get(i).convertSortedSegmentRowValuesToMergedRowValues(indexNumber, sourceDimensionSelector);<NEW_LINE>convertedDimensionSelectors[i] = convertedDimensionSelector;<NEW_LINE>// convertedDimensionSelector could be just the same object as sourceDimensionSelector, it means that this<NEW_LINE>// type of column doesn't have any kind of special per-index encoding that needs to be converted to the "global"<NEW_LINE>// encoding. E. g. it's always true for subclasses of NumericDimensionMergerV9.<NEW_LINE>// noinspection ObjectEquality<NEW_LINE>anySelectorChanged |= convertedDimensionSelector != sourceDimensionSelector;<NEW_LINE>convertedMarkedDimensionSelectors[i] = mergers.get(i).convertSortedSegmentRowValuesToMergedRowValues(indexNumber, markedSourceRowPointer.getDimensionSelector(i));<NEW_LINE>}<NEW_LINE>// If none dimensions are actually converted, don't need to transform the sourceRowIterator, adding extra<NEW_LINE>// indirection layer. It could be just returned back from this method.<NEW_LINE>if (!anySelectorChanged) {<NEW_LINE>return sourceRowIterator;<NEW_LINE>}<NEW_LINE>return makeRowIteratorWithConvertedDimensionColumns(sourceRowIterator, convertedDimensionSelectors, convertedMarkedDimensionSelectors);<NEW_LINE>}
ColumnValueSelector[mergers.size()];
965,719
final DescribeReservedElasticsearchInstancesResult executeDescribeReservedElasticsearchInstances(DescribeReservedElasticsearchInstancesRequest describeReservedElasticsearchInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReservedElasticsearchInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReservedElasticsearchInstancesRequest> request = null;<NEW_LINE>Response<DescribeReservedElasticsearchInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReservedElasticsearchInstancesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReservedElasticsearchInstancesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReservedElasticsearchInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeReservedElasticsearchInstancesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReservedElasticsearchInstancesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
888,384
private ResolvedArtifactSet locateOrCreate(Factory factory, ComponentIdentifier componentIdentifier, ResolvedVariant sourceVariant, VariantDefinition variantDefinition, ExtraExecutionGraphDependenciesResolverFactory dependenciesResolverFactory) {<NEW_LINE>ImmutableAttributes target = variantDefinition.getTargetAttributes();<NEW_LINE>Transformation transformation = variantDefinition.getTransformation();<NEW_LINE>VariantResolveMetadata.<MASK><NEW_LINE>if (identifier == null) {<NEW_LINE>// An ad hoc variant, do not cache the result<NEW_LINE>return factory.create(componentIdentifier, sourceVariant, variantDefinition, dependenciesResolverFactory);<NEW_LINE>}<NEW_LINE>VariantKey variantKey;<NEW_LINE>if (transformation.requiresDependencies()) {<NEW_LINE>variantKey = new VariantWithUpstreamDependenciesKey(identifier, target, dependenciesResolverFactory);<NEW_LINE>} else {<NEW_LINE>variantKey = new VariantKey(identifier, target);<NEW_LINE>}<NEW_LINE>// Can't use computeIfAbsent() as the default implementation does not allow recursive updates<NEW_LINE>ResolvedArtifactSet result = variants.get(variantKey);<NEW_LINE>if (result == null) {<NEW_LINE>ResolvedArtifactSet newResult = factory.create(componentIdentifier, sourceVariant, variantDefinition, dependenciesResolverFactory);<NEW_LINE>result = variants.putIfAbsent(variantKey, newResult);<NEW_LINE>if (result == null) {<NEW_LINE>result = newResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
Identifier identifier = sourceVariant.getIdentifier();
696,102
public void marshall(BatchResultErrorEntry _batchResultErrorEntry, Request<?> request, String _prefix) {<NEW_LINE>String prefix;<NEW_LINE>if (_batchResultErrorEntry.getId() != null) {<NEW_LINE>prefix = _prefix + "Id";<NEW_LINE>String id = _batchResultErrorEntry.getId();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(id));<NEW_LINE>}<NEW_LINE>if (_batchResultErrorEntry.getSenderFault() != null) {<NEW_LINE>prefix = _prefix + "SenderFault";<NEW_LINE><MASK><NEW_LINE>request.addParameter(prefix, StringUtils.fromBoolean(senderFault));<NEW_LINE>}<NEW_LINE>if (_batchResultErrorEntry.getCode() != null) {<NEW_LINE>prefix = _prefix + "Code";<NEW_LINE>String code = _batchResultErrorEntry.getCode();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(code));<NEW_LINE>}<NEW_LINE>if (_batchResultErrorEntry.getMessage() != null) {<NEW_LINE>prefix = _prefix + "Message";<NEW_LINE>String message = _batchResultErrorEntry.getMessage();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(message));<NEW_LINE>}<NEW_LINE>}
Boolean senderFault = _batchResultErrorEntry.getSenderFault();
1,551,939
private void handlePreload(Context context, Intent i) {<NEW_LINE>String url = UrlUtils.smartUrlFilter(i.getData());<NEW_LINE>String id = i.getStringExtra(EXTRA_PRELOAD_ID);<NEW_LINE>Map<String, String> headers = null;<NEW_LINE>if (id == null) {<NEW_LINE>if (LOGD_ENABLED)<NEW_LINE>Log.d(LOGTAG, "Preload request has no " + EXTRA_PRELOAD_ID);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (i.getBooleanExtra(EXTRA_PRELOAD_DISCARD, false)) {<NEW_LINE>if (LOGD_ENABLED)<NEW_LINE>Log.d(LOGTAG, "Got " + id + " preload discard request");<NEW_LINE>Preloader.getInstance().discardPreload(id);<NEW_LINE>} else if (i.getBooleanExtra(EXTRA_SEARCHBOX_CANCEL, false)) {<NEW_LINE>if (LOGD_ENABLED)<NEW_LINE>Log.d(LOGTAG, "Got " + id + " searchbox cancel request");<NEW_LINE>Preloader.getInstance().cancelSearchBoxPreload(id);<NEW_LINE>} else {<NEW_LINE>if (LOGD_ENABLED)<NEW_LINE>Log.d(LOGTAG, "Got " + id + " preload request for " + url);<NEW_LINE>if (url != null && url.startsWith("http")) {<NEW_LINE>final Bundle pairs = i.getBundleExtra(Browser.EXTRA_HEADERS);<NEW_LINE>if (pairs != null && !pairs.isEmpty()) {<NEW_LINE>Iterator<String> iter = pairs.keySet().iterator();<NEW_LINE>headers = new HashMap<String, String>();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>String key = iter.next();<NEW_LINE>headers.put(key, pairs.getString(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (url != null) {<NEW_LINE>if (LOGD_ENABLED) {<NEW_LINE>Log.d(LOGTAG, "Preload request(" + id + ", " + url + ", " + headers + ", " + sbQuery + ")");<NEW_LINE>}<NEW_LINE>Preloader.getInstance().handlePreloadRequest(id, url, headers, sbQuery);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sbQuery = i.getStringExtra(EXTRA_SEARCHBOX_SETQUERY);
678,527
private void annotateEntries(String prefix, PrintWriter printTo, AnnotatedOutput annotateTo) {<NEW_LINE>finishProcessingIfNecessary();<NEW_LINE>boolean consume = (annotateTo != null);<NEW_LINE>int amt1 = consume ? 6 : 0;<NEW_LINE>int amt2 = consume ? 2 : 0;<NEW_LINE>int size = table.size();<NEW_LINE>String subPrefix = prefix + " ";<NEW_LINE>if (consume) {<NEW_LINE>annotateTo.annotate(0, prefix + "tries:");<NEW_LINE>} else {<NEW_LINE>printTo.println(prefix + "tries:");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>CatchTable.Entry entry = table.get(i);<NEW_LINE>CatchHandlerList handlers = entry.getHandlers();<NEW_LINE>String s1 = subPrefix + "try " + Hex.u2or4(entry.getStart()) + ".." + Hex.u2or4(entry.getEnd());<NEW_LINE>String s2 = handlers.toHuman(subPrefix, "");<NEW_LINE>if (consume) {<NEW_LINE>annotateTo.annotate(amt1, s1);<NEW_LINE>annotateTo.annotate(amt2, s2);<NEW_LINE>} else {<NEW_LINE>printTo.println(s1);<NEW_LINE>printTo.println(s2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!consume) {<NEW_LINE>// Only emit the handler lists if we are consuming bytes.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>annotateTo.<MASK><NEW_LINE>annotateTo.annotate(encodedHandlerHeaderSize, subPrefix + "size: " + Hex.u2(handlerOffsets.size()));<NEW_LINE>int lastOffset = 0;<NEW_LINE>CatchHandlerList lastList = null;<NEW_LINE>for (Map.Entry<CatchHandlerList, Integer> mapping : handlerOffsets.entrySet()) {<NEW_LINE>CatchHandlerList list = mapping.getKey();<NEW_LINE>int offset = mapping.getValue();<NEW_LINE>if (lastList != null) {<NEW_LINE>annotateAndConsumeHandlers(lastList, lastOffset, offset - lastOffset, subPrefix, printTo, annotateTo);<NEW_LINE>}<NEW_LINE>lastList = list;<NEW_LINE>lastOffset = offset;<NEW_LINE>}<NEW_LINE>annotateAndConsumeHandlers(lastList, lastOffset, encodedHandlers.length - lastOffset, subPrefix, printTo, annotateTo);<NEW_LINE>}
annotate(0, prefix + "handlers:");
1,315,403
public static JFreeChart buildBoxPlot(final Number[] numbers, final String dataName) {<NEW_LINE>if (numbers == null || numbers.length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset();<NEW_LINE>final ArrayList<Number> list = new ArrayList<>();<NEW_LINE>list.addAll(Arrays.asList(numbers));<NEW_LINE>final String valuesString = getMessage("ChartsUtils.report.box-plot.values");<NEW_LINE>dataset.add(list, valuesString, "");<NEW_LINE>final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();<NEW_LINE>renderer.setMeanVisible(false);<NEW_LINE>renderer.setFillBox(false);<NEW_LINE>renderer.setMaximumBarWidth(0.5);<NEW_LINE>final CategoryAxis xAxis = new CategoryAxis(dataName);<NEW_LINE>final NumberAxis yAxis = new NumberAxis(getMessage("ChartsUtils.report.box-plot.values-range"));<NEW_LINE>yAxis.setAutoRangeIncludesZero(false);<NEW_LINE>renderer<MASK><NEW_LINE>final CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);<NEW_LINE>plot.setRenderer(renderer);<NEW_LINE>JFreeChart boxPlot = new JFreeChart(getMessage("ChartsUtils.report.box-plot.title"), plot);<NEW_LINE>return boxPlot;<NEW_LINE>}
.setBaseToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
286,352
public void run() {<NEW_LINE>stateLock.acquireReadLock();<NEW_LINE>try {<NEW_LINE>interruptionManager.enterCriticalPath();<NEW_LINE>if (status == STATUS.CLOSED) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final long[] nonActiveSegments = writeAheadLog.nonActiveSegments();<NEW_LINE>if (nonActiveSegments.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long flushTillSegmentId;<NEW_LINE>if (nonActiveSegments.length == 1) {<NEW_LINE>flushTillSegmentId = writeAheadLog.activeSegment();<NEW_LINE>} else {<NEW_LINE>flushTillSegmentId = (nonActiveSegments[0] + nonActiveSegments[nonActiveSegments.length - 1]) / 2;<NEW_LINE>}<NEW_LINE>long minDirtySegment;<NEW_LINE>do {<NEW_LINE>writeCache.flushTillSegment(flushTillSegmentId);<NEW_LINE>// we should take active segment BEFORE min write cache LSN call<NEW_LINE>// to avoid case when new data are changed before call<NEW_LINE>final long activeSegment = writeAheadLog.activeSegment();<NEW_LINE>final <MASK><NEW_LINE>if (minLSNSegment == null) {<NEW_LINE>minDirtySegment = activeSegment;<NEW_LINE>} else {<NEW_LINE>minDirtySegment = minLSNSegment;<NEW_LINE>}<NEW_LINE>} while (minDirtySegment < flushTillSegmentId);<NEW_LINE>atomicOperationsTable.compactTable();<NEW_LINE>final long operationSegment = atomicOperationsTable.getSegmentEarliestNotPersistedOperation();<NEW_LINE>if (operationSegment >= 0 && minDirtySegment > operationSegment) {<NEW_LINE>minDirtySegment = operationSegment;<NEW_LINE>}<NEW_LINE>if (minDirtySegment <= nonActiveSegments[0]) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>writeCache.syncDataFiles(minDirtySegment, lastMetadata);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>OLogManager.instance().error(this, "Error during flushing of data for fuzzy checkpoint, in storage %s", e, name);<NEW_LINE>} finally {<NEW_LINE>stateLock.releaseReadLock();<NEW_LINE>walVacuumInProgress.set(false);<NEW_LINE>interruptionManager.exitCriticalPath();<NEW_LINE>}<NEW_LINE>}
Long minLSNSegment = writeCache.getMinimalNotFlushedSegment();