@Test public void testSetLocation() { String className = "clazz"; String method = "method"; String fileName = "file.java"; int lineNumber = 42; Frame frame = new Frame(className, method, fileName, lineNumber); assertThat(frame.getClassName(), equalTo(className)); assertThat(frame.getMethodName(), equalTo(method)); assertThat(frame.getFileName(), equalTo(fileName)); assertThat(frame.getLineNumber(), equalTo(lineNumber)); assertThat(frame.isUnknown(), is(false)); assertThat(frame.isNative(), is(false)); frame.setLocation(null, Frame.IS_UNKNOWN); assertThat(frame.getClassName(), equalTo(className)); assertThat(frame.getMethodName(), equalTo(method)); assertThat(frame.getFileName(), nullValue()); assertThat(frame.getLineNumber(), equalTo(Frame.IS_UNKNOWN)); assertThat(frame.isUnknown(), is(true)); assertThat(frame.isNative(), is(false)); frame.setLocation(null, Frame.IS_NATIVE); assertThat(frame.getClassName(), equalTo(className)); assertThat(frame.getMethodName(), equalTo(method)); assertThat(frame.getFileName(), nullValue()); assertThat(frame.getLineNumber(), equalTo(Frame.IS_NATIVE)); assertThat(frame.isUnknown(), is(false)); assertThat(frame.isNative(), is(true)); }
public void setLocation(String fileName, int lineNumber) throws IllegalArgumentException { checkArgument(!(lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE) || (fileName == null), "If line number " + "is IS_UNKNOWN or IS_NATIVE, then fileName must be null!"); checkArgument(!(fileName == null) || (lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE), "If fileName is " + "null, then line number should be IS_UNKNOWN or IS_NATIVE!"); this.fileName = fileName; this.lineNumber = lineNumber; }
Frame { public void setLocation(String fileName, int lineNumber) throws IllegalArgumentException { checkArgument(!(lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE) || (fileName == null), "If line number " + "is IS_UNKNOWN or IS_NATIVE, then fileName must be null!"); checkArgument(!(fileName == null) || (lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE), "If fileName is " + "null, then line number should be IS_UNKNOWN or IS_NATIVE!"); this.fileName = fileName; this.lineNumber = lineNumber; } }
Frame { public void setLocation(String fileName, int lineNumber) throws IllegalArgumentException { checkArgument(!(lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE) || (fileName == null), "If line number " + "is IS_UNKNOWN or IS_NATIVE, then fileName must be null!"); checkArgument(!(fileName == null) || (lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE), "If fileName is " + "null, then line number should be IS_UNKNOWN or IS_NATIVE!"); this.fileName = fileName; this.lineNumber = lineNumber; } Frame(String className, String methodName);  Frame(String className, String methodName, String fileName, int lineNumber); }
Frame { public void setLocation(String fileName, int lineNumber) throws IllegalArgumentException { checkArgument(!(lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE) || (fileName == null), "If line number " + "is IS_UNKNOWN or IS_NATIVE, then fileName must be null!"); checkArgument(!(fileName == null) || (lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE), "If fileName is " + "null, then line number should be IS_UNKNOWN or IS_NATIVE!"); this.fileName = fileName; this.lineNumber = lineNumber; } Frame(String className, String methodName);  Frame(String className, String methodName, String fileName, int lineNumber); String getClassName(); void setClassName(String className); String getMethodName(); void setMethodName(String methodName); String getFileName(); int getLineNumber(); void setLocation(String fileName, int lineNumber); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); boolean isNative(); boolean isUnknown(); }
Frame { public void setLocation(String fileName, int lineNumber) throws IllegalArgumentException { checkArgument(!(lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE) || (fileName == null), "If line number " + "is IS_UNKNOWN or IS_NATIVE, then fileName must be null!"); checkArgument(!(fileName == null) || (lineNumber == IS_UNKNOWN || lineNumber == IS_NATIVE), "If fileName is " + "null, then line number should be IS_UNKNOWN or IS_NATIVE!"); this.fileName = fileName; this.lineNumber = lineNumber; } Frame(String className, String methodName);  Frame(String className, String methodName, String fileName, int lineNumber); String getClassName(); void setClassName(String className); String getMethodName(); void setMethodName(String methodName); String getFileName(); int getLineNumber(); void setLocation(String fileName, int lineNumber); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); boolean isNative(); boolean isUnknown(); static final int IS_NATIVE; static final int IS_UNKNOWN; }