Get the BugPattern.
510061
public @Nonnull BugPattern getBugPattern() {
        BugPattern result = DetectorFactoryCollection.instance().lookupBugPattern(getType());
        if (result != null) {
            return result;
        }
        AnalysisContext.logError("Unable to find description of bug pattern " + getType());
        result = DetectorFactoryCollection.instance().lookupBugPattern("UNKNOWN");
        if (result != null) {
            return result;
        }
        return BugPattern.REALLY_UNKNOWN;
    }
386075
def post_bug(self, bug):
        ''''''
        assert type(bug) is DotDict
        assert 'product' in bug
        assert 'component' in bug
        assert 'summary' in bug
        if (not 'version' in bug): bug.version = 'other'
        if (not 'op_sys' in bug): bug.op_sys = 'All'
        if (not 'platform' in bug): bug.platform = 'All'

        return self._post('bug', json.dumps(bug))
240981
def get_bug_simple(self, bugid):
        
        payload = {'ids': bugid}
        d = self.call('Bug.get', payload)
        d.addCallback(self._parse_bug_callback)
        return d
165518
function getPatterns() {
        if (isPatternsDirty) {
          patterns.sort(function (a, b) {
            if (a.start.length > b.start.length) {
              return -1;
            }

            if (a.start.length < b.start.length) {
              return 1;
            }

            return 0;
          });

          isPatternsDirty = false;
        }

        return patterns;
      }
141200
@Override
    public void visitCode(Code obj) {
        try {
            Method m = getMethod();
            if (m.isSynthetic()) {
                return;
            }

            if (m.isStatic() || m.isPrivate() || Values.CONSTRUCTOR.equals(m.getName())) {
                parmSigs = SignatureUtils.getParameterSlotAndSignatures(m.isStatic(), m.getSignature());
                if (!parmSigs.isEmpty() && prescreen(m)) {
                    state = State.SAW_NOTHING;
                    bugs = new HashMap<>();
                    downwardBranchTarget = -1;
                    super.visitCode(obj);
                    for (BugInfo bi : bugs.values()) {
                        bugReporter.reportBug(bi.bug);
                    }
                }
            }
        } finally {
            bugs = null;
        }
    }
1128188
def create_bug(self, request):
        
        if settings.BUGFILER_API_KEY is None:
            return Response({"failure": "Bugzilla API key not set!"},
                            status=HTTP_400_BAD_REQUEST)

        params = request.data

        # Arbitrarily cap crash signatures at 2048 characters to prevent perf issues on bmo
        crash_signature = params.get("crash_signature")
        if crash_signature and len(crash_signature) > 2048:
            return Response({"failure": "Crash signature can't be more than 2048 characters."},
                            status=HTTP_400_BAD_REQUEST)

        description = u"**Filed by:** {}\n{}".format(
            request.user.email.replace('@', " [at] "),
            params.get("comment", "")
        ).encode("utf-8")
        summary = params.get("summary").encode("utf-8").strip()
        url = settings.BUGFILER_API_URL + "/rest/bug"
        headers = {
            'x-bugzilla-api-key': settings.BUGFILER_API_KEY,
            'Accept': 'application/json'
        }
        data = {
            'product': params.get("product"),
            'component': params.get("component"),
            'summary': summary,
            'keywords': params.get("keywords"),
            'blocks': params.get("blocks"),
            'depends_on': params.get("depends_on"),
            'see_also': params.get("see_also"),
            'version': params.get("version"),
            'cf_crash_signature': params.get("crash_signature"),
            'severity': params.get("severity"),
            'priority': params.get("priority"),
            'description': description,
            'comment_tags': "treeherder",
        }

        try:
            response = make_request(url, method='POST', headers=headers, json=data)
        except requests.exceptions.HTTPError as e:
            try:
                message = e.response.json()['message']
            except (ValueError, KeyError):
                message = e.response.text
            return Response({"failure": message}, status=HTTP_400_BAD_REQUEST)

        return Response({"success": response.json()["id"]})
873875
public void execute() {
        Iterator<?> elementIter = XMLUtil.selectNodes(document, "/BugCollection/BugInstance").iterator();
        Iterator<BugInstance> bugInstanceIter = bugCollection.iterator();

        Set<String> bugTypeSet = new HashSet<>();
        Set<String> bugCategorySet = new HashSet<>();
        Set<String> bugCodeSet = new HashSet<>();

        // Add short and long descriptions to BugInstance elements.
        // We rely on the Document and the BugCollection storing
        // the bug instances in the same order.
        while (elementIter.hasNext() && bugInstanceIter.hasNext()) {
            Element element = (Element) elementIter.next();
            BugInstance bugInstance = bugInstanceIter.next();

            String bugType = bugInstance.getType();
            bugTypeSet.add(bugType);

            BugPattern bugPattern = bugInstance.getBugPattern();

            bugCategorySet.add(bugPattern.getCategory());
            bugCodeSet.add(bugPattern.getAbbrev());

            element.addElement("ShortMessage").addText(bugPattern.getShortDescription());
            element.addElement("LongMessage").addText(bugInstance.getMessage());

            // Add pre-formatted display strings in "Message"
            // elements for all bug annotations.
            Iterator<?> annElementIter = element.elements().iterator();
            Iterator<BugAnnotation> annIter = bugInstance.annotationIterator();
            while (annElementIter.hasNext() && annIter.hasNext()) {
                Element annElement = (Element) annElementIter.next();
                BugAnnotation ann = annIter.next();
                annElement.addElement("Message").addText(ann.toString());
            }
        }

        // Add BugPattern elements for each referenced bug types.
        addBugCategories(bugCategorySet);
        addBugPatterns(bugTypeSet);
        addBugCodes(bugCodeSet);
    }
983847
def _getPattern(self, ipattern, done=None):
        
        if ipattern is None:
            return None
        if ipattern is True:
            if done is not None:
                return ([(None, None, done)], {})
            # REMEMBER: This False is for sort reverse!
            return ([(0, False)], {})

        def _getReverse(pm):
            return pm == '-'

        def _getIndex(k):
            try:
                return int(k)
            except ValueError:
                raise InvalidPatternError(k, "Invalid level number")

        def _getDone(p):
            v = p.split('=')
            if len(v) == 2:
                try:
                    return (Model.indexes[v[0]], v[1], done)
                except KeyError:
                    raise InvalidPatternError(v[0], 'Invalid field name')
            return (None, v[0], done)
        ipattern1 = list()
        ipattern2 = dict()
        for s in ipattern.split(','):
            if done is not None:
                v = done
            else:
                v = _getReverse(s[-1])
            k = s.split(':')
            if len(k) == 1:
                if done is not None:
                    ipattern1.append(_getDone(k[0]))
                    continue
                ko = k[0][:-1]
                try:
                    if len(k[0]) == 1:
                        k = 0
                    else:
                        k = Model.indexes[ko]
                except KeyError:
                    k = _getIndex(k[0][:-1])
                else:
                    ipattern1.append((k, v))
                    continue
                v = (0, v)
            elif len(k) == 2:
                try:
                    if done is not None:
                        v = _getDone(k[1])
                    else:
                        v = (Model.indexes[k[1][:-1]], v)
                    k = _getIndex(k[0])
                except KeyError:
                    raise InvalidPatternError(k[1][:-1], 'Invalid field name')
            else:
                raise InvalidPatternError(s, 'Unrecognized token in')
            ipattern2.setdefault(k, []).append(v)
        return (ipattern1, ipattern2)
819164
public String getMessage() {
        BugPattern bugPattern = getBugPattern();
        String pattern = bugPattern.getAbbrev() + ": " + getLongDescription();
        FindBugsMessageFormat format = new FindBugsMessageFormat(pattern);
        try {
            return format.format(annotationList.toArray(new BugAnnotation[annotationList.size()]), getPrimaryClass());
        } catch (RuntimeException e) {
            AnalysisContext.logError("Error generating bug msg ", e);
            return bugPattern.getShortDescription() + " [Error generating customized description]";
        }
    }
1219727
def bug(bugid, logger=STDERR)
      logger.puts "You have found a bug! If you want, you can email".color(:red)
      logger.puts 'rudy@solutious.com'.color(:red).bright << " about it. It's bug ##{bugid}.".color(:red)          
      logger.puts "Continuing...".color(:red)
      true # so we can string it together like: bug('1') && next if ...
    end
163518
String getPattern() {
        final StringBuilder result = new StringBuilder();

        if (myPrefix != null) {
            result.append(myPrefix);
        }
        if (mySuffixes != null) {
            result.append("*");
            for (final Literal sub : mySuffixes) {
                result.append(sub);
                result.append("*");
            }
        }
        if (myPostfix != null) {
            result.append(myPostfix);
        }
        return result.toString();
    }
655988
def update(self):
        
        if 'id' in self._bug:
            result = self._bugsy.request('bug/%s' % self._bug['id'])
            self._bug = dict(**result['bugs'][0])
        else:
            raise BugException("Unable to update bug that isn't in Bugzilla")
928557
@Bean
    public Bugsnag bugsnag() {
        // Create a Bugsnag client
        Bugsnag bugsnag = new Bugsnag("YOUR-API-KEY");

        // Set some diagnostic data which will not change during the
        // lifecycle of the application
        bugsnag.setReleaseStage("staging");
        bugsnag.setAppVersion("1.0.1");

        // Create and attach a simple Bugsnag callback.
        // Use Callbacks to send custom diagnostic data which changes during
        // the lifecyle of your application
        bugsnag.addCallback(new Callback() {
            @Override
            public void beforeNotify(Report report) {
                report.addToTab("diagnostics", "timestamp", new Date());
                report.addToTab("customer", "name", "acme-inc");
                report.addToTab("customer", "paying", true);
                report.addToTab("customer", "spent", 1234);
                report.setUserName("User Name");
                report.setUserEmail("user@example.com");
                report.setUserId("12345");
            }
        });

        return bugsnag;
    }
1230281
public function getPattern() : ?string 
    {
        if ( ! $this->hasPattern()) {
            $this->setPattern($this->getDefaultPattern());
        }
        return $this->pattern;
    }
865575
def _get_patterns(installed_only=None, root=None):
    '''
    
    '''
    patterns = {}
    for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'pattern').getElementsByTagName('solvable'):
        installed = element.getAttribute('status') == 'installed'
        if (installed_only and installed) or not installed_only:
            patterns[element.getAttribute('name')] = {
                'installed': installed,
                'summary': element.getAttribute('summary'),
            }

    return patterns
78666
public static List<MarkerParameter> createBugParameters(IJavaProject project, BugCollection theCollection,
            IProgressMonitor monitor) {
        List<MarkerParameter> bugParameters = new ArrayList<>();
        if (project == null) {
            FindbugsPlugin.getDefault().logException(new NullPointerException("project is null"), "project is null");
            return bugParameters;
        }
        Iterator<BugInstance> iterator = theCollection.iterator();
        while (iterator.hasNext() && !monitor.isCanceled()) {
            BugInstance bug = iterator.next();
            DetectorFactory detectorFactory = bug.getDetectorFactory();
            if(detectorFactory != null && !detectorFactory.getPlugin().isGloballyEnabled()){
                continue;
            }
            MarkerParameter mp = createMarkerParameter(project, bug);
            if (mp != null) {
                bugParameters.add(mp);
            }
        }
        return bugParameters;
    }
1127841
private function getPatternId() : string
    {
        return sprintf(
            '%s::u%d::c%d::d%s::p%s',
            $this->patternId['division'],
            $this->patternId['useragent'],
            $this->patternId['child'],
            $this->patternId['device'],
            $this->patternId['platform']
        );
    }