code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private static void updateParallel(Object mojo) throws Exception {
try {
String currentParallel = getStringField(PARALLEL_FIELD, mojo);
if (currentParallel != null) {
warn(mojo, "Ekstazi does not support parallel parameter. This parameter will be set to null for this run... | java |
private static boolean isOneVMPerClass(Object mojo) throws Exception {
// We already know that we fork process (checked in
// precondition). Threfore if we see reuseForks=false, we know
// that one class will be run in one VM.
try {
return !invokeAndGetBoolean(IS_REUSE_FORKS,... | java |
public static <Type> ArrayObjectProvider<Type> getProvider(final Class<Type> arrayType) {
return new ArrayObjectProvider<Type>(arrayType);
} | java |
@Nonnull
public FineUploader5Request addCustomHeaders (@Nullable final Map <String, String> aCustomHeaders)
{
m_aRequestCustomHeaders.addAll (aCustomHeaders);
return this;
} | java |
@Nonnull
public FineUploader5Request setEndpoint (@Nonnull final ISimpleURL aRequestEndpoint)
{
ValueEnforcer.notNull (aRequestEndpoint, "RequestEndpoint");
m_aRequestEndpoint = aRequestEndpoint;
return this;
} | java |
@Nonnull
public FineUploader5Request setFilenameParam (@Nonnull @Nonempty final String sFilenameParam)
{
ValueEnforcer.notEmpty (sFilenameParam, "FilenameParam");
m_sRequestFilenameParam = sFilenameParam;
return this;
} | java |
@Nonnull
public FineUploader5Request setUUIDName (@Nonnull @Nonempty final String sUUIDName)
{
ValueEnforcer.notEmpty (sUUIDName, "UUIDName");
m_sRequestUUIDName = sUUIDName;
return this;
} | java |
@Nonnull
public FineUploader5Request setTotalFileSizeName (@Nonnull @Nonempty final String sTotalFileSizeName)
{
ValueEnforcer.notEmpty (sTotalFileSizeName, "TotalFileSizeName");
m_sRequestTotalFileSizeName = sTotalFileSizeName;
return this;
} | java |
public boolean canBeBundledWith (@Nonnull final WebSiteResourceWithCondition aOther)
{
ValueEnforcer.notNull (aOther, "Other");
// Resource cannot be bundled at all
if (!m_bIsBundlable || !aOther.isBundlable ())
return false;
// Can only bundle resources of the same type
if (!m_aResource.g... | java |
@Nonnull
public static WebSiteResourceWithCondition createForJS (@Nonnull final IJSPathProvider aPP, final boolean bRegular)
{
return createForJS (aPP.getJSItemPath (bRegular), aPP.getConditionalComment (), aPP.isBundlable ());
} | java |
@Nonnull
public static WebSiteResourceWithCondition createForCSS (@Nonnull final ICSSPathProvider aPP, final boolean bRegular)
{
return createForCSS (aPP.getCSSItemPath (bRegular),
aPP.getConditionalComment (),
aPP.isBundlable (),
aPP.ge... | java |
public static boolean canBeDeleted (@Nullable final IUser aUser)
{
return aUser != null && !aUser.isDeleted () && !aUser.isAdministrator ();
} | java |
@Nonnull
public static IHCConversionSettings createConversionSettings ()
{
// Create HTML without namespaces
final HCConversionSettings aRealCS = HCSettings.getMutableConversionSettings ().getClone ();
aRealCS.getMutableXMLWriterSettings ().setEmitNamespaces (false);
// Remove any "HCCustomizerAuto... | java |
public static void unregisterCSSIncludeFromThisRequest (@Nonnull final ICSSPathProvider aCSSPathProvider)
{
final CSSResourceSet aSet = _getPerRequestSet (false);
if (aSet != null)
aSet.removeItem (aCSSPathProvider);
} | java |
@Nonnull
public final HCOutput setFor (@Nullable final IHCHasID <?> aFor)
{
if (aFor == null)
m_sFor = null;
else
m_sFor = aFor.ensureID ().getID ();
return this;
} | java |
@Override
public void visitLdcInsn(Object cst) {
// We use this method to support accesses to .class.
if (cst instanceof Type) {
int sort = ((Type) cst).getSort();
if (sort == Type.OBJECT) {
String className = Types.descToInternalName(((Type) cst).getDescripto... | java |
private void insertTInvocation0(String className, int probeId) {
// Check if class name has been seen since the last label.
if (!mSeenClasses.add(className)) return;
// Check if this class name should be ignored.
if (Types.isIgnorableInternalName(className)) return;
// x. (we tr... | java |
protected Plugin lookupPlugin(String key) {
List<Plugin> plugins = project.getBuildPlugins();
for (Iterator<Plugin> iterator = plugins.iterator(); iterator.hasNext();) {
Plugin plugin = iterator.next();
if(key.equalsIgnoreCase(plugin.getKey())) {
return plugin;
... | java |
protected boolean isRestoreGoalPresent() {
Plugin ekstaziPlugin = lookupPlugin(EKSTAZI_PLUGIN_KEY);
if (ekstaziPlugin == null) {
return false;
}
for (Object execution : ekstaziPlugin.getExecutions()) {
for (Object goal : ((PluginExecution) execution).getGoals()) {... | java |
private void restoreExcludesFile(File excludesFileFile) throws MojoExecutionException {
if (!excludesFileFile.exists()) {
return;
}
try {
String[] lines = FileUtil.readLines(excludesFileFile);
List<String> newLines = new ArrayList<String>();
for (... | java |
private static List<byte[]> parsePrivateKeyASN1(ByteBuffer byteBuffer) {
final List<byte[]> collection = new ArrayList<byte[]>();
while (byteBuffer.hasRemaining()) {
byte type = byteBuffer.get();
int length = UnsignedBytes.toInt(byteBuffer.get());
if ((length & 0x80) != 0) {
int number... | java |
@Nonnull
@ReturnsMutableCopy
public static ICommonsList <String> getCleanPathParts (@Nonnull final String sPath)
{
// Remove leading and trailing whitespaces and slashes
String sRealPath = StringHelper.trimStartAndEnd (sPath.trim (), "/", "/");
// Remove obscure path parts
sRealPath = FilenameHel... | java |
@Nonnull
public FineUploader5Paste setDefaultName (@Nonnull @Nonempty final String sDefaultName)
{
ValueEnforcer.notEmpty (sDefaultName, "DefaultName");
m_sPasteDefaultName = sDefaultName;
return this;
} | java |
public String ordinalize(int number) {
String numberStr = Integer.toString(number);
if (11 <= number && number <= 13) return numberStr + "th";
int remainder = number % 10;
if (remainder == 1) return numberStr + "st";
if (remainder == 2) return numberStr + "nd";
if (remain... | java |
@OverrideOnDemand
protected boolean isLoginInProgress (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope)
{
return CLogin.REQUEST_ACTION_VALIDATE_LOGIN_CREDENTIALS.equals (aRequestScope.params ()
.getAsString (CLogin.REQ... | java |
@Nullable
@OverrideOnDemand
protected String getLoginName (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope)
{
return aRequestScope.params ().getAsString (CLogin.REQUEST_ATTR_USERID);
} | java |
@Nullable
@OverrideOnDemand
protected String getPassword (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope)
{
return aRequestScope.params ().getAsString (CLogin.REQUEST_ATTR_PASSWORD);
} | java |
@Nonnull
public final EContinue checkUserAndShowLogin (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
@Nonnull final UnifiedResponse aUnifiedResponse)
{
final LoggedInUserManager aLoggedInUserManager = LoggedInUserManager.getInstance ();
String ... | java |
@Nonnull
public static JSInvocation setSelectOptions (@Nonnull final IJSExpression aSelector,
@Nonnull final IJSExpression aValueList)
{
return getFormHelper ().invoke ("setSelectOptions").arg (aSelector).arg (aValueList);
} | java |
protected boolean isMagicCorrect(BufferedReader br) throws IOException {
if (mCheckMagicSequence) {
String magicLine = br.readLine();
return (magicLine != null && magicLine.equals(mMode.getMagicSequence()));
} else {
return true;
}
} | java |
protected RegData parseLine(State state, String line) {
// Note. Initial this method was using String.split, but that method
// seems to be much more expensive than playing with indexOf and
// substring.
int sepIndex = line.indexOf(SEPARATOR);
String urlExternalForm = line.substr... | java |
protected void printLine(State state, Writer pw, String externalForm, String hash) throws IOException {
pw.write(externalForm);
pw.write(SEPARATOR);
pw.write(hash);
pw.write('\n');
} | java |
public void update(final float delta) {
if (transitionInProgress) {
currentValue += (targetValue - initialValue) * delta / transitionLength;
if (isInitialGreater) {
if (currentValue <= targetValue) {
finalizeTransition();
}
... | java |
public void setCurrentValue(final float currentValue) {
this.currentValue = currentValue;
initialValue = currentValue;
targetValue = currentValue;
transitionInProgress = false;
} | java |
@Nonnull
public static IHCNode markdown (@Nullable final String sMD)
{
try
{
final HCNodeList aNL = MARKDOWN_PROC.process (sMD).getNodeList ();
// Replace a single <p> element with its contents
if (aNL.getChildCount () == 1 && aNL.getChildAtIndex (0) instanceof HCP)
return ((HCP) ... | java |
public final void getContent (@Nonnull final WPECTYPE aWPEC)
{
if (isValidToDisplayPage (aWPEC).isValid ())
{
// "before"-callback
beforeFillContent (aWPEC);
// Create the main page content
fillContent (aWPEC);
// "after"-callback
afterFillContent (aWPEC);
}
else
... | java |
@Nonnull
public static final AjaxFunctionDeclaration addAjax (@Nullable final String sPrefix,
@Nonnull final IAjaxExecutor aExecutor)
{
// null means random name
final String sFuncName = StringHelper.hasText (sPrefix) ? sPrefix + AjaxFunctionDeclaration... | java |
public QRSCT reference(String reference) {
if (reference != null && reference.length() <= 35) {
this.text = ""; //$NON-NLS-1$
this.reference = checkValidSigns(reference);
return this;
}
throw new IllegalArgumentException("supplied reference [" + reference //$NON-NLS-1$
+ "] not valid: has to b... | java |
public QRSCT text(String text) {
if (text != null && text.length() <= 140) {
this.reference = ""; //$NON-NLS-1$
this.text = checkValidSigns(text);
return this;
}
throw new IllegalArgumentException("supplied text [" + text //$NON-NLS-1$
+ "] not valid: has to be not null and of max length 140")... | java |
private void processClasspath(String classpathElement) throws ResourceNotFoundException, ParseErrorException, Exception {
// getLog().info("Classpath is " + classpathElement);
if (classpathElement.endsWith(".jar")) {
// TODO: implement JAR scanning
} else {
final File dir ... | java |
private void processPackage(File root, File dir) {
getLog().debug("- package: " + dir);
if (null != dir && dir.isDirectory()) {
for (File f : dir.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.... | java |
@Nonnull
@ReturnsMutableCopy
private HolidayMap _getHolidays (final int nYear,
@Nonnull final Configuration aConfig,
@Nullable final String... aArgs)
{
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Adding holidays for " + aConfig.getDe... | java |
private static void _validateConfigurationHierarchy (@Nonnull final Configuration aConfig)
{
final ICommonsSet <String> aHierarchySet = new CommonsHashSet <> ();
for (final Configuration aSubConfig : aConfig.getSubConfigurations ())
{
final String sHierarchy = aSubConfig.getHierarchy ();
if (!... | java |
@Nonnull
private static CalendarHierarchy _createConfigurationHierarchy (@Nonnull final Configuration aConfig,
@Nullable final CalendarHierarchy aParent)
{
final ECountry eCountry = ECountry.getFromIDOrNull (aConfig.getHierarchy ());
final Ca... | java |
public static void setDbType(JdbcDialect dialect, String key, String type) {
Properties props = getTypesProps(dialect);
props.setProperty(key, type);
} | java |
private static ICommonsSet <LocalDate> _getEthiopianOrthodoxHolidaysInGregorianYear (final int nGregorianYear,
final int nEOMonth,
final int nEODa... | java |
@Override
public Result parse(Command cmd, InputStream input, ResultType type) {
return parseResults(cmd, input, type);
} | java |
public static Result parseResults(Command cmd, InputStream input, ResultType type) throws SparqlException {
try {
return createResults(cmd, input, type);
} catch (Throwable t) {
logger.debug("Error parsing results from stream, cleaning up.");
try {
input.close();
} catch (IOExcep... | java |
private static Result createResults(Command cmd, InputStream stream, ResultType type) throws SparqlException {
XMLInputFactory xmlStreamFactory = XMLInputFactory.newInstance();
// Tell the factory to combine adjacent character blocks into a single event, so we don't have to do it ourselves.
xmlStreamFa... | java |
static private void parseHeader(String base, XMLStreamReader rdr, List<String> cols, List<String> md) throws XMLStreamException, SparqlException {
logger.debug("xml:base is initially {}", base);
base = getBase(base, rdr);
testOpen(rdr, rdr.nextTag(), HEAD, "Missing header from XML results");
base = getB... | java |
static final boolean nameIs(XMLStreamReader rdr, Element elt) {
return rdr.getLocalName().equalsIgnoreCase(elt.name());
} | java |
public static void runOnUiThread(@NonNull final Runnable runnable) {
Condition.INSTANCE.ensureNotNull(runnable, "The runnable may not be null");
new Handler(Looper.getMainLooper()).post(runnable);
} | java |
@SafeVarargs
private final boolean notifyOnLoad(@NonNull final KeyType key,
@NonNull final ParamType... params) {
boolean result = true;
for (Listener<DataType, KeyType, ViewType, ParamType> listener : listeners) {
result &= listener.onLoadData(thi... | java |
@SafeVarargs
private final void notifyOnFinished(@NonNull final KeyType key, @Nullable final DataType data,
@NonNull final ViewType view,
@NonNull final ParamType... params) {
for (Listener<DataType, KeyType, ViewType, ParamType... | java |
private void notifyOnCanceled() {
for (Listener<DataType, KeyType, ViewType, ParamType> listener : listeners) {
listener.onCanceled(this);
}
} | java |
@Nullable
private DataType getCachedData(@NonNull final KeyType key) {
synchronized (cache) {
return cache.get(key);
}
} | java |
private void cacheData(@NonNull final KeyType key, @NonNull final DataType data) {
synchronized (cache) {
if (useCache) {
cache.put(key, data);
}
}
} | java |
private void loadDataAsynchronously(
@NonNull final Task<DataType, KeyType, ViewType, ParamType> task) {
threadPool.submit(new Runnable() {
@Override
public void run() {
if (!isCanceled()) {
while (!notifyOnLoad(task.key, task.params)) {
... | java |
@Nullable
private DataType loadData(@NonNull final Task<DataType, KeyType, ViewType, ParamType> task) {
try {
DataType data = doInBackground(task.key, task.params);
if (data != null) {
cacheData(task.key, data);
}
logger.logInfo(getClass(), "... | java |
public final void addListener(
@NonNull final Listener<DataType, KeyType, ViewType, ParamType> listener) {
listeners.add(listener);
} | java |
public final void removeListener(
@NonNull final Listener<DataType, KeyType, ViewType, ParamType> listener) {
listeners.remove(listener);
} | java |
@SafeVarargs
public final void load(@NonNull final KeyType key, @NonNull final ViewType view,
@NonNull final ParamType... params) {
load(key, view, true, params);
} | java |
@SafeVarargs
public final void load(@NonNull final KeyType key, @NonNull final ViewType view,
final boolean async, @NonNull final ParamType... params) {
Condition.INSTANCE.ensureNotNull(key, "The key may not be null");
Condition.INSTANCE.ensureNotNull(view, "The view may n... | java |
public final boolean isCached(@NonNull final KeyType key) {
Condition.INSTANCE.ensureNotNull(key, "The key may not be null");
synchronized (cache) {
return cache.get(key) != null;
}
} | java |
public final void useCache(final boolean useCache) {
synchronized (cache) {
this.useCache = useCache;
logger.logDebug(getClass(), useCache ? "Enabled" : "Disabled" + " caching");
if (!useCache) {
clearCache();
}
}
} | java |
private static void profile(Task task, String message, int tries) {
for (int i = 0; i < tries; i++) {
long start = System.nanoTime();
task.run();
long finish = System.nanoTime();
System.out.println(
String.format("[Try %d] %-30s: %-5.2fms", i +... | java |
private void obtainShadowElevation(@NonNull final TypedArray typedArray) {
int defaultValue = getResources().getDimensionPixelSize(
R.dimen.elevation_shadow_view_shadow_elevation_default_value);
elevation = pixelsToDp(getContext(), typedArray
.getDimensionPixelSize(R.styl... | java |
private void obtainShadowOrientation(@NonNull final TypedArray typedArray) {
int defaultValue = getResources()
.getInteger(R.integer.elevation_shadow_view_shadow_orientation_default_value);
orientation = Orientation.fromValue(typedArray
.getInteger(R.styleable.ElevationSh... | java |
private void obtainEmulateParallelLight(@NonNull final TypedArray typedArray) {
boolean defaultValue = getResources()
.getBoolean(R.bool.elevation_shadow_view_emulate_parallel_light_default_value);
emulateParallelLight = typedArray
.getBoolean(R.styleable.ElevationShadowV... | java |
private void adaptElevationShadow() {
setImageBitmap(
createElevationShadow(getContext(), elevation, orientation, emulateParallelLight));
setScaleType(orientation == Orientation.LEFT || orientation == Orientation.TOP ||
orientation == Orientation.RIGHT || orientation == O... | java |
public final void setShadowElevation(final int elevation) {
Condition.INSTANCE.ensureAtLeast(elevation, 0, "The elevation must be at least 0");
Condition.INSTANCE.ensureAtMaximum(elevation, ElevationUtil.MAX_ELEVATION,
"The elevation must be at maximum " + ElevationUtil.MAX_ELEVATION);
... | java |
public final void setShadowOrientation(@NonNull final Orientation orientation) {
Condition.INSTANCE.ensureNotNull(orientation, "The orientation may not be null");
this.orientation = orientation;
adaptElevationShadow();
} | java |
@Override
public boolean hasError(Response<ByteSource> rs) {
StatusType statusType = StatusType.valueOf(rs.getStatus());
return (statusType == StatusType.CLIENT_ERROR || statusType == StatusType.SERVER_ERROR);
} | java |
protected void handleError(URI requestUri, HttpMethod requestMethod, int statusCode, String statusMessage,
ByteSource errorBody) throws RestEndpointIOException {
throw new RestEndpointException(requestUri, requestMethod, statusCode, statusMessage, errorBody);
} | java |
public void init(APUtils utils) throws DuzztInitializationException {
URL url = GenerateEDSLProcessor.class.getResource(ST_RESOURCE_NAME);
this.sourceGenGroup = new STGroupFile(
url,
ST_ENCODING,
ST_DELIM_START_CHAR,
ST_DELIM_STOP_CHAR);
sourceGenGroup.setListener(new ReporterDiagnosticListe... | java |
public void process(Element elem, GenerateEmbeddedDSL annotation,
Elements elementUtils, Types typeUtils, Filer filer, Reporter reporter) throws IOException {
if(!ElementUtils.checkElementKind(elem, ElementKind.CLASS, ElementKind.INTERFACE)) {
throw new IllegalArgumentException("Annotation " + GenerateEmbedd... | java |
public static boolean isPermissionGranted(@NonNull final Context context,
@NonNull final String permission) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
Condition.INSTANCE.ensureNotNull(permission, "The permission may not be nu... | java |
public static boolean areAllPermissionsGranted(@NonNull final Context context,
@NonNull final String... permissions) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
Condition.INSTANCE.ensureNotNull(permissions, "The array may... | java |
@NonNull
public static String[] getNotGrantedPermissions(@NonNull final Context context,
@NonNull final String... permissions) {
Condition.INSTANCE.ensureNotNull(permissions, "The array may not be null");
Collection<String> notGrantedPermissions = ... | java |
private List<O> findByDate(String dateField, Date start, Date end, int numObjects, boolean asc) {
if (start == null)
start = new Date(0);
if (end == null)
end = new Date();
return getDatastore().find(clazz).filter(dateField + " >", start).filter(dateField + " <", end).ord... | java |
public List<O> createdInPeriod(Date start, Date end, int numObjects) {
return findByDate("creationDate", start, end, numObjects, true);
} | java |
public List<Similarity> similar(Image object, double threshold) {
//return getDatastore().find(Similarity.class).field("firstObject").equal(object).order("similarityScore").asList();
Query<Similarity> q = getDatastore().createQuery(Similarity.class);
q.or(
q.criteria("firstObject... | java |
public void createZookeeperBase() throws WorkerDaoException {
createPersistentEmptyNodeIfNotExist(BASE_ZK);
createPersistentEmptyNodeIfNotExist(WORKERS_ZK);
createPersistentEmptyNodeIfNotExist(PLANS_ZK);
createPersistentEmptyNodeIfNotExist(SAVED_ZK);
createPersistentEmptyNodeIfNotExist(LOCKS_ZK);
... | java |
public List<String> findWorkersWorkingOnPlan(Plan plan) throws WorkerDaoException{
try {
Stat exists = framework.getCuratorFramework().checkExists().forPath(PLAN_WORKERS_ZK + "/" + plan.getName());
if (exists == null ){
return new ArrayList<String>();
}
return framework.getCuratorFra... | java |
public Plan findPlanByName(String name) throws WorkerDaoException {
Stat planStat;
byte[] planBytes;
try {
planStat = framework.getCuratorFramework().checkExists().forPath(PLANS_ZK + "/" + name);
if (planStat == null) {
return null;
}
planBytes = framework.getCuratorFramework... | java |
public void createOrUpdatePlan(Plan plan) throws WorkerDaoException {
try {
createZookeeperBase();
Stat s = this.framework.getCuratorFramework().checkExists().forPath(PLANS_ZK + "/" + plan.getName());
if (s != null) {
framework.getCuratorFramework().setData().withVersion(s.getVersion())
... | java |
public void createEphemeralNodeForDaemon(TeknekDaemon d) throws WorkerDaoException {
try {
byte [] hostbytes = d.getHostname().getBytes(ENCODING);
framework.getCuratorFramework().create()
.withMode(CreateMode.EPHEMERAL).withACL(Ids.OPEN_ACL_UNSAFE).forPath(WORKERS_ZK + "/" + d.getMyId(),
... | java |
public List<WorkerStatus> findAllWorkerStatusForPlan(Plan plan, List<String> otherWorkers) throws WorkerDaoException{
List<WorkerStatus> results = new ArrayList<WorkerStatus>();
try {
Stat preCheck = framework.getCuratorFramework().checkExists().forPath(PLAN_WORKERS_ZK + "/" + plan.getName());
if (p... | java |
public void registerWorkerStatus(ZooKeeper zk, Plan plan, WorkerStatus s) throws WorkerDaoException{
String writeToPath = PLAN_WORKERS_ZK + "/" + plan.getName() + "/" + s.getWorkerUuid();
try {
Stat planBase = zk.exists(PLAN_WORKERS_ZK + "/" + plan.getName(), false);
if (planBase == null){
t... | java |
public void deletePlan(Plan p) throws WorkerDaoException {
String planNode = PLANS_ZK + "/" + p.getName();
try {
Stat s = framework.getCuratorFramework().checkExists().forPath(planNode);
framework.getCuratorFramework().delete().withVersion(s.getVersion()).forPath(planNode);
} catch (Exception e)... | java |
public static int indexOf(@NonNull final boolean[] array, final boolean value) {
Condition.INSTANCE.ensureNotNull(array, "The array may not be null");
for (int i = 0; i < array.length; i++) {
if (array[i] == value) {
return i;
}
}
return -1;
} | java |
protected final void addUnusedView(@NonNull final View view, final int viewType) {
if (useCache) {
if (unusedViews == null) {
unusedViews = new SparseArray<>(adapter.getViewTypeCount());
}
Queue<View> queue = unusedViews.get(viewType);
if (queue ... | java |
@Nullable
protected final View pollUnusedView(final int viewType) {
if (useCache && unusedViews != null) {
Queue<View> queue = unusedViews.get(viewType);
if (queue != null) {
return queue.poll();
}
}
return null;
} | java |
@Nullable
public final View getView(@NonNull final ItemType item) {
Condition.INSTANCE.ensureNotNull(item, "The item may not be null");
return activeViews.get(item);
} | java |
public final void clearCache() {
if (unusedViews != null) {
unusedViews.clear();
unusedViews = null;
}
logger.logDebug(getClass(), "Removed all unused views from cache");
} | java |
public final void clearCache(final int viewType) {
if (unusedViews != null) {
unusedViews.remove(viewType);
}
logger.logDebug(getClass(),
"Removed all unused views of view type " + viewType + " from cache");
} | java |
public void init(){
try {
zk = new ZooKeeper(parent.getProperties().get(TeknekDaemon.ZK_SERVER_LIST).toString(), 30000, this);
} catch (IOException e1) {
throw new RuntimeException(e1);
}
Feed feed = DriverFactory.buildFeed(plan.getFeedDesc());
List<WorkerStatus> workerStatus;
try {
... | java |
private void shutdown(){
parent.workerThreads.get(plan).remove(this);
if (zk != null) {
try {
logger.debug("closing " + zk.getSessionId());
zk.close();
zk = null;
} catch (InterruptedException e1) {
logger.debug(e1);
}
logger.debug("shutdown complete");
... | java |
@Nonnull
public String getDescription (final Locale aContentLocale)
{
final String ret = m_eCountry == null ? null : m_eCountry.getDisplayText (aContentLocale);
return ret != null ? ret : "undefined";
} | java |
private static RDFNode toNode(Object value) {
if (value == null) {
return null;
} else if (value instanceof RDFNode) {
return (RDFNode) value;
} else if (value instanceof IRI) {
return new NamedNodeImpl(URI.create(((IRI)value).iri.toString()));
} else if (value instanceof PlainLiteral)... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.