зеркало из https://github.com/mozilla/pjs.git
bug=41977
Insert parameter checks for all webclient methods.
This commit is contained in:
Родитель
48b0204c9f
Коммит
919c4db6b8
|
@ -137,6 +137,7 @@ void delete()
|
|||
|
||||
static void appInitialize(String verifiedBinDirAbsolutePath) throws Exception
|
||||
{
|
||||
ParameterCheck.nonNull(verifiedBinDirAbsolutePath);
|
||||
if (null == wrapperFactory) {
|
||||
wrapperFactory = createWrapperFactory();
|
||||
}
|
||||
|
@ -283,7 +284,7 @@ public static void main(String [] args)
|
|||
Assert.setEnabled(true);
|
||||
Log.setApplicationName("BrowserControlImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: BrowserControlImpl.java,v 1.2 2000-03-13 18:41:46 edburns%acm.org Exp $");
|
||||
Log.setApplicationVersionDate("$Id: BrowserControlImpl.java,v 1.3 2000-07-22 02:48:23 edburns%acm.org Exp $");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ public void delete()
|
|||
public void addBookmark(BookmarkEntry mayBeNullParent,
|
||||
BookmarkEntry bookmark)
|
||||
{
|
||||
ParameterCheck.nonNull(bookmark);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
|
||||
if (!(bookmark instanceof BookmarkEntryImpl)) {
|
||||
|
@ -160,6 +161,7 @@ public TreeModel getBookmarks() throws IllegalStateException
|
|||
|
||||
public void removeBookmark(BookmarkEntry bookmark)
|
||||
{
|
||||
ParameterCheck.nonNull(bookmark);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
|
||||
|
@ -183,6 +185,7 @@ public BookmarkEntry newBookmarkEntry(String url)
|
|||
|
||||
public BookmarkEntry newBookmarkFolder(String name)
|
||||
{
|
||||
ParameterCheck.nonNull(name);
|
||||
BookmarkEntry result = null;
|
||||
getBookmarks();
|
||||
int newNode;
|
||||
|
@ -222,7 +225,7 @@ public static void main(String [] args)
|
|||
|
||||
Log.setApplicationName("BookmarksImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: BookmarksImpl.java,v 1.4 2000-05-23 21:06:11 ashuk%eng.sun.com Exp $");
|
||||
Log.setApplicationVersionDate("$Id: BookmarksImpl.java,v 1.5 2000-07-22 02:48:25 edburns%acm.org Exp $");
|
||||
|
||||
try {
|
||||
org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]);
|
||||
|
|
|
@ -100,6 +100,7 @@ public void copyCurrentSelectionToSystemClipboard()
|
|||
|
||||
public void findInPage(String stringToFind, boolean forward, boolean matchCase)
|
||||
{
|
||||
ParameterCheck.nonNull(stringToFind);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
|
||||
synchronized(myBrowserControl) {
|
||||
|
@ -260,7 +261,7 @@ public static void main(String [] args)
|
|||
Assert.setEnabled(true);
|
||||
Log.setApplicationName("CurrentPageImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: CurrentPageImpl.java,v 1.7 2000-06-30 00:01:35 ashuk%eng.sun.com Exp $");
|
||||
Log.setApplicationVersionDate("$Id: CurrentPageImpl.java,v 1.8 2000-07-22 02:48:25 edburns%acm.org Exp $");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -111,6 +111,7 @@ public void delete()
|
|||
|
||||
public void addDocumentLoadListener(DocumentLoadListener listener)
|
||||
{
|
||||
ParameterCheck.nonNull(listener);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
Assert.assert(null != nativeEventThread);
|
||||
|
@ -123,6 +124,7 @@ public void addDocumentLoadListener(DocumentLoadListener listener)
|
|||
|
||||
public void removeDocumentLoadListener(DocumentLoadListener listener)
|
||||
{
|
||||
ParameterCheck.nonNull(listener);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
|
||||
|
@ -134,6 +136,7 @@ public void removeDocumentLoadListener(DocumentLoadListener listener)
|
|||
|
||||
public void addMouseListener(MouseListener listener)
|
||||
{
|
||||
ParameterCheck.nonNull(listener);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
Assert.assert(null != nativeEventThread);
|
||||
|
@ -154,6 +157,7 @@ public void addMouseListener(MouseListener listener)
|
|||
|
||||
public void removeMouseListener(MouseListener listener)
|
||||
{
|
||||
ParameterCheck.nonNull(listener);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
|
||||
|
@ -175,7 +179,7 @@ public static void main(String [] args)
|
|||
|
||||
Log.setApplicationName("EventRegistrationImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: EventRegistrationImpl.java,v 1.6 2000-07-22 02:14:57 edburns%acm.org Exp $");
|
||||
Log.setApplicationVersionDate("$Id: EventRegistrationImpl.java,v 1.7 2000-07-22 02:48:25 edburns%acm.org Exp $");
|
||||
|
||||
try {
|
||||
org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]);
|
||||
|
|
|
@ -180,6 +180,7 @@ public HistoryEntry [] getHistory()
|
|||
|
||||
public HistoryEntry getHistoryEntry(int historyIndex)
|
||||
{
|
||||
ParameterCheck.noLessThan(historyIndex, 0);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
HistoryEntry result = null;
|
||||
|
@ -207,6 +208,7 @@ public int getCurrentHistoryIndex()
|
|||
|
||||
public void setCurrentHistoryIndex(int historyIndex)
|
||||
{
|
||||
ParameterCheck.noLessThan(historyIndex, 0);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
|
||||
|
@ -229,6 +231,7 @@ public int getHistoryLength()
|
|||
|
||||
public String getURLForIndex(int historyIndex)
|
||||
{
|
||||
ParameterCheck.noLessThan(historyIndex, 0);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
String result = null;
|
||||
|
@ -280,7 +283,7 @@ public static void main(String [] args)
|
|||
Assert.setEnabled(true);
|
||||
Log.setApplicationName("HistoryImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: HistoryImpl.java,v 1.3 2000-05-23 21:06:11 ashuk%eng.sun.com Exp $");
|
||||
Log.setApplicationVersionDate("$Id: HistoryImpl.java,v 1.4 2000-07-22 02:48:25 edburns%acm.org Exp $");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ public NavigationImpl(WrapperFactory yourFactory,
|
|||
|
||||
public void loadURL(String absoluteURL)
|
||||
{
|
||||
ParameterCheck.nonNull(absoluteURL);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
|
||||
|
@ -85,6 +86,7 @@ public void loadURL(String absoluteURL)
|
|||
|
||||
public void refresh(long loadFlags)
|
||||
{
|
||||
ParameterCheck.noLessThan(loadFlags, 0);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
|
||||
|
@ -125,7 +127,7 @@ public static void main(String [] args)
|
|||
|
||||
Log.setApplicationName("NavigationImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: NavigationImpl.java,v 1.2 2000-03-09 23:22:52 edburns%acm.org Exp $");
|
||||
Log.setApplicationVersionDate("$Id: NavigationImpl.java,v 1.3 2000-07-22 02:48:26 edburns%acm.org Exp $");
|
||||
|
||||
try {
|
||||
org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]);
|
||||
|
|
|
@ -103,6 +103,7 @@ NativeEventThread getNativeEventThread()
|
|||
|
||||
public void setBounds(Rectangle newBounds)
|
||||
{
|
||||
ParameterCheck.nonNull(newBounds);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
Assert.assert(-1 != nativeWebShell);
|
||||
|
||||
|
@ -114,6 +115,8 @@ public void setBounds(Rectangle newBounds)
|
|||
|
||||
public void createWindow(int nativeWindow, Rectangle bounds)
|
||||
{
|
||||
ParameterCheck.greaterThan(nativeWindow, 0);
|
||||
ParameterCheck.nonNull(bounds);
|
||||
myFactory.throwExceptionIfNotInitialized();
|
||||
|
||||
synchronized(myBrowserControl) {
|
||||
|
@ -242,7 +245,7 @@ public static void main(String [] args)
|
|||
|
||||
Log.setApplicationName("WindowControlImpl");
|
||||
Log.setApplicationVersion("0.0");
|
||||
Log.setApplicationVersionDate("$Id: WindowControlImpl.java,v 1.5 2000-07-07 18:49:08 edburns%acm.org Exp $");
|
||||
Log.setApplicationVersionDate("$Id: WindowControlImpl.java,v 1.6 2000-07-22 02:48:26 edburns%acm.org Exp $");
|
||||
|
||||
try {
|
||||
org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче