Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8662579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:46:02+00:00 2026-06-12T16:46:02+00:00

Today, the current Guava version seems to be: release is 13.0.1, August 3, 2012.

  • 0

Today, the current Guava version seems to be:

release is 13.0.1, August 3, 2012.

but I checked out the source off of:

git clone https://code.google.com/p/guava-libraries/

and got intrigued by what seems like an extremely useful testing tool to me:

http://code.google.com/p/guava-libraries/source/browse/guava-testlib/src/com/google/common/testing/NullPointerTester.java

I am trying to verify that all of my methods detest null just as much as Doug Lea ( http://gee.cs.oswego.edu/dl/html/vita.html ) seems to do, unless Joshua Bloch misquotes him ( http://www.youtube.com/watch?v=ZeO_J2OcHYM#t=26m35s ) in being “null-hostile”.

Anyway, NullPointerTester.java seems to be just perfect so I am trying to build it into my project.

Following the dependencies (NullPointerTester -> Invokable<?, ?>, -> … for example) is tedious as I run into classes that are @since 14.0, basically belong to a future version.

What’s the best way to build a self-contained JAR of the next/future version of Guava, with all dependencies being taken care of for me? Note: the sources seem to be “all” on git…


You can stop reading here.

I can’t wait to be doing stuff like this, which is really cool I think:

  • http://www.massapi.com/class/nu/NullPointerTester.html

Note: what’s missing are “security checks”, as in “if the constructor has been made private, check that I cannot reflect-invoke it anyway…

If I were a better coder I’d contribute, but this is all I can do and it’s very poor, although the intent should be clear?

static boolean isDefaultConstructorDisabled(Class<?> type) {
  boolean isDefaultConstructorDisabled = false;
  Constructor<?>[] declaredConstructors = type.getDeclaredConstructors();
  Constructor<?> defaultContructor = declaredConstructors[0];
  defaultContructor.setAccessible(true);
  try {
    defaultContructor.newInstance();
  } catch (InvocationTargetException invocationTargetException) {
    Throwable cause = invocationTargetException.getCause();
    if (cause instanceof UnsupportedOperationException
        && cause.getMessage().contains(
            ErrorMessage.DefaultConstructor.DISABLED)) {
      isDefaultConstructorDisabled = true;
    }
  } catch (Throwable throwable) {
    throwable.printStackTrace();
  }
  return isDefaultConstructorDisabled;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:46:04+00:00Added an answer on June 12, 2026 at 4:46 pm

    If you cloned the whole Guava repository, then the v13.0.1 tag will have guava-testlib, and specifically NullPointerTester, as of 13.0.1, which should work — no?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today Microsoft released Windows 8 Release Preview and visual studio 2012 rc. I'm a
I try to get started with selenium (downloaded the current version today) and copied
I need to print out the current date in the following format : Today
Today, I was working on a WPF UserControl to display the current value of
Today I generated a webservice client with CXF 2.6.1 (latest version), using the tool
today I have a (simple) rendering problem for you. My current project gets datas
Is it possible to display the current date (today's) in JSF without using a
Today I updated MinGW and rebuilt my current C++-project. I've logged timing-info since using
My Current Distribution Certificate expired today. That means both my AdHoc and AppStore provisioning
I am attempting to find 'entries' create today (in my current timezone) using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.