idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
224,069 | private JCCompilationUnit doCompile(JavaFileObject input, Iterable<JavaFileObject> files, Context context) throws IOException {<NEW_LINE>JavacTool tool = JavacTool.create();<NEW_LINE>DiagnosticCollector<JavaFileObject> diagnosticsCollector = new DiagnosticCollector<>();<NEW_LINE>ErrorProneOptions errorProneOptions;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (InvalidCommandLineOptionException e) {<NEW_LINE>throw new IllegalArgumentException("Exception during argument processing: " + e);<NEW_LINE>}<NEW_LINE>context.put(ErrorProneOptions.class, errorProneOptions);<NEW_LINE>StringWriter out = new StringWriter();<NEW_LINE>JavacTaskImpl task = (JavacTaskImpl) tool.getTask(new PrintWriter(out, true), FileManagers.testFileManager(), diagnosticsCollector, ImmutableList.copyOf(errorProneOptions.getRemainingArgs()), /*classes=*/<NEW_LINE>null, files, context);<NEW_LINE>Iterable<? extends CompilationUnitTree> trees = task.parse();<NEW_LINE>task.analyze();<NEW_LINE>ImmutableMap<URI, ? extends CompilationUnitTree> byURI = stream(trees).collect(toImmutableMap(t -> t.getSourceFile().toUri(), t -> t));<NEW_LINE>URI inputURI = input.toUri();<NEW_LINE>assertWithMessage(out + Joiner.on('\n').join(diagnosticsCollector.getDiagnostics())).that(byURI).containsKey(inputURI);<NEW_LINE>JCCompilationUnit tree = (JCCompilationUnit) byURI.get(inputURI);<NEW_LINE>Iterable<Diagnostic<? extends JavaFileObject>> errorDiagnostics = Iterables.filter(diagnosticsCollector.getDiagnostics(), d -> d.getKind() == Diagnostic.Kind.ERROR);<NEW_LINE>if (!Iterables.isEmpty(errorDiagnostics)) {<NEW_LINE>fail("compilation failed unexpectedly: " + errorDiagnostics);<NEW_LINE>}<NEW_LINE>return tree;<NEW_LINE>} | errorProneOptions = ErrorProneOptions.processArgs(options); |
329,437 | public static String jsonFromFields(String topic, long idx, long timestamp, String producerId, int msgSize) {<NEW_LINE>GenericRecord record = new GenericData.Record(DefaultTopicSchema.MESSAGE_V0);<NEW_LINE>record.put(DefaultTopicSchema.<MASK><NEW_LINE>record.put(DefaultTopicSchema.INDEX_FIELD.name(), idx);<NEW_LINE>record.put(DefaultTopicSchema.TIME_FIELD.name(), timestamp);<NEW_LINE>record.put(DefaultTopicSchema.PRODUCER_ID_FIELD.name(), producerId);<NEW_LINE>// CONTENT_FIELD is composed of #msgSize number of character 'x', e.g. xxxxxxxxxx<NEW_LINE>record.put(DefaultTopicSchema.CONTENT_FIELD.name(), String.format("%1$-" + msgSize + "s", "").replace(' ', 'x'));<NEW_LINE>return jsonFromGenericRecord(record);<NEW_LINE>} | TOPIC_FIELD.name(), topic); |
1,440,800 | private void readArchiveData() throws IOException {<NEW_LINE>// INDEX<NEW_LINE>// Pad<NEW_LINE>archiveIndexFile.readInt();<NEW_LINE>// UserData, should be 0<NEW_LINE>archiveIndexFile.readLong();<NEW_LINE>entryCount = archiveIndexFile.readInt();<NEW_LINE>entryOffset = archiveIndexFile.readInt();<NEW_LINE>hashOffset = archiveIndexFile.readInt();<NEW_LINE>hashLength = archiveIndexFile.readInt();<NEW_LINE>entries = new ArrayList<ArchiveEntry>(entryCount);<NEW_LINE>// Hashes are stored linearly in memory instead of within each entry, so the hashes are read in a separate loop.<NEW_LINE>// Once the hashes are read, the rest of the entries are read.<NEW_LINE>archiveIndexFile.seek(hashOffset);<NEW_LINE>// Read entry hashes<NEW_LINE>for (int i = 0; i < entryCount; ++i) {<NEW_LINE>archiveIndexFile.seek(hashOffset + i * HASH_BUFFER_BYTESIZE);<NEW_LINE>ArchiveEntry e = new ArchiveEntry("");<NEW_LINE>e.hash = new byte[HASH_BUFFER_BYTESIZE];<NEW_LINE>archiveIndexFile.read(e.hash, 0, hashLength);<NEW_LINE>if (this.manifestFile != null) {<NEW_LINE>ManifestData manifestData = ManifestData.parseFrom(this.manifestFile.getData());<NEW_LINE>for (ResourceEntry resource : manifestData.getResourcesList()) {<NEW_LINE>if (matchHash(e.hash, resource.getHash().getData().toByteArray(), this.hashLength)) {<NEW_LINE>e.fileName = resource.getUrl();<NEW_LINE>e.relName = resource.getUrl();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>entries.add(e);<NEW_LINE>}<NEW_LINE>// Read entries<NEW_LINE>archiveIndexFile.seek(entryOffset);<NEW_LINE>for (int i = 0; i < entryCount; ++i) {<NEW_LINE>ArchiveEntry e = entries.get(i);<NEW_LINE>e<MASK><NEW_LINE>e.size = archiveIndexFile.readInt();<NEW_LINE>e.compressedSize = archiveIndexFile.readInt();<NEW_LINE>e.flags = archiveIndexFile.readInt();<NEW_LINE>}<NEW_LINE>} | .resourceOffset = archiveIndexFile.readInt(); |
104,945 | private void loadOptionsConfig() throws TemplateModelException {<NEW_LINE>final String blogBaseUrl = optionService.getBlogBaseUrl();<NEW_LINE>final String context = optionService.isEnabledAbsolutePath() ? blogBaseUrl + "/" : "/";<NEW_LINE>configuration.setSharedVariable("options", optionService.listOptions());<NEW_LINE>configuration.setSharedVariable("context", context);<NEW_LINE>configuration.setSharedVariable("version", HaloConst.HALO_VERSION);<NEW_LINE>configuration.setSharedVariable("globalAbsolutePathEnabled", optionService.isEnabledAbsolutePath());<NEW_LINE>configuration.setSharedVariable("blog_title", optionService.getBlogTitle());<NEW_LINE>configuration.setSharedVariable("blog_url", blogBaseUrl);<NEW_LINE>configuration.setSharedVariable("blog_logo", optionService.getByPropertyOrDefault(BlogProperties.BLOG_LOGO, String.class, BlogProperties.BLOG_LOGO.defaultValue()));<NEW_LINE>configuration.setSharedVariable("seo_keywords", optionService.getByPropertyOrDefault(SeoProperties.KEYWORDS, String.class, SeoProperties.KEYWORDS.defaultValue()));<NEW_LINE>configuration.setSharedVariable("seo_description", optionService.getByPropertyOrDefault(SeoProperties.DESCRIPTION, String.class, SeoProperties.DESCRIPTION.defaultValue()));<NEW_LINE>configuration.setSharedVariable("rss_url", blogBaseUrl + "/rss.xml");<NEW_LINE>configuration.setSharedVariable("atom_url", blogBaseUrl + "/atom.xml");<NEW_LINE>configuration.setSharedVariable("sitemap_xml_url", blogBaseUrl + "/sitemap.xml");<NEW_LINE>configuration.setSharedVariable("sitemap_html_url", blogBaseUrl + "/sitemap.html");<NEW_LINE>configuration.setSharedVariable("links_url", context + optionService.getLinksPrefix());<NEW_LINE>configuration.setSharedVariable("photos_url", context + optionService.getPhotosPrefix());<NEW_LINE>configuration.setSharedVariable("journals_url", context + optionService.getJournalsPrefix());<NEW_LINE>configuration.setSharedVariable("archives_url", <MASK><NEW_LINE>configuration.setSharedVariable("categories_url", context + optionService.getCategoriesPrefix());<NEW_LINE>configuration.setSharedVariable("tags_url", context + optionService.getTagsPrefix());<NEW_LINE>log.debug("Loaded options");<NEW_LINE>} | context + optionService.getArchivesPrefix()); |
1,333,565 | private void drawWoodenBoard(Graphics2D g) {<NEW_LINE>if (uiConfig.getBoolean("fancy-board")) {<NEW_LINE>// fancy version<NEW_LINE>if (cachedBoardImage == emptyImage) {<NEW_LINE>cachedBoardImage = Lizzie.config.theme.board();<NEW_LINE>}<NEW_LINE>drawTextureImage(g, cachedBoardImage, x - 2 * shadowRadius, y - 2 * shadowRadius, boardWidth + 4 * shadowRadius, boardHeight + 4 * shadowRadius);<NEW_LINE>// The board border is no longer supported, add another option if needed<NEW_LINE>// if (Lizzie.config.showBorder) {<NEW_LINE>// g.setStroke(new BasicStroke(shadowRadius * 2));<NEW_LINE>// // draw border<NEW_LINE>// g.setColor(new Color(0, 0, 0, 50));<NEW_LINE>// g.drawRect(<NEW_LINE>// x - shadowRadius,<NEW_LINE>// y - shadowRadius,<NEW_LINE>// boardWidth + 2 * shadowRadius,<NEW_LINE>// boardHeight + 2 * shadowRadius);<NEW_LINE>// }<NEW_LINE>g.setStroke(new BasicStroke(1));<NEW_LINE>} else {<NEW_LINE>// simple version<NEW_LINE>JSONArray boardColor = uiConfig.getJSONArray("board-color");<NEW_LINE><MASK><NEW_LINE>g.setColor(new Color(boardColor.getInt(0), boardColor.getInt(1), boardColor.getInt(2)));<NEW_LINE>g.fillRect(x, y, boardWidth, boardHeight);<NEW_LINE>}<NEW_LINE>} | g.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_OFF); |
402,652 | public void cellHover(TableCell cell) {<NEW_LINE>super.cellHover(cell);<NEW_LINE>long lConnectedSeeds = 0;<NEW_LINE>DownloadManager dm = (DownloadManager) cell.getDataSource();<NEW_LINE>if (dm != null) {<NEW_LINE>lConnectedSeeds = dm.getNbSeeds();<NEW_LINE>String sToolTip = lConnectedSeeds + " " + MessageText.getString("GeneralView.label.connected") + "\n";<NEW_LINE>if (lTotalSeeds != -1) {<NEW_LINE>sToolTip += lTotalSeeds + " " + MessageText.getString("GeneralView.label.in_swarm");<NEW_LINE>} else {<NEW_LINE>Download d = getDownload();<NEW_LINE>if (d != null) {<NEW_LINE>DownloadScrapeResult response = d.getAggregatedScrapeResult(true);<NEW_LINE>sToolTip += "?? " + MessageText.getString("GeneralView.label.in_swarm");<NEW_LINE>if (response != null)<NEW_LINE>sToolTip += "(" + response.getStatus() + ")";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean bCompleteTorrent = dm.getAssumedComplete();<NEW_LINE>if (bCompleteTorrent && iFC_NumPeers > 0 && lTotalSeeds >= iFC_MinSeeds && lTotalPeers > 0) {<NEW_LINE>long lSeedsToAdd = lTotalPeers / iFC_NumPeers;<NEW_LINE>sToolTip += "\n" + MessageText.getString("TableColumn.header.seeds.fullcopycalc", new String[] { "" + lTotalPeers, "" + lSeedsToAdd });<NEW_LINE>}<NEW_LINE>long cache = dm.getDownloadState().getLongAttribute(DownloadManagerState.AT_SCRAPE_CACHE);<NEW_LINE>if (cache != -1) {<NEW_LINE>int seeds = (int) ((cache >> 32) & 0x00ffffff);<NEW_LINE>if (seeds != lTotalSeeds) {<NEW_LINE>sToolTip += "\n" + seeds + " " + MessageText.getString("Scrape.status.cached").toLowerCase(Locale.US);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] i2p_info = (int[]) <MASK><NEW_LINE>if (i2p_info != null) {<NEW_LINE>int totalI2PSeeds = i2p_info[0];<NEW_LINE>if (totalI2PSeeds > 0) {<NEW_LINE>sToolTip += "\n" + MessageText.getString("TableColumn.header.peers.i2p", new String[] { String.valueOf(totalI2PSeeds) });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cell.setToolTip(sToolTip);<NEW_LINE>} else {<NEW_LINE>cell.setToolTip("");<NEW_LINE>}<NEW_LINE>} | dm.getUserData(DHTTrackerPlugin.DOWNLOAD_USER_DATA_I2P_SCRAPE_KEY); |
574,155 | public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {<NEW_LINE>SceneTransToPointReq req = SceneTransToPointReq.parseFrom(payload);<NEW_LINE>String code = req.getSceneId() + "_" + req.getPointId();<NEW_LINE>ScenePointEntry scenePointEntry = GenshinData.getScenePointEntries().get(code);<NEW_LINE>if (scenePointEntry != null) {<NEW_LINE>float x = scenePointEntry.getPointData().getTranPos().getX();<NEW_LINE>float y = scenePointEntry.getPointData()<MASK><NEW_LINE>float z = scenePointEntry.getPointData().getTranPos().getZ();<NEW_LINE>session.getPlayer().getWorld().transferPlayerToScene(session.getPlayer(), req.getSceneId(), new Position(x, y, z));<NEW_LINE>session.send(new PacketSceneTransToPointRsp(session.getPlayer(), req.getPointId(), req.getSceneId()));<NEW_LINE>} else {<NEW_LINE>session.send(new PacketSceneTransToPointRsp());<NEW_LINE>}<NEW_LINE>} | .getTranPos().getY(); |
829,378 | public com.amazonaws.services.clouddirectory.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.clouddirectory.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.clouddirectory.model.ResourceNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceNotFoundException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,538,647 | public void invalidated(Observable valueModel) {<NEW_LINE>if (valueModel == labeled.textProperty()) {<NEW_LINE>labeledImpl.setText(labeled.getText());<NEW_LINE>} else if (valueModel == labeled.graphicProperty()) {<NEW_LINE>// If the user set the graphic, then mirror that.<NEW_LINE>// Otherwise, the graphic was set via the imageUrlProperty which<NEW_LINE>// will be mirrored onto the labeledImpl by the next block.<NEW_LINE>StyleOrigin origin = ((StyleableProperty<?>) labeled.<MASK><NEW_LINE>if (origin == null || origin == StyleOrigin.USER) {<NEW_LINE>labeledImpl.setGraphic(labeled.getGraphic());<NEW_LINE>}<NEW_LINE>} else if (valueModel instanceof StyleableProperty) {<NEW_LINE>StyleableProperty<?> styleableProperty = (StyleableProperty<?>) valueModel;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>CssMetaData<Styleable, Object> cssMetaData = (CssMetaData<Styleable, Object>) styleableProperty.getCssMetaData();<NEW_LINE>if (cssMetaData != null) {<NEW_LINE>StyleOrigin origin = styleableProperty.getStyleOrigin();<NEW_LINE>StyleableProperty<Object> targetProperty = cssMetaData.getStyleableProperty(labeledImpl);<NEW_LINE>targetProperty.applyStyle(origin, styleableProperty.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | graphicProperty()).getStyleOrigin(); |
340,672 | public Optional<String> checkValue(String value) {<NEW_LINE>if (StringUtil.isBlank(value)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (value.equals(FIRST_EDITION)) {<NEW_LINE>return Optional.of(Localization.lang("edition of book reported as just 1"));<NEW_LINE>}<NEW_LINE>if (bibDatabaseContextEdition.isBiblatexMode()) {<NEW_LINE>if (!ONLY_NUMERALS_OR_LITERALS.test(value.trim())) {<NEW_LINE>return Optional.of(Localization.lang("should contain an integer or a literal"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ONLY_NUMERALS.test(value) && (!allowIntegerEdition)) {<NEW_LINE>return Optional.of<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isFirstCharDigit(value) && !FIRST_LETTER_CAPITALIZED.test(value.trim())) {<NEW_LINE>return Optional.of(Localization.lang("should have the first letter capitalized"));<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>} | (Localization.lang("no integer as values for edition allowed")); |
308,460 | final UpdateQuickConnectNameResult executeUpdateQuickConnectName(UpdateQuickConnectNameRequest updateQuickConnectNameRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateQuickConnectNameRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateQuickConnectNameRequest> request = null;<NEW_LINE>Response<UpdateQuickConnectNameResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateQuickConnectNameRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateQuickConnectNameRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateQuickConnectName");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateQuickConnectNameResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateQuickConnectNameResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,758,525 | static ConfiguredType create(JsonObject type) {<NEW_LINE>ConfiguredType ct = new ConfiguredType(type.getString("type"), type.getBoolean("standalone", false), type.getString("prefix", null), type.getString("description", null), toList(type.getJsonArray("provides")));<NEW_LINE>List<String> producers = toList<MASK><NEW_LINE>for (String producer : producers) {<NEW_LINE>ct.addProducer(ProducerMethod.parse(producer));<NEW_LINE>}<NEW_LINE>List<String> inherits = toList(type.getJsonArray("inherits"));<NEW_LINE>for (String inherit : inherits) {<NEW_LINE>ct.addInherited(inherit);<NEW_LINE>}<NEW_LINE>JsonArray options = type.getJsonArray("options");<NEW_LINE>for (JsonValue option : options) {<NEW_LINE>ct.addProperty(ConfiguredProperty.create(option.asJsonObject()));<NEW_LINE>}<NEW_LINE>return ct;<NEW_LINE>} | (type.getJsonArray("producers")); |
1,032,495 | protected boolean validateComponent() {<NEW_LINE>// errors<NEW_LINE>Integer port = parseInteger(debuggerPanel.getPort());<NEW_LINE>if (port == null || port < 1) {<NEW_LINE>debuggerPanel.setError(NbBundle.getMessage(PhpDebuggerPanelController.class, "MSG_DebuggerInvalidPort"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String sessionId = debuggerPanel.getSessionId();<NEW_LINE>if (sessionId == null || sessionId.trim().length() == 0 || sessionId.contains(" ")) {<NEW_LINE>// NOI18N<NEW_LINE>debuggerPanel.setError(NbBundle.getMessage(PhpDebuggerPanelController.class, "MSG_DebuggerInvalidSessionId"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Integer maxDataLength = <MASK><NEW_LINE>if (maxDataLength == null || maxDataLength == 0 || maxDataLength < -1) {<NEW_LINE>debuggerPanel.setError(NbBundle.getMessage(PhpDebuggerPanelController.class, "MSG_DebuggerInvalidMaxDataLength"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Integer maxStructuresDepth = parseInteger(debuggerPanel.getMaxStructuresDepth());<NEW_LINE>if (maxStructuresDepth == null || maxStructuresDepth < 1) {<NEW_LINE>debuggerPanel.setError(NbBundle.getMessage(PhpDebuggerPanelController.class, "MSG_DebuggerInvalidMaxStructuresDepth"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Integer maxChildren = parseInteger(debuggerPanel.getMaxChildren());<NEW_LINE>if (maxChildren == null || maxChildren < 1) {<NEW_LINE>debuggerPanel.setError(NbBundle.getMessage(PhpDebuggerPanelController.class, "MSG_DebuggerInvalidMaxChildren"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// everything ok<NEW_LINE>// NOI18N<NEW_LINE>debuggerPanel.setError(" ");<NEW_LINE>return true;<NEW_LINE>} | parseInteger(debuggerPanel.getMaxDataLength()); |
496,961 | public static void fromXmlNode(MMigration parent, Node stepNode) {<NEW_LINE>MMigrationStep mstep = new MMigrationStep(parent);<NEW_LINE>Element step = (Element) stepNode;<NEW_LINE>mstep.setSeqNo(Integer.parseInt(step.getAttribute("SeqNo")));<NEW_LINE>mstep.setStepType(step.getAttribute("StepType"));<NEW_LINE>mstep.setStatusCode(MMigrationStep.STATUSCODE_Unapplied);<NEW_LINE>mstep.saveEx();<NEW_LINE>Node comment = (Element) step.getElementsByTagName("Comments").item(0);<NEW_LINE>if (comment != null)<NEW_LINE>mstep.setComments(comment.getTextContent());<NEW_LINE>if (MMigrationStep.STEPTYPE_ApplicationDictionary.equals(mstep.getStepType())) {<NEW_LINE>NodeList children = step.getElementsByTagName("PO");<NEW_LINE>for (int i = 0; i < children.getLength(); i++) {<NEW_LINE>Element element = (Element) children.item(i);<NEW_LINE>mstep.setAction<MASK><NEW_LINE>mstep.setAD_Table_ID(Integer.parseInt(element.getAttribute("AD_Table_ID")));<NEW_LINE>mstep.setRecord_ID(Integer.parseInt(element.getAttribute("Record_ID")));<NEW_LINE>NodeList data = element.getElementsByTagName("Data");<NEW_LINE>for (int j = 0; j < data.getLength(); j++) {<NEW_LINE>MMigrationData.fromXmlNode(mstep, data.item(j));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (MMigrationStep.STEPTYPE_SQLStatement.equals(mstep.getStepType())) {<NEW_LINE>mstep.setDBType(step.getAttribute("DBType"));<NEW_LINE>// If Parse is defined, set it accordingly, else, use the default or ignore<NEW_LINE>if (!step.getAttribute("Parse").equals("")) {<NEW_LINE>mstep.setParse("Y".equals(step.getAttribute("Parse")));<NEW_LINE>}<NEW_LINE>Node sql = step.getElementsByTagName("SQLStatement").item(0);<NEW_LINE>if (sql != null)<NEW_LINE>mstep.setSQLStatement(sql.getTextContent());<NEW_LINE>sql = step.getElementsByTagName("RollbackStatement").item(0);<NEW_LINE>if (sql != null)<NEW_LINE>mstep.setRollbackStatement(sql.getTextContent());<NEW_LINE>}<NEW_LINE>mstep.saveEx();<NEW_LINE>log.log(Level.CONFIG, mstep.getAD_Migration().toString() + ": Step " + mstep.getSeqNo() + " loaded");<NEW_LINE>} | (element.getAttribute("Action")); |
1,511,855 | public boolean acceptIndexMatch(String documentPath, SearchPattern indexRecord, SearchParticipant participant, AccessRuleSet access) {<NEW_LINE>SuperTypeReferencePattern record = (SuperTypeReferencePattern) indexRecord;<NEW_LINE>boolean isLocalOrAnonymous = record.enclosingTypeName == IIndexConstants.ONE_ZERO;<NEW_LINE>pathRequestor.acceptPath(documentPath, isLocalOrAnonymous);<NEW_LINE>char[] typeName = record.simpleName;<NEW_LINE>char[] enclosingTypeName = null;<NEW_LINE>if (documentPath.toLowerCase().endsWith(SUFFIX_STRING_class)) {<NEW_LINE>int suffix = documentPath.length() - SUFFIX_STRING_class.length();<NEW_LINE>HierarchyBinaryType binaryType = (HierarchyBinaryType) binariesFromIndexMatches.get(documentPath);<NEW_LINE>if (binaryType == null) {<NEW_LINE>enclosingTypeName = record.enclosingTypeName;<NEW_LINE>if (isLocalOrAnonymous) {<NEW_LINE>int lastSlash = documentPath.lastIndexOf('/');<NEW_LINE>int lastDollar = documentPath.lastIndexOf('$');<NEW_LINE>if (lastDollar == -1) {<NEW_LINE>// malformed local or anonymous type: it doesn't contain a $ in its name<NEW_LINE>// treat it as a top level type<NEW_LINE>enclosingTypeName = null;<NEW_LINE>typeName = documentPath.substring(lastSlash + 1, suffix).toCharArray();<NEW_LINE>} else {<NEW_LINE>enclosingTypeName = documentPath.substring(lastSlash + 1, lastDollar).toCharArray();<NEW_LINE>typeName = documentPath.substring(lastDollar + 1, suffix).toCharArray();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>binaryType = new HierarchyBinaryType(record.modifiers, record.pkgName, typeName, enclosingTypeName, record.typeParameterSignatures, record.classOrInterface);<NEW_LINE>binariesFromIndexMatches.put(documentPath, binaryType);<NEW_LINE>}<NEW_LINE>binaryType.recordSuperType(record.superSimpleName, record.superQualification, record.superClassOrInterface);<NEW_LINE>}<NEW_LINE>char[] fqnSuperName = CharOperation.concatNonEmpty(record.pkgName, '.', enclosingTypeName, '$', typeName);<NEW_LINE>if (// local or anonymous types cannot have subtypes outside the cu that define them<NEW_LINE>!isLocalOrAnonymous && !foundSuperNames.containsKey(fqnSuperName)) {<NEW_LINE><MASK><NEW_LINE>queue.add(new SubtypeQuery(fqnSuperName, typeName));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | foundSuperNames.put(fqnSuperName, fqnSuperName); |
1,066,817 | protected String displayForm(HttpServletRequest request, Model model) throws Exception {<NEW_LINE>UserSettingsCommand command;<NEW_LINE>if (!model.containsAttribute("command")) {<NEW_LINE>command = new UserSettingsCommand();<NEW_LINE>User user = getUser(request);<NEW_LINE>if (user != null) {<NEW_LINE>command.setUser(user);<NEW_LINE>command.<MASK><NEW_LINE>UserSettings userSettings = settingsService.getUserSettings(user.getUsername());<NEW_LINE>command.setTranscodeSchemeName(userSettings.getTranscodeScheme().name());<NEW_LINE>command.setAllowedMusicFolderIds(Util.toIntArray(getAllowedMusicFolderIds(user)));<NEW_LINE>command.setCurrentUser(securityService.getCurrentUser(request).getUsername().equals(user.getUsername()));<NEW_LINE>} else {<NEW_LINE>command.setNewUser(true);<NEW_LINE>command.setStreamRole(true);<NEW_LINE>command.setSettingsRole(true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>command = (UserSettingsCommand) model.asMap().get("command");<NEW_LINE>}<NEW_LINE>command.setUsers(securityService.getAllUsers());<NEW_LINE>command.setTranscodingSupported(transcodingService.isDownsamplingSupported(null));<NEW_LINE>command.setTranscodeDirectory(SettingsService.getTranscodeDirectory().toString());<NEW_LINE>command.setTranscodeSchemes(TranscodeScheme.values());<NEW_LINE>command.setLdapEnabled(settingsService.isLdapEnabled());<NEW_LINE>command.setAllMusicFolders(mediaFolderService.getAllMusicFolders());<NEW_LINE>model.addAttribute("command", command);<NEW_LINE>return "userSettings";<NEW_LINE>} | setEmail(user.getEmail()); |
514,167 | private Mono<Response<Flux<ByteBuffer>>> deletePublicIpWithResponseAsync(String resourceGroupName, String publicIpId, String privateCloudName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (publicIpId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (privateCloudName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.deletePublicIp(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), <MASK><NEW_LINE>} | publicIpId, privateCloudName, accept, context); |
193,034 | private void initializeTypes() {<NEW_LINE>// create class objects for builtin types<NEW_LINE>for (PythonBuiltinClassType builtinClass : PythonBuiltinClassType.VALUES) {<NEW_LINE>initializeBuiltinClass(builtinClass);<NEW_LINE>}<NEW_LINE>// n.b.: the builtin modules and classes and their constructors are initialized first here,<NEW_LINE>// so we have the mapping from java classes to python classes and builtin names to modules<NEW_LINE>// available.<NEW_LINE>for (PythonBuiltins builtin : builtins) {<NEW_LINE>CoreFunctions annotation = builtin.getClass().getAnnotation(CoreFunctions.class);<NEW_LINE>if (annotation.defineModule().length() > 0) {<NEW_LINE>createModule(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// publish builtin types in the corresponding modules<NEW_LINE>for (PythonBuiltinClassType builtinClass : PythonBuiltinClassType.VALUES) {<NEW_LINE>String module = builtinClass.getPublishInModule();<NEW_LINE>if (module != null) {<NEW_LINE>PythonModule pythonModule = lookupBuiltinModule(module);<NEW_LINE>if (pythonModule != null) {<NEW_LINE>pythonModule.setAttribute(builtinClass.getName(), lookupType(builtinClass));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now initialize well-known objects<NEW_LINE>pyTrue = factory().createInt(PythonBuiltinClassType.Boolean, BigInteger.ONE);<NEW_LINE>pyFalse = factory().createInt(PythonBuiltinClassType.Boolean, BigInteger.ZERO);<NEW_LINE>pyNaN = factory().createFloat(Double.NaN);<NEW_LINE>} | annotation.defineModule(), builtin); |
328,503 | protected void readObjStm(PRStream stream, IntHashtable map) throws IOException {<NEW_LINE>int first = stream.getAsNumber(PdfName.FIRST).intValue();<NEW_LINE>int n = stream.getAsNumber(PdfName.N).intValue();<NEW_LINE>byte[] b = getStreamBytes(stream, tokens.getFile());<NEW_LINE>PRTokeniser saveTokens = tokens;<NEW_LINE>tokens = new PRTokeniser(b);<NEW_LINE>try {<NEW_LINE>int[] address = new int[n];<NEW_LINE>int[] objNumber = new int[n];<NEW_LINE>boolean ok = true;<NEW_LINE>for (int k = 0; k < n; ++k) {<NEW_LINE>ok = tokens.nextToken();<NEW_LINE>if (!ok)<NEW_LINE>break;<NEW_LINE>if (tokens.getTokenType() != PRTokeniser.TK_NUMBER) {<NEW_LINE>ok = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>objNumber[k] = tokens.intValue();<NEW_LINE>ok = tokens.nextToken();<NEW_LINE>if (!ok)<NEW_LINE>break;<NEW_LINE>if (tokens.getTokenType() != PRTokeniser.TK_NUMBER) {<NEW_LINE>ok = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>address[k] = tokens.intValue() + first;<NEW_LINE>}<NEW_LINE>if (!ok)<NEW_LINE>throw new InvalidPdfException<MASK><NEW_LINE>for (int k = 0; k < n; ++k) {<NEW_LINE>if (map.containsKey(k)) {<NEW_LINE>tokens.seek(address[k]);<NEW_LINE>PdfObject obj = readPRObject();<NEW_LINE>xrefObj.set(objNumber[k], obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>tokens = saveTokens;<NEW_LINE>}<NEW_LINE>} | (MessageLocalization.getComposedMessage("error.reading.objstm")); |
382,958 | final ListVirtualClustersResult executeListVirtualClusters(ListVirtualClustersRequest listVirtualClustersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listVirtualClustersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListVirtualClustersRequest> request = null;<NEW_LINE>Response<ListVirtualClustersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListVirtualClustersRequestProtocolMarshaller(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, "EMR containers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListVirtualClusters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListVirtualClustersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListVirtualClustersResultJsonUnmarshaller());<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(listVirtualClustersRequest)); |
76,193 | public RepresentationModel<T> beforeBodyWrite(@Nullable RepresentationModel<T> body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) {<NEW_LINE>// Only step in if we are about to render HAL FORMS<NEW_LINE>if (!MediaTypes.HAL_FORMS_JSON.equals(selectedContentType)) {<NEW_LINE>return body;<NEW_LINE>}<NEW_LINE>List<MediaType> accept = request.getHeaders().getAccept();<NEW_LINE>boolean hasAffordances = body != null && body.getLinks().stream().anyMatch(it -> !it.getAffordances().isEmpty());<NEW_LINE>// Affordances registered -> we're fine as we will render templates<NEW_LINE>if (hasAffordances) {<NEW_LINE>return body;<NEW_LINE>}<NEW_LINE>// Check whether either HAL or general JSON are acceptable<NEW_LINE>for (MediaType candidate : accept) {<NEW_LINE>for (MediaType supported : SUPPORTED_MEDIA_TYPES) {<NEW_LINE>if (candidate.isCompatibleWith(supported)) {<NEW_LINE>// Tweak response to expose that<NEW_LINE>logger.debug(String.format(MESSAGE, supported));<NEW_LINE>response.<MASK><NEW_LINE>return body;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Reject the request otherwise<NEW_LINE>throw new HttpMediaTypeNotAcceptableException(SUPPORTED_MEDIA_TYPES);<NEW_LINE>} | getHeaders().setContentType(supported); |
1,263,738 | public boolean isChanged() {<NEW_LINE>String saved = AnalysisOptions.getInstance().getCodingStandardsFixerPath();<NEW_LINE>String current <MASK><NEW_LINE>if (saved == null ? !current.isEmpty() : !saved.equals(current)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>saved = AnalysisOptions.getInstance().getCodingStandardsFixerVersion();<NEW_LINE>current = getCodingStandardsFixerVersion();<NEW_LINE>if (saved == null ? StringUtils.hasText(current) : !saved.equals(current)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>saved = AnalysisOptions.getInstance().getCodingStandardsFixerLevel();<NEW_LINE>current = getCodingStandardsFixerLevel();<NEW_LINE>if (saved == null ? StringUtils.hasText(current) : !saved.equals(current)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>saved = AnalysisOptions.getInstance().getCodingStandardsFixerConfig();<NEW_LINE>current = getCodingStandardsFixerConfig();<NEW_LINE>if (saved == null ? StringUtils.hasText(current) : !saved.equals(current)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>saved = AnalysisOptions.getInstance().getCodingStandardsFixerOptions();<NEW_LINE>current = getCodingStandardsFixerOptions();<NEW_LINE>return !saved.equals(current);<NEW_LINE>} | = getCodingStandardsFixerPath().trim(); |
1,757,136 | default CompletableFuture<KeyValue<K, V>> vDelete(K k, long expectedVersion) {<NEW_LINE>TxnOp<K, V> op = getOpFactory().newTxn().If(newCompareVersion(CompareResult.EQUAL, k, expectedVersion)).Then(getOpFactory().newDelete(k, Options.deleteAndGet())).build();<NEW_LINE>return txn(op).thenCompose(result -> {<NEW_LINE>try {<NEW_LINE>Code code = result.code();<NEW_LINE>if (Code.OK == code && !result.isSuccess()) {<NEW_LINE>code = Code.BAD_REVISION;<NEW_LINE>}<NEW_LINE>if (Code.OK == code) {<NEW_LINE>List<Result<K, V>> subResults = result.results();<NEW_LINE>DeleteResult<K, V> deleteResult = (DeleteResult<K, V>) subResults.get(0);<NEW_LINE>List<KeyValue<K, V>> prevKvs = deleteResult.getPrevKvsAndClear();<NEW_LINE>if (prevKvs.isEmpty()) {<NEW_LINE>return FutureUtils.value(null);<NEW_LINE>} else {<NEW_LINE>return FutureUtils.value<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return failWithCode(code, "Failed to vDelete key " + k + " (version=" + expectedVersion + ") to store " + name());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>result.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (prevKvs.get(0)); |
1,052,869 | public // ///////////////////////////////////////////////////////////////<NEW_LINE>void initDataSource() {<NEW_LINE>if (dataSource == null) {<NEW_LINE>if (dataSourceJndiName != null) {<NEW_LINE>try {<NEW_LINE>dataSource = (DataSource) new InitialContext().lookup(dataSourceJndiName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ActivitiException("couldn't lookup datasource from " + dataSourceJndiName + ": " + <MASK><NEW_LINE>}<NEW_LINE>} else if (jdbcUrl != null) {<NEW_LINE>if ((jdbcDriver == null) || (jdbcUsername == null)) {<NEW_LINE>throw new ActivitiException("DataSource or JDBC properties have to be specified in a process engine configuration");<NEW_LINE>}<NEW_LINE>log.debug("initializing datasource to db: {}", jdbcUrl);<NEW_LINE>PooledDataSource pooledDataSource = new PooledDataSource(ReflectUtil.getClassLoader(), jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword);<NEW_LINE>if (jdbcMaxActiveConnections > 0) {<NEW_LINE>pooledDataSource.setPoolMaximumActiveConnections(jdbcMaxActiveConnections);<NEW_LINE>}<NEW_LINE>if (jdbcMaxIdleConnections > 0) {<NEW_LINE>pooledDataSource.setPoolMaximumIdleConnections(jdbcMaxIdleConnections);<NEW_LINE>}<NEW_LINE>if (jdbcMaxCheckoutTime > 0) {<NEW_LINE>pooledDataSource.setPoolMaximumCheckoutTime(jdbcMaxCheckoutTime);<NEW_LINE>}<NEW_LINE>if (jdbcMaxWaitTime > 0) {<NEW_LINE>pooledDataSource.setPoolTimeToWait(jdbcMaxWaitTime);<NEW_LINE>}<NEW_LINE>if (jdbcPingEnabled) {<NEW_LINE>pooledDataSource.setPoolPingEnabled(true);<NEW_LINE>if (jdbcPingQuery != null) {<NEW_LINE>pooledDataSource.setPoolPingQuery(jdbcPingQuery);<NEW_LINE>}<NEW_LINE>pooledDataSource.setPoolPingConnectionsNotUsedFor(jdbcPingConnectionNotUsedFor);<NEW_LINE>}<NEW_LINE>if (jdbcDefaultTransactionIsolationLevel > 0) {<NEW_LINE>pooledDataSource.setDefaultTransactionIsolationLevel(jdbcDefaultTransactionIsolationLevel);<NEW_LINE>}<NEW_LINE>dataSource = pooledDataSource;<NEW_LINE>}<NEW_LINE>if (dataSource instanceof PooledDataSource) {<NEW_LINE>// ACT-233: connection pool of Ibatis is not properly<NEW_LINE>// initialized if this is not called!<NEW_LINE>((PooledDataSource) dataSource).forceCloseAll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (databaseType == null) {<NEW_LINE>initDatabaseType();<NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,639,476 | private DomNode toXmlNode() {<NEW_LINE>DomNode root = new DomNode(nodeNameFor("application"));<NEW_LINE>Map<String, String> rootAttributes = Cast.uncheckedCast(root.attributes());<NEW_LINE>rootAttributes.put("version", version);<NEW_LINE>if (!"1.3".equals(version)) {<NEW_LINE>rootAttributes.put("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");<NEW_LINE>}<NEW_LINE>if ("1.3".equals(version)) {<NEW_LINE>root.setPublicId("-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN");<NEW_LINE>root.setSystemId("http://java.sun.com/dtd/application_1_3.dtd");<NEW_LINE>} else if ("1.4".equals(version)) {<NEW_LINE>rootAttributes.put("xsi:schemaLocation", "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd");<NEW_LINE>} else if ("5".equals(version) || "6".equals(version)) {<NEW_LINE>rootAttributes.put("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_" + version + ".xsd");<NEW_LINE>} else if ("7".equals(version)) {<NEW_LINE>rootAttributes.put("xsi:schemaLocation", "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_" + version + ".xsd");<NEW_LINE>}<NEW_LINE>if (applicationName != null) {<NEW_LINE>new Node(root, nodeNameFor("application-name"), applicationName);<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>new Node(root<MASK><NEW_LINE>}<NEW_LINE>if (displayName != null) {<NEW_LINE>new Node(root, nodeNameFor("display-name"), displayName);<NEW_LINE>}<NEW_LINE>if (initializeInOrder != null && initializeInOrder) {<NEW_LINE>new Node(root, nodeNameFor("initialize-in-order"), initializeInOrder);<NEW_LINE>}<NEW_LINE>for (EarModule module : modules) {<NEW_LINE>Node moduleNode = new Node(root, nodeNameFor("module"));<NEW_LINE>module.toXmlNode(moduleNode, moduleNameFor(module));<NEW_LINE>}<NEW_LINE>if (securityRoles != null) {<NEW_LINE>for (EarSecurityRole role : securityRoles) {<NEW_LINE>Node roleNode = new Node(root, nodeNameFor("security-role"));<NEW_LINE>if (role.getDescription() != null) {<NEW_LINE>new Node(roleNode, nodeNameFor("description"), role.getDescription());<NEW_LINE>}<NEW_LINE>new Node(roleNode, nodeNameFor("role-name"), role.getRoleName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (libraryDirectory != null) {<NEW_LINE>new Node(root, nodeNameFor("library-directory"), libraryDirectory);<NEW_LINE>}<NEW_LINE>return root;<NEW_LINE>} | , nodeNameFor("description"), description); |
598,581 | public Quaternion fromEuler(double yaw, double pitch, double roll) {<NEW_LINE>yaw = Math.toRadians(yaw);<NEW_LINE>pitch = Math.toRadians(pitch);<NEW_LINE>roll = Math.toRadians(roll);<NEW_LINE>double hr = roll * 0.5;<NEW_LINE>double shr = Math.sin(hr);<NEW_LINE>double chr = Math.cos(hr);<NEW_LINE>double hp = pitch * 0.5;<NEW_LINE>double <MASK><NEW_LINE>double chp = Math.cos(hp);<NEW_LINE>double hy = yaw * 0.5;<NEW_LINE>double shy = Math.sin(hy);<NEW_LINE>double chy = Math.cos(hy);<NEW_LINE>double chy_shp = chy * shp;<NEW_LINE>double shy_chp = shy * chp;<NEW_LINE>double chy_chp = chy * chp;<NEW_LINE>double shy_shp = shy * shp;<NEW_LINE>x = (chy_shp * chr) + (shy_chp * shr);<NEW_LINE>y = (shy_chp * chr) - (chy_shp * shr);<NEW_LINE>z = (chy_chp * shr) - (shy_shp * chr);<NEW_LINE>w = (chy_chp * chr) + (shy_shp * shr);<NEW_LINE>return this;<NEW_LINE>} | shp = Math.sin(hp); |
72,785 | public synchronized void cleanUp(Set<Long> activeTableIds) {<NEW_LINE>// We have to remember that there might be some race conditions when there are two tables created at once.<NEW_LINE>// That can lead to a situation when MemoryPagesStore already knows about a newer second table on some worker<NEW_LINE>// but cleanUp is triggered by insert from older first table, which MemoryTableHandle was created before<NEW_LINE>// second table creation. Thus activeTableIds can have missing latest ids and we can only clean up tables<NEW_LINE>// that:<NEW_LINE>// - have smaller value then max(activeTableIds).<NEW_LINE>// - are missing from activeTableIds set<NEW_LINE>if (activeTableIds.isEmpty()) {<NEW_LINE>// if activeTableIds is empty, we cannot determine latestTableId...<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long <MASK><NEW_LINE>for (Iterator<Map.Entry<Long, TableData>> tableDataIterator = tables.entrySet().iterator(); tableDataIterator.hasNext(); ) {<NEW_LINE>Map.Entry<Long, TableData> tablePagesEntry = tableDataIterator.next();<NEW_LINE>Long tableId = tablePagesEntry.getKey();<NEW_LINE>if (tableId < latestTableId && !activeTableIds.contains(tableId)) {<NEW_LINE>for (Page removedPage : tablePagesEntry.getValue().getPages()) {<NEW_LINE>currentBytes -= removedPage.getRetainedSizeInBytes();<NEW_LINE>}<NEW_LINE>tableDataIterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | latestTableId = Collections.max(activeTableIds); |
1,403,214 | public void onClick(View v) {<NEW_LINE>EntryEditActivity act = EntryEditActivity.this;<NEW_LINE>if (!validateBeforeSaving()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PwEntry newEntry = populateNewEntry();<NEW_LINE>if (newEntry.getTitle().equals(mEntry.getTitle())) {<NEW_LINE>setResult(KeePass.EXIT_REFRESH);<NEW_LINE>} else {<NEW_LINE>setResult(KeePass.EXIT_REFRESH_TITLE);<NEW_LINE>}<NEW_LINE>RunnableOnFinish task;<NEW_LINE>OnFinish onFinish = act.new AfterSave(new Handler());<NEW_LINE>if (mIsNew) {<NEW_LINE>task = AddEntry.getInstance(EntryEditActivity.this, App.getDB(), newEntry, onFinish);<NEW_LINE>} else {<NEW_LINE>task = new UpdateEntry(EntryEditActivity.this, App.getDB(), mEntry, newEntry, onFinish);<NEW_LINE>}<NEW_LINE>ProgressTask pt = new ProgressTask(act, <MASK><NEW_LINE>pt.run();<NEW_LINE>} | task, R.string.saving_database); |
1,841,720 | final GetBotResult executeGetBot(GetBotRequest getBotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBotRequest> request = null;<NEW_LINE>Response<GetBotResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetBotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBotRequest));<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, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBotResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBotResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,733,387 | protected void onCreate(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>report = (Report) getIntent().getSerializableExtra(EXTRA_REPORT);<NEW_LINE>final FloatingActionButton fab = findViewById(R.id.fab);<NEW_LINE>final TextView headerText = findViewById(R.id.header);<NEW_LINE>final TextView stacktraceText = findViewById(R.id.stacktrace);<NEW_LINE>final View container = findViewById(R.id.container);<NEW_LINE>fab.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>final Intent intent = new Intent(Intent.ACTION_SEND);<NEW_LINE>final String text = getExternalText();<NEW_LINE>intent.putExtra(Intent.EXTRA_TEXT, text);<NEW_LINE>intent.setType("text/plain");<NEW_LINE>startActivity(Intent.createChooser(intent, "Share"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>stacktraceText.setHorizontallyScrolling(true);<NEW_LINE>stacktraceText.setMovementMethod(new ScrollingMovementMethod());<NEW_LINE>headerText.setText(report.header);<NEW_LINE>stacktraceText.setText(report.trace);<NEW_LINE>container.setOnClickListener(this);<NEW_LINE>} | setContentView(R.layout.hc_activity); |
347,204 | /*<NEW_LINE>public void handlePressed(MouseEvent e, int sel) {<NEW_LINE>boolean shift = e.isShiftDown();<NEW_LINE>AndroidEditor aeditor = (AndroidEditor) editor;<NEW_LINE><NEW_LINE>switch (sel) {<NEW_LINE>case RUN:<NEW_LINE>if (!shift) {<NEW_LINE>aeditor.handleRunDevice();<NEW_LINE>} else {<NEW_LINE>aeditor.handleRunEmulator();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE><NEW_LINE>case STOP:<NEW_LINE>aeditor.handleStop();<NEW_LINE>break;<NEW_LINE><NEW_LINE>case OPEN:<NEW_LINE>// TODO I think we need a longer chain of accessors here.<NEW_LINE>JPopupMenu popup = editor.getMode()<MASK><NEW_LINE>popup.show(this, e.getX(), e.getY());<NEW_LINE>break;<NEW_LINE><NEW_LINE>case NEW:<NEW_LINE>// if (shift) {<NEW_LINE>base.handleNew();<NEW_LINE>// } else {<NEW_LINE>// base.handleNewReplace();<NEW_LINE>// }<NEW_LINE>break;<NEW_LINE><NEW_LINE>case SAVE:<NEW_LINE>aeditor.handleSave(false);<NEW_LINE>break;<NEW_LINE><NEW_LINE>case EXPORT:<NEW_LINE>if (!shift) {<NEW_LINE>aeditor.handleExportPackage();<NEW_LINE>} else {<NEW_LINE>aeditor.handleExportProject();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public List<EditorButton> createButtons() {<NEW_LINE>// aEditor not ready yet because this is called by super()<NEW_LINE>final boolean debug = ((AndroidEditor) editor).isDebuggerEnabled();<NEW_LINE>ArrayList<EditorButton> toReturn = new ArrayList<EditorButton>();<NEW_LINE>final String runText = debug ? Language.text("toolbar.debug") : Language.text("Run on Device");<NEW_LINE>runButton = new EditorButton(this, "/lib/toolbar/run", runText, "Run on emulator") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>handleRun(e.getModifiers());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>toReturn.add(runButton);<NEW_LINE>if (debug) {<NEW_LINE>stepButton = new EditorButton(this, "/lib/toolbar/step", Language.text("menu.debug.step"), Language.text("menu.debug.step_into"), Language.text("menu.debug.step_out")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>final int mask = ActionEvent.SHIFT_MASK | ActionEvent.ALT_MASK;<NEW_LINE>aEditor.handleStep(e.getModifiers() & mask);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>toReturn.add(stepButton);<NEW_LINE>continueButton = new EditorButton(this, "/lib/toolbar/continue", Language.text("menu.debug.continue")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>aEditor.handleContinue();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>toReturn.add(continueButton);<NEW_LINE>}<NEW_LINE>stopButton = new EditorButton(this, "/lib/toolbar/stop", Language.text("toolbar.stop")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>handleStop();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>toReturn.add(stopButton);<NEW_LINE>return toReturn;<NEW_LINE>} | .getToolbarMenu().getPopupMenu(); |
1,355,515 | final GetGroupsResult executeGetGroups(GetGroupsRequest getGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetGroupsRequest> request = null;<NEW_LINE>Response<GetGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetGroupsRequestProtocolMarshaller(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, "XRay");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetGroupsResultJsonUnmarshaller());<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(getGroupsRequest)); |
68,158 | public R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) throws Exception {<NEW_LINE>if (t1 == null) {<NEW_LINE>throw new NullPointerException("t1 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t2 == null) {<NEW_LINE>throw new NullPointerException("t2 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t3 == null) {<NEW_LINE>throw new NullPointerException("t3 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t4 == null) {<NEW_LINE>throw new NullPointerException("t4 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t5 == null) {<NEW_LINE>throw new NullPointerException("t5 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t6 == null) {<NEW_LINE>throw new NullPointerException("t6 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t7 == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (t8 == null) {<NEW_LINE>throw new NullPointerException("t8 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t9 == null) {<NEW_LINE>throw new NullPointerException("t9 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>R v;<NEW_LINE>try {<NEW_LINE>v = actual.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex));<NEW_LINE>}<NEW_LINE>if (v == null) {<NEW_LINE>throw new NullPointerException("The BiFunction returned null, tag = " + tag);<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>} | throw new NullPointerException("t7 is null, tag = " + tag); |
678,811 | public Object execute(ExecutionEvent event, Command command, IPath path) throws ExecutionException {<NEW_LINE>if (JAVA_WORKSPACE_COMMAND.equals(command.getCommand())) {<NEW_LINE>String cmdId = (String) command.getArguments().get(0);<NEW_LINE>List<Object> arguments = command.getArguments().subList(1, command.getArguments().size());<NEW_LINE>switch(cmdId) {<NEW_LINE>case ADD_CLASSPATH_LISTENER_COMMAND:<NEW_LINE>String callbackCommandIdForAdd = (String) arguments.get(0);<NEW_LINE>Boolean batched = (<MASK><NEW_LINE>return STS4LanguageClientImpl.CLASSPATH_SERVICE.addClasspathListener(callbackCommandIdForAdd, batched);<NEW_LINE>case REMOVE_CLASSPATH_LISTENER_COMMAND:<NEW_LINE>String callbackCommandIdForRemove = (String) arguments.get(0);<NEW_LINE>return STS4LanguageClientImpl.CLASSPATH_SERVICE.removeClasspathListener(callbackCommandIdForRemove);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | Boolean) arguments.get(1); |
587,787 | private static void returnExceptVoidAndLuaValue(MethodSpec.Builder mb, final String call, TypeName returnType, boolean initGlobals) {<NEW_LINE>if (isBoolean(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, getLuaBoolean(call), LuaValue, LuaValue);<NEW_LINE>} else if (isInt(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, getLuaNumberI(call), LuaNumber);<NEW_LINE>} else if (isDouble(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, getLuaNumberD(call), LuaNumber);<NEW_LINE>} else if (isString(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb<MASK><NEW_LINE>} else if (isLuaValue(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, call);<NEW_LINE>} else if (returnType instanceof ArrayTypeName) {<NEW_LINE>TypeName ct = ((ArrayTypeName) returnType).componentType;<NEW_LINE>if (!initGlobals)<NEW_LINE>mb.addStatement("$T globals = $T.getGlobalsByLState(L)", Globals, Globals);<NEW_LINE>mb.addCode("return ");<NEW_LINE>if (ct.isPrimitive()) {<NEW_LINE>LuaValue_varargsOf(mb, "$T.toTable(globals, " + call + ")", PrimitiveArrayUtils);<NEW_LINE>} else {<NEW_LINE>LuaValue_varargsOf(mb, "$T.toLuaArray(globals, " + call + ")", ObjectArrayUtils);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!initGlobals)<NEW_LINE>mb.addStatement("$T globals = $T.getGlobalsByLState(L)", Globals, Globals);<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, translateJavaToLua(call), UserdataTranslator);<NEW_LINE>}<NEW_LINE>} | , getLuaString(call), LuaString); |
1,744,947 | public Clustering<BiclusterWithInversionsModel> biclustering() {<NEW_LINE>double[][] mat = RelationUtil.relationAsMatrix(relation, rowIDs);<NEW_LINE>BiclusterCandidate cand = new BiclusterCandidate(getRowDim(), getColDim());<NEW_LINE>Clustering<BiclusterWithInversionsModel> result = new Clustering<>();<NEW_LINE>Metadata.of(result).setLongName("Cheng-and-Church");<NEW_LINE>ModifiableDBIDs noise = DBIDUtil.newHashSet(relation.getDBIDs());<NEW_LINE>Random rand = rnd.getSingleThreadedRandom();<NEW_LINE>FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Extracting Cluster", n, LOG) : null;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>cand.reset();<NEW_LINE>multipleNodeDeletion(mat, cand);<NEW_LINE>if (LOG.isVeryVerbose()) {<NEW_LINE>LOG.veryverbose("Residue after Alg 2: " + cand.residue + " " + cand.rowcard + "x" + cand.colcard);<NEW_LINE>}<NEW_LINE>singleNodeDeletion(mat, cand);<NEW_LINE>if (LOG.isVeryVerbose()) {<NEW_LINE>LOG.veryverbose("Residue after Alg 1: " + cand.residue + " " + cand.rowcard + "x" + cand.colcard);<NEW_LINE>}<NEW_LINE>nodeAddition(mat, cand);<NEW_LINE>if (LOG.isVeryVerbose()) {<NEW_LINE>LOG.veryverbose("Residue after Alg 3: " + cand.residue + " " + cand.rowcard + "x" + cand.colcard);<NEW_LINE>}<NEW_LINE>cand.maskMatrix(mat, dist, rand);<NEW_LINE>BiclusterWithInversionsModel model = new BiclusterWithInversionsModel(colsBitsetToIDs(cand.cols), rowsBitsetToIDs(cand.irow));<NEW_LINE>final ArrayDBIDs cids = rowsBitsetToIDs(cand.rows);<NEW_LINE>noise.removeDBIDs(cids);<NEW_LINE>result.addToplevelCluster(new Cluster<>(cids, model));<NEW_LINE>if (LOG.isVerbose()) {<NEW_LINE>LOG.verbose("Score of bicluster " + (i + 1) + <MASK><NEW_LINE>LOG.verbose("Number of rows: " + cand.rowcard + "\n");<NEW_LINE>LOG.verbose("Number of columns: " + cand.colcard + "\n");<NEW_LINE>// LOG.verbose("Total number of masked values: " + maskedVals.size() +<NEW_LINE>// "\n");<NEW_LINE>}<NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>}<NEW_LINE>// Add a noise cluster, full-dimensional.<NEW_LINE>if (!noise.isEmpty()) {<NEW_LINE>long[] allcols = BitsUtil.ones(getColDim());<NEW_LINE>BiclusterWithInversionsModel model = new BiclusterWithInversionsModel(colsBitsetToIDs(allcols), DBIDUtil.EMPTYDBIDS);<NEW_LINE>result.addToplevelCluster(new Cluster<>(noise, true, model));<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(prog);<NEW_LINE>return result;<NEW_LINE>} | ": " + cand.residue + "\n"); |
221,007 | public void registerAdapters(ReactiveAdapterRegistry registry) {<NEW_LINE>registry.registerReactiveType(ReactiveTypeDescriptor.multiValue(Flowable.class, Flowable::empty), source -> (Flowable<?>) source, Flowable::fromPublisher);<NEW_LINE>registry.registerReactiveType(ReactiveTypeDescriptor.multiValue(Observable.class, Observable::empty), source -> ((Observable<?>) source).toFlowable(BackpressureStrategy.BUFFER), source -> Flowable.fromPublisher(source).toObservable());<NEW_LINE>registry.registerReactiveType(ReactiveTypeDescriptor.singleRequiredValue(Single.class), source -> ((Single<?>) source).toFlowable(), source -> Flowable.fromPublisher(source).toObservable().singleElement().toSingle());<NEW_LINE>registry.registerReactiveType(ReactiveTypeDescriptor.singleOptionalValue(Maybe.class, Maybe::empty), source -> ((Maybe<?>) source).toFlowable(), source -> Flowable.fromPublisher(source).toObservable().singleElement());<NEW_LINE>registry.registerReactiveType(ReactiveTypeDescriptor.noValue(Completable.class, Completable::complete), source -> ((Completable) source).toFlowable(), source -> Flowable.fromPublisher(source).<MASK><NEW_LINE>} | toObservable().ignoreElements()); |
27,075 | public static <T extends ImageGray<T>> void orderBandsIntoRGB(Planar<T> image, BufferedImage input) {<NEW_LINE>boolean swap = swapBandOrder(input);<NEW_LINE>// Output formats are: RGB and RGBA<NEW_LINE>if (swap) {<NEW_LINE>if (image.getNumBands() == 3) {<NEW_LINE>int bufferedImageType = input.getType();<NEW_LINE>if (bufferedImageType == BufferedImage.TYPE_3BYTE_BGR || bufferedImageType == BufferedImage.TYPE_INT_BGR) {<NEW_LINE>T tmp = image.getBand(0);<NEW_LINE>image.bands[0] = image.getBand(2);<NEW_LINE>image.bands[2] = tmp;<NEW_LINE>}<NEW_LINE>} else if (image.getNumBands() == 4) {<NEW_LINE>T[] temp = (T[]) Array.newInstance(image.getBandType(), 4);<NEW_LINE>int bufferedImageType = input.getType();<NEW_LINE>if (bufferedImageType == BufferedImage.TYPE_INT_ARGB || bufferedImageType == BufferedImage.TYPE_INT_ARGB_PRE) {<NEW_LINE>temp[0] = image.getBand(1);<NEW_LINE>temp[1] = image.getBand(2);<NEW_LINE>temp[2] = image.getBand(3);<NEW_LINE>temp[3] = image.getBand(0);<NEW_LINE>} else if (bufferedImageType == BufferedImage.TYPE_4BYTE_ABGR || bufferedImageType == BufferedImage.TYPE_4BYTE_ABGR_PRE) {<NEW_LINE>temp[0] = image.getBand(3);<NEW_LINE>temp[1<MASK><NEW_LINE>temp[2] = image.getBand(1);<NEW_LINE>temp[3] = image.getBand(0);<NEW_LINE>}<NEW_LINE>image.bands[0] = temp[0];<NEW_LINE>image.bands[1] = temp[1];<NEW_LINE>image.bands[2] = temp[2];<NEW_LINE>image.bands[3] = temp[3];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] = image.getBand(2); |
1,607,118 | public String toDebugString(final Locale locale) {<NEW_LINE>if (values == null) {<NEW_LINE>return "No Email Item";<NEW_LINE>}<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>for (final Map.Entry<String, EmailItemBean> entry : values.entrySet()) {<NEW_LINE>final String localeKey = entry.getKey();<NEW_LINE>final EmailItemBean emailItemBean = entry.getValue();<NEW_LINE>sb.append("EmailItem ").append(LocaleHelper.debugLabel(LocaleHelper.parseLocaleString(localeKey))).append(": \n");<NEW_LINE>sb.append(" To:").append(emailItemBean.getTo<MASK><NEW_LINE>sb.append("From:").append(emailItemBean.getFrom()).append('\n');<NEW_LINE>sb.append("Subj:").append(emailItemBean.getSubject()).append('\n');<NEW_LINE>sb.append("Body:").append(emailItemBean.getBodyPlain()).append('\n');<NEW_LINE>sb.append("Html:").append(emailItemBean.getBodyHtml()).append('\n');<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | ()).append('\n'); |
1,654,425 | private void writeResLog(File newFile, File oldFile, int mode) throws IOException {<NEW_LINE>if (logWriter != null) {<NEW_LINE>String log = "";<NEW_LINE>String relative;<NEW_LINE>switch(mode) {<NEW_LINE>case TypedValue.ADD:<NEW_LINE>relative = getRelativePathStringToNewFile(newFile);<NEW_LINE>Logger.d("Found add resource: " + relative);<NEW_LINE>log = "add resource: " + relative + ", oldSize=" + FileOperation.getFileSizes(oldFile) + ", newSize=" + FileOperation.getFileSizes(newFile);<NEW_LINE>break;<NEW_LINE>case TypedValue.MOD:<NEW_LINE>relative = getRelativePathStringToNewFile(newFile);<NEW_LINE>Logger.d("Found modify resource: " + relative);<NEW_LINE>log = "modify resource: " + relative + ", oldSize=" + FileOperation.getFileSizes(oldFile) + <MASK><NEW_LINE>break;<NEW_LINE>case TypedValue.DEL:<NEW_LINE>relative = getRelativePathStringToOldFile(oldFile);<NEW_LINE>Logger.d("Found deleted resource: " + relative);<NEW_LINE>log = "deleted resource: " + relative + ", oldSize=" + FileOperation.getFileSizes(oldFile) + ", newSize=" + FileOperation.getFileSizes(newFile);<NEW_LINE>break;<NEW_LINE>case TypedValue.LARGE_MOD:<NEW_LINE>relative = getRelativePathStringToNewFile(newFile);<NEW_LINE>Logger.d("Found large modify resource: " + relative + " size:" + newFile.length());<NEW_LINE>log = "large modify resource: " + relative + ", oldSize=" + FileOperation.getFileSizes(oldFile) + ", newSize=" + FileOperation.getFileSizes(newFile);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>logWriter.writeLineToInfoFile(log);<NEW_LINE>}<NEW_LINE>} | ", newSize=" + FileOperation.getFileSizes(newFile); |
1,851,792 | public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.userId, convLabelName("User Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.userId, convLabelName("User Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.no, convLabelName("No"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.no, convLabelName("No"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this<MASK><NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.deleteFlag, convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | .insertUser, convLabelName("Insert User")); |
1,489,746 | public static SAMFileHeader createArtificialSamHeaderWithPrograms(int numberOfChromosomes, int startingChromosome, int chromosomeSize, int programCount) {<NEW_LINE>final SAMFileHeader header = <MASK><NEW_LINE>final List<SAMProgramRecord> programRecords = new ArrayList<>();<NEW_LINE>for (int i = 0; i < programCount; i++) {<NEW_LINE>final SAMProgramRecord rec = new SAMProgramRecord(Integer.toString(i));<NEW_LINE>rec.setCommandLine("run " + Integer.toString(i));<NEW_LINE>rec.setProgramVersion("1.0");<NEW_LINE>if (i > 0) {<NEW_LINE>rec.setPreviousProgramGroupId(Integer.toString(i - 1));<NEW_LINE>}<NEW_LINE>rec.setProgramName(DEFAULT_PROGRAM_NAME + i);<NEW_LINE>programRecords.add(rec);<NEW_LINE>}<NEW_LINE>header.setProgramRecords(programRecords);<NEW_LINE>return header;<NEW_LINE>} | createArtificialSamHeader(numberOfChromosomes, startingChromosome, chromosomeSize); |
1,463,142 | private List<IdentityItem> scanIdentityList(Business business, IdentitySheetConfigurator configurator, Sheet sheet) throws Exception {<NEW_LINE>if (null == configurator.getUniqueColumn()) {<NEW_LINE>throw new ExceptionUniqueColumnEmpty();<NEW_LINE>}<NEW_LINE>if (null == configurator.getUnitCodeColumn()) {<NEW_LINE>throw new ExceptionUnitUniqueColumnEmpty();<NEW_LINE>}<NEW_LINE>List<IdentityItem> identitys = new ArrayList<>();<NEW_LINE>for (int i = configurator.getFirstRow(); i <= configurator.getLastRow(); i++) {<NEW_LINE>Row row = sheet.getRow(i);<NEW_LINE>if (null != row) {<NEW_LINE>String unique = configurator.getCellStringValue(row.getCell(configurator.getUniqueColumn()));<NEW_LINE>String unitCode = configurator.getCellStringValue(row.getCell(configurator.getUnitCodeColumn()));<NEW_LINE>String majorStr = configurator.getCellStringValue(row.getCell<MASK><NEW_LINE>Boolean major = false;<NEW_LINE>if (majorStr.equals("true")) {<NEW_LINE>major = BooleanUtils.toBooleanObject(majorStr);<NEW_LINE>}<NEW_LINE>// if (StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(mobile)) {<NEW_LINE>IdentityItem identityItem = new IdentityItem();<NEW_LINE>identityItem.setRow(i);<NEW_LINE>identityItem.setPersonCode(unique);<NEW_LINE>identityItem.setUnitCode(unitCode);<NEW_LINE>identityItem.setMajor(major);<NEW_LINE>if (null != configurator.getIdentityUniqueColumnColumn()) {<NEW_LINE>String identityUnique = configurator.getCellStringValue(row.getCell(configurator.getIdentityUniqueColumnColumn()));<NEW_LINE>identityUnique = StringUtils.trimToEmpty(identityUnique);<NEW_LINE>identityItem.setUnique(identityUnique);<NEW_LINE>}<NEW_LINE>EntityManagerContainer emc = business.entityManagerContainer();<NEW_LINE>Person personobj = null;<NEW_LINE>personobj = emc.flag(unique, Person.class);<NEW_LINE>if (personobj != null) {<NEW_LINE>identityItem.setName(StringUtils.trimToEmpty(personobj.getName()));<NEW_LINE>identityItem.setPerson(StringUtils.trimToEmpty(personobj.getId()));<NEW_LINE>}<NEW_LINE>Unit u = null;<NEW_LINE>u = emc.flag(unitCode, Unit.class);<NEW_LINE>if (u != null) {<NEW_LINE>identityItem.setUnit(u.getId());<NEW_LINE>identityItem.setUnitLevel(u.getLevel());<NEW_LINE>identityItem.setUnitLevelName(u.getLevelName());<NEW_LINE>identityItem.setUnitName(u.getName());<NEW_LINE>}<NEW_LINE>identitys.add(identityItem);<NEW_LINE>int idcount = 0;<NEW_LINE>for (IdentityItem idItem : identitys) {<NEW_LINE>if (unique.equals(idItem.getPersonCode()) && unitCode.equals(idItem.getUnitCode())) {<NEW_LINE>idcount = idcount + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (idcount > 1) {<NEW_LINE>identitys.remove(identityItem);<NEW_LINE>}<NEW_LINE>logger.debug("scan identity:{}.", identityItem);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return identitys;<NEW_LINE>} | (configurator.getMajorColumn())); |
1,353,207 | public void end(String successMessage, String failureMessage, String language) throws SAXException {<NEW_LINE>ResultHandler resultHandler = emitter.startResult();<NEW_LINE>if (resultHandler != null) {<NEW_LINE>if (isIndeterminate()) {<NEW_LINE>resultHandler.startResult(Result.INDETERMINATE);<NEW_LINE>resultHandler.characters(<MASK><NEW_LINE>resultHandler.endResult();<NEW_LINE>} else if (isErrors()) {<NEW_LINE>resultHandler.startResult(Result.FAILURE);<NEW_LINE>resultHandler.characters(failureMessage.toCharArray(), 0, failureMessage.length());<NEW_LINE>resultHandler.endResult();<NEW_LINE>} else {<NEW_LINE>resultHandler.startResult(Result.SUCCESS);<NEW_LINE>resultHandler.characters(successMessage.toCharArray(), 0, successMessage.length());<NEW_LINE>resultHandler.endResult();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>emitter.endResult();<NEW_LINE>if (imageCollector != null) {<NEW_LINE>DocumentFragment instruction = IMAGE_REPORT_GENERAL;<NEW_LINE>boolean fatal = false;<NEW_LINE>if (getFatalErrors() > 0) {<NEW_LINE>fatal = true;<NEW_LINE>instruction = IMAGE_REPORT_FATAL;<NEW_LINE>} else if (imageCollector.isEmpty()) {<NEW_LINE>instruction = IMAGE_REPORT_EMPTY;<NEW_LINE>}<NEW_LINE>ImageReviewHandler imageReviewHandler = emitter.startImageReview(instruction, fatal);<NEW_LINE>if (imageReviewHandler != null && !fatal) {<NEW_LINE>emitImageReview(imageReviewHandler);<NEW_LINE>}<NEW_LINE>emitter.endImageReview();<NEW_LINE>}<NEW_LINE>if (showSource) {<NEW_LINE>SourceHandler sourceHandler = emitter.startFullSource(lineOffset);<NEW_LINE>if (sourceHandler != null) {<NEW_LINE>sourceCode.emitSource(sourceHandler);<NEW_LINE>}<NEW_LINE>emitter.endFullSource();<NEW_LINE>}<NEW_LINE>emitter.endMessages(language);<NEW_LINE>} | INDETERMINATE_MESSAGE, 0, INDETERMINATE_MESSAGE.length); |
363,787 | protected void generateMap(JDefinedClass mapClass, MapTemplateSpec mapSpec) throws JClassAlreadyExistsException {<NEW_LINE>final JClass valueJClass = generate(mapSpec.getValueClass());<NEW_LINE>final JClass dataJClass = generate(mapSpec.getValueDataClass());<NEW_LINE>final boolean isDirect = CodeUtil.isDirectType(mapSpec.getSchema().getValues());<NEW_LINE>if (isDirect) {<NEW_LINE>mapClass._extends(_directMapBaseClass.narrow(valueJClass));<NEW_LINE>} else {<NEW_LINE>extendWrappingMapBaseClass(valueJClass, mapClass);<NEW_LINE>}<NEW_LINE>final DataSchema bareSchema = new MapDataSchema(schemaForArrayItemsOrMapValues(mapSpec.getCustomInfo(), mapSpec.getSchema().getValues()));<NEW_LINE>final JVar schemaField = generateSchemaField(mapClass, bareSchema, mapSpec.getSourceFileFormat());<NEW_LINE>generateConstructorWithNoArg(mapClass, _dataMapClass);<NEW_LINE>generateConstructorWithInitialCapacity(mapClass, _dataMapClass);<NEW_LINE>generateConstructorWithInitialCapacityAndLoadFactor(mapClass);<NEW_LINE>generateConstructorWithMap(mapClass, valueJClass);<NEW_LINE>generateConstructorWithArg(mapClass, <MASK><NEW_LINE>if (_pathSpecMethods) {<NEW_LINE>generatePathSpecMethodsForCollection(mapClass, mapSpec.getSchema(), valueJClass, "values");<NEW_LINE>}<NEW_LINE>if (_fieldMaskMethods) {<NEW_LINE>generateMaskBuilderForCollection(mapClass, mapSpec.getSchema(), valueJClass, "values", mapSpec.getValueClass());<NEW_LINE>}<NEW_LINE>generateCustomClassInitialization(mapClass, mapSpec.getCustomInfo());<NEW_LINE>if (_copierMethods) {<NEW_LINE>generateCopierMethods(mapClass, Collections.emptyMap(), null);<NEW_LINE>}<NEW_LINE>// Generate coercer overrides<NEW_LINE>generateCoercerOverrides(mapClass, mapSpec.getValueClass(), mapSpec.getSchema().getValues(), mapSpec.getCustomInfo(), true);<NEW_LINE>} | schemaField, _dataMapClass, valueJClass, dataJClass); |
665,090 | protected void encodeAtom(OutputStream outputstream, byte[] abyte0, int i, int j) throws IOException {<NEW_LINE>if (j == 1) {<NEW_LINE>byte byte0 = abyte0[i];<NEW_LINE>int k = 0;<NEW_LINE>outputstream.write(pem_array[byte0 >>> 2 & 63]);<NEW_LINE>outputstream.write(pem_array[(byte0 << 4 & 48) + (k ><MASK><NEW_LINE>outputstream.write(61);<NEW_LINE>outputstream.write(61);<NEW_LINE>// outputstream.write(42); //*<NEW_LINE>// outputstream.write(42);<NEW_LINE>} else if (j == 2) {<NEW_LINE>byte byte1 = abyte0[i];<NEW_LINE>byte byte3 = abyte0[i + 1];<NEW_LINE>int l = 0;<NEW_LINE>outputstream.write(pem_array[byte1 >>> 2 & 63]);<NEW_LINE>outputstream.write(pem_array[(byte1 << 4 & 48) + (byte3 >>> 4 & 15)]);<NEW_LINE>outputstream.write(pem_array[(byte3 << 2 & 60) + (l >>> 6 & 3)]);<NEW_LINE>outputstream.write(61);<NEW_LINE>// outputstream.write(42);<NEW_LINE>} else {<NEW_LINE>byte byte2 = abyte0[i];<NEW_LINE>byte byte4 = abyte0[i + 1];<NEW_LINE>byte byte5 = abyte0[i + 2];<NEW_LINE>outputstream.write(pem_array[byte2 >>> 2 & 63]);<NEW_LINE>outputstream.write(pem_array[(byte2 << 4 & 48) + (byte4 >>> 4 & 15)]);<NEW_LINE>outputstream.write(pem_array[(byte4 << 2 & 60) + (byte5 >>> 6 & 3)]);<NEW_LINE>outputstream.write(pem_array[byte5 & 63]);<NEW_LINE>}<NEW_LINE>} | >> 4 & 15)]); |
533,841 | private int resolveConstructorArguments(String beanName, RootBeanDefinition mbd, BeanWrapper bw, ConstructorArgumentValues cargs, ConstructorArgumentValues resolvedValues) {<NEW_LINE>TypeConverter customConverter = this.beanFactory.getCustomTypeConverter();<NEW_LINE>TypeConverter converter = (customConverter != null ? customConverter : bw);<NEW_LINE>BeanDefinitionValueResolver valueResolver = new BeanDefinitionValueResolver(this.beanFactory, beanName, mbd, converter);<NEW_LINE>int minNrOfArgs = cargs.getArgumentCount();<NEW_LINE>for (Map.Entry<Integer, ConstructorArgumentValues.ValueHolder> entry : cargs.getIndexedArgumentValues().entrySet()) {<NEW_LINE>int index = entry.getKey();<NEW_LINE>if (index < 0) {<NEW_LINE>throw new BeanCreationException(mbd.getResourceDescription(), beanName, "Invalid constructor argument index: " + index);<NEW_LINE>}<NEW_LINE>if (index + 1 > minNrOfArgs) {<NEW_LINE>minNrOfArgs = index + 1;<NEW_LINE>}<NEW_LINE>ConstructorArgumentValues.ValueHolder valueHolder = entry.getValue();<NEW_LINE>if (valueHolder.isConverted()) {<NEW_LINE>resolvedValues.addIndexedArgumentValue(index, valueHolder);<NEW_LINE>} else {<NEW_LINE>Object resolvedValue = valueResolver.resolveValueIfNecessary("constructor argument", valueHolder.getValue());<NEW_LINE>ConstructorArgumentValues.ValueHolder resolvedValueHolder = new ConstructorArgumentValues.ValueHolder(resolvedValue, valueHolder.getType(), valueHolder.getName());<NEW_LINE>resolvedValueHolder.setSource(valueHolder);<NEW_LINE>resolvedValues.addIndexedArgumentValue(index, resolvedValueHolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ConstructorArgumentValues.ValueHolder valueHolder : cargs.getGenericArgumentValues()) {<NEW_LINE>if (valueHolder.isConverted()) {<NEW_LINE>resolvedValues.addGenericArgumentValue(valueHolder);<NEW_LINE>} else {<NEW_LINE>Object resolvedValue = valueResolver.resolveValueIfNecessary("constructor argument", valueHolder.getValue());<NEW_LINE>ConstructorArgumentValues.ValueHolder resolvedValueHolder = new ConstructorArgumentValues.ValueHolder(resolvedValue, valueHolder.getType(<MASK><NEW_LINE>resolvedValueHolder.setSource(valueHolder);<NEW_LINE>resolvedValues.addGenericArgumentValue(resolvedValueHolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return minNrOfArgs;<NEW_LINE>} | ), valueHolder.getName()); |
562,346 | private TaskProvider<BootJar> configureBootJarTask(Project project, TaskProvider<ResolveMainClassName> resolveMainClassName) {<NEW_LINE>SourceSet mainSourceSet = javaPluginExtension(project).getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);<NEW_LINE>Configuration developmentOnly = project.getConfigurations().getByName(SpringBootPlugin.DEVELOPMENT_ONLY_CONFIGURATION_NAME);<NEW_LINE>Configuration productionRuntimeClasspath = project.getConfigurations().getByName(SpringBootPlugin.PRODUCTION_RUNTIME_CLASSPATH_CONFIGURATION_NAME);<NEW_LINE>Callable<FileCollection> classpath = () -> mainSourceSet.getRuntimeClasspath().minus((developmentOnly.minus(productionRuntimeClasspath)))<MASK><NEW_LINE>return project.getTasks().register(SpringBootPlugin.BOOT_JAR_TASK_NAME, BootJar.class, (bootJar) -> {<NEW_LINE>bootJar.setDescription("Assembles an executable jar archive containing the main classes and their dependencies.");<NEW_LINE>bootJar.setGroup(BasePlugin.BUILD_GROUP);<NEW_LINE>bootJar.classpath(classpath);<NEW_LINE>Provider<String> manifestStartClass = project.provider(() -> (String) bootJar.getManifest().getAttributes().get("Start-Class"));<NEW_LINE>bootJar.getMainClass().convention(resolveMainClassName.flatMap((resolver) -> manifestStartClass.isPresent() ? manifestStartClass : resolveMainClassName.get().readMainClassName()));<NEW_LINE>});<NEW_LINE>} | .filter(new JarTypeFileSpec()); |
1,425,020 | public static void vertical(Kernel1D_S32 kernel, GrayU8 input, GrayI8 output, int skip, int divisor) {<NEW_LINE>final byte[] dataSrc = input.data;<NEW_LINE>final byte[] dataDst = output.data;<NEW_LINE>final int[] dataKer = kernel.data;<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final <MASK><NEW_LINE>int halfDivisor = divisor / 2;<NEW_LINE>final int width = input.width;<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offsetY = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offsetY; y <= heightEnd; y += skip) {<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride;<NEW_LINE>int i = input.startIndex + (y - radius) * input.stride;<NEW_LINE>final int iEnd = i + width;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int total = 0;<NEW_LINE>int indexSrc = i;<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * dataKer[k];<NEW_LINE>indexSrc += input.stride;<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = (byte) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int kernelWidth = kernel.getWidth(); |
1,207,194 | public void initialize(Config config, Config runtime) {<NEW_LINE>// validate the topology name before moving forward<NEW_LINE>if (!topologyNameIsValid(Runtime.topologyName(runtime))) {<NEW_LINE>throw new RuntimeException(getInvalidTopologyNameMessage(Runtime.topologyName(runtime)));<NEW_LINE>}<NEW_LINE>// validate that the image pull policy has been set correctly<NEW_LINE>if (!imagePullPolicyIsValid(KubernetesContext.getKubernetesImagePullPolicy(config))) {<NEW_LINE>throw new RuntimeException(getInvalidImagePullPolicyMessage(<MASK><NEW_LINE>}<NEW_LINE>final Config.Builder builder = Config.newBuilder().putAll(config);<NEW_LINE>if (config.containsKey(Key.TOPOLOGY_BINARY_FILE)) {<NEW_LINE>builder.put(Key.TOPOLOGY_BINARY_FILE, FileUtils.getBaseName(Context.topologyBinaryFile(config)));<NEW_LINE>}<NEW_LINE>this.configuration = builder.build();<NEW_LINE>this.runtimeConfiguration = runtime;<NEW_LINE>this.controller = getController();<NEW_LINE>this.updateTopologyManager = new UpdateTopologyManager(configuration, runtimeConfiguration, Optional.<IScalable>of(this));<NEW_LINE>} | KubernetesContext.getKubernetesImagePullPolicy(config))); |
1,413,298 | public void fillProcessQueueInfo(final ProcessQueueInfo info) {<NEW_LINE>try {<NEW_LINE>this.treeMapLock.readLock().lockInterruptibly();<NEW_LINE>if (!this.msgTreeMap.isEmpty()) {<NEW_LINE>info.setCachedMsgMinOffset(this.msgTreeMap.firstKey());<NEW_LINE>info.setCachedMsgMaxOffset(this.msgTreeMap.lastKey());<NEW_LINE>info.setCachedMsgCount(this.msgTreeMap.size());<NEW_LINE>info.setCachedMsgSizeInMiB((int) (this.msgSize.get() / (1024 * 1024)));<NEW_LINE>}<NEW_LINE>if (!this.consumingMsgOrderlyTreeMap.isEmpty()) {<NEW_LINE>info.setTransactionMsgMinOffset(this.consumingMsgOrderlyTreeMap.firstKey());<NEW_LINE>info.setTransactionMsgMaxOffset(this.consumingMsgOrderlyTreeMap.lastKey());<NEW_LINE>info.setTransactionMsgCount(this.consumingMsgOrderlyTreeMap.size());<NEW_LINE>}<NEW_LINE>info.setLocked(this.locked);<NEW_LINE>info.setTryUnlockTimes(<MASK><NEW_LINE>info.setLastLockTimestamp(this.lastLockTimestamp);<NEW_LINE>info.setDroped(this.dropped);<NEW_LINE>info.setLastPullTimestamp(this.lastPullTimestamp);<NEW_LINE>info.setLastConsumeTimestamp(this.lastConsumeTimestamp);<NEW_LINE>} catch (Exception e) {<NEW_LINE>} finally {<NEW_LINE>this.treeMapLock.readLock().unlock();<NEW_LINE>}<NEW_LINE>} | this.tryUnlockTimes.get()); |
1,457,932 | public void readOptions(Map<String, String> opts) {<NEW_LINE>disableUpdates = true;<NEW_LINE>RunOptionsModel.LoaderPolicy pol;<NEW_LINE>boolean enabled = Boolean.parseBoolean(opts.getOrDefault(JSHELL_ENABLED, Boolean.FALSE.toString()));<NEW_LINE>checkEnable.setSelected(enabled);<NEW_LINE>String polString = opts.getOrDefault(JSHELL_CLASS_LOADING, RunOptionsModel.LoaderPolicy.SYSTEM.name()).toUpperCase();<NEW_LINE>try {<NEW_LINE>pol = <MASK><NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>// expected<NEW_LINE>pol = RunOptionsModel.LoaderPolicy.SYSTEM;<NEW_LINE>}<NEW_LINE>String cn = opts.get(JSHELL_CLASSNAME);<NEW_LINE>String f = opts.get(JSHELL_FROM_FIELD);<NEW_LINE>String m = opts.get(JSHELL_FROM_METHOD);<NEW_LINE>if (cn == null) {<NEW_LINE>pol = RunOptionsModel.LoaderPolicy.SYSTEM;<NEW_LINE>} else if (f == null && m == null) {<NEW_LINE>pol = RunOptionsModel.LoaderPolicy.CLASS;<NEW_LINE>}<NEW_LINE>this.message = null;<NEW_LINE>setPolicy(pol);<NEW_LINE>setClassName(cn);<NEW_LINE>setMethodOrFieldName(cn, f, m);<NEW_LINE>cSwingExecutor.setSelected(PropertyNames.EXECUTOR_CLASS_SWING.equals(opts.get(PropertyNames.JSHELL_EXECUTOR)));<NEW_LINE>disableUpdates = false;<NEW_LINE>enableDisable();<NEW_LINE>} | RunOptionsModel.LoaderPolicy.valueOf(polString); |
1,624,384 | public static Object runFunctionScriptingSupport(Object reference, String function, Object[] args) {<NEW_LINE>Class<?> classSup = null;<NEW_LINE>if (reference == null || (reference instanceof String && ((String) reference).contains("org.python"))) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>RunTime.terminate(999, "Commons: JythonSupport: %s", e.getMessage());<NEW_LINE>}<NEW_LINE>} else if (reference instanceof String && ((String) reference).contains("org.jruby")) {<NEW_LINE>try {<NEW_LINE>classSup = Class.forName("org.sikuli.support.ide.JRubySupport");<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>RunTime.terminate(999, "Commons: JRubySupport: %s", e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>RunTime.terminate(999, "Commons: ScriptingSupport: not supported: %s", reference);<NEW_LINE>}<NEW_LINE>Object returnSup = null;<NEW_LINE>String error = "";<NEW_LINE>Object instanceSup = null;<NEW_LINE>Method method = null;<NEW_LINE>try {<NEW_LINE>instanceSup = classSup.getMethod("get", null).invoke(null, null);<NEW_LINE>if (args == null) {<NEW_LINE>method = classSup.getMethod(function, null);<NEW_LINE>returnSup = method.invoke(instanceSup);<NEW_LINE>} else {<NEW_LINE>method = classSup.getMethod(function, new Class[] { Object[].class });<NEW_LINE>returnSup = method.invoke(instanceSup, args);<NEW_LINE>}<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>error = e.toString();<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>error = e.toString();<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>error = e.toString();<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>error = e.toString();<NEW_LINE>}<NEW_LINE>if (!error.isEmpty()) {<NEW_LINE>RunTime.terminate(999, "Commons: runScriptingSupportFunction(%s, %s, %s): %s", instanceSup, method, args, error);<NEW_LINE>}<NEW_LINE>return returnSup;<NEW_LINE>} | classSup = Class.forName("org.sikuli.support.ide.JythonSupport"); |
1,236,131 | public static Object checkCast(Object value, Object object, String valueClassName) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>ClassLoader valueLoader = value == null ? null : AccessController.doPrivileged(new GetClassLoaderPrivileged(value.getClass()));<NEW_LINE>ClassLoader contextLoader = AccessController.doPrivileged(new GetContextClassLoaderPrivileged());<NEW_LINE>ClassLoader objectLoader = AccessController.doPrivileged(new GetClassLoaderPrivileged(object.getClass()));<NEW_LINE>ClassLoader objectValueLoader;<NEW_LINE>try {<NEW_LINE>Class<?> objectValueClass = Class.<MASK><NEW_LINE>objectValueLoader = objectValueClass == null ? null : AccessController.doPrivileged(new GetClassLoaderPrivileged(objectValueClass));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Tr.debug(tc, "checkCast: failed to load " + valueClassName, t);<NEW_LINE>objectValueLoader = null;<NEW_LINE>}<NEW_LINE>Tr.debug(tc, "checkCast: value=" + Util.identity(value) + ", valueClassName=" + valueClassName, ", valueLoader=" + Util.identity(valueLoader) + ", contextLoader=" + Util.identity(contextLoader) + ", object=" + Util.identity(object) + ", objectLoader=" + Util.identity(objectLoader) + ", objectValueLoader=" + Util.identity(objectValueLoader));<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>} | forName(valueClassName, false, objectLoader); |
1,460,638 | public void appendSpecificHtml(PrintWriter writer) {<NEW_LINE>writer.format("GetDataStream: %d queued batches, %d pending requests [", batches.size(), pending.size());<NEW_LINE>for (Map.Entry<Long, AppendableInputStream> entry : pending.entrySet()) {<NEW_LINE>writer.format("Stream %d ", entry.getKey());<NEW_LINE>if (entry.getValue().cancelled.get()) {<NEW_LINE>writer.append("cancelled ");<NEW_LINE>}<NEW_LINE>if (entry.getValue().complete.get()) {<NEW_LINE>writer.append("complete ");<NEW_LINE>}<NEW_LINE>int queueSize = entry.getValue<MASK><NEW_LINE>if (queueSize > 0) {<NEW_LINE>writer.format("%d queued responses ", queueSize);<NEW_LINE>}<NEW_LINE>long blockedMs = entry.getValue().blockedStartMs.get();<NEW_LINE>if (blockedMs > 0) {<NEW_LINE>writer.format("blocked for %dms", Instant.now().getMillis() - blockedMs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.append("]");<NEW_LINE>} | ().queue.size(); |
1,038,203 | public TrustStore unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TrustStore trustStore = new TrustStore();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("associatedPortalArns", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>trustStore.setAssociatedPortalArns(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("trustStoreArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>trustStore.setTrustStoreArn(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 trustStore;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,263,348 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {<NEW_LINE>Authentication auth = SecurityContextHolder.getContext().getAuthentication();<NEW_LINE>if (auth instanceof Authentication) {<NEW_LINE>request.setAttribute("userAuthorities", gson.toJson(auth.getAuthorities()));<NEW_LINE>}<NEW_LINE>if (!trustResolver.isAnonymous(auth)) {<NEW_LINE>// skip lookup on anonymous logins<NEW_LINE>if (auth instanceof OIDCAuthenticationToken) {<NEW_LINE>// if they're logging into this server from a remote OIDC server, pass through their user info<NEW_LINE>OIDCAuthenticationToken oidc = (OIDCAuthenticationToken) auth;<NEW_LINE>if (oidc.getUserInfo() != null) {<NEW_LINE>request.setAttribute("userInfo", oidc.getUserInfo());<NEW_LINE>request.setAttribute("userInfoJson", oidc.getUserInfo().toJson());<NEW_LINE>} else {<NEW_LINE>request.setAttribute("userInfo", null);<NEW_LINE>request.setAttribute("userInfoJson", "null");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// don't bother checking if we don't have a principal or a userInfoService to work with<NEW_LINE>if (auth != null && auth.getName() != null && userInfoService != null) {<NEW_LINE>// try to look up a user based on the principal's name<NEW_LINE>UserInfo user = userInfoService.getByUsername(auth.getName());<NEW_LINE>// if we have one, inject it so views can use it<NEW_LINE>if (user != null) {<NEW_LINE>request.setAttribute("userInfo", user);<NEW_LINE>request.setAttribute(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | "userInfoJson", user.toJson()); |
1,766,458 | private void flushBufferedData() throws IOException {<NEW_LINE>if (o == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int compressedLength = compressor.compress(buffer, 0, o, compressedBuffer, HEADER_LENGTH);<NEW_LINE>final int compressMethod;<NEW_LINE>if (compressedLength >= o) {<NEW_LINE>compressMethod = COMPRESSION_METHOD_RAW;<NEW_LINE>compressedLength = o;<NEW_LINE>System.arraycopy(buffer, 0, compressedBuffer, HEADER_LENGTH, o);<NEW_LINE>} else {<NEW_LINE>compressMethod = COMPRESSION_METHOD_LZ4;<NEW_LINE>}<NEW_LINE>compressedBuffer[MAGIC_LENGTH] = (byte) (compressMethod | compressionLevel);<NEW_LINE>writeIntLE(compressedLength, compressedBuffer, MAGIC_LENGTH + 1);<NEW_LINE>writeIntLE(o, compressedBuffer, MAGIC_LENGTH + 5);<NEW_LINE>// Write 0 for checksum. We do not read it on decompress.<NEW_LINE>writeIntLE(0, compressedBuffer, MAGIC_LENGTH + 9);<NEW_LINE>assert MAGIC_LENGTH + 13 == HEADER_LENGTH;<NEW_LINE>out.write(<MASK><NEW_LINE>o = 0;<NEW_LINE>} | compressedBuffer, 0, HEADER_LENGTH + compressedLength); |
1,106,140 | public void marshall(CreateIntegrationResponseRequest createIntegrationResponseRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createIntegrationResponseRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createIntegrationResponseRequest.getApiId(), APIID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createIntegrationResponseRequest.getIntegrationId(), INTEGRATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationResponseRequest.getIntegrationResponseKey(), INTEGRATIONRESPONSEKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationResponseRequest.getResponseParameters(), RESPONSEPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationResponseRequest.getResponseTemplates(), RESPONSETEMPLATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationResponseRequest.getTemplateSelectionExpression(), TEMPLATESELECTIONEXPRESSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createIntegrationResponseRequest.getContentHandlingStrategy(), CONTENTHANDLINGSTRATEGY_BINDING); |
1,209,199 | private void exportHTML(ExportDataDumper eDD, String viewName) {<NEW_LINE>// Header<NEW_LINE>// NOI18N<NEW_LINE>StringBuffer result = new StringBuffer("<HTML><HEAD><meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" /><TITLE>" + viewName + "</TITLE></HEAD><BODY><TABLE border=\"1\"><tr>");<NEW_LINE>for (int i = 0; i < (columnNames.length); i++) {<NEW_LINE>if (!(columnRenderers[i] == null)) {<NEW_LINE>// NOI18N<NEW_LINE>result.append("<th>").append(columnNames[i]).append("</th>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>result.append("</tr>");<NEW_LINE>eDD.dumpData(result);<NEW_LINE>for (int i = 0; i < nTrackedItems; i++) {<NEW_LINE>// NOI18N<NEW_LINE>result = new StringBuffer("<tr><td>" + replaceHTMLCharacters(<MASK><NEW_LINE>// NOI18N<NEW_LINE>result.append("<td align=\"right\">").append(totalAllocObjectsSize[i]).append("</td>");<NEW_LINE>// NOI18N<NEW_LINE>result.append("<td align=\"right\">").append(nTotalAllocObjects[i]).append("</td></tr>");<NEW_LINE>eDD.dumpData(result);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>eDD.dumpDataAndClose(new StringBuffer(" </TABLE></BODY></HTML>"));<NEW_LINE>} | sortedClassNames[i]) + "</td>"); |
1,646,902 | // ----- static methods -----<NEW_LINE>public static Object invokeMethod(final SecurityContext securityContext, final Method method, final Object entity, final Map<String, Object> propertySet, final EvaluationHints hints) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>// new structure: first parameter is always securityContext and second parameter can be Map (for dynamically defined methods)<NEW_LINE>if (method.getParameterTypes().length == 2 && method.getParameterTypes()[0].isAssignableFrom(SecurityContext.class) && method.getParameterTypes()[1].equals(Map.class)) {<NEW_LINE>final Object[] args = new Object[] { securityContext };<NEW_LINE>return method.invoke(entity, ArrayUtils.add(args, propertySet));<NEW_LINE>}<NEW_LINE>// second try: extracted parameter list<NEW_LINE>final Object[] args = extractParameters(propertySet, method.getParameterTypes());<NEW_LINE>return method.invoke(entity, ArrayUtils.add<MASK><NEW_LINE>} catch (InvocationTargetException itex) {<NEW_LINE>final Throwable cause = itex.getCause();<NEW_LINE>if (cause instanceof AssertException) {<NEW_LINE>final AssertException e = (AssertException) cause;<NEW_LINE>throw new FrameworkException(e.getStatus(), e.getMessage());<NEW_LINE>}<NEW_LINE>if (cause instanceof FrameworkException) {<NEW_LINE>throw (FrameworkException) cause;<NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException | IllegalArgumentException t) {<NEW_LINE>logger.warn("Unable to invoke method {}: {}", method.getName(), t.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (args, 0, securityContext)); |
381,856 | public static ProjectInfo createProjectInfo(String name, Map<String, Object> vals) throws IOException {<NEW_LINE>String artifact = (String) vals.getOrDefault(TemplateUtils.PARAM_ARTIFACT_ID, name);<NEW_LINE>String group = (String) vals.get(TemplateUtils.PARAM_GROUP_ID);<NEW_LINE>String version = (String) vals.getOrDefault(TemplateUtils.PARAM_VERSION, TemplateUtils.PARAM_VERSION_DEFAULT);<NEW_LINE>String pkg = (String) vals.get(TemplateUtils.PARAM_PACKAGE);<NEW_LINE>if (artifact == null) {<NEW_LINE>throw new IOException(Bundle.MSG_NoArtifactId());<NEW_LINE>}<NEW_LINE>if (group == null) {<NEW_LINE>group = findGroupId(pkg, artifact);<NEW_LINE>}<NEW_LINE>if (group == null) {<NEW_LINE>throw new IOException(Bundle.MSG_NoGroupId());<NEW_LINE>}<NEW_LINE>return new ProjectInfo(<MASK><NEW_LINE>} | group, artifact, version, pkg); |
499,140 | // Driver Program<NEW_LINE>public static void main(String[] args) {<NEW_LINE>// Just generate data<NEW_LINE>Random r = ThreadLocalRandom.current();<NEW_LINE>int size = 100;<NEW_LINE>int maxElement = 100000;<NEW_LINE>Integer[] integers = IntStream.generate(() -> r.nextInt(maxElement)).limit(size).sorted().boxed().toArray(Integer[]::new);<NEW_LINE>// The element for which the lower bound is to be found<NEW_LINE>int val = integers[r.nextInt<MASK><NEW_LINE>LowerBound search = new LowerBound();<NEW_LINE>int atIndex = search.find(integers, val);<NEW_LINE>System.out.println(format("Val: %d. Lower Bound Found %d at index %d. An array length %d", val, integers[atIndex], atIndex, size));<NEW_LINE>boolean toCheck = integers[atIndex] >= val || integers[size - 1] < val;<NEW_LINE>System.out.println(format("Lower Bound found at an index: %d. Is greater or max element: %b", atIndex, toCheck));<NEW_LINE>} | (size - 1)] + 1; |
163,053 | public FileVisitResult preVisitDirectory(java.nio.file.Path dir, BasicFileAttributes attrs) throws IOException {<NEW_LINE>int count = dir.getNameCount();<NEW_LINE>if (count == 1) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>if (count == 2) {<NEW_LINE>// e.g. /9A/java.base<NEW_LINE>java.nio.file.Path mod = dir.getName(1);<NEW_LINE>if ((JRTUtil.MODULE_TO_LOAD != null && JRTUtil.MODULE_TO_LOAD.length() > 0 && JRTUtil.MODULE_TO_LOAD.indexOf(mod.toString()) == -1)) {<NEW_LINE>return FileVisitResult.SKIP_SUBTREE;<NEW_LINE>}<NEW_LINE>return ((notify & JRTUtil.NOTIFY_MODULES) == 0) ? FileVisitResult.CONTINUE : visitor.visitModule(dir<MASK><NEW_LINE>}<NEW_LINE>if ((notify & JRTUtil.NOTIFY_PACKAGES) == 0) {<NEW_LINE>// client is not interested in packages<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>return visitor.visitPackage(dir.subpath(2, count), dir.getName(1), attrs);<NEW_LINE>} | , JRTUtil.sanitizedFileName(mod)); |
441,898 | private static void fillMainAttributes(Definition definition, ResourceListing listing, String basePath) {<NEW_LINE>definition.setVersion(listing.getApiVersion());<NEW_LINE>Contract contract = new Contract();<NEW_LINE>if (listing.getInfo() != null) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setEmail(listing.getInfo().getContact());<NEW_LINE>definition.setContact(contact);<NEW_LINE>License license = new License();<NEW_LINE>license.setName(listing.getInfo().getLicense());<NEW_LINE>license.setUrl(listing.getInfo().getLicenseUrl());<NEW_LINE>definition.setLicense(license);<NEW_LINE>contract.setName(listing.getInfo().getTitle());<NEW_LINE>contract.setDescription(listing.<MASK><NEW_LINE>}<NEW_LINE>LOGGER.log(Level.FINE, "Contract " + contract.getName() + " added.");<NEW_LINE>definition.setContract(contract);<NEW_LINE>if (definition.getEndpoints().isEmpty() && basePath != null) {<NEW_LINE>// TODO verify how to deal with API key auth + oauth<NEW_LINE>Endpoint endpoint = new Endpoint(basePath);<NEW_LINE>definition.getEndpoints().add(endpoint);<NEW_LINE>fillEndpointAuthorization(listing.getAuthorizations(), endpoint);<NEW_LINE>}<NEW_LINE>} | getInfo().getDescription()); |
1,021,982 | public void createUser(ActionRequest request, ActionResponse response) {<NEW_LINE>Context context = request.getContext();<NEW_LINE>User user = context.asType(User.class);<NEW_LINE>EmployeeRepository employeeRepository = Beans.get(EmployeeRepository.class);<NEW_LINE>User employeeUser = new User();<NEW_LINE>employeeUser.<MASK><NEW_LINE>employeeUser.setExpiresOn(user.getExpiresOn());<NEW_LINE>employeeUser.setCode(user.getCode());<NEW_LINE>employeeUser.setGroup(user.getGroup());<NEW_LINE>if (context.containsKey("_id")) {<NEW_LINE>Object employeeId = context.get("_id");<NEW_LINE>if (employeeId != null) {<NEW_LINE>Employee employee = employeeRepository.find(Long.parseLong(employeeId.toString()));<NEW_LINE>employeeUser.setEmployee(employeeRepository.find(employee.getId()));<NEW_LINE>if (employee.getContactPartner() != null) {<NEW_LINE>String employeeName = employee.getContactPartner().getName();<NEW_LINE>if (employee.getContactPartner().getFirstName() != null) {<NEW_LINE>employeeName += " " + employee.getContactPartner().getFirstName();<NEW_LINE>}<NEW_LINE>employeeUser.setName(employeeName);<NEW_LINE>if (employee.getContactPartner().getEmailAddress() != null) {<NEW_LINE>employeeUser.setEmail(employee.getContactPartner().getEmailAddress().getAddress());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (employee.getMainEmploymentContract() != null) {<NEW_LINE>employeeUser.setActiveCompany(employee.getMainEmploymentContract().getPayCompany());<NEW_LINE>}<NEW_LINE>List<EmploymentContract> contractList = employee.getEmploymentContractList();<NEW_LINE>if (contractList != null && !contractList.isEmpty()) {<NEW_LINE>for (EmploymentContract employmentContract : contractList) {<NEW_LINE>employeeUser.addCompanySetItem(employmentContract.getPayCompany());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CharSequence password = Beans.get(UserService.class).generateRandomPassword();<NEW_LINE>employeeUser.setPassword(password.toString());<NEW_LINE>employee.setUser(employeeUser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Beans.get(UserRepository.class).save(employeeUser);<NEW_LINE>response.setCanClose(true);<NEW_LINE>} | setActivateOn(user.getActivateOn()); |
1,012,498 | private static List<Op02WithProcessedDataAndRefs> copyBlock(List<Op02WithProcessedDataAndRefs> orig, InstrIndex afterThis) {<NEW_LINE>List<Op02WithProcessedDataAndRefs> output = ListFactory.newList(orig.size());<NEW_LINE>Map<Op02WithProcessedDataAndRefs, Op02WithProcessedDataAndRefs> fromTo = MapFactory.newMap();<NEW_LINE>for (Op02WithProcessedDataAndRefs in : orig) {<NEW_LINE>Op02WithProcessedDataAndRefs copy = new Op02WithProcessedDataAndRefs(in);<NEW_LINE>afterThis = afterThis.justAfter();<NEW_LINE>copy.index = afterThis;<NEW_LINE>fromTo.put(in, copy);<NEW_LINE>output.add(copy);<NEW_LINE>}<NEW_LINE>for (int x = 0, len = orig.size(); x < len; ++x) {<NEW_LINE>Op02WithProcessedDataAndRefs in = orig.get(x);<NEW_LINE>Op02WithProcessedDataAndRefs copy = output.get(x);<NEW_LINE>copy.exceptionGroups = <MASK><NEW_LINE>copy.containedInTheseBlocks = ListFactory.newList(in.containedInTheseBlocks);<NEW_LINE>copy.catchExceptionGroups = ListFactory.newList(in.catchExceptionGroups);<NEW_LINE>// Now, create copies of the sources and targets.<NEW_LINE>tieUpRelations(copy.getSources(), in.getSources(), fromTo);<NEW_LINE>tieUpRelations(copy.getTargets(), in.getTargets(), fromTo);<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | ListFactory.newList(in.exceptionGroups); |
777,762 | public Query toQuery(Class<?> clazz, String whereClause, Object[] params, String trxName) {<NEW_LINE>String tableName;<NEW_LINE>// Get Table_Name by Class<NEW_LINE>// TODO: refactor<NEW_LINE>try {<NEW_LINE>tableName = (String) clazz.getField("Table_Name").get(null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AdempiereException(e);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>Properties ctx = Env.getCtx();<NEW_LINE>MTable table = MTable.get(ctx, tableName);<NEW_LINE>ArrayList<Object> finalParams = new ArrayList<Object>();<NEW_LINE>StringBuffer finalWhereClause = new StringBuffer();<NEW_LINE>finalWhereClause.append(I_AD_Client.COLUMNNAME_AD_Client_ID + "=? ");<NEW_LINE>finalParams.add(this.AD_Client_ID);<NEW_LINE>finalWhereClause.append(" AND " + I_C_AcctSchema.COLUMNNAME_C_AcctSchema_ID + "=?");<NEW_LINE>finalParams.add(this.C_AcctSchema_ID);<NEW_LINE>finalWhereClause.append(<MASK><NEW_LINE>finalParams.add(this.AD_Org_ID);<NEW_LINE>finalWhereClause.append(" AND (").append(I_M_Warehouse.COLUMNNAME_M_Warehouse_ID).append(" IS NULL OR ").append(I_M_Warehouse.COLUMNNAME_M_Warehouse_ID + "=? )");<NEW_LINE>finalParams.add(this.M_Warehouse_ID);<NEW_LINE>finalWhereClause.append(" AND " + I_M_Product.COLUMNNAME_M_Product_ID + "=?");<NEW_LINE>finalParams.add(this.M_Product_ID);<NEW_LINE>finalWhereClause.append(" AND " + I_M_AttributeInstance.COLUMNNAME_M_AttributeSetInstance_ID + "=?");<NEW_LINE>finalParams.add(this.M_AttributeSetInstance_ID);<NEW_LINE>if (this.M_CostElement_ID != ANY) {<NEW_LINE>finalWhereClause.append(" AND " + I_M_CostElement.COLUMNNAME_M_CostElement_ID + "=?");<NEW_LINE>finalParams.add(this.M_CostElement_ID);<NEW_LINE>}<NEW_LINE>if (this.M_CostType_ID != ANY && table.getColumn(I_M_CostType.COLUMNNAME_M_CostType_ID) != null) {<NEW_LINE>finalWhereClause.append(" AND " + I_M_CostType.COLUMNNAME_M_CostType_ID + "=?");<NEW_LINE>finalParams.add(this.M_CostType_ID);<NEW_LINE>}<NEW_LINE>if (!Util.isEmpty(whereClause, true)) {<NEW_LINE>finalWhereClause.append(" AND (").append(whereClause).append(")");<NEW_LINE>if (params != null && params.length > 0) {<NEW_LINE>for (Object p : params) {<NEW_LINE>finalParams.add(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Query(ctx, tableName, finalWhereClause.toString(), trxName).setParameters(finalParams);<NEW_LINE>} | " AND " + I_AD_Org.COLUMNNAME_AD_Org_ID + "=?"); |
782,136 | public static void showPopup(JComponent content, String title, int x, int y) {<NEW_LINE>if (popupWindow != null) {<NEW_LINE>// Content already showing<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Toolkit.getDefaultToolkit().addAWTEventListener(hideListener, AWTEvent.MOUSE_EVENT_MASK);<NEW_LINE>// NOT using PopupFactory<NEW_LINE>// 1. on linux, creates mediumweight popup taht doesn't refresh behind visible glasspane<NEW_LINE>// 2. on mac, needs an owner frame otherwise hiding tooltip also hides the popup. (linux requires no owner frame to force heavyweight)<NEW_LINE>// 3. the created window is not focusable window<NEW_LINE>popupWindow = new JDialog(getMainWindow());<NEW_LINE>popupWindow.setName(POPUP_NAME);<NEW_LINE>popupWindow.setUndecorated(true);<NEW_LINE>popupWindow.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ESC_KEY_STROKE, CLOSE_KEY);<NEW_LINE>popupWindow.getRootPane().getActionMap().put(CLOSE_KEY, CLOSE_ACTION);<NEW_LINE>// set a11y<NEW_LINE>String a11yName = content.getAccessibleContext().getAccessibleName();<NEW_LINE>if (a11yName != null && !a11yName.equals(""))<NEW_LINE>popupWindow.getAccessibleContext().setAccessibleName(a11yName);<NEW_LINE>String a11yDesc = content.getAccessibleContext().getAccessibleDescription();<NEW_LINE>if (a11yDesc != null && !a11yDesc.equals(""))<NEW_LINE>popupWindow.getAccessibleContext().setAccessibleDescription(a11yDesc);<NEW_LINE>popupWindow.getContentPane().add(content);<NEW_LINE>WindowManager.getDefault().<MASK><NEW_LINE>WindowManager.getDefault().getMainWindow().addComponentListener(hideListener);<NEW_LINE>resizePopup();<NEW_LINE>if (x != (-1)) {<NEW_LINE>Point p = fitToScreen(x, y, 0);<NEW_LINE>popupWindow.setLocation(p.x, p.y);<NEW_LINE>}<NEW_LINE>popupWindow.setVisible(true);<NEW_LINE>content.requestFocus();<NEW_LINE>content.requestFocusInWindow();<NEW_LINE>} | getMainWindow().addWindowStateListener(hideListener); |
890,729 | private ObjectInstance dumpSource(InteropLibrary iop, HeapDump seg, Object source) throws IOException, UnsupportedMessageException {<NEW_LINE>String srcName = readMember(iop, source, "name", iop::asString);<NEW_LINE>String mimeType = asStringOrNull(iop, source, "mimeType");<NEW_LINE>String uri = asStringOrNull(iop, source, "uri");<NEW_LINE>String characters = asStringOrNull(iop, source, "characters");<NEW_LINE>SourceKey key = new SourceKey(srcName, uri, mimeType, characters);<NEW_LINE>ObjectInstance prevId = sources.get(key);<NEW_LINE>if (prevId != null) {<NEW_LINE>return prevId;<NEW_LINE>}<NEW_LINE>if (sourceClass == null) {<NEW_LINE>keyClass = seg.newClass("com.oracle.truffle.api.source.SourceImpl$Key").field("uri", String.class).field("content", String.class).field("mimeType", String.class).field("name", String.class).dumpClass();<NEW_LINE>sourceClass = seg.newClass("com.oracle.truffle.api.source.Source").field("key", <MASK><NEW_LINE>}<NEW_LINE>ObjectInstance keyId = seg.newInstance(keyClass).put("uri", seg.dumpString(uri)).put("mimeType", seg.dumpString(mimeType)).put("content", seg.dumpString(characters)).put("name", seg.dumpString(srcName)).dumpInstance();<NEW_LINE>ObjectInstance srcId = seg.newInstance(sourceClass).put("key", keyId).dumpInstance();<NEW_LINE>sources.put(key, srcId);<NEW_LINE>return srcId;<NEW_LINE>} | Object.class).dumpClass(); |
1,746,804 | public void visitRange(Range range) {<NEW_LINE>if (range.getCount() > 0) {<NEW_LINE>range.setAvg(range.getSum() / range.getCount());<NEW_LINE>}<NEW_LINE>final Map<Integer, AllDuration> allDurations = range.getAllDurations();<NEW_LINE>if (!allDurations.isEmpty() && !range.getClearDuration()) {<NEW_LINE>final Map<Integer, AllDuration> sourtMap = sortMap(allDurations);<NEW_LINE>Map<Double, Integer> lineValues = computeLineValue(sourtMap, new double[] { PERCENT_50, PERCENT_90, PERCENT_95, PERCENT_99, PERCENT_999, PERCENT_9999 });<NEW_LINE>range.setLine50Value(lineValues.get(PERCENT_50));<NEW_LINE>range.setLine90Value(lineValues.get(PERCENT_90));<NEW_LINE>range.setLine95Value(lineValues.get(PERCENT_95));<NEW_LINE>range.setLine99Value(lineValues.get(PERCENT_99));<NEW_LINE>range.setLine999Value(lineValues.get(PERCENT_999));<NEW_LINE>range.setLine9999Value<MASK><NEW_LINE>}<NEW_LINE>// clear duration in type all duration<NEW_LINE>long current = System.currentTimeMillis() / 1000 / 60;<NEW_LINE>int min = (int) (current % (60));<NEW_LINE>if (!allDurations.isEmpty() && range.getValue() + m_maxDurationMinute < min) {<NEW_LINE>range.getAllDurations().clear();<NEW_LINE>range.setClearDuration(true);<NEW_LINE>}<NEW_LINE>if (m_clearAll) {<NEW_LINE>range.getAllDurations().clear();<NEW_LINE>}<NEW_LINE>} | (lineValues.get(PERCENT_9999)); |
1,693,617 | private void addSource(Artifact source, Label label) {<NEW_LINE>Preconditions.checkNotNull(featureConfiguration);<NEW_LINE>Preconditions.checkState(!CppFileTypes.CPP_HEADER.matches<MASK><NEW_LINE>// We assume TreeArtifacts passed in are directories containing proper sources for compilation.<NEW_LINE>if (!sourceCategory.getSourceTypes().matches(source.getExecPathString()) && !source.isTreeArtifact()) {<NEW_LINE>// TODO(plf): If it's a non-source file we ignore it. This is only the case for precompiled<NEW_LINE>// files which should be forbidden in srcs of cc_library|binary and instead be migrated to<NEW_LINE>// cc_import rules.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isClifInputProto = CppFileTypes.CLIF_INPUT_PROTO.matches(source.getExecPathString());<NEW_LINE>CppSource.Type type;<NEW_LINE>if (isClifInputProto) {<NEW_LINE>type = CppSource.Type.CLIF_INPUT_PROTO;<NEW_LINE>} else {<NEW_LINE>type = CppSource.Type.SOURCE;<NEW_LINE>}<NEW_LINE>compilationUnitSources.put(source, CppSource.create(source, label, type));<NEW_LINE>} | (source.getExecPath())); |
243,418 | public static void main(String[] args) {<NEW_LINE>LOGGER.info("---------------------");<NEW_LINE>LOGGER.info("KEY VAULT - SECRETS");<NEW_LINE>LOGGER.info("IDENTITY - CREDENTIAL");<NEW_LINE>LOGGER.info("---------------------");<NEW_LINE>// Configure authority host from AZURE_CLOUD<NEW_LINE>String azureCloud = System.getenv("AZURE_CLOUD");<NEW_LINE>String authorityHost = AUTHORITY_HOST_MAP.getOrDefault(azureCloud, AzureAuthorityHosts.AZURE_PUBLIC_CLOUD);<NEW_LINE>SecretServiceVersion serviceVersion = AUTHORITY_HOST_SERVICE_VERSION_MAP.getOrDefault(azureCloud, SecretServiceVersion.getLatest());<NEW_LINE>secretClient = new SecretClientBuilder().vaultUrl(System.getenv("AZURE_PROJECT_URL")).credential(new DefaultAzureCredentialBuilder().authorityHost(authorityHost).build()).<MASK><NEW_LINE>try {<NEW_LINE>setSecret();<NEW_LINE>getSecret();<NEW_LINE>} finally {<NEW_LINE>deleteSecret();<NEW_LINE>}<NEW_LINE>} | serviceVersion(serviceVersion).buildClient(); |
113,308 | private void logSummary() {<NEW_LINE>try (CoreTransaction.Data txn = session.transaction(READ)) {<NEW_LINE>LOG.debug("Total 'thing' count: " + txn.graphMgr.data().stats().thingVertexTransitiveCount(txn.graphMgr.schema<MASK><NEW_LINE>long hasCount = 0;<NEW_LINE>NavigableSet<TypeVertex> allTypes = txn.graphMgr.schema().getSubtypes(txn.graphMgr.schema().rootThingType());<NEW_LINE>Set<TypeVertex> attributes = txn.graphMgr.schema().getSubtypes(txn.graphMgr.schema().rootAttributeType());<NEW_LINE>for (TypeVertex attr : attributes) {<NEW_LINE>hasCount += txn.graphMgr.data().stats().hasEdgeSum(allTypes, attr);<NEW_LINE>}<NEW_LINE>LOG.debug("Total 'role' count: " + txn.graphMgr.data().stats().thingVertexTransitiveCount(txn.graphMgr.schema().rootRoleType()));<NEW_LINE>LOG.debug("Total 'has' count: " + hasCount);<NEW_LINE>}<NEW_LINE>} | ().rootThingType())); |
1,855,184 | public static void main(final String[] args) {<NEW_LINE>final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null;<NEW_LINE>final Aeron.Context ctx = new Aeron.Context();<NEW_LINE>if (EMBEDDED_MEDIA_DRIVER) {<NEW_LINE>ctx.aeronDirectoryName(driver.aeronDirectoryName());<NEW_LINE>}<NEW_LINE>if (INFO_FLAG) {<NEW_LINE>ctx.availableImageHandler(SamplesUtil::printAvailableImage);<NEW_LINE>ctx.unavailableImageHandler(SamplesUtil::printUnavailableImage);<NEW_LINE>}<NEW_LINE>final IdleStrategy idleStrategy = new BusySpinIdleStrategy();<NEW_LINE>System.out.println("Subscribing Ping at " + PING_CHANNEL + " on stream id " + PING_STREAM_ID);<NEW_LINE>System.out.println("Publishing Pong at " + PONG_CHANNEL + " on stream id " + PONG_STREAM_ID);<NEW_LINE>System.<MASK><NEW_LINE>final AtomicBoolean running = new AtomicBoolean(true);<NEW_LINE>SigInt.register(() -> running.set(false));<NEW_LINE>try (Aeron aeron = Aeron.connect(ctx);<NEW_LINE>Subscription subscription = aeron.addSubscription(PING_CHANNEL, PING_STREAM_ID);<NEW_LINE>Publication publication = EXCLUSIVE_PUBLICATIONS ? aeron.addExclusivePublication(PONG_CHANNEL, PONG_STREAM_ID) : aeron.addPublication(PONG_CHANNEL, PONG_STREAM_ID)) {<NEW_LINE>final BufferClaim bufferClaim = new BufferClaim();<NEW_LINE>final FragmentHandler fragmentHandler = (buffer, offset, length, header) -> pingHandler(bufferClaim, publication, buffer, offset, length, header);<NEW_LINE>while (running.get()) {<NEW_LINE>idleStrategy.idle(subscription.poll(fragmentHandler, FRAME_COUNT_LIMIT));<NEW_LINE>}<NEW_LINE>System.out.println("Shutting down...");<NEW_LINE>}<NEW_LINE>CloseHelper.close(driver);<NEW_LINE>} | out.println("Using exclusive publications " + EXCLUSIVE_PUBLICATIONS); |
364,818 | void initializeHostContext(PolyglotLanguageContext context, PolyglotContextConfig newConfig) {<NEW_LINE>try {<NEW_LINE>Object contextImpl = context.getContextImpl();<NEW_LINE>if (contextImpl == null) {<NEW_LINE>throw new AssertionError("Host context not initialized.");<NEW_LINE>}<NEW_LINE>this.hostContextImpl = contextImpl;<NEW_LINE>AbstractHostService currentHost = engine.host;<NEW_LINE>AbstractHostService newHost = context.lookupService(AbstractHostService.class);<NEW_LINE>if (newHost == null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (currentHost == null) {<NEW_LINE>engine.host = newHost;<NEW_LINE>} else if (currentHost != newHost) {<NEW_LINE>throw new AssertionError("Host service must not change per engine.");<NEW_LINE>}<NEW_LINE>newHost.initializeHostContext(this, contextImpl, newConfig.hostAccess, newConfig.hostClassLoader, newConfig.classFilter, newConfig.hostClassLoadingAllowed, newConfig.hostLookupAllowed);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>throw PolyglotEngineException.illegalState(e.getMessage());<NEW_LINE>}<NEW_LINE>} | AssertionError("The engine host language must register a service of type:" + AbstractHostService.class); |
769,824 | public void refresh() {<NEW_LINE>setDate(DateUtil.yyyymmdd(TimeUtil.getCurrentTime()));<NEW_LINE>collectObj();<NEW_LINE>Integer[] serverIds = serverObjMap.keySet().toArray(new Integer[serverObjMap.size()]);<NEW_LINE>final TreeSet<XLogData> tempSet = new TreeSet<XLogData>(new XLogDataComparator());<NEW_LINE>int limit = PManager.getInstance().getInt(PreferenceConstants.P_XLOG_IGNORE_TIME);<NEW_LINE>final int max = getMaxCount();<NEW_LINE>twdata.setMax(max);<NEW_LINE>for (final int serverId : serverIds) {<NEW_LINE>TcpProxy <MASK><NEW_LINE>try {<NEW_LINE>MapPack param = paramMap.get(serverId);<NEW_LINE>if (param == null) {<NEW_LINE>param = new MapPack();<NEW_LINE>paramMap.put(serverId, param);<NEW_LINE>}<NEW_LINE>ListValue objHashLv = serverObjMap.get(serverId);<NEW_LINE>if (objHashLv.size() > 0) {<NEW_LINE>param.put("objHash", objHashLv);<NEW_LINE>param.put("limit", limit);<NEW_LINE>tcp.process(RequestCmd.TRANX_REAL_TIME_GROUP, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>Pack p = in.readPack();<NEW_LINE>if (p instanceof MapPack) {<NEW_LINE>MapPack param = (MapPack) p;<NEW_LINE>paramMap.put(serverId, param);<NEW_LINE>} else {<NEW_LINE>XLogPack x = XLogUtil.toXLogPack(p);<NEW_LINE>tempSet.add(new XLogData(x, serverId));<NEW_LINE>while (tempSet.size() >= max) {<NEW_LINE>tempSet.pollFirst();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>ConsoleProxy.errorSafe(e.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (XLogData d : tempSet) {<NEW_LINE>twdata.putLast(d.p.txid, d);<NEW_LINE>}<NEW_LINE>viewPainter.build();<NEW_LINE>ExUtil.exec(canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>canvas.redraw();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | tcp = TcpProxy.getTcpProxy(serverId); |
81,930 | public void shutdown(long quietPeriod, long timeout, TimeUnit unit) {<NEW_LINE>if (dnsMonitor != null) {<NEW_LINE>dnsMonitor.stop();<NEW_LINE>}<NEW_LINE>connectionWatcher.stop();<NEW_LINE>List<CompletableFuture<Void>> futures = new ArrayList<>();<NEW_LINE>for (MasterSlaveEntry entry : getEntrySet()) {<NEW_LINE>futures.add(entry.shutdownAsync());<NEW_LINE>}<NEW_LINE>CompletableFuture<Void> future = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));<NEW_LINE>try {<NEW_LINE>future.get(timeout, unit);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// skip<NEW_LINE>}<NEW_LINE>resolverGroup.close();<NEW_LINE>shutdownLatch.close();<NEW_LINE>if (cfg.getExecutor() == null) {<NEW_LINE>executor.shutdown();<NEW_LINE>try {<NEW_LINE>executor.awaitTermination(timeout, unit);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>shutdownPromise.trySuccess(null);<NEW_LINE>shutdownLatch.awaitUninterruptibly();<NEW_LINE>if (cfg.getEventLoopGroup() == null) {<NEW_LINE>group.shutdownGracefully(quietPeriod, <MASK><NEW_LINE>}<NEW_LINE>timer.stop();<NEW_LINE>} | timeout, unit).syncUninterruptibly(); |
1,514,385 | public static boolean didAffinitizedLeadersChange(PlacementInfo oldPlacementInfo, PlacementInfo newPlacementInfo) {<NEW_LINE>// Map between the old placement's AZs and the affinitized leader info.<NEW_LINE>HashMap<UUID, Boolean> oldAZMap = new HashMap<>();<NEW_LINE>for (PlacementCloud oldCloud : oldPlacementInfo.cloudList) {<NEW_LINE>for (PlacementRegion oldRegion : oldCloud.regionList) {<NEW_LINE>for (PlacementAZ oldAZ : oldRegion.azList) {<NEW_LINE>oldAZMap.put(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (PlacementCloud newCloud : newPlacementInfo.cloudList) {<NEW_LINE>for (PlacementRegion newRegion : newCloud.regionList) {<NEW_LINE>for (PlacementAZ newAZ : newRegion.azList) {<NEW_LINE>if (!oldAZMap.containsKey(newAZ.uuid)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (oldAZMap.get(newAZ.uuid) != newAZ.isAffinitized) {<NEW_LINE>// affinitized leader info has changed, return true.<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// No affinitized leader info has changed, return false.<NEW_LINE>return false;<NEW_LINE>} | oldAZ.uuid, oldAZ.isAffinitized); |
1,006,390 | // Make sure any temp used by the export is not optimized away<NEW_LINE>private void optimizeGather2(Constructor ct, MapSTL<Long, OptimizeRecord> recs, int secnum) {<NEW_LINE>ConstructTpl tpl;<NEW_LINE>if (secnum < 0) {<NEW_LINE>tpl = ct.getTempl();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (tpl == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HandleTpl hand = tpl.getResult();<NEW_LINE>if (hand == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (hand.getPtrSpace().isUniqueSpace()) {<NEW_LINE>if (hand.getPtrOffset().getType() == ConstTpl.const_type.real) {<NEW_LINE>long offset = hand.getPtrOffset().getReal();<NEW_LINE>recs.put(offset, new OptimizeRecord());<NEW_LINE>IteratorSTL<Pair<Long, OptimizeRecord>> res = recs.find(offset);<NEW_LINE>res.get().second.writeop = 0;<NEW_LINE>res.get().second.readop = 0;<NEW_LINE>res.get().second.writecount = 2;<NEW_LINE>res.get().second.readcount = 2;<NEW_LINE>res.get().second.readsection = -2;<NEW_LINE>res.get().second.writesection = -2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hand.getSpace().isUniqueSpace()) {<NEW_LINE>if ((hand.getPtrSpace().getType() == ConstTpl.const_type.real) && (hand.getPtrOffset().getType() == ConstTpl.const_type.real)) {<NEW_LINE>long offset = hand.getPtrOffset().getReal();<NEW_LINE>recs.put(offset, new OptimizeRecord());<NEW_LINE>IteratorSTL<Pair<Long, OptimizeRecord>> res = recs.find(offset);<NEW_LINE>res.get().second.writeop = 0;<NEW_LINE>res.get().second.readop = 0;<NEW_LINE>res.get().second.writecount = 2;<NEW_LINE>res.get().second.readcount = 2;<NEW_LINE>res.get().second.readsection = -2;<NEW_LINE>res.get().second.writesection = -2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | tpl = ct.getNamedTempl(secnum); |
1,330,081 | private static FlatTrace.Context handleReturn(final ProtocolSchedule protocolSchedule, final TransactionTrace transactionTrace, final Block block, final TraceFrame traceFrame, final Deque<FlatTrace.Context> tracesContexts, final FlatTrace.Context currentContext) {<NEW_LINE>final FlatTrace.Builder traceFrameBuilder = currentContext.getBuilder();<NEW_LINE>final Result.Builder resultBuilder = traceFrameBuilder.getResultBuilder();<NEW_LINE>final Action.Builder actionBuilder = traceFrameBuilder.getActionBuilder();<NEW_LINE>actionBuilder.value(Quantity.create(traceFrame.getValue()));<NEW_LINE>currentContext.setGasUsed(computeGasUsed(tracesContexts, currentContext, transactionTrace, traceFrame));<NEW_LINE>if ("STOP".equals(traceFrame.getOpcode()) && resultBuilder.isGasUsedEmpty()) {<NEW_LINE>final long callStipend = protocolSchedule.getByBlockNumber(block.getHeader().getNumber()).getGasCalculator().getAdditionalCallStipend().toLong();<NEW_LINE>tracesContexts.stream().filter(context -> !tracesContexts.getFirst().equals(context) && !tracesContexts.getLast().equals(context)).forEach(context -> context.decGasUsed(callStipend));<NEW_LINE>}<NEW_LINE>final Bytes outputData = traceFrame.getOutputData();<NEW_LINE>if (resultBuilder.getCode() == null) {<NEW_LINE>resultBuilder.output(outputData.toHexString());<NEW_LINE>}<NEW_LINE>// set value for contract creation TXes, CREATE, and CREATE2<NEW_LINE>if (actionBuilder.getCallType() == null && traceFrame.getMaybeCode().isPresent()) {<NEW_LINE>actionBuilder.init(traceFrame.getMaybeCode().get().getBytes().toHexString());<NEW_LINE>resultBuilder.code(outputData.toHexString());<NEW_LINE>if (currentContext.isCreateOp()) {<NEW_LINE>// this is from a CREATE/CREATE2, so add code deposit cost.<NEW_LINE>currentContext.incGasUsed(outputData.size() * 200L);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tracesContexts.removeLast();<NEW_LINE>final FlatTrace.Context nextContext = tracesContexts.peekLast();<NEW_LINE>if (nextContext != null) {<NEW_LINE>nextContext<MASK><NEW_LINE>}<NEW_LINE>return nextContext;<NEW_LINE>} | .getBuilder().incSubTraces(); |
1,102,978 | private void draw(Collection<JRPrintElement> elements) throws JRException {<NEW_LINE>if (elements != null && elements.size() > 0) {<NEW_LINE>Shape clipArea = grx.getClip();<NEW_LINE>for (Iterator<JRPrintElement> it = elements.iterator(); it.hasNext(); ) {<NEW_LINE>JRPrintElement element = it.next();<NEW_LINE>boolean isGenericElement = element instanceof JRGenericPrintElement;<NEW_LINE>JRGenericPrintElement genericElement = isGenericElement ? (JRGenericPrintElement) element : null;<NEW_LINE>GenericElementGraphics2DHandler handler = isGenericElement ? (GenericElementGraphics2DHandler) GenericElementHandlerEnviroment.getInstance(getJasperReportsContext()).getElementHandler(genericElement.getGenericType(), JRGraphics2DExporter.GRAPHICS2D_EXPORTER_KEY) : null;<NEW_LINE>boolean isGenericElementToExport = isGenericElement && handler != null && handler.toExport(genericElement);<NEW_LINE>if ((filter != null && !filter.isToExport(element)) || !clipArea.intersects(element.getX() + elementOffset.getX() - ELEMENT_RECTANGLE_PADDING, element.getY() + elementOffset.getY() - ELEMENT_RECTANGLE_PADDING, element.getWidth() + 2 * ELEMENT_RECTANGLE_PADDING, element.getHeight() + 2 * ELEMENT_RECTANGLE_PADDING)) {<NEW_LINE>continue;<NEW_LINE>} else if (isGenericElementToExport) {<NEW_LINE>handler.exportElement(exporterContext, genericElement, grx, elementOffset);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | element.accept(drawVisitor, elementOffset); |
1,792,246 | public static void main(String[] args) {<NEW_LINE>AmazonGuardDuty guardduty = AmazonGuardDutyClientBuilder.defaultClient();<NEW_LINE>// Set detectorId to the detectorId returned by GuardDuty's<NEW_LINE>// ListDetectors() for your current AWS Account/Region<NEW_LINE>final String detectorId = "ceb03b04f96520a8884c959f3e95c25a";<NEW_LINE>FindingCriteria criteria = new FindingCriteria();<NEW_LINE>Condition condition = new Condition();<NEW_LINE>List<String> condValues = new ArrayList<String>();<NEW_LINE>condValues.add("Recon:EC2/PortProbeUnprotectedPort");<NEW_LINE>condValues.add("Recon:EC2/PortScan");<NEW_LINE>condition.withEq(condValues);<NEW_LINE>criteria.addCriterionEntry("type", condition);<NEW_LINE>try {<NEW_LINE>ListFindingsRequest request = new ListFindingsRequest().withDetectorId(detectorId).withFindingCriteria(criteria);<NEW_LINE>ListFindingsResult <MASK><NEW_LINE>for (String finding : response.getFindingIds()) {<NEW_LINE>System.out.println("FindingId: " + finding);<NEW_LINE>}<NEW_LINE>} catch (AmazonServiceException ase) {<NEW_LINE>System.out.println("Caught Exception: " + ase.getMessage());<NEW_LINE>System.out.println("Response Status Code: " + ase.getStatusCode());<NEW_LINE>System.out.println("Error Code: " + ase.getErrorCode());<NEW_LINE>System.out.println("Request ID: " + ase.getRequestId());<NEW_LINE>}<NEW_LINE>} | response = guardduty.listFindings(request); |
759,786 | public static void init(BiConsumer<Block, RenderType> consumer) {<NEW_LINE>consumer.accept(ModBlocks.defaultAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.forestAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.plainsAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.mountainAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.fungalAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.swampAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.desertAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.taigaAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.mesaAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.mossyAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.ghostRail, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.solidVines, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.corporeaCrystalCube, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.manaGlass, RenderType.translucent());<NEW_LINE>consumer.accept(ModFluffBlocks.managlassPane, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.elfGlass, RenderType.translucent());<NEW_LINE>consumer.accept(ModFluffBlocks.alfglassPane, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.bifrost, RenderType.translucent());<NEW_LINE>consumer.accept(ModFluffBlocks.bifrostPane, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.bifrostPerm, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.prism, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.starfield, RenderType.cutoutMipped());<NEW_LINE>consumer.accept(ModBlocks.abstrusePlatform, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.infrangiblePlatform, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.<MASK><NEW_LINE>Registry.BLOCK.stream().filter(b -> Registry.BLOCK.getKey(b).getNamespace().equals(LibMisc.MOD_ID)).forEach(b -> {<NEW_LINE>if (b instanceof BlockFloatingFlower || b instanceof FlowerBlock || b instanceof TallFlowerBlock || b instanceof BlockModMushroom) {<NEW_LINE>consumer.accept(b, RenderType.cutout());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | spectralPlatform, RenderType.translucent()); |
1,769,042 | public static void main(String[] args) throws IOException {<NEW_LINE>Options options = new Options();<NEW_LINE>JCommander unused = new JCommander(options, args);<NEW_LINE>Path bugPatterns = Paths.get(options.bugPatterns);<NEW_LINE>if (!Files.exists(bugPatterns)) {<NEW_LINE>usage("Cannot find bugPatterns file: " + options.bugPatterns);<NEW_LINE>}<NEW_LINE>Path explanationDir = Paths.get(options.explanations);<NEW_LINE>if (!Files.exists(explanationDir)) {<NEW_LINE>usage("Cannot find explanations dir: " + options.explanations);<NEW_LINE>}<NEW_LINE>Path wikiDir = Paths.get(options.docsRepository);<NEW_LINE>Files.createDirectories(wikiDir);<NEW_LINE>Path bugpatternDir = wikiDir.resolve("bugpattern");<NEW_LINE>if (!Files.exists(bugpatternDir)) {<NEW_LINE>Files.createDirectories(bugpatternDir);<NEW_LINE>}<NEW_LINE>Files.createDirectories(wikiDir.resolve("_data"));<NEW_LINE>BugPatternFileGenerator generator = new BugPatternFileGenerator(bugpatternDir, explanationDir, options.target == Target.EXTERNAL, options.<MASK><NEW_LINE>try (Writer w = Files.newBufferedWriter(wikiDir.resolve("bugpatterns.md"), StandardCharsets.UTF_8)) {<NEW_LINE>List<BugPatternInstance> patterns = asCharSource(bugPatterns.toFile(), UTF_8).readLines(generator);<NEW_LINE>new BugPatternIndexWriter().dump(patterns, w, options.target, enabledCheckNames());<NEW_LINE>}<NEW_LINE>} | baseUrl, input -> input.severity); |
123,727 | private void updateText(Intent intent) {<NEW_LINE>int id = intent.getIntExtra(Attack.ATTACK_ID, -1);<NEW_LINE>if (attacks.containsKey(id)) {<NEW_LINE>Attack attack = attacks.get(id);<NEW_LINE>if (intent.hasExtra(Attack.ATTACK_UPDATE_TEXT) && intent.hasExtra(Attack.ATTACK_UPDATE_REASON)) {<NEW_LINE>String updateText = intent.getStringExtra(Attack.ATTACK_UPDATE_TEXT);<NEW_LINE>if (updateText.contains(Attack.DELIMITER)) {<NEW_LINE>for (int i = 0; i < attack.getRunningInfo().size(); i++) {<NEW_LINE>if (attack.getRunningInfo().get(i).message.contains(Attack.DELIMITER)) {<NEW_LINE>attack.getRunningInfo().remove(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int updateReason = intent.getIntExtra(Attack.ATTACK_UPDATE_REASON, AttackInfoString.ATTACK_UPDATE_RUNNING);<NEW_LINE>AttackInfoString attackInfoString = new AttackInfoString(updateReason, updateText);<NEW_LINE>attack.getRunningInfo().add(attackInfoString);<NEW_LINE>}<NEW_LINE>Intent sendIntent = new Intent("de.tu_darmstadt.seemoo.nexmon.ATTACK_GET");<NEW_LINE>sendIntent.putExtra(<MASK><NEW_LINE>sendIntent.putExtra("ATTACK", new Gson().toJson(attack));<NEW_LINE>MyApplication.getAppContext().sendBroadcast(sendIntent);<NEW_LINE>}<NEW_LINE>} | "ATTACK_TYPE", attack.getTypeString()); |
1,586,341 | public void updateNodeSubscriptions(UpdateSubscriptionsBulkRequest body, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling updateNodeSubscriptions");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/user/subscriptions/nodes";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token"<MASK><NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | , apiClient.parameterToString(xSdsAuthToken)); |
1,636,567 | public void doFormat(int depth, Hints formatOption, FormatWriter writer) throws IOException {<NEW_LINE>String fixedString = StringUtils.repeat(' ', depth * fixedLength);<NEW_LINE>//<NEW_LINE>writer.write(fixedString + "if (");<NEW_LINE>SwitchExpression switchExpr = this.testBlockSet.get(0);<NEW_LINE>switchExpr.testExpression.doFormat(depth + 1, formatOption, writer);<NEW_LINE>//<NEW_LINE>if (switchExpr.instBlockSet.isMultipleInst()) {<NEW_LINE>writer.write(") ");<NEW_LINE>switchExpr.instBlockSet.doFormat(depth, formatOption, writer);<NEW_LINE>} else {<NEW_LINE>writer.write(")\n");<NEW_LINE>switchExpr.instBlockSet.doFormat(depth + 1, formatOption, writer);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>//<NEW_LINE>for (int i = 1; i < this.testBlockSet.size(); i++) {<NEW_LINE>switchExpr = this.testBlockSet.get(i);<NEW_LINE>//<NEW_LINE>writer.write(" else if (");<NEW_LINE>switchExpr.testExpression.doFormat(depth + 1, formatOption, writer);<NEW_LINE>//<NEW_LINE>if (switchExpr.instBlockSet.isMultipleInst()) {<NEW_LINE>writer.write(") ");<NEW_LINE>switchExpr.instBlockSet.doFormat(depth, formatOption, writer);<NEW_LINE>writer.write(" ");<NEW_LINE>} else {<NEW_LINE>writer.write(")\n");<NEW_LINE>switchExpr.instBlockSet.doFormat(depth + 1, formatOption, writer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.elseBlockSet == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (elseBlockSet.isMultipleInst()) {<NEW_LINE><MASK><NEW_LINE>this.elseBlockSet.doFormat(depth, formatOption, writer);<NEW_LINE>writer.write("\n");<NEW_LINE>} else {<NEW_LINE>writer.write(fixedString + "else\n");<NEW_LINE>this.elseBlockSet.doFormat(depth + 1, formatOption, writer);<NEW_LINE>}<NEW_LINE>} | writer.write(fixedString + "else "); |
1,013,858 | private Map<JsName, JsLiteral> renameJsSymbols(PermutationProperties properties, JavaToJavaScriptMap jjsmap) throws UnableToCompleteException {<NEW_LINE>Map<JsName, JsLiteral> internedLiteralByVariableName = null;<NEW_LINE>try {<NEW_LINE>switch(options.getOutput()) {<NEW_LINE>case OBFUSCATED:<NEW_LINE>internedLiteralByVariableName = runObfuscateNamer(options, properties, jjsmap);<NEW_LINE>break;<NEW_LINE>case PRETTY:<NEW_LINE>internedLiteralByVariableName = <MASK><NEW_LINE>break;<NEW_LINE>case DETAILED:<NEW_LINE>internedLiteralByVariableName = runDetailedNamer(properties.getConfigurationProperties());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new InternalCompilerException("Unknown output mode");<NEW_LINE>}<NEW_LINE>} catch (IllegalNameException e) {<NEW_LINE>logger.log(TreeLogger.ERROR, e.getMessage(), e);<NEW_LINE>throw new UnableToCompleteException();<NEW_LINE>}<NEW_LINE>return internedLiteralByVariableName == null ? ImmutableMap.<JsName, JsLiteral>of() : internedLiteralByVariableName;<NEW_LINE>} | runPrettyNamer(options, properties, jjsmap); |
614,429 | public static void dumpDataflowInformation(Method method, CFG cfg, ValueNumberDataflow vnd, IsNullValueDataflow inv, @CheckForNull UnconditionalValueDerefDataflow dataflow, @CheckForNull TypeDataflow typeDataflow) throws DataflowAnalysisException {<NEW_LINE>System.out.println("\n\n{ UnconditionalValueDerefAnalysis analysis for " + method.getName());<NEW_LINE>TreeSet<Location> tree = new TreeSet<Location>();<NEW_LINE>for (Iterator<Location> locs = cfg.locationIterator(); locs.hasNext(); ) {<NEW_LINE>Location loc = locs.next();<NEW_LINE>tree.add(loc);<NEW_LINE>}<NEW_LINE>for (Location loc : tree) {<NEW_LINE>System.out.println();<NEW_LINE>if (dataflow != null) {<NEW_LINE>System.out.println("\n Pre: " + dataflow.getFactAfterLocation(loc));<NEW_LINE>}<NEW_LINE>System.out.println("Vna: " + vnd.getFactAtLocation(loc));<NEW_LINE>System.out.println("inv: " + inv.getFactAtLocation(loc));<NEW_LINE>if (typeDataflow != null) {<NEW_LINE>System.out.println("type: " <MASK><NEW_LINE>}<NEW_LINE>System.out.println("Location: " + loc);<NEW_LINE>if (dataflow != null) {<NEW_LINE>System.out.println("Post: " + dataflow.getFactAtLocation(loc));<NEW_LINE>}<NEW_LINE>System.out.println("Vna: " + vnd.getFactAfterLocation(loc));<NEW_LINE>System.out.println("inv: " + inv.getFactAfterLocation(loc));<NEW_LINE>if (typeDataflow != null) {<NEW_LINE>System.out.println("type: " + typeDataflow.getFactAfterLocation(loc));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("}\n\n");<NEW_LINE>} | + typeDataflow.getFactAtLocation(loc)); |
1,479,201 | ImmutableList<TypeMirror> erasedParameterTypes(ExecutableElement method, TypeElement in) {<NEW_LINE>if (method.getEnclosingElement().equals(in)) {<NEW_LINE>ImmutableList.Builder<TypeMirror> params = ImmutableList.builder();<NEW_LINE>for (VariableElement param : method.getParameters()) {<NEW_LINE>params.add(typeUtils.erasure(visit(param.asType())));<NEW_LINE>}<NEW_LINE>return params.build();<NEW_LINE>}<NEW_LINE>// Make a list of supertypes we are going to visit recursively: the superclass, if there<NEW_LINE>// is one, plus the superinterfaces.<NEW_LINE>List<TypeMirror> supers = Lists.newArrayList();<NEW_LINE>if (in.getSuperclass().getKind() == TypeKind.DECLARED) {<NEW_LINE>supers.add(in.getSuperclass());<NEW_LINE>}<NEW_LINE>supers.addAll(in.getInterfaces());<NEW_LINE>for (TypeMirror supertype : supers) {<NEW_LINE>DeclaredType declared = MoreTypes.asDeclared(supertype);<NEW_LINE>TypeElement element = MoreElements.asType(declared.asElement());<NEW_LINE>List<? extends TypeMirror<MASK><NEW_LINE>List<? extends TypeParameterElement> formals = element.getTypeParameters();<NEW_LINE>if (actuals.isEmpty()) {<NEW_LINE>// Either the formal type arguments are also empty or `declared` is raw.<NEW_LINE>actuals = formals.stream().map(t -> t.getBounds().get(0)).collect(toList());<NEW_LINE>}<NEW_LINE>Verify.verify(actuals.size() == formals.size());<NEW_LINE>for (int i = 0; i < actuals.size(); i++) {<NEW_LINE>typeBindings.put(formals.get(i), actuals.get(i));<NEW_LINE>}<NEW_LINE>ImmutableList<TypeMirror> params = erasedParameterTypes(method, element);<NEW_LINE>if (params != null) {<NEW_LINE>return params;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | > actuals = declared.getTypeArguments(); |
135,046 | public synchronized CompletableFuture<Void> listen(InetSocketAddress address, Consumer<GrpcMessagingConnection> listener) {<NEW_LINE>// Return existing future if building currently.<NEW_LINE>if (mListenFuture != null && !mListenFuture.isCompletedExceptionally()) {<NEW_LINE>return mListenFuture;<NEW_LINE>}<NEW_LINE>LOG.debug("Opening messaging server for: {}", address);<NEW_LINE>final GrpcMessagingContext threadContext = GrpcMessagingContext.currentContextOrThrow();<NEW_LINE>mListenFuture = CompletableFuture.runAsync(() -> {<NEW_LINE>InetSocketAddress bindAddress = address;<NEW_LINE>if (mProxy.hasProxyFor(address)) {<NEW_LINE>bindAddress = mProxy.getProxyFor(address);<NEW_LINE>LOG.debug("Found proxy: {} for address: {}", bindAddress, address);<NEW_LINE>}<NEW_LINE>LOG.debug("Binding messaging server to: {}", bindAddress);<NEW_LINE>// Create gRPC server.<NEW_LINE>mGrpcServer = GrpcServerBuilder.forAddress(GrpcServerAddress.create(bindAddress.getHostString(), bindAddress), mConf, mUserState).maxInboundMessageSize((int) mConf.getBytes(PropertyKey.MASTER_EMBEDDED_JOURNAL_TRANSPORT_MAX_INBOUND_MESSAGE_SIZE)).addService(new GrpcService(ServerInterceptors.intercept(new GrpcMessagingServiceClientHandler(address, listener::accept, threadContext, mExecutor, mConf.getMs(PropertyKey.MASTER_EMBEDDED_JOURNAL_MAX_ELECTION_TIMEOUT)), new ClientIpAddressInjector()))).build();<NEW_LINE>try {<NEW_LINE>mGrpcServer.start();<NEW_LINE><MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>mGrpcServer = null;<NEW_LINE>LOG.debug("Failed to create messaging server for: {}.", address, e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}, mExecutor);<NEW_LINE>return mListenFuture;<NEW_LINE>} | LOG.info("Successfully started messaging server at: {}", bindAddress); |
221,890 | public String[] authorize(URL home) {<NEW_LINE>FormLogin panel = new FormLogin();<NEW_LINE>String server = HudsonManager.simplifyServerLocation(home.toString(), true);<NEW_LINE>String username = loginPrefs(<MASK><NEW_LINE>if (username != null) {<NEW_LINE>panel.userField.setText(username);<NEW_LINE>char[] savedPassword = Keyring.read(server);<NEW_LINE>if (savedPassword != null) {<NEW_LINE>panel.passField.setText(new String(savedPassword));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>panel.locationField.setText(home.toString());<NEW_LINE>DialogDescriptor dd = new DialogDescriptor(panel, Bundle.FormLogin_log_in());<NEW_LINE>if (DialogDisplayer.getDefault().notify(dd) != NotifyDescriptor.OK_OPTION) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>username = panel.userField.getText();<NEW_LINE>loginPrefs().put(server, username);<NEW_LINE>String password = new String(panel.passField.getPassword());<NEW_LINE>panel.passField.setText("");<NEW_LINE>Keyring.save(server, password.toCharArray(), Bundle.FormLogin_password_description(home, username));<NEW_LINE>return new String[] { username, password };<NEW_LINE>} | ).get(server, null); |
1,788,756 | private void performCheck(int idx, HashBucket bucket) {<NEW_LINE>if (bucket.getTrieBitLen() > bitLen)<NEW_LINE>error("[%d] Bucket %d has bit length longer than the dictionary's (%d, %d)", idx, bucket.getId(), bucket.getTrieBitLen(), bitLen);<NEW_LINE>// Check the bucket hash against the slot it's in.<NEW_LINE>// Convert directory index to bucket hash<NEW_LINE>int tmp = (idx >>> (bitLen - bucket.getTrieBitLen()));<NEW_LINE>if (tmp != bucket.getTrieValue())<NEW_LINE>error("[%d] Bucket %d : hash prefix 0x%X, expected 0x%X : %s", idx, bucket.getId(), bucket.getTrieValue(), tmp, bucket);<NEW_LINE>// Check the contents.<NEW_LINE>Record prevKey = Record.NO_REC;<NEW_LINE>for (int i = 0; i < bucket.getCount(); i++) {<NEW_LINE>Record <MASK><NEW_LINE>if (prevKey != Record.NO_REC && Record.keyLT(rec, prevKey))<NEW_LINE>error("[%d] Bucket %d: Not sorted (slot %d) : %s", idx, bucket.getId(), i, bucket);<NEW_LINE>prevKey = rec;<NEW_LINE>int x = trieKey(rec, bucket.getTrieBitLen());<NEW_LINE>// Check the key is bucket-compatible.<NEW_LINE>if (x != bucket.getTrieValue())<NEW_LINE>error("[%d] Bucket %d: Key (0x%04X) does not match the hash (0x%04X) : %s", idx, bucket.getId(), x, bucket.getTrieValue(), bucket);<NEW_LINE>}<NEW_LINE>if (SystemTDB.NullOut) {<NEW_LINE>for (int i = bucket.getCount(); i < bucket.getMaxSize(); i++) {<NEW_LINE>if (!bucket.getRecordBuffer().isClear(i))<NEW_LINE>error("[%d] Bucket %d : overspill at [%d]: %s", idx, bucket.getId(), i, bucket);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | rec = bucket.get(i); |
703,542 | public IMessage onMessage(PacketRequestMissingItems message, MessageContext ctx) {<NEW_LINE>EntityPlayerMP player = ctx.getServerHandler().player;<NEW_LINE>if (player.openContainer.windowId == message.windowId && player.openContainer instanceof InventoryPanelContainer) {<NEW_LINE>InventoryPanelContainer <MASK><NEW_LINE>TileInventoryPanel teInvPanel = ipc.getTe();<NEW_LINE>IInventoryDatabaseServer db = teInvPanel.getDatabaseServer();<NEW_LINE>if (db != null) {<NEW_LINE>try {<NEW_LINE>List<? extends IServerItemEntry> items = db.decompressMissingItems(message.compressed);<NEW_LINE>if (!items.isEmpty()) {<NEW_LINE>return new PacketItemInfo(message.windowId, db, items);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Logger.getLogger(PacketItemInfo.class.getName()).log(Level.SEVERE, "Exception while reading missing item IDs", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ipc = (InventoryPanelContainer) player.openContainer; |
233,480 | private BatchFinderResult<RecordTemplatePlaceholder, RecordTemplatePlaceholder, RecordTemplatePlaceholder> buildBatchFinderResult(RecordDataSchema batchFinderMetadataSchema, RecordTemplate batchFinderCriteria) {<NEW_LINE>final List<RecordTemplatePlaceholder> results = new ArrayList<>();<NEW_LINE>results.add(generateEntity());<NEW_LINE>results.add(generateEntity());<NEW_LINE>BatchFinderResult batchFinderResult = new BatchFinderResult();<NEW_LINE>if (batchFinderMetadataSchema != null) {<NEW_LINE>DataMap metadataDataMap = (DataMap) _dataGenerator.buildData("metadata", batchFinderMetadataSchema);<NEW_LINE>RecordTemplatePlaceholder metadata <MASK><NEW_LINE>CollectionResult cr = new CollectionResult<>(results, results.size(), metadata);<NEW_LINE>batchFinderResult.putResult(batchFinderCriteria, cr);<NEW_LINE>} else {<NEW_LINE>CollectionResult cr = new CollectionResult<RecordTemplatePlaceholder, RecordTemplatePlaceholder>(results, results.size());<NEW_LINE>batchFinderResult.putResult(batchFinderCriteria, cr);<NEW_LINE>}<NEW_LINE>return batchFinderResult;<NEW_LINE>} | = new RecordTemplatePlaceholder(metadataDataMap, batchFinderMetadataSchema); |
1,437,811 | static boolean equalsImpl(List<?> thisList, @CheckForNull Object other) {<NEW_LINE>if (other == checkNotNull(thisList)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!(other instanceof List)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<?> otherList = (List<?>) other;<NEW_LINE>int size = thisList.size();<NEW_LINE>if (size != otherList.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (thisList instanceof RandomAccess && otherList instanceof RandomAccess) {<NEW_LINE>// avoid allocation and use the faster loop<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (!Objects.equal(thisList.get(i), otherList.get(i))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return Iterators.elementsEqual(thisList.iterator(<MASK><NEW_LINE>}<NEW_LINE>} | ), otherList.iterator()); |
1,345,828 | protected void layoutChildren(LayoutContext c, int contentStart) {<NEW_LINE>ensureChildren(c);<NEW_LINE>// If we have a running footer, we need its dimensions right away<NEW_LINE>boolean running = c.isPrint() && getStyle().isPaginateTable();<NEW_LINE>if (running) {<NEW_LINE>int headerHeight = layoutRunningHeader(c);<NEW_LINE>int footerHeight = layoutRunningFooter(c);<NEW_LINE>int spacingHeight = footerHeight == 0 ? 0 : getStyle().getBorderVSpacing(c);<NEW_LINE>PageBox first = c.getRootLayer().getFirstPage(c, this);<NEW_LINE>if (getAbsY() + getTy() + headerHeight + footerHeight + spacingHeight > first.getBottom()) {<NEW_LINE>// XXX Performance problem here. This forces the table<NEW_LINE>// to move to the next page (which we want), but the initial<NEW_LINE>// table layout run still completes (which we don't)<NEW_LINE>setNeedPageClear(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | super.layoutChildren(c, contentStart); |
1,530,879 | public void run(ITextSelection selection) {<NEW_LINE>if (!(getSite() instanceof IEditorSite)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IWorkbenchPart part = ((IEditorSite) getSite()).getPart();<NEW_LINE>if (!(part instanceof GroovyEditor)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GroovyEditor groovyEditor = (GroovyEditor) part;<NEW_LINE>GroovyCompilationUnit unit = groovyEditor.getGroovyCompilationUnit();<NEW_LINE>IDocument doc = groovyEditor.getDocumentProvider().getDocument(groovyEditor.getEditorInput());<NEW_LINE>if (doc != null && unit != null) {<NEW_LINE>boolean isIndentOnly = (kind == FormatKind.INDENT_ONLY);<NEW_LINE>FormatterPreferences preferences = new FormatterPreferences(unit);<NEW_LINE>DefaultGroovyFormatter formatter = new DefaultGroovyFormatter(selection, doc, preferences, isIndentOnly);<NEW_LINE>TextEdit edit = formatter.format();<NEW_LINE>try {<NEW_LINE>unit.applyTextEdit(edit, new NullProgressMonitor());<NEW_LINE>} catch (MalformedTreeException e) {<NEW_LINE><MASK><NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>GroovyCore.logException("Exception when formatting", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | GroovyCore.logException("Exception when formatting", e); |
1,578,685 | protected void onDraw(Canvas canvas) {<NEW_LINE>getDrawingRect(bounds);<NEW_LINE>int maxPadding = (int) Math.min(bounds.right / 2, bounds.bottom / 2);<NEW_LINE>int padding = (int) Math.min(borderWidth, maxPadding);<NEW_LINE>RectF innerRect = new RectF(bounds.left + padding, bounds.top + padding, bounds.right - padding, bounds.bottom - padding);<NEW_LINE>RectF outerRect = new RectF(bounds);<NEW_LINE>paint.setColor(color);<NEW_LINE>if (alpha > -1) {<NEW_LINE>paint.setAlpha(alpha);<NEW_LINE>}<NEW_LINE>Path outerPath = new Path();<NEW_LINE>if (hasRadius()) {<NEW_LINE>float[] innerRadius = new float[this.radius.length];<NEW_LINE>for (int i = 0; i < this.radius.length; i++) {<NEW_LINE>innerRadius[i] = this.radius[i] - padding;<NEW_LINE>}<NEW_LINE>outerPath.addRoundRect(innerRect, innerRadius, Direction.CCW);<NEW_LINE>Path innerPath = new Path(outerPath);<NEW_LINE>// Draw border.<NEW_LINE>outerPath.addRoundRect(outerRect, this.radius, Direction.CW);<NEW_LINE>canvas.drawPath(outerPath, paint);<NEW_LINE>// TIMOB-16909: hack to fix anti-aliasing<NEW_LINE>if (Build.VERSION.SDK_INT < 31 && backgroundColor != Color.TRANSPARENT) {<NEW_LINE>paint.setColor(backgroundColor);<NEW_LINE>canvas.drawPath(innerPath, paint);<NEW_LINE>}<NEW_LINE>canvas.clipPath(innerPath);<NEW_LINE>if (Build.VERSION.SDK_INT < 31 && backgroundColor != Color.TRANSPARENT) {<NEW_LINE>canvas.drawColor(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>outerPath.addRect(outerRect, Direction.CW);<NEW_LINE>outerPath.addRect(innerRect, Direction.CCW);<NEW_LINE>canvas.drawPath(outerPath, paint);<NEW_LINE>canvas.clipRect(innerRect);<NEW_LINE>}<NEW_LINE>// TIMOB-20076: set the outline for the view in order to use elevation<NEW_LINE>if (viewOutlineProvider == null) {<NEW_LINE>viewOutlineProvider = new ViewOutlineProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void getOutline(View view, Outline outline) {<NEW_LINE>outline.setRoundRect(bounds, radius[0]);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>setOutlineProvider(viewOutlineProvider);<NEW_LINE>}<NEW_LINE>} | 0, PorterDuff.Mode.CLEAR); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.