public static final class Factory extends TaskFactory { @org.netbeans.api.annotations.common.SuppressWarnings(value={"DMI_COLLECTION_OF_URLS"}, justification="URLs have never host part") //NOI18N private final Set<URL> firedFor = new HashSet<URL>(); @Override public Collection<? extends SchedulerTask> create(Snapshot snapshot) { return Collections.<SchedulerTask>singleton(new SourcePathCheck(this)); } }
@SuppressWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE") // mkdirs public @Override void actionPerformed(ActionEvent e) { for (Project prj : actionContext.lookupAll(Project.class)) { InputStream is = null; try { URL url = new URL(licenseResource); is = url.openStream(); if (is != null) { licenseFile = File.createTempFile("license", ".txt");
@Override @org.netbeans.api.annotations.common.SuppressWarnings(value={"DMI_COLLECTION_OF_URLS"}, justification="URLs have never host part") //NOI18N public void run(final Result result, final SchedulerEvent event) { final CompilationInfo info = CompilationInfo.get(result); if (!this.factory.firedFor.contains(url) && !JavaIndex.hasSourceCache(url,false) && FileOwnerQuery.getOwner(url.toURI()) != null) { unknown.add(url); this.factory.firedFor.add(url);
@org.netbeans.api.annotations.common.SuppressWarnings(value="DMI_BLOCKING_METHODS_ON_URL", justification="File URLs only") public SourceForBinaryQueryImplementation2.Result findSourceRoots2(URL binaryRoot) { SourceForBinaryQueryImplementation2.Result res = cache.get(binaryRoot); if (res != null) { return res; } boolean isNormalizedURL = isNormalizedURL(binaryRoot); for (LibraryManager mgr : LibraryManager.getOpenManagers()) { for (Library lib : mgr.getLibraries()) { if (lib.getType().equals(ServerLibraryTypeProvider.LIBRARY_TYPE)) { for (String type : CLASSPATH_VOLUMES) { for (URL entry : lib.getContent(type)) { URL normalizedEntry = entry; if (isNormalizedURL) { normalizedEntry = getNormalizedURL(normalizedEntry); } if (binaryRoot.equals(normalizedEntry)) { res = new Result(entry, lib); cache.put(binaryRoot, res); return res; } } } } } } return null; }
/** * Returns the dependent source path roots for given source root. * It returns all the open project source roots which have either * direct or transitive dependency on the given source root. * @param root to find the dependent roots for * @return {@link Set} of {@link URL}s containing at least the * incoming root, never returns null. * @since 0.10 */ @NonNull @org.netbeans.api.annotations.common.SuppressWarnings(value = {"DMI_COLLECTION_OF_URLS"}, justification="URLs have never host part") public static Set<URL> getDependentRoots (@NonNull final URL root) { return getDependentRoots(root, true); }
@org.netbeans.api.annotations.common.SuppressWarnings(value="DMI_BLOCKING_METHODS_ON_URL", justification="File URLs only") public SourceForBinaryQueryImplementation2.Result findSourceRoots2 (URL binaryRoot) { SourceForBinaryQueryImplementation2.Result res = this.cache.get (binaryRoot); normalizedEntry = entry; if (normalizedEntry != null && normalizedEntry.equals(binaryRoot)) { res = new Result(entry, libs[j]); cache.put (binaryRoot, res);
/** * Returns the dependent source path roots for given source root. It returns * all the source roots which have either direct or transitive dependency on * the given source root. * * @param root to find the dependent roots for * @param filterNonOpenedProjects true if the results should only contain roots for * opened projects * @return {@link Set} of {@link URL}s containing at least the incoming * root, never returns null. * @since 0.110 */ @NonNull @org.netbeans.api.annotations.common.SuppressWarnings(value = {"DMI_COLLECTION_OF_URLS"}, justification="URLs have never host part") public static Set<URL> getDependentRoots( @NonNull final URL root, final boolean filterNonOpenedProjects) { final FileObject rootFO = URLMapper.findFileObject(root); if (rootFO != null) { return mapToURLs(QuerySupport.findDependentRoots(rootFO,filterNonOpenedProjects)); } else { return Collections.<URL>singleton(root); } }
@org.netbeans.api.annotations.common.SuppressWarnings(value="DMI_BLOCKING_METHODS_ON_URL", justification="File URLs only") public JavadocForBinaryQuery.Result findJavadoc(final URL b) { class R implements JavadocForBinaryQuery.Result, PropertyChangeListener { normalizedEntry = entry; if (b.equals(normalizedEntry)) { return new R(lib);
@org.netbeans.api.annotations.common.SuppressWarnings(value = "EI_EXPOSE_REP2", justification = "Intentional") // NOI18N public PhpExtenderPanel(PhpModuleExtender extender, String[] steps, int stepIndex) { assert extender != null; assert steps != null; this.extender = extender; this.steps = steps; this.stepIndex = stepIndex; }
@org.netbeans.api.annotations.common.SuppressWarnings(value="DMI_BLOCKING_METHODS_ON_URL", justification="File URLs only") public JavadocForBinaryQuery.Result findJavadoc(final URL b) { class R implements JavadocForBinaryQuery.Result, PropertyChangeListener { normalizedEntry = entry; if (normalizedEntry != null && normalizedEntry.equals(b)) { return new R(libs[j]);
@org.netbeans.api.annotations.common.SuppressWarnings("SE_COMPARATOR_SHOULD_BE_SERIALIZABLE") private static final class ModelElementsPositionComparator implements Comparator<ModelElement> { @Override public int compare(ModelElement o1, ModelElement o2) { int o1End = o1.getNameRange().getEnd(); int o2End = o2.getNameRange().getEnd(); // furthest first if (o1End < o2End) { return 1; } else if (o1End > o2End) { return -1; } return 0; } }
@org.netbeans.api.annotations.common.SuppressWarnings("EQ_DOESNT_OVERRIDE_EQUALS") private static final class ImportantFileNode extends FilterNode { private final Pair<PhpFrameworkProvider, FileObject> pair; private final FileObject sourceDir; public ImportantFileNode(Pair<PhpFrameworkProvider, FileObject> pair, FileObject sourceDir) throws DataObjectNotFoundException { super(DataObject.find(pair.second()).getNodeDelegate()); this.pair = pair; this.sourceDir = sourceDir; } @Override public String getShortDescription() { String filepath = FileUtil.getRelativePath(sourceDir, pair.second()); if (filepath == null) { filepath = FileUtil.getFileDisplayName(pair.second()); } return NbBundle.getMessage(ImportantFileNode.class, "LBL_ImportantFileTooltip", filepath, pair.first().getName()); } } }
public static abstract class Accessor { @SuppressWarnings("MS_SHOULD_BE_FINAL") public static Accessor ACCESSOR;
/** * {@link PhpEnvironment} implementation for MAMP. */ @org.netbeans.api.annotations.common.SuppressWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") private static final class MampPhpEnvironment extends PhpEnvironment { @Override protected List<DocumentRoot> getDocumentRoots(String projectName) { File mamp = new File("/Applications/MAMP/htdocs"); // NOI18N if (mamp.isDirectory()) { String documentRoot = getFolderName(mamp, projectName); String url = getDefaultUrl(projectName, 8888); String hint = NbBundle.getMessage(MampPhpEnvironment.class, "TXT_MampHtDocs"); return Collections.singletonList(new DocumentRoot(documentRoot, url, hint, true)); } return Collections.emptyList(); } @Override public List<String> getAllPhpInterpreters() { File php = new File("/Applications/MAMP/bin/php5/bin/php"); // NOI18N if (php.isFile()) { return Collections.singletonList(php.getAbsolutePath()); } return Collections.emptyList(); } }
@org.netbeans.api.annotations.common.SuppressWarnings("SE_COMPARATOR_SHOULD_BE_SERIALIZABLE") private static final class SyncItemImageIconComparator implements Comparator<ImageIcon> {
@org.netbeans.api.annotations.common.SuppressWarnings("DM_GC") private long usedMemory() { System.gc(); return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); }
@org.netbeans.api.annotations.common.SuppressWarnings({"EI_EXPOSE_REP2"}) protected abstract static class AbstractTypeNode implements TreeNode {
@org.netbeans.api.annotations.common.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"}) public static class SyntaxError {
@org.netbeans.api.annotations.common.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"}) public class GSFPHPError implements org.netbeans.modules.csl.api.Error.Badging { private static final boolean SILENT_ERROR_BADGE = Boolean.getBoolean("nb.php.silent.error.badge"); //NOI18N
@org.netbeans.api.annotations.common.SuppressWarnings("EQ_DOESNT_OVERRIDE_EQUALS") private static final class PackageNode extends FilterNode {