title: Using static variables inside Cascading
body: <p>When I start my MapReduce job I save the current timestamp as a <code>Date</code> object in a static variable of my main class.</p>
  
  <p>Later when I want to read the value from a different class (such as my custom Cascading Filter or Cascading Function class) the job crashes with a  <code>java.lang.NullPointerException</code> according to Driven.</p>
  
  <p>Is it not possible to access a static variable within the Cascading logic? I have no idea why this doesn't work. The <code>Date</code> variable is definitely not null as I print it to console when the job is launched and afterwards it is not touched by any logic.</p>
  
  <p>This is the class that throws the error. If I create a new <code>Date</code> (with the current time) within the operate() method everything works fine.</p>
  
  <pre><code>public class TimestampAppender extends BaseOperation implements Function {
  
  public TimestampAppender(Fields fieldDeclaration) {
      super(Fields.ARGS);
  }
  
  public void operate(FlowProcess flowProcess, FunctionCall functionCall) {
  
      TupleEntry argument = functionCall.getArguments();
  
      Date timestamp = Main.timeFrameMiddle;
      String arg0 = argument.getString(0);
      String arg1 = argument.getString(1);
  
      Tuple result = new Tuple();
      result.addString(arg0);
      result.addString(arg1);
      result.addLong(timestamp.getTime());
  
      functionCall.getOutputCollector().add(result);
    }
  }
  </code></pre>