idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
648,431
private static void populateListPartsRequestParameters(ListPartsRequest listPartsRequest, Map<String, String> params) {<NEW_LINE>params.put(UPLOAD_ID, listPartsRequest.getUploadId());<NEW_LINE>Integer maxParts = listPartsRequest.getMaxParts();<NEW_LINE>if (maxParts != null) {<NEW_LINE>if (!checkParamRange(maxParts, 0, true, LIST_PART_MAX_RETURNS, true)) {<NEW_LINE>throw new IllegalArgumentException(OSS_RESOURCE_MANAGER.getFormattedString("MaxPartsOutOfRange", LIST_PART_MAX_RETURNS));<NEW_LINE>}<NEW_LINE>params.put(<MASK><NEW_LINE>}<NEW_LINE>Integer partNumberMarker = listPartsRequest.getPartNumberMarker();<NEW_LINE>if (partNumberMarker != null) {<NEW_LINE>if (!checkParamRange(partNumberMarker, 0, false, MAX_PART_NUMBER, true)) {<NEW_LINE>throw new IllegalArgumentException(OSS_RESOURCE_MANAGER.getString("PartNumberMarkerOutOfRange"));<NEW_LINE>}<NEW_LINE>params.put(PART_NUMBER_MARKER, partNumberMarker.toString());<NEW_LINE>}<NEW_LINE>if (listPartsRequest.getEncodingType() != null) {<NEW_LINE>params.put(ENCODING_TYPE, listPartsRequest.getEncodingType());<NEW_LINE>}<NEW_LINE>}
MAX_PARTS, maxParts.toString());
502,210
protected boolean syncFiles() throws Exception {<NEW_LINE>Path cacheDir = manifest.resolveCacheDir(getParameters().getNamed());<NEW_LINE>log.info(() -> String.format(Constants.getString("Application.log.Sycnfiles"), cacheDir));<NEW_LINE>phase = Constants.getString("Application.Phase.Syncfile");<NEW_LINE>if (getParameters().getUnnamed().contains("--offline")) {<NEW_LINE>log.info(Constants.getString("Application.log.offline"));<NEW_LINE>// to signal that nothing has changed.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<LibraryFile> needsUpdate = manifest.files.stream().filter(LibraryFile::loadForCurrentPlatform).filter(it -> it.needsUpdate(cacheDir)).collect(Collectors.toList());<NEW_LINE>if (needsUpdate.isEmpty())<NEW_LINE>return false;<NEW_LINE>Long totalBytes = needsUpdate.stream().mapToLong(f -> f.size).sum();<NEW_LINE>Long totalWritten = 0L;<NEW_LINE>for (LibraryFile lib : needsUpdate) {<NEW_LINE>Path target = cacheDir.resolve(lib.file).toAbsolutePath();<NEW_LINE>Files.<MASK><NEW_LINE>URI uri;<NEW_LINE>// We avoid using uri.resolve() here so as to not break UNC paths. See issue<NEW_LINE>// #143<NEW_LINE>String separator = manifest.uri.getPath().endsWith("/") ? "" : "/";<NEW_LINE>uri = URI.create(manifest.uri.toString() + separator + lib.file);<NEW_LINE>try (InputStream input = openDownloadStream(uri);<NEW_LINE>OutputStream output = Files.newOutputStream(target)) {<NEW_LINE>byte[] buf = new byte[65536];<NEW_LINE>int read;<NEW_LINE>while ((read = input.read(buf)) > -1) {<NEW_LINE>output.write(buf, 0, read);<NEW_LINE>totalWritten += read;<NEW_LINE>Double progress = totalWritten.doubleValue() / totalBytes.doubleValue();<NEW_LINE>updateProgress(progress);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
createDirectories(target.getParent());
1,841,491
public static RocksDB createWithColumnFamily(Map conf, String rocksDbDir, final Map<String, ColumnFamilyHandle> columnFamilyHandleMap, int ttlTimeSec) throws IOException {<NEW_LINE>List<ColumnFamilyDescriptor> <MASK><NEW_LINE>List<ColumnFamilyHandle> columnFamilyHandles = new ArrayList<>();<NEW_LINE>DBOptions dbOptions = getDBOptions(conf);<NEW_LINE>try {<NEW_LINE>RocksDB rocksDb = ttlTimeSec > 0 ? TtlDB.open(dbOptions, rocksDbDir, columnFamilyDescriptors, columnFamilyHandles, getTtlValues(ttlTimeSec, columnFamilyDescriptors), false) : RocksDB.open(dbOptions, rocksDbDir, columnFamilyDescriptors, columnFamilyHandles);<NEW_LINE>int n = Math.min(columnFamilyDescriptors.size(), columnFamilyHandles.size());<NEW_LINE>// skip default column<NEW_LINE>columnFamilyHandleMap.put(DEFAULT_COLUMN_FAMILY, rocksDb.getDefaultColumnFamily());<NEW_LINE>for (int i = 1; i < n; i++) {<NEW_LINE>ColumnFamilyDescriptor descriptor = columnFamilyDescriptors.get(i);<NEW_LINE>columnFamilyHandleMap.put(new String(descriptor.columnFamilyName()), columnFamilyHandles.get(i));<NEW_LINE>}<NEW_LINE>LOG.info("Finished loading RocksDB with existing column family={}, dbPath={}, ttlSec={}", columnFamilyHandleMap.keySet(), rocksDbDir, ttlTimeSec);<NEW_LINE>// enable compaction<NEW_LINE>rocksDb.compactRange();<NEW_LINE>return rocksDb;<NEW_LINE>} catch (RocksDBException e) {<NEW_LINE>throw new IOException("Failed to initialize RocksDb.", e);<NEW_LINE>}<NEW_LINE>}
columnFamilyDescriptors = getExistingColumnFamilyDesc(conf, rocksDbDir);
1,587,130
public void execute() {<NEW_LINE>WorkloadResource.MetaData metadata = getWorkloadRef().getMetadata();<NEW_LINE>String appStage = getSpec().getString("appStage");<NEW_LINE>String appUnit = getSpec().getString("appUnit");<NEW_LINE>String site = getSpec().getString("site");<NEW_LINE>String appName = getSpec().getString("appName");<NEW_LINE>String instanceGroup = getSpec().getString("instanceGroup");<NEW_LINE>String namingRegisterState = getSpec().getString("namingRegisterState");<NEW_LINE>assert !StringUtils.isEmpty(appStage);<NEW_LINE>assert !StringUtils.isEmpty(appUnit);<NEW_LINE>assert !StringUtils.isEmpty(site);<NEW_LINE>assert !StringUtils.isEmpty(appName);<NEW_LINE>assert !StringUtils.isEmpty(instanceGroup);<NEW_LINE>assert !StringUtils.isEmpty(namingRegisterState);<NEW_LINE>JSONObject labels = (JSONObject) metadata.getLabels();<NEW_LINE>labels.put("pod.beta1.sigma.ali/naming-register-state", namingRegisterState);<NEW_LINE><MASK><NEW_LINE>labels.put("sigma.ali/site", site);<NEW_LINE>labels.put("sigma.ali/instance-group", instanceGroup);<NEW_LINE>labels.put("sigma.alibaba-inc.com/app-stage", appStage);<NEW_LINE>labels.put("sigma.alibaba-inc.com/app-unit", appUnit);<NEW_LINE>// JSONObject annotations = (JSONObject) metadata.getAnnotations();<NEW_LINE>// annotations.put("pods.sigma.alibaba-inc.com/inject-pod-sn", "true");<NEW_LINE>log.info("skyline trait has applied to workload {}|spec={}", JSONObject.toJSONString(getWorkloadRef().getMetadata()), JSONObject.toJSONString(getSpec()));<NEW_LINE>}
labels.put("sigma.ali/app-name", appName);
572,847
protected Widget createMainWidget() {<NEW_LINE>Styles styles = RESOURCES.styles();<NEW_LINE>VerticalPanel panel = new VerticalPanel();<NEW_LINE>panel.<MASK><NEW_LINE>VerticalPanel namePanel = new VerticalPanel();<NEW_LINE>namePanel.setWidth("100%");<NEW_LINE>// path<NEW_LINE>TextBox txtKeyPath = new TextBox();<NEW_LINE>txtKeyPath.addStyleName(styles.keyPathTextBox());<NEW_LINE>txtKeyPath.setReadOnly(true);<NEW_LINE>txtKeyPath.setText(rsaSshKeyPath_.getPath());<NEW_LINE>txtKeyPath.setWidth("100%");<NEW_LINE>CaptionWithHelp pathCaption = new CaptionWithHelp(constants_.pathCaption(), constants_.pathHelpCaption(), "rsa_key_help", txtKeyPath);<NEW_LINE>pathCaption.setIncludeVersionInfo(false);<NEW_LINE>pathCaption.setWidth("100%");<NEW_LINE>namePanel.add(pathCaption);<NEW_LINE>namePanel.add(txtKeyPath);<NEW_LINE>panel.add(namePanel);<NEW_LINE>HorizontalPanel passphrasePanel = new HorizontalPanel();<NEW_LINE>passphrasePanel.addStyleName(styles.newSection());<NEW_LINE>VerticalPanel passphrasePanel1 = new VerticalPanel();<NEW_LINE>txtPassphrase_ = new PasswordTextBox();<NEW_LINE>txtPassphrase_.addStyleName(styles.passphrase());<NEW_LINE>FormLabel passphraseLabel1 = new FormLabel(constants_.passphraseLabel(), txtPassphrase_);<NEW_LINE>passphraseLabel1.addStyleName(styles.entryLabel());<NEW_LINE>passphrasePanel1.add(passphraseLabel1);<NEW_LINE>passphrasePanel1.add(txtPassphrase_);<NEW_LINE>passphrasePanel.add(passphrasePanel1);<NEW_LINE>VerticalPanel passphrasePanel2 = new VerticalPanel();<NEW_LINE>passphrasePanel2.addStyleName(styles.lastSection());<NEW_LINE>txtConfirmPassphrase_ = new PasswordTextBox();<NEW_LINE>txtConfirmPassphrase_.addStyleName(styles.passphraseConfirm());<NEW_LINE>FormLabel passphraseLabel2 = new FormLabel(constants_.passphraseConfirmLabel(), txtConfirmPassphrase_);<NEW_LINE>passphraseLabel2.addStyleName(styles.entryLabel());<NEW_LINE>passphrasePanel2.add(passphraseLabel2);<NEW_LINE>passphrasePanel2.add(txtConfirmPassphrase_);<NEW_LINE>passphrasePanel.add(passphrasePanel2);<NEW_LINE>panel.add(passphrasePanel);<NEW_LINE>return panel;<NEW_LINE>}
addStyleName(styles.mainWidget());
86,971
final CreateFolderResult executeCreateFolder(CreateFolderRequest createFolderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createFolderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateFolderRequest> request = null;<NEW_LINE>Response<CreateFolderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateFolderRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkDocs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFolder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateFolderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateFolderResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(createFolderRequest));
852,633
public void initialize(@Nonnull ManagingFS managingFS, @Nonnull FileWatcherNotificationSink notificationSink) {<NEW_LINE>myNotificationSink = notificationSink;<NEW_LINE>boolean disabled = isDisabled();<NEW_LINE>myExecutable = getExecutable();<NEW_LINE>if (disabled) {<NEW_LINE>LOG.info("Native file watcher is disabled");<NEW_LINE>} else if (myExecutable == null) {<NEW_LINE>notifyOnFailure(ApplicationBundle.message("watcher.exe.not.found"), null);<NEW_LINE>} else if (myExecutable == PLATFORM_NOT_SUPPORTED) {<NEW_LINE>notifyOnFailure(ApplicationBundle.message("watcher.exe.not.exists"), null);<NEW_LINE>} else if (!myExecutable.canExecute()) {<NEW_LINE>String message = ApplicationBundle.message("watcher.exe.not.exe", myExecutable);<NEW_LINE>notifyOnFailure(message, (notification, event) <MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>startupProcess(false);<NEW_LINE>LOG.info("Native file watcher is operational.");<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn(e.getMessage());<NEW_LINE>notifyOnFailure(ApplicationBundle.message("watcher.failed.to.start"), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
-> ShowFilePathAction.openFile(myExecutable));
1,003,418
private List<Torrent> makeStatsRequest(Log log) throws DaemonException, LoggedOutException {<NEW_LINE>try {<NEW_LINE>// Initialise the HTTP client<NEW_LINE>initialise();<NEW_LINE>makeLoginRequest(log);<NEW_LINE>// Make request<NEW_LINE>HttpGet httpget = new <MASK><NEW_LINE>HttpResponse response = httpclient.execute(httpget);<NEW_LINE>// Read XML response<NEW_LINE>InputStream instream = response.getEntity().getContent();<NEW_LINE>List<Torrent> torrents = StatsParser.parse(new InputStreamReader(instream), settings.getDownloadDir(), settings.getOS().getPathSeperator());<NEW_LINE>instream.close();<NEW_LINE>return torrents;<NEW_LINE>} catch (LoggedOutException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (DaemonException e) {<NEW_LINE>log.d(LOG_NAME, "Parsing error: " + e.toString());<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.d(LOG_NAME, "Error: " + e.toString());<NEW_LINE>throw new DaemonException(ExceptionType.ConnectionError, e.toString());<NEW_LINE>}<NEW_LINE>}
HttpGet(buildWebUIUrl() + RPC_URL_STATS);
283,429
public void renderResource(String templateName, Map<String, Object> model, Writer writer) {<NEW_LINE>String language = (String) model.get(PippoConstants.REQUEST_PARAMETER_LANG);<NEW_LINE>if (StringUtils.isNullOrEmpty(language)) {<NEW_LINE>language = getLanguageOrDefault(language);<NEW_LINE>}<NEW_LINE>// prepare the locale<NEW_LINE>Locale locale = (Locale) model.get(PippoConstants.REQUEST_PARAMETER_LOCALE);<NEW_LINE>if (locale == null) {<NEW_LINE>locale = getLocaleOrDefault(language);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Mustache template = null;<NEW_LINE>localeSupport.setCurrentLocale(locale);<NEW_LINE>templateName = StringUtils.removeEnd(templateName, "." + getFileExtension());<NEW_LINE>if (locale != null) {<NEW_LINE>// try the complete Locale<NEW_LINE>template = getMustacheEngine().getMustache(getLocalizedTemplateName(templateName, locale.toString()));<NEW_LINE>if (template == null) {<NEW_LINE>// try only the language<NEW_LINE>template = getMustacheEngine().getMustache(getLocalizedTemplateName(templateName<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (template == null) {<NEW_LINE>// fallback to the template without any language or locale<NEW_LINE>template = getMustacheEngine().getMustache(templateName);<NEW_LINE>}<NEW_LINE>if (template == null) {<NEW_LINE>throw new PippoRuntimeException("Template '{}' not found!", templateName);<NEW_LINE>}<NEW_LINE>template.render(writer, model);<NEW_LINE>writer.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e instanceof PippoRuntimeException) {<NEW_LINE>throw (PippoRuntimeException) e;<NEW_LINE>}<NEW_LINE>throw new PippoRuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>localeSupport.remove();<NEW_LINE>}<NEW_LINE>}
, locale.getLanguage()));
386,215
private void handleShowTableId() throws AnalysisException {<NEW_LINE>ShowTableIdStmt showStmt = (ShowTableIdStmt) stmt;<NEW_LINE>long tableId = showStmt.getTableId();<NEW_LINE>List<List<String><MASK><NEW_LINE>Env env = ctx.getEnv();<NEW_LINE>List<Long> dbIds = env.getInternalCatalog().getDbIds();<NEW_LINE>// TODO should use inverted index<NEW_LINE>for (long dbId : dbIds) {<NEW_LINE>Database database = env.getInternalCatalog().getDbNullable(dbId);<NEW_LINE>if (database == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TableIf table = database.getTableNullable(tableId);<NEW_LINE>if (table != null) {<NEW_LINE>List<String> row = new ArrayList<>();<NEW_LINE>row.add(database.getFullName());<NEW_LINE>row.add(table.getName());<NEW_LINE>row.add(String.valueOf(database.getId()));<NEW_LINE>rows.add(row);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resultSet = new ShowResultSet(showStmt.getMetaData(), rows);<NEW_LINE>}
> rows = Lists.newArrayList();
752,331
public static int createTopicIfNotExists(String topic, short replicationFactor, double partitionToBrokerRatio, int minPartitionNum, Properties topicConfig, AdminClient adminClient) throws ExecutionException, InterruptedException {<NEW_LINE>try {<NEW_LINE>if (adminClient.listTopics().names().get().contains(topic)) {<NEW_LINE>LOG.info("AdminClient indicates that topic {} already exists in the cluster. Topic config: {}", topic, topicConfig);<NEW_LINE>return getPartitionNumForTopic(adminClient, topic);<NEW_LINE>}<NEW_LINE>int brokerCount = Utils.getBrokerCount(adminClient);<NEW_LINE>int partitionCount = Math.max((int) Math.ceil(brokerCount * partitionToBrokerRatio), minPartitionNum);<NEW_LINE>try {<NEW_LINE>NewTopic newTopic = new <MASK><NEW_LINE>// noinspection rawtypes<NEW_LINE>newTopic.configs((Map) topicConfig);<NEW_LINE>List<NewTopic> topics = new ArrayList<>();<NEW_LINE>topics.add(newTopic);<NEW_LINE>CreateTopicsResult result = adminClient.createTopics(topics);<NEW_LINE>// waits for this topic creation future to complete, and then returns its result.<NEW_LINE>result.values().get(topic).get();<NEW_LINE>LOG.info("CreateTopicsResult: {}.", result.values());<NEW_LINE>} catch (TopicExistsException e) {
NewTopic(topic, partitionCount, replicationFactor);
866,579
public void dontSymlinkDirectoriesInExecroot(Sequence<?> paths, StarlarkThread thread) throws EvalException {<NEW_LINE>List<String> pathsList = Sequence.cast(paths, String.class, "paths");<NEW_LINE>Set<String> set = Sets.newHashSet();<NEW_LINE>for (String path : pathsList) {<NEW_LINE>PathFragment pathFragment = PathFragment.create(path);<NEW_LINE>if (pathFragment.isEmpty()) {<NEW_LINE>throw Starlark.errorf("Empty path can not be passed to toplevel_output_directories.");<NEW_LINE>}<NEW_LINE>if (pathFragment.containsUplevelReferences() || pathFragment.isMultiSegment()) {<NEW_LINE>throw Starlark.errorf("toplevel_output_directories can only accept top level directories under" + " workspace, \"%s\" can not be specified as an attribute.", path);<NEW_LINE>}<NEW_LINE>if (pathFragment.isAbsolute()) {<NEW_LINE>throw Starlark.errorf("toplevel_output_directories can only accept top level directories under" + " workspace, absolute path \"%s\" can not be specified as an attribute.", path);<NEW_LINE>}<NEW_LINE>if (!set.add(pathFragment.getBaseName())) {<NEW_LINE>throw Starlark.errorf("toplevel_output_directories should not contain duplicate values: \"%s\" is" + " specified more then once.", path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
doNotSymlinkInExecrootPaths = ImmutableSortedSet.copyOf(set);
1,114,132
protected long createBlob(int i, InputStream inputStream, @NonNegative long length) throws SQLException {<NEW_LINE>LargeObjectManager lom = connection.getLargeObjectAPI();<NEW_LINE>long oid = lom.createLO();<NEW_LINE>LargeObject <MASK><NEW_LINE>OutputStream outputStream = lob.getOutputStream();<NEW_LINE>byte[] buf = new byte[4096];<NEW_LINE>try {<NEW_LINE>long remaining;<NEW_LINE>if (length > 0) {<NEW_LINE>remaining = length;<NEW_LINE>} else {<NEW_LINE>remaining = Long.MAX_VALUE;<NEW_LINE>}<NEW_LINE>int numRead = inputStream.read(buf, 0, (length > 0 && remaining < buf.length ? (int) remaining : buf.length));<NEW_LINE>while (numRead != -1 && remaining > 0) {<NEW_LINE>remaining -= numRead;<NEW_LINE>outputStream.write(buf, 0, numRead);<NEW_LINE>numRead = inputStream.read(buf, 0, (length > 0 && remaining < buf.length ? (int) remaining : buf.length));<NEW_LINE>}<NEW_LINE>} catch (IOException se) {<NEW_LINE>throw new PSQLException(GT.tr("Unexpected error writing large object to database."), PSQLState.UNEXPECTED_ERROR, se);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return oid;<NEW_LINE>}
lob = lom.open(oid);
517,060
public MultiValueMap<String, Connection<?>> findConnectionsToUsers(MultiValueMap<String, String> providerUsers) {<NEW_LINE>if (providerUsers == null || providerUsers.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Unable to execute find: no providerUsers provided");<NEW_LINE>}<NEW_LINE>StringBuilder providerUsersCriteriaSql = new StringBuilder();<NEW_LINE>MapSqlParameterSource parameters = new MapSqlParameterSource();<NEW_LINE>parameters.addValue("userId", userId);<NEW_LINE>for (Iterator<Entry<String, List<String>>> it = providerUsers.entrySet().iterator(); it.hasNext(); ) {<NEW_LINE>Entry<String, List<String>> entry = it.next();<NEW_LINE>String providerId = entry.getKey();<NEW_LINE>providerUsersCriteriaSql.append("providerId = :providerId_").append(providerId).append(" and providerUserId in (:providerUserIds_").append(providerId).append(")");<NEW_LINE>parameters.addValue("providerId_" + providerId, providerId);<NEW_LINE>parameters.addValue("providerUserIds_" + providerId, entry.getValue());<NEW_LINE>if (it.hasNext()) {<NEW_LINE>providerUsersCriteriaSql.append(" or ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Connection<?>> resultList = new NamedParameterJdbcTemplate(jdbcTemplate).query(selectFromUserConnection() + " where userId = :userId and " + providerUsersCriteriaSql + " order by providerId, `rank`", parameters, connectionMapper);<NEW_LINE>MultiValueMap<String, Connection<?>> connectionsForUsers = new LinkedMultiValueMap<String, Connection<?>>();<NEW_LINE>for (Connection<?> connection : resultList) {<NEW_LINE>String providerId = connection.getKey().getProviderId();<NEW_LINE>List<String> userIds = providerUsers.get(providerId);<NEW_LINE>List<Connection<?>> connections = connectionsForUsers.get(providerId);<NEW_LINE>if (connections == null) {<NEW_LINE>connections = new ArrayList<Connection<?><MASK><NEW_LINE>for (int i = 0; i < userIds.size(); i++) {<NEW_LINE>connections.add(null);<NEW_LINE>}<NEW_LINE>connectionsForUsers.put(providerId, connections);<NEW_LINE>}<NEW_LINE>String providerUserId = connection.getKey().getProviderUserId();<NEW_LINE>int connectionIndex = userIds.indexOf(providerUserId);<NEW_LINE>connections.set(connectionIndex, connection);<NEW_LINE>}<NEW_LINE>return connectionsForUsers;<NEW_LINE>}
>(userIds.size());
1,832,140
private static void assertEvents(RegressionEnvironment env, String symbol, Double oldMedian, Double oldDistMedian, Double oldStdev, Double oldAvedev, Double newMedian, Double newDistMedian, Double newStdev, Double newAvedev) {<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>EventBean[] oldData = listener.getLastOldData();<NEW_LINE>EventBean[] newData = listener.getLastNewData();<NEW_LINE>assertEquals(1, oldData.length);<NEW_LINE>assertEquals(1, newData.length);<NEW_LINE>assertEquals(symbol, oldData[0].get("symbol"));<NEW_LINE>assertEquals("oldData.myMedian wrong", oldMedian, oldData[<MASK><NEW_LINE>assertEquals("oldData.myDistMedian wrong", oldDistMedian, oldData[0].get("myDistMedian"));<NEW_LINE>assertEquals("oldData.myAvedev wrong", oldAvedev, oldData[0].get("myAvedev"));<NEW_LINE>Double oldStdevResult = (Double) oldData[0].get("myStdev");<NEW_LINE>if (oldStdevResult == null) {<NEW_LINE>assertNull(oldStdev);<NEW_LINE>} else {<NEW_LINE>assertEquals("oldData.myStdev wrong", Math.round(oldStdev * 1000), Math.round(oldStdevResult * 1000));<NEW_LINE>}<NEW_LINE>assertEquals(symbol, newData[0].get("symbol"));<NEW_LINE>assertEquals("newData.myMedian wrong", newMedian, newData[0].get("myMedian"));<NEW_LINE>assertEquals("newData.myDistMedian wrong", newDistMedian, newData[0].get("myDistMedian"));<NEW_LINE>assertEquals("newData.myAvedev wrong", newAvedev, newData[0].get("myAvedev"));<NEW_LINE>Double newStdevResult = (Double) newData[0].get("myStdev");<NEW_LINE>if (newStdevResult == null) {<NEW_LINE>assertNull(newStdev);<NEW_LINE>} else {<NEW_LINE>assertEquals("newData.myStdev wrong", Math.round(newStdev * 1000), Math.round(newStdevResult * 1000));<NEW_LINE>}<NEW_LINE>listener.reset();<NEW_LINE>});<NEW_LINE>}
0].get("myMedian"));
1,013,562
protected void recreateBitmaps() {<NEW_LINE>super.recreateBitmaps();<NEW_LINE>float walkCircleH = attrsW<MASK><NEW_LINE>float walkCircleW = attrsW.paint.getStrokeWidth();<NEW_LINE>float walkCircleRadius = attrsW.paint.getStrokeWidth() / 2f;<NEW_LINE>float routeShieldRadius = attrsPT.paint3.getStrokeWidth() / 2f;<NEW_LINE>// create anchor bitmap<NEW_LINE>float density = getDensity();<NEW_LINE>float margin = 2f * density;<NEW_LINE>float width = routeShieldRadius * 2 + margin * 2;<NEW_LINE>float height = routeShieldRadius * 2 + margin * 2;<NEW_LINE>Bitmap bitmap = Bitmap.createBitmap((int) width, (int) height, Bitmap.Config.ARGB_8888);<NEW_LINE>Canvas canvas = new Canvas(bitmap);<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>paint.setStrokeWidth(1f * density);<NEW_LINE>float x = width / 2;<NEW_LINE>float y = height / 2;<NEW_LINE>paint.setColor(Color.WHITE);<NEW_LINE>paint.setStyle(Paint.Style.FILL);<NEW_LINE>canvas.drawCircle(x, y, routeShieldRadius, paint);<NEW_LINE>paint.setColor(Color.BLACK);<NEW_LINE>paint.setStyle(Paint.Style.STROKE);<NEW_LINE>canvas.drawCircle(x, y, routeShieldRadius, paint);<NEW_LINE>anchorBitmap = bitmap;<NEW_LINE>// create walk arrow bitmap<NEW_LINE>width = walkCircleW + margin * 2;<NEW_LINE>height = walkCircleH + margin * 2;<NEW_LINE>bitmap = Bitmap.createBitmap((int) width, (int) height, Bitmap.Config.ARGB_8888);<NEW_LINE>canvas = new Canvas(bitmap);<NEW_LINE>paint = new Paint();<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>paint.setStrokeWidth(1f * density);<NEW_LINE>RectF rect = new RectF(margin, margin, width - margin, height - margin);<NEW_LINE>paint.setColor(attrsW.paint.getColor());<NEW_LINE>paint.setStyle(Paint.Style.FILL);<NEW_LINE>canvas.drawRoundRect(rect, walkCircleRadius, walkCircleRadius, paint);<NEW_LINE>paint.setColor(getStrokeColor(paint.getColor()));<NEW_LINE>paint.setStyle(Paint.Style.STROKE);<NEW_LINE>canvas.drawRoundRect(rect, walkCircleRadius, walkCircleRadius, paint);<NEW_LINE>Bitmap arrowBitmap = getArrowBitmap();<NEW_LINE>paint = new Paint();<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>paint.setColor(Color.WHITE);<NEW_LINE>paint.setStrokeWidth(1f * density);<NEW_LINE>paint.setAlpha(200);<NEW_LINE>canvas.drawBitmap(arrowBitmap, width / 2 - arrowBitmap.getWidth() / 2f, height / 2 - arrowBitmap.getHeight() / 2f, paint);<NEW_LINE>walkArrowBitmap = bitmap;<NEW_LINE>stopBitmapsCache = new HashMap<>();<NEW_LINE>}
.paint.getStrokeWidth() * 1.33f;
976,309
public void doProxyInstall(ClassLoader webapploader, final String appid) {<NEW_LINE>dpInstaller.setTargetClassLoader(webapploader);<NEW_LINE>dpInstaller.defineField("mMap", Map.class, "org.aredis.cache.RedisCommandObject", "new java.util.HashMap()");<NEW_LINE>dpInstaller.installProxy("org.aredis.cache.RedisCommandObject", new String[] { "com.creditease.uav.hook.redis.aredis.interceptors" }, new DynamicProxyProcessor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void process(DPMethod m) throws Exception {<NEW_LINE>if ("sendRequest".equals(m.getName())) {<NEW_LINE>dpInstaller.defineLocalVal(m, "mObj", AredisCommandObjectIT.class);<NEW_LINE>m.insertBefore("{mObj = new AredisCommandObjectIT(\"" + appid + "\");" + "mObj.doAsyncStart(new Object[]{$1, $2, $3, commandInfo});" + "mMap.put(\"mObj\",mObj);}");<NEW_LINE>}<NEW_LINE>if ("receiveResponse".equals(m.getName())) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, false);<NEW_LINE>}
m.insertAfter("{AredisCommandObjectIT mObj = (AredisCommandObjectIT)mMap.get(\"mObj\");" + "mObj.doAsyncEnd(new Object[]{commandInfo});}");
75,737
private void loadingFinished(Runnable continuation) {<NEW_LINE>if (!myLoadingFinished.compareAndSet(false, true))<NEW_LINE>return;<NEW_LINE>myEditor.putUserData(ASYNC_LOADER, null);<NEW_LINE>if (myEditorComponent.isDisposed())<NEW_LINE>return;<NEW_LINE>if (continuation != null) {<NEW_LINE>continuation.run();<NEW_LINE>}<NEW_LINE>myEditorComponent.loadingFinished();<NEW_LINE>if (myDelayedState != null && PsiDocumentManager.getInstance(myProject).isCommitted(myEditor.getDocument())) {<NEW_LINE>TextEditorState state = new TextEditorState();<NEW_LINE>// don't do any scrolling<NEW_LINE>state.RELATIVE_CARET_POSITION = Integer.MAX_VALUE;<NEW_LINE>state.setFoldingState(myDelayedState.getFoldingState());<NEW_LINE>myProvider.setStateImpl(myProject, myEditor, state);<NEW_LINE>myDelayedState = null;<NEW_LINE>}<NEW_LINE>for (Runnable runnable : myDelayedActions) {<NEW_LINE>myEditor<MASK><NEW_LINE>runnable.run();<NEW_LINE>}<NEW_LINE>myEditor.getScrollingModel().enableAnimation();<NEW_LINE>if (FileEditorManager.getInstance(myProject).getSelectedTextEditor() == myEditor) {<NEW_LINE>IdeFocusManager.getInstance(myProject).requestFocusInProject(myTextEditor.getPreferredFocusedComponent(), myProject);<NEW_LINE>}<NEW_LINE>EditorNotifications.getInstance(myProject).updateNotifications(myTextEditor.myFile);<NEW_LINE>}
.getScrollingModel().disableAnimation();
1,043,151
public double distance(NumberVector v1, NumberVector v2) {<NEW_LINE>// Dimensionality, and last valid value in second vector:<NEW_LINE>final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality();<NEW_LINE>final int m2 = dim2 - 1;<NEW_LINE>// bandsize is the maximum allowed distance to the diagonal<NEW_LINE>final int band = effectiveBandSize(dim1, dim2);<NEW_LINE>// unsatisfiable - lengths too different!<NEW_LINE>if (Math.abs(dim1 - dim2) > band) {<NEW_LINE>return Double.POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>// Current and previous columns of the matrix<NEW_LINE>double[] buf = new double[dim2 << 1];<NEW_LINE>Arrays.fill(buf, Double.POSITIVE_INFINITY);<NEW_LINE>// Fill first row:<NEW_LINE>firstRow(buf, band, v1, v2, dim2);<NEW_LINE>// Active buffer offsets (cur = read, nxt = write)<NEW_LINE>int cur = 0, nxt = dim2;<NEW_LINE>// Fill remaining rows:<NEW_LINE>int i = 1, l = 0, r = Math.<MASK><NEW_LINE>while (i < dim1) {<NEW_LINE>final double val1 = derivative(i, v1);<NEW_LINE>for (int j = l; j <= r; j++) {<NEW_LINE>// Value in previous row (must exist, may be infinite):<NEW_LINE>double min = buf[cur + j];<NEW_LINE>// Diagonal:<NEW_LINE>if (j > 0) {<NEW_LINE>final double pij = buf[cur + j - 1];<NEW_LINE>min = (pij < min) ? pij : min;<NEW_LINE>// Previous in same row:<NEW_LINE>if (j > l) {<NEW_LINE>final double pj = buf[nxt + j - 1];<NEW_LINE>min = (pj < min) ? pj : min;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Write:<NEW_LINE>buf[nxt + j] = min + delta(val1, derivative(j, v2));<NEW_LINE>}<NEW_LINE>// Swap buffer positions:<NEW_LINE>cur = dim2 - cur;<NEW_LINE>nxt = dim2 - nxt;<NEW_LINE>// Update positions:<NEW_LINE>++i;<NEW_LINE>if (i > band) {<NEW_LINE>++l;<NEW_LINE>}<NEW_LINE>if (r < m2) {<NEW_LINE>++r;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: support Euclidean, Manhattan here:<NEW_LINE>return Math.sqrt(buf[cur + dim2 - 1]);<NEW_LINE>}
min(m2, i + band);
955,769
private String addM2OBinding(ActionBuilderLine line, boolean search, boolean filter) {<NEW_LINE>String fname = "setVar" + varCount;<NEW_LINE>varCount += 1;<NEW_LINE>String tModel = getTargetModel(line);<NEW_LINE>String srcModel = getSourceModel(line);<NEW_LINE>StringBuilder stb = new StringBuilder();<NEW_LINE>fbuilder.add(stb);<NEW_LINE>if (tModel.contains(".")) {<NEW_LINE>tModel = tModel.substring(tModel.lastIndexOf('.') + 1);<NEW_LINE>}<NEW_LINE>stb.append(format("", 1));<NEW_LINE>stb.append(format("function " + fname + "($$, $, _$){", 1));<NEW_LINE>stb.append(format("var val = null;", 2));<NEW_LINE>if (srcModel != null) {<NEW_LINE>stb.append(format("if ($ != null && $.id != null){", 2));<NEW_LINE>srcModel = srcModel.substring(srcModel.lastIndexOf('.') + 1);<NEW_LINE>stb.append(format("$ = $em.find(" + srcModel + ".class, $.id);", 3));<NEW_LINE>log.debug("src model: {}, Target model: {}", srcModel, tModel);<NEW_LINE>if (srcModel.contentEquals(tModel)) {<NEW_LINE>stb.append(format("val = $", 3));<NEW_LINE>}<NEW_LINE>stb.append<MASK><NEW_LINE>}<NEW_LINE>if (filter && line.getFilter() != null) {<NEW_LINE>if (line.getValue() != null) {<NEW_LINE>stb.append(format("var map = com.axelor.db.mapper.Mapper.toMap($);", 2));<NEW_LINE>} else {<NEW_LINE>stb.append(format("var map = com.axelor.db.mapper.Mapper.toMap($$);", 2));<NEW_LINE>}<NEW_LINE>stb.append(format("val = " + getQuery(tModel, line.getFilter(), false, false), 2));<NEW_LINE>} else if (srcModel == null) {<NEW_LINE>stb.append(format("val = " + "$", 2));<NEW_LINE>}<NEW_LINE>List<ActionBuilderLine> lines = line.getSubLines();<NEW_LINE>if (lines != null && !lines.isEmpty()) {<NEW_LINE>stb.append(format("if (!val) {", 2));<NEW_LINE>stb.append(format("val = new " + tModel + "();", 3));<NEW_LINE>stb.append(format("}", 2));<NEW_LINE>stb.append(addFieldsBinding("val", lines, 2));<NEW_LINE>// stb.append(format("$em.persist(val);", 2));<NEW_LINE>}<NEW_LINE>stb.append(format("return val;", 2));<NEW_LINE>stb.append(format("}", 1));<NEW_LINE>return fname;<NEW_LINE>}
(format("}", 2));
209,419
@ApiOperation(value = "Create an output")<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid output specification in input.", response = OutputSummary.class) })<NEW_LINE>@AuditEvent(type = AuditEventTypes.MESSAGE_OUTPUT_CREATE)<NEW_LINE>public Response create(@ApiParam(name = "JSON body", required = true) CreateOutputRequest csor) throws ValidationException {<NEW_LINE>checkPermission(RestPermissions.OUTPUTS_CREATE);<NEW_LINE>final AvailableOutputSummary outputSummary = messageOutputFactory.getAvailableOutputs().get(csor.type());<NEW_LINE>if (outputSummary == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Make sure the config values will be stored with the correct type.<NEW_LINE>final CreateOutputRequest createOutputRequest = CreateOutputRequest.create(csor.title(), csor.type(), ConfigurationMapConverter.convertValues(csor.configuration(), outputSummary.requestedConfiguration()), csor.streams());<NEW_LINE>final Output output = outputService.create(createOutputRequest, getCurrentUser().getName());<NEW_LINE>final URI outputUri = getUriBuilderToSelf().path(OutputResource.class).path("{outputId}").build(output.getId());<NEW_LINE>return Response.created(outputUri).entity(OutputSummary.create(output.getId(), output.getTitle(), output.getType(), output.getCreatorUserId(), new DateTime(output.getCreatedAt()), new HashMap<>(output.getConfiguration()), output.getContentPack())).build();<NEW_LINE>}
throw new ValidationException("type", "Invalid output type");
1,756,976
public Event readImageAsync(CommandQueue queue, ByteBuffer dest, long[] origin, long[] region, long rowPitch, long slicePitch) {<NEW_LINE>if (origin.length != 3 || region.length != 3) {<NEW_LINE>throw new IllegalArgumentException("origin and region must both be arrays of length 3");<NEW_LINE>}<NEW_LINE>Utils.pointerBuffers[0].rewind();<NEW_LINE>Utils.pointerBuffers[1].rewind();<NEW_LINE>Utils.<MASK><NEW_LINE>Utils.pointerBuffers[1].put(origin).position(0);<NEW_LINE>Utils.pointerBuffers[2].put(region).position(0);<NEW_LINE>CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue();<NEW_LINE>int ret = CL10.clEnqueueReadImage(q, image, CL10.CL_FALSE, Utils.pointerBuffers[1], Utils.pointerBuffers[2], rowPitch, slicePitch, dest, null, Utils.pointerBuffers[0]);<NEW_LINE>Utils.checkError(ret, "clEnqueueReadImage");<NEW_LINE>long event = Utils.pointerBuffers[0].get(0);<NEW_LINE>return new LwjglEvent(q.getCLEvent(event));<NEW_LINE>}
pointerBuffers[2].rewind();
1,323,718
final GetUpgradeStatusResult executeGetUpgradeStatus(GetUpgradeStatusRequest getUpgradeStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUpgradeStatusRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUpgradeStatusRequest> request = null;<NEW_LINE>Response<GetUpgradeStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUpgradeStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUpgradeStatusRequest));<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, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUpgradeStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUpgradeStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUpgradeStatusResultJsonUnmarshaller());<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,008,786
public Certificates decode(String data) throws DscListDecodeException {<NEW_LINE>try {<NEW_LINE>PublicKey publicKey = getPublicKeyFromString(distributionServiceConfig.getDigitalGreenCertificate().getDscClient().getPublicKey());<NEW_LINE>String signature = data.substring(0, data.indexOf<MASK><NEW_LINE>String content = data.substring(signature.length()).trim();<NEW_LINE>byte[] ecdsaSignature = getEcdsaEncodeFromSignature(base64decode(signature));<NEW_LINE>ecdsaSignatureVerification(ecdsaSignature, publicKey, content.getBytes(StandardCharsets.UTF_8));<NEW_LINE>logger.info(AUDIT, "DSC list - {}", content);<NEW_LINE>Certificates certificates = SerializationUtils.deserializeJson(content, typeFactory -> typeFactory.constructType(Certificates.class));<NEW_LINE>return filterValidCertificates(certificates);<NEW_LINE>} catch (SignatureException e) {<NEW_LINE>throw new DscListDecodeException("Signature verification failed! DSC list NOT decoded.", e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DscListDecodeException("DSC list NOT decoded.", e);<NEW_LINE>}<NEW_LINE>}
(CONTENT_STARTS_CHAR)).trim();
1,152,762
private static void collectInstructionsRecursively(VirtualFile directory, final IncrementalCompilerInstructionCreatorBase creator, @Nullable final PackagingFileFilter filter, final ProjectFileIndex index, final boolean copyExcluded) {<NEW_LINE>final FileTypeManager fileTypeManager = FileTypeManager.getInstance();<NEW_LINE>VfsUtilCore.visitChildrenRecursively(directory, new VirtualFileVisitor<IncrementalCompilerInstructionCreatorBase>(VirtualFileVisitor.SKIP_ROOT) {<NEW_LINE><NEW_LINE>{<NEW_LINE>setValueForChildren(creator);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visitFile(@Nonnull VirtualFile child) {<NEW_LINE>if (copyExcluded) {<NEW_LINE>if (fileTypeManager.isFileIgnored(child))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>if (index.isExcluded(child))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final IncrementalCompilerInstructionCreatorBase creator = getCurrentValue();<NEW_LINE>if (filter != null && !filter.accept(child, creator.myContext.getCompileContext())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!child.isDirectory()) {<NEW_LINE>creator.addFileCopyInstruction(child, child.getName());<NEW_LINE>} else {<NEW_LINE>setValueForChildren(creator.subFolder<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(child.getName()));
1,442,175
void parse(String html, int currentSearchOffset) {<NEW_LINE>searchFinished = true;<NEW_LINE>items.clear();<NEW_LINE>html = new String(html.getBytes(), StandardCharsets.UTF_8);<NEW_LINE>// NOI18N<NEW_LINE>Pattern // NOI18N<NEW_LINE>p = // NOI18N<NEW_LINE>Pattern.// NOI18N<NEW_LINE>compile("<a\\s+href\\s*=\\s*\"(.*?)\"[^>]*>(.*?)</a>", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);<NEW_LINE>Matcher m = p.matcher(html);<NEW_LINE>while (m.find()) {<NEW_LINE>String url = m.group(1);<NEW_LINE>String <MASK><NEW_LINE>if (url.startsWith("/")) {<NEW_LINE>// NOI18N<NEW_LINE>// look for previous/next links<NEW_LINE>int searchOffset = findSearchOffset(url);<NEW_LINE>if (searchOffset > currentSearchOffset)<NEW_LINE>searchFinished = false;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (url.contains("google.com")) {<NEW_LINE>// NOI18N<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>title = "<html>" + title;<NEW_LINE>Item si = new Item(url, title, null);<NEW_LINE>items.add(si);<NEW_LINE>}<NEW_LINE>}
title = m.group(2);
1,618,989
public void stateChanged(ChangeEvent e) {<NEW_LINE>JViewport viewport = (JViewport) e.getSource();<NEW_LINE>int tabPlacement = tabPane.getTabPlacement();<NEW_LINE>int tabCount = tabPane.getTabCount();<NEW_LINE>Rectangle vpRect = viewport.getBounds();<NEW_LINE><MASK><NEW_LINE>Rectangle viewRect = viewport.getViewRect();<NEW_LINE>leadingTabIndex = getClosestTab(viewRect.x, viewRect.y);<NEW_LINE>// If the tab isn't right aligned, adjust it.<NEW_LINE>if (leadingTabIndex + 1 < tabCount) {<NEW_LINE>switch(tabPlacement) {<NEW_LINE>case TOP:<NEW_LINE>case BOTTOM:<NEW_LINE>if (rects[leadingTabIndex].x < viewRect.x) {<NEW_LINE>leadingTabIndex++;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case LEFT:<NEW_LINE>case RIGHT:<NEW_LINE>if (rects[leadingTabIndex].y < viewRect.y) {<NEW_LINE>leadingTabIndex++;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Insets contentInsets = getContentBorderInsets(tabPlacement);<NEW_LINE>switch(tabPlacement) {<NEW_LINE>case LEFT:<NEW_LINE>tabPane.repaint(vpRect.x + vpRect.width, vpRect.y, contentInsets.left, vpRect.height);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.y > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.height - viewRect.y > viewRect.height);<NEW_LINE>break;<NEW_LINE>case RIGHT:<NEW_LINE>tabPane.repaint(vpRect.x - contentInsets.right, vpRect.y, contentInsets.right, vpRect.height);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.y > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.height - viewRect.y > viewRect.height);<NEW_LINE>break;<NEW_LINE>case BOTTOM:<NEW_LINE>tabPane.repaint(vpRect.x, vpRect.y - contentInsets.bottom, vpRect.width, contentInsets.bottom);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.x > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.width - viewRect.x > viewRect.width);<NEW_LINE>break;<NEW_LINE>case TOP:<NEW_LINE>default:<NEW_LINE>tabPane.repaint(vpRect.x, vpRect.y + vpRect.height, vpRect.width, contentInsets.top);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.x > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.width - viewRect.x > viewRect.width);<NEW_LINE>}<NEW_LINE>}
Dimension viewSize = viewport.getViewSize();
1,549,729
public void writeNode(java.io.Writer out, String nodeName, String indent) throws java.io.IOException {<NEW_LINE>out.write(indent);<NEW_LINE>out.write("<");<NEW_LINE>out.write(nodeName);<NEW_LINE>// id is an attribute<NEW_LINE>if (_Id != null) {<NEW_LINE>// NOI18N<NEW_LINE>out.write(" id");<NEW_LINE>// NOI18N<NEW_LINE>out.write("='");<NEW_LINE>com.sun.enterprise.admin.monitor.stats.lb.LoadBalancerStats.writeXML(out, _Id, true);<NEW_LINE>// NOI18N<NEW_LINE>out.write("'");<NEW_LINE>}<NEW_LINE>out.write(">\n");<NEW_LINE>String nextIndent = indent + " ";<NEW_LINE>for (java.util.Iterator it = _InstanceStats.iterator(); it.hasNext(); ) {<NEW_LINE>com.sun.enterprise.admin.monitor.stats.lb.InstanceStats element = (com.sun.enterprise.admin.monitor.stats.lb<MASK><NEW_LINE>if (element != null) {<NEW_LINE>element.writeNode(out, "instance-stats", nextIndent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(indent);<NEW_LINE>out.write("</" + nodeName + ">\n");<NEW_LINE>}
.InstanceStats) it.next();
157,196
private String makeKeyConstractorComment(List<ColumnDefinition> columnDefinitions) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append(" /**\n");<NEW_LINE>builder.append(" * Constructor\n");<NEW_LINE>Collection<ColumnDefinition> primaryKeys = getPrimaryKeys(columnDefinitions);<NEW_LINE>for (ColumnDefinition columnDefinition : primaryKeys) {<NEW_LINE>String feildName = nameConvertor.colmnNameToFeildName(columnDefinition.getColumn_name());<NEW_LINE>builder.append(" * @param " + feildName + <MASK><NEW_LINE>// builder.append(" ");<NEW_LINE>// builder.append(columnDefinition.getType_name());<NEW_LINE>// builder.append("[");<NEW_LINE>// builder.append(columnDefinition.getColumn_size());<NEW_LINE>// builder.append("]");<NEW_LINE>builder.append("\n");<NEW_LINE>}<NEW_LINE>builder.append(" */\n");<NEW_LINE>return builder.toString();<NEW_LINE>}
" " + columnDefinition.getRemarks());
1,811,896
public static TypeSpecDataHolder generateDelegates(SpecModel specModel, Map<Class<? extends Annotation>, DelegateMethodDescription> delegateMethodsMap, EnumSet<RunMode> runMode) {<NEW_LINE>TypeSpecDataHolder.Builder typeSpecDataHolder = TypeSpecDataHolder.newBuilder();<NEW_LINE>boolean hasAttachDetachCallback = false;<NEW_LINE>for (SpecMethodModel<DelegateMethod, Void> delegateMethodModel : specModel.getDelegateMethods()) {<NEW_LINE>for (Annotation annotation : delegateMethodModel.annotations) {<NEW_LINE>final Class<? extends Annotation> annotationType = annotation.annotationType();<NEW_LINE>if (annotationType.equals(OnAttached.class) || annotationType.equals(OnDetached.class)) {<NEW_LINE>hasAttachDetachCallback = true;<NEW_LINE>}<NEW_LINE>if (delegateMethodsMap.containsKey(annotation.annotationType())) {<NEW_LINE>final DelegateMethodDescription delegateMethodDescription = delegateMethodsMap.get(annotation.annotationType());<NEW_LINE>typeSpecDataHolder.addMethod(generateDelegate(specModel<MASK><NEW_LINE>for (MethodSpec methodSpec : delegateMethodDescription.extraMethods) {<NEW_LINE>typeSpecDataHolder.addMethod(methodSpec);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasAttachDetachCallback) {<NEW_LINE>typeSpecDataHolder.addMethod(generateHasAttachDetachCallback());<NEW_LINE>}<NEW_LINE>return typeSpecDataHolder.build();<NEW_LINE>}
, delegateMethodDescription, delegateMethodModel, runMode));
429,886
public AutoCompleteResult extractResult(@Nonnull SearchResponse searchResponse, @Nonnull String input) {<NEW_LINE>Set<String> results = new LinkedHashSet<>();<NEW_LINE>Set<AutoCompleteEntity> entityResults = new HashSet<>();<NEW_LINE>for (SearchHit hit : searchResponse.getHits()) {<NEW_LINE>Optional<String> matchedFieldValue = hit.getHighlightFields().entrySet().stream().findFirst().map(entry -> entry.getValue().getFragments()<MASK><NEW_LINE>Optional<String> matchedUrn = Optional.ofNullable((String) hit.getSourceAsMap().get("urn"));<NEW_LINE>try {<NEW_LINE>if (matchedUrn.isPresent()) {<NEW_LINE>entityResults.add(new AutoCompleteEntity().setUrn(Urn.createFromString(matchedUrn.get())));<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new RuntimeException(String.format("Failed to create urn %s", matchedUrn.get()), e);<NEW_LINE>}<NEW_LINE>if (matchedFieldValue.isPresent()) {<NEW_LINE>results.add(matchedFieldValue.get());<NEW_LINE>} else {<NEW_LINE>log.info("No highlighted field for query {}, hit {}", input, hit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new AutoCompleteResult().setQuery(input).setSuggestions(new StringArray(results)).setEntities(new AutoCompleteEntityArray(entityResults));<NEW_LINE>}
[0].string());
995,006
public void widgetSelected(SelectionEvent e) {<NEW_LINE>ColorDialog colorDialog = new ColorDialog(table.getShell());<NEW_LINE>Button self = ((Button) e.widget);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>RGBa theColor = (RGBa) self.getData("color");<NEW_LINE>if (theColor == null) {<NEW_LINE>theColor = color;<NEW_LINE>}<NEW_LINE>colorDialog.setRGB(theColor.toRGB());<NEW_LINE>RGB newRGB = colorDialog.open();<NEW_LINE>if (newRGB == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ThemeRule token = <MASK><NEW_LINE>RGBa newColor = new RGBa(newRGB);<NEW_LINE>if (index == 1) {<NEW_LINE>getTheme().updateRule(table.indexOf(tableItem), token.updateFG(newColor));<NEW_LINE>} else {<NEW_LINE>getTheme().updateRule(table.indexOf(tableItem), token.updateBG(newColor));<NEW_LINE>}<NEW_LINE>// Update the image for this button!<NEW_LINE>self.setImage(createColorImage(table, newColor));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>self.setData("color", newColor);<NEW_LINE>tableViewer.refresh();<NEW_LINE>}
(ThemeRule) tableItem.getData();
984,344
/*<NEW_LINE>* No need to process SwitchKey TODO test and reason<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public DavaFlowSet processASTSwitchNode(ASTSwitchNode node, DavaFlowSet input) {<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Processing switch node");<NEW_LINE>}<NEW_LINE>if (!isReachable(input)) {<NEW_LINE>// this sequence is not reachable hence simply return inset<NEW_LINE>return input;<NEW_LINE>}<NEW_LINE>// if reachable<NEW_LINE>List<Object<MASK><NEW_LINE>Map<Object, List<Object>> index2BodyList = node.getIndex2BodyList();<NEW_LINE>DavaFlowSet initialIn = cloneFlowSet(input);<NEW_LINE>DavaFlowSet out = null;<NEW_LINE>DavaFlowSet defaultOut = null;<NEW_LINE>List<DavaFlowSet> toMergeBreaks = new ArrayList<DavaFlowSet>();<NEW_LINE>Iterator<Object> it = indexList.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>// going through all the cases of the switch statement<NEW_LINE>Object currentIndex = it.next();<NEW_LINE>List body = index2BodyList.get(currentIndex);<NEW_LINE>if (body == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// although the input is usually the merge of the out of previous<NEW_LINE>// but since we know this case is always reachable as switch is reachable<NEW_LINE>// there is no need to merge<NEW_LINE>out = process(body, cloneFlowSet(initialIn));<NEW_LINE>toMergeBreaks.add(cloneFlowSet(out));<NEW_LINE>if (currentIndex instanceof String) {<NEW_LINE>// this is the default<NEW_LINE>defaultOut = out;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// have to handle the case when no case matches. The input is the output<NEW_LINE>DavaFlowSet output = initialIn;<NEW_LINE>if (out != null) {<NEW_LINE>// just to make sure that there were some cases present<NEW_LINE>if (defaultOut != null) {<NEW_LINE>output = merge(defaultOut, out);<NEW_LINE>} else {<NEW_LINE>output = merge(initialIn, out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// handle break<NEW_LINE>String label = getLabel(node);<NEW_LINE>// have to handleBreaks for all the different cases<NEW_LINE>List<DavaFlowSet> outList = new ArrayList<DavaFlowSet>();<NEW_LINE>// handling breakLists of each of the toMergeBreaks<NEW_LINE>for (DavaFlowSet tmb : toMergeBreaks) {<NEW_LINE>outList.add(handleBreak(label, tmb, node));<NEW_LINE>}<NEW_LINE>// merge all outList elements. since these are the outputs with breaks handled<NEW_LINE>DavaFlowSet finalOut = output;<NEW_LINE>for (DavaFlowSet fo : outList) {<NEW_LINE>finalOut = merge(finalOut, fo);<NEW_LINE>}<NEW_LINE>return finalOut;<NEW_LINE>}
> indexList = node.getIndexList();
1,474,217
public Result render(Context ctx, Throwable cause, StatusCode code) {<NEW_LINE>try {<NEW_LINE>List<Frame> frames = Frame.toFrames(locator, cause);<NEW_LINE>if (frames.isEmpty()) {<NEW_LINE>return Result.skip();<NEW_LINE>}<NEW_LINE>StringWriter stacktrace = new StringWriter();<NEW_LINE>cause.printStackTrace(new PrintWriter(stacktrace));<NEW_LINE>Map<String, Object> model = new HashMap<>();<NEW_LINE>String cpath = ctx.getContextPath();<NEW_LINE>if (cpath.equals("/")) {<NEW_LINE>cpath = "";<NEW_LINE>}<NEW_LINE>model.put("stylesheet", cpath + "/whoops/css/whoops.base.css");<NEW_LINE>model.put("prettify", cpath + "/whoops/js/prettify.min.js");<NEW_LINE>model.put("clipboard", cpath + "/whoops/js/clipboard.min.js");<NEW_LINE>model.put("zepto", cpath + "/whoops/js/zepto.min.js");<NEW_LINE>model.<MASK><NEW_LINE>model.put("frames", frames);<NEW_LINE>model.put("cause", cause);<NEW_LINE>model.put("causeName", Arrays.asList(cause.getClass().getName().split("\\.")));<NEW_LINE>model.put("stacktrace", stacktrace.toString());<NEW_LINE>model.put("code", code);<NEW_LINE>// environment<NEW_LINE>model.put("env", environment(ctx, code));<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE>engine.getTemplate("layout").evaluate(writer, model);<NEW_LINE>return Result.success(writer.toString());<NEW_LINE>} catch (Exception x) {<NEW_LINE>return Result.failure(x);<NEW_LINE>}<NEW_LINE>}
put("javascript", cpath + "/whoops/js/whoops.base.js");
112,957
protected void render(TileEntityPersonalChest tile, float partialTick, PoseStack matrix, MultiBufferSource renderer, int light, int overlayLight, ProfilerFiller profiler) {<NEW_LINE>matrix.pushPose();<NEW_LINE>if (!tile.isRemoved()) {<NEW_LINE>matrix.<MASK><NEW_LINE>matrix.mulPose(Vector3f.YP.rotationDegrees(-tile.getDirection().toYRot()));<NEW_LINE>matrix.translate(-0.5D, -0.5D, -0.5D);<NEW_LINE>}<NEW_LINE>float lidAngle = 1.0F - tile.getOpenNess(partialTick);<NEW_LINE>lidAngle = 1.0F - lidAngle * lidAngle * lidAngle;<NEW_LINE>VertexConsumer builder = renderer.getBuffer(RenderType.entityCutout(texture));<NEW_LINE>lid.xRot = -(lidAngle * ((float) Math.PI / 2F));<NEW_LINE>lock.xRot = lid.xRot;<NEW_LINE>lid.render(matrix, builder, light, overlayLight);<NEW_LINE>lock.render(matrix, builder, light, overlayLight);<NEW_LINE>bottom.render(matrix, builder, light, overlayLight);<NEW_LINE>matrix.popPose();<NEW_LINE>}
translate(0.5D, 0.5D, 0.5D);
1,100,399
final SetRepositoryPolicyResult executeSetRepositoryPolicy(SetRepositoryPolicyRequest setRepositoryPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setRepositoryPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetRepositoryPolicyRequest> request = null;<NEW_LINE>Response<SetRepositoryPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetRepositoryPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setRepositoryPolicyRequest));<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, "ECR PUBLIC");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetRepositoryPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SetRepositoryPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetRepositoryPolicyResultJsonUnmarshaller());<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());
1,325,855
public void prepare() {<NEW_LINE>LOG.debug("prepare() begin...");<NEW_LINE>// Compatible with the old version, path is a string before<NEW_LINE>String pathInString = this.originConfig.getNecessaryValue(Key.PATH, TxtFileReaderErrorCode.REQUIRED_VALUE);<NEW_LINE>if (StringUtils.isBlank(pathInString)) {<NEW_LINE>throw AddaxException.asAddaxException(TxtFileReaderErrorCode.REQUIRED_VALUE, "the path is required");<NEW_LINE>}<NEW_LINE>List<String> path;<NEW_LINE>if (!pathInString.startsWith("[") && !pathInString.endsWith("]")) {<NEW_LINE>path = new ArrayList<>();<NEW_LINE>path.add(pathInString);<NEW_LINE>} else {<NEW_LINE>path = this.originConfig.getList(<MASK><NEW_LINE>if (null == path || path.isEmpty()) {<NEW_LINE>throw AddaxException.asAddaxException(TxtFileReaderErrorCode.REQUIRED_VALUE, "the path is required");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.sourceFiles = FileHelper.buildSourceTargets(path);<NEW_LINE>List<Configuration> columns = this.originConfig.getListConfiguration(Key.COLUMN);<NEW_LINE>if (null != columns && !columns.isEmpty()) {<NEW_LINE>for (Configuration eachColumnConf : columns) {<NEW_LINE>if (null != eachColumnConf.getString(Key.NAME)) {<NEW_LINE>needReadColumnName = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (needReadColumnName) {<NEW_LINE>convertColumnNameToIndex(this.sourceFiles.get(0));<NEW_LINE>}<NEW_LINE>LOG.info("The number of files to read is: [{}]", this.sourceFiles.size());<NEW_LINE>}
Key.PATH, String.class);
883,233
protected void __constructor__(@NonNull String path, @Format int format) throws IOException {<NEW_LINE>if (path == null) {<NEW_LINE>throw new IllegalArgumentException("path must not be null");<NEW_LINE>}<NEW_LINE>// Create a stream, and cache a mapping from file descriptor to stream.<NEW_LINE>FileOutputStream stream = new FileOutputStream(path);<NEW_LINE>FileDescriptor fd = stream.getFD();<NEW_LINE>fdToStream.put(fd, stream);<NEW_LINE>// Initialize the CloseGuard and last track index, since they are otherwise null and 0.<NEW_LINE>CloseGuard guard = CloseGuard.get();<NEW_LINE>ReflectionHelpers.setField(MediaMuxer.class, realMuxer, "mCloseGuard", guard);<NEW_LINE>ReflectionHelpers.setField(MediaMuxer.class<MASK><NEW_LINE>// Pre-OREO jumps straight to nativeSetup inside the constructor.<NEW_LINE>if (RuntimeEnvironment.getApiLevel() < O) {<NEW_LINE>long nativeObject = nativeSetup(fd, format);<NEW_LINE>ReflectionHelpers.setField(MediaMuxer.class, realMuxer, "mNativeObject", nativeObject);<NEW_LINE>ReflectionHelpers.setField(MediaMuxer.class, realMuxer, "mState", MUXER_STATE_INITIALIZED);<NEW_LINE>guard.open("release");<NEW_LINE>} else {<NEW_LINE>ReflectionHelpers.callInstanceMethod(MediaMuxer.class, realMuxer, "setUpMediaMuxer", ReflectionHelpers.ClassParameter.from(FileDescriptor.class, fd), ReflectionHelpers.ClassParameter.from(int.class, format));<NEW_LINE>}<NEW_LINE>}
, realMuxer, "mLastTrackIndex", -1);
668,877
final public Value BasicValue(Env env) throws ParseException {<NEW_LINE>Token tok = null;<NEW_LINE>Token head = null;<NEW_LINE>Token tail = null;<NEW_LINE>SequencePattern.PatternExpr seqRegex = null;<NEW_LINE>switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {<NEW_LINE>case REGEX:<NEW_LINE>{<NEW_LINE>tok = jj_consume_token(REGEX);<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return new Expressions.RegexValue(/*"REGEX",*/<NEW_LINE>tok.image.substring(1, tok.image.length() - 1));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STR:<NEW_LINE>{<NEW_LINE>tok = jj_consume_token(STR);<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return new Expressions.PrimitiveValue<String>("STRING", parseQuotedString(tok.image));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case NONNEGINT:<NEW_LINE>case INT:<NEW_LINE>{<NEW_LINE>tok = IntegerToken();<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return new Expressions.PrimitiveValue<Number>("INTEGER", parseInteger(tok.image));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case LONGINT:<NEW_LINE>{<NEW_LINE>tok = jj_consume_token(LONGINT);<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return new Expressions.PrimitiveValue<Number>("INTEGER"<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case REAL:<NEW_LINE>{<NEW_LINE>tok = jj_consume_token(REAL);<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return new Expressions.PrimitiveValue<Number>("REAL", Double.valueOf(tok.image));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 25:<NEW_LINE>{<NEW_LINE>head = jj_consume_token(25);<NEW_LINE>seqRegex = SeqRegex(env);<NEW_LINE>tail = jj_consume_token(26);<NEW_LINE>String str = getStringFromTokens(head, tail, true);<NEW_LINE>TokenSequencePattern seqPattern = new TokenSequencePattern(str, seqRegex);<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return new Expressions.PrimitiveValue<TokenSequencePattern>("TOKEN_REGEX", seqPattern);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>jj_la1[7] = jj_gen;<NEW_LINE>jj_consume_token(-1);<NEW_LINE>throw new ParseException();<NEW_LINE>}<NEW_LINE>throw new Error("Missing return statement in function");<NEW_LINE>}
, parseLongInteger(tok.image));
1,701,450
public DeleteDocumentClassifierResult deleteDocumentClassifier(DeleteDocumentClassifierRequest deleteDocumentClassifierRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDocumentClassifierRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDocumentClassifierRequest> request = null;<NEW_LINE>Response<DeleteDocumentClassifierResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDocumentClassifierRequestMarshaller().marshall(deleteDocumentClassifierRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DeleteDocumentClassifierResult, JsonUnmarshallerContext> unmarshaller = new DeleteDocumentClassifierResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DeleteDocumentClassifierResult> responseHandler = new JsonResponseHandler<DeleteDocumentClassifierResult>(unmarshaller);<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,327,808
private static void addClassPathUrls(IProject project, List<URL> paths, Set<IProject> resolvedProjects) {<NEW_LINE>IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();<NEW_LINE>// add project to local cache to prevent adding its classpaths multiple times<NEW_LINE>if (resolvedProjects.contains(project)) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>resolvedProjects.add(project);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (JdtUtils.isJavaProject(project)) {<NEW_LINE>IJavaProject jp = JavaCore.create(project);<NEW_LINE>// configured classpath<NEW_LINE>IClasspathEntry[] classpath = jp.getResolvedClasspath(true);<NEW_LINE>// add class path entries<NEW_LINE>for (int i = 0; i < classpath.length; i++) {<NEW_LINE>IClasspathEntry path = classpath[i];<NEW_LINE>if (path.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {<NEW_LINE>IPath entryPath = path.getPath();<NEW_LINE><MASK><NEW_LINE>if (file.exists()) {<NEW_LINE>paths.add(file.toURI().toURL());<NEW_LINE>} else {<NEW_LINE>// case for project relative links<NEW_LINE>String projectName = entryPath.segment(0);<NEW_LINE>IProject pathProject = root.getProject(projectName);<NEW_LINE>covertPathToUrl(pathProject, paths, entryPath);<NEW_LINE>}<NEW_LINE>} else if (path.getEntryKind() == IClasspathEntry.CPE_SOURCE) {<NEW_LINE>// add source path as well for non java resources<NEW_LINE>IPath sourcePath = path.getPath();<NEW_LINE>covertPathToUrl(project, paths, sourcePath);<NEW_LINE>// add source output locations for different source<NEW_LINE>// folders<NEW_LINE>IPath sourceOutputPath = path.getOutputLocation();<NEW_LINE>covertPathToUrl(project, paths, sourceOutputPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add all depending java projects<NEW_LINE>for (IJavaProject p : JdtUtils.getAllDependingJavaProjects(jp)) {<NEW_LINE>addClassPathUrls(p.getProject(), paths, resolvedProjects);<NEW_LINE>}<NEW_LINE>// get default output directory<NEW_LINE>IPath outputPath = jp.getOutputLocation();<NEW_LINE>covertPathToUrl(project, paths, outputPath);<NEW_LINE>} else {<NEW_LINE>for (IProject p : project.getReferencedProjects()) {<NEW_LINE>addClassPathUrls(p, paths, resolvedProjects);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}
File file = entryPath.toFile();
1,734,440
// end parseFiles<NEW_LINE>public void processResults(ParserQuery parserQuery, int num, PrintWriter pwo) {<NEW_LINE>if (parserQuery.parseSkipped()) {<NEW_LINE>List<? extends HasWord> sentence = parserQuery.originalSentence();<NEW_LINE>if (sentence != null) {<NEW_LINE>numWords -= sentence.size();<NEW_LINE>}<NEW_LINE>numSkipped++;<NEW_LINE>}<NEW_LINE>if (parserQuery.parseNoMemory())<NEW_LINE>numNoMemory++;<NEW_LINE>if (parserQuery.parseUnparsable())<NEW_LINE>numUnparsable++;<NEW_LINE>if (parserQuery.parseFallback())<NEW_LINE>numFallback++;<NEW_LINE>saidMemMessage = saidMemMessage || parserQuery.saidMemMessage();<NEW_LINE>Tree ansTree = parserQuery.getBestParse();<NEW_LINE>if (ansTree == null) {<NEW_LINE>pwo.println("(())");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (pcfgLL != null && parserQuery.getPCFGParser() != null) {<NEW_LINE>pcfgLL.recordScore(parserQuery.getPCFGParser(), pwErr);<NEW_LINE>}<NEW_LINE>if (depLL != null && parserQuery.getDependencyParser() != null) {<NEW_LINE>depLL.recordScore(parserQuery.getDependencyParser(), pwErr);<NEW_LINE>}<NEW_LINE>if (factLL != null && parserQuery.getFactoredParser() != null) {<NEW_LINE>factLL.recordScore(parserQuery.getFactoredParser(), pwErr);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>treePrint.printTree(ansTree, Integer.toString(num), pwo);<NEW_LINE>} catch (RuntimeException re) {<NEW_LINE>pwErr.println("TreePrint.printTree skipped: out of memory (or other error)");<NEW_LINE>re.printStackTrace(pwErr);<NEW_LINE>numNoMemory++;<NEW_LINE>try {<NEW_LINE>treePrint.printTree(null, Integer.toString(num), pwo);<NEW_LINE>} catch (Exception e) {<NEW_LINE>pwErr.println("Sentence skipped: out of memory or error calling TreePrint.");<NEW_LINE>pwo.println("(())");<NEW_LINE>e.printStackTrace(pwErr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// crude addition of k-best tree printing<NEW_LINE>// TODO: interface with the RerankingParserQuery<NEW_LINE>if (op.testOptions.printPCFGkBest > 0 && parserQuery.getPCFGParser() != null && parserQuery.getPCFGParser().hasParse()) {<NEW_LINE>List<ScoredObject<Tree>> trees = parserQuery.getKBestPCFGParses(op.testOptions.printPCFGkBest);<NEW_LINE>treePrint.printTrees(trees, Integer.toString(num), pwo);<NEW_LINE>} else if (op.testOptions.printFactoredKGood > 0 && parserQuery.getFactoredParser() != null && parserQuery.getFactoredParser().hasParse()) {<NEW_LINE>// DZ: debug n best trees<NEW_LINE>List<ScoredObject<Tree>> trees = parserQuery.getKGoodFactoredParses(op.testOptions.printFactoredKGood);<NEW_LINE>treePrint.printTrees(trees, Integer<MASK><NEW_LINE>}<NEW_LINE>}
.toString(num), pwo);
685,220
public void recomputeStatistics(@NonNull final RecomputeStatisticsRequest request) {<NEW_LINE>final <MASK><NEW_LINE>final Set<ProductId> productIds = request.getProductIds();<NEW_LINE>final Map<ProductId, BPartnerProductStats> existingStatsByProductId = getByPartnerAndProducts(bpartnerId, productIds);<NEW_LINE>Map<ProductId, I_C_BPartner_Product_Stats_InOut_Online_v> inoutOnlineRecords = null;<NEW_LINE>if (request.isRecomputeInOutStatistics()) {<NEW_LINE>inoutOnlineRecords = Maps.uniqueIndex(retrieveInOutOnlineStats(bpartnerId, productIds), record -> ProductId.ofRepoId(record.getM_Product_ID()));<NEW_LINE>}<NEW_LINE>Map<ProductId, I_C_BPartner_Product_Stats_Invoice_Online_V> salesInvoiceOnlineRecords = null;<NEW_LINE>if (request.isRecomputeInvoiceStatistics()) {<NEW_LINE>salesInvoiceOnlineRecords = Maps.uniqueIndex(retrieveInvoiceOnlineStats(bpartnerId, productIds, SOTrx.SALES), record -> ProductId.ofRepoId(record.getM_Product_ID()));<NEW_LINE>}<NEW_LINE>final List<BPartnerProductStats> statsToSave = new ArrayList<>();<NEW_LINE>for (final ProductId productId : productIds) {<NEW_LINE>BPartnerProductStats stats = existingStatsByProductId.get(productId);<NEW_LINE>if (stats == null) {<NEW_LINE>stats = BPartnerProductStats.newInstance(bpartnerId, productId);<NEW_LINE>}<NEW_LINE>if (inoutOnlineRecords != null) {<NEW_LINE>updateStatsFromInOutOnlineRecord(stats, inoutOnlineRecords.get(productId));<NEW_LINE>}<NEW_LINE>if (salesInvoiceOnlineRecords != null) {<NEW_LINE>updateStatsFromSalesInvoiceOnlineRecord(stats, salesInvoiceOnlineRecords.get(productId));<NEW_LINE>}<NEW_LINE>statsToSave.add(stats);<NEW_LINE>}<NEW_LINE>saveAll(statsToSave);<NEW_LINE>}
BPartnerId bpartnerId = request.getBpartnerId();
1,624,882
public void onCreate(final Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>addPreferencesFromResource(R.xml.preference_about);<NEW_LINE>final PackageInfo packageInfo = application.packageInfo();<NEW_LINE>final Preference versionPref = findPreference(KEY_ABOUT_VERSION);<NEW_LINE>versionPref.setSummary(WalletApplication.versionLine(packageInfo));<NEW_LINE>versionPref.setOnPreferenceClickListener(preference -> {<NEW_LINE>new ApkHashFragment().show(getFragmentManager(), null);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>Installer <MASK><NEW_LINE>if (installer == null)<NEW_LINE>installer = Installer.F_DROID;<NEW_LINE>final Preference marketPref = findPreference(KEY_ABOUT_MARKET_APP);<NEW_LINE>marketPref.setTitle(getString(R.string.about_market_app_title, installer.displayName));<NEW_LINE>final Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(installer.appStorePageFor(application).toString()));<NEW_LINE>if (packageManager.resolveActivity(marketIntent, 0) != null) {<NEW_LINE>marketPref.setIntent(marketIntent);<NEW_LINE>marketPref.setEnabled(true);<NEW_LINE>}<NEW_LINE>findPreference(KEY_ABOUT_CREDITS_BITCOINJ).setTitle(getString(R.string.about_credits_bitcoinj_title, VersionMessage.BITCOINJ_VERSION));<NEW_LINE>}
installer = Installer.from(application);
545,110
private void playAsFirstEventRecord(NotificationEvent event, String eventKey) {<NEW_LINE>Map<String, Object> statusSet = new LinkedHashMap<String, Object>();<NEW_LINE>statusSet.put(NCConstant.COLUMN_STARTTIME, event.getTime());<NEW_LINE>statusSet.put(NCConstant.COLUMN_STATE, NCConstant.StateFlag.NEWCOME.getStatFlag());<NEW_LINE>statusSet.put(NCConstant.COLUMN_RETRY_COUNT, 1);<NEW_LINE>statusSet.put(NCConstant.COLUMN_LATESTIME, System.currentTimeMillis());<NEW_LINE>// NOTE: the latest record event time, then we can find out all records from first record startTime to this time<NEW_LINE>statusSet.put(NCConstant.COLUMN_LATESTRECORDTIME, event.getTime());<NEW_LINE>// First Time NTFE take priority as the "0" Priority.<NEW_LINE>statusSet.put(NCConstant.COLUMN_PRIORITY, 0);<NEW_LINE>statusSet.put(NCConstant.EVENT_COUNT, 1);<NEW_LINE>String statusStr = JSONHelper.toString(statusSet);<NEW_LINE>event.addArg(NCConstant.NCFirstEvent, "true");<NEW_LINE>event.addArg(NCConstant.NTFKEY, eventKey);<NEW_LINE>event.<MASK><NEW_LINE>addPersistentTask(event);<NEW_LINE>addNotficationTask(event, statusSet);<NEW_LINE>}
addArg(NCConstant.NTFVALUE, statusStr);
1,762,199
private String unsuan(String s) {<NEW_LINE>final String su = baseUrl.replace("http://", "");<NEW_LINE>boolean b = false;<NEW_LINE>for (int i = 0; i < sw.split("|").length; i++) {<NEW_LINE>if (su.indexOf(sw.split("|")[i]) > -1) {<NEW_LINE>b = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!b)<NEW_LINE>return "";<NEW_LINE>final String x = s.substring(s.length() - 1);<NEW_LINE>final String w = "abcdefghijklmnopqrstuvwxyz";<NEW_LINE>int xi = w.indexOf(x) + 1;<NEW_LINE>final String sk = s.substring(s.length() - xi - 12, s.length() - xi - 1);<NEW_LINE>s = s.substring(0, s.length() - xi - 12);<NEW_LINE>String k = sk.substring(0, <MASK><NEW_LINE>String f = sk.substring(sk.length() - 1);<NEW_LINE>for (int i = 0; i < k.length(); i++) {<NEW_LINE>s = s.replace(k.substring(i, i + 1), Integer.toString(i));<NEW_LINE>}<NEW_LINE>String[] ss = s.split(f);<NEW_LINE>s = "";<NEW_LINE>for (int i = 0; i < ss.length; i++) {<NEW_LINE>s += fromCharCode(Integer.parseInt(ss[i]));<NEW_LINE>}<NEW_LINE>return s;<NEW_LINE>}
sk.length() - 1);
543,424
private boolean deleteSelectedAnchor() {<NEW_LINE>PolygonFollower follower = lastSelectedMeshFollower;<NEW_LINE>PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class);<NEW_LINE>if (follower != null) {<NEW_LINE>if (polygonComponent == null || polygonComponent.vertices == null || polygonComponent.vertices.length == 0)<NEW_LINE>return false;<NEW_LINE>if (follower.getOriginalPoints().size() <= 3)<NEW_LINE>return false;<NEW_LINE>polygonBackup <MASK><NEW_LINE>currentCommandPayload = UpdatePolygonComponentCommand.payloadInitialState(follower.getEntity());<NEW_LINE>follower.getOriginalPoints().remove(follower.getSelectedAnchorId());<NEW_LINE>follower.getSelectedAnchorId(follower.getSelectedAnchorId() - 1);<NEW_LINE>Vector2[] points = follower.getOriginalPoints().toArray(new Vector2[0]);<NEW_LINE>polygonComponent.vertices = polygonize(points);<NEW_LINE>if (polygonComponent.vertices == null) {<NEW_LINE>// restore from backup<NEW_LINE>polygonComponent.vertices = polygonBackup.clone();<NEW_LINE>follower.update();<NEW_LINE>}<NEW_LINE>currentCommandPayload = UpdatePolygonComponentCommand.payload(currentCommandPayload, polygonComponent.vertices);<NEW_LINE>Overlap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_UPDATE_MESH_DATA, currentCommandPayload);<NEW_LINE>follower.updateDraw();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
= polygonComponent.vertices.clone();
1,840,490
public static void computeStereoCloud(GrayU8 distortedLeft, GrayU8 distortedRight, Planar<GrayU8> colorLeft, Planar<GrayU8> colorRight, CameraPinholeBrown intrinsicLeft, CameraPinholeBrown intrinsicRight, Se3_F64 leftToRight, int minDisparity, int rangeDisparity) {<NEW_LINE>// drawInliers(origLeft, origRight, intrinsic, inliers);<NEW_LINE>// Rectify and remove lens distortion for stereo processing<NEW_LINE>var rectifiedK = new DMatrixRMaj(3, 3);<NEW_LINE>var rectifiedR = new DMatrixRMaj(3, 3);<NEW_LINE>// rectify a colored image<NEW_LINE>Planar<GrayU8<MASK><NEW_LINE>Planar<GrayU8> rectColorRight = colorLeft.createSameShape();<NEW_LINE>GrayU8 rectMask = new GrayU8(colorLeft.width, colorLeft.height);<NEW_LINE>rectifyImages(colorLeft, colorRight, leftToRight, intrinsicLeft, intrinsicRight, rectColorLeft, rectColorRight, rectMask, rectifiedK, rectifiedR);<NEW_LINE>if (rectifiedK.get(0, 0) < 0)<NEW_LINE>throw new RuntimeException("Egads");<NEW_LINE>System.out.println("Rectified K");<NEW_LINE>rectifiedK.print();<NEW_LINE>System.out.println("Rectified R");<NEW_LINE>rectifiedR.print();<NEW_LINE>GrayU8 rectifiedLeft = distortedLeft.createSameShape();<NEW_LINE>GrayU8 rectifiedRight = distortedRight.createSameShape();<NEW_LINE>ConvertImage.average(rectColorLeft, rectifiedLeft);<NEW_LINE>ConvertImage.average(rectColorRight, rectifiedRight);<NEW_LINE>// compute disparity<NEW_LINE>var config = new ConfigDisparityBMBest5();<NEW_LINE>config.errorType = DisparityError.CENSUS;<NEW_LINE>config.disparityMin = minDisparity;<NEW_LINE>config.disparityRange = rangeDisparity;<NEW_LINE>config.subpixel = true;<NEW_LINE>config.regionRadiusX = config.regionRadiusY = 6;<NEW_LINE>config.validateRtoL = 1;<NEW_LINE>config.texture = 0.2;<NEW_LINE>StereoDisparity<GrayU8, GrayF32> disparityAlg = FactoryStereoDisparity.blockMatchBest5(config, GrayU8.class, GrayF32.class);<NEW_LINE>// process and return the results<NEW_LINE>disparityAlg.process(rectifiedLeft, rectifiedRight);<NEW_LINE>GrayF32 disparity = disparityAlg.getDisparity();<NEW_LINE>RectifyImageOps.applyMask(disparity, rectMask, 0);<NEW_LINE>// show results<NEW_LINE>BufferedImage visualized = VisualizeImageData.disparity(disparity, null, rangeDisparity, 0);<NEW_LINE>BufferedImage outLeft = ConvertBufferedImage.convertTo(rectColorLeft, null, true);<NEW_LINE>BufferedImage outRight = ConvertBufferedImage.convertTo(rectColorRight, null, true);<NEW_LINE>ShowImages.showWindow(new RectifiedPairPanel(true, outLeft, outRight), "Rectification", true);<NEW_LINE>ShowImages.showWindow(visualized, "Disparity", true);<NEW_LINE>showPointCloud(disparity, outLeft, leftToRight, rectifiedK, rectifiedR, minDisparity, rangeDisparity);<NEW_LINE>}
> rectColorLeft = colorLeft.createSameShape();
281,370
public static void vertical(GrayU16 input, GrayI16 output, int radius, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>workspaces = BoofMiscOps.checkDeclare(workspaces, DogArray_I32::new);<NEW_LINE>// CONCURRENT_REMOVE_LINE<NEW_LINE>final DogArray_I32 work = workspaces.grow();<NEW_LINE>final int kernelWidth = radius * 2 + 1;<NEW_LINE>final int backStep = kernelWidth * input.stride;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(radius, output.height-radius, kernelWidth, workspaces, (work, y0,y1)->{<NEW_LINE>final int y0 = radius, y1 = output.height - radius;<NEW_LINE>int[] totals = BoofMiscOps.checkDeclare(work, input.width, false);<NEW_LINE>for (int x = 0; x < input.width; x++) {<NEW_LINE>int indexIn = input.startIndex + (y0 - radius) * input.stride + x;<NEW_LINE>int indexOut = output.startIndex + output.stride * y0 + x;<NEW_LINE>int total = 0;<NEW_LINE>int indexEnd = indexIn + input.stride * kernelWidth;<NEW_LINE>for (; indexIn < indexEnd; indexIn += input.stride) {<NEW_LINE>total += input.data[indexIn] & 0xFFFF;<NEW_LINE>}<NEW_LINE>totals[x] = total;<NEW_LINE>output.data[indexOut] = (short) total;<NEW_LINE>}<NEW_LINE>// change the order it is processed in to reduce cache misses<NEW_LINE>for (int y = y0 + 1; y < y1; y++) {<NEW_LINE>int indexIn = input.startIndex + (y + radius) * input.stride;<NEW_LINE>int indexOut = output<MASK><NEW_LINE>for (int x = 0; x < input.width; x++, indexIn++, indexOut++) {<NEW_LINE>int total = totals[x] - (input.data[indexIn - backStep] & 0xFFFF);<NEW_LINE>totals[x] = total += input.data[indexIn] & 0xFFFF;<NEW_LINE>output.data[indexOut] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}
.startIndex + y * output.stride;
1,737,938
private static void generateNumberToCharMap() {<NEW_LINE>numberToCharMap = new Character[10][5];<NEW_LINE>numberToCharMap[0] = new Character[] { '\0' };<NEW_LINE>numberToCharMap[1] = new Character[] { '\0' };<NEW_LINE>numberToCharMap[2] = new Character[] { 'a', 'b', 'c' };<NEW_LINE>numberToCharMap[3] = new Character[] { 'd', 'e', 'f' };<NEW_LINE>numberToCharMap[4] = new Character[<MASK><NEW_LINE>numberToCharMap[5] = new Character[] { 'j', 'k', 'l' };<NEW_LINE>numberToCharMap[6] = new Character[] { 'm', 'n', 'o' };<NEW_LINE>numberToCharMap[7] = new Character[] { 'p', 'q', 'r', 's' };<NEW_LINE>numberToCharMap[8] = new Character[] { 't', 'u', 'v' };<NEW_LINE>numberToCharMap[9] = new Character[] { 'w', 'x', 'y', 'z' };<NEW_LINE>}
] { 'g', 'h', 'i' };
706,605
@Timed<NEW_LINE>@ApiOperation(value = "Delete a stream rule")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 404, message = "Stream rule not found."), @ApiResponse(code = 400, message = "Invalid ObjectId.") })<NEW_LINE>@AuditEvent(type = AuditEventTypes.STREAM_RULE_DELETE)<NEW_LINE>public void delete(@ApiParam(name = "streamid", value = "The stream id this new rule belongs to.", required = true) @PathParam("streamid") String streamid, @ApiParam(name = "streamRuleId", required = true) @PathParam("streamRuleId") @NotEmpty String streamRuleId) throws NotFoundException {<NEW_LINE><MASK><NEW_LINE>checkNotEditable(streamid, "Cannot delete stream rule on non-editable streams.");<NEW_LINE>final StreamRule streamRule = streamRuleService.load(streamRuleId);<NEW_LINE>if (streamRule.getStreamId().equals(streamid)) {<NEW_LINE>streamRuleService.destroy(streamRule);<NEW_LINE>} else {<NEW_LINE>throw new NotFoundException("Couldn't delete stream rule " + streamRuleId + "in stream " + streamid);<NEW_LINE>}<NEW_LINE>}
checkPermission(RestPermissions.STREAMS_EDIT, streamid);
1,796,094
private void init(Object[] objs) {<NEW_LINE>try {<NEW_LINE>m_endpoint = objs[0].toString() + "?scroll=1m";<NEW_LINE>String entity = "";<NEW_LINE>if (objs.length == 2) {<NEW_LINE>entity = objs[1].toString();<NEW_LINE>} else {<NEW_LINE>entity = "{ \"size\": 500," + " \"query\": { \"match_all\": {}}}";<NEW_LINE>}<NEW_LINE>m_method = "GET";<NEW_LINE>m_buffer = new ArrayList<Object[]>();<NEW_LINE>m_entity = new NStringEntity(entity, ContentType.APPLICATION_JSON);<NEW_LINE>Request request = new Request(m_method, m_endpoint);<NEW_LINE>request.setEntity(m_entity);<NEW_LINE>Response response = m_restConn.m_restClient.performRequest(request);<NEW_LINE>String v = EntityUtils.toString(response.getEntity());<NEW_LINE>Map<String, Object> map = new HashMap<String, Object>();<NEW_LINE>parseHeaderInfo(v, map);<NEW_LINE>m_nTotal = Integer.parseInt(map.get("total").toString());<NEW_LINE>String scrollId = map.<MASK><NEW_LINE>if (objs.length == 2) {<NEW_LINE>// skip;<NEW_LINE>;<NEW_LINE>} else if (m_restConn.m_version.equals("1.5")) {<NEW_LINE>m_endpoint = "/_search/scroll?scroll=1m";<NEW_LINE>m_entity = new NStringEntity(scrollId, ContentType.APPLICATION_JSON);<NEW_LINE>} else {<NEW_LINE>m_endpoint = "/_search/scroll";<NEW_LINE>m_entity = new NStringEntity("{\n" + " \"scroll\" : \"1m\"," + " \"scroll_id\": \"" + scrollId + "\"" + "}", ContentType.APPLICATION_JSON);<NEW_LINE>}<NEW_LINE>m_current = Integer.parseInt(map.get("ret").toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
get("scroll_id").toString();
497,723
public boolean visit(SwitchCase node) {<NEW_LINE>if (!hasChildrenChanges(node)) {<NEW_LINE>return doVisitUnchangedChildren(node);<NEW_LINE>}<NEW_LINE>// dont allow switching from case to default or back. New statements should be created.<NEW_LINE>if (node.getAST().apiLevel() == JLS12_INTERNAL && node.getAST().isPreviewEnabled()) {<NEW_LINE>int pos = // $NON-NLS-1$<NEW_LINE>node.expressions().size() == 0 ? // $NON-NLS-1$<NEW_LINE>node.getStartPosition() : rewriteNodeList(node, SwitchCase.EXPRESSIONS2_PROPERTY, node.getStartPosition(<MASK><NEW_LINE>if (isChanged(node, SwitchCase.SWITCH_LABELED_RULE_PROPERTY)) {<NEW_LINE>TextEditGroup editGroup = getEditGroup(node, SwitchCase.SWITCH_LABELED_RULE_PROPERTY);<NEW_LINE>try {<NEW_LINE>int tokenEnd, oldToken;<NEW_LINE>String newVal;<NEW_LINE>if (getNewValue(node, SwitchCase.SWITCH_LABELED_RULE_PROPERTY).equals(Boolean.TRUE)) {<NEW_LINE>oldToken = TerminalTokens.TokenNameCOLON;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>newVal = "->";<NEW_LINE>} else {<NEW_LINE>oldToken = TerminalTokens.TokenNameARROW;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>newVal = ":";<NEW_LINE>}<NEW_LINE>pos = getScanner().getTokenStartOffset(oldToken, pos);<NEW_LINE>tokenEnd = getScanner().getTokenEndOffset(oldToken, pos);<NEW_LINE>doTextRemove(pos, tokenEnd - pos, editGroup);<NEW_LINE>doTextInsert(pos, newVal, editGroup);<NEW_LINE>pos = tokenEnd;<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rewriteExpressionOptionalQualifier(node, INTERNAL_SWITCH_EXPRESSION_PROPERTY, node.getStartPosition());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
), Util.EMPTY_STRING, ", ");
1,452,758
public static void main(String[] args) {<NEW_LINE>double[][] wifis = new double[10][];<NEW_LINE>wifis[0] = new double[] { -0.1752, 1.6722 };<NEW_LINE>wifis[1] = new double[] { 0.2784, 3.2999 };<NEW_LINE>wifis[2] = new double[] { 1.8177, 3.2585 };<NEW_LINE>wifis[3] = new double[] { 3.4643, 3.1955 };<NEW_LINE>wifis[4] = new double[] { 3.4026, 5.7257 };<NEW_LINE>wifis[5] = new double[] { 5.9359, 5.6577 };<NEW_LINE>wifis[6] = new double[] { 6.1601, 8.0462 };<NEW_LINE>wifis[7] = new double[] { 8.0159, 7.5123 };<NEW_LINE>wifis[8] = new double[] { 8.7819, 10.0279 };<NEW_LINE>wifis[9] = new double[] { 9.6048, 8.2946 };<NEW_LINE>double[][] kfl = new double[10][];<NEW_LINE>kfl[0] = new double[] { -0.1752, 1.6722 };<NEW_LINE>kfl[1] = new double[] { 0.2706, 3.2720 };<NEW_LINE>kfl[2] = new double[] { 1.6280, 3.5296 };<NEW_LINE>kfl[3] = new double[] { 3.2086, 3.5331 };<NEW_LINE>kfl[4] = new double[] { 3.8219, 5.0287 };<NEW_LINE>kfl[5] = new double[] { 5.4215, 5.7390 };<NEW_LINE>kfl[6] = new double[] { 6.3998, 7.2287 };<NEW_LINE>kfl[7] = new double[] { 7.7391, 7.8945 };<NEW_LINE>kfl[8] = new double[] { 8.8665, 9.2587 };<NEW_LINE>kfl[9] = new double[] { 9.8840, 9.5473 };<NEW_LINE>KalmanFilter filter = new KalmanFilter(wifis[0][0], wifis[0][1]);<NEW_LINE>for (int i = 1; i < wifis.length; i++) {<NEW_LINE>double[] wifi = wifis[i];<NEW_LINE>// = filter.update(wifi[0], wifi[1]);<NEW_LINE>KalmanFilter.Point p = new <MASK><NEW_LINE>System.out.println(String.format("V%d: %4.3f. %4.3f", i, p.x, p.y));<NEW_LINE>System.out.println(String.format("V%d: %4.3f. %4.3f", i, kfl[i][0], kfl[i][1]));<NEW_LINE>if (Math.abs(p.x - kfl[i][0]) > 0.001 || Math.abs(p.y - kfl[i][1]) > 0.001) {<NEW_LINE>System.out.println(String.format("Error"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Done");<NEW_LINE>}
KalmanFilter.Point(0, 0);
532,019
public double[] computeRegression(final double[] input) {<NEW_LINE>// first, compute the output values of each of the RBFs<NEW_LINE>// Add in one additional RBF output for bias (always set to one).<NEW_LINE>final double[] rbfOutput = new double[rbf.length + 1];<NEW_LINE>// bias<NEW_LINE>rbfOutput[rbfOutput.length - 1] = 1;<NEW_LINE>for (int rbfIndex = 0; rbfIndex < rbf.length; rbfIndex++) {<NEW_LINE>// weight the input<NEW_LINE>final double[] weightedInput <MASK><NEW_LINE>for (int inputIndex = 0; inputIndex < input.length; inputIndex++) {<NEW_LINE>final int memoryIndex = this.indexInputWeights + (rbfIndex * this.inputCount) + inputIndex;<NEW_LINE>weightedInput[inputIndex] = input[inputIndex] * this.longTermMemory[memoryIndex];<NEW_LINE>}<NEW_LINE>// calculate the rbf<NEW_LINE>rbfOutput[rbfIndex] = this.rbf[rbfIndex].evaluate(weightedInput);<NEW_LINE>}<NEW_LINE>// second, calculate the output, which is the result of the weighted result of the RBF's.<NEW_LINE>final double[] result = new double[this.outputCount];<NEW_LINE>for (int outputIndex = 0; outputIndex < result.length; outputIndex++) {<NEW_LINE>double sum = 0;<NEW_LINE>for (int rbfIndex = 0; rbfIndex < rbfOutput.length; rbfIndex++) {<NEW_LINE>// add 1 to rbf length for bias<NEW_LINE>final int memoryIndex = this.indexOutputWeights + (outputIndex * (rbf.length + 1)) + rbfIndex;<NEW_LINE>sum += rbfOutput[rbfIndex] * this.longTermMemory[memoryIndex];<NEW_LINE>}<NEW_LINE>result[outputIndex] = sum;<NEW_LINE>}<NEW_LINE>// finally, return the result.<NEW_LINE>return result;<NEW_LINE>}
= new double[input.length];
366,749
private void loadAnalyzerOptionsPanels() {<NEW_LINE>List<Options> optionGroups = analysisOptions.getChildOptions();<NEW_LINE>noOptionsPanel = new JPanel(new VerticalLayout(5));<NEW_LINE>noOptionsPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));<NEW_LINE>noOptionsPanel.add(new GLabel("No options available."));<NEW_LINE>HelpService help = Help.getHelpService();<NEW_LINE>for (Options optionsGroup : optionGroups) {<NEW_LINE>String analyzerName = optionsGroup.getName();<NEW_LINE>JPanel optionsContainer = new JPanel(new VerticalLayout(5));<NEW_LINE>optionsContainer.setName(ANALYZER_OPTIONS_PANEL_NAME);<NEW_LINE>optionsContainer.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));<NEW_LINE>JScrollPane scrollPane = new JScrollPane(optionsContainer);<NEW_LINE>scrollPane.setBorder(null);<NEW_LINE>analyzerToOptionsPanelMap.put(analyzerName, scrollPane);<NEW_LINE>analyzerManagedComponentsMap.put(analyzerName, new ArrayList<Component>());<NEW_LINE>List<String> optionNames = getOptionNames(optionsGroup);<NEW_LINE>Collections.sort(optionNames);<NEW_LINE>List<GenericOptionsComponent> optionComponents = new ArrayList<>();<NEW_LINE>for (String childOptionName : optionNames) {<NEW_LINE>EditorState childState = editorStateFactory.getEditorState(optionsGroup, childOptionName, this);<NEW_LINE>GenericOptionsComponent comp = GenericOptionsComponent.createOptionComponent(childState);<NEW_LINE>HelpLocation helpLoc = analysisOptions.getHelpLocation(analyzerName + Options.DELIMITER_STRING + childOptionName);<NEW_LINE>if (helpLoc != null) {<NEW_LINE>help.registerHelp(comp, helpLoc);<NEW_LINE>}<NEW_LINE>optionsContainer.add(comp);<NEW_LINE>optionComponents.add(comp);<NEW_LINE>analyzerManagedComponentsMap.get<MASK><NEW_LINE>editorList.add(childState);<NEW_LINE>}<NEW_LINE>GenericOptionsComponent.alignLabels(optionComponents);<NEW_LINE>Object value = analysisOptions.getObject(analyzerName, null);<NEW_LINE>boolean enabled = true;<NEW_LINE>if (value instanceof Boolean) {<NEW_LINE>enabled = (Boolean) value;<NEW_LINE>}<NEW_LINE>setAnalyzerEnabled(analyzerName, enabled, false);<NEW_LINE>}<NEW_LINE>}
(analyzerName).add(comp);
731,926
public BigInteger[] generateSignature(byte[] digest) {<NEW_LINE>if (!this.forSigning) {<NEW_LINE>throw new IllegalStateException("not initialised for signing");<NEW_LINE>}<NEW_LINE>BigInteger n = getOrder();<NEW_LINE>BigInteger e <MASK><NEW_LINE>ECPrivateKeyParameters privKey = (ECPrivateKeyParameters) key;<NEW_LINE>if (e.compareTo(n) >= 0) {<NEW_LINE>throw new DataLengthException("input too large for ECNR key");<NEW_LINE>}<NEW_LINE>BigInteger r = null;<NEW_LINE>BigInteger s = null;<NEW_LINE>AsymmetricCipherKeyPair tempPair;<NEW_LINE>do // generate r<NEW_LINE>{<NEW_LINE>// generate another, but very temporary, key pair using<NEW_LINE>// the same EC parameters<NEW_LINE>ECKeyPairGenerator keyGen = new ECKeyPairGenerator();<NEW_LINE>keyGen.init(new ECKeyGenerationParameters(privKey.getParameters(), this.random));<NEW_LINE>tempPair = keyGen.generateKeyPair();<NEW_LINE>// BigInteger Vx = tempPair.getPublic().getW().getAffineX();<NEW_LINE>// get temp's public key<NEW_LINE>ECPublicKeyParameters V = (ECPublicKeyParameters) tempPair.getPublic();<NEW_LINE>// get the point's x coordinate<NEW_LINE>BigInteger Vx = V.getQ().getAffineXCoord().toBigInteger();<NEW_LINE>r = Vx.add(e).mod(n);<NEW_LINE>} while (r.equals(ECConstants.ZERO));<NEW_LINE>// generate s<NEW_LINE>// private key value<NEW_LINE>BigInteger x = privKey.getD();<NEW_LINE>// temp's private key value<NEW_LINE>BigInteger u = ((ECPrivateKeyParameters) tempPair.getPrivate()).getD();<NEW_LINE>s = u.subtract(r.multiply(x)).mod(n);<NEW_LINE>BigInteger[] res = new BigInteger[2];<NEW_LINE>res[0] = r;<NEW_LINE>res[1] = s;<NEW_LINE>return res;<NEW_LINE>}
= new BigInteger(1, digest);
902,750
protected void analyzeMethod(ClassContext classContext, Method method) throws CheckedAnalysisException {<NEW_LINE>TaintDataflow dataflow = getTaintDataFlow(classContext, method);<NEW_LINE>ConstantPoolGen cpg = classContext.getConstantPoolGen();<NEW_LINE>ClassMethodSignature classMethodSignature = new ClassMethodSignature(com.h3xstream.findsecbugs.BCELUtil.getSlashedClassName(classContext.getJavaClass()), method.getName(), method.getSignature());<NEW_LINE>for (Iterator<Location> i = getLocationIterator(classContext, method); i.hasNext(); ) {<NEW_LINE>Location location = i.next();<NEW_LINE>InstructionHandle handle = location.getHandle();<NEW_LINE><MASK><NEW_LINE>if (!(instruction instanceof InvokeInstruction)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>InvokeInstruction invoke = (InvokeInstruction) instruction;<NEW_LINE>TaintFrame fact = dataflow.getFactAtLocation(location);<NEW_LINE>assert fact != null;<NEW_LINE>if (!fact.isValid()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>analyzeLocation(classContext, method, handle, cpg, invoke, fact, classMethodSignature);<NEW_LINE>}<NEW_LINE>}
Instruction instruction = handle.getInstruction();
1,475,299
final SetActiveReceiptRuleSetResult executeSetActiveReceiptRuleSet(SetActiveReceiptRuleSetRequest setActiveReceiptRuleSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setActiveReceiptRuleSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetActiveReceiptRuleSetRequest> request = null;<NEW_LINE>Response<SetActiveReceiptRuleSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetActiveReceiptRuleSetRequestMarshaller().marshall(super.beforeMarshalling(setActiveReceiptRuleSetRequest));<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, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetActiveReceiptRuleSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<SetActiveReceiptRuleSetResult> responseHandler = new StaxResponseHandler<SetActiveReceiptRuleSetResult>(new SetActiveReceiptRuleSetResultStaxUnmarshaller());<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());
1,355,960
public boolean tableExists(String tableName) throws TskCoreException {<NEW_LINE>boolean tableExists = false;<NEW_LINE>Statement tableExistsStatement = null;<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>try {<NEW_LINE>tableExistsStatement = connection.createStatement();<NEW_LINE>// NON-NLS<NEW_LINE>resultSet = tableExistsStatement.executeQuery("SELECT name FROM sqlite_master WHERE type='table'");<NEW_LINE>while (resultSet.next()) {<NEW_LINE>if (resultSet.getString("name").equalsIgnoreCase(tableName)) {<NEW_LINE>// NON-NLS<NEW_LINE>tableExists = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw new TskCoreException("Error checking if table " + tableName + "exists ", ex);<NEW_LINE>} finally {<NEW_LINE>if (resultSet != null) {<NEW_LINE>try {<NEW_LINE>resultSet.close();<NEW_LINE>} catch (SQLException ex2) {<NEW_LINE>logger.log(Level.WARNING, "Failed to close resultset after checking table", ex2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tableExistsStatement != null) {<NEW_LINE>try {<NEW_LINE>tableExistsStatement.close();<NEW_LINE>} catch (SQLException ex2) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tableExists;<NEW_LINE>}
Level.SEVERE, "Error closing Statement", ex2);
765,015
public FilterConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>FilterConfiguration filterConfiguration = new FilterConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AllowedLocations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>filterConfiguration.setAllowedLocations(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return filterConfiguration;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
707,346
public <T> T createMock(MockCreationSettings<T> settings, MockHandler handler) {<NEW_LINE>Class<T> typeToMock = settings.getTypeToMock();<NEW_LINE>Set<Class<?>> interfacesSet = settings.getExtraInterfaces();<NEW_LINE>Class<?>[] extraInterfaces = interfacesSet.toArray(new Class[interfacesSet.size()]);<NEW_LINE>InvocationHandler invocationHandler = new InvocationHandlerAdapter(handler);<NEW_LINE>if (typeToMock.isInterface()) {<NEW_LINE>// support interfaces via java.lang.reflect.Proxy<NEW_LINE>Class[] classesToMock = new Class[extraInterfaces.length + 1];<NEW_LINE>classesToMock[0] = typeToMock;<NEW_LINE>System.arraycopy(extraInterfaces, 0, classesToMock, 1, extraInterfaces.length);<NEW_LINE>// newProxyInstance returns the type of typeToMock<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>T mock = (T) Proxy.newProxyInstance(typeToMock.getClassLoader(), classesToMock, invocationHandler);<NEW_LINE>return mock;<NEW_LINE>} else {<NEW_LINE>// support concrete classes via dexmaker's ProxyBuilder<NEW_LINE>try {<NEW_LINE>ProxyBuilder builder = ProxyBuilder.forClass(typeToMock).implementing(extraInterfaces);<NEW_LINE>if (isApi28) {<NEW_LINE>builder.markTrusted();<NEW_LINE>}<NEW_LINE>Class<? extends T> proxyClass = builder.buildProxyClass();<NEW_LINE>T <MASK><NEW_LINE>ProxyBuilder.setInvocationHandler(mock, invocationHandler);<NEW_LINE>return mock;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new MockitoException("Failed to mock " + typeToMock, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mock = unsafeAllocator.newInstance(proxyClass);
876,331
public static String md5(String s) {<NEW_LINE>// http://stackoverflow.com/questions/1057041/difference-between-java-and-php5-md5-hash<NEW_LINE>// http://code.google.com/p/roboguice/issues/detail?id=89<NEW_LINE>try {<NEW_LINE>final byte[] hash = MessageDigest.getInstance("MD5").digest(s.getBytes(CharEncoding.UTF_8));<NEW_LINE>final StringBuilder hashString = new StringBuilder();<NEW_LINE>for (byte aHash : hash) {<NEW_LINE>String hex = Integer.toHexString(aHash);<NEW_LINE>if (hex.length() == 1) {<NEW_LINE>hashString.append('0');<NEW_LINE>hashString.append(hex.charAt(hex<MASK><NEW_LINE>} else {<NEW_LINE>hashString.append(hex.substring(hex.length() - 2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hashString.toString();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
.length() - 1));
1,812,502
public void store(Item item, String alias) {<NEW_LINE>logger.debug("Storing item: {}", item.getName());<NEW_LINE>if (item.getState() instanceof UnDefType) {<NEW_LINE>logger.debug("This item is of undefined type. Cannot persist it!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!JpaConfiguration.isInitialized) {<NEW_LINE>logger.debug("Trying to create EntityManagerFactory but we don't have configuration yet!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// determine item name to be stored<NEW_LINE>String name = (alias != null) ? alias : item.getName();<NEW_LINE>JpaPersistentItem pItem = new JpaPersistentItem();<NEW_LINE>try {<NEW_LINE>String newValue = StateHelper.toString(item.getState());<NEW_LINE>pItem.setValue(newValue);<NEW_LINE>logger.debug("Stored new value: {}", newValue);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>logger.error("Error on converting state value to string: {}", e1.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pItem.setName(name);<NEW_LINE>pItem.<MASK><NEW_LINE>pItem.setTimestamp(new Date());<NEW_LINE>EntityManager em = getEntityManagerFactory().createEntityManager();<NEW_LINE>try {<NEW_LINE>logger.debug("Persisting item...");<NEW_LINE>// In RESOURCE_LOCAL calls to EntityManager require a begin/commit<NEW_LINE>em.getTransaction().begin();<NEW_LINE>em.persist(pItem);<NEW_LINE>em.getTransaction().commit();<NEW_LINE>logger.debug("Persisting item...done");<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Error on persisting item! Rolling back!");<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>em.getTransaction().rollback();<NEW_LINE>} finally {<NEW_LINE>em.close();<NEW_LINE>}<NEW_LINE>logger.debug("Storing item...done");<NEW_LINE>}
setRealName(item.getName());
524,600
public BankStatementLineId createBankStatementLine(@NonNull final BankStatementLineCreateRequest request) {<NEW_LINE>final I_C_BankStatementLine record = newInstance(I_C_BankStatementLine.class);<NEW_LINE>record.setC_BankStatement_ID(request.getBankStatementId().getRepoId());<NEW_LINE>record.setAD_Org_ID(request.getOrgId().getRepoId());<NEW_LINE>record.setLine(request.getLineNo());<NEW_LINE>if (request.getLineNo() > 0) {<NEW_LINE>record.setLine(request.getLineNo());<NEW_LINE>} else {<NEW_LINE>final int maxLineNo = getLastLineNo(request.getBankStatementId());<NEW_LINE>record.setLine(maxLineNo + 10);<NEW_LINE>}<NEW_LINE>record.setC_BPartner_ID(BPartnerId.toRepoId(request.getBpartnerId()));<NEW_LINE>record.setImportedBillPartnerName(request.getImportedBillPartnerName());<NEW_LINE>record.setImportedBillPartnerIBAN(request.getImportedBillPartnerIBAN());<NEW_LINE>record.setReferenceNo(request.getReferenceNo());<NEW_LINE>record.setDescription(request.getLineDescription());<NEW_LINE>record.setMemo(request.getMemo());<NEW_LINE>record.setStatementLineDate(TimeUtil.asTimestamp(request.getStatementLineDate()));<NEW_LINE>record.setDateAcct(TimeUtil.asTimestamp(request.getDateAcct()));<NEW_LINE>record.setValutaDate(TimeUtil.asTimestamp(request.getValutaDate()));<NEW_LINE>record.setC_Currency_ID(request.getStatementAmt().getCurrencyId().getRepoId());<NEW_LINE>record.setStmtAmt(request.getStatementAmt().toBigDecimal());<NEW_LINE>record.setTrxAmt(request.getTrxAmt().toBigDecimal());<NEW_LINE>record.setBankFeeAmt(request.getBankFeeAmt().toBigDecimal());<NEW_LINE>record.setChargeAmt(request.getChargeAmt().toBigDecimal());<NEW_LINE>record.setInterestAmt(request.getInterestAmt().toBigDecimal());<NEW_LINE>record.setC_Charge_ID(ChargeId.toRepoId(request.getChargeId()));<NEW_LINE>record.setDebitorOrCreditorId(request.getDebitorOrCreditorId());<NEW_LINE>final BankStatementLineCreateRequest.<MASK><NEW_LINE>if (eft != null) {<NEW_LINE>record.setEftTrxID(eft.getTrxId());<NEW_LINE>record.setEftTrxType(eft.getTrxType());<NEW_LINE>record.setEftCheckNo(eft.getCheckNo());<NEW_LINE>record.setEftReference(eft.getReference());<NEW_LINE>record.setEftMemo(eft.getMemo());<NEW_LINE>record.setEftPayee(eft.getPayee());<NEW_LINE>record.setEftPayeeAccount(eft.getPayeeAccount());<NEW_LINE>record.setEftStatementLineDate(TimeUtil.asTimestamp(eft.getStatementLineDate()));<NEW_LINE>record.setEftValutaDate(TimeUtil.asTimestamp(eft.getValutaDate()));<NEW_LINE>record.setEftCurrency(eft.getCurrency());<NEW_LINE>record.setEftAmt(eft.getAmt());<NEW_LINE>}<NEW_LINE>save(record);<NEW_LINE>return BankStatementLineId.ofRepoId(record.getC_BankStatementLine_ID());<NEW_LINE>}
ElectronicFundsTransfer eft = request.getEft();
164,437
private TypeDef findPreexistingTypeDef(Program program) throws InvalidDataTypeException {<NEW_LINE>DataTypeManager dtm = program.getDataTypeManager();<NEW_LINE>DataType dt = dtm.getDataType(userPath, userName);<NEW_LINE>if (dt == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!(dt instanceof TypeDef)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>TypeDef res = (TypeDef) dt;<NEW_LINE>if (!(res.getDataType() instanceof Pointer)) {<NEW_LINE>throw new InvalidDataTypeException("Data-type " + userName + " already exists and is not a pointer TypeDef");<NEW_LINE>}<NEW_LINE>DataType baseType = ((Pointer) res.getDataType()).getDataType();<NEW_LINE>if (!userDataType.getName().equals(baseType.getName()) || !userDataType.getCategoryPath().equals(baseType.getCategoryPath())) {<NEW_LINE>throw new InvalidDataTypeException("Data-type " + userName + " already exists and has a different base");<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
InvalidDataTypeException("Data-type " + userName + " already exists");
1,203
List<JCTree> enumBody(Name enumName) {<NEW_LINE>accept(LBRACE);<NEW_LINE>ListBuffer<JCTree> defs = new ListBuffer<JCTree>();<NEW_LINE>if (token.kind == COMMA) {<NEW_LINE>nextToken();<NEW_LINE>} else if (token.kind != RBRACE && token.kind != SEMI) {<NEW_LINE>defs.append(enumeratorDeclaration(enumName));<NEW_LINE>while (token.kind == COMMA) {<NEW_LINE>nextToken();<NEW_LINE>if (token.kind == RBRACE || token.kind == SEMI)<NEW_LINE>break;<NEW_LINE>defs.append(enumeratorDeclaration(enumName));<NEW_LINE>}<NEW_LINE>if (token.kind != SEMI && token.kind != RBRACE) {<NEW_LINE>defs.append(syntaxError(token.pos, "expected3"<MASK><NEW_LINE>nextToken();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (token.kind == SEMI) {<NEW_LINE>nextToken();<NEW_LINE>while (token.kind != RBRACE && token.kind != EOF) {<NEW_LINE>defs.appendList(classOrInterfaceBodyDeclaration(enumName, false));<NEW_LINE>if (token.pos <= endPosTable.errorEndPos) {<NEW_LINE>// error recovery<NEW_LINE>skip(false, true, true, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>accept(RBRACE);<NEW_LINE>return defs.toList();<NEW_LINE>}
, COMMA, RBRACE, SEMI));
1,378,380
private void addListeners() {<NEW_LINE>model.tradeCurrencyCode.addListener(tradeCurrencyCodeListener);<NEW_LINE>model.marketPriceAvailableProperty.addListener(marketPriceAvailableListener);<NEW_LINE>model.marketPriceMargin.addListener(marketPriceMarginListener);<NEW_LINE>model.volume.addListener(volumeListener);<NEW_LINE>model.getDataModel().missingCoin.addListener(missingCoinListener);<NEW_LINE><MASK><NEW_LINE>model.buyerSecurityDepositInBTC.addListener(buyerSecurityDepositInBTCListener);<NEW_LINE>model.isMinBuyerSecurityDeposit.addListener(isMinBuyerSecurityDepositListener);<NEW_LINE>tradeFeeInBtcToggle.selectedProperty().addListener(tradeFeeInBtcToggleListener);<NEW_LINE>tradeFeeInBsqToggle.selectedProperty().addListener(tradeFeeInBsqToggleListener);<NEW_LINE>// focus out<NEW_LINE>amountTextField.focusedProperty().addListener(amountFocusedListener);<NEW_LINE>minAmountTextField.focusedProperty().addListener(minAmountFocusedListener);<NEW_LINE>fixedPriceTextField.focusedProperty().addListener(priceFocusedListener);<NEW_LINE>triggerPriceInputTextField.focusedProperty().addListener(triggerPriceFocusedListener);<NEW_LINE>marketBasedPriceTextField.focusedProperty().addListener(priceAsPercentageFocusedListener);<NEW_LINE>volumeTextField.focusedProperty().addListener(volumeFocusedListener);<NEW_LINE>buyerSecurityDepositInputTextField.focusedProperty().addListener(buyerSecurityDepositFocusedListener);<NEW_LINE>// notifications<NEW_LINE>model.getDataModel().getShowWalletFundedNotification().addListener(getShowWalletFundedNotificationListener);<NEW_LINE>// warnings<NEW_LINE>model.errorMessage.addListener(errorMessageListener);<NEW_LINE>// model.getDataModel().feeFromFundingTxProperty.addListener(feeFromFundingTxListener);<NEW_LINE>model.placeOfferCompleted.addListener(placeOfferCompletedListener);<NEW_LINE>// UI actions<NEW_LINE>paymentAccountsComboBox.setOnAction(paymentAccountsComboBoxSelectionHandler);<NEW_LINE>currencyComboBox.setOnAction(currencyComboBoxSelectionHandler);<NEW_LINE>}
model.isTradeFeeVisible.addListener(tradeFeeVisibleListener);
625,934
private void commonSupportingFiles() {<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));<NEW_LINE>if (getLibrary().equals(MULTIPLATFORM)) {<NEW_LINE>supportingFiles.add(new SupportingFile("build.gradle.kts.mustache", "", "build.gradle.kts"));<NEW_LINE>supportingFiles.add(new SupportingFile("settings.gradle.kts.mustache", "", "settings.gradle.kts"));<NEW_LINE>} else if (getLibrary().equals(JVM_VOLLEY)) {<NEW_LINE>supportingFiles.add(new SupportingFile("build.mustache", "", "build.gradle"));<NEW_LINE>supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties"));<NEW_LINE>supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle"));<NEW_LINE>supportingFiles.add(new SupportingFile("manifest.mustache", "", "src/main/AndroidManifest.xml"));<NEW_LINE>} else {<NEW_LINE>supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle"));<NEW_LINE>supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle"));<NEW_LINE>}<NEW_LINE>// gradle wrapper supporting files<NEW_LINE>supportingFiles.add(new SupportingFile("gradlew.mustache", "", "gradlew"));<NEW_LINE>supportingFiles.add(new SupportingFile("gradlew.bat.mustache", "", "gradlew.bat"));<NEW_LINE>supportingFiles.add(new SupportingFile("gradle-wrapper.properties.mustache", "gradle.wrapper".replace(".", <MASK><NEW_LINE>supportingFiles.add(new SupportingFile("gradle-wrapper.jar", "gradle.wrapper".replace(".", File.separator), "gradle-wrapper.jar"));<NEW_LINE>}
File.separator), "gradle-wrapper.properties"));
240,650
final boolean complete(LogonCommand logonCommand, TDSReader tdsReader) throws SQLServerException {<NEW_LINE>// If we have the login ack already then we're done processing.<NEW_LINE>if (null != loginAckToken)<NEW_LINE>return true;<NEW_LINE>// No login ack yet. Check if there is more SSPI handshake to do...<NEW_LINE>if (null != secBlobOut && 0 != secBlobOut.length) {<NEW_LINE>// Yes, there is. So start the next SSPI round trip and indicate to<NEW_LINE>// our caller that it needs to keep the processing loop going.<NEW_LINE>logonCommand.startRequest(TDS.PKT_SSPI).writeBytes(<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// The login ack comes in its own complete TDS response message.<NEW_LINE>// So integrated auth effectively receives more response messages from<NEW_LINE>// the server than it sends request messages from the driver.<NEW_LINE>// To ensure that the rest of the response can be read, fake another<NEW_LINE>// request to the server so that the channel sees int auth login<NEW_LINE>// as a symmetric conversation.<NEW_LINE>logonCommand.startRequest(TDS.PKT_SSPI);<NEW_LINE>logonCommand.onRequestComplete();<NEW_LINE>++tdsChannel.numMsgsSent;<NEW_LINE>TDSParser.parse(tdsReader, this);<NEW_LINE>return true;<NEW_LINE>}
secBlobOut, 0, secBlobOut.length);
1,441,815
public void readCustomNBT(CompoundTag nbt, boolean descPacket) {<NEW_LINE>if (!descPacket) {<NEW_LINE>NonNullList<ItemStack> merged = NonNullList.withSize(<MASK><NEW_LINE>ContainerHelper.loadAllItems(nbt, merged);<NEW_LINE>for (int i = 0; i < NUM_SLOTS; ++i) {<NEW_LINE>this.buffers.set(i, merged.get(i + NUM_SLOTS));<NEW_LINE>this.filters.set(i, merged.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.batchMode = BatchMode.values()[nbt.getByte("batchMode")];<NEW_LINE>int[] redstoneConfig = nbt.getIntArray("redstoneColors");<NEW_LINE>if (redstoneConfig.length >= NUM_SLOTS)<NEW_LINE>for (int i = 0; i < NUM_SLOTS; i++) this.redstoneColors.set(i, DyeColor.byId(redstoneConfig[i]));<NEW_LINE>}
2 * NUM_SLOTS, ItemStack.EMPTY);
976,289
protected Subscription createSingletonRSSSupport(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon, int add_type, boolean subscribe) throws SubscriptionException {<NEW_LINE>checkURL(url);<NEW_LINE>try {<NEW_LINE>Subscription existing = lookupSingletonRSS(name, url, is_public, check_interval_mins, is_anon);<NEW_LINE>if (existing != null) {<NEW_LINE>return (existing);<NEW_LINE>}<NEW_LINE>Engine engine = MetaSearchManagerFactory.getSingleton().getMetaSearch().createRSSEngine(name, url);<NEW_LINE>String json = SubscriptionImpl.getSkeletonJSON(engine, check_interval_mins);<NEW_LINE>Map singleton_details = getSingletonMap(name, url, is_public, check_interval_mins, is_anon);<NEW_LINE>SubscriptionImpl subs = new SubscriptionImpl(this, name, is_public, <MASK><NEW_LINE>subs.setSubscribed(subscribe);<NEW_LINE>log("Created new singleton subscription: " + subs.getString());<NEW_LINE>subs = addSubscription(subs);<NEW_LINE>if (subs.isPublic() && subs.isMine() && subs.isSearchTemplate()) {<NEW_LINE>updatePublicSubscription(subs);<NEW_LINE>}<NEW_LINE>return (subs);<NEW_LINE>} catch (SubscriptionException e) {<NEW_LINE>throw ((SubscriptionException) e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw (new SubscriptionException("Failed to create subscription", e));<NEW_LINE>}<NEW_LINE>}
is_anon, singleton_details, json, add_type);
1,399,420
/*<NEW_LINE>hash is MD5<NEW_LINE>h(0) <- hash(passphrase, iv);<NEW_LINE>h(n) <- hash(h(n-1), passphrase, iv);<NEW_LINE>key <- (h(0),...,h(n))[0,..,key.length];<NEW_LINE>*/<NEW_LINE>@SuppressWarnings({ "static" })<NEW_LINE>synchronized byte[] genKey(byte[] passphrase, byte[] iv) {<NEW_LINE>if (cipher == null)<NEW_LINE>cipher = genCipher();<NEW_LINE>if (hash == null)<NEW_LINE>hash = genHash();<NEW_LINE>byte[] key = new byte[cipher.getBlockSize()];<NEW_LINE>int hsize = hash.getBlockSize();<NEW_LINE>byte[] hn = new byte[key.length / hsize * hsize + (key.length % hsize == 0 ? 0 : hsize)];<NEW_LINE>try {<NEW_LINE>byte[] tmp = null;<NEW_LINE>if (vendor == VENDOR_OPENSSH) {<NEW_LINE>for (int index = 0; index + hsize <= hn.length; ) {<NEW_LINE>if (tmp != null) {<NEW_LINE>hash.update(tmp, 0, tmp.length);<NEW_LINE>}<NEW_LINE>hash.update(passphrase, 0, passphrase.length);<NEW_LINE>hash.update(iv, 0, iv.length > 8 ? 8 : iv.length);<NEW_LINE>tmp = hash.digest();<NEW_LINE>System.arraycopy(tmp, 0, hn, index, tmp.length);<NEW_LINE>index += tmp.length;<NEW_LINE>}<NEW_LINE>System.arraycopy(hn, 0, key, 0, key.length);<NEW_LINE>} else if (vendor == VENDOR_FSECURE) {<NEW_LINE>for (int index = 0; index + hsize <= hn.length; ) {<NEW_LINE>if (tmp != null) {<NEW_LINE>hash.update(tmp, 0, tmp.length);<NEW_LINE>}<NEW_LINE>hash.update(passphrase, 0, passphrase.length);<NEW_LINE>tmp = hash.digest();<NEW_LINE>System.arraycopy(tmp, 0, hn, index, tmp.length);<NEW_LINE>index += tmp.length;<NEW_LINE>}<NEW_LINE>System.arraycopy(hn, 0, key, 0, key.length);<NEW_LINE>} else if (vendor == VENDOR_PUTTY) {<NEW_LINE>Class c = Class.forName((String) jsch.getConfig("sha-1"));<NEW_LINE>HASH sha1 = (HASH) (c.newInstance());<NEW_LINE>tmp = new byte[4];<NEW_LINE>key = new byte[20 * 2];<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>sha1.init();<NEW_LINE>tmp<MASK><NEW_LINE>sha1.update(tmp, 0, tmp.length);<NEW_LINE>sha1.update(passphrase, 0, passphrase.length);<NEW_LINE>System.arraycopy(sha1.digest(), 0, key, i * 20, 20);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println(e);<NEW_LINE>}<NEW_LINE>return key;<NEW_LINE>}
[3] = (byte) i;
1,003,126
private void serializeTimer(MetaData.Builder metaData, Timer metric) {<NEW_LINE>final Snapshot snapshot = metric.getSnapshot();<NEW_LINE>writeValue(metaData, COUNT, (double) metric.getCount());<NEW_LINE>writeDuration(metaData, MAX, (<MASK><NEW_LINE>writeDuration(metaData, MEAN, snapshot.getMean());<NEW_LINE>writeDuration(metaData, MIN, (double) snapshot.getMin());<NEW_LINE>writeDuration(metaData, STDDEV, snapshot.getStdDev());<NEW_LINE>writeDuration(metaData, P50, snapshot.getMedian());<NEW_LINE>writeDuration(metaData, P75, snapshot.get75thPercentile());<NEW_LINE>writeDuration(metaData, P95, snapshot.get95thPercentile());<NEW_LINE>writeDuration(metaData, P98, snapshot.get98thPercentile());<NEW_LINE>writeDuration(metaData, P99, snapshot.get99thPercentile());<NEW_LINE>writeDuration(metaData, P999, snapshot.get999thPercentile());<NEW_LINE>writeRate(metaData, M1_RATE, metric.getOneMinuteRate());<NEW_LINE>writeRate(metaData, M5_RATE, metric.getFiveMinuteRate());<NEW_LINE>writeRate(metaData, M15_RATE, metric.getFifteenMinuteRate());<NEW_LINE>writeRate(metaData, MEAN_RATE, metric.getMeanRate());<NEW_LINE>}
double) snapshot.getMax());
1,640,523
private static Pair<NewVirtualFile, Iterable<String>> prepare(@Nonnull NewVirtualFileSystem vfs, @Nonnull String path) {<NEW_LINE>String normalizedPath = normalize(vfs, path);<NEW_LINE>if (StringUtil.isEmptyOrSpaces(normalizedPath)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (basePath.length() > normalizedPath.length()) {<NEW_LINE>LOG.error(vfs + " failed to extract root path '" + basePath + "' from '" + normalizedPath + "' (original '" + path + "')");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>NewVirtualFile root = ManagingFS.getInstance().findRoot(basePath, vfs);<NEW_LINE>if (root == null || !root.exists()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Iterable<String> parts = StringUtil.tokenize(normalizedPath.substring(basePath.length()), FILE_SEPARATORS);<NEW_LINE>return Pair.create(root, parts);<NEW_LINE>}
basePath = vfs.extractRootPath(normalizedPath);
1,722,876
static Object[] promotePrimitives(Object lhs, Object rhs) {<NEW_LINE>Number lnum = promoteToInteger(lhs);<NEW_LINE>Number rnum = promoteToInteger(rhs);<NEW_LINE>if (lhs instanceof BigDecimal) {<NEW_LINE>if (!(rhs instanceof BigDecimal))<NEW_LINE>rhs = Primitive.castNumber(BigDecimal.class, rnum);<NEW_LINE>} else if (rhs instanceof BigDecimal) {<NEW_LINE>lhs = Primitive.castNumber(BigDecimal.class, lnum);<NEW_LINE>} else if (Types.isFloatingpoint(lhs) || Types.isFloatingpoint(rhs)) {<NEW_LINE>if (!(lhs instanceof Double))<NEW_LINE>lhs = Double.<MASK><NEW_LINE>if (!(rhs instanceof Double))<NEW_LINE>rhs = Double.valueOf(rnum.doubleValue());<NEW_LINE>} else if (lhs instanceof BigInteger) {<NEW_LINE>if (!(rhs instanceof BigInteger))<NEW_LINE>rhs = Primitive.castNumber(BigInteger.class, rnum);<NEW_LINE>} else if (rhs instanceof BigInteger) {<NEW_LINE>lhs = Primitive.castNumber(BigInteger.class, lnum);<NEW_LINE>} else {<NEW_LINE>if (!(lhs instanceof Long))<NEW_LINE>lhs = Long.valueOf(lnum.longValue());<NEW_LINE>if (!(rhs instanceof Long))<NEW_LINE>rhs = Long.valueOf(rnum.longValue());<NEW_LINE>}<NEW_LINE>return new Object[] { lhs, rhs };<NEW_LINE>}
valueOf(lnum.doubleValue());
1,361,381
public StructureView createStructureView(FileEditor fileEditor, @Nonnull Project project) {<NEW_LINE>List<StructureViewComposite.StructureViewDescriptor> viewDescriptors = new ArrayList<>();<NEW_LINE>VirtualFile file = fileEditor == null ? null : fileEditor.getFile();<NEW_LINE>PsiFile psiFile = file == null || !file.isValid() ? null : PsiManager.getInstance(project).findFile(file);<NEW_LINE>List<Language> languages = getLanguages(psiFile).toList();<NEW_LINE>for (Language language : languages) {<NEW_LINE>StructureViewBuilder builder = getBuilder(ObjectUtils.notNull(psiFile), language);<NEW_LINE>if (builder == null)<NEW_LINE>continue;<NEW_LINE>StructureView structureView = builder.createStructureView(fileEditor, project);<NEW_LINE>String title = language.getDisplayName();<NEW_LINE>Image icon = ObjectUtils.notNull(LanguageUtil.getLanguageFileType(language), UnknownFileType.INSTANCE).getIcon();<NEW_LINE>viewDescriptors.add(new StructureViewComposite.StructureViewDescriptor(title, structureView, icon));<NEW_LINE>}<NEW_LINE>StructureViewComposite.StructureViewDescriptor[] array = viewDescriptors.toArray(new StructureViewComposite.StructureViewDescriptor[0]);<NEW_LINE>return new StructureViewComposite(array) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isOutdated() {<NEW_LINE>VirtualFile file = fileEditor == null ? null : fileEditor.getFile();<NEW_LINE>PsiFile psiFile = file == null || !file.isValid() ? null : PsiManager.getInstance(project).findFile(file);<NEW_LINE>List<Language> newLanguages = getLanguages(psiFile).toList();<NEW_LINE>if (!Comparing.equal(languages, newLanguages))<NEW_LINE>return true;<NEW_LINE>if (psiFile == null)<NEW_LINE>return true;<NEW_LINE>FileViewProvider viewProvider = psiFile.getViewProvider();<NEW_LINE>Language baseLanguage = viewProvider.getBaseLanguage();<NEW_LINE>StructureViewDescriptor[] views = getStructureViews();<NEW_LINE>boolean hasMainView = views.length > 0 && Comparing.equal(views[0].title, baseLanguage.getDisplayName());<NEW_LINE>JBIterable<Language> newAcceptedLanguages = JBIterable.from(newLanguages).filter(o -> o == baseLanguage && hasMainView || o != baseLanguage && isAcceptableBaseLanguageFile(<MASK><NEW_LINE>return views.length != newAcceptedLanguages.size();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
viewProvider.getPsi(o)));
659,930
public void visit(final IfStmt n, final Void arg) {<NEW_LINE>printOrphanCommentsBeforeThisChildNode(n);<NEW_LINE>printComment(n.getComment(), arg);<NEW_LINE>printer.print("if (");<NEW_LINE>n.getCondition(<MASK><NEW_LINE>final boolean thenBlock = n.getThenStmt() instanceof BlockStmt;<NEW_LINE>if (// block statement should start on the same line<NEW_LINE>thenBlock)<NEW_LINE>printer.print(") ");<NEW_LINE>else {<NEW_LINE>printer.println(")");<NEW_LINE>printer.indent();<NEW_LINE>}<NEW_LINE>n.getThenStmt().accept(this, arg);<NEW_LINE>if (!thenBlock)<NEW_LINE>printer.unindent();<NEW_LINE>if (n.getElseStmt().isPresent()) {<NEW_LINE>if (thenBlock)<NEW_LINE>printer.print(" ");<NEW_LINE>else<NEW_LINE>printer.println();<NEW_LINE>final boolean elseIf = n.getElseStmt().orElse(null) instanceof IfStmt;<NEW_LINE>final boolean elseBlock = n.getElseStmt().orElse(null) instanceof BlockStmt;<NEW_LINE>if (// put chained if and start of block statement on a same level<NEW_LINE>elseIf || elseBlock)<NEW_LINE>printer.print("else ");<NEW_LINE>else {<NEW_LINE>printer.println("else");<NEW_LINE>printer.indent();<NEW_LINE>}<NEW_LINE>if (n.getElseStmt().isPresent())<NEW_LINE>n.getElseStmt().get().accept(this, arg);<NEW_LINE>if (!(elseIf || elseBlock))<NEW_LINE>printer.unindent();<NEW_LINE>}<NEW_LINE>}
).accept(this, arg);
632,343
public boolean init(final String actionPath, final String[] separators) {<NEW_LINE>String prefix = separators[0];<NEW_LINE>String split = separators[1];<NEW_LINE>String suffix = separators[2];<NEW_LINE>macrosCount = StringUtil.count(actionPath, prefix);<NEW_LINE>if (macrosCount == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>names = new String[macrosCount];<NEW_LINE>patterns = new String[macrosCount];<NEW_LINE>fixed = new String[macrosCount + 1];<NEW_LINE>int offset = 0;<NEW_LINE>int i = 0;<NEW_LINE>while (true) {<NEW_LINE>int[] ndx = StringUtil.indexOfRegion(actionPath, prefix, suffix, offset);<NEW_LINE>if (ndx == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>fixed[i] = actionPath.substring(offset, ndx[0]);<NEW_LINE>String name = actionPath.substring(ndx[1], ndx[2]);<NEW_LINE>// name:pattern<NEW_LINE>String pattern = null;<NEW_LINE>int colonNdx = name.indexOf(split);<NEW_LINE>if (colonNdx != -1) {<NEW_LINE>pattern = name.substring(<MASK><NEW_LINE>name = name.substring(0, colonNdx).trim();<NEW_LINE>}<NEW_LINE>this.patterns[i] = pattern;<NEW_LINE>this.names[i] = name;<NEW_LINE>// iterate<NEW_LINE>offset = ndx[3];<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>if (offset < actionPath.length()) {<NEW_LINE>fixed[i] = actionPath.substring(offset);<NEW_LINE>} else {<NEW_LINE>fixed[i] = StringPool.EMPTY;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
colonNdx + 1).trim();
234,101
private List<? extends PreferencesCustomizer> loadCustomizers(String mimeType) {<NEW_LINE>ArrayList<PreferencesCustomizer> list = new ArrayList<PreferencesCustomizer>();<NEW_LINE>Preferences prefs = pf.getPreferences(mimeType);<NEW_LINE>if (mimeType.length() > 0) {<NEW_LINE>Lookup l = Lookups.forPath(FORMATTING_CUSTOMIZERS_FOLDER + mimeType);<NEW_LINE>// collect factories<NEW_LINE>Collection<? extends PreferencesCustomizer.Factory> factories = l.lookupAll(PreferencesCustomizer.Factory.class);<NEW_LINE>for (PreferencesCustomizer.Factory f : factories) {<NEW_LINE>PreferencesCustomizer c = f.create(prefs);<NEW_LINE>if (c != null) {<NEW_LINE>if (c.getId().equals(PreferencesCustomizer.TABS_AND_INDENTS_ID)) {<NEW_LINE>// NOI18N<NEW_LINE>Preferences allLangPrefs = pf.getPreferences("");<NEW_LINE>c = new IndentationPanelController(MimePath.parse(mimeType), pf, prefs, allLangPrefs, c);<NEW_LINE>}<NEW_LINE>list.add(c);<NEW_LINE>c2p.put(c, prefs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if permitted, collect old controllers<NEW_LINE>if (acceptOldControllers) {<NEW_LINE>Collection<? extends OptionsPanelController> controllers = <MASK><NEW_LINE>for (OptionsPanelController controller : controllers) {<NEW_LINE>PreferencesCustomizer c = controller instanceof PreviewProvider ? new WrapperCustomizerWithPreview(controller) : new WrapperCustomizer(controller);<NEW_LINE>list.add(c);<NEW_LINE>c2p.put(c, prefs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>PreferencesCustomizer c = new IndentationPanelController(prefs);<NEW_LINE>list.add(c);<NEW_LINE>c2p.put(c, prefs);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
l.lookupAll(OptionsPanelController.class);
498,736
public boolean tryUpdatingDatabaseConfigurationLocally(final String iDatabaseName, final OModifiableDistributedConfiguration cfg) {<NEW_LINE>ODistributedDatabaseImpl local = distributedPlugin.getMessageService().getDatabase(iDatabaseName);<NEW_LINE>if (local == null)<NEW_LINE>return false;<NEW_LINE>final ODistributedConfiguration dCfg = local.getDistributedConfiguration();<NEW_LINE>ODocument oldCfg = dCfg != null ? dCfg.getDocument() : null;<NEW_LINE>Integer oldVersion = oldCfg != null ? (Integer) oldCfg.field("version") : null;<NEW_LINE>if (oldVersion == null)<NEW_LINE>oldVersion = 0;<NEW_LINE>int currVersion = cfg.getVersion();<NEW_LINE>final boolean modified = currVersion > oldVersion;<NEW_LINE>if (oldCfg != null && !modified) {<NEW_LINE>// NO CHANGE, SKIP IT<NEW_LINE>OLogManager.instance().debug(<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// SAVE IN NODE'S LOCAL RAM<NEW_LINE>local.setDistributedConfiguration(cfg);<NEW_LINE>ODistributedServerLog.info(this, nodeName, null, ODistributedServerLog.DIRECTION.NONE, "Broadcasting new distributed configuration for database: %s (version=%d)\n", iDatabaseName, currVersion);<NEW_LINE>return modified;<NEW_LINE>}
this, "Skip saving of distributed configuration file for database '%s' because is unchanged (version %d)", iDatabaseName, currVersion);
640,896
private void createOutlineView() {<NEW_LINE>outlineView = new OutlineView(// NOI18N<NEW_LINE>UiUtils.// NOI18N<NEW_LINE>getText("BasicSearchResultsPanel.outline.nodes"));<NEW_LINE>outlineView.getOutline().setDefaultRenderer(Node.Property.class, new ResultsOutlineCellRenderer());<NEW_LINE>setOutlineColumns();<NEW_LINE>outlineView.getOutline().setAutoCreateColumnsFromModel(false);<NEW_LINE>outlineView.addTreeExpansionListener(new ExpandingTreeExpansionListener());<NEW_LINE>outlineView.<MASK><NEW_LINE>outlineView.addHierarchyListener((HierarchyEvent e) -> {<NEW_LINE>if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {<NEW_LINE>if (outlineView.isDisplayable()) {<NEW_LINE>outlineView.expandNode(resultsNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>outlineView.getOutline().getColumnModel().addColumnModelListener(new ColumnsListener());<NEW_LINE>// #209949<NEW_LINE>outlineView.getOutline().getInputMap().// #209949<NEW_LINE>remove(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0));<NEW_LINE>// NOI18N<NEW_LINE>outlineView.getOutline().getInputMap().// NOI18N<NEW_LINE>put(// NOI18N<NEW_LINE>KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "hide");<NEW_LINE>// NOI18N<NEW_LINE>outlineView.getOutline().getActionMap().// NOI18N<NEW_LINE>put(// NOI18N<NEW_LINE>"hide", // NOI18N<NEW_LINE>SystemAction.get(HideResultAction.class));<NEW_LINE>outlineView.getOutline().setShowGrid(false);<NEW_LINE>Font font = outlineView.getOutline().getFont();<NEW_LINE>FontMetrics fm = outlineView.getOutline().getFontMetrics(font);<NEW_LINE>outlineView.getOutline().setRowHeight(Math.max(16, fm.getHeight()) + VERTICAL_ROW_SPACE);<NEW_LINE>outlineView.setTreeHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_POLICY);<NEW_LINE>setTooltipHidingBehavior();<NEW_LINE>}
getOutline().setRootVisible(false);
262,384
private void updateView() {<NEW_LINE>if (dialog == null)<NEW_LINE>return;<NEW_LINE>final Wallet wallet = walletActivityViewModel.wallet.getValue();<NEW_LINE>final boolean needsPassword = wallet != null && wallet.isEncrypted();<NEW_LINE>if (wallet == null || transaction == null || feeRaise == null) {<NEW_LINE>messageView.setText(R.string.raise_fee_dialog_determining_fee);<NEW_LINE>passwordGroup.setVisibility(View.GONE);<NEW_LINE>} else if (findSpendableOutput(wallet, transaction, feeRaise) == null) {<NEW_LINE>messageView.setText(R.string.raise_fee_dialog_cant_raise);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>messageView.setText(getString(R.string.raise_fee_dialog_message, config.getFormat().format(feeRaise)));<NEW_LINE>passwordGroup.setVisibility(needsPassword ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>if (state == State.INPUT) {<NEW_LINE>positiveButton.setText(R.string.raise_fee_dialog_button_raise);<NEW_LINE>positiveButton.setEnabled((!needsPassword || passwordView.getText().toString().trim().length() > 0) && wallet != null && transaction != null && feeRaise != null && findSpendableOutput(wallet, transaction, feeRaise) != null);<NEW_LINE>negativeButton.setEnabled(true);<NEW_LINE>} else if (state == State.DECRYPTING) {<NEW_LINE>positiveButton.setText(R.string.raise_fee_dialog_state_decrypting);<NEW_LINE>positiveButton.setEnabled(false);<NEW_LINE>negativeButton.setEnabled(false);<NEW_LINE>} else if (state == State.DONE) {<NEW_LINE>positiveButton.setText(R.string.raise_fee_dialog_state_done);<NEW_LINE>positiveButton.setEnabled(false);<NEW_LINE>negativeButton.setEnabled(false);<NEW_LINE>}<NEW_LINE>}
passwordGroup.setVisibility(View.GONE);
7,848
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>SharedPreferences themePrefs = getSharedPreferences("THEME", 0);<NEW_LINE>Boolean isDark = themePrefs.getBoolean("isDark", false);<NEW_LINE>if (isDark)<NEW_LINE>setTheme(R.style.DarkTheme);<NEW_LINE>else<NEW_LINE>setTheme(R.style.AppTheme);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>mStartButton = (FloatingActionButton) findViewById(R.id.inspectToggleButton);<NEW_LINE>mActivity = (ProgressBar) <MASK><NEW_LINE>TextView mDeviceName = (TextView) findViewById(R.id.deviceName);<NEW_LINE>mDeviceType = (TextView) findViewById(R.id.deviceType);<NEW_LINE>mDeviceOS = (TextView) findViewById(R.id.deviceOS);<NEW_LINE>mDeviceServices = (TextView) findViewById(R.id.deviceServices);<NEW_LINE>mFocusedScan = System.getCurrentTarget().hasOpenPorts();<NEW_LINE>mDeviceName.setText(System.getCurrentTarget().toString());<NEW_LINE>if (System.getCurrentTarget().getDeviceType() != null)<NEW_LINE>mDeviceType.setText(System.getCurrentTarget().getDeviceType());<NEW_LINE>if (System.getCurrentTarget().getDeviceOS() != null)<NEW_LINE>mDeviceOS.setText(System.getCurrentTarget().getDeviceOS());<NEW_LINE>empty = getText(R.string.unknown).toString();<NEW_LINE>// yep, we're on main thread here<NEW_LINE>write_services();<NEW_LINE>mStartButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>if (mRunning) {<NEW_LINE>setStoppedState();<NEW_LINE>} else {<NEW_LINE>setStartedState();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mReceiver = new Receiver(System.getCurrentTarget());<NEW_LINE>}
findViewById(R.id.inspectActivity);
104,948
public BlackboardArtifact addWebFormAutofill(String name, String value, long creationTime, long accessTime, int count, Collection<BlackboardAttribute> otherAttributesList) throws TskCoreException, BlackboardException {<NEW_LINE>Collection<BlackboardAttribute> attributes = new ArrayList<>();<NEW_LINE>// construct attributes<NEW_LINE>attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME, getModuleName(), name));<NEW_LINE>attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_VALUE, getModuleName(), value));<NEW_LINE>addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED, creationTime, attributes);<NEW_LINE>addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED, accessTime, attributes);<NEW_LINE>addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COUNT, count, attributes);<NEW_LINE>// add attributes to artifact<NEW_LINE>attributes.addAll(otherAttributesList);<NEW_LINE>Content content = getContent();<NEW_LINE>BlackboardArtifact webFormAutofillArtifact = content.newDataArtifact(WEB_FORM_AUTOFILL_TYPE, attributes);<NEW_LINE>// post artifact<NEW_LINE>Optional<Long> ingestJobId = getIngestJobId();<NEW_LINE>getSleuthkitCase().getBlackboard().postArtifact(webFormAutofillArtifact, getModuleName()<MASK><NEW_LINE>// return the artifact<NEW_LINE>return webFormAutofillArtifact;<NEW_LINE>}
, ingestJobId.orElse(null));
1,037,020
public TSExecuteStatementResp executeUpdateStatement(TSExecuteStatementReq req) {<NEW_LINE>if (!serviceProvider.checkLogin(req.getSessionId())) {<NEW_LINE>return RpcUtils.getTSExecuteStatementResp(getNotLoggedInStatus());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>PhysicalPlan physicalPlan = serviceProvider.getPlanner().parseSQLToPhysicalPlan(req.statement, SESSION_MANAGER.getZoneId(req.sessionId), SESSION_MANAGER.getClientVersion(req.sessionId));<NEW_LINE>return physicalPlan.isQuery() ? RpcUtils.getTSExecuteStatementResp(TSStatusCode.EXECUTE_STATEMENT_ERROR, "Statement is a query statement.") : executeUpdateStatement(req.statement, req.statementId, physicalPlan, req.fetchSize, req.timeout, req.getSessionId());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOGGER.error(INFO_INTERRUPT_ERROR, req, e);<NEW_LINE>Thread<MASK><NEW_LINE>return RpcUtils.getTSExecuteStatementResp(onQueryException(e, "\"" + req.statement + "\". " + OperationType.EXECUTE_UPDATE_STATEMENT));<NEW_LINE>} catch (Exception e) {<NEW_LINE>return RpcUtils.getTSExecuteStatementResp(onQueryException(e, "\"" + req.statement + "\". " + OperationType.EXECUTE_UPDATE_STATEMENT));<NEW_LINE>}<NEW_LINE>}
.currentThread().interrupt();
790,175
private void init() {<NEW_LINE>inflate(getContext(), R.layout.contact_friend_profile_layout, this);<NEW_LINE>mHeadImageView = findViewById(R.id.friend_icon);<NEW_LINE>mNickNameView = <MASK><NEW_LINE>mIDView = findViewById(R.id.friend_account);<NEW_LINE>mRemarkView = findViewById(R.id.remark);<NEW_LINE>mRemarkView.setOnClickListener(this);<NEW_LINE>mSignatureTagView = findViewById(R.id.friend_signature_tag);<NEW_LINE>mSignatureView = findViewById(R.id.friend_signature);<NEW_LINE>mMessageOptionView = findViewById(R.id.msg_rev_opt);<NEW_LINE>mMessageOptionView.setOnClickListener(this);<NEW_LINE>mChatTopView = findViewById(R.id.chat_to_top);<NEW_LINE>mAddBlackView = findViewById(R.id.blackList);<NEW_LINE>deleteFriendBtn = findViewById(R.id.btn_delete);<NEW_LINE>deleteFriendBtn.setOnClickListener(this);<NEW_LINE>chatBtn = findViewById(R.id.btn_chat);<NEW_LINE>chatBtn.setOnClickListener(this);<NEW_LINE>audioCallBtn = findViewById(R.id.btn_voice);<NEW_LINE>audioCallBtn.setOnClickListener(this);<NEW_LINE>videoCallBtn = findViewById(R.id.btn_video);<NEW_LINE>videoCallBtn.setOnClickListener(this);<NEW_LINE>addFriendSendBtn = findViewById(R.id.add_friend_send_btn);<NEW_LINE>addFriendSendBtn.setOnClickListener(this);<NEW_LINE>acceptFriendBtn = findViewById(R.id.accept_friend_send_btn);<NEW_LINE>refuseFriendBtn = findViewById(R.id.refuse_friend_send_btn);<NEW_LINE>addFriendArea = findViewById(R.id.add_friend_verify_area);<NEW_LINE>addWordingEditText = findViewById(R.id.add_wording_edit);<NEW_LINE>friendApplicationVerifyArea = findViewById(R.id.friend_application_verify_area);<NEW_LINE>friendApplicationAddWording = findViewById(R.id.friend_application_add_wording);<NEW_LINE>addFriendRemarkLv = findViewById(R.id.friend_remark_lv);<NEW_LINE>addFriendRemarkLv.setOnClickListener(this);<NEW_LINE>addFriendGroupLv = findViewById(R.id.friend_group_lv);<NEW_LINE>addFriendGroupLv.setContent(getContext().getString(R.string.contact_my_friend));<NEW_LINE>remarkAndGroupTip = findViewById(R.id.remark_and_group_tip);<NEW_LINE>mTitleBar = findViewById(R.id.friend_titlebar);<NEW_LINE>mTitleBar.setTitle(getResources().getString(R.string.profile_detail), ITitleBarLayout.Position.MIDDLE);<NEW_LINE>mTitleBar.getRightGroup().setVisibility(View.GONE);<NEW_LINE>mTitleBar.setOnLeftClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>((Activity) getContext()).finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
findViewById(R.id.friend_nick_name);
877,605
public final void complete() {<NEW_LINE>NumberFormat nfMegabyte = NumberFormat.getInstance();<NEW_LINE>NumberFormat nfCounts = NumberFormat.getInstance();<NEW_LINE>nfCounts.setGroupingUsed(true);<NEW_LINE>nfMegabyte.setMaximumFractionDigits(2);<NEW_LINE>LOGGER.info("completing read...");<NEW_LINE>this.tileBasedGeoObjectStore.complete();<NEW_LINE>LOGGER.info("start writing file...");<NEW_LINE>try {<NEW_LINE>if (this.configuration.getOutputFile().exists()) {<NEW_LINE>LOGGER.info("overwriting file " + this.configuration.getOutputFile().getAbsolutePath());<NEW_LINE>this.configuration.getOutputFile().delete();<NEW_LINE>}<NEW_LINE>MapFileWriter.writeFile(this.configuration, this.tileBasedGeoObjectStore);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.log(Level.SEVERE, "error while writing file", e);<NEW_LINE>}<NEW_LINE>LOGGER.info("finished...");<NEW_LINE>LOGGER.fine("total processed nodes: " + nfCounts.format(this.tileBasedGeoObjectStore.getNodesNumber()));<NEW_LINE>LOGGER.fine("total processed ways: " + nfCounts.format(this.tileBasedGeoObjectStore.getWaysNumber()));<NEW_LINE>LOGGER.fine("total processed relations: " + nfCounts.format(this.tileBasedGeoObjectStore.getRelationsNumber()));<NEW_LINE>LOGGER.info("estimated memory consumption: " + nfMegabyte.format(+((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / Math.pow(1024<MASK><NEW_LINE>}
, 2))) + "MB");
73,846
public void draw(Canvas canvas) {<NEW_LINE>super.draw(canvas);<NEW_LINE>if (!badgeEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Rect bounds = getBounds();<NEW_LINE>if (TextUtil.isTextEmpty(text)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final float x = (1 - <MASK><NEW_LINE>final float y = HALF_SIZE_FACTOR * bounds.height();<NEW_LINE>canvas.drawCircle(x, y, (SIZE_FACTOR / 1.4f) * bounds.width(), bigBackgroundPaint);<NEW_LINE>final float x1 = (1 - HALF_SIZE_FACTOR) * bounds.width() + 2;<NEW_LINE>final float y1 = HALF_SIZE_FACTOR * bounds.height() - 2;<NEW_LINE>canvas.drawCircle(x1, y1, (SIZE_FACTOR / 1.3f) * bounds.width() - 2, backgroundPaint);<NEW_LINE>final Rect textBounds = new Rect();<NEW_LINE>textPaint.getTextBounds(text, 0, text.length(), textBounds);<NEW_LINE>canvas.drawText(text, x1, y1 + (float) (textBounds.height() / 2.5), textPaint);<NEW_LINE>}
HALF_SIZE_FACTOR) * bounds.width();
57,898
private void createNewFiltersAndCursors(ItemStream itemStream) throws SIResourceException, MessageStoreException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "createNewFiltersAndCursors", itemStream);<NEW_LINE>LockingCursor cursor = null;<NEW_LINE>// Instantiate a new array of Filters and associated cursors. If there is<NEW_LINE>// no message classification, then we'll instantiate a single filter and<NEW_LINE>// cursor pair.<NEW_LINE>if (classifyingMessages) {<NEW_LINE>// Classifying messages for XD.<NEW_LINE>// this work should be done under the classifications readlock acquired higher<NEW_LINE>// up in the stack<NEW_LINE>JSConsumerClassifications classifications = consumerSet.getClassifications();<NEW_LINE>int numClasses = classifications.getNumberOfClasses();<NEW_LINE>consumerKeyFilter = new LocalQPConsumerKeyFilter[numClasses + 1];<NEW_LINE>for (int i = 0; i < numClasses + 1; i++) {<NEW_LINE>String classificationName = null;<NEW_LINE>// The zeroth filter belongs to the default classification, which has a<NEW_LINE>// null classification name<NEW_LINE>if (i > 0)<NEW_LINE>classificationName = classifications.getClassification(i);<NEW_LINE>consumerKeyFilter[i] = new LocalQPConsumerKeyFilter(this, i, classificationName);<NEW_LINE>cursor = itemStream.newLockingItemCursor(<MASK><NEW_LINE>consumerKeyFilter[i].setLockingCursor(cursor);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// No message classification<NEW_LINE>consumerKeyFilter = new LocalQPConsumerKeyFilter[1];<NEW_LINE>consumerKeyFilter[0] = new LocalQPConsumerKeyFilter(this, 0, null);<NEW_LINE>cursor = itemStream.newLockingItemCursor(consumerKeyFilter[0], !forwardScanning);<NEW_LINE>consumerKeyFilter[0].setLockingCursor(cursor);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createNewFiltersAndCursors");<NEW_LINE>}
consumerKeyFilter[i], !forwardScanning);
1,027,749
public void parseContentTypesFile(InputStream contentTypes) throws InvalidFormatException {<NEW_LINE>CTTypes types;<NEW_LINE>try {<NEW_LINE>XMLInputFactory xif = XMLInputFactory.newInstance();<NEW_LINE>xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);<NEW_LINE>// a DTD is merely ignored, its presence doesn't cause an exception<NEW_LINE>xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);<NEW_LINE>XMLStreamReader xsr = xif.createXMLStreamReader(contentTypes);<NEW_LINE>Unmarshaller u = Context.jcContentTypes.createUnmarshaller();<NEW_LINE>// u.setSchema(org.docx4j.jaxb.WmlSchema.schema);<NEW_LINE>u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler());<NEW_LINE>log.debug("unmarshalling " + this.getClass().getName());<NEW_LINE>Object res = XmlUtils.unwrap(u.unmarshal(xsr));<NEW_LINE>// types = (CTTypes)((JAXBElement)res).getValue();<NEW_LINE>types = (CTTypes) res;<NEW_LINE>// log.debug( types.getClass().getName() + " unmarshalled" );<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>XmlUtils.marshaltoString(res, true, true, Context.jcContentTypes);<NEW_LINE>}<NEW_LINE>CTDefault defaultCT;<NEW_LINE>CTOverride overrideCT;<NEW_LINE>for (Object o : types.getDefaultOrOverride()) {<NEW_LINE>if (o instanceof CTDefault) {<NEW_LINE>defaultCT = (CTDefault) o;<NEW_LINE>addDefaultContentType(defaultCT.getExtension(), defaultCT);<NEW_LINE>}<NEW_LINE>if (o instanceof CTOverride) {<NEW_LINE>overrideCT = (CTOverride) o;<NEW_LINE>URI uri = new URI(overrideCT.getPartName());<NEW_LINE>addOverrideContentType(uri, overrideCT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new InvalidFormatException("Bad [Content_Types].xml", e);
291,182
public static DescribeDnsGtmInstancesResponse unmarshall(DescribeDnsGtmInstancesResponse describeDnsGtmInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDnsGtmInstancesResponse.setRequestId(_ctx.stringValue("DescribeDnsGtmInstancesResponse.RequestId"));<NEW_LINE>describeDnsGtmInstancesResponse.setPageSize(_ctx.integerValue("DescribeDnsGtmInstancesResponse.PageSize"));<NEW_LINE>describeDnsGtmInstancesResponse.setPageNumber(_ctx.integerValue("DescribeDnsGtmInstancesResponse.PageNumber"));<NEW_LINE>describeDnsGtmInstancesResponse.setTotalPages(_ctx.integerValue("DescribeDnsGtmInstancesResponse.TotalPages"));<NEW_LINE>describeDnsGtmInstancesResponse.setTotalItems(_ctx.integerValue("DescribeDnsGtmInstancesResponse.TotalItems"));<NEW_LINE>List<GtmInstance> gtmInstances = new ArrayList<GtmInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDnsGtmInstancesResponse.GtmInstances.Length"); i++) {<NEW_LINE>GtmInstance gtmInstance = new GtmInstance();<NEW_LINE>gtmInstance.setPaymentType(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].PaymentType"));<NEW_LINE>gtmInstance.setExpireTime(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].ExpireTime"));<NEW_LINE>gtmInstance.setCreateTime(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].CreateTime"));<NEW_LINE>gtmInstance.setSmsQuota(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].SmsQuota"));<NEW_LINE>gtmInstance.setInstanceId(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].InstanceId"));<NEW_LINE>gtmInstance.setExpireTimestamp(_ctx.longValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].ExpireTimestamp"));<NEW_LINE>gtmInstance.setResourceGroupId(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].ResourceGroupId"));<NEW_LINE>gtmInstance.setVersionCode(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].VersionCode"));<NEW_LINE>gtmInstance.setTaskQuota(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].TaskQuota"));<NEW_LINE>gtmInstance.setCreateTimestamp(_ctx.longValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].CreateTimestamp"));<NEW_LINE>Config config = new Config();<NEW_LINE>config.setTtl(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.Ttl"));<NEW_LINE>config.setAlertGroup(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertGroup"));<NEW_LINE>config.setPublicZoneName(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicZoneName"));<NEW_LINE>config.setCnameType(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.CnameType"));<NEW_LINE>config.setStrategyMode(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.StrategyMode"));<NEW_LINE>config.setInstanceName(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.InstanceName"));<NEW_LINE>config.setPublicCnameMode(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicCnameMode"));<NEW_LINE>config.setPublicUserDomainName(_ctx.stringValue<MASK><NEW_LINE>config.setPublicRr(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicRr"));<NEW_LINE>List<AlertConfigItem> alertConfig = new ArrayList<AlertConfigItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig.Length"); j++) {<NEW_LINE>AlertConfigItem alertConfigItem = new AlertConfigItem();<NEW_LINE>alertConfigItem.setSmsNotice(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig[" + j + "].SmsNotice"));<NEW_LINE>alertConfigItem.setNoticeType(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig[" + j + "].NoticeType"));<NEW_LINE>alertConfigItem.setEmailNotice(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig[" + j + "].EmailNotice"));<NEW_LINE>alertConfigItem.setDingtalkNotice(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig[" + j + "].DingtalkNotice"));<NEW_LINE>alertConfig.add(alertConfigItem);<NEW_LINE>}<NEW_LINE>config.setAlertConfig(alertConfig);<NEW_LINE>gtmInstance.setConfig(config);<NEW_LINE>UsedQuota usedQuota = new UsedQuota();<NEW_LINE>usedQuota.setEmailUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.EmailUsedCount"));<NEW_LINE>usedQuota.setTaskUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.TaskUsedCount"));<NEW_LINE>usedQuota.setSmsUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.SmsUsedCount"));<NEW_LINE>usedQuota.setDingtalkUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.DingtalkUsedCount"));<NEW_LINE>gtmInstance.setUsedQuota(usedQuota);<NEW_LINE>gtmInstances.add(gtmInstance);<NEW_LINE>}<NEW_LINE>describeDnsGtmInstancesResponse.setGtmInstances(gtmInstances);<NEW_LINE>return describeDnsGtmInstancesResponse;<NEW_LINE>}
("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicUserDomainName"));
717,264
/*<NEW_LINE>* sends a channel command & value from openHAB => NeoHub. It delegates upwards<NEW_LINE>* to the NeoHub to handle the command<NEW_LINE>*/<NEW_LINE>protected void toNeoHubSendCommand(String channelId, Command command) {<NEW_LINE>String cmdStr = toNeoHubBuildCommandString(channelId, command);<NEW_LINE>if (!cmdStr.isEmpty()) {<NEW_LINE>NeoHubHandler hub = getNeoHub();<NEW_LINE>if (hub != null) {<NEW_LINE>switch(hub.toNeoHubSendChannelValue(cmdStr)) {<NEW_LINE>case SUCCEEDED:<NEW_LINE>logger.debug(MSG_FMT_COMMAND_OK, getThing().getLabel());<NEW_LINE>if (getThing().getStatus() != ThingStatus.ONLINE) {<NEW_LINE>updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE);<NEW_LINE>}<NEW_LINE>// initialize the de-bouncer for this channel<NEW_LINE>debouncer.initialize(channelId);<NEW_LINE>break;<NEW_LINE>case ERR_COMMUNICATION:<NEW_LINE>logger.debug(MSG_HUB_COMM, hub.getThing().getUID());<NEW_LINE>updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR);<NEW_LINE>break;<NEW_LINE>case ERR_INITIALIZATION:<NEW_LINE>logger.warn(MSG_HUB_CONFIG, hub.getThing().getUID());<NEW_LINE>updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug(MSG_HUB_CONFIG, "unknown");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug(<MASK><NEW_LINE>}<NEW_LINE>}
MSG_FMT_COMMAND_BAD, command.toString());
157,946
private int addLink(int row, DataObject dob) {<NEW_LINE>Action action = extractAction(dob);<NEW_LINE>if (null != action) {<NEW_LINE>JPanel panel = <MASK><NEW_LINE>panel.setOpaque(false);<NEW_LINE>ActionButton lb = new ActionButton(action, Utils.getUrlString(dob), Utils.getColor(COLOR_BIG_BUTTON), true, dob.getPrimaryFile().getPath());<NEW_LINE>panel.add(lb, new GridBagConstraints(1, 0, 1, 3, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>lb.setFont(GET_STARTED_FONT);<NEW_LINE>lb.getAccessibleContext().setAccessibleName(lb.getText());<NEW_LINE>// NOI18N<NEW_LINE>lb.getAccessibleContext().// NOI18N<NEW_LINE>setAccessibleDescription(BundleSupport.getAccessibilityDescription("GettingStarted", lb.getText()));<NEW_LINE>add(panel, new GridBagConstraints(0, row++, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 3, 0), 0, 0));<NEW_LINE>}<NEW_LINE>return row;<NEW_LINE>}
new JPanel(new GridBagLayout());
790,401
public boolean checkTrigger(GameEvent event, Game game) {<NEW_LINE>Permanent equipment = game.getPermanent(this.sourceId);<NEW_LINE>if (equipment != null && equipment.getAttachedTo() != null && event.getSourceId().equals(equipment.getAttachedTo())) {<NEW_LINE>getEffects().setValue("sourceId", event.getSourceId());<NEW_LINE>// TODO: Passing a permanent object like this can cause bugs. May need refactoring to use UUID instead.<NEW_LINE>// See https://github.com/magefree/mage/issues/8377<NEW_LINE>// 11-08-2021: Added a new constructor to set target pointer. Should probably be using this instead.<NEW_LINE>Permanent attachedPermanent = game.<MASK><NEW_LINE>getEffects().setValue("attachedPermanent", attachedPermanent);<NEW_LINE>if (setTargetPointer && attachedPermanent != null) {<NEW_LINE>getEffects().setTargetPointer(new FixedTarget(attachedPermanent, game));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPermanent(event.getSourceId());
1,130,855
/* (non-Javadoc)<NEW_LINE>* @see com.ibm.ws.sib.processor.runtime.AbstractControllable#checkValidControllable()<NEW_LINE>*/<NEW_LINE>public void assertValidControllable() throws SIMPControllableNotFoundException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "assertValidControllable");<NEW_LINE>if (_streamSet == null || _ioStreamManager == null) {<NEW_LINE>SIMPControllableNotFoundException finalE = new SIMPControllableNotFoundException(nls.getFormattedMessage("INTERNAL_MESSAGING_ERROR_CWSIP0005", new Object[] { "InternalOutputStreamControl.assertValidControllable", "1:363:1.30", _streamSet }, null));<NEW_LINE>SibTr.exception(tc, finalE);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "assertValidControllable", finalE);<NEW_LINE>throw finalE;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "assertValidControllable");<NEW_LINE>}
SibTr.exception(tc, finalE);
1,527,126
private CFNode<L> insert(CFNode<L> node, NumberVector nv, DBIDRef dbid) {<NEW_LINE>assert node.getChild(0) != null : "Unexpected empty node!";<NEW_LINE>// Find the best child:<NEW_LINE>AsClusterFeature best = node.getChild(0);<NEW_LINE>double bestd = sqdistance(nv, best.getCF());<NEW_LINE>for (int i = 1; i < capacity; i++) {<NEW_LINE>AsClusterFeature cf = node.getChild(i);<NEW_LINE>if (cf == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>final double d2 = sqabsorption(nv, cf.getCF());<NEW_LINE>if (d2 < bestd) {<NEW_LINE>best = cf;<NEW_LINE>bestd = d2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Leaf node:<NEW_LINE>if (!(best instanceof CFNode)) {<NEW_LINE>// Threshold constraint satisfied?<NEW_LINE>if (abs.squaredDistance(nv, best.getCF()) <= thresholdsq) {<NEW_LINE>best.getCF().addToStatistics(nv);<NEW_LINE>if (idmap != null) {<NEW_LINE>idmap.get((L) best).add(dbid);<NEW_LINE>}<NEW_LINE>node.getCF().addToStatistics(nv);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>L bestl = factory.make(nv.getDimensionality());<NEW_LINE>if (idmap != null) {<NEW_LINE>ArrayModifiableDBIDs list = DBIDUtil.newArray();<NEW_LINE>list.add(dbid);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>bestl.addToStatistics(nv);<NEW_LINE>++leaves;<NEW_LINE>return node.add(bestl) ? null : split(node, bestl);<NEW_LINE>}<NEW_LINE>assert (best instanceof CFNode) : "Node is neither child nor inner?";<NEW_LINE>CFNode<L> newchild = insert((CFNode<L>) best, nv, dbid);<NEW_LINE>if (newchild == null) {<NEW_LINE>node.getCF().addToStatistics(nv);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (node.setChild(newchild)) {<NEW_LINE>node.getCF().addToStatistics(nv);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return split(node, newchild);<NEW_LINE>}
idmap.put(bestl, list);
903,709
public void writeObject(ByteBuffer buffer, Object object) throws IOException {<NEW_LINE>Collection collection = (Collection) object;<NEW_LINE>int length = collection.size();<NEW_LINE>buffer.putInt(length);<NEW_LINE>if (length == 0)<NEW_LINE>return;<NEW_LINE>Iterator it = collection.iterator();<NEW_LINE>Class elementClass = it.next().getClass();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object obj = it.next();<NEW_LINE>if (obj.getClass() != elementClass) {<NEW_LINE>elementClass = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (elementClass != null) {<NEW_LINE>buffer.put((byte) 1);<NEW_LINE>Serializer.writeClass(buffer, elementClass);<NEW_LINE>Serializer serializer = Serializer.getSerializer(elementClass);<NEW_LINE>for (Object elem : collection) {<NEW_LINE>serializer.writeObject(buffer, elem);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>buffer<MASK><NEW_LINE>for (Object elem : collection) {<NEW_LINE>Serializer.writeClassAndObject(buffer, elem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.put((byte) 0);
102,573
public void handleResponse(Channel channel, ByteBuf byteBuf) {<NEW_LINE>timeoutCounter.set(0);<NEW_LINE>ByteBufReceiver byteBufReceiver = receivers.peek();<NEW_LINE>if (byteBufReceiver != null) {<NEW_LINE>ByteBufReceiver.RECEIVER_RESULT result = byteBufReceiver.receive(channel, byteBuf);<NEW_LINE>switch(result) {<NEW_LINE>case SUCCESS:<NEW_LINE>logger.debug("[handleResponse][remove receiver]");<NEW_LINE>receivers.poll();<NEW_LINE>break;<NEW_LINE>case CONTINUE:<NEW_LINE>// nothing need to be done<NEW_LINE>break;<NEW_LINE>case FAIL:<NEW_LINE>logger.<MASK><NEW_LINE>channel.close();<NEW_LINE>break;<NEW_LINE>case ALREADY_FINISH:<NEW_LINE>logger.info("[handleResponse][already finish, close channel]{}, {}", byteBufReceiver, channel);<NEW_LINE>channel.close();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("unknown result:" + result);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("[handleResponse][no receiver][close client]{}, {}, {}", channel, byteBuf.readableBytes(), ByteBufUtils.readToString(byteBuf));<NEW_LINE>channel.close();<NEW_LINE>}<NEW_LINE>}
info("[handleResponse][fail, close channel]{}, {}", byteBufReceiver, channel);
80,081
private void appendSummary(TransactionProfile profile, StringBuilder sb) {<NEW_LINE>TransactionProfile.<MASK><NEW_LINE>sb.append("z:").append(rate(profile.getTotalMicros(), summary.persistCount + summary.queryCount)).append(' ');<NEW_LINE>sb.append("p:").append(rate(summary.persistMicros, summary.persistBeans)).append(' ');<NEW_LINE>sb.append("q:").append(rate(summary.queryMicros, summary.queryCount)).append(' ');<NEW_LINE>sb.append("qm:").append(summary.queryMax).append(' ');<NEW_LINE>sb.append("qt:").append(summary.queryMicros).append(' ');<NEW_LINE>sb.append("qc:").append(summary.queryCount).append(' ');<NEW_LINE>sb.append("qb:").append(summary.queryBeans).append(' ');<NEW_LINE>sb.append("pt:").append(summary.persistMicros).append(' ');<NEW_LINE>sb.append("pc:").append(summary.persistCount).append(' ');<NEW_LINE>sb.append("pb:").append(summary.persistBeans).append(' ');<NEW_LINE>sb.append("po:").append(summary.persistOneCount).append(' ');<NEW_LINE>sb.append("pz:").append(rate(summary.persistBeans, summary.persistCount));<NEW_LINE>}
Summary summary = profile.getSummary();