code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private static void logToken(final Level logLevel, final String msgPrefix, final UserGroupInformation user) {
if (LOG.isLoggable(logLevel)) {
LOG.log(logLevel, "{0} number of tokens: [{1}].",
new Object[] {msgPrefix, user.getCredentials().numberOfTokens()});
for (final org.apache.hadoop.securi... | java |
private void writeDriverHttpEndPoint(final File driverFolder,
final String applicationId,
final Path dfsPath) throws IOException {
final FileSystem fs = FileSystem.get(yarnConfiguration);
final Path httpEndpointPath = new Path(dfsPat... | java |
@Override
public void start(final VortexThreadPool vortexThreadPool) {
final Vector<Integer> inputVector = new Vector<>();
for (int i = 0; i < dimension; i++) {
inputVector.add(i);
}
final List<VortexFuture<Integer>> futures = new ArrayList<>();
final AddOneFunction addOneFunction = new Add... | java |
public static int getTotalPhysicalMemorySizeInMB() {
int memorySizeInMB;
try {
long memorySizeInBytes = ((com.sun.management.OperatingSystemMXBean) ManagementFactory
.getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
memorySizeInMB = (int) (memorySizeInBytes / BYTES_IN_... | java |
public void submitContextAndTaskString(final String evaluatorConfigurationString,
final String contextConfigurationString,
final String taskConfigurationString) {
final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:s... | java |
public void submitContextString(final String evaluatorConfigurationString,
final String contextConfigurationString) {
if (evaluatorConfigurationString.isEmpty()) {
throw new RuntimeException("empty evaluatorConfigurationString provided.");
}
if (contextConfigurationSt... | java |
public void submitContextAndServiceString(final String evaluatorConfigurationString,
final String contextConfigurationString,
final String serviceConfigurationString) {
if (evaluatorConfigurationString.isEmpty()) {
throw n... | java |
public void submitContextAndServiceAndTaskString(
final String evaluatorConfigurationString,
final String contextConfigurationString,
final String serviceConfigurationString,
final String taskConfigurationString) {
if (evaluatorConfigurationString.isEmpty()) {
throw new RuntimeExceptio... | java |
public String getEvaluatorDescriptorString() {
final String descriptorString =
Utilities.getEvaluatorDescriptorString(jallocatedEvaluator.getEvaluatorDescriptor());
LOG.log(Level.INFO, "allocated evaluator - serialized evaluator descriptor: " + descriptorString);
return descriptorString;
} | java |
public static String getGraphvizString(
final InjectionPlan<?> injectionPlan, final boolean showLegend) {
final GraphvizInjectionPlanVisitor visitor = new GraphvizInjectionPlanVisitor(showLegend);
Walk.preorder(visitor, visitor, injectionPlan);
return visitor.toString();
} | java |
@Override
public boolean visit(final Constructor<?> node) {
this.graphStr
.append(" \"")
.append(node.getClass())
.append('_')
.append(node.getNode().getName())
.append("\" [label=\"")
.append(node.getNode().getName())
.append("\", shape=box];\n");
retu... | java |
@Override
public boolean visit(final JavaInstance<?> node) {
this.graphStr
.append(" \"")
.append(node.getClass())
.append('_')
.append(node.getNode().getName())
.append("\" [label=\"")
.append(node.getNode().getName())
.append(" = ")
.append(node.g... | java |
@Override
public boolean visit(final InjectionPlan<?> nodeFrom, final InjectionPlan<?> nodeTo) {
this.graphStr
.append(" \"")
.append(nodeFrom.getClass())
.append('_')
.append(nodeFrom.getNode().getName())
.append("\" -> \"")
.append(nodeTo.getClass())
.app... | java |
public static void main(final String[] args) {
LOG.log(Level.INFO, "Entering Launch at :::" + new Date());
try {
if (args == null || args.length == 0) {
throw new IllegalArgumentException("No arguments provided, at least a clrFolder should be supplied.");
}
final File dotNetFolder = ne... | java |
public static String getIdentifier(final Configuration c) {
try {
return Tang.Factory.getTang().newInjector(c).getNamedInstance(
ContextIdentifier.class);
} catch (final InjectionException e) {
throw new RuntimeException("Unable to determine context identifier. Giving up.", e);
}
} | java |
private void log(final String message) {
if (this.optionalParams.isPresent()) {
logger.log(logLevel, message, params);
} else {
logger.log(logLevel, message);
}
} | java |
String getWhereTaskletWasScheduledTo(final int taskletId) {
for (final Map.Entry<String, VortexWorkerManager> entry : runningWorkers.entrySet()) {
final String workerId = entry.getKey();
final VortexWorkerManager vortexWorkerManager = entry.getValue();
if (vortexWorkerManager.containsTasklet(taskl... | java |
public static void logThreads(
final Logger logger, final Level level, final String prefix,
final String threadPrefix, final String stackElementPrefix) {
if (logger.isLoggable(level)) {
logger.log(level, getFormattedThreadList(prefix, threadPrefix, stackElementPrefix));
}
} | java |
public static String getFormattedThreadList(
final String prefix, final String threadPrefix, final String stackElementPrefix) {
// Sort by thread name
final TreeMap<String, StackTraceElement[]> threadNames = new TreeMap<>();
for (final Map.Entry<Thread, StackTraceElement[]> entry : Thread.getAllStack... | java |
public static String getFormattedDeadlockInfo(
final String prefix, final String threadPrefix, final String stackElementPrefix) {
final StringBuilder message = new StringBuilder(prefix);
final DeadlockInfo deadlockInfo = new DeadlockInfo();
final ThreadInfo[] deadlockedThreads = deadlockInfo.getDead... | java |
void parseOneFile(final Path inputPath, final Writer outputWriter) throws IOException {
try (final TFile.Reader.Scanner scanner = this.getScanner(inputPath)) {
while (!scanner.atEnd()) {
new LogFileEntry(scanner.entry()).write(outputWriter);
scanner.advance();
}
}
} | java |
void parseOneFile(final Path inputPath, final File outputFolder) throws IOException {
try (final TFile.Reader.Scanner scanner = this.getScanner(inputPath)) {
while (!scanner.atEnd()) {
new LogFileEntry(scanner.entry()).write(outputFolder);
scanner.advance();
}
}
} | java |
@Override
public byte[] encode(final NSMessage<T> obj) {
if (isStreamingCodec) {
final StreamingCodec<T> streamingCodec = (StreamingCodec<T>) codec;
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
try (DataOutputStream daos = new DataOutputStream(baos)) {
daos.writeU... | java |
@Override
public NSMessage<T> decode(final byte[] buf) {
if (isStreamingCodec) {
final StreamingCodec<T> streamingCodec = (StreamingCodec<T>) codec;
try (ByteArrayInputStream bais = new ByteArrayInputStream(buf)) {
try (DataInputStream dais = new DataInputStream(bais)) {
final Identi... | java |
@SuppressWarnings("checkstyle:illegalcatch")
public void beforeTaskStart() throws TaskStartHandlerFailure {
LOG.log(Level.FINEST, "Sending TaskStart event to the registered event handlers.");
for (final EventHandler<TaskStart> startHandler : this.taskStartHandlers) {
try {
startHandler.onNext(th... | java |
@SuppressWarnings("checkstyle:illegalcatch")
public void afterTaskExit() throws TaskStopHandlerFailure {
LOG.log(Level.FINEST, "Sending TaskStop event to the registered event handlers.");
for (final EventHandler<TaskStop> stopHandler : this.taskStopHandlers) {
try {
stopHandler.onNext(this.taskS... | java |
@Override
public void write(final T message) {
LOG.log(Level.FINEST, "write {0} :: {1}", new Object[] {channel, message});
final ChannelFuture future = channel.writeAndFlush(Unpooled.wrappedBuffer(encoder.encode(message)));
if (listener != null) {
future.addListener(new NettyChannelFutureListener<>... | java |
private static Configuration readConfigurationFromDisk(
final String configPath, final ConfigurationSerializer serializer) {
LOG.log(Level.FINER, "Loading configuration file: {0}", configPath);
final File evaluatorConfigFile = new File(configPath);
if (!evaluatorConfigFile.exists()) {
thr... | java |
synchronized ResourceRequestEvent satisfyOne() {
final ResourceRequest req = this.requestQueue.element();
req.satisfyOne();
if (req.isSatisfied()) {
this.requestQueue.poll();
}
return req.getRequestProto();
} | java |
public void serialize(final ByteArrayOutputStream outputStream,
final SpecificRecord message, final long sequence) throws IOException {
// Binary encoder for both the header and message.
final BinaryEncoder encoder = EncoderFactory.get().binaryEncoder(outputStream, null);
// Write th... | java |
private synchronized void onJobFailure(final JobStatusProto jobStatusProto) {
assert jobStatusProto.getState() == ReefServiceProtos.State.FAILED;
final String id = this.jobId;
final Optional<byte[]> data = jobStatusProto.hasException() ?
Optional.of(jobStatusProto.getException().toByteArray()) :
... | java |
@Override
public synchronized Set<String> recoverEvaluators() {
final Set<String> expectedContainers = new HashSet<>();
try {
if (this.fileSystem == null || this.changeLogLocation == null) {
LOG.log(Level.WARNING, "Unable to recover evaluators due to failure to instantiate FileSystem. Returning ... | java |
@Override
public synchronized void recordAllocatedEvaluator(final String id) {
if (this.fileSystem != null && this.changeLogLocation != null) {
final String entry = ADD_FLAG + id + System.lineSeparator();
this.logContainerChange(entry);
}
} | java |
@Override
public synchronized void recordRemovedEvaluator(final String id) {
if (this.fileSystem != null && this.changeLogLocation != null) {
final String entry = REMOVE_FLAG + id + System.lineSeparator();
this.logContainerChange(entry);
}
} | java |
@Override
public synchronized void close() throws Exception {
if (this.readerWriter != null && !this.writerClosed) {
this.readerWriter.close();
this.writerClosed = true;
}
} | java |
private void onCleanExit(final String processId) {
this.onResourceStatus(
ResourceStatusEventImpl.newBuilder()
.setIdentifier(processId)
.setState(State.DONE)
.setExitCode(0)
.build()
);
} | java |
private void onUncleanExit(final String processId, final int exitCode) {
this.onResourceStatus(
ResourceStatusEventImpl.newBuilder()
.setIdentifier(processId)
.setState(State.FAILED)
.setExitCode(exitCode)
.build()
);
} | java |
@SuppressWarnings("checkstyle:illegalCatch")
public Throwable dispatch(final StopTime stopTime) {
try {
for (final EventHandler<StopTime> handler : stopHandlers) {
handler.onNext(stopTime);
}
return null;
} catch (Throwable t) {
return t;
}
} | java |
@Override
public void launchTask(final ExecutorDriver driver, final TaskInfo task) {
driver.sendStatusUpdate(TaskStatus.newBuilder()
.setTaskId(TaskID.newBuilder().setValue(this.mesosExecutorId).build())
.setState(TaskState.TASK_STARTING)
.setSlaveId(task.getSlaveId())
.setMessage(... | java |
public static void main(final String[] args) throws Exception {
final Injector injector = Tang.Factory.getTang().newInjector(parseCommandLine(args));
final REEFExecutor reefExecutor = injector.getInstance(REEFExecutor.class);
reefExecutor.onStart();
} | java |
void addTokensFromFile(final UserGroupInformation ugi) throws IOException {
LOG.log(Level.FINE, "Reading security tokens from file: {0}", this.securityTokensFile);
try (final FileInputStream stream = new FileInputStream(securityTokensFile)) {
final BinaryDecoder decoder = decoderFactory.binaryDecoder(str... | java |
LocalResource makeLocalResourceForJarFile(final Path path) throws IOException {
final LocalResource localResource = Records.newRecord(LocalResource.class);
final FileStatus status = FileContext.getFileContext(this.fileSystem.getUri()).getFileStatus(path);
localResource.setType(LocalResourceType.ARCHIVE);
... | java |
public static ArrayList<String> getFilteredLinesFromFile(final String fileName,
final String filter,
final String removeBeforeToken,
final Stri... | java |
public static ArrayList<String> getFilteredLinesFromFile(final String fileName, final String filter)
throws IOException {
return getFilteredLinesFromFile(fileName, filter, null, null);
} | java |
public static ArrayList<String> findStages(final ArrayList<String> lines, final String[] stageIndicators) {
final ArrayList<String> stages = new ArrayList<>();
int i = 0;
for (final String line: lines) {
if (line.contains(stageIndicators[i])){
stages.add(stageIndicators[i]);
if (i < s... | java |
public static void runHelloReefWithoutClient(final Configuration runtimeConf) throws InjectionException {
final REEF reef = Tang.Factory.getTang().newInjector(runtimeConf).getInstance(REEF.class);
final Configuration driverConf = getDriverConfiguration();
reef.submit(driverConf);
} | java |
@Override
@SuppressWarnings("checkstyle:hiddenfield")
public void resourceOffers(final SchedulerDriver driver, final List<Protos.Offer> offers) {
final Map<String, NodeDescriptorEventImpl.Builder> nodeDescriptorEvents = new HashMap<>();
for (final Offer offer : offers) {
if (nodeDescriptorEvents.get(... | java |
public YarnSubmissionHelper addLocalResource(final String resourceName, final LocalResource resource) {
resources.put(resourceName, resource);
return this;
} | java |
public YarnSubmissionHelper setPreserveEvaluators(final boolean preserveEvaluators) {
if (preserveEvaluators) {
// when supported, set KeepContainersAcrossApplicationAttempts to be true
// so that when driver (AM) crashes, evaluators will still be running and we can recover later.
if (YarnTypes.is... | java |
public YarnSubmissionHelper setJobSubmissionEnvMap(final Map<String, String> map) {
for (final Map.Entry<String, String> entry : map.entrySet()) {
environmentVariablesMap.put(entry.getKey(), entry.getValue());
}
return this;
} | java |
public YarnSubmissionHelper setJobSubmissionEnvVariable(final String key, final String value) {
environmentVariablesMap.put(key, value);
return this;
} | java |
@Override
public void onException(final Throwable cause, final SocketAddress remoteAddress, final T message) {
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "Error sending message " + message + " to " + remoteAddress, cause);
}
} | java |
static YarnClusterSubmissionFromCS fromJobSubmissionParametersFile(final File yarnClusterAppSubmissionParametersFile,
final File yarnClusterJobSubmissionParametersFile)
throws IOException {
try (final FileInputStream appFileInputStream = new... | java |
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int measuredWidth = MeasureSpec.getSize(widthMeasureSpec);
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int measuredHeight = MeasureSpec.getSize(heightMeasureSpec);
int heightMode = MeasureSpec.g... | java |
private void setItem(int index, int value) {
if (index == HOUR_INDEX) {
setValueForItem(HOUR_INDEX, value);
int hourDegrees = (value % 12) * HOUR_VALUE_TO_DEGREES_STEP_SIZE;
mHourRadialSelectorView.setSelection(hourDegrees, isHourInnerCircle(value), false);
mHourR... | java |
public void setCurrentItemShowing(int index, boolean animate) {
if (index != HOUR_INDEX && index != MINUTE_INDEX) {
Log.e(TAG, "TimePicker does not support view at index " + index);
return;
}
int lastIndex = getCurrentItemShowing();
mCurrentItemShowing = index;
... | java |
public final void attach(T object, IAddon parent) {
if (mObject != null || object == null || mParent != null || parent == null) {
throw new IllegalStateException();
}
mParent = parent;
onAttach(mObject = object);
} | java |
public void setFocusedItem(T item) {
final int itemId = getIdForItem(item);
if (itemId == INVALID_ID) {
return;
}
performAction(itemId, AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS, null);
} | java |
public void clearFocusedItem() {
final int itemId = mFocusedItemId;
if (itemId == INVALID_ID) {
return;
}
performAction(itemId, AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS, null);
} | java |
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public boolean sendEventForItem(T item, int eventType) {
if (!mManager.isEnabled() || Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return false;
}
final AccessibilityEvent event = getEventForItem(item, event... | java |
void drawDivider(Canvas canvas, Rect bounds, int childIndex) {
final Drawable divider = getDivider();
divider.setBounds(bounds);
divider.draw(canvas);
} | java |
@SuppressLint("InlinedApi")
private static Object[] parseFontStyle(Context context, AttributeSet attrs, int defStyleAttr) {
final TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.TextAppearance, defStyleAttr, 0);
final Object[] result = parseFontStyle(a);
a.re... | java |
private void removeItemAtInt(int index, boolean updateChildrenOnMenuViews) {
if ((index < 0) || (index >= mItems.size())) {
return;
}
mItems.remove(index);
if (updateChildrenOnMenuViews) {
onItemsChanged(true);
}
} | java |
public void updateMenuView(boolean cleared) {
final ViewGroup parent = (ViewGroup) mMenuView;
if (parent == null) {
return;
}
int childIndex = 0;
if (mMenu != null) {
mMenu.flagActionItems();
ArrayList<MenuItemImpl> visibleItems = mMenu.getVis... | java |
private void updateProgressBars(int value) {
ProgressBar circularProgressBar = getCircularProgressBar();
ProgressBar horizontalProgressBar = getHorizontalProgressBar();
if (value == Window.PROGRESS_VISIBILITY_ON) {
if (mFeatureProgress) {
int level = horizontalProgre... | java |
public CalendarDay getDayFromLocation(float x, float y) {
int dayStart = mPadding;
if (x < dayStart || x > mWidth - mPadding) {
return null;
}
// Selection is (x - start) / (pixels/day) == (x -s) * day / pixels
int row = (int) (y - MONTH_HEADER_SIZE) / mRowHeight;
... | java |
private Drawable getDrawable(Uri uri) {
try {
String scheme = uri.getScheme();
if (ContentResolver.SCHEME_ANDROID_RESOURCE.equals(scheme)) {
// Load drawables through Resources, to get the source density information
try {
return getDraw... | java |
private Drawable getDefaultIcon1(Cursor cursor) {
// Check the component that gave us the suggestion
Drawable drawable = getActivityIconWithCache(mSearchable.getSearchActivity());
if (drawable != null) {
return drawable;
}
// Fall back to a default icon
retur... | java |
public ResolveInfo getDefaultActivity() {
synchronized (mInstanceLock) {
ensureConsistentState();
if (!mActivities.isEmpty()) {
return mActivities.get(0).resolveInfo;
}
}
return null;
} | java |
public void setDefaultActivity(int index) {
synchronized (mInstanceLock) {
ensureConsistentState();
ActivityResolveInfo newDefaultActivity = mActivities.get(index);
ActivityResolveInfo oldDefaultActivity = mActivities.get(0);
final float weight;
if (... | java |
public void setActivitySorter(ActivitySorter activitySorter) {
synchronized (mInstanceLock) {
if (mActivitySorter == activitySorter) {
return;
}
mActivitySorter = activitySorter;
if (sortActivitiesIfNeeded()) {
notifyChanged();
... | java |
private boolean sortActivitiesIfNeeded() {
if (mActivitySorter != null && mIntent != null
&& !mActivities.isEmpty() && !mHistoricalRecords.isEmpty()) {
mActivitySorter.sort(mIntent, mActivities,
Collections.unmodifiableList(mHistoricalRecords));
return... | java |
private boolean loadActivitiesIfNeeded() {
if (mReloadActivities && mIntent != null) {
mReloadActivities = false;
mActivities.clear();
List<ResolveInfo> resolveInfos = mContext.getPackageManager()
.queryIntentActivities(mIntent, 0);
final int r... | java |
private boolean readHistoricalDataIfNeeded() {
if (mCanReadHistoricalData && mHistoricalRecordsChanged &&
!TextUtils.isEmpty(mHistoryFileName)) {
mCanReadHistoricalData = false;
mReadShareHistoryCalled = true;
readHistoricalDataImpl();
return true;... | java |
private void pruneExcessiveHistoricalRecordsIfNeeded() {
final int pruneCount = mHistoricalRecords.size() - mHistoryMaxSize;
if (pruneCount <= 0) {
return;
}
mHistoricalRecordsChanged = true;
for (int i = 0; i < pruneCount; i++) {
HistoricalRecord prunedRe... | java |
private void readHistoricalDataImpl() {
FileInputStream fis = null;
try {
fis = mContext.openFileInput(mHistoryFileName);
} catch (FileNotFoundException fnfe) {
if (DEBUG) {
Log.i(LOG_TAG, "Could not open historical records file: " + mHistoryFileName);
... | java |
public static void applyTheme(Activity activity, boolean force) {
if (force || ThemeManager.hasSpecifiedTheme(activity)) {
activity.setTheme(ThemeManager.getTheme(activity));
}
} | java |
public static void cloneTheme(Intent sourceIntent, Intent intent,
boolean force) {
final boolean hasSourceTheme = hasSpecifiedTheme(sourceIntent);
if (force || hasSourceTheme) {
intent.putExtra(_THEME_TAG, hasSourceTheme ? getTheme(sourceIntent)
... | java |
public static void setDefaultTheme(int theme) {
ThemeManager._DEFAULT_THEME = theme;
if (theme < _START_RESOURCES_ID) {
ThemeManager._DEFAULT_THEME &= ThemeManager._THEME_MASK;
}
} | java |
public static int getTheme(Intent intent, boolean applyModifier) {
return prepareFlags(intent.getIntExtra(ThemeManager._THEME_TAG,
ThemeManager._DEFAULT_THEME), applyModifier);
} | java |
public static int getThemeResource(int themeTag, boolean applyModifier) {
if (themeTag >= _START_RESOURCES_ID) {
return themeTag;
}
themeTag = prepareFlags(themeTag, applyModifier);
if (ThemeManager.sThemeGetters != null) {
int getterResource;
final Th... | java |
public static void modifyDefaultThemeClear(int mod) {
mod &= ThemeManager._THEME_MASK;
ThemeManager._DEFAULT_THEME |= mod;
ThemeManager._DEFAULT_THEME ^= mod;
} | java |
public static void reset() {
if ((_DEFAULT_THEME & COLOR_SCHEME_MASK) == 0) {
_DEFAULT_THEME = DARK;
}
_THEME_MODIFIER = 0;
_THEMES_MAP.clear();
map(DARK,
Holo_Theme);
map(DARK | FULLSCREEN,
Holo_Theme_Fullscreen);
map(... | java |
public boolean onSupportNavigateUp() {
Intent upIntent = getSupportParentActivityIntent();
if (upIntent != null) {
if (supportShouldUpRecreateTask(upIntent)) {
TaskStackBuilder b = TaskStackBuilder.create(this);
onCreateSupportNavigateUpTaskStack(b);
... | java |
private void updateSearchAutoComplete() {
mQueryTextView.setThreshold(mSearchable.getSuggestThreshold());
mQueryTextView.setImeOptions(mSearchable.getImeOptions());
int inputType = mSearchable.getInputType();
// We only touch this if the input type is set up for text (which it almost cer... | java |
private void setQuery(CharSequence query) {
mQueryTextView.setText(query);
// Move the cursor to the end
mQueryTextView.setSelection(TextUtils.isEmpty(query) ? 0 : query.length());
} | java |
private void parseMenu(XmlPullParser parser, AttributeSet attrs, Menu menu)
throws XmlPullParserException, IOException {
MenuState menuState = new MenuState(menu);
int eventType = parser.getEventType();
String tagName;
boolean lookingForEndOfUnknownTag = false;
Strin... | java |
private void tryStartingKbMode(int keyCode) {
if (mTimePicker.trySettingInputEnabled(false) &&
(keyCode == -1 || addKeyIfLegal(keyCode))) {
mInKbMode = true;
mDoneButton.setEnabled(false);
updateDisplay(false);
}
} | java |
private void finishKbMode(boolean updateDisplays) {
mInKbMode = false;
if (!mTypedTimes.isEmpty()) {
int values[] = getEnteredTime(null);
mTimePicker.setTime(values[0], values[1]);
if (!mIs24HourMode) {
mTimePicker.setAmOrPm(values[2]);
}
... | java |
private int[] getEnteredTime(Boolean[] enteredZeros) {
int amOrPm = -1;
int startIndex = 1;
if (!mIs24HourMode && isTypedTimeFullyLegal()) {
int keyCode = mTypedTimes.get(mTypedTimes.size() - 1);
if (keyCode == getAmOrPmKeyCode(AM)) {
amOrPm = AM;
... | java |
private int getAmOrPmKeyCode(int amOrPm) {
// Cache the codes.
if (mAmKeyCode == -1 || mPmKeyCode == -1) {
// Find the first character in the AM/PM text that is unique.
KeyCharacterMap kcm = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);
char amChar;
... | java |
public void show(IBinder windowToken) {
// Many references to mMenu, create local reference
final MenuBuilder menu = mMenu;
// Get the builder for the dialog
final AlertDialog.Builder builder = new AlertDialog.Builder(menu.getContext());
mPresenter = new ListMenuPresenter(build... | java |
@Override
public void onScroll(
AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
SimpleMonthView child = (SimpleMonthView) view.getChildAt(0);
if (child == null) {
return;
}
// Figure out where we are
long currScroll... | java |
public int getMostVisiblePosition() {
final int firstPosition = getFirstVisiblePosition();
final int height = getHeight();
int maxDisplayedHeight = 0;
int mostVisibleIndex = 0;
int i = 0;
int bottom = 0;
while (bottom < height) {
View child = getChild... | java |
public ArticleAttachments createUploadArticle(long articleId, File file) throws IOException {
return createUploadArticle(articleId, file, false);
} | java |
@NotNull
@ApiModelProperty(required = true, value = "Key-value pairs to add as custom property into alert. You can refer here for example values")
public Map<String, String> getDetails() {
return details;
} | java |
@Deprecated
public Map serialize() throws OpsGenieClientValidationException {
validate();
try {
return JsonUtils.toMap(this);
} catch (Exception e) {
e.printStackTrace();
}
return null;
} | java |
public void fromJson(String json) throws IOException, ParseException {
JsonUtils.fromJson(this, json);
this.json = json;
} | java |
public void setApiKey(String apiKey) {
if (this.jsonHttpClient != null) {
this.jsonHttpClient.setApiKey(apiKey);
}
if (this.restApiClient != null) {
this.restApiClient.setApiKey(apiKey);
}
if (this.swaggerApiClient != null) {
ApiKeyAuth... | java |
public SuccessResponse deleteAlert(DeleteAlertRequest params) throws ApiException {
String identifier = params.getIdentifier();
String identifierType = params.getIdentifierType().getValue();
String source = params.getSource();
String user = params.getUser();
Object localVarPostBody = null;
//... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.