issues a new bug at this location

@param library
the type of backport library that is in use
518892
private void reportBug(Library library) {
        bugReporter.reportBug(new BugInstance(this, BugType.BRPI_BACKPORT_REUSE_PUBLIC_IDENTIFIERS.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                .addSourceLine(this).addString(library.name()));
    }
596159
@Fix(io.sarl.lang.validation.IssueCodes.INVALID_IMPLEMENTED_TYPE)
	public void fixInvalidImplementedType(final Issue issue, IssueResolutionAcceptor acceptor) {
		ImplementedTypeRemoveModification.accept(this, issue, acceptor, RemovalType.OTHER);
	}
1054730
public void addTangoInterfaceChangeListener(ITangoInterfaceChangeListener listener, String attrName)
            throws DevFailed {
        addTangoInterfaceChangeListener(listener, attrName, false);
    }
326840
public void dev_import(final Connection connection) throws DevFailed {
		Database db;
		if (connection.url.host == null) {
	    	db = ApiUtil.get_db_obj();
		} else {
	    	db = ApiUtil.get_db_obj(connection.url.host, connection.url.strPort);
		}
		// Check if device must be imported directly from IOR
        String  local_ior = null;
        boolean ior_read  = false;
		if (connection.ior == null) {
	    	final DbDevImportInfo info = db.import_device(connection.devname);
	    	if (info.exported) {
                 local_ior = info.ior;
                 ior_read = true;
	    	} else {
                Except.throw_connection_failed("TangoApi_DEVICE_NOT_EXPORTED",
                        connection.devname + " Not Exported !",
                        "Connection(" + connection.devname + ")");
             }
		} else {
	    	local_ior = connection.ior;
		}
		try {
	    	// Import the TANGO device
            try {
    	    	createDevice(connection, local_ior);
            }
            catch(final Exception e0) {
                if (ior_read || connection.isAlready_connected())
                    throw e0;   //  Has already been connected
				if (e0.toString().startsWith("org.omg.CORBA.TRANSIENT")) {
    				throw e0;   //  Connection failed (Hard killed)
				}
                // Else it is the first time, retry (ior could have changed)
                connection.ior = null;
                dev_import(connection);
            }

	    	connection.setAlready_connected(true);
	    	connection.ior = local_ior;

		} catch (final DevFailed e) {
	    	connection.device = null;
	    	connection.device_2 = null;
	    	connection.device_3 = null;
	    	connection.device_4 = null;
	    	connection.device_5 = null;
	    	connection.ior = null;
	    	throw e;
		} catch (final Exception e) {
	    	connection.device = null;
	    	connection.device_2 = null;
	    	connection.device_3 = null;
	    	connection.device_4 = null;
	    	connection.device_5 = null;
	    	connection.ior = null;
	    	final String reason = "TangoApi_CANNOT_IMPORT_DEVICE";
	    	final String s = connection.isAlready_connected() ? "Re-" : "";
	    	final String desc = "Cannot " + s + "import " + connection.devname + " :\n\t"
		    	+ e.toString();
	    	final String origin = "Connection.dev_import(" + connection.devname + ")";
	    	// e.printStackTrace();
	    	Except.throw_connection_failed(reason, desc, origin);
		}
    }
861929
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "FCBL_FIELD_COULD_BE_LOCAL", justification = "False positives occur when state is maintained across callbacks")
    @Override
    public void visitCode(Code obj) {
        try {
            Method m = getMethod();
            if (m.isPublic() && !m.isSynthetic() && "clone".equals(m.getName()) && (m.getArgumentTypes().length == 0)) {

                String returnClsName = m.getReturnType().getSignature();
                returnClsName = SignatureUtils.stripSignature(returnClsName);
                if (!clsName.equals(returnClsName)) {
                    if (Values.DOTTED_JAVA_LANG_OBJECT.equals(returnClsName)) {
                        bugReporter.reportBug(
                                new BugInstance(this, BugType.CU_CLONE_USABILITY_OBJECT_RETURN.name(), NORMAL_PRIORITY).addClass(this).addMethod(this));
                    } else {
                        JavaClass clonedClass = Repository.lookupClass(returnClsName);
                        if (!cls.instanceOf(clonedClass)) {
                            bugReporter.reportBug(
                                    new BugInstance(this, BugType.CU_CLONE_USABILITY_MISMATCHED_RETURN.name(), HIGH_PRIORITY).addClass(this).addMethod(this));
                        }
                    }
                }

                ExceptionTable et = m.getExceptionTable();

                if ((et != null) && (et.getLength() > 0)) {

                    throwsCNFE = false;
                    if (prescreen(m)) {
                        stack.resetForMethodEntry(this);
                        super.visitCode(obj);
                    }

                    if (!throwsCNFE) {
                        bugReporter.reportBug(new BugInstance(this, BugType.CU_CLONE_USABILITY_THROWS.name(), NORMAL_PRIORITY).addClass(this).addMethod(this));
                    }
                }
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        }
    }
384843
function _addLibrary(app, item) {
  if (!item.name || item.name === '') {
    try {
      if (typeof item.fn.publicName === 'string') item.name = item.fn.publicName;
    } catch (e) {
    }
  }
  item.name = item.name.trim();
  if (item.name.indexOf('thorin-lib-') === 0) {
    item.name = item.name.substr(11);
  }
  if (typeof app[libraries][item.name] !== 'undefined') {
    throw new Error('Thorin.addLibrary: library ' + item.name + " is already registered. Please use a different name.");
  }
  /* Check if we have a constructor or an already created object. */
  let libType = Object.prototype.toString.call(item.fn);
  let itemObj;
  if (libType === '[object Object]') {
    itemObj = item.fn;
  } else {
    itemObj = new item.fn(app);
  }
  app[libraries][item.name] = itemObj;
}
1016226
public void addTangoInterfaceChangeListener(ITangoInterfaceChangeListener listener, String deviceName, boolean stateless)
            throws DevFailed {
        TangoInterfaceChange interfaceChange;
        if ((interfaceChange = tango_interface_change_source.get(deviceName)) == null) {
            interfaceChange = new TangoInterfaceChange(deviceProxy);
            tango_interface_change_source.put(deviceName, interfaceChange);
        }
        synchronized (moni) {
            interfaceChange.addTangoInterfaceChangeListener(listener, stateless);
        }
    }
81866
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            if ((jcomponentClass != null) && (accessibleClass != null)) {
                JavaClass cls = classContext.getJavaClass();
                if (cls.instanceOf(jcomponentClass) && !cls.implementationOf(accessibleClass)) {
                    bugReporter.reportBug(new BugInstance(this, BugType.S508C_NON_ACCESSIBLE_JCOMPONENT.name(), NORMAL_PRIORITY).addClass(cls));
                }
            }

            stack = new OpcodeStack();
            fieldLabels = new HashSet<>();
            localLabels = new HashMap<>();
            super.visitClassContext(classContext);
            for (XField fa : fieldLabels) {
                bugReporter.reportBug(new BugInstance(this, BugType.S508C_NO_SETLABELFOR.name(), NORMAL_PRIORITY).addClass(this).addField(fa));
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            stack = null;
            fieldLabels = null;
            localLabels = null;
        }
    }
1061166
@Fix(IssueCodes.CLASS_EXPECTED)
	public void fixClassExpected(final Issue issue, IssueResolutionAcceptor acceptor) {
		ExtendedTypeRemoveModification.accept(this, issue, acceptor);
	}
920567
@Override
    public void report() {
        for (Map.Entry<String, Map<String, BugInstance>> thisEntry : possibleBugs.entrySet()) {

            Map<String, BugInstance> equalsClassesMap = thisEntry.getValue();
            for (Map.Entry<String, BugInstance> equalsEntry : equalsClassesMap.entrySet()) {
                String equalsCls = equalsEntry.getKey();

                Map<String, BugInstance> reverseEqualsClassMap = possibleBugs.get(equalsCls);
                if (reverseEqualsClassMap == null) {
                    bugReporter.reportBug(equalsClassesMap.values().iterator().next());
                    break;
                }

                if (!reverseEqualsClassMap.containsKey(thisEntry.getKey())) {
                    bugReporter.reportBug(equalsClassesMap.values().iterator().next());
                    break;
                }
            }
        }
        possibleBugs.clear();
    }
152718
@Override
    public void sawOpcode(int seen) {
        try {

            stack.precomputation(this);

            if ((seen == Const.ARETURN) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                if (item.isNull()) {
                    bugReporter.reportBug(new BugInstance(this, BugType.TBP_TRISTATE_BOOLEAN_PATTERN.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                            .addSourceLine(this));
                    throw new StopOpcodeParsingException();
                }
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
1207397
protected void loadSink(String line, String bugType) {
        SINKS_LOADER.loadSink(line, bugType, new SinksLoader.InjectionPointReceiver() {
            @Override
            public void receiveInjectionPoint(String fullMethodName, InjectionPoint injectionPoint) {
                addParsedInjectionPoint(fullMethodName, injectionPoint);
            }
        });
    }
692053
private void reportBugs() {
        for (Map.Entry<QMethod, String> attEntry : attributes.entrySet()) {
            QMethod methodInfo = attEntry.getKey();
            String attType = attEntry.getValue();

            Map<Map.Entry<String, String>, SourceLineAnnotation> fields = methodWrites.get(methodInfo);
            if ((fields == null) || (fields.size() != 1)) {
                continue;
            }

            Map.Entry<String, String> fieldInfo = fields.keySet().iterator().next();
            String fieldType = fieldInfo.getValue();

            if (!attType.equals(fieldType)) {
                continue;
            }

            String fieldName = fieldInfo.getKey();

            for (Map.Entry<QMethod, Map<Map.Entry<String, String>, SourceLineAnnotation>> fwEntry : methodWrites.entrySet()) {
                if (fwEntry.getKey().equals(methodInfo)) {
                    continue;
                }

                SourceLineAnnotation sla = fwEntry.getValue().get(fieldInfo);
                if (sla != null) {
                    bugReporter.reportBug(new BugInstance(this, BugType.NRTL_NON_RECYCLEABLE_TAG_LIB.name(), NORMAL_PRIORITY).addClass(this)
                            .addField(fieldAnnotations.get(fieldName)).addSourceLine(sla));
                    break;
                }
            }
        }
    }
422711
@Override
    public void visitCode(Code obj) {
        stack.resetForMethodEntry(this);
        nodeCreations.clear();
        nodeStores.clear();
        super.visitCode(obj);

        BitSet reportedPCs = new BitSet();
        for (Integer pc : nodeCreations.values()) {
            if (!reportedPCs.get(pc.intValue())) {
                bugReporter.reportBug(new BugInstance(this, BugType.ODN_ORPHANED_DOM_NODE.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, pc.intValue()));
                reportedPCs.set(pc.intValue());
            }
        }
        for (Integer pc : nodeStores.values()) {
            if (!reportedPCs.get(pc.intValue())) {
                bugReporter.reportBug(new BugInstance(this, BugType.ODN_ORPHANED_DOM_NODE.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, pc.intValue()));
                reportedPCs.set(pc.intValue());
            }
        }
    }
298412
@Override
    public boolean libraryExists(String libraryName)
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        String localePrefix = getLocalePrefixForLocateResource(facesContext);
        final List<String> contracts = facesContext.getResourceLibraryContracts(); 

        String pathToLib = null;
        Boolean libraryFound = null;
        if (libraryName != null && !ResourceValidationUtils.isValidLibraryName(
                libraryName, isAllowSlashesLibraryName()))
        {
            return false;
        }
        
        if (localePrefix != null)
        {
            //Check with locale
            pathToLib = localePrefix + '/' + libraryName;

            libraryFound = getResourceLoaderCache().libraryExists(pathToLib);
            if (libraryFound != null)
            {
                return libraryFound.booleanValue();
            }
        }
        libraryFound = getResourceLoaderCache().libraryExists(libraryName);
        if (libraryFound != null)
        {
            return libraryFound.booleanValue();
        }
        
        if (localePrefix != null)
        {
            if (!contracts.isEmpty())
            {
                for (String contract : contracts)
                {
                    for (ContractResourceLoader loader : getResourceHandlerSupport()
                            .getContractResourceLoaders())
                    {
                        if (loader.libraryExists(pathToLib, contract))
                        {
                            getResourceLoaderCache().confirmLibraryExists(pathToLib);
                            return true;
                        }
                    }
                }
            }
            
            for (ResourceLoader loader : getResourceHandlerSupport()
                    .getResourceLoaders())
            {
                if (loader.libraryExists(pathToLib))
                {
                    getResourceLoaderCache().confirmLibraryExists(pathToLib);
                    return true;
                }
            }            
        }

        //Check without locale
        if (!contracts.isEmpty())
        {
            for (String contract : contracts)
            {
                for (ContractResourceLoader loader : getResourceHandlerSupport()
                        .getContractResourceLoaders())
                {
                    if (loader.libraryExists(libraryName, contract))
                    {
                        getResourceLoaderCache().confirmLibraryExists(libraryName);
                        return true;
                    }
                }
            }
        }

        for (ResourceLoader loader : getResourceHandlerSupport()
                .getResourceLoaders())
        {
            if (loader.libraryExists(libraryName))
            {
                getResourceLoaderCache().confirmLibraryExists(libraryName);
                return true;
            }
        }

        if (localePrefix != null)
        {
            //Check with locale
            getResourceLoaderCache().confirmLibraryNotExists(pathToLib);
        }
        else
        {
            getResourceLoaderCache().confirmLibraryNotExists(libraryName);
        }
        return false;
    }
330828
def add_library(self, library):
        
        for fn in library.__dict__.copy().values():
            # ignore imported methods and anything beginning __
            if inspect.isfunction(fn) and inspect.getmodule(fn) == library and not fn.__name__.startswith('__'):
                name = fn.__name__.lower()

                # strip preceding _ chars used to avoid conflicts with Java keywords
                if name.startswith('_'):
                    name = name[1:]

                self._functions[name] = fn
1236249
private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
        SortedBugCollection newBugCollection = bugReporter.getBugCollection();
        try {
            st.newPoint("getBugCollection");
            SortedBugCollection oldBugCollection = FindbugsPlugin.getBugCollection(project, monitor);

            st.newPoint("mergeBugCollections");
            SortedBugCollection resultCollection = mergeBugCollections(oldBugCollection, newBugCollection, incremental);
             resultCollection.getProject().setGuiCallback(new EclipseGuiCallback(project));
            resultCollection.setTimestamp(System.currentTimeMillis());

            // will store bugs in the default FB file + Eclipse project session
            // props
            st.newPoint("storeBugCollection");
            FindbugsPlugin.storeBugCollection(project, resultCollection, monitor);
        } catch (IOException e) {
            FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
        } catch (CoreException e) {
            FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
        }

        // will store bugs as markers in Eclipse workspace
        st.newPoint("createMarkers");
        MarkerUtil.createMarkers(javaProject, newBugCollection, resource, monitor);
    }