本文整理汇总了Java中edu.umd.cs.findbugs.annotations.SuppressFBWarnings类的典型用法代码示例。如果您正苦于以下问题:Java SuppressFBWarnings类的具体用法?Java SuppressFBWarnings怎么用?Java SuppressFBWarnings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SuppressFBWarnings类属于edu.umd.cs.findbugs.annotations包,在下文中一共展示了SuppressFBWarnings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startReconnect
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@SuppressFBWarnings(value = "UL_UNRELEASED_LOCK", justification = "Lock is released asynchronously via the cohort")
ProxyReconnectCohort startReconnect(final ConnectedClientConnection<ShardBackendInfo> newConnection) {
lock.lock();
if (successor != null) {
lock.unlock();
throw new IllegalStateException("Proxy history " + this + " already has a successor");
}
successor = createSuccessor(newConnection);
LOG.debug("History {} instantiated successor {}", this, successor);
for (AbstractProxyTransaction t : proxies.values()) {
t.startReconnect();
}
return new ReconnectCohort();
}
示例2: _apply
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "Assume both inputs are the same type")
@Override
public Number _apply(final Number a, final Number b) {
if (a instanceof Integer) {
return aggregateInt((Integer) a, (Integer) b);
} else if (a instanceof Long) {
return aggregateLong((Long) a, (Long) b);
} else if (a instanceof Double) {
return aggregateDouble((Double) a, (Double) b);
} else if (a instanceof Float) {
return aggregateFloat((Float) a, (Float) b);
} else if (a instanceof Short) {
return aggregateShort((Short) a, (Short) b);
}
return null;
}
示例3: addElementsFromHdfsWithMultipleInput
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void addElementsFromHdfsWithMultipleInput() {
// ---------------------------------------------------------
final Map<String, String> inputMapperMap = new HashMap<>();
inputMapperMap.put("/path/to/first/inputFileOrFolder", TextMapperGeneratorImpl.class.getName());
inputMapperMap.put("/path/to/second/inputFileOrFolder", TextMapperGeneratorImpl.class.getName());
final AddElementsFromHdfs operation = new AddElementsFromHdfs.Builder()
.inputMapperPairs(inputMapperMap)
.addInputMapperPair("/path/to/third/inputFileOrFolder", TextMapperGeneratorImpl.class.getName())
.outputPath("/path/to/output/folder")
.failurePath("/path/to/failure/folder")
.splitsFilePath("/path/to/splits/file")
.workingPath("/tmp/workingDir")
.useProvidedSplits(false)
.jobInitialiser(new TextJobInitialiser())
.minReducers(10)
.maxReducers(100)
.build();
// ---------------------------------------------------------
showJavaExample(null);
}
示例4: testVcapSingleServiceWithNulls
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@Test
@SuppressFBWarnings("DM_DEFAULT_ENCODING")
public void testVcapSingleServiceWithNulls() {
final Resource resource = new ClassPathResource("/vcap2.json");
final String content;
try {
content = new String(
Files.readAllBytes(Paths.get(resource.getURI())));
final VcapResult result = parser.parse(content);
final VcapPojo[] pojos = result.getPojos();
assertNotNull(pojos);
assertEquals(1, pojos.length);
final VcapPojo pojo = pojos[0];
LOG.debug("pojo = " + pojo);
assertEquals(4, pojo.getCredentials().size());
assertEquals(0, pojo.getTags().length);
assertEquals(0, pojo.getVolumeMounts().length);
assertEquals("azure-documentdb", pojo.getLabel());
assertNull(pojo.getProvider());
assertEquals("azure-documentdb", pojo.getServiceBrokerName());
assertEquals("mydocumentdb", pojo.getServiceInstanceName());
assertEquals("standard", pojo.getServicePlan());
assertNull(pojo.getSyslogDrainUrl());
assertEquals("docdb123mj",
pojo.getCredentials().get("documentdb_database_id"));
assertEquals("dbs/ZFxCAA==/",
pojo.getCredentials().get("documentdb_database_link"));
assertEquals("https://hostname:443/",
pojo.getCredentials().get("documentdb_host_endpoint"));
assertEquals(
"3becR7JFnWamMvGwWYWWTV4WpeNhN8tOzJ74yjAxPKDpx65q2lYz60jt8WXU6HrIKrAIwhs0Hglf0123456789==",
pojo.getCredentials().get("documentdb_master_key"));
} catch (IOException e) {
LOG.error("Error reading json file", e);
}
}
示例5: updateMetadata
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED")
private void updateMetadata() {
storage.getMetadata().defaultIfEmpty(new Metadata.Builder(schema)
.setAttribution(System.getProperty("user.name")).build())
.subscribe(new Consumer<Metadata>() {
@Override
public void accept(Metadata metadata) throws Exception {
Metadata.Builder newMetadata = new Metadata.Builder(metadata);
for (FluentLayer layer : layers) {
if (!isLayerInMetadata(metadata, layer.getName())) {
newMetadata.addLayer(layer.getMetadata());
}
}
storage.putMetadata(Single.just(newMetadata.build()));
}
});
}
示例6: saveSettings
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@Override
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH") // minLength and such are always non-null
public void saveSettings(final @NotNull WordSettings settings) {
settings.setMinLength(Math.toIntExact(minLength.getValue()));
settings.setMaxLength(Math.toIntExact(maxLength.getValue()));
settings.setEnclosure(ButtonGroupHelper.getValue(enclosureGroup));
settings.setCapitalization(CapitalizationMode.getMode(ButtonGroupHelper.getValue(capitalizationGroup)));
settings.setBundledDictionaries(dictionaries.getEntries().stream()
.filter(Dictionary.BundledDictionary.class::isInstance)
.map(Dictionary::getPath)
.collect(Collectors.toSet()));
settings.setActiveBundledDictionaries(dictionaries.getActiveEntries().stream()
.filter(Dictionary.BundledDictionary.class::isInstance)
.map(Dictionary::getPath)
.collect(Collectors.toSet()));
settings.setUserDictionaries(dictionaries.getEntries().stream()
.filter(Dictionary.UserDictionary.class::isInstance)
.map(Dictionary::getPath)
.collect(Collectors.toSet()));
settings.setActiveUserDictionaries(dictionaries.getActiveEntries().stream()
.filter(Dictionary.UserDictionary.class::isInstance)
.map(Dictionary::getPath)
.collect(Collectors.toSet()));
}
示例7: buildUpdateActionsAndUpdate
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
/**
* Given an existing {@link InventoryEntry} and a new {@link InventoryEntryDraft}, the method calculates all the
* update actions required to synchronize the existing entry to be the same as the new one. If there are update
* actions found, a request is made to CTP to update the existing entry, otherwise it doesn't issue a request.
*
* <p>The {@code statistics} instance is updated accordingly to whether the CTP request was carried
* out successfully or not. If an exception was thrown on executing the request to CTP, the error handling method
* is called.
*
* @param entry existing inventory entry that could be updated.
* @param draft draft containing data that could differ from data in {@code entry}.
* <strong>Sku isn't compared</strong>
* @return a future which contains an empty result after execution of the update.
*/
@SuppressFBWarnings("NP_NONNULL_PARAM_VIOLATION") // https://github.com/findbugsproject/findbugs/issues/79
private CompletionStage<Void> buildUpdateActionsAndUpdate(@Nonnull final InventoryEntry entry,
@Nonnull final InventoryEntryDraft draft) {
final List<UpdateAction<InventoryEntry>> updateActions =
InventorySyncUtils.buildActions(entry, draft, syncOptions);
if (!updateActions.isEmpty()) {
return inventoryService.updateInventoryEntry(entry, updateActions)
.thenAccept(updatedInventory -> statistics.incrementUpdated())
.exceptionally(exception -> {
final Reference<Channel> supplyChannel = draft.getSupplyChannel();
final String errorMessage = format(CTP_INVENTORY_ENTRY_UPDATE_FAILED, draft.getSku(),
supplyChannel != null ? supplyChannel.getId() : null);
handleError(errorMessage, exception, 1);
return null;
});
}
return completedFuture(null);
}
示例8: calculateCorePoolSize
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
/**
* Tries using the number of files named 'cpuNN' in sysfs to figure out the number of
* processors on this device. `Runtime.getRuntime().availableProcessors()` may return
* a smaller number when the device is sleeping.
*
* @return the number of threads to be allocated for the executor pool
*/
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
private static int calculateCorePoolSize() {
int cpus = countFilesInDir(SYS_CPU_DIR, "cpu[0-9]+");
if (cpus <= 0) {
cpus = Runtime.getRuntime().availableProcessors();
}
return (cpus <= 0) ? 1 : (cpus * 2) + 1;
}
示例9: PermissionOffer
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
/**
* Creates a request for a permission offer that last until it is manually revoked.
*
* @param url specific url to Realm effected. The user sending the offer must have manage rights to this Realm.
* @param accessLevel the {@link AccessLevel} granted to the user accepting the offer.
* @param expiresAt the date and time when this offer expires. If {@code null} is provided the offer never expires.
*
*
* @see PermissionManager#revokeOffer(String, PermissionManager.RevokeOfferCallback)
*/
@SuppressFBWarnings("EI_EXPOSE_REP2")
public PermissionOffer(String url, AccessLevel accessLevel, @Nullable Date expiresAt) {
validateUrl(url);
validateAccessLevel(accessLevel);
this.mayRead = accessLevel.mayRead();
this.mayWrite = accessLevel.mayWrite();
this.mayManage = accessLevel.mayManage();
this.realmUrl = url;
//noinspection ConstantConditions
this.expiresAt = (expiresAt != null) ? (Date) expiresAt.clone() : null;
}
示例10: apply
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@Override
@SuppressFBWarnings(value = "DE_MIGHT_IGNORE", justification = "Any exceptions are to be ignored")
public T apply(final Iterable<T> input) {
if (null == input) {
throw new IllegalArgumentException("Input cannot be null");
}
try {
return Iterables.get(input, selection);
} finally {
CloseableUtil.close(input);
}
}
示例11: Graph
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
/**
* Constructs a graph from array based data structure.
*
* @param nodeArrays nested array containing the graph's data
* @param gfaFile a reference to the GFA file from which the graph is created
*/
@SuppressFBWarnings(
value = "EI_EXPOSE_REP2",
justification = "For performance reasons, we don't want to create a copy here"
)
@SuppressWarnings("PMD.ArrayIsStoredDirectly") // Performance
public Graph(final int[][] nodeArrays, final GfaFile gfaFile) {
this.nodeArrays = nodeArrays;
this.gfaFile = gfaFile;
}
示例12: EdgeOptimizer
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
/**
* Constructs and initializes {@link LayoutableNode}.
*
* @param layers an array of layers
*/
@SuppressFBWarnings(
value = "EI_EXPOSE_REP2",
justification = "For performance reasons, we don't want to create a copy here"
)
@SuppressWarnings("PMD.ArrayIsStoredDirectly") // For performance reason, we don't want to create a copy here
public EdgeOptimizer(final LayoutableNode[][] layers) {
this.layers = layers;
}
示例13: toArray
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
/**
* Getter for the node's array which contains its metadata.
*
* @return the node array
*/
@SuppressFBWarnings(
value = "EI_EXPOSE_REP",
justification = "For performance reasons, we don't want to create a copy here"
)
@SuppressWarnings("PMD.MethodReturnsInternalArray") // Performance
public int[] toArray() {
return data;
}
示例14: handle
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
@Override
public void handle(final byte[] screenshot, final ITestResult testResult) {
if (nonNull(screenshot) && testResult.getStatus() == FAILURE) {
attachScreenshot(screenshot,
testResult.getMethod().getMethodName() + "_" + LocalDate.now());
}
}
示例15: newInstance
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; //导入依赖的package包/类
/**
* This is called via blueprint xml as the builder pattern can't be used.
*/
@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE",
justification = "Findbugs flags this as an unconfirmed cast of return value but the build method clearly "
+ "returns RemoteRpcProviderConfig. Perhaps it's confused b/c the build method is overloaded and "
+ "and differs in return type from the base class.")
public static RemoteRpcProviderConfig newInstance(final String actorSystemName, final boolean metricCaptureEnabled,
final int mailboxCapacity) {
return new Builder(actorSystemName).metricCaptureEnabled(metricCaptureEnabled)
.mailboxCapacity(mailboxCapacity).build();
}