code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public static UserPermissionViewModel newViewModel(
final ApplicationFeatureId featureId, final ApplicationUser user, final ApplicationPermissionValueSet.Evaluation viewingEvaluation, final ApplicationPermissionValueSet.Evaluation changingEvaluation, final DomainObjectContainer container) {
return c... | java |
private List<AgigaCoref> parseCorefs(VTDNav vn) throws PilotException, NavException {
require (vn.matchElement(AgigaConstants.DOC));
List<AgigaCoref> agigaCorefs = new ArrayList<AgigaCoref>();
if (!vn.toElement(VTDNav.FIRST_CHILD, AgigaConstants.COREFERENCES)) {
// If there ... | java |
private String parseHeadline(VTDNav vn) throws NavException {
require (vn.matchElement(AgigaConstants.DOC));
if (!vn.toElement(VTDNav.FIRST_CHILD, AgigaConstants.HEADLINE) || vn.getText() == -1) {
// If there is no headline annotation return the empty list
log.finer("No h... | java |
public Level getEffectiveLevel() {
Level effectiveLevel = level;
if (effectiveLevel == null && !name.equals("")) {
if (commonLoggerRepository == null) {
throw new IllegalStateException("CommonLoggerRepository has not been set");
} else {
effective... | java |
public void setClientID(String clientID) {
if (clientID == null || clientID.isEmpty()) {
this.clientID = DEFAULT_CLIENT_ID;
return;
}
this.clientID = clientID;
} | java |
synchronized public void addAppender(Appender appender) throws IllegalArgumentException {
if (appender == null) {
throw new IllegalArgumentException("Appender not allowed to be null");
}
for (Appender p : appenderList) {
if (p.getClass() == appender.getClass())
... | java |
public void removeAppender(Appender appender) throws IllegalArgumentException {
if (appender == null) {
throw new IllegalArgumentException("The appender must not be null.");
}
if (appender.isLogOpen()) {
try {
appender.close();
} catch (IOExce... | java |
public void removeAllAppenders() {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender appender = ite.next();
if (appender != null && appender.isLogOpen()) {
try {
appender.close();
} catch... | java |
public Appender getAppender(int index) {
if (index < 0 || index >= appenderList.size())
return null;
return appenderList.get(index);
} | java |
public void log(Level level, Object message) throws IllegalArgumentException {
log(level, message, null);
} | java |
public void log(Level level, Object message, Throwable t) throws IllegalArgumentException {
if (level == null) {
throw new IllegalArgumentException("The level must not be null.");
}
if (getEffectiveLevel().toInt() <= level.toInt() && level.toInt() > Level.OFF_INT) {
if ... | java |
public synchronized void resetLogger() {
Logger.appenderList.clear();
Logger.stopWatch.stop();
Logger.stopWatch.reset();
Logger.firstLogEvent = true;
} | java |
void open() throws IOException {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender p = ite.next();
if (p != null) p.open();
}
} | java |
public void close() throws IOException {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender p = ite.next();
if (p != null)
p.close();
}
stopWatch.stop();
Logger.firstLogEvent = true;
} | java |
private void init(SSLContextImpl ctx) {
if (debug != null && Debug.isOn("ssl")) {
System.out.println("Using SSLEngineImpl.");
}
sslContext = ctx;
sess = SSLSessionImpl.nullSession;
handshakeSession = null;
/*
* State is cs_START until we initialize ... | java |
public SSLEngineResult unwrap(ByteBuffer netData, ByteBuffer [] appData,
int offset, int length) throws SSLException {
EngineArgs ea = new EngineArgs(netData, appData, offset, length);
try {
synchronized (unwrapLock) {
return readNetRecord(ea);
}
... | java |
public SSLEngineResult wrap(ByteBuffer [] appData,
int offset, int length, ByteBuffer netData) throws SSLException {
EngineArgs ea = new EngineArgs(appData, offset, length, netData);
/*
* We can be smarter about using smaller buffer sizes later.
* For now, force it to be ... | java |
private boolean checkSequenceNumber(MAC mac, byte type)
throws IOException {
/*
* Don't bother to check the sequence number for error or
* closed connections, or NULL MAC
*/
if (connectionState >= cs_ERROR || mac == MAC.NULL) {
return false;
}
... | java |
synchronized public void setEnableSessionCreation(boolean flag) {
enableSessionCreation = flag;
if ((handshaker != null) && !handshaker.activated()) {
handshaker.setEnableSessionCreation(enableSessionCreation);
}
} | java |
synchronized public void setUseClientMode(boolean flag) {
switch (connectionState) {
case cs_START:
/*
* If we need to change the engine mode and the enabled
* protocols haven't specifically been set by the user,
* change them to the corresponding defa... | java |
synchronized public SSLParameters getSSLParameters() {
SSLParameters params = super.getSSLParameters();
// the super implementation does not handle the following parameters
params.setEndpointIdentificationAlgorithm(identificationProtocol);
params.setAlgorithmConstraints(algorithmConstra... | java |
synchronized public void setSSLParameters(SSLParameters params) {
super.setSSLParameters(params);
// the super implementation does not handle the following parameters
identificationProtocol = params.getEndpointIdentificationAlgorithm();
algorithmConstraints = params.getAlgorithmConstrai... | java |
public Optional<JField> exceptionMessageField() {
String fieldName = getExceptionMessageFieldName();
return numericalOrderFields().stream()
.filter(f -> f.name().equals(fieldName) && f.type() == PType.STRING)
.findFirst();
} | java |
private String getAnnotationValue(String annotation) {
if (descriptor instanceof CAnnotatedDescriptor) {
if (((CAnnotatedDescriptor) descriptor).hasAnnotation(annotation)) {
return ((CAnnotatedDescriptor) descriptor).getAnnotationValue(annotation);
}
}
ret... | java |
public List<String> getRoleNames(final Optional<Subject> subjectOption)
{
final List<String> roleNames = new ArrayList<String>();
subjectOption.ifPresent(subject -> {
final List<? extends Role> roles = subject.getRoles();
if (roles != null)
{
... | java |
@Override
public void onDestroyView() {
mHandler.removeCallbacks(mRequestFocus);
mList = null;
mListShown = false;
mEmptyView = mProgressContainer = mListContainer = null;
mStandardEmptyView = null;
super.onDestroyView();
} | java |
public void setListAdapter(ListAdapter adapter) {
boolean hadAdapter = mAdapter != null;
mAdapter = adapter;
if (mList != null) {
mList.setAdapter(adapter);
if (!mListShown && !hadAdapter) {
// The list was hidden, and previously didn't have an
... | java |
public void setEmptyText(CharSequence text) {
ensureList();
if (mStandardEmptyView == null) {
throw new IllegalStateException("Can't be used with a custom content view");
}
mStandardEmptyView.setText(text);
if (mEmptyText == null) {
mList.setEmptyView(mSta... | java |
private void appendCreateMethod(List<CStructDescriptor> messages) {
writer.appendln("@Override")
.formatln("public %s create(int classId) {", Portable.class.getName())
.begin()
.appendln("switch(classId) {")
.begin();
for (CStructDescriptor message... | java |
private void appendPopulateMethod(List<CStructDescriptor> messages) {
writer.formatln("public static final %s populateConfig(%s %s, int %s) {",
Config.class.getName(),
Config.class.getName(),
CONFIG,
PORTABLE_VERSION... | java |
private void appendCollectionTypeField(JField field, PDescriptor descriptor) {
switch (descriptor.getType()) {
case BYTE:
case BINARY:
writer.formatln(".addByteArrayField(\"%s\")", field.name());
break;
case BOOL:
writer.formatl... | java |
protected boolean objectVisibleToUser(String objectTenancyPath, String userTenancyPath) {
// if in "same hierarchy"
return objectTenancyPath.startsWith(userTenancyPath) ||
userTenancyPath.startsWith(objectTenancyPath);
} | java |
@Nonnull
protected Throwable getResponseException(Throwable e) {
// Unwrap execution exceptions.
if (ExecutionException.class.isAssignableFrom(e.getClass())) {
return getResponseException(e.getCause());
}
return e;
} | java |
public static Key JOIN_PROMPT(String value, Voice voice) {
Map<String, String> map = new HashMap<String, String>();
map.put("value", value);
if (voice != null) {
map.put("voice", voice.toString());
}
return createKey("joinPrompt", map);
} | java |
@Programmatic
public List<ApplicationTenancy> findByNameOrPathMatchingCached(final String search) {
return queryResultsCache.execute(new Callable<List<ApplicationTenancy>>() {
@Override public List<ApplicationTenancy> call() throws Exception {
return findByNameOrPathMatching(sear... | java |
@Programmatic
public ApplicationTenancy findByPathCached(final String path) {
return queryResultsCache.execute(new Callable<ApplicationTenancy>() {
@Override
public ApplicationTenancy call() throws Exception {
return findByPath(path);
}
}, Applicat... | java |
@Programmatic
public ApplicationTenancy newTenancy(
final String name,
final String path,
final ApplicationTenancy parent) {
ApplicationTenancy tenancy = findByPath(path);
if (tenancy == null) {
tenancy = getApplicationTenancyFactory().newApplicationTe... | java |
@Programmatic
public List<ApplicationTenancy> allTenancies() {
return queryResultsCache.execute(new Callable<List<ApplicationTenancy>>() {
@Override
public List<ApplicationTenancy> call() throws Exception {
return allTenanciesNoCache();
}
}, Applic... | java |
public static <T extends Throwable> Matcher<T> isThrowable(Class<?> type) {
return IsThrowable.isThrowable(type);
} | java |
@Beta
public static <E extends Throwable> void check(boolean condition, E throwable) throws E {
checkArgument(throwable != null, "Expected non-null reference");
if (!condition) {
throw throwable;
}
} | java |
public RecursiveTypeRegistry getRegistryForProgramName(String programName) {
if (localProgramContext.equals(programName)) return this;
for (RecursiveTypeRegistry registry : includes.values()) {
if (registry.getLocalProgramContext().equals(programName)) {
return registry;
... | java |
public void registerInclude(String programName, RecursiveTypeRegistry registry) {
if (registry == this) {
throw new IllegalArgumentException("Registering include back to itself: " + programName);
}
if (includes.containsKey(programName)) {
return;
}
include... | java |
@WillCloseWhenClosed
public static void sleepFor(long timeout, TimeUnit unit) {
try {
unit.sleep(timeout);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} | java |
@WillNotClose
public static Optional<InterruptedException> uninterruptibleSleepFor(long timeout, TimeUnit unit) {
try {
unit.sleep(timeout);
return Optional.absent();
} catch (InterruptedException e) {
return Optional.of(e);
}
} | java |
public String getContentId() {
String[] values = getMimeHeader("Content-ID");
if (values != null && values.length > 0)
return values[0];
return null;
} | java |
public String getContentType() {
String[] values = getMimeHeader("Content-Type");
if (values != null && values.length > 0)
return values[0];
return null;
} | java |
protected String finalTypename(String typeName, String programContext) {
String qualifiedName = qualifiedTypenameInternal(typeName, programContext);
if (typedefs.containsKey(qualifiedName)) {
String resolved = typedefs.get(qualifiedName);
return finalTypename(resolved, programCo... | java |
protected static String qualifiedNameFromIdAndContext(String name, String context) {
if (!name.contains(".")) {
return context + "." + name;
}
return name;
} | java |
private void registerListType(PContainer containerType) {
PDescriptor itemType = containerType.itemDescriptor();
if (itemType.getType() == PType.MAP ||
itemType.getType() == PType.LIST ||
itemType.getType() == PType.SET) {
registerListType((PContainer) itemType);
... | java |
protected static <Message extends PMessage<Message, CField>>
String asString(Message message) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PRETTY_SERIALIZER.serialize(baos, message);
return new String(baos.toByteArray(), UTF_8);
} | java |
@SuppressWarnings("unchecked")
private static <T extends Comparable<T>> int compare(T o1, T o2) {
if (o1 instanceof PMessage && o2 instanceof PMessage) {
return compareMessages((PMessage) o1, (PMessage) o2);
}
return o1.compareTo(o2);
} | java |
public static <T, E extends RuntimeException> ExceptionSupplier<T, E> throwA(E exception) {
return new ExceptionSupplier<>(exception);
} | java |
public static <T, E extends RuntimeException> ExceptionSupplier<T, E> throwA(
@SuppressWarnings("UnusedParameters") Class<T> type, E exception) {
return new ExceptionSupplier<>(exception);
} | java |
private <Message extends PMessage<Message, Field>, Field extends PField>
Message parseMessage(ThriftTokenizer tokenizer,
PMessageDescriptor<Message, Field> type) throws IOException {
PMessageBuilder<Message, Field> builder = type.builder();
if (tokenizer.peek("checking for ... | java |
@Override
public List<FixtureResult> runFixtureScript(
final FixtureScript fixtureScript,
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
named = "Parameters",
describedAs = "Script-specific parameters (if any). The format depends... | java |
@Action(
semantics = SemanticsOf.NON_IDEMPOTENT,
restrictTo = RestrictTo.PROTOTYPING
)
@MemberOrder(sequence="20")
public Object installFixturesAndReturnFirstRole() {
final List<FixtureResult> fixtureResultList = findFixtureScriptFor(SecurityModuleAppSetUp.class).run(null);
... | java |
public JServiceMethod[] methods() {
List<CServiceMethod> methods = new ArrayList<>(service.getMethodsIncludingExtended());
CServiceMethod[] ma = methods.toArray(new CServiceMethod[methods.size()]);
JServiceMethod[] ret = new JServiceMethod[ma.length];
for (int i = 0; i < methods.size();... | java |
@Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes(UTF_8));
return DEBUG_STRING... | java |
@SuppressWarnings("unchecked")
@Nonnull
public static <T> Optional<T> optionalInMessage(PMessage message, PField... fields) {
if (fields == null || fields.length == 0) {
throw new IllegalArgumentException("No fields arguments.");
}
PField field = fields[0];
if (!messa... | java |
@javax.annotation.Nonnull
public java.util.Optional<String> optionalMessage() {
return java.util.Optional.ofNullable(mMessage);
} | java |
@javax.annotation.Nonnull
public java.util.Optional<net.morimekta.providence.PApplicationExceptionType> optionalId() {
return java.util.Optional.ofNullable(mId);
} | java |
public Collection<CServiceMethod> getMethodsIncludingExtended() {
CService extended = getExtendsService();
if (extended == null) {
return getMethods();
}
List<CServiceMethod> out = new ArrayList<>();
out.addAll(extended.getMethodsIncludingExtended());
out.addA... | java |
public static TestRule ignoreIfNotUnix() {
return (base, description) -> new Statement() {
@Override
public void evaluate() throws Throwable {
assumeIsUnix();
base.evaluate();
}
};
} | java |
private void appendPrimitive(JsonWriter writer, Object primitive) throws SerializerException {
if (primitive instanceof PEnumValue) {
if (IdType.ID.equals(enumValueType)) {
writer.value(((PEnumValue<?>) primitive).asInteger());
} else {
writer.valueUnescap... | java |
String getTimeFileName() {
SimpleDateFormat dateFormat = new SimpleDateFormat(wraper.formatter);
return dateFormat.format(Calendar.getInstance().getTime());
} | java |
@Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Stream<Message> stream(InputStream in,
Serializer serializer,
PMessageDescriptor<Message, Field> descriptor) {
return StreamSupport.stream(new MessageSpliterator<... | java |
public static <T, R> Function<T, ListenableFuture<R>> futureWith(final ListeningExecutorService executor,
final Function<T, R> task,
final FutureCallback<R> callback) {
check... | java |
public <Message extends PMessage<Message, Field>, Field extends PField>
void formatTo(OutputStream out, Message message) {
IndentedPrintWriter builder = new IndentedPrintWriter(out, indent, newline);
if (message == null) {
builder.append(null);
} else {
builder.append... | java |
public <Message extends PMessage<Message, Field>, Field extends PField>
String format(Message message) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
formatTo(out, message);
return new String(out.toByteArray(), StandardCharsets.UTF_8);
} | java |
public Key getKey(String alias, String password) {
try {
return keyStore.getKey(alias, password.toCharArray());
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | java |
public PrivateKey getPrivateKey(String alias, String password) {
Key key = getKey(alias, password);
if (key instanceof PrivateKey) {
return (PrivateKey) key;
} else {
throw new IllegalStateException(format("Key with alias '%s' was not a private key, but was: %s",
... | java |
public SecretKey getSecretKey(String alias, String password) {
Key key = getKey(alias, password);
if (key instanceof PrivateKey) {
return (SecretKey) key;
} else {
throw new IllegalStateException(format("Key with alias '%s' was not a secret key, but was: %s",
... | java |
public static String colorHeader() {
return Color.BOLD +
HEADER_L1 + "\n" +
new Color(Color.YELLOW, Color.UNDERLINE) +
HEADER_L2 + " " +
Color.CLEAR;
} | java |
private void appendFactoryId(JMessage<?> message) {
writer.appendln("@Override")
.appendln("public int getFactoryId() {")
.begin()
//TODO: The factory should be file unqiue. ID is struct unique so for id we want to define several constants.
// so for conte... | java |
private void appendClassId(JMessage<?> message) {
writer.appendln("@Override")
.appendln("public int getClassId() {")
.begin()
//TODO: Need to add method to create a constant for the description or struct here.
.formatln("return %s.%s;",
... | java |
private void appendPortableWriter(JMessage<?> message) {
writer.appendln("@Override")
.formatln("public void writePortable(%s %s) throws %s {",
PortableWriter.class.getName(),
PORTABLE_WRITER,
IOException.class.getName())
... | java |
private void appendPortableReader(JMessage<?> message) {
writer.appendln("@Override")
.formatln("public void readPortable(%s %s) throws %s {",
PortableReader.class.getName(),
PORTABLE_READER,
IOException.class.getName())
... | java |
@Programmatic
public ApplicationRole newRole(
final String name,
final String description) {
ApplicationRole role = findByName(name);
if (role == null){
role = getApplicationRoleFactory().newApplicationRole();
role.setName(name);
role.setDe... | java |
private void hangOut( final RequestCallInfo req, GenericJSO hangOut )
{
final int hangOutId = hangOut.getIntByIdx( 0 );
JsArrayString tmp = hangOut.getGenericJSOByIdx( 1 ).cast();
String name = tmp.get( 0 );
String type = tmp.get( 1 );
String title = tmp.get( 2 );
String description = tmp.get( 3 );
Java... | java |
private RPCBatchRequestSender getBatchRequestSender()
{
RPCBatchRequestSender sender = null;
// test the last sender we have in the list
if( !batchRequestSenders.isEmpty() )
{
sender = batchRequestSenders.get( batchRequestSenders.size() - 1 );
if( sender.canAddRequest() )
return sender;
}
// ot... | java |
private Set<ConstraintViolation<Object>> addViolations(
Set<ConstraintViolation<Object>> source,
Set<ConstraintViolation<Object>> target) {
if (supportsConstraintComposition) {
target.addAll(source);
return target;
}
for (final Iterator<Constraint... | java |
private void passViolations(ConstraintValidatorContext context,
Set<ConstraintViolation<Object>> source) {
for (final ConstraintViolation<Object> violation : source) {
final Iterator<Node> nodeIter = violation.getPropertyPath()
.iterator();
... | java |
private void editCell( Cell cell )
{
if( cell == null || cell == editedCell )
return;
T record = getRecordForRow( cell.getParentRow() );
if( record == null )
return;
registerCurrentEdition( cell, record );
} | java |
public static String toHawkularFormat(BasicMessage msg) {
return String.format("%s=%s", msg.getClass().getSimpleName(), msg.toJSON());
} | java |
public static <T extends BasicMessage> T fromJSON(String json, Class<T> clazz) {
try {
Method buildObjectMapperForDeserializationMethod = findBuildObjectMapperForDeserializationMethod(clazz);
final ObjectMapper mapper = (ObjectMapper) buildObjectMapperForDeserializationMethod.invoke(nul... | java |
public static <T extends BasicMessage> BasicMessageWithExtraData<T> fromJSON(InputStream in, Class<T> clazz) {
final T obj;
final byte[] remainder;
try (JsonParser parser = new JsonFactory().configure(Feature.AUTO_CLOSE_SOURCE, false).createParser(in)) {
Method buildObjectMapperForDe... | java |
protected static ObjectMapper buildObjectMapperForDeserialization() {
final ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return mapper;
} | java |
@Override
public String toJSON() {
final ObjectMapper mapper = buildObjectMapperForSerialization();
try {
return mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
throw new IllegalStateException("Object cannot be parsed as JSON.", e);
}
... | java |
@Override
public void onResponse( Object cookie, ResponseJSO response, int msgLevel, String msg )
{
PendingRequestInfo info = (PendingRequestInfo) cookie;
// Store answer in cache
if( info.fStoreResultInCache )
cache.put( info.requestKey, response );
// give the result to all the subscribees
for( Reque... | java |
public static boolean dumpDatabaseSchemaToFile( DatabaseContext ctx, File file )
{
log.info( "Dumping database schema to file " + file.getAbsolutePath() );
DatabaseDescriptionInspector inspector = new DatabaseDescriptionInspector();
DatabaseDescription dbDesc = inspector.getDatabaseDescription( ctx.db, ctx.dbh ... | java |
String getStatistics()
{
String msg = "PropertyChanges stats :\r\n"
+ "# registered handlers : " + nbRegisteredHandlers + "\r\n"
+ "# notifications : " + nbNotifications + "\r\n"
+ "# dispatches : " + nbDispatches + "\r\n";
StringBuilder details = new StringBuilder();
for( Entry<Str... | java |
public <T> T manageTransaction( DatabaseContext ctx, TransactionManagedAction<T> action )
{
ctx.db.startTransaction();
try
{
T result = action.execute( ctx );
ctx.db.commit();
return result;
}
catch( Exception exception )
{
ctx.db.rollback();
throw new ManagedTransactionException( "Except... | java |
public synchronized DatabaseContextFactory dbFactory( String databaseUri )
{
DatabaseContextFactory factory = new DatabaseContextFactory();
if( ! factory.init( databaseUri ) )
{
log.error( "Cannot initialize database connection pool, it won't be available to the program !" );
return null;
}
return f... | java |
public static Throwable getCause(Throwable e, Class<? extends Throwable>... causes) {
if ((e == null) || (causes == null) || (causes.length < 1)) {
return null;
} else if (isInstance(e, causes)) {
if (((e.getCause() == null) || (e.getCause()
.equals(e) ||... | java |
public static HttpMockServer start(ConfigReader configReader, NetworkType networkType) {
return HttpMockServer.startMockApiServer(configReader, networkType);
} | java |
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) {
BeanManager bm = getBeanManager();
Bean<?> bean = bm.getBeans(name).iterator().next();
CreationalContext<?> ctx = bm.createCreationalContext(bean);
return (T) bm.getReference(bean, bean.getBeanClass(), ctx);
... | java |
public int toInt()
{
int day = ((year + 1900) * 12 + month) * 31 + (date - 1);
if( day < TIME_BEGIN )
day = TIME_BEGIN;
else if( day > TIME_END )
day = TIME_END;
return day;
} | java |
public int indexOf( Widget w )
{
for( int i = 0; i < size; ++i )
{
if( array[i] == w )
{
return i;
}
}
return -1;
} | java |
public void insert( Shape w, int beforeIndex )
{
if( (beforeIndex < 0) || (beforeIndex > size) )
{
throw new IndexOutOfBoundsException();
}
// Realloc array if necessary (doubling).
if( size == array.length )
{
Shape[] newArray = new Shape[array.length * 2];
for( int i = 0; i < array.length; ++i ... | java |
public void remove( int index )
{
if( (index < 0) || (index >= size) )
{
throw new IndexOutOfBoundsException();
}
--size;
for( int i = index; i < size; ++i )
{
array[i] = array[i + 1];
}
array[size] = null;
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.