idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,689,972 | public static // modified for performance and to allow parsing numbers with leading '+'<NEW_LINE>Integer tryParse(String string, int begin, int end) {<NEW_LINE>if (begin < 0 || end > string.length() || end - begin < 1)<NEW_LINE>return null;<NEW_LINE>int radix = 10;<NEW_LINE>char firstChar = string.charAt(begin);<NEW_LINE>boolean negative = firstChar == '-';<NEW_LINE>int index = negative || firstChar == '+' ? begin + 1 : begin;<NEW_LINE>if (index == end)<NEW_LINE>return null;<NEW_LINE>int digit = Character.digit(string.charAt(index++), 10);<NEW_LINE>if (digit < 0 || digit >= radix)<NEW_LINE>return null;<NEW_LINE>int accum = -digit;<NEW_LINE><MASK><NEW_LINE>while (index < end) {<NEW_LINE>digit = Character.digit(string.charAt(index++), 10);<NEW_LINE>if (digit < 0 || digit >= radix || accum < cap)<NEW_LINE>return null;<NEW_LINE>accum *= radix;<NEW_LINE>if (accum < Integer.MIN_VALUE + digit)<NEW_LINE>return null;<NEW_LINE>accum -= digit;<NEW_LINE>}<NEW_LINE>if (negative)<NEW_LINE>return accum;<NEW_LINE>else if (accum == Integer.MIN_VALUE)<NEW_LINE>return null;<NEW_LINE>else<NEW_LINE>return -accum;<NEW_LINE>} | int cap = Integer.MIN_VALUE / radix; |
998,177 | public void drawU(UGraphic ug) {<NEW_LINE>final StringBounder stringBounder = ug.getStringBounder();<NEW_LINE>final FtileGeometry dim1 = getFtile1().calculateDimension(stringBounder);<NEW_LINE>if (dim1.hasPointOut() == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Point2D p1 = getTranslate1(getFtile1(), stringBounder).getTranslated(dim1.getPointOut());<NEW_LINE>final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);<NEW_LINE>final Point2D p2 = new Point2D.Double(dimTotal.getWidth(), p1.getY() + 15);<NEW_LINE>final Snake snake = Snake.create(skinParam(), <MASK><NEW_LINE>snake.addPoint(p1);<NEW_LINE>snake.addPoint(p1.getX(), p2.getY());<NEW_LINE>snake.addPoint(p2);<NEW_LINE>ug.draw(snake);<NEW_LINE>} | arrowColor, Arrows.asToRight()); |
162,155 | public ImmutableMultimap<ShippedCandidateKey, InOutId> retrieveShipmentIdsByCandidateKey(@NonNull final Set<ShippedCandidateKey> shippedCandidateKeys) {<NEW_LINE>final Set<ShipmentScheduleId> scheduleIds = shippedCandidateKeys.stream().map(ShippedCandidateKey::getShipmentScheduleId).collect(ImmutableSet.toImmutableSet());<NEW_LINE>final ImmutableMap<ShipmentScheduleId, List<I_M_ShipmentSchedule_QtyPicked>> scheduleId2qtyPickedRecords = shipmentScheduleAllocDAO.retrieveOnShipmentLineRecordsByScheduleIds(scheduleIds);<NEW_LINE>final Set<InOutLineId> inOutLineIds = scheduleId2qtyPickedRecords.values().stream().flatMap(List::stream).map(I_M_ShipmentSchedule_QtyPicked::getM_InOutLine_ID).map(InOutLineId::ofRepoId).collect(ImmutableSet.toImmutableSet());<NEW_LINE>final ImmutableMap<InOutLineId, I_M_InOut> lineId2InOut = inOutDAO.retrieveInOutByLineIds(inOutLineIds);<NEW_LINE>final ImmutableMultimap.Builder<ShippedCandidateKey, InOutId> candidateKey2ShipmentId = ImmutableMultimap.builder();<NEW_LINE>for (final ShippedCandidateKey candidateKey : shippedCandidateKeys) {<NEW_LINE>final Supplier<AdempiereException> exceptionSupplier = () -> new AdempiereException("No Shipment was found for the M_ShipmentSchedule_ID!").appendParametersToMessage().setParameter("M_ShipmentSchedule_ID", ShipmentScheduleId.toRepoId(candidateKey.getShipmentScheduleId())).setParameter("ShipmentDocumentNumber", candidateKey.getShipmentDocumentNo());<NEW_LINE>final List<I_M_ShipmentSchedule_QtyPicked> qtyPickedRecords = scheduleId2qtyPickedRecords.get(candidateKey.getShipmentScheduleId());<NEW_LINE>if (qtyPickedRecords == null) {<NEW_LINE>throw exceptionSupplier.get();<NEW_LINE>}<NEW_LINE>final ImmutableList<InOutId> targetShipmentIds = // don't assume that the shipment's documentNo is equal to the request's assumed documentNo<NEW_LINE>qtyPickedRecords.stream().map(I_M_ShipmentSchedule_QtyPicked::getM_InOutLine_ID).map(InOutLineId::ofRepoId).map(lineId2InOut::get).// .filter(shipment -> candidateKey.getShipmentDocumentNo().equals(shipment.getDocumentNo()))<NEW_LINE>map(I_M_InOut::getM_InOut_ID).map(InOutId::ofRepoId).collect(ImmutableList.toImmutableList());<NEW_LINE>if (targetShipmentIds.isEmpty()) {<NEW_LINE>throw exceptionSupplier.get();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return candidateKey2ShipmentId.build();<NEW_LINE>} | candidateKey2ShipmentId.putAll(candidateKey, targetShipmentIds); |
700,634 | private IRubyObject enumerateGraphemeClusters(ThreadContext context, String name, Block block, boolean wantarray) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>RubyString str = this;<NEW_LINE>Encoding enc = str.getEncoding();<NEW_LINE>if (!enc.isUnicode()) {<NEW_LINE>return enumerateChars(<MASK><NEW_LINE>}<NEW_LINE>if (block.isGiven()) {<NEW_LINE>if (wantarray) {<NEW_LINE>runtime.getWarnings().warning("passing a block to String#" + name + " is deprecated");<NEW_LINE>wantarray = false;<NEW_LINE>}<NEW_LINE>} else if (!wantarray) {<NEW_LINE>return enumeratorizeWithSize(context, str, name, RubyString::eachGraphemeClusterSize);<NEW_LINE>}<NEW_LINE>Regex reg = RubyRegexp.getRegexpFromCache(runtime, GRAPHEME_CLUSTER_PATTERN, enc, RegexpOptions.NULL_OPTIONS);<NEW_LINE>if (!wantarray)<NEW_LINE>str = str.newFrozen();<NEW_LINE>ByteList strByteList = str.value;<NEW_LINE>byte[] ptrBytes = strByteList.unsafeBytes();<NEW_LINE>int ptr = strByteList.begin();<NEW_LINE>int end = ptr + strByteList.getRealSize();<NEW_LINE>Matcher matcher = reg.matcher(ptrBytes, ptr, end);<NEW_LINE>RubyArray ary = wantarray ? RubyArray.newArray(runtime, end - ptr) : null;<NEW_LINE>while (ptr < end) {<NEW_LINE>int len = matcher.match(ptr, end, Option.DEFAULT);<NEW_LINE>if (len <= 0)<NEW_LINE>break;<NEW_LINE>RubyString result = newStringShared(runtime, ptrBytes, ptr, len, enc);<NEW_LINE>if (wantarray)<NEW_LINE>ary.append(result);<NEW_LINE>else<NEW_LINE>block.yield(context, result);<NEW_LINE>ptr += len;<NEW_LINE>}<NEW_LINE>return wantarray ? ary : this;<NEW_LINE>} | context, name, block, wantarray); |
531,586 | public void read(org.apache.thrift.protocol.TProtocol prot, flushTablet_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(4);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE>struct.credentials.read(iprot);<NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct<MASK><NEW_LINE>struct.setLockIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.extent = new org.apache.accumulo.core.dataImpl.thrift.TKeyExtent();<NEW_LINE>struct.extent.read(iprot);<NEW_LINE>struct.setExtentIsSet(true);<NEW_LINE>}<NEW_LINE>} | .lock = iprot.readString(); |
391,574 | private void writeRevisionsFeed(HttpServletRequest request, HttpServletResponse response, ServiceMap serviceMap) throws IOException, FeedException, ServiceException, PublicInterfaceNotFoundException {<NEW_LINE>long poid = Long.parseLong(request.getParameter("poid"));<NEW_LINE>SProject sProject = serviceMap.<MASK><NEW_LINE>SyndFeed feed = new SyndFeedImpl();<NEW_LINE>feed.setFeedType(FEED_TYPE);<NEW_LINE>feed.setTitle("BIMserver.org revisions feed for project '" + sProject.getName() + "'");<NEW_LINE>feed.setLink(request.getContextPath());<NEW_LINE>feed.setDescription("This feed represents all the revisions of project '" + sProject.getName() + "'");<NEW_LINE>List<SyndEntry> entries = new ArrayList<SyndEntry>();<NEW_LINE>try {<NEW_LINE>List<SRevision> allRevisionsOfProject = serviceMap.getServiceInterface().getAllRevisionsOfProject(poid);<NEW_LINE>Collections.sort(allRevisionsOfProject, new SRevisionIdComparator(false));<NEW_LINE>for (SRevision sVirtualRevision : allRevisionsOfProject) {<NEW_LINE>SUser user = serviceMap.getServiceInterface().getUserByUoid(sVirtualRevision.getUserId());<NEW_LINE>SyndEntry entry = new SyndEntryImpl();<NEW_LINE>entry.setTitle("Revision " + sVirtualRevision.getOid());<NEW_LINE>entry.setLink(request.getContextPath() + "/revision.jsp?poid=" + sVirtualRevision.getOid() + "&roid=" + sVirtualRevision.getOid());<NEW_LINE>entry.setPublishedDate(sVirtualRevision.getDate());<NEW_LINE>SyndContent description = new SyndContentImpl();<NEW_LINE>description.setType("text/html");<NEW_LINE>description.setValue("<table><tr><td>User</td><td>" + user.getUsername() + "</td></tr><tr><td>Comment</td><td>" + sVirtualRevision.getComment() + "</td></tr></table>");<NEW_LINE>entry.setDescription(description);<NEW_LINE>entries.add(entry);<NEW_LINE>}<NEW_LINE>} catch (ServiceException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>feed.setEntries(entries);<NEW_LINE>SyndFeedOutput output = new SyndFeedOutput();<NEW_LINE>output.output(feed, response.getWriter());<NEW_LINE>} | getServiceInterface().getProjectByPoid(poid); |
1,796,651 | public Result parseFromQueryString(String queryString) {<NEW_LINE>final ParsedQueryString parsed = parseQueryStringAndValidateSignature(queryString, "SAMLRequest");<NEW_LINE>final Element root = parseSamlMessage(inflate(<MASK><NEW_LINE>if (REQUEST_TAG_NAME.equals(root.getLocalName()) && SAML_NAMESPACE.equals(root.getNamespaceURI())) {<NEW_LINE>try {<NEW_LINE>final LogoutRequest logoutRequest = buildXmlObject(root, LogoutRequest.class);<NEW_LINE>return parseLogout(logoutRequest, parsed.hasSignature == false, parsed.relayState);<NEW_LINE>} catch (ElasticsearchSecurityException e) {<NEW_LINE>logger.trace("Rejecting SAML logout request {} because {}", SamlUtils.toString(root), e.getMessage());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw samlException("SAML content [{}] should have a root element of Namespace=[{}] Tag=[{}]", root, SAML_NAMESPACE, REQUEST_TAG_NAME);<NEW_LINE>}<NEW_LINE>} | decodeBase64(parsed.samlMessage))); |
1,844,485 | private UnidbgStructure createDyldImageInfo(MachOModule module) {<NEW_LINE>if (emulator.is64Bit()) {<NEW_LINE>int elementSize = UnidbgStructure.calculateSize(DyldImageInfo64.class);<NEW_LINE>Pointer pointer = emulator.getSvcMemory().allocate(elementSize, "notifySingle");<NEW_LINE>DyldImageInfo64 info = new DyldImageInfo64(pointer);<NEW_LINE>info.imageFilePath = UnidbgPointer.nativeValue(module.createPathMemory(emulator.getSvcMemory()));<NEW_LINE>info.imageLoadAddress = module.machHeader;<NEW_LINE>info.imageFileModDate = 0;<NEW_LINE>info.pack();<NEW_LINE>return info;<NEW_LINE>} else {<NEW_LINE>int elementSize = UnidbgStructure.calculateSize(DyldImageInfo32.class);<NEW_LINE>Pointer pointer = emulator.getSvcMemory().allocate(elementSize, "notifySingle");<NEW_LINE>DyldImageInfo32 info = new DyldImageInfo32(pointer);<NEW_LINE>info.imageFilePath = (int) (UnidbgPointer.nativeValue(module.createPathMemory(<MASK><NEW_LINE>info.imageLoadAddress = (int) module.machHeader;<NEW_LINE>info.imageFileModDate = 0;<NEW_LINE>info.pack();<NEW_LINE>return info;<NEW_LINE>}<NEW_LINE>} | emulator.getSvcMemory()))); |
443,939 | public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>if (!(getParentFragment() instanceof CanAcceptNumber)) {<NEW_LINE>throw new RuntimeException("Parent fragment must implement CanAcceptNumber");<NEW_LINE>}<NEW_LINE>Bundle args = getArguments();<NEW_LINE>final String numberTag = args.getString(NUMBER_TAG);<NEW_LINE>String headerText = args.getString(HEADER_TEXT);<NEW_LINE>String subHeaderText = args.getString(SUBHEADER_TEXT);<NEW_LINE>int numberOfItems = args.getInt(NUMBER_OF_ITEMS);<NEW_LINE>int currentNumber = args.getInt(CURRENT_NUMBER);<NEW_LINE>String[] items = new String[numberOfItems];<NEW_LINE>for (int i = 0; i < numberOfItems; i++) {<NEW_LINE>items[i] = <MASK><NEW_LINE>}<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());<NEW_LINE>builder.setSingleChoiceItems(items, Math.max(0, currentNumber - 1), null).setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>final int userChoice = ((AlertDialog) dialog).getListView().getCheckedItemPosition() + 1;<NEW_LINE>((CanAcceptNumber) getParentFragment()).acceptNumber(numberTag, userChoice);<NEW_LINE>}<NEW_LINE>}).setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>if (subHeaderText != null) {<NEW_LINE>View titleView = LayoutInflater.from(getActivity()).inflate(R.layout.number_picker_dialog_title, null);<NEW_LINE>TextView titleTextView = (TextView) titleView.findViewById(R.id.titleTextView);<NEW_LINE>titleTextView.setText(headerText);<NEW_LINE>TextView subtitleTextView = (TextView) titleView.findViewById(R.id.subtitleTextView);<NEW_LINE>subtitleTextView.setText(subHeaderText);<NEW_LINE>builder.setCustomTitle(titleView);<NEW_LINE>} else {<NEW_LINE>builder.setTitle(headerText);<NEW_LINE>}<NEW_LINE>return builder.create();<NEW_LINE>} | String.valueOf(i + 1); |
195,304 | public void execute(AppView appView) {<NEW_LINE>logger.info("Removing @kotlin.Metadata annotation where not kept...");<NEW_LINE>ClassCounter originalCounter = new ClassCounter();<NEW_LINE>MemberCounter keptMemberCounter = new MemberCounter();<NEW_LINE>MyKotlinAnnotationStripper kotlinAnnotationStripper = new MyKotlinAnnotationStripper();<NEW_LINE>ClassVisitor kotlinAnnotationStripperVisitor = new MultiClassVisitor(new KotlinClassFilter(new // The member counter won't increase if there are no members kept in the class.<NEW_LINE>MultiClassVisitor(// The member counter won't increase if there are no members kept in the class.<NEW_LINE>originalCounter, new // Check how many any of the members were specifically kept.<NEW_LINE>CounterConditionalClassVisitor(// Check how many any of the members were specifically kept.<NEW_LINE>keptMemberCounter, // Check how many any of the members were specifically kept.<NEW_LINE>CounterConditionalClassVisitor::isSame, // Conditional visitor for when members weren't kept, we remove the annotation<NEW_LINE>new AllMemberVisitor(new MemberProcessingFlagFilter(DONT_OBFUSCATE | DONT_SHRINK | DONT_OPTIMIZE, 0, keptMemberCounter)), // if the class does not have DONT_OBFUSCATE, DONT_SHRINK, DONT_OPTIMIZE.<NEW_LINE>new ClassProcessingFlagFilter(0, DONT_OBFUSCATE | DONT_SHRINK | DONT_OPTIMIZE, // Ensure that a class that still has the annotation is marked DONT_OPTIMIZE<NEW_LINE>kotlinAnnotationStripper)))), // (e.g. if originally the member was kept but class wasn't).<NEW_LINE>new KotlinClassFilter(new ProcessingFlagSetter(ProcessingFlags.DONT_OPTIMIZE)));<NEW_LINE>appView.programClassPool.classesAccept(kotlinAnnotationStripperVisitor);<NEW_LINE><MASK><NEW_LINE>logger.info(" Original number of classes with @kotlin.Metadata: {}", originalCounter.getCount());<NEW_LINE>logger.info(" Final number of classes with @kotlin.Metadata: {}", (originalCounter.getCount() - kotlinAnnotationStripper.getCount()));<NEW_LINE>} | appView.libraryClassPool.classesAccept(kotlinAnnotationStripperVisitor); |
1,625,357 | private void commentElement(TreeElementDecl node) {<NEW_LINE>String tag = node.getName();<NEW_LINE>currentElement = tag;<NEW_LINE>headline1(tag, tag);<NEW_LINE>// try to survive various user tags wrap it in <div><NEW_LINE>// NOI18N<NEW_LINE>s.append(comment == null ? "" : "<div>" + comment + "</div>");<NEW_LINE>commentAttributes(node);<NEW_LINE>headline2(NbBundle.getMessage(DTDDoclet.class, "TEXT_ContentModel"));<NEW_LINE>TreeElementDecl.ContentType type = node.getContentType();<NEW_LINE>// NOI18N<NEW_LINE>s.append("<p><tt>");<NEW_LINE>commentContentModel(type);<NEW_LINE>// NOI18N<NEW_LINE>s.append("</tt></p>");<NEW_LINE>headline2(NbBundle.getMessage(DTDDoclet.class, "TEXT_Referenced_by"));<NEW_LINE>// NOI18N<NEW_LINE>s.append("<p><tt>");<NEW_LINE>s<MASK><NEW_LINE>// NOI18N<NEW_LINE>s.append("</tt></p>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("\n");<NEW_LINE>} | .append(getRefList(tag)); |
589,187 | final GetContainerServiceMetricDataResult executeGetContainerServiceMetricData(GetContainerServiceMetricDataRequest getContainerServiceMetricDataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getContainerServiceMetricDataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetContainerServiceMetricDataRequest> request = null;<NEW_LINE>Response<GetContainerServiceMetricDataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetContainerServiceMetricDataRequestProtocolMarshaller(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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetContainerServiceMetricData");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetContainerServiceMetricDataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetContainerServiceMetricDataResultJsonUnmarshaller());<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(getContainerServiceMetricDataRequest)); |
36,229 | public void searchGroups(MethodCall methodCall, final MethodChannel.Result result) {<NEW_LINE>HashMap<String, Object> searchParam = CommonUtil.getParam(methodCall, result, "searchParam");<NEW_LINE>V2TIMGroupSearchParam param = new V2TIMGroupSearchParam();<NEW_LINE>if (searchParam.get("keywordList") != null) {<NEW_LINE>param.setKeywordList((List<String>) searchParam.get("keywordList"));<NEW_LINE>}<NEW_LINE>if (searchParam.get("isSearchGroupID") != null) {<NEW_LINE>param.setSearchGroupID((Boolean) searchParam.get("isSearchGroupID"));<NEW_LINE>}<NEW_LINE>if (searchParam.get("isSearchGroupName") != null) {<NEW_LINE>param.setSearchGroupName((Boolean<MASK><NEW_LINE>}<NEW_LINE>V2TIMManager.getGroupManager().searchGroups(param, new V2TIMValueCallback<List<V2TIMGroupInfo>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(List<V2TIMGroupInfo> v2TIMGroupInfos) {<NEW_LINE>LinkedList<HashMap<String, Object>> infoList = new LinkedList<>();<NEW_LINE>for (int i = 0; i < v2TIMGroupInfos.size(); i++) {<NEW_LINE>infoList.add(CommonUtil.convertV2TIMGroupInfoToMap(v2TIMGroupInfos.get(i)));<NEW_LINE>}<NEW_LINE>CommonUtil.returnSuccess(result, infoList);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int code, String desc) {<NEW_LINE>CommonUtil.returnError(result, code, desc);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ) searchParam.get("isSearchGroupName")); |
1,628,734 | private void initialize() {<NEW_LINE>preferences = MoviescraperPreferences.getInstance();<NEW_LINE>guiSettings = GuiSettings.getInstance();<NEW_LINE>reinitializeAmalgamationPreferencesFromFile();<NEW_LINE>setCurrentlySelectedNfoFileList(new ArrayList<File>());<NEW_LINE>setCurrentlySelectedMovieFileList(new ArrayList<File>());<NEW_LINE>setCurrentlySelectedPosterFileList(new ArrayList<File>());<NEW_LINE>setCurrentlySelectedFolderJpgFileList(new ArrayList<File>());<NEW_LINE>setCurrentlySelectedFanartFileList(new ArrayList<File>());<NEW_LINE>setCurrentlySelectedTrailerFileList(new ArrayList<File>());<NEW_LINE>currentlySelectedActorsFolderList = new ArrayList<>();<NEW_LINE>movieToWriteToDiskList = new ArrayList<>();<NEW_LINE>frmMoviescraper = new JFrame();<NEW_LINE>frmMovieScraperBlocker = new WindowBlocker();<NEW_LINE>// set up the window that sits above the frame and can block input to this frame if needed while a dialog is open<NEW_LINE>frmMoviescraper.setGlassPane(frmMovieScraperBlocker);<NEW_LINE>frmMoviescraper.setBackground(SystemColor.window);<NEW_LINE>frmMoviescraper.setMinimumSize(new Dimension(minimumWidth, minimumHeight));<NEW_LINE>frmMoviescraper.setPreferredSize(new Dimension(guiSettings.getWidth(), guiSettings.getHeight()));<NEW_LINE>frmMoviescraper.setTitle("JAVMovieScraper");<NEW_LINE>frmMoviescraper.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>// Add listener<NEW_LINE>frmMoviescraper.addComponentListener(new ComponentListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentResized(ComponentEvent arg0) {<NEW_LINE>guiSettings.setHeight(frmMoviescraper.getHeight());<NEW_LINE>guiSettings.setWidth(frmMoviescraper.getWidth());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentMoved(ComponentEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentShown(ComponentEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentHidden(ComponentEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// create tree view icon provider<NEW_LINE>IconCache.setIconProvider(getGuiSettings().getUseContentBasedTypeIcons() ? IconCache.IconProviderType.CONTENT : IconCache.IconProviderType.SYSTEM);<NEW_LINE>// Used for icon in the title bar<NEW_LINE>frmMoviescraper.setIconImage(GUICommon.getProgramIcon());<NEW_LINE>// Set up the file list panel - the panel where the user picks what file to scrape<NEW_LINE>setUpFileListPanel();<NEW_LINE>// Set up the bottom panel - area for message panel<NEW_LINE>messageConsolePanel = new MessageConsolePanel();<NEW_LINE>frmMoviescraper.getContentPane().add(messageConsolePanel, BorderLayout.SOUTH);<NEW_LINE>buttonPanel = new GUIMainButtonPanel(this);<NEW_LINE>frmMoviescraper.getContentPane().add(buttonPanel, BorderLayout.NORTH);<NEW_LINE>// add in the menu bar<NEW_LINE>menuBar = new GUIMainMenuBar(this);<NEW_LINE>frmMoviescraper.setJMenuBar(menuBar);<NEW_LINE>frmMoviescraper.pack();<NEW_LINE>frmMoviescraper.setLocationRelativeTo(null);<NEW_LINE>int gap = 7;<NEW_LINE>fileListFileDetailSplitPane.setBorder(BorderFactory.createEmptyBorder());<NEW_LINE>fileListFileDetailSplitPane.setDividerSize(gap);<NEW_LINE>fileListFileDetailSplitPane.setDividerLocation(guiSettings.getFileListDividerLocation());<NEW_LINE>fileListFileDetailSplitPane.addPropertyChangeListener((PropertyChangeEvent evt) -> {<NEW_LINE>if ("dividerLocation".equals(evt.getPropertyName())) {<NEW_LINE>guiSettings.setFileListDividerLocation((<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>messageConsolePanel.setBorder(BorderFactory.createEmptyBorder(gap, 0, 0, 0));<NEW_LINE>// restore gui state<NEW_LINE>buttonPanel.setVisible(guiSettings.getShowToolbar());<NEW_LINE>messageConsolePanel.setVisible(guiSettings.getShowOutputPanel());<NEW_LINE>} | Integer) evt.getNewValue()); |
929,402 | public Object parseObject(String text, ParsePosition pos) {<NEW_LINE>Objects.requireNonNull(text, "text");<NEW_LINE>Parsed unresolved;<NEW_LINE>try {<NEW_LINE>unresolved = formatter.parseUnresolved0(text, pos);<NEW_LINE>} catch (IndexOutOfBoundsException ex) {<NEW_LINE>if (pos.getErrorIndex() < 0) {<NEW_LINE>pos.setErrorIndex(0);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (unresolved == null) {<NEW_LINE>if (pos.getErrorIndex() < 0) {<NEW_LINE>pos.setErrorIndex(0);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DateTimeBuilder builder = unresolved.toBuilder().resolve(formatter.getResolverStyle(<MASK><NEW_LINE>if (query == null) {<NEW_LINE>return builder;<NEW_LINE>}<NEW_LINE>return builder.build(query);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>pos.setErrorIndex(0);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | ), formatter.getResolverFields()); |
896,176 | protected JComponent createCenterPanel() {<NEW_LINE>JPanel mainPanel = new JPanel(new BorderLayout());<NEW_LINE>JPanel panel = <MASK><NEW_LINE>GridBagConstraints constr;<NEW_LINE>constr = new GridBagConstraints();<NEW_LINE>constr.gridx = 0;<NEW_LINE>constr.gridy = 0;<NEW_LINE>constr.anchor = GridBagConstraints.WEST;<NEW_LINE>constr.weighty = 0;<NEW_LINE>constr.gridwidth = 1;<NEW_LINE>constr.insets = new Insets(5, 0, 0, 0);<NEW_LINE>panel.add(new JLabel(ToolsBundle.message("tools.filters.add.name.label")), constr);<NEW_LINE>constr.gridx = 0;<NEW_LINE>constr.gridy = 1;<NEW_LINE>constr.weightx = 1;<NEW_LINE>constr.gridwidth = 3;<NEW_LINE>constr.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>panel.add(myNameField, constr);<NEW_LINE>constr.gridx = 0;<NEW_LINE>constr.gridy = 2;<NEW_LINE>constr.weightx = 0;<NEW_LINE>panel.add(new JLabel(ToolsBundle.message("tools.filters.add.description.label")), constr);<NEW_LINE>constr.gridx = 0;<NEW_LINE>constr.gridy = 3;<NEW_LINE>constr.gridwidth = 2;<NEW_LINE>constr.weightx = 1;<NEW_LINE>panel.add(myDescriptionField, constr);<NEW_LINE>constr.gridy = 4;<NEW_LINE>constr.gridx = 0;<NEW_LINE>constr.gridwidth = 2;<NEW_LINE>constr.weightx = 0;<NEW_LINE>panel.add(new JLabel(ToolsBundle.message("tools.filters.add.regex.label")), constr);<NEW_LINE>constr.gridx = 0;<NEW_LINE>constr.gridy = 5;<NEW_LINE>constr.gridwidth = 3;<NEW_LINE>panel.add(myRegexpField, constr);<NEW_LINE>makePopup();<NEW_LINE>panel.setPreferredSize(new Dimension(335, 160));<NEW_LINE>mainPanel.add(panel, BorderLayout.NORTH);<NEW_LINE>return mainPanel;<NEW_LINE>} | new JPanel(new GridBagLayout()); |
1,594,990 | public ListPublicKeysResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPublicKeysResult listPublicKeysResult = new ListPublicKeysResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listPublicKeysResult;<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("PublicKeyList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPublicKeysResult.setPublicKeyList(new ListUnmarshaller<PublicKey>(PublicKeyJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPublicKeysResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listPublicKeysResult;<NEW_LINE>} | class).unmarshall(context)); |
1,659,337 | private HttpRequest.Builder createUsersWithListInputRequestBuilder(List<User> user) throws ApiException {<NEW_LINE>// verify the required parameter 'user' is set<NEW_LINE>if (user == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput");<NEW_LINE>}<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();<NEW_LINE>String localVarPath = "/user/createWithList";<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));<NEW_LINE>localVarRequestBuilder.header("Content-Type", "application/json");<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);<NEW_LINE>localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ApiException(e);<NEW_LINE>}<NEW_LINE>if (memberVarReadTimeout != null) {<NEW_LINE>localVarRequestBuilder.timeout(memberVarReadTimeout);<NEW_LINE>}<NEW_LINE>if (memberVarInterceptor != null) {<NEW_LINE>memberVarInterceptor.accept(localVarRequestBuilder);<NEW_LINE>}<NEW_LINE>return localVarRequestBuilder;<NEW_LINE>} | localVarRequestBuilder.header("Accept", "application/json"); |
854,784 | private VMTemplateVO createTemplateObjectInDB(SystemVMTemplateDetails details) {<NEW_LINE>Long templateId = vmTemplateDao.getNextInSequence(Long.class, "id");<NEW_LINE>VMTemplateVO template = new VMTemplateVO();<NEW_LINE>template.setUuid(details.getUuid());<NEW_LINE>template.setUniqueName(String.format("routing-%s", <MASK><NEW_LINE>template.setName(details.getName());<NEW_LINE>template.setPublicTemplate(false);<NEW_LINE>template.setFeatured(false);<NEW_LINE>template.setTemplateType(Storage.TemplateType.SYSTEM);<NEW_LINE>template.setRequiresHvm(true);<NEW_LINE>template.setBits(64);<NEW_LINE>template.setAccountId(Account.ACCOUNT_ID_SYSTEM);<NEW_LINE>template.setUrl(details.getUrl());<NEW_LINE>template.setChecksum(details.getChecksum());<NEW_LINE>template.setEnablePassword(false);<NEW_LINE>template.setDisplayText(details.getName());<NEW_LINE>template.setFormat(details.getFormat());<NEW_LINE>template.setGuestOSId(details.getGuestOsId());<NEW_LINE>template.setCrossZones(true);<NEW_LINE>template.setHypervisorType(details.getHypervisorType());<NEW_LINE>template.setState(VirtualMachineTemplate.State.Inactive);<NEW_LINE>template.setDeployAsIs(false);<NEW_LINE>template = vmTemplateDao.persist(template);<NEW_LINE>return template;<NEW_LINE>} | String.valueOf(templateId))); |
1,681,472 | public void onEnforceSLARequest(JobClusterProto.EnforceSLARequest request) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Enter onEnforceSLA for JobCluster {} with request", this.name, request);<NEW_LINE>}<NEW_LINE>numSLAEnforcementExecutions.increment();<NEW_LINE>long now = request.timeOfEnforcement.toEpochMilli();<NEW_LINE>List<JobInfo> pendingInitializationJobsPriorToCutoff = jobManager.getJobActorsStuckInInit(now, getExpirePendingInitializeDelayMs());<NEW_LINE>List<JobInfo> jobsStuckInAcceptedList = jobManager.getJobsStuckInAccepted(now, getExpireAcceptedDelayMs());<NEW_LINE>List<JobInfo> jobsStuckInTerminatingList = jobManager.getJobsStuckInTerminating(now, getExpireAcceptedDelayMs());<NEW_LINE>if (!slaEnforcer.hasSLA()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int activeJobsCount = jobManager.activeJobsCount();<NEW_LINE>int acceptedJobsCount = jobManager.acceptedJobsCount();<NEW_LINE>// enforcing min<NEW_LINE>int noOfJobsToLaunch = <MASK><NEW_LINE>if (noOfJobsToLaunch > 0) {<NEW_LINE>logger.info("Submitting {} jobs for job name {} as active count is {} and accepted count is {}", noOfJobsToLaunch, name, activeJobsCount, acceptedJobsCount);<NEW_LINE>String user = MANTIS_MASTER_USER;<NEW_LINE>if (request.jobDefinitionOp.isPresent()) {<NEW_LINE>user = request.jobDefinitionOp.get().getUser();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < noOfJobsToLaunch; i++) {<NEW_LINE>getSelf().tell(new SubmitJobRequest(name, user, true, request.jobDefinitionOp), getSelf());<NEW_LINE>}<NEW_LINE>// enforce max.<NEW_LINE>} else {<NEW_LINE>List<JobInfo> listOfJobs = new ArrayList<>(activeJobsCount + acceptedJobsCount);<NEW_LINE>listOfJobs.addAll(jobManager.getActiveJobsList());<NEW_LINE>listOfJobs.addAll(jobManager.getAcceptedJobsList());<NEW_LINE>List<JobId> jobsToKill = slaEnforcer.enforceSLAMax(Collections.unmodifiableList(listOfJobs));<NEW_LINE>for (JobId jobId : jobsToKill) {<NEW_LINE>logger.info("Request termination for job {}", jobId);<NEW_LINE>getSelf().tell(new KillJobRequest(jobId, "SLA enforcement", JobCompletedReason.Killed, MANTIS_MASTER_USER, ActorRef.noSender()), getSelf());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Exit onEnforceSLA for JobCluster {}", name);<NEW_LINE>}<NEW_LINE>} | slaEnforcer.enforceSLAMin(activeJobsCount, acceptedJobsCount); |
11,296 | public static ListAggregateDiscoveredResourcesResponse unmarshall(ListAggregateDiscoveredResourcesResponse listAggregateDiscoveredResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAggregateDiscoveredResourcesResponse.setRequestId(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.RequestId"));<NEW_LINE>DiscoveredResourceProfiles discoveredResourceProfiles = new DiscoveredResourceProfiles();<NEW_LINE>discoveredResourceProfiles.setNextToken(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.NextToken"));<NEW_LINE>discoveredResourceProfiles.setMaxResults(_ctx.integerValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.MaxResults"));<NEW_LINE>discoveredResourceProfiles.setPreviousToken(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.PreviousToken"));<NEW_LINE>List<DiscoveredResourceProfile> discoveredResourceProfileList = new ArrayList<DiscoveredResourceProfile>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList.Length"); i++) {<NEW_LINE>DiscoveredResourceProfile discoveredResourceProfile = new DiscoveredResourceProfile();<NEW_LINE>discoveredResourceProfile.setResourceType(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].ResourceType"));<NEW_LINE>discoveredResourceProfile.setRegion(_ctx.stringValue<MASK><NEW_LINE>discoveredResourceProfile.setResourceCreationTime(_ctx.longValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].ResourceCreationTime"));<NEW_LINE>discoveredResourceProfile.setTags(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].Tags"));<NEW_LINE>discoveredResourceProfile.setAccountId(_ctx.longValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].AccountId"));<NEW_LINE>discoveredResourceProfile.setResourceId(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].ResourceId"));<NEW_LINE>discoveredResourceProfile.setResourceName(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].ResourceName"));<NEW_LINE>discoveredResourceProfile.setResourceDeleted(_ctx.integerValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].ResourceDeleted"));<NEW_LINE>discoveredResourceProfile.setResourceStatus(_ctx.stringValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].ResourceStatus"));<NEW_LINE>discoveredResourceProfile.setResourceOwnerId(_ctx.longValue("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].ResourceOwnerId"));<NEW_LINE>discoveredResourceProfileList.add(discoveredResourceProfile);<NEW_LINE>}<NEW_LINE>discoveredResourceProfiles.setDiscoveredResourceProfileList(discoveredResourceProfileList);<NEW_LINE>listAggregateDiscoveredResourcesResponse.setDiscoveredResourceProfiles(discoveredResourceProfiles);<NEW_LINE>return listAggregateDiscoveredResourcesResponse;<NEW_LINE>} | ("ListAggregateDiscoveredResourcesResponse.DiscoveredResourceProfiles.DiscoveredResourceProfileList[" + i + "].Region")); |
1,310,624 | public GenericRowFileManager reduce() throws Exception {<NEW_LINE>LOGGER.info("Start reducing on partition: {}", _partitionId);<NEW_LINE>long reduceStartTimeMs = System.currentTimeMillis();<NEW_LINE>GenericRowFileReader fileReader = _fileManager.getFileReader();<NEW_LINE>int numRows = fileReader.getNumRows();<NEW_LINE>int numSortFields = fileReader.getNumSortFields();<NEW_LINE>LOGGER.info("Start sorting on numRows: {}, numSortFields: {}", numRows, numSortFields);<NEW_LINE>long sortStartTimeMs = System.currentTimeMillis();<NEW_LINE>GenericRowFileRecordReader recordReader = fileReader.getRecordReader();<NEW_LINE>LOGGER.info("Finish sorting in {}ms", System.currentTimeMillis() - sortStartTimeMs);<NEW_LINE>File partitionOutputDir = new File(_reducerOutputDir, _partitionId);<NEW_LINE>FileUtils.forceMkdir(partitionOutputDir);<NEW_LINE>LOGGER.info("Start creating dedup file under dir: {}", partitionOutputDir);<NEW_LINE><MASK><NEW_LINE>GenericRowFileManager dedupFileManager = new GenericRowFileManager(partitionOutputDir, _fileManager.getFieldSpecs(), _fileManager.isIncludeNullFields(), 0);<NEW_LINE>GenericRowFileWriter dedupFileWriter = dedupFileManager.getFileWriter();<NEW_LINE>GenericRow previousRow = new GenericRow();<NEW_LINE>recordReader.read(0, previousRow);<NEW_LINE>int previousRowId = 0;<NEW_LINE>dedupFileWriter.write(previousRow);<NEW_LINE>for (int i = 1; i < numRows; i++) {<NEW_LINE>if (recordReader.compare(previousRowId, i) != 0) {<NEW_LINE>previousRow.clear();<NEW_LINE>recordReader.read(i, previousRow);<NEW_LINE>previousRowId = i;<NEW_LINE>dedupFileWriter.write(previousRow);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dedupFileManager.closeFileWriter();<NEW_LINE>LOGGER.info("Finish creating dedup file in {}ms", System.currentTimeMillis() - dedupFileCreationStartTimeMs);<NEW_LINE>_fileManager.cleanUp();<NEW_LINE>LOGGER.info("Finish reducing in {}ms", System.currentTimeMillis() - reduceStartTimeMs);<NEW_LINE>return dedupFileManager;<NEW_LINE>} | long dedupFileCreationStartTimeMs = System.currentTimeMillis(); |
967,855 | final DisassociateApplicationFleetResult executeDisassociateApplicationFleet(DisassociateApplicationFleetRequest disassociateApplicationFleetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateApplicationFleetRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateApplicationFleetRequest> request = null;<NEW_LINE>Response<DisassociateApplicationFleetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateApplicationFleetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateApplicationFleetRequest));<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, "AppStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateApplicationFleet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateApplicationFleetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateApplicationFleetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,083,880 | final ListBillingGroupsResult executeListBillingGroups(ListBillingGroupsRequest listBillingGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBillingGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBillingGroupsRequest> request = null;<NEW_LINE>Response<ListBillingGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBillingGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBillingGroupsRequest));<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, "billingconductor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBillingGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBillingGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListBillingGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,665,660 | protected void generateXML(ProjectInfo proj) {<NEW_LINE>String apiname = proj.getName();<NEW_LINE>Javadoc jd = initJavadoc("Analyzing " + apiname);<NEW_LINE>jd.setDestdir(getDestdir());<NEW_LINE>addSourcePaths(jd, proj);<NEW_LINE>// Tell Javadoc which packages we want to scan.<NEW_LINE>// JDiff works with packagenames, not sourcefiles.<NEW_LINE>jd.setPackagenames(getPackageList(proj));<NEW_LINE>// Create the DocletInfo first so we have a way to use it to add params<NEW_LINE>DocletInfo dInfo = jd.createDoclet();<NEW_LINE>jd.setDoclet("jdiff.JDiff");<NEW_LINE>jd.setDocletPath(new Path(project, jdiffClassPath));<NEW_LINE>// Now set up some parameters for the JDiff doclet.<NEW_LINE>DocletParam dp1 = dInfo.createParam();<NEW_LINE>dp1.setName("-apiname");<NEW_LINE>dp1.setValue(apiname);<NEW_LINE>DocletParam dp2 = dInfo.createParam();<NEW_LINE>dp2.setName("-baseURI");<NEW_LINE>dp2.setValue("http://www.w3.org");<NEW_LINE>// Put the generated file in the same directory as the report<NEW_LINE><MASK><NEW_LINE>dp3.setName("-apidir");<NEW_LINE>dp3.setValue(getDestdir().toString());<NEW_LINE>// Execute the Javadoc command to generate the XML file.<NEW_LINE>jd.perform();<NEW_LINE>} | DocletParam dp3 = dInfo.createParam(); |
1,622,758 | public void drawFigure(Graphics graphics) {<NEW_LINE>graphics.pushState();<NEW_LINE>Rectangle bounds = getBounds();<NEW_LINE>bounds.width--;<NEW_LINE>bounds.height--;<NEW_LINE>// Set line width here so that the whole figure is constrained, otherwise SVG graphics will have overspill<NEW_LINE>setLineWidth(graphics, 1, bounds);<NEW_LINE>PointList points = new PointList();<NEW_LINE>points.addPoint(bounds.x + FLANGE, bounds.y);<NEW_LINE>points.addPoint(bounds.x + bounds.width, bounds.y);<NEW_LINE>points.addPoint(bounds.x + bounds.width - FLANGE, bounds.y + bounds.height);<NEW_LINE>points.addPoint(bounds.x, bounds.y + bounds.height);<NEW_LINE>graphics.setAlpha(getAlpha());<NEW_LINE>if (!isEnabled()) {<NEW_LINE>setDisabledState(graphics);<NEW_LINE>}<NEW_LINE>// Fill<NEW_LINE>graphics.setBackgroundColor(getFillColor());<NEW_LINE>Pattern <MASK><NEW_LINE>Path path = FigureUtils.createPathFromPoints(points);<NEW_LINE>graphics.fillPath(path);<NEW_LINE>path.dispose();<NEW_LINE>disposeGradientPattern(graphics, gradient);<NEW_LINE>// Outline<NEW_LINE>graphics.setAlpha(getLineAlpha());<NEW_LINE>graphics.setForegroundColor(getLineColor());<NEW_LINE>graphics.drawPolygon(points);<NEW_LINE>// Slash<NEW_LINE>if (fWithSlash) {<NEW_LINE>graphics.drawLine(bounds.x + FLANGE + 20, bounds.y, bounds.x + 20, bounds.y + bounds.height);<NEW_LINE>}<NEW_LINE>// Icon<NEW_LINE>// getOwner().drawIconImage(graphics, bounds);<NEW_LINE>getOwner().drawIconImage(graphics, bounds, 0, 0, 0, 0);<NEW_LINE>graphics.popState();<NEW_LINE>} | gradient = applyGradientPattern(graphics, bounds); |
1,815,512 | private void wrapCalloutView() {<NEW_LINE>// some hackery is needed to get the arbitrary infowindow view to render centered, and<NEW_LINE>// with only the width/height that it needs.<NEW_LINE>if (this.calloutView == null || this.calloutView.getChildCount() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LinearLayout LL = new LinearLayout(context);<NEW_LINE><MASK><NEW_LINE>LL.setLayoutParams(new LinearLayout.LayoutParams(this.calloutView.width, this.calloutView.height, 0f));<NEW_LINE>LinearLayout LL2 = new LinearLayout(context);<NEW_LINE>LL2.setOrientation(LinearLayout.HORIZONTAL);<NEW_LINE>LL2.setLayoutParams(new LinearLayout.LayoutParams(this.calloutView.width, this.calloutView.height, 0f));<NEW_LINE>LL.addView(LL2);<NEW_LINE>LL2.addView(this.calloutView);<NEW_LINE>this.wrappedCalloutView = LL;<NEW_LINE>} | LL.setOrientation(LinearLayout.VERTICAL); |
1,308,558 | private List<Long> listStalledVMInTransitionStateOnDisconnectedHosts(final Date cutTime) {<NEW_LINE>final String sql = "SELECT i.* FROM vm_instance as i, host as h WHERE h.status != 'UP' " + "AND i.power_state_update_time < ? AND i.host_id = h.id " + "AND (i.state ='Starting' OR i.state='Stopping' OR i.state='Migrating') " + "AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)" + "AND i.removed IS NULL";<NEW_LINE>final List<Long> l = new ArrayList<>();<NEW_LINE>try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB)) {<NEW_LINE>String cutTimeStr = DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutTime);<NEW_LINE>int jobStatusInProgress = JobInfo<MASK><NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = txn.prepareAutoCloseStatement(sql);<NEW_LINE>pstmt.setString(1, cutTimeStr);<NEW_LINE>pstmt.setInt(2, jobStatusInProgress);<NEW_LINE>final ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>l.add(rs.getLong(1));<NEW_LINE>}<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>s_logger.error(String.format("Unable to execute SQL [%s] with params {\"i.power_state_update_time\": \"%s\", \"j.job_status\": %s} due to [%s].", sql, cutTimeStr, jobStatusInProgress, e.getMessage()), e);<NEW_LINE>}<NEW_LINE>return l;<NEW_LINE>}<NEW_LINE>} | .Status.IN_PROGRESS.ordinal(); |
921,738 | public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredFile' is set<NEW_LINE>if (requiredFile == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));<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, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (additionalMetadata != null)<NEW_LINE>localVarFormParams.put("additionalMetadata", additionalMetadata);<NEW_LINE>if (requiredFile != null)<NEW_LINE>localVarFormParams.put("requiredFile", requiredFile);<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>GenericType<ModelApiResponse> localVarReturnType = new GenericType<ModelApiResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); |
1,159,090 | public static // '[' ('...'|Expression?) ']' Type<NEW_LINE>boolean ArrayOrSliceType(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "ArrayOrSliceType"))<NEW_LINE>return false;<NEW_LINE>if (!nextTokenIs(b, LBRACK))<NEW_LINE>return false;<NEW_LINE>boolean r, p;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, ARRAY_OR_SLICE_TYPE, null);<NEW_LINE>r = consumeToken(b, LBRACK);<NEW_LINE>// pin = 1<NEW_LINE>p = r;<NEW_LINE>r = r && report_error_(b, ArrayOrSliceType_1(b, l + 1));<NEW_LINE>r = p && report_error_(b, consumeToken(b, RBRACK)) && r;<NEW_LINE>r = p && Type(<MASK><NEW_LINE>exit_section_(b, l, m, r, p, null);<NEW_LINE>return r || p;<NEW_LINE>} | b, l + 1) && r; |
103,830 | public void visitSerializableProperties(final Object object, final JavaBeanProvider.Visitor visitor) {<NEW_LINE>final PropertyDescriptor[] propertyDescriptors = getSerializableProperties(object);<NEW_LINE>for (final PropertyDescriptor property : propertyDescriptors) {<NEW_LINE>ErrorWritingException ex = null;<NEW_LINE>try {<NEW_LINE>final Method readMethod = property.getReadMethod();<NEW_LINE>final String name = property.getName();<NEW_LINE>final Class<?> definedIn = readMethod.getDeclaringClass();<NEW_LINE>if (visitor.shouldVisit(name, definedIn)) {<NEW_LINE>final Object value = readMethod.invoke(object);<NEW_LINE>visitor.visit(name, property.getPropertyType(), definedIn, value);<NEW_LINE>}<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>ex = new ConversionException("Cannot get property", e);<NEW_LINE>} catch (final IllegalAccessException e) {<NEW_LINE>ex = new ObjectAccessException("Cannot access property", e);<NEW_LINE>} catch (final InvocationTargetException e) {<NEW_LINE>ex = new ConversionException("Cannot get property", e.getTargetException());<NEW_LINE>}<NEW_LINE>if (ex != null) {<NEW_LINE>ex.add("property", object.getClass() + <MASK><NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "." + property.getName()); |
423,000 | private CostDetailCreateResult createCostDetailAndAdjustCurrentCosts(final CostDetailCreateRequest request) {<NEW_LINE>final boolean isInboundTrx = request.getQty().signum() >= 0;<NEW_LINE>final CurrentCost currentCosts = utils.getCurrentCost(request);<NEW_LINE>final CostDetailPreviousAmounts <MASK><NEW_LINE>// final CostPrice currentCostPrice = currentCosts.getCostPrice();<NEW_LINE>final CostDetailCreateRequest requestEffective;<NEW_LINE>//<NEW_LINE>// Inbound transactions (qty >= 0)<NEW_LINE>// or Reversals<NEW_LINE>if (isInboundTrx || request.isReversal()) {<NEW_LINE>// Seed/initial costs import<NEW_LINE>if (request.getDocumentRef().isInventoryLine() && request.getQty().signum() == 0) {<NEW_LINE>requestEffective = request.withAmount(request.getAmt().toZero());<NEW_LINE>if (currentCosts.getCurrentQty().isZero()) {<NEW_LINE>currentCosts.setOwnCostPrice(request.getAmt());<NEW_LINE>} else {<NEW_LINE>// Do not change an existing positive cost price if there is also a positive qty<NEW_LINE>}<NEW_LINE>} else // In case the amount was not provided but there is a positive qty incoming<NEW_LINE>// use the current cost price to calculate the amount.<NEW_LINE>// In case of reversals, always consider the Amt.<NEW_LINE>{<NEW_LINE>final CostPrice price = currentCosts.getCostPrice();<NEW_LINE>final Quantity qty = utils.convertToUOM(request.getQty(), price.getUomId(), request.getProductId());<NEW_LINE>if (request.getAmt().isZero() && !request.isReversal()) {<NEW_LINE>final CostAmount amt = price.multiply(qty).roundToPrecisionIfNeeded(currentCosts.getPrecision());<NEW_LINE>requestEffective = request.withAmountAndQty(amt, qty);<NEW_LINE>} else {<NEW_LINE>requestEffective = request.withQty(qty);<NEW_LINE>}<NEW_LINE>currentCosts.addWeightedAverage(requestEffective.getAmt(), requestEffective.getQty(), utils.getQuantityUOMConverter());<NEW_LINE>}<NEW_LINE>} else //<NEW_LINE>// Outbound transactions (qty < 0)<NEW_LINE>{<NEW_LINE>final CostPrice price = currentCosts.getCostPrice();<NEW_LINE>final Quantity qty = utils.convertToUOM(request.getQty(), price.getUomId(), request.getProductId());<NEW_LINE>final CostAmount amt = price.multiply(qty).roundToPrecisionIfNeeded(currentCosts.getPrecision());<NEW_LINE>requestEffective = request.withAmountAndQty(amt, qty);<NEW_LINE>currentCosts.addToCurrentQtyAndCumulate(qty, amt);<NEW_LINE>}<NEW_LINE>final CostDetailCreateResult result = utils.createCostDetailRecordWithChangedCosts(requestEffective, previousCosts);<NEW_LINE>utils.saveCurrentCost(currentCosts);<NEW_LINE>return result;<NEW_LINE>} | previousCosts = CostDetailPreviousAmounts.of(currentCosts); |
456,350 | public AllowlistOperationResult removeAccounts(final List<String> accounts) {<NEW_LINE>final List<String> normalizedAccounts = normalizeAccounts(accounts);<NEW_LINE><MASK><NEW_LINE>if (inputValidationResult != AllowlistOperationResult.SUCCESS) {<NEW_LINE>return inputValidationResult;<NEW_LINE>}<NEW_LINE>if (!accountAllowlist.containsAll(normalizedAccounts)) {<NEW_LINE>return AllowlistOperationResult.ERROR_ABSENT_ENTRY;<NEW_LINE>}<NEW_LINE>final List<String> oldAllowlist = new ArrayList<>(this.accountAllowlist);<NEW_LINE>this.accountAllowlist.removeAll(normalizedAccounts);<NEW_LINE>try {<NEW_LINE>verifyConfigurationFileState(oldAllowlist);<NEW_LINE>updateConfigurationFile(accountAllowlist);<NEW_LINE>verifyConfigurationFileState(accountAllowlist);<NEW_LINE>} catch (IOException e) {<NEW_LINE>revertState(oldAllowlist);<NEW_LINE>return AllowlistOperationResult.ERROR_ALLOWLIST_PERSIST_FAIL;<NEW_LINE>} catch (AllowlistFileSyncException e) {<NEW_LINE>return AllowlistOperationResult.ERROR_ALLOWLIST_FILE_SYNC;<NEW_LINE>}<NEW_LINE>return AllowlistOperationResult.SUCCESS;<NEW_LINE>} | final AllowlistOperationResult inputValidationResult = inputValidation(normalizedAccounts); |
1,144,087 | ControlSession newControlSession(final long correlationId, final int streamId, final int version, final String channel, final byte[] encodedCredentials, final ControlSessionDemuxer demuxer) {<NEW_LINE>final ChannelUri channelUri = ChannelUri.parse(channel);<NEW_LINE>final String mtuStr = channelUri.get(CommonContext.MTU_LENGTH_PARAM_NAME);<NEW_LINE>final int mtuLength = null == mtuStr ? ctx.controlMtuLength() : (int) SystemUtil.parseSize(MTU_LENGTH_PARAM_NAME, mtuStr);<NEW_LINE>final String <MASK><NEW_LINE>final int termLength = null == termLengthStr ? ctx.controlTermBufferLength() : (int) SystemUtil.parseSize(TERM_LENGTH_PARAM_NAME, termLengthStr);<NEW_LINE>final String isSparseStr = channelUri.get(SPARSE_PARAM_NAME);<NEW_LINE>final boolean isSparse = null == isSparseStr ? ctx.controlTermBufferSparse() : Boolean.parseBoolean(isSparseStr);<NEW_LINE>final String responseChannel = strippedChannelBuilder(channelUri).ttl(channelUri).termLength(termLength).sparse(isSparse).mtu(mtuLength).build();<NEW_LINE>String invalidVersionMessage = null;<NEW_LINE>if (SemanticVersion.major(version) != AeronArchive.Configuration.PROTOCOL_MAJOR_VERSION) {<NEW_LINE>invalidVersionMessage = "invalid client version " + SemanticVersion.toString(version) + ", archive is " + SemanticVersion.toString(AeronArchive.Configuration.PROTOCOL_SEMANTIC_VERSION);<NEW_LINE>}<NEW_LINE>final ControlSession controlSession = new ControlSession(nextSessionId++, correlationId, connectTimeoutMs, aeron.asyncAddExclusivePublication(responseChannel, streamId), invalidVersionMessage, demuxer, aeron, this, cachedEpochClock, controlResponseProxy, authenticator, controlSessionProxy);<NEW_LINE>authenticator.onConnectRequest(controlSession.sessionId(), encodedCredentials, cachedEpochClock.time());<NEW_LINE>addSession(controlSession);<NEW_LINE>ctx.controlSessionsCounter().incrementOrdered();<NEW_LINE>return controlSession;<NEW_LINE>} | termLengthStr = channelUri.get(TERM_LENGTH_PARAM_NAME); |
1,662,831 | private void execute(JSDynamicObject obj, Object getterV, Object setterV) {<NEW_LINE>DynamicObjectLibrary dynamicObjectLib = dynamicObjectLibrary();<NEW_LINE>JSDynamicObject getter = (JSDynamicObject) getterV;<NEW_LINE>JSDynamicObject setter = (JSDynamicObject) setterV;<NEW_LINE>if ((getterNode == null || setterNode == null) && JSProperty.isAccessor(dynamicObjectLib.getPropertyFlagsOrDefault(obj, name, 0))) {<NEW_LINE>// No full accessor information and there is an accessor property already<NEW_LINE>// => merge the new and existing accessor functions<NEW_LINE>Accessor existing = (Accessor) dynamicObjectLib.getOrDefault(obj, name, null);<NEW_LINE>getter = (getter == null) ? existing.getGetter() : getter;<NEW_LINE>setter = (setter == null) ? existing.getSetter() : setter;<NEW_LINE>}<NEW_LINE>Accessor accessor = new Accessor(getter, setter);<NEW_LINE>dynamicObjectLib.putWithFlags(obj, name, <MASK><NEW_LINE>} | accessor, attributes | JSProperty.ACCESSOR); |
1,263,962 | protected void doSourceArchiveUpdates(CompilerSpec compilerSpec, TaskMonitor monitor) throws CancelledException {<NEW_LINE>SourceArchiveUpgradeMap upgradeMap = new SourceArchiveUpgradeMap();<NEW_LINE>for (SourceArchive sourceArchive : getSourceArchives()) {<NEW_LINE>SourceArchive mappedSourceArchive = upgradeMap.getMappedSourceArchive(sourceArchive, compilerSpec);<NEW_LINE>if (mappedSourceArchive != null) {<NEW_LINE>replaceSourceArchive(sourceArchive, mappedSourceArchive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (String name : SourceArchiveUpgradeMap.getTypedefReplacements()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>DataType dataType = getDataType(CategoryPath.ROOT, name);<NEW_LINE>if (dataType instanceof TypeDef) {<NEW_LINE>DataType builtIn = builtInDTM.getDataType(CategoryPath.ROOT, name);<NEW_LINE>if (builtIn != null) {<NEW_LINE>try {<NEW_LINE>replace(dataType, resolve(builtIn, null));<NEW_LINE>} catch (DataTypeDependencyException e) {<NEW_LINE>throw new AssertException("Got DataTypeDependencyException on built in", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | BuiltInDataTypeManager builtInDTM = BuiltInDataTypeManager.getDataTypeManager(); |
1,500,977 | public void marshall(Job job, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (job == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(job.getAccelerationSettings(), ACCELERATIONSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getAccelerationStatus(), ACCELERATIONSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getBillingTagsSource(), BILLINGTAGSSOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(job.getErrorCode(), ERRORCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getErrorMessage(), ERRORMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getHopDestinations(), HOPDESTINATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getJobPercentComplete(), JOBPERCENTCOMPLETE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getJobTemplate(), JOBTEMPLATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getMessages(), MESSAGES_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getOutputGroupDetails(), OUTPUTGROUPDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getPriority(), PRIORITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getQueue(), QUEUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getQueueTransitions(), QUEUETRANSITIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getRetryCount(), RETRYCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getRole(), ROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getSettings(), SETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getSimulateReservedQueue(), SIMULATERESERVEDQUEUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getStatusUpdateInterval(), STATUSUPDATEINTERVAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getTiming(), TIMING_BINDING);<NEW_LINE>protocolMarshaller.marshall(job.getUserMetadata(), USERMETADATA_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | job.getCurrentPhase(), CURRENTPHASE_BINDING); |
1,257,417 | private void readFieldStatistics(HollowBlobInput in, HollowObjectSchema unfilteredSchema) throws IOException {<NEW_LINE>bitsPerRecord = 0;<NEW_LINE>bitsPerUnfilteredField = new int[unfilteredSchema.numFields()];<NEW_LINE>unfilteredFieldIsIncluded = new boolean[unfilteredSchema.numFields()];<NEW_LINE>int filteredFieldIdx = 0;<NEW_LINE>for (int i = 0; i < unfilteredSchema.numFields(); i++) {<NEW_LINE>int readBitsPerField = VarInt.readVInt(in);<NEW_LINE>bitsPerUnfilteredField[i] = readBitsPerField;<NEW_LINE>unfilteredFieldIsIncluded[i] = schema.getPosition(unfilteredSchema.getFieldName(i)) != -1;<NEW_LINE>if (unfilteredFieldIsIncluded[i]) {<NEW_LINE>bitsPerField[filteredFieldIdx] = readBitsPerField;<NEW_LINE>nullValueForField[filteredFieldIdx] = bitsPerField[filteredFieldIdx] == 64 ? -1L : (1L <MASK><NEW_LINE>bitOffsetPerField[filteredFieldIdx] = bitsPerRecord;<NEW_LINE>bitsPerRecord += bitsPerField[filteredFieldIdx];<NEW_LINE>filteredFieldIdx++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | << bitsPerField[filteredFieldIdx]) - 1; |
515,640 | public BatchAttachToIndexResponse unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchAttachToIndexResponse batchAttachToIndexResponse = new BatchAttachToIndexResponse();<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("AttachedObjectIdentifier", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchAttachToIndexResponse.setAttachedObjectIdentifier(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 batchAttachToIndexResponse;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
235,480 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>((WordPress) getActivity().getApplication()).component().inject(this);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>AppLog.d(T.READER, "reader post list > restoring instance state");<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_TAG)) {<NEW_LINE>mCurrentTag = (ReaderTag) savedInstanceState.getSerializable(ReaderConstants.ARG_TAG);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_BLOG_ID)) {<NEW_LINE>mCurrentBlogId = savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_FEED_ID)) {<NEW_LINE>mCurrentFeedId = savedInstanceState.getLong(ReaderConstants.ARG_FEED_ID);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_SEARCH_QUERY)) {<NEW_LINE>mCurrentSearchQuery = savedInstanceState.getString(ReaderConstants.ARG_SEARCH_QUERY);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_POST_LIST_TYPE)) {<NEW_LINE>mPostListType = (ReaderPostListType) savedInstanceState.getSerializable(ReaderConstants.ARG_POST_LIST_TYPE);<NEW_LINE>}<NEW_LINE>if (getPostListType() == ReaderPostListType.TAG_PREVIEW) {<NEW_LINE>mTagPreviewHistory.restoreInstance(savedInstanceState);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_IS_TOP_LEVEL)) {<NEW_LINE>mIsTopLevel = savedInstanceState.getBoolean(ReaderConstants.ARG_IS_TOP_LEVEL);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_ORIGINAL_TAG)) {<NEW_LINE>mTagFragmentStartedWith = (ReaderTag) savedInstanceState.getSerializable(ReaderConstants.ARG_ORIGINAL_TAG);<NEW_LINE>}<NEW_LINE>mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION);<NEW_LINE>mSiteSearchRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_SITE_SEARCH_RESTORE_POSITION);<NEW_LINE>mWasPaused = <MASK><NEW_LINE>mHasUpdatedPosts = savedInstanceState.getBoolean(ReaderConstants.KEY_ALREADY_UPDATED);<NEW_LINE>mFirstLoad = savedInstanceState.getBoolean(ReaderConstants.KEY_FIRST_LOAD);<NEW_LINE>mSearchTabsPos = savedInstanceState.getInt(ReaderConstants.KEY_ACTIVE_SEARCH_TAB, NO_POSITION);<NEW_LINE>mQuickStartEvent = savedInstanceState.getParcelable(QuickStartEvent.KEY);<NEW_LINE>}<NEW_LINE>} | savedInstanceState.getBoolean(ReaderConstants.KEY_WAS_PAUSED); |
448,966 | public Request<DescribeClassicLinkInstancesRequest> marshall(DescribeClassicLinkInstancesRequest describeClassicLinkInstancesRequest) {<NEW_LINE>if (describeClassicLinkInstancesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeClassicLinkInstancesRequest> request = new DefaultRequest<DescribeClassicLinkInstancesRequest>(describeClassicLinkInstancesRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DescribeClassicLinkInstances");<NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>java.util.List<String> instanceIdsList = describeClassicLinkInstancesRequest.getInstanceIds();<NEW_LINE>int instanceIdsListIndex = 1;<NEW_LINE>for (String instanceIdsListValue : instanceIdsList) {<NEW_LINE>if (instanceIdsListValue != null) {<NEW_LINE>request.addParameter("InstanceId." + instanceIdsListIndex, StringUtils.fromString(instanceIdsListValue));<NEW_LINE>}<NEW_LINE>instanceIdsListIndex++;<NEW_LINE>}<NEW_LINE>java.util.List<Filter<MASK><NEW_LINE>int filtersListIndex = 1;<NEW_LINE>for (Filter filtersListValue : filtersList) {<NEW_LINE>Filter filterMember = filtersListValue;<NEW_LINE>if (filterMember != null) {<NEW_LINE>if (filterMember.getName() != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Name", StringUtils.fromString(filterMember.getName()));<NEW_LINE>}<NEW_LINE>java.util.List<String> valuesList = filterMember.getValues();<NEW_LINE>int valuesListIndex = 1;<NEW_LINE>for (String valuesListValue : valuesList) {<NEW_LINE>if (valuesListValue != null) {<NEW_LINE>request.addParameter("Filter." + filtersListIndex + ".Value." + valuesListIndex, StringUtils.fromString(valuesListValue));<NEW_LINE>}<NEW_LINE>valuesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filtersListIndex++;<NEW_LINE>}<NEW_LINE>if (describeClassicLinkInstancesRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(describeClassicLinkInstancesRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (describeClassicLinkInstancesRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger(describeClassicLinkInstancesRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | > filtersList = describeClassicLinkInstancesRequest.getFilters(); |
1,393,064 | private static YailList jsonObjectToYail(final String logTag, final JSONObject object) throws JSONException {<NEW_LINE>List<YailList> pairs = new ArrayList<YailList>();<NEW_LINE>// json only allows String keys<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Iterator<String> j = object.keys();<NEW_LINE>while (j.hasNext()) {<NEW_LINE>String key = j.next();<NEW_LINE>Object <MASK><NEW_LINE>if (value instanceof Boolean || value instanceof Integer || value instanceof Long || value instanceof Double || value instanceof String) {<NEW_LINE>pairs.add(YailList.makeList(new Object[] { key, value }));<NEW_LINE>} else if (value instanceof JSONArray) {<NEW_LINE>pairs.add(YailList.makeList(new Object[] { key, jsonArrayToYail(logTag, (JSONArray) value) }));<NEW_LINE>} else if (value instanceof JSONObject) {<NEW_LINE>pairs.add(YailList.makeList(new Object[] { key, jsonObjectToYail(logTag, (JSONObject) value) }));<NEW_LINE>} else if (!JSONObject.NULL.equals(value)) {<NEW_LINE>Log.wtf(logTag, ERROR_UNKNOWN_TYPE + ": " + value.getClass());<NEW_LINE>throw new IllegalArgumentException(ERROR_UNKNOWN_TYPE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return YailList.makeList(pairs);<NEW_LINE>} | value = object.get(key); |
241,529 | public void processSave(final IHUContext huContext, final I_M_HU_Trx_Attribute trxAttribute, final Object referencedModel) {<NEW_LINE>if (!HUConstants.DEBUG_07277_processHUTrxAttribute) {<NEW_LINE>// FIXME debuging<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final I_M_HU hu = InterfaceWrapperHelper.create(referencedModel, I_M_HU.class);<NEW_LINE>final IHUAttributesDAO huAttributesDAO = huContext.getHUAttributeStorageFactory().getHUAttributesDAO();<NEW_LINE>final I_M_HU_Attribute <MASK><NEW_LINE>final I_M_HU_Attribute huAttribute;<NEW_LINE>if (huAttributeExisting == null) {<NEW_LINE>// Create new attribute<NEW_LINE>huAttribute = InterfaceWrapperHelper.newInstance(I_M_HU_Attribute.class, hu);<NEW_LINE>huAttribute.setAD_Org_ID(hu.getAD_Org_ID());<NEW_LINE>huAttribute.setM_HU(hu);<NEW_LINE>huAttribute.setM_Attribute_ID(trxAttribute.getM_Attribute_ID());<NEW_LINE>huAttribute.setM_HU_PI_Attribute_ID(trxAttribute.getM_HU_PI_Attribute_ID());<NEW_LINE>} else {<NEW_LINE>huAttribute = huAttributeExisting;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Update values<NEW_LINE>huAttribute.setValue(trxAttribute.getValue());<NEW_LINE>huAttribute.setValueNumber(trxAttribute.getValueNumber());<NEW_LINE>// TODO tsa: why following line was missing?!?<NEW_LINE>// huAttribute.setValueDate(trxAttribute.getValueDate());<NEW_LINE>huAttributesDAO.save(huAttribute);<NEW_LINE>} | huAttributeExisting = retrieveHUAttribute(huAttributesDAO, trxAttribute); |
791,513 | private EnumDataType applyEnumMsType(AbstractEnumMsType type) throws PdbException {<NEW_LINE>String fullPathName = type.getName();<NEW_LINE>// // TODO: evaluate whether we do full SymbolPath... see others<NEW_LINE>// SymbolPath fixedPath = getFixedSymbolPath();<NEW_LINE>//<NEW_LINE>// RecordNumber underlyingRecordNumber = type.getUnderlyingRecordNumber();<NEW_LINE>// MsProperty property = type.getMsProperty();<NEW_LINE>// if (property.isForwardReference()) {<NEW_LINE>// // investigate this<NEW_LINE>// }<NEW_LINE>// underlyingApplier = applicator.getApplier(underlyingRecordNumber);<NEW_LINE>//<NEW_LINE>// if (underlyingApplier == null) {<NEW_LINE>// applicator.appendLogMsg("Missing applier for underlying type index " +<NEW_LINE>// underlyingRecordNumber + " in Enum " + fullPathName);<NEW_LINE>// return null;<NEW_LINE>// }<NEW_LINE>// DataType underlyingType = underlyingApplier.getDataType();<NEW_LINE>// int length = 0;<NEW_LINE>// if (underlyingType != null) {<NEW_LINE>// length = underlyingType.getLength();<NEW_LINE>// }<NEW_LINE>// else {<NEW_LINE>// AbstractMsType underlying = underlyingApplier.getMsType();<NEW_LINE>// if (underlying instanceof PrimitiveMsType) {<NEW_LINE>// length = ((PrimitiveMsType) underlying).getTypeSize();<NEW_LINE>// // TODO: there might be more<NEW_LINE>// // TODO: investigate getSize() on AbstractMsType?<NEW_LINE>// // then: length = underlying.getSize();<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// // Ghidra does not like size of zero.<NEW_LINE>// length = Integer.max(length, 1);<NEW_LINE>//<NEW_LINE>// CategoryPath categoryPath = applicator.getCategory(fixedPath.getParent());<NEW_LINE>// EnumDataType enumDataType = new EnumDataType(categoryPath, fixedPath.getName(), length,<NEW_LINE>// applicator.getDataTypeManager());<NEW_LINE>//<NEW_LINE>RecordNumber fieldListRecordNumber = type.getFieldDescriptorListRecordNumber();<NEW_LINE>FieldListTypeApplier fieldListApplier = FieldListTypeApplier.getFieldListApplierSpecial(applicator, fieldListRecordNumber);<NEW_LINE>// Note: not doing anything with getNamespaceList() or getMethodsList() at this time.<NEW_LINE>List<MsTypeApplier> memberList = fieldListApplier.getMemberList();<NEW_LINE>int numElements = type.getNumElements();<NEW_LINE>if (memberList.size() != numElements) {<NEW_LINE>pdbLogAndInfoMessage(this, "Enum expecting " + numElements + " elements, but only " + memberList.<MASK><NEW_LINE>}<NEW_LINE>EnumDataType enumDataType = (EnumDataType) dataType;<NEW_LINE>int length = getLength();<NEW_LINE>boolean isSigned = isSigned();<NEW_LINE>for (MsTypeApplier memberApplier : memberList) {<NEW_LINE>if (memberApplier instanceof EnumerateTypeApplier) {<NEW_LINE>EnumerateTypeApplier enumerateApplier = (EnumerateTypeApplier) memberApplier;<NEW_LINE>SymbolPath memberSymbolPath = new SymbolPath(enumerateApplier.getName());<NEW_LINE>enumDataType.add(memberSymbolPath.getName(), narrowingConversion(length, isSigned, enumerateApplier.getNumeric()));<NEW_LINE>} else {<NEW_LINE>// (member instanceof AbstractMemberMsType)<NEW_LINE>// I do not believe (until proven otherwise) that an Enum will have members of<NEW_LINE>// type AbstractMemberMsType.<NEW_LINE>pdbLogAndInfoMessage(this, getClass().getSimpleName() + ": unexpected " + memberApplier.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return enumDataType;<NEW_LINE>} | size() + " available for " + fullPathName); |
816,062 | public com.amazonaws.services.snowball.model.InvalidNextTokenException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.snowball.model.InvalidNextTokenException invalidNextTokenException = new com.amazonaws.services.snowball.model.InvalidNextTokenException(null);<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>} 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 invalidNextTokenException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
178,903 | final SearchDevicesResult executeSearchDevices(SearchDevicesRequest searchDevicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchDevicesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchDevicesRequest> request = null;<NEW_LINE>Response<SearchDevicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchDevicesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(searchDevicesRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SearchDevices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchDevicesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SearchDevicesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
326,358 | public DataFile execute(CommandContext ctxt) throws CommandException {<NEW_LINE>if (!file.getOwner().isFileAccessRequest()) {<NEW_LINE>throw new CommandException(BundleUtil.getStringFromBundle("file.requestAccess.notAllowed"), this);<NEW_LINE>}<NEW_LINE>// if user already has permission to download file or the file is public throw command exception<NEW_LINE>if (!file.isRestricted() || ctxt.permissions().requestOn(this.getRequest(), file).has(Permission.DownloadFile)) {<NEW_LINE>throw new CommandException(BundleUtil.getStringFromBundle("file.requestAccess.notAllowed.alreadyHasDownloadPermisssion"), this);<NEW_LINE>}<NEW_LINE>if (FileUtil.isActivelyEmbargoed(file)) {<NEW_LINE>throw new CommandException(BundleUtil<MASK><NEW_LINE>}<NEW_LINE>file.getFileAccessRequesters().add(requester);<NEW_LINE>if (sendNotification) {<NEW_LINE>ctxt.fileDownload().sendRequestFileAccessNotification(this.file, requester);<NEW_LINE>}<NEW_LINE>return ctxt.files().save(file);<NEW_LINE>} | .getStringFromBundle("file.requestAccess.notAllowed.embargoed"), this); |
1,286,790 | public Mono<Response<AddressResponseInner>> listVipsWithResponseAsync(String resourceGroupName, String name) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listVips(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,015,456 | public static AggregateFunctionInitArguments createAggregateFunctionInitArgs(final int udafIndex, final FunctionCall functionCall, final KsqlConfig config) {<NEW_LINE>final List<Expression> args = functionCall.getArguments();<NEW_LINE>final List<Object> initArgs = new ArrayList<>(Math.max(0, args.size() - 1));<NEW_LINE>// args for index > 0 must be literals:<NEW_LINE>for (int idx = 1; idx < args.size(); idx++) {<NEW_LINE>final Expression param = args.get(idx);<NEW_LINE>if (!(param instanceof Literal)) {<NEW_LINE>throw new KsqlException("Parameter " + (idx + 1) + " passed to function " + functionCall.getName().text() + " must be a literal constant, but was expression: '" + param + "'");<NEW_LINE>}<NEW_LINE>initArgs.add(((Literal) param).getValue());<NEW_LINE>}<NEW_LINE>final Map<String, Object> functionConfig = config.getKsqlFunctionsConfigProps(functionCall.getName().text());<NEW_LINE>return new <MASK><NEW_LINE>} | AggregateFunctionInitArguments(udafIndex, functionConfig, initArgs); |
868,013 | public void onDescriptorRead(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) {<NEW_LINE>final byte[] data = descriptor.getValue();<NEW_LINE>if (status == BluetoothGatt.GATT_SUCCESS) {<NEW_LINE>log(Log.INFO, () -> "Read Response received from descr. " + descriptor.getUuid() + ", value: " + ParserUtils.parse(data));<NEW_LINE>BleManagerHandler.<MASK><NEW_LINE>if (request instanceof ReadRequest) {<NEW_LINE>final ReadRequest request = (ReadRequest) BleManagerHandler.this.request;<NEW_LINE>request.notifyValueChanged(gatt.getDevice(), data);<NEW_LINE>if (request.hasMore()) {<NEW_LINE>enqueueFirst(request);<NEW_LINE>} else {<NEW_LINE>request.notifySuccess(gatt.getDevice());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (status == BluetoothGatt.GATT_INSUFFICIENT_AUTHENTICATION || status == 8 || /* GATT INSUF AUTHORIZATION */<NEW_LINE>status == 137) /* GATT AUTH FAIL */<NEW_LINE>{<NEW_LINE>log(Log.WARN, () -> "Authentication required (" + status + ")");<NEW_LINE>if (gatt.getDevice().getBondState() != BluetoothDevice.BOND_NONE) {<NEW_LINE>// This should never happen but it used to: http://stackoverflow.com/a/20093695/2115352<NEW_LINE>Log.w(TAG, ERROR_AUTH_ERROR_WHILE_BONDED);<NEW_LINE>postCallback(c -> c.onError(gatt.getDevice(), ERROR_AUTH_ERROR_WHILE_BONDED, status));<NEW_LINE>}<NEW_LINE>// The request will be repeated when the bond state changes to BONDED.<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>Log.e(TAG, "onDescriptorRead error " + status);<NEW_LINE>if (request instanceof ReadRequest) {<NEW_LINE>request.notifyFail(gatt.getDevice(), status);<NEW_LINE>}<NEW_LINE>awaitingRequest = null;<NEW_LINE>onError(gatt.getDevice(), ERROR_READ_DESCRIPTOR, status);<NEW_LINE>}<NEW_LINE>checkCondition();<NEW_LINE>nextRequest(true);<NEW_LINE>} | this.onDescriptorRead(gatt, descriptor); |
843,304 | public NamingEnumeration<SearchResult> search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException {<NEW_LINE>PartialCompositeDirContext ctx = this;<NEW_LINE>Hashtable<?, ?> env = p_getEnvironment();<NEW_LINE>Continuation cont <MASK><NEW_LINE>NamingEnumeration<SearchResult> answer;<NEW_LINE>Name nm = name;<NEW_LINE>try {<NEW_LINE>answer = ctx.p_search(nm, filterExpr, filterArgs, cons, cont);<NEW_LINE>while (cont.isContinue()) {<NEW_LINE>nm = cont.getRemainingName();<NEW_LINE>ctx = getPCDirContext(cont);<NEW_LINE>answer = ctx.p_search(nm, filterExpr, filterArgs, cons, cont);<NEW_LINE>}<NEW_LINE>} catch (CannotProceedException e) {<NEW_LINE>DirContext cctx = DirectoryManager.getContinuationDirContext(e);<NEW_LINE>answer = cctx.search(e.getRemainingName(), filterExpr, filterArgs, cons);<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>} | = new Continuation(name, env); |
1,251,004 | final DescribeRiskConfigurationResult executeDescribeRiskConfiguration(DescribeRiskConfigurationRequest describeRiskConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRiskConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRiskConfigurationRequest> request = null;<NEW_LINE>Response<DescribeRiskConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRiskConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRiskConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRiskConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRiskConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRiskConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,328,813 | public void startWarmUpThread() {<NEW_LINE>new Thread() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Thread.sleep(500);<NEW_LINE>String internalName = FindBox.class.getName();<NEW_LINE>TypeReference type = metadataSystem.lookupType(internalName);<NEW_LINE>TypeDefinition resolvedType = null;<NEW_LINE>if ((type == null) || ((resolvedType = type.resolve()) == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringWriter stringwriter = new StringWriter();<NEW_LINE>PlainTextOutput plainTextOutput = new PlainTextOutput(stringwriter);<NEW_LINE>plainTextOutput.setUnicodeOutputEnabled(decompilationOptions.getSettings().isUnicodeOutputEnabled());<NEW_LINE>settings.getLanguage().decompileType(resolvedType, plainTextOutput, decompilationOptions);<NEW_LINE>String decompiledSource = stringwriter.toString();<NEW_LINE>OpenFile open = new OpenFile(internalName, "*/" + internalName, getTheme(), mainWindow);<NEW_LINE>open.setContent(decompiledSource);<NEW_LINE>JTabbedPane pane = new JTabbedPane();<NEW_LINE>pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);<NEW_LINE>pane.addTab("title", open.scrollPane);<NEW_LINE>pane.setSelectedIndex(pane.indexOfTab("title"));<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>} | Luyten.showExceptionDialog("Exception!", e); |
1,631,114 | public String initNetwork(@Nullable String networkName, @Nullable String networkPrefix) {<NEW_LINE>try {<NEW_LINE>WebTarget webTarget = getTarget(CoordConsts.SVC_RSC_INIT_NETWORK);<NEW_LINE>// postData will close it<NEW_LINE>@SuppressWarnings("PMD.CloseResource")<NEW_LINE>MultiPart multiPart = new MultiPart();<NEW_LINE>multiPart.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE);<NEW_LINE>addTextMultiPart(multiPart, CoordConsts.SVC_KEY_API_KEY, _settings.getApiKey());<NEW_LINE>if (networkName != null) {<NEW_LINE>addTextMultiPart(multiPart, CoordConsts.SVC_KEY_NETWORK_NAME, networkName);<NEW_LINE>} else {<NEW_LINE>addTextMultiPart(multiPart, CoordConsts.SVC_KEY_NETWORK_PREFIX, networkPrefix);<NEW_LINE>}<NEW_LINE>JSONObject jObj = postData(webTarget, multiPart);<NEW_LINE>if (jObj == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!jObj.has(CoordConsts.SVC_KEY_NETWORK_NAME)) {<NEW_LINE>_logger.errorf("network name key not found in: %s\n", jObj);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.errorf("exception: ");<NEW_LINE>_logger.error(Throwables.getStackTraceAsString(e) + "\n");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | jObj.getString(CoordConsts.SVC_KEY_NETWORK_NAME); |
912,293 | private void loadTweets(final List<Long> tweetIds, final ViewGroup container, final List<Integer> viewIds) {<NEW_LINE>TweetUtils.loadTweets(tweetIds, new Callback<List<Tweet>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(Result<List<Tweet>> result) {<NEW_LINE>final Context context = getActivity();<NEW_LINE>if (context == null)<NEW_LINE>return;<NEW_LINE>for (int i = 0; i < result.data.size(); i++) {<NEW_LINE>final BaseTweetView tv = new CompactTweetView(context, result.data.get(i), R.style.tw__TweetDarkWithActionsStyle);<NEW_LINE>tv.setOnActionCallback(actionCallback);<NEW_LINE>tv.setId<MASK><NEW_LINE>container.addView(tv);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void failure(TwitterException exception) {<NEW_LINE>Log.e(TAG, "loadTweets failure " + tweetIds, exception);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (viewIds.get(i)); |
1,318,641 | public void initialise() {<NEW_LINE>setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation());<NEW_LINE>WidgetUtil.trySubscribe(this, "close", button -> {<NEW_LINE>final UniverseSetupScreen universeSetupScreen = getManager().createScreen(UniverseSetupScreen.ASSET_URI, UniverseSetupScreen.class);<NEW_LINE>final WorldPreGenerationScreen worldPreGenerationScreen = getManager().createScreen(WorldPreGenerationScreen.ASSET_URI, WorldPreGenerationScreen.class);<NEW_LINE>UIText customWorldName = find("customisedWorldName", UIText.class);<NEW_LINE>boolean goBack = false;<NEW_LINE>// sanity checks on world name<NEW_LINE>if (customWorldName.getText().isEmpty()) {<NEW_LINE>// name empty: display a popup, stay on the same screen<NEW_LINE>getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage("Name Cannot Be Empty!", "Please add a name for the world");<NEW_LINE>} else if (customWorldName.getText().equalsIgnoreCase(world.getWorldName().toString())) {<NEW_LINE>// same name as before: go back to universe setup<NEW_LINE>goBack = true;<NEW_LINE>} else if (universeSetupScreen.worldNameMatchesAnother(customWorldName.getText())) {<NEW_LINE>// if same name is already used, inform user with a popup<NEW_LINE>getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class<MASK><NEW_LINE>} else {<NEW_LINE>// no match found: go back to universe setup<NEW_LINE>goBack = true;<NEW_LINE>}<NEW_LINE>if (goBack) {<NEW_LINE>newWorldName = new Name(customWorldName.getText());<NEW_LINE>world.setWorldName(newWorldName);<NEW_LINE>universeSetupScreen.refreshWorldDropdown(worldsDropdown);<NEW_LINE>worldPreGenerationScreen.setName(newWorldName);<NEW_LINE>triggerBackAnimation();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ).setMessage("Name Already Used!", "Please use a different name for this world"); |
694,740 | private Optional<Set<BatfishUUID>> toAddrgrpMemberUUIDs(Address_namesContext ctx, FortiosStructureUsage usage, boolean pruneAll) {<NEW_LINE>int line = ctx.start.getLine();<NEW_LINE>Map<String, Address> addressesMap = _c.getAddresses();<NEW_LINE>Map<String, Addrgrp> addrgrpsMap = _c.getAddrgrps();<NEW_LINE>ImmutableSet.Builder<BatfishUUID> addressUuidsBuilder = ImmutableSet.builder();<NEW_LINE>Set<String> addresses = ctx.address_name().stream().map(n -> toString(n.str())).collect(ImmutableSet.toImmutableSet());<NEW_LINE>for (String name : addresses) {<NEW_LINE>if (pruneAll && name.equals(Policy.ALL_ADDRESSES) && addresses.size() > 1) {<NEW_LINE>warn(ctx, "When 'all' is set together with other address(es), it is removed");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (addressesMap.containsKey(name)) {<NEW_LINE>addressUuidsBuilder.add(addressesMap.get(name).getBatfishUUID());<NEW_LINE>_c.referenceStructure(FortiosStructureType.ADDRESS, name, usage, line);<NEW_LINE>} else if (addrgrpsMap.containsKey(name)) {<NEW_LINE>addressUuidsBuilder.add(addrgrpsMap.get(name).getBatfishUUID());<NEW_LINE>_c.referenceStructure(FortiosStructureType.ADDRGRP, name, usage, line);<NEW_LINE>} else {<NEW_LINE>_c.undefined(FortiosStructureType.ADDRESS_OR_ADDRGRP, name, usage, line);<NEW_LINE>warn(ctx, String.format("Address or addrgrp %s is undefined and cannot be referenced", name));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.<MASK><NEW_LINE>} | of(addressUuidsBuilder.build()); |
1,685,805 | private Expression transformMethodCallExpression(final MethodCallExpression exp) {<NEW_LINE>ClassNode traitType = getTraitSuperTarget(exp.getObjectExpression());<NEW_LINE>if (traitType != null) {<NEW_LINE>ClassNode helperType = getHelper(traitType);<NEW_LINE>// TraitType.super.foo() -> TraitType$Trait$Helper.foo(this)<NEW_LINE>List<MethodNode> targets = helperType.getMethods(exp.getMethodAsString());<NEW_LINE>boolean isStatic = !targets.isEmpty() && targets.stream().map(MethodNode::getParameters).allMatch(params -> params.length > 0 && params[0].getType()<MASK><NEW_LINE>ArgumentListExpression newArgs = new ArgumentListExpression(isStatic ? thisPropX(false, "class") : varX("this"));<NEW_LINE>Expression arguments = exp.getArguments();<NEW_LINE>if (arguments instanceof TupleExpression) {<NEW_LINE>for (Expression expression : (TupleExpression) arguments) {<NEW_LINE>newArgs.addExpression(transform(expression));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newArgs.addExpression(transform(arguments));<NEW_LINE>}<NEW_LINE>MethodCallExpression newCall = new MethodCallExpression(new ClassExpression(helperType), transform(exp.getMethod()), newArgs);<NEW_LINE>newCall.getObjectExpression().setSourcePosition(traitType);<NEW_LINE>newCall.setSpreadSafe(exp.isSpreadSafe());<NEW_LINE>newCall.setImplicitThis(false);<NEW_LINE>return newCall;<NEW_LINE>}<NEW_LINE>return super.transform(exp);<NEW_LINE>} | .equals(ClassHelper.CLASS_Type)); |
1,282,558 | private void createSubmenu(JMenu menu) {<NEW_LINE>Node[] nodes = getActivatedNodes();<NEW_LINE>if (nodes != null && nodes.length == 1) {<NEW_LINE>RADComponentCookie radCookie = nodes[0].getCookie(RADComponentCookie.class);<NEW_LINE>RADComponent comp = (radCookie != null) ? radCookie.getRADComponent() : null;<NEW_LINE>if (comp != null) {<NEW_LINE>List<JMenuItem> list <MASK><NEW_LINE>RADComponent topComp = comp.getFormModel().getTopRADComponent();<NEW_LINE>boolean topCompIncluded = false;<NEW_LINE>RADComponent parent = comp.getParentComponent();<NEW_LINE>while (parent != null) {<NEW_LINE>list.add(new DesignParentMenuItem(parent, parent == topComp, getMenuItemListener()));<NEW_LINE>if (parent == topComp) {<NEW_LINE>topCompIncluded = true;<NEW_LINE>}<NEW_LINE>parent = parent.getParentComponent();<NEW_LINE>}<NEW_LINE>if (!topCompIncluded && topComp != null) {<NEW_LINE>list.add(new DesignParentMenuItem(topComp, true, getMenuItemListener()));<NEW_LINE>}<NEW_LINE>for (ListIterator<JMenuItem> it = list.listIterator(list.size()); it.hasPrevious(); ) {<NEW_LINE>menu.add(it.previous());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new ArrayList<JMenuItem>(); |
1,713,793 | public Object call() throws Exception {<NEW_LINE>try {<NEW_LINE>final Object result = task.execute(reqId, serverInstance, manager, database);<NEW_LINE>if (result instanceof Throwable && !(result instanceof OException))<NEW_LINE>// EXCEPTION<NEW_LINE>ODistributedServerLog.debug(this, nodeName, getNodeNameById(reqId.getNodeId()), DIRECTION.IN, "Error on executing request %d (%s) on local node: ", (Throwable) result, reqId, task);<NEW_LINE>return result;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// IGNORE IT<NEW_LINE>ODistributedServerLog.debug(this, nodeName, getNodeNameById(reqId.getNodeId()), DIRECTION.IN, "Interrupted execution on executing distributed request %s on local node: %s", e, reqId, task);<NEW_LINE>return e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!(e instanceof OException))<NEW_LINE>ODistributedServerLog.error(this, nodeName, getNodeNameById(reqId.getNodeId()), DIRECTION.IN, <MASK><NEW_LINE>return e;<NEW_LINE>}<NEW_LINE>} | "Error on executing distributed request %s on local node: %s", e, reqId, task); |
984,707 | public ExternalTaskQueryBuilder buildQuery(ProcessEngine processEngine) {<NEW_LINE>ExternalTaskQueryBuilder fetchBuilder = processEngine.getExternalTaskService().fetchAndLock(getMaxTasks(), getWorkerId(), isUsePriority());<NEW_LINE>if (getTopics() != null) {<NEW_LINE>for (FetchExternalTaskTopicDto topicDto : getTopics()) {<NEW_LINE>ExternalTaskQueryTopicBuilder topicFetchBuilder = fetchBuilder.topic(topicDto.getTopicName(), topicDto.getLockDuration());<NEW_LINE>if (topicDto.getBusinessKey() != null) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.businessKey(topicDto.getBusinessKey());<NEW_LINE>}<NEW_LINE>if (topicDto.getProcessDefinitionId() != null) {<NEW_LINE>topicFetchBuilder.<MASK><NEW_LINE>}<NEW_LINE>if (topicDto.getProcessDefinitionIdIn() != null) {<NEW_LINE>topicFetchBuilder.processDefinitionIdIn(topicDto.getProcessDefinitionIdIn());<NEW_LINE>}<NEW_LINE>if (topicDto.getProcessDefinitionKey() != null) {<NEW_LINE>topicFetchBuilder.processDefinitionKey(topicDto.getProcessDefinitionKey());<NEW_LINE>}<NEW_LINE>if (topicDto.getProcessDefinitionKeyIn() != null) {<NEW_LINE>topicFetchBuilder.processDefinitionKeyIn(topicDto.getProcessDefinitionKeyIn());<NEW_LINE>}<NEW_LINE>if (topicDto.getVariables() != null) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.variables(topicDto.getVariables());<NEW_LINE>}<NEW_LINE>if (topicDto.getProcessVariables() != null) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.processInstanceVariableEquals(topicDto.getProcessVariables());<NEW_LINE>}<NEW_LINE>if (topicDto.isDeserializeValues()) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.enableCustomObjectDeserialization();<NEW_LINE>}<NEW_LINE>if (topicDto.isLocalVariables()) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.localVariables();<NEW_LINE>}<NEW_LINE>if (TRUE.equals(topicDto.isWithoutTenantId())) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.withoutTenantId();<NEW_LINE>}<NEW_LINE>if (topicDto.getTenantIdIn() != null) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.tenantIdIn(topicDto.getTenantIdIn());<NEW_LINE>}<NEW_LINE>if (topicDto.getProcessDefinitionVersionTag() != null) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.processDefinitionVersionTag(topicDto.getProcessDefinitionVersionTag());<NEW_LINE>}<NEW_LINE>if (topicDto.isIncludeExtensionProperties()) {<NEW_LINE>topicFetchBuilder = topicFetchBuilder.includeExtensionProperties();<NEW_LINE>}<NEW_LINE>fetchBuilder = topicFetchBuilder;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fetchBuilder;<NEW_LINE>} | processDefinitionId(topicDto.getProcessDefinitionId()); |
773,539 | private void updateSpawnMode(boolean spawnMode) {<NEW_LINE>wasSpawnMode = spawnMode;<NEW_LINE>((ContainerPoweredSpawner) inventorySlots).setSlotVisibility(!spawnMode);<NEW_LINE>if (spawnMode) {<NEW_LINE>getGhostSlotHandler().getGhostSlots().clear();<NEW_LINE>header = Lang.GUI_SPAWNER_SPAWN.get();<NEW_LINE>progressTooltipRect.x = 80;<NEW_LINE>progressTooltipRect.y = 34;<NEW_LINE>progressTooltipRect.width = 14;<NEW_LINE>progressTooltipRect.height = 14;<NEW_LINE>} else {<NEW_LINE>((ContainerPoweredSpawner) inventorySlots).createGhostSlots(<MASK><NEW_LINE>header = Lang.GUI_SPAWNER_CAPTURE.get();<NEW_LINE>progressTooltipRect.x = 52;<NEW_LINE>progressTooltipRect.y = 40;<NEW_LINE>progressTooltipRect.width = 72;<NEW_LINE>progressTooltipRect.height = 21;<NEW_LINE>}<NEW_LINE>} | getGhostSlotHandler().getGhostSlots()); |
797,283 | private Object translateAvroRecordToPegasusUnionWithAliases(Object value, UnionDataSchema unionDataSchema, Schema avroSchema) {<NEW_LINE>Schema recordAvroSchema = extractNonnullSchema(avroSchema);<NEW_LINE>GenericRecord record = (GenericRecord) value;<NEW_LINE>Object fieldDiscriminatorValue = <MASK><NEW_LINE>if (fieldDiscriminatorValue == null) {<NEW_LINE>appendMessage("cannot find required field %1$s in record %2$s", DataSchemaConstants.DISCRIMINATOR_FIELD, record);<NEW_LINE>return BAD_RESULT;<NEW_LINE>}<NEW_LINE>String fieldDiscriminator = fieldDiscriminatorValue.toString();<NEW_LINE>if (DataSchemaConstants.NULL_TYPE.equals(fieldDiscriminator)) {<NEW_LINE>return Data.NULL;<NEW_LINE>} else {<NEW_LINE>Object fieldValue = record.get(fieldDiscriminator);<NEW_LINE>Schema fieldAvroSchema = recordAvroSchema.getField(fieldDiscriminator).schema();<NEW_LINE>DataSchema memberDataSchema = unionDataSchema.getTypeByMemberKey(fieldDiscriminator);<NEW_LINE>DataMap result = new DataMap(1);<NEW_LINE>_path.add(fieldDiscriminator);<NEW_LINE>result.put(fieldDiscriminator, translate(fieldValue, memberDataSchema, extractNonnullSchema(fieldAvroSchema)));<NEW_LINE>_path.removeLast();<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | record.get(DataSchemaConstants.DISCRIMINATOR_FIELD); |
1,161,806 | public HeartbeatResponse call() {<NEW_LINE>TPaloBrokerService.Client client = null;<NEW_LINE>TNetworkAddress addr = new TNetworkAddress(broker.ip, broker.port);<NEW_LINE>boolean ok = false;<NEW_LINE>try {<NEW_LINE>client = ClientPool.brokerPool.borrowObject(addr);<NEW_LINE>TBrokerPingBrokerRequest request = new TBrokerPingBrokerRequest(TBrokerVersion.VERSION_ONE, clientId);<NEW_LINE>TBrokerOperationStatus status = client.ping(request);<NEW_LINE>ok = true;<NEW_LINE>if (status.getStatusCode() != TBrokerOperationStatusCode.OK) {<NEW_LINE>return new BrokerHbResponse(brokerName, broker.ip, broker.port, status.getMessage());<NEW_LINE>} else {<NEW_LINE>return new BrokerHbResponse(brokerName, broker.ip, broker.port, System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return new BrokerHbResponse(brokerName, broker.ip, broker.port, Strings.isNullOrEmpty(e.getMessage()) ? <MASK><NEW_LINE>} finally {<NEW_LINE>if (ok) {<NEW_LINE>ClientPool.brokerPool.returnObject(addr, client);<NEW_LINE>} else {<NEW_LINE>ClientPool.brokerPool.invalidateObject(addr, client);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "got exception" : e.getMessage()); |
89,807 | private StringBuilder printSamplePerf(OperationPerfGroup perfGroup) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>boolean firstLine = true;<NEW_LINE>for (int i = 0; i < perfGroup.getOperationPerfs().size(); i++) {<NEW_LINE>OperationPerf operationPerf = perfGroup.getOperationPerfs().get(i);<NEW_LINE>PerfInfo stageTotal = operationPerf.findStage(MeterInvocationConst.STAGE_TOTAL);<NEW_LINE>if (Double.compare(0D, stageTotal.getTps()) == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (firstLine) {<NEW_LINE>firstLine = false;<NEW_LINE>String status = perfGroup.getTransport() + "." + perfGroup.getStatus();<NEW_LINE>sb.append(String.format(FIRST_LINE_SIMPLE_FORMAT, status, stageTotal.getTps(), getDetailsFromPerf(stageTotal), formatLatencyDistribution(operationPerf)<MASK><NEW_LINE>} else {<NEW_LINE>sb.append(String.format(SIMPLE_FORMAT, stageTotal.getTps(), getDetailsFromPerf(stageTotal), formatLatencyDistribution(operationPerf), operationPerf.getOperation()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OperationPerf summaryOperation = perfGroup.getSummary();<NEW_LINE>PerfInfo stageSummaryTotal = summaryOperation.findStage(MeterInvocationConst.STAGE_TOTAL);<NEW_LINE>// print summary<NEW_LINE>sb.append(String.format(SIMPLE_FORMAT, stageSummaryTotal.getTps(), getDetailsFromPerf(stageSummaryTotal), formatLatencyDistribution(summaryOperation), "(summary)"));<NEW_LINE>return sb;<NEW_LINE>} | , operationPerf.getOperation())); |
1,488,477 | public void encodeMessage(byte[] data) throws NibeHeatPumpException {<NEW_LINE>if (NibeHeatPumpProtocol.isModbus40ReadResponse(data)) {<NEW_LINE>super.encodeMessage(data);<NEW_LINE>coilAddress = ((rawMessage[NibeHeatPumpProtocol.RES_OFFS_DATA + 1] & 0xFF) << 8 | (rawMessage[NibeHeatPumpProtocol.RES_OFFS_DATA + 0] & 0xFF));<NEW_LINE>value = (rawMessage[NibeHeatPumpProtocol.RES_OFFS_DATA + 5] & 0xFF) << 24 | (rawMessage[NibeHeatPumpProtocol.RES_OFFS_DATA + 4] & 0xFF) << 16 | (rawMessage[NibeHeatPumpProtocol.RES_OFFS_DATA + 3] & 0xFF) << 8 | (rawMessage[NibeHeatPumpProtocol<MASK><NEW_LINE>} else {<NEW_LINE>throw new NibeHeatPumpException("Not Read Response message");<NEW_LINE>}<NEW_LINE>} | .RES_OFFS_DATA + 2] & 0xFF); |
128,225 | protected void writeBarbecue(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException {<NEW_LINE>Component component = componentElement.getComponent();<NEW_LINE>BarbecueComponent barcode = (BarbecueComponent) component;<NEW_LINE>JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper();<NEW_LINE>ComponentKey componentKey = componentElement.getComponentKey();<NEW_LINE>XmlNamespace namespace = new XmlNamespace(ComponentsExtensionsRegistryFactory.NAMESPACE, componentKey.getNamespacePrefix(), ComponentsExtensionsRegistryFactory.XSD_LOCATION);<NEW_LINE>writer.startElement("barbecue", namespace);<NEW_LINE>writer.addAttribute("type", barcode.getType());<NEW_LINE>writer.addAttribute("drawText", barcode.isDrawText());<NEW_LINE>writer.addAttribute(<MASK><NEW_LINE>writer.addAttribute("barWidth", barcode.getBarWidth());<NEW_LINE>writer.addAttribute("barHeight", barcode.getBarHeight());<NEW_LINE>if (isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_0_0)) {<NEW_LINE>writer.addAttribute("rotation", barcode.getOwnRotation());<NEW_LINE>}<NEW_LINE>if (barcode.getEvaluationTimeValue() != EvaluationTimeEnum.NOW) {<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, barcode.getEvaluationTimeValue());<NEW_LINE>}<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, barcode.getEvaluationGroup());<NEW_LINE>writeExpression("codeExpression", barcode.getCodeExpression(), false, componentElement, reportWriter);<NEW_LINE>writeExpression("applicationIdentifierExpression", barcode.getApplicationIdentifierExpression(), false, componentElement, reportWriter);<NEW_LINE>writer.closeElement();<NEW_LINE>} | "checksumRequired", barcode.isChecksumRequired()); |
80,853 | protected void computeBarycentricCoordinates(DogArray<Point3D_F64> controlWorldPts, DMatrixRMaj alphas, List<Point3D_F64> worldPts) {<NEW_LINE>alphas.reshape(worldPts.size(), numControl, false);<NEW_LINE>v_temp.reshape(3, 1);<NEW_LINE>A_temp.reshape(3, numControl - 1);<NEW_LINE>for (int i = 0; i < numControl - 1; i++) {<NEW_LINE>Point3D_F64 c = controlWorldPts.get(i);<NEW_LINE>A_temp.set(0, i, c.x - meanWorldPts.x);<NEW_LINE>A_temp.set(1, i, c.y - meanWorldPts.y);<NEW_LINE>A_temp.set(2, i, c.z - meanWorldPts.z);<NEW_LINE>}<NEW_LINE>// invert the matrix<NEW_LINE>solverPinv.setA(A_temp);<NEW_LINE>A_temp.reshape(A_temp.numCols, A_temp.numRows);<NEW_LINE>solverPinv.invert(A_temp);<NEW_LINE>w_temp.reshape(numControl - 1, 1);<NEW_LINE>for (int i = 0; i < worldPts.size(); i++) {<NEW_LINE>Point3D_F64 p = worldPts.get(i);<NEW_LINE>v_temp.data[0] = p.x - meanWorldPts.x;<NEW_LINE>v_temp.data[1] = p.y - meanWorldPts.y;<NEW_LINE>v_temp.data[2] <MASK><NEW_LINE>MatrixVectorMult_DDRM.mult(A_temp, v_temp, w_temp);<NEW_LINE>int rowIndex = alphas.numCols * i;<NEW_LINE>for (int j = 0; j < numControl - 1; j++) alphas.data[rowIndex++] = w_temp.data[j];<NEW_LINE>if (numControl == 4)<NEW_LINE>alphas.data[rowIndex] = 1 - w_temp.data[0] - w_temp.data[1] - w_temp.data[2];<NEW_LINE>else<NEW_LINE>alphas.data[rowIndex] = 1 - w_temp.data[0] - w_temp.data[1];<NEW_LINE>}<NEW_LINE>} | = p.z - meanWorldPts.z; |
274,128 | final DisassociateIdentityProviderConfigResult executeDisassociateIdentityProviderConfig(DisassociateIdentityProviderConfigRequest disassociateIdentityProviderConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateIdentityProviderConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateIdentityProviderConfigRequest> request = null;<NEW_LINE>Response<DisassociateIdentityProviderConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateIdentityProviderConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateIdentityProviderConfigRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateIdentityProviderConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateIdentityProviderConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateIdentityProviderConfigResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,057,175 | protected void explore(Method method) {<NEW_LINE>// Children cache<NEW_LINE>HashSet<Set<Constraint<?>>> seenChildren = new HashSet();<NEW_LINE>// WorkList<NEW_LINE>Queue<DSETestCase> testCasesWorkList = createWorkList();<NEW_LINE>// Initial element<NEW_LINE>DSETestCase initialTestCase = testCaseBuildingStrategy.buildInitialTestCase(method);<NEW_LINE>// Run & check<NEW_LINE>testCasesWorkList.add(initialTestCase);<NEW_LINE>addNewTestCaseToTestSuite(initialTestCase);<NEW_LINE>while (keepSearchingCriteriaStrategy.shouldKeepSearching(testCasesWorkList)) {<NEW_LINE>// This gets wrapped into the building and fitness strategy selected due to the PriorityQueue sorting nature<NEW_LINE>DSETestCase <MASK><NEW_LINE>// After iteration checks and logs<NEW_LINE>if (showProgress)<NEW_LINE>logger.info(PROGRESS_MSG_INFO, getProgress());<NEW_LINE>if (isFinished())<NEW_LINE>return;<NEW_LINE>// Runs the current test case<NEW_LINE>GenerationalSearchPathCondition currentExecutedPathCondition = executeTestCaseConcolically(currentTestCase);<NEW_LINE>statisticsLogger.reportNewPathExplored();<NEW_LINE>logger.debug(PATH_CONDITION_COLLECTED_SIZE, currentExecutedPathCondition.getPathCondition().size());<NEW_LINE>// Checks for a divergence<NEW_LINE>boolean hasPathConditionDiverged = checkPathConditionDivergence(currentExecutedPathCondition.getPathCondition(), currentTestCase.getOriginalPathCondition().getPathCondition());<NEW_LINE>Set<Constraint<?>> normalizedPathCondition = normalize(currentExecutedPathCondition.getPathCondition().getConstraints());<NEW_LINE>// If a diverged path condition was previously explored, skip it<NEW_LINE>if (!shouldSkipCurrentPathcondition(hasPathConditionDiverged, normalizedPathCondition, seenChildren)) {<NEW_LINE>// Adds the new path condition to the already visited set<NEW_LINE>seenChildren.add(normalizedPathCondition);<NEW_LINE>logger.debug(NUMBER_OF_SEEN_PATH_CONDITIONS, seenChildren.size());<NEW_LINE>// Generates the children<NEW_LINE>List<GenerationalSearchPathCondition> children = pathsExpansionStrategy.generateChildren(currentExecutedPathCondition);<NEW_LINE>processChildren(testCasesWorkList, seenChildren, currentTestCase, children, hasPathConditionDiverged);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | currentTestCase = testCaseSelectionStrategy.getCurrentIterationBasedTestCase(testCasesWorkList); |
1,508,312 | private boolean printPageEntries(LedgerCache.PageEntries page) {<NEW_LINE>final MutableLong curEntry = new MutableLong(page.getFirstEntry());<NEW_LINE>try (LedgerEntryPage lep = page.getLEP()) {<NEW_LINE>lep.getEntries((entry, offset) -> {<NEW_LINE>while (curEntry.longValue() < entry) {<NEW_LINE>print.<MASK><NEW_LINE>curEntry.increment();<NEW_LINE>}<NEW_LINE>long entryLogId = offset >> 32L;<NEW_LINE>long pos = offset & 0xffffffffL;<NEW_LINE>print.accept("entry " + curEntry + "\t:\t(log:" + entryLogId + ", pos: " + pos + ")");<NEW_LINE>curEntry.increment();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>print.accept("Failed to read index page @ " + page.getFirstEntry() + ", the index file may be corrupted : " + e.getMessage());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>while (curEntry.longValue() < page.getLastEntry()) {<NEW_LINE>print.accept("entry " + curEntry + "\t:\tN/A");<NEW_LINE>curEntry.increment();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | accept("entry " + curEntry + "\t:\tN/A"); |
1,526,877 | public CalculatedLifecycle unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CalculatedLifecycle calculatedLifecycle = new CalculatedLifecycle();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("MoveToColdStorageAt", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>calculatedLifecycle.setMoveToColdStorageAt(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DeleteAt", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>calculatedLifecycle.setDeleteAt(DateJsonUnmarshallerFactory.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return calculatedLifecycle;<NEW_LINE>} | "unixTimestamp").unmarshall(context)); |
1,253,344 | public void gainFocus(boolean persistanceStatus) {<NEW_LINE>if (!isVisible()) {<NEW_LINE>String lastReplace = replaceTextField.getText();<NEW_LINE>changeSearchBarToBePartOfReplaceBar();<NEW_LINE>SearchComboBoxEditor.changeToOneLineEditorPane((JEditorPane) replaceTextField);<NEW_LINE>addEnterKeystrokeReplaceTo(replaceTextField);<NEW_LINE>MutableComboBoxModel<String> comboBoxModelIncSearch = ((MutableComboBoxModel<String>) replaceComboBox.getModel());<NEW_LINE>for (int i = comboBoxModelIncSearch.getSize() - 1; i >= 0; i--) {<NEW_LINE>comboBoxModelIncSearch.removeElementAt(i);<NEW_LINE>}<NEW_LINE>for (EditorFindSupport.RP rp : EditorFindSupport.getInstance().getReplaceHistory()) {<NEW_LINE>comboBoxModelIncSearch.addElement(rp.getReplaceExpression());<NEW_LINE>}<NEW_LINE>replaceTextField.setText(lastReplace);<NEW_LINE>setVisible(true);<NEW_LINE>}<NEW_LINE>searchBar.gainFocus(persistanceStatus);<NEW_LINE>searchBar<MASK><NEW_LINE>} | .getIncSearchTextField().requestFocusInWindow(); |
1,840,004 | final DescribeClusterResult executeDescribeCluster(DescribeClusterRequest describeClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeClusterRequest> request = null;<NEW_LINE>Response<DescribeClusterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeClusterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeClusterRequest));<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, "Route53 Recovery Control Config");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeClusterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeClusterResultJsonUnmarshaller());<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); |
660,037 | public Class determineRelationshipType(Relationship relationship) {<NEW_LINE>if (TransactionCommand.isDeleted(relationship)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String type = GraphObject.type.dbName();<NEW_LINE>final Node startNode = relationship.getStartNode();<NEW_LINE>final Node endNode = relationship.getEndNode();<NEW_LINE>if (startNode == null || endNode == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// first try: duck-typing<NEW_LINE>final String sourceType = startNode.hasProperty(type) ? startNode.getProperty(type).toString() : "";<NEW_LINE>final String targetType = endNode.hasProperty(type) ? endNode.getProperty(type).toString() : "";<NEW_LINE>final String relType = relationship.getType().name();<NEW_LINE>final Class entityType = getClassForCombinedType(sourceType, relType, targetType);<NEW_LINE>if (entityType != null) {<NEW_LINE>logger.debug("Class for assembled combined {}", entityType.getName());<NEW_LINE>return entityType;<NEW_LINE>}<NEW_LINE>// first try: type property<NEW_LINE>if (relationship.hasProperty(type)) {<NEW_LINE>Object obj = relationship.getProperty(type);<NEW_LINE>if (obj != null) {<NEW_LINE>Class relationClass = StructrApp.getConfiguration().getRelationshipEntityClass(obj.toString());<NEW_LINE>if (relationClass != null) {<NEW_LINE>StructrApp.getConfiguration().setRelationClassForCombinedType(sourceType, relType, targetType, relationClass);<NEW_LINE>return relationClass;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// fallback to old type<NEW_LINE>final String combinedTypeName = "combinedType";<NEW_LINE>if (relationship.hasProperty(combinedTypeName)) {<NEW_LINE>Object <MASK><NEW_LINE>if (obj != null) {<NEW_LINE>Class classForCombinedType = getClassForCombinedType(obj.toString());<NEW_LINE>if (classForCombinedType != null) {<NEW_LINE>return classForCombinedType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// logger.warn("No instantiable class for relationship found for {} {} {}, returning generic relationship class.", new Object[] { sourceType, relType, targetType });<NEW_LINE>return getGenericRelationshipType();<NEW_LINE>} | obj = relationship.getProperty(combinedTypeName); |
1,568,903 | protected void encodeHeaderRowWithoutColumn(FacesContext context, HeaderRow row, DataTable table, boolean expandable, boolean expanded) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String style = row.getStyle();<NEW_LINE>String styleClass = row.getStyleClass();<NEW_LINE>Integer rowspan = row.getRowspan();<NEW_LINE><MASK><NEW_LINE>writer.startElement("td", null);<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, null);<NEW_LINE>}<NEW_LINE>if (styleClass != null) {<NEW_LINE>writer.writeAttribute("class", styleClass, null);<NEW_LINE>}<NEW_LINE>if (rowspan != null) {<NEW_LINE>writer.writeAttribute("rowspan", rowspan, null);<NEW_LINE>}<NEW_LINE>if (colspan == null) {<NEW_LINE>colspan = table.getColumnsCount();<NEW_LINE>}<NEW_LINE>writer.writeAttribute("colspan", colspan, null);<NEW_LINE>if (expandable) {<NEW_LINE>encodeToggleIcon(context, expanded);<NEW_LINE>}<NEW_LINE>String field = row.getField();<NEW_LINE>Object value = LangUtils.isNotBlank(field) ? UIColumn.createValueExpressionFromField(context, table.getVar(), field).getValue(context.getELContext()) : row.getGroupBy();<NEW_LINE>writer.writeText(value, null);<NEW_LINE>writer.endElement("td");<NEW_LINE>} | Integer colspan = row.getColspan(); |
1,608,417 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {<NEW_LINE>if (requestCode == Constants.PermissionRequestType.LOCATION.ordinal()) {<NEW_LINE>boolean granted = grantResults.length > 0;<NEW_LINE>for (int i = 0; i < grantResults.length; i++) {<NEW_LINE>if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {<NEW_LINE>granted = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (granted) {<NEW_LINE>this.startService(new Intent(this, SyncthingService.class).setAction(SyncthingService.ACTION_REFRESH_NETWORK_INFO));<NEW_LINE>} else {<NEW_LINE>Util.getAlertDialogBuilder(this).setTitle(R.string.sync_only_wifi_ssids_location_permission_rejected_dialog_title).setMessage(R.string.sync_only_wifi_ssids_location_permission_rejected_dialog_content).setPositiveButton(android.R.string.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ok, null).show(); |
713,897 | public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {<NEW_LINE>if (value instanceof MyFileNode) {<NEW_LINE>final VirtualFile file = ((MyFileNode) value).getUserObject();<NEW_LINE>final Module module = ModuleUtil.findModuleForFile(file, myProject);<NEW_LINE>if (module != null) {<NEW_LINE>setIcon(AllIcons.Nodes.Module);<NEW_LINE>append("[" + module.getName() + "] ", new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, UIUtil.getTreeForeground()));<NEW_LINE>append(getRelativePathToProject(myProject, file));<NEW_LINE>} else {<NEW_LINE>append(getRelativePathToProject(myProject, file));<NEW_LINE>}<NEW_LINE>} else if (value instanceof MyDuplicatesNode) {<NEW_LINE>final Set<VirtualFile> files = ((MyDuplicatesNode) value).getUserObject();<NEW_LINE>for (VirtualFile file : files) {<NEW_LINE>final Module module = <MASK><NEW_LINE>if (module != null && myResourceModules.contains(module)) {<NEW_LINE>append("Icons can be replaced to ");<NEW_LINE>append(getRelativePathToProject(myProject, file), new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, ColorUtil.fromHex("008000")));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>append("Icon conflict");<NEW_LINE>} else if (value instanceof MyRootNode) {<NEW_LINE>append("All conflicts");<NEW_LINE>}<NEW_LINE>} | ModuleUtil.findModuleForFile(file, myProject); |
1,033,472 | private void generate(ClassOutlineImpl outline, CPropertyInfo prop) {<NEW_LINE>// add isSetXXX and unsetXXX.<NEW_LINE><MASK><NEW_LINE>JCodeModel codeModel = outline.parent().getCodeModel();<NEW_LINE>FieldAccessor acc = core.create(JExpr._this());<NEW_LINE>if (generateIsSetMethod) {<NEW_LINE>// [RESULT] boolean isSetXXX()<NEW_LINE>JExpression hasSetValue = acc.hasSetValue();<NEW_LINE>if (hasSetValue == null) {<NEW_LINE>// this field renderer doesn't support the isSet/unset methods generation.<NEW_LINE>// issue an error<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>writer.declareMethod(codeModel.BOOLEAN, "isSet" + this.prop.getName(true)).body()._return(hasSetValue);<NEW_LINE>}<NEW_LINE>if (generateUnSetMethod) {<NEW_LINE>// [RESULT] void unsetXXX()<NEW_LINE>acc.unsetValues(writer.declareMethod(codeModel.VOID, "unset" + this.prop.getName(true)).body());<NEW_LINE>}<NEW_LINE>} | MethodWriter writer = outline.createMethodWriter(); |
974,114 | public static void cleanupUninstalledExtensions() {<NEW_LINE>if (SystemUtilities.isInDevelopmentMode()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// 1. Get all extensions in the installation folder.<NEW_LINE>Set<ExtensionDetails> installedExtensions = ExtensionUtils.getInstalledExtensions(true);<NEW_LINE>// 2. For any that have a Module.manifest.uninstall, attempt to delete.<NEW_LINE>for (ExtensionDetails ext : installedExtensions) {<NEW_LINE>String installPath = ext.getInstallPath();<NEW_LINE>File mm = new File(installPath, ModuleUtilities.MANIFEST_FILE_NAME_UNINSTALLED);<NEW_LINE>if (mm.exists()) {<NEW_LINE>boolean success = ExtensionUtils.uninstall(ext);<NEW_LINE>if (!success) {<NEW_LINE>Msg.error(null, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ExtensionException e) {<NEW_LINE>Msg.error(null, "Error retrieving installed extensions", e);<NEW_LINE>}<NEW_LINE>} | "Error removing extension: " + ext.getInstallPath()); |
936,626 | private void runDijkstraWithSource(ConnectionPoint source, Predicate<Path> stopAfter) {<NEW_LINE>Map<ConnectionPoint, Path> shortestKnown = new HashMap<>();<NEW_LINE>BinaryHeap<ConnectionPoint> heap = new BinaryHeap<>(Comparator.comparingDouble(end -> shortestKnown.get(end).loss));<NEW_LINE>Map<ConnectionPoint, HeapEntry<ConnectionPoint>> entryMap = new HashMap<>();<NEW_LINE>shortestKnown.put(source, new Path(source));<NEW_LINE>entryMap.put(source, heap.insert(source));<NEW_LINE>while (!heap.empty()) {<NEW_LINE>ConnectionPoint endPoint = heap.extractMin();<NEW_LINE>entryMap.remove(endPoint);<NEW_LINE>Path shortest = shortestKnown.get(endPoint);<NEW_LINE>if (stopAfter.test(shortest))<NEW_LINE>return;<NEW_LINE>// Loss of 1 means no energy will be transferred, so the paths are irrelevant<NEW_LINE>if (shortest.loss >= 1)<NEW_LINE>break;<NEW_LINE>for (Connection next : localNet.getConnections(endPoint)) {<NEW_LINE>Path alternative = shortest.append(next, sinks.containsKey(next.getOtherEnd(shortest.end)));<NEW_LINE>if (!shortestKnown.containsKey(alternative.end)) {<NEW_LINE>shortestKnown.<MASK><NEW_LINE>entryMap.put(alternative.end, heap.insert(alternative.end));<NEW_LINE>} else {<NEW_LINE>Path oldPath = shortestKnown.get(alternative.end);<NEW_LINE>if (alternative.loss < oldPath.loss) {<NEW_LINE>shortestKnown.put(alternative.end, alternative);<NEW_LINE>heap.decreaseKey(entryMap.get(alternative.end));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | put(alternative.end, alternative); |
1,568,692 | private static // Last, the south pole offset is added negatively, to get last offset as 0 (used as a check)<NEW_LINE>boolean readGeoidOffsetsD(BufferedInputStream is) throws Exception {<NEW_LINE>// BufferedReader _may_ increase the performance<NEW_LINE>final byte[] buf = new byte[1000];<NEW_LINE>int bufRead = 0;<NEW_LINE>byte prevByte = 0;<NEW_LINE>int off = 0;<NEW_LINE>// NorthPole is first<NEW_LINE>int offsetCount = -1;<NEW_LINE>boolean allRead = false;<NEW_LINE>boolean prevIsTwo = false;<NEW_LINE>do {<NEW_LINE>int i = 0;<NEW_LINE>while (i < bufRead) {<NEW_LINE>byte c = buf[i];<NEW_LINE>i++;<NEW_LINE>if (prevIsTwo) {<NEW_LINE>off += ((((prevByte & 0xff) << 8) | (<MASK><NEW_LINE>prevIsTwo = false;<NEW_LINE>} else if ((c & 0x80) == 0) {<NEW_LINE>off += ((c & 0xff) - 0x40);<NEW_LINE>} else {<NEW_LINE>prevIsTwo = true;<NEW_LINE>}<NEW_LINE>prevByte = c;<NEW_LINE>if (!prevIsTwo) {<NEW_LINE>if (offsetCount < 0) {<NEW_LINE>offset_north_pole = (short) off;<NEW_LINE>} else if (offsetCount == ROWS * COLS) {<NEW_LINE>offset_south_pole = (short) off;<NEW_LINE>} else if (offsetCount == 1 + ROWS * COLS) {<NEW_LINE>if (off == 0) {<NEW_LINE>allRead = true;<NEW_LINE>} else {<NEW_LINE>System.err.println("Offset is not 0 at southpole " + offsetCount / COLS + " " + offsetCount % COLS + " " + off + " " + c);<NEW_LINE>}<NEW_LINE>} else if (offsetCount > ROWS * COLS) {<NEW_LINE>// Should not occur<NEW_LINE>allRead = false;<NEW_LINE>System.err.println("Unexpected data " + offsetCount / COLS + " " + offsetCount % COLS + " " + off + " " + c);<NEW_LINE>} else {<NEW_LINE>offset[offsetCount / COLS][offsetCount % COLS] = (short) off;<NEW_LINE>}<NEW_LINE>offsetCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bufRead = is.read(buf);<NEW_LINE>} while (bufRead > 0);<NEW_LINE>return allRead;<NEW_LINE>} | c & 0xff)) - 0xc000); |
407,309 | public void testCompareToScheduledFutureTask() throws Exception {<NEW_LINE>ScheduledFuture<?> future5 = schedxsvcDefaultLookup.scheduleWithFixedDelay(new CounterTask(), <MASK><NEW_LINE>try {<NEW_LINE>ScheduledFuture<?> future4 = daemon.schedule((Runnable) new CounterTask(), 4, TimeUnit.MINUTES);<NEW_LINE>try {<NEW_LINE>int compare = future5.compareTo(future4);<NEW_LINE>if (compare <= 0)<NEW_LINE>throw new Exception("Our scheduled future impl should compare greater than the ScheduledFutureTask. Instead: " + compare);<NEW_LINE>compare = future4.compareTo(future5);<NEW_LINE>if (compare >= 0)<NEW_LINE>throw new Exception("The ScheduledFutureTask should compare less than our scheduled future impl. Insated: " + compare);<NEW_LINE>} finally {<NEW_LINE>future4.cancel(false);<NEW_LINE>}<NEW_LINE>ScheduledFuture<?> future6 = daemon.schedule((Runnable) new CounterTask(), 6, TimeUnit.MINUTES);<NEW_LINE>try {<NEW_LINE>int compare = future5.compareTo(future6);<NEW_LINE>if (compare >= 0)<NEW_LINE>throw new Exception("Our scheduled future impl should compare less than the ScheduledFutureTask. Instead: " + compare);<NEW_LINE>compare = future6.compareTo(future5);<NEW_LINE>if (compare <= 0)<NEW_LINE>throw new Exception("The ScheduledFutureTask should compare greater than our scheduled future impl. Insated: " + compare);<NEW_LINE>} finally {<NEW_LINE>future6.cancel(false);<NEW_LINE>}<NEW_LINE>int compare = future5.compareTo(future5);<NEW_LINE>if (compare != 0)<NEW_LINE>throw new Exception("Unexpected compare of future to self: " + compare);<NEW_LINE>} finally {<NEW_LINE>future5.cancel(false);<NEW_LINE>}<NEW_LINE>int compare = future5.compareTo(future5);<NEW_LINE>if (compare != 0)<NEW_LINE>throw new Exception("Unexpected compare of future to self after cancel: " + compare);<NEW_LINE>} | 5, 1, TimeUnit.MINUTES); |
1,625,962 | final DescribeCacheClustersResult executeDescribeCacheClusters(DescribeCacheClustersRequest describeCacheClustersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCacheClustersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeCacheClustersRequest> request = null;<NEW_LINE>Response<DescribeCacheClustersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeCacheClustersRequestMarshaller().marshall(super.beforeMarshalling(describeCacheClustersRequest));<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, "ElastiCache");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCacheClusters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeCacheClustersResult> responseHandler = new StaxResponseHandler<DescribeCacheClustersResult>(new DescribeCacheClustersResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
132,227 | public Classifications predictProba(String text, int topK, String labelPrefix) {<NEW_LINE>int cap = topK != -1 ? topK : 10;<NEW_LINE>ArrayList<String> labels = new ArrayList<>(cap);<NEW_LINE>ArrayList<Float> probs <MASK><NEW_LINE>int size = FastTextLibrary.LIB.predictProba(getHandle(), text, topK, labels, probs);<NEW_LINE>List<String> classes = new ArrayList<>(size);<NEW_LINE>List<Double> probabilities = new ArrayList<>(size);<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>String label = labels.get(i);<NEW_LINE>if (label.startsWith(labelPrefix)) {<NEW_LINE>label = label.substring(labelPrefix.length());<NEW_LINE>}<NEW_LINE>classes.add(label);<NEW_LINE>probabilities.add((double) probs.get(i));<NEW_LINE>}<NEW_LINE>return new Classifications(classes, probabilities);<NEW_LINE>} | = new ArrayList<>(cap); |
664,121 | private FixedSizeMap<K, V> filter(Predicate2<? super K, ? super V> predicate) {<NEW_LINE>int result = 0;<NEW_LINE>if (predicate.accept(this.key1, this.value1)) {<NEW_LINE>result |= 1;<NEW_LINE>}<NEW_LINE>if (predicate.accept(this.key2, this.value2)) {<NEW_LINE>result |= 2;<NEW_LINE>}<NEW_LINE>if (predicate.accept(this.key3, this.value3)) {<NEW_LINE>result |= 4;<NEW_LINE>}<NEW_LINE>switch(result) {<NEW_LINE>case 1:<NEW_LINE>return Maps.fixedSize.of(this.key1, this.value1);<NEW_LINE>case 2:<NEW_LINE>return Maps.fixedSize.of(this.key2, this.value2);<NEW_LINE>case 3:<NEW_LINE>return Maps.fixedSize.of(this.key1, this.value1, this.key2, this.value2);<NEW_LINE>case 4:<NEW_LINE>return Maps.fixedSize.of(this.key3, this.value3);<NEW_LINE>case 5:<NEW_LINE>return Maps.fixedSize.of(this.key1, this.value1, this.key3, this.value3);<NEW_LINE>case 6:<NEW_LINE>return Maps.fixedSize.of(this.key2, this.value2, <MASK><NEW_LINE>case 7:<NEW_LINE>return Maps.fixedSize.of(this.key1, this.value1, this.key2, this.value2, this.key3, this.value3);<NEW_LINE>default:<NEW_LINE>return Maps.fixedSize.of();<NEW_LINE>}<NEW_LINE>} | this.key3, this.value3); |
1,510,146 | public Map<Formula, UnaryFormulaInfo> createUnaryFormulaInfoMap() {<NEW_LINE>Map<Formula, FbFormulasInfo.UnaryFormulaInfo> res = new HashMap<<MASK><NEW_LINE>// professions<NEW_LINE>for (String profession : professionPopularityMap.keySet()) {<NEW_LINE>Formula f = new JoinFormula(PROF, new ValueFormula<Value>(new NameValue(profession)));<NEW_LINE>UnaryFormulaInfo info = new UnaryFormulaInfo(f, professionPopularityMap.get(profession), MapUtils.get(professionDescriptionsMap, profession, new LinkedList<String>()), Collections.singleton(PERSON));<NEW_LINE>if (!info.isComplete()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>res.put(f, info);<NEW_LINE>}<NEW_LINE>// types<NEW_LINE>for (String type : typePopularityMap.keySet()) {<NEW_LINE>Formula f = new JoinFormula(TYPE, new ValueFormula<Value>(new NameValue(type)));<NEW_LINE>UnaryFormulaInfo info = new UnaryFormulaInfo(f, typePopularityMap.get(type), MapUtils.get(typeDescriptionsMap, type, new LinkedList<String>()), Collections.singleton(type));<NEW_LINE>if (!info.isComplete()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>res.put(f, info);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | Formula, FbFormulasInfo.UnaryFormulaInfo>(); |
28,316 | public void show(short mode) {<NEW_LINE>this.mode = mode;<NEW_LINE>dialog = new Shell(Display.getDefault(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);<NEW_LINE>UIUtil.setDialogDefaultFunctions(dialog);<NEW_LINE>if (mode == ADD_MODE) {<NEW_LINE>dialog.setText("Add Account");<NEW_LINE>} else if (mode == EDIT_MODE) {<NEW_LINE>dialog.setText("Edit Account");<NEW_LINE>}<NEW_LINE>initialLayout();<NEW_LINE>if (mode == ADD_MODE) {<NEW_LINE>okBtn.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (validateOk()) {<NEW_LINE>okBtn.setEnabled(false);<NEW_LINE>addAccount();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (mode == EDIT_MODE) {<NEW_LINE>String group = null;<NEW_LINE>if (targetAccount == null) {<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>idText.setText(server.getUserId());<NEW_LINE>emailText.<MASK><NEW_LINE>group = server.getGroup();<NEW_LINE>} else {<NEW_LINE>idText.setText(targetAccount.id);<NEW_LINE>emailText.setText(targetAccount.email);<NEW_LINE>group = targetAccount.group;<NEW_LINE>}<NEW_LINE>idText.setEnabled(false);<NEW_LINE>dupCheckBtn.setEnabled(false);<NEW_LINE>if (StringUtil.isNotEmpty(group)) {<NEW_LINE>for (Button btn : radiobuttons) {<NEW_LINE>if (btn.getText().equals(group)) {<NEW_LINE>selectedGroup = group;<NEW_LINE>btn.setSelection(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>okBtn.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>confirmId = true;<NEW_LINE>if (validateOk()) {<NEW_LINE>okBtn.setEnabled(false);<NEW_LINE>editAccount();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>dialog.pack();<NEW_LINE>dialog.open();<NEW_LINE>} | setText(server.getEmail()); |
983,960 | private static <EVIDENCE extends Locatable> LikelihoodMatrix<EVIDENCE, Allele> combinedLikelihoodMatrix(final List<LikelihoodMatrix<EVIDENCE, Allele>> matrices, final AlleleList<Allele> alleleList) {<NEW_LINE>final List<EVIDENCE> reads = matrices.stream().flatMap(m -> m.evidence().stream()).collect(Collectors.toList());<NEW_LINE>final AlleleLikelihoods<EVIDENCE, Allele> combinedLikelihoods = new AlleleLikelihoods<>(SampleList.singletonSampleList("COMBINED"), alleleList, ImmutableMap.of("COMBINED", reads));<NEW_LINE>int combinedReadIndex = 0;<NEW_LINE>final LikelihoodMatrix<EVIDENCE, Allele> result = combinedLikelihoods.sampleMatrix(0);<NEW_LINE>final int alleleCount = result.numberOfAlleles();<NEW_LINE>for (final LikelihoodMatrix<EVIDENCE, Allele> matrix : matrices) {<NEW_LINE>final <MASK><NEW_LINE>for (int r = 0; r < readCount; r++) {<NEW_LINE>for (int a = 0; a < alleleCount; a++) {<NEW_LINE>result.set(a, combinedReadIndex, matrix.get(a, r));<NEW_LINE>}<NEW_LINE>combinedReadIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | int readCount = matrix.evidenceCount(); |
309,122 | public List<ValidationEvent> unionShape(UnionShape shape) {<NEW_LINE>return value.asObjectNode().map(object -> {<NEW_LINE>List<<MASK><NEW_LINE>if (object.size() > 1) {<NEW_LINE>events.add(event("union values can contain a value for only a single member"));<NEW_LINE>} else {<NEW_LINE>Map<String, MemberShape> members = shape.getAllMembers();<NEW_LINE>for (Map.Entry<String, Node> entry : object.getStringMap().entrySet()) {<NEW_LINE>String entryKey = entry.getKey();<NEW_LINE>Node entryValue = entry.getValue();<NEW_LINE>if (!members.containsKey(entryKey)) {<NEW_LINE>events.add(event(String.format("Invalid union member `%s` found for `%s`", entryKey, shape.getId())));<NEW_LINE>} else {<NEW_LINE>events.addAll(traverse(entryKey, entryValue).memberShape(members.get(entryKey)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return events;<NEW_LINE>}).orElseGet(() -> invalidShape(shape, NodeType.OBJECT));<NEW_LINE>} | ValidationEvent> events = applyPlugins(shape); |
1,078,938 | private static void exchangeCommands(String[][] commandsToExchange, final JComponent target, final JComponent source) {<NEW_LINE>InputMap targetBindings = target.getInputMap();<NEW_LINE>KeyStroke[] targetBindingKeys = targetBindings.allKeys();<NEW_LINE>ActionMap targetActions = target.getActionMap();<NEW_LINE><MASK><NEW_LINE>ActionMap sourceActions = source.getActionMap();<NEW_LINE>for (int i = 0; i < commandsToExchange.length; i++) {<NEW_LINE>String commandFrom = commandsToExchange[i][0];<NEW_LINE>String commandTo = commandsToExchange[i][1];<NEW_LINE>final Action orig = targetActions.get(commandTo);<NEW_LINE>if (orig == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>sourceActions.put(commandTo, new AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>orig.actionPerformed(new ActionEvent(target, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int j = 0; j < targetBindingKeys.length; j++) {<NEW_LINE>if (targetBindings.get(targetBindingKeys[j]).equals(commandFrom)) {<NEW_LINE>sourceBindings.put(targetBindingKeys[j], commandTo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | InputMap sourceBindings = source.getInputMap(); |
960,933 | private void purgeEden() {<NEW_LINE>while (eden.size() > maxEdenSize) {<NEW_LINE>final OCacheEntry candidate = eden.poll();<NEW_LINE>assert candidate != null;<NEW_LINE>if (probation.size() + protection.size() < maxSecondLevelSize) {<NEW_LINE>probation.moveToTheTail(candidate);<NEW_LINE>} else {<NEW_LINE>final OCacheEntry victim = probation.peek();<NEW_LINE>final int candidateKeyHashCode = PageKey.hashCode(candidate.getFileId(), (<MASK><NEW_LINE>final int victimKeyHashCode = PageKey.hashCode(victim.getFileId(), (int) victim.getPageIndex());<NEW_LINE>final int candidateFrequency = admittor.frequency(candidateKeyHashCode);<NEW_LINE>final int victimFrequency = admittor.frequency(victimKeyHashCode);<NEW_LINE>if (candidateFrequency >= victimFrequency) {<NEW_LINE>probation.poll();<NEW_LINE>probation.moveToTheTail(candidate);<NEW_LINE>if (victim.freeze()) {<NEW_LINE>final boolean removed = data.remove(new PageKey(victim.getFileId(), (int) victim.getPageIndex()), victim);<NEW_LINE>victim.makeDead();<NEW_LINE>if (removed) {<NEW_LINE>cacheSize.decrementAndGet();<NEW_LINE>}<NEW_LINE>final OCachePointer pointer = victim.getCachePointer();<NEW_LINE>pointer.decrementReadersReferrer();<NEW_LINE>victim.clearCachePointer();<NEW_LINE>} else {<NEW_LINE>eden.moveToTheTail(victim);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (candidate.freeze()) {<NEW_LINE>final boolean removed = data.remove(new PageKey(candidate.getFileId(), (int) candidate.getPageIndex()), candidate);<NEW_LINE>candidate.makeDead();<NEW_LINE>if (removed) {<NEW_LINE>cacheSize.decrementAndGet();<NEW_LINE>}<NEW_LINE>final OCachePointer pointer = candidate.getCachePointer();<NEW_LINE>pointer.decrementReadersReferrer();<NEW_LINE>candidate.clearCachePointer();<NEW_LINE>} else {<NEW_LINE>eden.moveToTheTail(candidate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert protection.size() <= maxProtectedSize;<NEW_LINE>} | int) candidate.getPageIndex()); |
977,106 | public Request<ListOpenIDConnectProviderTagsRequest> marshall(ListOpenIDConnectProviderTagsRequest listOpenIDConnectProviderTagsRequest) {<NEW_LINE>if (listOpenIDConnectProviderTagsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ListOpenIDConnectProviderTagsRequest> request = new DefaultRequest<ListOpenIDConnectProviderTagsRequest>(listOpenIDConnectProviderTagsRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "ListOpenIDConnectProviderTags");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (listOpenIDConnectProviderTagsRequest.getOpenIDConnectProviderArn() != null) {<NEW_LINE>request.addParameter("OpenIDConnectProviderArn", StringUtils.fromString(listOpenIDConnectProviderTagsRequest.getOpenIDConnectProviderArn()));<NEW_LINE>}<NEW_LINE>if (listOpenIDConnectProviderTagsRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(listOpenIDConnectProviderTagsRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (listOpenIDConnectProviderTagsRequest.getMaxItems() != null) {<NEW_LINE>request.addParameter("MaxItems", StringUtils.fromInteger<MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (listOpenIDConnectProviderTagsRequest.getMaxItems())); |
910,134 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {<NEW_LINE>String url = request.getRequestURI();<NEW_LINE>if (!urlSet.contains(url)) {<NEW_LINE>String token = request.getHeader(JwtUtils.AUTHORIZATION_HEADER_PREFIX);<NEW_LINE>String privateSecret = GovernanceApplication.governanceConfig.getPrivateSecret();<NEW_LINE>if (!StringUtils.isBlank(token) && JwtUtils.verifierToken(token, privateSecret)) {<NEW_LINE>AccountEntity accountEntity = JwtUtils.decodeToken(token, privateSecret);<NEW_LINE>if (accountEntity != null) {<NEW_LINE>log.info("get token from HTTP header, {} : {}", JwtUtils.AUTHORIZATION_HEADER_PREFIX, token);<NEW_LINE>UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(accountEntity.getUsername(), null, null);<NEW_LINE>auth.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));<NEW_LINE>SecurityContextHolder.getContext().setAuthentication(auth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filterChain.doFilter(request, response);<NEW_LINE>} else {<NEW_LINE>String newPath = url.replace("/weevent-governance", "");<NEW_LINE>RequestDispatcher requestDispatcher = request.getRequestDispatcher(newPath);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | requestDispatcher.forward(request, response); |
1,662 | public void addInputText(String name, String id) {<NEW_LINE>if (id == null || id.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArrayList<String> nameList = new ArrayList<String>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>add(name);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ArrayList<String> idList = new ArrayList<String>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>add(id);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>updateAtUserInfoMap(nameList, idList);<NEW_LINE>if (mTextInput != null) {<NEW_LINE>Map<String, String> displayAtNameMap = new HashMap<>();<NEW_LINE>displayAtNameMap.put(TIMMentionEditText.TIM_MENTION_TAG + displayInputString, id);<NEW_LINE>mTextInput.setMentionMap(displayAtNameMap);<NEW_LINE>int selectedIndex = mTextInput.getSelectionEnd();<NEW_LINE>if (selectedIndex != -1) {<NEW_LINE><MASK><NEW_LINE>String text = mTextInput.getText().insert(selectedIndex, insertStr).toString();<NEW_LINE>FaceManager.handlerEmojiText(mTextInput, text, true);<NEW_LINE>mTextInput.setSelection(selectedIndex + insertStr.length());<NEW_LINE>}<NEW_LINE>showSoftInput();<NEW_LINE>}<NEW_LINE>} | String insertStr = TIMMentionEditText.TIM_MENTION_TAG + displayInputString; |
6,797 | public List<ServiceInstance> lookup(SubscribeInfo subscribeInfo) {<NEW_LINE>String path = getSubscribePath(subscribeInfo);<NEW_LINE>List<ServiceInstance> instances = new ArrayList<ServiceInstance>();<NEW_LINE>try {<NEW_LINE>List<String> childList = client.getChildren().forPath(path);<NEW_LINE>for (String child : childList) {<NEW_LINE>String childPath = path + "/" + child;<NEW_LINE>try {<NEW_LINE>String childData = new String(client.getData().forPath(childPath));<NEW_LINE>Endpoint endpoint = GsonUtils.fromJson(childData, Endpoint.class);<NEW_LINE>ServiceInstance instance = new ServiceInstance(endpoint);<NEW_LINE>if (subscribeInfo != null && StringUtils.isNoneBlank(subscribeInfo.getServiceId())) {<NEW_LINE>instance.setServiceName(subscribeInfo.getServiceId());<NEW_LINE>}<NEW_LINE>instances.add(instance);<NEW_LINE>} catch (Exception getDataFailedException) {<NEW_LINE>log.warn("get child data failed, path:{}, ex:", childPath, getDataFailedException);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("lookup {} instances from {}", <MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.warn("lookup end point list failed from {}, msg={}", url, ex.getMessage());<NEW_LINE>if (!subscribeInfo.isIgnoreFailOfNamingService()) {<NEW_LINE>throw new RpcException("lookup end point list failed from zookeeper failed", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return instances;<NEW_LINE>} | instances.size(), url); |
159,359 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName, 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 (privateCloudName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (authorizationName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); |
208,513 | private int putInDynamicCacheIfAbsent(int bootstrapIndex, final char[] selector, final char[] descriptor, final int value) {<NEW_LINE>int index;<NEW_LINE>HashtableOfObject key1Value = (HashtableOfObject) this.dynamicCache.get(bootstrapIndex);<NEW_LINE>if (key1Value == null) {<NEW_LINE>key1Value = new HashtableOfObject();<NEW_LINE>this.dynamicCache.put(bootstrapIndex, key1Value);<NEW_LINE>CachedIndexEntry cachedIndexEntry = new CachedIndexEntry(descriptor, value);<NEW_LINE>index = -value;<NEW_LINE>key1Value.put(selector, cachedIndexEntry);<NEW_LINE>} else {<NEW_LINE>Object <MASK><NEW_LINE>if (key2Value == null) {<NEW_LINE>CachedIndexEntry cachedIndexEntry = new CachedIndexEntry(descriptor, value);<NEW_LINE>index = -value;<NEW_LINE>key1Value.put(selector, cachedIndexEntry);<NEW_LINE>} else if (key2Value instanceof CachedIndexEntry) {<NEW_LINE>// adding a second entry<NEW_LINE>CachedIndexEntry entry = (CachedIndexEntry) key2Value;<NEW_LINE>if (CharOperation.equals(descriptor, entry.signature)) {<NEW_LINE>index = entry.index;<NEW_LINE>} else {<NEW_LINE>CharArrayCache charArrayCache = new CharArrayCache();<NEW_LINE>charArrayCache.putIfAbsent(entry.signature, entry.index);<NEW_LINE>index = charArrayCache.putIfAbsent(descriptor, value);<NEW_LINE>key1Value.put(selector, charArrayCache);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>CharArrayCache charArrayCache = (CharArrayCache) key2Value;<NEW_LINE>index = charArrayCache.putIfAbsent(descriptor, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>} | key2Value = key1Value.get(selector); |
1,158,053 | public static void main(String... args) {<NEW_LINE>final long start = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>final Injector injector = Guice.createInjector(Stage.PRODUCTION, new SingularityRunnerBaseModule(SingularityExecutorConfiguration.class, ImmutableSet.<Class<? extends BaseRunnerConfiguration>>of(SingularityS3Configuration.class)), new SingularityExecutorModule());<NEW_LINE>final SingularityExecutorRunner executorRunner = injector.getInstance(SingularityExecutorRunner.class);<NEW_LINE>final LocalDownloadServiceFetcher downloadServiceFetcher = injector.getInstance(LocalDownloadServiceFetcher.class);<NEW_LINE>downloadServiceFetcher.start();<NEW_LINE>final Protos.Status driverStatus = executorRunner.run();<NEW_LINE>LOG.info("Executor finished after {} with status: {}", JavaUtils.duration(start), driverStatus);<NEW_LINE>downloadServiceFetcher.stop();<NEW_LINE>stopLog();<NEW_LINE>System.exit(driverStatus == Protos.<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.error("Finished after {} with error", JavaUtils.duration(start), t);<NEW_LINE>stopLog();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | Status.DRIVER_STOPPED ? 0 : 1); |
1,421,191 | public int trainModel(String modelPath, int epochs) {<NEW_LINE>if (modelPath == null) {<NEW_LINE>logger.severe(Common.addTag("model path cannot be empty"));<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (epochs <= 0) {<NEW_LINE>logger.severe(Common.addTag("epochs cannot smaller than 0"));<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int status = padSamples();<NEW_LINE>if (status != 0) {<NEW_LINE>logger.severe<MASK><NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>status = trainLoop(epochs);<NEW_LINE>if (status == -1) {<NEW_LINE>logger.severe(Common.addTag("train loop failed"));<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>boolean isSuccess = trainSession.export(modelPath, 0, 1);<NEW_LINE>if (!isSuccess) {<NEW_LINE>logger.severe(Common.addTag("save model failed"));<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | (Common.addTag("train model failed")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.