空指针异常将决不会被完全根除。
Null-pointer exceptions will never be completely eradicated.
它的目的是避免使用空子符串调用Web服务而出现空指针异常。
This code is included in the code which handles the click event for the Invoke Service button and its purpose is to avoid a null pointer exception when the web service is invoked with an empty string.
在许多空指针异常中,真正的错误出现在变量被赋为空值的地方。
In many null-pointer exceptions, the true bug occurs where the variable is actually assigned to null.
因为空指针异常更难诊断,这种“修正”实际上会降低代码的质量。
Because null-pointer exceptions are more difficult to diagnose, this "fix" would actually decrease the quality of the code.
系统级错误包括语法错误、空指针异常、web服务超时、数据库连接超时等。
The system level error includes syntactical error, null pointer exception, web service timeout, database connection timeout, and so on.
相反,在运行时发出的错误将会是一个空指针异常而不是类强制转换异常。
Instead, the error signaled at run time would be a null-pointer exception instead of a class-cast exception.
我们将探讨的第一个关于空指针异常的错误类型,是一个我称之为悬挂复合类型的错误类型。
The first bug pattern relating to null-pointer exceptions that we'll explore is one that I call the Dangling Composite pattern.
Sun的JSFRI期望,在组件没有渲染器的时候,渲染器会发送一个空指针异常。
Sun's JSF RI expects a renderer will send a null pointer exception if your component doesn't have a renderer.
不幸的是,自动控制理论告诉我们,没有工具可以静态地决定哪些程序将抛出空指针异常。
Unfortunately, automata theory tells us that no tool could ever statically determine which programs will throw null-pointer exceptions.
例如,不像一个类转型异常,空指针异常不给出它所需要的内容的任何信息,只有一个空指针。
Unlike, for example, a class-cast exception, a null-pointer exception says nothing about what was expected instead of the null pointer.
在下一个部分,我们将还要注视另外一个非常普遍的,也被证明是一个空指针异常的错误类型,以及怎样识别它和避免它。
In the next installment, we'll take a look at yet another very common bug pattern that manifests itself as a null-pointer exception, how to recognize it, and how to avoid it.
与可怕的空指针异常(该异常除了报告空指针之外,对于将要发生的事情什么也不说)不同,类强制转换异常相对来说容易调试。
Unlike the dreaded null-pointer exception (which says nothing about what was expected to occur instead of the null pointer), a class-cast exception is relatively easy to debug.
清单8列出了jfs_mount . c文件的源代码中被修改过的代码,我们在代码中创建了一个空指针异常,从而使代码在第109行产生段错误。
Listing 8 lists the code that was modified in the source of the jfs_mount.c file to create a segmentation fault at line 109 by creating a null pointer exception.
另外,任何阻断我们的链表以及忽略检查空例的代码将返回一个NoSuchElementException,而不是那些没什么用的空指针异常。
Additionally, any code that traverses our lists and forgets to check for the empty case will get a NoSuchElementException, as opposed to the much-less-helpful null-pointer exception.
这并不是说某些规则(如格式设置规则)不重要,而是应该将它们与其他问题进行比较权衡,例如空指针或处理不当的异常。
That is not to say that some rules, like formatting rules, are not important, just that they should be weighed in comparison to other issues, such as null Pointers or mishandled exceptions.
未检查异常作为运行时exception类是理想的异常侯选处理不可恢复性出错,如资源不可用或者空指针。
Unchecked exceptions which are descendents of RuntimeException class are the ideal candidate exceptions handle non-recoverable errors such as resource non-availability or some null Pointers.
通过指针映射集和故障模型,可以自动检测内存释放异常、内存泄露和空指针引用等动态内存故障,提高了测试效率。
Through pointer mapping sets and fault model, it can detect bad deallocation, memory leak and null pointer dereference faults automatically and increase the testing efficiency.
通过指针映射集和故障模型,可以自动检测内存释放异常、内存泄露和空指针引用等动态内存故障,提高了测试效率。
Through pointer mapping sets and fault model, it can detect bad deallocation, memory leak and null pointer dereference faults automatically and increase the testing efficiency.
应用推荐