congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NoSuchElementException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
java.util.NoSuchElementException

Best Java code snippets using java.util.NoSuchElementException.getMessage (Showing top 20 results out of 810)

origin: stagemonitor/stagemonitor

public static Integer getMajorVersion(String version) {
  if (version != null) {
    StringTokenizer stringTokenizer = new StringTokenizer(version, ".");
    try {
      Integer majorVersion = Integer.valueOf(stringTokenizer.nextToken());
      logger.debug(String.format("Parsed version: %s, got major version: %d ", version, majorVersion));
      return majorVersion;
    } catch (NumberFormatException nfe) {
      logger.error(nfe.getMessage(), nfe);
    } catch (NoSuchElementException nsee) {
      logger.error(nsee.getMessage(), nsee);
    }
  }
  return null;
}
origin: apache/hive

throw new EOFException(e.getMessage());
origin: Sable/soot

/**
 * {@inheritDoc}
 *
 */
@Override
final public boolean contains(Object o) {
 if (o == null) {
  return false;
 }
 try {
  if (o.equals(peek())) {
   return true;
  }
  return contains(getOrdinal(o));
 } catch (NoSuchElementException e) {
  logger.debug("" + e.getMessage());
 }
 return false;
}
origin: Sable/soot

/**
 * {@inheritDoc}
 *
 */
@Override
final public boolean remove(Object o) {
 if (o == null || isEmpty()) {
  return false;
 }
 try {
  if (o.equals(peek())) {
   remove(min);
   return true;
  }
  return remove(getOrdinal(o));
 } catch (NoSuchElementException e) {
  logger.debug("" + e.getMessage());
 }
 return false;
}
origin: apache/hbase

public void testAdvanceTwiceOnEmptyCell() throws IOException {
 Result r = Result.create(new Cell[0]);
 assertFalse(r.advance());
 try {
  r.advance();
  fail("NoSuchElementException should have been thrown!");
 } catch (NoSuchElementException ex) {
  LOG.debug("As expected: " + ex.getMessage());
 }
}
origin: DV8FromTheWorld/JDA

public void createOverridesPass(AbstractChannelImpl<?> channel, JSONArray overrides)
{
  for (int i = 0; i < overrides.length(); i++)
  {
    try
    {
      createPermissionOverride(overrides.getJSONObject(i), channel);
    }
    catch (NoSuchElementException e)
    {
      //Caused by Discord not properly clearing PermissionOverrides when a Member leaves a Guild.
      LOG.debug("{}. Ignoring PermissionOverride.", e.getMessage());
    }
    catch (IllegalArgumentException e)
    {
      //Missing handling for a type
      LOG.warn("{}. Ignoring PermissionOverride.", e.getMessage());
    }
  }
}
origin: OfficeDev/ews-java-api

 throw new DnsException("NumberFormatException " + ne.getMessage());
} catch (NoSuchElementException ne) {
 throw new DnsException("NoSuchElementException " + ne.getMessage());
origin: geotools/geotools

  LOGGER.log(
      Level.WARNING,
      "Out of connections: " + e.getMessage() + ". Config: " + this.config);
  throw new UnavailableConnectionException(config.getMaxConnections(), this.config);
} catch (SeException se) {
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int available)
{
  query.setFetchSize(fetchSize);
  int counter = 0;
  Iterator<PersonRDBMS> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize == null || available < fetchSize ? available : fetchSize);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
}
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int available)
{
  query.setFetchSize(fetchSize);
  int counter = 0;
  Iterator<PersonMongo> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize == null || available < fetchSize ? available : fetchSize);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
}
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int available)
{
  query.setFetchSize(fetchSize);
  int counter=0;
  Iterator<CassandraPrimeUser> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize == null || available < fetchSize?available:fetchSize);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
}
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int available)
{
  query.setFetchSize(fetchSize);
  int counter = 0;
  Iterator<PersonHBase> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize == null || available < fetchSize ? available : fetchSize);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
}
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int available)
{
  query.setFetchSize(fetchSize);
  int counter=0;
  Iterator<PrimeUser> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize != null && fetchSize == 0 ? 0:available);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
}
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int expectedCount)
{
  query.setFetchSize(fetchSize);
  int counter = 0;
  Iterator<PersonCouchDB> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize == null || expectedCount < fetchSize ? expectedCount : fetchSize);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
}
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int available)
{
  query.setFetchSize(fetchSize);
  int counter=0;
  try
  {
  Iterator<PersonCassandra> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize != null && fetchSize == 0 ? 0:available);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
  }catch(UnsupportedOperationException e)
  { 
    Assert.assertEquals("Iteration not supported over native queries",e.getMessage());
  }
  
}
origin: Impetus/Kundera

private void assertOnFetch(Query query, Integer fetchSize, int available)
{
  query.setFetchSize(fetchSize);
  int counter=0;
  try
  {
  Iterator<PersonCassandra> iter = query.iterate();
  while (iter.hasNext())
  {
    Assert.assertNotNull(iter.next());
    counter++;
  }
  Assert.assertEquals(counter, fetchSize == null || available < fetchSize?available:fetchSize);
  try
  {
    iter.next();
    Assert.fail();
  }
  catch (NoSuchElementException nsex)
  {
    Assert.assertNotNull(nsex.getMessage());
  }
  }catch(UnsupportedOperationException e)
  { 
    Assert.assertEquals("Iteration not supported over native queries",e.getMessage());
  }
  
}
origin: Impetus/Kundera

Assert.assertNotNull(nsex.getMessage());
origin: jclouds/legacy-jclouds

@Test
public void testDidntFindNetworkThrowsNSEEWithReasonableMessage() {
 Supplier<Set<? extends Location>> supplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
    .<Location> of(provider, region));
 FirstNetwork fn = new FirstNetwork(supplier);
 try {
   fn.get();
   fail("Expected NoSuchElementException");
 } catch (NoSuchElementException e) {
   assertEquals(e.getMessage(), "none of the locations are scope NETWORK: [servo:PROVIDER, servo-r:REGION]");
 }
}
origin: jclouds/legacy-jclouds

@Test
public void testDidntFindRegionThrowsNSEEWithReasonableMessage() {
 Supplier<Set<? extends Location>> supplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
    .<Location> of(provider, zone));
 FirstRegion fn = new FirstRegion(supplier);
 try {
   fn.get();
   fail("Expected NoSuchElementException");
 } catch (NoSuchElementException e) {
   assertEquals(e.getMessage(), "none to of the locations are scope REGION: [servo:PROVIDER, servo-z:ZONE]");
 }
}
origin: org.apache.hbase/hbase-server

public void testAdvanceTwiceOnEmptyCell() throws IOException {
 Result r = Result.create(new Cell[0]);
 assertFalse(r.advance());
 try {
  r.advance();
  fail("NoSuchElementException should have been thrown!");
 } catch (NoSuchElementException ex) {
  LOG.debug("As expected: " + ex.getMessage());
 }
}
java.utilNoSuchElementExceptiongetMessage

Popular methods of NoSuchElementException

  • <init>
    Constructs a NoSuchElementException, saving a reference to the error message string s for later retr
  • initCause
  • printStackTrace
  • toString
  • getLocalizedMessage
  • getCause
  • getStackTrace
  • setStackTrace
  • addSuppressed

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now