Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2011-12-19 14:53:30 +0000
committerMike Rennie2011-12-19 14:53:30 +0000
commitce86425aef2eed46429c175a17472fb1ff9a03da (patch)
tree5e5a6e7dec3e02394b4aebdb0d43b4560bbf0bda
parentaaddd477d5f5357e626b82ab76c1faaf5d3e49e3 (diff)
downloadeclipse.jdt.debug-ce86425aef2eed46429c175a17472fb1ff9a03da.tar.gz
eclipse.jdt.debug-ce86425aef2eed46429c175a17472fb1ff9a03da.tar.xz
eclipse.jdt.debug-ce86425aef2eed46429c175a17472fb1ff9a03da.zip
Bug 352479 - Investigate moving debug to Java 1.5 BREE
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/.classpath2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractJDITest.java5
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AccessibleTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayReferenceTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayTypeTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BooleanValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BreakpointRequestTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ByteValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/CharValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassLoaderReferenceTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventWaiter.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareRequestTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassTypeTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassesByNameTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ContendedMonitorTests.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/DoubleValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventReader.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestManagerTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionRequestTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FieldTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FileConsoleReader.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FloatValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ForceEarlyReturnTests.java8
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HeapWalkingTests.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HotCodeReplacementTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/IntegerValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/InterfaceTypeTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestCase.java4
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestSuite.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocalVariableTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocatableTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocationTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LongValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodEntryRequestTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodExitRequestTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodReturnValuesTests.java13
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MirrorTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ModificationWatchpointEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MonitorFrameInfoTests.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/NullConsoleReader.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ObjectReferenceTest.java4
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/PrimitiveValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ProvideArgumentsTests.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ReferenceTypeTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ShortValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/SourceNameFilterTests.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StackFrameTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StepEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StringReferenceTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TextTestResult.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadDeathEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadGroupReferenceTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadReferenceTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadStartEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeComponentTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeTest.java26
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventWaiter.java1
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisposeTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ValueTest.java2
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineExitTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineTest.java5
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointEventTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointRequestTest.java3
-rw-r--r--org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/program/MainClass.java1
-rw-r--r--org.eclipse.jdt.debug.tests/.classpath2
-rw-r--r--org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.core.prefs63
-rw-r--r--org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleEchoActionDelegate.java2
-rw-r--r--org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleMultipleStreamActionDelegate.java4
-rw-r--r--org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleOutputActionDelegate.java2
-rw-r--r--org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/TestShowConsoleActionDelegate.java2
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ContextView.java2
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementEventWaiter.java1
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventDetailWaiter.java1
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventWaiter.java1
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ExpressionWaiter.java1
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaAlernateModeTab.java3
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/NullVariableInitializer.java1
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/SpecificDebugElementEventWaiter.java1
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/TestClasspathContainerInitializer.java2
-rw-r--r--org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/detailpane/TableDetailPane.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugPerformanceTest.java2
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java5
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/DebugSuite.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/EvalTestSuite.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ManualSuite.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ProjectCreationDecorator.java1
-rw-r--r--[-rwxr-xr-x]org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointFieldLocator.java4
-rw-r--r--[-rwxr-xr-x]org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointMethodLocator.java3
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/JavaBreakpointListenerTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/MethodBreakpointTests15.java1
-rw-r--r--[-rwxr-xr-x]org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/PatternBreakpointTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java3
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleTests.java6
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaLibraryPathTests.java3
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LineTrackerTests.java6
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LiteralTests17.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/StringSubstitutionTests.java2
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/WatchExpressionTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ConfigurationEncodingTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchShortcutTests.java1
-rw-r--r--[-rwxr-xr-x]org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchesTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java6
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/refactoring/MemberParser.java2
-rw-r--r--[-rwxr-xr-x]org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/ArchiveSourceLookupTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceLookupTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java3
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLocationTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLookupTests.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/OpenFromClipboardTests.java4
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/ViewMangementTests.java2
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/performance/OpenLaunchConfigurationDialogTests.java2
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestAnonymousInspect.java1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestIntegerAccessUnboxing15.java1
-rw-r--r--org.eclipse.jdt.debug.ui/.classpath2
-rw-r--r--org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs34
-rw-r--r--org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaSourceLookupDialog.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaUISourceLocator.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/actions/JavaBreakpointPropertiesRulerActionDelegate.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java18
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AbstractVMInstallPage.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletArgumentsTab.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletMainTab.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java8
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaAppletLaunchShortcut.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaApplicationLaunchShortcut.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaArgumentsTab.java11
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaClasspathTab.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java9
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaMainTab.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaSourceLookupTab.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointChange.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMovePackageParticipant.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveParticipant.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveTypeParticipant.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameFieldParticipant.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameMethodParticipant.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenamePackageParticipant.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameParticipant.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameProjectParticipant.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameTypeParticipant.java7
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ClassPrepareBreakpointTypeChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/DeleteBreakpointChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ExceptionBreakpointTypeChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIJavaProjectRenameParticipant.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentMoveParticipant.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentRenameParticipant.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeMoveParticipant.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeRenameParticipant.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationProjectMainTypeChange.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointChange.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointTypeChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointMethodChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointTypeChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointFieldChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeChange.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeRenameChange.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ConditionalBreakpointErrorDialog.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/CreateStepFilterDialog.java7
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java7
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ErrorDialogWithToggle.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ExpressionInformationControlCreator.java11
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/Filter.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterLabelProvider.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterViewerComparator.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HeapWalkingPreferencePage.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HotCodeReplaceErrorDialog.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPlugin.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPreferenceInitializer.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIImageDescriptor.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDISourceViewer.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugOptionsManager.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugPreferencePage.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersManager.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersPreferencePage.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaLogicalStructuresPreferencePage.java10
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaPrimitivesPreferencePage.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaSourceLocationWorkbenchAdapterFactory.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaStepFilterPreferencePage.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/PackageSelectionDialog.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StorageEditorInput.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/TypeNameResolver.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddAdvancedAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalFolderAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalJarAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddFolderAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddJarAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddLibraryAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddPackageStepFilterAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddProjectAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddTypeStepFilterAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddVariableAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AttachSourceAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointHitCountAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointSuspendPolicyToggleAction.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ControlAccessibleListener.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/DisplayAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditClasspathEntryAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditStepFiltersAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditVariableLogicalStructureAction.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EntryToggleAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionCaughtToggleAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionUncaughtToggleAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExecuteAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExitToggleAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExpressionInputDialog.java19
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ForceReturnAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InspectAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InstanceFiltersAction.java7
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaBreakpointPropertiesRulerAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaPrimitiveValueEditor.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveDownAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveUpAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ObjectFilter.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeHierarchyAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDialogAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenFromClipboardAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeHierarchyAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenStackFrameAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenTypeAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeHierarchyAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeHierarchyAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableTypeAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupDisplayAction.java13
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupInspectAction.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ProjectSelectionDialog.java7
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RemoveAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RestoreDefaultEntriesAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RuntimeClasspathAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowMonitorThreadInformation.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowNullArrayEntriesAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowQualifiedAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStaticVariablesAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStratumAction.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowSystemThreadsAction.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowThreadGroups.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/StringValueInputDialog.java25
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBooleanPreferenceAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java10
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/WatchAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddClassPrepareBreakpointAction.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionTypeDialogExtension.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/CompositeBreakpointEditor.java11
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointEditor.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointEditor.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java10
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointEditor.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/BootpathFilter.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathEntry.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathGroup.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/DefaultClasspathEntryDialog.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/RuntimeClasspathViewer.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/AutoFormatSettingAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionConsoleTracker.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionHyperLink.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeConsoleTracker.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeStackTraceHyperlink.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsole.java14
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsolePage.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsoleViewer.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentFrameContext.java9
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentValueContext.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/DynamicTypeContext.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugCompletionProposalCollector.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayView.java9
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/InstanceCountActionDelegate.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/AddVMInstallWizard.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/BuildJREDescriptor.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EEVMPage.java8
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EditVMInstallWizard.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsLabelProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java13
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREContainerWizardPage.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsComboBlock.java7
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentComparator.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentLabelProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsLabelProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsPreferencePage.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryLabelProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryStandin.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMCommandTab.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMPage.java8
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMDetailsDialog.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMInstallWizard.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMLibraryBlock.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMTypePage.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AbstractJavaMainTab.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletSelectionDialog.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletWorkingDirectoryBlock.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/ArchiveFileFilter.java1
-rw-r--r--[-rwxr-xr-x]org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/DebugTypeSelectionDialog.java14
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/JavaWorkingDirectoryBlock.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/MainMethodSearchEngine.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/NameValuePairDialog.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/OpenPreferencePageResolution.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathAdvancedDialog.java7
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathEntryLabelProvider.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathViewer.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementLabelProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementQualifierProvider.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceLookupBlock.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ContendedMonitorContentProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaContendedMonitor.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaElementContentProvider.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwnedMonitor.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwningThread.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwnedMonitorContentProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwningThreadContentProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ThreadMonitorManager.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/WaitingThreadContentProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/ExceptionFilterEditor.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointAdvancedPage.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointPage.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaExceptionBreakpointAdvancedPage.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/VMCapabilitiesPropertyPage.java5
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetEditor.java15
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileCreationWizard.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileWizardPage.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ScrapbookSourcepathProvider.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsDialog.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ShowInPackageViewAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorActionContributor.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorPropertyPage.java6
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorStorageDocumentProvider.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenHierarchyOnSelectionAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenOnSelectionAction.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/StopAction.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathContainerSourceContainerBrowser.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathVariableSourceContainerBrowser.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaProjectSourceContainerBrowser.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/StackFrameShowInSourceAdapter.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetContentProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetProxy.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadEventHandler.java9
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupContentProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupLabelProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaExpressionContentProvider.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameContentProvider.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameLabelProvider.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameMementoProvider.java1
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableCellModifier.java9
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableColumnPresentation.java3
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableContentProvider.java4
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableEditor.java2
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableLabelProvider.java7
-rw-r--r--org.eclipse.jdt.debug/.classpath4
-rw-r--r--org.eclipse.jdt.debug/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.jdt.debug/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.jdt.debug/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/EvaluationManager.java48
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IAstEvaluationEngine.java259
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IClassFileEvaluationEngine.java108
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/ICompiledExpression.java34
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationEngine.java187
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationListener.java18
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationResult.java89
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/EvaluationResult.java100
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/LocalEvaluationEngine.java1174
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java581
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java2926
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java288
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ArrayRuntimeContext.java68
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/BinaryBasedSourceGenerator.java458
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java2
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java172
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/IRuntimeContext.java127
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java120
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/InterpreterVariable.java48
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/JavaObjectRuntimeContext.java27
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/RuntimeContext.java34
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SignatureExt.java35
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java1063
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndAssignmentOperator.java5
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndOperator.java34
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAccess.java48
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAllocation.java55
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInitializerInstruction.java23
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInstruction.java4
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AssignmentOperator.java55
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/BinaryOperator.java325
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Cast.java127
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/CompoundInstruction.java10
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ConditionalJump.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Constructor.java27
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideAssignmentOperator.java8
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideOperator.java59
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Dup.java21
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DupX1.java26
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/EqualEqualOperator.java81
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterEqualOperator.java45
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterOperator.java45
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java39
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Instruction.java234
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionSequence.java68
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionsEvaluationMessages.java3
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Jump.java8
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftAssignmentOperator.java6
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftOperator.java68
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessEqualOperator.java46
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessOperator.java45
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LocalVariableCreation.java70
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusAssignmentOperator.java6
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusOperator.java39
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyAssignmentOperator.java6
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyOperator.java39
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NoOp.java7
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NotOperator.java6
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrAssignmentOperator.java3
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrOperator.java34
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusAssignmentOperator.java3
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusOperator.java100
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Pop.java18
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixMinusMinusOperator.java57
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java57
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixMinusMinusOperator.java57
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixPlusPlusOperator.java57
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayLength.java18
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayType.java8
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushBoolean.java12
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushChar.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushClassLiteralValue.java8
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushDouble.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFieldVariable.java79
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFloat.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushInt.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLocalVariable.java50
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLong.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushNull.java10
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushPrimitiveType.java23
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java52
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushString.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushThis.java29
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushType.java21
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderAssignmentOperator.java6
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderOperator.java59
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ReturnInstruction.java9
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftAssignmentOperator.java6
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftOperator.java68
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RuntimeSignature.java451
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java57
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendStaticMessage.java55
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SimpleInstruction.java14
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ThrowInstruction.java3
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/TwiddleOperator.java24
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryMinusOperator.java36
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryOperator.java4
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryPlusOperator.java36
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftAssignmentOperator.java9
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftOperator.java68
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Value.java10
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XfixOperator.java5
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorAssignmentOperator.java3
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorOperator.java33
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/AbsentInformationException.java23
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Accessible.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayReference.java15
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanValue.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Bootstrap.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteValue.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharValue.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassLoaderReference.java11
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotLoadedException.java26
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotPreparedException.java21
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassObjectReference.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassType.java17
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleValue.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Field.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatValue.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IncompatibleThreadStateException.java21
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InconsistentDebugInfoException.java21
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerValue.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InterfaceType.java13
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InternalException.java34
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidCodeIndexException.java28
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidLineNumberException.java30
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidStackFrameException.java23
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidTypeException.java23
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvocationException.java21
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/JDIPermission.java18
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LocalVariable.java11
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Locatable.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Location.java19
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongValue.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Method.java27
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Mirror.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/MonitorInfo.java12
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/NativeMethodException.java23
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectCollectedException.java23
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectReference.java17
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PathSearchingVirtualMachine.java11
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveValue.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ReferenceType.java51
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortValue.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StackFrame.java15
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StringReference.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadGroupReference.java11
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadReference.java15
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Type.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/TypeComponent.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMCannotBeModifiedException.java19
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMDisconnectedException.java19
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMMismatchException.java23
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMOutOfMemoryException.java23
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Value.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachine.java33
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachineManager.java20
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidType.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidValue.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/AttachingConnector.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Connector.java31
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/IllegalConnectorArgumentsException.java33
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/LaunchingConnector.java10
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/ListeningConnector.java13
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Transport.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/TransportTimeoutException.java19
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/VMStartException.java25
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/ClosedConnectionException.java19
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/Connection.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/TransportService.java39
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/AccessWatchpointEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/BreakpointEvent.java5
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassPrepareEvent.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassUnloadEvent.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/Event.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventIterator.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventQueue.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventSet.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ExceptionEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/LocatableEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodEntryEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodExitEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ModificationWatchpointEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnterEvent.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnteredEvent.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitEvent.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitedEvent.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/StepEvent.java6
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadDeathEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadStartEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDeathEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDisconnectEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMStartEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/WatchpointEvent.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/AccessWatchpointRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/BreakpointRequest.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassPrepareRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassUnloadRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/DuplicateRequestException.java21
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequest.java16
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequestManager.java46
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ExceptionRequest.java9
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/InvalidRequestStateException.java19
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodEntryRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodExitRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ModificationWatchpointRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnterRequest.java10
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnteredRequest.java12
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitRequest.java12
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitedRequest.java12
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/StepRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadDeathRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadStartRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/VMDeathRequest.java8
-rw-r--r--org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/WatchpointRequest.java7
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/Bootstrap.java35
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/TimeoutException.java10
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/VirtualMachine.java11
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/EventRequestManager.java38
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/OperationRefusedException.java15
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReenterStepRequest.java73
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReferenceType.java75
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ThreadReference.java91
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/VirtualMachine.java182
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/AccessibleImpl.java89
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayReferenceImpl.java337
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayTypeImpl.java187
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanTypeImpl.java19
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanValueImpl.java38
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteTypeImpl.java21
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteValueImpl.java38
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharTypeImpl.java18
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharValueImpl.java27
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassLoaderReferenceImpl.java57
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassObjectReferenceImpl.java32
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassTypeImpl.java325
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleTypeImpl.java16
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleValueImpl.java27
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FieldImpl.java112
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatTypeImpl.java16
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatValueImpl.java27
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/GenericSignature.java95
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerTypeImpl.java16
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerValueImpl.java30
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/InterfaceTypeImpl.java112
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocalVariableImpl.java151
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocationImpl.java103
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongTypeImpl.java16
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongValueImpl.java27
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MethodImpl.java536
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MirrorImpl.java348
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MonitorInfoImpl.java13
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java470
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveTypeImpl.java78
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveValueImpl.java175
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ReferenceTypeImpl.java1715
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortTypeImpl.java18
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortValueImpl.java27
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/SourceDebugExtensionParser.java495
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StackFrameImpl.java175
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StringReferenceImpl.java32
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadGroupReferenceImpl.java117
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadReferenceImpl.java505
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeComponentImpl.java55
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeImpl.java314
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueCache.java84
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueImpl.java404
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VerboseWriter.java206
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java737
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineManagerImpl.java111
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidTypeImpl.java17
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidValueImpl.java24
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectorImpl.java200
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketManager.java52
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketReceiveManager.java479
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketSendManager.java93
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketAttachingConnectorImpl.java116
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketConnection.java223
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketLaunchingConnectorImpl.java177
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketListeningConnectorImpl.java139
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketRawLaunchingConnectorImpl.java124
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportImpl.java64
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportService.java608
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/TransportImpl.java24
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/AccessWatchpointEventImpl.java38
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/BreakpointEventImpl.java34
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassPrepareEventImpl.java40
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassUnloadEventImpl.java27
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventImpl.java205
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventIteratorImpl.java32
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventQueueImpl.java55
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventSetImpl.java210
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ExceptionEventImpl.java29
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/LocatableEventImpl.java22
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodEntryEventImpl.java24
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodExitEventImpl.java39
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ModificationWatchpointEventImpl.java35
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnterEventImpl.java34
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnteredEventImpl.java34
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitEventImpl.java36
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitedEventImpl.java47
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/StepEventImpl.java18
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadDeathEventImpl.java19
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadStartEventImpl.java19
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDeathEventImpl.java16
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDisconnectEventImpl.java22
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMStartEventImpl.java18
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/WatchpointEventImpl.java35
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpArrayID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassLoaderID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassObjectID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java832
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFieldID.java9
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFrameID.java9
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpID.java140
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpInterfaceID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpMethodID.java9
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpObjectID.java9
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpPacket.java152
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReferenceTypeID.java9
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReplyPacket.java58
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpString.java56
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpStringID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadGroupID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadID.java3
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/AccessWatchpointRequestImpl.java15
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/BreakpointRequestImpl.java19
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassPrepareRequestImpl.java14
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassUnloadRequestImpl.java14
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestImpl.java558
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestManagerImpl.java654
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ExceptionRequestImpl.java22
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodEntryRequestImpl.java12
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodExitRequestImpl.java12
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ModificationWatchpointRequestImpl.java12
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnterRequestImpl.java10
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnteredRequestImpl.java10
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitRequestImpl.java12
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitedRequestImpl.java10
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ReenterStepRequestImpl.java24
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/RequestID.java35
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/StepRequestImpl.java19
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadDeathRequestImpl.java12
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadStartRequestImpl.java12
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/VMDeathRequestImpl.java10
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/WatchpointRequestImpl.java15
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java258
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpConversation.java13
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpPacket.java83
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpReplyPacket.java41
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/TcpipSpy.java130
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/UnableToParseDataException.java15
-rw-r--r--org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/VerbosePacketStream.java3683
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IEvaluationRunnable.java31
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArray.java131
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArrayType.java38
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpoint.java254
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpointListener.java202
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassObject.java17
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassPrepareBreakpoint.java23
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassType.java206
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaDebugTarget.java522
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java186
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaFieldVariable.java47
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaHotCodeReplaceListener.java43
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaInterfaceType.java86
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaLineBreakpoint.java94
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodBreakpoint.java186
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodEntryBreakpoint.java48
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaModifiers.java118
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaObject.java271
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPatternBreakpoint.java38
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPrimitiveValue.java18
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaReferenceType.java241
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStackFrame.java658
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStratumLineBreakpoint.java82
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaTargetPatternBreakpoint.java60
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThread.java300
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThreadGroup.java30
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaType.java38
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaValue.java72
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaVariable.java90
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaWatchpoint.java36
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/JDIDebugModel.java1146
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/EventDispatcher.java209
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/HeapWalkingManager.java154
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJDIEventListener.java60
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugOptions.java27
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPlugin.java564
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPluginPreferenceInitializer.java37
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugPropertyTester.java39
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugUtils.java497
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/BreakpointListenerManager.java153
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java158
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpoint.java1112
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java628
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaClassPrepareBreakpoint.java234
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaExceptionBreakpoint.java534
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java518
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodBreakpoint.java618
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodEntryBreakpoint.java117
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaPatternBreakpoint.java155
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaStratumLineBreakpoint.java318
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaTargetPatternBreakpoint.java186
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaWatchpoint.java427
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java768
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/CompilationUnitDelta.java214
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/JavaHotCodeReplaceManager.java1234
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/MethodSearchVisitor.java813
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/IJavaStructuresListener.java15
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIAllInstancesValue.java229
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIPlaceholderVariable.java180
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java372
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructures.java267
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaStructureErrorValue.java116
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/LogicalObjectStructureValue.java153
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/ITimeoutListener.java2
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayEntryVariable.java155
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayType.java34
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayValue.java180
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassObjectValue.java14
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassType.java200
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugElement.java286
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java8
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java1838
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIFieldVariable.java187
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIInterfaceType.java102
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDILocalVariable.java118
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIMethod.java107
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIModificationVariable.java275
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDINullValue.java119
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIObjectValue.java454
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPlaceholderValue.java30
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPrimitiveValue.java12
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListEntryVariable.java19
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListValue.java222
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListVariable.java54
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceType.java286
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java640
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThisVariable.java89
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java2483
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThreadGroup.java75
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIType.java148
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIValue.java312
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVariable.java135
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidType.java20
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidValue.java30
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/Timer.java100
-rw-r--r--org.eclipse.jdt.launching.macosx/.classpath2
-rw-r--r--org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.core.prefs36
-rw-r--r--org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java3
-rw-r--r--org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java4
-rw-r--r--org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java8
-rw-r--r--org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java3
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/.classpath2
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.core.prefs228
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardBasePage.java5
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage1.java7
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage2.java5
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage3.java2
-rw-r--r--org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/MacBundleWizard.java2
-rw-r--r--org.eclipse.jdt.launching/.classpath2
-rw-r--r--org.eclipse.jdt.launching/.settings/org.eclipse.jdt.core.prefs36
-rw-r--r--org.eclipse.jdt.launching/.settings/org.eclipse.jdt.ui.prefs54
-rw-r--r--org.eclipse.jdt.launching/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CompositeId.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DefaultProjectClasspathEntry.java7
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMInstall.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainer.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java7
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREPreferenceModifyListener.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaAppletLaunchConfigurationDelegate.java6
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaClasspathVariablesInitializer.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaSourceLookupDirector.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPlugin.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPreferenceInitializer.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacInstalledJREs.java2
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/RuntimeClasspathEntry.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java4
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVM.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMRunner.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMType.java8
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVM.java4
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/VariableClasspathEntry.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/AccessRuleParticipant.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java7
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstall.java2
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IJavaLaunchConfigurationConstants.java2
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IRuntimeContainerComparator.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IVMInstall.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/LibraryLocation.java2
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/SocketUtil.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/StandardSourcePathProvider.java32
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/VMStandin.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ArchiveSourceLocation.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/IJavaSourceLocation.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaProjectSourceLocation.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaSourceLocator.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/LocalFileStorage.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/PackageFragmentRootSourceLocation.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ZipEntryStorage.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathContainerSourceContainer.java3
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathVariableSourceContainer.java1
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaProjectSourceContainer.java5
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaSourceLookupParticipant.java4
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/PackageFragmentRootSourceContainer.java2
917 files changed, 34663 insertions, 25203 deletions
diff --git a/org.eclipse.jdt.debug.jdi.tests/.classpath b/org.eclipse.jdt.debug.jdi.tests/.classpath
index 43b8f4730..1c19094c7 100644
--- a/org.eclipse.jdt.debug.jdi.tests/.classpath
+++ b/org.eclipse.jdt.debug.jdi.tests/.classpath
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="tests"/>
<classpathentry kind="src" path="/org.eclipse.jdt.debug"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.core.prefs
index cef86f7ad..5bb012e85 100644
--- a/org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Thu May 05 15:13:10 CDT 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -8,8 +7,13 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
@@ -25,6 +29,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
diff --git a/org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..bf9e9379a
--- /dev/null
+++ b/org.eclipse.jdt.debug.jdi.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractJDITest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractJDITest.java
index 07eb050c0..f78d57137 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractJDITest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractJDITest.java
@@ -46,7 +46,6 @@ import com.sun.jdi.VirtualMachineManager;
import com.sun.jdi.connect.AttachingConnector;
import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
-import com.sun.jdi.event.ClassPrepareEvent;
import com.sun.jdi.event.Event;
import com.sun.jdi.event.ExceptionEvent;
import com.sun.jdi.event.StepEvent;
@@ -1044,6 +1043,7 @@ public abstract class AbstractJDITest extends TestCase {
/**
* Init tests
*/
+ @Override
protected void setUp() {
if (fVM == null || fInControl) {
launchTargetAndStartProgram();
@@ -1213,7 +1213,7 @@ public abstract class AbstractJDITest extends TestCase {
fEventReader.start();
// Wait until the program has started
- Event event = (ClassPrepareEvent) waitForEvent(waiter, 3 * TIMEOUT);
+ Event event = waitForEvent(waiter, 3 * TIMEOUT);
fEventReader.removeEventListener(waiter);
if (event == null) {
// try {
@@ -1252,6 +1252,7 @@ public abstract class AbstractJDITest extends TestCase {
/**
* Undo the initialization of the test.
*/
+ @Override
protected void tearDown() {
try {
super.tearDown();
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AccessibleTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AccessibleTest.java
index 8321aa86b..a87ff24c9 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AccessibleTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AccessibleTest.java
@@ -28,6 +28,7 @@ public class AccessibleTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get the all kinds of accessible
@@ -51,6 +52,7 @@ public class AccessibleTest extends AbstractJDITest {
/**
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Accessible";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayReferenceTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayReferenceTest.java
index 8fec580d1..8122f7158 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayReferenceTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayReferenceTest.java
@@ -38,6 +38,7 @@ public class ArrayReferenceTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get array references
fArray = getObjectArrayReference();
@@ -54,6 +55,7 @@ public class ArrayReferenceTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ArrayReference";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayTypeTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayTypeTest.java
index 78cf7175a..c8c578103 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayTypeTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ArrayTypeTest.java
@@ -34,6 +34,7 @@ public class ArrayTypeTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get array type
fType = getArrayType();
@@ -49,6 +50,7 @@ public class ArrayTypeTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ArrayType";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BooleanValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BooleanValueTest.java
index b610736ef..75397b517 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BooleanValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BooleanValueTest.java
@@ -28,6 +28,7 @@ public class BooleanValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get boolean value for "true"
fValue = fVM.mirrorOf(true);
@@ -43,6 +44,7 @@ public class BooleanValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.BooleanValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BreakpointRequestTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BreakpointRequestTest.java
index ad5f0da8b..822b94df2 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BreakpointRequestTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/BreakpointRequestTest.java
@@ -28,6 +28,7 @@ public class BreakpointRequestTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get the breakpoint request
fRequest = getBreakpointRequest();
@@ -35,6 +36,7 @@ public class BreakpointRequestTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Delete the breakpoint request we created in this test
fVM.eventRequestManager().deleteEventRequest(fRequest);
@@ -50,6 +52,7 @@ public class BreakpointRequestTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.request.BreakpointRequest";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ByteValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ByteValueTest.java
index 733db950a..8ec132b5d 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ByteValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ByteValueTest.java
@@ -28,6 +28,7 @@ public class ByteValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get byte value for 1
fValue = fVM.mirrorOf((byte) 1);
@@ -43,6 +44,7 @@ public class ByteValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ByteValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/CharValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/CharValueTest.java
index 5261fdaf3..5281f014f 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/CharValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/CharValueTest.java
@@ -28,6 +28,7 @@ public class CharValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get char value for 'a'
fValue = fVM.mirrorOf('a');
@@ -43,6 +44,7 @@ public class CharValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.CharValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassLoaderReferenceTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassLoaderReferenceTest.java
index ebf7335f4..fe0bf4f6e 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassLoaderReferenceTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassLoaderReferenceTest.java
@@ -32,6 +32,7 @@ public class ClassLoaderReferenceTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get the class loader of org.eclipse.debug.jdi.tests.program.MainClass
fClassLoader = getClassLoaderReference();
@@ -47,6 +48,7 @@ public class ClassLoaderReferenceTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ClassLoaderReference";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventTest.java
index c9577ef1c..d06df31e7 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventTest.java
@@ -29,6 +29,7 @@ public class ClassPrepareEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Trigger a class prepare event
fRequest = fVM.eventRequestManager().createClassPrepareRequest();
@@ -40,6 +41,7 @@ public class ClassPrepareEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// The test has resumed the test thread, so suspend it
waitUntilReady();
@@ -58,6 +60,7 @@ public class ClassPrepareEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.ClassPrepareEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventWaiter.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventWaiter.java
index b14eda0c2..a3baac4e2 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventWaiter.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareEventWaiter.java
@@ -33,6 +33,7 @@ public class ClassPrepareEventWaiter extends EventWaiter {
/**
* @see org.eclipse.debug.jdi.tests.EventWaiter#classPrepare(com.sun.jdi.event.ClassPrepareEvent)
*/
+ @Override
public boolean classPrepare(ClassPrepareEvent event) {
if (event.referenceType().name().equals(fClassName)) {
notifyEvent(event);
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareRequestTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareRequestTest.java
index 83fb93d81..e9833364a 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareRequestTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassPrepareRequestTest.java
@@ -28,6 +28,7 @@ public class ClassPrepareRequestTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
}
/**
@@ -41,6 +42,7 @@ public class ClassPrepareRequestTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.request.ClassPrepareRequest";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassTypeTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassTypeTest.java
index f5fd380d9..35fff2390 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassTypeTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassTypeTest.java
@@ -46,6 +46,7 @@ public class ClassTypeTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get the type org.eclipse.debug.jdi.tests.program.MainClass
fType = getMainClass();
@@ -61,6 +62,7 @@ public class ClassTypeTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ClassType";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassesByNameTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassesByNameTest.java
index b8185525d..b73bf64d4 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassesByNameTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ClassesByNameTest.java
@@ -29,6 +29,7 @@ public class ClassesByNameTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
}
@@ -43,6 +44,7 @@ public class ClassesByNameTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.VirtualMachine.classesByName";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java
index f78bcd32e..11dc6fad8 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ConstantPoolTests.java
@@ -24,6 +24,7 @@ public class ConstantPoolTests extends AbstractJDITest {
ReferenceType fClass;
/** setup test info locally **/
+ @Override
public void localSetUp() {}
/**
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ContendedMonitorTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ContendedMonitorTests.java
index a2505dcb0..b601e6033 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ContendedMonitorTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ContendedMonitorTests.java
@@ -29,6 +29,7 @@ public class ContendedMonitorTests extends AbstractJDITest {
EventRequestManager erm = null;
/** setup test info locally **/
+ @Override
public void localSetUp() {
erm = fVM.eventRequestManager();
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/DoubleValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/DoubleValueTest.java
index 7bb297d60..359f2731f 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/DoubleValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/DoubleValueTest.java
@@ -28,6 +28,7 @@ public class DoubleValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get double value for 12345.6789
fValue = fVM.mirrorOf(12345.6789);
@@ -43,6 +44,7 @@ public class DoubleValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.DoubleValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventReader.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventReader.java
index f81fb2fa4..71afdcb0b 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventReader.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventReader.java
@@ -95,6 +95,7 @@ public class EventReader extends AbstractReader {
/**
* Continuously reads events that are coming from the event queue.
*/
+ @Override
protected void readerLoop() {
while (!fIsStopping) {
try {
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestManagerTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestManagerTest.java
index d1cee7b5a..ffafbc612 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestManagerTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestManagerTest.java
@@ -42,6 +42,7 @@ public class EventRequestManagerTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get the event request manager
fManager = fVM.eventRequestManager();
@@ -57,6 +58,7 @@ public class EventRequestManagerTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.request.EventRequestManager";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestTest.java
index 029775fd6..89d548bc9 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventRequestTest.java
@@ -32,6 +32,7 @@ public class EventRequestTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get all kinds of request
if (fVM.canWatchFieldAccess())
@@ -53,6 +54,7 @@ public class EventRequestTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Delete the requests we created in this test
fVM.eventRequestManager().deleteEventRequests(fRequests);
@@ -68,6 +70,7 @@ public class EventRequestTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.request.EventRequest";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventTest.java
index e72e9ffb2..21f9033ee 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/EventTest.java
@@ -32,6 +32,7 @@ public class EventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// All events...
@@ -72,6 +73,7 @@ public class EventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Ensure that the modification of the "fBool" field has completed
fVM.resume();
@@ -95,6 +97,7 @@ public class EventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.Event";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionEventTest.java
index 2d80e668c..74f93f24e 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionEventTest.java
@@ -29,6 +29,7 @@ public class ExceptionEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Trigger an exception event
fEvent =
@@ -39,6 +40,7 @@ public class ExceptionEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// The test has interrupted the VM, so let it go
fVM.resume();
@@ -57,6 +59,7 @@ public class ExceptionEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.ExceptionEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionRequestTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionRequestTest.java
index 0613cfbdf..0b4fed165 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionRequestTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ExceptionRequestTest.java
@@ -28,6 +28,7 @@ public class ExceptionRequestTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get the exception request
fRequest = getExceptionRequest();
@@ -35,6 +36,7 @@ public class ExceptionRequestTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Delete the exception request we created in this test
fVM.eventRequestManager().deleteEventRequest(fRequest);
@@ -50,6 +52,7 @@ public class ExceptionRequestTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.request.ExceptionRequest";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FieldTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FieldTest.java
index 3a5717ac9..61bbed890 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FieldTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FieldTest.java
@@ -29,6 +29,7 @@ public class FieldTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get static field "fObject"
fField = getField();
@@ -44,6 +45,7 @@ public class FieldTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Field";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FileConsoleReader.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FileConsoleReader.java
index 52d88b05d..635e4ab8a 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FileConsoleReader.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FileConsoleReader.java
@@ -42,6 +42,7 @@ public class FileConsoleReader extends AbstractReader {
/**
* Continuously reads events that are coming from the event queue.
*/
+ @Override
protected void readerLoop() {
BufferedReader input = new BufferedReader(new InputStreamReader(fInput));
try {
@@ -60,6 +61,7 @@ public class FileConsoleReader extends AbstractReader {
/**
* @see org.eclipse.debug.jdi.tests.AbstractReader#stop()
*/
+ @Override
public void stop() {
try {
fFileOutputStream.close();
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FloatValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FloatValueTest.java
index 20b7c7686..8b1253a8e 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FloatValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/FloatValueTest.java
@@ -28,6 +28,7 @@ public class FloatValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get float value for 123.45f
fValue = fVM.mirrorOf(123.45f);
@@ -43,6 +44,7 @@ public class FloatValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.FloatType";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ForceEarlyReturnTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ForceEarlyReturnTests.java
index b3ca63391..5fc9afaca 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ForceEarlyReturnTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ForceEarlyReturnTests.java
@@ -21,6 +21,7 @@ import com.sun.jdi.ThreadReference;
import com.sun.jdi.Value;
import com.sun.jdi.event.BreakpointEvent;
import com.sun.jdi.request.BreakpointRequest;
+import com.sun.jdi.request.EventRequest;
/**
* Test cases for the implementation of providing argumebnt information even if
@@ -31,6 +32,7 @@ import com.sun.jdi.request.BreakpointRequest;
public class ForceEarlyReturnTests extends AbstractJDITest {
/** setup test info locally **/
+ @Override
public void localSetUp() {}
/**
@@ -55,7 +57,7 @@ public class ForceEarlyReturnTests extends AbstractJDITest {
try {
Method method = getMethod("foo", "()Ljava/lang/String;");
BreakpointRequest br = getBreakpointRequest(method.location());
- br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
+ br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.enable();
EventWaiter waiter = new EventWaiter(br, true);
fEventReader.addEventListener(waiter);
@@ -67,7 +69,7 @@ public class ForceEarlyReturnTests extends AbstractJDITest {
if(tref.isAtBreakpoint()) {
method = getMethod("printNumber", "(Ljava/io/OutputStream;I)I");
br = getBreakpointRequest((Location) method.locationsOfLine(136).get(0));
- br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
+ br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.enable();
waiter = new EventWaiter(br, true);
fEventReader.addEventListener(waiter);
@@ -77,7 +79,7 @@ public class ForceEarlyReturnTests extends AbstractJDITest {
tref = bpe.thread();
LocalVariable lv = (LocalVariable)tref.frame(0).visibleVariables().get(2);
Value val = tref.frame(0).getValue(lv);
- System.out.println((StringReference)val);
+ System.out.println(val);
assertTrue("value should be a StringReference", val instanceof StringReference);
fEventReader.removeEventListener(waiter);
//TODO make sure this works with the newest versions of the 1.6VM
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HeapWalkingTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HeapWalkingTests.java
index 636fa762d..e06f393ab 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HeapWalkingTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HeapWalkingTests.java
@@ -27,9 +27,11 @@ public class HeapWalkingTests extends AbstractJDITest {
private ObjectReference fObject;
/** setup our tests */
+ @Override
public void localSetUp() {}
/** tear down our tests */
+ @Override
public void localTearDown() {
super.localTearDown();
fClass = null;
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HotCodeReplacementTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HotCodeReplacementTest.java
index 61e89490c..f4fd14205 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HotCodeReplacementTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/HotCodeReplacementTest.java
@@ -83,6 +83,7 @@ public class HotCodeReplacementTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
waitUntilReady();
}
@@ -97,6 +98,7 @@ public class HotCodeReplacementTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "Hot code replacement extension to JDI (org.eclipse.jdi.hcr) tests";
}
@@ -243,6 +245,7 @@ public class HotCodeReplacementTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
waitUntilReady();
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/IntegerValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/IntegerValueTest.java
index f0ea14d02..757049b4a 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/IntegerValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/IntegerValueTest.java
@@ -28,6 +28,7 @@ public class IntegerValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get int value for 12345
fValue = fVM.mirrorOf(12345);
@@ -43,6 +44,7 @@ public class IntegerValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.IntegerValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/InterfaceTypeTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/InterfaceTypeTest.java
index 85d3b17d1..e6114d4c6 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/InterfaceTypeTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/InterfaceTypeTest.java
@@ -34,6 +34,7 @@ public class InterfaceTypeTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get interface type "org.eclipse.debug.jdi.tests.program.Printable"
fType = getInterfaceType();
@@ -49,6 +50,7 @@ public class InterfaceTypeTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.InterfaceType";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestCase.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestCase.java
index c0259380f..5ce3c3ba9 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestCase.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestCase.java
@@ -33,6 +33,7 @@ public class JDITestCase extends TestCase {
* Override to run the test and assert its state.
* @exception Throwable if any exception is thrown
*/
+ @Override
protected void runTest() throws Throwable {
Method runMethod = null;
try {
@@ -59,12 +60,14 @@ public class JDITestCase extends TestCase {
/**
* Init tests
*/
+ @Override
protected void setUp() {
// Ignore setUp since it is done once for all tests in the test suite
}
/**
* Tears down the fixture.
*/
+ @Override
protected void tearDown() {
// Ignore tearDown since it is done once for all tests in the test suite
}
@@ -72,6 +75,7 @@ public class JDITestCase extends TestCase {
* Returns a string representation of the test case
* @see junit.framework.TestCase#toString()
*/
+ @Override
public String toString() {
return fTest.getClass().getName() + "." + getName() + "()";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestSuite.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestSuite.java
index 4b910000b..db7f171bb 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestSuite.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/JDITestSuite.java
@@ -33,6 +33,7 @@ public class JDITestSuite extends TestSuite {
* Runs the tests and collects their result in a TestResult.
* @see junit.framework.TestSuite#run(junit.framework.TestResult)
*/
+ @Override
public void run(TestResult result) {
fTest.setUp();
super.run(result);
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocalVariableTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocalVariableTest.java
index 78ded64ef..a75b66e1e 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocalVariableTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocalVariableTest.java
@@ -30,6 +30,7 @@ public class LocalVariableTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Wait for the program to be ready
waitUntilReady();
@@ -48,6 +49,7 @@ public class LocalVariableTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.LocalVariable";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocatableTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocatableTest.java
index 0581796f1..5c85f56f2 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocatableTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocatableTest.java
@@ -38,6 +38,7 @@ public class LocatableTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get all kinds of locatable
@@ -80,6 +81,7 @@ public class LocatableTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Ensure that the modification of the "fBool" field has completed
fVM.resume();
@@ -102,6 +104,7 @@ public class LocatableTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Locatable";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocationTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocationTest.java
index 21390dfc2..2da12dd73 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocationTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LocationTest.java
@@ -30,6 +30,7 @@ public class LocationTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Ensure we're in a good state
fVM.resume();
@@ -50,6 +51,7 @@ public class LocationTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Location";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LongValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LongValueTest.java
index 64d5d7f84..7087fe240 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LongValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/LongValueTest.java
@@ -27,6 +27,7 @@ public class LongValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get long value for 123456789l
fValue = fVM.mirrorOf(123456789l);
@@ -42,6 +43,7 @@ public class LongValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.LongValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodEntryRequestTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodEntryRequestTest.java
index 762467b7f..9fc7005f1 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodEntryRequestTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodEntryRequestTest.java
@@ -26,12 +26,14 @@ public class MethodEntryRequestTest extends AbstractJDITest {
/**
* @see org.eclipse.debug.jdi.tests.AbstractJDITest#localSetUp()
*/
+ @Override
public void localSetUp() {
}
/**
* @see org.eclipse.debug.jdi.tests.AbstractJDITest#localTearDown()
*/
+ @Override
public void localTearDown() {
fVM.resume();
waitUntilReady();
@@ -48,6 +50,7 @@ public class MethodEntryRequestTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.MethodEntryRequest";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodExitRequestTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodExitRequestTest.java
index 527dd4ffa..1cd5e030f 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodExitRequestTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodExitRequestTest.java
@@ -26,11 +26,13 @@ public class MethodExitRequestTest extends AbstractJDITest {
/**
* @see org.eclipse.debug.jdi.tests.AbstractJDITest#localSetUp()
*/
+ @Override
public void localSetUp() {
}
/**
* @see org.eclipse.debug.jdi.tests.AbstractJDITest#localTearDown()
*/
+ @Override
public void localTearDown() {
fVM.resume();
waitUntilReady();
@@ -47,6 +49,7 @@ public class MethodExitRequestTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.MethodExitRequest";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodReturnValuesTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodReturnValuesTests.java
index c8480758f..9caeee890 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodReturnValuesTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodReturnValuesTests.java
@@ -18,6 +18,7 @@ import com.sun.jdi.Value;
import com.sun.jdi.event.BreakpointEvent;
import com.sun.jdi.event.MethodExitEvent;
import com.sun.jdi.request.BreakpointRequest;
+import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.MethodExitRequest;
@@ -40,11 +41,13 @@ public class MethodReturnValuesTests extends AbstractJDITest {
/** setup test info locally **/
+ @Override
public void localSetUp() {
erm = fVM.eventRequestManager();
}
/** cleans up local tests **/
+ @Override
public void localTearDown() {
super.localTearDown();
if(erm != null) {
@@ -76,7 +79,7 @@ public class MethodReturnValuesTests extends AbstractJDITest {
//test VoidValueImpl return type
method = getMethod("print", "(Ljava/io/OutputStream;)V");
br = getBreakpointRequest(method.location());
- br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
+ br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.enable();
waiter = new EventWaiter(br, true);
fEventReader.addEventListener(waiter);
@@ -118,7 +121,7 @@ public class MethodReturnValuesTests extends AbstractJDITest {
//test non void return types, in the case IntegerValueImpl
method = getMethod("foo", "()Ljava/lang/String;");
br = getBreakpointRequest(method.location());
- br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
+ br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.enable();
waiter = new EventWaiter(br, true);
fEventReader.addEventListener(waiter);
@@ -160,7 +163,7 @@ public class MethodReturnValuesTests extends AbstractJDITest {
//test non void return types, in the case IntegerValueImpl
method = getMethod("getInt", "()I");
br = getBreakpointRequest(method.location());
- br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
+ br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.enable();
waiter = new EventWaiter(br, true);
fEventReader.addEventListener(waiter);
@@ -202,7 +205,7 @@ public class MethodReturnValuesTests extends AbstractJDITest {
//test non void return types, in the case IntegerValueImpl
method = getMethod("getBoolean", "()Z");
br = getBreakpointRequest(method.location());
- br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
+ br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.enable();
waiter = new EventWaiter(br, true);
fEventReader.addEventListener(waiter);
@@ -244,7 +247,7 @@ public class MethodReturnValuesTests extends AbstractJDITest {
//test non void return types, in the case IntegerValueImpl
method = getMethod("getLong", "()J");
br = getBreakpointRequest(method.location());
- br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
+ br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.enable();
waiter = new EventWaiter(br, true);
fEventReader.addEventListener(waiter);
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodTest.java
index db1406521..721a7b2c4 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MethodTest.java
@@ -36,6 +36,7 @@ public class MethodTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get method useLocalVars(Thread, MainClass)
fMethod1 =
@@ -54,6 +55,7 @@ public class MethodTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Method";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MirrorTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MirrorTest.java
index 8d1975aee..ed16b8083 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MirrorTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MirrorTest.java
@@ -33,6 +33,7 @@ public class MirrorTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get all kinds of concrete mirror that can be found in the VM
// in alphabetical order.
@@ -80,6 +81,7 @@ public class MirrorTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
ListIterator iterator = fMirrors.listIterator();
while (iterator.hasNext()) {
@@ -112,6 +114,7 @@ public class MirrorTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Mirror";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ModificationWatchpointEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ModificationWatchpointEventTest.java
index ae5f4644b..dc2ba9d73 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ModificationWatchpointEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ModificationWatchpointEventTest.java
@@ -30,6 +30,7 @@ public class ModificationWatchpointEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Trigger a static modification watchpoint event
fWatchpointRequest = getStaticModificationWatchpointRequest();
@@ -42,6 +43,7 @@ public class ModificationWatchpointEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Ensure that the modification of the "fString" field has completed
fVM.resume();
@@ -64,6 +66,7 @@ public class ModificationWatchpointEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.ModificationWatchpointEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MonitorFrameInfoTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MonitorFrameInfoTests.java
index afd8cacd5..f71beb4cb 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MonitorFrameInfoTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/MonitorFrameInfoTests.java
@@ -28,6 +28,7 @@ import com.sun.jdi.request.EventRequest;
public class MonitorFrameInfoTests extends AbstractJDITest {
/** setup test info locally **/
+ @Override
public void localSetUp() {}
/**
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/NullConsoleReader.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/NullConsoleReader.java
index 7902c3555..39b2b7b37 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/NullConsoleReader.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/NullConsoleReader.java
@@ -34,6 +34,7 @@ public class NullConsoleReader extends AbstractReader {
/**
* Continuously reads events that are coming from the event queue.
*/
+ @Override
protected void readerLoop() {
java.io.BufferedReader input =
new BufferedReader(new InputStreamReader(fInput));
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ObjectReferenceTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ObjectReferenceTest.java
index 708f1cc63..540e96e9f 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ObjectReferenceTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ObjectReferenceTest.java
@@ -51,6 +51,7 @@ public class ObjectReferenceTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Make sure the object is in expected state (eg. it has not entered a monitor)
waitUntilReady();
@@ -61,6 +62,7 @@ public class ObjectReferenceTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// The test has resumed and suspended the Test Thread. Make sure this
// thread is suspended at the right location
@@ -77,12 +79,14 @@ public class ObjectReferenceTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ObjectReference";
}
/**
* Returns all tests
*/
+ @Override
protected Test suite() {
JDITestSuite suite = (JDITestSuite) super.suite();
Vector testNames = getAllMatchingTests("testLast");
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/PrimitiveValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/PrimitiveValueTest.java
index 5bc7a5d98..a0df20c8e 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/PrimitiveValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/PrimitiveValueTest.java
@@ -35,6 +35,7 @@ public class PrimitiveValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get all kinds of prinitive values
fBoolean = fVM.mirrorOf(true);
@@ -57,6 +58,7 @@ public class PrimitiveValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.PrimitiveValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ProvideArgumentsTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ProvideArgumentsTests.java
index 208645fd0..3be9f8d1b 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ProvideArgumentsTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ProvideArgumentsTests.java
@@ -32,6 +32,7 @@ import com.sun.jdi.request.EventRequest;
public class ProvideArgumentsTests extends AbstractJDITest {
/** setup test info locally **/
+ @Override
public void localSetUp() {}
/**
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ReferenceTypeTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ReferenceTypeTest.java
index 5f029e345..8924ae130 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ReferenceTypeTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ReferenceTypeTest.java
@@ -54,6 +54,7 @@ public class ReferenceTypeTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get all kinds of reference type
fTypes.add(getSystemType());
@@ -72,6 +73,7 @@ public class ReferenceTypeTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ReferenceType";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ShortValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ShortValueTest.java
index 9c0b0a0e3..249fa8252 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ShortValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ShortValueTest.java
@@ -27,6 +27,7 @@ public class ShortValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get short value for 12345
fValue = fVM.mirrorOf((short) 12345);
@@ -42,6 +43,7 @@ public class ShortValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ShortValue";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/SourceNameFilterTests.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/SourceNameFilterTests.java
index 17887ad6e..2f1f5be18 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/SourceNameFilterTests.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/SourceNameFilterTests.java
@@ -23,6 +23,7 @@ import com.sun.jdi.request.EventRequestManager;
public class SourceNameFilterTests extends AbstractJDITest {
/** setup test info locally **/
+ @Override
public void localSetUp() {}
/**
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StackFrameTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StackFrameTest.java
index ef39dd431..df0003e3d 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StackFrameTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StackFrameTest.java
@@ -38,6 +38,7 @@ public class StackFrameTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get the frame running MainClass.run()
fFrame = getFrame(RUN_FRAME_OFFSET);
@@ -54,6 +55,7 @@ public class StackFrameTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.StackFrame";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StepEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StepEventTest.java
index b95a9720d..8912fd0d1 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StepEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StepEventTest.java
@@ -31,6 +31,7 @@ public class StepEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Trigger a step event
fStepEvent = triggerStepAndWait();
@@ -38,6 +39,7 @@ public class StepEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// The test has resumed the test thread, so suspend it
waitUntilReady();
@@ -53,6 +55,7 @@ public class StepEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.StepEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StringReferenceTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StringReferenceTest.java
index a8743670b..3f5da12fe 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StringReferenceTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/StringReferenceTest.java
@@ -28,6 +28,7 @@ public class StringReferenceTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get static field "fString"
fString = getStringReference();
@@ -43,6 +44,7 @@ public class StringReferenceTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.StringReference";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TextTestResult.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TextTestResult.java
index 352b13b32..816bf2c80 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TextTestResult.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TextTestResult.java
@@ -25,6 +25,7 @@ public class TextTestResult extends TestResult {
/**
* @see junit.framework.TestResult#addError(junit.framework.Test, java.lang.Throwable)
*/
+ @Override
public synchronized void addError(Test test, Throwable t) {
super.addError(test, t);
System.out.println("E");
@@ -32,6 +33,7 @@ public class TextTestResult extends TestResult {
/**
* @see junit.framework.TestResult#addFailure(junit.framework.Test, junit.framework.AssertionFailedError)
*/
+ @Override
public synchronized void addFailure(Test test, AssertionFailedError t) {
super.addFailure(test, t);
System.out.print("F");
@@ -113,6 +115,7 @@ public class TextTestResult extends TestResult {
/**
* @see junit.framework.TestResult#startTest(junit.framework.Test)
*/
+ @Override
public synchronized void startTest(Test test) {
super.startTest(test);
System.out.print(".");
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadDeathEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadDeathEventTest.java
index 489ff638a..e56a649b3 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadDeathEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadDeathEventTest.java
@@ -28,6 +28,7 @@ public class ThreadDeathEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Make sure the entire VM is not suspended before we start a new thread
// (otherwise this new thread will start suspended and we will never get the
@@ -45,6 +46,7 @@ public class ThreadDeathEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// The test has resumed the test thread, so suspend it
waitUntilReady();
@@ -60,6 +62,7 @@ public class ThreadDeathEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.ThreadDeathEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadGroupReferenceTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadGroupReferenceTest.java
index 81c0fe439..bdfd04505 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadGroupReferenceTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadGroupReferenceTest.java
@@ -32,6 +32,7 @@ public class ThreadGroupReferenceTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get value of "fThread"
ThreadReference thread = getThread();
@@ -42,6 +43,7 @@ public class ThreadGroupReferenceTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// The test has resumed the thread group, and so the test thread, so suspend it
waitUntilReady();
@@ -57,6 +59,7 @@ public class ThreadGroupReferenceTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ThreadGroupReference";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadReferenceTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadReferenceTest.java
index 2ee78aa94..6a6123268 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadReferenceTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadReferenceTest.java
@@ -39,6 +39,7 @@ public class ThreadReferenceTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get thread
fThread = getThread();
@@ -54,6 +55,7 @@ public class ThreadReferenceTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.ThreadReference";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadStartEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadStartEventTest.java
index 07d1190be..8a2b775e0 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadStartEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ThreadStartEventTest.java
@@ -27,6 +27,7 @@ public class ThreadStartEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Make sure the entire VM is not suspended before we start a new thread
// (otherwise this new thread will start suspended and we will never get the
@@ -44,6 +45,7 @@ public class ThreadStartEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// The test has resumed the test thread, so suspend it
waitUntilReady();
@@ -59,6 +61,7 @@ public class ThreadStartEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.ThreadStartEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeComponentTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeComponentTest.java
index beaf67ec3..e892643fa 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeComponentTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeComponentTest.java
@@ -28,6 +28,7 @@ public class TypeComponentTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get field fObject in org.eclipse.debug.jdi.tests.program.MainClass
fField = getField();
@@ -46,6 +47,7 @@ public class TypeComponentTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.TypeComponent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeTest.java
index 7df3b6c11..74a996d21 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/TypeTest.java
@@ -10,14 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.jdi.tests;
-import com.sun.jdi.BooleanType;
-import com.sun.jdi.ByteType;
-import com.sun.jdi.CharType;
-import com.sun.jdi.DoubleType;
-import com.sun.jdi.FloatType;
-import com.sun.jdi.IntegerType;
-import com.sun.jdi.LongType;
-import com.sun.jdi.ShortType;
import com.sun.jdi.Type;
/**
@@ -65,20 +57,21 @@ public class TypeTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get reference types
fArrayType = getArrayType();
fClassType = getMainClass();
fInterfaceType = getInterfaceType();
// Get primitive types
- fBooleanType = (BooleanType) (fVM.mirrorOf(true).type());
- fByteType = (ByteType) (fVM.mirrorOf((byte) 1).type());
- fCharType = (CharType) (fVM.mirrorOf('a').type());
- fDoubleType = (DoubleType) (fVM.mirrorOf(12345.6789).type());
- fFloatType = (FloatType) (fVM.mirrorOf(12345.6789f).type());
- fIntegerType = (IntegerType) (fVM.mirrorOf(12345).type());
- fLongType = (LongType) (fVM.mirrorOf(123456789l).type());
- fShortType = (ShortType) (fVM.mirrorOf((short) 12345).type());
+ fBooleanType = (fVM.mirrorOf(true).type());
+ fByteType = (fVM.mirrorOf((byte) 1).type());
+ fCharType = (fVM.mirrorOf('a').type());
+ fDoubleType = (fVM.mirrorOf(12345.6789).type());
+ fFloatType = (fVM.mirrorOf(12345.6789f).type());
+ fIntegerType = (fVM.mirrorOf(12345).type());
+ fLongType = (fVM.mirrorOf(123456789l).type());
+ fShortType = (fVM.mirrorOf((short) 12345).type());
// Get one-dimensional primitive arrays
fByteArrayType = getByteArrayType();
fShortArrayType = getShortArrayType();
@@ -110,6 +103,7 @@ public class TypeTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Type";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventTest.java
index ff3bddae3..0660ef258 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventTest.java
@@ -27,6 +27,7 @@ public class VMDisconnectEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Prepare to receive the event
VMDisconnectEventWaiter waiter =
@@ -44,6 +45,7 @@ public class VMDisconnectEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Finish the shut down
shutDownTarget();
@@ -62,6 +64,7 @@ public class VMDisconnectEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.VMDeathEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventWaiter.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventWaiter.java
index 2bfd85333..ed4c92dda 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventWaiter.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisconnectEventWaiter.java
@@ -27,6 +27,7 @@ public class VMDisconnectEventWaiter extends EventWaiter {
/**
* @see org.eclipse.debug.jdi.tests.EventWaiter#vmDisconnect(com.sun.jdi.event.VMDisconnectEvent)
*/
+ @Override
public boolean vmDisconnect(VMDisconnectEvent event) {
notifyEvent(event);
return fShouldGo;
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisposeTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisposeTest.java
index 260db6a42..7db1b18a6 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisposeTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VMDisposeTest.java
@@ -25,6 +25,7 @@ public class VMDisposeTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
}
/**
@@ -38,6 +39,7 @@ public class VMDisposeTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.VirtualMachine.dispose";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ValueTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ValueTest.java
index 4be97a19e..23c9e9a27 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ValueTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/ValueTest.java
@@ -35,6 +35,7 @@ public class ValueTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get primitive values
fBoolean = fVM.mirrorOf(true);
@@ -61,6 +62,7 @@ public class ValueTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.Value";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineExitTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineExitTest.java
index 5baef607e..d07d90057 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineExitTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineExitTest.java
@@ -25,11 +25,13 @@ public class VirtualMachineExitTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
}
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Finish the shut down
shutDownTarget();
@@ -48,6 +50,7 @@ public class VirtualMachineExitTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.VirtualMachine.exit(int)";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineTest.java
index 3fe90a85a..79c968ed5 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/VirtualMachineTest.java
@@ -48,6 +48,7 @@ public class VirtualMachineTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
}
/**
@@ -61,12 +62,14 @@ public class VirtualMachineTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.VirtualMachine";
}
/**
* Don't start the program yet, so that the testNotStarted* tests can run before.
*/
+ @Override
protected void setUp() {
launchTargetAndConnectToVM();
}
@@ -75,12 +78,14 @@ public class VirtualMachineTest extends AbstractJDITest {
* NB: This method is copied in this class only so that it can be invoked
* dynamically.
*/
+ @Override
public void startProgram() {
super.startProgram();
}
/**
* Returns all tests
*/
+ @Override
protected Test suite() {
JDITestSuite suite = new JDITestSuite(this);
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointEventTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointEventTest.java
index d013d1410..293942e78 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointEventTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointEventTest.java
@@ -37,6 +37,7 @@ public class WatchpointEventTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Trigger an access watchpoint event
fAccessWatchpointEvent =
@@ -70,6 +71,7 @@ public class WatchpointEventTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Ensure that the modification of the "fBool" field has completed
fVM.resume();
@@ -96,6 +98,7 @@ public class WatchpointEventTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.event.WatchpointEvent";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointRequestTest.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointRequestTest.java
index 917d08c2d..bc6089369 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointRequestTest.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/WatchpointRequestTest.java
@@ -28,6 +28,7 @@ public class WatchpointRequestTest extends AbstractJDITest {
/**
* Init the fields that are used by this test only.
*/
+ @Override
public void localSetUp() {
// Get an acces watchpoint request
fAccessWatchpointRequest = getAccessWatchpointRequest();
@@ -38,6 +39,7 @@ public class WatchpointRequestTest extends AbstractJDITest {
/**
* Make sure the test leaves the VM in the same state it found it.
*/
+ @Override
public void localTearDown() {
// Delete the watchpoint requests we created in this test
fVM.eventRequestManager().deleteEventRequest(fAccessWatchpointRequest);
@@ -55,6 +57,7 @@ public class WatchpointRequestTest extends AbstractJDITest {
* Gets the name of the test case.
* @see junit.framework.TestCase#getName()
*/
+ @Override
public String getName() {
return "com.sun.jdi.request.WatchpointRequest";
}
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/program/MainClass.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/program/MainClass.java
index 97fa8270c..48782bd44 100644
--- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/program/MainClass.java
+++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/program/MainClass.java
@@ -28,6 +28,7 @@ import org.eclipse.debug.jdi.tests.ClassTypeTest;
* as well as its behavior. So if this class or one of the types in this
* package is changed, the corresponding tests must also be changed.
*/
+@SuppressWarnings("unused")
public class MainClass extends Date implements Runnable, Printable {
private static byte[] byteArray = new byte[0];
diff --git a/org.eclipse.jdt.debug.tests/.classpath b/org.eclipse.jdt.debug.tests/.classpath
index 5093adb7f..4b8ab5a7d 100644
--- a/org.eclipse.jdt.debug.tests/.classpath
+++ b/org.eclipse.jdt.debug.tests/.classpath
@@ -4,6 +4,6 @@
<classpathentry kind="src" path="tests"/>
<classpathentry kind="src" path="console tests"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.core.prefs
index 0f4adae76..a5fd53d20 100644
--- a/org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Thu May 05 15:13:17 CDT 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,28 +6,42 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
@@ -37,6 +50,8 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -45,30 +60,60 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
diff --git a/org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..bf9e9379a
--- /dev/null
+++ b/org.eclipse.jdt.debug.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
diff --git a/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF
index 99db8126f..6d46b3a90 100644
--- a/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF
@@ -47,4 +47,4 @@ Require-Bundle: org.eclipse.ui.ide;resolution:=optional,
org.eclipse.jdt.core.manipulation,
org.eclipse.core.filesystem
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleEchoActionDelegate.java b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleEchoActionDelegate.java
index 3d472ade5..a5e1741d8 100644
--- a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleEchoActionDelegate.java
+++ b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleEchoActionDelegate.java
@@ -82,7 +82,7 @@ public class IOConsoleEchoActionDelegate implements IActionDelegate2, IWorkbench
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
manager.addConsoles(new IConsole[] { console });
- final IOConsoleOutputStream out = console.newOutputStream(); //$NON-NLS-1$
+ final IOConsoleOutputStream out = console.newOutputStream();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
out.setColor(Display.getDefault().getSystemColor(SWT.COLOR_GREEN));
diff --git a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleMultipleStreamActionDelegate.java b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleMultipleStreamActionDelegate.java
index c42c99d92..65c186193 100644
--- a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleMultipleStreamActionDelegate.java
+++ b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleMultipleStreamActionDelegate.java
@@ -77,7 +77,7 @@ public class IOConsoleMultipleStreamActionDelegate implements IActionDelegate2,
final Display display = Display.getDefault();
final IOConsoleInputStream in = console.getInputStream();
- final IOConsoleOutputStream echo = console.newOutputStream(); //$NON-NLS-1$
+ final IOConsoleOutputStream echo = console.newOutputStream();
display.asyncExec(new Runnable() {
public void run() {
in.setColor(display.getSystemColor(SWT.COLOR_BLUE));
@@ -86,7 +86,7 @@ public class IOConsoleMultipleStreamActionDelegate implements IActionDelegate2,
});
startInputReadThread(in, echo);
- IOConsoleOutputStream out = console.newOutputStream(); //$NON-NLS-1$
+ IOConsoleOutputStream out = console.newOutputStream();
startOutputThread(out);
}
diff --git a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleOutputActionDelegate.java b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleOutputActionDelegate.java
index 7433122fa..dfd3006d1 100644
--- a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleOutputActionDelegate.java
+++ b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/IOConsoleOutputActionDelegate.java
@@ -55,7 +55,7 @@ public class IOConsoleOutputActionDelegate implements IActionDelegate2, IWorkben
IOConsole console = new IOConsole("Test IOConsole", null, DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_ACT_RUN)); //$NON-NLS-1$
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
manager.addConsoles(new IConsole[]{console});
- OutputStream out = console.newOutputStream(); //$NON-NLS-1$
+ OutputStream out = console.newOutputStream();
final PrintStream stream = new PrintStream(out);
Runnable r = new Runnable() {
public void run() {
diff --git a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/TestShowConsoleActionDelegate.java b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/TestShowConsoleActionDelegate.java
index 19d2069db..3391c4c83 100644
--- a/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/TestShowConsoleActionDelegate.java
+++ b/org.eclipse.jdt.debug.tests/console tests/org/eclipse/jdt/debug/tests/console/TestShowConsoleActionDelegate.java
@@ -99,7 +99,7 @@ public class TestShowConsoleActionDelegate implements IActionDelegate2, IWorkben
}
private void writeToStream(final MessageConsoleStream stream, final String str) {
- stream.print(str); //$NON-NLS-1$
+ stream.print(str);
}
/**
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ContextView.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ContextView.java
index 90ca1365d..a629dc1df 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ContextView.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ContextView.java
@@ -27,6 +27,7 @@ public class ContextView extends ViewPart {
/**
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
}
@@ -34,6 +35,7 @@ public class ContextView extends ViewPart {
/**
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
+ @Override
public void setFocus() {
viewer.getControl().setFocus();
}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementEventWaiter.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementEventWaiter.java
index 5d7445875..24c0fa875 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementEventWaiter.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementEventWaiter.java
@@ -32,6 +32,7 @@ public class DebugElementEventWaiter extends DebugEventWaiter {
/**
* @see org.eclipse.jdt.debug.testplugin.DebugEventWaiter#accept(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
public boolean accept(DebugEvent event) {
return super.accept(event) && fElement == event.getSource();
}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventDetailWaiter.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventDetailWaiter.java
index f079d2be4..7bfbcb4c8 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventDetailWaiter.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventDetailWaiter.java
@@ -33,6 +33,7 @@ public class DebugElementKindEventDetailWaiter extends DebugElementKindEventWait
/**
* @see org.eclipse.jdt.debug.testplugin.DebugElementKindEventWaiter#accept(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
public boolean accept(DebugEvent event) {
return super.accept(event) && fDetail == event.getDetail();
}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventWaiter.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventWaiter.java
index 10825e5bc..6755cb607 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventWaiter.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/DebugElementKindEventWaiter.java
@@ -34,6 +34,7 @@ public class DebugElementKindEventWaiter extends DebugEventWaiter {
/**
* @see org.eclipse.jdt.debug.testplugin.DebugEventWaiter#accept(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
public boolean accept(DebugEvent event) {
Object o = event.getSource();
return super.accept(event) && fElementClass.isInstance(o);
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ExpressionWaiter.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ExpressionWaiter.java
index 73e2b62d6..e8491b29a 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ExpressionWaiter.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/ExpressionWaiter.java
@@ -31,6 +31,7 @@ public class ExpressionWaiter extends DebugElementEventWaiter {
/**
* @see org.eclipse.jdt.debug.testplugin.DebugElementEventWaiter#accept(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
public boolean accept(DebugEvent event) {
if (event.getDetail() == DebugEvent.STATE) {
return false;
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaAlernateModeTab.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaAlernateModeTab.java
index bbd7b1973..10981de7b 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaAlernateModeTab.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaAlernateModeTab.java
@@ -54,6 +54,7 @@ public class JavaAlernateModeTab extends AbstractLaunchConfigurationTab implemen
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this);
super.dispose();
@@ -100,6 +101,7 @@ public class JavaAlernateModeTab extends AbstractLaunchConfigurationTab implemen
fAlternateModeCheckBox = new Button(parent, SWT.CHECK);
fAlternateModeCheckBox.setText("Check &me for 'alternate' mode");
fAlternateModeCheckBox.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
@@ -111,6 +113,7 @@ public class JavaAlernateModeTab extends AbstractLaunchConfigurationTab implemen
/**
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.tests.javaAlternateModeTab";
}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/NullVariableInitializer.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/NullVariableInitializer.java
index c04b6e949..f52e9c57b 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/NullVariableInitializer.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/NullVariableInitializer.java
@@ -29,6 +29,7 @@ public class NullVariableInitializer extends ClasspathVariableInitializer {
*
* @see org.eclipse.jdt.core.ClasspathVariableInitializer#initialize(java.lang.String)
*/
+ @Override
public void initialize(String variable) {
}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/SpecificDebugElementEventWaiter.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/SpecificDebugElementEventWaiter.java
index 9d7f52173..f0fbae116 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/SpecificDebugElementEventWaiter.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/SpecificDebugElementEventWaiter.java
@@ -35,6 +35,7 @@ public class SpecificDebugElementEventWaiter extends DebugEventWaiter {
/**
* @see org.eclipse.jdt.debug.testplugin.DebugEventWaiter#accept(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
public boolean accept(DebugEvent event) {
Object o = event.getSource();
if (o instanceof IDebugElement) {
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/TestClasspathContainerInitializer.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/TestClasspathContainerInitializer.java
index 1c0d56d89..fd855d914 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/TestClasspathContainerInitializer.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/TestClasspathContainerInitializer.java
@@ -23,6 +23,7 @@ public class TestClasspathContainerInitializer extends ClasspathContainerInitial
/**
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
// never called
}
@@ -30,6 +31,7 @@ public class TestClasspathContainerInitializer extends ClasspathContainerInitial
/**
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public Object getComparisonID(IPath containerPath, IJavaProject project) {
return project;
}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/detailpane/TableDetailPane.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/detailpane/TableDetailPane.java
index 4c4f52be8..1e9e3031c 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/detailpane/TableDetailPane.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/detailpane/TableDetailPane.java
@@ -222,6 +222,7 @@ public class TableDetailPane implements IDetailPane, IValueDetailListener {
*/
public void detailComputed(IValue value, final String result){
WorkbenchJob append = new WorkbenchJob("append details") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
fText.setDocument(new Document(result));
return Status.OK_STATUS;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugPerformanceTest.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugPerformanceTest.java
index 1bc6fddb6..48de2f9b8 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugPerformanceTest.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugPerformanceTest.java
@@ -33,6 +33,7 @@ public class AbstractDebugPerformanceTest extends AbstractDebugTest {
* Overridden to create a default performance meter for this test case.
* @throws Exception
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
Performance performance= Performance.getDefault();
@@ -43,6 +44,7 @@ public class AbstractDebugPerformanceTest extends AbstractDebugTest {
* Overridden to dispose of the performance meter.
* @throws Exception
*/
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
fPerformanceMeter.dispose();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
index 96b6f0331..67de591d4 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
@@ -145,6 +145,7 @@ import com.sun.jdi.InternalException;
/**
* Tests for launch configurations
*/
+@SuppressWarnings("deprecation")
public abstract class AbstractDebugTest extends TestCase implements IEvaluationListener {
public static final String MULTI_OUTPUT_PROJECT_NAME = "MultiOutput";
@@ -212,6 +213,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
setPreferences();
@@ -2256,6 +2258,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
* When a test throws the 'try again' exception, try it again.
* @see junit.framework.TestCase#runBare()
*/
+ @Override
public void runBare() throws Throwable {
boolean tryAgain = true;
int attempts = 0;
@@ -2289,6 +2292,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
} else {
final IEditorPart[] parts = new IEditorPart[1];
WorkbenchJob job = new WorkbenchJob(display, "open editor") {
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
@@ -2317,6 +2321,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
protected IBreakpoint toggleBreakpoint(final IEditorPart editor, int lineNumber) throws InterruptedException {
final IVerticalRulerInfo info = new VerticalRulerInfoStub(lineNumber-1); // sub 1, as the doc lines start at 0
WorkbenchJob job = new WorkbenchJob(DebugUIPlugin.getStandardDisplay(), "toggle breakpoint") {
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
ToggleBreakpointAction action = new ToggleBreakpointAction(editor, null, info);
action.run();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/DebugSuite.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/DebugSuite.java
index 136f24849..214b22acb 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/DebugSuite.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/DebugSuite.java
@@ -41,6 +41,7 @@ public abstract class DebugSuite extends TestSuite {
* waiter blocks the UI when a resource changes.
* @see junit.framework.TestSuite#run(junit.framework.TestResult)
*/
+ @Override
public void run(final TestResult result) {
final Display display = Display.getCurrent();
Thread thread = null;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/EvalTestSuite.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/EvalTestSuite.java
index cee884033..e6b73e6eb 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/EvalTestSuite.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/EvalTestSuite.java
@@ -231,6 +231,7 @@ public class EvalTestSuite extends TestSuite {
* waiter blocks the UI when a resource changes.
* @see junit.framework.TestSuite#run(junit.framework.TestResult)
*/
+ @Override
public void run(final TestResult result) {
final Display display = Display.getCurrent();
Thread thread = null;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ManualSuite.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ManualSuite.java
index ecae03c45..489d42a93 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ManualSuite.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ManualSuite.java
@@ -59,6 +59,7 @@ public class ManualSuite extends TestSuite {
* waiter blocks the UI when a resource changes.
* @see junit.framework.TestSuite#run(junit.framework.TestResult)
*/
+ @Override
public void run(final TestResult result) {
final Display display = Display.getCurrent();
Thread thread = null;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ProjectCreationDecorator.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ProjectCreationDecorator.java
index b411b3628..589f5dfba 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ProjectCreationDecorator.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ProjectCreationDecorator.java
@@ -44,6 +44,7 @@ public class ProjectCreationDecorator extends AbstractDebugTest {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.tests.AbstractDebugTest#getProjectContext()
*/
+ @Override
protected IJavaProject getProjectContext() {
return get14Project();
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointFieldLocator.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointFieldLocator.java
index 02664dcea..e487626ea 100755..100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointFieldLocator.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointFieldLocator.java
@@ -72,6 +72,7 @@ public class BreakpointFieldLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CompilationUnit)
*/
+ @Override
public boolean visit(CompilationUnit node) {
// visit only the type declarations
List types = node.types();
@@ -84,6 +85,7 @@ public class BreakpointFieldLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldDeclaration)
*/
+ @Override
public boolean visit(FieldDeclaration node) {
if (containsPosition(node)) {
// visit only the variable declaration fragments
@@ -104,6 +106,7 @@ public class BreakpointFieldLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclaration)
*/
+ @Override
public boolean visit(TypeDeclaration node) {
if (containsPosition(node)) {
// visit the field declarations
@@ -125,6 +128,7 @@ public class BreakpointFieldLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationFragment)
*/
+ @Override
public boolean visit(VariableDeclarationFragment node) {
if (containsPosition(node)) {
fFieldName= node.getName().getIdentifier();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointMethodLocator.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointMethodLocator.java
index 5fc2361b1..f8b6e5205 100755..100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointMethodLocator.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/BreakpointMethodLocator.java
@@ -139,6 +139,7 @@ public class BreakpointMethodLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CompilationUnit)
*/
+ @Override
public boolean visit(CompilationUnit node) {
// visit only the type declarations
List types = node.types();
@@ -151,6 +152,7 @@ public class BreakpointMethodLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldDeclaration)
*/
+ @Override
public boolean visit(MethodDeclaration node) {
if (containsPosition(node)) {
if (node.isConstructor()) {
@@ -168,6 +170,7 @@ public class BreakpointMethodLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclaration)
*/
+ @Override
public boolean visit(TypeDeclaration node) {
if (containsPosition(node)) {
// visit the methode declarations
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/JavaBreakpointListenerTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/JavaBreakpointListenerTests.java
index 50548f1e2..e92e390a6 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/JavaBreakpointListenerTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/JavaBreakpointListenerTests.java
@@ -150,6 +150,7 @@ public class JavaBreakpointListenerTests extends AbstractDebugTest implements IJ
/**
* @see org.eclipse.jdt.debug.tests.breakpoints.JavaBreakpointListenerTests.SuspendVoter#installingBreakpoint(org.eclipse.jdt.debug.core.IJavaDebugTarget, org.eclipse.jdt.debug.core.IJavaBreakpoint, org.eclipse.jdt.debug.core.IJavaType)
*/
+ @Override
public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type) {
if (breakpoint.equals(fTheBreakpoint)) {
return fVote;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/MethodBreakpointTests15.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/MethodBreakpointTests15.java
index 5bea9df2e..b8aae4412 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/MethodBreakpointTests15.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/MethodBreakpointTests15.java
@@ -32,6 +32,7 @@ public class MethodBreakpointTests15 extends AbstractDebugTest {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.tests.AbstractDebugTest#getProjectContext()
*/
+ @Override
protected IJavaProject getProjectContext() {
return get15Project();
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/PatternBreakpointTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/PatternBreakpointTests.java
index 2aaf16bca..c55b0e1ca 100755..100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/PatternBreakpointTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/PatternBreakpointTests.java
@@ -23,6 +23,7 @@ import org.eclipse.jdt.debug.tests.AbstractDebugTest;
/**
* Tests deferred pattern breakpoints.
*/
+@SuppressWarnings("deprecation")
public class PatternBreakpointTests extends AbstractDebugTest {
/**
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java
index fb69761cc..1a7c1777e 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java
@@ -48,7 +48,8 @@ public class ConsoleInputTests extends AbstractDebugTest implements IConsoleLine
super(name);
}
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
super.setUp();
fStarted = false;
fStopped = false;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleTests.java
index 4ebdc0995..c4db1b85d 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleTests.java
@@ -39,12 +39,14 @@ public class ConsoleTests extends AbstractDebugTest {
super("Life's like that", null, autoLifecycle);
}
- protected void init() {
+ @Override
+ protected void init() {
super.init();
fInit = true;
}
- protected void dispose() {
+ @Override
+ protected void dispose() {
super.dispose();
fDispose = true;
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java
index a6cf9d949..7d6f075e8 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java
@@ -93,6 +93,7 @@ public class HcrTests extends AbstractDebugTest {
*
* @see junit.framework.TestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
ICompilationUnit cu = getCompilationUnit(get14Project(), "src", "org.eclipse.debug.tests.targets", "HcrClass.java");
cu = cu.getPrimary();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaLibraryPathTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaLibraryPathTests.java
index 597d3f0fe..3e73bfdaa 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaLibraryPathTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaLibraryPathTests.java
@@ -42,6 +42,7 @@ import org.eclipse.jdt.launching.JavaRuntime;
*
* @since 3.1
*/
+@SuppressWarnings("deprecation")
public class JavaLibraryPathTests extends AbstractDebugTest {
public JavaLibraryPathTests(String name) {
@@ -51,12 +52,14 @@ public class JavaLibraryPathTests extends AbstractDebugTest {
/**
* Create test projects "PathTests1/2/3"
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
createProject("PathTests1");
createProject("PathTests2");
}
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
deleteProject("PathTests1");
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LineTrackerTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LineTrackerTests.java
index 37e7af482..adb8a254a 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LineTrackerTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LineTrackerTests.java
@@ -59,13 +59,15 @@ public class LineTrackerTests extends AbstractDebugTest implements IConsoleLineT
super(name);
}
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
super.setUp();
fStarted = false;
fStopped = false;
}
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
super.tearDown();
// delete references and gc to free memory.
fConsole = null;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LiteralTests17.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LiteralTests17.java
index ae4878f19..9aa129a87 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LiteralTests17.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LiteralTests17.java
@@ -37,6 +37,7 @@ public class LiteralTests17 extends AbstractDebugTest {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.tests.AbstractDebugTest#getProjectContext()
*/
+ @Override
protected IJavaProject getProjectContext() {
return get17Project();
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/StringSubstitutionTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/StringSubstitutionTests.java
index a83c00942..8aa8d626f 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/StringSubstitutionTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/StringSubstitutionTests.java
@@ -461,6 +461,7 @@ public class StringSubstitutionTests extends AbstractDebugTest implements IValue
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
fAdded = null;
@@ -473,6 +474,7 @@ public class StringSubstitutionTests extends AbstractDebugTest implements IValue
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/WatchExpressionTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/WatchExpressionTests.java
index 39440f6ef..b814b5659 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/WatchExpressionTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/WatchExpressionTests.java
@@ -189,6 +189,7 @@ public class WatchExpressionTests extends AbstractDebugTest {
/**
* Ensure the expression view is visible
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
Display display = DebugUIPlugin.getStandardDisplay();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ConfigurationEncodingTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ConfigurationEncodingTests.java
index 7875ca42c..449933e6b 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ConfigurationEncodingTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ConfigurationEncodingTests.java
@@ -25,6 +25,7 @@ import org.eclipse.jdt.debug.tests.AbstractDebugTest;
* scenarios
* @since 3.4
*/
+@SuppressWarnings("deprecation")
public class ConfigurationEncodingTests extends AbstractDebugTest {
/**
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchShortcutTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchShortcutTests.java
index ba9e4f6c2..829c96b70 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchShortcutTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchShortcutTests.java
@@ -23,6 +23,7 @@ import org.eclipse.ui.activities.WorkbenchActivityHelper;
*
* @since 3.3
*/
+@SuppressWarnings("deprecation")
public class LaunchShortcutTests extends AbstractDebugTest {
private static String TESTING = "testing"; //$NON-NLS-1$
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchesTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchesTests.java
index 073defdee..f33e9cc2f 100755..100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchesTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LaunchesTests.java
@@ -36,6 +36,7 @@ public class LaunchesTests extends AbstractDebugTest implements ILaunchesListene
+ @Override
protected void setUp() throws Exception {
added = false;
removed = false;
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java
index 57afe5746..055313a56 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java
@@ -77,7 +77,8 @@ public class PerfConsoleTests extends AbstractDebugPerformanceTest implements IC
/**
* @see org.eclipse.jdt.debug.tests.AbstractDebugPerformanceTest#setUp()
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
super.setUp();
fStarted = false;
fStopped = false;
@@ -87,7 +88,8 @@ public class PerfConsoleTests extends AbstractDebugPerformanceTest implements IC
/**
* @see org.eclipse.jdt.debug.tests.AbstractDebugPerformanceTest#tearDown()
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
super.tearDown();
ConsoleLineTracker.setDelegate(null);
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/refactoring/MemberParser.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/refactoring/MemberParser.java
index 7c8d3f30b..7fda506ef 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/refactoring/MemberParser.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/refactoring/MemberParser.java
@@ -422,7 +422,7 @@ public class MemberParser{
}
}
- return IInternalDebugCoreConstants.EMPTY_STRING;//entire thing is a number //$NON-NLS-1$
+ return IInternalDebugCoreConstants.EMPTY_STRING;//entire thing is a number
}
/**
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/ArchiveSourceLookupTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/ArchiveSourceLookupTests.java
index 030458528..53dac3d65 100755..100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/ArchiveSourceLookupTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/ArchiveSourceLookupTests.java
@@ -21,6 +21,7 @@ import org.eclipse.jdt.launching.sourcelookup.ZipEntryStorage;
/**
* Tests source lookup in archives
*/
+@SuppressWarnings("deprecation")
public class ArchiveSourceLookupTests extends AbstractDebugTest {
public ArchiveSourceLookupTests(String name) {
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceLookupTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceLookupTests.java
index 1ee8eb872..ed8ca4aed 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceLookupTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceLookupTests.java
@@ -23,6 +23,7 @@ import org.eclipse.jdt.launching.sourcelookup.LocalFileStorage;
/**
* Tests source lookup in directories
*/
+@SuppressWarnings("deprecation")
public class DirectorySourceLookupTests extends AbstractDebugTest {
public DirectorySourceLookupTests(String name) {
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java
index 552108b1b..63fa14e57 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java
@@ -65,6 +65,7 @@ public class JarSourceLookupTests extends AbstractDebugTest {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.tests.AbstractDebugTest#getProjectContext()
*/
+ @Override
protected IJavaProject getProjectContext() {
return fgJarProject;
}
@@ -72,6 +73,7 @@ public class JarSourceLookupTests extends AbstractDebugTest {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.tests.AbstractDebugTest#setUp()
*/
+ @Override
protected void setUp() throws Exception {
IPath testrpath = new Path("testresources");
createProjectClone(fJarProject, testrpath.append(fJarProject).toString(), false);
@@ -81,6 +83,7 @@ public class JarSourceLookupTests extends AbstractDebugTest {
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
removeAllBreakpoints();
super.tearDown();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLocationTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLocationTests.java
index a819dd86f..25dc4bbb8 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLocationTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLocationTests.java
@@ -33,6 +33,7 @@ import org.eclipse.jdt.launching.sourcelookup.PackageFragmentRootSourceLocation;
/**
* Tests source location creation/restoration.
*/
+@SuppressWarnings("deprecation")
public class SourceLocationTests extends AbstractDebugTest {
public static final String JRE_CONTAINER_1_4_CPE_NAME = "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4";
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLookupTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLookupTests.java
index a95993dd7..0bc25f821 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLookupTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/SourceLookupTests.java
@@ -28,6 +28,7 @@ import org.eclipse.jdt.launching.sourcelookup.PackageFragmentRootSourceLocation;
/**
* Tests source lookup in source folders
*/
+@SuppressWarnings("deprecation")
public class SourceLookupTests extends AbstractDebugTest {
public SourceLookupTests(String name) {
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/OpenFromClipboardTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/OpenFromClipboardTests.java
index df6806428..2f3ebea90 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/OpenFromClipboardTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/OpenFromClipboardTests.java
@@ -81,11 +81,13 @@ public class OpenFromClipboardTests extends TestCase {
super(test);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
fJProject = createProject("OpenFromClipboardTests");
}
+ @Override
protected void tearDown() throws Exception {
fJProject.getProject().delete(true, true, null);
super.tearDown();
@@ -117,11 +119,13 @@ public class OpenFromClipboardTests extends TestCase {
return new MyTestSetup(someTest);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
fSourceFolder = JavaProjectHelper.addSourceContainer(MyTestSetup.fJProject, "src");
}
+ @Override
protected void tearDown() throws Exception {
JavaProjectHelper.removeSourceContainer(MyTestSetup.fJProject, "src");
super.tearDown();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/ViewMangementTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/ViewMangementTests.java
index 4eb905545..ae3771898 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/ViewMangementTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/ViewMangementTests.java
@@ -150,6 +150,7 @@ public class ViewMangementTests extends AbstractDebugTest implements IPerspectiv
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
IPreferenceStore preferenceStore = DebugUITools.getPreferenceStore();
@@ -167,6 +168,7 @@ public class ViewMangementTests extends AbstractDebugTest implements IPerspectiv
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
IPreferenceStore preferenceStore = DebugUITools.getPreferenceStore();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/performance/OpenLaunchConfigurationDialogTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/performance/OpenLaunchConfigurationDialogTests.java
index 2d8f63968..be9047ebb 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/performance/OpenLaunchConfigurationDialogTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/performance/OpenLaunchConfigurationDialogTests.java
@@ -72,7 +72,7 @@ public class OpenLaunchConfigurationDialogTests extends AbstractDebugPerformance
*/
private void openLCD(final IStructuredSelection selection, final String groupIdentifier) {
//set a status to go to the classpath tab
- IStatus status = new Status(IStatus.INFO, IJavaDebugUIConstants.PLUGIN_ID, 1000, IInternalDebugCoreConstants.EMPTY_STRING, null); //$NON-NLS-1$
+ IStatus status = new Status(IStatus.INFO, IJavaDebugUIConstants.PLUGIN_ID, 1000, IInternalDebugCoreConstants.EMPTY_STRING, null);
LaunchConfigurationsDialog dialog= new LaunchConfigurationsDialog(DebugUIPlugin.getShell(), DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier));
dialog.setBlockOnOpen(false);
dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestAnonymousInspect.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestAnonymousInspect.java
index 9519e6069..3c9cdb5c1 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestAnonymousInspect.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestAnonymousInspect.java
@@ -52,6 +52,7 @@ public class TestAnonymousInspect extends AbstractDebugTest {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.tests.AbstractDebugTest#setUp()
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
createLaunchConfiguration(get14Project(), TYPE_NAME);
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestIntegerAccessUnboxing15.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestIntegerAccessUnboxing15.java
index cd26f265f..f4ab86ae4 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestIntegerAccessUnboxing15.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/variables/TestIntegerAccessUnboxing15.java
@@ -93,6 +93,7 @@ public class TestIntegerAccessUnboxing15 extends AbstractDebugTest {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.tests.AbstractDebugTest#getProjectContext()
*/
+ @Override
protected IJavaProject getProjectContext() {
return get15Project();
}
diff --git a/org.eclipse.jdt.debug.ui/.classpath b/org.eclipse.jdt.debug.ui/.classpath
index f921cfa92..92443192a 100644
--- a/org.eclipse.jdt.debug.ui/.classpath
+++ b/org.eclipse.jdt.debug.ui/.classpath
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="ui"/>
<classpathentry kind="src" output="snippet_bin" path="Snippet Support"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs
index 406da01de..9f2085381 100644
--- a/org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Thu Jan 20 17:01:44 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,17 +6,22 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -26,11 +30,12 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
@@ -63,21 +68,30 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -99,7 +113,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
diff --git a/org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..bf9e9379a
--- /dev/null
+++ b/org.eclipse.jdt.debug.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
diff --git a/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
index 2574d24b4..f7c521d07 100644
--- a/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
@@ -49,4 +49,4 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
com.ibm.icu,
org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaSourceLookupDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaSourceLookupDialog.java
index cd760631c..b2391a316 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaSourceLookupDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaSourceLookupDialog.java
@@ -47,6 +47,7 @@ import org.eclipse.swt.widgets.Shell;
* <code>org.eclipse.debug.ui.sourcelookup.SourceLookupDialog</code>.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class JavaSourceLookupDialog extends Dialog {
private SourceLookupBlock fSourceLookupBlock;
@@ -90,6 +91,7 @@ public class JavaSourceLookupDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Font font = parent.getFont();
initializeDialogUnits(parent);
@@ -127,6 +129,7 @@ public class JavaSourceLookupDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
try {
if (fAskAgainCheckBox != null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaUISourceLocator.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaUISourceLocator.java
index 2e3894e57..9e908d454 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaUISourceLocator.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaUISourceLocator.java
@@ -68,6 +68,7 @@ import com.ibm.icu.text.MessageFormat;
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class JavaUISourceLocator implements IPersistableSourceLocator {
/**
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/actions/JavaBreakpointPropertiesRulerActionDelegate.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/actions/JavaBreakpointPropertiesRulerActionDelegate.java
index cf16fe1c2..1e9145749 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/actions/JavaBreakpointPropertiesRulerActionDelegate.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/actions/JavaBreakpointPropertiesRulerActionDelegate.java
@@ -48,6 +48,7 @@ public class JavaBreakpointPropertiesRulerActionDelegate extends AbstractRulerAc
/**
* @see AbstractRulerActionDelegate#createAction(ITextEditor, IVerticalRulerInfo)
*/
+ @Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
return new JavaBreakpointPropertiesRulerAction(editor, rulerInfo);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java
index 48b76093e..90918a80e 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java
@@ -197,6 +197,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
*
* @param listener listener
*/
+ @Override
public void addPropertyListener(IPropertyListener listener) {
super.addPropertyListener(listener);
}
@@ -206,6 +207,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
*
* @param listener listener
*/
+ @Override
public void removePropertyListener(IPropertyListener listener) {
super.removePropertyListener(listener);
}
@@ -216,6 +218,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
* @param input breakpoint or <code>null</code>
* @throws CoreException if unable to access breakpoint attributes
*/
+ @Override
public void setInput(Object input) throws CoreException {
try {
boolean sameBreakpoint= fBreakpoint == input;
@@ -296,6 +299,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
fCompletionProcessor = new JavaDebugContentAssistProcessor(context);
document.set((condition == null ? "" : condition)); //$NON-NLS-1$
fViewer.configure(new DisplayViewerConfiguration() {
+ @Override
public IContentAssistProcessor getContentAssistantProcessor() {
return fCompletionProcessor;
}
@@ -325,6 +329,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
* @param parent composite to embed the editor controls in
* @return top level control
*/
+ @Override
public Control createControl(Composite parent) {
Composite controls = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_HORIZONTAL, 0, 0);
fConditional = SWTFactory.createCheckButton(controls,
@@ -334,6 +339,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
1);
fConditional.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
fConditional.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
boolean checked = fConditional.getSelection();
setEnabled(checked, true);
@@ -346,11 +352,13 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
fWhenChange = SWTFactory.createRadioButton(radios, processMnemonics(PropertyPageMessages.JavaBreakpointConditionEditor_2));
fWhenChange.setLayoutData(new GridData());
fWhenTrue.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setDirty(PROP_CONDITION_SUSPEND_POLICY);
}
});
fWhenChange.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setDirty(PROP_CONDITION_SUSPEND_POLICY);
}
@@ -361,6 +369,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
fConditionHistory= SWTFactory.createCombo(parent, SWT.DROP_DOWN | SWT.READ_ONLY, 1, null);
initializeConditionHistoryDropDown();
fConditionHistory.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
int historyIndex= fConditionHistory.getSelectionIndex() - 1;
if (historyIndex >= 0 && historyIndex != fSeparatorIndex)
@@ -409,9 +418,11 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
};
fHandlerService = (IHandlerService) PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
fViewer.getControl().addFocusListener(new FocusAdapter() {
+ @Override
public void focusGained(FocusEvent e) {
activateHandlers();
}
+ @Override
public void focusLost(FocusEvent e) {
deactivateHandlers();
}
@@ -428,6 +439,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
* Disposes this editor and its controls. Once disposed, the editor can no
* longer be used.
*/
+ @Override
protected void dispose() {
super.dispose();
deactivateHandlers();
@@ -440,6 +452,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
/**
* Gives focus to an appropriate control in the editor.
*/
+ @Override
public void setFocus() {
fViewer.getControl().setFocus();
}
@@ -451,6 +464,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
*
* @exception CoreException if unable to update the breakpoint.
*/
+ @Override
public void doSave() throws CoreException {
if (fBreakpoint != null && isDirty()) {
fBreakpoint.setCondition(fViewer.getDocument().get().trim());
@@ -469,6 +483,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
*
* @return editor status.
*/
+ @Override
public IStatus getStatus() {
if (fBreakpoint != null && fBreakpoint.supportsCondition()) {
if (fConditional.getSelection()) {
@@ -485,6 +500,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
*
* @return whether the editor needs saving
*/
+ @Override
public boolean isDirty() {
return super.isDirty();
}
@@ -496,6 +512,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
*
* @param mnemonics whether to display mnemonics
*/
+ @Override
public void setMnemonics(boolean mnemonics) {
super.setMnemonics(mnemonics);
}
@@ -572,6 +589,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
*
* @return breakpoint or <code>null</code>
*/
+ @Override
public Object getInput() {
return fBreakpoint;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AbstractVMInstallPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AbstractVMInstallPage.java
index da75240e0..ee66ddc49 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AbstractVMInstallPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AbstractVMInstallPage.java
@@ -174,6 +174,7 @@ public abstract class AbstractVMInstallPage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#getNextPage()
*/
+ @Override
public IWizardPage getNextPage() {
return null;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletArgumentsTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletArgumentsTab.java
index f89413ef6..e3e9f82de 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletArgumentsTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletArgumentsTab.java
@@ -31,6 +31,7 @@ public class AppletArgumentsTab extends JavaArgumentsTab {
/**
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab#createWorkingDirBlock()
*/
+ @Override
protected WorkingDirectoryBlock createWorkingDirBlock() {
return new AppletWorkingDirectoryBlock();
}
@@ -38,6 +39,7 @@ public class AppletArgumentsTab extends JavaArgumentsTab {
/**
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab#setHelpContextId()
*/
+ @Override
protected void setHelpContextId() {
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_APPLET_ARGUMENTS_TAB);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletMainTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletMainTab.java
index a8ac66618..2befa079c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletMainTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletMainTab.java
@@ -97,6 +97,7 @@ public class AppletMainTab extends SharedJavaMainTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CLASS);
}
@@ -124,6 +125,7 @@ public class AppletMainTab extends SharedJavaMainTab {
/**
* Show a dialog that lists all main types
*/
+ @Override
protected void handleSearchButtonSelected() {
IJavaElement[] scope= null;
IJavaProject project = getJavaProject();
@@ -180,6 +182,7 @@ public class AppletMainTab extends SharedJavaMainTab {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.launcher.AbstractJavaMainTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration config) {
super.initializeFrom(config);
updateMainTypeFromConfig(config);
@@ -196,6 +199,7 @@ public class AppletMainTab extends SharedJavaMainTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
@@ -284,6 +288,7 @@ public class AppletMainTab extends SharedJavaMainTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.appletMainTab"; //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java
index 3cb783fbe..5fb8acb2f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java
@@ -80,6 +80,7 @@ public class AppletParametersTab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
+ @Override
public void widgetSelected(SelectionEvent e) {
Object source= e.getSource();
if (source == fViewer.getTable() || source == fViewer) {
@@ -167,6 +168,7 @@ public class AppletParametersTab extends JavaLaunchTab {
ptable.setLinesVisible(true);
ptable.addSelectionListener(fListener);
ptable.addMouseListener(new MouseAdapter() {
+ @Override
public void mouseDoubleClick(MouseEvent e) {
setParametersButtonsEnableState();
if (fParametersEditButton.isEnabled()) {
@@ -234,6 +236,7 @@ public class AppletParametersTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
try {
@@ -370,6 +373,7 @@ public class AppletParametersTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration config) {
try {
fWidthText.setText(Integer.toString(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_WIDTH, DEFAULT_APPLET_WIDTH)));
@@ -410,6 +414,7 @@ public class AppletParametersTab extends JavaLaunchTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.appletParametersTab"; //$NON-NLS-1$
}
@@ -417,6 +422,7 @@ public class AppletParametersTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_VIEW_ARGUMENTS_TAB);
}
@@ -424,6 +430,7 @@ public class AppletParametersTab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when activated
}
@@ -431,6 +438,7 @@ public class AppletParametersTab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when de-activated
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaAppletLaunchShortcut.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaAppletLaunchShortcut.java
index f87316f01..54b5f315b 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaAppletLaunchShortcut.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaAppletLaunchShortcut.java
@@ -40,6 +40,7 @@ public class JavaAppletLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#createConfiguration(org.eclipse.jdt.core.IType)
*/
+ @Override
protected ILaunchConfiguration createConfiguration(IType type) {
ILaunchConfiguration config = null;
try {
@@ -61,6 +62,7 @@ public class JavaAppletLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getConfigurationType()
*/
+ @Override
protected ILaunchConfigurationType getConfigurationType() {
ILaunchManager lm= DebugPlugin.getDefault().getLaunchManager();
return lm.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLET);
@@ -69,6 +71,7 @@ public class JavaAppletLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#findTypes(java.lang.Object[], org.eclipse.jface.operation.IRunnableContext)
*/
+ @Override
protected IType[] findTypes(Object[] elements, IRunnableContext context) throws InterruptedException, CoreException {
try {
return AppletLaunchConfigurationUtils.findApplets(context, elements);
@@ -80,6 +83,7 @@ public class JavaAppletLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getTypeSelectionTitle()
*/
+ @Override
protected String getTypeSelectionTitle() {
return LauncherMessages.JavaAppletLaunchShortcut_0;
}
@@ -87,6 +91,7 @@ public class JavaAppletLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getEditorEmptyMessage()
*/
+ @Override
protected String getEditorEmptyMessage() {
return LauncherMessages.JavaAppletLaunchShortcut_1;
}
@@ -94,6 +99,7 @@ public class JavaAppletLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getSelectionEmptyMessage()
*/
+ @Override
protected String getSelectionEmptyMessage() {
return LauncherMessages.JavaAppletLaunchShortcut_2;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaApplicationLaunchShortcut.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaApplicationLaunchShortcut.java
index 71c485462..e3e53d4e4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaApplicationLaunchShortcut.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaApplicationLaunchShortcut.java
@@ -78,6 +78,7 @@ public class JavaApplicationLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#createConfiguration(org.eclipse.jdt.core.IType)
*/
+ @Override
protected ILaunchConfiguration createConfiguration(IType type) {
ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
@@ -97,6 +98,7 @@ public class JavaApplicationLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getConfigurationType()
*/
+ @Override
protected ILaunchConfigurationType getConfigurationType() {
return getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
}
@@ -113,6 +115,7 @@ public class JavaApplicationLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#findTypes(java.lang.Object[], org.eclipse.jface.operation.IRunnableContext)
*/
+ @Override
protected IType[] findTypes(Object[] elements, IRunnableContext context) throws InterruptedException, CoreException {
try {
if(elements.length == 1) {
@@ -157,6 +160,7 @@ public class JavaApplicationLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getTypeSelectionTitle()
*/
+ @Override
protected String getTypeSelectionTitle() {
return LauncherMessages.JavaApplicationLaunchShortcut_0;
}
@@ -164,6 +168,7 @@ public class JavaApplicationLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getEditorEmptyMessage()
*/
+ @Override
protected String getEditorEmptyMessage() {
return LauncherMessages.JavaApplicationLaunchShortcut_1;
}
@@ -171,6 +176,7 @@ public class JavaApplicationLaunchShortcut extends JavaLaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#getSelectionEmptyMessage()
*/
+ @Override
protected String getSelectionEmptyMessage() {
return LauncherMessages.JavaApplicationLaunchShortcut_2;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaArgumentsTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaArgumentsTab.java
index a25d80505..9973b1dfd 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaArgumentsTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaArgumentsTab.java
@@ -150,6 +150,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
Button pgrmArgVariableButton = createPushButton(group, buttonLabel, null);
pgrmArgVariableButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
pgrmArgVariableButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
@@ -176,12 +177,14 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
}
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration config) {
return fWorkingDirectoryBlock.isValid(config);
}
@@ -200,6 +203,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
fPrgmArgumentsText.setText(configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "")); //$NON-NLS-1$
@@ -243,6 +247,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setLaunchConfigurationDialog(ILaunchConfigurationDialog)
*/
+ @Override
public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
super.setLaunchConfigurationDialog(dialog);
fWorkingDirectoryBlock.setLaunchConfigurationDialog(dialog);
@@ -251,6 +256,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
String m = super.getErrorMessage();
if (m == null) {
@@ -262,6 +268,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getMessage()
*/
+ @Override
public String getMessage() {
String m = super.getMessage();
if (m == null) {
@@ -273,6 +280,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_VIEW_ARGUMENTS_TAB);
}
@@ -282,6 +290,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.javaArgumentsTab"; //$NON-NLS-1$
}
@@ -289,6 +298,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
fWorkingDirectoryBlock.initializeFrom(workingCopy);
}
@@ -296,6 +306,7 @@ public class JavaArgumentsTab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when deactivated
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaClasspathTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaClasspathTab.java
index 4fab66d8f..4c8499920 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaClasspathTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaClasspathTab.java
@@ -204,6 +204,7 @@ public class JavaClasspathTab extends AbstractJavaClasspathTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
refresh(configuration);
fClasspathViewer.expandToLevel(2);
@@ -212,6 +213,7 @@ public class JavaClasspathTab extends AbstractJavaClasspathTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
try {
boolean useDefault= workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
@@ -387,6 +389,7 @@ public class JavaClasspathTab extends AbstractJavaClasspathTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.javaClasspathTab"; //$NON-NLS-1$
}
@@ -415,6 +418,7 @@ public class JavaClasspathTab extends AbstractJavaClasspathTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
if (fClasspathViewer != null) {
fClasspathViewer.removeEntriesChangedListener(this);
@@ -425,6 +429,7 @@ public class JavaClasspathTab extends AbstractJavaClasspathTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return getClasspathImage();
}
@@ -432,6 +437,7 @@ public class JavaClasspathTab extends AbstractJavaClasspathTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java
index e458ea1aa..3110ae87f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaConnectTab.java
@@ -99,6 +99,7 @@ public class JavaConnectTab extends AbstractJavaMainTab implements IPropertyChan
}
fConnectorCombo = SWTFactory.createCombo(group, SWT.READ_ONLY, 1, GridData.FILL_HORIZONTAL, names);
fConnectorCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
handleConnectorComboModified();
}
@@ -188,6 +189,7 @@ public class JavaConnectTab extends AbstractJavaMainTab implements IPropertyChan
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.launcher.AbstractJavaMainTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration config) {
super.initializeFrom(config);
updateAllowTerminateFromConfig(config);
@@ -333,6 +335,7 @@ public class JavaConnectTab extends AbstractJavaMainTab implements IPropertyChan
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration config) {
setErrorMessage(null);
setMessage(null);
@@ -369,6 +372,7 @@ public class JavaConnectTab extends AbstractJavaMainTab implements IPropertyChan
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return DebugUITools.getImage(IDebugUIConstants.IMG_LCL_DISCONNECT);
}
@@ -378,6 +382,7 @@ public class JavaConnectTab extends AbstractJavaMainTab implements IPropertyChan
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.javaConnectTab"; //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
index 7e9610755..dffe02a91 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
@@ -99,6 +99,7 @@ public class JavaJRETab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
if (fJREBlock != null) {
@@ -156,6 +157,7 @@ public class JavaJRETab extends JavaLaunchTab {
/**
* @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
fIsInitializing = true;
getControl().setRedraw(false);
@@ -200,6 +202,7 @@ public class JavaJRETab extends JavaLaunchTab {
/**
* @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration config) {
setErrorMessage(null);
@@ -316,6 +319,7 @@ public class JavaJRETab extends JavaLaunchTab {
/**
* @see ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_LIBRARY);
}
@@ -325,6 +329,7 @@ public class JavaJRETab extends JavaLaunchTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.javaJRETab"; //$NON-NLS-1$
}
@@ -465,6 +470,7 @@ public class JavaJRETab extends JavaLaunchTab {
*
* @see ILaunchConfigurationTab#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
ILaunchConfigurationTab tab = getDynamicTab();
if ((super.getErrorMessage() != null) || (tab == null)) {
@@ -506,6 +512,7 @@ public class JavaJRETab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.jres.DefaultJREDescriptor#getDescription()
*/
+ @Override
public String getDescription() {
IJavaProject project = getJavaProject();
String name = LauncherMessages.JavaJRETab_7;
@@ -578,6 +585,7 @@ public class JavaJRETab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
// update the default JRE description, in case it has changed
// based on the selected project
@@ -587,6 +595,7 @@ public class JavaJRETab extends JavaLaunchTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when deactivated
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaMainTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaMainTab.java
index 362475a1e..96d9f158b 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaMainTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaMainTab.java
@@ -99,6 +99,7 @@ public class JavaMainTab extends SharedJavaMainTab {
/**
* @see org.eclipse.jdt.internal.debug.ui.launcher.SharedJavaMainTab#createMainTypeExtensions(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createMainTypeExtensions(Composite parent) {
fSearchExternalJarsCheckButton = SWTFactory.createCheckButton(parent, LauncherMessages.JavaMainTab_E_xt__jars_6, null, false, 2);
fSearchExternalJarsCheckButton.addSelectionListener(getDefaultListener());
@@ -113,6 +114,7 @@ public class JavaMainTab extends SharedJavaMainTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CLASS);
}
@@ -129,6 +131,7 @@ public class JavaMainTab extends SharedJavaMainTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.javaMainTab"; //$NON-NLS-1$
}
@@ -136,6 +139,7 @@ public class JavaMainTab extends SharedJavaMainTab {
/**
* Show a dialog that lists all main types
*/
+ @Override
protected void handleSearchButtonSelected() {
IJavaProject project = getJavaProject();
IJavaElement[] elements = null;
@@ -188,6 +192,7 @@ public class JavaMainTab extends SharedJavaMainTab {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.launcher.AbstractJavaMainTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration config) {
super.initializeFrom(config);
updateMainTypeFromConfig(config);
@@ -199,6 +204,7 @@ public class JavaMainTab extends SharedJavaMainTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration config) {
setErrorMessage(null);
setMessage(null);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaSourceLookupTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaSourceLookupTab.java
index 461030a8b..dda3a8107 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaSourceLookupTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaSourceLookupTab.java
@@ -46,6 +46,7 @@ import org.eclipse.ui.PlatformUI;
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class JavaSourceLookupTab extends JavaLaunchTab {
protected SourceLookupBlock fSourceLookupBlock;
@@ -87,6 +88,7 @@ public class JavaSourceLookupTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
fSourceLookupBlock.initializeFrom(configuration);
}
@@ -104,6 +106,7 @@ public class JavaSourceLookupTab extends JavaLaunchTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.javaSourceLookupTab"; //$NON-NLS-1$
}
@@ -118,6 +121,7 @@ public class JavaSourceLookupTab extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointChange.java
index 824da5667..b5315d332 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointChange.java
@@ -111,6 +111,7 @@ public abstract class BreakpointChange extends Change {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void initializeValidationData(IProgressMonitor pm) {
// do nothing
}
@@ -118,6 +119,7 @@ public abstract class BreakpointChange extends Change {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
return new RefactoringStatus();
}
@@ -125,6 +127,7 @@ public abstract class BreakpointChange extends Change {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
*/
+ @Override
public Object getModifiedElement() {
return fBreakpoint;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMovePackageParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMovePackageParticipant.java
index 48c52fa31..8f4c1bce2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMovePackageParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMovePackageParticipant.java
@@ -34,6 +34,7 @@ public class BreakpointMovePackageParticipant extends BreakpointMoveParticipant
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#accepts(org.eclipse.jdt.core.IJavaElement)
*/
+ @Override
protected boolean accepts(IJavaElement element) {
return element instanceof IPackageFragment && getArguments().getDestination() instanceof IPackageFragmentRoot;
}
@@ -41,6 +42,7 @@ public class BreakpointMovePackageParticipant extends BreakpointMoveParticipant
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointMoveParticipant#gatherChanges(org.eclipse.core.resources.IMarker[], java.util.List)
*/
+ @Override
protected void gatherChanges(IMarker[] markers, List changes) throws CoreException, OperationCanceledException {
IPackageFragmentRoot destRoot = (IPackageFragmentRoot)getDestination();
for (int i = 0; i < markers.length; i++) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveParticipant.java
index 60b4d3d07..855bc5e23 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveParticipant.java
@@ -54,6 +54,7 @@ public abstract class BreakpointMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
+ @Override
protected boolean initialize(Object element) {
if (element instanceof IJavaElement && accepts((IJavaElement)element)) {
fElement = (IJavaElement) element;
@@ -93,6 +94,7 @@ public abstract class BreakpointMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
+ @Override
public String getName() {
return RefactoringMessages.BreakpointRenameParticipant_0;
}
@@ -100,6 +102,7 @@ public abstract class BreakpointMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
+ @Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
return new RefactoringStatus();
}
@@ -107,6 +110,7 @@ public abstract class BreakpointMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
List changes = new ArrayList();
IResource resource = getBreakpointContainer();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveTypeParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveTypeParticipant.java
index cf13ac6a2..84fbe83dd 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveTypeParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointMoveTypeParticipant.java
@@ -33,6 +33,7 @@ public class BreakpointMoveTypeParticipant extends BreakpointMoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#accepts(org.eclipse.jdt.core.IJavaElement)
*/
+ @Override
protected boolean accepts(IJavaElement element) {
return element instanceof IType && getArguments().getDestination() instanceof IPackageFragment;
}
@@ -40,6 +41,7 @@ public class BreakpointMoveTypeParticipant extends BreakpointMoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointMoveParticipant#gatherChanges(org.eclipse.core.resources.IMarker[], java.util.List)
*/
+ @Override
protected void gatherChanges(IMarker[] markers, List changes) throws CoreException, OperationCanceledException {
IType originalType = (IType) getOriginalElement();
IPackageFragment destPackage = (IPackageFragment) getDestination();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameFieldParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameFieldParticipant.java
index 5d4784b9b..9aa2c6136 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameFieldParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameFieldParticipant.java
@@ -38,6 +38,7 @@ public class BreakpointRenameFieldParticipant extends BreakpointRenameParticipan
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#accepts(org.eclipse.jdt.core.IJavaElement)
*/
+ @Override
protected boolean accepts(IJavaElement element) {
return element instanceof IField;
}
@@ -45,6 +46,7 @@ public class BreakpointRenameFieldParticipant extends BreakpointRenameParticipan
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
List changes = new ArrayList();
IResource resource = getBreakpointContainer();
@@ -61,6 +63,7 @@ public class BreakpointRenameFieldParticipant extends BreakpointRenameParticipan
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#gatherChanges(org.eclipse.core.resources.IMarker[], java.util.List, java.lang.String)
*/
+ @Override
protected void gatherChanges(IMarker[] markers, List changes, String destFieldName) throws CoreException, OperationCanceledException {
IField originalField = (IField) getOriginalElement();
for (int i = 0; i < markers.length; i++) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameMethodParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameMethodParticipant.java
index b2c789c93..ad1968fa9 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameMethodParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameMethodParticipant.java
@@ -33,6 +33,7 @@ public class BreakpointRenameMethodParticipant extends BreakpointRenameParticipa
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#accepts(org.eclipse.jdt.core.IJavaElement)
*/
+ @Override
protected boolean accepts(IJavaElement element) {
return element instanceof IMethod;
}
@@ -40,6 +41,7 @@ public class BreakpointRenameMethodParticipant extends BreakpointRenameParticipa
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#gatherChanges(org.eclipse.core.resources.IMarker[], java.util.List, java.lang.String)
*/
+ @Override
protected void gatherChanges(IMarker[] markers, List changes, String destMethodName) throws CoreException, OperationCanceledException {
IMethod originalMethod = (IMethod) getOriginalElement();
for (int i = 0; i < markers.length; i++) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenamePackageParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenamePackageParticipant.java
index d06608767..143b4d63a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenamePackageParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenamePackageParticipant.java
@@ -34,6 +34,7 @@ public class BreakpointRenamePackageParticipant extends BreakpointRenameParticip
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#accepts(org.eclipse.jdt.core.IJavaElement)
*/
+ @Override
protected boolean accepts(IJavaElement element) {
return element instanceof IPackageFragment;
}
@@ -41,6 +42,7 @@ public class BreakpointRenamePackageParticipant extends BreakpointRenameParticip
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#gatherChanges(org.eclipse.core.resources.IMarker[], java.util.List, java.lang.String)
*/
+ @Override
protected void gatherChanges(IMarker[] markers, List changes, String destPackageName) throws CoreException, OperationCanceledException {
IPackageFragment originalPackage = (IPackageFragment) getOriginalElement();
String originalPackageName = originalPackage.getElementName();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameParticipant.java
index dcddfb79b..9f449fc17 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameParticipant.java
@@ -49,6 +49,7 @@ public abstract class BreakpointRenameParticipant extends RenameParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
+ @Override
protected boolean initialize(Object element) {
if (element instanceof IJavaElement && accepts((IJavaElement)element)) {
fElement = (IJavaElement) element;
@@ -78,6 +79,7 @@ public abstract class BreakpointRenameParticipant extends RenameParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
+ @Override
public String getName() {
return RefactoringMessages.BreakpointRenameParticipant_0;
}
@@ -85,6 +87,7 @@ public abstract class BreakpointRenameParticipant extends RenameParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
+ @Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
return new RefactoringStatus();
}
@@ -92,6 +95,7 @@ public abstract class BreakpointRenameParticipant extends RenameParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
List changes = new ArrayList();
IResource resource = getBreakpointContainer();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameProjectParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameProjectParticipant.java
index 558502122..9a44a7d14 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameProjectParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameProjectParticipant.java
@@ -38,6 +38,7 @@ public class BreakpointRenameProjectParticipant extends BreakpointRenameParticip
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#accepts(org.eclipse.jdt.core.IJavaElement)
*/
+ @Override
protected boolean accepts(IJavaElement element) {
return element instanceof IJavaProject;
}
@@ -45,6 +46,7 @@ public class BreakpointRenameProjectParticipant extends BreakpointRenameParticip
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#gatherChanges(org.eclipse.core.resources.IMarker[], java.util.List, java.lang.String)
*/
+ @Override
protected void gatherChanges(IMarker[] markers, List changes, String destProjectName) throws CoreException, OperationCanceledException {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(destProjectName);
IJavaProject destProject = JavaCore.create(project);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameTypeParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameTypeParticipant.java
index 8cbcb05de..3fd8d5ec2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameTypeParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/BreakpointRenameTypeParticipant.java
@@ -38,10 +38,12 @@ public class BreakpointRenameTypeParticipant extends BreakpointRenameParticipant
*
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#accepts(org.eclipse.jdt.core.IJavaElement)
*/
- protected boolean accepts(IJavaElement element) {
+ @Override
+ protected boolean accepts(IJavaElement element) {
return element instanceof IType;
}
+ @Override
protected Change createTypeChange(IJavaBreakpoint breakpoint, IType destType, IType originalType) throws CoreException {
if (breakpoint instanceof IJavaWatchpoint) {
return new WatchpointTypeRenameChange((IJavaWatchpoint) breakpoint, destType, originalType, getProcessor(), (RenameTypeArguments) getArguments());
@@ -56,7 +58,8 @@ public class BreakpointRenameTypeParticipant extends BreakpointRenameParticipant
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointRenameParticipant#gatherChanges(org.eclipse.core.resources.IMarker[],
* java.util.List, java.lang.String)
*/
- protected void gatherChanges(IMarker[] markers, List changes, String simpleDestName) throws CoreException, OperationCanceledException {
+ @Override
+ protected void gatherChanges(IMarker[] markers, List changes, String simpleDestName) throws CoreException, OperationCanceledException {
IType originalType = (IType) getOriginalElement();
ICompilationUnit originalCU = originalType.getCompilationUnit();
ICompilationUnit destCU = null;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ClassPrepareBreakpointTypeChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ClassPrepareBreakpointTypeChange.java
index 363d93e1e..b74bb9886 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ClassPrepareBreakpointTypeChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ClassPrepareBreakpointTypeChange.java
@@ -41,6 +41,7 @@ public class ClassPrepareBreakpointTypeChange extends ClassPrepareBreakpointChan
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
return MessageFormat.format(RefactoringMessages.ClassPrepareBreakpointTypeChange_0,
new String[] {getBreakpointLabel(getOriginalBreakpoint()), fDestType.getElementName()});
@@ -49,6 +50,7 @@ public class ClassPrepareBreakpointTypeChange extends ClassPrepareBreakpointChan
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
IResource resource = BreakpointUtils.getBreakpointResource(fDestType);
Map map = new HashMap();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/DeleteBreakpointChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/DeleteBreakpointChange.java
index 470e5cea2..b1f656944 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/DeleteBreakpointChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/DeleteBreakpointChange.java
@@ -36,6 +36,7 @@ public class DeleteBreakpointChange extends BreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
return MessageFormat.format(RefactoringMessages.DeleteBreakpointChange_0,
new String[] {getBreakpointLabel(getOriginalBreakpoint())});
@@ -44,6 +45,7 @@ public class DeleteBreakpointChange extends BreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
getOriginalBreakpoint().delete();
return new NullChange();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ExceptionBreakpointTypeChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ExceptionBreakpointTypeChange.java
index ab30bf426..d9ba855da 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ExceptionBreakpointTypeChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/ExceptionBreakpointTypeChange.java
@@ -40,6 +40,7 @@ public class ExceptionBreakpointTypeChange extends ExceptionBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
return MessageFormat.format(RefactoringMessages.ExceptionBreakpointTypeChange_0,
new String[] {getBreakpointLabel(getOriginalBreakpoint()), fDestType.getElementName()});
@@ -48,6 +49,7 @@ public class ExceptionBreakpointTypeChange extends ExceptionBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
Map map = new HashMap();
BreakpointUtils.addJavaBreakpointAttributes(map, fDestType);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIJavaProjectRenameParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIJavaProjectRenameParticipant.java
index 6b7b500ea..9d501d3c1 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIJavaProjectRenameParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIJavaProjectRenameParticipant.java
@@ -34,6 +34,7 @@ public class LaunchConfigurationIJavaProjectRenameParticipant extends RenamePart
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
+ @Override
protected boolean initialize(Object element) {
fJavaProject = (IJavaProject) element;
return true;
@@ -42,6 +43,7 @@ public class LaunchConfigurationIJavaProjectRenameParticipant extends RenamePart
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
+ @Override
public String getName() {
return RefactoringMessages.LaunchConfigurationParticipant_0;
}
@@ -49,6 +51,7 @@ public class LaunchConfigurationIJavaProjectRenameParticipant extends RenamePart
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
+ @Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
return new RefactoringStatus();
}
@@ -56,6 +59,7 @@ public class LaunchConfigurationIJavaProjectRenameParticipant extends RenamePart
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException {
return JDTDebugRefactoringUtil.createChangesForProjectRename(fJavaProject, getArguments().getNewName());
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentMoveParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentMoveParticipant.java
index 586896f33..840a2cf89 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentMoveParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentMoveParticipant.java
@@ -33,6 +33,7 @@ public class LaunchConfigurationIPackageFragmentMoveParticipant extends MovePart
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
+ @Override
protected boolean initialize(Object element) {
fPackageFragment= (IPackageFragment)element;
Object destination= getArguments().getDestination();
@@ -50,6 +51,7 @@ public class LaunchConfigurationIPackageFragmentMoveParticipant extends MovePart
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
+ @Override
public String getName() {
return RefactoringMessages.LaunchConfigurationParticipant_0;
}
@@ -57,6 +59,7 @@ public class LaunchConfigurationIPackageFragmentMoveParticipant extends MovePart
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
+ @Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
return new RefactoringStatus();
}
@@ -64,6 +67,7 @@ public class LaunchConfigurationIPackageFragmentMoveParticipant extends MovePart
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
return JDTDebugRefactoringUtil.createChangesForPackageMove(fPackageFragment, fDestination);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentRenameParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentRenameParticipant.java
index 7544fb424..2187dec37 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentRenameParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationIPackageFragmentRenameParticipant.java
@@ -28,6 +28,7 @@ public class LaunchConfigurationIPackageFragmentRenameParticipant extends Rename
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
+ @Override
protected boolean initialize(Object element) {
fPackageFragment= (IPackageFragment)element;
return true;
@@ -36,6 +37,7 @@ public class LaunchConfigurationIPackageFragmentRenameParticipant extends Rename
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
+ @Override
public String getName() {
return RefactoringMessages.LaunchConfigurationParticipant_0;
}
@@ -43,6 +45,7 @@ public class LaunchConfigurationIPackageFragmentRenameParticipant extends Rename
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
+ @Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
return new RefactoringStatus();
}
@@ -50,6 +53,7 @@ public class LaunchConfigurationIPackageFragmentRenameParticipant extends Rename
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.refactoring.participants.IRefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException {
return JDTDebugRefactoringUtil.createChangesForPackageRename(fPackageFragment, getArguments().getNewName());
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeMoveParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeMoveParticipant.java
index 88a4d3640..0d2aba031 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeMoveParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeMoveParticipant.java
@@ -33,6 +33,7 @@ public class LaunchConfigurationITypeMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
+ @Override
protected boolean initialize(Object element) {
fType= (IType)element;
try {
@@ -58,6 +59,7 @@ public class LaunchConfigurationITypeMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
+ @Override
public String getName() {
return RefactoringMessages.LaunchConfigurationParticipant_0;
}
@@ -65,6 +67,7 @@ public class LaunchConfigurationITypeMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
+ @Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
return new RefactoringStatus();
}
@@ -72,6 +75,7 @@ public class LaunchConfigurationITypeMoveParticipant extends MoveParticipant {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException {
return JDTDebugRefactoringUtil.createChangesForTypeMove(fType, fDestination);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeRenameParticipant.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeRenameParticipant.java
index df109ce08..a4e7a8994 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeRenameParticipant.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationITypeRenameParticipant.java
@@ -28,6 +28,7 @@ public class LaunchConfigurationITypeRenameParticipant extends RenameParticipant
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
+ @Override
protected boolean initialize(Object element) {
fType= (IType) element;
return true;
@@ -36,6 +37,7 @@ public class LaunchConfigurationITypeRenameParticipant extends RenameParticipant
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
+ @Override
public String getName() {
return RefactoringMessages.LaunchConfigurationParticipant_0;
}
@@ -43,6 +45,7 @@ public class LaunchConfigurationITypeRenameParticipant extends RenameParticipant
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
+ @Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
return new RefactoringStatus();
}
@@ -50,6 +53,7 @@ public class LaunchConfigurationITypeRenameParticipant extends RenameParticipant
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change createChange(IProgressMonitor pm) throws CoreException {
return JDTDebugRefactoringUtil.createChangesForTypeRename(fType, getArguments().getNewName());
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationProjectMainTypeChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationProjectMainTypeChange.java
index 5d0476f87..b2f71111f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationProjectMainTypeChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LaunchConfigurationProjectMainTypeChange.java
@@ -70,6 +70,7 @@ public class LaunchConfigurationProjectMainTypeChange extends Change {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
*/
+ @Override
public Object getModifiedElement() {
return fLaunchConfiguration;
}
@@ -77,6 +78,7 @@ public class LaunchConfigurationProjectMainTypeChange extends Change {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
if (fNewLaunchConfigurationName != null) {
return MessageFormat.format(RefactoringMessages.LaunchConfigurationProjectMainTypeChange_0, new String[] {fLaunchConfiguration.getName(), fNewLaunchConfigurationName});
@@ -93,11 +95,13 @@ public class LaunchConfigurationProjectMainTypeChange extends Change {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void initializeValidationData(IProgressMonitor pm) {}
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
if (fLaunchConfiguration.exists()) {
String typeName = fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, (String)null);
@@ -125,6 +129,7 @@ public class LaunchConfigurationProjectMainTypeChange extends Change {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
final ILaunchConfigurationWorkingCopy wc = fLaunchConfiguration.getWorkingCopy();
if (fNewConfigContainerName != null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointChange.java
index 802a23ded..202051458 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointChange.java
@@ -57,6 +57,7 @@ public abstract class LineBreakpointChange extends BreakpointChange {
/**
* @see org.eclipse.jdt.internal.debug.core.refactoring.BreakpointChange#getLineNumber()
*/
+ @Override
protected int getLineNumber() {
return fLineNumber;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointTypeChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointTypeChange.java
index ef64710fd..e651bf791 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointTypeChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/LineBreakpointTypeChange.java
@@ -40,6 +40,7 @@ public class LineBreakpointTypeChange extends LineBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
String msg = MessageFormat.format(RefactoringMessages.LineBreakpointTypeChange_1, new String[] {getBreakpointLabel(getOriginalBreakpoint())});
if(!"".equals(fDestType.getElementName())) { //$NON-NLS-1$
@@ -52,6 +53,7 @@ public class LineBreakpointTypeChange extends LineBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
IResource resource = BreakpointUtils.getBreakpointResource(fDestType);
Map map = new HashMap();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointMethodChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointMethodChange.java
index 3d4c31145..d3207d464 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointMethodChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointMethodChange.java
@@ -39,6 +39,7 @@ public class MethodBreakpointMethodChange extends MethodBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
return MessageFormat.format(RefactoringMessages.MethodBreakpointMethodChange_0,
new String[] {getBreakpointLabel(getOriginalBreakpoint()), fDestMethod.getElementName()});
@@ -47,6 +48,7 @@ public class MethodBreakpointMethodChange extends MethodBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
Map map = new HashMap();
BreakpointUtils.addJavaBreakpointAttributes(map, fDestMethod);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointTypeChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointTypeChange.java
index 3db0fcc0d..e4bab760a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointTypeChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/MethodBreakpointTypeChange.java
@@ -41,6 +41,7 @@ public class MethodBreakpointTypeChange extends MethodBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
String msg = MessageFormat.format(RefactoringMessages.MethodBreakpointTypeChange_1, new String[] {getBreakpointLabel(getOriginalBreakpoint())});
if(!"".equals(fDestType.getElementName())) { //$NON-NLS-1$
@@ -53,6 +54,7 @@ public class MethodBreakpointTypeChange extends MethodBreakpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
String[] parameterTypes = Signature.getParameterTypes(getSignature());
for (int i = 0; i < parameterTypes.length; i++) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointFieldChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointFieldChange.java
index d66aa0674..b078f06d5 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointFieldChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointFieldChange.java
@@ -40,6 +40,7 @@ public class WatchpointFieldChange extends WatchpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
return MessageFormat.format(RefactoringMessages.WatchpointFieldChange_0,
new String[] {getBreakpointLabel(getOriginalBreakpoint()), fDestField.getElementName()});
@@ -48,6 +49,7 @@ public class WatchpointFieldChange extends WatchpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
Map map = new HashMap();
BreakpointUtils.addJavaBreakpointAttributes(map, fDestField);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeChange.java
index 679310051..6300b1d06 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeChange.java
@@ -42,6 +42,7 @@ public class WatchpointTypeChange extends WatchpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
+ @Override
public String getName() {
String msg = MessageFormat.format(RefactoringMessages.WatchpointTypeChange_1, new String[] {getBreakpointLabel(getOriginalBreakpoint())});
if(!"".equals(fDestType.getElementName())) { //$NON-NLS-1$
@@ -54,6 +55,7 @@ public class WatchpointTypeChange extends WatchpointChange {
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
IField destField = fDestType.getField(getFieldName());
Map map = new HashMap();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeRenameChange.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeRenameChange.java
index 69245a0b6..1d50e5a23 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeRenameChange.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/core/refactoring/WatchpointTypeRenameChange.java
@@ -38,6 +38,7 @@ public class WatchpointTypeRenameChange extends WatchpointTypeChange {
fArguments = arguments;
}
+ @Override
public Change perform(IProgressMonitor pm) throws CoreException {
IField originalField = getOriginalType().getField(getFieldName());
IField destinationField = null;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ConditionalBreakpointErrorDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ConditionalBreakpointErrorDialog.java
index 0f72d83a5..8e14ac289 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ConditionalBreakpointErrorDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ConditionalBreakpointErrorDialog.java
@@ -26,6 +26,7 @@ public class ConditionalBreakpointErrorDialog extends ErrorDialog {
/**
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
// create Edit and Cancel buttons
createButton(parent, IDialogConstants.OK_ID, DebugUIMessages.ConditionalBreakpointErrorDialog__Edit_Condition_2, true);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/CreateStepFilterDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/CreateStepFilterDialog.java
index e2b6e7a27..d4beecfeb 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/CreateStepFilterDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/CreateStepFilterDialog.java
@@ -59,12 +59,14 @@ public class CreateStepFilterDialog extends StatusDialog {
return createStepFilterDialog.filter;
}
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
okButton= createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
okButton.setEnabled(false);
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
+ @Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite)super.createDialogArea(parent);
@@ -175,6 +177,7 @@ public class CreateStepFilterDialog extends StatusDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#close()
*/
+ @Override
public boolean close() {
if (!okClicked) {
filterValid = false;
@@ -186,7 +189,8 @@ public class CreateStepFilterDialog extends StatusDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
@@ -195,6 +199,7 @@ public class CreateStepFilterDialog extends StatusDialog {
return section;
}
+ @Override
protected void okPressed() {
okClicked = true;
super.okPressed();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java
index 2d7dc6852..92853aac9 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java
@@ -155,6 +155,7 @@ public class DetailFormatterDialog extends StatusDialog implements ITypeProvider
*
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
IWorkbench workbench = PlatformUI.getWorkbench();
@@ -233,6 +234,7 @@ public class DetailFormatterDialog extends StatusDialog implements ITypeProvider
IDocument document= new Document();
tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
fSnippetViewer.configure(new DisplayViewerConfiguration() {
+ @Override
public IContentAssistProcessor getContentAssistantProcessor() {
return new JavaDebugContentAssistProcessor(new DynamicTypeContext(DetailFormatterDialog.this));
}
@@ -281,6 +283,7 @@ public class DetailFormatterDialog extends StatusDialog implements ITypeProvider
/**
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
fDetailFormatter.setEnabled(fCheckBox.getSelection());
fDetailFormatter.setTypeName(fTypeNameText.getText().trim());
@@ -337,10 +340,12 @@ public class DetailFormatterDialog extends StatusDialog implements ITypeProvider
final SearchRequestor collector = new SearchRequestor() {
private boolean fFirst= true;
+ @Override
public void endReporting() {
checkValues();
}
+ @Override
public void acceptSearchMatch(SearchMatch match) throws CoreException {
Object enclosingElement = match.getElement();
if (!fFirst) {
@@ -380,6 +385,7 @@ public class DetailFormatterDialog extends StatusDialog implements ITypeProvider
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#close()
*/
+ @Override
public boolean close() {
IWorkbench workbench = PlatformUI.getWorkbench();
IHandlerService handlerService = (IHandlerService) workbench.getAdapter(IHandlerService.class);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java
index 7c9ef9b75..44357c429 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java
@@ -165,6 +165,7 @@ public class EditLogicalStructureDialog extends StatusDialog implements Listener
}
public class AttributesLabelProvider extends LabelProvider {
+ @Override
public String getText(Object element) {
return ((String[])element)[0];
}
@@ -210,6 +211,7 @@ public class EditLogicalStructureDialog extends StatusDialog implements Listener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
IWorkbench workbench = PlatformUI.getWorkbench();
workbench.getHelpSystem().setHelp(
@@ -308,6 +310,7 @@ public class EditLogicalStructureDialog extends StatusDialog implements Listener
tools.setupJavaDocumentPartitioner(fSnippetDocument, IJavaPartitions.JAVA_PARTITIONING);
if (fViewerConfiguration == null) {
fViewerConfiguration= new DisplayViewerConfiguration() {
+ @Override
public IContentAssistProcessor getContentAssistantProcessor() {
return new JavaDebugContentAssistProcessor(new DynamicTypeContext(EditLogicalStructureDialog.this));
}
@@ -648,6 +651,7 @@ public class EditLogicalStructureDialog extends StatusDialog implements Listener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
// save the new data in the logical structure
fLogicalStructure.setType(fQualifiedTypeNameText.getText().trim());
@@ -683,10 +687,12 @@ public class EditLogicalStructureDialog extends StatusDialog implements Listener
final SearchRequestor collector = new SearchRequestor() {
private boolean fFirst= true;
+ @Override
public void endReporting() {
checkValues();
}
+ @Override
public void acceptSearchMatch(SearchMatch match) throws CoreException {
Object enclosingElement = match.getElement();
if (!fFirst) {
@@ -726,6 +732,7 @@ public class EditLogicalStructureDialog extends StatusDialog implements Listener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#close()
*/
+ @Override
public boolean close() {
IWorkbench workbench = PlatformUI.getWorkbench();
IHandlerService handlerService = (IHandlerService) workbench.getAdapter(IHandlerService.class);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ErrorDialogWithToggle.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ErrorDialogWithToggle.java
index b2a8e5ced..6fb3baaa6 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ErrorDialogWithToggle.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ErrorDialogWithToggle.java
@@ -54,6 +54,7 @@ public class ErrorDialogWithToggle extends ErrorDialog {
fToggleMessage= toggleMessage;
}
+ @Override
protected Control createDialogArea(Composite parent) {
Composite dialogComposite= (Composite) super.createDialogArea(parent);
dialogComposite.setFont(parent.getFont());
@@ -80,6 +81,7 @@ public class ErrorDialogWithToggle extends ErrorDialog {
return button;
}
+ @Override
protected void buttonPressed(int id) {
if (id == IDialogConstants.OK_ID) { // was the OK button pressed?
storePreference();
@@ -102,6 +104,7 @@ public class ErrorDialogWithToggle extends ErrorDialog {
/**
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
getButton(IDialogConstants.OK_ID).setFocus();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ExpressionInformationControlCreator.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ExpressionInformationControlCreator.java
index 3efdf0345..a0839f406 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ExpressionInformationControlCreator.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/ExpressionInformationControlCreator.java
@@ -100,12 +100,14 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return 1;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return new Object[] { fVariable };
}
@@ -113,6 +115,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return true;
}
@@ -184,6 +187,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractInformationControl#computeSizeHint()
*/
+ @Override
public Point computeSizeHint() {
IDialogSettings settings = getDialogSettings(false);
if (settings != null) {
@@ -230,6 +234,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractInformationControl#dispose()
*/
+ @Override
public void dispose() {
persistSettings(getShell());
fContext.dispose();
@@ -258,6 +263,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractInformationControl#setVisible(boolean)
*/
+ @Override
public void setVisible(boolean visible) {
if (!visible) {
persistSettings(getShell());
@@ -268,6 +274,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractInformationControl#createContent(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createContent(Composite parent) {
fSashForm = new SashForm(parent, parent.getStyle());
@@ -384,6 +391,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractInformationControl#setBackgroundColor(org.eclipse.swt.graphics.Color)
*/
+ @Override
public void setBackgroundColor(Color background) {
super.setBackgroundColor(background);
fDetailPaneComposite.setBackground(background);
@@ -393,6 +401,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractInformationControl#setFocus()
*/
+ @Override
public void setFocus() {
super.setFocus();
fTree.setFocus();
@@ -418,11 +427,13 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractInformationControl#getInformationPresenterControlCreator()
*/
+ @Override
public IInformationControlCreator getInformationPresenterControlCreator() {
return new ExpressionInformationControlCreator() {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.ExpressionInformationControlCreator#createInformationControl(org.eclipse.swt.widgets.Shell)
*/
+ @Override
public IInformationControl createInformationControl(Shell shell) {
return new ExpressionInformationControl(shell, true);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/Filter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/Filter.java
index a522fb121..d6ea41f6f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/Filter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/Filter.java
@@ -40,6 +40,7 @@ public class Filter {
fChecked = checked;
}
+ @Override
public boolean equals(Object o) {
if (o instanceof Filter) {
Filter other = (Filter) o;
@@ -50,6 +51,7 @@ public class Filter {
return false;
}
+ @Override
public int hashCode() {
return getName().hashCode();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterLabelProvider.java
index 67e5e5dd9..81b12f3af 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterLabelProvider.java
@@ -40,6 +40,7 @@ public class FilterLabelProvider extends LabelProvider implements ITableLabelPro
/**
* @see ILabelProvider#getText(Object)
*/
+ @Override
public String getText(Object element) {
return ((Filter) element).getName();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterViewerComparator.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterViewerComparator.java
index 374fe614f..896f4ab93 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterViewerComparator.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/FilterViewerComparator.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.model.WorkbenchViewerComparator;
public class FilterViewerComparator extends WorkbenchViewerComparator {
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
ILabelProvider lprov =
(ILabelProvider) ((ContentViewer) viewer).getLabelProvider();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HeapWalkingPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HeapWalkingPreferencePage.java
index f583b2b7a..9272a1fb4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HeapWalkingPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HeapWalkingPreferencePage.java
@@ -53,6 +53,7 @@ public class HeapWalkingPreferencePage extends PreferencePage implements IWorkbe
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
// TODO: Help must be updated
@@ -62,6 +63,7 @@ public class HeapWalkingPreferencePage extends PreferencePage implements IWorkbe
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH);
@@ -111,6 +113,7 @@ public class HeapWalkingPreferencePage extends PreferencePage implements IWorkbe
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
boolean result = super.performOk();
if (result){
@@ -169,6 +172,7 @@ public class HeapWalkingPreferencePage extends PreferencePage implements IWorkbe
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
HeapWalkingManager.getDefault().resetToDefaultSettings();
fAllReferencesMaxCount.setText(Integer.toString(HeapWalkingManager.getDefault().getAllReferencesMaxCount()));
@@ -179,6 +183,7 @@ public class HeapWalkingPreferencePage extends PreferencePage implements IWorkbe
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
fErrorMessages.clear();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HotCodeReplaceErrorDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HotCodeReplaceErrorDialog.java
index b42e87bda..01a8b2f5e 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HotCodeReplaceErrorDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HotCodeReplaceErrorDialog.java
@@ -59,6 +59,7 @@ public class HotCodeReplaceErrorDialog extends ErrorDialogWithToggle {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
getButton(IDialogConstants.OK_ID).setText(DebugUIMessages.HotCodeReplaceErrorDialog_0);
@@ -80,6 +81,7 @@ public class HotCodeReplaceErrorDialog extends ErrorDialogWithToggle {
* @see org.eclipse.jface.dialogs.Dialog#createButton(org.eclipse.swt.widgets.Composite, int, java.lang.String, boolean)
* @since 3.6
*/
+ @Override
protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
Button button= super.createButton(parent, id, label, defaultButton);
blockMnemonicWithoutModifier(button);
@@ -105,6 +107,7 @@ public class HotCodeReplaceErrorDialog extends ErrorDialogWithToggle {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
*/
+ @Override
protected void buttonPressed(final int id) {
if (id == TERMINATE_ID || id == DISCONNECT_ID || id == RESTART_ID) {
final DebugException[] ex = new DebugException[1];
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPlugin.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPlugin.java
index fbd6e7933..15f41c976 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPlugin.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPlugin.java
@@ -245,6 +245,7 @@ public class JDIDebugUIPlugin extends AbstractUIPlugin {
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry()
*/
+ @Override
protected ImageRegistry createImageRegistry() {
return JavaDebugImages.getImageRegistry();
}
@@ -354,6 +355,7 @@ public class JDIDebugUIPlugin extends AbstractUIPlugin {
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
IAdapterManager manager= Platform.getAdapterManager();
@@ -419,6 +421,7 @@ public class JDIDebugUIPlugin extends AbstractUIPlugin {
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
try {
setShuttingDown(true);
@@ -629,6 +632,7 @@ public class JDIDebugUIPlugin extends AbstractUIPlugin {
* @param page pref page
* @deprecated use <code>JDIDebugUIPlugin#showPreferencePage(String pageId)</code>, which uses the <code>PreferenceUtils</code> framework for opening pages.
*/
+ @Deprecated
public static void showPreferencePage(String id, IPreferencePage page) {
final IPreferenceNode targetNode = new PreferenceNode(id, page);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPreferenceInitializer.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPreferenceInitializer.java
index 9dd69fa9e..ed6e412db 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPreferenceInitializer.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPreferenceInitializer.java
@@ -32,6 +32,7 @@ public class JDIDebugUIPreferenceInitializer extends AbstractPreferenceInitializ
*
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
IPreferenceStore store = JDIDebugUIPlugin.getDefault().getPreferenceStore();
store.setDefault(IJDIPreferencesConstants.PREF_SUSPEND_ON_COMPILATION_ERRORS, true);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIImageDescriptor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIImageDescriptor.java
index cd03f9bac..c4fdb9f1d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIImageDescriptor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIImageDescriptor.java
@@ -76,6 +76,7 @@ public class JDIImageDescriptor extends CompositeImageDescriptor {
/**
* @see CompositeImageDescriptor#getSize()
*/
+ @Override
protected Point getSize() {
if (fSize == null) {
ImageData data= getBaseImage().getImageData();
@@ -87,6 +88,7 @@ public class JDIImageDescriptor extends CompositeImageDescriptor {
/**
* @see Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
if (!(object instanceof JDIImageDescriptor)){
return false;
@@ -99,6 +101,7 @@ public class JDIImageDescriptor extends CompositeImageDescriptor {
/**
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
return getBaseImage().hashCode() | getFlags();
}
@@ -106,6 +109,7 @@ public class JDIImageDescriptor extends CompositeImageDescriptor {
/**
* @see CompositeImageDescriptor#drawCompositeImage(int, int)
*/
+ @Override
protected void drawCompositeImage(int width, int height) {
ImageData bg= getBaseImage().getImageData();
if (bg == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
index dbca7e6ba..b81d1f8c0 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
@@ -146,6 +146,7 @@ public class JDIModelPresentation extends LabelProvider implements IDebugModelPr
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
if (fJavaLabelProvider != null) {
@@ -204,6 +205,7 @@ public class JDIModelPresentation extends LabelProvider implements IDebugModelPr
/**
* @see IDebugModelPresentation#getText(Object)
*/
+ @Override
public String getText(Object item) {
try {
boolean showQualified= isShowQualifiedNames();
@@ -665,6 +667,7 @@ public class JDIModelPresentation extends LabelProvider implements IDebugModelPr
*
* @see IDebugModelPresentation#getImage(Object)
*/
+ @Override
public Image getImage(Object item) {
initImageRegistries();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDISourceViewer.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDISourceViewer.java
index 1ed6b90b1..cecceda81 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDISourceViewer.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDISourceViewer.java
@@ -300,6 +300,7 @@ public class JDISourceViewer extends SourceViewer implements IPropertyChangeList
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.SourceViewer#configure(org.eclipse.jface.text.source.SourceViewerConfiguration)
*/
+ @Override
public void configure(SourceViewerConfiguration configuration) {
super.configure(configuration);
if (fStore != null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugOptionsManager.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugOptionsManager.java
index 34a0fe878..fc47fbe33 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugOptionsManager.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugOptionsManager.java
@@ -146,6 +146,7 @@ public class JavaDebugOptionsManager implements IDebugEventSetListener, IPropert
super(DebugUIMessages.JavaDebugOptionsManager_0);
}
+ @Override
protected IStatus run(IProgressMonitor monitor) {
MultiStatus status = new MultiStatus(JDIDebugUIPlugin.getUniqueIdentifier(), IJavaDebugUIConstants.INTERNAL_ERROR, "Java debug options failed to initialize", null); //$NON-NLS-1$
// compilation error breakpoint
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugPreferencePage.java
index 2505d49eb..f94f92330 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugPreferencePage.java
@@ -63,10 +63,12 @@ public class JavaDebugPreferencePage extends PreferencePage implements IWorkbenc
super(name, labelText, parent);
}
+ @Override
protected void refreshValidState() {
super.refreshValidState();
}
+ @Override
protected void clearErrorMessage() {
if (canClearErrorMessage()) {
super.clearErrorMessage();
@@ -102,6 +104,7 @@ public class JavaDebugPreferencePage extends PreferencePage implements IWorkbenc
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_DEBUG_PREFERENCE_PAGE);
@@ -110,6 +113,7 @@ public class JavaDebugPreferencePage extends PreferencePage implements IWorkbenc
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
//The main composite
Composite composite = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, 0, 0, GridData.FILL);
@@ -177,6 +181,7 @@ public class JavaDebugPreferencePage extends PreferencePage implements IWorkbenc
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
IPreferenceStore store = getPreferenceStore();
Preferences coreStore = JDIDebugModel.getPreferences();
@@ -209,6 +214,7 @@ public class JavaDebugPreferencePage extends PreferencePage implements IWorkbenc
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
IPreferenceStore store = getPreferenceStore();
Preferences coreStore= JDIDebugModel.getPreferences();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersManager.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersManager.java
index acf02543e..fedd2e7cc 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersManager.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersManager.java
@@ -526,6 +526,7 @@ public class JavaDetailFormattersManager implements IPropertyChangeListener, IDe
fDebugTarget= debugTarget;
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof Key) {
Key key= (Key) obj;
@@ -534,6 +535,7 @@ public class JavaDetailFormattersManager implements IPropertyChangeListener, IDe
return false;
}
+ @Override
public int hashCode() {
return fTypeName.hashCode() / 2 + fDebugTarget.hashCode() / 2;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersPreferencePage.java
index 41b92c177..14080c34f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersPreferencePage.java
@@ -80,6 +80,7 @@ public class JavaDetailFormattersPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_DETAIL_FORMATTER_PREFERENCE_PAGE);
@@ -158,6 +159,7 @@ public class JavaDetailFormattersPreferencePage extends PreferencePage implement
fFormatViewerContentProvider= new FormatterListViewerContentProvider(fFormatterListViewer);
fFormatterListViewer.setContentProvider(fFormatViewerContentProvider);
fFormatterListViewer.setLabelProvider(new LabelProvider() {
+ @Override
public String getText(Object element) {
if (element instanceof DetailFormatter) {
return ((DetailFormatter)element).getTypeName();
@@ -183,6 +185,7 @@ public class JavaDetailFormattersPreferencePage extends PreferencePage implement
}
});
table.addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
removeTypes();
@@ -328,6 +331,7 @@ public class JavaDetailFormattersPreferencePage extends PreferencePage implement
}
}
+ @Override
public boolean performOk() {
if (fFormatViewerContentProvider != null) {
fFormatViewerContentProvider.saveDetailFormatters();
@@ -472,6 +476,7 @@ public class JavaDetailFormattersPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performCancel()
*/
+ @Override
public boolean performCancel() {
if (fCodeViewer != null) {
fCodeViewer.dispose();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaLogicalStructuresPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaLogicalStructuresPreferencePage.java
index e30079395..fe75ce735 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaLogicalStructuresPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaLogicalStructuresPreferencePage.java
@@ -241,6 +241,7 @@ public class JavaLogicalStructuresPreferencePage extends PreferencePage implemen
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_LOGICAL_STRUCTURES_PAGE);
@@ -249,6 +250,7 @@ public class JavaLogicalStructuresPreferencePage extends PreferencePage implemen
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_BOTH, 0, 2);
createTable(comp);
@@ -343,14 +345,16 @@ public class JavaLogicalStructuresPreferencePage extends PreferencePage implemen
}
});
table.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent event) {
+ @Override
+ public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0 && fRemoveLogicalStructureButton.isEnabled()) {
removeLogicalStrutures();
}
}
});
fLogicalStructuresViewer.setComparator(new ViewerComparator() {
- public int compare(Viewer iViewer, Object e1, Object e2) {
+ @Override
+ public int compare(Viewer iViewer, Object e1, Object e2) {
if (e1 == null) {
return -1;
} else if (e2 == null) {
@@ -510,6 +514,7 @@ public class JavaLogicalStructuresPreferencePage extends PreferencePage implemen
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
if (fCodeViewer != null) {
fLogicalStructuresContentProvider.saveUserDefinedJavaLogicalStructures();
@@ -521,6 +526,7 @@ public class JavaLogicalStructuresPreferencePage extends PreferencePage implemen
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performCancel()
*/
+ @Override
public boolean performCancel() {
if (fCodeViewer != null) {
fCodeViewer.dispose();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaPrimitivesPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaPrimitivesPreferencePage.java
index 002b57bb4..310bcc0f6 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaPrimitivesPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaPrimitivesPreferencePage.java
@@ -44,6 +44,7 @@ public class JavaPrimitivesPreferencePage extends PreferencePage implements IWor
/**
* @see PreferencePage#createContents(Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_PRIMITIVES_PREFERENCE_PAGE);
@@ -92,6 +93,7 @@ public class JavaPrimitivesPreferencePage extends PreferencePage implements IWor
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
* Also, notifies interested listeners
*/
+ @Override
public boolean performOk() {
storeValues();
return true;
@@ -101,6 +103,7 @@ public class JavaPrimitivesPreferencePage extends PreferencePage implements IWor
* Sets the default preferences.
* @see PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
Iterator iterator = fEdtiors.iterator();
while (iterator.hasNext()) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaSourceLocationWorkbenchAdapterFactory.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaSourceLocationWorkbenchAdapterFactory.java
index 38785f0b9..c45edb107 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaSourceLocationWorkbenchAdapterFactory.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaSourceLocationWorkbenchAdapterFactory.java
@@ -31,6 +31,7 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
*
* @deprecated
*/
+@Deprecated
/*package*/ class JavaSourceLocationWorkbenchAdapterFactory implements IAdapterFactory {
class SourceLocationPropertiesAdapter implements IWorkbenchAdapter {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaStepFilterPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaStepFilterPreferencePage.java
index 4183be4f1..a76876d69 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaStepFilterPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaStepFilterPreferencePage.java
@@ -107,6 +107,7 @@ public class JavaStepFilterPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_STEP_FILTER_PREFERENCE_PAGE);
//The main composite
@@ -167,6 +168,7 @@ public class JavaStepFilterPreferencePage extends PreferencePage implements IWor
}
});
fTableViewer.getControl().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
handleFilterViewerKeyPress(event);
}
@@ -398,6 +400,7 @@ public class JavaStepFilterPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
DebugUITools.setUseStepFilters(fUseStepFiltersButton.getSelection());
IPreferenceStore store = getPreferenceStore();
@@ -430,6 +433,7 @@ public class JavaStepFilterPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
boolean stepenabled = DebugUITools.isUseStepFilters();
fUseStepFiltersButton.setSelection(stepenabled);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/PackageSelectionDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/PackageSelectionDialog.java
index 320e059df..6b9b2ed53 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/PackageSelectionDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/PackageSelectionDialog.java
@@ -38,7 +38,8 @@ public class PackageSelectionDialog extends ElementListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StorageEditorInput.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StorageEditorInput.java
index d69e57dba..0fc09c98d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StorageEditorInput.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StorageEditorInput.java
@@ -71,6 +71,7 @@ public abstract class StorageEditorInput extends PlatformObject implements IStor
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
return object instanceof StorageEditorInput &&
getStorage().equals(((StorageEditorInput)object).getStorage());
@@ -79,6 +80,7 @@ public abstract class StorageEditorInput extends PlatformObject implements IStor
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getStorage().hashCode();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/TypeNameResolver.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/TypeNameResolver.java
index 3a51e061b..6939be907 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/TypeNameResolver.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/TypeNameResolver.java
@@ -28,6 +28,7 @@ public class TypeNameResolver extends ResourceResolver {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
IResource resource = getSelectedResource(variable);
IJavaElement javaElement = JavaCore.create(resource);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddAdvancedAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddAdvancedAction.java
index 35fa6ae84..c55bcc431 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddAdvancedAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddAdvancedAction.java
@@ -34,6 +34,7 @@ public class AddAdvancedAction extends RuntimeClasspathAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
Dialog dialog = new RuntimeClasspathAdvancedDialog(getShell(), fActions, getViewer());
dialog.open();
@@ -42,6 +43,7 @@ public class AddAdvancedAction extends RuntimeClasspathAction {
/**
* @see RuntimeClasspathAction#setViewer(RuntimeClasspathViewer)
*/
+ @Override
public void setViewer(IClasspathViewer viewer) {
super.setViewer(viewer);
if (fActions != null) {
@@ -53,6 +55,7 @@ public class AddAdvancedAction extends RuntimeClasspathAction {
}
}
+ @Override
protected int getActionType() {
return ADD;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalFolderAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalFolderAction.java
index d82c8ad95..7f8b2c881 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalFolderAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalFolderAction.java
@@ -33,6 +33,7 @@ public class AddExternalFolderAction extends OpenDialogAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
String lastUsedPath= getDialogSetting(LAST_PATH_SETTING);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalJarAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalJarAction.java
index a4dbb05b8..f455295f9 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalJarAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddExternalJarAction.java
@@ -38,6 +38,7 @@ public class AddExternalJarAction extends OpenDialogAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
String lastUsedPath = getDialogSetting(LAST_PATH_SETTING);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddFolderAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddFolderAction.java
index 379834cfb..2c5cbde84 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddFolderAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddFolderAction.java
@@ -50,6 +50,7 @@ public class AddFolderAction extends RuntimeClasspathAction {
*
*/
class FileFilter extends ViewerFilter {
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if(element instanceof IProject) {
return true;
@@ -71,6 +72,7 @@ public class AddFolderAction extends RuntimeClasspathAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
ISelectionStatusValidator validator= new ISelectionStatusValidator() {
@@ -130,6 +132,7 @@ public class AddFolderAction extends RuntimeClasspathAction {
return folders;
}
+ @Override
protected int getActionType() {
return ADD;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddJarAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddJarAction.java
index 5e18f041d..e98d277ed 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddJarAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddJarAction.java
@@ -38,6 +38,7 @@ public class AddJarAction extends RuntimeClasspathAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
IPath[] paths = BuildPathDialogAccess.chooseJAREntries(getShell(), null, getSelectedJars());
@@ -71,6 +72,7 @@ public class AddJarAction extends RuntimeClasspathAction {
return (IPath[]) jars.toArray(new IPath[jars.size()]);
}
+ @Override
protected int getActionType() {
return ADD;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddLibraryAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddLibraryAction.java
index f58465bd4..46f4e6ef4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddLibraryAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddLibraryAction.java
@@ -34,6 +34,7 @@ public class AddLibraryAction extends RuntimeClasspathAction {
*
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
IClasspathEntry[] newEntries = BuildPathDialogAccess.chooseContainerEntries(getShell(), null, new IClasspathEntry[0]);
@@ -52,6 +53,7 @@ public class AddLibraryAction extends RuntimeClasspathAction {
}
}
+ @Override
protected int getActionType() {
return ADD;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddPackageStepFilterAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddPackageStepFilterAction.java
index ca5b1e6dc..b8c8a5a75 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddPackageStepFilterAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddPackageStepFilterAction.java
@@ -22,6 +22,7 @@ public class AddPackageStepFilterAction extends AbstractAddStepFilterAction {
/**
* @see org.eclipse.jdt.internal.debug.ui.actions.AbstractAddStepFilterAction#generateStepFilterPattern(org.eclipse.jdt.debug.core.IJavaStackFrame)
*/
+ @Override
protected String generateStepFilterPattern(IJavaStackFrame frame) {
String typeName;
try {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddProjectAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddProjectAction.java
index 65352ec52..d6a663782 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddProjectAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddProjectAction.java
@@ -83,6 +83,7 @@ public class AddProjectAction extends RuntimeClasspathAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
List projects = getPossibleAdditions();
ProjectSelectionDialog dialog= new ProjectSelectionDialog(getShell(),projects);
@@ -131,10 +132,12 @@ public class AddProjectAction extends RuntimeClasspathAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
return getViewer().updateSelection(getActionType(), selection) && !getPossibleAdditions().isEmpty();
}
+ @Override
protected int getActionType() {
return ADD;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddTypeStepFilterAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddTypeStepFilterAction.java
index 788a5ca41..cc2d50ea3 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddTypeStepFilterAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddTypeStepFilterAction.java
@@ -22,6 +22,7 @@ public class AddTypeStepFilterAction extends AbstractAddStepFilterAction {
/**
* @see org.eclipse.jdt.internal.debug.ui.actions.AbstractAddStepFilterAction#generateStepFilterPattern(org.eclipse.jdt.debug.core.IJavaStackFrame)
*/
+ @Override
protected String generateStepFilterPattern(IJavaStackFrame frame) {
try {
return frame.getDeclaringTypeName();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddVariableAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddVariableAction.java
index 1541b4a74..c360045fb 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddVariableAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AddVariableAction.java
@@ -31,6 +31,7 @@ public class AddVariableAction extends RuntimeClasspathAction {
*
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
IPath[] paths = BuildPathDialogAccess.chooseVariableEntries(getShell(), new IPath[0]);
@@ -43,6 +44,7 @@ public class AddVariableAction extends RuntimeClasspathAction {
}
}
+ @Override
protected int getActionType() {
return ADD;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AttachSourceAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AttachSourceAction.java
index a8edb4b48..d7fbaed1a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AttachSourceAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/AttachSourceAction.java
@@ -42,6 +42,7 @@ public class AttachSourceAction extends RuntimeClasspathAction {
*
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
IClasspathEntry classpathEntry = BuildPathDialogAccess.configureSourceAttachment(getShell(), fEntries[0].getClasspathEntry());
if (classpathEntry != null) {
@@ -58,6 +59,7 @@ public class AttachSourceAction extends RuntimeClasspathAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
fEntries = new IRuntimeClasspathEntry[selection.size()];
Iterator iterator = selection.iterator();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointHitCountAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointHitCountAction.java
index 33f690da8..9780c2bcc 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointHitCountAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointHitCountAction.java
@@ -54,6 +54,7 @@ public class BreakpointHitCountAction extends ObjectActionDelegate {
/**
* @see Dialog#createDialogArea(Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite area= (Composite)super.createDialogArea(parent);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java
index b5da0f7b5..c5366ed10 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java
@@ -116,6 +116,7 @@ public class BreakpointLocationVerifierJob extends Job {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public IStatus run(IProgressMonitor monitor) {
ValidBreakpointLocationLocator locator = new ValidBreakpointLocationLocator(fCunit, fLineNumber, true, fBestMatch);
fCunit.accept(locator);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointSuspendPolicyToggleAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointSuspendPolicyToggleAction.java
index 77be21775..9f44de2ff 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointSuspendPolicyToggleAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointSuspendPolicyToggleAction.java
@@ -35,6 +35,7 @@ public class BreakpointSuspendPolicyToggleAction extends BreakpointToggleAction
/**
* @see BreakpointToggleAction#doAction(IJavaBreakpoint)
*/
+ @Override
public void doAction(IJavaBreakpoint breakpoint) throws CoreException {
if(breakpoint.getSuspendPolicy() != fCurrentPolicy) {
breakpoint.setSuspendPolicy(fCurrentPolicy);
@@ -44,6 +45,7 @@ public class BreakpointSuspendPolicyToggleAction extends BreakpointToggleAction
/**
* @see BreakpointToggleAction#getToggleState(IJavaBreakpoint)
*/
+ @Override
protected boolean getToggleState(IJavaBreakpoint breakpoint) {
return false;
}
@@ -51,6 +53,7 @@ public class BreakpointSuspendPolicyToggleAction extends BreakpointToggleAction
/**
* @see BreakpointToggleAction#isEnabledFor(IStructuredSelection)
*/
+ @Override
public boolean isEnabledFor(IStructuredSelection selection) {
Iterator iter= selection.iterator();
while (iter.hasNext()) {
@@ -66,6 +69,7 @@ public class BreakpointSuspendPolicyToggleAction extends BreakpointToggleAction
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
super.selectionChanged(action, selection);
if (action.isEnabled()) {
@@ -77,6 +81,7 @@ public class BreakpointSuspendPolicyToggleAction extends BreakpointToggleAction
/**
* @see org.eclipse.jdt.internal.debug.ui.actions.BreakpointToggleAction#isToggleAction()
*/
+ @Override
protected boolean isToggleAction() {
return false;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ControlAccessibleListener.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ControlAccessibleListener.java
index 2fece5c4d..1c7e3e043 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ControlAccessibleListener.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ControlAccessibleListener.java
@@ -21,6 +21,7 @@ public class ControlAccessibleListener extends AccessibleAdapter {
controlName = name;
}
+ @Override
public void getName(AccessibleEvent e) {
e.result = controlName;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/DisplayAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/DisplayAction.java
index 5db8f74ad..ae858f138 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/DisplayAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/DisplayAction.java
@@ -35,6 +35,7 @@ public class DisplayAction extends EvaluateAction {
/**
* @see EvaluateAction#displayResult(IEvaluationResult)
*/
+ @Override
protected void displayResult(final IEvaluationResult evaluationResult) {
if (evaluationResult.hasErrors()) {
final Display display = JDIDebugUIPlugin.getStandardDisplay();
@@ -97,6 +98,7 @@ public class DisplayAction extends EvaluateAction {
});
}
+ @Override
protected void run() {
IWorkbenchPart part= getTargetPart();
if (part instanceof JavaSnippetEditor) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditClasspathEntryAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditClasspathEntryAction.java
index d94db829f..0aa31dbd2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditClasspathEntryAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditClasspathEntryAction.java
@@ -38,6 +38,7 @@ public class EditClasspathEntryAction extends RuntimeClasspathAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
List targets = getOrderedSelection();
if (targets.size() != 1) {
@@ -79,6 +80,7 @@ public class EditClasspathEntryAction extends RuntimeClasspathAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
if (selection.size() == 1) {
Object element = selection.getFirstElement();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditStepFiltersAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditStepFiltersAction.java
index f11c0df5e..7d675b044 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditStepFiltersAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditStepFiltersAction.java
@@ -23,6 +23,7 @@ public class EditStepFiltersAction extends ActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
SWTFactory.showPreferencePage(JavaStepFilterPreferencePage.PAGE_ID);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditVariableLogicalStructureAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditVariableLogicalStructureAction.java
index e62714a04..82f591b65 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditVariableLogicalStructureAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EditVariableLogicalStructureAction.java
@@ -51,7 +51,8 @@ public class EditVariableLogicalStructureAction extends ActionDelegate implement
* Prompt the user to edit the logical structure associated with the currently
* selected variable.
*/
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
if (fStructure == null) {
return;
}
@@ -67,7 +68,8 @@ public class EditVariableLogicalStructureAction extends ActionDelegate implement
/**
* @see ActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
fStructure= null;
Object element = ((IStructuredSelection) selection).getFirstElement();
if (element instanceof IJavaVariable) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EntryToggleAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EntryToggleAction.java
index 89b7ac9bf..07038818d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EntryToggleAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/EntryToggleAction.java
@@ -23,6 +23,7 @@ public class EntryToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#getToggleState(IJavaBreakpoint)
*/
+ @Override
protected boolean getToggleState(IJavaBreakpoint breakpoint) throws CoreException {
return ((IJavaMethodBreakpoint)breakpoint).isEntry();
}
@@ -30,6 +31,7 @@ public class EntryToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#doAction(IJavaBreakpoint)
*/
+ @Override
public void doAction(IJavaBreakpoint breakpoint) throws CoreException {
((IJavaMethodBreakpoint)breakpoint).setEntry(!((IJavaMethodBreakpoint)breakpoint).isEntry());
}
@@ -37,6 +39,7 @@ public class EntryToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#isEnabledFor(IStructuredSelection)
*/
+ @Override
public boolean isEnabledFor(IStructuredSelection selection) {
Iterator iter= selection.iterator();
while (iter.hasNext()) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionCaughtToggleAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionCaughtToggleAction.java
index a672a4701..2e149d87f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionCaughtToggleAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionCaughtToggleAction.java
@@ -26,6 +26,7 @@ public class ExceptionCaughtToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#getToggleState(IJavaBreakpoint)
*/
+ @Override
protected boolean getToggleState(IJavaBreakpoint breakpoint) throws CoreException {
//will only be called after isEnabledFor so cast is safe
IJavaExceptionBreakpoint exception= (IJavaExceptionBreakpoint)breakpoint;
@@ -35,6 +36,7 @@ public class ExceptionCaughtToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#doAction(IJavaBreakpoint)
*/
+ @Override
public void doAction(IJavaBreakpoint breakpoint) throws CoreException {
//will only be called after isEnabledFor so cast is safe
IJavaExceptionBreakpoint exception= (IJavaExceptionBreakpoint)breakpoint;
@@ -44,6 +46,7 @@ public class ExceptionCaughtToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#isEnabledFor(IStructuredSelection)
*/
+ @Override
public boolean isEnabledFor(IStructuredSelection selection) {
Iterator iter= selection.iterator();
while (iter.hasNext()) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionUncaughtToggleAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionUncaughtToggleAction.java
index 25c49253b..81366f2ed 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionUncaughtToggleAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExceptionUncaughtToggleAction.java
@@ -26,6 +26,7 @@ public class ExceptionUncaughtToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#getToggleState(IJavaBreakpoint)
*/
+ @Override
protected boolean getToggleState(IJavaBreakpoint breakpoint) throws CoreException {
//will only be called after isEnabledFor so cast is safe
IJavaExceptionBreakpoint exception= (IJavaExceptionBreakpoint)breakpoint;
@@ -35,6 +36,7 @@ public class ExceptionUncaughtToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#doAction(IJavaBreakpoint)
*/
+ @Override
public void doAction(IJavaBreakpoint breakpoint) throws CoreException {
//will only be called after isEnabledFor so cast is safe
IJavaExceptionBreakpoint exception= (IJavaExceptionBreakpoint)breakpoint;
@@ -44,6 +46,7 @@ public class ExceptionUncaughtToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#isEnabledFor(IStructuredSelection)
*/
+ @Override
public boolean isEnabledFor(IStructuredSelection selection) {
Iterator iter= selection.iterator();
while (iter.hasNext()) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExecuteAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExecuteAction.java
index 3b00db38e..7b9a08ab4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExecuteAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExecuteAction.java
@@ -23,6 +23,7 @@ public class ExecuteAction extends EvaluateAction {
/**
* @see org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction#displayResult(org.eclipse.jdt.debug.eval.IEvaluationResult)
*/
+ @Override
protected void displayResult(final IEvaluationResult result) {
if (result.hasErrors()) {
final Display display = JDIDebugUIPlugin.getStandardDisplay();
@@ -43,6 +44,7 @@ public class ExecuteAction extends EvaluateAction {
/**
* @see org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction#run()
*/
+ @Override
protected void run() {
IWorkbenchPart part= getTargetPart();
if (part instanceof JavaSnippetEditor) {
@@ -55,6 +57,7 @@ public class ExecuteAction extends EvaluateAction {
/**
* @see org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction#getDataDisplay()
*/
+ @Override
protected IDataDisplay getDataDisplay() {
return super.getDirectDataDisplay();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExitToggleAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExitToggleAction.java
index 8d16ccc9d..c95c120ac 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExitToggleAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExitToggleAction.java
@@ -23,6 +23,7 @@ public class ExitToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#getToggleState(IJavaBreakpoint)
*/
+ @Override
protected boolean getToggleState(IJavaBreakpoint breakpoint) throws CoreException {
return ((IJavaMethodBreakpoint)breakpoint).isExit();
}
@@ -30,6 +31,7 @@ public class ExitToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#doAction(IJavaBreakpoint)
*/
+ @Override
public void doAction(IJavaBreakpoint breakpoint) throws CoreException {
((IJavaMethodBreakpoint)breakpoint).setExit(!((IJavaMethodBreakpoint)breakpoint).isExit());
}
@@ -37,6 +39,7 @@ public class ExitToggleAction extends BreakpointToggleAction {
/**
* @see BreakpointToggleAction#isEnabledFor(IStructuredSelection)
*/
+ @Override
public boolean isEnabledFor(IStructuredSelection selection) {
Iterator iter= selection.iterator();
while (iter.hasNext()) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExpressionInputDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExpressionInputDialog.java
index 34617a057..8bc62a9d4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExpressionInputDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ExpressionInputDialog.java
@@ -91,7 +91,8 @@ public class ExpressionInputDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
- protected Control createDialogArea(Composite parent) {
+ @Override
+ protected Control createDialogArea(Composite parent) {
IWorkbench workbench = PlatformUI.getWorkbench();
workbench.getHelpSystem().setHelp(
parent,
@@ -183,6 +184,7 @@ public class ExpressionInputDialog extends TrayDialog {
IDocument document= new Document();
tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
fSourceViewer.configure(new DisplayViewerConfiguration() {
+ @Override
public IContentAssistProcessor getContentAssistantProcessor() {
return getCompletionProcessor();
}
@@ -328,7 +330,8 @@ public class ExpressionInputDialog extends TrayDialog {
/**
* Persist the dialog size and store the user's input on OK is pressed.
*/
- protected void okPressed() {
+ @Override
+ protected void okPressed() {
fResult= getText();
super.okPressed();
}
@@ -375,7 +378,8 @@ public class ExpressionInputDialog extends TrayDialog {
/**
* Initializes the dialog shell with a title.
*/
- protected void configureShell(Shell newShell) {
+ @Override
+ protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(ActionMessages.ExpressionInputDialog_2);
}
@@ -384,7 +388,8 @@ public class ExpressionInputDialog extends TrayDialog {
* Override method to initialize the enablement of the OK button after
* it is created.
*/
- protected void createButtonsForButtonBar(Composite parent) {
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
//do this here because setting the text will set enablement on the ok
// button
@@ -394,7 +399,8 @@ public class ExpressionInputDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#close()
*/
- public boolean close() {
+ @Override
+ public boolean close() {
dispose();
return super.close();
}
@@ -402,7 +408,8 @@ public class ExpressionInputDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ForceReturnAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ForceReturnAction.java
index 680849573..71e7d1612 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ForceReturnAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ForceReturnAction.java
@@ -35,6 +35,7 @@ public class ForceReturnAction extends EvaluateAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction#displayResult(org.eclipse.jdt.debug.eval.IEvaluationResult)
*/
+ @Override
protected void displayResult(final IEvaluationResult result) {
evaluationCleanup();
@@ -82,6 +83,7 @@ public class ForceReturnAction extends EvaluateAction {
}
}
+ @Override
protected void run() {
IJavaStackFrame stackFrame= getStackFrameContext();
if (stackFrame != null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InspectAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InspectAction.java
index 122d846c1..844ea03b3 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InspectAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InspectAction.java
@@ -38,6 +38,7 @@ public class InspectAction extends EvaluateAction {
/**
* @see EvaluateAction#displayResult(IEvaluationResult)
*/
+ @Override
protected void displayResult(final IEvaluationResult result) {
final Display display= JDIDebugUIPlugin.getStandardDisplay();
display.asyncExec(new Runnable() {
@@ -75,6 +76,7 @@ public class InspectAction extends EvaluateAction {
}
}
+ @Override
protected void run() {
IWorkbenchPart part= getTargetPart();
if (part instanceof JavaSnippetEditor) {
@@ -103,6 +105,7 @@ public class InspectAction extends EvaluateAction {
showExpressionView();
}
+ @Override
protected IDataDisplay getDataDisplay() {
return getDirectDataDisplay();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InstanceFiltersAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InstanceFiltersAction.java
index 3a930f91a..931135d75 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InstanceFiltersAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/InstanceFiltersAction.java
@@ -69,6 +69,7 @@ public class InstanceFiltersAction extends ObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog#isValid()
*/
+ @Override
protected boolean isValid() {
return true;
}
@@ -76,6 +77,7 @@ public class InstanceFiltersAction extends ObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return IJavaDebugUIConstants.PLUGIN_ID + ".INSTANCE_FILTERS_ACTION_DIALOG"; //$NON-NLS-1$
}
@@ -83,6 +85,7 @@ public class InstanceFiltersAction extends ObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IJavaDebugHelpContextIds.INSTANCE_BREAKPOINT_SELECTION_DIALOG;
}
@@ -90,6 +93,7 @@ public class InstanceFiltersAction extends ObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fInput;
}
@@ -97,6 +101,7 @@ public class InstanceFiltersAction extends ObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return fMessage;
}
@@ -104,6 +109,7 @@ public class InstanceFiltersAction extends ObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
*/
+ @Override
protected IBaseLabelProvider getLabelProvider() {
return fLabelProvider;
}
@@ -135,6 +141,7 @@ public class InstanceFiltersAction extends ObjectActionDelegate {
}
InstanceFilterDialog dialog = new InstanceFilterDialog(JDIDebugUIPlugin.getActiveWorkbenchShell(), breakpoints, modelPresentation, MessageFormat.format(ActionMessages.InstanceFiltersAction_1, new String[] {var.getName()})){
+ @Override
public void okPressed() {
// check if breakpoints have already been restricted to other objects.
Object[] checkBreakpoint= getCheckBoxTableViewer().getCheckedElements();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaBreakpointPropertiesRulerAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaBreakpointPropertiesRulerAction.java
index 884c27c41..e67a05eae 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaBreakpointPropertiesRulerAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaBreakpointPropertiesRulerAction.java
@@ -43,6 +43,7 @@ public class JavaBreakpointPropertiesRulerAction extends RulerBreakpointAction i
/**
* @see Action#run()
*/
+ @Override
public void run() {
if (getBreakpoint() != null) {
PropertyDialogAction action=
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java
index 47e4cbf41..24cdfec61 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java
@@ -109,6 +109,7 @@ public class JavaObjectValueEditor implements IVariableValueEditor {
*/
protected void setValue(final IVariable variable, final String expression){
UIJob job = new UIJob("Setting Variable Value"){ //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
try {
IValue newValue = evaluate(expression);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaPrimitiveValueEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaPrimitiveValueEditor.java
index 7387a4c1b..ddba333c2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaPrimitiveValueEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaPrimitiveValueEditor.java
@@ -56,7 +56,8 @@ public class JavaPrimitiveValueEditor implements IVariableValueEditor {
String initialValue= variable.getValue().getValueString();
PrimitiveValidator validator= new PrimitiveValidator();
InputDialog dialog= new InputDialog(shell, title, message, initialValue, validator){
- protected Control createDialogArea(Composite parent) {
+ @Override
+ protected Control createDialogArea(Composite parent) {
IWorkbench workbench = PlatformUI.getWorkbench();
workbench.getHelpSystem().setHelp(parent, IJavaDebugHelpContextIds.DEFAULT_INPUT_DIALOG);
return super.createDialogArea(parent);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveDownAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveDownAction.java
index 90f5f99eb..433b0fb03 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveDownAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveDownAction.java
@@ -27,6 +27,7 @@ public class MoveDownAction extends RuntimeClasspathAction {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
List targets = getOrderedSelection();
if (targets.isEmpty()) {
@@ -56,6 +57,7 @@ public class MoveDownAction extends RuntimeClasspathAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.RuntimeClasspathAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
if (selection.isEmpty()) {
return false;
@@ -66,6 +68,7 @@ public class MoveDownAction extends RuntimeClasspathAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.RuntimeClasspathAction#getActionType()
*/
+ @Override
protected int getActionType() {
return MOVE;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveUpAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveUpAction.java
index 5781c2e10..84e291096 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveUpAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/MoveUpAction.java
@@ -29,6 +29,7 @@ public class MoveUpAction extends RuntimeClasspathAction {
* Moves all selected entries up one position (if possible).
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
List targets = getOrderedSelection();
if (targets.isEmpty()) {
@@ -59,6 +60,7 @@ public class MoveUpAction extends RuntimeClasspathAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.RuntimeClasspathAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
if (selection.isEmpty()) {
return false;
@@ -69,6 +71,7 @@ public class MoveUpAction extends RuntimeClasspathAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.RuntimeClasspathAction#getActionType()
*/
+ @Override
protected int getActionType() {
return MOVE;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ObjectFilter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ObjectFilter.java
index 5965edaa1..454cc35ec 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ObjectFilter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ObjectFilter.java
@@ -37,6 +37,7 @@ public class ObjectFilter extends ViewerFilter {
/**
* @see ViewerFilter#select(Viewer, Object, Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return !fFilter.contains(element);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeAction.java
index b5e17008e..77110c854 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeAction.java
@@ -24,6 +24,7 @@ public class OpenDeclaringTypeAction extends OpenStackFrameAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#getTypeToOpen(org.eclipse.debug.core.model.IDebugElement)
*/
+ @Override
protected IJavaType getTypeToOpen(IDebugElement element) throws CoreException {
if (element instanceof IJavaStackFrame) {
IJavaStackFrame frame = (IJavaStackFrame) element;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeHierarchyAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeHierarchyAction.java
index 0fa995b0e..caaac5f1c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeHierarchyAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDeclaringTypeHierarchyAction.java
@@ -18,6 +18,7 @@ public class OpenDeclaringTypeHierarchyAction extends OpenDeclaringTypeAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#isHierarchy()
*/
+ @Override
protected boolean isHierarchy() {
return true;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDialogAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDialogAction.java
index bf53fdbaf..5cf1836d6 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDialogAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenDialogAction.java
@@ -82,6 +82,7 @@ public abstract class OpenDialogAction extends RuntimeClasspathAction {
return settings;
}
+ @Override
protected int getActionType() {
return ADD;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenFromClipboardAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenFromClipboardAction.java
index 9aa3edd41..b950083c7 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenFromClipboardAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenFromClipboardAction.java
@@ -551,6 +551,7 @@ public class OpenFromClipboardAction implements IWorkbenchWindowActionDelegate {
private static SearchRequestor createSearchRequestor(final List matches) {
return new SearchRequestor() {
+ @Override
public void acceptSearchMatch(SearchMatch match) {
if (match.getAccuracy() == SearchMatch.A_ACCURATE)
matches.add(match.getElement());
@@ -591,6 +592,7 @@ public class OpenFromClipboardAction implements IWorkbenchWindowActionDelegate {
try {
searchEngine.searchAllTypeNames(packageName == null ? null : packageName.toCharArray(), packageName == null ? SearchPattern.R_EXACT_MATCH : getSearchFlags(), typeName.toCharArray(),
getSearchFlags(), IJavaSearchConstants.TYPE, scope, new TypeNameMatchRequestor() {
+ @Override
public void acceptTypeNameMatch(TypeNameMatch match) {
matches.add(match.getType());
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeAction.java
index 2adcce9dc..4e0ca5ef3 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeAction.java
@@ -24,6 +24,7 @@ public class OpenReceivingTypeAction extends OpenStackFrameAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#getTypeToOpen(org.eclipse.debug.core.model.IDebugElement)
*/
+ @Override
protected IJavaType getTypeToOpen(IDebugElement element) throws CoreException {
if (element instanceof IJavaStackFrame) {
IJavaStackFrame frame = (IJavaStackFrame) element;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeHierarchyAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeHierarchyAction.java
index b947f17ce..1c27c6e73 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeHierarchyAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenReceivingTypeHierarchyAction.java
@@ -18,6 +18,7 @@ public class OpenReceivingTypeHierarchyAction extends OpenReceivingTypeAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#isHierarchy()
*/
+ @Override
protected boolean isHierarchy() {
return true;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenStackFrameAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenStackFrameAction.java
index 192c31aac..754634c85 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenStackFrameAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenStackFrameAction.java
@@ -23,6 +23,7 @@ public abstract class OpenStackFrameAction extends OpenTypeAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#getDebugElement(org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
protected IDebugElement getDebugElement(IAdaptable element) {
return (IDebugElement)element.getAdapter(IJavaStackFrame.class);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenTypeAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenTypeAction.java
index ff6505990..97c6d3f44 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenTypeAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenTypeAction.java
@@ -164,6 +164,7 @@ public abstract class OpenTypeAction extends ObjectActionDelegate {
}
}
TypeNameMatchRequestor requestor= new TypeNameMatchRequestor() {
+ @Override
public void acceptTypeNameMatch(TypeNameMatch match) {
throw new ResultException(match.getType());
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeAction.java
index 8d3cf6f1f..ccd343b96 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeAction.java
@@ -25,6 +25,7 @@ public class OpenVariableConcreteTypeAction extends OpenVariableTypeAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#getTypeToOpen(org.eclipse.debug.core.model.IDebugElement)
*/
+ @Override
protected IJavaType getTypeToOpen(IDebugElement element) throws CoreException {
if (element instanceof IJavaVariable) {
IJavaVariable variable = (IJavaVariable) element;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeHierarchyAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeHierarchyAction.java
index 8a130b031..c2a0adea9 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeHierarchyAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableConcreteTypeHierarchyAction.java
@@ -18,6 +18,7 @@ public class OpenVariableConcreteTypeHierarchyAction extends OpenVariableConcret
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#isHierarchy()
*/
+ @Override
protected boolean isHierarchy() {
return true;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeAction.java
index b5740a213..449ebe7ff 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeAction.java
@@ -24,6 +24,7 @@ public class OpenVariableDeclaredTypeAction extends OpenVariableTypeAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#getTypeToOpen(org.eclipse.debug.core.model.IDebugElement)
*/
+ @Override
protected IJavaType getTypeToOpen(IDebugElement element) throws CoreException {
if (element instanceof IJavaVariable) {
IJavaVariable variable = (IJavaVariable) element;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeHierarchyAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeHierarchyAction.java
index 6a5377359..e6594643a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeHierarchyAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableDeclaredTypeHierarchyAction.java
@@ -18,6 +18,7 @@ public class OpenVariableDeclaredTypeHierarchyAction extends OpenVariableDeclare
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#isHierarchy()
*/
+ @Override
protected boolean isHierarchy() {
return true;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableTypeAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableTypeAction.java
index f51c66043..2b49a5e84 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableTypeAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/OpenVariableTypeAction.java
@@ -23,6 +23,7 @@ public abstract class OpenVariableTypeAction extends OpenTypeAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#getDebugElement(org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
protected IDebugElement getDebugElement(IAdaptable element) {
return (IDebugElement)element.getAdapter(IJavaVariable.class);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupDisplayAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupDisplayAction.java
index a16299b44..75576b64a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupDisplayAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupDisplayAction.java
@@ -54,10 +54,12 @@ public class PopupDisplayAction extends DisplayAction {
super(shell, getPopupAnchor(textWidget), ACTION_DEFINITION_ID);
}
- protected String getActionText() {
+ @Override
+ protected String getActionText() {
return ActionMessages.PopupDisplayAction_2;
}
+ @Override
protected void persist() {
IDataDisplay directDisplay = getDirectDataDisplay();
Display display = JDIDebugUIPlugin.getStandardDisplay();
@@ -73,7 +75,8 @@ public class PopupDisplayAction extends DisplayAction {
}
}
- protected Control createDialogArea(Composite parent) {
+ @Override
+ protected Control createDialogArea(Composite parent) {
GridData gd = new GridData(GridData.FILL_BOTH);
StyledText text = new StyledText(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
text.setLayoutData(gd);
@@ -85,7 +88,8 @@ public class PopupDisplayAction extends DisplayAction {
return text;
}
- public boolean close() {
+ @Override
+ public boolean close() {
boolean returnValue = super.close();
if (fTextEditor != null && fSelectionBeforeEvaluation != null) {
fTextEditor.getSelectionProvider().setSelection(fSelectionBeforeEvaluation);
@@ -96,7 +100,8 @@ public class PopupDisplayAction extends DisplayAction {
}
}
- protected void displayStringResult(String currentSnippet, String currentResultString) {
+ @Override
+ protected void displayStringResult(String currentSnippet, String currentResultString) {
IWorkbenchPart part = getTargetPart();
if (part instanceof DisplayView) {
super.displayStringResult(currentSnippet, currentResultString);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupInspectAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupInspectAction.java
index 2e8a0ffeb..ff946ece0 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupInspectAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/PopupInspectAction.java
@@ -32,7 +32,8 @@ public class PopupInspectAction extends InspectAction {
/**
* @see EvaluateAction#displayResult(IEvaluationResult)
*/
- protected void displayResult(final IEvaluationResult result) {
+ @Override
+ protected void displayResult(final IEvaluationResult result) {
IWorkbenchPart part = getTargetPart();
final StyledText styledText = getStyledText(part);
if (styledText == null) {
@@ -55,7 +56,8 @@ public class PopupInspectAction extends InspectAction {
fSelectionBeforeEvaluation = getTargetSelection();
}
DebugPopup displayPopup = new InspectPopupDialog(getShell(), getPopupAnchor(textWidget), ACTION_DEFININITION_ID, expression){
- public boolean close() {
+ @Override
+ public boolean close() {
boolean returnValue = super.close();
if (fTextEditor != null && fSelectionBeforeEvaluation != null){
fTextEditor.getSelectionProvider().setSelection(fSelectionBeforeEvaluation);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ProjectSelectionDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ProjectSelectionDialog.java
index 161068605..92d665c81 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ProjectSelectionDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ProjectSelectionDialog.java
@@ -47,11 +47,13 @@ public class ProjectSelectionDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void addCustomFooterControls(Composite parent) {
super.addCustomFooterControls(parent);
final Button addExported = new Button(parent, SWT.CHECK);
addExported.setText(ActionMessages.ProjectSelectionDialog_Add_exported_entries_of_selected_projects__1);
addExported.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fAddExportedEntries = addExported.getSelection();
}
@@ -62,6 +64,7 @@ public class ProjectSelectionDialog extends AbstractDebugCheckboxSelectionDialog
final Button addRequired = new Button(parent, SWT.CHECK);
addRequired.setText(ActionMessages.ProjectSelectionDialog_Add_required_projects_of_selected_projects__2);
addRequired.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fAddRequiredProjects = addRequired.getSelection();
}
@@ -91,6 +94,7 @@ public class ProjectSelectionDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return IJavaDebugUIConstants.PLUGIN_ID + ".PROJECT_SELECTION_DIALOG_SECTION"; //$NON-NLS-1$
}
@@ -98,6 +102,7 @@ public class ProjectSelectionDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IJavaDebugHelpContextIds.SELECT_PROJECT_DIALOG;
}
@@ -105,6 +110,7 @@ public class ProjectSelectionDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fProjects;
}
@@ -112,6 +118,7 @@ public class ProjectSelectionDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return ActionMessages.ProjectSelectionDialog_0;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RemoveAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RemoveAction.java
index 2c05fb33d..e428dd344 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RemoveAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RemoveAction.java
@@ -29,6 +29,7 @@ public class RemoveAction extends RuntimeClasspathAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
List targets = getOrderedSelection();
List list = getEntriesAsList();
@@ -39,6 +40,7 @@ public class RemoveAction extends RuntimeClasspathAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
if (selection.isEmpty()) {
return false;
@@ -46,6 +48,7 @@ public class RemoveAction extends RuntimeClasspathAction {
return getViewer().updateSelection(getActionType(), selection);
}
+ @Override
protected int getActionType() {
return REMOVE;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RestoreDefaultEntriesAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RestoreDefaultEntriesAction.java
index b436a9d11..d443975ca 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RestoreDefaultEntriesAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RestoreDefaultEntriesAction.java
@@ -42,6 +42,7 @@ public class RestoreDefaultEntriesAction extends RuntimeClasspathAction {
*
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
try {
ILaunchConfiguration config = fTab.getLaunchConfiguration();
@@ -63,6 +64,7 @@ public class RestoreDefaultEntriesAction extends RuntimeClasspathAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
return true;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RuntimeClasspathAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RuntimeClasspathAction.java
index 017c0be54..3ca7044ae 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RuntimeClasspathAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RuntimeClasspathAction.java
@@ -133,6 +133,7 @@ public abstract class RuntimeClasspathAction extends SelectionListenerAction {
public void setButton(Button button) {
fButton = button;
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
run();
}
@@ -142,6 +143,7 @@ public abstract class RuntimeClasspathAction extends SelectionListenerAction {
/**
* @see IAction#setEnabled(boolean)
*/
+ @Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (fButton != null) {
@@ -177,6 +179,7 @@ public abstract class RuntimeClasspathAction extends SelectionListenerAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
return getViewer().updateSelection(getActionType(), selection);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java
index e19df4975..7a53f319d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java
@@ -25,6 +25,7 @@ public class ShowConstantsAction extends ToggleBooleanPreferenceAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#getPreferenceKey()
*/
+ @Override
protected String getPreferenceKey() {
return IJDIPreferencesConstants.PREF_SHOW_CONSTANTS;
}
@@ -32,6 +33,7 @@ public class ShowConstantsAction extends ToggleBooleanPreferenceAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ToggleBooleanPreferenceAction#getViewKey()
*/
+ @Override
protected String getViewKey() {
return getCompositeKey();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowMonitorThreadInformation.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowMonitorThreadInformation.java
index 398075871..fd7a8f826 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowMonitorThreadInformation.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowMonitorThreadInformation.java
@@ -20,6 +20,7 @@ public class ShowMonitorThreadInformation extends ToggleBooleanPreferenceAction
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#getPreferenceKey()
*/
+ @Override
protected String getPreferenceKey() {
return IJavaDebugUIConstants.PREF_SHOW_MONITOR_THREAD_INFO;
}
@@ -27,6 +28,7 @@ public class ShowMonitorThreadInformation extends ToggleBooleanPreferenceAction
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#getCompositeKey()
*/
+ @Override
protected String getCompositeKey() {
return getPreferenceKey();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowNullArrayEntriesAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowNullArrayEntriesAction.java
index 409aa4904..c45f60bb4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowNullArrayEntriesAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowNullArrayEntriesAction.java
@@ -30,6 +30,7 @@ public class ShowNullArrayEntriesAction extends ViewFilterAction {
/**
* @see ViewFilterAction#getPreferenceKey()
*/
+ @Override
protected String getPreferenceKey() {
return IJDIPreferencesConstants.PREF_SHOW_NULL_ARRAY_ENTRIES;
}
@@ -37,6 +38,7 @@ public class ShowNullArrayEntriesAction extends ViewFilterAction {
/**
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (getValue()) {
// when on, filter nothing
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowQualifiedAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowQualifiedAction.java
index 827411651..5366f4570 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowQualifiedAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowQualifiedAction.java
@@ -31,6 +31,7 @@ public class ShowQualifiedAction extends ViewFilterAction {
/**
* @see ViewFilterAction#getPreferenceKey()
*/
+ @Override
protected String getPreferenceKey() {
return IJDIPreferencesConstants.PREF_SHOW_QUALIFIED_NAMES;
}
@@ -41,6 +42,7 @@ public class ShowQualifiedAction extends ViewFilterAction {
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return true;
}
@@ -48,6 +50,7 @@ public class ShowQualifiedAction extends ViewFilterAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
final StructuredViewer viewer = getStructuredViewer();
IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStaticVariablesAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStaticVariablesAction.java
index 9a9e09b38..42b889d26 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStaticVariablesAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStaticVariablesAction.java
@@ -25,6 +25,7 @@ public class ShowStaticVariablesAction extends ToggleBooleanPreferenceAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#getPreferenceKey()
*/
+ @Override
protected String getPreferenceKey() {
return IJDIPreferencesConstants.PREF_SHOW_STATIC_VARIABLES;
}
@@ -32,6 +33,7 @@ public class ShowStaticVariablesAction extends ToggleBooleanPreferenceAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ToggleBooleanPreferenceAction#getViewKey()
*/
+ @Override
protected String getViewKey() {
return getCompositeKey();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStratumAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStratumAction.java
index ad7fe5ea6..2b460f71f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStratumAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStratumAction.java
@@ -80,6 +80,7 @@ public class ShowStratumAction implements IObjectActionDelegate, IMenuCreator {
//Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
Menu menu = new Menu(parent);
menu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
@@ -126,7 +127,8 @@ public class ShowStratumAction implements IObjectActionDelegate, IMenuCreator {
item.setText(stratum);
}
item.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
if (((MenuItem)e.getSource()).getSelection()) {
target.setDefaultStratum(stratum);
} else {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowSystemThreadsAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowSystemThreadsAction.java
index 67ef4b29f..a11310e67 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowSystemThreadsAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowSystemThreadsAction.java
@@ -30,6 +30,7 @@ public class ShowSystemThreadsAction extends ViewFilterAction implements IDebugE
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ThreadFilterAction#getPreferenceKey()
*/
+ @Override
protected String getPreferenceKey() {
return IJavaDebugUIConstants.PREF_SHOW_SYSTEM_THREADS;
}
@@ -37,6 +38,7 @@ public class ShowSystemThreadsAction extends ViewFilterAction implements IDebugE
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (!getValue()) {
@@ -67,6 +69,7 @@ public class ShowSystemThreadsAction extends ViewFilterAction implements IDebugE
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
super.init(view);
DebugPlugin.getDefault().addDebugEventListener(this);
@@ -74,6 +77,7 @@ public class ShowSystemThreadsAction extends ViewFilterAction implements IDebugE
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
DebugPlugin.getDefault().removeDebugEventListener(this);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowThreadGroups.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowThreadGroups.java
index ded80de53..493df658d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowThreadGroups.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowThreadGroups.java
@@ -20,6 +20,7 @@ public class ShowThreadGroups extends ToggleBooleanPreferenceAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#getPreferenceKey()
*/
+ @Override
protected String getPreferenceKey() {
return IJavaDebugUIConstants.PREF_SHOW_THREAD_GROUPS;
}
@@ -27,6 +28,7 @@ public class ShowThreadGroups extends ToggleBooleanPreferenceAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#getCompositeKey()
*/
+ @Override
protected String getCompositeKey() {
return getPreferenceKey();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/StringValueInputDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/StringValueInputDialog.java
index a701ba9ef..661653eae 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/StringValueInputDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/StringValueInputDialog.java
@@ -61,7 +61,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ExpressionInputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
- protected Control createDialogArea(Composite parent) {
+ @Override
+ protected Control createDialogArea(Composite parent) {
Control control = super.createDialogArea(parent);
IWorkbench workbench = PlatformUI.getWorkbench();
workbench.getHelpSystem().setHelp(parent, IJavaDebugHelpContextIds.STRING_VALUE_INPUT_DIALOG);
@@ -71,7 +72,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ExpressionInputDialog#createInputArea(org.eclipse.swt.widgets.Composite)
*/
- protected Composite createInputArea(Composite parent) {
+ @Override
+ protected Composite createInputArea(Composite parent) {
Composite composite = super.createInputArea(parent);
createRadioButtons(parent);
return composite;
@@ -81,7 +83,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
* Override superclass method to create the appropriate viewer
* (source viewer or simple text viewer) in the input area.
*/
- protected void populateInputArea(Composite parent) {
+ @Override
+ protected void populateInputArea(Composite parent) {
super.populateInputArea(parent);
createTextViewer(parent);
@@ -130,7 +133,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
fWrapText = SWTFactory.createCheckButton(fTextGroup, ActionMessages.StringValueInputDialog_4, null, wrap, 1);
updateWordWrap();
fWrapText.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
updateWordWrap();
}
});
@@ -157,7 +161,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
fTextButton = SWTFactory.createRadioButton(parent, ActionMessages.StringValueInputDialog_1);
fTextButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
handleRadioSelectionChanged();
}
});
@@ -199,7 +204,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
/**
* Updates the error message based on the user's input.
*/
- protected void refreshValidState() {
+ @Override
+ protected void refreshValidState() {
if (isUseLiteralValue()) {
refreshValidState(fTextViewer);
} else {
@@ -211,7 +217,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
* Override superclass method to persist user's evaluation/literal mode
* selection.
*/
- protected void okPressed() {
+ @Override
+ protected void okPressed() {
IDialogSettings settings= getDialogSettings();
if (settings == null) {
settings= JDIDebugUIPlugin.getDefault().getDialogSettings().addNewSection(getDialogSettingsSectionName());
@@ -239,7 +246,8 @@ public class StringValueInputDialog extends ExpressionInputDialog {
* viewer if appropriate.
* @see ExpressionInputDialog#getText()
*/
- protected String getText() {
+ @Override
+ protected String getText() {
if (fTextButton.getSelection()) {
return fTextViewer.getDocument().get();
}
@@ -257,6 +265,7 @@ public class StringValueInputDialog extends ExpressionInputDialog {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ExpressionInputDialog#getDialogSettingsSectionName()
*/
+ @Override
protected String getDialogSettingsSectionName() {
return "STRING_VALUE_INPUT_DIALOG"; //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBooleanPreferenceAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBooleanPreferenceAction.java
index 989c71863..f4fb7e758 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBooleanPreferenceAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBooleanPreferenceAction.java
@@ -27,6 +27,7 @@ public abstract class ToggleBooleanPreferenceAction extends ViewFilterAction {
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return false;
}
@@ -34,6 +35,7 @@ public abstract class ToggleBooleanPreferenceAction extends ViewFilterAction {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
final StructuredViewer viewer = getStructuredViewer();
BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable() {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
index 7b2495a06..a4a615f78 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
@@ -211,7 +211,8 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTargetExtensio
*/
public void toggleLineBreakpoints(final IWorkbenchPart part, final ISelection selection, final boolean bestMatch, final ValidBreakpointLocationLocator locator) {
Job job = new Job("Toggle Line Breakpoint") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
ITextEditor editor = getTextEditor(part);
if (editor != null && selection instanceof ITextSelection) {
if (monitor.isCanceled()) {
@@ -305,7 +306,8 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTargetExtensio
*/
public void toggleMethodBreakpoints(final IWorkbenchPart part, final ISelection finalSelection) {
Job job = new Job("Toggle Method Breakpoints") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
@@ -388,6 +390,7 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTargetExtensio
*/
public void toggleClassBreakpoints(final IWorkbenchPart part, final ISelection selection) {
Job job = new Job("Toggle Class Load Breakpoints") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
@@ -824,7 +827,8 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTargetExtensio
*/
public void toggleWatchpoints(final IWorkbenchPart part, final ISelection finalSelection) {
Job job = new Job("Toggle Watchpoints") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/WatchAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/WatchAction.java
index 16177d0d7..492348aa7 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/WatchAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/WatchAction.java
@@ -29,6 +29,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
*/
public class WatchAction extends InspectAction {
+ @Override
public void run() {
Object selectedObject= getSelectedObject();
if (selectedObject instanceof IStructuredSelection) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddClassPrepareBreakpointAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddClassPrepareBreakpointAction.java
index b25aeec38..089aa0375 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddClassPrepareBreakpointAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddClassPrepareBreakpointAction.java
@@ -88,7 +88,8 @@ public class AddClassPrepareBreakpointAction implements IWorkbenchWindowActionDe
final int finalStart = start;
final int finalEnd = end;
new Job(BreakpointMessages.AddClassPrepareBreakpointAction_2) {
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
try {
JDIDebugModel.createClassPrepareBreakpoint(resource, type.getFullyQualifiedName(), finalKind, finalStart, finalEnd, true, map);
return Status.OK_STATUS;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java
index a15ff5dce..d8c2f1174 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionAction.java
@@ -136,6 +136,7 @@ public class AddExceptionAction implements IViewActionDelegate, IWorkbenchWindow
// If the breakpoint does not exist, add it. If it does exist, make sure it is enabled.
if (!exists) {
Job job = new Job(BreakpointMessages.AddExceptionAction_0) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
JDIDebugModel.createExceptionBreakpoint(resource,
@@ -154,7 +155,8 @@ public class AddExceptionAction implements IViewActionDelegate, IWorkbenchWindow
} else {
final IJavaBreakpoint existingBreakpoint = breakpoint;
Job job = new Job(BreakpointMessages.AddExceptionAction_EnableExceptionBreakpoint) {
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
try {
existingBreakpoint.setEnabled(true);
return Status.OK_STATUS;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionTypeDialogExtension.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionTypeDialogExtension.java
index c175c562e..38d17fe65 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionTypeDialogExtension.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AddExceptionTypeDialogExtension.java
@@ -55,6 +55,7 @@ public class AddExceptionTypeDialogExtension extends TypeSelectionExtension {
/* (non-Javadoc)
* @see org.eclipse.jdt.ui.dialogs.TypeSelectionExtension#createContentArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createContentArea(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
fCaughtButton = SWTFactory.createCheckButton(comp, BreakpointMessages.AddExceptionDialog_15, null, fCaught, 1);
@@ -77,6 +78,7 @@ public class AddExceptionTypeDialogExtension extends TypeSelectionExtension {
/* (non-Javadoc)
* @see org.eclipse.jdt.ui.dialogs.TypeSelectionExtension#getSelectionValidator()
*/
+ @Override
public ISelectionStatusValidator getSelectionValidator() {
return new ISelectionStatusValidator() {
public IStatus validate(Object[] selection) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/CompositeBreakpointEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/CompositeBreakpointEditor.java
index 93262ca32..30063414c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/CompositeBreakpointEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/CompositeBreakpointEditor.java
@@ -35,6 +35,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#addPropertyListener(org.eclipse.ui.IPropertyListener)
*/
+ @Override
public void addPropertyListener(IPropertyListener listener) {
for (int i = 0; i < fEditors.length; i++) {
fEditors[i].addPropertyListener(listener);
@@ -44,6 +45,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#removePropertyListener(org.eclipse.ui.IPropertyListener)
*/
+ @Override
public void removePropertyListener(IPropertyListener listener) {
for (int i = 0; i < fEditors.length; i++) {
fEditors[i].removePropertyListener(listener);
@@ -53,6 +55,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#dispose()
*/
+ @Override
protected void dispose() {
for (int i = 0; i < fEditors.length; i++) {
fEditors[i].dispose();
@@ -63,6 +66,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0);
for (int i = 0; i < fEditors.length; i++) {
@@ -74,6 +78,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#setFocus()
*/
+ @Override
public void setFocus() {
fEditors[0].setFocus();
}
@@ -81,6 +86,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#doSave()
*/
+ @Override
public void doSave() throws CoreException {
for (int i = 0; i < fEditors.length; i++) {
fEditors[i].doSave();
@@ -90,6 +96,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#isDirty()
*/
+ @Override
public boolean isDirty() {
for (int i = 0; i < fEditors.length; i++) {
if (fEditors[i].isDirty()) {
@@ -102,6 +109,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#getStatus()
*/
+ @Override
public IStatus getStatus() {
for (int i = 0; i < fEditors.length; i++) {
IStatus status = fEditors[i].getStatus();
@@ -115,6 +123,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#getInput()
*/
+ @Override
public Object getInput() {
return fEditors[0].getInput();
}
@@ -122,6 +131,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#setInput(java.lang.Object)
*/
+ @Override
public void setInput(Object breakpoint) throws CoreException {
for (int i = 0; i < fEditors.length; i++) {
fEditors[i].setInput(breakpoint);
@@ -131,6 +141,7 @@ public class CompositeBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#setMnemonics(boolean)
*/
+ @Override
public void setMnemonics(boolean mnemonics) {
super.setMnemonics(mnemonics);
for (int i = 0; i < fEditors.length; i++) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java
index 1189aae59..d120e16a1 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java
@@ -39,6 +39,7 @@ public class ExceptionBreakpointDetailPane extends AbstractDetailPane {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractDetailPane#createEditor(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected AbstractJavaBreakpointEditor createEditor(Composite parent) {
return new ExceptionBreakpointEditor();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointEditor.java
index b7a3f8c29..9af95efff 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointEditor.java
@@ -40,6 +40,7 @@ public class ExceptionBreakpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
Composite container = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, 0, 0, 0);
// add standard controls
@@ -55,6 +56,7 @@ public class ExceptionBreakpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#setBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint)
*/
+ @Override
protected void setBreakpoint(IJavaBreakpoint breakpoint) throws CoreException {
super.setBreakpoint(breakpoint);
if (breakpoint instanceof IJavaExceptionBreakpoint) {
@@ -75,6 +77,7 @@ public class ExceptionBreakpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#doSave()
*/
+ @Override
public void doSave() throws CoreException {
super.doSave();
IJavaBreakpoint breakpoint = getBreakpoint();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java
index b0e2d586d..5cd8d2a8d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java
@@ -38,6 +38,7 @@ public class LineBreakpointDetailPane extends AbstractDetailPane {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractDetailPane#createEditor(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected AbstractJavaBreakpointEditor createEditor(Composite parent) {
return new CompositeBreakpointEditor(
new AbstractJavaBreakpointEditor[] {new StandardJavaBreakpointEditor(), new JavaBreakpointConditionEditor(null)});
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java
index 540fa083d..57a94a77b 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java
@@ -41,6 +41,7 @@ public class MethodBreakpointDetailPane extends AbstractDetailPane {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractDetailPane#createEditor(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected AbstractJavaBreakpointEditor createEditor(Composite parent) {
return new CompositeBreakpointEditor(new AbstractJavaBreakpointEditor[]
{new MethodBreakpointEditor(), new JavaBreakpointConditionEditor(null)});
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointEditor.java
index b4f9185c4..3e28048ef 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointEditor.java
@@ -36,6 +36,7 @@ public class MethodBreakpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
Composite composite = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, 0, 0, 0);
// add standard controls
@@ -49,6 +50,7 @@ public class MethodBreakpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#setBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint)
*/
+ @Override
protected void setBreakpoint(IJavaBreakpoint breakpoint) throws CoreException {
super.setBreakpoint(breakpoint);
if (breakpoint instanceof IJavaMethodBreakpoint) {
@@ -68,6 +70,7 @@ public class MethodBreakpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#doSave()
*/
+ @Override
public void doSave() throws CoreException {
super.doSave();
IJavaBreakpoint breakpoint = getBreakpoint();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java
index 7ab3d2197..c2dbfc0a4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java
@@ -35,6 +35,7 @@ public class StandardBreakpointDetailPane extends AbstractDetailPane {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractDetailPane#createEditor(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected AbstractJavaBreakpointEditor createEditor(Composite parent) {
return new StandardJavaBreakpointEditor();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java
index 6b1a83e1c..a23f170e5 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java
@@ -59,6 +59,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
return createStandardControls(parent);
}
@@ -68,6 +69,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
fHitCountButton = SWTFactory.createCheckButton(composite, processMnemonics(PropertyPageMessages.JavaBreakpointPage_4), null, false, 1);
fHitCountButton.setLayoutData(new GridData());
fHitCountButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
boolean enabled = fHitCountButton.getSelection();
fHitCountText.setEnabled(enabled);
@@ -92,11 +94,13 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
fSuspendVM = SWTFactory.createRadioButton(radios, processMnemonics(PropertyPageMessages.JavaBreakpointPage_8), 1);
fSuspendVM.setLayoutData(new GridData());
fSuspendThread.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setDirty(PROP_SUSPEND_POLICY);
}
});
fSuspendVM.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setDirty(PROP_SUSPEND_POLICY);
}
@@ -112,6 +116,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#setInput(java.lang.Object)
*/
+ @Override
public void setInput(Object breakpoint) throws CoreException {
try {
suppressPropertyChanges(true);
@@ -128,6 +133,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#getInput()
*/
+ @Override
public Object getInput() {
return fBreakpoint;
}
@@ -176,6 +182,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#setFocus()
*/
+ @Override
public void setFocus() {
// do nothing
}
@@ -183,6 +190,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#doSave()
*/
+ @Override
public void doSave() throws CoreException {
if (fBreakpoint != null) {
int suspendPolicy = IJavaBreakpoint.SUSPEND_THREAD;
@@ -207,6 +215,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor#getStatus()
*/
+ @Override
public IStatus getStatus() {
if (fHitCountButton.getSelection()) {
String hitCountText= fHitCountText.getText();
@@ -238,6 +247,7 @@ public class StandardJavaBreakpointEditor extends AbstractJavaBreakpointEditor {
GridData gd = new GridData(SWT.BEGINNING);
button.setLayoutData(gd);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setDirty(propId);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java
index 9b026c039..7590e00ad 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java
@@ -38,6 +38,7 @@ public class WatchpointDetailPane extends AbstractDetailPane {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractDetailPane#createEditor(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected AbstractJavaBreakpointEditor createEditor(Composite parent) {
return new WatchpointEditor();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointEditor.java
index 5e209f4cc..3e440446e 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointEditor.java
@@ -37,6 +37,7 @@ public class WatchpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
Composite container = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, 0, 0, 0);
// add standard controls
@@ -50,6 +51,7 @@ public class WatchpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#setBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint)
*/
+ @Override
protected void setBreakpoint(IJavaBreakpoint breakpoint) throws CoreException {
super.setBreakpoint(breakpoint);
if (breakpoint instanceof IJavaWatchpoint) {
@@ -69,6 +71,7 @@ public class WatchpointEditor extends StandardJavaBreakpointEditor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.breakpoints.StandardJavaBreakpointEditor#doSave()
*/
+ @Override
public void doSave() throws CoreException {
super.doSave();
IJavaBreakpoint breakpoint = getBreakpoint();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/BootpathFilter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/BootpathFilter.java
index a74e6c8aa..5e73d35e2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/BootpathFilter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/BootpathFilter.java
@@ -23,6 +23,7 @@ public class BootpathFilter extends ViewerFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof ClasspathGroup) {
ClasspathModel model = (ClasspathModel) parentElement;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathEntry.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathEntry.java
index db08d90a4..7b6482fc8 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathEntry.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathEntry.java
@@ -38,6 +38,7 @@ public class ClasspathEntry extends AbstractClasspathEntry implements IRuntimeCl
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof ClasspathEntry) {
ClasspathEntry other= (ClasspathEntry)obj;
@@ -54,6 +55,7 @@ public class ClasspathEntry extends AbstractClasspathEntry implements IRuntimeCl
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return entry.hashCode();
}
@@ -61,6 +63,7 @@ public class ClasspathEntry extends AbstractClasspathEntry implements IRuntimeCl
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return entry.getPath().toOSString();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathGroup.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathGroup.java
index b4bcdfe05..020c2e7ea 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathGroup.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/ClasspathGroup.java
@@ -46,6 +46,7 @@ public class ClasspathGroup extends AbstractClasspathEntry {
return childEntries.contains(entry);
}
+ @Override
public String toString() {
return name;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/DefaultClasspathEntryDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/DefaultClasspathEntryDialog.java
index 3739bc068..5afa1e469 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/DefaultClasspathEntryDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/DefaultClasspathEntryDialog.java
@@ -38,6 +38,7 @@ public class DefaultClasspathEntryDialog extends MessageDialog {
fEntry = (DefaultProjectClasspathEntry) entry;
}
+ @Override
protected Control createCustomArea(Composite parent) {
fButton = new Button(parent, SWT.CHECK);
fButton.setText(ClasspathMessages.DefaultClasspathEntryDialog_4);
@@ -45,6 +46,7 @@ public class DefaultClasspathEntryDialog extends MessageDialog {
return fButton;
}
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == 0) {
fEntry.setExportedEntriesOnly(fButton.getSelection());
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/RuntimeClasspathViewer.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/RuntimeClasspathViewer.java
index 3de2471d9..ca0abbdfa 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/RuntimeClasspathViewer.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/classpath/RuntimeClasspathViewer.java
@@ -59,6 +59,7 @@ public class RuntimeClasspathViewer extends TreeViewer implements IClasspathView
getTree().setLayoutData(data);
getTree().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
if (updateSelection(RuntimeClasspathAction.REMOVE, (IStructuredSelection)getSelection()) && event.character == SWT.DEL && event.stateMask == 0) {
List selection= getSelectionFromWidget();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/AutoFormatSettingAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/AutoFormatSettingAction.java
index 474639aed..616863724 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/AutoFormatSettingAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/AutoFormatSettingAction.java
@@ -37,6 +37,7 @@ public class AutoFormatSettingAction extends Action {
setChecked(checked);
}
+ @Override
public void run() {
boolean checked = isChecked();
JavaStackTraceConsoleViewer viewer = (JavaStackTraceConsoleViewer) fPage.getViewer();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionConsoleTracker.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionConsoleTracker.java
index 5fbbb72f6..3f7f32c2a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionConsoleTracker.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionConsoleTracker.java
@@ -25,7 +25,8 @@ public class JavaExceptionConsoleTracker extends JavaConsoleTracker {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListenerDelegate#matchFound(org.eclipse.ui.console.PatternMatchEvent)
*/
- public void matchFound(PatternMatchEvent event) {
+ @Override
+ public void matchFound(PatternMatchEvent event) {
try {
int offset = event.getOffset();
int length = event.getLength();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionHyperLink.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionHyperLink.java
index b0eea9cd4..392aa2399 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionHyperLink.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaExceptionHyperLink.java
@@ -55,6 +55,7 @@ public class JavaExceptionHyperLink extends JavaStackTraceHyperlink {
/**
* @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkActivated()
*/
+ @Override
public void linkActivated() {
try {
// check for an existing breakpoint
@@ -91,6 +92,7 @@ public class JavaExceptionHyperLink extends JavaStackTraceHyperlink {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink#processSearchResult(java.lang.Object, java.lang.String, int)
*/
+ @Override
protected void processSearchResult(Object source, String typeName, int lineNumber) {
try {
source = JavaDebugUtils.getJavaElement(source);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeConsoleTracker.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeConsoleTracker.java
index d90d1404f..23264c120 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeConsoleTracker.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeConsoleTracker.java
@@ -21,7 +21,8 @@ import org.eclipse.ui.console.TextConsole;
* @since 3.1
*/
public class JavaNativeConsoleTracker extends JavaConsoleTracker {
- public void matchFound(PatternMatchEvent event) {
+ @Override
+ public void matchFound(PatternMatchEvent event) {
try {
int offset = event.getOffset();
int length = event.getLength();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeStackTraceHyperlink.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeStackTraceHyperlink.java
index d7aafa23f..fd9e71313 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeStackTraceHyperlink.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaNativeStackTraceHyperlink.java
@@ -29,10 +29,12 @@ public class JavaNativeStackTraceHyperlink extends JavaStackTraceHyperlink {
/**
* @see org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink#getLineNumber()
*/
+ @Override
protected int getLineNumber(String linkText) {
return -1;
}
+ @Override
protected String getTypeName(String linkText) throws CoreException {
String typeName;
int index = linkText.indexOf('(');
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsole.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsole.java
index 525bf12ed..a00a7207c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsole.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsole.java
@@ -115,14 +115,16 @@ public class JavaStackTraceConsole extends TextConsole {
/**
* @see org.eclipse.ui.console.AbstractConsole#init()
*/
- protected void init() {
+ @Override
+ protected void init() {
JFaceResources.getFontRegistry().addListener(propertyListener);
}
/**
* @see org.eclipse.ui.console.TextConsole#dispose()
*/
- protected void dispose() {
+ @Override
+ protected void dispose() {
saveDocument();
JFaceResources.getFontRegistry().removeListener(propertyListener);
super.dispose();
@@ -152,13 +154,15 @@ public class JavaStackTraceConsole extends TextConsole {
/**
* @see org.eclipse.ui.console.TextConsole#getPartitioner()
*/
- protected IConsoleDocumentPartitioner getPartitioner() {
+ @Override
+ protected IConsoleDocumentPartitioner getPartitioner() {
return partitioner;
}
/**
* @see org.eclipse.ui.console.AbstractConsole#getHelpContextId()
*/
+ @Override
public String getHelpContextId() {
return IJavaDebugHelpContextIds.STACK_TRACE_CONSOLE;
}
@@ -166,7 +170,8 @@ public class JavaStackTraceConsole extends TextConsole {
/**
* @see org.eclipse.ui.console.TextConsole#createPage(org.eclipse.ui.console.IConsoleView)
*/
- public IPageBookViewPage createPage(IConsoleView view) {
+ @Override
+ public IPageBookViewPage createPage(IConsoleView view) {
return new JavaStackTraceConsolePage(this, view);
}
@@ -175,6 +180,7 @@ public class JavaStackTraceConsole extends TextConsole {
*/
public void format() {
WorkbenchJob job = new WorkbenchJob(ConsoleMessages.JavaStackTraceConsole_1) {
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IJobManager jobManager = Job.getJobManager();
try {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsolePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsolePage.java
index a20e90803..795e2f4ad 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsolePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsolePage.java
@@ -27,6 +27,7 @@ public class JavaStackTraceConsolePage extends TextConsolePage {
super(console, view);
}
+ @Override
protected void createActions() {
super.createActions();
@@ -36,6 +37,7 @@ public class JavaStackTraceConsolePage extends TextConsolePage {
toolBarManager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, fAutoFormat);
}
+ @Override
protected TextConsoleViewer createViewer(Composite parent) {
return new JavaStackTraceConsoleViewer(parent, (JavaStackTraceConsole) getConsole());
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsoleViewer.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsoleViewer.java
index e64d87d7c..98f4ccc51 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsoleViewer.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceConsoleViewer.java
@@ -41,6 +41,7 @@ public class JavaStackTraceConsoleViewer extends TextConsoleViewer {
/**
* @see org.eclipse.jface.text.source.SourceViewer#doOperation(int)
*/
+ @Override
public void doOperation(int operation) {
super.doOperation(operation);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java
index 95ee5c619..07d5ab9a2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/console/JavaStackTraceHyperlink.java
@@ -94,6 +94,7 @@ public class JavaStackTraceHyperlink implements IHyperlink {
*/
protected void startSourceSearch(final String typeName, final int lineNumber) {
Job search = new Job(ConsoleMessages.JavaStackTraceHyperlink_2) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
ILaunch launch = getLaunch();
Object result = null;
@@ -118,6 +119,7 @@ public class JavaStackTraceHyperlink implements IHyperlink {
protected void searchCompleted(final Object source, final String typeName, final int lineNumber, final IStatus status) {
UIJob job = new UIJob("link search complete") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (source == null) {
if (status == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentFrameContext.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentFrameContext.java
index 9f729c4d1..beb91643f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentFrameContext.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentFrameContext.java
@@ -38,7 +38,8 @@ public class CurrentFrameContext extends TypeContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.contentassist.IJavaDebugContentAssistContext#getType()
*/
- public IType getType() throws CoreException {
+ @Override
+ public IType getType() throws CoreException {
IJavaStackFrame frame = getStackFrame();
if (frame != null) {
IType type = JavaDebugUtils.resolveDeclaringType(frame);
@@ -52,7 +53,8 @@ public class CurrentFrameContext extends TypeContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.contentassist.IJavaDebugContentAssistContext#getLocalVariables()
*/
- public String[][] getLocalVariables() throws CoreException {
+ @Override
+ public String[][] getLocalVariables() throws CoreException {
IJavaStackFrame frame = getStackFrame();
if (frame != null) {
IVariable[] variables = frame.getVariables();
@@ -75,7 +77,8 @@ public class CurrentFrameContext extends TypeContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.contentassist.IJavaDebugContentAssistContext#isStatic()
*/
- public boolean isStatic() throws CoreException {
+ @Override
+ public boolean isStatic() throws CoreException {
IJavaStackFrame frame = getStackFrame();
if (frame != null) {
return frame.isStatic();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentValueContext.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentValueContext.java
index 1ff44b5ba..de5ee9194 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentValueContext.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/CurrentValueContext.java
@@ -37,7 +37,8 @@ public class CurrentValueContext extends CurrentFrameContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.contentassist.IJavaDebugContentAssistContext#getType()
*/
- public IType getType() throws CoreException {
+ @Override
+ public IType getType() throws CoreException {
IJavaValue value = resolveValue();
if (value == null || value instanceof IJavaPrimitiveValue) {
// no object selected, use the frame
@@ -110,6 +111,7 @@ public class CurrentValueContext extends CurrentFrameContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.contentassist.IJavaDebugContentAssistContext#getLocalVariables()
*/
+ @Override
public String[][] getLocalVariables() throws CoreException {
IJavaValue value = resolveValue();
if (value instanceof IJavaArray) {
@@ -124,6 +126,7 @@ public class CurrentValueContext extends CurrentFrameContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.contentassist.IJavaDebugContentAssistContext#getSnippet(java.lang.String)
*/
+ @Override
public String getSnippet(String snippet) throws CoreException {
IJavaValue value = resolveValue();
if (value instanceof IJavaArray) {
@@ -135,6 +138,7 @@ public class CurrentValueContext extends CurrentFrameContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.contentassist.CurrentFrameContext#isStatic()
*/
+ @Override
public boolean isStatic() throws CoreException {
IJavaValue value = resolveValue();
if (value instanceof IJavaObject) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/DynamicTypeContext.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/DynamicTypeContext.java
index 4309f69b6..de95d73ac 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/DynamicTypeContext.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/DynamicTypeContext.java
@@ -51,6 +51,7 @@ public class DynamicTypeContext extends TypeContext {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.text.IJavaDebugCompletionProcessorContext#getType()
*/
+ @Override
public IType getType() throws CoreException {
IType type = fTypeProvider.getType();
if (type == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugCompletionProposalCollector.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugCompletionProposalCollector.java
index 72e56e16c..a7070e5ca 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugCompletionProposalCollector.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugCompletionProposalCollector.java
@@ -39,6 +39,7 @@ public class JavaDebugCompletionProposalCollector extends CompletionProposalColl
/* (non-Javadoc)
* @see org.eclipse.jdt.ui.text.java.CompletionProposalCollector#isFiltered(org.eclipse.jdt.core.CompletionProposal)
*/
+ @Override
protected boolean isFiltered(CompletionProposal proposal) {
if (proposal.getKind() == CompletionProposal.LOCAL_VARIABLE_REF) {
if (Arrays.equals(proposal.getName(), fgHiddenLocal)) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java
index 345c27bae..3d46b085d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java
@@ -28,6 +28,7 @@ public class DetailsViewerConfiguration extends TextSourceViewerConfiguration {
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
*/
+ @Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
assistant.setContentAssistProcessor(new JavaDebugContentAssistProcessor(new CurrentValueContext()),IDocument.DEFAULT_CONTENT_TYPE);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayView.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayView.java
index 48d486811..ba2a84450 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayView.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayView.java
@@ -163,6 +163,7 @@ public class DisplayView extends ViewPart implements ITextInputListener, IPerspe
/**
* @see ViewPart#createChild(IWorkbenchPartContainer)
*/
+ @Override
public void createPartControl(Composite parent) {
fSourceViewer= new JDISourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.LEFT_TO_RIGHT);
fSourceViewer.configure(new DisplayViewerConfiguration());
@@ -225,6 +226,7 @@ public class DisplayView extends ViewPart implements ITextInputListener, IPerspe
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
+ @Override
public void setFocus() {
if (fSourceViewer != null) {
fSourceViewer.getControl().setFocus();
@@ -375,6 +377,7 @@ public class DisplayView extends ViewPart implements ITextInputListener, IPerspe
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#getAdapter(Class)
*/
+ @Override
public Object getAdapter(Class required) {
if (ITextOperationTarget.class.equals(required)) {
@@ -410,6 +413,7 @@ public class DisplayView extends ViewPart implements ITextInputListener, IPerspe
*
* @see org.eclipse.ui.IViewPart#saveState(IMemento)
*/
+ @Override
public void saveState(IMemento memento) {
if (fSourceViewer != null) {
String contents= getContents();
@@ -426,6 +430,7 @@ public class DisplayView extends ViewPart implements ITextInputListener, IPerspe
*
* @see org.eclipse.ui.IViewPart#init(IViewSite, IMemento)
*/
+ @Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
init(site);
if (fgMemento != null) {
@@ -446,7 +451,8 @@ public class DisplayView extends ViewPart implements ITextInputListener, IPerspe
DragSource ds = new DragSource(fSourceViewer.getTextWidget(), DND.DROP_COPY | DND.DROP_MOVE);
ds.setTransfer(new Transfer[] {TextTransfer.getInstance()});
ds.addDragListener(new DragSourceAdapter() {
- public void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event) {
+ @Override
+ public void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event) {
event.data = fSourceViewer.getTextWidget().getSelectionText();
}
});
@@ -505,6 +511,7 @@ public class DisplayView extends ViewPart implements ITextInputListener, IPerspe
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
getSite().getWorkbenchWindow().removePerspectiveListener(this);
if (fSourceViewer != null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewAction.java
index 6146674a0..5c6d0b074 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewAction.java
@@ -46,6 +46,7 @@ public class DisplayViewAction extends Action implements IUpdate {
* <code>IAction</code> method runs the operation with the current
* operation code.
*/
+ @Override
public void run() {
if (fOperationCode != -1 && fOperationTarget != null)
fOperationTarget.doOperation(fOperationCode);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java
index cf186dbd9..8e8960b5a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java
@@ -58,6 +58,7 @@ public class DisplayViewerConfiguration extends JavaSourceViewerConfiguration {
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
*/
+ @Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
@@ -77,6 +78,7 @@ public class DisplayViewerConfiguration extends JavaSourceViewerConfiguration {
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
*/
+ @Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
ITextDoubleClickStrategy clickStrat = new ITextDoubleClickStrategy() {
// Highlight the whole line when double clicked. See Bug#45481
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java
index 523786e86..cb9bb597a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java
@@ -357,6 +357,7 @@ public class AllInstancesActionDelegate extends ObjectActionDelegate implements
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ObjectActionDelegate#getPart()
*/
+ @Override
protected IWorkbenchPart getPart() {
IWorkbenchPart part = super.getPart();
if (part != null){
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java
index df415d74e..1f94bcbac 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java
@@ -107,6 +107,7 @@ public class AllReferencesActionDelegate extends ObjectActionDelegate implements
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.actions.ObjectActionDelegate#getPart()
*/
+ @Override
protected IWorkbenchPart getPart() {
IWorkbenchPart part = super.getPart();
if (part != null){
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/InstanceCountActionDelegate.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/InstanceCountActionDelegate.java
index 02be5d1c0..dfc631e17 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/InstanceCountActionDelegate.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/InstanceCountActionDelegate.java
@@ -28,6 +28,7 @@ public class InstanceCountActionDelegate extends AllInstancesActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.heapwalking.AllInstancesActionDelegate#displayInstaces(org.eclipse.jdt.debug.core.IJavaDebugTarget, org.eclipse.jdt.internal.debug.core.model.JDIReferenceType)
*/
+ @Override
protected void displayInstaces(IJavaDebugTarget target, JDIReferenceType rtype) {
try {
displayNumInstances(rtype.getName(), rtype.getInstanceCount());
@@ -40,6 +41,7 @@ public class InstanceCountActionDelegate extends AllInstancesActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.heapwalking.AllInstancesActionDelegate#displayNoInstances(org.eclipse.jdt.debug.core.IJavaDebugTarget, java.lang.String)
*/
+ @Override
protected void displayNoInstances(IJavaDebugTarget target, String typeName) {
displayNumInstances(typeName, 0);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/AddVMInstallWizard.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/AddVMInstallWizard.java
index b911d9851..d0cddcad2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/AddVMInstallWizard.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/AddVMInstallWizard.java
@@ -38,6 +38,7 @@ public class AddVMInstallWizard extends VMInstallWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
+ @Override
public void addPages() {
fTypePage = new VMTypePage();
addPage(fTypePage);
@@ -46,6 +47,7 @@ public class AddVMInstallWizard extends VMInstallWizard {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.jres.VMInstallWizard#getResult()
*/
+ @Override
protected VMStandin getResult() {
return fResult;
}
@@ -53,6 +55,7 @@ public class AddVMInstallWizard extends VMInstallWizard {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.jres.VMInstallWizard#canFinish()
*/
+ @Override
public boolean canFinish() {
IWizardPage currentPage = getContainer().getCurrentPage();
return currentPage != fTypePage && super.canFinish() && currentPage.isPageComplete();
@@ -61,6 +64,7 @@ public class AddVMInstallWizard extends VMInstallWizard {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.jres.VMInstallWizard#performFinish()
*/
+ @Override
public boolean performFinish() {
IWizardPage currentPage = getContainer().getCurrentPage();
if (currentPage instanceof AbstractVMInstallPage) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/BuildJREDescriptor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/BuildJREDescriptor.java
index 1e7871c4a..94da07d10 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/BuildJREDescriptor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/BuildJREDescriptor.java
@@ -22,6 +22,7 @@ public class BuildJREDescriptor extends JREDescriptor {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.jres.JREDescriptor#getDescription()
*/
+ @Override
public String getDescription() {
return MessageFormat.format(JREMessages.BuildJREDescriptor_0, new String[]{JavaRuntime.getDefaultVMInstall().getName()});
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EEVMPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EEVMPage.java
index 15707733a..a6d49d86b 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EEVMPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EEVMPage.java
@@ -74,6 +74,7 @@ public class EEVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getImage()
*/
+ @Override
public Image getImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_WIZBAN_LIBRARY);
}
@@ -157,6 +158,7 @@ public class EEVMPage extends AbstractVMInstallPage {
}
});
variables.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
if (dialog.open() == Window.OK) {
@@ -256,6 +258,7 @@ public class EEVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#finish()
*/
+ @Override
public boolean finish() {
setFieldValuesToVM(fVM);
fLibraryBlock.finish();
@@ -265,6 +268,7 @@ public class EEVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#getSelection()
*/
+ @Override
public VMStandin getSelection() {
return fVM;
}
@@ -272,6 +276,7 @@ public class EEVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#setSelection(org.eclipse.jdt.launching.VMStandin)
*/
+ @Override
public void setSelection(VMStandin vm) {
super.setSelection(vm);
fVM = vm;
@@ -356,6 +361,7 @@ public class EEVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
String message = super.getErrorMessage();
if (message == null) {
@@ -367,6 +373,7 @@ public class EEVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
*/
+ @Override
public boolean isPageComplete() {
boolean complete = super.isPageComplete();
if (complete) {
@@ -378,6 +385,7 @@ public class EEVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#getVMStatus()
*/
+ @Override
protected IStatus[] getVMStatus() {
return fFieldStatus;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EditVMInstallWizard.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EditVMInstallWizard.java
index f9fc502fa..6388ebdc5 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EditVMInstallWizard.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/EditVMInstallWizard.java
@@ -35,6 +35,7 @@ public class EditVMInstallWizard extends VMInstallWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
+ @Override
public void addPages() {
fEditPage = getPage(getVMInstall().getVMInstallType());
fEditPage.setSelection(new VMStandin(getVMInstall()));
@@ -44,6 +45,7 @@ public class EditVMInstallWizard extends VMInstallWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
if (fEditPage.finish()) {
return super.performFinish();
@@ -54,6 +56,7 @@ public class EditVMInstallWizard extends VMInstallWizard {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.jres.VMInstallWizard#getResult()
*/
+ @Override
protected VMStandin getResult() {
return fEditPage.getSelection();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsLabelProvider.java
index 1b892efa7..61a3044db 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsLabelProvider.java
@@ -25,6 +25,7 @@ public class ExecutionEnvironmentsLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_LIBRARY);
}
@@ -32,6 +33,7 @@ public class ExecutionEnvironmentsLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
return ((IExecutionEnvironment)element).getId();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java
index dfb12d13f..7fe05ce57 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/ExecutionEnvironmentsPreferencePage.java
@@ -106,6 +106,7 @@ public class ExecutionEnvironmentsPreferencePage extends PreferencePage implemen
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite ancestor) {
initializeDialogUnits(ancestor);
noDefaultAndApplyButton();
@@ -225,6 +226,7 @@ public class ExecutionEnvironmentsPreferencePage extends PreferencePage implemen
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
IExecutionEnvironment[] environments = manager.getExecutionEnvironments();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java
index 0f0710e18..a5c9a0177 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java
@@ -252,6 +252,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
TableColumn column = new TableColumn(fTable, SWT.NULL);
column.setText(JREMessages.InstalledJREsBlock_0);
column.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
sortByName();
}
@@ -262,6 +263,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
column = new TableColumn(fTable, SWT.NULL);
column.setText(JREMessages.InstalledJREsBlock_1);
column.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
sortByLocation();
}
@@ -271,6 +273,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
column = new TableColumn(fTable, SWT.NULL);
column.setText(JREMessages.InstalledJREsBlock_2);
column.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
sortByType();
}
@@ -307,6 +310,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
}
});
fTable.addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
if (fRemoveButton.isEnabled()){
@@ -437,6 +441,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
*/
private void sortByType() {
fVMList.setComparator(new ViewerComparator() {
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
IVMInstall left= (IVMInstall)e1;
@@ -452,6 +457,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
return super.compare(viewer, e1, e2);
}
+ @Override
public boolean isSorterProperty(Object element, String property) {
return true;
}
@@ -464,6 +470,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
*/
private void sortByName() {
fVMList.setComparator(new ViewerComparator() {
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
IVMInstall left= (IVMInstall)e1;
@@ -473,6 +480,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
return super.compare(viewer, e1, e2);
}
+ @Override
public boolean isSorterProperty(Object element, String property) {
return true;
}
@@ -485,6 +493,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
*/
private void sortByLocation() {
fVMList.setComparator(new ViewerComparator() {
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
if ((e1 instanceof IVMInstall) && (e2 instanceof IVMInstall)) {
IVMInstall left= (IVMInstall)e1;
@@ -494,6 +503,7 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
return super.compare(viewer, e1, e2);
}
+ @Override
public boolean isSorterProperty(Object element, String property) {
return true;
}
@@ -715,7 +725,8 @@ public class InstalledJREsBlock implements IAddVMDialogRequestor, ISelectionProv
* More accurately reflects action taken when button pressed.
* Bug [162902]
*/
- protected void createCancelButton(Composite parent) {
+ @Override
+ protected void createCancelButton(Composite parent) {
cancel = createButton(parent, IDialogConstants.CANCEL_ID,
IDialogConstants.STOP_LABEL, true);
if (arrowCursor == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREContainerWizardPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREContainerWizardPage.java
index a139da8ad..f5807de48 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREContainerWizardPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREContainerWizardPage.java
@@ -121,6 +121,7 @@ public class JREContainerWizardPage extends WizardPage implements IClasspathCont
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getImage()
*/
+ @Override
public Image getImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_WIZBAN_LIBRARY);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsComboBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsComboBlock.java
index cbf4a82dd..9b21248c2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsComboBlock.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsComboBlock.java
@@ -190,6 +190,7 @@ public class JREsComboBlock {
private void createEEControls(Composite comp) {
fEnvironmentsButton = SWTFactory.createRadioButton(comp, JREMessages.JREsComboBlock_4);
fEnvironmentsButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (fEnvironmentsButton.getSelection()) {
fCombo.setEnabled(false);
@@ -209,6 +210,7 @@ public class JREsComboBlock {
fEnvironmentsCombo = SWTFactory.createCombo(comp, SWT.DROP_DOWN | SWT.READ_ONLY, 1, null);
fEnvironmentsCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setPath(JavaRuntime.newJREContainerPath(getEnvironment()));
firePropertyChange();
@@ -232,6 +234,7 @@ public class JREsComboBlock {
}
fSpecificButton = SWTFactory.createRadioButton(comp, text, 1);
fSpecificButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (fSpecificButton.getSelection()) {
fCombo.setEnabled(true);
@@ -251,6 +254,7 @@ public class JREsComboBlock {
fCombo = SWTFactory.createCombo(comp, SWT.DROP_DOWN | SWT.READ_ONLY, 1, null);
ControlAccessibleListener.addListener(fCombo, fSpecificButton.getText());
fCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setStatus(OK_STATUS);
firePropertyChange();
@@ -270,6 +274,7 @@ public class JREsComboBlock {
if (fDefaultDescriptor != null) {
fDefaultButton = SWTFactory.createRadioButton(comp, fDefaultDescriptor.getDescription(), 3);
fDefaultButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (fDefaultButton.getSelection()) {
setUseDefaultJRE();
@@ -342,6 +347,7 @@ public class JREsComboBlock {
return left.getName().compareToIgnoreCase(right.getName());
}
+ @Override
public boolean equals(Object obj) {
return obj == this;
}
@@ -464,6 +470,7 @@ public class JREsComboBlock {
return left.getId().compareToIgnoreCase(right.getId());
}
+ @Override
public boolean equals(Object obj) {
return obj == this;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentComparator.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentComparator.java
index bed2df95a..72c276dc3 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentComparator.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentComparator.java
@@ -27,6 +27,7 @@ public class JREsEnvironmentComparator extends ViewerComparator {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerSorter#category(java.lang.Object)
*/
+ @Override
public int category(Object element) {
if (fEnvironment == null) {
return super.category(element);
@@ -42,6 +43,7 @@ public class JREsEnvironmentComparator extends ViewerComparator {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
fEnvironment = (IExecutionEnvironment) viewer.getInput();
int result = super.compare(viewer, e1, e2);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentLabelProvider.java
index 58e25e478..55e400636 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentLabelProvider.java
@@ -51,6 +51,7 @@ public class JREsEnvironmentLabelProvider extends JREsLabelProvider implements I
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.LabelProvider#dispose()
*/
+ @Override
public void dispose() {
if (fFont != null) {
fFont.dispose();
@@ -63,6 +64,7 @@ public class JREsEnvironmentLabelProvider extends JREsLabelProvider implements I
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.jres.JREsLabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
String label = super.getText(element);
if (isStrictlyCompatible(element)) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsLabelProvider.java
index cadabfedd..00f0e3eac 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsLabelProvider.java
@@ -25,6 +25,7 @@ public class JREsLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_LIBRARY);
}
@@ -32,6 +33,7 @@ public class JREsLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
return ((IVMInstall)element).getName();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsPreferencePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsPreferencePage.java
index e4ef085b0..7f97616f5 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsPreferencePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/JREsPreferencePage.java
@@ -101,6 +101,7 @@ public class JREsPreferencePage extends PreferencePage implements IWorkbenchPref
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite ancestor) {
initializeDialogUnits(ancestor);
@@ -164,6 +165,7 @@ public class JREsPreferencePage extends PreferencePage implements IWorkbenchPref
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#isValid()
*/
+ @Override
public boolean isValid() {
String compliance = getCurrentCompilerCompliance();
if(!supportsCurrentCompliance(getCurrentDefaultVM(), compliance)) {
@@ -231,6 +233,7 @@ public class JREsPreferencePage extends PreferencePage implements IWorkbenchPref
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
final boolean[] canceled = new boolean[] {false};
BusyIndicator.showWhile(null, new Runnable() {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryLabelProvider.java
index bdfde8f80..9b4f0f497 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryLabelProvider.java
@@ -35,6 +35,7 @@ public class LibraryLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
String key = null;
IStatus status = Status.OK_STATUS;
@@ -70,6 +71,7 @@ public class LibraryLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof LibraryStandin) {
return ((LibraryStandin)element).getSystemLibraryPath().toOSString();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryStandin.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryStandin.java
index c1b6f9e11..4b6e043f1 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryStandin.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/LibraryStandin.java
@@ -91,6 +91,7 @@ public final class LibraryStandin {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof LibraryStandin) {
LibraryStandin lib = (LibraryStandin)obj;
@@ -105,6 +106,7 @@ public final class LibraryStandin {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getSystemLibraryPath().hashCode();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMCommandTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMCommandTab.java
index fc7aa224c..e4282b414 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMCommandTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMCommandTab.java
@@ -73,6 +73,7 @@ public class StandardVMCommandTab extends AbstractLaunchConfigurationTab {
fDefaultButton.setText(MessageFormat.format(JREMessages.AbstractJavaCommandTab_2, new String[]{getDefaultCommand()}));
fDefaultButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
handleSelection();
}
@@ -85,6 +86,7 @@ public class StandardVMCommandTab extends AbstractLaunchConfigurationTab {
fSpecificButton.setText(JREMessages.AbstractJavaCommandTab_4);
fSpecificButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
handleSelection();
}
@@ -172,6 +174,7 @@ public class StandardVMCommandTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getTabId()
*/
+ @Override
public String getId() {
return "org.eclipse.jdt.debug.ui.standardVMCommandTab"; //$NON-NLS-1$
}
@@ -179,6 +182,7 @@ public class StandardVMCommandTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
boolean valid= fDefaultButton.getSelection() || fJavaCommandText.getText().length() != 0;
if (valid) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMPage.java
index e1d3dd54f..3d19f3ed0 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/StandardVMPage.java
@@ -77,6 +77,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getImage()
*/
+ @Override
public Image getImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_WIZBAN_LIBRARY);
}
@@ -147,6 +148,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
}
});
variables.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
if (dialog.open() == Window.OK) {
@@ -273,6 +275,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#finish()
*/
+ @Override
public boolean finish() {
setFieldValuesToVM(fVM);
fLibraryBlock.finish();
@@ -282,6 +285,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#getSelection()
*/
+ @Override
public VMStandin getSelection() {
return fVM;
}
@@ -289,6 +293,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#setSelection(org.eclipse.jdt.launching.VMStandin)
*/
+ @Override
public void setSelection(VMStandin vm) {
super.setSelection(vm);
fVM = vm;
@@ -368,6 +373,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
String message = super.getErrorMessage();
if (message == null) {
@@ -379,6 +385,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
*/
+ @Override
public boolean isPageComplete() {
boolean complete = super.isPageComplete();
if (complete) {
@@ -390,6 +397,7 @@ public class StandardVMPage extends AbstractVMInstallPage {
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#getVMStatus()
*/
+ @Override
protected IStatus[] getVMStatus() {
return fFieldStatus;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMDetailsDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMDetailsDialog.java
index b36b2d8cf..e3237b006 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMDetailsDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMDetailsDialog.java
@@ -49,12 +49,14 @@ public class VMDetailsDialog extends Dialog {
/**
* @see Windows#configureShell
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(JREMessages.VMDetailsDialog_0);
PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaDebugHelpContextIds.JRE_DETAILS_DIALOG);
}
+ @Override
protected Control createDialogArea(Composite ancestor) {
Composite parent = (Composite)super.createDialogArea(ancestor);
GridLayout layout = new GridLayout(2, false);
@@ -134,7 +136,8 @@ public class VMDetailsDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
@@ -146,6 +149,7 @@ public class VMDetailsDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
// create OK and Cancel buttons by default
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMInstallWizard.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMInstallWizard.java
index 34c25c871..f1f55c26d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMInstallWizard.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMInstallWizard.java
@@ -71,6 +71,7 @@ public abstract class VMInstallWizard extends Wizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
return getResult() != null;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMLibraryBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMLibraryBlock.java
index 2a3767fa6..c66636000 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMLibraryBlock.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMLibraryBlock.java
@@ -398,6 +398,7 @@ public class VMLibraryBlock extends AbstractVMInstallPage implements SelectionLi
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#finish()
*/
+ @Override
public boolean finish() {
if (fVmInstall != null) {
if (isDefaultLocations(fVmInstall)) {
@@ -413,6 +414,7 @@ public class VMLibraryBlock extends AbstractVMInstallPage implements SelectionLi
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#getSelection()
*/
+ @Override
public VMStandin getSelection() {
return fVmInstall;
}
@@ -420,6 +422,7 @@ public class VMLibraryBlock extends AbstractVMInstallPage implements SelectionLi
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#setSelection(org.eclipse.jdt.launching.VMStandin)
*/
+ @Override
public void setSelection(VMStandin vm) {
super.setSelection(vm);
LibraryLocation[] libraryLocations = null;
@@ -435,6 +438,7 @@ public class VMLibraryBlock extends AbstractVMInstallPage implements SelectionLi
/* (non-Javadoc)
* @see org.eclipse.jdt.debug.ui.launchConfigurations.AbstractVMInstallPage#getVMStatus()
*/
+ @Override
protected IStatus[] getVMStatus() {
return fLibStatus;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMTypePage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMTypePage.java
index ef608986c..9fee536cb 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMTypePage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/VMTypePage.java
@@ -63,6 +63,7 @@ public class VMTypePage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof IVMInstallType) {
IVMInstallType type = (IVMInstallType) element;
@@ -86,6 +87,7 @@ public class VMTypePage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
Iterator iterator = fPages.iterator();
@@ -140,6 +142,7 @@ public class VMTypePage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getImage()
*/
+ @Override
public Image getImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_WIZBAN_LIBRARY);
}
@@ -147,6 +150,7 @@ public class VMTypePage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#getNextPage()
*/
+ @Override
public IWizardPage getNextPage() {
return fNextPage;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AbstractJavaMainTab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AbstractJavaMainTab.java
index b4c9649c6..d84711f92 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AbstractJavaMainTab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AbstractJavaMainTab.java
@@ -171,6 +171,7 @@ private class WidgetListener implements ModifyListener, SelectionListener {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration config) {
updateProjectFromConfig(config);
super.initializeFrom(config);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletSelectionDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletSelectionDialog.java
index ed24f2b59..8d53ec66e 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletSelectionDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletSelectionDialog.java
@@ -48,10 +48,12 @@ public class AppletSelectionDialog extends TwoPaneElementSelector {
super(JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_POST_QUALIFIED | JavaElementLabelProvider.SHOW_ROOT);
}
+ @Override
public Image getImage(Object element) {
return super.getImage(((IType) element).getPackageFragment());
}
+ @Override
public String getText(Object element) {
return super.getText(((IType) element).getPackageFragment());
}
@@ -69,6 +71,7 @@ public class AppletSelectionDialog extends TwoPaneElementSelector {
/**
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
}
@@ -76,6 +79,7 @@ public class AppletSelectionDialog extends TwoPaneElementSelector {
/**
* @see org.eclipse.jface.window.Window#open()
*/
+ @Override
public int open() {
IType[] types = getAppletTypes();
if (types == null) {
@@ -139,6 +143,7 @@ public class AppletSelectionDialog extends TwoPaneElementSelector {
/**
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createDialogArea(Composite parent) {
Control control = super.createDialogArea(parent);
applyDialogFont(control);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletWorkingDirectoryBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletWorkingDirectoryBlock.java
index 2eeecb39c..9500a9909 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletWorkingDirectoryBlock.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletWorkingDirectoryBlock.java
@@ -20,6 +20,7 @@ public class AppletWorkingDirectoryBlock extends JavaWorkingDirectoryBlock {
/**
* @see org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock#setDefaultWorkingDir()
*/
+ @Override
protected void setDefaultWorkingDir() {
String outputDir = JavaRuntime.getProjectOutputDirectory(getLaunchConfiguration());
if (outputDir != null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/ArchiveFileFilter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/ArchiveFileFilter.java
index 233ed7df9..c4d1e9f17 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/ArchiveFileFilter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/ArchiveFileFilter.java
@@ -48,6 +48,7 @@ public class ArchiveFileFilter extends ViewerFilter {
/*
* @see ViewerFilter#select
*/
+ @Override
public boolean select(Viewer viewer, Object parent, Object element) {
if (element instanceof IFile) {
if (fExcludes != null && fExcludes.contains(element)) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/DebugTypeSelectionDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/DebugTypeSelectionDialog.java
index 56d67bbbc..2297bcd35 100755..100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/DebugTypeSelectionDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/DebugTypeSelectionDialog.java
@@ -128,6 +128,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
* Provides a label and image for the details area of the dialog
*/
class DebugTypeDetailsLabelProvider extends DebugTypeLabelProvider {
+ @Override
public String getText(Object element) {
if(element instanceof IType) {
IType type = (IType) element;
@@ -149,6 +150,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
}
return null;
}
+ @Override
public Image getImage(Object element) {
if(element instanceof IType) {
return super.getImage(getDeclaringContainer(((IType) element)));
@@ -161,9 +163,11 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
* Simple items filter
*/
class DebugTypeItemsFilter extends ItemsFilter {
+ @Override
public boolean isConsistentItem(Object item) {
return item instanceof IType;
}
+ @Override
public boolean matchItem(Object item) {
if(!(item instanceof IType) || !Arrays.asList(fTypes).contains(item)) {
return false;
@@ -176,10 +180,12 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
* The selection history for the dialog
*/
class DebugTypeSelectionHistory extends SelectionHistory {
+ @Override
protected Object restoreItemFromMemento(IMemento memento) {
IJavaElement element = JavaCore.create(memento.getTextData());
return (element instanceof IType ? element : null);
}
+ @Override
protected void storeItemToMemento(Object item, IMemento memento) {
if(item instanceof IType) {
memento.putTextData(((IType) item).getHandleIdentifier());
@@ -208,6 +214,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Control ctrl = super.createDialogArea(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(ctrl, IJavaDebugHelpContextIds.SELECT_MAIN_METHOD_DIALOG);
@@ -217,6 +224,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getDialogSettings()
*/
+ @Override
protected IDialogSettings getDialogSettings() {
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(SETTINGS_ID);
@@ -229,6 +237,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getItemsComparator()
*/
+ @Override
protected Comparator getItemsComparator() {
Comparator comp = new Comparator() {
public int compare(Object o1, Object o2) {
@@ -244,6 +253,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#validateItem(java.lang.Object)
*/
+ @Override
protected IStatus validateItem(Object item) {
return Status.OK_STATUS;
}
@@ -251,6 +261,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createExtendedContentArea(Composite parent) {
return null;
}
@@ -258,6 +269,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createFilter()
*/
+ @Override
protected ItemsFilter createFilter() {
return new DebugTypeItemsFilter();
}
@@ -265,6 +277,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException {
if(fTypes != null && fTypes.length > 0) {
for(int i = 0; i < fTypes.length; i++) {
@@ -278,6 +291,7 @@ public class DebugTypeSelectionDialog extends FilteredItemsSelectionDialog {
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getElementName(java.lang.Object)
*/
+ @Override
public String getElementName(Object item) {
if(item instanceof IType) {
return ((IType)item).getElementName();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/JavaWorkingDirectoryBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/JavaWorkingDirectoryBlock.java
index 46f70f57a..fb7de9658 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/JavaWorkingDirectoryBlock.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/JavaWorkingDirectoryBlock.java
@@ -41,6 +41,7 @@ public class JavaWorkingDirectoryBlock extends WorkingDirectoryBlock {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.WorkingDirectoryBlock#getProject(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
protected IProject getProject(ILaunchConfiguration configuration)
throws CoreException {
IJavaProject project = JavaRuntime.getJavaProject(configuration);
@@ -50,6 +51,7 @@ public class JavaWorkingDirectoryBlock extends WorkingDirectoryBlock {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.WorkingDirectoryBlock#log(org.eclipse.core.runtime.CoreException)
*/
+ @Override
protected void log(CoreException e) {
setErrorMessage(e.getMessage());
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/MainMethodSearchEngine.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/MainMethodSearchEngine.java
index 9fef23000..96a76e415 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/MainMethodSearchEngine.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/MainMethodSearchEngine.java
@@ -52,6 +52,7 @@ public class MainMethodSearchEngine{
/* (non-Javadoc)
* @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
*/
+ @Override
public void acceptSearchMatch(SearchMatch match) throws CoreException {
Object enclosingElement = match.getElement();
if (enclosingElement instanceof IMethod) { // defensive code
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/NameValuePairDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/NameValuePairDialog.java
index 1dd7521fa..469a0ce1c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/NameValuePairDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/NameValuePairDialog.java
@@ -50,6 +50,7 @@ public class NameValuePairDialog extends Dialog {
/**
* @see Dialog#createDialogArea(Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Font font = parent.getFont();
@@ -101,6 +102,7 @@ public class NameValuePairDialog extends Dialog {
/**
* @see Dialog#buttonPressed(int)
*/
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
fName= fNameText.getText().trim();
@@ -115,6 +117,7 @@ public class NameValuePairDialog extends Dialog {
/**
* @see Window#configureShell(Shell)
*/
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
if (fTitle != null) {
@@ -134,6 +137,7 @@ public class NameValuePairDialog extends Dialog {
/**
* Enable the buttons on creation.
*/
+ @Override
public void create() {
super.create();
updateButtons();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/OpenPreferencePageResolution.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/OpenPreferencePageResolution.java
index 56e950eee..b2b129279 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/OpenPreferencePageResolution.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/OpenPreferencePageResolution.java
@@ -73,6 +73,7 @@ public class OpenPreferencePageResolution implements IMarkerResolution2 {
*/
public void run(IMarker marker) {
UIJob job = new UIJob(""){ //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
SWTFactory.showPreferencePage(
OpenPreferencePageResolution.this.pageid,
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathAdvancedDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathAdvancedDialog.java
index 8001a70b1..fce70c6a3 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathAdvancedDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathAdvancedDialog.java
@@ -62,6 +62,7 @@ public class RuntimeClasspathAdvancedDialog extends Dialog {
/**
* @see Dialog#createDialogArea(Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite inner= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
@@ -113,6 +114,7 @@ public class RuntimeClasspathAdvancedDialog extends Dialog {
fVariablesButton.setLayoutData(gd);
fVariablesButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
@@ -124,6 +126,7 @@ public class RuntimeClasspathAdvancedDialog extends Dialog {
});
fAddVariableStringButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
boolean enabled = fAddVariableStringButton.getSelection();
fVariableString.setEnabled(enabled);
@@ -139,6 +142,7 @@ public class RuntimeClasspathAdvancedDialog extends Dialog {
/**
* @see Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
if (fAddVariableStringButton.getSelection()) {
String varString = fVariableString.getText().trim();
@@ -168,7 +172,8 @@ public class RuntimeClasspathAdvancedDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathEntryLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathEntryLabelProvider.java
index 4696989af..091549df9 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathEntryLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathEntryLabelProvider.java
@@ -58,6 +58,7 @@ public class RuntimeClasspathEntryLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry)element;
IResource resource = entry.getResource();
@@ -124,6 +125,7 @@ public class RuntimeClasspathEntryLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry)element;
switch (entry.getType()) {
@@ -229,6 +231,7 @@ public class RuntimeClasspathEntryLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
lp.dispose();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathViewer.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathViewer.java
index fa3acc5f3..59b991004 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathViewer.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/RuntimeClasspathViewer.java
@@ -84,6 +84,7 @@ public class RuntimeClasspathViewer extends TableViewer implements IClasspathVie
setInput(fEntries);
getTable().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
if (isEnabled() && event.character == SWT.DEL && event.stateMask == 0) {
List selection= getSelectionFromWidget();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementLabelProvider.java
index 870252f48..b6df9e186 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementLabelProvider.java
@@ -31,6 +31,7 @@ public class SourceElementLabelProvider extends LabelProvider implements ILabelP
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof IJavaElement) {
return ((IJavaElement)element).getElementName();
@@ -47,6 +48,7 @@ public class SourceElementLabelProvider extends LabelProvider implements ILabelP
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
if (element instanceof ICompilationUnit) {
return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_CUNIT);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementQualifierProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementQualifierProvider.java
index 4f2dcb168..137696436 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementQualifierProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceElementQualifierProvider.java
@@ -40,6 +40,7 @@ public class SourceElementQualifierProvider extends LabelProvider implements ILa
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof IJavaElement) {
IJavaElement parent = ((IJavaElement)element).getParent();
@@ -67,6 +68,7 @@ public class SourceElementQualifierProvider extends LabelProvider implements ILa
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
if (element instanceof IJavaElement) {
IJavaElement parent = ((IJavaElement)element).getParent();
@@ -90,6 +92,7 @@ public class SourceElementQualifierProvider extends LabelProvider implements ILa
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
fJavaLabels.dispose();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceLookupBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceLookupBlock.java
index 625ff9bd2..31537bf75 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceLookupBlock.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/SourceLookupBlock.java
@@ -110,6 +110,7 @@ public class SourceLookupBlock extends AbstractJavaClasspathTab implements ILaun
fDefaultButton.setLayoutData(gd);
fDefaultButton.setFont(font);
fDefaultButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
handleDefaultButtonSelected();
}
@@ -122,6 +123,7 @@ public class SourceLookupBlock extends AbstractJavaClasspathTab implements ILaun
fDuplicatesButton.setLayoutData(gd);
fDuplicatesButton.setFont(font);
fDuplicatesButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
setDirty(true);
updateLaunchConfigurationDialog();
@@ -236,6 +238,7 @@ public class SourceLookupBlock extends AbstractJavaClasspathTab implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration config) {
boolean useDefault = true;
setErrorMessage(null);
@@ -348,6 +351,7 @@ public class SourceLookupBlock extends AbstractJavaClasspathTab implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
*/
+ @Override
protected void updateLaunchConfigurationDialog() {
if (getLaunchConfigurationDialog() != null) {
super.updateLaunchConfigurationDialog();
@@ -357,6 +361,7 @@ public class SourceLookupBlock extends AbstractJavaClasspathTab implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
fPathViewer.removeEntriesChangedListener(this);
super.dispose();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java
index 1a5c7241b..dc513b4db 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java
@@ -97,6 +97,7 @@ public class VMArgumentsBlock extends JavaLaunchTab {
fPgrmArgVariableButton.setFont(font);
fPgrmArgVariableButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
fPgrmArgVariableButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
@@ -118,6 +119,7 @@ public class VMArgumentsBlock extends JavaLaunchTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
fVMArgumentsText.setText(configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "")); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ContendedMonitorContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ContendedMonitorContentProvider.java
index 327d32d72..ec5316e67 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ContendedMonitorContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ContendedMonitorContentProvider.java
@@ -24,6 +24,7 @@ public class ContendedMonitorContentProvider extends JavaElementContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (((JavaContendedMonitor)element).getOwningThread() != null) {
return 1;
@@ -34,6 +35,7 @@ public class ContendedMonitorContentProvider extends JavaElementContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
JavaOwningThread owningThread= ((JavaContendedMonitor)parent).getOwningThread();
if (owningThread == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaContendedMonitor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaContendedMonitor.java
index deac98286..776536c6c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaContendedMonitor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaContendedMonitor.java
@@ -109,6 +109,7 @@ public class JavaContendedMonitor extends PlatformObject implements IDebugElemen
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if(adapter == IDebugTarget.class) {
return getDebugTarget();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaElementContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaElementContentProvider.java
index 27584b667..2441e3f6a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaElementContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaElementContentProvider.java
@@ -56,6 +56,7 @@ public abstract class JavaElementContentProvider extends ElementContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwnedMonitor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwnedMonitor.java
index eac211435..5b7f4c688 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwnedMonitor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwnedMonitor.java
@@ -124,6 +124,7 @@ public class JavaOwnedMonitor extends PlatformObject implements IDebugElement, I
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if(adapter == IDebugTarget.class) {
return getDebugTarget();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwningThread.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwningThread.java
index 172c27fcc..6023e8c66 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwningThread.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaOwningThread.java
@@ -110,6 +110,7 @@ public class JavaOwningThread extends PlatformObject implements IDebugElement, I
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if(adapter == IDebugTarget.class) {
return getDebugTarget();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java
index 7ed966c2c..f41a944a2 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java
@@ -35,6 +35,7 @@ public class JavaThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
IJavaThread thread = (IJavaThread)element;
if (!thread.isSuspended()) {
@@ -58,6 +59,7 @@ public class JavaThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
IJavaThread thread = (IJavaThread)parent;
if (!thread.isSuspended()) {
@@ -116,6 +118,7 @@ public class JavaThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (element instanceof JDIThread) {
JDIThread jThread = (JDIThread) element;
@@ -132,6 +135,7 @@ public class JavaThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getRule(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate[])
*/
+ @Override
protected ISchedulingRule getRule(IChildrenCountUpdate[] updates) {
return getThreadRule(updates);
}
@@ -139,6 +143,7 @@ public class JavaThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getRule(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate[])
*/
+ @Override
protected ISchedulingRule getRule(IChildrenUpdate[] updates) {
return getThreadRule(updates);
}
@@ -146,6 +151,7 @@ public class JavaThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getRule(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
*/
+ @Override
protected ISchedulingRule getRule(IHasChildrenUpdate[] updates) {
return getThreadRule(updates);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwnedMonitorContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwnedMonitorContentProvider.java
index 0380d139e..56a8d9c5c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwnedMonitorContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwnedMonitorContentProvider.java
@@ -24,6 +24,7 @@ public class OwnedMonitorContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((JavaOwnedMonitor) element).getWaitingThreads().length;
}
@@ -31,6 +32,7 @@ public class OwnedMonitorContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(((JavaOwnedMonitor) parent).getWaitingThreads(), index, length);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwningThreadContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwningThreadContentProvider.java
index ef52dd0fb..9fa3bfb1e 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwningThreadContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/OwningThreadContentProvider.java
@@ -24,6 +24,7 @@ public class OwningThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (((JavaOwningThread)element).getContendedMonitor() != null) {
return 1;
@@ -34,6 +35,7 @@ public class OwningThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
JavaContendedMonitor contendedMonitor= ((JavaOwningThread)parent).getContendedMonitor();
if (contendedMonitor == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ThreadMonitorManager.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ThreadMonitorManager.java
index 7afdcc103..46f05a0fd 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ThreadMonitorManager.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/ThreadMonitorManager.java
@@ -222,6 +222,7 @@ public class ThreadMonitorManager implements IDebugEventSetListener, IPropertyCh
* look for deadlocks.
*/
class RefreshAndDetectDeadlock extends DetectDeadlock {
+ @Override
public void run() {
JavaMonitorThread[] threads= getJavaMonitorThreads();
for (int i = 0; i < threads.length; i++) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/WaitingThreadContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/WaitingThreadContentProvider.java
index a1c10f1d0..00e5f7ba5 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/WaitingThreadContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/WaitingThreadContentProvider.java
@@ -24,6 +24,7 @@ public class WaitingThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((JavaWaitingThread) element).getOwnedMonitors().length;
}
@@ -31,6 +32,7 @@ public class WaitingThreadContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(((JavaWaitingThread) parent).getOwnedMonitors(), index, length);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/ExceptionFilterEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/ExceptionFilterEditor.java
index 3c9079cb2..26fae63e6 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/ExceptionFilterEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/ExceptionFilterEditor.java
@@ -87,6 +87,7 @@ public class ExceptionFilterEditor {
private FilterContentProvider fFilterContentProvider;
private SelectionListener fSelectionListener= new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Object source = e.getSource();
if (source == fAddTypeButton) {
@@ -161,6 +162,7 @@ public class ExceptionFilterEditor {
}
});
fFilterViewer.getTable().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
removeFilters();
@@ -291,6 +293,7 @@ public class ExceptionFilterEditor {
private void setEditorListeners(Text text) {
// CR means commit the changes, ESC means abort and don't commit
text.addKeyListener(new KeyAdapter() {
+ @Override
public void keyReleased(KeyEvent event) {
if (event.character == SWT.CR) {
if (fInvalidEditorText != null) {
@@ -307,6 +310,7 @@ public class ExceptionFilterEditor {
});
// Consider loss of focus on the editor to mean the same as CR
text.addFocusListener(new FocusAdapter() {
+ @Override
public void focusLost(FocusEvent event) {
if (fInvalidEditorText != null) {
fEditorText.setText(fInvalidEditorText);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointAdvancedPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointAdvancedPage.java
index 0028223e4..d4eaf75eb 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointAdvancedPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointAdvancedPage.java
@@ -34,6 +34,7 @@ public class JavaBreakpointAdvancedPage extends PropertyPage {
/**
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
doStore();
return super.performOk();
@@ -52,6 +53,7 @@ public class JavaBreakpointAdvancedPage extends PropertyPage {
/**
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
Composite mainComposite = new Composite(parent, SWT.NONE);
@@ -96,6 +98,7 @@ public class JavaBreakpointAdvancedPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_BREAKPOINT_ADVANCED_PROPERTY_PAGE);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointPage.java
index 20d04b76a..3b2b38087 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaBreakpointPage.java
@@ -86,6 +86,7 @@ public class JavaBreakpointPage extends PropertyPage {
* Store the breakpoint properties.
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
@@ -169,6 +170,7 @@ public class JavaBreakpointPage extends PropertyPage {
* Creates the labels and editors displayed for the breakpoint.
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
Composite mainComposite = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL, 0, 0);
@@ -394,6 +396,7 @@ public class JavaBreakpointPage extends PropertyPage {
* Check to see if the breakpoint should be deleted.
* @return <code>true</code> if the page was canceled, <code>false</code> othewise
*/
+ @Override
public boolean performCancel() {
try {
if (getBreakpoint().getMarker().getAttribute(ATTR_DELETE_ON_CANCEL) != null) {
@@ -409,6 +412,7 @@ public class JavaBreakpointPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_BREAKPOINT_PROPERTY_PAGE);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaExceptionBreakpointAdvancedPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaExceptionBreakpointAdvancedPage.java
index bd0ebff55..bf11c4e8f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaExceptionBreakpointAdvancedPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/JavaExceptionBreakpointAdvancedPage.java
@@ -24,6 +24,7 @@ public class JavaExceptionBreakpointAdvancedPage extends JavaBreakpointAdvancedP
/**
* @see org.eclipse.jdt.internal.debug.ui.propertypages.JavaBreakpointAdvancedPage#doStore()
*/
+ @Override
protected void doStore() {
super.doStore();
fFilterEditor.doStore();
@@ -32,6 +33,7 @@ public class JavaExceptionBreakpointAdvancedPage extends JavaBreakpointAdvancedP
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.debug.ui.propertypages.JavaBreakpointAdvancedPage#createTypeSpecificEditors(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createTypeSpecificEditors(Composite parent) {
fFilterEditor= new ExceptionFilterEditor(parent, this);
}
@@ -39,6 +41,7 @@ public class JavaExceptionBreakpointAdvancedPage extends JavaBreakpointAdvancedP
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.JAVA_EXCEPTION_BREAKPOINT_FILTERING_PROPERTY_PAGE);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/VMCapabilitiesPropertyPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/VMCapabilitiesPropertyPage.java
index 4fd464831..5d6f1a383 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/VMCapabilitiesPropertyPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/VMCapabilitiesPropertyPage.java
@@ -76,6 +76,7 @@ public class VMCapabilitiesPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
final ScrollPain scomp = new ScrollPain(parent);
@@ -159,6 +160,7 @@ public class VMCapabilitiesPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.VMCAPABILITIES_PROPERTY_PAGE);
@@ -211,6 +213,7 @@ public class VMCapabilitiesPropertyPage extends PropertyPage {
private ExpandableComposite createExpandibleComposite(Composite parent, int style, String label, int hspan, int fill) {
ExpandableComposite ex = SWTFactory.createExpandibleComposite(parent, style, label, hspan, fill);
ex.addExpansionListener(new ExpansionAdapter() {
+ @Override
public void expansionStateChanged(ExpansionEvent e) {
ScrollPain sp = getParentScrollPane((ExpandableComposite) e.getSource());
if(sp != null) {
@@ -224,6 +227,7 @@ public class VMCapabilitiesPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
*/
+ @Override
protected IPreferenceStore doGetPreferenceStore() {
return JDIDebugUIPlugin.getDefault().getPreferenceStore();
}
@@ -260,6 +264,7 @@ public class VMCapabilitiesPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
boolean ok = super.performOk();
persistExpansionState();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetEditor.java
index fa7504b16..fd6e634d8 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetEditor.java
@@ -196,6 +196,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
fDisplay = display;
fLock= lock;
}
+ @Override
public void run() {
try {
synchronized (fLock) {
@@ -286,6 +287,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#doSetInput(org.eclipse.ui.IEditorInput)
*/
+ @Override
protected void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
IFile file= getFile();
@@ -297,6 +299,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
}
}
+ @Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
site.getWorkbenchWindow().getPartService().addPartListener(fActivationListener);
@@ -305,6 +308,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
shutDownVM();
fPresentation.dispose();
@@ -321,6 +325,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
* Actions for the editor popup menu
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
*/
+ @Override
protected void createActions() {
super.createActions();
if (getFile() != null) {
@@ -336,6 +341,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
*/
+ @Override
protected void editorContextMenuAboutToShow(IMenuManager menu) {
super.editorContextMenuAboutToShow(menu);
addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_GENERATE);
@@ -1111,6 +1117,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#affectsTextPresentation(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
protected boolean affectsTextPresentation(PropertyChangeEvent event) {
JavaSourceViewerConfiguration sourceViewerConfiguration = (JavaSourceViewerConfiguration) getSourceViewerConfiguration();
return sourceViewerConfiguration.affectsTextPresentation(event);
@@ -1119,6 +1126,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
JDISourceViewer isv= (JDISourceViewer) getSourceViewer();
if (isv != null) {
@@ -1179,6 +1187,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#updateSelectionDependentActions()
*/
+ @Override
protected void updateSelectionDependentActions() {
super.updateSelectionDependentActions();
fireEvalStateChanged();
@@ -1187,6 +1196,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/**
* Terminates existing VM on a rename of the editor
*/
+ @Override
protected void setPartName(String title) {
cleanupOnRenameOrMove();
super.setPartName(title);
@@ -1248,6 +1258,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
* of a file resource and saves the document there.
* @see org.eclipse.ui.texteditor.AbstractTextEditor#performSaveAs(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected void performSaveAs(IProgressMonitor progressMonitor) {
Shell shell= getSite().getShell();
SaveAsDialog dialog= new SaveAsDialog(shell);
@@ -1265,6 +1276,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
final IEditorInput newInput= new FileEditorInput(file);
WorkspaceModifyOperation op= new WorkspaceModifyOperation() {
+ @Override
public void execute(final IProgressMonitor monitor) throws CoreException {
IDocumentProvider dp= getDocumentProvider();
dp.saveDocument(monitor, newInput, dp.getDocument(getEditorInput()), true);
@@ -1297,6 +1309,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
*/
+ @Override
public boolean isSaveAsAllowed() {
return true;
}
@@ -1318,6 +1331,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
*/
+ @Override
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
fAnnotationAccess= getAnnotationAccess();
fOverviewRuler= createOverviewRuler(getSharedColors());
@@ -1401,6 +1415,7 @@ public class JavaSnippetEditor extends AbstractDecoratedTextEditor implements ID
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class required) {
if (required == IShowInTargetList.class) {
return new IShowInTargetList() {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java
index 6586f4985..d18346e37 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java
@@ -42,6 +42,7 @@ public class JavaSnippetViewerConfiguration extends JavaSourceViewerConfiguratio
/**
* @see SourceViewerConfiguration#getContentAssistant(ISourceViewer)
*/
+ @Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
@@ -61,6 +62,7 @@ public class JavaSnippetViewerConfiguration extends JavaSourceViewerConfiguratio
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer)
*/
+ @Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
return null;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileCreationWizard.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileCreationWizard.java
index 20b3f56dc..509f6bb20 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileCreationWizard.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileCreationWizard.java
@@ -38,6 +38,7 @@ public class NewSnippetFileCreationWizard extends Wizard implements INewWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
+ @Override
public void addPages() {
super.addPages();
if (fSelection == null) {
@@ -55,6 +56,7 @@ public class NewSnippetFileCreationWizard extends Wizard implements INewWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#performFinish()
*/
+ @Override
public boolean performFinish() {
return fPage.finish();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileWizardPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileWizardPage.java
index 33e9c12b5..da1af9367 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileWizardPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/NewSnippetFileWizardPage.java
@@ -84,6 +84,7 @@ public class NewSnippetFileWizardPage extends WizardNewFileCreationPage {
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#validatePage()
*/
+ @Override
protected boolean validatePage() {
// check whether file with extension doesn't exist
boolean valid= super.validatePage();
@@ -120,6 +121,7 @@ public class NewSnippetFileWizardPage extends WizardNewFileCreationPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.NEW_SNIPPET_WIZARD_PAGE);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ScrapbookSourcepathProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ScrapbookSourcepathProvider.java
index 0ae8e2165..9bf36d653 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ScrapbookSourcepathProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ScrapbookSourcepathProvider.java
@@ -23,6 +23,7 @@ import org.eclipse.jdt.launching.StandardSourcePathProvider;
*/
public class ScrapbookSourcepathProvider extends StandardSourcePathProvider {
+ @Override
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_SOURCE_PATH, true);
IRuntimeClasspathEntry[] entries = null;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsAction.java
index c148f6e7a..f1b51390a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsAction.java
@@ -31,6 +31,7 @@ public class SelectImportsAction extends SnippetAction {
/**
* @see IAction#run()
*/
+ @Override
public void run() {
if (!getEditor().isInJavaProject()) {
getEditor().reportNotInJavaProjectError();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsDialog.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsDialog.java
index fb496a503..c8ad448de 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsDialog.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsDialog.java
@@ -265,6 +265,7 @@ public class SelectImportsDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Font font = parent.getFont();
@@ -324,6 +325,7 @@ public class SelectImportsDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
String[] imports= null;
Object[] results= fImportContentProvider.getElements(null);
@@ -343,6 +345,7 @@ public class SelectImportsDialog extends TitleAreaDialog {
*
* @see org.eclipse.jface.window.Window#configureShell(Shell);
*/
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(SnippetMessages.getString("SelectImportsDialog.Java_Snippet_Imports_18")); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ShowInPackageViewAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ShowInPackageViewAction.java
index 71c38b60b..4a008e065 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ShowInPackageViewAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/ShowInPackageViewAction.java
@@ -56,6 +56,7 @@ public class ShowInPackageViewAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
IFile file= fEditor.getFile();
if (file == null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorActionContributor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorActionContributor.java
index a81132e7d..97b898915 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorActionContributor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorActionContributor.java
@@ -38,6 +38,7 @@ public class SnippetEditorActionContributor extends BasicCompilationUnitEditorAc
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
if (fStopAction == null) {
@@ -52,6 +53,7 @@ public class SnippetEditorActionContributor extends BasicCompilationUnitEditorAc
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
*/
+ @Override
public void contributeToMenu(IMenuManager menu) {
if (fOpenOnSelectionAction == null) {
return;
@@ -69,6 +71,7 @@ public class SnippetEditorActionContributor extends BasicCompilationUnitEditorAc
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
*/
+ @Override
public void setActiveEditor(IEditorPart part) {
super.setActiveEditor(part);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorPropertyPage.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorPropertyPage.java
index 53a52802d..14c54328c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorPropertyPage.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorPropertyPage.java
@@ -123,6 +123,7 @@ public class SnippetEditorPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
GridLayout topLayout = new GridLayout();
@@ -180,6 +181,7 @@ public class SnippetEditorPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
super.performDefaults();
fWorkingDirBlock.setDefaults(fWorkingCopy);
@@ -193,6 +195,7 @@ public class SnippetEditorPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#isValid()
*/
+ @Override
public boolean isValid() {
return fWorkingDirBlock.isValid(fConfig);
}
@@ -200,6 +203,7 @@ public class SnippetEditorPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
String message = fWorkingDirBlock.getErrorMessage();
if (message == null) {
@@ -211,6 +215,7 @@ public class SnippetEditorPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IMessageProvider#getMessage()
*/
+ @Override
public String getMessage() {
String message = fWorkingDirBlock.getMessage();
if (message == null) {
@@ -222,6 +227,7 @@ public class SnippetEditorPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
fWorkingDirBlock.performApply(fWorkingCopy);
fJRETab.performApply(fWorkingCopy);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorStorageDocumentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorStorageDocumentProvider.java
index 6daf1a026..b24665da1 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorStorageDocumentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorStorageDocumentProvider.java
@@ -25,6 +25,7 @@ public class SnippetEditorStorageDocumentProvider extends StorageDocumentProvide
* @see org.eclipse.ui.editors.text.StorageDocumentProvider#setupDocument(java.lang.Object,
* org.eclipse.jface.text.IDocument)
*/
+ @Override
protected void setupDocument(Object element, IDocument document) {
if (document != null) {
JavaTextTools tools= JDIDebugUIPlugin.getDefault().getJavaTextTools();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenHierarchyOnSelectionAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenHierarchyOnSelectionAction.java
index 574615283..de05d58c1 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenHierarchyOnSelectionAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenHierarchyOnSelectionAction.java
@@ -66,6 +66,7 @@ public class SnippetOpenHierarchyOnSelectionAction extends OpenTypeHierarchyActi
fDialogMessage= message;
}
+ @Override
public void run() {
if (fEditor == null) {
return;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenOnSelectionAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenOnSelectionAction.java
index 17b9431e0..db1160ad9 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenOnSelectionAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetOpenOnSelectionAction.java
@@ -124,6 +124,7 @@ public class SnippetOpenOnSelectionAction extends OpenAction {
return refs;
}
+ @Override
public void run() {
if (fEditor == null) {
return;
@@ -146,6 +147,7 @@ public class SnippetOpenOnSelectionAction extends OpenAction {
/**
* @see SelectionDispatchAction#selectionChanged(ITextSelection)
*/
+ @Override
public void selectionChanged(ITextSelection selection) {
setEnabled(fEditor != null);
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/StopAction.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/StopAction.java
index ccf1d0033..80f1134f8 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/StopAction.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/StopAction.java
@@ -37,6 +37,7 @@ public class StopAction extends SnippetAction {
/**
* @see IAction#run()
*/
+ @Override
public void run() {
getEditor().shutDownVM();
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathContainerSourceContainerBrowser.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathContainerSourceContainerBrowser.java
index 75aa66831..6b9459667 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathContainerSourceContainerBrowser.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathContainerSourceContainerBrowser.java
@@ -33,6 +33,7 @@ public class ClasspathContainerSourceContainerBrowser extends AbstractSourceCont
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
return editLibraries(shell, director, null);
// SourceLookupMessages.getString("ClasspathContainerSourceContainerBrowser.0")
@@ -40,12 +41,14 @@ public class ClasspathContainerSourceContainerBrowser extends AbstractSourceCont
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
return containers.length == 1;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
ClasspathContainerSourceContainer sourceContainer = (ClasspathContainerSourceContainer)containers[0];
IPath containerPath = (sourceContainer).getPath();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathVariableSourceContainerBrowser.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathVariableSourceContainerBrowser.java
index b57f14668..8945cb234 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathVariableSourceContainerBrowser.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/ClasspathVariableSourceContainerBrowser.java
@@ -27,12 +27,14 @@ public class ClasspathVariableSourceContainerBrowser extends AbstractSourceConta
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
return containers.length == 1;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
ClasspathVariableSourceContainer container = (ClasspathVariableSourceContainer) containers[0];
IPath path = BuildPathDialogAccess.configureVariableEntry(shell, container.getPath(), new IPath[]{container.getPath()});
@@ -46,6 +48,7 @@ public class ClasspathVariableSourceContainerBrowser extends AbstractSourceConta
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
IPath[] paths = BuildPathDialogAccess.chooseVariableEntries(shell, new IPath[0]);
if (paths != null) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaProjectSourceContainerBrowser.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaProjectSourceContainerBrowser.java
index d34799e8f..90dd56c42 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaProjectSourceContainerBrowser.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaProjectSourceContainerBrowser.java
@@ -79,6 +79,7 @@ public class JavaProjectSourceContainerBrowser extends AbstractSourceContainerBr
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
List projects = getPossibleAdditions(director);
ProjectSelectionDialog dialog= new ProjectSelectionDialog(shell, projects);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/StackFrameShowInSourceAdapter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/StackFrameShowInSourceAdapter.java
index 62040c145..873b74a83 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/StackFrameShowInSourceAdapter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/StackFrameShowInSourceAdapter.java
@@ -40,6 +40,7 @@ public class StackFrameShowInSourceAdapter implements IShowInSource {
/* (non-Javadoc)
* @see org.eclipse.ui.part.ShowInContext#getSelection()
*/
+ @Override
public ISelection getSelection() {
if (!resolved) {
try {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetContentProvider.java
index d76c62db9..77139a71a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetContentProvider.java
@@ -26,6 +26,7 @@ public class JavaDebugTargetContentProvider extends DebugTargetContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
if (JavaElementContentProvider.isDisplayThreadGroups()) {
@@ -42,6 +43,7 @@ public class JavaDebugTargetContentProvider extends DebugTargetContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
if (JavaElementContentProvider.isDisplayThreadGroups()) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetProxy.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetProxy.java
index d797c39f2..6621f30fb 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetProxy.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaDebugTargetProxy.java
@@ -60,6 +60,7 @@ public class JavaDebugTargetProxy extends DebugTargetProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugTargetProxy#createEventHandlers()
*/
+ @Override
protected DebugEventHandler[] createEventHandlers() {
fThreadEventHandler = new JavaThreadEventHandler(this);
return new DebugEventHandler[] { new DebugTargetEventHandler(this), fThreadEventHandler,
@@ -69,6 +70,7 @@ public class JavaDebugTargetProxy extends DebugTargetProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugTargetProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
if (fIsScrapbook) {
// don't auto expand scrap books
@@ -78,6 +80,7 @@ public class JavaDebugTargetProxy extends DebugTargetProxy {
// Delay the auto-select-expand job to allow for transient suspend states to resolve.
// See bug 225377
Job job = new Job("Initialize Java Debug Session") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (!isDisposed()) {
doInstalled(finalViewer);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadEventHandler.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadEventHandler.java
index 2d483b52b..61327ee2b 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadEventHandler.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadEventHandler.java
@@ -82,6 +82,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.ThreadEventHandler#dispose()
*/
+ @Override
public synchronized void dispose() {
if (fTree != null) {
fTree.removeTreeListener(this);
@@ -91,6 +92,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
super.dispose();
}
+ @Override
protected ModelDelta addPathToThread(ModelDelta delta, IThread thread) {
if (JavaElementContentProvider.isDisplayThreadGroups()) {
ILaunch launch = thread.getLaunch();
@@ -145,6 +147,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.ThreadEventHandler#indexOf(org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
protected int indexOf(IStackFrame frame) {
if (isDisplayMonitors()) {
if (((IJavaDebugTarget)frame.getDebugTarget()).supportsMonitorInformation()) {
@@ -173,6 +176,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
* @param thread thread
* @return number of children
*/
+ @Override
protected int childCount(IThread thread) {
try {
IJavaThread jThread = (IJavaThread) thread;
@@ -198,6 +202,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.ThreadEventHandler#indexOf(org.eclipse.debug.core.model.IThread)
*/
+ @Override
protected int indexOf(IThread thread) {
if (JavaElementContentProvider.isDisplayThreadGroups()) {
IJavaThread javaThread = (IJavaThread) thread;
@@ -213,6 +218,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.ThreadEventHandler#handlesEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected boolean handlesEvent(DebugEvent event) {
if (super.handlesEvent(event)) {
Object source = event.getSource();
@@ -272,6 +278,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
/**
* Do not update for quiet resume/suspend
*/
+ @Override
protected void handleOther(DebugEvent event) {
if (event.getDetail() == JDIThread.SUSPEND_QUIET || event.getDetail() == JDIThread.RESUME_QUIET) {
return;
@@ -309,6 +316,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.ThreadEventHandler#handleCreate(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected void handleCreate(DebugEvent event) {
if (isMissingRequiredThreadGroup(event)) {
// don't bother adding/removing thread missing thread group
@@ -320,6 +328,7 @@ public class JavaThreadEventHandler extends ThreadEventHandler implements IPrope
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.ThreadEventHandler#handleTerminate(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected void handleTerminate(DebugEvent event) {
if (isMissingRequiredThreadGroup(event)) {
// don't bother adding/removing thread missing thread group
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupContentProvider.java
index e7e0acecf..d49679113 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupContentProvider.java
@@ -26,6 +26,7 @@ public class JavaThreadGroupContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
int count = 0;
if (element instanceof IJavaThreadGroup) {
@@ -41,6 +42,7 @@ public class JavaThreadGroupContentProvider extends JavaElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (parent instanceof IJavaThreadGroup) {
return getElements(getChildren((IJavaThreadGroup) parent), index, length);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupLabelProvider.java
index 0e03cca7c..e090b79c0 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/threadgroups/JavaThreadGroupLabelProvider.java
@@ -30,6 +30,7 @@ public class JavaThreadGroupLabelProvider extends ElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
IJavaThreadGroup group = (IJavaThreadGroup) elementPath.getLastSegment();
return MessageFormat.format(ThreadGroupMessages.AsyncThreadGroupLabelAdapter_0, new String[]{group.getName()});
@@ -38,6 +39,7 @@ public class JavaThreadGroupLabelProvider extends ElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
return fgImage;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaExpressionContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaExpressionContentProvider.java
index b202c2f0a..17355e8d3 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaExpressionContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaExpressionContentProvider.java
@@ -36,6 +36,7 @@ public class JavaExpressionContentProvider extends ExpressionContentProvider{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
Object[] variables = getAllChildren(parent, context);
if (JavaVariableContentProvider.displayReferencesAsChild(parent)){
@@ -53,6 +54,7 @@ public class JavaExpressionContentProvider extends ExpressionContentProvider{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
int count = super.getChildCount(element, context, monitor);
if (JavaVariableContentProvider.displayReferencesAsChild(element)){
@@ -67,6 +69,7 @@ public class JavaExpressionContentProvider extends ExpressionContentProvider{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ExpressionContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (JavaVariableContentProvider.displayReferencesAsChild(element)){
return true;
@@ -77,6 +80,7 @@ public class JavaExpressionContentProvider extends ExpressionContentProvider{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ExpressionContentProvider#getAllChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getAllChildren(Object parent, IPresentationContext context) throws CoreException {
Object[] children = super.getAllChildren(parent, context);
return JavaContentProviderFilter.filterVariables(children, context);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameContentProvider.java
index 81fd008e6..180f5d0aa 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameContentProvider.java
@@ -27,6 +27,7 @@ public class JavaStackFrameContentProvider extends StackFrameContentProvider {
*
* @see org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider#getAllChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
try {
Object[] children = super.getAllChildren(parent, context, monitor);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameLabelProvider.java
index de81a3abd..3be37bf74 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameLabelProvider.java
@@ -28,6 +28,7 @@ public class JavaStackFrameLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#retrieveLabel(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
*/
+ @Override
protected void retrieveLabel(ILabelUpdate update) throws CoreException {
Object element = update.getElement();
if (element instanceof IJavaStackFrame) {
@@ -43,6 +44,7 @@ public class JavaStackFrameLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getRule(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
*/
+ @Override
protected ISchedulingRule getRule(ILabelUpdate update) {
Object element = update.getElement();
if (element instanceof IJavaStackFrame) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameMementoProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameMementoProvider.java
index 7bcaddf21..2326ddf59 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameMementoProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaStackFrameMementoProvider.java
@@ -27,6 +27,7 @@ public class JavaStackFrameMementoProvider extends DebugElementMementoProvider i
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IJavaStackFrame) {
StringBuffer buf = new StringBuffer();
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableCellModifier.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableCellModifier.java
index d3873bcc9..64b039cdd 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableCellModifier.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableCellModifier.java
@@ -28,7 +28,8 @@ public class JavaVariableCellModifier extends DefaultVariableCellModifier {
* @see org.eclipse.debug.internal.ui.elements.adapters.DefaultVariableCellModifier#canModify(java.lang.Object,
* java.lang.String)
*/
- public boolean canModify(Object element, String property) {
+ @Override
+ public boolean canModify(Object element, String property) {
if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
if (element instanceof IJavaVariable) {
IJavaVariable var = (IJavaVariable) element;
@@ -56,7 +57,8 @@ public class JavaVariableCellModifier extends DefaultVariableCellModifier {
* @see org.eclipse.debug.internal.ui.elements.adapters.DefaultVariableCellModifier#getValue(java.lang.Object,
* java.lang.String)
*/
- public Object getValue(Object element, String property) {
+ @Override
+ public Object getValue(Object element, String property) {
if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
if (element instanceof IJavaVariable) {
IJavaVariable var = (IJavaVariable) element;
@@ -75,7 +77,8 @@ public class JavaVariableCellModifier extends DefaultVariableCellModifier {
return super.getValue(element, property);
}
- public void modify(Object element, String property, Object value) {
+ @Override
+ public void modify(Object element, String property, Object value) {
Object oldValue = getValue(element, property);
if (!value.equals(oldValue)) {
if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableColumnPresentation.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableColumnPresentation.java
index ba44c410b..4e6be067d 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableColumnPresentation.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableColumnPresentation.java
@@ -40,6 +40,7 @@ public class JavaVariableColumnPresentation extends VariableColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation#getAvailableColumns()
*/
+ @Override
public String[] getAvailableColumns() {
if (fgAllColumns == null) {
String[] basic = super.getAvailableColumns();
@@ -54,6 +55,7 @@ public class JavaVariableColumnPresentation extends VariableColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation#getHeader(java.lang.String)
*/
+ @Override
public String getHeader(String id) {
if (COLUMN_INSTANCE_ID.equals(id)) {
return VariableMessages.JavaVariableColumnPresentation_0;
@@ -67,6 +69,7 @@ public class JavaVariableColumnPresentation extends VariableColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation#getId()
*/
+ @Override
public String getId() {
return JAVA_VARIABLE_COLUMN_PRESENTATION;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableContentProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableContentProvider.java
index 492fdc4f3..0da8214ce 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableContentProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableContentProvider.java
@@ -40,6 +40,7 @@ public class JavaVariableContentProvider extends VariableContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
try {
Object[] variables = getAllChildren(parent, context);
@@ -63,6 +64,7 @@ public class JavaVariableContentProvider extends VariableContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
try {
int count = super.getChildCount(element, context, monitor);
@@ -82,6 +84,7 @@ public class JavaVariableContentProvider extends VariableContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
try {
if (displayReferencesAsChild(element)){
@@ -133,6 +136,7 @@ public class JavaVariableContentProvider extends VariableContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableContentProvider#getAllChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getAllChildren(Object parent, IPresentationContext context) throws CoreException {
Object[] children = super.getAllChildren(parent, context);
return JavaContentProviderFilter.filterVariables(children, context);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableEditor.java
index 698da5dee..4055e544c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableEditor.java
@@ -30,6 +30,7 @@ public class JavaVariableEditor extends VariableEditor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor#getCellModifier(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
*/
+ @Override
public ICellModifier getCellModifier(IPresentationContext context, Object element) {
return new JavaVariableCellModifier();
}
@@ -37,6 +38,7 @@ public class JavaVariableEditor extends VariableEditor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor#getCellEditor(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String, java.lang.Object, org.eclipse.swt.widgets.Composite)
*/
+ @Override
public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) {
if (element instanceof IJavaVariable) {
IJavaVariable var = (IJavaVariable) element;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableLabelProvider.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableLabelProvider.java
index 42cc2069e..997755678 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableLabelProvider.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableLabelProvider.java
@@ -73,6 +73,7 @@ public class JavaVariableLabelProvider extends VariableLabelProvider implements
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.elements.adapters.VariableLabelAdapter#getValueText(org.eclipse.debug.core.model.IVariable, org.eclipse.debug.core.model.IValue)
*/
+ @Override
protected String getValueText(IVariable variable, IValue value, IPresentationContext context) throws CoreException {
if (value instanceof IJavaValue) {
return fLabelProvider.getFormattedValueText((IJavaValue) value);
@@ -83,6 +84,7 @@ public class JavaVariableLabelProvider extends VariableLabelProvider implements
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.elements.adapters.VariableLabelAdapter#getValueTypeName(org.eclipse.debug.core.model.IVariable, org.eclipse.debug.core.model.IValue)
*/
+ @Override
protected String getValueTypeName(IVariable variable, IValue value, IPresentationContext context) throws CoreException {
String typeName= DebugUIMessages.JDIModelPresentation_unknown_type__2;
try {
@@ -97,6 +99,7 @@ public class JavaVariableLabelProvider extends VariableLabelProvider implements
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.elements.adapters.VariableLabelAdapter#getVariableTypeName(org.eclipse.debug.core.model.IVariable)
*/
+ @Override
protected String getVariableTypeName(IVariable variable, IPresentationContext context) throws CoreException {
String typeName= DebugUIMessages.JDIModelPresentation_unknown_type__2;
try {
@@ -125,6 +128,7 @@ public class JavaVariableLabelProvider extends VariableLabelProvider implements
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.elements.adapters.VariableLabelAdapter#getColumnText(org.eclipse.debug.core.model.IVariable, org.eclipse.debug.core.model.IValue, java.lang.String, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected String getColumnText(IVariable variable, IValue value, IPresentationContext context, String columnId) throws CoreException {
if (JavaVariableColumnPresentation.COLUMN_INSTANCE_ID.equals(columnId)) {
if (value instanceof JDIObjectValue) {
@@ -163,6 +167,7 @@ public class JavaVariableLabelProvider extends VariableLabelProvider implements
/**
* Sets qualified name setting before building label
*/
+ @Override
protected void retrieveLabel(ILabelUpdate update) throws CoreException {
Boolean showQ = isShowQualfiiedNames(update.getPresentationContext());
fQualifiedNames = showQ.booleanValue();
@@ -199,6 +204,7 @@ public class JavaVariableLabelProvider extends VariableLabelProvider implements
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException {
if (columnId == null) {
// when no columns, handle special escaping ourselves
@@ -213,6 +219,7 @@ public class JavaVariableLabelProvider extends VariableLabelProvider implements
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getRule(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
*/
+ @Override
protected ISchedulingRule getRule(ILabelUpdate update) {
IJavaStackFrame frame = null;
switch (fSerializeMode) {
diff --git a/org.eclipse.jdt.debug/.classpath b/org.eclipse.jdt.debug/.classpath
index 4b3f9840f..784f8bd69 100644
--- a/org.eclipse.jdt.debug/.classpath
+++ b/org.eclipse.jdt.debug/.classpath
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry output="jdi-bin" kind="src" path="jdi interfaces"/>
+ <classpathentry kind="src" output="jdi-bin" path="jdi interfaces"/>
<classpathentry kind="src" path="model"/>
<classpathentry kind="src" path="jdi"/>
<classpathentry kind="src" path="eval"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.jdt.debug/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.debug/.settings/org.eclipse.jdt.core.prefs
index 7e2e415e8..f41301c1a 100644
--- a/org.eclipse.jdt.debug/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.debug/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Thu Jan 20 17:01:17 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,17 +6,22 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -26,11 +30,12 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
@@ -38,7 +43,7 @@ org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
@@ -51,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
@@ -63,21 +68,30 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -99,7 +113,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
diff --git a/org.eclipse.jdt.debug/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.debug/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..435791e90
--- /dev/null
+++ b/org.eclipse.jdt.debug/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=true
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=true
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_Eclipse [built-in] 2
+cleanup_settings_version=2
+eclipse.preferences.version=1
diff --git a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
index 20cc207cf..0e53906cb 100644
--- a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
@@ -39,4 +39,4 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
Bundle-ActivationPolicy: lazy
Import-Package: com.ibm.icu.text
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/EvaluationManager.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/EvaluationManager.java
index 477f4fa5a..45380bbea 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/EvaluationManager.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/EvaluationManager.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.debug.eval;
-
import java.io.File;
import org.eclipse.jdt.core.IJavaProject;
@@ -19,8 +18,9 @@ import org.eclipse.jdt.internal.debug.eval.LocalEvaluationEngine;
import org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine;
/**
- * The evaluation manager provides factory methods for
- * creating evaluation engines.
+ * The evaluation manager provides factory methods for creating evaluation
+ * engines.
+ *
* @see org.eclipse.jdt.debug.eval.IEvaluationEngine
* @see org.eclipse.jdt.debug.eval.IClassFileEvaluationEngine
* @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine
@@ -31,43 +31,45 @@ import org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine;
* @noextend This class is not intended to be subclassed by clients.
*/
public class EvaluationManager {
-
+
/**
* Not to be instantiated
*/
private EvaluationManager() {
}
-
+
/**
- * Creates and returns a new evaluation engine that
- * performs evaluations for local Java applications
- * by deploying class files.
+ * Creates and returns a new evaluation engine that performs evaluations for
+ * local Java applications by deploying class files.
*
- * @param project the Java project in which expressions
- * are to be compiled
- * @param target the Java debug target in which expressions
- * are to be evaluated
- * @param directory the directory where support class files
- * are deployed to assist in the evaluation. The directory
- * must exist.
+ * @param project
+ * the Java project in which expressions are to be compiled
+ * @param target
+ * the Java debug target in which expressions are to be evaluated
+ * @param directory
+ * the directory where support class files are deployed to assist
+ * in the evaluation. The directory must exist.
* @return an evaluation engine
*/
- public static IClassFileEvaluationEngine newClassFileEvaluationEngine(IJavaProject project, IJavaDebugTarget target, File directory) {
+ public static IClassFileEvaluationEngine newClassFileEvaluationEngine(
+ IJavaProject project, IJavaDebugTarget target, File directory) {
return new LocalEvaluationEngine(project, target, directory);
}
-
+
/**
* Creates and returns a new evaluation engine that performs evaluations by
* compiling expressions into abstract syntax trees (ASTs), and interpreting
- * the AST over a JDI connection. This type of evaluation engine is capable of
- * performing remote evaluations.
+ * the AST over a JDI connection. This type of evaluation engine is capable
+ * of performing remote evaluations.
*
- * @param project the Java project in which expressions are to be compiled
- * @param target the Java debug target in which expressions are to be evaluated
+ * @param project
+ * the Java project in which expressions are to be compiled
+ * @param target
+ * the Java debug target in which expressions are to be evaluated
* @return an evaluation engine
*/
- public static IAstEvaluationEngine newAstEvaluationEngine(IJavaProject project, IJavaDebugTarget target) {
+ public static IAstEvaluationEngine newAstEvaluationEngine(
+ IJavaProject project, IJavaDebugTarget target) {
return new ASTEvaluationEngine(project, target);
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IAstEvaluationEngine.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IAstEvaluationEngine.java
index 76367797b..c456ecd3e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IAstEvaluationEngine.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IAstEvaluationEngine.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.debug.eval;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaReferenceType;
@@ -18,146 +17,180 @@ import org.eclipse.jdt.debug.core.IJavaStackFrame;
import org.eclipse.jdt.debug.core.IJavaThread;
/**
- * An evaluation engine that performs evaluations by
- * interpreting abstract syntax trees. An AST evaluation engine
- * is capable of creating compiled expressions that can be
- * evaluated multiple times in a given runtime context.
+ * An evaluation engine that performs evaluations by interpreting abstract
+ * syntax trees. An AST evaluation engine is capable of creating compiled
+ * expressions that can be evaluated multiple times in a given runtime context.
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
- */
+ */
public interface IAstEvaluationEngine extends IEvaluationEngine {
/**
- * Asynchronously evaluates the given expression in the context of
- * the specified stack frame, reporting the result back to the given listener.
- * The thread is resumed from the location at which it
- * is currently suspended to perform the evaluation. When the evaluation
- * completes, the thread will be suspended at this original location.
- * The thread runs the evaluation with the given evaluation detail
- * (@see IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int)).
+ * Asynchronously evaluates the given expression in the context of the
+ * specified stack frame, reporting the result back to the given listener.
+ * The thread is resumed from the location at which it is currently
+ * suspended to perform the evaluation. When the evaluation completes, the
+ * thread will be suspended at this original location. The thread runs the
+ * evaluation with the given evaluation detail (@see
+ * IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int)).
* Compilation and runtime errors are reported in the evaluation result.
*
- * @param expression expression to evaluate
- * @param frame the stack frame context in which to run the
- * evaluation.
- * @param listener the listener that will receive notification
- * when/if the evaluation completes
- * @param evaluationDetail one of <code>DebugEvent.EVALUATION</code> or
- * <code>DebugEvent.EVALUATION_IMPLICIT</code>
- * @param hitBreakpoints whether or not breakpoints should be honored
- * in the evaluation thread during the evaluation. If <code>false</code>,
- * breakpoints hit in the evaluation thread will be ignored.
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The associated thread is not currently suspended</li>
- * <li>The stack frame is not contained in the debug target
- * associated with this evaluation engine</li>
- * <li>The associated thread is suspended in the middle of
- * an evaluation that has not completed. It is not possible
- * to perform nested evaluations</li>
- * </ul>
+ * @param expression
+ * expression to evaluate
+ * @param frame
+ * the stack frame context in which to run the evaluation.
+ * @param listener
+ * the listener that will receive notification when/if the
+ * evaluation completes
+ * @param evaluationDetail
+ * one of <code>DebugEvent.EVALUATION</code> or
+ * <code>DebugEvent.EVALUATION_IMPLICIT</code>
+ * @param hitBreakpoints
+ * whether or not breakpoints should be honored in the evaluation
+ * thread during the evaluation. If <code>false</code>,
+ * breakpoints hit in the evaluation thread will be ignored.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The associated thread is not currently suspended</li>
+ * <li>The stack frame is not contained in the debug target
+ * associated with this evaluation engine</li>
+ * <li>The associated thread is suspended in the middle of an
+ * evaluation that has not completed. It is not possible to
+ * perform nested evaluations</li>
+ * </ul>
*/
- public void evaluateExpression(ICompiledExpression expression, IJavaStackFrame frame, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException;
+ public void evaluateExpression(ICompiledExpression expression,
+ IJavaStackFrame frame, IEvaluationListener listener,
+ int evaluationDetail, boolean hitBreakpoints) throws DebugException;
/**
- * Asynchronously evaluates the given expression in the context of
- * the specified type, reporting the result back to the given listener.
- * The expression is evaluated in the context of the Java
- * project this evaluation engine was created on. If the
- * expression is determined to have no errors, the expression
- * is evaluated in the thread associated with the given
- * stack frame. When the evaluation completes, the thread
- * will be suspended at this original location.
- * The thread runs the evaluation with the given evaluation detail
- * (@see IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int)).
+ * Asynchronously evaluates the given expression in the context of the
+ * specified type, reporting the result back to the given listener. The
+ * expression is evaluated in the context of the Java project this
+ * evaluation engine was created on. If the expression is determined to have
+ * no errors, the expression is evaluated in the thread associated with the
+ * given stack frame. When the evaluation completes, the thread will be
+ * suspended at this original location. The thread runs the evaluation with
+ * the given evaluation detail (@see
+ * IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int)).
* Compilation and runtime errors are reported in the evaluation result.
*
- * @param expression the expression to evaluate
- * @param object the 'this' context for the evaluation
- * @param thread the thread in which to run the evaluation,
- * which must be suspended
- * @param listener the listener that will receive notification
- * when/if the evaluation completes
- * @param evaluationDetail one of <code>DebugEvent.EVALUATION</code> or
- * <code>DebugEvent.EVALUATION_IMPLICIT</code>
- * @param hitBreakpoints whether or not breakpoints should be honored
- * in the evaluation thread during the evaluation. If <code>false</code>,
- * breakpoints hit in the evaluation thread will be ignored.
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The associated thread is not currently suspended</li>
- * <li>The stack frame is not contained in the debug target
- * associated with this evaluation engine</li>
- * <li>The associated thread is suspended in the middle of
- * an evaluation that has not completed. It is not possible
- * to perform nested evaluations</li>
- * </ul>
+ * @param expression
+ * the expression to evaluate
+ * @param object
+ * the 'this' context for the evaluation
+ * @param thread
+ * the thread in which to run the evaluation, which must be
+ * suspended
+ * @param listener
+ * the listener that will receive notification when/if the
+ * evaluation completes
+ * @param evaluationDetail
+ * one of <code>DebugEvent.EVALUATION</code> or
+ * <code>DebugEvent.EVALUATION_IMPLICIT</code>
+ * @param hitBreakpoints
+ * whether or not breakpoints should be honored in the evaluation
+ * thread during the evaluation. If <code>false</code>,
+ * breakpoints hit in the evaluation thread will be ignored.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The associated thread is not currently suspended</li>
+ * <li>The stack frame is not contained in the debug target
+ * associated with this evaluation engine</li>
+ * <li>The associated thread is suspended in the middle of an
+ * evaluation that has not completed. It is not possible to
+ * perform nested evaluations</li>
+ * </ul>
*/
- public void evaluateExpression(ICompiledExpression expression, IJavaObject object, IJavaThread thread, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException;
+ public void evaluateExpression(ICompiledExpression expression,
+ IJavaObject object, IJavaThread thread,
+ IEvaluationListener listener, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException;
/**
* Synchronously generates a compiled expression from the given expression
- * in the context of the specified stack frame. The generated expression
- * can be stored and evaluated later in a valid runtime context.
- * Compilation errors are reported in the returned compiled expression.
+ * in the context of the specified stack frame. The generated expression can
+ * be stored and evaluated later in a valid runtime context. Compilation
+ * errors are reported in the returned compiled expression.
*
- * @param expression expression to compile
- * @param frame the context in which to compile the expression
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The associated thread is not currently suspended</li>
- * <li>The stack frame is not contained in the debug target
- * associated with this evaluation engine</li>
- * </ul>
+ * @param expression
+ * expression to compile
+ * @param frame
+ * the context in which to compile the expression
+ * @return the compiled expression
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The associated thread is not currently suspended</li>
+ * <li>The stack frame is not contained in the debug target
+ * associated with this evaluation engine</li>
+ * </ul>
*/
- public ICompiledExpression getCompiledExpression(String expression, IJavaStackFrame frame) throws DebugException;
-
+ public ICompiledExpression getCompiledExpression(String expression,
+ IJavaStackFrame frame) throws DebugException;
+
/**
* Synchronously generates a compiled expression from the given expression
- * in the context of the specified object. The generated expression
- * can be stored and evaluated later in a valid runtime context.
- * Compilation errors are reported in the returned compiled expression.
+ * in the context of the specified object. The generated expression can be
+ * stored and evaluated later in a valid runtime context. Compilation errors
+ * are reported in the returned compiled expression.
*
- * @param expression expression to compile
- * @param object the context in which to compile the expression
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The associated thread is not currently suspended</li>
- * <li>The stack frame is not contained in the debug target
- * associated with this evaluation engine</li>
- * </ul>
+ * @param expression
+ * expression to compile
+ * @param object
+ * the context in which to compile the expression
+ * @return the compiled epxression
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The associated thread is not currently suspended</li>
+ * <li>The stack frame is not contained in the debug target
+ * associated with this evaluation engine</li>
+ * </ul>
*/
- public ICompiledExpression getCompiledExpression(String expression, IJavaObject object) throws DebugException;
+ public ICompiledExpression getCompiledExpression(String expression,
+ IJavaObject object) throws DebugException;
/**
* Synchronously generates a compiled expression from the given expression
- * in the context of the specified type. The generated expression
- * can be stored and evaluated later in a valid runtime context.
- * Compilation errors are reported in the returned compiled expression.
+ * in the context of the specified type. The generated expression can be
+ * stored and evaluated later in a valid runtime context. Compilation errors
+ * are reported in the returned compiled expression.
*
- * @param expression expression to compile
- * @param type the context in which to compile the expression
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The associated thread is not currently suspended</li>
- * <li>The stack frame is not contained in the debug target
- * associated with this evaluation engine</li>
- * </ul>
+ * @param expression
+ * expression to compile
+ * @param type
+ * the context in which to compile the expression
+ * @return the compiled expression
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The associated thread is not currently suspended</li>
+ * <li>The stack frame is not contained in the debug target
+ * associated with this evaluation engine</li>
+ * </ul>
* @since 3.1
*/
- public ICompiledExpression getCompiledExpression(String expression, IJavaReferenceType type) throws DebugException;
+ public ICompiledExpression getCompiledExpression(String expression,
+ IJavaReferenceType type) throws DebugException;
-
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IClassFileEvaluationEngine.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IClassFileEvaluationEngine.java
index 1ffca66d2..eb51a59eb 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IClassFileEvaluationEngine.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IClassFileEvaluationEngine.java
@@ -13,71 +13,77 @@ package org.eclipse.jdt.debug.eval;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaThread;
-
/**
- * An evaluation engine that performs evaluations by
- * deploying and executing class files locally.
+ * An evaluation engine that performs evaluations by deploying and executing
+ * class files locally.
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
- */
+ */
public interface IClassFileEvaluationEngine extends IEvaluationEngine {
/**
* Returns the import declarations for this evaluation context. An empty
- * list indicates there are no imports. The syntax for the import corresponds to a
- * fully qualified type name, or to an on-demand package name as defined by
- * ImportDeclaration (JLS2 7.5). For example, <code>"java.util.Hashtable"</code>
- * or <code>"java.util.*"</code>.
- *
+ * list indicates there are no imports. The syntax for the import
+ * corresponds to a fully qualified type name, or to an on-demand package
+ * name as defined by ImportDeclaration (JLS2 7.5). For example,
+ * <code>"java.util.Hashtable"</code> or <code>"java.util.*"</code>.
+ *
* @return the list of import names
*/
public String[] getImports();
-
+
/**
- * Sets the import declarations for this evaluation context. An empty
- * list indicates there are no imports. The syntax for the import corresponds to a
- * fully qualified type name, or to an on-demand package name as defined by
- * ImportDeclaration (JLS2 7.5). For example, <code>"java.util.Hashtable"</code>
- * or <code>"java.util.*"</code>.
- *
- * @param imports the list of import names
+ * Sets the import declarations for this evaluation context. An empty list
+ * indicates there are no imports. The syntax for the import corresponds to
+ * a fully qualified type name, or to an on-demand package name as defined
+ * by ImportDeclaration (JLS2 7.5). For example,
+ * <code>"java.util.Hashtable"</code> or <code>"java.util.*"</code>.
+ *
+ * @param imports
+ * the list of import names
*/
public void setImports(String[] imports);
-
+
/**
- * Asynchronously evaluates the given snippet in the specified
- * target thread, reporting the result back to the given listener.
- * The snippet is evaluated in the context of the Java
- * project this evaluation engine was created on. If the
- * snippet is determined to be a valid expression, the expression
- * is evaluated in the specified thread, which resumes its
- * execution from the location at which it is currently suspended.
- * When the evaluation completes, the thread will be suspened
- * at this original location.
- * Compilation and runtime errors are reported in the evaluation result.
+ * Asynchronously evaluates the given snippet in the specified target
+ * thread, reporting the result back to the given listener. The snippet is
+ * evaluated in the context of the Java project this evaluation engine was
+ * created on. If the snippet is determined to be a valid expression, the
+ * expression is evaluated in the specified thread, which resumes its
+ * execution from the location at which it is currently suspended. When the
+ * evaluation completes, the thread will be suspened at this original
+ * location. Compilation and runtime errors are reported in the evaluation
+ * result.
*
- * @param snippet code snippet to evaluate
- * @param thread the thread in which to run the evaluation,
- * which must be suspended
- * @param listener the listener that will receive notification
- * when/if the evalaution completes
- * @param hitBreakpoints whether or not breakpoints should be honored
- * in the evaluation thread during the evaluation. If <code>false</code>,
- * breakpoints hit in the evaluation thread will be ignored.
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The specified thread is not currently suspended</li>
- * <li>The specified thread is not contained in the debug target
- * associated with this evaluation engine</li>
- * <li>The specified thread is suspended in the middle of
- * an evaluation that has not completed. It is not possible
- * to perform nested evaluations</li>
- * </ul>
+ * @param snippet
+ * code snippet to evaluate
+ * @param thread
+ * the thread in which to run the evaluation, which must be
+ * suspended
+ * @param listener
+ * the listener that will receive notification when/if the
+ * evalaution completes
+ * @param hitBreakpoints
+ * whether or not breakpoints should be honored in the evaluation
+ * thread during the evaluation. If <code>false</code>,
+ * breakpoints hit in the evaluation thread will be ignored.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The specified thread is not currently suspended</li>
+ * <li>The specified thread is not contained in the debug
+ * target associated with this evaluation engine</li>
+ * <li>The specified thread is suspended in the middle of an
+ * evaluation that has not completed. It is not possible to
+ * perform nested evaluations</li>
+ * </ul>
*/
- public void evaluate(String snippet, IJavaThread thread, IEvaluationListener listener, boolean hitBreakpoints) throws DebugException;
-
-
-}
+ public void evaluate(String snippet, IJavaThread thread,
+ IEvaluationListener listener, boolean hitBreakpoints)
+ throws DebugException;
+}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/ICompiledExpression.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/ICompiledExpression.java
index 9087e49a2..269e3185a 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/ICompiledExpression.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/ICompiledExpression.java
@@ -10,51 +10,53 @@
*******************************************************************************/
package org.eclipse.jdt.debug.eval;
-
import org.eclipse.jdt.core.dom.Message;
/**
- * A compiled expression can be compiled once and evaluated multiple times
- * in a runtime context.
+ * A compiled expression can be compiled once and evaluated multiple times in a
+ * runtime context.
+ *
* @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-
public interface ICompiledExpression {
-
+
/**
- * Returns the source snippet from which this compiled expression was created.
+ * Returns the source snippet from which this compiled expression was
+ * created.
*
- * @return the source snippet from which this compiled expression was created
+ * @return the source snippet from which this compiled expression was
+ * created
*/
public String getSnippet();
-
+
/**
* Returns whether this compiled expression has any compilation errors.
*
* @return whether this compiled expression has any compilation errors
*/
public boolean hasErrors();
-
+
/**
- * Returns any errors which occurred while creating this compiled expression.
+ * Returns any errors which occurred while creating this compiled
+ * expression.
*
* @return any errors which occurred while creating this compiled expression
* @deprecated use getErrorMessages()
*/
+ @Deprecated
public Message[] getErrors();
-
+
/**
- * Returns an array of problem messages. Each message describes a problem that
- * occurred while while creating this compiled expression.
- *
+ * Returns an array of problem messages. Each message describes a problem
+ * that occurred while while creating this compiled expression.
+ *
* @return error messages, or an empty array if no errors occurred
* @since 2.1
*/
public String[] getErrorMessages();
-
-}
+}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationEngine.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationEngine.java
index c316ff99c..727ef872a 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationEngine.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationEngine.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.debug.eval;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.debug.core.IJavaDebugTarget;
@@ -19,10 +18,10 @@ import org.eclipse.jdt.debug.core.IJavaStackFrame;
import org.eclipse.jdt.debug.core.IJavaThread;
/**
- * An evaluation engine performs an evaluation of a
- * code snippet or expression in a specified thread of a debug target.
- * An evaluation engine is associated with a specific
- * debug target and Java project on creation.
+ * An evaluation engine performs an evaluation of a code snippet or expression
+ * in a specified thread of a debug target. An evaluation engine is associated
+ * with a specific debug target and Java project on creation.
+ *
* @see IEvaluationResult
* @see IEvaluationListener
* @since 2.0
@@ -32,106 +31,122 @@ import org.eclipse.jdt.debug.core.IJavaThread;
public interface IEvaluationEngine {
/**
- * Asynchronously evaluates the given snippet in the context of
- * the specified stack frame, reporting the result back to the given listener.
- * The snippet is evaluated in the context of the Java
- * project this evaluation engine was created on. If the
- * snippet is determined to be a valid expression, the expression
- * is evaluated in the thread associated with the given
- * stack frame. The thread is resumed from the location at which it
- * is currently suspended to perform the evaluation. When the evaluation
- * completes, the thread will be suspended at this original location.
- * The thread runs the evaluation with the given evaluation detail
- * (@see IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int)).
- * Compilation and runtime errors are reported in the evaluation result.
+ * Asynchronously evaluates the given snippet in the context of the
+ * specified stack frame, reporting the result back to the given listener.
+ * The snippet is evaluated in the context of the Java project this
+ * evaluation engine was created on. If the snippet is determined to be a
+ * valid expression, the expression is evaluated in the thread associated
+ * with the given stack frame. The thread is resumed from the location at
+ * which it is currently suspended to perform the evaluation. When the
+ * evaluation completes, the thread will be suspended at this original
+ * location. The thread runs the evaluation with the given evaluation detail
+ * (@see IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor,
+ * int)). Compilation and runtime errors are reported in the evaluation
+ * result.
*
- * @param snippet code snippet to evaluate
- * @param frame the stack frame context in which to run the
- * evaluation.
- * @param listener the listener that will receive notification
- * when/if the evaluation completes
- * @param evaluationDetail one of <code>DebugEvent.EVALUATION</code> or
- * <code>DebugEvent.EVALUATION_IMPLICIT</code>
- * @param hitBreakpoints whether or not breakpoints should be honored
- * in the evaluation thread during the evaluation. If <code>false</code>,
- * breakpoints hit in the evaluation thread will be ignored.
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The associated thread is not currently suspended</li>
- * <li>The stack frame is not contained in the debug target
- * associated with this evaluation engine</li>
- * <li>The associated thread is suspended in the middle of
- * an evaluation that has not completed. It is not possible
- * to perform nested evaluations</li>
- * </ul>
+ * @param snippet
+ * code snippet to evaluate
+ * @param frame
+ * the stack frame context in which to run the evaluation.
+ * @param listener
+ * the listener that will receive notification when/if the
+ * evaluation completes
+ * @param evaluationDetail
+ * one of <code>DebugEvent.EVALUATION</code> or
+ * <code>DebugEvent.EVALUATION_IMPLICIT</code>
+ * @param hitBreakpoints
+ * whether or not breakpoints should be honored in the evaluation
+ * thread during the evaluation. If <code>false</code>,
+ * breakpoints hit in the evaluation thread will be ignored.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The associated thread is not currently suspended</li>
+ * <li>The stack frame is not contained in the debug target
+ * associated with this evaluation engine</li>
+ * <li>The associated thread is suspended in the middle of an
+ * evaluation that has not completed. It is not possible to
+ * perform nested evaluations</li>
+ * </ul>
*/
- public void evaluate(String snippet, IJavaStackFrame frame, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException;
+ public void evaluate(String snippet, IJavaStackFrame frame,
+ IEvaluationListener listener, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException;
+
/**
- * Asynchronously evaluates the given snippet in the context of
- * the specified type, reporting the result back to the given listener.
- * The snippet is evaluated in the context of the Java
- * project this evaluation engine was created on. If the
- * snippet is determined to be a valid expression, the expression
- * is evaluated in the thread associated with the given
- * stack frame. The thread is resumed from the location at which it
- * is currently suspended to perform the evaluation. When the evaluation
- * completes, the thread will be suspended at this original location.
- * The thread runs the evaluation with the given evaluation detail
- * (@see IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int)).
+ * Asynchronously evaluates the given snippet in the context of the
+ * specified type, reporting the result back to the given listener. The
+ * snippet is evaluated in the context of the Java project this evaluation
+ * engine was created on. If the snippet is determined to be a valid
+ * expression, the expression is evaluated in the thread associated with the
+ * given stack frame. The thread is resumed from the location at which it is
+ * currently suspended to perform the evaluation. When the evaluation
+ * completes, the thread will be suspended at this original location. The
+ * thread runs the evaluation with the given evaluation detail (@see
+ * IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int)).
* Compilation and runtime errors are reported in the evaluation result.
*
- * @param snippet code snippet to evaluate
- * @param thisContext the 'this' context for the evaluation
- * @param thread the thread in which to run the evaluation,
- * which must be suspended
- * @param listener the listener that will receive notification
- * when/if the evaluation completes
- * @param evaluationDetail one of <code>DebugEvent.EVALUATION</code> or
- * <code>DebugEvent.EVALUATION_IMPLICIT</code>
- * @param hitBreakpoints whether or not breakpoints should be honored
- * in the evaluation thread during the evaluation. If <code>false</code>,
- * breakpoints hit in the evaluation thread will be ignored.
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The associated thread is not currently suspended</li>
- * <li>The specified thread is not contained in the debug target
- * associated with this evaluation engine</li>
- * <li>The associated thread is suspended in the middle of
- * an evaluation that has not completed. It is not possible
- * to perform nested evaluations</li>
- * </ul>
+ * @param snippet
+ * code snippet to evaluate
+ * @param thisContext
+ * the 'this' context for the evaluation
+ * @param thread
+ * the thread in which to run the evaluation, which must be
+ * suspended
+ * @param listener
+ * the listener that will receive notification when/if the
+ * evaluation completes
+ * @param evaluationDetail
+ * one of <code>DebugEvent.EVALUATION</code> or
+ * <code>DebugEvent.EVALUATION_IMPLICIT</code>
+ * @param hitBreakpoints
+ * whether or not breakpoints should be honored in the evaluation
+ * thread during the evaluation. If <code>false</code>,
+ * breakpoints hit in the evaluation thread will be ignored.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The associated thread is not currently suspended</li>
+ * <li>The specified thread is not contained in the debug
+ * target associated with this evaluation engine</li>
+ * <li>The associated thread is suspended in the middle of an
+ * evaluation that has not completed. It is not possible to
+ * perform nested evaluations</li>
+ * </ul>
*/
- public void evaluate(String snippet, IJavaObject thisContext, IJavaThread thread, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException;
+ public void evaluate(String snippet, IJavaObject thisContext,
+ IJavaThread thread, IEvaluationListener listener,
+ int evaluationDetail, boolean hitBreakpoints) throws DebugException;
/**
- * Returns the Java project in which expressions are
- * compiled.
+ * Returns the Java project in which expressions are compiled.
*
* @return Java project context
*/
public IJavaProject getJavaProject();
-
+
/**
- * Returns the debug target for which evaluations
- * are executed.
+ * Returns the debug target for which evaluations are executed.
*
* @return Java debug target
*/
public IJavaDebugTarget getDebugTarget();
-
+
/**
- * Disposes this evaluation engine. This causes the evaluation engine
- * to cleanup any resources (such as threads) that it maintains. Clients
- * should call this method when they are finished performing evaluations
- * with this engine.
+ * Disposes this evaluation engine. This causes the evaluation engine to
+ * cleanup any resources (such as threads) that it maintains. Clients should
+ * call this method when they are finished performing evaluations with this
+ * engine.
*
- * This engine must not be used to perform evaluations after it has been disposed.
+ * This engine must not be used to perform evaluations after it has been
+ * disposed.
*/
public void dispose();
-
-}
+}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationListener.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationListener.java
index 2707c939a..905c167ff 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationListener.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationListener.java
@@ -10,26 +10,26 @@
*******************************************************************************/
package org.eclipse.jdt.debug.eval;
-
/**
- * Evaluation results are reported to evaluation listeners
- * on the completion of an evaluation. The evaluation
- * may fail but a result will be supplied indicating the
- * problems.
+ * Evaluation results are reported to evaluation listeners on the completion of
+ * an evaluation. The evaluation may fail but a result will be supplied
+ * indicating the problems.
* <p>
* Clients may implement this interface.
* </p>
+ *
* @see IEvaluationResult
* @since 2.0
*/
public interface IEvaluationListener {
-
+
/**
- * Notifies this listener that an evaluation has completed, with the
- * given result.
+ * Notifies this listener that an evaluation has completed, with the given
+ * result.
*
- * @param result The result from the evaluation
+ * @param result
+ * The result from the evaluation
* @see IEvaluationResult
*/
public void evaluationComplete(IEvaluationResult result);
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationResult.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationResult.java
index 7a0a1f271..cee44e755 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationResult.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/IEvaluationResult.java
@@ -10,15 +10,15 @@
*******************************************************************************/
package org.eclipse.jdt.debug.eval;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.core.dom.Message;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.core.IJavaValue;
/**
- * The result of an evaluation. An evaluation result may
- * contain problems and/or a result value.
+ * The result of an evaluation. An evaluation result may contain problems and/or
+ * a result value.
+ *
* @see IJavaValue
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
@@ -26,87 +26,86 @@ import org.eclipse.jdt.debug.core.IJavaValue;
*/
public interface IEvaluationResult {
-
+
/**
- * Returns the value representing the result of the
- * evaluation, or <code>null</code> if the
- * associated evaluation failed. If
- * the associated evaluation failed, there will
- * be problems, or an exception in this result.
+ * Returns the value representing the result of the evaluation, or
+ * <code>null</code> if the associated evaluation failed. If the associated
+ * evaluation failed, there will be problems, or an exception in this
+ * result.
* <p>
- * Since 3.5, this method can also return null if
- * the evaluation was terminated before it completed.
+ * Since 3.5, this method can also return null if the evaluation was
+ * terminated before it completed.
* </p>
- * @return the resulting value, possibly
- * <code>null</code>
+ *
+ * @return the resulting value, possibly <code>null</code>
*/
public IJavaValue getValue();
-
+
/**
- * Returns whether the evaluation had any problems
- * or if an exception occurred while performing the
- * evaluation.
- *
+ * Returns whether the evaluation had any problems or if an exception
+ * occurred while performing the evaluation.
+ *
* @return whether there were any problems.
* @see #getErrors()
* @see #getException()
*/
public boolean hasErrors();
-
+
/**
- * Returns an array of problem messages. Each message describes a problem that
- * occurred while compiling the snippet.
- *
- * @return compilation error messages, or an empty array if no errors occurred
+ * Returns an array of problem messages. Each message describes a problem
+ * that occurred while compiling the snippet.
+ *
+ * @return compilation error messages, or an empty array if no errors
+ * occurred
* @deprecated use getErrorMessages()
*/
+ @Deprecated
public Message[] getErrors();
-
+
/**
- * Returns an array of problem messages. Each message describes a problem that
- * occurred while compiling the snippet.
- *
- * @return compilation error messages, or an empty array if no errors occurred
+ * Returns an array of problem messages. Each message describes a problem
+ * that occurred while compiling the snippet.
+ *
+ * @return compilation error messages, or an empty array if no errors
+ * occurred
* @since 2.1
*/
public String[] getErrorMessages();
-
+
/**
* Returns the snippet that was evaluated.
- *
+ *
* @return The string code snippet.
*/
public String getSnippet();
-
+
/**
- * Returns any exception that occurred while performing the evaluation
- * or <code>null</code> if an exception did not occur.
- * The exception will be a debug exception or a debug exception
- * that wrappers a JDI exception that indicates a problem communicating
- * with the target or with actually performing some action in the target.
- *
+ * Returns any exception that occurred while performing the evaluation or
+ * <code>null</code> if an exception did not occur. The exception will be a
+ * debug exception or a debug exception that wrappers a JDI exception that
+ * indicates a problem communicating with the target or with actually
+ * performing some action in the target.
+ *
* @return The exception that occurred during the evaluation
* @see com.sun.jdi.InvocationException
* @see org.eclipse.debug.core.DebugException
*/
public DebugException getException();
-
+
/**
* Returns the thread in which the evaluation was performed.
*
* @return the thread in which the evaluation was performed
*/
public IJavaThread getThread();
-
+
/**
- * Returns the evaluation engine used to evaluate the original
- * snippet.
+ * Returns the evaluation engine used to evaluate the original snippet.
*
- * @return the evaluation engine used to evaluate the
- * original snippet
+ * @return the evaluation engine used to evaluate the original snippet
*/
- public IEvaluationEngine getEvaluationEngine();
-
+ public IEvaluationEngine getEvaluationEngine();
+
/**
* Returns whether this evaluation was terminated before it completed.
*
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/EvaluationResult.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/EvaluationResult.java
index 0687b4a3c..69ccfa739 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/EvaluationResult.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/EvaluationResult.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -21,60 +20,59 @@ import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.debug.eval.IEvaluationEngine;
import org.eclipse.jdt.debug.eval.IEvaluationResult;
-
+
/**
* The result of an evaluation.
*
* @see org.eclipse.jdt.debug.eval.IEvaluationResult
*/
public class EvaluationResult implements IEvaluationResult {
-
+
/**
* The result of an evaluation, possibly <code>null</code>
*/
private IJavaValue fValue;
-
+
/**
- * Thread in which the associated evaluation was
- * executed.
+ * Thread in which the associated evaluation was executed.
*/
private IJavaThread fThread;
-
+
/**
* Evaluation engine that created this result
*/
private IEvaluationEngine fEngine;
-
+
/**
* Source that was evaluated.
*/
private String fSnippet;
-
+
/**
- * Exception that occurred during evaluation,
- * or <code>null</code> if none.
+ * Exception that occurred during evaluation, or <code>null</code> if none.
*/
private DebugException fException;
-
+
/**
* List of <code>String</code>s describing compilation problems.
*/
- private List fErrors;
-
+ private List<String> fErrors;
+
/**
* Whether the evaluation was terminated.
*/
private boolean fTerminated = false;
/**
- * Constructs a new evaluation result for the given
- * engine, thread, and code snippet.
+ * Constructs a new evaluation result for the given engine, thread, and code
+ * snippet.
*/
- public EvaluationResult(IEvaluationEngine engine, String snippet, IJavaThread thread) {
+ public EvaluationResult(IEvaluationEngine engine, String snippet,
+ IJavaThread thread) {
setEvaluationEngine(engine);
setThread(thread);
setSnippet(snippet);
- fErrors= new ArrayList();
+ fErrors = new ArrayList<String>();
}
/**
@@ -83,17 +81,16 @@ public class EvaluationResult implements IEvaluationResult {
public IJavaValue getValue() {
return fValue;
}
-
+
/**
- * Sets the result of an evaluation, possibly
- * <code>null</code>.
+ * Sets the result of an evaluation, possibly <code>null</code>.
*
- * @param value result of an evaluation, possibly
- * <code>null</code>
+ * @param value
+ * result of an evaluation, possibly <code>null</code>
*/
public void setValue(IJavaValue value) {
fValue = value;
- }
+ }
/**
* @see IEvaluationResult#hasProblems()
@@ -106,33 +103,35 @@ public class EvaluationResult implements IEvaluationResult {
* @see IEvaluationResult#getProblems()
* @deprecated
*/
+ @Deprecated
public Message[] getErrors() {
- Message[] messages= new Message[fErrors.size()];
- int i= 0;
- for (Iterator iter= fErrors.iterator(); iter.hasNext();) {
- messages[i++]= new Message((String) iter.next(), -1);
+ Message[] messages = new Message[fErrors.size()];
+ int i = 0;
+ for (Iterator<String> iter = fErrors.iterator(); iter.hasNext();) {
+ messages[i++] = new Message(iter.next(), -1);
}
return messages;
}
-
+
/**
* @see org.eclipse.jdt.debug.eval.IEvaluationResult#getErrorMessages()
*/
public String[] getErrorMessages() {
- return (String[])fErrors.toArray(new String[fErrors.size()]);
+ return fErrors.toArray(new String[fErrors.size()]);
}
-
+
/**
* @see IEvaluationResult#getSnippet()
*/
public String getSnippet() {
return fSnippet;
}
-
+
/**
* Sets the code snippet that was evaluated.
*
- * @param snippet the source code that was evaluated
+ * @param snippet
+ * the source code that was evaluated
*/
private void setSnippet(String snippet) {
fSnippet = snippet;
@@ -144,12 +143,13 @@ public class EvaluationResult implements IEvaluationResult {
public DebugException getException() {
return fException;
}
-
+
/**
- * Sets an exception that occurred while attempting
- * the associated evaluation.
+ * Sets an exception that occurred while attempting the associated
+ * evaluation.
*
- * @param e exception
+ * @param e
+ * exception
*/
public void setException(DebugException e) {
fException = e;
@@ -161,16 +161,15 @@ public class EvaluationResult implements IEvaluationResult {
public IJavaThread getThread() {
return fThread;
}
-
+
/**
- * Sets the thread this result was generated
- * from.
+ * Sets the thread this result was generated from.
*
- * @param thread thread in which the associated
- * evaluation was executed
+ * @param thread
+ * thread in which the associated evaluation was executed
*/
private void setThread(IJavaThread thread) {
- fThread= thread;
+ fThread = thread;
}
/**
@@ -179,16 +178,17 @@ public class EvaluationResult implements IEvaluationResult {
public IEvaluationEngine getEvaluationEngine() {
return fEngine;
}
-
+
/**
* Sets the evaluation that created this result.
*
- * @param engine the evaluation that created this result
+ * @param engine
+ * the evaluation that created this result
*/
private void setEvaluationEngine(IEvaluationEngine engine) {
fEngine = engine;
}
-
+
/**
* Adds the given message to the list of error messages.
*/
@@ -196,7 +196,9 @@ public class EvaluationResult implements IEvaluationResult {
fErrors.add(message);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.eval.IEvaluationResult#isTerminated()
*/
public boolean isTerminated() {
@@ -206,10 +208,10 @@ public class EvaluationResult implements IEvaluationResult {
/**
* Sets whether terminated.
*
- * @param terminated whether terminated
+ * @param terminated
+ * whether terminated
*/
public void setTerminated(boolean terminated) {
fTerminated = terminated;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/LocalEvaluationEngine.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/LocalEvaluationEngine.java
index d969070e8..cd9aacb33 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/LocalEvaluationEngine.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/LocalEvaluationEngine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,9 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval;
-
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -46,12 +44,14 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.debug.eval.IClassFileEvaluationEngine;
+import org.eclipse.jdt.debug.eval.IEvaluationEngine;
import org.eclipse.jdt.debug.eval.IEvaluationListener;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.JavaDebugUtils;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
import org.eclipse.jdt.internal.debug.core.model.JDIValue;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.InvocationException;
import com.sun.jdi.ObjectReference;
@@ -59,139 +59,136 @@ import com.sun.jdi.ObjectReference;
* An evaluation engine that deploys class files locally
*/
-public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeSnippetRequestor , IEvaluationRunnable {
-
- private static final String CODE_SNIPPET_NAME= "CodeSnippet.class"; //$NON-NLS-1$
+public class LocalEvaluationEngine implements IClassFileEvaluationEngine,
+ ICodeSnippetRequestor, IEvaluationRunnable {
+
+ private static final String CODE_SNIPPET_NAME = "CodeSnippet.class"; //$NON-NLS-1$
/**
- * A count of the number of engines created.
- * Count is incremented on instantiation and decremented on
- * dispose. When the count == 0, the special CodeSnippet.class
- * is deleted as this class file is shared by all.
+ * A count of the number of engines created. Count is incremented on
+ * instantiation and decremented on dispose. When the count == 0, the
+ * special CodeSnippet.class is deleted as this class file is shared by all.
*/
- private static int ENGINE_COUNT= 0;
+ private static int ENGINE_COUNT = 0;
/**
* The Java project context in which to compile snippets.
*/
private IJavaProject fJavaProject;
-
+
/**
* The debug target on which to execute snippets
*/
private IJavaDebugTarget fDebugTarget;
-
+
/**
* The location in which to deploy snippet class files
*/
private File fOutputDirectory;
-
+
/**
- * The listener to notify when the current evaluation
- * is complete.
+ * The listener to notify when the current evaluation is complete.
*/
private IEvaluationListener fListener;
-
+
/**
- * The stack frame context for the current evaluation
- * or <code>null</code> if there is no stack frame
- * context.
+ * The stack frame context for the current evaluation or <code>null</code>
+ * if there is no stack frame context.
*/
private IJavaStackFrame fStackFrame;
-
+
/**
* The result of this evaluation
*/
private EvaluationResult fResult;
-
+
/**
* Collection of deployed snippet class files
*/
- private List fSnippetFiles;
-
+ private List<File> fSnippetFiles;
+
/**
- * Collection of directories created by this evaluation
- * engine.
+ * Collection of directories created by this evaluation engine.
*/
- private List fDirectories;
-
+ private List<File> fDirectories;
+
/**
- * Evaluation context for the Java project associated
- * with this evaluation engine.
+ * Evaluation context for the Java project associated with this evaluation
+ * engine.
*/
private IEvaluationContext fEvaluationContext;
-
+
/**
- * Array of modifier constants for visible local variables
- * in the current evaluation.
+ * Array of modifier constants for visible local variables in the current
+ * evaluation.
*
- * XXX: constants should be 'default' or 'final'. Where
- * are these constants defined.
+ * XXX: constants should be 'default' or 'final'. Where are these constants
+ * defined.
*/
private int[] fLocalVariableModifiers;
-
+
/**
- * Array of names of visible local variables
- * in the current evaluation.
+ * Array of names of visible local variables in the current evaluation.
*/
private String[] fLocalVariableNames;
-
+
/**
- * Array of type names of visible local variables
- * in the current evaluation.
+ * Array of type names of visible local variables in the current evaluation.
*/
private String[] fLocalVariableTypeNames;
-
+
/**
- * The 'this' object for the current evaluation
- * or <code>null</code> if there is no 'this'
- * context (static method, or not context)
+ * The 'this' object for the current evaluation or <code>null</code> if
+ * there is no 'this' context (static method, or not context)
*/
private IJavaObject fThis;
-
+
/**
* Whether this engine has been disposed.
*/
private boolean fDisposed = false;
-
+
/**
- * The number of evaluations currently being
- * performed.
+ * The number of evaluations currently being performed.
*/
private int fEvaluationCount = 0;
-
+
/**
* The name of the code snippet class to instantiate
*/
private String fCodeSnippetClassName = null;
-
- /**
+
+ /**
* Whether to hit breakpoints in the evaluation thread
*/
private boolean fHitBreakpoints = false;
-
+
/**
* Constant for empty array of <code>java.lang.String</code>
*/
private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
+
/**
* Constant for empty array of <code>int</code>
*/
private static final int[] EMPTY_INT_ARRAY = new int[0];
-
+
/**
- * Cosntructs a new evaluation engine for the given VM in the context
- * of the specified project. Class files required for the evaluation will
- * be deployed to the specified directory (which must be on the class
- * path of the VM in order for evaluation to work).
+ * Constructs a new evaluation engine for the given VM in the context of the
+ * specified project. Class files required for the evaluation will be
+ * deployed to the specified directory (which must be on the class path of
+ * the VM in order for evaluation to work).
*
- * @param project context in which to compile snippets
- * @param vm debug target in which to evaluate snippets
- * @param directory location where snippet class files will
- * be deployed for execution. The directory must exist
- */
- public LocalEvaluationEngine(IJavaProject project, IJavaDebugTarget vm, File directory) {
+ * @param project
+ * context in which to compile snippets
+ * @param vm
+ * debug target in which to evaluate snippets
+ * @param directory
+ * location where snippet class files will be deployed for
+ * execution. The directory must exist
+ */
+ public LocalEvaluationEngine(IJavaProject project, IJavaDebugTarget vm,
+ File directory) {
setJavaProject(project);
setDebugTarget(vm);
setOutputDirectory(directory);
@@ -201,60 +198,66 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
/**
* @see ICodeSnippetRequestor#acceptClassFiles(byte[][], String[][], String)
*/
- public boolean acceptClassFiles(
- byte[][] classFileBytes,
- String[][] classFileCompoundNames,
- String codeSnippetClassName) {
+ public boolean acceptClassFiles(byte[][] classFileBytes,
+ String[][] classFileCompoundNames, String codeSnippetClassName) {
+ try {
+ deploy(classFileBytes, classFileCompoundNames);
+ } catch (DebugException e) {
+ getResult().setException(e);
+ return false;
+ }
+ if (codeSnippetClassName != null) {
+ setCodeSnippetClassName(codeSnippetClassName);
try {
- deploy(classFileBytes, classFileCompoundNames);
+ getThread().runEvaluation(this, null, DebugEvent.EVALUATION,
+ getHitBreakpoints());
} catch (DebugException e) {
- getResult().setException(e);
- return false;
+ // exception handling is in evaluation runnable
}
- if (codeSnippetClassName != null) {
- setCodeSnippetClassName(codeSnippetClassName);
- try {
- getThread().runEvaluation(this, null, DebugEvent.EVALUATION, getHitBreakpoints());
- } catch (DebugException e) {
- // exception handling is in evaluation runnable
- }
- }
- return true;
+ }
+ return true;
}
-
+
public void run(IJavaThread thread, IProgressMonitor monitor) {
IJavaObject codeSnippetInstance = null;
try {
codeSnippetInstance = newInstance(getCodeSnippetClassName());
- initializeLocals(codeSnippetInstance);
- codeSnippetInstance.sendMessage(RUN_METHOD, "()V", null, getThread(), false); //$NON-NLS-1$
+ initializeLocals(codeSnippetInstance);
+ codeSnippetInstance.sendMessage(RUN_METHOD,
+ "()V", null, getThread(), false); //$NON-NLS-1$
restoreLocals(codeSnippetInstance);
-
+
// now retrieve the description of the result
IVariable[] fields = codeSnippetInstance.getVariables();
IJavaVariable resultValue = null;
IJavaVariable resultType = null;
- for (int i = 0; i < fields.length; i++) {
- if (fields[i].getName().equals(RESULT_TYPE_FIELD)) {
- resultType = (IJavaVariable)fields[i];
+ for (IVariable field : fields) {
+ if (field.getName().equals(RESULT_TYPE_FIELD)) {
+ resultType = (IJavaVariable) field;
}
- if (fields[i].getName().equals(RESULT_VALUE_FIELD)) {
- resultValue = (IJavaVariable)fields[i];
+ if (field.getName().equals(RESULT_VALUE_FIELD)) {
+ resultValue = (IJavaVariable) field;
}
}
- IJavaValue result = convertResult((IJavaClassObject)resultType.getValue(), (IJavaValue)resultValue.getValue());
+ IJavaValue result = convertResult(
+ (IJavaClassObject) resultType.getValue(),
+ (IJavaValue) resultValue.getValue());
getResult().setValue(result);
} catch (DebugException e) {
getResult().setException(e);
-
+
Throwable underlyingException = e.getStatus().getException();
if (underlyingException instanceof InvocationException) {
- ObjectReference theException = ((InvocationException)underlyingException).exception();
+ ObjectReference theException = ((InvocationException) underlyingException)
+ .exception();
if (theException != null) {
try {
try {
- IJavaObject v = (IJavaObject)JDIValue.createValue((JDIDebugTarget)getDebugTarget(), theException);
- v.sendMessage("printStackTrace", "()V", null, getThread(), false); //$NON-NLS-2$ //$NON-NLS-1$
+ IJavaObject v = (IJavaObject) JDIValue.createValue(
+ (JDIDebugTarget) getDebugTarget(),
+ theException);
+ v.sendMessage(
+ "printStackTrace", "()V", null, getThread(), false); //$NON-NLS-2$ //$NON-NLS-1$
} catch (DebugException de) {
JDIDebugPlugin.log(de);
}
@@ -264,18 +267,18 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
}
}
}
-
+
}
-
+
/**
- * Initializes the value of instance variables in the
- * 'code snippet object' that are used as placeholders
- * for locals and 'this' in the current stack frame.
+ * Initializes the value of instance variables in the 'code snippet object'
+ * that are used as place-holders for locals and 'this' in the current stack
+ * frame.
*
- * @param object instance of code snippet class that will
- * be run
- * @exception DebugException if an exception is thrown
- * accessing the given object
+ * @param object
+ * instance of code snippet class that will be run
+ * @exception DebugException
+ * if an exception is thrown accessing the given object
*/
protected void initializeLocals(IJavaObject object) throws DebugException {
IJavaVariable[] locals = null;
@@ -284,15 +287,18 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
locals = getStackFrame().getLocalVariables();
}
if (locals != null) {
- for (int i = 0; i < locals.length; i++) {
- IJavaVariable local = locals[i];
- IJavaVariable field = object.getField(LOCAL_VAR_PREFIX + local.getName(), false);
+ for (IJavaVariable local : locals) {
+ IJavaVariable field = object.getField(
+ LOCAL_VAR_PREFIX + local.getName(), false);
// internal error if field is not found
if (field == null) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize_local_variables__4, null)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize_local_variables__4,
+ null));
}
field.setValue(local.getValue());
}
@@ -302,23 +308,26 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
// internal error if field is not found
if (field == null) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize___this___context__5, null)
- );
- }
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize___this___context__5,
+ null));
+ }
field.setValue(thisObject);
}
}
-
+
/**
- * Restores the value local variables from the instance
- * variables in the 'code snippet object' that are used
- * as placeholders for locals in the current stack frame.
+ * Restores the value local variables from the instance variables in the
+ * 'code snippet object' that are used as place-holders for locals in the
+ * current stack frame.
*
- * @param object instance of code snippet class that was
- * run
- * @exception DebugException if an exception is thrown
- * accessing the given object
+ * @param object
+ * instance of code snippet class that was run
+ * @exception DebugException
+ * if an exception is thrown accessing the given object
*/
protected void restoreLocals(IJavaObject object) throws DebugException {
IJavaVariable[] locals = null;
@@ -326,16 +335,19 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
locals = getStackFrame().getLocalVariables();
}
if (locals != null) {
- for (int i = 0; i < locals.length; i++) {
- IJavaVariable local = locals[i];
- IJavaVariable field = object.getField(LOCAL_VAR_PREFIX + local.getName(), false);
+ for (IJavaVariable local : locals) {
+ IJavaVariable field = object.getField(
+ LOCAL_VAR_PREFIX + local.getName(), false);
// internal error if field is not found
if (field == null) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize_local_variables__6, null)
- );
- }
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize_local_variables__6,
+ null));
+ }
local.setValue(field.getValue());
}
}
@@ -344,13 +356,14 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
/**
* @see ICodeSnippetRequestor#acceptProblem(IMarker, String, int)
*/
- public void acceptProblem(IMarker problemMarker, String fragmentSource, int fragmentKind) {
+ public void acceptProblem(IMarker problemMarker, String fragmentSource,
+ int fragmentKind) {
if (problemMarker.getAttribute(IMarker.SEVERITY, -1) != IMarker.SEVERITY_ERROR) {
return;
}
getResult().addError(problemMarker.getAttribute(IMarker.MESSAGE, "")); //$NON-NLS-1$
}
-
+
/**
* @see IEvaluationEngine#getDebugTarget()
*/
@@ -361,7 +374,8 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
/**
* Sets the debug target in which snippets are executed.
*
- * @param debugTarget the debug target in which snippets are executed
+ * @param debugTarget
+ * the debug target in which snippets are executed
*/
private void setDebugTarget(IJavaDebugTarget debugTarget) {
fDebugTarget = debugTarget;
@@ -377,7 +391,8 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
/**
* Sets the Java project in which snippets are compiled.
*
- * @param javaProject the Java project in which snippets are compiled
+ * @param javaProject
+ * the Java project in which snippets are compiled
*/
private void setJavaProject(IJavaProject javaProject) {
fJavaProject = javaProject;
@@ -393,263 +408,298 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
}
/**
- * Sets the directory in which snippet class files are
- * deployed.
+ * Sets the directory in which snippet class files are deployed.
*
- * @param outputDirectory location to deploy snippet class files
+ * @param outputDirectory
+ * location to deploy snippet class files
*/
private void setOutputDirectory(File outputDirectory) {
fOutputDirectory = outputDirectory;
}
/**
- * @see IClassFileEvaluationEngine#evaluate(String, IJavaThread, IEvaluationListener)
+ * @see IClassFileEvaluationEngine#evaluate(String, IJavaThread,
+ * IEvaluationListener)
*/
- public void evaluate(String snippet, IJavaThread thread, IEvaluationListener listener, boolean hitBreakpoints) throws DebugException {
- checkDisposed();
- checkEvaluating();
- try {
- evaluationStarted();
- setListener(listener);
- setHitBreakpoints(hitBreakpoints);
- setResult(new EvaluationResult(this, snippet, thread));
- checkThread();
- // no receiver/stack frame context
- setThis(null);
- setLocalVariableNames(EMPTY_STRING_ARRAY);
- setLocalVariableTypeNames(EMPTY_STRING_ARRAY);
- setLocalVariableModifiers(EMPTY_INT_ARRAY);
-
- // do the evaluation in a different thread
- Runnable r = new Runnable() {
- public void run() {
- try {
- LocalEvaluationEngine.this.getEvaluationContext().
- evaluateCodeSnippet(LocalEvaluationEngine.this.getSnippet(),
- LocalEvaluationEngine.this, null);
- } catch (JavaModelException e) {
- LocalEvaluationEngine.this.getResult().setException(new DebugException(e.getStatus()));
- } finally {
- LocalEvaluationEngine.this.evaluationComplete();
- }
+ public void evaluate(String snippet, IJavaThread thread,
+ IEvaluationListener listener, boolean hitBreakpoints)
+ throws DebugException {
+ checkDisposed();
+ checkEvaluating();
+ try {
+ evaluationStarted();
+ setListener(listener);
+ setHitBreakpoints(hitBreakpoints);
+ setResult(new EvaluationResult(this, snippet, thread));
+ checkThread();
+ // no receiver/stack frame context
+ setThis(null);
+ setLocalVariableNames(EMPTY_STRING_ARRAY);
+ setLocalVariableTypeNames(EMPTY_STRING_ARRAY);
+ setLocalVariableModifiers(EMPTY_INT_ARRAY);
+
+ // do the evaluation in a different thread
+ Runnable r = new Runnable() {
+ public void run() {
+ try {
+ LocalEvaluationEngine.this
+ .getEvaluationContext()
+ .evaluateCodeSnippet(
+ LocalEvaluationEngine.this.getSnippet(),
+ LocalEvaluationEngine.this, null);
+ } catch (JavaModelException e) {
+ LocalEvaluationEngine.this.getResult().setException(
+ new DebugException(e.getStatus()));
+ } finally {
+ LocalEvaluationEngine.this.evaluationComplete();
}
- };
-
- Thread t = new Thread(r);
- t.setDaemon(true);
- t.start();
- } catch (DebugException d) {
- evaluationAborted();
- throw d;
- }
-
+ }
+ };
+
+ Thread t = new Thread(r);
+ t.setDaemon(true);
+ t.start();
+ } catch (DebugException d) {
+ evaluationAborted();
+ throw d;
+ }
+
}
/**
- * @see IEvaluationEngine#evaluate(String, IJavaStackFrame, IEvaluationListener, int)
+ * @see IEvaluationEngine#evaluate(String, IJavaStackFrame,
+ * IEvaluationListener, int)
*/
- public void evaluate(String snippet, IJavaStackFrame frame, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
- checkDisposed();
- checkEvaluating();
- try {
- evaluationStarted();
- setListener(listener);
- setStackFrame(frame);
- setHitBreakpoints(hitBreakpoints);
- setResult(new EvaluationResult(this, snippet, (IJavaThread)frame.getThread()));
- checkThread();
-
- // set up local variables and 'this' context for evaluation
- IJavaVariable[] locals = frame.getLocalVariables();
-
- List typeNames = new ArrayList(locals.length);
- List varNames = new ArrayList(locals.length);
-
- for (int i = 0; i < locals.length; i++) {
- IJavaVariable var = locals[i];
- String typeName = getTranslatedTypeName(var.getReferenceTypeName());
- if (typeName != null) {
- typeNames.add(typeName);
- varNames.add(var.getName());
- }
+ public void evaluate(String snippet, IJavaStackFrame frame,
+ IEvaluationListener listener, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException {
+ checkDisposed();
+ checkEvaluating();
+ try {
+ evaluationStarted();
+ setListener(listener);
+ setStackFrame(frame);
+ setHitBreakpoints(hitBreakpoints);
+ setResult(new EvaluationResult(this, snippet,
+ (IJavaThread) frame.getThread()));
+ checkThread();
+
+ // set up local variables and 'this' context for evaluation
+ IJavaVariable[] locals = frame.getLocalVariables();
+
+ List<String> typeNames = new ArrayList<String>(locals.length);
+ List<String> varNames = new ArrayList<String>(locals.length);
+
+ for (IJavaVariable var : locals) {
+ String typeName = getTranslatedTypeName(var
+ .getReferenceTypeName());
+ if (typeName != null) {
+ typeNames.add(typeName);
+ varNames.add(var.getName());
}
-
- setLocalVariableTypeNames((String[])typeNames.toArray(new String[typeNames.size()]));
- setLocalVariableNames((String[])varNames.toArray(new String[varNames.size()]));
- int[] modifiers = new int[typeNames.size()];
- // cannot determine if local is final, so specify as default
- Arrays.fill(modifiers, 0);
- setLocalVariableModifiers(modifiers);
- setThis(frame.getThis());
-
- final boolean isStatic = frame.isStatic();
- final boolean isConstructor = frame.isConstructor();
- final IType receivingType = JavaDebugUtils.resolveDeclaringType(frame);
- validateReceivingType(receivingType);
-
- // do the evaluation in a different thread
- Runnable r = new Runnable() {
- public void run() {
- try {
- LocalEvaluationEngine.this.getEvaluationContext().
- evaluateCodeSnippet(
- LocalEvaluationEngine.this.getSnippet(),
- LocalEvaluationEngine.this.getLocalVariableTypeNames(),
- LocalEvaluationEngine.this.getLocalVariableNames(),
- LocalEvaluationEngine.this.getLocalVariableModifiers(),
- receivingType,
- isStatic,
- isConstructor,
- LocalEvaluationEngine.this,
- null);
- } catch (JavaModelException e) {
- LocalEvaluationEngine.this.getResult().setException(new DebugException(e.getStatus()));
- } finally {
- LocalEvaluationEngine.this.evaluationComplete();
- }
+ }
+
+ setLocalVariableTypeNames(typeNames
+ .toArray(new String[typeNames.size()]));
+ setLocalVariableNames(varNames
+ .toArray(new String[varNames.size()]));
+ int[] modifiers = new int[typeNames.size()];
+ // cannot determine if local is final, so specify as default
+ Arrays.fill(modifiers, 0);
+ setLocalVariableModifiers(modifiers);
+ setThis(frame.getThis());
+
+ final boolean isStatic = frame.isStatic();
+ final boolean isConstructor = frame.isConstructor();
+ final IType receivingType = JavaDebugUtils
+ .resolveDeclaringType(frame);
+ validateReceivingType(receivingType);
+
+ // do the evaluation in a different thread
+ Runnable r = new Runnable() {
+ public void run() {
+ try {
+ LocalEvaluationEngine.this
+ .getEvaluationContext()
+ .evaluateCodeSnippet(
+ LocalEvaluationEngine.this.getSnippet(),
+ LocalEvaluationEngine.this
+ .getLocalVariableTypeNames(),
+ LocalEvaluationEngine.this
+ .getLocalVariableNames(),
+ LocalEvaluationEngine.this
+ .getLocalVariableModifiers(),
+ receivingType, isStatic, isConstructor,
+ LocalEvaluationEngine.this, null);
+ } catch (JavaModelException e) {
+ LocalEvaluationEngine.this.getResult().setException(
+ new DebugException(e.getStatus()));
+ } finally {
+ LocalEvaluationEngine.this.evaluationComplete();
}
- };
-
- Thread t = new Thread(r);
- t.setDaemon(true);
- t.start();
- } catch (DebugException d) {
- evaluationAborted();
- throw d;
- } catch (CoreException e) {
- evaluationAborted();
- throw new DebugException(e.getStatus());
- }
+ }
+ };
+
+ Thread t = new Thread(r);
+ t.setDaemon(true);
+ t.start();
+ } catch (DebugException d) {
+ evaluationAborted();
+ throw d;
+ } catch (CoreException e) {
+ evaluationAborted();
+ throw new DebugException(e.getStatus());
+ }
}
/**
- * Verifies the receiving type was resovled and is not an inner type.
+ * Verifies the receiving type was resolved and is not an inner type.
*
* @param receivingType
* @throws DebugException
*/
- private void validateReceivingType(final IType receivingType) throws DebugException {
+ private void validateReceivingType(final IType receivingType)
+ throws DebugException {
if (receivingType == null) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_determine_receiving_type_context__18, null)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_determine_receiving_type_context__18,
+ null));
}
-
+
if (receivingType.getDeclaringType() != null) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_in_context_of_inner_type_not_supported__19, null)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_in_context_of_inner_type_not_supported__19,
+ null));
}
}
-
+
/**
- * @see IEvaluationEngine#evaluate(String, IJavaObject, IJavaThread, IEvaluationListener, int)
+ * @see IEvaluationEngine#evaluate(String, IJavaObject, IJavaThread,
+ * IEvaluationListener, int)
*/
- public void evaluate(String snippet, IJavaObject thisContext, IJavaThread thread, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
- checkDisposed();
- checkEvaluating();
- try {
- evaluationStarted();
- setListener(listener);
- setHitBreakpoints(hitBreakpoints);
- setResult(new EvaluationResult(this, snippet, thread));
- checkThread();
-
- // no locals
- setLocalVariableTypeNames(new String[0]);
- setLocalVariableNames(new String[0]);
- setLocalVariableModifiers(new int[0]);
-
- setThis(thisContext);
-
- final boolean isStatic = false;
- final boolean isConstructor = false;
- final IType receivingType = JavaDebugUtils.resolveType(thisContext.getJavaType());
- validateReceivingType(receivingType);
-
- // do the evaluation in a different thread
- Runnable r = new Runnable() {
- public void run() {
- try {
- LocalEvaluationEngine.this.getEvaluationContext().
- evaluateCodeSnippet(
- LocalEvaluationEngine.this.getSnippet(),
- LocalEvaluationEngine.this.getLocalVariableTypeNames(),
- LocalEvaluationEngine.this.getLocalVariableNames(),
- LocalEvaluationEngine.this.getLocalVariableModifiers(),
- receivingType,
- isStatic,
- isConstructor,
- LocalEvaluationEngine.this,
- null);
- } catch (JavaModelException e) {
- LocalEvaluationEngine.this.getResult().setException(new DebugException(e.getStatus()));
- } finally {
- LocalEvaluationEngine.this.evaluationComplete();
- }
+ public void evaluate(String snippet, IJavaObject thisContext,
+ IJavaThread thread, IEvaluationListener listener,
+ int evaluationDetail, boolean hitBreakpoints) throws DebugException {
+ checkDisposed();
+ checkEvaluating();
+ try {
+ evaluationStarted();
+ setListener(listener);
+ setHitBreakpoints(hitBreakpoints);
+ setResult(new EvaluationResult(this, snippet, thread));
+ checkThread();
+
+ // no locals
+ setLocalVariableTypeNames(new String[0]);
+ setLocalVariableNames(new String[0]);
+ setLocalVariableModifiers(new int[0]);
+
+ setThis(thisContext);
+
+ final boolean isStatic = false;
+ final boolean isConstructor = false;
+ final IType receivingType = JavaDebugUtils.resolveType(thisContext
+ .getJavaType());
+ validateReceivingType(receivingType);
+
+ // do the evaluation in a different thread
+ Runnable r = new Runnable() {
+ public void run() {
+ try {
+ LocalEvaluationEngine.this
+ .getEvaluationContext()
+ .evaluateCodeSnippet(
+ LocalEvaluationEngine.this.getSnippet(),
+ LocalEvaluationEngine.this
+ .getLocalVariableTypeNames(),
+ LocalEvaluationEngine.this
+ .getLocalVariableNames(),
+ LocalEvaluationEngine.this
+ .getLocalVariableModifiers(),
+ receivingType, isStatic, isConstructor,
+ LocalEvaluationEngine.this, null);
+ } catch (JavaModelException e) {
+ LocalEvaluationEngine.this.getResult().setException(
+ new DebugException(e.getStatus()));
+ } finally {
+ LocalEvaluationEngine.this.evaluationComplete();
}
- };
-
- Thread t = new Thread(r);
- t.setDaemon(true);
- t.start();
- } catch (DebugException d) {
- evaluationAborted();
- throw d;
- } catch (CoreException e) {
- evaluationAborted();
- throw new DebugException(e.getStatus());
- }
+ }
+ };
+
+ Thread t = new Thread(r);
+ t.setDaemon(true);
+ t.start();
+ } catch (DebugException d) {
+ evaluationAborted();
+ throw d;
+ } catch (CoreException e) {
+ evaluationAborted();
+ throw new DebugException(e.getStatus());
+ }
}
-
+
/**
- * Throws an exception if this engine has already been
- * disposed.
+ * Throws an exception if this engine has already been disposed.
*
- * @exception DebugException if this engine has been disposed
+ * @exception DebugException
+ * if this engine has been disposed
*/
protected void checkDisposed() throws DebugException {
if (isDisposed()) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___evaluation_context_has_been_disposed__7, null)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___evaluation_context_has_been_disposed__7,
+ null));
}
}
-
+
/**
- * Throws an exception if this engine is already in an
- * evaluation.
+ * Throws an exception if this engine is already in an evaluation.
*
- * @exception DebugException if this engine is currently
- * performing an evaluation
+ * @exception DebugException
+ * if this engine is currently performing an evaluation
*/
protected void checkEvaluating() throws DebugException {
if (isEvaluating()) {
- throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, "Cannot perform nested evaluations.", null) //$NON-NLS-1$
+ throw new DebugException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ "Cannot perform nested evaluations.", null) //$NON-NLS-1$
);
}
- }
-
+ }
+
/**
- * Throws an exception if this engine's current evaluation
- * thread is not suspended.
+ * Throws an exception if this engine's current evaluation thread is not
+ * suspended.
*
- * @exception DebugException if this engine's current evaluation
- * thread is not suspended
+ * @exception DebugException
+ * if this engine's current evaluation thread is not
+ * suspended
*/
protected void checkThread() throws DebugException {
if (!getThread().isSuspended()) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___evaluation_thread_must_be_suspended__8, null)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___evaluation_thread_must_be_suspended__8,
+ null));
}
- }
+ }
/**
* Deletes deployed class files, and clears state.
@@ -664,33 +714,43 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
// wait for evaluation to complete
return;
}
- List snippetFiles = getSnippetFiles();
- Iterator iter = snippetFiles.iterator();
+ List<File> snippetFiles = getSnippetFiles();
+ Iterator<File> iter = snippetFiles.iterator();
while (iter.hasNext()) {
- File file = (File)iter.next();
+ File file = (File) iter.next();
if (file.exists()) {
- if (CODE_SNIPPET_NAME.equals(file.getName()) && ENGINE_COUNT > 0) {
- continue; //do not delete the common file for other engines
+ if (CODE_SNIPPET_NAME.equals(file.getName())
+ && ENGINE_COUNT > 0) {
+ continue; // do not delete the common file for other engines
}
if (!file.delete()) {
- JDIDebugPlugin.log(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.REQUEST_FAILED,
- MessageFormat.format("Unable to delete temporary evaluation class file {0}.", new String[] {file.getAbsolutePath()}), null) //$NON-NLS-1$
- );
+ JDIDebugPlugin
+ .log(new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ MessageFormat
+ .format("Unable to delete temporary evaluation class file {0}.", new Object[] { file.getAbsolutePath() }), null) //$NON-NLS-1$
+ );
}
}
}
- List directories = getDirectories();
+ List<File> directories = getDirectories();
// remove directories in bottom up order
int i = directories.size() - 1;
while (i >= 0) {
- File dir = (File)directories.get(i);
- String[] listing= dir.list();
- if (dir.exists() && listing != null && listing.length == 0 && !dir.delete()) {
- JDIDebugPlugin.log(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.REQUEST_FAILED,
- MessageFormat.format("Unable to delete temporary evaluation directory {0}.", new String[] {dir.getAbsolutePath()}), null) //$NON-NLS-1$
- );
+ File dir = directories.get(i);
+ String[] listing = dir.list();
+ if (dir.exists() && listing != null && listing.length == 0
+ && !dir.delete()) {
+ JDIDebugPlugin
+ .log(new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ MessageFormat
+ .format("Unable to delete temporary evaluation directory {0}.", new Object[] { dir.getAbsolutePath() }), null) //$NON-NLS-1$
+ );
}
i--;
}
@@ -701,7 +761,6 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
setResult(null);
setEvaluationContext(null);
}
-
/**
* Resets this engine for another evaluation.
@@ -711,35 +770,32 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
setStackFrame(null);
setListener(null);
}
-
+
/**
- * Returns the listener to notify when the current
- * evaluation is complete.
+ * Returns the listener to notify when the current evaluation is complete.
*
- * @return the listener to notify when the current
- * evaluation is complete
+ * @return the listener to notify when the current evaluation is complete
*/
protected IEvaluationListener getListener() {
return fListener;
}
/**
- * Sets the listener to notify when the current
- * evaluation is complete.
+ * Sets the listener to notify when the current evaluation is complete.
*
- * @param listener the listener to notify when the current
- * evaluation is complete
+ * @param listener
+ * the listener to notify when the current evaluation is complete
*/
private void setListener(IEvaluationListener listener) {
fListener = listener;
}
/**
- * Returns the stack frame context for the current
- * evaluation, or <code>null</code> if none.
+ * Returns the stack frame context for the current evaluation, or
+ * <code>null</code> if none.
*
- * @return the stack frame context for the current
- * evaluation, or <code>null</code> if none
+ * @return the stack frame context for the current evaluation, or
+ * <code>null</code> if none
*/
protected IJavaStackFrame getStackFrame() {
return fStackFrame;
@@ -748,24 +804,22 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
/**
* Sets the stack frame context for the current evaluation.
*
- * @param stackFrame stack frame context or <code>null</code>
- * if none
+ * @param stackFrame
+ * stack frame context or <code>null</code> if none
*/
private void setStackFrame(IJavaStackFrame stackFrame) {
fStackFrame = stackFrame;
}
/**
- * Returns the thread in which the current evaluation is
- * to be executed.
+ * Returns the thread in which the current evaluation is to be executed.
*
- * @return the thread in which the current evaluation is
- * to be executed
+ * @return the thread in which the current evaluation is to be executed
*/
protected IJavaThread getThread() {
return getResult().getThread();
}
-
+
/**
* Returns the code snippet being evaluated.
*
@@ -773,7 +827,7 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
*/
protected String getSnippet() {
return getResult().getSnippet();
- }
+ }
/**
* Returns the current evaluation result.
@@ -787,30 +841,31 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
/**
* Sets the current evaluation result.
*
- * @param result the current evaluation result
+ * @param result
+ * the current evaluation result
*/
private void setResult(EvaluationResult result) {
fResult = result;
}
-
+
/**
- * Deploys the given class files to this engine's
- * output location, and adds the files to this
- * engines list of temporary files to be deleted
- * when disposed.
- *
- * @exception DebugException if this fails due to a
- * lower level exception.
+ * Deploys the given class files to this engine's output location, and adds
+ * the files to this engines list of temporary files to be deleted when
+ * disposed.
+ *
+ * @exception DebugException
+ * if this fails due to a lower level exception.
*/
- protected void deploy(byte[][] classFiles, String[][] classFileNames) throws DebugException {
+ protected void deploy(byte[][] classFiles, String[][] classFileNames)
+ throws DebugException {
for (int i = 0; i < classFiles.length; i++) {
String[] compoundName = classFileNames[i];
- //create required folders
+ // create required folders
File dir = LocalEvaluationEngine.this.getOutputDirectory();
try {
String pkgDirName = dir.getCanonicalPath();
for (int j = 0; j < (compoundName.length - 1); j++) {
- pkgDirName += File.separator + compoundName[j];
+ pkgDirName += File.separator + compoundName[j];
File pkgDir = new File(pkgDirName);
if (!pkgDir.exists()) {
pkgDir.mkdir();
@@ -828,47 +883,51 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
LocalEvaluationEngine.this.addSnippetFile(classFile);
} catch (IOException e) {
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.REQUEST_FAILED,
- MessageFormat.format(EvaluationMessages.LocalEvaluationEngine__0__occurred_deploying_class_file_for_evaluation_9, new String[] {e.toString()}), e)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ MessageFormat
+ .format(EvaluationMessages.LocalEvaluationEngine__0__occurred_deploying_class_file_for_evaluation_9,
+ new Object[] { e.toString() }),
+ e));
}
- }
- }
-
+ }
+ }
+
/**
- * Adds the given file to this engine's collection
- * of deployed snippet class files, which are to
- * be deleted when this engine is diposed.
+ * Adds the given file to this engine's collection of deployed snippet class
+ * files, which are to be deleted when this engine is disposed.
*
- * @param File snippet class file
+ * @param File
+ * snippet class file
*/
private void addSnippetFile(File file) {
if (fSnippetFiles == null) {
- fSnippetFiles = new ArrayList();
+ fSnippetFiles = new ArrayList<File>();
}
fSnippetFiles.add(file);
}
-
+
/**
- * Adds the given file to this engine's collection
- * of cerated directories, which are to
- * be deleted when this engine is diposed.
+ * Adds the given file to this engine's collection of created directories,
+ * which are to be deleted when this engine is disposed.
*
- * @param file directory created for class file deployment
+ * @param file
+ * directory created for class file deployment
*/
private void addDirectory(File file) {
if (fDirectories == null) {
- fDirectories = new ArrayList();
+ fDirectories = new ArrayList<File>();
}
fDirectories.add(file);
- }
+ }
/**
- * Returns an evaluation context for this evaluation
- * engine. An evaluation context is associted with a
- * specific Java project. The evaluation context is
- * created lazily on the first access.
- *
+ * Returns an evaluation context for this evaluation engine. An evaluation
+ * context is associated with a specific Java project. The evaluation context
+ * is created lazily on the first access.
+ *
* @return evaluation context
*/
protected IEvaluationContext getEvaluationContext() {
@@ -877,62 +936,59 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
}
return fEvaluationContext;
}
-
+
/**
- * Sets the evaluation context for this evaluation
- * engine.
- *
- * @param context evaluation context
+ * Sets the evaluation context for this evaluation engine.
+ *
+ * @param context
+ * evaluation context
*/
private void setEvaluationContext(IEvaluationContext context) {
fEvaluationContext = context;
}
-
/**
- * Returns a collection of snippet class file deployed by
- * this evaluation engine, possibly empty.
+ * Returns a collection of snippet class file deployed by this evaluation
+ * engine, possibly empty.
*
* @return deployed class files
*/
- protected List getSnippetFiles() {
+ protected List<File> getSnippetFiles() {
if (fSnippetFiles == null) {
return Collections.EMPTY_LIST;
}
return fSnippetFiles;
}
-
+
/**
- * Returns a collection of directories created by
- * this evaluation engine, possibly empty.
+ * Returns a collection of directories created by this evaluation engine,
+ * possibly empty.
*
* @return directories created when deploying class files
*/
- protected List getDirectories() {
+ protected List<File> getDirectories() {
if (fDirectories == null) {
return Collections.EMPTY_LIST;
- }
+ }
return fDirectories;
- }
-
+ }
+
/**
- * Returns whether this evaluation engine has been
- * disposed.
+ * Returns whether this evaluation engine has been disposed.
*
- * @return whether this evaluation engine has been
- * disposed
+ * @return whether this evaluation engine has been disposed
*/
protected boolean isDisposed() {
return fDisposed;
}
-
+
/**
- * The evaluation is complete. Notify the current listener
- * and reset for the next evaluation.
+ * The evaluation is complete. Notify the current listener and reset for the
+ * next evaluation.
*/
protected void evaluationComplete() {
// only notify if plug-in not yet shutdown (bug# 8693)
- if (JDIDebugPlugin.getDefault() != null) {
+ if (JDIDebugPlugin.getDefault() != null) {
getListener().evaluationComplete(getResult());
}
evaluationEnded();
@@ -941,16 +997,16 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
// if the engine was disposed during an evaluation
// do the cleanup now
dispose();
- }
+ }
}
-
+
/**
* Increments the evaluation counter.
*/
private void evaluationStarted() {
fEvaluationCount++;
}
-
+
/**
* Decrements the evaluation counter.
*/
@@ -958,20 +1014,18 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
if (fEvaluationCount > 0) {
fEvaluationCount--;
}
- }
-
+ }
+
/**
- * Returns whether this engine is currently in the
- * midst of an evaluation.
+ * Returns whether this engine is currently in the midst of an evaluation.
*/
protected boolean isEvaluating() {
return fEvaluationCount > 0;
}
-
+
/**
- * Called when an evaluation is aborted due to an
- * exception. Decrements the evalution count, and
- * disposes this engine if the target VM disconnected
+ * Called when an evaluation is aborted due to an exception. Decrements the
+ * evaluation count, and disposes this engine if the target VM disconnected
* or terminated during the evaluation attempt.
*/
private void evaluationAborted() {
@@ -980,23 +1034,25 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
// if the engine was disposed during an evaluation
// do the cleanup now
dispose();
- }
+ }
}
-
+
/**
- * Constructs and returns a new instance of the specified
- * class on the target VM.
+ * Constructs and returns a new instance of the specified class on the
+ * target VM.
*
- * @param className fully qualified class name
+ * @param className
+ * fully qualified class name
* @return a new instance on the target, as an <code>IJavaValue</code>
- * @exception DebugException if creation fails
+ * @exception DebugException
+ * if creation fails
*/
protected IJavaObject newInstance(String className) throws DebugException {
IJavaObject object = null;
IJavaClassType clazz = null;
IJavaType[] types = getDebugTarget().getJavaTypes(className);
if (types != null && types.length > 0) {
- clazz = (IJavaClassType)types[0];
+ clazz = (IJavaClassType) types[0];
}
if (clazz == null) {
// The class is not loaded on the target VM.
@@ -1004,48 +1060,59 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
types = getDebugTarget().getJavaTypes("java.lang.Class"); //$NON-NLS-1$
IJavaClassType classClass = null;
if (types != null && types.length > 0) {
- classClass = (IJavaClassType)types[0];
+ classClass = (IJavaClassType) types[0];
}
if (classClass == null) {
// unable to load the class
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_instantiate_code_snippet_class__11, null)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_instantiate_code_snippet_class__11,
+ null));
}
- IJavaValue[] args = new IJavaValue[] {getDebugTarget().newValue(className)};
- IJavaObject classObject = (IJavaObject)classClass.sendMessage("forName", "(Ljava/lang/String;)Ljava/lang/Class;", args, getThread()); //$NON-NLS-2$ //$NON-NLS-1$
- object = (IJavaObject)classObject.sendMessage("newInstance", "()Ljava/lang/Object;", null, getThread(), false); //$NON-NLS-2$ //$NON-NLS-1$
+ IJavaValue[] args = new IJavaValue[] { getDebugTarget().newValue(
+ className) };
+ IJavaObject classObject = (IJavaObject) classClass
+ .sendMessage(
+ "forName", "(Ljava/lang/String;)Ljava/lang/Class;", args, getThread()); //$NON-NLS-2$ //$NON-NLS-1$
+ object = (IJavaObject) classObject
+ .sendMessage(
+ "newInstance", "()Ljava/lang/Object;", null, getThread(), false); //$NON-NLS-2$ //$NON-NLS-1$
} else {
object = clazz.newInstance("<init>", null, getThread()); //$NON-NLS-1$
}
return object;
}
-
+
/**
- * Interpretts and returns the result of the running the snippet
- * class file. The type of the result is described by an instance of
- * <code>java.lang.Class</code>. The value is interpretted based
- * on the result type.
+ * Interprets and returns the result of the running the snippet class file.
+ * The type of the result is described by an instance of
+ * <code>java.lang.Class</code>. The value is interpreted based on the
+ * result type.
* <p>
- * Objects as well as primitve data types (boolean, int, etc.),
- * have class objects, which are created by the VM. If the class object
- * represents a primitive data type, then the associated value
- * is stored in an instance of its "object" class. For example, when
- * the result type is the class object for <code>int</code>, the result
- * object is an instance of <code>java.lang.Integer</code>, and the
- * actual <code>int</code> is stored in the </code>intValue()</code>.
- * When the result type is the class object for <code>java.lang.Integer</code>
- * the result object is an instance of <code>java.lang.Integer</code>,
- * to be interpretted as a <ocde>java.lang.Integer</code>.
+ * Objects as well as primitive data types (boolean, int, etc.), have class
+ * objects, which are created by the VM. If the class object represents a
+ * primitive data type, then the associated value is stored in an instance
+ * of its "object" class. For example, when the result type is the class
+ * object for <code>int</code>, the result object is an instance of
+ * <code>java.lang.Integer</code>, and the actual <code>int</code> is stored
+ * in the </code>intValue()</code>. When the result type is the class object
+ * for <code>java.lang.Integer</code> the result object is an instance of
+ * <code>java.lang.Integer</code>, to be interpreted as a
+ * <code>java.lang.Integer</code>.
* </p>
*
- * @param resultType the class of the result
- * @param resultValue the value of ther result, to be interpretted
- * based on resultType
- * @return the result of running the code snipped class file
- */
- protected IJavaValue convertResult(IJavaClassObject resultType, IJavaValue result) throws DebugException {
+ * @param resultType
+ * the class of the result
+ * @param resultValue
+ * the value of the result, to be interpreted based on
+ * resultType
+ * @return the result of running the code snippet class file
+ */
+ protected IJavaValue convertResult(IJavaClassObject resultType,
+ IJavaValue result) throws DebugException {
if (resultType == null) {
// there was an exception or compilation problem - no result
return null;
@@ -1062,35 +1129,38 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
// null result
return result;
}
-
+
if (sig.length() == 1) {
// primitive type - find the instance variable with the
// signature of the result type we are looking for
IVariable[] vars = result.getVariables();
IJavaVariable var = null;
- for (int i = 0; i < vars.length; i++) {
- IJavaVariable jv = (IJavaVariable)vars[i];
+ for (IVariable var2 : vars) {
+ IJavaVariable jv = (IJavaVariable) var2;
if (!jv.isStatic() && jv.getSignature().equals(sig)) {
var = jv;
break;
}
}
if (var != null) {
- return (IJavaValue)var.getValue();
+ return (IJavaValue) var.getValue();
}
} else {
// an object
return result;
}
throw new DebugException(
- new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.REQUEST_FAILED, EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___internal_error_retreiving_result__17, null)
- );
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___internal_error_retreiving_result__17,
+ null));
}
-
+
/**
- * Returns the modifiers of the local variables
- * visible in this evaluation, possibly empty.
+ * Returns the modifiers of the local variables visible in this evaluation,
+ * possibly empty.
*
* @return array of modifiers
*/
@@ -1099,90 +1169,95 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
}
/**
- * Sets the modifiers of the local variables
- * visible in this evaluation, possibly empty.
+ * Sets the modifiers of the local variables visible in this evaluation,
+ * possibly empty.
*
- * @param localVariableModifiers array of modifiers
+ * @param localVariableModifiers
+ * array of modifiers
*/
private void setLocalVariableModifiers(int[] localVariableModifiers) {
fLocalVariableModifiers = localVariableModifiers;
}
-
+
/**
- * Returns the names of the local variables
- * visible in this evaluation, possibly empty.
+ * Returns the names of the local variables visible in this evaluation,
+ * possibly empty.
*
- * @param array of names
- */
+ * @param array
+ * of names
+ */
private String[] getLocalVariableNames() {
return fLocalVariableNames;
}
-
+
/**
- * Sets the names of the local variables
- * visible in this evaluation, possibly empty.
+ * Sets the names of the local variables visible in this evaluation,
+ * possibly empty.
*
- * @param localVariableNames array of names
+ * @param localVariableNames
+ * array of names
*/
private void setLocalVariableNames(String[] localVariableNames) {
fLocalVariableNames = localVariableNames;
}
/**
- * Returns the type names of the local variables
- * visible in this evaluation, possibly empty.
+ * Returns the type names of the local variables visible in this evaluation,
+ * possibly empty.
*
- * @param array of type names
+ * @param array
+ * of type names
*/
private String[] getLocalVariableTypeNames() {
return fLocalVariableTypeNames;
}
/**
- * Sets the type names of the local variables
- * visible in this evaluation, possibly empty.
+ * Sets the type names of the local variables visible in this evaluation,
+ * possibly empty.
*
- * @param localVariableTypeNames array of type names
+ * @param localVariableTypeNames
+ * array of type names
*/
private void setLocalVariableTypeNames(String[] localVariableTypeNames) {
fLocalVariableTypeNames = localVariableTypeNames;
- }
-
+ }
+
/**
- * Sets the receiver context for the associated evaluation,
- * possibly <code>null</code> if the evaluation is
- * in the context of a static method or there is
- * no object context.
+ * Sets the receiver context for the associated evaluation, possibly
+ * <code>null</code> if the evaluation is in the context of a static method
+ * or there is no object context.
*
- * @param thisObject the receiver content of the
- * associated evaluation, or <code>null</code>
+ * @param thisObject
+ * the receiver content of the associated evaluation, or
+ * <code>null</code>
*/
private void setThis(IJavaObject thisObject) {
fThis = thisObject;
}
-
+
/**
- * Returns the receiver context for the associated evaluation,
- * or <code>null</code> if the evaluation is
- * in the context of a static method or there is
- * no object context.
+ * Returns the receiver context for the associated evaluation, or
+ * <code>null</code> if the evaluation is in the context of a static method
+ * or there is no object context.
*
- * @return the receiver context of the associated
- * evaluation or <code>null</code>
+ * @return the receiver context of the associated evaluation or
+ * <code>null</code>
*/
private IJavaObject getThis() {
return fThis;
}
-
+
/**
- * Returns a copy of the type name with '$' replaced by
- * '.', or returns <code>null</code> if the given type
- * name refers to an anonymous inner class.
+ * Returns a copy of the type name with '$' replaced by '.', or returns
+ * <code>null</code> if the given type name refers to an anonymous inner
+ * class.
*
- * @param typeName a fully qualified type name
- * @return a copy of the type name with '$' replaced by
- * '.', or returns <code>null</code> if the given type
- * name refers to an anonymous inner class.
+ * @param typeName
+ * a fully qualified type name
+ * @return a copy of the type name with '$' replaced by '.', or returns
+ * <code>null</code> if the given type name refers to an anonymous
+ * inner class.
*/
protected String getTranslatedTypeName(String typeName) {
int index = typeName.lastIndexOf('$');
@@ -1203,30 +1278,30 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
}
/**
- * Returns an array of simple type names that are
- * part of the given type's qualified name. For
- * example, if the given name is <code>x.y.A$B</code>,
+ * Returns an array of simple type names that are part of the given type's
+ * qualified name. For example, if the given name is <code>x.y.A$B</code>,
* an array with <code>["A", "B"]</code> is returned.
*
- * @param typeName fully qualified type name
+ * @param typeName
+ * fully qualified type name
* @return array of nested type names
*/
protected String[] getNestedTypeNames(String typeName) {
int index = typeName.lastIndexOf('.');
if (index >= 0) {
- typeName= typeName.substring(index + 1);
+ typeName = typeName.substring(index + 1);
}
index = typeName.indexOf('$');
- ArrayList list = new ArrayList(1);
+ ArrayList<String> list = new ArrayList<String>(1);
while (index >= 0) {
list.add(typeName.substring(0, index));
typeName = typeName.substring(index + 1);
index = typeName.indexOf('$');
}
list.add(typeName);
- return (String[])list.toArray(new String[list.size()]);
+ return list.toArray(new String[list.size()]);
}
-
+
/**
* @see IClassFileEvaluationEngine#getImports()
*/
@@ -1240,25 +1315,24 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
public void setImports(String[] imports) {
getEvaluationContext().setImports(imports);
}
-
+
/**
- * Sets the name of the code snippet to instantiate
- * to run the current evaluation.
+ * Sets the name of the code snippet to instantiate to run the current
+ * evaluation.
*
- * @param name the name of the deployed code snippet
- * to instantiate and run
+ * @param name
+ * the name of the deployed code snippet to instantiate and run
*/
private void setCodeSnippetClassName(String name) {
fCodeSnippetClassName = name;
}
/**
- * Returns the name of the code snippet to instantiate
- * to run the current evaluation.
+ * Returns the name of the code snippet to instantiate to run the current
+ * evaluation.
*
- * @return the name of the deployed code snippet
- * to instantiate and run
- */
+ * @return the name of the deployed code snippet to instantiate and run
+ */
protected String getCodeSnippetClassName() {
return fCodeSnippetClassName;
}
@@ -1281,7 +1355,9 @@ public class LocalEvaluationEngine implements IClassFileEvaluationEngine, ICodeS
/**
* Sets whether to hit breakpoints in the evaluation thread.
- * @param hit whether to hit breakpoints in the evaluation thread
+ *
+ * @param hit
+ * whether to hit breakpoints in the evaluation thread
*/
private void setHitBreakpoints(boolean hit) {
fHitBreakpoints = hit;
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java
index 741260ea2..5f2651299 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import java.util.Date;
import java.util.HashSet;
import java.util.Map;
@@ -64,44 +63,52 @@ import com.sun.jdi.InvocationException;
import com.sun.jdi.ObjectReference;
public class ASTEvaluationEngine implements IAstEvaluationEngine {
-
+
private IJavaProject fProject;
-
+
private IJavaDebugTarget fDebugTarget;
-
+
/**
* Regex to find occurrences of 'this' in a code snippet
*/
- private static Pattern fgThisPattern = Pattern.compile("(.*[^a-zA-Z0-9]+|^)(this)([^a-zA-Z0-9]+|$).*"); //$NON-NLS-1$
-
+ private static Pattern fgThisPattern = Pattern
+ .compile("(.*[^a-zA-Z0-9]+|^)(this)([^a-zA-Z0-9]+|$).*"); //$NON-NLS-1$
+
/**
- * Filters variable change events during an evaluation to avoid refreshing the variables
- * view until done.
+ * Filters variable change events during an evaluation to avoid refreshing
+ * the variables view until done.
*/
class EventFilter implements IDebugEventFilter {
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventFilter#filterDebugEvents(org.eclipse.debug.core.DebugEvent[])
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.IDebugEventFilter#filterDebugEvents(org.eclipse
+ * .debug.core.DebugEvent[])
*/
public DebugEvent[] filterDebugEvents(DebugEvent[] events) {
if (events.length == 1) {
DebugEvent event = events[0];
- if (event.getSource() instanceof IJavaVariable && event.getKind() == DebugEvent.CHANGE) {
- if (((IJavaVariable)event.getSource()).getDebugTarget().equals(getDebugTarget())) {
+ if (event.getSource() instanceof IJavaVariable
+ && event.getKind() == DebugEvent.CHANGE) {
+ if (((IJavaVariable) event.getSource()).getDebugTarget()
+ .equals(getDebugTarget())) {
return null;
}
}
}
return events;
}
-
+
}
-
- public ASTEvaluationEngine(IJavaProject project, IJavaDebugTarget debugTarget) {
+
+ public ASTEvaluationEngine(IJavaProject project,
+ IJavaDebugTarget debugTarget) {
setJavaProject(project);
setDebugTarget(debugTarget);
}
-
+
public void setJavaProject(IJavaProject project) {
fProject = project;
}
@@ -110,30 +117,50 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
fDebugTarget = debugTarget;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IEvaluationEngine#evaluate(java.lang.String, org.eclipse.jdt.debug.core.IJavaStackFrame, org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IEvaluationEngine#evaluate(java.lang.String,
+ * org.eclipse.jdt.debug.core.IJavaStackFrame,
+ * org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
*/
- public void evaluate(String snippet, IJavaStackFrame frame, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
+ public void evaluate(String snippet, IJavaStackFrame frame,
+ IEvaluationListener listener, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException {
traceCaller(snippet, frame.getThread());
- checkInterface(frame);
- ICompiledExpression expression= getCompiledExpression(snippet, frame);
- evaluateExpression(expression, frame, listener, evaluationDetail, hitBreakpoints);
+ checkInterface(frame);
+ ICompiledExpression expression = getCompiledExpression(snippet, frame);
+ evaluateExpression(expression, frame, listener, evaluationDetail,
+ hitBreakpoints);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IEvaluationEngine#evaluate(java.lang.String, org.eclipse.jdt.debug.core.IJavaObject, org.eclipse.jdt.debug.core.IJavaThread, org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IEvaluationEngine#evaluate(java.lang.String,
+ * org.eclipse.jdt.debug.core.IJavaObject,
+ * org.eclipse.jdt.debug.core.IJavaThread,
+ * org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
*/
- public void evaluate(String snippet, IJavaObject thisContext, IJavaThread thread, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
+ public void evaluate(String snippet, IJavaObject thisContext,
+ IJavaThread thread, IEvaluationListener listener,
+ int evaluationDetail, boolean hitBreakpoints) throws DebugException {
traceCaller(snippet, thread);
- ICompiledExpression expression= getCompiledExpression(snippet, thisContext);
- evaluateExpression(expression, thisContext, thread, listener, evaluationDetail, hitBreakpoints);
+ ICompiledExpression expression = getCompiledExpression(snippet,
+ thisContext);
+ evaluateExpression(expression, thisContext, thread, listener,
+ evaluationDetail, hitBreakpoints);
}
-
+
/**
* Writes a stack dump to trace the calling thread.
*
- * @param snippet expression to evaluate
- * @param thread thread to evaluate in
+ * @param snippet
+ * expression to evaluate
+ * @param thread
+ * thread to evaluate in
*/
private void traceCaller(String snippet, IThread thread) {
if (JDIDebugOptions.DEBUG_AST_EVAL_THREAD_TRACE) {
@@ -154,68 +181,114 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
System.out.flush();
Thread.dumpStack();
}
- }
-
- /**
- * Checks if the stack frame is declared in an interface an aborts
- * if so.
- *
- * @param frame stack frame
- * @throws DebugException if declaring type is an interface
- */
- private void checkInterface(IJavaStackFrame frame) throws DebugException {
- if (frame.getReferenceType() instanceof IJavaInterfaceType) {
- IStatus status = new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.REQUEST_FAILED,
- EvaluationEngineMessages.ASTEvaluationEngine_0, null);
- throw new DebugException(status);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine#evaluateExpression(org.eclipse.jdt.debug.eval.ICompiledExpression, org.eclipse.jdt.debug.core.IJavaStackFrame, org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
+ }
+
+ /**
+ * Checks if the stack frame is declared in an interface an aborts if so.
+ *
+ * @param frame
+ * stack frame
+ * @throws DebugException
+ * if declaring type is an interface
*/
- public void evaluateExpression(ICompiledExpression expression, IJavaStackFrame frame, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
+ private void checkInterface(IJavaStackFrame frame) throws DebugException {
+ if (frame.getReferenceType() instanceof IJavaInterfaceType) {
+ IStatus status = new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ EvaluationEngineMessages.ASTEvaluationEngine_0, null);
+ throw new DebugException(status);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IAstEvaluationEngine#evaluateExpression(org
+ * .eclipse.jdt.debug.eval.ICompiledExpression,
+ * org.eclipse.jdt.debug.core.IJavaStackFrame,
+ * org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
+ */
+ public void evaluateExpression(ICompiledExpression expression,
+ IJavaStackFrame frame, IEvaluationListener listener,
+ int evaluationDetail, boolean hitBreakpoints) throws DebugException {
traceCaller(expression.getSnippet(), frame.getThread());
RuntimeContext context = new RuntimeContext(getJavaProject(), frame);
- doEvaluation(expression, context, (IJavaThread)frame.getThread(), listener, evaluationDetail, hitBreakpoints);
+ doEvaluation(expression, context, (IJavaThread) frame.getThread(),
+ listener, evaluationDetail, hitBreakpoints);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine#evaluateExpression(org.eclipse.jdt.debug.eval.ICompiledExpression, org.eclipse.jdt.debug.core.IJavaObject, org.eclipse.jdt.debug.core.IJavaThread, org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IAstEvaluationEngine#evaluateExpression(org
+ * .eclipse.jdt.debug.eval.ICompiledExpression,
+ * org.eclipse.jdt.debug.core.IJavaObject,
+ * org.eclipse.jdt.debug.core.IJavaThread,
+ * org.eclipse.jdt.debug.eval.IEvaluationListener, int, boolean)
*/
- public void evaluateExpression(ICompiledExpression expression, IJavaObject thisContext, IJavaThread thread, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
+ public void evaluateExpression(ICompiledExpression expression,
+ IJavaObject thisContext, IJavaThread thread,
+ IEvaluationListener listener, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException {
traceCaller(expression.getSnippet(), thread);
IRuntimeContext context = null;
if (thisContext instanceof IJavaArray) {
- context = new ArrayRuntimeContext((IJavaArray) thisContext, thread, getJavaProject());
+ context = new ArrayRuntimeContext((IJavaArray) thisContext, thread,
+ getJavaProject());
} else {
- context = new JavaObjectRuntimeContext(thisContext, getJavaProject(), thread);
+ context = new JavaObjectRuntimeContext(thisContext,
+ getJavaProject(), thread);
}
- doEvaluation(expression, context, thread, listener, evaluationDetail, hitBreakpoints);
+ doEvaluation(expression, context, thread, listener, evaluationDetail,
+ hitBreakpoints);
}
-
+
/**
- * Evaluates the given expression in the given thread and the given runtime context.
+ * Evaluates the given expression in the given thread and the given runtime
+ * context.
*/
- private void doEvaluation(ICompiledExpression expression, IRuntimeContext context, IJavaThread thread, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
+ private void doEvaluation(ICompiledExpression expression,
+ IRuntimeContext context, IJavaThread thread,
+ IEvaluationListener listener, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException {
if (expression instanceof InstructionSequence) {
- // don't queue explicit evaluation if the thread is all ready performing an evaluation.
- if (thread.isSuspended() && ((JDIThread)thread).isInvokingMethod() || thread.isPerformingEvaluation() && evaluationDetail == DebugEvent.EVALUATION) {
- EvaluationResult result= new EvaluationResult(this, expression.getSnippet(), thread);
- result.addError(EvaluationEngineMessages.ASTEvaluationEngine_Cannot_perform_nested_evaluations);
+ // don't queue explicit evaluation if the thread is all ready
+ // performing an evaluation.
+ if (thread.isSuspended() && ((JDIThread) thread).isInvokingMethod()
+ || thread.isPerformingEvaluation()
+ && evaluationDetail == DebugEvent.EVALUATION) {
+ EvaluationResult result = new EvaluationResult(this,
+ expression.getSnippet(), thread);
+ result.addError(EvaluationEngineMessages.ASTEvaluationEngine_Cannot_perform_nested_evaluations);
listener.evaluationComplete(result);
return;
}
- thread.queueRunnable(new EvalRunnable((InstructionSequence)expression, thread, context, listener, evaluationDetail, hitBreakpoints));
+ thread.queueRunnable(new EvalRunnable(
+ (InstructionSequence) expression, thread, context,
+ listener, evaluationDetail, hitBreakpoints));
} else {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, EvaluationEngineMessages.ASTEvaluationEngine_AST_evaluation_engine_cannot_evaluate_expression, null));
+ throw new DebugException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ EvaluationEngineMessages.ASTEvaluationEngine_AST_evaluation_engine_cannot_evaluate_expression,
+ null));
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine#getCompiledExpression(java.lang.String, org.eclipse.jdt.debug.core.IJavaStackFrame)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IAstEvaluationEngine#getCompiledExpression
+ * (java.lang.String, org.eclipse.jdt.debug.core.IJavaStackFrame)
*/
- public ICompiledExpression getCompiledExpression(String snippet, IJavaStackFrame frame) {
+ public ICompiledExpression getCompiledExpression(String snippet,
+ IJavaStackFrame frame) {
IJavaProject javaProject = getJavaProject();
RuntimeContext context = new RuntimeContext(javaProject, frame);
@@ -223,57 +296,69 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
CompilationUnit unit = null;
try {
IJavaVariable[] localsVar = context.getLocals();
- int numLocalsVar= localsVar.length;
- Set names = new HashSet();
+ int numLocalsVar = localsVar.length;
+ Set<String> names = new HashSet<String>();
// ******
- // to hide problems with local variable declare as instance of Local Types
+ // to hide problems with local variable declare as instance of Local
+ // Types
// and to remove locals with duplicate names
- IJavaVariable[] locals= new IJavaVariable[numLocalsVar];
- int numLocals= 0;
+ IJavaVariable[] locals = new IJavaVariable[numLocalsVar];
+ int numLocals = 0;
for (int i = 0; i < numLocalsVar; i++) {
- if (!isLocalType(localsVar[i].getSignature()) && !names.contains(localsVar[i].getName())) {
- locals[numLocals++]= localsVar[i];
+ if (!isLocalType(localsVar[i].getSignature())
+ && !names.contains(localsVar[i].getName())) {
+ locals[numLocals++] = localsVar[i];
names.add(localsVar[i].getName());
}
}
// to solve and remove
// ******
- String[] localTypesNames= new String[numLocals];
- String[] localVariables= new String[numLocals];
+ String[] localTypesNames = new String[numLocals];
+ String[] localVariables = new String[numLocals];
for (int i = 0; i < numLocals; i++) {
localVariables[i] = locals[i].getName();
- localTypesNames[i] = Signature.toString(locals[i].getGenericSignature()).replace('/', '.');
+ localTypesNames[i] = Signature.toString(
+ locals[i].getGenericSignature()).replace('/', '.');
}
- mapper = new EvaluationSourceGenerator(localTypesNames, localVariables, snippet);
- // Compile in context of declaring type to get proper visibility of locals and members.
- // Compiling in context of receiving type potentially provides access to more members,
+ mapper = new EvaluationSourceGenerator(localTypesNames,
+ localVariables, snippet);
+ // Compile in context of declaring type to get proper visibility of
+ // locals and members.
+ // Compiling in context of receiving type potentially provides
+ // access to more members,
// but does not allow access to privates members in declaring type
IJavaReferenceType receivingType = frame.getReferenceType();
-
-// currently disabled - see bugs 99416 and 106492
-// if (frame.isStatic()) {
-// receivingType= frame.getReferenceType();
-// } else {
-// receivingType= (IJavaReferenceType) frame.getThis().getJavaType();
-// }
-
- unit = parseCompilationUnit(mapper.getSource(receivingType, javaProject, frame.isStatic()).toCharArray(), mapper.getCompilationUnitName(), javaProject);
+
+ // currently disabled - see bugs 99416 and 106492
+ // if (frame.isStatic()) {
+ // receivingType= frame.getReferenceType();
+ // } else {
+ // receivingType= (IJavaReferenceType)
+ // frame.getThis().getJavaType();
+ // }
+
+ unit = parseCompilationUnit(
+ mapper.getSource(receivingType, javaProject,
+ frame.isStatic()).toCharArray(),
+ mapper.getCompilationUnitName(), javaProject);
} catch (CoreException e) {
- InstructionSequence expression= new InstructionSequence(snippet);
+ InstructionSequence expression = new InstructionSequence(snippet);
expression.addError(e.getStatus().getMessage());
return expression;
}
-
+
return createExpressionFromAST(snippet, mapper, unit);
}
-
- private CompilationUnit parseCompilationUnit(char[] source, String unitName, IJavaProject project) {
+
+ private CompilationUnit parseCompilationUnit(char[] source,
+ String unitName, IJavaProject project) {
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(source);
parser.setUnitName(unitName);
parser.setProject(project);
parser.setResolveBindings(true);
- Map options=EvaluationSourceGenerator.getCompilerOptions(project);
+ Map<?, ?> options = EvaluationSourceGenerator
+ .getCompilerOptions(project);
parser.setCompilerOptions(options);
return (CompilationUnit) parser.createAST(null);
}
@@ -281,40 +366,44 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
// ******
// to hide problems with local variable declare as instance of Local Types
private boolean isLocalType(String typeName) {
- StringTokenizer strTok= new StringTokenizer(typeName,"$"); //$NON-NLS-1$
+ StringTokenizer strTok = new StringTokenizer(typeName, "$"); //$NON-NLS-1$
strTok.nextToken();
while (strTok.hasMoreTokens()) {
- char char0= strTok.nextToken().charAt(0);
+ char char0 = strTok.nextToken().charAt(0);
if ('0' <= char0 && char0 <= '9') {
return true;
}
}
return false;
}
+
// ******
-
+
/**
- * Returns a compiled expression for an evaluation in the context of an array
- * as a receiver.
+ * Returns a compiled expression for an evaluation in the context of an
+ * array as a receiver.
*/
- private ICompiledExpression getCompiledExpression(String snippet, IJavaArrayType arrayType) {
+ private ICompiledExpression getCompiledExpression(String snippet,
+ IJavaArrayType arrayType) {
EvaluationSourceGenerator mapper = null;
CompilationUnit unit = null;
try {
IJavaProject javaProject = getJavaProject();
// replace all occurrences of 'this' with '_a_t'
String newSnippet = replaceThisReferences(snippet);
-
+
int dimension = 1;
IJavaType componentType = arrayType.getComponentType();
while (componentType instanceof IJavaArrayType) {
- componentType = ((IJavaArrayType)componentType).getComponentType();
+ componentType = ((IJavaArrayType) componentType)
+ .getComponentType();
dimension++;
}
-
+
// Primitive arrays are evaluated in the context of Object.
- // Arrays with a base component type of a class or interface are treated
- // as Object arrays and evaluated in Object.
+ // Arrays with a base component type of a class or interface are
+ // treated
+ // as Object arrays and evaluated in Object.
String recTypeName = "java.lang.Object"; //$NON-NLS-1$
String typeName = arrayType.getName();
if (componentType instanceof IJavaReferenceType) {
@@ -325,70 +414,91 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
}
typeName = buf.toString();
}
-
-
- String[] localTypesNames= new String[]{typeName};
- String[] localVariables= new String[]{ArrayRuntimeContext.ARRAY_THIS_VARIABLE};
- mapper = new EvaluationSourceGenerator(localTypesNames, localVariables, newSnippet);
-
-
+
+ String[] localTypesNames = new String[] { typeName };
+ String[] localVariables = new String[] { ArrayRuntimeContext.ARRAY_THIS_VARIABLE };
+ mapper = new EvaluationSourceGenerator(localTypesNames,
+ localVariables, newSnippet);
+
int index = typeName.indexOf('$');
- // if the argument is an inner type, compile in context of outer type so type is visible
+ // if the argument is an inner type, compile in context of outer
+ // type so type is visible
if (index >= 0) {
recTypeName = typeName.substring(0, index);
}
IJavaType[] javaTypes = getDebugTarget().getJavaTypes(recTypeName);
if (javaTypes.length > 0) {
IJavaReferenceType recType = (IJavaReferenceType) javaTypes[0];
- unit = parseCompilationUnit(mapper.getSource(recType, getJavaProject(), false).toCharArray(), mapper.getCompilationUnitName(), javaProject);
+ unit = parseCompilationUnit(
+ mapper.getSource(recType, getJavaProject(), false)
+ .toCharArray(),
+ mapper.getCompilationUnitName(), javaProject);
} else {
- IStatus status = new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, EvaluationEngineMessages.ASTEvaluationEngine_1, null);
+ IStatus status = new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.ERROR,
+ EvaluationEngineMessages.ASTEvaluationEngine_1, null);
throw new CoreException(status);
}
} catch (CoreException e) {
- InstructionSequence expression= new InstructionSequence(snippet);
+ InstructionSequence expression = new InstructionSequence(snippet);
expression.addError(e.getStatus().getMessage());
return expression;
}
-
- return createExpressionFromAST(snippet, mapper, unit);
+
+ return createExpressionFromAST(snippet, mapper, unit);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine#getCompiledExpression(java.lang.String, org.eclipse.jdt.debug.core.IJavaObject)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IAstEvaluationEngine#getCompiledExpression
+ * (java.lang.String, org.eclipse.jdt.debug.core.IJavaObject)
*/
- public ICompiledExpression getCompiledExpression(String snippet, IJavaObject thisContext) {
+ public ICompiledExpression getCompiledExpression(String snippet,
+ IJavaObject thisContext) {
try {
if (thisContext instanceof IJavaArray) {
- return getCompiledExpression(snippet, (IJavaArrayType)thisContext.getJavaType());
+ return getCompiledExpression(snippet,
+ (IJavaArrayType) thisContext.getJavaType());
}
- return getCompiledExpression(snippet, (IJavaReferenceType)thisContext.getJavaType());
+ return getCompiledExpression(snippet,
+ (IJavaReferenceType) thisContext.getJavaType());
} catch (DebugException e) {
- InstructionSequence expression= new InstructionSequence(snippet);
+ InstructionSequence expression = new InstructionSequence(snippet);
expression.addError(e.getStatus().getMessage());
return expression;
}
-
+
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine#getCompiledExpression(java.lang.String, org.eclipse.jdt.debug.core.IJavaType)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IAstEvaluationEngine#getCompiledExpression
+ * (java.lang.String, org.eclipse.jdt.debug.core.IJavaType)
*/
- public ICompiledExpression getCompiledExpression(String snippet, IJavaReferenceType type) {
+ public ICompiledExpression getCompiledExpression(String snippet,
+ IJavaReferenceType type) {
if (type instanceof IJavaArrayType) {
- return getCompiledExpression(snippet, (IJavaArrayType)type);
+ return getCompiledExpression(snippet, (IJavaArrayType) type);
}
IJavaProject javaProject = getJavaProject();
EvaluationSourceGenerator mapper = null;
CompilationUnit unit = null;
- mapper = new EvaluationSourceGenerator(new String[0], new String[0], snippet);
+ mapper = new EvaluationSourceGenerator(new String[0], new String[0],
+ snippet);
try {
- unit = parseCompilationUnit(mapper.getSource(type, javaProject, false).toCharArray(), mapper.getCompilationUnitName(), javaProject);
+ unit = parseCompilationUnit(
+ mapper.getSource(type, javaProject, false).toCharArray(),
+ mapper.getCompilationUnitName(), javaProject);
} catch (CoreException e) {
- InstructionSequence expression= new InstructionSequence(snippet);
+ InstructionSequence expression = new InstructionSequence(snippet);
expression.addError(e.getStatus().getMessage());
return expression;
}
@@ -396,101 +506,118 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
}
/**
- * Creates a compiled expression for the given snippet using the given mapper and
- * compilation unit (AST).
- * @param snippet the code snippet to be compiled
- * @param mapper the object which will be used to create the expression
- * @param unit the compilation unit (AST) generated for the snippet
+ * Creates a compiled expression for the given snippet using the given
+ * mapper and compilation unit (AST).
+ *
+ * @param snippet
+ * the code snippet to be compiled
+ * @param mapper
+ * the object which will be used to create the expression
+ * @param unit
+ * the compilation unit (AST) generated for the snippet
*/
- private ICompiledExpression createExpressionFromAST(String snippet, EvaluationSourceGenerator mapper, CompilationUnit unit) {
- IProblem[] problems= unit.getProblems();
+ private ICompiledExpression createExpressionFromAST(String snippet,
+ EvaluationSourceGenerator mapper, CompilationUnit unit) {
+ IProblem[] problems = unit.getProblems();
if (problems.length != 0) {
- boolean snippetError= false;
- boolean runMethodError= false;
- InstructionSequence errorSequence= new InstructionSequence(snippet);
- int codeSnippetStart= mapper.getSnippetStart();
- int codeSnippetEnd= codeSnippetStart + mapper.getSnippet().length();
- int runMethodStart= mapper.getRunMethodStart();
- int runMethodEnd= runMethodStart + mapper.getRunMethodLength();
- for (int i = 0; i < problems.length; i++) {
- IProblem problem= problems[i];
- int errorOffset= problem.getSourceStart();
- int problemId= problem.getID();
+ boolean snippetError = false;
+ boolean runMethodError = false;
+ InstructionSequence errorSequence = new InstructionSequence(snippet);
+ int codeSnippetStart = mapper.getSnippetStart();
+ int codeSnippetEnd = codeSnippetStart
+ + mapper.getSnippet().length();
+ int runMethodStart = mapper.getRunMethodStart();
+ int runMethodEnd = runMethodStart + mapper.getRunMethodLength();
+ for (IProblem problem : problems) {
+ int errorOffset = problem.getSourceStart();
+ int problemId = problem.getID();
if (problemId == IProblem.IsClassPathCorrect) {
errorSequence.addError(problem.getMessage());
snippetError = true;
}
if (problemId == IProblem.VoidMethodReturnsValue
- || problemId == IProblem.NotVisibleMethod
- || problemId == IProblem.NotVisibleConstructor
- || problemId == IProblem.NotVisibleField
- || problemId == IProblem.NotVisibleType) {
+ || problemId == IProblem.NotVisibleMethod
+ || problemId == IProblem.NotVisibleConstructor
+ || problemId == IProblem.NotVisibleField
+ || problemId == IProblem.NotVisibleType) {
continue;
}
if (problem.isError()) {
- if (codeSnippetStart <= errorOffset && errorOffset <= codeSnippetEnd) {
+ if (codeSnippetStart <= errorOffset
+ && errorOffset <= codeSnippetEnd) {
errorSequence.addError(problem.getMessage());
snippetError = true;
- } else if (runMethodStart <= errorOffset && errorOffset <= runMethodEnd) {
+ } else if (runMethodStart <= errorOffset
+ && errorOffset <= runMethodEnd) {
runMethodError = true;
}
}
}
if (snippetError || runMethodError) {
if (runMethodError) {
- errorSequence.addError(EvaluationEngineMessages.ASTEvaluationEngine_Evaluations_must_contain_either_an_expression_or_a_block_of_well_formed_statements_1);
+ errorSequence
+ .addError(EvaluationEngineMessages.ASTEvaluationEngine_Evaluations_must_contain_either_an_expression_or_a_block_of_well_formed_statements_1);
}
return errorSequence;
}
}
-
- ASTInstructionCompiler visitor = new ASTInstructionCompiler(mapper.getSnippetStart(), snippet);
+
+ ASTInstructionCompiler visitor = new ASTInstructionCompiler(
+ mapper.getSnippetStart(), snippet);
unit.accept(visitor);
return visitor.getInstructions();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.eval.IEvaluationEngine#getJavaProject()
*/
public IJavaProject getJavaProject() {
return fProject;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.eval.IEvaluationEngine#getDebugTarget()
*/
public IJavaDebugTarget getDebugTarget() {
return fDebugTarget;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.eval.IEvaluationEngine#dispose()
*/
public void dispose() {
}
-
+
class EvalRunnable implements Runnable {
-
+
private InstructionSequence fExpression;
-
+
private IJavaThread fThread;
-
+
private int fEvaluationDetail;
-
+
private boolean fHitBreakpoints;
-
+
private IRuntimeContext fContext;
-
+
private IEvaluationListener fListener;
-
- public EvalRunnable(InstructionSequence expression, IJavaThread thread, IRuntimeContext context, IEvaluationListener listener, int evaluationDetail, boolean hitBreakpoints) {
- fExpression= expression;
- fThread= thread;
- fContext= context;
- fListener= listener;
- fEvaluationDetail= evaluationDetail;
- fHitBreakpoints= hitBreakpoints;
+
+ public EvalRunnable(InstructionSequence expression, IJavaThread thread,
+ IRuntimeContext context, IEvaluationListener listener,
+ int evaluationDetail, boolean hitBreakpoints) {
+ fExpression = expression;
+ fThread = thread;
+ fContext = context;
+ fListener = listener;
+ fEvaluationDetail = evaluationDetail;
+ fHitBreakpoints = hitBreakpoints;
}
public void run() {
@@ -521,11 +648,12 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
buf.append(fHitBreakpoints);
System.out.println(buf.toString());
}
- EvaluationResult result = new EvaluationResult(ASTEvaluationEngine.this, fExpression.getSnippet(), fThread);
+ EvaluationResult result = new EvaluationResult(
+ ASTEvaluationEngine.this, fExpression.getSnippet(), fThread);
if (fExpression.hasErrors()) {
String[] errors = fExpression.getErrorMessages();
- for (int i = 0, numErrors = errors.length; i < numErrors; i++) {
- result.addError(errors[i]);
+ for (String error : errors) {
+ result.addError(error);
}
evaluationFinished(result);
if (JDIDebugOptions.DEBUG_AST_EVAL) {
@@ -542,13 +670,14 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
}
return;
}
- final Interpreter interpreter = new Interpreter(fExpression, fContext);
-
+ final Interpreter interpreter = new Interpreter(fExpression,
+ fContext);
+
class EvaluationRunnable implements IEvaluationRunnable, ITerminate {
-
+
CoreException fException;
boolean fTerminated = false;
-
+
public void run(IJavaThread jt, IProgressMonitor pm) {
EventFilter filter = new EventFilter();
try {
@@ -556,13 +685,22 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
interpreter.execute();
} catch (CoreException exception) {
fException = exception;
- if (fEvaluationDetail == DebugEvent.EVALUATION && exception.getStatus().getException() instanceof InvocationException) {
- // print the stack trace for the exception if an *explicit* evaluation
- InvocationException invocationException = (InvocationException)exception.getStatus().getException();
- ObjectReference exObject = invocationException.exception();
- IJavaObject modelObject = (IJavaObject)JDIValue.createValue((JDIDebugTarget)getDebugTarget(), exObject);
+ if (fEvaluationDetail == DebugEvent.EVALUATION
+ && exception.getStatus().getException() instanceof InvocationException) {
+ // print the stack trace for the exception if an
+ // *explicit* evaluation
+ InvocationException invocationException = (InvocationException) exception
+ .getStatus().getException();
+ ObjectReference exObject = invocationException
+ .exception();
+ IJavaObject modelObject = (IJavaObject) JDIValue
+ .createValue(
+ (JDIDebugTarget) getDebugTarget(),
+ exObject);
try {
- modelObject.sendMessage("printStackTrace", "()V", null, jt, false); //$NON-NLS-1$ //$NON-NLS-2$
+ modelObject
+ .sendMessage(
+ "printStackTrace", "()V", null, jt, false); //$NON-NLS-1$ //$NON-NLS-2$
} catch (DebugException e) {
// unable to print stack trace
}
@@ -571,17 +709,20 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
DebugPlugin.getDefault().removeDebugEventFilter(filter);
}
}
+
public void terminate() {
fTerminated = true;
interpreter.stop();
}
+
public boolean canTerminate() {
return true;
}
+
public boolean isTerminated() {
return false;
}
-
+
public CoreException getException() {
return fException;
}
@@ -591,18 +732,19 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
CoreException exception = null;
long start = System.currentTimeMillis();
try {
- fThread.runEvaluation(er, null, fEvaluationDetail, fHitBreakpoints);
+ fThread.runEvaluation(er, null, fEvaluationDetail,
+ fHitBreakpoints);
} catch (DebugException e) {
exception = e;
}
long end = System.currentTimeMillis();
-
- IJavaValue value = interpreter.getResult();
+
+ IJavaValue value = interpreter.getResult();
if (exception == null) {
exception = er.getException();
}
-
+
result.setTerminated(er.fTerminated);
if (exception != null) {
if (JDIDebugOptions.DEBUG_AST_EVAL) {
@@ -611,25 +753,26 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
buf.append(exception.toString());
System.out.println(buf.toString());
}
- if (exception instanceof DebugException) {
- result.setException((DebugException)exception);
- } else {
- result.setException(new DebugException(exception.getStatus()));
- }
- } else {
- if (value != null) {
- result.setValue(value);
- if (JDIDebugOptions.DEBUG_AST_EVAL) {
+ if (exception instanceof DebugException) {
+ result.setException((DebugException) exception);
+ } else {
+ result.setException(new DebugException(exception
+ .getStatus()));
+ }
+ } else {
+ if (value != null) {
+ result.setValue(value);
+ if (JDIDebugOptions.DEBUG_AST_EVAL) {
StringBuffer buf = new StringBuffer();
buf.append("\tResult: "); //$NON-NLS-1$
buf.append(value);
System.out.println(buf.toString());
}
- } else {
- result.addError(EvaluationEngineMessages.ASTEvaluationEngine_An_unknown_error_occurred_during_evaluation);
- }
+ } else {
+ result.addError(EvaluationEngineMessages.ASTEvaluationEngine_An_unknown_error_occurred_during_evaluation);
+ }
}
-
+
if (JDIDebugOptions.DEBUG_AST_EVAL) {
StringBuffer buf = new StringBuffer();
buf.append("\tDuration: "); //$NON-NLS-1$
@@ -637,22 +780,24 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
buf.append("ms"); //$NON-NLS-1$
System.out.println(buf.toString());
}
-
+
evaluationFinished(result);
}
+
private void evaluationFinished(IEvaluationResult result) {
// only notify if plug-in not yet shutdown - bug# 8693
- if(JDIDebugPlugin.getDefault() != null) {
+ if (JDIDebugPlugin.getDefault() != null) {
fListener.evaluationComplete(result);
}
}
-
+
}
-
+
/**
* Replaces references to 'this' with the 'array_this' variable.
*
- * @param snippet code snippet
+ * @param snippet
+ * code snippet
* @return snippet with 'this' references replaced
*/
public static String replaceThisReferences(String snippet) {
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
index 92f63b3c3..e7b89d65d 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -191,26 +190,25 @@ import org.eclipse.jdt.internal.debug.eval.ast.instructions.XorOperator;
import com.ibm.icu.text.MessageFormat;
/**
- * The AST instruction compiler generates a sequence
- * of instructions (InstructionSequence) from a
- * DOM AST.
+ * The AST instruction compiler generates a sequence of instructions
+ * (InstructionSequence) from a DOM AST.
*/
public class ASTInstructionCompiler extends ASTVisitor {
/**
- * Represent a break or a continue instruction.
- * These instructions needs are stored and managed later by their
- * related statement.
+ * Represent a break or a continue instruction. These instructions needs are
+ * stored and managed later by their related statement.
*/
class CompleteInstruction {
Jump fInstruction;
String fLabel;
boolean fIsBreak;
- public CompleteInstruction(Jump instruction, String label, boolean isBreak) {
- fInstruction= instruction;
- fLabel= label;
- fIsBreak= isBreak;
+ public CompleteInstruction(Jump instruction, String label,
+ boolean isBreak) {
+ fInstruction = instruction;
+ fLabel = label;
+ fIsBreak = isBreak;
}
}
@@ -224,7 +222,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* The list of pending break and continue instruction.
*/
- private List fCompleteInstructions;
+ private List<CompleteInstruction> fCompleteInstructions;
private int fStartPosition;
@@ -232,13 +230,12 @@ public class ASTInstructionCompiler extends ASTVisitor {
private boolean fHasErrors;
- private Stack fStack;
+ private Stack<Instruction> fStack;
private int fCounter;
-
- // internal index used to create unique variable name
- private int fUniqueIdIndex= 0;
+ // internal index used to create unique variable name
+ private int fUniqueIdIndex = 0;
/**
* Create a new AST instruction compiler
@@ -246,27 +243,26 @@ public class ASTInstructionCompiler extends ASTVisitor {
public ASTInstructionCompiler(int startPosition, String snippet) {
fStartPosition = startPosition;
fInstructions = new InstructionSequence(snippet);
- fStack = new Stack();
- fCompleteInstructions= new ArrayList();
+ fStack = new Stack<Instruction>();
+ fCompleteInstructions = new ArrayList<CompleteInstruction>();
}
/**
- * Returns the instruction sequence generated
- * by this AST instruction compiler
+ * Returns the instruction sequence generated by this AST instruction
+ * compiler
*/
public InstructionSequence getInstructions() {
return fInstructions;
}
/**
- * Returns whether the generated instruction sequence
- * has errors.
- * Errors include:
+ * Returns whether the generated instruction sequence has errors. Errors
+ * include:
* <ol>
- * <li>AST contains unimplemented operations (features which will be supported,
- * but aren't yet)</li>
- * <li>AST contains unsupported operations (features which are not yet implemented
- * and are likely NOT to be implemented)</li>
+ * <li>AST contains unimplemented operations (features which will be
+ * supported, but aren't yet)</li>
+ * <li>AST contains unsupported operations (features which are not yet
+ * implemented and are likely NOT to be implemented)</li>
* </ol>
*/
public boolean hasErrors() {
@@ -274,7 +270,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
private void setHasError(boolean value) {
- fHasErrors= value;
+ fHasErrors = value;
}
private void addErrorMessage(String message) {
@@ -289,31 +285,29 @@ public class ASTInstructionCompiler extends ASTVisitor {
fActive = active;
}
-
private void push(Instruction i) {
fStack.push(i);
}
private Instruction pop() {
- return (Instruction)fStack.pop();
+ return fStack.pop();
}
private void storeInstruction() {
- Instruction instruction= pop();
+ Instruction instruction = pop();
fCounter++;
if (instruction instanceof CompoundInstruction) {
- ((CompoundInstruction)instruction).setEnd(fCounter);
+ ((CompoundInstruction) instruction).setEnd(fCounter);
}
fInstructions.add(instruction);
verbose("Add " + instruction.toString()); //$NON-NLS-1$
}
-
/**
- * Prints the given message to the console if verbose
- * mode is on.
- *
- * @param message the message to display
+ * Prints the given message to the console if verbose mode is on.
+ *
+ * @param message
+ * the message to display
*/
private void verbose(String message) {
if (VERBOSE) {
@@ -323,12 +317,12 @@ public class ASTInstructionCompiler extends ASTVisitor {
private String getTypeName(ITypeBinding typeBinding) {
if (typeBinding.isRawType()) {
- typeBinding= typeBinding.getErasure();
+ typeBinding = typeBinding.getErasure();
}
if (typeBinding.isTypeVariable()) {
- ITypeBinding[] typeBounds= typeBinding.getTypeBounds();
+ ITypeBinding[] typeBounds = typeBinding.getTypeBounds();
if (typeBounds.length > 0) {
- String name= getTypeName(typeBounds[0]);
+ String name = getTypeName(typeBounds[0]);
if (typeBounds.length > 1 && "java.lang.Object".equals(name)) { //$NON-NLS-1$
return getTypeName(typeBounds[1]);
}
@@ -338,24 +332,24 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
StringBuffer name;
if (typeBinding.isArray()) {
- name= new StringBuffer(getTypeName(typeBinding.getElementType()));
- int dimensions= typeBinding.getDimensions();
- for (int i= 0; i < dimensions; i++) {
+ name = new StringBuffer(getTypeName(typeBinding.getElementType()));
+ int dimensions = typeBinding.getDimensions();
+ for (int i = 0; i < dimensions; i++) {
name.append("[]"); //$NON-NLS-1$
}
return name.toString();
}
- String typeName= typeBinding.getName();
- int parameters= typeName.indexOf('<');
+ String typeName = typeBinding.getName();
+ int parameters = typeName.indexOf('<');
if (parameters >= 0) {
- typeName= typeName.substring(0, parameters);
+ typeName = typeName.substring(0, parameters);
}
- name= new StringBuffer(typeName);
- IPackageBinding packageBinding= typeBinding.getPackage();
- typeBinding= typeBinding.getDeclaringClass();
- while(typeBinding != null) {
+ name = new StringBuffer(typeName);
+ IPackageBinding packageBinding = typeBinding.getPackage();
+ typeBinding = typeBinding.getDeclaringClass();
+ while (typeBinding != null) {
name.insert(0, '$').insert(0, typeBinding.getName());
- typeBinding= typeBinding.getDeclaringClass();
+ typeBinding = typeBinding.getDeclaringClass();
}
if (packageBinding != null && !packageBinding.isUnnamed()) {
name.insert(0, '.').insert(0, packageBinding.getName());
@@ -364,46 +358,52 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
private String getTypeSignature(ITypeBinding typeBinding) {
- return Signature.createTypeSignature(getTypeName(typeBinding), true).replace('.', '/');
+ return Signature.createTypeSignature(getTypeName(typeBinding), true)
+ .replace('.', '/');
}
private boolean isALocalType(ITypeBinding typeBinding) {
- while(typeBinding != null) {
+ while (typeBinding != null) {
if (typeBinding.isLocal()) {
return true;
}
- typeBinding= typeBinding.getDeclaringClass();
+ typeBinding = typeBinding.getDeclaringClass();
}
return false;
}
private boolean containsALocalType(IMethodBinding methodBinding) {
- ITypeBinding[] typeBindings= methodBinding.getParameterTypes();
- for (int i= 0, length= typeBindings.length; i < length; i++) {
- if (isALocalType(typeBindings[i])) {
+ ITypeBinding[] typeBindings = methodBinding.getParameterTypes();
+ for (ITypeBinding typeBinding : typeBindings) {
+ if (isALocalType(typeBinding)) {
return true;
}
}
return false;
}
- private int getEnclosingLevel(ASTNode node, ITypeBinding referenceTypeBinding) {
+ private int getEnclosingLevel(ASTNode node,
+ ITypeBinding referenceTypeBinding) {
ASTNode parent = node;
- ITypeBinding refbinding = referenceTypeBinding.isParameterizedType() ? referenceTypeBinding.getTypeDeclaration() : referenceTypeBinding;
+ ITypeBinding refbinding = referenceTypeBinding.isParameterizedType() ? referenceTypeBinding
+ .getTypeDeclaration() : referenceTypeBinding;
do {
parent = parent.getParent();
- } while (parent != null && !(parent instanceof AbstractTypeDeclaration || parent instanceof AnonymousClassDeclaration));
- if(parent == null) {
+ } while (parent != null
+ && !(parent instanceof AbstractTypeDeclaration || parent instanceof AnonymousClassDeclaration));
+ if (parent == null) {
return 0;
}
ITypeBinding parentBinding = null;
- if(parent instanceof AbstractTypeDeclaration) {
- parentBinding = ((AbstractTypeDeclaration)parent).resolveBinding();
- }
- else if(parent instanceof AnonymousClassDeclaration) {
- parentBinding = ((AnonymousClassDeclaration)parent).resolveBinding();
- }
- if (parentBinding != null && (parentBinding.isEqualTo(refbinding) || parentBinding.isCastCompatible(refbinding))) {
+ if (parent instanceof AbstractTypeDeclaration) {
+ parentBinding = ((AbstractTypeDeclaration) parent).resolveBinding();
+ } else if (parent instanceof AnonymousClassDeclaration) {
+ parentBinding = ((AnonymousClassDeclaration) parent)
+ .resolveBinding();
+ }
+ if (parentBinding != null
+ && (parentBinding.isEqualTo(refbinding) || parentBinding
+ .isCastCompatible(refbinding))) {
return 0;
}
return getEnclosingLevel(parent, referenceTypeBinding) + 1;
@@ -418,41 +418,47 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* Return the label associated with the given statement.
- *
- * @param statement the statement.
+ *
+ * @param statement
+ * the statement.
* @return the associated label, or <code>null</code> if there is none.
*/
private String getLabel(Statement statement) {
- ASTNode parent= statement.getParent();
+ ASTNode parent = statement.getParent();
if (parent instanceof LabeledStatement) {
- return ((LabeledStatement)parent).getLabel().getIdentifier();
+ return ((LabeledStatement) parent).getLabel().getIdentifier();
}
return null;
}
/**
- * Append a pop instruction in the instruction list if needed.
- * A pop instruction is added when the expression has a return value,
- * i.e. all expressions expect method invocation expressions which
- * have <code>void</code> as return type and variable declaration expression.
- *
- * @param expression the expression to test.
+ * Append a pop instruction in the instruction list if needed. A pop
+ * instruction is added when the expression has a return value, i.e. all
+ * expressions expect method invocation expressions which have
+ * <code>void</code> as return type and variable declaration expression.
+ *
+ * @param expression
+ * the expression to test.
*/
private void addPopInstructionIfNeeded(Expression expression) {
- boolean pop= true;
+ boolean pop = true;
if (expression instanceof MethodInvocation) {
- IMethodBinding methodBinding= (IMethodBinding)((MethodInvocation)expression).getName().resolveBinding();
- if (methodBinding != null && "void".equals(methodBinding.getReturnType().getName())) { //$NON-NLS-1$
- pop= false;
+ IMethodBinding methodBinding = (IMethodBinding) ((MethodInvocation) expression)
+ .getName().resolveBinding();
+ if (methodBinding != null
+ && "void".equals(methodBinding.getReturnType().getName())) { //$NON-NLS-1$
+ pop = false;
}
} else if (expression instanceof SuperMethodInvocation) {
- IMethodBinding methodBinding= (IMethodBinding)((SuperMethodInvocation)expression).getName().resolveBinding();
- if (methodBinding != null && "void".equals(methodBinding.getReturnType().getName())) { //$NON-NLS-1$
- pop= false;
+ IMethodBinding methodBinding = (IMethodBinding) ((SuperMethodInvocation) expression)
+ .getName().resolveBinding();
+ if (methodBinding != null
+ && "void".equals(methodBinding.getReturnType().getName())) { //$NON-NLS-1$
+ pop = false;
}
} else if (expression instanceof VariableDeclarationExpression) {
- pop= false;
+ pop = false;
}
if (pop) {
@@ -464,17 +470,20 @@ public class ASTInstructionCompiler extends ASTVisitor {
*
*/
private void addPopInstruction() {
- Instruction lastInstruction= fInstructions.getInstruction(fInstructions.getEnd());
+ Instruction lastInstruction = fInstructions
+ .getInstruction(fInstructions.getEnd());
push(new Pop(lastInstruction.getSize() + 1));
storeInstruction();
}
-
+
/**
- * Check the current type of a value and the requested type to decide if boxing/un-boxing is required.
- * If needed, the correct instruction is added to the stack
- * Returns true if a storeInstruction() is needed after visiting the expression
+ * Check the current type of a value and the requested type to decide if
+ * boxing/un-boxing is required. If needed, the correct instruction is added
+ * to the stack Returns true if a storeInstruction() is needed after
+ * visiting the expression
*/
- private boolean checkAutoBoxing(ITypeBinding valueBinding, ITypeBinding requestedBinding) {
+ private boolean checkAutoBoxing(ITypeBinding valueBinding,
+ ITypeBinding requestedBinding) {
if (valueBinding == null) {
return false; // unresolved
}
@@ -493,59 +502,75 @@ public class ASTInstructionCompiler extends ASTVisitor {
* Add to the stack the instruction to box a primitive value.
*/
private void boxing(ITypeBinding requestedBinding, ITypeBinding valueBinding) {
- String requestedTypeName= requestedBinding.getQualifiedName();
+ String requestedTypeName = requestedBinding.getQualifiedName();
if ("java.lang.Object".equals(requestedTypeName)) { //$NON-NLS-1$
switch (valueBinding.getBinaryName().charAt(0)) {
- case 'I':
- push(new SendStaticMessage("java.lang.Integer", "valueOf", "(I)Ljava/lang/Integer;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case 'C':
- push(new SendStaticMessage("java.lang.Character", "valueOf", "(C)Ljava/lang/Character;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case 'B':
- push(new SendStaticMessage("java.lang.Byte", "valueOf", "(B)Ljava/lang/Byte;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case 'S':
- push(new SendStaticMessage("java.lang.Short", "valueOf", "(S)Ljava/lang/Short;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case 'J':
- push(new SendStaticMessage("java.lang.Long", "valueOf", "(J)Ljava/lang/Long;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case 'F':
- push(new SendStaticMessage("java.lang.Float", "valueOf", "(F)Ljava/lang/Float;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case 'D':
- push(new SendStaticMessage("java.lang.Double", "valueOf", "(D)Ljava/lang/Double;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
- case 'Z':
- push(new SendStaticMessage("java.lang.Boolean", "valueOf", "(Z)Ljava/lang/Boolean;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
+ case 'I':
+ push(new SendStaticMessage(
+ "java.lang.Integer", "valueOf", "(I)Ljava/lang/Integer;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ case 'C':
+ push(new SendStaticMessage(
+ "java.lang.Character", "valueOf", "(C)Ljava/lang/Character;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ case 'B':
+ push(new SendStaticMessage(
+ "java.lang.Byte", "valueOf", "(B)Ljava/lang/Byte;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ case 'S':
+ push(new SendStaticMessage(
+ "java.lang.Short", "valueOf", "(S)Ljava/lang/Short;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ case 'J':
+ push(new SendStaticMessage(
+ "java.lang.Long", "valueOf", "(J)Ljava/lang/Long;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ case 'F':
+ push(new SendStaticMessage(
+ "java.lang.Float", "valueOf", "(F)Ljava/lang/Float;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ case 'D':
+ push(new SendStaticMessage(
+ "java.lang.Double", "valueOf", "(D)Ljava/lang/Double;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
+ case 'Z':
+ push(new SendStaticMessage(
+ "java.lang.Boolean", "valueOf", "(Z)Ljava/lang/Boolean;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
}
} else if ("java.lang.Integer".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(I)Ljava/lang/Integer;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(I)Ljava/lang/Integer;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Character".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(C)Ljava/lang/Character;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(C)Ljava/lang/Character;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Byte".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(B)Ljava/lang/Byte;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(B)Ljava/lang/Byte;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Short".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(S)Ljava/lang/Short;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(S)Ljava/lang/Short;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Long".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(J)Ljava/lang/Long;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(J)Ljava/lang/Long;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Float".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(F)Ljava/lang/Float;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(F)Ljava/lang/Float;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Double".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(D)Ljava/lang/Double;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(D)Ljava/lang/Double;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Boolean".equals(requestedTypeName)) { //$NON-NLS-1$
- push(new SendStaticMessage(requestedTypeName, "valueOf", "(Z)Ljava/lang/Boolean;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new SendStaticMessage(requestedTypeName,
+ "valueOf", "(Z)Ljava/lang/Boolean;", 1, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
- * Add the instruction to un-box a non-primitive value if needed.
- * Returns true if a storeInstruction() is needed after visiting the expression
+ * Add the instruction to un-box a non-primitive value if needed. Returns
+ * true if a storeInstruction() is needed after visiting the expression
*/
private boolean unBoxing(ITypeBinding valueBinding) {
- String valueTypeName= valueBinding.getQualifiedName();
+ String valueTypeName = valueBinding.getQualifiedName();
if ("java.lang.Integer".equals(valueTypeName)) { //$NON-NLS-1$
push(new SendMessage("intValue", "()I", 0, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
} else if ("java.lang.Character".equals(valueTypeName)) { //$NON-NLS-1$
@@ -570,21 +595,20 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* End visit methods
- *
+ *
* There are two paths to ending a visit to a node:
* <ol>
- * <li>For control statements, the necessary control
- * instructions (jump, conditional jump) are inserted
- * into the instruction sequence</li>
- * <li>For other cases, we simply remove the node's
- * instruction from the stack and add it to the
- * instruction sequence.</li>
+ * <li>For control statements, the necessary control instructions (jump,
+ * conditional jump) are inserted into the instruction sequence</li>
+ * <li>For other cases, we simply remove the node's instruction from the
+ * stack and add it to the instruction sequence.</li>
* </ol>
*/
/**
* @see ASTVisitor#endVisit(AnonymousClassDeclaration)
*/
+ @Override
public void endVisit(AnonymousClassDeclaration node) {
}
@@ -592,6 +616,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ArrayAccess)
*/
+ @Override
public void endVisit(ArrayAccess node) {
if (!isActive() || hasErrors())
return;
@@ -606,6 +631,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ArrayCreation)
*/
+ @Override
public void endVisit(ArrayCreation node) {
if (!isActive() || hasErrors())
return;
@@ -615,6 +641,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ArrayInitializer)
*/
+ @Override
public void endVisit(ArrayInitializer node) {
if (!isActive() || hasErrors())
return;
@@ -624,6 +651,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ArrayType)
*/
+ @Override
public void endVisit(ArrayType node) {
if (!isActive() || hasErrors())
return;
@@ -633,6 +661,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(AssertStatement)
*/
+ @Override
public void endVisit(AssertStatement node) {
}
@@ -640,6 +669,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(Assignment)
*/
+ @Override
public void endVisit(Assignment node) {
if (!isActive() || hasErrors())
return;
@@ -649,6 +679,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(Block)
*/
+ @Override
public void endVisit(Block node) {
if (!isActive() || hasErrors())
return;
@@ -658,6 +689,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(BooleanLiteral)
*/
+ @Override
public void endVisit(BooleanLiteral node) {
if (!isActive() || hasErrors())
return;
@@ -667,6 +699,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(BreakStatement)
*/
+ @Override
public void endVisit(BreakStatement node) {
if (!isActive() || hasErrors())
return;
@@ -676,6 +709,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(CastExpression)
*/
+ @Override
public void endVisit(CastExpression node) {
if (!isActive() || hasErrors())
return;
@@ -685,6 +719,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(CatchClause)
*/
+ @Override
public void endVisit(CatchClause node) {
}
@@ -692,6 +727,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(CharacterLiteral)
*/
+ @Override
public void endVisit(CharacterLiteral node) {
if (!isActive() || hasErrors())
return;
@@ -701,6 +737,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ClassInstanceCreation)
*/
+ @Override
public void endVisit(ClassInstanceCreation node) {
if (!isActive() || hasErrors())
return;
@@ -710,6 +747,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(CompilationUnit)
*/
+ @Override
public void endVisit(CompilationUnit node) {
}
@@ -717,24 +755,25 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ConditionalExpression)
*/
+ @Override
public void endVisit(ConditionalExpression node) {
if (!isActive() || hasErrors())
return;
// Get the instructions
- int ifFalseAddress= fInstructions.getEnd();
- Instruction ifFalse= fInstructions.get(ifFalseAddress);
- int ifTrueAddress= ifFalseAddress - ifFalse.getSize();
- Instruction ifTrue= fInstructions.get(ifTrueAddress);
- int conditionalAddress= ifTrueAddress - ifTrue.getSize();
+ int ifFalseAddress = fInstructions.getEnd();
+ Instruction ifFalse = fInstructions.get(ifFalseAddress);
+ int ifTrueAddress = ifFalseAddress - ifFalse.getSize();
+ Instruction ifTrue = fInstructions.get(ifTrueAddress);
+ int conditionalAddress = ifTrueAddress - ifTrue.getSize();
// Insert the conditional jump
- ConditionalJump conditionalJump= new ConditionalJump(false);
+ ConditionalJump conditionalJump = new ConditionalJump(false);
fInstructions.insert(conditionalJump, conditionalAddress + 1);
// Insert the jump
- int jumpAddress= ifTrueAddress + 2;
- Jump jump= new Jump();
+ int jumpAddress = ifTrueAddress + 2;
+ Jump jump = new Jump();
fInstructions.insert(jump, jumpAddress);
// Set the jump offsets
@@ -749,6 +788,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ConstructorInvocation)
*/
+ @Override
public void endVisit(ConstructorInvocation node) {
}
@@ -756,6 +796,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ContinueStatement)
*/
+ @Override
public void endVisit(ContinueStatement node) {
if (!isActive() || hasErrors())
return;
@@ -765,33 +806,29 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(DoStatement)
*/
+ @Override
public void endVisit(DoStatement node) {
if (!isActive() || hasErrors())
return;
- /* The structure of generated instructions is :
- *
- * --
- * | body
- * --
- * --
- * |condition
- * --
- * - jump to the first instruction of the body if the condition is true.
- *
+ /*
+ * The structure of generated instructions is :
+ *
+ * -- | body -- -- |condition -- - jump to the first instruction of the
+ * body if the condition is true.
*/
- String label= getLabel(node);
+ String label = getLabel(node);
// get address of each part
- int conditionAddress= fInstructions.getEnd();
- Instruction condition= fInstructions.getInstruction(conditionAddress);
- int bodyAddress= conditionAddress - condition.getSize();
- Instruction body= fInstructions.getInstruction(bodyAddress);
- int bodyStartAddress= bodyAddress - body.getSize();
+ int conditionAddress = fInstructions.getEnd();
+ Instruction condition = fInstructions.getInstruction(conditionAddress);
+ int bodyAddress = conditionAddress - condition.getSize();
+ Instruction body = fInstructions.getInstruction(bodyAddress);
+ int bodyStartAddress = bodyAddress - body.getSize();
// add the conditionnalJump
- ConditionalJump conditionalJump= new ConditionalJump(true);
+ ConditionalJump conditionalJump = new ConditionalJump(true);
fInstructions.add(conditionalJump);
fCounter++;
@@ -800,15 +837,18 @@ public class ASTInstructionCompiler extends ASTVisitor {
// for each pending break or continue instruction which are related to
// this loop, set the offset of the corresponding jump.
- for (Iterator iter= fCompleteInstructions.iterator(); iter.hasNext();) {
- CompleteInstruction instruction= (CompleteInstruction) iter.next();
- Jump jumpInstruction= instruction.fInstruction;
- int instructionAddress= fInstructions.indexOf(jumpInstruction);
- if (instructionAddress > bodyStartAddress && (instruction.fLabel == null || instruction.fLabel.equals(label))) {
+ for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
+ CompleteInstruction instruction = iter.next();
+ Jump jumpInstruction = instruction.fInstruction;
+ int instructionAddress = fInstructions.indexOf(jumpInstruction);
+ if (instructionAddress > bodyStartAddress
+ && (instruction.fLabel == null || instruction.fLabel
+ .equals(label))) {
iter.remove();
if (instruction.fIsBreak) {
// jump to the instruction after the last jump
- jumpInstruction.setOffset((conditionAddress - instructionAddress) + 1);
+ jumpInstruction
+ .setOffset((conditionAddress - instructionAddress) + 1);
} else {
// jump to the first instruction of the condition
jumpInstruction.setOffset(bodyAddress - instructionAddress);
@@ -822,101 +862,88 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(EmptyStatement)
*/
+ @Override
public void endVisit(EmptyStatement node) {
if (!isActive() || hasErrors())
return;
storeInstruction();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnhancedForStatement)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom
+ * .EnhancedForStatement)
*/
+ @Override
public void endVisit(EnhancedForStatement node) {
if (!isActive() || hasErrors())
return;
- /* The structure of generated instructions is :
- *
- * For an array:
- * --
- * | <ParameterType>[] a= Expression
- * | int i= 0
- * | <ParameterType> <ParameterName>
- * --
- * --
- * | i < a.length
- * - jump to the instruction after the last jump if the condition is false.
- * --
- * --
- * | s= a[i]
- * | Body
- * --
- * --
- * - jump to the first instruction of the condition.
- *
- * For an Iterable:
- * --
- * | Iterator i= Expression.iterator()
- * | <ParameterType> <ParameterName>
- * --
- * --
- * | i.hasNext()
- * - jump to the instruction after the last jump if the condition is false.
- * --
- * --
- * | s= i.next()
- * | Body
- * --
- * --
- * - jump to the first instruction of the condition.
- *
+ /*
+ * The structure of generated instructions is :
+ *
+ * For an array: -- | <ParameterType>[] a= Expression | int i= 0 |
+ * <ParameterType> <ParameterName> -- -- | i < a.length - jump to the
+ * instruction after the last jump if the condition is false. -- -- | s=
+ * a[i] | Body -- -- - jump to the first instruction of the condition.
+ *
+ * For an Iterable: -- | Iterator i= Expression.iterator() |
+ * <ParameterType> <ParameterName> -- -- | i.hasNext() - jump to the
+ * instruction after the last jump if the condition is false. -- -- | s=
+ * i.next() | Body -- -- - jump to the first instruction of the
+ * condition.
*/
- int bodyAddress= fInstructions.getEnd();
- Instruction body= fInstructions.getInstruction(bodyAddress);
- int conditionAddress= bodyAddress - body.getSize();
- Instruction condition= fInstructions.getInstruction(conditionAddress);
- int initAddress= conditionAddress - condition.getSize();
-
+ int bodyAddress = fInstructions.getEnd();
+ Instruction body = fInstructions.getInstruction(bodyAddress);
+ int conditionAddress = bodyAddress - body.getSize();
+ Instruction condition = fInstructions.getInstruction(conditionAddress);
+ int initAddress = conditionAddress - condition.getSize();
+
// add conditional jump
- ConditionalJump condJump= new ConditionalJump(false);
+ ConditionalJump condJump = new ConditionalJump(false);
fInstructions.insert(condJump, conditionAddress + 1);
bodyAddress++;
fCounter++;
condJump.setOffset(body.getSize() + 1);
-
+
// add jump
- Jump jump= new Jump();
+ Jump jump = new Jump();
fInstructions.add(jump);
fCounter++;
jump.setOffset(initAddress - (bodyAddress + 1));
-
// for each pending break or continue instruction which are related to
// this loop, set the offset of the corresponding jump.
- String label= getLabel(node);
- for (Iterator iter= fCompleteInstructions.iterator(); iter.hasNext();) {
- CompleteInstruction instruction= (CompleteInstruction) iter.next();
- Jump jumpInstruction= instruction.fInstruction;
- int instructionAddress= fInstructions.indexOf(jumpInstruction);
- if (instructionAddress > conditionAddress && (instruction.fLabel == null || instruction.fLabel.equals(label))) {
+ String label = getLabel(node);
+ for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
+ CompleteInstruction instruction = iter.next();
+ Jump jumpInstruction = instruction.fInstruction;
+ int instructionAddress = fInstructions.indexOf(jumpInstruction);
+ if (instructionAddress > conditionAddress
+ && (instruction.fLabel == null || instruction.fLabel
+ .equals(label))) {
iter.remove();
if (instruction.fIsBreak) {
// jump to the instruction after the last jump
- jumpInstruction.setOffset((bodyAddress - instructionAddress) + 1);
+ jumpInstruction
+ .setOffset((bodyAddress - instructionAddress) + 1);
} else {
// jump to the first instruction of the condition
jumpInstruction.setOffset(initAddress - instructionAddress);
}
}
}
-
+
storeInstruction();
}
/**
* @see ASTVisitor#endVisit(ExpressionStatement)
*/
+ @Override
public void endVisit(ExpressionStatement node) {
if (!isActive() || hasErrors())
return;
@@ -927,6 +954,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(FieldAccess)
*/
+ @Override
public void endVisit(FieldAccess node) {
if (!isActive() || hasErrors())
return;
@@ -936,6 +964,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(FieldDeclaration)
*/
+ @Override
public void endVisit(FieldDeclaration node) {
}
@@ -943,58 +972,48 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ForStatement)
*/
+ @Override
public void endVisit(ForStatement node) {
if (!isActive() || hasErrors())
return;
- /* The structure of generated instructions is :
- *
- * --
- * |initialization
- * --
- * --
- * |condition
- * --
- * - jump to the instruction after the last jump if the condition is false.
- * --
- * | body
- * --
- * --
- * | updaters
- * --
- * - jump to the first instruction of the condition.
- *
+ /*
+ * The structure of generated instructions is :
+ *
+ * -- |initialization -- -- |condition -- - jump to the instruction
+ * after the last jump if the condition is false. -- | body -- -- |
+ * updaters -- - jump to the first instruction of the condition.
*/
- String label= getLabel(node);
- boolean hasCondition= node.getExpression() != null;
+ String label = getLabel(node);
+ boolean hasCondition = node.getExpression() != null;
// get address of each part
- int updatersAddress= fInstructions.getEnd();
- Instruction updaters= fInstructions.getInstruction(updatersAddress);
- int bodyAddress= updatersAddress - updaters.getSize();
- Instruction body= fInstructions.getInstruction(bodyAddress);
- int bodyStartAddress= bodyAddress - body.getSize();
+ int updatersAddress = fInstructions.getEnd();
+ Instruction updaters = fInstructions.getInstruction(updatersAddress);
+ int bodyAddress = updatersAddress - updaters.getSize();
+ Instruction body = fInstructions.getInstruction(bodyAddress);
+ int bodyStartAddress = bodyAddress - body.getSize();
int conditionAddress;
Instruction condition;
if (hasCondition) {
- conditionAddress= bodyStartAddress;
- condition= fInstructions.getInstruction(conditionAddress);
+ conditionAddress = bodyStartAddress;
+ condition = fInstructions.getInstruction(conditionAddress);
} else {
- conditionAddress= 0;
- condition= null;
+ conditionAddress = 0;
+ condition = null;
}
// add jump
- Jump jump= new Jump();
+ Jump jump = new Jump();
fInstructions.add(jump);
fCounter++;
if (hasCondition) {
// add conditional jump
- ConditionalJump condJump= new ConditionalJump(false);
+ ConditionalJump condJump = new ConditionalJump(false);
fInstructions.insert(condJump, conditionAddress + 1);
bodyAddress++;
bodyStartAddress++;
@@ -1005,19 +1024,23 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
// set jump offset
- jump.setOffset(-((hasCondition && (condition != null) ? condition.getSize() : 0) + body.getSize() + updaters.getSize() + 2));
+ jump.setOffset(-((hasCondition && (condition != null) ? condition
+ .getSize() : 0) + body.getSize() + updaters.getSize() + 2));
// for each pending break or continue instruction which are related to
// this loop, set the offset of the corresponding jump.
- for (Iterator iter= fCompleteInstructions.iterator(); iter.hasNext();) {
- CompleteInstruction instruction= (CompleteInstruction) iter.next();
- Jump jumpInstruction= instruction.fInstruction;
- int instructionAddress= fInstructions.indexOf(jumpInstruction);
- if (instructionAddress > bodyStartAddress && (instruction.fLabel == null || instruction.fLabel.equals(label))) {
+ for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
+ CompleteInstruction instruction = iter.next();
+ Jump jumpInstruction = instruction.fInstruction;
+ int instructionAddress = fInstructions.indexOf(jumpInstruction);
+ if (instructionAddress > bodyStartAddress
+ && (instruction.fLabel == null || instruction.fLabel
+ .equals(label))) {
iter.remove();
if (instruction.fIsBreak) {
// jump to the instruction after the last jump
- jumpInstruction.setOffset((updatersAddress - instructionAddress) + 1);
+ jumpInstruction
+ .setOffset((updatersAddress - instructionAddress) + 1);
} else {
// jump to the first instruction of the condition
jumpInstruction.setOffset(bodyAddress - instructionAddress);
@@ -1031,42 +1054,44 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(IfStatement)
*/
+ @Override
public void endVisit(IfStatement node) {
if (!isActive() || hasErrors())
return;
- boolean hasElseStatement= node.getElseStatement() != null;
+ boolean hasElseStatement = node.getElseStatement() != null;
// Get the instructions
- int ifFalseAddress= 0;
- Instruction ifFalse= null;
- int ifTrueAddress= 0;
- Instruction ifTrue= null;
+ int ifFalseAddress = 0;
+ Instruction ifFalse = null;
+ int ifTrueAddress = 0;
+ Instruction ifTrue = null;
if (hasElseStatement) {
- ifFalseAddress= fInstructions.getEnd();
- ifFalse= fInstructions.get(ifFalseAddress);
- ifTrueAddress= ifFalseAddress - ifFalse.getSize();
- ifTrue= fInstructions.get(ifTrueAddress);
+ ifFalseAddress = fInstructions.getEnd();
+ ifFalse = fInstructions.get(ifFalseAddress);
+ ifTrueAddress = ifFalseAddress - ifFalse.getSize();
+ ifTrue = fInstructions.get(ifTrueAddress);
} else {
- ifTrueAddress= fInstructions.getEnd();
- ifTrue= fInstructions.get(ifTrueAddress);
+ ifTrueAddress = fInstructions.getEnd();
+ ifTrue = fInstructions.get(ifTrueAddress);
}
- int conditionalAddress= ifTrueAddress - ifTrue.getSize();
+ int conditionalAddress = ifTrueAddress - ifTrue.getSize();
// Insert the conditional jump
- ConditionalJump conditionalJump= new ConditionalJump(false);
+ ConditionalJump conditionalJump = new ConditionalJump(false);
fInstructions.insert(conditionalJump, conditionalAddress + 1);
// Set the jump offset
- conditionalJump.setOffset(ifTrue.getSize() + ((hasElseStatement)? 1 : 0));
+ conditionalJump.setOffset(ifTrue.getSize()
+ + ((hasElseStatement) ? 1 : 0));
fCounter++;
if (hasElseStatement) {
// Insert the jump
- int jumpAddress= ifTrueAddress + 2;
- Jump jump= new Jump();
+ int jumpAddress = ifTrueAddress + 2;
+ Jump jump = new Jump();
fInstructions.insert(jump, jumpAddress);
// Set the jump offset
jump.setOffset(ifFalse.getSize() + 1);
@@ -1080,6 +1105,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ImportDeclaration)
*/
+ @Override
public void endVisit(ImportDeclaration node) {
}
@@ -1087,12 +1113,14 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(InfixExpression)
*/
+ @Override
public void endVisit(InfixExpression node) {
}
/**
* @see ASTVisitor#endVisit(Initializer)
*/
+ @Override
public void endVisit(Initializer node) {
}
@@ -1100,6 +1128,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(InstanceofExpression)
*/
+ @Override
public void endVisit(InstanceofExpression node) {
if (!isActive() || hasErrors())
return;
@@ -1109,6 +1138,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(Javadoc)
*/
+ @Override
public void endVisit(Javadoc node) {
}
@@ -1116,23 +1146,25 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(LabeledStatement)
*/
+ @Override
public void endVisit(LabeledStatement node) {
if (!isActive() || hasErrors())
return;
- String label= node.getLabel().getIdentifier();
+ String label = node.getLabel().getIdentifier();
// for each pending continue instruction which are related to
// this statement, set the offset of the corresponding jump.
- for (Iterator iter= fCompleteInstructions.iterator(); iter.hasNext();) {
- CompleteInstruction instruction= (CompleteInstruction) iter.next();
+ for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
+ CompleteInstruction instruction = iter.next();
if (instruction.fLabel != null && instruction.fLabel.equals(label)) {
iter.remove();
- Jump jumpInstruction= instruction.fInstruction;
- int instructionAddress= fInstructions.indexOf(jumpInstruction);
+ Jump jumpInstruction = instruction.fInstruction;
+ int instructionAddress = fInstructions.indexOf(jumpInstruction);
if (instruction.fIsBreak) {
// jump to the instruction after the statement
- jumpInstruction.setOffset(fInstructions.getEnd() - instructionAddress);
+ jumpInstruction.setOffset(fInstructions.getEnd()
+ - instructionAddress);
}
}
}
@@ -1141,6 +1173,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(MethodDeclaration)
*/
+ @Override
public void endVisit(MethodDeclaration node) {
setActive(false);
}
@@ -1148,6 +1181,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(MethodInvocation)
*/
+ @Override
public void endVisit(MethodInvocation node) {
if (!isActive() || hasErrors())
return;
@@ -1157,6 +1191,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(NullLiteral)
*/
+ @Override
public void endVisit(NullLiteral node) {
if (!isActive() || hasErrors())
return;
@@ -1166,6 +1201,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(NumberLiteral)
*/
+ @Override
public void endVisit(NumberLiteral node) {
if (!isActive() || hasErrors())
return;
@@ -1175,6 +1211,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(PackageDeclaration)
*/
+ @Override
public void endVisit(PackageDeclaration node) {
}
@@ -1182,6 +1219,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SimpleType)
*/
+ @Override
public void endVisit(ParameterizedType node) {
if (!isActive() || hasErrors())
return;
@@ -1191,6 +1229,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ParenthesizedExpression)
*/
+ @Override
public void endVisit(ParenthesizedExpression node) {
}
@@ -1198,6 +1237,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(PostfixExpression)
*/
+ @Override
public void endVisit(PostfixExpression node) {
if (!isActive() || hasErrors())
return;
@@ -1207,6 +1247,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(PrefixExpression)
*/
+ @Override
public void endVisit(PrefixExpression node) {
if (!isActive() || hasErrors())
return;
@@ -1216,21 +1257,24 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(PrimitiveType)
*/
+ @Override
public void endVisit(PrimitiveType node) {
if (!isActive() || hasErrors())
return;
- storeInstruction();
+ storeInstruction();
}
/**
* @see ASTVisitor#endVisit(QualifiedName)
*/
+ @Override
public void endVisit(QualifiedName node) {
}
/**
* @see ASTVisitor#endVisit(SimpleType)
*/
+ @Override
public void endVisit(QualifiedType node) {
if (!isActive() || hasErrors())
return;
@@ -1240,6 +1284,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ReturnStatement)
*/
+ @Override
public void endVisit(ReturnStatement node) {
if (!isActive() || hasErrors())
return;
@@ -1249,6 +1294,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SimpleName)
*/
+ @Override
public void endVisit(SimpleName node) {
if (!isActive() || hasErrors())
return;
@@ -1258,6 +1304,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SimpleType)
*/
+ @Override
public void endVisit(SimpleType node) {
if (!isActive() || hasErrors())
return;
@@ -1267,6 +1314,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SingleVariableDeclaration)
*/
+ @Override
public void endVisit(SingleVariableDeclaration node) {
if (!isActive() || hasErrors())
return;
@@ -1276,6 +1324,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(StringLiteral)
*/
+ @Override
public void endVisit(StringLiteral node) {
if (!isActive() || hasErrors())
return;
@@ -1285,6 +1334,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SuperConstructorInvocation)
*/
+ @Override
public void endVisit(SuperConstructorInvocation node) {
}
@@ -1292,6 +1342,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SuperFieldAccess)
*/
+ @Override
public void endVisit(SuperFieldAccess node) {
if (!isActive() || hasErrors())
return;
@@ -1301,6 +1352,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SuperMethodInvocation)
*/
+ @Override
public void endVisit(SuperMethodInvocation node) {
if (!isActive() || hasErrors())
return;
@@ -1310,6 +1362,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SwitchCase)
*/
+ @Override
public void endVisit(SwitchCase node) {
// never called
}
@@ -1317,6 +1370,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SwitchStatement)
*/
+ @Override
public void endVisit(SwitchStatement node) {
// nothing to do
}
@@ -1324,6 +1378,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(SynchronizedStatement)
*/
+ @Override
public void endVisit(SynchronizedStatement node) {
}
@@ -1331,6 +1386,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ThisExpression)
*/
+ @Override
public void endVisit(ThisExpression node) {
if (!isActive() || hasErrors())
return;
@@ -1340,6 +1396,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(ThrowStatement)
*/
+ @Override
public void endVisit(ThrowStatement node) {
if (!isActive() || hasErrors())
return;
@@ -1349,6 +1406,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(TryStatement)
*/
+ @Override
public void endVisit(TryStatement node) {
}
@@ -1356,6 +1414,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(TypeDeclaration)
*/
+ @Override
public void endVisit(TypeDeclaration node) {
}
@@ -1363,6 +1422,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(TypeDeclarationStatement)
*/
+ @Override
public void endVisit(TypeDeclarationStatement node) {
}
@@ -1370,6 +1430,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(TypeLiteral)
*/
+ @Override
public void endVisit(TypeLiteral node) {
if (!isActive() || hasErrors())
return;
@@ -1379,6 +1440,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(VariableDeclarationExpression)
*/
+ @Override
public void endVisit(VariableDeclarationExpression node) {
}
@@ -1386,6 +1448,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(VariableDeclarationFragment)
*/
+ @Override
public void endVisit(VariableDeclarationFragment node) {
if (!isActive() || hasErrors())
return;
@@ -1395,6 +1458,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(VariableDeclarationStatement)
*/
+ @Override
public void endVisit(VariableDeclarationStatement node) {
}
@@ -1402,37 +1466,33 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(WhileStatement)
*/
+ @Override
public void endVisit(WhileStatement node) {
if (!isActive() || hasErrors())
return;
- /* The structure of generated instructions is :
- *
- * --
- * |condition
- * --
- * - jump to the instruction after the last jump if the condition is false.
- * --
- * | body
- * --
- * - jump to the first instruction of the condition.
- *
+ /*
+ * The structure of generated instructions is :
+ *
+ * -- |condition -- - jump to the instruction after the last jump if the
+ * condition is false. -- | body -- - jump to the first instruction of
+ * the condition.
*/
- String label= getLabel(node);
+ String label = getLabel(node);
// get address of each part
- int bodyAddress= fInstructions.getEnd();
- Instruction body= fInstructions.getInstruction(bodyAddress);
- int conditionAddress= bodyAddress - body.getSize();
- Instruction condition= fInstructions.getInstruction(conditionAddress);
+ int bodyAddress = fInstructions.getEnd();
+ Instruction body = fInstructions.getInstruction(bodyAddress);
+ int conditionAddress = bodyAddress - body.getSize();
+ Instruction condition = fInstructions.getInstruction(conditionAddress);
// add the conditionnalJump
- ConditionalJump conditionalJump= new ConditionalJump(false);
+ ConditionalJump conditionalJump = new ConditionalJump(false);
fInstructions.insert(conditionalJump, conditionAddress + 1);
// add the jump
- Jump jump= new Jump();
+ Jump jump = new Jump();
fInstructions.add(jump);
// set jump offsets
@@ -1441,51 +1501,59 @@ public class ASTInstructionCompiler extends ASTVisitor {
// for each pending break or continue instruction which are related to
// this loop, set the offset of the corresponding jump.
- for (Iterator iter= fCompleteInstructions.iterator(); iter.hasNext();) {
- CompleteInstruction instruction= (CompleteInstruction) iter.next();
- Jump jumpInstruction= instruction.fInstruction;
- int instructionAddress= fInstructions.indexOf(jumpInstruction);
- if (instructionAddress > conditionAddress && (instruction.fLabel == null || instruction.fLabel.equals(label))) {
+ for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
+ CompleteInstruction instruction = iter.next();
+ Jump jumpInstruction = instruction.fInstruction;
+ int instructionAddress = fInstructions.indexOf(jumpInstruction);
+ if (instructionAddress > conditionAddress
+ && (instruction.fLabel == null || instruction.fLabel
+ .equals(label))) {
iter.remove();
if (instruction.fIsBreak) {
// jump to the instruction after the last jump
- jumpInstruction.setOffset((bodyAddress - instructionAddress) + 2);
+ jumpInstruction
+ .setOffset((bodyAddress - instructionAddress) + 2);
} else {
// jump to the first instruction of the condition
- jumpInstruction.setOffset((conditionAddress - condition.getSize()) - instructionAddress);
+ jumpInstruction.setOffset((conditionAddress - condition
+ .getSize()) - instructionAddress);
}
}
}
- fCounter+= 2;
+ fCounter += 2;
storeInstruction();
}
/*
* Visit methods
- *
- * There are two variations of node visiting:
- * <ol>
- * <li>Push the instruction corresponding to the node
- * onto the stack and return <code>true</code> to visit
- * the children of the node.</li>
- * <li>Push the instruction corresponding to the node
- * onto the stack and visit the children of the node
- * manually (return <code>false</code> to avoid the
- * default child visiting implementation).</li>
- * </ol>
+ *
+ * There are two variations of node visiting: <ol> <li>Push the instruction
+ * corresponding to the node onto the stack and return <code>true</code> to
+ * visit the children of the node.</li> <li>Push the instruction
+ * corresponding to the node onto the stack and visit the children of the
+ * node manually (return <code>false</code> to avoid the default child
+ * visiting implementation).</li> </ol>
*/
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * AnnotationTypeDeclaration)
*/
+ @Override
public boolean visit(AnnotationTypeDeclaration node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * AnnotationTypeMemberDeclaration)
*/
+ @Override
public boolean visit(AnnotationTypeMemberDeclaration node) {
return false;
}
@@ -1493,24 +1561,27 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(AnonymousClassDeclaration)
*/
+ @Override
public boolean visit(AnonymousClassDeclaration node) {
if (!isActive()) {
return true;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Anonymous_type_declaration_cannot_be_used_in_an_evaluation_expression_2);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Anonymous_type_declaration_cannot_be_used_in_an_evaluation_expression_2);
return false;
}
/**
* @see ASTVisitor#visit(ArrayAccess)
*/
+ @Override
public boolean visit(ArrayAccess node) {
if (!isActive()) {
return false;
}
- push(new org.eclipse.jdt.internal.debug.eval.ast.instructions.ArrayAccess(fCounter));
+ push(new org.eclipse.jdt.internal.debug.eval.ast.instructions.ArrayAccess(
+ fCounter));
return true;
}
@@ -1518,21 +1589,23 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ArrayCreation)
*/
+ @Override
public boolean visit(ArrayCreation node) {
if (!isActive()) {
return false;
}
- ArrayType arrayType= node.getType();
+ ArrayType arrayType = node.getType();
ITypeBinding binding = resolveTypeBinding(arrayType);
if (binding != null && isALocalType(binding.getElementType())) {
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Local_type_array_instance_creation_cannot_be_used_in_an_evaluation_expression_29);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Local_type_array_instance_creation_cannot_be_used_in_an_evaluation_expression_29);
setHasError(true);
return false;
}
- push(new ArrayAllocation(arrayType.getDimensions(), node.dimensions().size(), node.getInitializer() != null, fCounter));
+ push(new ArrayAllocation(arrayType.getDimensions(), node.dimensions()
+ .size(), node.getInitializer() != null, fCounter));
return true;
}
@@ -1540,6 +1613,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ArrayInitializer)
*/
+ @Override
public boolean visit(ArrayInitializer node) {
if (!isActive()) {
return false;
@@ -1547,9 +1621,10 @@ public class ASTInstructionCompiler extends ASTVisitor {
ITypeBinding typeBinding = resolveTypeBinding(node);
if (typeBinding != null) {
- int dimension= typeBinding.getDimensions();
- String signature= getTypeSignature(typeBinding.getElementType());
- push(new ArrayInitializerInstruction(signature, node.expressions().size(), dimension, fCounter));
+ int dimension = typeBinding.getDimensions();
+ String signature = getTypeSignature(typeBinding.getElementType());
+ push(new ArrayInitializerInstruction(signature, node.expressions()
+ .size(), dimension, fCounter));
}
return true;
@@ -1558,14 +1633,16 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ArrayType)
*/
+ @Override
public boolean visit(ArrayType node) {
if (!isActive()) {
return false;
}
- ITypeBinding arrayTypeBinding= resolveTypeBinding(node);
+ ITypeBinding arrayTypeBinding = resolveTypeBinding(node);
if (arrayTypeBinding != null) {
- int dimension= arrayTypeBinding.getDimensions();
- String signature= getTypeSignature(arrayTypeBinding.getElementType());
+ int dimension = arrayTypeBinding.getDimensions();
+ String signature = getTypeSignature(arrayTypeBinding
+ .getElementType());
push(new PushArrayType(signature, dimension, fCounter));
}
@@ -1575,24 +1652,26 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(AssertStatement)
*/
+ @Override
public boolean visit(AssertStatement node) {
if (!isActive()) {
return false;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Assert_statement_cannot_be_used_in_an_evaluation_expression_3);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Assert_statement_cannot_be_used_in_an_evaluation_expression_3);
return false;
}
/**
* @see ASTVisitor#visit(Assignment)
*/
+ @Override
public boolean visit(Assignment node) {
if (!isActive()) {
return false;
}
- Expression leftHandSide= node.getLeftHandSide();
- Expression rightHandSide= node.getRightHandSide();
+ Expression leftHandSide = node.getLeftHandSide();
+ Expression rightHandSide = node.getRightHandSide();
int variableTypeId = getTypeId(leftHandSide);
int valueTypeId = getTypeId(rightHandSide);
@@ -1616,86 +1695,102 @@ public class ASTInstructionCompiler extends ASTVisitor {
// If the variable is an object, the value may need to be boxed for
// the simple assignment.
// For the compound assignment operators, the value of the variable
- // have to be un-boxed before the operation is done, then re-boxed to
+ // have to be un-boxed before the operation is done, then re-boxed
+ // to
// to be stored in the variable.
-
- int unboxedVariableTypeId= getUnBoxedTypeId(leftHandSide);
- int unboxedValueTypeId= getUnBoxedTypeId(rightHandSide);
- int unboxedResultTypeId= Instruction.getBinaryPromotionType(unboxedVariableTypeId, unboxedValueTypeId);
- push(new AssignmentOperator(variableTypeId, variableTypeId, fCounter));
-
+ int unboxedVariableTypeId = getUnBoxedTypeId(leftHandSide);
+ int unboxedValueTypeId = getUnBoxedTypeId(rightHandSide);
+ int unboxedResultTypeId = Instruction.getBinaryPromotionType(
+ unboxedVariableTypeId, unboxedValueTypeId);
+
+ push(new AssignmentOperator(variableTypeId, variableTypeId,
+ fCounter));
+
leftHandSide.accept(this);
-
+
if (char0 == '=') {
-
- boolean storeRequired= false;
+
+ boolean storeRequired = false;
if (rightBinding.isPrimitive()) {
boxing(leftBinding, rightBinding);
- storeRequired= true;
+ storeRequired = true;
}
rightHandSide.accept(this);
if (storeRequired) {
storeInstruction(); // boxing
}
-
+
} else {
boolean unrecognized = false;
-
-
+
boxing(leftBinding, rightBinding);
-
+
switch (char0) {
- case '=': // equal
- break;
- case '+': // plus equal
- push(new PlusOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '-': // minus equal
- push(new MinusOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '*': // multiply equal
- push(new MultiplyOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '/': // divide equal
- push(new DivideOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '%': // remainder equal
- push(new RemainderOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '^': // XOr equal
- push(new XorOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '|': // or equal
- push(new OrOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '&': // and equal
- push(new AndOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '<': // left shift equal
- push(new LeftShiftOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ case '=': // equal
+ break;
+ case '+': // plus equal
+ push(new PlusOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '-': // minus equal
+ push(new MinusOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '*': // multiply equal
+ push(new MultiplyOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '/': // divide equal
+ push(new DivideOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '%': // remainder equal
+ push(new RemainderOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '^': // XOr equal
+ push(new XorOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '|': // or equal
+ push(new OrOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '&': // and equal
+ push(new AndOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '<': // left shift equal
+ push(new LeftShiftOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId, fCounter));
+ break;
+ case '>': // right shift equal or unsigned right shift equal
+ switch (char2) {
+ case '=': // right shift equal
+ push(new RightShiftOperator(unboxedVariableTypeId,
+ unboxedValueTypeId, unboxedResultTypeId,
+ fCounter));
break;
- case '>': // right shift equal or unsigned right shift equal
- switch (char2) {
- case '=': // right shift equal
- push(new RightShiftOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- case '>': // unsigned right shift equal
- push(new UnsignedRightShiftOperator(unboxedVariableTypeId, unboxedValueTypeId, unboxedResultTypeId, fCounter));
- break;
- default:
- unrecognized = true;
- break;
- }
+ case '>': // unsigned right shift equal
+ push(new UnsignedRightShiftOperator(
+ unboxedVariableTypeId, unboxedValueTypeId,
+ unboxedResultTypeId, fCounter));
break;
default:
unrecognized = true;
break;
+ }
+ break;
+ default:
+ unrecognized = true;
+ break;
}
if (unrecognized) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Unrecognized_assignment_operator____4 + opToken);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Unrecognized_assignment_operator____4
+ + opToken);
return false;
}
@@ -1703,93 +1798,107 @@ public class ASTInstructionCompiler extends ASTVisitor {
push(new Dup());
storeInstruction(); // dupe
storeInstruction(); // un-boxing
-
- boolean storeRequired= unBoxing(rightBinding);
+
+ boolean storeRequired = unBoxing(rightBinding);
rightHandSide.accept(this);
if (storeRequired) {
storeInstruction(); // un-boxing
}
-
+
storeInstruction(); // operation
storeInstruction(); // boxing
-
+
}
-
+
} else {
boolean unrecognized = false;
-
+
switch (char0) {
- case '=': // equal
- push(new AssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '+': // plus equal
- push(new PlusAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '-': // minus equal
- push(new MinusAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '*': // multiply equal
- push(new MultiplyAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '/': // divide equal
- push(new DivideAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '%': // remainder equal
- push(new RemainderAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '^': // XOr equal
- push(new XorAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '|': // or equal
- push(new OrAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '&': // and equal
- push(new AndAssignmentOperator(variableTypeId, valueTypeId, fCounter));
+ case '=': // equal
+ push(new AssignmentOperator(variableTypeId, valueTypeId,
+ fCounter));
+ break;
+ case '+': // plus equal
+ push(new PlusAssignmentOperator(variableTypeId, valueTypeId,
+ fCounter));
+ break;
+ case '-': // minus equal
+ push(new MinusAssignmentOperator(variableTypeId, valueTypeId,
+ fCounter));
+ break;
+ case '*': // multiply equal
+ push(new MultiplyAssignmentOperator(variableTypeId,
+ valueTypeId, fCounter));
+ break;
+ case '/': // divide equal
+ push(new DivideAssignmentOperator(variableTypeId, valueTypeId,
+ fCounter));
+ break;
+ case '%': // remainder equal
+ push(new RemainderAssignmentOperator(variableTypeId,
+ valueTypeId, fCounter));
+ break;
+ case '^': // XOr equal
+ push(new XorAssignmentOperator(variableTypeId, valueTypeId,
+ fCounter));
+ break;
+ case '|': // or equal
+ push(new OrAssignmentOperator(variableTypeId, valueTypeId,
+ fCounter));
+ break;
+ case '&': // and equal
+ push(new AndAssignmentOperator(variableTypeId, valueTypeId,
+ fCounter));
+ break;
+ case '<': // left shift equal
+ push(new LeftShiftAssignmentOperator(variableTypeId,
+ valueTypeId, fCounter));
+ break;
+ case '>': // right shift equal or unsigned right shift equal
+ switch (char2) {
+ case '=': // right shift equal
+ push(new RightShiftAssignmentOperator(variableTypeId,
+ valueTypeId, fCounter));
break;
- case '<': // left shift equal
- push(new LeftShiftAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '>': // right shift equal or unsigned right shift equal
- switch (char2) {
- case '=': // right shift equal
- push(new RightShiftAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- case '>': // unsigned right shift equal
- push(new UnsignedRightShiftAssignmentOperator(variableTypeId, valueTypeId, fCounter));
- break;
- default:
- unrecognized = true;
- break;
- }
+ case '>': // unsigned right shift equal
+ push(new UnsignedRightShiftAssignmentOperator(
+ variableTypeId, valueTypeId, fCounter));
break;
default:
unrecognized = true;
break;
+ }
+ break;
+ default:
+ unrecognized = true;
+ break;
}
-
+
if (unrecognized) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Unrecognized_assignment_operator____4 + opToken);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Unrecognized_assignment_operator____4
+ + opToken);
return false;
}
-
+
leftHandSide.accept(this);
- boolean storeRequired= unBoxing(rightBinding);
+ boolean storeRequired = unBoxing(rightBinding);
rightHandSide.accept(this);
if (storeRequired) {
storeInstruction();
}
}
-
+
return false;
-
+
}
/**
* @see ASTVisitor#visit(Block)
*/
+ @Override
public boolean visit(Block node) {
- int start= node.getStartPosition();
+ int start = node.getStartPosition();
if (start == fStartPosition || start == (fStartPosition + 1)) {
setActive(true);
}
@@ -1802,16 +1911,21 @@ public class ASTInstructionCompiler extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BlockComment)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * BlockComment)
*/
+ @Override
public boolean visit(BlockComment node) {
return false;
}
-
+
/**
* @see ASTVisitor#visit(BooleanLiteral)
*/
+ @Override
public boolean visit(BooleanLiteral node) {
if (!isActive()) {
return false;
@@ -1825,6 +1939,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(BreakStatement)
*/
+ @Override
public boolean visit(BreakStatement node) {
if (!isActive()) {
return false;
@@ -1832,14 +1947,15 @@ public class ASTInstructionCompiler extends ASTVisitor {
// create the equivalent jump instruction in the instruction
// and add an element in the list of pending break and continue
// instructions
- Jump instruction= new Jump();
- SimpleName labelName= node.getLabel();
- String label= null;
+ Jump instruction = new Jump();
+ SimpleName labelName = node.getLabel();
+ String label = null;
if (labelName != null) {
- label= labelName.getIdentifier();
+ label = labelName.getIdentifier();
}
push(instruction);
- fCompleteInstructions.add(new CompleteInstruction(instruction, label, true));
+ fCompleteInstructions.add(new CompleteInstruction(instruction, label,
+ true));
return false;
}
@@ -1847,22 +1963,23 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(CastExpression)
*/
+ @Override
public boolean visit(CastExpression node) {
if (!isActive()) {
return false;
}
- Type type= node.getType();
- int typeId= getTypeId(type);
- ITypeBinding typeBinding= resolveTypeBinding(type);
-
+ Type type = node.getType();
+ int typeId = getTypeId(type);
+ ITypeBinding typeBinding = resolveTypeBinding(type);
+
if (typeBinding != null) {
String baseTypeSignature;
- int dimension= typeBinding.getDimensions();
+ int dimension = typeBinding.getDimensions();
if (typeBinding.isArray()) {
- typeBinding= typeBinding.getElementType();
+ typeBinding = typeBinding.getElementType();
}
- baseTypeSignature= getTypeName(typeBinding);
+ baseTypeSignature = getTypeName(typeBinding);
push(new Cast(typeId, baseTypeSignature, dimension, fCounter));
node.getExpression().accept(this);
}
@@ -1873,18 +1990,20 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(CatchClause)
*/
+ @Override
public boolean visit(CatchClause node) {
if (!isActive()) {
return false;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Catch_clause_cannot_be_used_in_an_evaluation_expression_6);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Catch_clause_cannot_be_used_in_an_evaluation_expression_6);
return false;
}
/**
* @see ASTVisitor#visit(CharacterLiteral)
*/
+ @Override
public boolean visit(CharacterLiteral node) {
if (!isActive()) {
return false;
@@ -1896,9 +2015,12 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
/**
- * return false, visit expression, type name & arguments, don't visit body declaration
+ * return false, visit expression, type name & arguments, don't visit body
+ * declaration
+ *
* @see ASTVisitor#visit(ClassInstanceCreation)
*/
+ @Override
public boolean visit(ClassInstanceCreation node) {
if (!isActive()) {
return true;
@@ -1906,50 +2028,55 @@ public class ASTInstructionCompiler extends ASTVisitor {
if (node.getAnonymousClassDeclaration() != null) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Anonymous_type_declaration_cannot_be_used_in_an_evaluation_expression_7);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Anonymous_type_declaration_cannot_be_used_in_an_evaluation_expression_7);
}
- IMethodBinding methodBinding= node.resolveConstructorBinding();
+ IMethodBinding methodBinding = node.resolveConstructorBinding();
if (methodBinding == null) {
setHasError(true);
- addErrorMessage(MessageFormat.format(EvaluationEngineMessages.ASTInstructionCompiler_1, new String[]{node.toString()}));
+ addErrorMessage(MessageFormat.format(
+ EvaluationEngineMessages.ASTInstructionCompiler_1,
+ new Object[] { node.toString() }));
return false;
}
- ITypeBinding typeBinding= methodBinding.getDeclaringClass();
+ ITypeBinding typeBinding = methodBinding.getDeclaringClass();
- boolean isInstanceMemberType= typeBinding.isMember() && ! Modifier.isStatic(typeBinding.getModifiers());
+ boolean isInstanceMemberType = typeBinding.isMember()
+ && !Modifier.isStatic(typeBinding.getModifiers());
if (isALocalType(typeBinding)) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Constructor_of_a_local_type_cannot_be_used_in_an_evaluation_expression_8);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Constructor_of_a_local_type_cannot_be_used_in_an_evaluation_expression_8);
}
if (containsALocalType(methodBinding)) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Constructor_which_contains_a_local_type_as_parameter_cannot_be_used_in_an_evaluation_expression_30);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Constructor_which_contains_a_local_type_as_parameter_cannot_be_used_in_an_evaluation_expression_30);
}
-
if (hasErrors()) {
return false;
}
- int paramCount= methodBinding.getParameterTypes().length;
+ int paramCount = methodBinding.getParameterTypes().length;
- String enclosingTypeSignature= null;
- ITypeBinding enclosingTypeBinding= null;
+ String enclosingTypeSignature = null;
+ ITypeBinding enclosingTypeBinding = null;
if (isInstanceMemberType) {
- enclosingTypeBinding= typeBinding.getDeclaringClass();
+ enclosingTypeBinding = typeBinding.getDeclaringClass();
if (enclosingTypeBinding == null) {
setHasError(true);
- addErrorMessage(MessageFormat.format(EvaluationEngineMessages.ASTInstructionCompiler_2, new String[]{typeBinding.getQualifiedName()}));
+ addErrorMessage(MessageFormat.format(
+ EvaluationEngineMessages.ASTInstructionCompiler_2,
+ new Object[] { typeBinding.getQualifiedName() }));
return false;
}
- enclosingTypeSignature= getTypeSignature(enclosingTypeBinding);
+ enclosingTypeSignature = getTypeSignature(enclosingTypeBinding);
paramCount++;
}
- String signature= getMethodSignature(methodBinding, enclosingTypeSignature).replace('.','/');
+ String signature = getMethodSignature(methodBinding,
+ enclosingTypeSignature).replace('.', '/');
push(new Constructor(signature, paramCount, fCounter));
@@ -1957,18 +2084,20 @@ public class ASTInstructionCompiler extends ASTVisitor {
storeInstruction();
if (isInstanceMemberType) {
- Expression optionalExpression= node.getExpression();
+ Expression optionalExpression = node.getExpression();
if (optionalExpression != null) {
optionalExpression.accept(this);
} else {
- // for a non-static inner class, check if we are not in a static context (method)
- ASTNode parent= node;
+ // for a non-static inner class, check if we are not in a static
+ // context (method)
+ ASTNode parent = node;
do {
- parent= parent.getParent();
- } while (! (parent instanceof MethodDeclaration));
- if (Modifier.isStatic(((MethodDeclaration)parent).getModifiers())) {
+ parent = parent.getParent();
+ } while (!(parent instanceof MethodDeclaration));
+ if (Modifier.isStatic(((MethodDeclaration) parent)
+ .getModifiers())) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Must_explicitly_qualify_the_allocation_with_an_instance_of_the_enclosing_type_33);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Must_explicitly_qualify_the_allocation_with_an_instance_of_the_enclosing_type_33);
return false;
}
@@ -1977,7 +2106,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
}
- List arguments = node.arguments();
+ List<Expression> arguments = node.arguments();
pushMethodArguments(methodBinding, arguments);
return false;
@@ -1986,6 +2115,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(CompilationUnit)
*/
+ @Override
public boolean visit(CompilationUnit node) {
return true;
}
@@ -1993,6 +2123,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ConditionalExpression)
*/
+ @Override
public boolean visit(ConditionalExpression node) {
if (!isActive()) {
return true;
@@ -2006,18 +2137,20 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ConstructorInvocation)
*/
+ @Override
public boolean visit(ConstructorInvocation node) {
if (!isActive()) {
return false;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_this_constructor_invocation_cannot_be_used_in_an_evaluation_expression_9);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_this_constructor_invocation_cannot_be_used_in_an_evaluation_expression_9);
return false;
}
/**
* @see ASTVisitor#visit(ContinueStatement)
*/
+ @Override
public boolean visit(ContinueStatement node) {
if (!isActive()) {
return false;
@@ -2025,14 +2158,15 @@ public class ASTInstructionCompiler extends ASTVisitor {
// create the equivalent jump instruction in the instruction
// and add an element in the list of pending break and continue
// instructions
- Jump instruction= new Jump();
- SimpleName labelName= node.getLabel();
- String label= null;
+ Jump instruction = new Jump();
+ SimpleName labelName = node.getLabel();
+ String label = null;
if (labelName != null) {
- label= labelName.getIdentifier();
+ label = labelName.getIdentifier();
}
push(instruction);
- fCompleteInstructions.add(new CompleteInstruction(instruction, label, false));
+ fCompleteInstructions.add(new CompleteInstruction(instruction, label,
+ false));
return false;
}
@@ -2040,6 +2174,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(DoStatement)
*/
+ @Override
public boolean visit(DoStatement node) {
if (!isActive()) {
return false;
@@ -2052,6 +2187,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(EmptyStatement)
*/
+ @Override
public boolean visit(EmptyStatement node) {
if (!isActive()) {
return false;
@@ -2060,123 +2196,140 @@ public class ASTInstructionCompiler extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnhancedForStatement)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnhancedForStatement)
*/
+ @Override
public boolean visit(EnhancedForStatement node) {
if (!isActive()) {
return false;
}
-
+
push(new NoOp(fCounter));
-
-
- ITypeBinding typeBinding= resolveTypeBinding(node.getExpression());
+
+ ITypeBinding typeBinding = resolveTypeBinding(node.getExpression());
if (typeBinding == null) {
return false;
}
- Type paramType= node.getParameter().getType();
- ITypeBinding paramBinding = resolveTypeBinding(paramType);
- if (paramBinding == null) {
+ Type paramType = node.getParameter().getType();
+ ITypeBinding paramBinding = resolveTypeBinding(paramType);
+ if (paramBinding == null) {
return false;
- }
- String typeSignature= getTypeSignature(paramBinding);
- int paramTypeId= getTypeId(paramType);
- boolean isParamPrimitiveType= paramTypeId != Instruction.T_Object && paramTypeId != Instruction.T_String;
- String paramIdentifier= node.getParameter().getName().getIdentifier();
-
+ }
+ String typeSignature = getTypeSignature(paramBinding);
+ int paramTypeId = getTypeId(paramType);
+ boolean isParamPrimitiveType = paramTypeId != Instruction.T_Object
+ && paramTypeId != Instruction.T_String;
+ String paramIdentifier = node.getParameter().getName().getIdentifier();
+
if (typeBinding.isArray()) {
// the expression returns an array
- int idIndex= fUniqueIdIndex++;
- String arrayIdentifier= "#a" + idIndex; //$NON-NLS-1$
- String varIdentifier= "#i" + idIndex; //$NON-NLS-1$
- push(new LocalVariableCreation(arrayIdentifier, typeSignature, 1, isParamPrimitiveType, true, fCounter));
- node.getExpression().accept(this);
+ int idIndex = fUniqueIdIndex++;
+ String arrayIdentifier = "#a" + idIndex; //$NON-NLS-1$
+ String varIdentifier = "#i" + idIndex; //$NON-NLS-1$
+ push(new LocalVariableCreation(arrayIdentifier, typeSignature, 1,
+ isParamPrimitiveType, true, fCounter));
+ node.getExpression().accept(this);
storeInstruction();
- push(new LocalVariableCreation(varIdentifier, "I", 0, true, true, fCounter)); //$NON-NLS-1$
- push(new PushInt(0));
- storeInstruction();
+ push(new LocalVariableCreation(varIdentifier,
+ "I", 0, true, true, fCounter)); //$NON-NLS-1$
+ push(new PushInt(0));
storeInstruction();
- push(new LocalVariableCreation(paramIdentifier, typeSignature, 0, isParamPrimitiveType, false, fCounter));
storeInstruction();
-
- push(new LessOperator(Instruction.T_int, Instruction.T_int, fCounter));
- push(new PushLocalVariable(varIdentifier));
- storeInstruction();
- push(new PushArrayLength(fCounter));
- push(new PushLocalVariable(arrayIdentifier));
- storeInstruction();
- storeInstruction();
+ push(new LocalVariableCreation(paramIdentifier, typeSignature, 0,
+ isParamPrimitiveType, false, fCounter));
+ storeInstruction();
+
+ push(new LessOperator(Instruction.T_int, Instruction.T_int,
+ fCounter));
+ push(new PushLocalVariable(varIdentifier));
storeInstruction();
-
+ push(new PushArrayLength(fCounter));
+ push(new PushLocalVariable(arrayIdentifier));
+ storeInstruction();
+ storeInstruction();
+ storeInstruction();
+
// conditional jump will be added here
-
+
push(new NoOp(fCounter));
- push(new AssignmentOperator(paramTypeId, paramTypeId, fCounter));
- push(new PushLocalVariable(paramIdentifier));
- storeInstruction();
- push(new org.eclipse.jdt.internal.debug.eval.ast.instructions.ArrayAccess(fCounter));
- push(new PushLocalVariable(arrayIdentifier));
- storeInstruction();
- push(new PostfixPlusPlusOperator(Instruction.T_int, fCounter));
- push(new PushLocalVariable(varIdentifier));
- storeInstruction();
- storeInstruction();
- storeInstruction();
- if (checkAutoBoxing(typeBinding.getElementType(), paramBinding)) {
- storeInstruction();
- }
+ push(new AssignmentOperator(paramTypeId, paramTypeId, fCounter));
+ push(new PushLocalVariable(paramIdentifier));
+ storeInstruction();
+ push(new org.eclipse.jdt.internal.debug.eval.ast.instructions.ArrayAccess(
+ fCounter));
+ push(new PushLocalVariable(arrayIdentifier));
+ storeInstruction();
+ push(new PostfixPlusPlusOperator(Instruction.T_int, fCounter));
+ push(new PushLocalVariable(varIdentifier));
+ storeInstruction();
+ storeInstruction();
+ storeInstruction();
+ if (checkAutoBoxing(typeBinding.getElementType(), paramBinding)) {
storeInstruction();
- addPopInstruction();
- node.getBody().accept(this);
+ }
+ storeInstruction();
+ addPopInstruction();
+ node.getBody().accept(this);
storeInstruction();
-
+
// jump will be added here
-
+
} else {
// the expression returns a collection
- String iteratorIdentifier= "#i" + fUniqueIdIndex++; //$NON-NLS-1$
- push(new LocalVariableCreation(iteratorIdentifier, "Ljava/util/Iterator;", 0, false, true, fCounter)); //$NON-NLS-1$
- push(new SendMessage("iterator", "()Ljava/util/Iterator;", 0, null, fCounter)); //$NON-NLS-1$//$NON-NLS-2$
- node.getExpression().accept(this);
- storeInstruction();
+ String iteratorIdentifier = "#i" + fUniqueIdIndex++; //$NON-NLS-1$
+ push(new LocalVariableCreation(iteratorIdentifier,
+ "Ljava/util/Iterator;", 0, false, true, fCounter)); //$NON-NLS-1$
+ push(new SendMessage(
+ "iterator", "()Ljava/util/Iterator;", 0, null, fCounter)); //$NON-NLS-1$//$NON-NLS-2$
+ node.getExpression().accept(this);
storeInstruction();
- push(new LocalVariableCreation(paramIdentifier, typeSignature, 0, isParamPrimitiveType, false, fCounter));
storeInstruction();
-
+ push(new LocalVariableCreation(paramIdentifier, typeSignature, 0,
+ isParamPrimitiveType, false, fCounter));
+ storeInstruction();
+
push(new SendMessage("hasNext", "()Z", 0, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
- push(new PushLocalVariable(iteratorIdentifier));
- storeInstruction();
+ push(new PushLocalVariable(iteratorIdentifier));
+ storeInstruction();
storeInstruction();
-
+
// conditional jump will be added here
-
+
push(new NoOp(fCounter));
- push(new AssignmentOperator(paramTypeId, paramTypeId, fCounter));
- push(new PushLocalVariable(paramIdentifier));
- storeInstruction();
- push(new SendMessage("next", "()Ljava/lang/Object;", 0, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
- push(new PushLocalVariable(iteratorIdentifier));
- storeInstruction();
- storeInstruction();
- if (checkAutoBoxing(typeBinding.getTypeArguments()[0], paramBinding)) {
- storeInstruction();
- }
+ push(new AssignmentOperator(paramTypeId, paramTypeId, fCounter));
+ push(new PushLocalVariable(paramIdentifier));
+ storeInstruction();
+ push(new SendMessage(
+ "next", "()Ljava/lang/Object;", 0, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ push(new PushLocalVariable(iteratorIdentifier));
+ storeInstruction();
+ storeInstruction();
+ if (checkAutoBoxing(typeBinding.getTypeArguments()[0], paramBinding)) {
storeInstruction();
- addPopInstruction();
- node.getBody().accept(this);
+ }
+ storeInstruction();
+ addPopInstruction();
+ node.getBody().accept(this);
storeInstruction();
-
+
// jump will be added here
-
+
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumConstantDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnumConstantDeclaration)
*/
+ @Override
public boolean visit(EnumConstantDeclaration node) {
if (!isActive()) {
return true;
@@ -2186,56 +2339,69 @@ public class ASTInstructionCompiler extends ASTVisitor {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnumDeclaration)
*/
+ @Override
public boolean visit(EnumDeclaration node) {
if (!isActive()) {
return true;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_0);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_0);
return false;
}
/**
* @see ASTVisitor#visit(ExpressionStatement)
*/
+ @Override
public boolean visit(ExpressionStatement node) {
return true;
}
/**
* return false, visit expression, don't visit name
- *
+ *
* @see ASTVisitor#visit(FieldAccess)
*/
+ @Override
public boolean visit(FieldAccess node) {
if (!isActive()) {
return false;
}
- SimpleName fieldName= node.getName();
- IVariableBinding fieldBinding= (IVariableBinding) fieldName.resolveBinding();
- if(fieldBinding != null) {
- ITypeBinding declaringTypeBinding= fieldBinding.getDeclaringClass();
+ SimpleName fieldName = node.getName();
+ IVariableBinding fieldBinding = (IVariableBinding) fieldName
+ .resolveBinding();
+ if (fieldBinding != null) {
+ ITypeBinding declaringTypeBinding = fieldBinding
+ .getDeclaringClass();
Expression expression = node.getExpression();
String fieldId = fieldName.getIdentifier();
-
+
if (Modifier.isStatic(fieldBinding.getModifiers())) {
- push(new PushStaticFieldVariable(fieldId, getTypeName(declaringTypeBinding), fCounter));
+ push(new PushStaticFieldVariable(fieldId,
+ getTypeName(declaringTypeBinding), fCounter));
expression.accept(this);
addPopInstruction();
} else {
- if (declaringTypeBinding == null) { // it is a field without declaring type => it is the special length array field
+ if (declaringTypeBinding == null) { // it is a field without
+ // declaring type => it is
+ // the special length array
+ // field
push(new PushArrayLength(fCounter));
} else {
if (isALocalType(declaringTypeBinding)) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Qualified_local_type_field_access_cannot_be_used_in_an_evaluation_expression_31);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Qualified_local_type_field_access_cannot_be_used_in_an_evaluation_expression_31);
return false;
}
- push(new PushFieldVariable(fieldId, getTypeSignature(declaringTypeBinding), fCounter));
+ push(new PushFieldVariable(fieldId,
+ getTypeSignature(declaringTypeBinding), fCounter));
}
expression.accept(this);
}
@@ -2246,16 +2412,17 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(FieldDeclaration)
*/
+ @Override
public boolean visit(FieldDeclaration node) {
return true;
}
/**
- * @see ASTVisitor#visit(ForStatement)
- * return <code>false</code>, don't use the standard accept order.
- * order used for visiting children :
- * initializers, condition, body, updaters
+ * @see ASTVisitor#visit(ForStatement) return <code>false</code>, don't use
+ * the standard accept order. order used for visiting children :
+ * initializers, condition, body, updaters
*/
+ @Override
public boolean visit(ForStatement node) {
if (!isActive()) {
return false;
@@ -2264,14 +2431,14 @@ public class ASTInstructionCompiler extends ASTVisitor {
push(new NoOp(fCounter));
push(new NoOp(fCounter));
- for (Iterator iter= node.initializers().iterator(); iter.hasNext();) {
- Expression expr= (Expression) iter.next();
+ for (Iterator<Expression> iter = node.initializers().iterator(); iter.hasNext();) {
+ Expression expr = iter.next();
expr.accept(this);
addPopInstructionIfNeeded(expr);
}
storeInstruction();
- Expression condition= node.getExpression();
+ Expression condition = node.getExpression();
if (condition != null) {
condition.accept(this);
}
@@ -2279,8 +2446,8 @@ public class ASTInstructionCompiler extends ASTVisitor {
node.getBody().accept(this);
push(new NoOp(fCounter));
- for (Iterator iter= node.updaters().iterator(); iter.hasNext();) {
- Expression expr= (Expression) iter.next();
+ for (Iterator<Expression> iter = node.updaters().iterator(); iter.hasNext();) {
+ Expression expr = iter.next();
expr.accept(this);
addPopInstructionIfNeeded(expr);
}
@@ -2292,6 +2459,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(IfStatement)
*/
+ @Override
public boolean visit(IfStatement node) {
if (!isActive()) {
return false;
@@ -2305,15 +2473,17 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ImportDeclaration)
*/
+ @Override
public boolean visit(ImportDeclaration node) {
return false;
}
/**
* return <code>false</code>, don't use the standard accept order.
- *
+ *
* @see ASTVisitor#visit(InfixExpression)
*/
+ @Override
public boolean visit(InfixExpression node) {
if (!isActive()) {
return false;
@@ -2331,20 +2501,21 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
}
- List extendedOperands = node.extendedOperands();
+ List<Expression> extendedOperands = node.extendedOperands();
- int operatorNumber=extendedOperands.size() + 1;
+ int operatorNumber = extendedOperands.size() + 1;
int[][] types = new int[operatorNumber][3];
- Iterator iterator = extendedOperands.iterator();
+ Iterator<Expression> iterator = extendedOperands.iterator();
- Expression leftOperand= node.getLeftOperand();
- Expression rightOperand= node.getRightOperand();
+ Expression leftOperand = node.getLeftOperand();
+ Expression rightOperand = node.getRightOperand();
int leftTypeId;
int rightTypeId;
boolean unbox = false;
- // for == and != un-box when at least operand is primitive (otherwise compare the objects)
+ // for == and != un-box when at least operand is primitive (otherwise
+ // compare the objects)
ITypeBinding leftBinding = resolveTypeBinding(leftOperand);
if (leftBinding == null) {
return false;
@@ -2359,166 +2530,188 @@ public class ASTInstructionCompiler extends ASTVisitor {
unbox = true;
}
if (unbox) {
- leftTypeId= getUnBoxedTypeId(leftOperand);
+ leftTypeId = getUnBoxedTypeId(leftOperand);
rightTypeId = getUnBoxedTypeId(rightOperand);
} else {
- leftTypeId= getTypeId(leftOperand);
+ leftTypeId = getTypeId(leftOperand);
rightTypeId = getTypeId(rightOperand);
}
- int resultTypeId = Instruction.getBinaryPromotionType(leftTypeId, rightTypeId);
+ int resultTypeId = Instruction.getBinaryPromotionType(leftTypeId,
+ rightTypeId);
types[0][0] = resultTypeId;
types[0][1] = leftTypeId;
types[0][2] = rightTypeId;
for (int i = 1; i < operatorNumber; i++) {
- Expression operand = (Expression) iterator.next();
+ Expression operand = iterator.next();
leftTypeId = resultTypeId;
rightTypeId = getUnBoxedTypeId(operand);
- resultTypeId = Instruction.getBinaryPromotionType(leftTypeId, rightTypeId);
+ resultTypeId = Instruction.getBinaryPromotionType(leftTypeId,
+ rightTypeId);
types[i][0] = resultTypeId;
types[i][1] = leftTypeId;
types[i][2] = rightTypeId;
}
- boolean unrecognized= false;
+ boolean unrecognized = false;
switch (char0) {
- case '*': // multiply
+ case '*': // multiply
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new MultiplyOperator(types[i][0], types[i][1],
+ types[i][2], fCounter));
+ }
+ break;
+ case '/': // divide
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new DivideOperator(types[i][0], types[i][1], types[i][2],
+ fCounter));
+ }
+ break;
+ case '%': // remainder
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new RemainderOperator(types[i][0], types[i][1],
+ types[i][2], fCounter));
+ }
+ break;
+ case '+': // plus
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new PlusOperator(types[i][0], types[i][1], types[i][2],
+ fCounter));
+ }
+ break;
+ case '-': // minus
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new MinusOperator(types[i][0], types[i][1], types[i][2],
+ fCounter));
+ }
+ break;
+ case '<': // left shift or less or less equal
+ switch (char1) {
+ case '\0': // less
for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new MultiplyOperator(types[i][0], types[i][1], types[i][2], fCounter));
+ push(new LessOperator(types[i][1], types[i][2], fCounter));
}
break;
- case '/': // divide
+ case '<': // left shift
for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new DivideOperator(types[i][0], types[i][1], types[i][2], fCounter));
+ push(new LeftShiftOperator(
+ Instruction.getUnaryPromotionType(types[i][1]),
+ types[i][1], types[i][2], fCounter));
}
break;
- case '%': // remainder
+ case '=': // less equal
for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new RemainderOperator(types[i][0], types[i][1], types[i][2], fCounter));
+ push(new LessEqualOperator(types[i][1], types[i][2],
+ fCounter));
}
break;
- case '+': // plus
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new PlusOperator(types[i][0], types[i][1], types[i][2], fCounter));
- }
+ default:
+ unrecognized = true;
break;
- case '-': // minus
+ }
+ break;
+ case '>': // right shift or unsigned right shift or greater or greater
+ // equal
+ switch (char1) {
+ case '\0': // greater
for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new MinusOperator(types[i][0], types[i][1], types[i][2], fCounter));
- }
- break;
- case '<': // left shift or less or less equal
- switch (char1) {
- case '\0': // less
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new LessOperator(types[i][1], types[i][2], fCounter));
- }
- break;
- case '<': // left shift
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new LeftShiftOperator(Instruction.getUnaryPromotionType(types[i][1]), types[i][1], types[i][2], fCounter));
- }
- break;
- case '=': // less equal
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new LessEqualOperator(types[i][1], types[i][2], fCounter));
- }
- break;
- default:
- unrecognized= true;
- break;
+ push(new GreaterOperator(types[i][1], types[i][2], fCounter));
}
break;
- case '>': // right shift or unsigned right shift or greater or greater equal
- switch (char1) {
- case '\0': // greater
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new GreaterOperator(types[i][1], types[i][2], fCounter));
- }
- break;
- case '>': // right shift or unsigned right shift
- switch (char2) {
- case '\0': // right shift
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new RightShiftOperator(Instruction.getUnaryPromotionType(types[i][1]), types[i][1], types[i][2], fCounter));
- }
- break;
- case '>': // unsigned right shift
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new UnsignedRightShiftOperator(Instruction.getUnaryPromotionType(types[i][1]), types[i][1], types[i][2], fCounter));
- }
- break;
- }
- break;
- case '=': // greater equal
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new GreaterEqualOperator(types[i][1], types[i][2], fCounter));
- }
- break;
- default:
- unrecognized= true;
- break;
+ case '>': // right shift or unsigned right shift
+ switch (char2) {
+ case '\0': // right shift
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new RightShiftOperator(
+ Instruction.getUnaryPromotionType(types[i][1]),
+ types[i][1], types[i][2], fCounter));
+ }
+ break;
+ case '>': // unsigned right shift
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new UnsignedRightShiftOperator(
+ Instruction.getUnaryPromotionType(types[i][1]),
+ types[i][1], types[i][2], fCounter));
+ }
+ break;
}
break;
- case '=': // equal equal
+ case '=': // greater equal
for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new EqualEqualOperator(types[i][1], types[i][2], true, fCounter));
+ push(new GreaterEqualOperator(types[i][1], types[i][2],
+ fCounter));
}
break;
- case '!': // not equal
+ default:
+ unrecognized = true;
+ break;
+ }
+ break;
+ case '=': // equal equal
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new EqualEqualOperator(types[i][1], types[i][2], true,
+ fCounter));
+ }
+ break;
+ case '!': // not equal
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new EqualEqualOperator(types[i][1], types[i][2], false,
+ fCounter));
+ }
+ break;
+ case '^': // XOr
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new XorOperator(types[i][0], types[i][1], types[i][2],
+ fCounter));
+ }
+ break;
+ case '|': // or or or or
+ switch (char1) {
+ case '\0': // or
for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new EqualEqualOperator(types[i][1], types[i][2], false, fCounter));
+ push(new OrOperator(types[i][0], types[i][1], types[i][2],
+ fCounter));
}
break;
- case '^': // XOr
+ case '|': // or or
for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new XorOperator(types[i][0], types[i][1], types[i][2], fCounter));
+ push(new NoOp(fCounter));
}
break;
- case '|': // or or or or
- switch (char1) {
- case '\0': // or
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new OrOperator(types[i][0], types[i][1], types[i][2], fCounter));
- }
- break;
- case '|': // or or
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new NoOp(fCounter));
- }
- break;
- default:
- unrecognized= true;
- break;
+ default:
+ unrecognized = true;
+ break;
+ }
+ break;
+ case '&': // and or and and
+ switch (char1) {
+ case '\0': // and
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new AndOperator(types[i][0], types[i][1], types[i][2],
+ fCounter));
}
break;
- case '&': // and or and and
- switch (char1) {
- case '\0': // and
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new AndOperator(types[i][0], types[i][1], types[i][2], fCounter));
- }
- break;
- case '&': // and and
- for (int i = operatorNumber - 1; i >= 0; i--) {
- push(new NoOp(fCounter));
- }
- break;
- default:
- unrecognized= true;
- break;
+ case '&': // and and
+ for (int i = operatorNumber - 1; i >= 0; i--) {
+ push(new NoOp(fCounter));
}
break;
default:
- unrecognized= true;
+ unrecognized = true;
break;
+ }
+ break;
+ default:
+ unrecognized = true;
+ break;
}
if (unrecognized) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Unrecognized_infix_operator____13 + opToken);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Unrecognized_infix_operator____13
+ + opToken);
}
if (hasErrors()) {
@@ -2527,43 +2720,45 @@ public class ASTInstructionCompiler extends ASTVisitor {
iterator = extendedOperands.iterator();
- if ((char0 == '&' && char1 == '&') || (char0 == '|' && char1 == '|')) { // and and operator
+ if ((char0 == '&' && char1 == '&') || (char0 == '|' && char1 == '|')) { // and
+ // and
+ // operator
- boolean isOrOr= char0 == '|';
+ boolean isOrOr = char0 == '|';
- ConditionalJump[] conditionalJumps= new ConditionalJump[operatorNumber];
+ ConditionalJump[] conditionalJumps = new ConditionalJump[operatorNumber];
int[] conditionalJumpAddresses = new int[operatorNumber];
- boolean storeRequired= unBoxing(leftBinding);
+ boolean storeRequired = unBoxing(leftBinding);
leftOperand.accept(this);
if (storeRequired) {
storeInstruction();
}
- ConditionalJump conditionalJump= new ConditionalJump(isOrOr);
- conditionalJumps[0]= conditionalJump;
+ ConditionalJump conditionalJump = new ConditionalJump(isOrOr);
+ conditionalJumps[0] = conditionalJump;
conditionalJumpAddresses[0] = fCounter;
push(conditionalJump);
storeInstruction();
- storeRequired= unBoxing(rightBinding);
+ storeRequired = unBoxing(rightBinding);
rightOperand.accept(this);
if (storeRequired) {
storeInstruction();
}
- for (int i= 1; i < operatorNumber; i ++) {
- conditionalJump= new ConditionalJump(isOrOr);
- conditionalJumps[i]= conditionalJump;
+ for (int i = 1; i < operatorNumber; i++) {
+ conditionalJump = new ConditionalJump(isOrOr);
+ conditionalJumps[i] = conditionalJump;
conditionalJumpAddresses[i] = fCounter;
push(conditionalJump);
storeInstruction();
- Expression operand= (Expression) iterator.next();
+ Expression operand = iterator.next();
ITypeBinding typeBinding = resolveTypeBinding(operand);
if (typeBinding == null) {
return false;
}
- storeRequired= unBoxing(typeBinding);
+ storeRequired = unBoxing(typeBinding);
operand.accept(this);
if (storeRequired) {
storeInstruction();
@@ -2575,8 +2770,9 @@ public class ASTInstructionCompiler extends ASTVisitor {
push(jump);
storeInstruction();
- for (int i= 0; i < operatorNumber; i ++) {
- conditionalJumps[i].setOffset(fCounter - conditionalJumpAddresses[i] - 1);
+ for (int i = 0; i < operatorNumber; i++) {
+ conditionalJumps[i].setOffset(fCounter
+ - conditionalJumpAddresses[i] - 1);
}
push(new PushBoolean(isOrOr));
@@ -2587,16 +2783,16 @@ public class ASTInstructionCompiler extends ASTVisitor {
} else { // other operators
- boolean storeRequired= false;
+ boolean storeRequired = false;
if (unbox) {
- storeRequired= unBoxing(leftBinding);
+ storeRequired = unBoxing(leftBinding);
}
leftOperand.accept(this);
if (storeRequired) {
storeInstruction();
}
if (unbox) {
- storeRequired= unBoxing(rightBinding);
+ storeRequired = unBoxing(rightBinding);
}
rightOperand.accept(this);
if (storeRequired) {
@@ -2604,14 +2800,14 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
storeInstruction();
- for (int i= 1; i < operatorNumber; i ++) {
- Expression operand= (Expression) iterator.next();
+ for (int i = 1; i < operatorNumber; i++) {
+ Expression operand = iterator.next();
if (unbox) {
ITypeBinding typeBinding = resolveTypeBinding(operand);
if (typeBinding == null) {
return false;
}
- storeRequired= unBoxing(typeBinding);
+ storeRequired = unBoxing(typeBinding);
}
operand.accept(this);
if (storeRequired) {
@@ -2621,14 +2817,13 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
}
-
-
return false;
}
/**
* @see ASTVisitor#visit(Initializer)
*/
+ @Override
public boolean visit(Initializer node) {
return true;
}
@@ -2636,6 +2831,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(InstanceofExpression)
*/
+ @Override
public boolean visit(InstanceofExpression node) {
if (!isActive()) {
return false;
@@ -2647,54 +2843,73 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(Javadoc)
*/
+ @Override
public boolean visit(Javadoc node) {
return false;
}
/**
- * @see ASTVisitor#visit(LabeledStatement)
- * return <code>false</code>, don't use the standard accept order.
+ * @see ASTVisitor#visit(LabeledStatement) return <code>false</code>, don't
+ * use the standard accept order.
*/
+ @Override
public boolean visit(LabeledStatement node) {
node.getBody().accept(this);
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.LineComment)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * LineComment)
*/
+ @Override
public boolean visit(LineComment node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MarkerAnnotation)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MarkerAnnotation)
*/
+ @Override
public boolean visit(MarkerAnnotation node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef
+ * )
*/
+ @Override
public boolean visit(MemberRef node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberValuePair)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MemberValuePair)
*/
+ @Override
public boolean visit(MemberValuePair node) {
return false;
}
-
+
/**
* @see ASTVisitor#visit(MethodDeclaration)
*/
+ @Override
public boolean visit(MethodDeclaration node) {
- int start= node.getStartPosition();
- int end= start + node.getLength();
+ int start = node.getStartPosition();
+ int end = start + node.getLength();
if (start < fStartPosition && end > fStartPosition) {
return true;
}
@@ -2703,29 +2918,31 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* return false, don't visit name, visit expression & arguments
- *
+ *
* @see ASTVisitor#visit(MethodInvocation)
*/
+ @Override
public boolean visit(MethodInvocation node) {
if (!isActive()) {
return false;
}
- IMethodBinding methodBinding= (IMethodBinding) node.getName().resolveBinding();
+ IMethodBinding methodBinding = (IMethodBinding) node.getName()
+ .resolveBinding();
if (methodBinding == null) {
- // could be the receiver is not visible - for example a private field access from super class
+ // could be the receiver is not visible - for example a private
+ // field access from super class
ASTNode root = node.getRoot();
if (root instanceof CompilationUnit) {
CompilationUnit cu = (CompilationUnit) root;
IProblem[] problems = cu.getProblems();
- for (int i = 0; i < problems.length; i++) {
- IProblem problem = problems[i];
+ for (IProblem problem : problems) {
setHasError(true);
addErrorMessage(problem.getMessage());
}
}
}
-
+
if (hasErrors()) {
return false;
}
@@ -2737,75 +2954,89 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
int paramCount = methodBinding.getParameterTypes().length;
- String selector= methodBinding.getName();
+ String selector = methodBinding.getName();
- String signature= getMethodSignature(methodBinding, null).replace('.','/');
+ String signature = getMethodSignature(methodBinding, null).replace('.',
+ '/');
- boolean isStatic= Flags.isStatic(methodBinding.getModifiers());
- Expression expression= node.getExpression();
+ boolean isStatic = Flags.isStatic(methodBinding.getModifiers());
+ Expression expression = node.getExpression();
if (isStatic) {
- String typeName= getTypeName(methodBinding.getDeclaringClass());
- push(new SendStaticMessage(typeName, selector, signature, paramCount, fCounter));
+ String typeName = getTypeName(methodBinding.getDeclaringClass());
+ push(new SendStaticMessage(typeName, selector, signature,
+ paramCount, fCounter));
if (expression != null) {
node.getExpression().accept(this);
addPopInstruction();
}
} else {
- push(new SendMessage(selector, signature, paramCount, null, fCounter));
+ push(new SendMessage(selector, signature, paramCount, null,
+ fCounter));
if (expression == null) {
- push(new PushThis(getEnclosingLevel(node, methodBinding.getDeclaringClass())));
+ push(new PushThis(getEnclosingLevel(node,
+ methodBinding.getDeclaringClass())));
storeInstruction();
} else {
node.getExpression().accept(this);
}
}
- List arguments = node.arguments();
+ List<Expression> arguments = node.arguments();
pushMethodArguments(methodBinding, arguments);
return false;
}
-
+
/**
- * Pushes method arguments onto the stack for a method or constructor invocation taking
- * variable arguments and auto-boxing into consideration.
+ * Pushes method arguments onto the stack for a method or constructor
+ * invocation taking variable arguments and auto-boxing into consideration.
*
- * @param methodBinding method or constructor being called
- * @param arguments argument list
+ * @param methodBinding
+ * method or constructor being called
+ * @param arguments
+ * argument list
*/
- private void pushMethodArguments(IMethodBinding methodBinding, List arguments) {
+ private void pushMethodArguments(IMethodBinding methodBinding, List<Expression> arguments) {
int argCount = arguments.size();
ITypeBinding[] parameterTypes = methodBinding.getParameterTypes();
int paramCount = parameterTypes.length;
ITypeBinding lastArgBinding = null;
if (methodBinding.isVarargs()) {
- Expression lastArg = (Expression)arguments.get(argCount - 1);
+ Expression lastArg = arguments.get(argCount - 1);
lastArgBinding = resolveTypeBinding(lastArg);
if (lastArgBinding == null) {
return;
}
}
- if (methodBinding.isVarargs() && !(paramCount == argCount && parameterTypes[paramCount - 1].getDimensions() == lastArgBinding.getDimensions())) {
- // if this method is a varargs, and if the method is invoked using the varargs syntax
+ if (methodBinding.isVarargs()
+ && !(paramCount == argCount && parameterTypes[paramCount - 1]
+ .getDimensions() == lastArgBinding.getDimensions())) {
+ // if this method is a varargs, and if the method is invoked using
+ // the varargs syntax
// (multiple arguments) and not an array
- Iterator iterator= arguments.iterator();
+ Iterator<Expression> iterator = arguments.iterator();
// process the first arguments (no part of the variable argument)
- for (int i= 0; i < paramCount - 1; i++) {
- Expression argument= (Expression)iterator.next();
- boolean storeRequired= checkAutoBoxing(argument.resolveTypeBinding(), parameterTypes[i]);
+ for (int i = 0; i < paramCount - 1; i++) {
+ Expression argument = iterator.next();
+ boolean storeRequired = checkAutoBoxing(
+ argument.resolveTypeBinding(), parameterTypes[i]);
argument.accept(this);
if (storeRequired) {
storeInstruction();
}
}
// create a array of the remainder arguments
- ITypeBinding varargsParameterType= parameterTypes[paramCount - 1];
- ITypeBinding varargsElementType= varargsParameterType.getElementType();
- push(new ArrayInitializerInstruction(getTypeSignature(varargsElementType), argCount - paramCount + 1, varargsParameterType.getDimensions(), fCounter));
+ ITypeBinding varargsParameterType = parameterTypes[paramCount - 1];
+ ITypeBinding varargsElementType = varargsParameterType
+ .getElementType();
+ push(new ArrayInitializerInstruction(
+ getTypeSignature(varargsElementType), argCount - paramCount
+ + 1, varargsParameterType.getDimensions(), fCounter));
while (iterator.hasNext()) {
- Expression argument= (Expression) iterator.next();
- boolean storeRequired= checkAutoBoxing(argument.resolveTypeBinding(), varargsElementType);
+ Expression argument = iterator.next();
+ boolean storeRequired = checkAutoBoxing(
+ argument.resolveTypeBinding(), varargsElementType);
argument.accept(this);
if (storeRequired) {
storeInstruction();
@@ -2813,43 +3044,62 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
storeInstruction();
} else {
- Iterator iterator= arguments.iterator();
- int i= 0;
+ Iterator<Expression> iterator = arguments.iterator();
+ int i = 0;
while (iterator.hasNext()) {
- Expression argument= (Expression) iterator.next();
- boolean storeRequired= checkAutoBoxing(argument.resolveTypeBinding(), parameterTypes[i++]);
+ Expression argument = iterator.next();
+ boolean storeRequired = checkAutoBoxing(
+ argument.resolveTypeBinding(), parameterTypes[i++]);
argument.accept(this);
if (storeRequired) {
storeInstruction();
}
}
- }
+ }
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef
+ * )
*/
+ @Override
public boolean visit(MethodRef node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRefParameter)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MethodRefParameter)
*/
+ @Override
public boolean visit(MethodRefParameter node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier
+ * )
*/
+ @Override
public boolean visit(Modifier node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NormalAnnotation)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * NormalAnnotation)
*/
+ @Override
public boolean visit(NormalAnnotation node) {
return false;
}
@@ -2857,6 +3107,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(NullLiteral)
*/
+ @Override
public boolean visit(NullLiteral node) {
if (!isActive()) {
return false;
@@ -2870,166 +3121,187 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(NumberLiteral)
*/
+ @Override
public boolean visit(NumberLiteral node) {
if (!isActive()) {
return false;
}
- int literalType= getTypeId(node);
- String token= node.getToken();
- int tokenLastCharOffset= token.length() - 1;
- char lastChar= token.charAt(tokenLastCharOffset);
- String subToken= token.substring(0, tokenLastCharOffset);
-
+ int literalType = getTypeId(node);
+ String token = node.getToken();
+ int tokenLastCharOffset = token.length() - 1;
+ char lastChar = token.charAt(tokenLastCharOffset);
+ String subToken = token.substring(0, tokenLastCharOffset);
switch (literalType) {
- case Instruction.T_byte:
- push(new PushInt(parseByteValue(token)));
- break;
- case Instruction.T_short:
- push(new PushInt(parseShortValue(token)));
- break;
- case Instruction.T_int:
- push(new PushInt(parseIntValue(token)));
- break;
- case Instruction.T_long:
- push(new PushLong(parseLongValue(subToken)));
- break;
- case Instruction.T_float:
- push(new PushFloat(Float.parseFloat(removePrefixZerosAndUnderscores(subToken, false))));
- break;
- case Instruction.T_double:
- if (lastChar == 'D' || lastChar == 'd') {
- push(new PushDouble(Double.parseDouble(removePrefixZerosAndUnderscores(subToken, false))));
- } else {
- push(new PushDouble(Double.parseDouble(removePrefixZerosAndUnderscores(token, false))));
- }
- break;
+ case Instruction.T_byte:
+ push(new PushInt(parseByteValue(token)));
+ break;
+ case Instruction.T_short:
+ push(new PushInt(parseShortValue(token)));
+ break;
+ case Instruction.T_int:
+ push(new PushInt(parseIntValue(token)));
+ break;
+ case Instruction.T_long:
+ push(new PushLong(parseLongValue(subToken)));
+ break;
+ case Instruction.T_float:
+ push(new PushFloat(
+ Float.parseFloat(removePrefixZerosAndUnderscores(subToken,
+ false))));
+ break;
+ case Instruction.T_double:
+ if (lastChar == 'D' || lastChar == 'd') {
+ push(new PushDouble(
+ Double.parseDouble(removePrefixZerosAndUnderscores(
+ subToken, false))));
+ } else {
+ push(new PushDouble(
+ Double.parseDouble(removePrefixZerosAndUnderscores(
+ token, false))));
+ }
+ break;
}
return true;
}
/**
- * Removes all preamble typing and underscores and returns the base integer value
+ * Removes all preamble typing and underscores and returns the base integer
+ * value
*
- * @param token the token to parse
+ * @param token
+ * the token to parse
* @return the int value of the token
*/
public static int parseIntValue(String token) {
token = removePrefixZerosAndUnderscores(token, false);
switch (getBase(token)) {
- case 8:
- return Integer.valueOf(token.substring(1), 8).intValue();
- case 16:
- return Integer.valueOf(token.substring(2), 16).intValue();
- case 2:
- return Integer.valueOf(token.substring(2), 2).intValue();
- default:
- return Integer.valueOf(token, 10).intValue();
+ case 8:
+ return Integer.valueOf(token.substring(1), 8).intValue();
+ case 16:
+ return Integer.valueOf(token.substring(2), 16).intValue();
+ case 2:
+ return Integer.valueOf(token.substring(2), 2).intValue();
+ default:
+ return Integer.valueOf(token, 10).intValue();
}
}
/**
- * Removes all preamble typing and underscores and returns the base short value
+ * Removes all preamble typing and underscores and returns the base short
+ * value
*
- * @param token the token to parse
+ * @param token
+ * the token to parse
* @return the short value of the token
*/
public static short parseShortValue(String token) {
token = removePrefixZerosAndUnderscores(token, false);
switch (getBase(token)) {
- case 8:
- return Short.valueOf(token.substring(1), 8).shortValue();
- case 16:
- return Short.valueOf(token.substring(2), 16).shortValue();
- case 2:
- return Short.valueOf(token.substring(2), 2).shortValue();
- default:
- return Short.valueOf(token, 10).shortValue();
+ case 8:
+ return Short.valueOf(token.substring(1), 8).shortValue();
+ case 16:
+ return Short.valueOf(token.substring(2), 16).shortValue();
+ case 2:
+ return Short.valueOf(token.substring(2), 2).shortValue();
+ default:
+ return Short.valueOf(token, 10).shortValue();
}
}
/**
- * Removes all preamble typing and underscores and returns the base byte value
+ * Removes all preamble typing and underscores and returns the base byte
+ * value
*
- * @param token the token to parse
+ * @param token
+ * the token to parse
* @return the byte value of the token
*/
public static byte parseByteValue(String token) {
token = removePrefixZerosAndUnderscores(token, false);
switch (getBase(token)) {
- case 8:
- return Byte.valueOf(token.substring(1), 8).byteValue();
- case 16:
- return Byte.valueOf(token.substring(2), 16).byteValue();
- case 2:
- return Byte.valueOf(token.substring(2), 2).byteValue();
- default:
- return Byte.valueOf(token, 10).byteValue();
+ case 8:
+ return Byte.valueOf(token.substring(1), 8).byteValue();
+ case 16:
+ return Byte.valueOf(token.substring(2), 16).byteValue();
+ case 2:
+ return Byte.valueOf(token.substring(2), 2).byteValue();
+ default:
+ return Byte.valueOf(token, 10).byteValue();
}
}
-
+
/**
- * Removes all preamble typing and underscores and returns the base long value
- * @param token the token to parse
+ * Removes all preamble typing and underscores and returns the base long
+ * value
+ *
+ * @param token
+ * the token to parse
* @return the long value of the token
*/
public static long parseLongValue(String token) {
token = removePrefixZerosAndUnderscores(token, true);
switch (getBase(token)) {
- case 8:
- return Long.valueOf(token.substring(1), 8).longValue();
- case 16:
- return Long.valueOf(token.substring(2), 16).longValue();
- case 2:
- return Long.valueOf(token.substring(2), 2).longValue();
- default:
- return Long.valueOf(token, 10).longValue();
+ case 8:
+ return Long.valueOf(token.substring(1), 8).longValue();
+ case 16:
+ return Long.valueOf(token.substring(2), 16).longValue();
+ case 2:
+ return Long.valueOf(token.substring(2), 2).longValue();
+ default:
+ return Long.valueOf(token, 10).longValue();
}
}
/**
- * Returns the numeric base for the given token
- * according to the Java specification. Returns
- * 8, 10, or 16.
- * @param token the token to get the base from
+ * Returns the numeric base for the given token according to the Java
+ * specification. Returns 8, 10, or 16.
+ *
+ * @param token
+ * the token to get the base from
* @return the numeric base for the given token
*/
public static int getBase(String token) {
if (token.charAt(0) == '0' && (token.length() > 1)) {
- switch(token.charAt(1)) {
- case 'x' :
- case 'X' :
- // "0x" prefix: Hexadecimal
- return 16;
- case 'b' :
- case 'B' :
- // "0b" prefix: binary
- return 2;
- default :
- // "0" prefix: Octal
- return 8;
+ switch (token.charAt(1)) {
+ case 'x':
+ case 'X':
+ // "0x" prefix: Hexadecimal
+ return 16;
+ case 'b':
+ case 'B':
+ // "0b" prefix: binary
+ return 2;
+ default:
+ // "0" prefix: Octal
+ return 8;
}
- }
+ }
return 10; // No prefix: Decimal
}
/**
* @see ASTVisitor#visit(PackageDeclaration)
*/
+ @Override
public boolean visit(PackageDeclaration node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ParameterizedType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * ParameterizedType)
*/
+ @Override
public boolean visit(ParameterizedType node) {
if (!isActive()) {
return false;
}
- ITypeBinding typeBinding = resolveTypeBinding(node);
+ ITypeBinding typeBinding = resolveTypeBinding(node);
if (typeBinding != null) {
push(new PushType(getTypeName(typeBinding)));
}
@@ -3039,6 +3311,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ParenthesizedExpression)
*/
+ @Override
public boolean visit(ParenthesizedExpression node) {
if (!isActive()) {
return false;
@@ -3049,35 +3322,42 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(PostfixExpression)
*/
+ @Override
public boolean visit(PostfixExpression node) {
if (!isActive()) {
return false;
}
- Expression operand= node.getOperand();
+ Expression operand = node.getOperand();
int expressionTypeId = getTypeId(operand);
String opToken = node.getOperator().toString();
char char0 = opToken.charAt(0);
-
+
if (expressionTypeId == Instruction.T_Object) {
- int expressionUnBoxedTypeId= getUnBoxedTypeId(operand);
-
- AssignmentOperator assignmentInstruction= new AssignmentOperator(Instruction.T_Object, Instruction.T_Object, fCounter);
+ int expressionUnBoxedTypeId = getUnBoxedTypeId(operand);
+
+ AssignmentOperator assignmentInstruction = new AssignmentOperator(
+ Instruction.T_Object, Instruction.T_Object, fCounter);
push(assignmentInstruction);
operand.accept(this);
switch (char0) {
- case '+': // plus plus
- push(new PlusOperator(expressionUnBoxedTypeId, expressionUnBoxedTypeId, expressionUnBoxedTypeId, fCounter));
- break;
- case '-': // minus minus
- push(new MinusOperator(expressionUnBoxedTypeId, expressionUnBoxedTypeId, expressionUnBoxedTypeId, fCounter));
- break;
- default:
- setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_postfix_operator____15 + opToken);
- return false;
+ case '+': // plus plus
+ push(new PlusOperator(expressionUnBoxedTypeId,
+ expressionUnBoxedTypeId, expressionUnBoxedTypeId,
+ fCounter));
+ break;
+ case '-': // minus minus
+ push(new MinusOperator(expressionUnBoxedTypeId,
+ expressionUnBoxedTypeId, expressionUnBoxedTypeId,
+ fCounter));
+ break;
+ default:
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_postfix_operator____15
+ + opToken);
+ return false;
}
push(new Value(fCounter));
push(new Dup());
@@ -3098,22 +3378,22 @@ public class ASTInstructionCompiler extends ASTVisitor {
storeInstruction(); // boxing
storeInstruction(); // assignment
push(new Pop(assignmentInstruction.getSize() + 1));
-
-
+
return false;
}
switch (char0) {
- case '+': // plus plus
- push(new PostfixPlusPlusOperator(expressionTypeId, fCounter));
- break;
- case '-': // minus minus
- push(new PostfixMinusMinusOperator(expressionTypeId, fCounter));
- break;
- default:
- setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_postfix_operator____15 + opToken);
- return false;
+ case '+': // plus plus
+ push(new PostfixPlusPlusOperator(expressionTypeId, fCounter));
+ break;
+ case '-': // minus minus
+ push(new PostfixMinusMinusOperator(expressionTypeId, fCounter));
+ break;
+ default:
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_postfix_operator____15
+ + opToken);
+ return false;
}
return true;
@@ -3122,12 +3402,13 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(PrefixExpression)
*/
+ @Override
public boolean visit(PrefixExpression node) {
if (!isActive()) {
return false;
}
- Expression operand= node.getOperand();
+ Expression operand = node.getOperand();
int expressionTypeId = getTypeId(operand);
String opToken = node.getOperator().toString();
@@ -3139,118 +3420,127 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
boolean unrecognized = false;
-
+
if (expressionTypeId == Instruction.T_Object) {
-
- int expressionUnBoxedTypeId= getUnBoxedTypeId(operand);
-
+
+ int expressionUnBoxedTypeId = getUnBoxedTypeId(operand);
+
ITypeBinding typeBinding = resolveTypeBinding(operand);
if (typeBinding == null) {
return false;
}
if (char1 == '\0') {
switch (char0) {
- case '+': // unary plus
- push(new UnaryPlusOperator(expressionUnBoxedTypeId, fCounter));
- break;
- case '-': // unary minus
- push(new UnaryMinusOperator(expressionUnBoxedTypeId, fCounter));
- break;
- case '~': // twiddle
- push(new TwiddleOperator(expressionUnBoxedTypeId, fCounter));
- break;
- case '!': // not
- push(new NotOperator(expressionUnBoxedTypeId, fCounter));
- break;
- default:
- setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_prefix_operator____16 + opToken);
- return false;
+ case '+': // unary plus
+ push(new UnaryPlusOperator(expressionUnBoxedTypeId,
+ fCounter));
+ break;
+ case '-': // unary minus
+ push(new UnaryMinusOperator(expressionUnBoxedTypeId,
+ fCounter));
+ break;
+ case '~': // twiddle
+ push(new TwiddleOperator(expressionUnBoxedTypeId, fCounter));
+ break;
+ case '!': // not
+ push(new NotOperator(expressionUnBoxedTypeId, fCounter));
+ break;
+ default:
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_prefix_operator____16
+ + opToken);
+ return false;
}
-
+
unBoxing(typeBinding);
operand.accept(this);
storeInstruction(); // un-boxing
-
+
} else {
// plus plus and minus minus operators
-
- push(new AssignmentOperator(Instruction.T_Object, Instruction.T_Object, fCounter));
-
+
+ push(new AssignmentOperator(Instruction.T_Object,
+ Instruction.T_Object, fCounter));
+
operand.accept(this);
-
+
boxing(typeBinding, null);
-
+
switch (char1) {
- case '+':
- push(new PlusOperator(expressionUnBoxedTypeId, expressionUnBoxedTypeId, expressionUnBoxedTypeId, fCounter));
- break;
- case '-':
- push(new MinusOperator(expressionUnBoxedTypeId, expressionUnBoxedTypeId, expressionUnBoxedTypeId, fCounter));
- break;
- default:
- setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_prefix_operator____16 + opToken);
- return false;
+ case '+':
+ push(new PlusOperator(expressionUnBoxedTypeId,
+ expressionUnBoxedTypeId, expressionUnBoxedTypeId,
+ fCounter));
+ break;
+ case '-':
+ push(new MinusOperator(expressionUnBoxedTypeId,
+ expressionUnBoxedTypeId, expressionUnBoxedTypeId,
+ fCounter));
+ break;
+ default:
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_prefix_operator____16
+ + opToken);
+ return false;
}
-
+
unBoxing(typeBinding);
push(new Dup());
storeInstruction(); // dupe
storeInstruction(); // un-boxing
push(new PushInt(1));
storeInstruction(); // push 1
-
+
storeInstruction(); // operator
storeInstruction(); // boxing
-
+
}
-
+
return false;
}
-
+
switch (char0) {
- case '+': // plus plus or unary plus
- switch (char1) {
- case '\0': // unary plus
- push(new UnaryPlusOperator(expressionTypeId, fCounter));
- break;
- case '+': // plus plus
- push(new PrefixPlusPlusOperator(expressionTypeId, fCounter));
- break;
- default:
- unrecognized= true;
- break;
- }
+ case '+': // plus plus or unary plus
+ switch (char1) {
+ case '\0': // unary plus
+ push(new UnaryPlusOperator(expressionTypeId, fCounter));
break;
- case '-': // minus minus or unary minus
- switch (char1) {
- case '\0': // unary minus
- push(new UnaryMinusOperator(expressionTypeId, fCounter));
- break;
- case '-': // minus minus
- push(new PrefixMinusMinusOperator(expressionTypeId, fCounter));
- break;
- default:
- unrecognized= true;
- break;
- }
+ case '+': // plus plus
+ push(new PrefixPlusPlusOperator(expressionTypeId, fCounter));
break;
- case '~': // twiddle
- push(new TwiddleOperator(expressionTypeId, fCounter));
+ default:
+ unrecognized = true;
+ break;
+ }
+ break;
+ case '-': // minus minus or unary minus
+ switch (char1) {
+ case '\0': // unary minus
+ push(new UnaryMinusOperator(expressionTypeId, fCounter));
break;
- case '!': // not
- push(new NotOperator(expressionTypeId, fCounter));
+ case '-': // minus minus
+ push(new PrefixMinusMinusOperator(expressionTypeId, fCounter));
break;
default:
- unrecognized= true;
+ unrecognized = true;
break;
+ }
+ break;
+ case '~': // twiddle
+ push(new TwiddleOperator(expressionTypeId, fCounter));
+ break;
+ case '!': // not
+ push(new NotOperator(expressionTypeId, fCounter));
+ break;
+ default:
+ unrecognized = true;
+ break;
}
-
if (unrecognized) {
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_prefix_operator____16 + opToken);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_unrecognized_prefix_operator____16
+ + opToken);
return false;
}
@@ -3260,11 +3550,12 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(PrimitiveType)
*/
+ @Override
public boolean visit(PrimitiveType node) {
if (!isActive()) {
return false;
}
- ITypeBinding typeBinding = resolveTypeBinding(node);
+ ITypeBinding typeBinding = resolveTypeBinding(node);
if (typeBinding != null) {
push(new PushPrimitiveType(getTypeName(typeBinding)));
}
@@ -3274,6 +3565,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(QualifiedName)
*/
+ @Override
public boolean visit(QualifiedName node) {
if (!isActive()) {
return false;
@@ -3288,43 +3580,50 @@ public class ASTInstructionCompiler extends ASTVisitor {
return false;
}
switch (binding.getKind()) {
- case IBinding.TYPE:
- node.getName().accept(this);
- break;
- case IBinding.VARIABLE:
- SimpleName fieldName= node.getName();
- IVariableBinding fieldBinding= (IVariableBinding) resolveBinding(fieldName);
- if (fieldBinding == null) {
- return false;
- }
- ITypeBinding declaringTypeBinding= fieldBinding.getDeclaringClass();
- String fieldId = fieldName.getIdentifier();
+ case IBinding.TYPE:
+ node.getName().accept(this);
+ break;
+ case IBinding.VARIABLE:
+ SimpleName fieldName = node.getName();
+ IVariableBinding fieldBinding = (IVariableBinding) resolveBinding(fieldName);
+ if (fieldBinding == null) {
+ return false;
+ }
+ ITypeBinding declaringTypeBinding = fieldBinding
+ .getDeclaringClass();
+ String fieldId = fieldName.getIdentifier();
- if (Modifier.isStatic(fieldBinding.getModifiers())) {
- push(new PushStaticFieldVariable(fieldId, getTypeName(declaringTypeBinding), fCounter));
+ if (Modifier.isStatic(fieldBinding.getModifiers())) {
+ push(new PushStaticFieldVariable(fieldId,
+ getTypeName(declaringTypeBinding), fCounter));
+ } else {
+ if (declaringTypeBinding == null) {
+ push(new PushArrayLength(fCounter));
} else {
- if (declaringTypeBinding == null) {
- push(new PushArrayLength(fCounter));
- } else {
- push(new PushFieldVariable(fieldId, getTypeSignature(declaringTypeBinding), fCounter));
- }
- node.getQualifier().accept(this);
+ push(new PushFieldVariable(fieldId,
+ getTypeSignature(declaringTypeBinding), fCounter));
}
- storeInstruction();
- break;
+ node.getQualifier().accept(this);
+ }
+ storeInstruction();
+ break;
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.QualifiedType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * QualifiedType)
*/
+ @Override
public boolean visit(QualifiedType node) {
if (!isActive()) {
return false;
}
- ITypeBinding typeBinding = resolveTypeBinding(node);
+ ITypeBinding typeBinding = resolveTypeBinding(node);
if (typeBinding != null) {
push(new PushType(getTypeName(typeBinding)));
}
@@ -3334,6 +3633,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ReturnStatement)
*/
+ @Override
public boolean visit(ReturnStatement node) {
if (!isActive()) {
return false;
@@ -3345,6 +3645,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(SimpleName)
*/
+ @Override
public boolean visit(SimpleName node) {
if (!isActive()) {
return false;
@@ -3361,74 +3662,86 @@ public class ASTInstructionCompiler extends ASTVisitor {
String variableId = node.getIdentifier();
switch (binding.getKind()) {
- case IBinding.TYPE:
- ITypeBinding typeBinding= (ITypeBinding) binding;
- push(new PushType(getTypeName(typeBinding)));
- break;
- case IBinding.VARIABLE:
- IVariableBinding variableBinding= (IVariableBinding) binding;
- ITypeBinding declaringTypeBinding= variableBinding.getDeclaringClass();
- if (variableBinding.isField()) {
- if (Modifier.isStatic(variableBinding.getModifiers())) {
- push(new PushStaticFieldVariable(variableId, getTypeName(declaringTypeBinding), fCounter));
- } else {
- if (isALocalType(declaringTypeBinding)) {
- setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_36);
- return false;
- }
- push(new PushFieldVariable(variableId, getTypeSignature(declaringTypeBinding), fCounter));
- push(new PushThis(getEnclosingLevel(node, declaringTypeBinding)));
- storeInstruction();
- }
+ case IBinding.TYPE:
+ ITypeBinding typeBinding = (ITypeBinding) binding;
+ push(new PushType(getTypeName(typeBinding)));
+ break;
+ case IBinding.VARIABLE:
+ IVariableBinding variableBinding = (IVariableBinding) binding;
+ ITypeBinding declaringTypeBinding = variableBinding
+ .getDeclaringClass();
+ if (variableBinding.isField()) {
+ if (Modifier.isStatic(variableBinding.getModifiers())) {
+ push(new PushStaticFieldVariable(variableId,
+ getTypeName(declaringTypeBinding), fCounter));
} else {
- push(new PushLocalVariable(variableId));
+ if (isALocalType(declaringTypeBinding)) {
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_36);
+ return false;
+ }
+ push(new PushFieldVariable(variableId,
+ getTypeSignature(declaringTypeBinding), fCounter));
+ push(new PushThis(getEnclosingLevel(node,
+ declaringTypeBinding)));
+ storeInstruction();
}
- break;
+ } else {
+ push(new PushLocalVariable(variableId));
+ }
+ break;
}
return true;
}
/**
* return false, don't visit child
- *
+ *
* @see ASTVisitor#visit(SimpleType)
*/
+ @Override
public boolean visit(SimpleType node) {
if (!isActive()) {
return false;
}
- ITypeBinding typeBinding = resolveTypeBinding(node);
+ ITypeBinding typeBinding = resolveTypeBinding(node);
if (typeBinding != null) {
push(new PushType(getTypeName(typeBinding)));
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * SingleMemberAnnotation)
*/
+ @Override
public boolean visit(SingleMemberAnnotation node) {
return false;
}
-
+
/**
- * @see ASTVisitor#visit(SingleVariableDeclaration)
- * return <code>false</code>, don't use the standard accept order.
+ * @see ASTVisitor#visit(SingleVariableDeclaration) return
+ * <code>false</code>, don't use the standard accept order.
*/
+ @Override
public boolean visit(SingleVariableDeclaration node) {
if (!isActive()) {
return false;
}
- ITypeBinding typeBinding= resolveTypeBinding(node.getType());
+ ITypeBinding typeBinding = resolveTypeBinding(node.getType());
if (typeBinding != null) {
- int typeDimension= typeBinding.getDimensions();
+ int typeDimension = typeBinding.getDimensions();
if (typeDimension != 0) {
- typeBinding= typeBinding.getElementType();
+ typeBinding = typeBinding.getElementType();
}
- Expression initializer= node.getInitializer();
- push(new LocalVariableCreation(node.getName().getIdentifier(), getTypeSignature(typeBinding), typeDimension, typeBinding.isPrimitive(), initializer != null, fCounter));
+ Expression initializer = node.getInitializer();
+ push(new LocalVariableCreation(node.getName().getIdentifier(),
+ getTypeSignature(typeBinding), typeDimension,
+ typeBinding.isPrimitive(), initializer != null, fCounter));
if (initializer != null) {
initializer.accept(this);
}
@@ -3439,6 +3752,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(StringLiteral)
*/
+ @Override
public boolean visit(StringLiteral node) {
if (!isActive()) {
return false;
@@ -3452,48 +3766,51 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(SuperConstructorInvocation)
*/
+ @Override
public boolean visit(SuperConstructorInvocation node) {
if (!isActive()) {
return false;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_super_constructor_invocation_cannot_be_used_in_an_evaluation_expression_19);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_super_constructor_invocation_cannot_be_used_in_an_evaluation_expression_19);
return false;
}
/**
* @see ASTVisitor#visit(SuperFieldAccess)
*/
+ @Override
public boolean visit(SuperFieldAccess node) {
if (!isActive()) {
return false;
}
- SimpleName fieldName= node.getName();
- IVariableBinding fieldBinding= (IVariableBinding) resolveBinding(fieldName);
+ SimpleName fieldName = node.getName();
+ IVariableBinding fieldBinding = (IVariableBinding) resolveBinding(fieldName);
if (fieldBinding == null) {
return false;
}
- ITypeBinding declaringTypeBinding= fieldBinding.getDeclaringClass();
+ ITypeBinding declaringTypeBinding = fieldBinding.getDeclaringClass();
String fieldId = fieldName.getIdentifier();
if (Modifier.isStatic(fieldBinding.getModifiers())) {
- push(new PushStaticFieldVariable(fieldId, getTypeName(declaringTypeBinding), fCounter));
+ push(new PushStaticFieldVariable(fieldId,
+ getTypeName(declaringTypeBinding), fCounter));
} else {
Name qualifier = node.getQualifier();
- int superLevel= 1;
- int enclosingLevel= 0;
+ int superLevel = 1;
+ int enclosingLevel = 0;
if (qualifier != null) {
ITypeBinding typeBinding = resolveTypeBinding(qualifier);
if (typeBinding == null) {
return false;
}
- superLevel= getSuperLevel(typeBinding, declaringTypeBinding);
- ITypeBinding binding = (ITypeBinding)resolveBinding(qualifier);
+ superLevel = getSuperLevel(typeBinding, declaringTypeBinding);
+ ITypeBinding binding = (ITypeBinding) resolveBinding(qualifier);
if (binding == null) {
return false;
}
- enclosingLevel= getEnclosingLevel(node, binding);
+ enclosingLevel = getEnclosingLevel(node, binding);
}
push(new PushFieldVariable(fieldId, superLevel, fCounter));
push(new PushThis(enclosingLevel));
@@ -3505,15 +3822,17 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* return false, don't visit name, visit arguments
- *
+ *
* @see ASTVisitor#visit(SuperMethodInvocation)
*/
+ @Override
public boolean visit(SuperMethodInvocation node) {
if (!isActive()) {
return false;
}
- IMethodBinding methodBinding = (IMethodBinding) resolveBinding(node.getName());
+ IMethodBinding methodBinding = (IMethodBinding) resolveBinding(node
+ .getName());
if (methodBinding == null) {
return false;
}
@@ -3529,52 +3848,64 @@ public class ASTInstructionCompiler extends ASTVisitor {
String selector = methodBinding.getName();
String signature = getMethodSignature(methodBinding, null);
- Name qualifier= node.getQualifier();
+ Name qualifier = node.getQualifier();
if (Modifier.isStatic(methodBinding.getModifiers())) {
- push(new SendStaticMessage(getTypeName(methodBinding.getDeclaringClass()), selector, signature, paramCount, fCounter));
+ push(new SendStaticMessage(
+ getTypeName(methodBinding.getDeclaringClass()), selector,
+ signature, paramCount, fCounter));
} else {
- push(new SendMessage(selector, signature, paramCount, getTypeSignature(methodBinding.getDeclaringClass()), fCounter));
- int enclosingLevel= 0;
+ push(new SendMessage(selector, signature, paramCount,
+ getTypeSignature(methodBinding.getDeclaringClass()),
+ fCounter));
+ int enclosingLevel = 0;
if (qualifier != null) {
- ITypeBinding typeBinding = (ITypeBinding)resolveBinding(qualifier);
+ ITypeBinding typeBinding = (ITypeBinding) resolveBinding(qualifier);
if (typeBinding == null) {
return false;
}
- enclosingLevel= getEnclosingLevel(node, typeBinding);
+ enclosingLevel = getEnclosingLevel(node, typeBinding);
}
push(new PushThis(enclosingLevel));
storeInstruction();
}
- List arguments = node.arguments();
+ List<Expression> arguments = node.arguments();
int argCount = arguments.size();
ITypeBinding lastArgBinding = null;
if (methodBinding.isVarargs()) {
- lastArgBinding = resolveTypeBinding((Expression)arguments.get(argCount - 1));
+ lastArgBinding = resolveTypeBinding(arguments.get(argCount - 1));
if (lastArgBinding == null) {
return false;
}
}
- if (methodBinding.isVarargs() && !(paramCount == argCount && parameterTypes[paramCount - 1].getDimensions() == lastArgBinding.getDimensions())) {
- // if this method is a varargs, and if the method is invoked using the varargs syntax
+ if (methodBinding.isVarargs()
+ && !(paramCount == argCount && parameterTypes[paramCount - 1]
+ .getDimensions() == lastArgBinding.getDimensions())) {
+ // if this method is a varargs, and if the method is invoked using
+ // the varargs syntax
// (multiple arguments) and not an array
- Iterator iterator= arguments.iterator();
+ Iterator<Expression> iterator = arguments.iterator();
// process the first arguments (no part of the variable argument)
- for (int i= 0; i < paramCount - 1; i++) {
- Expression argument= (Expression) iterator.next();
- boolean storeRequired= checkAutoBoxing(argument.resolveTypeBinding(), parameterTypes[i]);
+ for (int i = 0; i < paramCount - 1; i++) {
+ Expression argument = iterator.next();
+ boolean storeRequired = checkAutoBoxing(
+ argument.resolveTypeBinding(), parameterTypes[i]);
argument.accept(this);
if (storeRequired) {
storeInstruction();
}
}
// create a array of the remainder arguments
- ITypeBinding varargsParameterType= parameterTypes[paramCount - 1];
- ITypeBinding varargsElementType= varargsParameterType.getElementType();
- push(new ArrayInitializerInstruction(getTypeSignature(varargsElementType), argCount - paramCount + 1, varargsParameterType.getDimensions(), fCounter));
+ ITypeBinding varargsParameterType = parameterTypes[paramCount - 1];
+ ITypeBinding varargsElementType = varargsParameterType
+ .getElementType();
+ push(new ArrayInitializerInstruction(
+ getTypeSignature(varargsElementType), argCount - paramCount
+ + 1, varargsParameterType.getDimensions(), fCounter));
while (iterator.hasNext()) {
- Expression argument= (Expression) iterator.next();
- boolean storeRequired= checkAutoBoxing(argument.resolveTypeBinding(), varargsElementType);
+ Expression argument = iterator.next();
+ boolean storeRequired = checkAutoBoxing(
+ argument.resolveTypeBinding(), varargsElementType);
argument.accept(this);
if (storeRequired) {
storeInstruction();
@@ -3582,17 +3913,18 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
storeInstruction();
} else {
- Iterator iterator= arguments.iterator();
- int i= 0;
+ Iterator<Expression> iterator = arguments.iterator();
+ int i = 0;
while (iterator.hasNext()) {
- Expression argument= (Expression) iterator.next();
- boolean storeRequired= checkAutoBoxing(argument.resolveTypeBinding(), parameterTypes[i++]);
+ Expression argument = iterator.next();
+ boolean storeRequired = checkAutoBoxing(
+ argument.resolveTypeBinding(), parameterTypes[i++]);
argument.accept(this);
if (storeRequired) {
storeInstruction();
}
}
- }
+ }
return false;
}
@@ -3600,117 +3932,131 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(SwitchCase)
*/
+ @Override
public boolean visit(SwitchCase node) {
// never called
return false;
}
+ class slot {
+ ArrayList<ConditionalJump> jumps = new ArrayList<ConditionalJump>();
+ ArrayList<Statement> stmts = null;
+ }
+
/**
* @see ASTVisitor#visit(SwitchStatement)
*/
+ @Override
public boolean visit(SwitchStatement node) {
if (!isActive()) {
return false;
}
push(new NoOp(fCounter));
- int switchStart= fCounter;
+ int switchStart = fCounter;
node.getExpression().accept(this);
-
- ArrayList statementsDefault= null;
- Jump jumpDefault= null;
- ArrayList jumpsStatements= new ArrayList();
- ArrayList[] currentJumpsStatements= new ArrayList[] {new ArrayList(), null};
- jumpsStatements.add(currentJumpsStatements);
-
- for (Iterator iter= node.statements().iterator(); iter.hasNext();) {
- Statement statement= (Statement) iter.next();
+
+ ArrayList<Statement> statementsDefault = null;
+ Jump jumpDefault = null;
+ ArrayList<slot> jumpsStatements = new ArrayList<slot>();
+ slot currentslot = new slot();
+ jumpsStatements.add(currentslot);
+
+ for (Iterator<Statement> iter = node.statements().iterator(); iter.hasNext();) {
+ Statement statement = iter.next();
if (statement instanceof SwitchCase) {
- SwitchCase switchCase= (SwitchCase) statement;
+ SwitchCase switchCase = (SwitchCase) statement;
if (switchCase.isDefault()) {
- jumpDefault= new Jump();
+ jumpDefault = new Jump();
push(jumpDefault);
storeInstruction(); // jump
- statementsDefault= new ArrayList();
+ statementsDefault = new ArrayList<Statement>();
} else {
- if(switchCase.getExpression() instanceof StringLiteral) {
- push(new SendMessage("equals", "(Ljava/lang/Object;)Z", 1, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- push(new EqualEqualOperator(Instruction.T_int, Instruction.T_int, true, fCounter));
+ if (switchCase.getExpression() instanceof StringLiteral) {
+ push(new SendMessage(
+ "equals", "(Ljava/lang/Object;)Z", 1, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ push(new EqualEqualOperator(Instruction.T_int,
+ Instruction.T_int, true, fCounter));
}
push(new Dup());
storeInstruction(); // dupe
switchCase.getExpression().accept(this);
storeInstruction(); // equal-equal
- ConditionalJump condJump= new ConditionalJump(true);
+ ConditionalJump condJump = new ConditionalJump(true);
push(condJump);
storeInstruction(); // conditional jump
- if (currentJumpsStatements[1] != null) {
- currentJumpsStatements= new ArrayList[] {new ArrayList(), null};
- jumpsStatements.add(currentJumpsStatements);
+ if (currentslot.stmts != null) {
+ currentslot = new slot();
+ jumpsStatements.add(currentslot);
}
- currentJumpsStatements[0].add(condJump);
+ currentslot.jumps.add(condJump);
}
} else {
if (statementsDefault != null) {
statementsDefault.add(statement);
} else {
- if (currentJumpsStatements[1] == null) {
- currentJumpsStatements[1]= new ArrayList();
+ if (currentslot.stmts == null) {
+ currentslot.stmts = new ArrayList<Statement>();
}
- currentJumpsStatements[1].add(statement);
+ currentslot.stmts.add(statement);
}
}
}
-
- Jump jumpEnd= null;
+
+ Jump jumpEnd = null;
if (jumpDefault == null) {
push(new Pop(0));
storeInstruction(); // pop
- jumpEnd= new Jump();
+ jumpEnd = new Jump();
push(jumpEnd);
storeInstruction(); // jump
}
-
- for (Iterator iter= jumpsStatements.iterator(); iter.hasNext();) {
- currentJumpsStatements= (ArrayList[]) iter.next();
- for (Iterator iterator= currentJumpsStatements[0].iterator(); iterator.hasNext();) {
- ConditionalJump condJump= (ConditionalJump) iterator.next();
+
+ for (Iterator<slot> iter = jumpsStatements.iterator(); iter.hasNext();) {
+ currentslot = iter.next();
+ for (Iterator<ConditionalJump> iterator = currentslot.jumps.iterator(); iterator.hasNext();) {
+ ConditionalJump condJump = iterator.next();
condJump.setOffset((fCounter - fInstructions.indexOf(condJump)) - 1);
}
- if (currentJumpsStatements[1] != null) {
+ if (currentslot.stmts != null) {
push(new Pop(0));
storeInstruction(); // pop
- for (Iterator iterator= currentJumpsStatements[1].iterator(); iterator.hasNext();) {
- ((Statement) iterator.next()).accept(this);
+ for (Iterator<Statement> iterator = currentslot.stmts.iterator(); iterator.hasNext();) {
+ iterator.next().accept(this);
}
}
}
-
+
// default case
if (jumpDefault != null) {
- jumpDefault.setOffset((fCounter - fInstructions.indexOf(jumpDefault)) - 1);
+ jumpDefault.setOffset((fCounter - fInstructions
+ .indexOf(jumpDefault)) - 1);
push(new Pop(0));
storeInstruction(); // pop
- for (Iterator iterator= statementsDefault.iterator(); iterator.hasNext();) {
- ((Statement) iterator.next()).accept(this);
+ for (Iterator<Statement> iterator = statementsDefault.iterator(); iterator
+ .hasNext();) {
+ iterator.next().accept(this);
}
} else {
jumpEnd.setOffset((fCounter - fInstructions.indexOf(jumpEnd)) - 1);
}
-
+
// for each pending break or continue instruction which are related to
// this loop, set the offset of the corresponding jump.
- String label= getLabel(node);
- for (Iterator iter= fCompleteInstructions.iterator(); iter.hasNext();) {
- CompleteInstruction instruction= (CompleteInstruction) iter.next();
- Jump jumpInstruction= instruction.fInstruction;
- int instructionAddress= fInstructions.indexOf(jumpInstruction);
- if (instructionAddress > switchStart && (instruction.fLabel == null || instruction.fLabel.equals(label))) {
+ String label = getLabel(node);
+ for (Iterator<CompleteInstruction> iter = fCompleteInstructions.iterator(); iter.hasNext();) {
+ CompleteInstruction instruction = iter.next();
+ Jump jumpInstruction = instruction.fInstruction;
+ int instructionAddress = fInstructions.indexOf(jumpInstruction);
+ if (instructionAddress > switchStart
+ && (instruction.fLabel == null || instruction.fLabel
+ .equals(label))) {
iter.remove();
if (instruction.fIsBreak) {
- // jump to the instruction after the last instruction of the switch
- jumpInstruction.setOffset((fCounter - instructionAddress) - 1);
+ // jump to the instruction after the last instruction of the
+ // switch
+ jumpInstruction
+ .setOffset((fCounter - instructionAddress) - 1);
}
}
}
@@ -3720,6 +4066,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(SynchronizedStatement)
*/
+ @Override
public boolean visit(SynchronizedStatement node) {
if (!isActive()) {
return false;
@@ -3727,16 +4074,25 @@ public class ASTInstructionCompiler extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement
+ * )
*/
+ @Override
public boolean visit(TagElement node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TextElement)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * TextElement)
*/
+ @Override
public boolean visit(TextElement node) {
return false;
}
@@ -3744,19 +4100,20 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ThisExpression)
*/
+ @Override
public boolean visit(ThisExpression node) {
if (!isActive()) {
return false;
}
- Name qualifier= node.getQualifier();
- int enclosingLevel= 0;
+ Name qualifier = node.getQualifier();
+ int enclosingLevel = 0;
if (qualifier != null) {
- ITypeBinding binding = (ITypeBinding)resolveBinding(qualifier);
+ ITypeBinding binding = (ITypeBinding) resolveBinding(qualifier);
if (binding == null) {
return false;
}
- enclosingLevel= getEnclosingLevel(node, binding);
+ enclosingLevel = getEnclosingLevel(node, binding);
}
push(new PushThis(enclosingLevel));
@@ -3766,6 +4123,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(ThrowStatement)
*/
+ @Override
public boolean visit(ThrowStatement node) {
if (!isActive()) {
return false;
@@ -3777,42 +4135,49 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(TryStatement)
*/
+ @Override
public boolean visit(TryStatement node) {
if (!isActive()) {
return false;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Try_statement_cannot_be_used_in_an_evaluation_expression_23);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Try_statement_cannot_be_used_in_an_evaluation_expression_23);
return false;
}
/**
* @see ASTVisitor#visit(TypeDeclaration)
*/
+ @Override
public boolean visit(TypeDeclaration node) {
if (!isActive()) {
return true;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Type_declaration_cannot_be_used_in_an_evaluation_expression_24);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Type_declaration_cannot_be_used_in_an_evaluation_expression_24);
return false;
}
/**
* @see ASTVisitor#visit(TypeDeclarationStatement)
*/
+ @Override
public boolean visit(TypeDeclarationStatement node) {
if (!isActive()) {
return true;
}
setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Type_declaration_statement_cannot_be_used_in_an_evaluation_expression_25);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Type_declaration_statement_cannot_be_used_in_an_evaluation_expression_25);
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeParameter)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * TypeParameter)
*/
+ @Override
public boolean visit(TypeParameter node) {
return false;
}
@@ -3820,6 +4185,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(TypeLiteral)
*/
+ @Override
public boolean visit(TypeLiteral node) {
if (!isActive()) {
return false;
@@ -3833,17 +4199,19 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(VariableDeclarationExpression)
*/
+ @Override
public boolean visit(VariableDeclarationExpression node) {
- /* if it is in the code to execute, return <code>false</code>,
- * we don't use the standard accept order.
- * Otherwise, return true. We want to search the code to execute
- * in variable declarations (in case of inner classes).
+ /*
+ * if it is in the code to execute, return <code>false</code>, we don't
+ * use the standard accept order. Otherwise, return true. We want to
+ * search the code to execute in variable declarations (in case of inner
+ * classes).
*/
if (!isActive()) {
return true;
}
- for (Iterator iter= node.fragments().iterator(); iter.hasNext();) {
- ((VariableDeclarationFragment) iter.next()).accept(this);
+ for (Iterator<VariableDeclarationFragment> iter = node.fragments().iterator(); iter.hasNext();) {
+ iter.next().accept(this);
}
return false;
}
@@ -3851,41 +4219,47 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(VariableDeclarationFragment)
*/
+ @Override
public boolean visit(VariableDeclarationFragment node) {
- /* if it is in the code to execute, return <code>false</code>,
- * we don't use the standard accept order.
- * Otherwise, return true. We want to search the code to execute
- * in variable declarations (in case of inner classes).
+ /*
+ * if it is in the code to execute, return <code>false</code>, we don't
+ * use the standard accept order. Otherwise, return true. We want to
+ * search the code to execute in variable declarations (in case of inner
+ * classes).
*/
if (!isActive()) {
return true;
}
// get the type of the variable
ITypeBinding varTypeBinding;
- ASTNode parent= node.getParent();
+ ASTNode parent = node.getParent();
switch (parent.getNodeType()) {
- case ASTNode.VARIABLE_DECLARATION_EXPRESSION:
- varTypeBinding= resolveTypeBinding(((VariableDeclarationExpression)parent).getType());
- break;
- case ASTNode.VARIABLE_DECLARATION_STATEMENT:
- varTypeBinding= resolveTypeBinding(((VariableDeclarationStatement)parent).getType());
- break;
- default:
- setHasError(true);
- addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Error_in_type_declaration_statement);
- return false;
+ case ASTNode.VARIABLE_DECLARATION_EXPRESSION:
+ varTypeBinding = resolveTypeBinding(((VariableDeclarationExpression) parent)
+ .getType());
+ break;
+ case ASTNode.VARIABLE_DECLARATION_STATEMENT:
+ varTypeBinding = resolveTypeBinding(((VariableDeclarationStatement) parent)
+ .getType());
+ break;
+ default:
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Error_in_type_declaration_statement);
+ return false;
}
if (varTypeBinding == null) {
return false;
}
- int typeDimension= varTypeBinding.getDimensions();
+ int typeDimension = varTypeBinding.getDimensions();
ITypeBinding elementBinding = varTypeBinding;
if (typeDimension != 0) {
- elementBinding= elementBinding.getElementType();
+ elementBinding = elementBinding.getElementType();
}
- Expression initializer= node.getInitializer();
- push(new LocalVariableCreation(node.getName().getIdentifier(), getTypeSignature(elementBinding), typeDimension, elementBinding.isPrimitive(), initializer != null, fCounter));
+ Expression initializer = node.getInitializer();
+ push(new LocalVariableCreation(node.getName().getIdentifier(),
+ getTypeSignature(elementBinding), typeDimension,
+ elementBinding.isPrimitive(), initializer != null, fCounter));
if (initializer != null) {
initializer.accept(this);
ITypeBinding expBindnig = initializer.resolveTypeBinding();
@@ -3902,24 +4276,30 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(VariableDeclarationStatement)
*/
+ @Override
public boolean visit(VariableDeclarationStatement node) {
- /* if it is in the code to execute, return <code>false</code>,
- * we don't use the standard accept order.
- * Otherwise, return true. We want to search the code to execute
- * in variable declarations (in case of inner classes).
+ /*
+ * if it is in the code to execute, return <code>false</code>, we don't
+ * use the standard accept order. Otherwise, return true. We want to
+ * search the code to execute in variable declarations (in case of inner
+ * classes).
*/
if (!isActive()) {
return true;
}
- for (Iterator iter= node.fragments().iterator(); iter.hasNext();) {
- ((VariableDeclarationFragment) iter.next()).accept(this);
+ for (Iterator<VariableDeclarationFragment> iter = node.fragments().iterator(); iter.hasNext();) {
+ iter.next().accept(this);
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.WildcardType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * WildcardType)
*/
+ @Override
public boolean visit(WildcardType node) {
// we shouldn't have to do anything
return false;
@@ -3928,6 +4308,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
/**
* @see ASTVisitor#visit(WhileStatement)
*/
+ @Override
public boolean visit(WhileStatement node) {
if (!isActive()) {
return false;
@@ -3937,7 +4318,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
return true;
}
- //--------------------------
+ // --------------------------
private int getTypeId(Expression expression) {
ITypeBinding typeBinding = expression.resolveTypeBinding();
@@ -3947,7 +4328,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
String typeName = typeBinding.getQualifiedName();
if (typeBinding.isPrimitive()) {
return getPrimitiveTypeId(typeName);
- } else if ("java.lang.String".equals(typeName)){ //$NON-NLS-1$
+ } else if ("java.lang.String".equals(typeName)) { //$NON-NLS-1$
return Instruction.T_String;
} else {
return Instruction.T_Object;
@@ -3962,7 +4343,7 @@ public class ASTInstructionCompiler extends ASTVisitor {
String typeName = typeBinding.getQualifiedName();
if (typeBinding.isPrimitive()) {
return getPrimitiveTypeId(typeName);
- } else if ("java.lang.String".equals(typeName)){ //$NON-NLS-1$
+ } else if ("java.lang.String".equals(typeName)) { //$NON-NLS-1$
return Instruction.T_String;
} else {
// un-boxing
@@ -3989,12 +4370,13 @@ public class ASTInstructionCompiler extends ASTVisitor {
private int getTypeId(Type type) {
if (type.isPrimitiveType()) {
- return getPrimitiveTypeId(((PrimitiveType)type).getPrimitiveTypeCode().toString());
+ return getPrimitiveTypeId(((PrimitiveType) type)
+ .getPrimitiveTypeCode().toString());
} else if (type.isSimpleType()) {
SimpleType simpleType = (SimpleType) type;
- if ("java.lang.String".equals(simpleType.getName().getFullyQualifiedName())){ //$NON-NLS-1$
+ if ("java.lang.String".equals(simpleType.getName().getFullyQualifiedName())) { //$NON-NLS-1$
return Instruction.T_String;
- }
+ }
return Instruction.T_Object;
} else if (type.isArrayType()) {
return Instruction.T_Object;
@@ -4004,7 +4386,8 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
- public static String removePrefixZerosAndUnderscores(String tokenString, boolean isLong) {
+ public static String removePrefixZerosAndUnderscores(String tokenString,
+ boolean isLong) {
char[] token = tokenString.toCharArray();
int max = token.length;
int start = 0;
@@ -4025,18 +4408,18 @@ public class ASTInstructionCompiler extends ASTVisitor {
boolean ignore = true;
loop: for (int i = start; i < max; i++) {
char currentChar = token[i];
- switch(currentChar) {
- case '0' :
- // this is a prefix '0'
- if (ignore && !modified && (i < end)) {
- modified = true;
- }
- break;
- case '_' :
+ switch (currentChar) {
+ case '0':
+ // this is a prefix '0'
+ if (ignore && !modified && (i < end)) {
modified = true;
- break loop;
- default :
- ignore = false;
+ }
+ break;
+ case '_':
+ modified = true;
+ break loop;
+ default:
+ ignore = false;
}
}
if (!modified) {
@@ -4047,17 +4430,17 @@ public class ASTInstructionCompiler extends ASTVisitor {
buffer.append(token, 0, start);
loop: for (int i = start; i < max; i++) {
char currentChar = token[i];
- switch(currentChar) {
- case '0' :
- if (ignore && (i < end)) {
- // this is a prefix '0'
- continue loop;
- }
- break;
- case '_' :
+ switch (currentChar) {
+ case '0':
+ if (ignore && (i < end)) {
+ // this is a prefix '0'
continue loop;
- default:
- ignore = false;
+ }
+ break;
+ case '_':
+ continue loop;
+ default:
+ ignore = false;
}
buffer.append(currentChar);
}
@@ -4065,123 +4448,142 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
/**
- * Returns the method signature given the binding and the enclosing type signature (if there is one)
- * @param methodBinding the binding to get the signature for
- * @param enclosingTypeSignature the enclosing type signature or <code>null</code>
- * @return the method signature for the given binding and enclosing type signature
- */
- private String getMethodSignature(IMethodBinding methodBinding, String enclosingTypeSignature) {
- methodBinding= methodBinding.getMethodDeclaration();
+ * Returns the method signature given the binding and the enclosing type
+ * signature (if there is one)
+ *
+ * @param methodBinding
+ * the binding to get the signature for
+ * @param enclosingTypeSignature
+ * the enclosing type signature or <code>null</code>
+ * @return the method signature for the given binding and enclosing type
+ * signature
+ */
+ private String getMethodSignature(IMethodBinding methodBinding,
+ String enclosingTypeSignature) {
+ methodBinding = methodBinding.getMethodDeclaration();
ITypeBinding[] parameterTypes = methodBinding.getParameterTypes();
int offset = 0;
int argCount;
String[] parameterSignatures;
if (enclosingTypeSignature == null) {
- argCount= parameterTypes.length;
- parameterSignatures= new String[argCount];
+ argCount = parameterTypes.length;
+ parameterSignatures = new String[argCount];
} else {
offset = 1;
- argCount= parameterTypes.length + 1;
- parameterSignatures= new String[argCount];
- parameterSignatures[0]= enclosingTypeSignature;
+ argCount = parameterTypes.length + 1;
+ parameterSignatures = new String[argCount];
+ parameterSignatures[0] = enclosingTypeSignature;
}
for (int i = 0; i < parameterTypes.length; i++) {
- parameterSignatures[i+offset]= getTypeSignature(parameterTypes[i]);
+ parameterSignatures[i + offset] = getTypeSignature(parameterTypes[i]);
}
- String signature= Signature.createMethodSignature(parameterSignatures, getTypeSignature(methodBinding.getReturnType()));
+ String signature = Signature.createMethodSignature(parameterSignatures,
+ getTypeSignature(methodBinding.getReturnType()));
return signature;
}
private int getPrimitiveTypeId(String typeName) {
switch (typeName.charAt(0)) {
- case 'b': // byte or boolean
- switch (typeName.charAt(1)) {
- case 'o': // boolean;
- return Instruction.T_boolean;
- case 'y': // byte
- return Instruction.T_byte;
- }
- break;
- case 'c': // char
- return Instruction.T_char;
- case 'd': // double
- return Instruction.T_double;
- case 'f': // float
- return Instruction.T_float;
- case 'i': // int
- return Instruction.T_int;
- case 'l': // long
- return Instruction.T_long;
- case 'n':
- return Instruction.T_null;
- case 's': // short
- return Instruction.T_short;
- case 'v': // void
- return Instruction.T_void;
+ case 'b': // byte or boolean
+ switch (typeName.charAt(1)) {
+ case 'o': // boolean;
+ return Instruction.T_boolean;
+ case 'y': // byte
+ return Instruction.T_byte;
+ }
+ break;
+ case 'c': // char
+ return Instruction.T_char;
+ case 'd': // double
+ return Instruction.T_double;
+ case 'f': // float
+ return Instruction.T_float;
+ case 'i': // int
+ return Instruction.T_int;
+ case 'l': // long
+ return Instruction.T_long;
+ case 'n':
+ return Instruction.T_null;
+ case 's': // short
+ return Instruction.T_short;
+ case 'v': // void
+ return Instruction.T_void;
}
return Instruction.T_undefined;
}
-
+
/**
- * Resolves and returns the type binding from the given expression reporting an error
- * if the binding is <code>null</code>.
- *
- * @param expression expression to resolve type binding for
+ * Resolves and returns the type binding from the given expression reporting
+ * an error if the binding is <code>null</code>.
+ *
+ * @param expression
+ * expression to resolve type binding for
* @return type binding or <code>null</code> if not available
*/
private ITypeBinding resolveTypeBinding(Expression expression) {
ITypeBinding typeBinding = expression.resolveTypeBinding();
if (typeBinding == null) {
setHasError(true);
- addErrorMessage(MessageFormat.format(EvaluationEngineMessages.ASTInstructionCompiler_3, new String[]{expression.toString()}));
+ addErrorMessage(MessageFormat.format(
+ EvaluationEngineMessages.ASTInstructionCompiler_3,
+ new Object[] { expression.toString() }));
}
return typeBinding;
}
-
+
/**
- * Resolves and returns the type binding for the give type reporting an error
- * if the binding is <code>null</code>.
+ * Resolves and returns the type binding for the give type reporting an
+ * error if the binding is <code>null</code>.
*
- * @param type type to resolve binding for
+ * @param type
+ * type to resolve binding for
* @return type binding or <code>null</code> if not available
*/
private ITypeBinding resolveTypeBinding(Type type) {
ITypeBinding typeBinding = type.resolveBinding();
if (typeBinding == null) {
setHasError(true);
- addErrorMessage(MessageFormat.format(EvaluationEngineMessages.ASTInstructionCompiler_3, new String[]{type.toString()}));
+ addErrorMessage(MessageFormat.format(
+ EvaluationEngineMessages.ASTInstructionCompiler_3,
+ new Object[] { type.toString() }));
}
return typeBinding;
}
-
+
/**
- * Resolves and returns the binding for the given name reporting an error
- * if the binding is <code>null</code>.
+ * Resolves and returns the binding for the given name reporting an error if
+ * the binding is <code>null</code>.
*
- * @param name name to resolve binding for
+ * @param name
+ * name to resolve binding for
* @return binding or <code>null</code> if not available
*/
private IBinding resolveBinding(Name name) {
IBinding binding = name.resolveBinding();
if (binding == null) {
setHasError(true);
- addErrorMessage(MessageFormat.format(EvaluationEngineMessages.ASTInstructionCompiler_5, new String[]{name.getFullyQualifiedName()}));
+ addErrorMessage(MessageFormat.format(
+ EvaluationEngineMessages.ASTInstructionCompiler_5,
+ new Object[] { name.getFullyQualifiedName() }));
}
return binding;
- }
-
+ }
+
/**
- * Resolves and returns the type binding for the given name reporting an error
- * if the binding is <code>null</code>.
+ * Resolves and returns the type binding for the given name reporting an
+ * error if the binding is <code>null</code>.
*
- * @param name name to resolve type binding for
+ * @param name
+ * name to resolve type binding for
* @return type binding or <code>null</code> if not available
*/
private ITypeBinding resolveTypeBinding(Name name) {
ITypeBinding typeBinding = name.resolveTypeBinding();
if (typeBinding == null) {
setHasError(true);
- addErrorMessage(MessageFormat.format(EvaluationEngineMessages.ASTInstructionCompiler_3, new String[]{name.getFullyQualifiedName()}));
+ addErrorMessage(MessageFormat.format(
+ EvaluationEngineMessages.ASTInstructionCompiler_3,
+ new Object[] { name.getFullyQualifiedName() }));
}
return typeBinding;
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java
index e73d87baf..76e5a7495 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/AbstractRuntimeContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,149 +29,178 @@ import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.InvocationException;
/**
- * Common runtime context code for class loading and cache of
- * class loader/java.lang.Class.
+ * Common runtime context code for class loading and cache of class
+ * loader/java.lang.Class.
*
* @since 3.2
*/
public abstract class AbstractRuntimeContext implements IRuntimeContext {
-
- /**
- * Cache of class loader for this runtime context
- */
- private IJavaObject fClassLoader;
-
- /**
- * Cache of java.lang.Class type
- */
- private IJavaClassType fJavaLangClass;
-
- /**
- * Java project context
- */
+
+ /**
+ * Cache of class loader for this runtime context
+ */
+ private IJavaObject fClassLoader;
+
+ /**
+ * Cache of java.lang.Class type
+ */
+ private IJavaClassType fJavaLangClass;
+
+ /**
+ * Java project context
+ */
protected IJavaProject fProject;
-
- public static final String CLASS= "java.lang.Class"; //$NON-NLS-1$
- public static final String FOR_NAME= "forName"; //$NON-NLS-1$
- public static final String FOR_NAME_SIGNATURE= "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;"; //$NON-NLS-1$
-
-
- public AbstractRuntimeContext(IJavaProject project) {
- fProject = project;
- }
-
- /**
- * Returns the class loader used to load classes for this runtime context
- * or <code>null</code> when loaded by the bootstrap loader
- *
- * @return the class loader used to load classes for this runtime context or
- * <code>null</code> when loaded by the bootstrap loader
- * @throws CoreException if unable to resolve a class loader
- */
- protected IJavaObject getClassLoaderObject() throws CoreException {
- if (fClassLoader == null) {
- fClassLoader = getReceivingType().getClassLoaderObject();
- }
- return fClassLoader;
- }
-
- /**
- * Return the java.lang.Class type.
- *
- * @return the java.lang.Class type
- * @throws CoreException if unable to retrive the type
- */
- protected IJavaClassType getJavaLangClass() throws CoreException {
- if (fJavaLangClass == null) {
- IJavaType[] types= getVM().getJavaTypes(CLASS);
- if (types == null || types.length != 1) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Instruction_No_type, new String[]{CLASS}), null));
- }
- fJavaLangClass = (IJavaClassType) types[0];
- }
- return fJavaLangClass;
- }
-
- /**
- * Invokes Class.classForName(String, boolean, ClassLoader) on the target
- * to force load the specified class.
- *
- * @param qualifiedName name of class to load
- * @param loader the class loader to use or <code>null</code> if the bootstrap loader
- * @return the loaded class
- * @throws CoreException if loading fails
- */
- protected IJavaClassObject classForName(String qualifiedName, IJavaObject loader) throws CoreException {
- String tname = qualifiedName;
- if (tname.startsWith("[")) { //$NON-NLS-1$
- tname = TypeImpl.signatureToName(qualifiedName);
- }
+
+ public static final String CLASS = "java.lang.Class"; //$NON-NLS-1$
+ public static final String FOR_NAME = "forName"; //$NON-NLS-1$
+ public static final String FOR_NAME_SIGNATURE = "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;"; //$NON-NLS-1$
+
+ public AbstractRuntimeContext(IJavaProject project) {
+ fProject = project;
+ }
+
+ /**
+ * Returns the class loader used to load classes for this runtime context or
+ * <code>null</code> when loaded by the bootstrap loader
+ *
+ * @return the class loader used to load classes for this runtime context or
+ * <code>null</code> when loaded by the bootstrap loader
+ * @throws CoreException
+ * if unable to resolve a class loader
+ */
+ protected IJavaObject getClassLoaderObject() throws CoreException {
+ if (fClassLoader == null) {
+ fClassLoader = getReceivingType().getClassLoaderObject();
+ }
+ return fClassLoader;
+ }
+
+ /**
+ * Return the java.lang.Class type.
+ *
+ * @return the java.lang.Class type
+ * @throws CoreException
+ * if unable to retrive the type
+ */
+ protected IJavaClassType getJavaLangClass() throws CoreException {
+ if (fJavaLangClass == null) {
+ IJavaType[] types = getVM().getJavaTypes(CLASS);
+ if (types == null || types.length != 1) {
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ MessageFormat
+ .format(InstructionsEvaluationMessages.Instruction_No_type,
+ new Object[] { CLASS }), null));
+ }
+ fJavaLangClass = (IJavaClassType) types[0];
+ }
+ return fJavaLangClass;
+ }
+
+ /**
+ * Invokes Class.classForName(String, boolean, ClassLoader) on the target to
+ * force load the specified class.
+ *
+ * @param qualifiedName
+ * name of class to load
+ * @param loader
+ * the class loader to use or <code>null</code> if the bootstrap
+ * loader
+ * @return the loaded class
+ * @throws CoreException
+ * if loading fails
+ */
+ protected IJavaClassObject classForName(String qualifiedName,
+ IJavaObject loader) throws CoreException {
+ String tname = qualifiedName;
+ if (tname.startsWith("[")) { //$NON-NLS-1$
+ tname = TypeImpl.signatureToName(qualifiedName);
+ }
IJavaType[] types = getVM().getJavaTypes(tname);
if (types != null && types.length > 0) {
// find the one with the right class loader
- for (int i = 0; i < types.length; i++) {
- IJavaReferenceType type = (IJavaReferenceType) types[i];
+ for (IJavaType type2 : types) {
+ IJavaReferenceType type = (IJavaReferenceType) type2;
IJavaObject cloader = type.getClassLoaderObject();
if (isCompatibleLoader(loader, cloader)) {
return type.getClassObject();
}
}
}
- IJavaValue loaderArg = loader;
- if (loader == null) {
- loaderArg = getVM().nullValue();
- }
- //prevent the name string from being collected during the class lookup call
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=301412
- final IJavaValue name = getVM().newValue(qualifiedName);
- ((IJavaObject)name).disableCollection();
- IJavaValue[] args = new IJavaValue[] {name, getVM().newValue(true), loaderArg};
- try {
- return (IJavaClassObject) getJavaLangClass().sendMessage(FOR_NAME, FOR_NAME_SIGNATURE, args, getThread());
- } catch (CoreException e) {
- if (e.getStatus().getException() instanceof InvocationException) {
- // Don't throw ClassNotFoundException
- if (((InvocationException)e.getStatus().getException()).exception().referenceType().name().equals("java.lang.ClassNotFoundException")) { //$NON-NLS-1$
- return null;
- }
- }
- throw e;
- }
- finally {
- ((IJavaObject)name).enableCollection();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#classForName(java.lang.String)
- */
- public IJavaClassObject classForName(String name) throws CoreException {
- return classForName(name, getClassLoaderObject());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getProject()
+ IJavaValue loaderArg = loader;
+ if (loader == null) {
+ loaderArg = getVM().nullValue();
+ }
+ // prevent the name string from being collected during the class lookup
+ // call
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=301412
+ final IJavaValue name = getVM().newValue(qualifiedName);
+ ((IJavaObject) name).disableCollection();
+ IJavaValue[] args = new IJavaValue[] { name, getVM().newValue(true),
+ loaderArg };
+ try {
+ return (IJavaClassObject) getJavaLangClass().sendMessage(FOR_NAME,
+ FOR_NAME_SIGNATURE, args, getThread());
+ } catch (CoreException e) {
+ if (e.getStatus().getException() instanceof InvocationException) {
+ // Don't throw ClassNotFoundException
+ if (((InvocationException) e.getStatus().getException())
+ .exception().referenceType().name()
+ .equals("java.lang.ClassNotFoundException")) { //$NON-NLS-1$
+ return null;
+ }
+ }
+ throw e;
+ } finally {
+ ((IJavaObject) name).enableCollection();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#classForName
+ * (java.lang.String)
+ */
+ public IJavaClassObject classForName(String name) throws CoreException {
+ return classForName(name, getClassLoaderObject());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getProject
+ * ()
*/
public IJavaProject getProject() {
return fProject;
}
-
+
/**
- * Returns whether the class loaded by the <code>otherLoader</code> is compatible
- * with the receiver's class loader. To be compatible, the other's loader must
- * be the same or a parent of the receiver's loader.
+ * Returns whether the class loaded by the <code>otherLoader</code> is
+ * compatible with the receiver's class loader. To be compatible, the
+ * other's loader must be the same or a parent of the receiver's loader.
*
- * @param recLoader class loader of receiver
- * @param otherLoader class loader of other class
+ * @param recLoader
+ * class loader of receiver
+ * @param otherLoader
+ * class loader of other class
* @return whether compatible
*/
- private boolean isCompatibleLoader(IJavaObject recLoader, IJavaObject otherLoader) throws CoreException {
+ private boolean isCompatibleLoader(IJavaObject recLoader,
+ IJavaObject otherLoader) throws CoreException {
if (recLoader == null || otherLoader == null) {
- // if either class is a bootstrap loader, then they are compatible since all loaders
+ // if either class is a bootstrap loader, then they are compatible
+ // since all loaders
// stem from the bootstrap loader
return true;
- }
+ }
if (recLoader.equals(otherLoader)) {
return true;
}
@@ -185,30 +214,33 @@ public abstract class AbstractRuntimeContext implements IRuntimeContext {
}
return false;
}
-
+
/**
- * Returns the parent class loader of the given class loader object or <code>null</code>
- * if none.
+ * Returns the parent class loader of the given class loader object or
+ * <code>null</code> if none.
*
- * @param loader class loader object
+ * @param loader
+ * class loader object
* @return parent class loader or <code>null</code>
* @throws CoreException
*/
- private IJavaObject getParentLoader(IJavaObject loader) throws CoreException {
+ private IJavaObject getParentLoader(IJavaObject loader)
+ throws CoreException {
// to avoid message send, first check for 'parent' field
IJavaFieldVariable field = loader.getField("parent", false); //$NON-NLS-1$
if (field != null) {
- IJavaValue value = (IJavaValue)field.getValue();
+ IJavaValue value = (IJavaValue) field.getValue();
if (value.isNull()) {
return null;
}
- return (IJavaObject)value;
+ return (IJavaObject) value;
}
- IJavaValue result = loader.sendMessage("getParent", "()Ljava/lang/ClassLoader;", null, getThread(), false); //$NON-NLS-1$ //$NON-NLS-2$
+ IJavaValue result = loader
+ .sendMessage(
+ "getParent", "()Ljava/lang/ClassLoader;", null, getThread(), false); //$NON-NLS-1$ //$NON-NLS-2$
if (result.isNull()) {
return null;
}
- return (IJavaObject)result;
+ return (IJavaObject) result;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ArrayRuntimeContext.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ArrayRuntimeContext.java
index ece66aa65..ef1d6a44b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ArrayRuntimeContext.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ArrayRuntimeContext.java
@@ -28,41 +28,52 @@ import org.eclipse.jdt.internal.debug.core.logicalstructures.JDIPlaceholderVaria
* Context for evaluation of an expression in the receiver context of an array.
*/
public class ArrayRuntimeContext extends AbstractRuntimeContext {
-
+
/**
- * Name used for temp variable referring to array (replaces 'this').
- * The same length as "this" so it does not affect code assist.
+ * Name used for temp variable referring to array (replaces 'this'). The
+ * same length as "this" so it does not affect code assist.
*/
public static String ARRAY_THIS_VARIABLE = "_a_t"; //$NON-NLS-1$
-
+
private IJavaArray fArray = null;
private IJavaReferenceType fReceivingType = null;
private IJavaThread fThread = null;
private IJavaVariable fLocalArray = null;
-
- public ArrayRuntimeContext(IJavaArray arrayObject, IJavaThread thread, IJavaProject project) {
+
+ public ArrayRuntimeContext(IJavaArray arrayObject, IJavaThread thread,
+ IJavaProject project) {
super(project);
fArray = arrayObject;
fThread = thread;
- fLocalArray = new JDIPlaceholderVariable(ARRAY_THIS_VARIABLE, arrayObject);
+ fLocalArray = new JDIPlaceholderVariable(ARRAY_THIS_VARIABLE,
+ arrayObject);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getVM()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getVM()
*/
public IJavaDebugTarget getVM() {
return (IJavaDebugTarget) fArray.getDebugTarget();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getThis()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getThis()
*/
public IJavaObject getThis() throws CoreException {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getReceivingType()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#
+ * getReceivingType()
*/
public IJavaReferenceType getReceivingType() throws CoreException {
if (fReceivingType == null) {
@@ -70,29 +81,44 @@ public class ArrayRuntimeContext extends AbstractRuntimeContext {
if (javaTypes.length > 0) {
fReceivingType = (IJavaReferenceType) javaTypes[0];
} else {
- IStatus status = new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.INTERNAL_ERROR, EvaluationEngineMessages.ArrayRuntimeContext_0, null);
+ IStatus status = new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.INTERNAL_ERROR,
+ EvaluationEngineMessages.ArrayRuntimeContext_0, null);
throw new CoreException(status);
}
}
return fReceivingType;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getLocals()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getLocals
+ * ()
*/
public IJavaVariable[] getLocals() throws CoreException {
- return new IJavaVariable[]{fLocalArray};
+ return new IJavaVariable[] { fLocalArray };
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getThread()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#getThread
+ * ()
*/
public IJavaThread getThread() {
return fThread;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#isConstructor()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext#isConstructor
+ * ()
*/
public boolean isConstructor() throws CoreException {
return false;
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/BinaryBasedSourceGenerator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/BinaryBasedSourceGenerator.java
index 58203a1a5..7d9199719 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/BinaryBasedSourceGenerator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/BinaryBasedSourceGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import java.util.Iterator;
import java.util.List;
@@ -28,82 +27,86 @@ import com.sun.jdi.ReferenceType;
import com.sun.jdi.Type;
public class BinaryBasedSourceGenerator {
-
- private static final String RUN_METHOD_NAME= "___run"; //$NON-NLS-1$
- private static final String EVAL_METHOD_NAME= "___eval"; //$NON-NLS-1$
- private static final String ANONYMOUS_CLASS_NAME= "___EvalClass"; //$NON-NLS-1$
-
-
+
+ private static final String RUN_METHOD_NAME = "___run"; //$NON-NLS-1$
+ private static final String EVAL_METHOD_NAME = "___eval"; //$NON-NLS-1$
+ private static final String ANONYMOUS_CLASS_NAME = "___EvalClass"; //$NON-NLS-1$
+
private String[] fLocalVariableTypeNames;
-
+
private String[] fLocalVariableNames;
-
+
private boolean fIsInStaticMethod;
-
+
private StringBuffer fSource;
-
+
private int fRunMethodStartOffset;
private int fRunMethodLength;
private int fCodeSnippetPosition;
-
+
private String fCompilationUnitName;
-
+
/**
- * Level of source code to generate (major, minor). For example 1 and 4
+ * Level of source code to generate (major, minor). For example 1 and 4
* indicates 1.4.
*/
private int fSourceMajorLevel;
private int fSourceMinorLevel;
-
- public BinaryBasedSourceGenerator(String[] localTypesNames, String[] localVariables, boolean isInStaticMethod, String sourceLevel) {
- fLocalVariableTypeNames= localTypesNames;
- fLocalVariableNames= localVariables;
- fIsInStaticMethod= isInStaticMethod;
+
+ public BinaryBasedSourceGenerator(String[] localTypesNames,
+ String[] localVariables, boolean isInStaticMethod,
+ String sourceLevel) {
+ fLocalVariableTypeNames = localTypesNames;
+ fLocalVariableNames = localVariables;
+ fIsInStaticMethod = isInStaticMethod;
int index = sourceLevel.indexOf('.');
String num = sourceLevel.substring(0, index);
fSourceMajorLevel = Integer.valueOf(num).intValue();
num = sourceLevel.substring(index + 1);
fSourceMinorLevel = Integer.valueOf(num).intValue();
}
-
+
/**
* Build source for an object value (instance context)
*/
public void buildSource(JDIReferenceType referenceType) {
- ReferenceType reference= (ReferenceType)referenceType.getUnderlyingType();
- fSource= buildTypeDeclaration(reference, buildRunMethod(reference), null);
+ ReferenceType reference = (ReferenceType) referenceType
+ .getUnderlyingType();
+ fSource = buildTypeDeclaration(reference, buildRunMethod(reference),
+ null);
}
-
+
/**
* Build source for a class type (static context)
*/
public void buildSourceStatic(IJavaReferenceType type) {
- Type underlyingType= ((JDIReferenceType)type).getUnderlyingType();
+ Type underlyingType = ((JDIReferenceType) type).getUnderlyingType();
if (!(underlyingType instanceof ReferenceType)) {
return;
}
- ReferenceType refType= (ReferenceType)underlyingType;
- fSource= buildTypeDeclaration(refType, buildRunMethod(refType), null, false);
+ ReferenceType refType = (ReferenceType) underlyingType;
+ fSource = buildTypeDeclaration(refType, buildRunMethod(refType), null,
+ false);
String packageName = getPackageName(refType.name());
if (packageName != null) {
fSource.insert(0, "package " + packageName + ";\n"); //$NON-NLS-1$ //$NON-NLS-2$
fCodeSnippetPosition += 10 + packageName.length();
}
- fCompilationUnitName= getSimpleName(refType.name());
+ fCompilationUnitName = getSimpleName(refType.name());
}
-
+
protected String getUniqueMethodName(String methodName, ReferenceType type) {
- List methods= type.methodsByName(methodName);
+ List<Method> methods = type.methodsByName(methodName);
while (!methods.isEmpty()) {
methodName += '_';
- methods= type.methodsByName(methodName);
+ methods = type.methodsByName(methodName);
}
return methodName;
}
-
+
private StringBuffer buildRunMethod(ReferenceType type) {
StringBuffer source = new StringBuffer();
-
+
if (isInStaticMethod()) {
source.append("static "); //$NON-NLS-1$
}
@@ -111,7 +114,7 @@ public class BinaryBasedSourceGenerator {
source.append("void "); //$NON-NLS-1$
source.append(getUniqueMethodName(RUN_METHOD_NAME, type));
source.append('(');
- for(int i= 0, length= fLocalVariableNames.length; i < length; i++) {
+ for (int i = 0, length = fLocalVariableNames.length; i < length; i++) {
source.append(getDotName(fLocalVariableTypeNames[i]));
source.append(' ');
source.append(fLocalVariableNames[i]);
@@ -120,30 +123,32 @@ public class BinaryBasedSourceGenerator {
}
source.append(") throws Throwable {"); //$NON-NLS-1$
source.append('\n');
- fCodeSnippetPosition= source.length();
- fRunMethodStartOffset= fCodeSnippetPosition;
+ fCodeSnippetPosition = source.length();
+ fRunMethodStartOffset = fCodeSnippetPosition;
source.append('\n');
source.append('}').append('\n');
- fRunMethodLength= source.length();
+ fRunMethodLength = source.length();
return source;
}
-
- private StringBuffer buildTypeDeclaration(ReferenceType referenceType, StringBuffer buffer, String nestedTypeName) {
-
- Field thisField= null;
-
- List fields= referenceType.visibleFields();
- for (Iterator iterator= fields.iterator(); iterator.hasNext();) {
- Field field= (Field) iterator.next();
+
+ private StringBuffer buildTypeDeclaration(ReferenceType referenceType,
+ StringBuffer buffer, String nestedTypeName) {
+
+ Field thisField = null;
+
+ List<Field> fields = referenceType.visibleFields();
+ for (Iterator<Field> iterator = fields.iterator(); iterator.hasNext();) {
+ Field field = iterator.next();
if (field.name().startsWith("this$")) { //$NON-NLS-1$
thisField = field;
break;
}
}
-
- StringBuffer source = buildTypeDeclaration(referenceType, buffer, nestedTypeName, thisField != null);
-
+
+ StringBuffer source = buildTypeDeclaration(referenceType, buffer,
+ nestedTypeName, thisField != null);
+
if (thisField == null) {
String packageName = getPackageName(referenceType.name());
if (packageName != null) {
@@ -151,38 +156,43 @@ public class BinaryBasedSourceGenerator {
fCodeSnippetPosition += 10 + packageName.length();
}
if (isAnonymousTypeName(referenceType.name())) {
- fCompilationUnitName= ANONYMOUS_CLASS_NAME;
+ fCompilationUnitName = ANONYMOUS_CLASS_NAME;
} else {
- fCompilationUnitName= getSimpleName(referenceType.name());
+ fCompilationUnitName = getSimpleName(referenceType.name());
}
} else {
try {
- return buildTypeDeclaration((ReferenceType) thisField.type(), source, referenceType.name());
+ return buildTypeDeclaration((ReferenceType) thisField.type(),
+ source, referenceType.name());
} catch (ClassNotLoadedException e) {
}
}
-
+
return source;
}
- private StringBuffer buildTypeDeclaration(ReferenceType referenceType, StringBuffer buffer, String nestedTypeName, boolean hasEnclosingInstance) {
- StringBuffer source= new StringBuffer();
-
- String typeName= referenceType.name();
-
- boolean isAnonymousType= isAnonymousTypeName(typeName);
-
+ private StringBuffer buildTypeDeclaration(ReferenceType referenceType,
+ StringBuffer buffer, String nestedTypeName,
+ boolean hasEnclosingInstance) {
+ StringBuffer source = new StringBuffer();
+
+ String typeName = referenceType.name();
+
+ boolean isAnonymousType = isAnonymousTypeName(typeName);
+
if (isAnonymousType) {
- ClassType classType= (ClassType) referenceType;
-
- List interfaceList= classType.interfaces();
- String superClassName= classType.superclass().name();
+ ClassType classType = (ClassType) referenceType;
+
+ List<InterfaceType> interfaceList = classType.interfaces();
+ String superClassName = classType.superclass().name();
if (hasEnclosingInstance) {
source.append("void "); //$NON-NLS-1$
- source.append(getUniqueMethodName(EVAL_METHOD_NAME, referenceType));
+ source.append(getUniqueMethodName(EVAL_METHOD_NAME,
+ referenceType));
source.append("() {\nnew "); //$NON-NLS-1$
if (interfaceList.size() != 0) {
- source.append(getDotName(((InterfaceType)interfaceList.get(0)).name()));
+ source.append(getDotName(interfaceList
+ .get(0).name()));
} else {
source.append(getDotName(superClassName));
}
@@ -190,160 +200,178 @@ public class BinaryBasedSourceGenerator {
} else {
source.append("public class ").append(ANONYMOUS_CLASS_NAME).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
if (interfaceList.size() != 0) {
- source.append(" implements ").append(getDotName(((InterfaceType)interfaceList.get(0)).name())); //$NON-NLS-1$
+ source.append(" implements ").append(getDotName(interfaceList.get(0).name())); //$NON-NLS-1$
} else {
source.append(" extends ").append(getDotName(superClassName)); //$NON-NLS-1$
}
}
-
+
} else {
if (referenceType.isFinal()) {
source.append("final "); //$NON-NLS-1$
}
-
+
if (referenceType.isStatic()) {
source.append("static "); //$NON-NLS-1$
}
-
+
if (referenceType instanceof ClassType) {
- ClassType classType= (ClassType) referenceType;
-
+ ClassType classType = (ClassType) referenceType;
+
if (classType.isAbstract()) {
source.append("abstract "); //$NON-NLS-1$
}
-
+
source.append("class "); //$NON-NLS-1$
source.append(getSimpleName(typeName)).append(' ');
- String genericSignature= referenceType.genericSignature();
- if (genericSignature != null && isSourceLevelGreaterOrEqual(1, 5)) {
- String[] typeParameters= Signature.getTypeParameters(genericSignature);
+ String genericSignature = referenceType.genericSignature();
+ if (genericSignature != null
+ && isSourceLevelGreaterOrEqual(1, 5)) {
+ String[] typeParameters = Signature
+ .getTypeParameters(genericSignature);
if (typeParameters.length > 0) {
source.append('<');
- source.append(Signature.getTypeVariable(typeParameters[0]));
- String[] typeParameterBounds= Signature.getTypeParameterBounds(typeParameters[0]);
+ source.append(Signature
+ .getTypeVariable(typeParameters[0]));
+ String[] typeParameterBounds = Signature
+ .getTypeParameterBounds(typeParameters[0]);
source.append(" extends ").append(Signature.toString(typeParameterBounds[0]).replace('/', '.')); //$NON-NLS-1$
- for (int i= 1; i < typeParameterBounds.length; i++) {
+ for (int i = 1; i < typeParameterBounds.length; i++) {
source.append(" & ").append(Signature.toString(typeParameterBounds[i]).replace('/', '.')); //$NON-NLS-1$
}
- for (int j= 1; j < typeParameters.length; j++) {
- source.append(',').append(Signature.getTypeVariable(typeParameters[j]));
- typeParameterBounds= Signature.getTypeParameterBounds(typeParameters[j]);
+ for (int j = 1; j < typeParameters.length; j++) {
+ source.append(',')
+ .append(Signature
+ .getTypeVariable(typeParameters[j]));
+ typeParameterBounds = Signature
+ .getTypeParameterBounds(typeParameters[j]);
source.append(" extends ").append(Signature.toString(typeParameterBounds[0]).replace('/', '.')); //$NON-NLS-1$
- for (int i= 1; i < typeParameterBounds.length; i++) {
+ for (int i = 1; i < typeParameterBounds.length; i++) {
source.append(" & ").append(Signature.toString(typeParameterBounds[i]).replace('/', '.')); //$NON-NLS-1$
}
}
source.append("> "); //$NON-NLS-1$
}
- String[] superClassInterfaces= SignatureExt.getTypeSuperClassInterfaces(genericSignature);
- int length= superClassInterfaces.length;
+ String[] superClassInterfaces = SignatureExt
+ .getTypeSuperClassInterfaces(genericSignature);
+ int length = superClassInterfaces.length;
if (length > 0) {
source.append("extends ").append(Signature.toString(superClassInterfaces[0]).replace('/', '.')); //$NON-NLS-1$
if (length > 1) {
source.append(" implements ").append(Signature.toString(superClassInterfaces[1]).replace('/', '.')); //$NON-NLS-1$
for (int i = 2; i < length; i++) {
- source.append(',').append(Signature.toString(superClassInterfaces[1]));
+ source.append(',')
+ .append(Signature
+ .toString(superClassInterfaces[1]));
}
}
}
} else {
-
- ClassType superClass= classType.superclass();
+
+ ClassType superClass = classType.superclass();
if (superClass != null) {
source.append("extends ").append(getDotName(superClass.name())).append(' '); //$NON-NLS-1$
}
-
- List interfaces;
+
+ List<InterfaceType> interfaces;
try {
- interfaces= classType.interfaces();
+ interfaces = classType.interfaces();
} catch (ClassNotPreparedException e) {
return new StringBuffer();
}
if (interfaces.size() != 0) {
source.append("implements "); //$NON-NLS-1$
- Iterator iterator= interfaces.iterator();
- InterfaceType interface_= (InterfaceType)iterator.next();
+ Iterator<InterfaceType> iterator = interfaces.iterator();
+ InterfaceType interface_ = iterator
+ .next();
source.append(getDotName(interface_.name()));
while (iterator.hasNext()) {
- source.append(',').append(getDotName(((InterfaceType)iterator.next()).name()));
+ source.append(',')
+ .append(getDotName(iterator
+ .next().name()));
}
}
}
} else if (referenceType instanceof InterfaceType) {
if (buffer != null) {
source.append("abstract class "); //$NON-NLS-1$
- source.append(getSimpleName(typeName)).append("___ implements "); //$NON-NLS-1$
+ source.append(getSimpleName(typeName)).append(
+ "___ implements "); //$NON-NLS-1$
source.append(typeName.replace('$', '.')).append(" {\n"); //$NON-NLS-1$
fCodeSnippetPosition += source.length();
source.append(buffer).append("}\n"); //$NON-NLS-1$
}
-
+
return source;
}
}
-
+
source.append(" {\n"); //$NON-NLS-1$
-
+
if (buffer != null && !(referenceType instanceof InterfaceType)) {
fCodeSnippetPosition += source.length();
source.append(buffer);
}
-
- List fields= referenceType.fields();
- for (Iterator iterator= fields.iterator(); iterator.hasNext();) {
- Field field= (Field) iterator.next();
+
+ List<Field> fields = referenceType.fields();
+ for (Iterator<Field> iterator = fields.iterator(); iterator.hasNext();) {
+ Field field = iterator.next();
if (!field.name().startsWith("this$")) { //$NON-NLS-1$
source.append(buildFieldDeclaration(field));
}
}
-
- List methods= referenceType.methods();
- for (Iterator iterator = methods.iterator(); iterator.hasNext();) {
- Method method= (Method) iterator.next();
- if (!method.isConstructor() && !method.isStaticInitializer() && !method.isBridge()) {
+
+ List<Method> methods = referenceType.methods();
+ for (Iterator<Method> iterator = methods.iterator(); iterator.hasNext();) {
+ Method method = iterator.next();
+ if (!method.isConstructor() && !method.isStaticInitializer()
+ && !method.isBridge()) {
source.append(buildMethodDeclaration(method));
}
}
-
- List nestedTypes= referenceType.nestedTypes();
+
+ List<ReferenceType> nestedTypes = referenceType.nestedTypes();
if (nestedTypeName == null) {
- for (Iterator iterator = nestedTypes.iterator(); iterator.hasNext();) {
- ReferenceType nestedType= (ReferenceType) iterator.next();
+ for (Iterator<ReferenceType> iterator = nestedTypes.iterator(); iterator.hasNext();) {
+ ReferenceType nestedType = iterator.next();
if (isADirectInnerType(typeName, nestedType.name())) {
- source.append(buildTypeDeclaration(nestedType, null, null, true));
+ source.append(buildTypeDeclaration(nestedType, null, null,
+ true));
}
}
} else {
- for (Iterator iterator = nestedTypes.iterator(); iterator.hasNext();) {
- ReferenceType nestedType= (ReferenceType) iterator.next();
- if (!nestedTypeName.equals(nestedType.name()) && isADirectInnerType(typeName, nestedType.name())) {
- source.append(buildTypeDeclaration(nestedType, null, null, true));
+ for (Iterator<ReferenceType> iterator = nestedTypes.iterator(); iterator.hasNext();) {
+ ReferenceType nestedType = iterator.next();
+ if (!nestedTypeName.equals(nestedType.name())
+ && isADirectInnerType(typeName, nestedType.name())) {
+ source.append(buildTypeDeclaration(nestedType, null, null,
+ true));
}
}
}
-
+
if (isAnonymousType & hasEnclosingInstance) {
source.append("};\n"); //$NON-NLS-1$
}
-
+
source.append("}\n"); //$NON-NLS-1$
-
+
return source;
}
-
+
private StringBuffer buildFieldDeclaration(Field field) {
StringBuffer source = new StringBuffer();
-
+
if (field.isFinal()) {
source.append("final "); //$NON-NLS-1$
}
-
+
if (field.isStatic()) {
source.append("static "); //$NON-NLS-1$
}
-
+
if (field.isPublic()) {
source.append("public "); //$NON-NLS-1$
} else if (field.isPrivate()) {
@@ -351,29 +379,30 @@ public class BinaryBasedSourceGenerator {
} else if (field.isProtected()) {
source.append("protected "); //$NON-NLS-1$
}
-
- source.append(getDotName(field.typeName())).append(' ').append(field.name()).append(';').append('\n');
-
+
+ source.append(getDotName(field.typeName())).append(' ')
+ .append(field.name()).append(';').append('\n');
+
return source;
}
-
+
private StringBuffer buildMethodDeclaration(Method method) {
- StringBuffer source= new StringBuffer();
-
+ StringBuffer source = new StringBuffer();
+
if (method.isFinal()) {
source.append("final "); //$NON-NLS-1$
}
-
+
if (method.isStatic()) {
source.append("static "); //$NON-NLS-1$
}
-
+
if (method.isNative()) {
source.append("native "); //$NON-NLS-1$
} else if (method.isAbstract()) {
source.append("abstract "); //$NON-NLS-1$
}
-
+
if (method.isPublic()) {
source.append("public "); //$NON-NLS-1$
} else if (method.isPrivate()) {
@@ -381,62 +410,87 @@ public class BinaryBasedSourceGenerator {
} else if (method.isProtected()) {
source.append("protected "); //$NON-NLS-1$
}
-
- String genericSignature= method.genericSignature();
+
+ String genericSignature = method.genericSignature();
if (genericSignature != null && isSourceLevelGreaterOrEqual(1, 5)) {
- String[] typeParameters= Signature.getTypeParameters(genericSignature);
+ String[] typeParameters = Signature
+ .getTypeParameters(genericSignature);
if (typeParameters.length > 0) {
source.append('<');
source.append(Signature.getTypeVariable(typeParameters[0]));
- String[] typeParameterBounds= Signature.getTypeParameterBounds(typeParameters[0]);
+ String[] typeParameterBounds = Signature
+ .getTypeParameterBounds(typeParameters[0]);
source.append(" extends ").append(Signature.toString(typeParameterBounds[0]).replace('/', '.')); //$NON-NLS-1$
- for (int i= 1; i < typeParameterBounds.length; i++) {
+ for (int i = 1; i < typeParameterBounds.length; i++) {
source.append(" & ").append(Signature.toString(typeParameterBounds[i]).replace('/', '.')); //$NON-NLS-1$
}
- for (int j= 1; j < typeParameters.length; j++) {
- source.append(',').append(Signature.getTypeVariable(typeParameters[j]));
- typeParameterBounds= Signature.getTypeParameterBounds(typeParameters[j]);
+ for (int j = 1; j < typeParameters.length; j++) {
+ source.append(',').append(
+ Signature.getTypeVariable(typeParameters[j]));
+ typeParameterBounds = Signature
+ .getTypeParameterBounds(typeParameters[j]);
source.append(" extends ").append(Signature.toString(typeParameterBounds[0]).replace('/', '.')); //$NON-NLS-1$
- for (int i= 1; i < typeParameterBounds.length; i++) {
+ for (int i = 1; i < typeParameterBounds.length; i++) {
source.append(" & ").append(Signature.toString(typeParameterBounds[i]).replace('/', '.')); //$NON-NLS-1$
}
}
source.append("> "); //$NON-NLS-1$
}
-
- source.append(Signature.toString(Signature.getReturnType(genericSignature)).replace('/', '.')).append(' ').append(method.name()).append('(');
-
- String[] parameterTypes= Signature.getParameterTypes(genericSignature);
- int i= 0;
+
+ source.append(
+ Signature.toString(
+ Signature.getReturnType(genericSignature)).replace(
+ '/', '.')).append(' ').append(method.name())
+ .append('(');
+
+ String[] parameterTypes = Signature
+ .getParameterTypes(genericSignature);
+ int i = 0;
if (parameterTypes.length != 0) {
- source.append(Signature.toString(parameterTypes[0]).replace('/', '.')).append(" arg").append(i++); //$NON-NLS-1$
+ source.append(
+ Signature.toString(parameterTypes[0]).replace('/', '.'))
+ .append(" arg").append(i++); //$NON-NLS-1$
if (method.isVarArgs()) {
- for (int j= 1; j < parameterTypes.length - 1; j++) {
- source.append(',').append(Signature.toString(parameterTypes[j]).replace('/', '.')).append(" arg").append(i++); //$NON-NLS-1$
+ for (int j = 1; j < parameterTypes.length - 1; j++) {
+ source.append(',')
+ .append(Signature.toString(parameterTypes[j])
+ .replace('/', '.'))
+ .append(" arg").append(i++); //$NON-NLS-1$
}
- String typeName= Signature.toString(parameterTypes[parameterTypes.length - 1]).replace('/', '.');
- source.append(',').append(typeName.substring(0,typeName.length() - 2)).append("...").append(" arg").append(i++); //$NON-NLS-1$ //$NON-NLS-2$
+ String typeName = Signature.toString(
+ parameterTypes[parameterTypes.length - 1]).replace(
+ '/', '.');
+ source.append(',')
+ .append(typeName.substring(0, typeName.length() - 2))
+ .append("...").append(" arg").append(i++); //$NON-NLS-1$ //$NON-NLS-2$
} else {
- for (int j= 1; j < parameterTypes.length; j++) {
- source.append(',').append(Signature.toString(parameterTypes[j]).replace('/', '.')).append(" arg").append(i++); //$NON-NLS-1$
+ for (int j = 1; j < parameterTypes.length; j++) {
+ source.append(',')
+ .append(Signature.toString(parameterTypes[j])
+ .replace('/', '.'))
+ .append(" arg").append(i++); //$NON-NLS-1$
}
}
}
source.append(')');
} else {
- source.append(getDotName(method.returnTypeName())).append(' ').append(method.name()).append('(');
-
- List arguments= method.argumentTypeNames();
- int i= 0;
+ source.append(getDotName(method.returnTypeName())).append(' ')
+ .append(method.name()).append('(');
+
+ List<String> arguments = method.argumentTypeNames();
+ int i = 0;
if (arguments.size() != 0) {
- Iterator iterator= arguments.iterator();
- source.append(getDotName((String) iterator.next())).append(" arg").append(i++); //$NON-NLS-1$
+ Iterator<String> iterator = arguments.iterator();
+ source.append(getDotName(iterator.next()))
+ .append(" arg").append(i++); //$NON-NLS-1$
if (method.isVarArgs()) {
while (iterator.hasNext()) {
source.append(',');
- String argName = getDotName((String) iterator.next());
+ String argName = getDotName(iterator.next());
if (!iterator.hasNext()) {
- source.append(argName.substring(0,argName.length() - 2)).append("..."); //$NON-NLS-1$
+ source.append(
+ argName.substring(0, argName.length() - 2))
+ .append("..."); //$NON-NLS-1$
} else {
source.append(argName);
}
@@ -444,13 +498,15 @@ public class BinaryBasedSourceGenerator {
}
} else {
while (iterator.hasNext()) {
- source.append(',').append(getDotName((String) iterator.next())).append(" arg").append(i++); //$NON-NLS-1$
+ source.append(',')
+ .append(getDotName(iterator.next()))
+ .append(" arg").append(i++); //$NON-NLS-1$
}
}
}
source.append(')');
}
-
+
if (method.isAbstract() || method.isNative()) {
// No body for abstract and native methods
source.append(";\n"); //$NON-NLS-1$
@@ -462,35 +518,35 @@ public class BinaryBasedSourceGenerator {
return source;
}
-
+
private String getReturnStatement(String returnTypeName) {
- String typeName= getSimpleName(returnTypeName);
+ String typeName = getSimpleName(returnTypeName);
if (typeName.charAt(typeName.length() - 1) == ']') {
return "return null;\n"; //$NON-NLS-1$
}
switch (typeName.charAt(0)) {
- case 'v':
- return ""; //$NON-NLS-1$
- case 'b':
- if (typeName.charAt(1) == 'o') {
- return "return false;\n"; //$NON-NLS-1$
- }
- case 's':
- case 'c':
- case 'i':
- case 'l':
- case 'd':
- case 'f':
- return "return 0;\n"; //$NON-NLS-1$
- default:
- return "return null;\n"; //$NON-NLS-1$
+ case 'v':
+ return ""; //$NON-NLS-1$
+ case 'b':
+ if (typeName.charAt(1) == 'o') {
+ return "return false;\n"; //$NON-NLS-1$
+ }
+ case 's':
+ case 'c':
+ case 'i':
+ case 'l':
+ case 'd':
+ case 'f':
+ return "return 0;\n"; //$NON-NLS-1$
+ default:
+ return "return null;\n"; //$NON-NLS-1$
}
}
-
+
private String getDotName(String typeName) {
return typeName.replace('$', '.');
}
-
+
private boolean isAnonymousTypeName(String typeName) {
char char0 = getSimpleName(typeName).charAt(0);
return '0' <= char0 && char0 <= '9';
@@ -501,57 +557,59 @@ public class BinaryBasedSourceGenerator {
if (pos == -1) {
pos = qualifiedName.lastIndexOf('.');
}
- return ((pos == -1)? qualifiedName : qualifiedName.substring(pos + 1));
+ return ((pos == -1) ? qualifiedName : qualifiedName.substring(pos + 1));
}
-
+
private String getPackageName(String qualifiedName) {
int pos = qualifiedName.lastIndexOf('.');
- return ((pos == -1)? null : qualifiedName.substring(0, pos));
+ return ((pos == -1) ? null : qualifiedName.substring(0, pos));
}
-
+
private boolean isADirectInnerType(String typeName, String nestedTypeName) {
- String end= nestedTypeName.substring(typeName.length() + 1);
+ String end = nestedTypeName.substring(typeName.length() + 1);
return end.indexOf('$') == -1;
}
-
+
private boolean isInStaticMethod() {
return fIsInStaticMethod;
}
-
+
public StringBuffer getSource() {
return fSource;
}
-
+
public int getCodeSnippetPosition() {
return fCodeSnippetPosition;
}
-
+
public String getCompilationUnitName() {
return fCompilationUnitName;
}
-
+
public int getSnippetStart() {
return fCodeSnippetPosition - 2;
}
-
+
public int getRunMethodStart() {
return fCodeSnippetPosition - fRunMethodStartOffset;
}
-
+
public int getRunMethodLength() {
return fRunMethodLength;
}
/**
- * Returns whether the source to be generated is greater than or equal to the
- * given source level.
+ * Returns whether the source to be generated is greater than or equal to
+ * the given source level.
*
- * @param major major level - e.g. 1 from 1.4
- * @param minor minor level - e.g. 4 from 1.4
+ * @param major
+ * major level - e.g. 1 from 1.4
+ * @param minor
+ * minor level - e.g. 4 from 1.4
* @return
*/
public boolean isSourceLevelGreaterOrEqual(int major, int minor) {
- return (fSourceMajorLevel > major) ||
- (fSourceMajorLevel == major && fSourceMinorLevel >= minor);
- }
+ return (fSourceMajorLevel > major)
+ || (fSourceMajorLevel == major && fSourceMinorLevel >= minor);
+ }
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
index ccfba0fbd..3817e88ca 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
@@ -59,7 +59,7 @@ public class EvaluationEngineMessages extends NLS {
NLS.initializeMessages(BUNDLE_NAME, EvaluationEngineMessages.class);
}
- public static String ASTEvaluationEngine_0;
+ public static String ASTEvaluationEngine_0;
public static String ASTEvaluationEngine_1;
public static String ArrayRuntimeContext_0;
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java
index ff090164b..f21a3b91d 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java
@@ -29,11 +29,10 @@ import org.eclipse.jdt.internal.debug.core.JavaDebugUtils;
import org.eclipse.jdt.internal.debug.core.model.JDIReferenceType;
/**
- * Creates the source code necessary to evaluate a code snippet.
- * The (simplified) structure of the source is as follows:
- * [package <package name>;]
- * [import <import name>;]*
- * public class <code snippet class name> extends <global variable class name> {
+ * Creates the source code necessary to evaluate a code snippet. The
+ * (simplified) structure of the source is as follows: [package <package name>;]
+ * [import <import name>;]* public class
+ * <code snippet class name> extends <global variable class name> {
* public void run() {
* <code snippet>
* }
@@ -42,26 +41,26 @@ import org.eclipse.jdt.internal.debug.core.model.JDIReferenceType;
public class EvaluationSourceGenerator {
private String fCodeSnippet;
-
+
private String[] fLocalVariableTypeNames;
private String[] fLocalVariableNames;
-
-
+
private String fSource;
private String fCompilationUnitName;
private int fSnippetStartPosition;
private int fRunMethodStartPosition;
private int fRunMethodLength;
-
+
/**
* Rebuild source in presence of external local variables
*/
- public EvaluationSourceGenerator(String[] localVariableTypesNames, String[] localVariableNames, String codeSnippet) {
+ public EvaluationSourceGenerator(String[] localVariableTypesNames,
+ String[] localVariableNames, String codeSnippet) {
fLocalVariableTypeNames = localVariableTypesNames;
fLocalVariableNames = localVariableNames;
- fCodeSnippet= getCompleteSnippet(codeSnippet);
+ fCodeSnippet = getCompleteSnippet(codeSnippet);
}
-
+
public EvaluationSourceGenerator(String codeSnippet) {
this(new String[0], new String[0], codeSnippet);
}
@@ -73,80 +72,91 @@ public class EvaluationSourceGenerator {
}
return codeSnippet;
}
-
+
/**
- * Returns whether the given snippet represents an expression.
- * This is determined by examining the snippet for non-quoted semicolons.
+ * Returns whether the given snippet represents an expression. This is
+ * determined by examining the snippet for non-quoted semicolons.
*
* Returns <code>true</code> if the snippet is an expression, or
- * <code>false</code> if the expresssion contains a statement.
+ * <code>false</code> if the expression contains a statement.
*/
protected boolean isExpression(String codeSnippet) {
- boolean inString= false;
- byte[] chars= codeSnippet.getBytes();
- for (int i= 0, numChars= chars.length; i < numChars; i++) {
+ boolean inString = false;
+ byte[] chars = codeSnippet.getBytes();
+ for (int i = 0, numChars = chars.length; i < numChars; i++) {
switch (chars[i]) {
- case '\\':
- if (inString) { // skip the char after an escape char
- i++;
- }
- break;
- case '\"':
- case '\'':
- inString= !inString;
- break;
- case ';':
- if (!inString) {
- return false;
- }
- break;
+ case '\\':
+ if (inString) { // skip the char after an escape char
+ i++;
+ }
+ break;
+ case '\"':
+ case '\'':
+ inString = !inString;
+ break;
+ case ';':
+ if (!inString) {
+ return false;
+ }
+ break;
}
}
return true;
}
-
+
public String getCompilationUnitName() {
return fCompilationUnitName;
}
-
+
public int getSnippetStart() {
return fSnippetStartPosition;
}
+
public int getRunMethodStart() {
return fRunMethodStartPosition;
}
+
public int getRunMethodLength() {
return fRunMethodLength;
}
+
protected void setSnippetStart(int position) {
- fSnippetStartPosition= position;
+ fSnippetStartPosition = position;
}
+
protected void setRunMethodStart(int position) {
- fRunMethodStartPosition= position;
+ fRunMethodStartPosition = position;
}
+
protected void setRunMethodLength(int length) {
- fRunMethodLength= length;
+ fRunMethodLength = length;
}
-
+
public String getSnippet() {
return fCodeSnippet;
}
- private void createEvaluationSourceFromSource(String source, IType type, boolean createInAStaticMethod, IJavaProject project) throws DebugException {
+ private void createEvaluationSourceFromSource(String source, IType type,
+ boolean createInAStaticMethod, IJavaProject project)
+ throws DebugException {
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(source.toCharArray());
- Map options=getCompilerOptions(project);
+ Map<String, String> options = getCompilerOptions(project);
String sourceLevel = project.getOption(JavaCore.COMPILER_SOURCE, true);
parser.setCompilerOptions(options);
- CompilationUnit unit= (CompilationUnit)parser.createAST(null);
- SourceBasedSourceGenerator visitor= new SourceBasedSourceGenerator(type, createInAStaticMethod, fLocalVariableTypeNames, fLocalVariableNames, fCodeSnippet, sourceLevel);
+ CompilationUnit unit = (CompilationUnit) parser.createAST(null);
+ SourceBasedSourceGenerator visitor = new SourceBasedSourceGenerator(
+ type, createInAStaticMethod, fLocalVariableTypeNames,
+ fLocalVariableNames, fCodeSnippet, sourceLevel);
unit.accept(visitor);
-
+
if (visitor.hasError()) {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, visitor.getError(), null));
+ throw new DebugException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ visitor.getError(), null));
}
-
- String sourceRes= visitor.getSource();
+
+ String sourceRes = visitor.getSource();
if (sourceRes == null) {
return;
}
@@ -156,47 +166,59 @@ public class EvaluationSourceGenerator {
setRunMethodStart(visitor.getRunMethodStart());
setRunMethodLength(visitor.getRunMethodLength());
}
-
+
/**
* Returns the compiler options used for compiling the expression.
* <p>
- * Turns all errors and warnings into ignore and disables task tags. The customizable set of
- * compiler options only contains additional Eclipse options. The standard JDK compiler options
- * can't be changed anyway.
+ * Turns all errors and warnings into ignore and disables task tags. The
+ * customizable set of compiler options only contains additional Eclipse
+ * options. The standard JDK compiler options can't be changed anyway.
*
- * @param element an element (not the Java model)
+ * @param element
+ * an element (not the Java model)
* @return compiler options
*/
- public static Map getCompilerOptions(IJavaProject project) {
- Map options= project.getOptions(true);
- for (Iterator iter= options.keySet().iterator(); iter.hasNext();) {
- String key= (String)iter.next();
- String value= (String)options.get(key);
+ public static Map<String, String> getCompilerOptions(IJavaProject project) {
+ Map<String, String> options = project.getOptions(true);
+ for (Iterator<String> iter = options.keySet().iterator(); iter.hasNext();) {
+ String key = iter.next();
+ String value = options.get(key);
if (JavaCore.ERROR.equals(value) || JavaCore.WARNING.equals(value)) {
options.put(key, JavaCore.IGNORE);
}
}
options.put(JavaCore.COMPILER_TASK_TAGS, ""); //$NON-NLS-1$
return options;
- }
-
- private void createEvaluationSourceFromJDIObject(BinaryBasedSourceGenerator objectToEvaluationSourceMapper) {
-
- setCompilationUnitName(objectToEvaluationSourceMapper.getCompilationUnitName());
+ }
+
+ private void createEvaluationSourceFromJDIObject(
+ BinaryBasedSourceGenerator objectToEvaluationSourceMapper) {
+
+ setCompilationUnitName(objectToEvaluationSourceMapper
+ .getCompilationUnitName());
setSnippetStart(objectToEvaluationSourceMapper.getSnippetStart());
setRunMethodStart(objectToEvaluationSourceMapper.getRunMethodStart());
- setRunMethodLength(fCodeSnippet.length() + objectToEvaluationSourceMapper.getRunMethodLength());
- setSource(objectToEvaluationSourceMapper.getSource().insert(objectToEvaluationSourceMapper.getCodeSnippetPosition(), fCodeSnippet).toString());
+ setRunMethodLength(fCodeSnippet.length()
+ + objectToEvaluationSourceMapper.getRunMethodLength());
+ setSource(objectToEvaluationSourceMapper
+ .getSource()
+ .insert(objectToEvaluationSourceMapper.getCodeSnippetPosition(),
+ fCodeSnippet).toString());
}
-
- private BinaryBasedSourceGenerator getInstanceSourceMapper(JDIReferenceType referenceType, boolean isInStaticMethod, IJavaProject project) {
+
+ private BinaryBasedSourceGenerator getInstanceSourceMapper(
+ JDIReferenceType referenceType, boolean isInStaticMethod,
+ IJavaProject project) {
String sourceLevel = project.getOption(JavaCore.COMPILER_SOURCE, true);
- BinaryBasedSourceGenerator objectToEvaluationSourceMapper = new BinaryBasedSourceGenerator(fLocalVariableTypeNames, fLocalVariableNames, isInStaticMethod, sourceLevel);
+ BinaryBasedSourceGenerator objectToEvaluationSourceMapper = new BinaryBasedSourceGenerator(
+ fLocalVariableTypeNames, fLocalVariableNames, isInStaticMethod,
+ sourceLevel);
objectToEvaluationSourceMapper.buildSource(referenceType);
return objectToEvaluationSourceMapper;
}
-
- public String getSource(IJavaReferenceType type, IJavaProject javaProject, boolean isStatic) throws CoreException {
+
+ public String getSource(IJavaReferenceType type, IJavaProject javaProject,
+ boolean isStatic) throws CoreException {
if (fSource == null) {
IType iType = JavaDebugUtils.resolveType(type);
if (iType != null && !iType.isInterface()) {
@@ -207,11 +229,13 @@ public class EvaluationSourceGenerator {
baseSource = iType.getCompilationUnit().getSource();
}
if (baseSource != null) {
- createEvaluationSourceFromSource(baseSource, iType, isStatic, javaProject);
+ createEvaluationSourceFromSource(baseSource, iType,
+ isStatic, javaProject);
}
}
if (fSource == null) {
- BinaryBasedSourceGenerator mapper= getInstanceSourceMapper((JDIReferenceType) type, isStatic, javaProject);
+ BinaryBasedSourceGenerator mapper = getInstanceSourceMapper(
+ (JDIReferenceType) type, isStatic, javaProject);
createEvaluationSourceFromJDIObject(mapper);
}
}
@@ -219,11 +243,11 @@ public class EvaluationSourceGenerator {
}
protected void setCompilationUnitName(String name) {
- fCompilationUnitName= name;
+ fCompilationUnitName = name;
}
-
+
protected void setSource(String source) {
- fSource= source;
+ fSource = source;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/IRuntimeContext.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/IRuntimeContext.java
index 8c68f51eb..9c53f8ef4 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/IRuntimeContext.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/IRuntimeContext.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.debug.core.IJavaClassObject;
@@ -19,107 +18,113 @@ import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaReferenceType;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.core.IJavaVariable;
-
+
/**
- * The context in which an evaluation is to be performed. An
- * evaluation is performed in the context of an object or class.
- * The evaluation may be in the context of a method, in which case
- * there could be local variables.
+ * The context in which an evaluation is to be performed. An evaluation is
+ * performed in the context of an object or class. The evaluation may be in the
+ * context of a method, in which case there could be local variables.
* <p>
* Clients are not intended to implement this interface.
*/
public interface IRuntimeContext {
-
+
/**
- * Returns the virtual machine in which to perform the
- * evaluation.
+ * Returns the virtual machine in which to perform the evaluation.
*
* @return virtual machine
*/
IJavaDebugTarget getVM();
-
+
/**
- * Returns the receiving object context in which to perform
- * the evaluation - equivalent to 'this'. Returns <code>null</code>
- * if the context of an evaluation is in a class rather than
- * an object.
+ * Returns the receiving object context in which to perform the evaluation -
+ * equivalent to 'this'. Returns <code>null</code> if the context of an
+ * evaluation is in a class rather than an object.
*
* @return 'this', or <code>null</code>
- * @exception EvaluationException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The exception's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception EvaluationException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The exception's
+ * status code contains the underlying exception responsible
+ * for the failure.</li>
+ * </ul>
*/
IJavaObject getThis() throws CoreException;
-
+
/**
- * Returns the receiving type context in which to perform
- * the evaluation. The type of 'this', or in the case of a
- * static context, the class or interface in which the evaluation is being
- * performed.
+ * Returns the receiving type context in which to perform the evaluation.
+ * The type of 'this', or in the case of a static context, the class or
+ * interface in which the evaluation is being performed.
*
* @return receiving class
- * @exception EvaluationException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The exception's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception EvaluationException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The exception's
+ * status code contains the underlying exception responsible
+ * for the failure.</li>
+ * </ul>
*/
IJavaReferenceType getReceivingType() throws CoreException;
-
+
/**
- * Returns the local variables visible for the evaluation.
- * This includes method arguments, if any. Does not return
- * <code>null</code> returns an empty collection if there
- * are no locals.
+ * Returns the local variables visible for the evaluation. This includes
+ * method arguments, if any. Does not return <code>null</code> returns an
+ * empty collection if there are no locals.
*
* @return local variables
- * @exception EvaluationException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The exception's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception EvaluationException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The exception's
+ * status code contains the underlying exception responsible
+ * for the failure.</li>
+ * </ul>
*/
IJavaVariable[] getLocals() throws CoreException;
/**
- * Returns the Java project context in which this expression
- * should be compiled.
+ * Returns the Java project context in which this expression should be
+ * compiled.
*
* @return project
*/
IJavaProject getProject();
-
+
/**
* Returns the thread in which message sends may be performed.
*
* @return thread
*/
IJavaThread getThread();
-
+
/**
- * Returns whether the context of this evaluation is within
- * a constructor.
+ * Returns whether the context of this evaluation is within a constructor.
*
- * @return whether the context of this evaluation is within
- * a constructor
- * @exception EvaluationException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The exception's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @return whether the context of this evaluation is within a constructor
+ * @exception EvaluationException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The exception's
+ * status code contains the underlying exception responsible
+ * for the failure.</li>
+ * </ul>
*/
public boolean isConstructor() throws CoreException;
- /**
- * Loads, prepares and returns the class with the given name in this runtime
- * context's receiving type's class loader. If the class is already loaded,
- * it is simply returned.
- *
- * @param name fully qualified class name
- * @return class object
- * @throws CoreException if unable to load the class
- * @since 3.2
- */
- public IJavaClassObject classForName(String name) throws CoreException;
-
-}
+ /**
+ * Loads, prepares and returns the class with the given name in this runtime
+ * context's receiving type's class loader. If the class is already loaded,
+ * it is simply returned.
+ *
+ * @param name
+ * fully qualified class name
+ * @return class object
+ * @throws CoreException
+ * if unable to load the class
+ * @since 3.2
+ */
+ public IJavaClassObject classForName(String name) throws CoreException;
+}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java
index 19f9d1259..1d3dfa493 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java
@@ -36,79 +36,81 @@ public class Interpreter {
private Instruction[] fInstructions;
private int fInstructionCounter;
private IRuntimeContext fContext;
- private Stack fStack;
+ private Stack<Object> fStack;
private IJavaValue fLastValue;
-
+
/**
* The list of internal variables
*/
- private Map fInternalVariables;
-
+ private Map<String, IVariable> fInternalVariables;
+
/**
* List of objects for which GC has been disabled
*/
- private List fPermStorage = null;
-
- private boolean fStopped= false;
-
+ private List<IJavaObject> fPermStorage = null;
+
+ private boolean fStopped = false;
+
public Interpreter(InstructionSequence instructions, IRuntimeContext context) {
- fInstructions= instructions.getInstructions();
- fContext= context;
- fInternalVariables= new HashMap();
+ fInstructions = instructions.getInstructions();
+ fContext = context;
+ fInternalVariables = new HashMap<String, IVariable>();
}
-
+
public void execute() throws CoreException {
try {
reset();
- while(fInstructionCounter < fInstructions.length && !fStopped) {
- Instruction instruction= fInstructions[fInstructionCounter++];
+ while (fInstructionCounter < fInstructions.length && !fStopped) {
+ Instruction instruction = fInstructions[fInstructionCounter++];
instruction.setInterpreter(this);
instruction.execute();
instruction.setInterpreter(null);
}
} catch (VMDisconnectedException e) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), e.getMessage(), e));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(), e.getMessage(), e));
} finally {
releaseObjects();
}
}
-
+
public void stop() {
- fStopped= true;
+ fStopped = true;
}
private void reset() {
- fStack= new Stack();
- fInstructionCounter= 0;
+ fStack = new Stack<Object>();
+ fInstructionCounter = 0;
}
-
+
/**
* Jumps to a given address
*/
public void jump(int offset) {
- fInstructionCounter+= offset;
- }
-
+ fInstructionCounter += offset;
+ }
+
/**
* Pushes an object onto the stack. Disables garbage collection for any
- * interim object pushed onto the stack. Objects are released after the
+ * interim object pushed onto the stack. Objects are released after the
* evaluation completes.
*/
public void push(Object object) {
fStack.push(object);
if (object instanceof IJavaObject) {
- disableCollection((IJavaObject)object);
+ disableCollection((IJavaObject) object);
}
}
-
+
/**
* Avoid garbage collecting interim results.
*
- * @param value object to disable garbage collection for
+ * @param value
+ * object to disable garbage collection for
*/
private void disableCollection(IJavaObject value) {
if (fPermStorage == null) {
- fPermStorage = new ArrayList(5);
+ fPermStorage = new ArrayList<IJavaObject>(5);
}
try {
value.disableCollection();
@@ -117,19 +119,19 @@ public class Interpreter {
JDIDebugPlugin.log(e);
}
}
-
+
/**
* Re-enable garbage collection if interim results.
*/
private void releaseObjects() {
if (fPermStorage != null) {
- Iterator iterator = fPermStorage.iterator();
+ Iterator<IJavaObject> iterator = fPermStorage.iterator();
while (iterator.hasNext()) {
- IJavaObject object = (IJavaObject)iterator.next();
+ IJavaObject object = iterator.next();
try {
object.enableCollection();
} catch (CoreException e) {
- // don't worry about GC if the VM has terminated
+ // don't worry about GC if the VM has terminated
if ((e.getStatus().getException() instanceof VMDisconnectedException)) {
break;
}
@@ -145,22 +147,22 @@ public class Interpreter {
*/
public Object peek() {
return fStack.peek();
- }
-
+ }
+
/**
* Pops an object off of the stack
*/
public Object pop() {
return fStack.pop();
}
-
+
/**
* Answers the context for the interpreter
*/
public IRuntimeContext getContext() {
return fContext;
}
-
+
public IJavaValue getResult() {
if (fStack == null || fStack.isEmpty()) {
if (fLastValue == null) {
@@ -168,48 +170,54 @@ public class Interpreter {
}
return fLastValue;
}
- Object top= fStack.peek();
+ Object top = fStack.peek();
if (top instanceof IJavaVariable) {
try {
- return (IJavaValue)((IJavaVariable)top).getValue();
+ return (IJavaValue) ((IJavaVariable) top).getValue();
} catch (CoreException exception) {
- return getContext().getVM().newValue(exception.getStatus().getMessage());
+ return getContext().getVM().newValue(
+ exception.getStatus().getMessage());
}
}
if (top instanceof IJavaValue) {
- return (IJavaValue)top;
+ return (IJavaValue) top;
}
// XXX: exception
- return null;
+ return null;
}
-
+
public void setLastValue(IJavaValue value) {
- fLastValue= value;
+ fLastValue = value;
}
-
+
/**
- * Create a new variable in the interpreter with the given name
- * and the given type.
+ * Create a new variable in the interpreter with the given name and the
+ * given type.
*
- * @param name the name of the variable to create.
- * @param type the type of the variable to create.
+ * @param name
+ * the name of the variable to create.
+ * @param type
+ * the type of the variable to create.
* @return the created variable.
*/
public IVariable createInternalVariable(String name, IJavaType referencType) {
- IVariable var= new InterpreterVariable(name, referencType, fContext.getVM());
+ IVariable var = new InterpreterVariable(name, referencType,
+ fContext.getVM());
fInternalVariables.put(name, var);
return var;
}
-
+
/**
- * Return the variable with the given name.
- * This method only looks in the list of internal variable (i.e. created by
+ * Return the variable with the given name. This method only looks in the
+ * list of internal variable (i.e. created by
* Interpreter#createInternalVariable(String, IJavaType))
*
- * @param name the name of the variable to retrieve.
- * @return the corresponding variable, or <code>null</code> if there is none.
- */
+ * @param name
+ * the name of the variable to retrieve.
+ * @return the corresponding variable, or <code>null</code> if there is
+ * none.
+ */
public IVariable getInternalVariable(String name) {
- return (IVariable)fInternalVariables.get(name);
+ return fInternalVariables.get(name);
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/InterpreterVariable.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/InterpreterVariable.java
index 2ed99a81b..81d7e657b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/InterpreterVariable.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/InterpreterVariable.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
@@ -27,23 +26,24 @@ public class InterpreterVariable implements IJavaVariable {
* The reference type of this variable.
*/
private IJavaType fReferenceType;
-
+
/**
* The variable name.
*/
private String fName;
-
+
/**
* The variable value.
*/
private IValue fValue;
-
+
private IDebugTarget fDebugTarget;
- public InterpreterVariable(String name, IJavaType referenceType, IDebugTarget debugTarget) {
- fName= name;
- fReferenceType= referenceType;
- fDebugTarget= debugTarget;
+ public InterpreterVariable(String name, IJavaType referenceType,
+ IDebugTarget debugTarget) {
+ fName = name;
+ fReferenceType = referenceType;
+ fDebugTarget = debugTarget;
}
/**
@@ -99,14 +99,20 @@ public class InterpreterVariable implements IJavaVariable {
* @see org.eclipse.debug.core.model.IValueModification#setValue(String)
*/
public void setValue(String expression) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.NOT_SUPPORTED, EvaluationEngineMessages.InterpreterVariable_setValue_String__not_supported_for_interpreter_variable_1, null));
+ throw new DebugException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.NOT_SUPPORTED,
+ EvaluationEngineMessages.InterpreterVariable_setValue_String__not_supported_for_interpreter_variable_1,
+ null));
}
/**
* @see org.eclipse.debug.core.model.IValueModification#setValue(IValue)
*/
public void setValue(IValue value) {
- fValue= value;
+ fValue = value;
}
/**
@@ -120,14 +126,26 @@ public class InterpreterVariable implements IJavaVariable {
* @see org.eclipse.debug.core.model.IValueModification#verifyValue(IValue)
*/
public boolean verifyValue(IValue value) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.NOT_SUPPORTED, EvaluationEngineMessages.InterpreterVariable_verifyValue_IValue__not_supported_for_interpreter_variable_2, null));
+ throw new DebugException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.NOT_SUPPORTED,
+ EvaluationEngineMessages.InterpreterVariable_verifyValue_IValue__not_supported_for_interpreter_variable_2,
+ null));
}
/**
* @see org.eclipse.debug.core.model.IValueModification#verifyValue(String)
*/
public boolean verifyValue(String expression) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.NOT_SUPPORTED, EvaluationEngineMessages.InterpreterVariable_verifyValue_String__not_supported_for_interpreter_variable_3, null));
+ throw new DebugException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.NOT_SUPPORTED,
+ EvaluationEngineMessages.InterpreterVariable_verifyValue_String__not_supported_for_interpreter_variable_3,
+ null));
}
/**
@@ -206,8 +224,10 @@ public class InterpreterVariable implements IJavaVariable {
public boolean isLocal() {
return false;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/JavaObjectRuntimeContext.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/JavaObjectRuntimeContext.java
index 93b331d2e..ea99441d3 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/JavaObjectRuntimeContext.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/JavaObjectRuntimeContext.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.debug.core.IJavaDebugTarget;
@@ -20,35 +19,39 @@ import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.core.IJavaVariable;
public class JavaObjectRuntimeContext extends AbstractRuntimeContext {
-
+
/**
* <code>this</code> object or this context.
*/
private IJavaObject fThisObject;
-
+
/**
* The thread for this context.
*/
private IJavaThread fThread;
-
+
/**
* ObjectValueRuntimeContext constructor.
*
- * @param thisObject <code>this</code> object of this context.
- * @param javaProject the project for this context.
- * @param thread the thread for this context.
+ * @param thisObject
+ * <code>this</code> object of this context.
+ * @param javaProject
+ * the project for this context.
+ * @param thread
+ * the thread for this context.
*/
- public JavaObjectRuntimeContext(IJavaObject thisObject, IJavaProject javaProject, IJavaThread thread) {
+ public JavaObjectRuntimeContext(IJavaObject thisObject,
+ IJavaProject javaProject, IJavaThread thread) {
super(javaProject);
- fThisObject= thisObject;
- fThread= thread;
+ fThisObject = thisObject;
+ fThread = thread;
}
/**
* @see IRuntimeContext#getVM()
*/
public IJavaDebugTarget getVM() {
- return (IJavaDebugTarget)fThisObject.getDebugTarget();
+ return (IJavaDebugTarget) fThisObject.getDebugTarget();
}
/**
@@ -62,7 +65,7 @@ public class JavaObjectRuntimeContext extends AbstractRuntimeContext {
* @see IRuntimeContext#getReceivingType()
*/
public IJavaReferenceType getReceivingType() throws CoreException {
- return (IJavaReferenceType)getThis().getJavaType();
+ return (IJavaReferenceType) getThis().getJavaType();
}
/**
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/RuntimeContext.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/RuntimeContext.java
index b9e654db4..8e08d693b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/RuntimeContext.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/RuntimeContext.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.debug.core.IJavaDebugTarget;
@@ -28,24 +27,24 @@ public class RuntimeContext extends AbstractRuntimeContext {
private IJavaStackFrame fFrame;
/**
- * Creates a runtime context for the given java project and
- * stack frame.
+ * Creates a runtime context for the given java project and stack frame.
*
- * @param project Java project context used to compile expressions in
- * @param frame stack frame used to define locals and receiving type
- * context
+ * @param project
+ * Java project context used to compile expressions in
+ * @param frame
+ * stack frame used to define locals and receiving type context
* @return a new runtime context
*/
public RuntimeContext(IJavaProject project, IJavaStackFrame frame) {
super(project);
setFrame(frame);
}
-
+
/**
* @see IRuntimeContext#getVM()
*/
public IJavaDebugTarget getVM() {
- return (IJavaDebugTarget)getFrame().getDebugTarget();
+ return (IJavaDebugTarget) getFrame().getDebugTarget();
}
/**
@@ -61,7 +60,7 @@ public class RuntimeContext extends AbstractRuntimeContext {
public IJavaReferenceType getReceivingType() throws CoreException {
IJavaObject rec = getThis();
if (rec != null) {
- return (IJavaReferenceType)rec.getJavaType();
+ return (IJavaReferenceType) rec.getJavaType();
}
return getFrame().getReferenceType();
}
@@ -72,30 +71,32 @@ public class RuntimeContext extends AbstractRuntimeContext {
public IJavaVariable[] getLocals() throws CoreException {
return getFrame().getLocalVariables();
}
-
+
/**
* Sets the stack frame context used to compile/run expressions
*
- * @param frame the stack frame context used to compile/run expressions
+ * @param frame
+ * the stack frame context used to compile/run expressions
*/
protected IJavaStackFrame getFrame() {
return fFrame;
- }
-
+ }
+
/**
* Sets the stack frame context used to compile/run expressions
*
- * @param frame the stack frame context used to compile/run expressions
+ * @param frame
+ * the stack frame context used to compile/run expressions
*/
private void setFrame(IJavaStackFrame frame) {
fFrame = frame;
- }
+ }
/**
* @see IRuntimeContext#getThread()
*/
public IJavaThread getThread() {
- return (IJavaThread)getFrame().getThread();
+ return (IJavaThread) getFrame().getThread();
}
/**
@@ -106,4 +107,3 @@ public class RuntimeContext extends AbstractRuntimeContext {
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SignatureExt.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SignatureExt.java
index 2d43b53a8..3cdf2c866 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SignatureExt.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SignatureExt.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,16 +18,21 @@ import org.eclipse.jdt.internal.core.util.Util;
public class SignatureExt {
- public static char[][] getTypeSuperClassInterfaces(char[] typeSignature) throws IllegalArgumentException {
+ public static char[][] getTypeSuperClassInterfaces(char[] typeSignature)
+ throws IllegalArgumentException {
try {
int length = typeSignature.length;
- if (length == 0) return CharOperation.NO_CHAR_CHAR;
+ if (length == 0)
+ return CharOperation.NO_CHAR_CHAR;
int i = 0;
if (typeSignature[0] == Signature.C_GENERIC_START) {
i++; // leading '<'
- while (i < length && typeSignature[i] != Signature.C_GENERIC_END) {
- i = CharOperation.indexOf(Signature.C_COLON, typeSignature, i);
- if (i < 0 || i >= length) throw new IllegalArgumentException();
+ while (i < length
+ && typeSignature[i] != Signature.C_GENERIC_END) {
+ i = CharOperation.indexOf(Signature.C_COLON, typeSignature,
+ i);
+ if (i < 0 || i >= length)
+ throw new IllegalArgumentException();
// iterate over bounds
nextBound: while (typeSignature[i] == ':') {
i++; // skip colon
@@ -38,15 +43,17 @@ public class SignatureExt {
i++; // position at start of next param if any
}
}
- if (i < 0 || i >= length) throw new IllegalArgumentException();
+ if (i < 0 || i >= length)
+ throw new IllegalArgumentException();
i++; // trailing '>'
}
- ArrayList superList= new ArrayList();
+ ArrayList<char[]> superList = new ArrayList<char[]>();
while (i < length) {
- int superStart= i;
- i= Util.scanTypeSignature(typeSignature, i);
+ int superStart = i;
+ i = Util.scanTypeSignature(typeSignature, i);
i++;
- superList.add(CharOperation.subarray(typeSignature, superStart, i));
+ superList.add(CharOperation.subarray(typeSignature, superStart,
+ i));
}
char[][] result;
superList.toArray(result = new char[superList.size()][]);
@@ -57,8 +64,10 @@ public class SignatureExt {
throw new IllegalArgumentException();
}
- public static String[] getTypeSuperClassInterfaces(String typeSignature) throws IllegalArgumentException {
- char[][] params = getTypeSuperClassInterfaces(typeSignature.toCharArray());
+ public static String[] getTypeSuperClassInterfaces(String typeSignature)
+ throws IllegalArgumentException {
+ char[][] params = getTypeSuperClassInterfaces(typeSignature
+ .toCharArray());
return CharOperation.toStrings(params);
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java
index 9a86812c5..dbbd7d950 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
-
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -113,74 +112,83 @@ import org.eclipse.jdt.core.dom.WhileStatement;
import org.eclipse.jdt.core.dom.WildcardType;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
+public class SourceBasedSourceGenerator extends ASTVisitor {
-public class SourceBasedSourceGenerator extends ASTVisitor {
-
- private static final String RUN_METHOD_NAME= "___run"; //$NON-NLS-1$
- private static final String EVAL_METHOD_NAME= "___eval"; //$NON-NLS-1$
- private static final String EVAL_FIELD_NAME= "___field"; //$NON-NLS-1$
+ private static final String RUN_METHOD_NAME = "___run"; //$NON-NLS-1$
+ private static final String EVAL_METHOD_NAME = "___eval"; //$NON-NLS-1$
+ private static final String EVAL_FIELD_NAME = "___field"; //$NON-NLS-1$
private String[] fLocalVariableTypeNames;
private String[] fLocalVariableNames;
private String fCodeSnippet;
-
+
private boolean fRightTypeFound;
-
+
private boolean fCreateInAStaticMethod;
-
+
private boolean fEvaluateNextEndTypeDeclaration;
-
+
private String fError;
-
+
private IType fType;
-
+
private StringBuffer fSource;
-
+
private String fLastTypeName;
-
+
private String fCompilationUnitName;
-
+
private int fSnippetStartPosition;
private int fRunMethodStartOffset;
private int fRunMethodLength;
-
+
/**
- * Level of source code to generate (major, minor). For example 1 and 4
+ * Level of source code to generate (major, minor). For example 1 and 4
* indicates 1.4.
*/
private int fSourceMajorLevel;
private int fSourceMinorLevel;
-
- private Set fTypeParameters = new HashSet();
-
+
+ private Set<String> fTypeParameters = new HashSet<String>();
+
/**
- * if the <code>createInAnInstanceMethod</code> flag is set, the method created
- * which contains the code snippet is an no-static method, even if <code>position</code>
- * is in a static method.
+ * if the <code>createInAnInstanceMethod</code> flag is set, the method
+ * created which contains the code snippet is an no-static method, even if
+ * <code>position</code> is in a static method.
*
- * @param type the root {@link IType}
- * @param createInAStaticMethod if the source should be generated
- * @param localTypesNames the array of local type names
- * @param localVariables the listing of local variable names
- * @param codeSnippet the code snippet
- * @param sourceLevel the desired source level
- */
- public SourceBasedSourceGenerator(IType type, boolean createInAStaticMethod, String[] localTypesNames, String[] localVariables, String codeSnippet, String sourceLevel) {
- fRightTypeFound= false;
- fType= type;
- fLocalVariableTypeNames= localTypesNames;
- fLocalVariableNames= localVariables;
- fCodeSnippet= codeSnippet;
- fCreateInAStaticMethod= createInAStaticMethod;
+ * @param type
+ * the root {@link IType}
+ * @param createInAStaticMethod
+ * if the source should be generated
+ * @param localTypesNames
+ * the array of local type names
+ * @param localVariables
+ * the listing of local variable names
+ * @param codeSnippet
+ * the code snippet
+ * @param sourceLevel
+ * the desired source level
+ */
+ public SourceBasedSourceGenerator(IType type,
+ boolean createInAStaticMethod, String[] localTypesNames,
+ String[] localVariables, String codeSnippet, String sourceLevel) {
+ fRightTypeFound = false;
+ fType = type;
+ fLocalVariableTypeNames = localTypesNames;
+ fLocalVariableNames = localVariables;
+ fCodeSnippet = codeSnippet;
+ fCreateInAStaticMethod = createInAStaticMethod;
int index = sourceLevel.indexOf('.');
String num = sourceLevel.substring(0, index);
fSourceMajorLevel = Integer.valueOf(num).intValue();
num = sourceLevel.substring(index + 1);
fSourceMinorLevel = Integer.valueOf(num).intValue();
}
-
+
/**
- * Returns the generated source or <code>null</code> if no source can be generated.
+ * Returns the generated source or <code>null</code> if no source can be
+ * generated.
+ *
* @return returns the backing source from the generator
*/
public String getSource() {
@@ -189,55 +197,57 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
return fSource.toString();
}
-
+
public String getCompilationUnitName() {
return fCompilationUnitName;
}
-
+
public int getSnippetStart() {
return fSnippetStartPosition;
}
+
public int getRunMethodStart() {
return fSnippetStartPosition - fRunMethodStartOffset;
}
+
public int getRunMethodLength() {
return fRunMethodLength;
}
-
+
private boolean rightTypeFound() {
- return fRightTypeFound;
+ return fRightTypeFound;
}
-
+
private void setRightTypeFound(boolean value) {
- fRightTypeFound= value;
+ fRightTypeFound = value;
}
-
+
public boolean hasError() {
return fError != null;
}
-
+
public void setError(String errorDesc) {
- fError= errorDesc;
+ fError = errorDesc;
}
-
+
public String getError() {
return fError;
}
-
- private StringBuffer buildRunMethod(List bodyDeclarations) {
+
+ private StringBuffer buildRunMethod(List<BodyDeclaration> bodyDeclarations) {
StringBuffer buffer = new StringBuffer();
if (fCreateInAStaticMethod) {
buffer.append("static "); //$NON-NLS-1$
}
-
+
// add type parameters as required
if (isSourceLevelGreaterOrEqual(1, 5)) {
if (!fTypeParameters.isEmpty()) {
- Iterator iterator = fTypeParameters.iterator();
+ Iterator<String> iterator = fTypeParameters.iterator();
buffer.append(Signature.C_GENERIC_START);
while (iterator.hasNext()) {
- String name = (String) iterator.next();
+ String name = iterator.next();
buffer.append(name);
if (iterator.hasNext()) {
buffer.append(", "); //$NON-NLS-1$
@@ -245,12 +255,12 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
buffer.append(Signature.C_GENERIC_END);
}
- }
-
+ }
+
buffer.append("void "); //$NON-NLS-1$
buffer.append(getUniqueMethodName(RUN_METHOD_NAME, bodyDeclarations));
buffer.append('(');
- for(int i= 0, length= fLocalVariableNames.length; i < length; i++) {
+ for (int i = 0, length = fLocalVariableNames.length; i < length; i++) {
buffer.append(getDotName(fLocalVariableTypeNames[i]));
buffer.append(' ');
buffer.append(fLocalVariableNames[i]);
@@ -259,31 +269,34 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
buffer.append(") throws Throwable {"); //$NON-NLS-1$
buffer.append('\n');
- fSnippetStartPosition= buffer.length() - 2;
- fRunMethodStartOffset= fSnippetStartPosition;
- String codeSnippet= new String(fCodeSnippet).trim();
-
+ fSnippetStartPosition = buffer.length() - 2;
+ fRunMethodStartOffset = fSnippetStartPosition;
+ String codeSnippet = new String(fCodeSnippet).trim();
+
buffer.append(codeSnippet);
buffer.append('\n');
buffer.append('}').append('\n');
- fRunMethodLength= buffer.length();
+ fRunMethodLength = buffer.length();
return buffer;
}
-
+
private String getDotName(String typeName) {
return typeName.replace('$', '.');
}
/**
- * Returns if the specified {@link ASTNode} has the 'correct' parent type to match the current
- * type name context
- * @param node the {@link ASTNode} to check source ranges for
- * @return true if the parent type of the given node matches the current type name context,
- * false otherwise
+ * Returns if the specified {@link ASTNode} has the 'correct' parent type to
+ * match the current type name context
+ *
+ * @param node
+ * the {@link ASTNode} to check source ranges for
+ * @return true if the parent type of the given node matches the current
+ * type name context, false otherwise
*/
private boolean isRightType(ASTNode node) {
- SourceRange range = new SourceRange(node.getStartPosition(), node.getLength());
+ SourceRange range = new SourceRange(node.getStartPosition(),
+ node.getLength());
try {
return fType.getSourceRange().equals(range);
} catch (JavaModelException e) {
@@ -291,31 +304,34 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
return false;
}
-
- private StringBuffer buildTypeBody(StringBuffer buffer, List list) {
+
+ private StringBuffer buildTypeBody(StringBuffer buffer, List<BodyDeclaration> list) {
StringBuffer source = new StringBuffer();
-
+
source.append('{').append('\n');
-
+
if (buffer != null) {
- fSnippetStartPosition+= source.length();
+ fSnippetStartPosition += source.length();
}
-
+
source.append(buildBody(buffer, list));
source.append('}').append('\n');
-
+
return source;
}
-
- private StringBuffer buildEnumBody(StringBuffer buffer, List constantDeclarations, List bodyDeclarations) {
+
+ private StringBuffer buildEnumBody(StringBuffer buffer,
+ List<EnumConstantDeclaration> constantDeclarations, List<BodyDeclaration> bodyDeclarations) {
StringBuffer source = new StringBuffer();
-
+
source.append('{').append('\n');
if (constantDeclarations.isEmpty()) {
source.append(';').append('\n');
} else {
- for (Iterator iter= constantDeclarations.iterator(); iter.hasNext();) {
- source.append(((EnumConstantDeclaration) iter.next()).getName().getIdentifier());
+ for (Iterator<EnumConstantDeclaration> iter = constantDeclarations.iterator(); iter
+ .hasNext();) {
+ source.append(iter.next().getName()
+ .getIdentifier());
if (iter.hasNext()) {
source.append(',');
} else {
@@ -324,120 +340,135 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
source.append('\n');
}
}
-
+
if (buffer != null) {
- fSnippetStartPosition+= source.length();
+ fSnippetStartPosition += source.length();
}
-
+
source.append(buildBody(buffer, bodyDeclarations));
source.append('}').append('\n');
-
+
return source;
-
+
}
/**
- * Builds up the given buffer with the source from each of {@link BodyDeclaration}s in the
- * given list
- * @param buffer the buffer to clone and append to
- * @param list the list of {@link BodyDeclaration}s
- * @return the new source buffer
+ * Builds up the given buffer with the source from each of
+ * {@link BodyDeclaration}s in the given list
+ *
+ * @param buffer
+ * the buffer to clone and append to
+ * @param list
+ * the list of {@link BodyDeclaration}s
+ * @return the new source buffer
*/
- private StringBuffer buildBody(StringBuffer buffer, List list) {
- StringBuffer source= new StringBuffer();
+ private StringBuffer buildBody(StringBuffer buffer, List<BodyDeclaration> list) {
+ StringBuffer source = new StringBuffer();
if (buffer != null) {
fSnippetStartPosition += source.length();
source.append(buffer.toString());
}
- for (Iterator iterator= list.iterator(); iterator.hasNext();) {
- BodyDeclaration bodyDeclaration= (BodyDeclaration) iterator.next();
+ for (Iterator<BodyDeclaration> iterator = list.iterator(); iterator.hasNext();) {
+ BodyDeclaration bodyDeclaration = iterator.next();
if (bodyDeclaration instanceof FieldDeclaration) {
source.append(buildFieldDeclaration((FieldDeclaration) bodyDeclaration));
} else if (bodyDeclaration instanceof MethodDeclaration) {
source.append(buildMethodDeclaration((MethodDeclaration) bodyDeclaration));
} else if (bodyDeclaration instanceof TypeDeclaration) {
TypeDeclaration typeDeclaration = (TypeDeclaration) bodyDeclaration;
- if (!typeDeclaration.getName().getIdentifier().equals(fLastTypeName)) {
+ if (!typeDeclaration.getName().getIdentifier()
+ .equals(fLastTypeName)) {
source.append(buildTypeDeclaration(null, typeDeclaration));
}
} else if (bodyDeclaration instanceof EnumDeclaration) {
- EnumDeclaration enumDeclaration= (EnumDeclaration) bodyDeclaration;
- if (!enumDeclaration.getName().getIdentifier().equals(fLastTypeName)) {
+ EnumDeclaration enumDeclaration = (EnumDeclaration) bodyDeclaration;
+ if (!enumDeclaration.getName().getIdentifier()
+ .equals(fLastTypeName)) {
source.append(buildEnumDeclaration(null, enumDeclaration));
}
}
}
return source;
}
-
+
private StringBuffer buildFieldDeclaration(FieldDeclaration fieldDeclaration) {
StringBuffer source = new StringBuffer();
-
+
source.append(Flags.toString(fieldDeclaration.getModifiers()));
source.append(' ');
source.append(getDotName(getTypeName(fieldDeclaration.getType())));
source.append(' ');
-
- boolean first= true;
- for (Iterator iterator= fieldDeclaration.fragments().iterator(); iterator.hasNext();) {
- VariableDeclarationFragment variableDeclarationFragment= (VariableDeclarationFragment) iterator.next();
+
+ boolean first = true;
+ for (Iterator<VariableDeclarationFragment> iterator = fieldDeclaration.fragments().iterator(); iterator
+ .hasNext();) {
+ VariableDeclarationFragment variableDeclarationFragment = iterator
+ .next();
if (first) {
first = false;
} else {
source.append(',');
}
source.append(variableDeclarationFragment.getName().getIdentifier());
- for (int i= 0, dim= variableDeclarationFragment.getExtraDimensions(); i < dim; i++) {
+ for (int i = 0, dim = variableDeclarationFragment
+ .getExtraDimensions(); i < dim; i++) {
source.append('[').append(']');
}
}
-
+
source.append(';').append('\n');
-
+
return source;
}
-
- private StringBuffer buildMethodDeclaration(MethodDeclaration methodDeclaration) {
+
+ private StringBuffer buildMethodDeclaration(
+ MethodDeclaration methodDeclaration) {
StringBuffer source = new StringBuffer();
- int modifiers= methodDeclaration.getModifiers();
+ int modifiers = methodDeclaration.getModifiers();
source.append(Flags.toString(modifiers));
source.append(' ');
-
+
appendTypeParameters(source, methodDeclaration.typeParameters());
-
- boolean isConstructor= methodDeclaration.isConstructor();
+
+ boolean isConstructor = methodDeclaration.isConstructor();
if (!isConstructor) {
- source.append(getDotName(getTypeName(methodDeclaration.getReturnType2())));
+ source.append(getDotName(getTypeName(methodDeclaration
+ .getReturnType2())));
source.append(' ');
}
-
+
source.append(methodDeclaration.getName().getIdentifier());
source.append(' ').append('(');
-
- boolean first= true;
- for (Iterator iterator = methodDeclaration.parameters().iterator(); iterator.hasNext();) {
- SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) iterator.next();
+
+ boolean first = true;
+ for (Iterator<SingleVariableDeclaration> iterator = methodDeclaration.parameters().iterator(); iterator
+ .hasNext();) {
+ SingleVariableDeclaration singleVariableDeclaration = iterator
+ .next();
if (first) {
first = false;
} else {
source.append(',');
}
- source.append(getDotName(getTypeName(singleVariableDeclaration.getType())));
+ source.append(getDotName(getTypeName(singleVariableDeclaration
+ .getType())));
if (singleVariableDeclaration.isVarargs()) {
source.append("..."); //$NON-NLS-1$
}
source.append(' ');
source.append(singleVariableDeclaration.getName().getIdentifier());
- appendExtraDimensions(source, singleVariableDeclaration.getExtraDimensions());
+ appendExtraDimensions(source,
+ singleVariableDeclaration.getExtraDimensions());
}
-
+
source.append(')');
-
+
appendExtraDimensions(source, methodDeclaration.getExtraDimensions());
-
+
first = true;
- for (Iterator iterator = methodDeclaration.thrownExceptions().iterator(); iterator.hasNext();) {
- Name name = (Name) iterator.next();
+ for (Iterator<Name> iterator = methodDeclaration.thrownExceptions()
+ .iterator(); iterator.hasNext();) {
+ Name name = iterator.next();
if (first) {
first = false;
source.append(" throws "); //$NON-NLS-1$
@@ -446,58 +477,61 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
source.append(getQualifiedIdentifier(name));
}
-
+
if (Flags.isAbstract(modifiers) || Flags.isNative(modifiers)) {
// No body for abstract and native methods
source.append(";\n"); //$NON-NLS-1$
} else {
source.append('{').append('\n');
if (!isConstructor) {
- source.append(getReturnExpression(methodDeclaration.getReturnType2()));
+ source.append(getReturnExpression(methodDeclaration
+ .getReturnType2()));
}
source.append('}').append('\n');
}
-
+
return source;
}
private void appendExtraDimensions(StringBuffer source, int extraDimension) {
if (extraDimension > 0) {
source.append(' ');
- for (int i= 0; i < extraDimension; i ++) {
+ for (int i = 0; i < extraDimension; i++) {
source.append("[]"); //$NON-NLS-1$
}
}
}
- private StringBuffer buildEnumDeclaration(StringBuffer buffer, EnumDeclaration enumDeclaration) {
+ private StringBuffer buildEnumDeclaration(StringBuffer buffer,
+ EnumDeclaration enumDeclaration) {
StringBuffer source = new StringBuffer();
source.append(Flags.toString(enumDeclaration.getModifiers()));
source.append(" enum "); //$NON-NLS-1$
-
+
source.append(enumDeclaration.getName().getIdentifier());
-
- Iterator iterator= enumDeclaration.superInterfaceTypes().iterator();
+
+ Iterator<Type> iterator = enumDeclaration.superInterfaceTypes().iterator();
if (iterator.hasNext()) {
source.append(" implements "); //$NON-NLS-1$
- source.append(getTypeName((Type) iterator.next()));
+ source.append(getTypeName(iterator.next()));
while (iterator.hasNext()) {
source.append(',');
- source.append(getTypeName((Type) iterator.next()));
+ source.append(getTypeName(iterator.next()));
}
}
if (buffer != null) {
- fSnippetStartPosition+= source.length();
+ fSnippetStartPosition += source.length();
}
- source.append(buildEnumBody(buffer, enumDeclaration.enumConstants(), enumDeclaration.bodyDeclarations()));
-
+ source.append(buildEnumBody(buffer, enumDeclaration.enumConstants(),
+ enumDeclaration.bodyDeclarations()));
+
return source;
}
-
- private StringBuffer buildTypeDeclaration(StringBuffer buffer, TypeDeclaration typeDeclaration) {
-
+ private StringBuffer buildTypeDeclaration(StringBuffer buffer,
+ TypeDeclaration typeDeclaration) {
+
StringBuffer source = new StringBuffer();
source.append(Flags.toString(typeDeclaration.getModifiers()));
if (typeDeclaration.isInterface()) {
@@ -505,37 +539,37 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
} else {
source.append(" class "); //$NON-NLS-1$
}
-
+
source.append(typeDeclaration.getName().getIdentifier());
- List typeParameters= typeDeclaration.typeParameters();
+ List<TypeParameter> typeParameters = typeDeclaration.typeParameters();
if (!typeParameters.isEmpty() && isSourceLevelGreaterOrEqual(1, 5)) {
source.append('<');
- Iterator iter= typeParameters.iterator();
- TypeParameter typeParameter= (TypeParameter) iter.next();
+ Iterator<TypeParameter> iter = typeParameters.iterator();
+ TypeParameter typeParameter = iter.next();
source.append(typeParameter.getName().getIdentifier());
- List typeBounds= typeParameter.typeBounds();
+ List<Type> typeBounds = typeParameter.typeBounds();
if (!typeBounds.isEmpty()) {
source.append(" extends "); //$NON-NLS-1$
- Iterator iter2= typeBounds.iterator();
- source.append(getTypeName((Type) iter2.next()));
+ Iterator<Type> iter2 = typeBounds.iterator();
+ source.append(getTypeName(iter2.next()));
while (iter2.hasNext()) {
source.append('&');
- source.append(getTypeName((Type) iter2.next()));
+ source.append(getTypeName(iter2.next()));
}
}
while (iter.hasNext()) {
source.append(',');
- typeParameter= (TypeParameter) iter.next();
+ typeParameter = iter.next();
source.append(typeParameter.getName().getIdentifier());
- typeBounds= typeParameter.typeBounds();
+ typeBounds = typeParameter.typeBounds();
if (!typeBounds.isEmpty()) {
source.append(" extends "); //$NON-NLS-1$
- Iterator iter2= typeBounds.iterator();
- source.append(getTypeName((Type) iter2.next()));
+ Iterator<Type> iter2 = typeBounds.iterator();
+ source.append(getTypeName(iter2.next()));
while (iter2.hasNext()) {
source.append('&');
- source.append(getTypeName((Type) iter2.next()));
+ source.append(getTypeName(iter2.next()));
}
}
}
@@ -548,150 +582,165 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
source.append(getTypeName(superClass));
}
- Iterator iter= typeDeclaration.superInterfaceTypes().iterator();
+ Iterator<Type> iter = typeDeclaration.superInterfaceTypes().iterator();
if (iter.hasNext()) {
if (typeDeclaration.isInterface()) {
source.append(" extends "); //$NON-NLS-1$
} else {
source.append(" implements "); //$NON-NLS-1$
}
- source.append(getTypeName((Type) iter.next()));
+ source.append(getTypeName(iter.next()));
while (iter.hasNext()) {
source.append(',');
- source.append(getTypeName((Type) iter.next()));
+ source.append(getTypeName(iter.next()));
}
}
-
+
if (buffer != null) {
- fSnippetStartPosition+= source.length();
+ fSnippetStartPosition += source.length();
}
source.append(buildTypeBody(buffer, typeDeclaration.bodyDeclarations()));
-
+
return source;
}
- private StringBuffer buildCompilationUnit(StringBuffer buffer, CompilationUnit compilationUnit) {
+ private StringBuffer buildCompilationUnit(StringBuffer buffer,
+ CompilationUnit compilationUnit) {
StringBuffer source = new StringBuffer();
-
+
PackageDeclaration packageDeclaration = compilationUnit.getPackage();
if (packageDeclaration != null) {
source.append("package "); //$NON-NLS-1$
source.append(getQualifiedIdentifier(packageDeclaration.getName()));
source.append(";\n"); //$NON-NLS-1$
}
-
- for (Iterator iterator = compilationUnit.imports().iterator(); iterator.hasNext();) {
- ImportDeclaration importDeclaration = (ImportDeclaration) iterator.next();
+
+ for (Iterator<ImportDeclaration> iterator = compilationUnit.imports().iterator(); iterator
+ .hasNext();) {
+ ImportDeclaration importDeclaration = iterator
+ .next();
source.append("import "); //$NON-NLS-1$
- if (importDeclaration.isStatic()) {
- source.append("static "); //$NON-NLS-1$
- }
+ if (importDeclaration.isStatic()) {
+ source.append("static "); //$NON-NLS-1$
+ }
source.append(getQualifiedIdentifier(importDeclaration.getName()));
if (importDeclaration.isOnDemand()) {
source.append(".*"); //$NON-NLS-1$
}
source.append(";\n"); //$NON-NLS-1$
}
-
+
fSnippetStartPosition += source.length();
source.append(buffer);
-
- for (Iterator iterator = compilationUnit.types().iterator(); iterator.hasNext();) {
- AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) iterator.next();
+
+ for (Iterator<TypeDeclaration> iterator = compilationUnit.types().iterator(); iterator
+ .hasNext();) {
+ AbstractTypeDeclaration typeDeclaration = iterator.next();
if (Flags.isPublic(typeDeclaration.getModifiers())) {
- fCompilationUnitName = typeDeclaration.getName().getIdentifier();
+ fCompilationUnitName = typeDeclaration.getName()
+ .getIdentifier();
}
- if (!fLastTypeName.equals(typeDeclaration.getName().getIdentifier())) {
+ if (!fLastTypeName
+ .equals(typeDeclaration.getName().getIdentifier())) {
if (typeDeclaration instanceof TypeDeclaration) {
- source.append(buildTypeDeclaration(null, (TypeDeclaration)typeDeclaration));
+ source.append(buildTypeDeclaration(null,
+ (TypeDeclaration) typeDeclaration));
} else if (typeDeclaration instanceof EnumDeclaration) {
- source.append(buildEnumDeclaration(null, (EnumDeclaration)typeDeclaration));
+ source.append(buildEnumDeclaration(null,
+ (EnumDeclaration) typeDeclaration));
}
}
}
- if (fCompilationUnitName == null) {
+ if (fCompilationUnitName == null) {
// If no public class was found, the compilation unit
// name doesn't matter.
- fCompilationUnitName= "Eval"; //$NON-NLS-1$
+ fCompilationUnitName = "Eval"; //$NON-NLS-1$
}
return source;
}
-
+
/**
- * Returns a method name that will be unique in the generated source.
- * The generated name is baseName plus as many '_' characters as necessary
- * to not duplicate an existing method name.
+ * Returns a method name that will be unique in the generated source. The
+ * generated name is baseName plus as many '_' characters as necessary to
+ * not duplicate an existing method name.
*
- * @param methodName the method name to look for
- * @param bodyDeclarations the listing of {@link BodyDeclaration}s to search through
+ * @param methodName
+ * the method name to look for
+ * @param bodyDeclarations
+ * the listing of {@link BodyDeclaration}s to search through
* @return the unique method name
*/
- private String getUniqueMethodName(String methodName, List bodyDeclarations) {
- Iterator iter= bodyDeclarations.iterator();
+ private String getUniqueMethodName(String methodName, List<BodyDeclaration> bodyDeclarations) {
+ Iterator<BodyDeclaration> iter = bodyDeclarations.iterator();
BodyDeclaration bodyDeclaration;
MethodDeclaration method;
String foundName;
while (iter.hasNext()) {
- bodyDeclaration= (BodyDeclaration) iter.next();
+ bodyDeclaration = iter.next();
if (bodyDeclaration instanceof MethodDeclaration) {
- method= (MethodDeclaration)bodyDeclaration;
- foundName= method.getName().getIdentifier();
+ method = (MethodDeclaration) bodyDeclaration;
+ foundName = method.getName().getIdentifier();
if (foundName.startsWith(methodName)) {
- methodName= foundName + '_';
+ methodName = foundName + '_';
}
}
}
return methodName;
}
-
+
/**
- * Returns a field name that will be unique in the generated source.
- * The generated name is baseName plus as many '_' characters as necessary
- * to not duplicate an existing method name.
+ * Returns a field name that will be unique in the generated source. The
+ * generated name is baseName plus as many '_' characters as necessary to
+ * not duplicate an existing method name.
*
- * @param fieldName the name of the field to look for
- * @param bodyDeclarations the list of {@link BodyDeclaration}s to search through
+ * @param fieldName
+ * the name of the field to look for
+ * @param bodyDeclarations
+ * the list of {@link BodyDeclaration}s to search through
* @return the unique field name
*/
- private String getUniqueFieldName(String fieldName, List bodyDeclarations) {
- Iterator iter= bodyDeclarations.iterator();
+ private String getUniqueFieldName(String fieldName, List<BodyDeclaration> bodyDeclarations) {
+ Iterator<BodyDeclaration> iter = bodyDeclarations.iterator();
BodyDeclaration bodyDeclaration;
FieldDeclaration fieldDeclaration;
String foundName;
while (iter.hasNext()) {
- bodyDeclaration= (BodyDeclaration) iter.next();
+ bodyDeclaration = iter.next();
if (bodyDeclaration instanceof FieldDeclaration) {
- fieldDeclaration= (FieldDeclaration)bodyDeclaration;
- for (Iterator iterator= fieldDeclaration.fragments().iterator(); iterator.hasNext();) {
- foundName= ((VariableDeclarationFragment) iterator.next()).getName().getIdentifier();
+ fieldDeclaration = (FieldDeclaration) bodyDeclaration;
+ for (Iterator<VariableDeclarationFragment> iterator = fieldDeclaration.fragments()
+ .iterator(); iterator.hasNext();) {
+ foundName = iterator.next()
+ .getName().getIdentifier();
if (foundName.startsWith(fieldName)) {
- fieldName= foundName + '_';
+ fieldName = foundName + '_';
}
}
}
}
return fieldName;
}
-
+
private String getQualifiedIdentifier(Name name) {
- String typeName= ""; //$NON-NLS-1$
+ String typeName = ""; //$NON-NLS-1$
while (name.isQualifiedName()) {
QualifiedName qualifiedName = (QualifiedName) name;
- typeName= "." + qualifiedName.getName().getIdentifier() + typeName; //$NON-NLS-1$
- name= qualifiedName.getQualifier();
+ typeName = "." + qualifiedName.getName().getIdentifier() + typeName; //$NON-NLS-1$
+ name = qualifiedName.getQualifier();
}
if (name.isSimpleName()) {
- typeName= ((SimpleName)name).getIdentifier() + typeName;
+ typeName = ((SimpleName) name).getIdentifier() + typeName;
} else {
return null;
}
return typeName;
}
-
+
public String getTypeName(Type type) {
if (type.isSimpleType()) {
String name = getQualifiedIdentifier(((SimpleType) type).getName());
- if (!isSourceLevelGreaterOrEqual(1, 5) && fTypeParameters.contains(name)) {
+ if (!isSourceLevelGreaterOrEqual(1, 5)
+ && fTypeParameters.contains(name)) {
return "Object"; //$NON-NLS-1$
}
return name;
@@ -700,26 +749,28 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
} else if (type.isPrimitiveType()) {
return ((PrimitiveType) type).getPrimitiveTypeCode().toString();
} else if (type.isQualifiedType()) {
- QualifiedType qualifiedType= (QualifiedType) type;
- return getTypeName(qualifiedType.getQualifier()) + '.' + qualifiedType.getName().getIdentifier();
+ QualifiedType qualifiedType = (QualifiedType) type;
+ return getTypeName(qualifiedType.getQualifier()) + '.'
+ + qualifiedType.getName().getIdentifier();
} else if (type.isParameterizedType()) {
- ParameterizedType parameterizedType= (ParameterizedType)type;
- StringBuffer buff= new StringBuffer(getTypeName(parameterizedType.getType()));
- Iterator iter= parameterizedType.typeArguments().iterator();
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ StringBuffer buff = new StringBuffer(
+ getTypeName(parameterizedType.getType()));
+ Iterator<Type> iter = parameterizedType.typeArguments().iterator();
if (iter.hasNext() && isSourceLevelGreaterOrEqual(1, 5)) {
buff.append('<');
- buff.append(getTypeName((Type)iter.next()));
+ buff.append(getTypeName(iter.next()));
while (iter.hasNext()) {
buff.append(',');
- buff.append(getTypeName((Type)iter.next()));
+ buff.append(getTypeName(iter.next()));
}
buff.append('>');
}
return buff.toString();
} else if (type.isWildcardType()) {
- WildcardType wildcardType= (WildcardType)type;
- StringBuffer buff= new StringBuffer("?"); //$NON-NLS-1$
- Type bound= wildcardType.getBound();
+ WildcardType wildcardType = (WildcardType) type;
+ StringBuffer buff = new StringBuffer("?"); //$NON-NLS-1$
+ Type bound = wildcardType.getBound();
if (bound != null) {
buff.append(wildcardType.isUpperBound() ? " extends " : " super "); //$NON-NLS-1$ //$NON-NLS-2$
buff.append(getTypeName(bound));
@@ -727,14 +778,16 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return buff.toString();
}
return null;
-
+
}
-
+
public String getReturnExpression(Type type) {
- if (type.isSimpleType() || type.isArrayType() || type.isQualifiedType() || type.isWildcardType() || type.isParameterizedType()) {
+ if (type.isSimpleType() || type.isArrayType() || type.isQualifiedType()
+ || type.isWildcardType() || type.isParameterizedType()) {
return "return null;"; //$NON-NLS-1$
} else if (type.isPrimitiveType()) {
- String typeName= ((PrimitiveType) type).getPrimitiveTypeCode().toString();
+ String typeName = ((PrimitiveType) type).getPrimitiveTypeCode()
+ .toString();
char char0 = typeName.charAt(0);
if (char0 == 'v') {
return ""; //$NON-NLS-1$
@@ -747,179 +800,206 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
return null;
}
-
- //----------------------
+ // ----------------------
/**
* @see ASTVisitor#endVisit(ClassInstanceCreation)
*/
+ @Override
public void endVisit(ClassInstanceCreation node) {
if (hasError()) {
return;
}
- AnonymousClassDeclaration anonymousClassDeclaration = node.getAnonymousClassDeclaration();
+ AnonymousClassDeclaration anonymousClassDeclaration = node
+ .getAnonymousClassDeclaration();
if (anonymousClassDeclaration != null) {
if (!rightTypeFound() && isRightType(node)) {
setRightTypeFound(true);
-
- fSource= buildRunMethod(anonymousClassDeclaration.bodyDeclarations());
+
+ fSource = buildRunMethod(anonymousClassDeclaration
+ .bodyDeclarations());
fEvaluateNextEndTypeDeclaration = true;
}
-
+
if (rightTypeFound()) {
-
- List bodyDeclarations= anonymousClassDeclaration.bodyDeclarations();
-
+
+ List<BodyDeclaration> bodyDeclarations = anonymousClassDeclaration
+ .bodyDeclarations();
+
StringBuffer source = buildTypeBody(fSource, bodyDeclarations);
-
+
ASTNode parent = node.getParent();
- while (!(parent instanceof MethodDeclaration ||
- parent instanceof FieldDeclaration ||
- parent instanceof Initializer) && parent != null) {
- parent= parent.getParent();
- }
-
- fSource= new StringBuffer();
-
- if(parent instanceof Initializer) {
- createAnonymousEvalMethod(true, bodyDeclarations, getTypeName(node.getType()), source);
+ while (!(parent instanceof MethodDeclaration
+ || parent instanceof FieldDeclaration || parent instanceof Initializer)
+ && parent != null) {
+ parent = parent.getParent();
}
- else if (parent instanceof MethodDeclaration) {
+
+ fSource = new StringBuffer();
+
+ if (parent instanceof Initializer) {
+ createAnonymousEvalMethod(true, bodyDeclarations,
+ getTypeName(node.getType()), source);
+ } else if (parent instanceof MethodDeclaration) {
MethodDeclaration enclosingMethodDeclaration = (MethodDeclaration) parent;
- createAnonymousEvalMethod(Flags.isStatic(enclosingMethodDeclaration.getModifiers()),
- bodyDeclarations,
- getTypeName(node.getType()),
- source);
-
+ createAnonymousEvalMethod(
+ Flags.isStatic(enclosingMethodDeclaration
+ .getModifiers()), bodyDeclarations,
+ getTypeName(node.getType()), source);
+
} else if (parent instanceof FieldDeclaration) {
FieldDeclaration enclosingFieldDeclaration = (FieldDeclaration) parent;
-
- if (Flags.isStatic(enclosingFieldDeclaration.getModifiers())) {
+
+ if (Flags
+ .isStatic(enclosingFieldDeclaration.getModifiers())) {
fSource.append("static "); //$NON-NLS-1$
}
-
- Type type = getParentType(enclosingFieldDeclaration.getType());
- fSource.append(getQualifiedIdentifier(((SimpleType)type).getName()));
+
+ Type type = getParentType(enclosingFieldDeclaration
+ .getType());
+ fSource.append(getQualifiedIdentifier(((SimpleType) type)
+ .getName()));
fSource.append(' ');
- fSource.append(getUniqueFieldName(EVAL_FIELD_NAME, bodyDeclarations));
+ fSource.append(getUniqueFieldName(EVAL_FIELD_NAME,
+ bodyDeclarations));
fSource.append(" = new "); //$NON-NLS-1$
fSource.append(getTypeName(node.getType()));
fSource.append("()"); //$NON-NLS-1$
-
- fSnippetStartPosition+= fSource.length();
+
+ fSnippetStartPosition += fSource.length();
fSource.append(source);
fSource.append(";\n"); //$NON-NLS-1$
-
+
}
- fLastTypeName= ""; //$NON-NLS-1$
+ fLastTypeName = ""; //$NON-NLS-1$
}
- }
+ }
}
/**
- * Create a <code>void ____eval()</code> method considering the given {@link BodyDeclaration}s, type name and existing
- * body source when an anonymous {@link ClassInstanceCreation} is visited.
- * <br><br>
- * This method adds the new <code>___eval</code> method source to the root {@link #fSource} variable directly
+ * Create a <code>void ____eval()</code> method considering the given
+ * {@link BodyDeclaration}s, type name and existing body source when an
+ * anonymous {@link ClassInstanceCreation} is visited. <br>
+ * <br>
+ * This method adds the new <code>___eval</code> method source to the root
+ * {@link #fSource} variable directly
*
- * @param isstatic if the keyword <code>static</code> should be added to the method source
- * @param bodydecls the existing listing of {@link BodyDeclaration}s to consider when creating the <code>___eval</code> method name
- * @param typename the raw type name of the type to instantiate in the <code>___eval</code> method
- * @param body the existing body of source to append to the remainder of the new method
+ * @param isstatic
+ * if the keyword <code>static</code> should be added to the
+ * method source
+ * @param bodydecls
+ * the existing listing of {@link BodyDeclaration}s to consider
+ * when creating the <code>___eval</code> method name
+ * @param typename
+ * the raw type name of the type to instantiate in the
+ * <code>___eval</code> method
+ * @param body
+ * the existing body of source to append to the remainder of the
+ * new method
* @since 3.7
*/
- void createAnonymousEvalMethod(boolean isstatic, List bodydecls, String typename, StringBuffer body) {
- if(isstatic) {
+ void createAnonymousEvalMethod(boolean isstatic, List<BodyDeclaration> bodydecls,
+ String typename, StringBuffer body) {
+ if (isstatic) {
fSource.append("static "); //$NON-NLS-1$
}
fSource.append("void "); //$NON-NLS-1$
fSource.append(getUniqueMethodName(EVAL_METHOD_NAME, bodydecls));
fSource.append("() {\n"); //$NON-NLS-1$
fSource.append("new "); //$NON-NLS-1$
- fSource.append(typename);
+ fSource.append(typename);
fSource.append("()"); //$NON-NLS-1$
-
- fSnippetStartPosition+= fSource.length();
+
+ fSnippetStartPosition += fSource.length();
fSource.append(body);
fSource.append(";}\n"); //$NON-NLS-1$
}
-
+
/**
- * Recursively finds the parent {@link Type} from the given type, in the cases where
- * the type is an {@link ArrayType} or a {@link ParameterizedType}
- * @param type the {@link Type}
+ * Recursively finds the parent {@link Type} from the given type, in the
+ * cases where the type is an {@link ArrayType} or a
+ * {@link ParameterizedType}
+ *
+ * @param type
+ * the {@link Type}
* @return the parent {@link Type}
*/
private Type getParentType(Type type) {
- if(type instanceof ArrayType) {
- return getParentType(((ArrayType)type).getComponentType());
+ if (type instanceof ArrayType) {
+ return getParentType(((ArrayType) type).getComponentType());
}
- if(type instanceof ParameterizedType) {
- return getParentType(((ParameterizedType)type).getType());
+ if (type instanceof ParameterizedType) {
+ return getParentType(((ParameterizedType) type).getType());
}
return type;
}
-
+
/**
* @see ASTVisitor#endVisit(CompilationUnit)
*/
+ @Override
public void endVisit(CompilationUnit node) {
if (hasError()) {
return;
}
if (!rightTypeFound()) { // if the right type hasn't been found
- fSource= null;
+ fSource = null;
return;
}
fSource = buildCompilationUnit(fSource, node);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnumDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom
+ * .EnumDeclaration)
*/
+ @Override
public void endVisit(EnumDeclaration node) {
-
+
if (hasError()) {
return;
}
-
+
if (!rightTypeFound() && isRightType(node)) {
setRightTypeFound(true);
-
- fSource= buildRunMethod(node.bodyDeclarations());
+
+ fSource = buildRunMethod(node.bodyDeclarations());
fEvaluateNextEndTypeDeclaration = true;
}
-
+
if (!fEvaluateNextEndTypeDeclaration) {
fEvaluateNextEndTypeDeclaration = true;
return;
}
-
+
if (rightTypeFound()) {
-
+
StringBuffer source = buildEnumDeclaration(fSource, node);
-
+
if (node.isLocalTypeDeclaration()) {
// enclose in a method if necessary
-
+
ASTNode parent = node.getParent();
while (!(parent instanceof MethodDeclaration)) {
- parent= parent.getParent();
+ parent = parent.getParent();
}
MethodDeclaration enclosingMethodDeclaration = (MethodDeclaration) parent;
-
+
fSource = new StringBuffer();
-
+
if (Flags.isStatic(enclosingMethodDeclaration.getModifiers())) {
fSource.append("static "); //$NON-NLS-1$
}
-
+
fSource.append("void ___eval() {\n"); //$NON-NLS-1$
- fSnippetStartPosition+= fSource.length();
+ fSnippetStartPosition += fSource.length();
fSource.append(source);
fSource.append("}\n"); //$NON-NLS-1$
-
+
fLastTypeName = ""; //$NON-NLS-1$
} else {
fSource = source;
@@ -931,48 +1011,49 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#endVisit(TypeDeclaration)
*/
+ @Override
public void endVisit(TypeDeclaration node) {
-
+
if (hasError()) {
return;
}
-
+
if (!rightTypeFound() && isRightType(node)) {
setRightTypeFound(true);
-
- fSource= buildRunMethod(node.bodyDeclarations());
+
+ fSource = buildRunMethod(node.bodyDeclarations());
fEvaluateNextEndTypeDeclaration = true;
}
-
+
if (!fEvaluateNextEndTypeDeclaration) {
fEvaluateNextEndTypeDeclaration = true;
return;
}
-
+
if (rightTypeFound()) {
-
+
StringBuffer source = buildTypeDeclaration(fSource, node);
-
+
if (node.isLocalTypeDeclaration()) {
// enclose in a method if nessecary
-
+
ASTNode parent = node.getParent();
while (!(parent instanceof MethodDeclaration)) {
- parent= parent.getParent();
+ parent = parent.getParent();
}
MethodDeclaration enclosingMethodDeclaration = (MethodDeclaration) parent;
-
+
fSource = new StringBuffer();
-
+
if (Flags.isStatic(enclosingMethodDeclaration.getModifiers())) {
fSource.append("static "); //$NON-NLS-1$
}
-
+
fSource.append("void ___eval() {\n"); //$NON-NLS-1$
- fSnippetStartPosition+= fSource.length();
+ fSnippetStartPosition += fSource.length();
fSource.append(source);
fSource.append("}\n"); //$NON-NLS-1$
-
+
fLastTypeName = ""; //$NON-NLS-1$
} else {
fSource = source;
@@ -981,23 +1062,32 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * AnnotationTypeDeclaration)
*/
+ @Override
public boolean visit(AnnotationTypeDeclaration node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * AnnotationTypeMemberDeclaration)
*/
+ @Override
public boolean visit(AnnotationTypeMemberDeclaration node) {
return false;
}
-
+
/**
* @see ASTVisitor#visit(AnonymousClassDeclaration)
*/
+ @Override
public boolean visit(AnonymousClassDeclaration node) {
if (rightTypeFound()) {
return false;
@@ -1008,6 +1098,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ArrayAccess)
*/
+ @Override
public boolean visit(ArrayAccess node) {
if (rightTypeFound()) {
return false;
@@ -1018,6 +1109,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ArrayCreation)
*/
+ @Override
public boolean visit(ArrayCreation node) {
if (rightTypeFound()) {
return false;
@@ -1028,6 +1120,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ArrayInitializer)
*/
+ @Override
public boolean visit(ArrayInitializer node) {
if (rightTypeFound()) {
return false;
@@ -1038,6 +1131,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ArrayType)
*/
+ @Override
public boolean visit(ArrayType node) {
if (rightTypeFound()) {
return false;
@@ -1048,6 +1142,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(AssertStatement)
*/
+ @Override
public boolean visit(AssertStatement node) {
if (rightTypeFound()) {
return false;
@@ -1058,6 +1153,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(Assignment)
*/
+ @Override
public boolean visit(Assignment node) {
if (rightTypeFound()) {
return false;
@@ -1068,6 +1164,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(Block)
*/
+ @Override
public boolean visit(Block node) {
if (rightTypeFound()) {
return false;
@@ -1075,9 +1172,13 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BlockComment)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * BlockComment)
*/
+ @Override
public boolean visit(BlockComment node) {
return false;
}
@@ -1085,6 +1186,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(BooleanLiteral)
*/
+ @Override
public boolean visit(BooleanLiteral node) {
if (rightTypeFound()) {
return false;
@@ -1095,6 +1197,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(BreakStatement)
*/
+ @Override
public boolean visit(BreakStatement node) {
if (rightTypeFound()) {
return false;
@@ -1105,6 +1208,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(CastExpression)
*/
+ @Override
public boolean visit(CastExpression node) {
if (rightTypeFound()) {
return false;
@@ -1115,6 +1219,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(CatchClause)
*/
+ @Override
public boolean visit(CatchClause node) {
if (rightTypeFound()) {
return false;
@@ -1125,6 +1230,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(CharacterLiteral)
*/
+ @Override
public boolean visit(CharacterLiteral node) {
if (rightTypeFound()) {
return false;
@@ -1135,6 +1241,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ClassInstanceCreation)
*/
+ @Override
public boolean visit(ClassInstanceCreation node) {
if (rightTypeFound()) {
return false;
@@ -1145,7 +1252,8 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(CompilationUnit)
*/
- public boolean visit(CompilationUnit node) {
+ @Override
+ public boolean visit(CompilationUnit node) {
if (rightTypeFound()) {
return false;
}
@@ -1155,6 +1263,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ConditionalExpression)
*/
+ @Override
public boolean visit(ConditionalExpression node) {
if (rightTypeFound()) {
return false;
@@ -1165,6 +1274,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ConstructorInvocation)
*/
+ @Override
public boolean visit(ConstructorInvocation node) {
if (rightTypeFound()) {
return false;
@@ -1175,6 +1285,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ContinueStatement)
*/
+ @Override
public boolean visit(ContinueStatement node) {
if (rightTypeFound()) {
return false;
@@ -1185,6 +1296,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(DoStatement)
*/
+ @Override
public boolean visit(DoStatement node) {
if (rightTypeFound()) {
return false;
@@ -1195,6 +1307,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(EmptyStatement)
*/
+ @Override
public boolean visit(EmptyStatement node) {
if (rightTypeFound()) {
return false;
@@ -1202,9 +1315,13 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnhancedForStatement)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnhancedForStatement)
*/
+ @Override
public boolean visit(EnhancedForStatement node) {
if (rightTypeFound()) {
return false;
@@ -1212,19 +1329,27 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumConstantDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnumConstantDeclaration)
*/
+ @Override
public boolean visit(EnumConstantDeclaration node) {
if (rightTypeFound()) {
return false;
}
return true;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumDeclaration)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnumDeclaration)
*/
+ @Override
public boolean visit(EnumDeclaration node) {
if (rightTypeFound()) {
fEvaluateNextEndTypeDeclaration = false;
@@ -1232,10 +1357,11 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
}
return true;
}
-
+
/**
* @see ASTVisitor#visit(ExpressionStatement)
*/
+ @Override
public boolean visit(ExpressionStatement node) {
if (rightTypeFound()) {
return false;
@@ -1246,6 +1372,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(FieldAccess)
*/
+ @Override
public boolean visit(FieldAccess node) {
if (rightTypeFound()) {
return false;
@@ -1256,6 +1383,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(FieldDeclaration)
*/
+ @Override
public boolean visit(FieldDeclaration node) {
if (rightTypeFound()) {
return false;
@@ -1266,6 +1394,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ForStatement)
*/
+ @Override
public boolean visit(ForStatement node) {
if (rightTypeFound()) {
return false;
@@ -1276,6 +1405,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(IfStatement)
*/
+ @Override
public boolean visit(IfStatement node) {
if (rightTypeFound()) {
return false;
@@ -1286,6 +1416,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ImportDeclaration)
*/
+ @Override
public boolean visit(ImportDeclaration node) {
if (rightTypeFound()) {
return false;
@@ -1296,6 +1427,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(InfixExpression)
*/
+ @Override
public boolean visit(InfixExpression node) {
if (rightTypeFound()) {
return false;
@@ -1306,6 +1438,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(Initializer)
*/
+ @Override
public boolean visit(Initializer node) {
if (rightTypeFound()) {
return false;
@@ -1313,18 +1446,24 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.InstanceofExpression)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * InstanceofExpression)
*/
+ @Override
public boolean visit(InstanceofExpression node) {
if (rightTypeFound()) {
return false;
}
return true;
}
+
/**
* @see ASTVisitor#visit(Javadoc)
*/
+ @Override
public boolean visit(Javadoc node) {
if (rightTypeFound()) {
return false;
@@ -1335,6 +1474,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(LabeledStatement)
*/
+ @Override
public boolean visit(LabeledStatement node) {
if (rightTypeFound()) {
return false;
@@ -1342,42 +1482,61 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.LineComment)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * LineComment)
*/
+ @Override
public boolean visit(LineComment node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MarkerAnnotation)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MarkerAnnotation)
*/
+ @Override
public boolean visit(MarkerAnnotation node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef
+ * )
*/
+ @Override
public boolean visit(MemberRef node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberValuePair)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MemberValuePair)
*/
+ @Override
public boolean visit(MemberValuePair node) {
return false;
}
+
/**
* @see ASTVisitor#visit(MethodDeclaration)
*/
+ @Override
public boolean visit(MethodDeclaration node) {
- List typeParameters = node.typeParameters();
+ List<TypeParameter> typeParameters = node.typeParameters();
if (!typeParameters.isEmpty()) {
- Iterator iterator = typeParameters.iterator();
+ Iterator<TypeParameter> iterator = typeParameters.iterator();
while (iterator.hasNext()) {
- TypeParameter typeParameter= (TypeParameter) iterator.next();
+ TypeParameter typeParameter = iterator.next();
fTypeParameters.add(typeParameter.toString());
}
}
@@ -1390,6 +1549,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(MethodInvocation)
*/
+ @Override
public boolean visit(MethodInvocation node) {
if (rightTypeFound()) {
return false;
@@ -1397,37 +1557,56 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef
+ * )
*/
+ @Override
public boolean visit(MethodRef node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRefParameter)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MethodRefParameter)
*/
+ @Override
public boolean visit(MethodRefParameter node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier
+ * )
*/
+ @Override
public boolean visit(Modifier node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NormalAnnotation)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * NormalAnnotation)
*/
+ @Override
public boolean visit(NormalAnnotation node) {
return false;
}
-
+
/**
* @see ASTVisitor#visit(NullLiteral)
*/
+ @Override
public boolean visit(NullLiteral node) {
if (rightTypeFound()) {
return false;
@@ -1438,6 +1617,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(NumberLiteral)
*/
+ @Override
public boolean visit(NumberLiteral node) {
if (rightTypeFound()) {
return false;
@@ -1448,6 +1628,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(PackageDeclaration)
*/
+ @Override
public boolean visit(PackageDeclaration node) {
if (rightTypeFound()) {
return false;
@@ -1455,9 +1636,13 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ParameterizedType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * ParameterizedType)
*/
+ @Override
public boolean visit(ParameterizedType node) {
if (rightTypeFound()) {
return false;
@@ -1468,6 +1653,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ParenthesizedExpression)
*/
+ @Override
public boolean visit(ParenthesizedExpression node) {
if (rightTypeFound()) {
return false;
@@ -1478,6 +1664,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(PostfixExpression)
*/
+ @Override
public boolean visit(PostfixExpression node) {
if (rightTypeFound()) {
return false;
@@ -1488,6 +1675,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(PrefixExpression)
*/
+ @Override
public boolean visit(PrefixExpression node) {
if (rightTypeFound()) {
return false;
@@ -1498,6 +1686,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(PrimitiveType)
*/
+ @Override
public boolean visit(PrimitiveType node) {
if (rightTypeFound()) {
return false;
@@ -1508,6 +1697,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(QualifiedName)
*/
+ @Override
public boolean visit(QualifiedName node) {
if (rightTypeFound()) {
return false;
@@ -1515,15 +1705,21 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.QualifiedType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * QualifiedType)
*/
+ @Override
public boolean visit(QualifiedType node) {
return false;
}
+
/**
* @see ASTVisitor#visit(ReturnStatement)
*/
+ @Override
public boolean visit(ReturnStatement node) {
if (rightTypeFound()) {
return false;
@@ -1534,6 +1730,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SimpleName)
*/
+ @Override
public boolean visit(SimpleName node) {
if (rightTypeFound()) {
return false;
@@ -1544,6 +1741,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SimpleType)
*/
+ @Override
public boolean visit(SimpleType node) {
if (rightTypeFound()) {
return false;
@@ -1551,16 +1749,21 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * SingleMemberAnnotation)
*/
+ @Override
public boolean visit(SingleMemberAnnotation node) {
return false;
}
-
+
/**
* @see ASTVisitor#visit(SingleVariableDeclaration)
*/
+ @Override
public boolean visit(SingleVariableDeclaration node) {
if (rightTypeFound()) {
return false;
@@ -1571,6 +1774,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(StringLiteral)
*/
+ @Override
public boolean visit(StringLiteral node) {
if (rightTypeFound()) {
return false;
@@ -1581,6 +1785,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SuperConstructorInvocation)
*/
+ @Override
public boolean visit(SuperConstructorInvocation node) {
if (rightTypeFound()) {
return false;
@@ -1591,6 +1796,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SuperFieldAccess)
*/
+ @Override
public boolean visit(SuperFieldAccess node) {
if (rightTypeFound()) {
return false;
@@ -1601,6 +1807,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SuperMethodInvocation)
*/
+ @Override
public boolean visit(SuperMethodInvocation node) {
if (rightTypeFound()) {
return false;
@@ -1611,6 +1818,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SwitchCase)
*/
+ @Override
public boolean visit(SwitchCase node) {
if (rightTypeFound()) {
return false;
@@ -1621,6 +1829,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SwitchStatement)
*/
+ @Override
public boolean visit(SwitchStatement node) {
if (rightTypeFound()) {
return false;
@@ -1631,6 +1840,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(SynchronizedStatement)
*/
+ @Override
public boolean visit(SynchronizedStatement node) {
if (rightTypeFound()) {
return false;
@@ -1638,16 +1848,25 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement
+ * )
*/
+ @Override
public boolean visit(TagElement node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TextElement)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * TextElement)
*/
+ @Override
public boolean visit(TextElement node) {
return false;
}
@@ -1655,6 +1874,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ThisExpression)
*/
+ @Override
public boolean visit(ThisExpression node) {
if (rightTypeFound()) {
return false;
@@ -1665,6 +1885,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(ThrowStatement)
*/
+ @Override
public boolean visit(ThrowStatement node) {
if (rightTypeFound()) {
return false;
@@ -1675,6 +1896,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(TryStatement)
*/
+ @Override
public boolean visit(TryStatement node) {
if (rightTypeFound()) {
return false;
@@ -1682,25 +1904,31 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.UnionType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.UnionType
+ * )
*/
+ @Override
public boolean visit(UnionType node) {
if (rightTypeFound()) {
return false;
}
return true;
}
-
+
/**
* @see ASTVisitor#visit(TypeDeclaration)
*/
+ @Override
public boolean visit(TypeDeclaration node) {
- List typeParameters = node.typeParameters();
+ List<TypeParameter> typeParameters = node.typeParameters();
if (!typeParameters.isEmpty()) {
- Iterator iterator = typeParameters.iterator();
+ Iterator<TypeParameter> iterator = typeParameters.iterator();
while (iterator.hasNext()) {
- TypeParameter typeParameter= (TypeParameter) iterator.next();
+ TypeParameter typeParameter = iterator.next();
fTypeParameters.add(typeParameter.getName().getIdentifier());
}
}
@@ -1714,6 +1942,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(TypeDeclarationStatement)
*/
+ @Override
public boolean visit(TypeDeclarationStatement node) {
if (rightTypeFound()) {
return false;
@@ -1724,6 +1953,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(TypeLiteral)
*/
+ @Override
public boolean visit(TypeLiteral node) {
if (rightTypeFound()) {
return false;
@@ -1731,9 +1961,13 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeParameter)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * TypeParameter)
*/
+ @Override
public boolean visit(TypeParameter node) {
return false;
}
@@ -1741,6 +1975,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(VariableDeclarationExpression)
*/
+ @Override
public boolean visit(VariableDeclarationExpression node) {
if (rightTypeFound()) {
return false;
@@ -1751,6 +1986,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(VariableDeclarationFragment)
*/
+ @Override
public boolean visit(VariableDeclarationFragment node) {
if (rightTypeFound()) {
return false;
@@ -1761,6 +1997,7 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(VariableDeclarationStatement)
*/
+ @Override
public boolean visit(VariableDeclarationStatement node) {
if (rightTypeFound()) {
return false;
@@ -1771,72 +2008,82 @@ public class SourceBasedSourceGenerator extends ASTVisitor {
/**
* @see ASTVisitor#visit(WhileStatement)
*/
+ @Override
public boolean visit(WhileStatement node) {
if (rightTypeFound()) {
return false;
}
return true;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.WildcardType)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * WildcardType)
*/
+ @Override
public boolean visit(WildcardType node) {
return false;
}
/**
- * Returns whether the source to be generated is greater than or equal to the
- * given source level.
+ * Returns whether the source to be generated is greater than or equal to
+ * the given source level.
*
- * @param major major level - e.g. 1 from 1.4
- * @param minor minor level - e.g. 4 from 1.4
- * @return <code>true</code> if the given major / minor version is less than or equal to the backing source level
+ * @param major
+ * major level - e.g. 1 from 1.4
+ * @param minor
+ * minor level - e.g. 4 from 1.4
+ * @return <code>true</code> if the given major / minor version is less than
+ * or equal to the backing source level
*/
public boolean isSourceLevelGreaterOrEqual(int major, int minor) {
- return (fSourceMajorLevel > major) ||
- (fSourceMajorLevel == major && fSourceMinorLevel >= minor);
+ return (fSourceMajorLevel > major)
+ || (fSourceMajorLevel == major && fSourceMinorLevel >= minor);
}
-
+
/**
* Appends type parameters to source.
*
- * @param source the current buffer of source to append to
- * @param typeParameters the list of {@link TypeParameter}s to add
+ * @param source
+ * the current buffer of source to append to
+ * @param typeParameters
+ * the list of {@link TypeParameter}s to add
*/
- private void appendTypeParameters(StringBuffer source, List typeParameters) {
+ private void appendTypeParameters(StringBuffer source, List<TypeParameter> typeParameters) {
if (!typeParameters.isEmpty() && isSourceLevelGreaterOrEqual(1, 5)) {
source.append('<');
- Iterator iter= typeParameters.iterator();
- TypeParameter typeParameter= (TypeParameter) iter.next();
+ Iterator<TypeParameter> iter = typeParameters.iterator();
+ TypeParameter typeParameter = iter.next();
source.append(typeParameter.getName().getIdentifier());
- List typeBounds= typeParameter.typeBounds();
+ List<Type> typeBounds = typeParameter.typeBounds();
if (!typeBounds.isEmpty()) {
source.append(" extends "); //$NON-NLS-1$
- Iterator iter2= typeBounds.iterator();
- source.append(getTypeName((Type) iter2.next()));
+ Iterator<Type> iter2 = typeBounds.iterator();
+ source.append(getTypeName(iter2.next()));
while (iter2.hasNext()) {
source.append('&');
- source.append(getTypeName((Type) iter2.next()));
+ source.append(getTypeName(iter2.next()));
}
}
while (iter.hasNext()) {
source.append(',');
- typeParameter= (TypeParameter) iter.next();
+ typeParameter = iter.next();
source.append(typeParameter.getName().getIdentifier());
- typeBounds= typeParameter.typeBounds();
+ typeBounds = typeParameter.typeBounds();
if (!typeBounds.isEmpty()) {
source.append(" extends "); //$NON-NLS-1$
- Iterator iter2= typeBounds.iterator();
- source.append(getTypeName((Type) iter2.next()));
+ Iterator<Type> iter2 = typeBounds.iterator();
+ source.append(getTypeName(iter2.next()));
while (iter2.hasNext()) {
source.append('&');
- source.append(getTypeName((Type) iter2.next()));
+ source.append(getTypeName(iter2.next()));
}
}
}
source.append('>');
source.append(' ');
- }
- }
+ }
+ }
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndAssignmentOperator.java
index 1e9c36bcd..2909c8f9c 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndAssignmentOperator.java
@@ -15,8 +15,9 @@ public class AndAssignmentOperator extends AndOperator {
public AndAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.AndAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.AndAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndOperator.java
index d536e20a5..a1509d329 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AndOperator.java
@@ -13,60 +13,74 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaValue;
-
public class AndOperator extends BinaryOperator {
public AndOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected AndOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperateur, int start) {
+ protected AndOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperateur, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperateur, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getBooleanValue() & ((IJavaPrimitiveValue) rightOperand).getBooleanValue();
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getBooleanValue()
+ & ((IJavaPrimitiveValue) rightOperand).getBooleanValue();
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() & ((IJavaPrimitiveValue) rightOperand).getIntValue();
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue()
+ & ((IJavaPrimitiveValue) rightOperand).getIntValue();
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() & ((IJavaPrimitiveValue) rightOperand).getLongValue();
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue()
+ & ((IJavaPrimitiveValue) rightOperand).getLongValue();
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.AndOperator_____operator_1;
+ return InstructionsEvaluationMessages.AndOperator_____operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAccess.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAccess.java
index de0b2c70f..7493dda72 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAccess.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAccess.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -20,49 +19,62 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import com.ibm.icu.text.MessageFormat;
-
+
/**
- * Resolves an array access - the top of the stack is
- * the position, and the second from top is the array
- * object.
+ * Resolves an array access - the top of the stack is the position, and the
+ * second from top is the array object.
*/
public class ArrayAccess extends ArrayInstruction {
-
+
public ArrayAccess(int start) {
super(start);
}
-
+
+ @Override
public void execute() throws CoreException {
- int index = ((IJavaPrimitiveValue)popValue()).getIntValue();
+ int index = ((IJavaPrimitiveValue) popValue()).getIntValue();
IJavaArray array = popArray();
if (index >= array.getLength() || index < 0) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.ArrayAccess_illegal_index, new Object[] {new Integer(index)}), null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ MessageFormat
+ .format(InstructionsEvaluationMessages.ArrayAccess_illegal_index,
+ new Object[] { new Integer(index) }),
+ null));
}
push(array.getVariable(index));
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.ArrayAccess_array_access_1;
+ return InstructionsEvaluationMessages.ArrayAccess_array_access_1;
}
-
+
/**
- * Pops an array object off the top of the stack. Throws an exception if not an array
- * object or <code>null</code>.
+ * Pops an array object off the top of the stack. Throws an exception if not
+ * an array object or <code>null</code>.
*
* @return array object on top of the stack
- * @throws CoreException if not available
+ * @throws CoreException
+ * if not available
*/
protected IJavaArray popArray() throws CoreException {
IJavaValue value = popValue();
if (value instanceof IJavaArray) {
- return (IJavaArray)value;
+ return (IJavaArray) value;
} else if (value.isNull()) {
// null pointer
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.ArrayAccess_0, null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ InstructionsEvaluationMessages.ArrayAccess_0, null));
} else {
// internal error
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, "Internal error: attempt to access non-array object", null)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ "Internal error: attempt to access non-array object", null)); //$NON-NLS-1$
}
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAllocation.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAllocation.java
index 14d5a363c..4610538bd 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAllocation.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayAllocation.java
@@ -19,18 +19,20 @@ import org.eclipse.jdt.debug.core.IJavaType;
public class ArrayAllocation extends ArrayInstruction {
private int fDimension;
-
+
private int fExprDimension;
-
+
private boolean fHasInitializer;
-
+
private IJavaArrayType[] fCachedArrayTypes;
/**
* Constructor for ArrayAllocation.
+ *
* @param start
*/
- public ArrayAllocation(int dimension, int exprDimension, boolean hasInitializer, int start) {
+ public ArrayAllocation(int dimension, int exprDimension,
+ boolean hasInitializer, int start) {
super(start);
fDimension = dimension;
fExprDimension = exprDimension;
@@ -40,58 +42,63 @@ public class ArrayAllocation extends ArrayInstruction {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
if (fHasInitializer) {
IJavaArray array = (IJavaArray) popValue();
pop(); // pop the type
push(array);
} else {
-
+
int[] exprDimensions = new int[fExprDimension];
-
+
for (int i = fExprDimension - 1; i >= 0; i--) {
- exprDimensions[i] = ((IJavaPrimitiveValue)popValue()).getIntValue();
+ exprDimensions[i] = ((IJavaPrimitiveValue) popValue())
+ .getIntValue();
}
-
+
IJavaType type = (IJavaType) pop();
-
+
fCachedArrayTypes = new IJavaArrayType[fDimension + 1];
-
- for (int i =fDimension, lim = fDimension - fExprDimension ; i > lim; i--) {
+
+ for (int i = fDimension, lim = fDimension - fExprDimension; i > lim; i--) {
fCachedArrayTypes[i] = (IJavaArrayType) type;
- type = ((IJavaArrayType)type).getComponentType();
+ type = ((IJavaArrayType) type).getComponentType();
}
-
+
IJavaArray array = createArray(fDimension, exprDimensions);
-
+
push(array);
}
}
-
+
/**
* Create and populate an array.
*/
- private IJavaArray createArray(int dimension, int[] exprDimensions) throws CoreException {
-
- IJavaArray array = fCachedArrayTypes[dimension].newInstance(exprDimensions[0]);
-
+ private IJavaArray createArray(int dimension, int[] exprDimensions)
+ throws CoreException {
+
+ IJavaArray array = fCachedArrayTypes[dimension]
+ .newInstance(exprDimensions[0]);
+
if (exprDimensions.length > 1) {
int[] newExprDimension = new int[exprDimensions.length - 1];
for (int i = 0; i < newExprDimension.length; i++) {
newExprDimension[i] = exprDimensions[i + 1];
}
-
+
for (int i = 0; i < exprDimensions[0]; i++) {
array.setValue(i, createArray(dimension - 1, newExprDimension));
}
-
+
}
-
+
return array;
- }
+ }
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.ArrayAllocation_array_allocation_1;
+ return InstructionsEvaluationMessages.ArrayAllocation_array_allocation_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInitializerInstruction.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInitializerInstruction.java
index c0e89d079..cede6f398 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInitializerInstruction.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInitializerInstruction.java
@@ -17,16 +17,18 @@ import org.eclipse.jdt.debug.core.IJavaArrayType;
public class ArrayInitializerInstruction extends ArrayInstruction {
private String fTypeSignature;
-
+
private int fDimensions;
-
+
private int fLength;
/**
* Constructor for ArrayInitializerInstruction.
+ *
* @param start
*/
- public ArrayInitializerInstruction(String typeSignature, int length, int dimensions, int start) {
+ public ArrayInitializerInstruction(String typeSignature, int length,
+ int dimensions, int start) {
super(start);
fTypeSignature = typeSignature;
fDimensions = dimensions;
@@ -36,21 +38,24 @@ public class ArrayInitializerInstruction extends ArrayInstruction {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
-
- IJavaArrayType arrayType = getArrayType(fTypeSignature.replace('/','.'), fDimensions);
+
+ IJavaArrayType arrayType = getArrayType(
+ fTypeSignature.replace('/', '.'), fDimensions);
IJavaArray array = arrayType.newInstance(fLength);
-
+
for (int i = fLength - 1; i >= 0; i--) {
array.setValue(i, popValue());
}
-
+
push(array);
-
+
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.ArrayInitializerInstruction_array_initializer_1;
+ return InstructionsEvaluationMessages.ArrayInitializerInstruction_array_initializer_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInstruction.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInstruction.java
index 9ed66eaed..2a9ec39a2 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInstruction.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ArrayInstruction.java
@@ -10,12 +10,10 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
public abstract class ArrayInstruction extends CompoundInstruction {
-
public ArrayInstruction(int start) {
super(start);
}
-
+
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AssignmentOperator.java
index f7fdae66d..12a1b9ac9 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/AssignmentOperator.java
@@ -20,7 +20,6 @@ public class AssignmentOperator extends CompoundInstruction {
protected int fVariableTypeId;
protected int fValueTypeId;
-
public AssignmentOperator(int variableTypeId, int valueTypeId, int start) {
super(start);
fVariableTypeId = variableTypeId;
@@ -30,37 +29,38 @@ public class AssignmentOperator extends CompoundInstruction {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
IJavaValue value = popValue();
IJavaVariable variable = (IJavaVariable) pop();
-
+
if (value instanceof IJavaPrimitiveValue) {
IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
switch (fVariableTypeId) {
- case T_boolean:
- variable.setValue(newValue(primitiveValue.getBooleanValue()));
- break;
- case T_byte:
- variable.setValue(newValue(primitiveValue.getByteValue()));
- break;
- case T_short:
- variable.setValue(newValue(primitiveValue.getShortValue()));
- break;
- case T_char:
- variable.setValue(newValue(primitiveValue.getCharValue()));
- break;
- case T_int:
- variable.setValue(newValue(primitiveValue.getIntValue()));
- break;
- case T_long:
- variable.setValue(newValue(primitiveValue.getLongValue()));
- break;
- case T_float:
- variable.setValue(newValue(primitiveValue.getFloatValue()));
- break;
- case T_double:
- variable.setValue(newValue(primitiveValue.getDoubleValue()));
- break;
+ case T_boolean:
+ variable.setValue(newValue(primitiveValue.getBooleanValue()));
+ break;
+ case T_byte:
+ variable.setValue(newValue(primitiveValue.getByteValue()));
+ break;
+ case T_short:
+ variable.setValue(newValue(primitiveValue.getShortValue()));
+ break;
+ case T_char:
+ variable.setValue(newValue(primitiveValue.getCharValue()));
+ break;
+ case T_int:
+ variable.setValue(newValue(primitiveValue.getIntValue()));
+ break;
+ case T_long:
+ variable.setValue(newValue(primitiveValue.getLongValue()));
+ break;
+ case T_float:
+ variable.setValue(newValue(primitiveValue.getFloatValue()));
+ break;
+ case T_double:
+ variable.setValue(newValue(primitiveValue.getDoubleValue()));
+ break;
}
} else {
variable.setValue(value);
@@ -68,7 +68,8 @@ public class AssignmentOperator extends CompoundInstruction {
push(variable.getValue());
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.AssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.AssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/BinaryOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/BinaryOperator.java
index 006c543ee..f26d764f8 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/BinaryOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/BinaryOperator.java
@@ -20,17 +20,19 @@ public abstract class BinaryOperator extends CompoundInstruction {
protected int fRightTypeId;
protected boolean fIsAssignmentOperator;
- protected BinaryOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignementOperator, int start) {
+ protected BinaryOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignementOperator, int start) {
super(start);
- fResultTypeId= resultId;
- fLeftTypeId= leftTypeId;
- fRightTypeId= rightTypeId;
- fIsAssignmentOperator= isAssignementOperator;
+ fResultTypeId = resultId;
+ fLeftTypeId = leftTypeId;
+ fRightTypeId = rightTypeId;
+ fIsAssignmentOperator = isAssignementOperator;
}
-
+
/*
* @see Instruction#execute()
*/
+ @Override
final public void execute() throws CoreException {
if (fIsAssignmentOperator) {
executeAssignment();
@@ -38,195 +40,210 @@ public abstract class BinaryOperator extends CompoundInstruction {
executeBinary();
}
}
-
+
private void executeAssignment() throws CoreException {
IJavaValue value = popValue();
IJavaVariable variable = (IJavaVariable) pop();
- IJavaValue variableValue = (IJavaValue)variable.getValue();
-
+ IJavaValue variableValue = (IJavaValue) variable.getValue();
+
switch (fResultTypeId) {
- case T_byte:
- variableValue= getByteValueResult(variableValue, value);
- break;
- case T_short:
- variableValue= getShortValueResult(variableValue, value);
- break;
- case T_char:
- variableValue= getCharValueResult(variableValue, value);
- break;
- case T_int:
- variableValue= getIntValueResult(variableValue, value);
- break;
- case T_long:
- variableValue= getLongValueResult(variableValue, value);
- break;
- case T_float:
- variableValue= getFloatValueResult(variableValue, value);
- break;
- case T_double:
- variableValue= getDoubleValueResult(variableValue, value);
- break;
- case T_boolean:
- variableValue= getBooleanValueResult(variableValue, value);
- break;
- case T_String:
- variableValue= getStringValueResult(variableValue, value);
- break;
+ case T_byte:
+ variableValue = getByteValueResult(variableValue, value);
+ break;
+ case T_short:
+ variableValue = getShortValueResult(variableValue, value);
+ break;
+ case T_char:
+ variableValue = getCharValueResult(variableValue, value);
+ break;
+ case T_int:
+ variableValue = getIntValueResult(variableValue, value);
+ break;
+ case T_long:
+ variableValue = getLongValueResult(variableValue, value);
+ break;
+ case T_float:
+ variableValue = getFloatValueResult(variableValue, value);
+ break;
+ case T_double:
+ variableValue = getDoubleValueResult(variableValue, value);
+ break;
+ case T_boolean:
+ variableValue = getBooleanValueResult(variableValue, value);
+ break;
+ case T_String:
+ variableValue = getStringValueResult(variableValue, value);
+ break;
}
variable.setValue(variableValue);
push(variableValue);
}
-
+
private void executeBinary() throws CoreException {
- IJavaValue right= popValue();
- IJavaValue left= popValue();
+ IJavaValue right = popValue();
+ IJavaValue left = popValue();
switch (fResultTypeId) {
- case T_String:
- pushNewValue(getStringResult(left, right));
- break;
- case T_double:
- pushNewValue(getDoubleResult(left, right));
- break;
- case T_float:
- pushNewValue(getFloatResult(left, right));
- break;
- case T_long:
- pushNewValue(getLongResult(left, right));
- break;
- case T_int:
- pushNewValue(getIntResult(left, right));
- break;
- case T_boolean:
- pushNewValue(getBooleanResult(left, right));
- break;
- }
+ case T_String:
+ pushNewValue(getStringResult(left, right));
+ break;
+ case T_double:
+ pushNewValue(getDoubleResult(left, right));
+ break;
+ case T_float:
+ pushNewValue(getFloatResult(left, right));
+ break;
+ case T_long:
+ pushNewValue(getLongResult(left, right));
+ break;
+ case T_int:
+ pushNewValue(getIntResult(left, right));
+ break;
+ case T_boolean:
+ pushNewValue(getBooleanResult(left, right));
+ break;
+ }
}
-
- private IJavaValue getByteValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getByteValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
switch (getInternResultType()) {
- case T_double:
- return newValue((byte) getDoubleResult(leftOperand, rightOperand));
- case T_float:
- return newValue((byte) getFloatResult(leftOperand, rightOperand));
- case T_long:
- return newValue((byte) getLongResult(leftOperand, rightOperand));
- case T_int:
- return newValue((byte) getIntResult(leftOperand, rightOperand));
- default:
- return null;
+ case T_double:
+ return newValue((byte) getDoubleResult(leftOperand, rightOperand));
+ case T_float:
+ return newValue((byte) getFloatResult(leftOperand, rightOperand));
+ case T_long:
+ return newValue((byte) getLongResult(leftOperand, rightOperand));
+ case T_int:
+ return newValue((byte) getIntResult(leftOperand, rightOperand));
+ default:
+ return null;
}
}
-
- private IJavaValue getShortValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getShortValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
switch (getInternResultType()) {
- case T_double:
- return newValue((short) getDoubleResult(leftOperand, rightOperand));
- case T_float:
- return newValue((short) getFloatResult(leftOperand, rightOperand));
- case T_long:
- return newValue((short) getLongResult(leftOperand, rightOperand));
- case T_int:
- return newValue((short) getIntResult(leftOperand, rightOperand));
- default:
- return null;
+ case T_double:
+ return newValue((short) getDoubleResult(leftOperand, rightOperand));
+ case T_float:
+ return newValue((short) getFloatResult(leftOperand, rightOperand));
+ case T_long:
+ return newValue((short) getLongResult(leftOperand, rightOperand));
+ case T_int:
+ return newValue((short) getIntResult(leftOperand, rightOperand));
+ default:
+ return null;
}
}
-
- private IJavaValue getCharValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getCharValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
switch (getInternResultType()) {
- case T_double:
- return newValue((char) getDoubleResult(leftOperand, rightOperand));
- case T_float:
- return newValue((char) getFloatResult(leftOperand, rightOperand));
- case T_long:
- return newValue((char) getLongResult(leftOperand, rightOperand));
- case T_int:
- return newValue((char) getIntResult(leftOperand, rightOperand));
- default:
- return null;
+ case T_double:
+ return newValue((char) getDoubleResult(leftOperand, rightOperand));
+ case T_float:
+ return newValue((char) getFloatResult(leftOperand, rightOperand));
+ case T_long:
+ return newValue((char) getLongResult(leftOperand, rightOperand));
+ case T_int:
+ return newValue((char) getIntResult(leftOperand, rightOperand));
+ default:
+ return null;
}
}
-
- private IJavaValue getIntValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getIntValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
switch (getInternResultType()) {
- case T_double:
- return newValue((int) getDoubleResult(leftOperand, rightOperand));
- case T_float:
- return newValue((int) getFloatResult(leftOperand, rightOperand));
- case T_long:
- return newValue((int) getLongResult(leftOperand, rightOperand));
- case T_int:
- return newValue(getIntResult(leftOperand, rightOperand));
- default:
- return null;
+ case T_double:
+ return newValue((int) getDoubleResult(leftOperand, rightOperand));
+ case T_float:
+ return newValue((int) getFloatResult(leftOperand, rightOperand));
+ case T_long:
+ return newValue((int) getLongResult(leftOperand, rightOperand));
+ case T_int:
+ return newValue(getIntResult(leftOperand, rightOperand));
+ default:
+ return null;
}
}
-
- private IJavaValue getLongValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getLongValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
switch (getInternResultType()) {
- case T_double:
- return newValue((long) getDoubleResult(leftOperand, rightOperand));
- case T_float:
- return newValue((long) getFloatResult(leftOperand, rightOperand));
- case T_long:
- return newValue(getLongResult(leftOperand, rightOperand));
- case T_int:
- return newValue((long) getIntResult(leftOperand, rightOperand));
- default:
- return null;
+ case T_double:
+ return newValue((long) getDoubleResult(leftOperand, rightOperand));
+ case T_float:
+ return newValue((long) getFloatResult(leftOperand, rightOperand));
+ case T_long:
+ return newValue(getLongResult(leftOperand, rightOperand));
+ case T_int:
+ return newValue((long) getIntResult(leftOperand, rightOperand));
+ default:
+ return null;
}
}
-
- private IJavaValue getFloatValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getFloatValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
switch (getInternResultType()) {
- case T_double:
- return newValue((float) getDoubleResult(leftOperand, rightOperand));
- case T_float:
- return newValue(getFloatResult(leftOperand, rightOperand));
- case T_long:
- return newValue((float) getLongResult(leftOperand, rightOperand));
- case T_int:
- return newValue((float) getIntResult(leftOperand, rightOperand));
- default:
- return null;
+ case T_double:
+ return newValue((float) getDoubleResult(leftOperand, rightOperand));
+ case T_float:
+ return newValue(getFloatResult(leftOperand, rightOperand));
+ case T_long:
+ return newValue((float) getLongResult(leftOperand, rightOperand));
+ case T_int:
+ return newValue((float) getIntResult(leftOperand, rightOperand));
+ default:
+ return null;
}
}
-
- private IJavaValue getDoubleValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getDoubleValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
switch (getInternResultType()) {
- case T_double:
- return newValue(getDoubleResult(leftOperand, rightOperand));
- case T_float:
- return newValue((double) getFloatResult(leftOperand, rightOperand));
- case T_long:
- return newValue((double) getLongResult(leftOperand, rightOperand));
- case T_int:
- return newValue((double) getIntResult(leftOperand, rightOperand));
- default:
- return null;
+ case T_double:
+ return newValue(getDoubleResult(leftOperand, rightOperand));
+ case T_float:
+ return newValue((double) getFloatResult(leftOperand, rightOperand));
+ case T_long:
+ return newValue((double) getLongResult(leftOperand, rightOperand));
+ case T_int:
+ return newValue((double) getIntResult(leftOperand, rightOperand));
+ default:
+ return null;
}
}
-
- private IJavaValue getBooleanValueResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+
+ private IJavaValue getBooleanValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return newValue(getBooleanResult(leftOperand, rightOperand));
}
-
- private IJavaValue getStringValueResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
+
+ private IJavaValue getStringValueResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
return newValue(getStringResult(leftOperand, rightOperand));
}
-
- protected abstract int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException;
-
- protected abstract long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException;
- protected abstract float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand);
+ protected abstract int getIntResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException;
+
+ protected abstract long getLongResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException;
+
+ protected abstract float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand);
- protected abstract double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand);
+ protected abstract double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand);
- protected abstract boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand);
+ protected abstract boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand);
- protected abstract String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException;
+ protected abstract String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException;
protected int getInternResultType() {
return getBinaryPromotionType(fLeftTypeId, fRightTypeId);
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Cast.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Cast.java
index 1a1e8c72f..171c2d263 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Cast.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Cast.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -22,91 +20,119 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDINullValue;
+import com.ibm.icu.text.MessageFormat;
+
public class Cast extends CompoundInstruction {
- public static final String IS_INSTANCE= "isInstance"; //$NON-NLS-1$
- public static final String IS_INSTANCE_SIGNATURE= "(Ljava/lang/Object;)Z"; //$NON-NLS-1$
+ public static final String IS_INSTANCE = "isInstance"; //$NON-NLS-1$
+ public static final String IS_INSTANCE_SIGNATURE = "(Ljava/lang/Object;)Z"; //$NON-NLS-1$
private int fTypeTypeId;
-
+
private String fBaseTypeName;
-
+
private int fDimension;
-
+
/**
* Cast intruction constructor.
*
- * @param typeTypeId the id of the type to cast into.
- * @param baseTypeName the base type name of the type (the type name if the
- * type is not an array type.
- * @param dimension the dimension of the array type, 0 if the type is not an
- * array type.
+ * @param typeTypeId
+ * the id of the type to cast into.
+ * @param baseTypeName
+ * the base type name of the type (the type name if the type is
+ * not an array type.
+ * @param dimension
+ * the dimension of the array type, 0 if the type is not an array
+ * type.
*/
public Cast(int typeTypeId, String baseTypeName, int dimension, int start) {
super(start);
- fTypeTypeId= typeTypeId;
- fBaseTypeName= baseTypeName;
- fDimension= dimension;
+ fTypeTypeId = typeTypeId;
+ fBaseTypeName = baseTypeName;
+ fDimension = dimension;
}
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaValue value= popValue();
-
+ IJavaValue value = popValue();
+
if (value instanceof IJavaPrimitiveValue) {
IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
switch (fTypeTypeId) {
- case T_double:
- push(newValue(primitiveValue.getDoubleValue()));
- break;
- case T_float:
- push(newValue(primitiveValue.getFloatValue()));
- break;
- case T_long:
- push(newValue(primitiveValue.getLongValue()));
- break;
- case T_int:
- push(newValue(primitiveValue.getIntValue()));
- break;
- case T_short:
- push(newValue(primitiveValue.getShortValue()));
- break;
- case T_byte:
- push(newValue(primitiveValue.getByteValue()));
- break;
- case T_char:
- push(newValue(primitiveValue.getCharValue()));
- break;
+ case T_double:
+ push(newValue(primitiveValue.getDoubleValue()));
+ break;
+ case T_float:
+ push(newValue(primitiveValue.getFloatValue()));
+ break;
+ case T_long:
+ push(newValue(primitiveValue.getLongValue()));
+ break;
+ case T_int:
+ push(newValue(primitiveValue.getIntValue()));
+ break;
+ case T_short:
+ push(newValue(primitiveValue.getShortValue()));
+ break;
+ case T_byte:
+ push(newValue(primitiveValue.getByteValue()));
+ break;
+ case T_char:
+ push(newValue(primitiveValue.getCharValue()));
+ break;
}
-
+
} else if (value instanceof JDINullValue) {
// null value can be cast to all non-primitive types (bug 31637).
push(value);
} else {
IJavaObject classObject;
if (fDimension == 0) {
- classObject= getClassObject(getType(fBaseTypeName));
+ classObject = getClassObject(getType(fBaseTypeName));
} else {
- classObject= getClassObject(getArrayType(Signature.createTypeSignature(fBaseTypeName, true), fDimension));
+ classObject = getClassObject(getArrayType(
+ Signature.createTypeSignature(fBaseTypeName, true),
+ fDimension));
}
if (classObject == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Cast_No_class_object, new String[]{typeName()}), null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ MessageFormat
+ .format(InstructionsEvaluationMessages.Cast_No_class_object,
+ new String[] { typeName() }),
+ null));
}
- IJavaPrimitiveValue resultValue = (IJavaPrimitiveValue)classObject.sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE, new IJavaValue[] {value}, getContext().getThread(), false);
+ IJavaPrimitiveValue resultValue = (IJavaPrimitiveValue) classObject
+ .sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE,
+ new IJavaValue[] { value }, getContext()
+ .getThread(), false);
if (!resultValue.getBooleanValue()) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Cast_ClassCastException__Cannot_cast__0__as__1___1, new String[]{value.toString(), typeName()}), null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ MessageFormat
+ .format(InstructionsEvaluationMessages.Cast_ClassCastException__Cannot_cast__0__as__1___1,
+ new String[] {
+ value.toString(),
+ typeName() }), null));
}
-
+
push(value);
}
}
-
+
private String typeName() {
- String result= fBaseTypeName;
- for (int i= 0; i < fDimension; i++) {
- result+= "[]"; //$NON-NLS-1$
+ String result = fBaseTypeName;
+ for (int i = 0; i < fDimension; i++) {
+ result += "[]"; //$NON-NLS-1$
}
return result;
}
@@ -114,8 +140,9 @@ public class Cast extends CompoundInstruction {
/*
* @see Object#toString()
*/
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.Cast_cast_3;
+ return InstructionsEvaluationMessages.Cast_cast_3;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/CompoundInstruction.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/CompoundInstruction.java
index 5bff1461b..2b0c1f0fa 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/CompoundInstruction.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/CompoundInstruction.java
@@ -11,25 +11,27 @@
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
/**
- * A <code>CompoundInstruction</code> is a container instruction
- * and may have a size greater than one.
+ * A <code>CompoundInstruction</code> is a container instruction and may have a
+ * size greater than one.
*/
public abstract class CompoundInstruction extends Instruction {
private int fSize;
-
+
/**
* Constructor for CompoundInstruction.
+ *
* @param start
*/
protected CompoundInstruction(int start) {
- fSize= -start;
+ fSize = -start;
}
public void setEnd(int end) {
fSize += end;
}
+ @Override
public int getSize() {
return fSize;
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ConditionalJump.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ConditionalJump.java
index 9c431f416..255ae2f84 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ConditionalJump.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ConditionalJump.java
@@ -15,17 +15,18 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
public class ConditionalJump extends Jump {
private boolean fJumpOnTrue;
-
+
public ConditionalJump(boolean jumpOnTrue) {
- fJumpOnTrue= jumpOnTrue;
+ fJumpOnTrue = jumpOnTrue;
}
-
+
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaPrimitiveValue condition= (IJavaPrimitiveValue)popValue();
-
+ IJavaPrimitiveValue condition = (IJavaPrimitiveValue) popValue();
+
if (!(fJumpOnTrue ^ condition.getBooleanValue())) {
jump(fOffset);
}
@@ -34,8 +35,9 @@ public class ConditionalJump extends Jump {
/*
* @see Object#toString()
*/
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.ConditionalJump_conditional_jump_1;
+ return InstructionsEvaluationMessages.ConditionalJump_conditional_jump_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Constructor.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Constructor.java
index 3c0442e8f..6953b388e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Constructor.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Constructor.java
@@ -10,41 +10,42 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.debug.core.IJavaClassType;
import org.eclipse.jdt.debug.core.IJavaValue;
/**
- * Invokes a constructor. The arguments are on the
- * stack in reverse order, followed by the type.
- * Pushes the result onto the stack
+ * Invokes a constructor. The arguments are on the stack in reverse order,
+ * followed by the type. Pushes the result onto the stack
*/
public class Constructor extends CompoundInstruction {
-
+
private int fArgCount;
private String fSignature;
-
+
public Constructor(String signature, int argCount, int start) {
super(start);
fArgCount = argCount;
fSignature = signature;
}
-
+
+ @Override
public void execute() throws CoreException {
IJavaValue[] args = new IJavaValue[fArgCount];
// args are in reverse order
- for (int i= fArgCount - 1; i >= 0; i--) {
+ for (int i = fArgCount - 1; i >= 0; i--) {
args[i] = popValue();
}
- IJavaClassType clazz = (IJavaClassType)pop();
- IJavaValue result = clazz.newInstance(fSignature, args, getContext().getThread());
+ IJavaClassType clazz = (IJavaClassType) pop();
+ IJavaValue result = clazz.newInstance(fSignature, args, getContext()
+ .getThread());
push(result);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.Constructor_constructor__1 + fSignature;
+ return InstructionsEvaluationMessages.Constructor_constructor__1
+ + fSignature;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideAssignmentOperator.java
index 73db3170a..eaa2ed8ba 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideAssignmentOperator.java
@@ -12,12 +12,14 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
public class DivideAssignmentOperator extends DivideOperator {
- public DivideAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
+ public DivideAssignmentOperator(int variableTypeId, int valueTypeId,
+ int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.DivideAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.DivideAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideOperator.java
index 9dc85f904..2d73c6a44 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DivideOperator.java
@@ -18,42 +18,60 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
public class DivideOperator extends BinaryOperator {
- public DivideOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
+ public DivideOperator(int resultId, int leftTypeId, int rightTypeId,
+ int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected DivideOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ protected DivideOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() / ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue()
+ / ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() / ((IJavaPrimitiveValue) rightOperand).getFloatValue();
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue()
+ / ((IJavaPrimitiveValue) rightOperand).getFloatValue();
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
- protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
- int divisor= ((IJavaPrimitiveValue) rightOperand).getIntValue();
+ @Override
+ protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand)
+ throws CoreException {
+ int divisor = ((IJavaPrimitiveValue) rightOperand).getIntValue();
if (divisor == 0) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.DivideOperator_Divide_by_zero_1, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ InstructionsEvaluationMessages.DivideOperator_Divide_by_zero_1,
+ null));
}
return ((IJavaPrimitiveValue) leftOperand).getIntValue() / divisor;
}
@@ -61,10 +79,18 @@ public class DivideOperator extends BinaryOperator {
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
- protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
- long divisor= ((IJavaPrimitiveValue) rightOperand).getLongValue();
+ @Override
+ protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand)
+ throws CoreException {
+ long divisor = ((IJavaPrimitiveValue) rightOperand).getLongValue();
if (divisor == 0) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.DivideOperator_Divide_by_zero_2, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ InstructionsEvaluationMessages.DivideOperator_Divide_by_zero_2,
+ null));
}
return ((IJavaPrimitiveValue) leftOperand).getLongValue() / divisor;
}
@@ -72,12 +98,15 @@ public class DivideOperator extends BinaryOperator {
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.DivideOperator______operator_3;
+ return InstructionsEvaluationMessages.DivideOperator______operator_3;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Dup.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Dup.java
index 3efeff7fb..55ba29ea0 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Dup.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Dup.java
@@ -15,27 +15,30 @@ import org.eclipse.core.runtime.CoreException;
/**
* Duplicate the top element of the stack
*
- * Element
- * ...
+ * Element ...
*
* ->
*
- * Element
- * Element
- * ...
+ * Element Element ...
*
*/
public class Dup extends SimpleInstruction {
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute
+ * ()
*/
+ @Override
public void execute() throws CoreException {
- Object element= pop();
+ Object element = pop();
push(element);
push(element);
}
-
+
+ @Override
public String toString() {
return "Dup"; //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DupX1.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DupX1.java
index d08f1c849..67e628b2c 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DupX1.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/DupX1.java
@@ -13,29 +13,29 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
import org.eclipse.core.runtime.CoreException;
/**
- * Duplicate the top element of the stack and put in it behind
- * the second element of the stack.
+ * Duplicate the top element of the stack and put in it behind the second
+ * element of the stack.
*
- * Element1
- * Element2
- * ...
+ * Element1 Element2 ...
*
* ->
*
- * Element1
- * Element2
- * Element3
- * ...
+ * Element1 Element2 Element3 ...
*
*/
public class DupX1 extends SimpleInstruction {
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute
+ * ()
*/
+ @Override
public void execute() throws CoreException {
- Object element1= pop();
- Object element2= pop();
+ Object element1 = pop();
+ Object element2 = pop();
push(element1);
push(element2);
push(element1);
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/EqualEqualOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/EqualEqualOperator.java
index cb843eba6..ceae27e9e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/EqualEqualOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/EqualEqualOperator.java
@@ -15,43 +15,51 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaValue;
public class EqualEqualOperator extends BinaryOperator {
-
+
private boolean fIsEquals;
- public EqualEqualOperator(int leftTypeId, int rightTypeId, boolean isEquals, int start) {
+ public EqualEqualOperator(int leftTypeId, int rightTypeId,
+ boolean isEquals, int start) {
super(T_boolean, leftTypeId, rightTypeId, false, start);
- fIsEquals= isEquals;
+ fIsEquals = isEquals;
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- boolean equals= false;
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ boolean equals = false;
switch (getInternResultType()) {
- case T_double :
- equals= ((IJavaPrimitiveValue) leftOperand).getDoubleValue() == ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
- break;
- case T_float :
- equals= ((IJavaPrimitiveValue) leftOperand).getFloatValue() == ((IJavaPrimitiveValue) rightOperand).getFloatValue();
- break;
- case T_long :
- equals= ((IJavaPrimitiveValue) leftOperand).getLongValue() == ((IJavaPrimitiveValue) rightOperand).getLongValue();
- break;
- case T_int :
- if (leftOperand instanceof IJavaObject) {
- // enumerations in switch statement
- equals = leftOperand.equals(rightOperand);
- } else {
- equals= ((IJavaPrimitiveValue) leftOperand).getIntValue() == ((IJavaPrimitiveValue) rightOperand).getIntValue();
- }
- break;
- case T_boolean :
- equals= ((IJavaPrimitiveValue) leftOperand).getBooleanValue() == ((IJavaPrimitiveValue) rightOperand).getBooleanValue();
- break;
- default :
- equals= leftOperand.equals(rightOperand);
- break;
+ case T_double:
+ equals = ((IJavaPrimitiveValue) leftOperand).getDoubleValue() == ((IJavaPrimitiveValue) rightOperand)
+ .getDoubleValue();
+ break;
+ case T_float:
+ equals = ((IJavaPrimitiveValue) leftOperand).getFloatValue() == ((IJavaPrimitiveValue) rightOperand)
+ .getFloatValue();
+ break;
+ case T_long:
+ equals = ((IJavaPrimitiveValue) leftOperand).getLongValue() == ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ break;
+ case T_int:
+ if (leftOperand instanceof IJavaObject) {
+ // enumerations in switch statement
+ equals = leftOperand.equals(rightOperand);
+ } else {
+ equals = ((IJavaPrimitiveValue) leftOperand).getIntValue() == ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ }
+ break;
+ case T_boolean:
+ equals = ((IJavaPrimitiveValue) leftOperand).getBooleanValue() == ((IJavaPrimitiveValue) rightOperand)
+ .getBooleanValue();
+ break;
+ default:
+ equals = leftOperand.equals(rightOperand);
+ break;
}
return ((fIsEquals) ? equals : !equals);
}
@@ -59,20 +67,25 @@ public class EqualEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -80,6 +93,7 @@ public class EqualEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -87,12 +101,15 @@ public class EqualEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.EqualEqualOperator_operator_1;
+ return InstructionsEvaluationMessages.EqualEqualOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterEqualOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterEqualOperator.java
index 98e26f511..15299b7d9 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterEqualOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterEqualOperator.java
@@ -21,38 +21,49 @@ public class GreaterEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
switch (getInternResultType()) {
- case T_double :
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() >= ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
- case T_float :
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() >= ((IJavaPrimitiveValue) rightOperand).getFloatValue();
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() >= ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() >= ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return false;
+ case T_double:
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() >= ((IJavaPrimitiveValue) rightOperand)
+ .getDoubleValue();
+ case T_float:
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue() >= ((IJavaPrimitiveValue) rightOperand)
+ .getFloatValue();
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() >= ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() >= ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return false;
}
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -60,6 +71,7 @@ public class GreaterEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -67,12 +79,15 @@ public class GreaterEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.GreaterEqualOperator_operator_1;
+ return InstructionsEvaluationMessages.GreaterEqualOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterOperator.java
index 8e71c8495..0b3926cf2 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/GreaterOperator.java
@@ -21,38 +21,49 @@ public class GreaterOperator extends BinaryOperator {
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
switch (getInternResultType()) {
- case T_double :
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() > ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
- case T_float :
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() > ((IJavaPrimitiveValue) rightOperand).getFloatValue();
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() > ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() > ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return false;
+ case T_double:
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() > ((IJavaPrimitiveValue) rightOperand)
+ .getDoubleValue();
+ case T_float:
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue() > ((IJavaPrimitiveValue) rightOperand)
+ .getFloatValue();
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() > ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() > ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return false;
}
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -60,6 +71,7 @@ public class GreaterOperator extends BinaryOperator {
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -67,12 +79,15 @@ public class GreaterOperator extends BinaryOperator {
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.GreaterOperator______operator_1;
+ return InstructionsEvaluationMessages.GreaterOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java
index d766fd5f7..341602248 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -21,35 +19,48 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDINullValue;
+import com.ibm.icu.text.MessageFormat;
+
public class InstanceOfOperator extends CompoundInstruction {
- public static final String IS_INSTANCE= "isInstance"; //$NON-NLS-1$
- public static final String IS_INSTANCE_SIGNATURE= "(Ljava/lang/Object;)Z"; //$NON-NLS-1$
-
+ public static final String IS_INSTANCE = "isInstance"; //$NON-NLS-1$
+ public static final String IS_INSTANCE_SIGNATURE = "(Ljava/lang/Object;)Z"; //$NON-NLS-1$
+
public InstanceOfOperator(int start) {
super(start);
}
-
+
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaType type= (IJavaType)pop();
- IJavaValue value= popValue();
+ IJavaType type = (IJavaType) pop();
+ IJavaValue value = popValue();
if (value instanceof JDINullValue) {
pushNewValue(false);
return;
}
- IJavaObject object= (IJavaObject)value;
+ IJavaObject object = (IJavaObject) value;
- IJavaObject classObject= getClassObject(type);
+ IJavaObject classObject = getClassObject(type);
if (classObject == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.InstanceOfOperator_No_class_object, new String[]{type.getName()}), null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ MessageFormat
+ .format(InstructionsEvaluationMessages.InstanceOfOperator_No_class_object,
+ new String[] { type.getName() }),
+ null));
}
- push(classObject.sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE, new IJavaValue[] {object}, getContext().getThread(), false));
+ push(classObject.sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE,
+ new IJavaValue[] { object }, getContext().getThread(), false));
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.InstanceOfOperator__instanceof___operator_3;
+ return InstructionsEvaluationMessages.InstanceOfOperator__instanceof___operator_3;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Instruction.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Instruction.java
index efc9009c5..40f0e118d 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Instruction.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Instruction.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -40,7 +39,7 @@ public abstract class Instruction {
public abstract int getSize();
public void setInterpreter(Interpreter interpreter) {
- fInterpreter= interpreter;
+ fInterpreter = interpreter;
}
public void setLastValue(IJavaValue value) {
@@ -54,6 +53,7 @@ public abstract class Instruction {
public static int getBinaryPromotionType(int left, int right) {
return fTypeTable[left][right];
}
+
public abstract void execute() throws CoreException;
protected IRuntimeContext getContext() {
@@ -66,7 +66,7 @@ public abstract class Instruction {
/**
* Return the internal variable with the given name.
- *
+ *
* @see Interpreter#getInternalVariable(String)
*/
protected IVariable getInternalVariable(String name) {
@@ -74,22 +74,22 @@ public abstract class Instruction {
}
/**
- * Create and return a new internal variable with the given name
- * and the given type.
- *
+ * Create and return a new internal variable with the given name and the
+ * given type.
+ *
* @see Interpreter#createInternalVariable(String, String)
*/
- protected IVariable createInternalVariable(String name, IJavaType referencType) {
+ protected IVariable createInternalVariable(String name,
+ IJavaType referencType) {
return fInterpreter.createInternalVariable(name, referencType);
}
-
/**
* Answers the instance of Class that the given type represents.
*/
protected IJavaObject getClassObject(IJavaType type) throws CoreException {
if (type instanceof IJavaReferenceType) {
- return ((IJavaReferenceType)type).getClassObject();
+ return ((IJavaReferenceType) type).getClassObject();
}
return null;
}
@@ -109,9 +109,9 @@ public abstract class Instruction {
protected IJavaValue popValue() throws CoreException {
Object element = fInterpreter.pop();
if (element instanceof IJavaVariable) {
- return (IJavaValue)((IJavaVariable)element).getValue();
+ return (IJavaValue) ((IJavaVariable) element).getValue();
}
- return (IJavaValue)element;
+ return (IJavaValue) element;
}
protected void pushNewValue(boolean value) {
@@ -198,54 +198,65 @@ public abstract class Instruction {
return fTypeTable[typeId][T_int];
}
- protected IJavaType getType(String qualifiedName) throws CoreException {
- // Force the class to be loaded, and record the class reference
- // for later use if there are multiple classes with the same name.
- IJavaClassObject classReference= getContext().classForName(qualifiedName);
- // Found many classes, look for the right one for this scope.
- if (classReference == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Instruction_No_type, new String[]{qualifiedName}), null));
- }
- return classReference.getInstanceType();
- }
-
- /**
- * Returns the primitive type with the given name.
- *
- * @param name type name, for example - "int"
- * @return primitive type
- * @throws CoreException
- */
- protected IJavaType getPrimitiveType(String name) throws CoreException {
- IJavaReferenceType type = null;
- if ("boolean".equals(name)) { //$NON-NLS-1$
- type = (IJavaReferenceType) getType("java.lang.Boolean"); //$NON-NLS-1$
- } else if ("byte".equals(name)) { //$NON-NLS-1$
- type = (IJavaReferenceType) getType("java.lang.Byte"); //$NON-NLS-1$
- } else if ("char".equals(name)) { //$NON-NLS-1$
- type = (IJavaReferenceType) getType("java.lang.Character"); //$NON-NLS-1$
- } else if ("double".equals(name)) { //$NON-NLS-1$
- type = (IJavaReferenceType) getType("java.lang.Double"); //$NON-NLS-1$
- } else if ("float".equals(name)) { //$NON-NLS-1$
- type = (IJavaReferenceType) getType("java.lang.Float"); //$NON-NLS-1$
- } else if ("int".equals(name)) { //$NON-NLS-1$
+ protected IJavaType getType(String qualifiedName) throws CoreException {
+ // Force the class to be loaded, and record the class reference
+ // for later use if there are multiple classes with the same name.
+ IJavaClassObject classReference = getContext().classForName(
+ qualifiedName);
+ // Found many classes, look for the right one for this scope.
+ if (classReference == null) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ MessageFormat.format(
+ InstructionsEvaluationMessages.Instruction_No_type,
+ new String[] { qualifiedName }), null));
+ }
+ return classReference.getInstanceType();
+ }
+
+ /**
+ * Returns the primitive type with the given name.
+ *
+ * @param name
+ * type name, for example - "int"
+ * @return primitive type
+ * @throws CoreException
+ */
+ protected IJavaType getPrimitiveType(String name) throws CoreException {
+ IJavaReferenceType type = null;
+ if ("boolean".equals(name)) { //$NON-NLS-1$
+ type = (IJavaReferenceType) getType("java.lang.Boolean"); //$NON-NLS-1$
+ } else if ("byte".equals(name)) { //$NON-NLS-1$
+ type = (IJavaReferenceType) getType("java.lang.Byte"); //$NON-NLS-1$
+ } else if ("char".equals(name)) { //$NON-NLS-1$
+ type = (IJavaReferenceType) getType("java.lang.Character"); //$NON-NLS-1$
+ } else if ("double".equals(name)) { //$NON-NLS-1$
+ type = (IJavaReferenceType) getType("java.lang.Double"); //$NON-NLS-1$
+ } else if ("float".equals(name)) { //$NON-NLS-1$
+ type = (IJavaReferenceType) getType("java.lang.Float"); //$NON-NLS-1$
+ } else if ("int".equals(name)) { //$NON-NLS-1$
type = (IJavaReferenceType) getType("java.lang.Integer"); //$NON-NLS-1$
} else if ("long".equals(name)) { //$NON-NLS-1$
type = (IJavaReferenceType) getType("java.lang.Long"); //$NON-NLS-1$
} else if ("short".equals(name)) { //$NON-NLS-1$
type = (IJavaReferenceType) getType("java.lang.Short"); //$NON-NLS-1$
- } else if ("void".equals(name)) { //$NON-NLS-1$
- type = (IJavaReferenceType) getType("java.lang.Void"); //$NON-NLS-1$
- }
- if (type != null) {
- IJavaFieldVariable field = type.getField("TYPE"); //$NON-NLS-1$
+ } else if ("void".equals(name)) { //$NON-NLS-1$
+ type = (IJavaReferenceType) getType("java.lang.Void"); //$NON-NLS-1$
+ }
+ if (type != null) {
+ IJavaFieldVariable field = type.getField("TYPE"); //$NON-NLS-1$
IJavaClassObject clazz = (IJavaClassObject) field.getValue();
return clazz.getInstanceType();
- }
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Instruction_No_type, new String[]{name}), null));
- }
+ }
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ MessageFormat.format(
+ InstructionsEvaluationMessages.Instruction_No_type,
+ new String[] { name }), null));
+ }
- protected IJavaArrayType getArrayType(String typeSignature, int dimension) throws CoreException {
+ protected IJavaArrayType getArrayType(String typeSignature, int dimension)
+ throws CoreException {
String qualifiedName = RuntimeSignature.toString(typeSignature);
String braces = ""; //$NON-NLS-1$
for (int i = 0; i < dimension; i++) {
@@ -255,21 +266,24 @@ public abstract class Instruction {
String signature = braces + typeSignature;
// Force the class to be loaded, and record the class reference
// for later use if there are multiple classes with the same name.
- IJavaObject classReference= getContext().classForName(signature);
+ IJavaObject classReference = getContext().classForName(signature);
if (classReference == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Instruction_No_type, new String[]{qualifiedName}), null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ MessageFormat.format(
+ InstructionsEvaluationMessages.Instruction_No_type,
+ new String[] { qualifiedName }), null));
}
- IJavaType[] types= getVM().getJavaTypes(qualifiedName);
+ IJavaType[] types = getVM().getJavaTypes(qualifiedName);
checkTypes(types, qualifiedName);
if (types.length == 1) {
// Found only one class.
- return (IJavaArrayType)types[0];
+ return (IJavaArrayType) types[0];
}
// Found many classes, look for the right one for this scope.
- for(int i= 0, length= types.length; i < length; i++) {
- IJavaType type= types[i];
+ for (IJavaType type : types) {
if (classReference.equals(getClassObject(type))) {
- return (IJavaArrayType)type;
+ return (IJavaArrayType) type;
}
}
@@ -278,43 +292,81 @@ public abstract class Instruction {
// call, but none of them were the class that was returned in
// the classForName call.
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Instruction_No_type, new String[]{qualifiedName}), null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ MessageFormat.format(
+ InstructionsEvaluationMessages.Instruction_No_type,
+ new String[] { qualifiedName }), null));
}
- protected void checkTypes(IJavaType[] types, String qualifiedName) throws CoreException {
+ protected void checkTypes(IJavaType[] types, String qualifiedName)
+ throws CoreException {
if (types == null || types.length == 0) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.Instruction_No_type, new String[]{qualifiedName}), null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ MessageFormat.format(
+ InstructionsEvaluationMessages.Instruction_No_type,
+ new String[] { qualifiedName }), null));
}
}
- static public final int T_undefined =0;
- static public final int T_Object =1;
- static public final int T_char =2;
- static public final int T_byte =3;
- static public final int T_short =4;
- static public final int T_boolean =5;
- static public final int T_void =6;
- static public final int T_long =7;
- static public final int T_double =8;
- static public final int T_float =9;
- static public final int T_int =10;
- static public final int T_String =11;
- static public final int T_null =12;
-
- private static final int[][] fTypeTable= {
-/* undefined */ {T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined},
-/* object */ {T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_String, T_undefined},
-/* char */ {T_undefined, T_undefined, T_int, T_int, T_int, T_undefined, T_undefined, T_long, T_double, T_float, T_int, T_String, T_undefined},
-/* byte */ {T_undefined, T_undefined, T_int, T_int, T_int, T_undefined, T_undefined, T_long, T_double, T_float, T_int, T_String, T_undefined},
-/* short */ {T_undefined, T_undefined, T_int, T_int, T_int, T_undefined, T_undefined, T_long, T_double, T_float, T_int, T_String, T_undefined},
-/* boolean */ {T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_boolean, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_String, T_undefined},
-/* void */ {T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined},
-/* long */ {T_undefined, T_undefined, T_long, T_long, T_long, T_undefined, T_undefined, T_long, T_double, T_float, T_long, T_String, T_undefined},
-/* double */ {T_undefined, T_undefined, T_double, T_double, T_double, T_undefined, T_undefined, T_double, T_double, T_double, T_double, T_String, T_undefined},
-/* float */ {T_undefined, T_undefined, T_float, T_float, T_float, T_undefined, T_undefined, T_float, T_double, T_float, T_float, T_String, T_undefined},
-/* int */ {T_undefined, T_undefined, T_int, T_int, T_int, T_undefined, T_undefined, T_long, T_double, T_float, T_int, T_String, T_undefined},
-/* String */ {T_undefined, T_String, T_String, T_String, T_String, T_String, T_undefined, T_String, T_String, T_String, T_String, T_String, T_String},
-/* null */ {T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_undefined, T_String, T_undefined},
- };
+ static public final int T_undefined = 0;
+ static public final int T_Object = 1;
+ static public final int T_char = 2;
+ static public final int T_byte = 3;
+ static public final int T_short = 4;
+ static public final int T_boolean = 5;
+ static public final int T_void = 6;
+ static public final int T_long = 7;
+ static public final int T_double = 8;
+ static public final int T_float = 9;
+ static public final int T_int = 10;
+ static public final int T_String = 11;
+ static public final int T_null = 12;
+
+ private static final int[][] fTypeTable = {
+ /* undefined */{ T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined },
+ /* object */{ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_String,
+ T_undefined },
+ /* char */{ T_undefined, T_undefined, T_int, T_int, T_int,
+ T_undefined, T_undefined, T_long, T_double, T_float, T_int,
+ T_String, T_undefined },
+ /* byte */{ T_undefined, T_undefined, T_int, T_int, T_int,
+ T_undefined, T_undefined, T_long, T_double, T_float, T_int,
+ T_String, T_undefined },
+ /* short */{ T_undefined, T_undefined, T_int, T_int, T_int,
+ T_undefined, T_undefined, T_long, T_double, T_float, T_int,
+ T_String, T_undefined },
+ /* boolean */{ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_boolean, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_String,
+ T_undefined },
+ /* void */{ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined },
+ /* long */{ T_undefined, T_undefined, T_long, T_long, T_long,
+ T_undefined, T_undefined, T_long, T_double, T_float,
+ T_long, T_String, T_undefined },
+ /* double */{ T_undefined, T_undefined, T_double, T_double,
+ T_double, T_undefined, T_undefined, T_double, T_double,
+ T_double, T_double, T_String, T_undefined },
+ /* float */{ T_undefined, T_undefined, T_float, T_float, T_float,
+ T_undefined, T_undefined, T_float, T_double, T_float,
+ T_float, T_String, T_undefined },
+ /* int */{ T_undefined, T_undefined, T_int, T_int, T_int,
+ T_undefined, T_undefined, T_long, T_double, T_float, T_int,
+ T_String, T_undefined },
+ /* String */{ T_undefined, T_String, T_String, T_String, T_String,
+ T_String, T_undefined, T_String, T_String, T_String,
+ T_String, T_String, T_String },
+ /* null */{ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_undefined,
+ T_undefined, T_undefined, T_undefined, T_String,
+ T_undefined }, };
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionSequence.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionSequence.java
index 036cef283..d6ae7c0a5 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionSequence.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionSequence.java
@@ -20,97 +20,98 @@ import org.eclipse.jdt.debug.eval.ICompiledExpression;
public class InstructionSequence implements ICompiledExpression {
- private List fInstructions;
+ private List<Instruction> fInstructions;
/**
* A collection of error messages (<code>String</code>) that occurred while
* creating this expression
*/
- private List fErrors;
+ private List<String> fErrors;
private String fSnippet;
private CoreException fException;
-
+
public InstructionSequence(String snippet) {
- fInstructions= new ArrayList(10);
- fErrors= new ArrayList();
- fSnippet= snippet;
+ fInstructions = new ArrayList<Instruction>(10);
+ fErrors = new ArrayList<String>();
+ fSnippet = snippet;
}
-
+
/**
- * Returns the runtime exception that occurred while evaluating this expression
- * or <code>null</code> if no exception occurred.
+ * Returns the runtime exception that occurred while evaluating this
+ * expression or <code>null</code> if no exception occurred.
*/
public CoreException getException() {
return fException;
}
-
+
/**
* @see ICompiledExpression#getSnippet()
*/
public String getSnippet() {
return fSnippet;
}
-
+
/**
- * Adds the given error to the list of errors that occurred
- * while compiling this instruction sequence
+ * Adds the given error to the list of errors that occurred while compiling
+ * this instruction sequence
*/
public void addError(String error) {
fErrors.add(error);
}
-
+
/**
* @see ICompiledExpression#hasErrors()
*/
public boolean hasErrors() {
return !fErrors.isEmpty();
}
-
+
/**
* @see ICompiledExpression#getErrors()
* @deprecated
*/
+ @Deprecated
public Message[] getErrors() {
- Message[] messages= new Message[fErrors.size()];
- int i= 0;
- for (Iterator iter= fErrors.iterator(); iter.hasNext();) {
- messages[i++]= new Message((String) iter.next(), -1);
+ Message[] messages = new Message[fErrors.size()];
+ int i = 0;
+ for (Iterator<String> iter = fErrors.iterator(); iter.hasNext();) {
+ messages[i++] = new Message(iter.next(), -1);
}
return messages;
}
-
+
/**
* @see org.eclipse.jdt.debug.eval.ICompiledExpression#getErrorMessages()
*/
public String[] getErrorMessages() {
- return (String[])fErrors.toArray(new String[fErrors.size()]);
+ return fErrors.toArray(new String[fErrors.size()]);
}
/**
* Answers the array of instructions, or an empty array.
*/
public Instruction[] getInstructions() {
- int size= fInstructions.size();
- Instruction[] instructions= new Instruction[size];
+ int size = fInstructions.size();
+ Instruction[] instructions = new Instruction[size];
if (size > 0) {
fInstructions.toArray(instructions);
}
return instructions;
}
-
+
/**
* Answer the instruction at the given address
*/
public Instruction getInstruction(int address) {
- return (Instruction)fInstructions.get(address);
+ return fInstructions.get(address);
}
-
+
/**
* Add the given instruction to the end of the list
*/
public void add(Instruction instruction) {
fInstructions.add(instruction);
}
-
+
public int indexOf(Instruction instruction) {
return fInstructions.indexOf(instruction);
}
@@ -123,21 +124,20 @@ public class InstructionSequence implements ICompiledExpression {
}
/**
- * Inserts the instruction at the given index. If
- * the index is less than 0 or greater than the current
- * instruction count, the instruction is added at the end
- * of the sequence.
+ * Inserts the instruction at the given index. If the index is less than 0
+ * or greater than the current instruction count, the instruction is added
+ * at the end of the sequence.
*
* Instructs the instructions to update their program counters.
*/
public void insert(Instruction instruction, int index) {
fInstructions.add(index, instruction);
}
-
+
public Instruction get(int address) {
- return (Instruction)fInstructions.get(address);
+ return fInstructions.get(address);
}
-
+
public int getEnd() {
return fInstructions.size() - 1;
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionsEvaluationMessages.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionsEvaluationMessages.java
index e1e3c9cbb..b54f0fc44 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionsEvaluationMessages.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionsEvaluationMessages.java
@@ -102,6 +102,7 @@ public class InstructionsEvaluationMessages extends NLS {
static {
// load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, InstructionsEvaluationMessages.class);
+ NLS.initializeMessages(BUNDLE_NAME,
+ InstructionsEvaluationMessages.class);
}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Jump.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Jump.java
index f4048793c..a82f6256b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Jump.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Jump.java
@@ -14,14 +14,15 @@ import org.eclipse.core.runtime.CoreException;
public class Jump extends SimpleInstruction {
protected int fOffset;
-
+
public void setOffset(int offset) {
- fOffset= offset;
+ fOffset = offset;
}
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
jump(fOffset);
}
@@ -29,8 +30,9 @@ public class Jump extends SimpleInstruction {
/*
* @see Object#toString()
*/
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.Jump_jump_1;
+ return InstructionsEvaluationMessages.Jump_jump_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftAssignmentOperator.java
index 27795e4b1..2ccd88d2a 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftAssignmentOperator.java
@@ -12,12 +12,14 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
public class LeftShiftAssignmentOperator extends LeftShiftOperator {
- public LeftShiftAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
+ public LeftShiftAssignmentOperator(int variableTypeId, int valueTypeId,
+ int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.LeftShiftAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.LeftShiftAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftOperator.java
index 7fafbcc58..c47f09eb4 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LeftShiftOperator.java
@@ -14,85 +14,103 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaValue;
public class LeftShiftOperator extends BinaryOperator {
- public LeftShiftOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
+ public LeftShiftOperator(int resultId, int leftTypeId, int rightTypeId,
+ int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected LeftShiftOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ protected LeftShiftOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
// unary type promotion on both operands see 5.6.1 and 15.18
switch (fRightTypeId) {
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() << ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- case T_short :
- case T_byte :
- case T_char :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() << ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return 0;
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() << ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ case T_short:
+ case T_byte:
+ case T_char:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() << ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return 0;
}
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
// unary type promotion on both operands see 5.6.1 and 15.18
switch (fRightTypeId) {
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() << ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- case T_short :
- case T_byte :
- case T_char :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() << ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return 0;
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() << ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ case T_short:
+ case T_byte:
+ case T_char:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() << ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return 0;
}
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
protected int getInternResultType() {
// unary type promotion on both operands see 5.6.1 and 15.18
return getUnaryPromotionType(fLeftTypeId);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.LeftShiftOperator_______operator_1;
+ return InstructionsEvaluationMessages.LeftShiftOperator_______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessEqualOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessEqualOperator.java
index b4d2e7b4b..a61bda778 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessEqualOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessEqualOperator.java
@@ -21,38 +21,49 @@ public class LessEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
switch (getInternResultType()) {
- case T_double :
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() <= ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
- case T_float :
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() <= ((IJavaPrimitiveValue) rightOperand).getFloatValue();
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() <= ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() <= ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return false;
+ case T_double:
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() <= ((IJavaPrimitiveValue) rightOperand)
+ .getDoubleValue();
+ case T_float:
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue() <= ((IJavaPrimitiveValue) rightOperand)
+ .getFloatValue();
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() <= ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() <= ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return false;
}
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -60,6 +71,7 @@ public class LessEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -67,11 +79,15 @@ public class LessEqualOperator extends BinaryOperator {
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.LessEqualOperator_operator_1;
+ return InstructionsEvaluationMessages.LessEqualOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessOperator.java
index 44a2c30f1..f77aeda4e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LessOperator.java
@@ -21,38 +21,49 @@ public class LessOperator extends BinaryOperator {
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
switch (getInternResultType()) {
- case T_double :
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() < ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
- case T_float :
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() < ((IJavaPrimitiveValue) rightOperand).getFloatValue();
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() < ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() < ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return false;
+ case T_double:
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() < ((IJavaPrimitiveValue) rightOperand)
+ .getDoubleValue();
+ case T_float:
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue() < ((IJavaPrimitiveValue) rightOperand)
+ .getFloatValue();
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() < ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() < ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return false;
}
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -60,6 +71,7 @@ public class LessOperator extends BinaryOperator {
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
return 0;
}
@@ -67,12 +79,15 @@ public class LessOperator extends BinaryOperator {
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.LessOperator______operator_1;
+ return InstructionsEvaluationMessages.LessOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LocalVariableCreation.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LocalVariableCreation.java
index c2850aaa8..39119ae6f 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LocalVariableCreation.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/LocalVariableCreation.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdi.internal.PrimitiveTypeImpl;
@@ -21,6 +18,7 @@ import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
import org.eclipse.jdt.internal.debug.core.model.JDIType;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.VirtualMachine;
public class LocalVariableCreation extends CompoundInstruction {
@@ -34,17 +32,18 @@ public class LocalVariableCreation extends CompoundInstruction {
* The name of the variable to create.
*/
private String fName;
-
+
/**
- * The signature of the type, or of the element type in case of an array type.
+ * The signature of the type, or of the element type in case of an array
+ * type.
*/
private String fTypeSignature;
-
+
/**
* The dimension of the array type.
*/
private int fDimension;
-
+
/**
* Indicate if there is an initializer for this variable.
*/
@@ -53,46 +52,65 @@ public class LocalVariableCreation extends CompoundInstruction {
/**
* Constructor for LocalVariableCreation.
*
- * @param name the name of the variable to create.
- * @param typeSignature the signature of the type, or of the element type in case of an array type.
- * @param dimension the dimension of the array type, <code>0</code> if it's not an array type.
- * @param isPrimitiveType indicate if the type is a primitive type.
- * @param hasInitializer indicate if there is an initializer for this variable.
+ * @param name
+ * the name of the variable to create.
+ * @param typeSignature
+ * the signature of the type, or of the element type in case of
+ * an array type.
+ * @param dimension
+ * the dimension of the array type, <code>0</code> if it's not an
+ * array type.
+ * @param isPrimitiveType
+ * indicate if the type is a primitive type.
+ * @param hasInitializer
+ * indicate if there is an initializer for this variable.
* @param start
*/
- public LocalVariableCreation(String name, String typeSignature, int dimension, boolean isPrimitiveType, boolean hasInitializer, int start) {
+ public LocalVariableCreation(String name, String typeSignature,
+ int dimension, boolean isPrimitiveType, boolean hasInitializer,
+ int start) {
super(start);
- fName= name;
- fTypeSignature= typeSignature.replace('/', '.');
- fIsPrimitiveType= isPrimitiveType;
- fHasInitializer= hasInitializer;
- fDimension= dimension;
+ fName = name;
+ fTypeSignature = typeSignature.replace('/', '.');
+ fIsPrimitiveType = isPrimitiveType;
+ fHasInitializer = hasInitializer;
+ fDimension = dimension;
}
/**
* @see org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
IJavaType type;
if (fIsPrimitiveType) {
- JDIDebugTarget debugTarget= (JDIDebugTarget)getVM();
+ JDIDebugTarget debugTarget = (JDIDebugTarget) getVM();
VirtualMachine vm = debugTarget.getVM();
if (vm == null) {
- debugTarget.requestFailed(InstructionsEvaluationMessages.LocalVariableCreation_Execution_failed___VM_disconnected__1, null);
- }
- type= JDIType.createType(debugTarget, PrimitiveTypeImpl.create((VirtualMachineImpl)vm, fTypeSignature));
+ debugTarget
+ .requestFailed(
+ InstructionsEvaluationMessages.LocalVariableCreation_Execution_failed___VM_disconnected__1,
+ null);
+ }
+ type = JDIType.createType(debugTarget, PrimitiveTypeImpl.create(
+ (VirtualMachineImpl) vm, fTypeSignature));
} else if (fDimension == 0) {
- type= getType(RuntimeSignature.toString(fTypeSignature)); // See Bug 22165
+ type = getType(RuntimeSignature.toString(fTypeSignature)); // See
+ // Bug
+ // 22165
} else {
- type= getArrayType(fTypeSignature, fDimension);
+ type = getArrayType(fTypeSignature, fDimension);
}
- IVariable var= createInternalVariable(fName, type);
+ IVariable var = createInternalVariable(fName, type);
if (fHasInitializer) {
var.setValue(popValue());
}
}
+ @Override
public String toString() {
- return MessageFormat.format(InstructionsEvaluationMessages.LocalVariableCreation_create_local_variable__0___1___1, new String[]{fName, fTypeSignature});
+ return MessageFormat
+ .format(InstructionsEvaluationMessages.LocalVariableCreation_create_local_variable__0___1___1,
+ new String[] { fName, fTypeSignature });
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusAssignmentOperator.java
index a65e1dbd8..2bd4f2c73 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusAssignmentOperator.java
@@ -12,12 +12,14 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
public class MinusAssignmentOperator extends MinusOperator {
- public MinusAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
+ public MinusAssignmentOperator(int variableTypeId, int valueTypeId,
+ int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.MinusAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.MinusAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusOperator.java
index 1b1cccd37..d487b3193 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MinusOperator.java
@@ -15,58 +15,75 @@ import org.eclipse.jdt.debug.core.IJavaValue;
public class MinusOperator extends BinaryOperator {
- public MinusOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
+ public MinusOperator(int resultId, int leftTypeId, int rightTypeId,
+ int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected MinusOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ protected MinusOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() - ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue()
+ - ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() - ((IJavaPrimitiveValue) rightOperand).getFloatValue();
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue()
+ - ((IJavaPrimitiveValue) rightOperand).getFloatValue();
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() - ((IJavaPrimitiveValue) rightOperand).getIntValue();
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue()
+ - ((IJavaPrimitiveValue) rightOperand).getIntValue();
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() - ((IJavaPrimitiveValue) rightOperand).getLongValue();
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue()
+ - ((IJavaPrimitiveValue) rightOperand).getLongValue();
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.MinusOperator______operator_1;
+ return InstructionsEvaluationMessages.MinusOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyAssignmentOperator.java
index 8c7f7b557..d1fc3565f 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyAssignmentOperator.java
@@ -12,12 +12,14 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
public class MultiplyAssignmentOperator extends MultiplyOperator {
- public MultiplyAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
+ public MultiplyAssignmentOperator(int variableTypeId, int valueTypeId,
+ int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.MultiplyAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.MultiplyAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyOperator.java
index 16abe675e..e4b73e248 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/MultiplyOperator.java
@@ -14,58 +14,75 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaValue;
public class MultiplyOperator extends BinaryOperator {
- public MultiplyOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
+ public MultiplyOperator(int resultId, int leftTypeId, int rightTypeId,
+ int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected MultiplyOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ protected MultiplyOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() * ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue()
+ * ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() * ((IJavaPrimitiveValue) rightOperand).getFloatValue();
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue()
+ * ((IJavaPrimitiveValue) rightOperand).getFloatValue();
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() * ((IJavaPrimitiveValue) rightOperand).getIntValue();
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue()
+ * ((IJavaPrimitiveValue) rightOperand).getIntValue();
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() * ((IJavaPrimitiveValue) rightOperand).getLongValue();
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue()
+ * ((IJavaPrimitiveValue) rightOperand).getLongValue();
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.MultiplyOperator______operator_1;
+ return InstructionsEvaluationMessages.MultiplyOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NoOp.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NoOp.java
index bde25c7cf..5b1335a73 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NoOp.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NoOp.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
public class NoOp extends CompoundInstruction {
public NoOp(int start) {
@@ -20,14 +19,16 @@ public class NoOp extends CompoundInstruction {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() {
}
-
+
/*
* @see Object#toString()
*/
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.NoOp_no_op_1;
+ return InstructionsEvaluationMessages.NoOp_no_op_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NotOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NotOperator.java
index 5b4d1b023..84cc44281 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NotOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/NotOperator.java
@@ -22,13 +22,15 @@ public class NotOperator extends UnaryOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaPrimitiveValue value= (IJavaPrimitiveValue)popValue();
+ IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
pushNewValue(!value.getBooleanValue());
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.NotOperator______operator_1;
+ return InstructionsEvaluationMessages.NotOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrAssignmentOperator.java
index ea40cd62c..b3a20aa0d 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrAssignmentOperator.java
@@ -16,8 +16,9 @@ public class OrAssignmentOperator extends OrOperator {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.OrAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.OrAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrOperator.java
index 71f5b7e06..864b656e5 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/OrOperator.java
@@ -13,60 +13,74 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaValue;
-
public class OrOperator extends BinaryOperator {
public OrOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected OrOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ protected OrOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getBooleanValue() | ((IJavaPrimitiveValue) rightOperand).getBooleanValue();
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getBooleanValue()
+ | ((IJavaPrimitiveValue) rightOperand).getBooleanValue();
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() | ((IJavaPrimitiveValue) rightOperand).getIntValue();
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue()
+ | ((IJavaPrimitiveValue) rightOperand).getIntValue();
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() | ((IJavaPrimitiveValue) rightOperand).getLongValue();
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue()
+ | ((IJavaPrimitiveValue) rightOperand).getLongValue();
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.OrOperator______operator_1;
+ return InstructionsEvaluationMessages.OrOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusAssignmentOperator.java
index 44914d391..6fe49b1f0 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusAssignmentOperator.java
@@ -16,8 +16,9 @@ public class PlusAssignmentOperator extends PlusOperator {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PlusAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.PlusAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusOperator.java
index 3760d8660..13aa93351 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PlusOperator.java
@@ -19,98 +19,118 @@ import org.eclipse.jdt.internal.debug.core.model.JDINullValue;
public class PlusOperator extends BinaryOperator {
- public static final String NULL= "null"; //$NON-NLS-1$
- public static final String TOSTRING_SELECTOR= "toString"; //$NON-NLS-1$
- public static final String TOSTRING_SIGNATURE= "()Ljava/lang/String;"; //$NON-NLS-1$
+ public static final String NULL = "null"; //$NON-NLS-1$
+ public static final String TOSTRING_SELECTOR = "toString"; //$NON-NLS-1$
+ public static final String TOSTRING_SIGNATURE = "()Ljava/lang/String;"; //$NON-NLS-1$
public PlusOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
-
- protected PlusOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+
+ protected PlusOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
-
- private String getString(IJavaValue value, int typeId) throws DebugException {
-
+
+ private String getString(IJavaValue value, int typeId)
+ throws DebugException {
+
// test if value == null
if (value instanceof JDINullValue) {
return NULL;
}
-
+
if (value instanceof IJavaObject) {
if (typeId == T_String) {
return value.getValueString();
}
- return ((IJavaObject) value).sendMessage(TOSTRING_SELECTOR, TOSTRING_SIGNATURE, null, getContext().getThread(), null).getValueString();
+ return ((IJavaObject) value).sendMessage(TOSTRING_SELECTOR,
+ TOSTRING_SIGNATURE, null, getContext().getThread(), null)
+ .getValueString();
}
-
- IJavaPrimitiveValue primitiveValue= (IJavaPrimitiveValue)value;
+
+ IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
switch (typeId) {
- case T_boolean:
- return Boolean.valueOf(primitiveValue.getBooleanValue()).toString();
- case T_byte:
- return new Integer(primitiveValue.getByteValue()).toString();
- case T_char:
- return new Character(primitiveValue.getCharValue()).toString();
- case T_double:
- return new Double(primitiveValue.getDoubleValue()).toString();
- case T_float:
- return new Float(primitiveValue.getFloatValue()).toString();
- case T_int:
- return new Integer(primitiveValue.getIntValue()).toString();
- case T_long:
- return new Long(primitiveValue.getLongValue()).toString();
- case T_short:
- return new Integer(primitiveValue.getShortValue()).toString();
+ case T_boolean:
+ return Boolean.valueOf(primitiveValue.getBooleanValue()).toString();
+ case T_byte:
+ return new Integer(primitiveValue.getByteValue()).toString();
+ case T_char:
+ return new Character(primitiveValue.getCharValue()).toString();
+ case T_double:
+ return new Double(primitiveValue.getDoubleValue()).toString();
+ case T_float:
+ return new Float(primitiveValue.getFloatValue()).toString();
+ case T_int:
+ return new Integer(primitiveValue.getIntValue()).toString();
+ case T_long:
+ return new Long(primitiveValue.getLongValue()).toString();
+ case T_short:
+ return new Integer(primitiveValue.getShortValue()).toString();
}
return NULL;
- }
-
+ }
+
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue)leftOperand).getDoubleValue() + ((IJavaPrimitiveValue)rightOperand).getDoubleValue();
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue()
+ + ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue)leftOperand).getFloatValue() + ((IJavaPrimitiveValue)rightOperand).getFloatValue();
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue()
+ + ((IJavaPrimitiveValue) rightOperand).getFloatValue();
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue)leftOperand).getIntValue() + ((IJavaPrimitiveValue)rightOperand).getIntValue();
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue()
+ + ((IJavaPrimitiveValue) rightOperand).getIntValue();
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue)leftOperand).getLongValue() + ((IJavaPrimitiveValue)rightOperand).getLongValue();
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue()
+ + ((IJavaPrimitiveValue) rightOperand).getLongValue();
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
- return getString(leftOperand, fLeftTypeId) + getString(rightOperand, fRightTypeId);
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) throws CoreException {
+ return getString(leftOperand, fLeftTypeId)
+ + getString(rightOperand, fRightTypeId);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PlusOperator______operator_2;
+ return InstructionsEvaluationMessages.PlusOperator______operator_2;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Pop.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Pop.java
index 54596fbea..0720098ef 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Pop.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Pop.java
@@ -10,21 +10,21 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
public class Pop extends Instruction {
private int fSize;
-
+
/**
* @param start
*/
public Pop(int size) {
- fSize= size;
+ fSize = size;
}
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() {
pop();
}
@@ -32,13 +32,19 @@ public class Pop extends Instruction {
/*
* @see Object#toString()
*/
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.Pop_pop_1;
+ return InstructionsEvaluationMessages.Pop_pop_1;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#getSize()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#getSize
+ * ()
*/
+ @Override
public int getSize() {
return fSize;
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixMinusMinusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixMinusMinusOperator.java
index f5eb03268..ff1d5d123 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixMinusMinusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixMinusMinusOperator.java
@@ -15,7 +15,7 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
public class PostfixMinusMinusOperator extends XfixOperator {
-
+
public PostfixMinusMinusOperator(int variableTypeId, int start) {
super(variableTypeId, start);
}
@@ -23,37 +23,46 @@ public class PostfixMinusMinusOperator extends XfixOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
IJavaVariable variable = (IJavaVariable) pop();
push(variable.getValue());
-
+
switch (fVariableTypeId) {
- case T_byte :
- variable.setValue(newValue((byte)(((IJavaPrimitiveValue)variable.getValue()).getByteValue() - 1)));
- break;
- case T_short :
- variable.setValue(newValue((short)(((IJavaPrimitiveValue)variable.getValue()).getShortValue() - 1)));
- break;
- case T_char :
- variable.setValue(newValue((char)(((IJavaPrimitiveValue)variable.getValue()).getCharValue() - 1)));
- break;
- case T_int :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getIntValue() - 1));
- break;
- case T_long :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getLongValue() - 1));
- break;
- case T_float :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getFloatValue() - 1));
- break;
- case T_double :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getDoubleValue() - 1));
- break;
+ case T_byte:
+ variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
+ .getValue()).getByteValue() - 1)));
+ break;
+ case T_short:
+ variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
+ .getValue()).getShortValue() - 1)));
+ break;
+ case T_char:
+ variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
+ .getValue()).getCharValue() - 1)));
+ break;
+ case T_int:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getIntValue() - 1));
+ break;
+ case T_long:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getLongValue() - 1));
+ break;
+ case T_float:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getFloatValue() - 1));
+ break;
+ case T_double:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getDoubleValue() - 1));
+ break;
}
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PostfixMinusMinusOperator_postfix________operator_1;
+ return InstructionsEvaluationMessages.PostfixMinusMinusOperator_postfix________operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java
index af952d03a..515b6ab01 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java
@@ -15,7 +15,7 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
public class PostfixPlusPlusOperator extends XfixOperator {
-
+
public PostfixPlusPlusOperator(int variableTypeId, int start) {
super(variableTypeId, start);
}
@@ -23,37 +23,46 @@ public class PostfixPlusPlusOperator extends XfixOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
IJavaVariable variable = (IJavaVariable) pop();
push(variable.getValue());
-
+
switch (fVariableTypeId) {
- case T_byte :
- variable.setValue(newValue((byte)(((IJavaPrimitiveValue)variable.getValue()).getByteValue() + 1)));
- break;
- case T_short :
- variable.setValue(newValue((short)(((IJavaPrimitiveValue)variable.getValue()).getShortValue() + 1)));
- break;
- case T_char :
- variable.setValue(newValue((char)(((IJavaPrimitiveValue)variable.getValue()).getCharValue() + 1)));
- break;
- case T_int :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getIntValue() + 1));
- break;
- case T_long :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getLongValue() + 1));
- break;
- case T_float :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getFloatValue() + 1));
- break;
- case T_double :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getDoubleValue() + 1));
- break;
+ case T_byte:
+ variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
+ .getValue()).getByteValue() + 1)));
+ break;
+ case T_short:
+ variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
+ .getValue()).getShortValue() + 1)));
+ break;
+ case T_char:
+ variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
+ .getValue()).getCharValue() + 1)));
+ break;
+ case T_int:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getIntValue() + 1));
+ break;
+ case T_long:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getLongValue() + 1));
+ break;
+ case T_float:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getFloatValue() + 1));
+ break;
+ case T_double:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getDoubleValue() + 1));
+ break;
}
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PostfixPlusPlusOperator_postfix________operator_1;
+ return InstructionsEvaluationMessages.PostfixPlusPlusOperator_postfix________operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixMinusMinusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixMinusMinusOperator.java
index ea02f73b9..1a9099aeb 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixMinusMinusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixMinusMinusOperator.java
@@ -15,7 +15,7 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
public class PrefixMinusMinusOperator extends XfixOperator {
-
+
public PrefixMinusMinusOperator(int variableTypeId, int start) {
super(variableTypeId, start);
}
@@ -23,38 +23,47 @@ public class PrefixMinusMinusOperator extends XfixOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
IJavaVariable variable = (IJavaVariable) pop();
-
+
switch (fVariableTypeId) {
- case T_byte :
- variable.setValue(newValue((byte)(((IJavaPrimitiveValue)variable.getValue()).getByteValue() - 1)));
- break;
- case T_short :
- variable.setValue(newValue((short)(((IJavaPrimitiveValue)variable.getValue()).getShortValue() - 1)));
- break;
- case T_char :
- variable.setValue(newValue((char)(((IJavaPrimitiveValue)variable.getValue()).getCharValue() - 1)));
- break;
- case T_int :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getIntValue() - 1));
- break;
- case T_long :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getLongValue() - 1));
- break;
- case T_float :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getFloatValue() - 1));
- break;
- case T_double :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getDoubleValue() - 1));
- break;
+ case T_byte:
+ variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
+ .getValue()).getByteValue() - 1)));
+ break;
+ case T_short:
+ variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
+ .getValue()).getShortValue() - 1)));
+ break;
+ case T_char:
+ variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
+ .getValue()).getCharValue() - 1)));
+ break;
+ case T_int:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getIntValue() - 1));
+ break;
+ case T_long:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getLongValue() - 1));
+ break;
+ case T_float:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getFloatValue() - 1));
+ break;
+ case T_double:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getDoubleValue() - 1));
+ break;
}
push(variable.getValue());
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PrefixMinusMinusOperator_prefix________operator_1;
+ return InstructionsEvaluationMessages.PrefixMinusMinusOperator_prefix________operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixPlusPlusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixPlusPlusOperator.java
index 818b553d2..33200c4e1 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixPlusPlusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PrefixPlusPlusOperator.java
@@ -15,7 +15,7 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
public class PrefixPlusPlusOperator extends XfixOperator {
-
+
public PrefixPlusPlusOperator(int variableTypeId, int start) {
super(variableTypeId, start);
}
@@ -23,38 +23,47 @@ public class PrefixPlusPlusOperator extends XfixOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
IJavaVariable variable = (IJavaVariable) pop();
-
+
switch (fVariableTypeId) {
- case T_byte :
- variable.setValue(newValue((byte)(((IJavaPrimitiveValue)variable.getValue()).getByteValue() + 1)));
- break;
- case T_short :
- variable.setValue(newValue((short)(((IJavaPrimitiveValue)variable.getValue()).getShortValue() + 1)));
- break;
- case T_char :
- variable.setValue(newValue((char)(((IJavaPrimitiveValue)variable.getValue()).getCharValue() + 1)));
- break;
- case T_int :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getIntValue() + 1));
- break;
- case T_long :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getLongValue() + 1));
- break;
- case T_float :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getFloatValue() + 1));
- break;
- case T_double :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getDoubleValue() + 1));
- break;
+ case T_byte:
+ variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
+ .getValue()).getByteValue() + 1)));
+ break;
+ case T_short:
+ variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
+ .getValue()).getShortValue() + 1)));
+ break;
+ case T_char:
+ variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
+ .getValue()).getCharValue() + 1)));
+ break;
+ case T_int:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getIntValue() + 1));
+ break;
+ case T_long:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getLongValue() + 1));
+ break;
+ case T_float:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getFloatValue() + 1));
+ break;
+ case T_double:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getDoubleValue() + 1));
+ break;
}
push(variable.getValue());
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PrefixPlusPlusOperator_prefix________operator_1;
+ return InstructionsEvaluationMessages.PrefixPlusPlusOperator_prefix________operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayLength.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayLength.java
index 4d8820fbd..3678d1aa5 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayLength.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayLength.java
@@ -10,27 +10,27 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.debug.core.IJavaArray;
-
+
/**
* Pops an array object off the stack, and pushes its length.
*/
public class PushArrayLength extends ArrayAccess {
-
+
public PushArrayLength(int start) {
super(start);
}
-
+
+ @Override
public void execute() throws CoreException {
- IJavaArray receiver= popArray();
- int length= receiver.getLength();
+ IJavaArray receiver = popArray();
+ int length = receiver.getLength();
pushNewValue(length);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushArrayLength_push_array_length__1;
+ return InstructionsEvaluationMessages.PushArrayLength_push_array_length__1;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayType.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayType.java
index 87b30056b..93cf0323b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayType.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushArrayType.java
@@ -15,21 +15,21 @@ import org.eclipse.core.runtime.CoreException;
public class PushArrayType extends ArrayInstruction {
private String fTypeSignature;
-
+
private int fDimension;
-
+
public PushArrayType(String typeSignature, int dimension, int start) {
super(start);
fTypeSignature = typeSignature;
fDimension = dimension;
}
-
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- push(getArrayType(fTypeSignature.replace('/','.'), fDimension));
+ push(getArrayType(fTypeSignature.replace('/', '.'), fDimension));
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushBoolean.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushBoolean.java
index 0d6df388b..fa8c86a1a 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushBoolean.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushBoolean.java
@@ -10,23 +10,23 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
/**
* Pushes a boolean literal onto the stack.
*/
public class PushBoolean extends SimpleInstruction {
private boolean fValue;
-
+
public PushBoolean(boolean value) {
- fValue= value;
+ fValue = value;
}
-
+
+ @Override
public void execute() {
pushNewValue(fValue);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushBoolean_push__1 + fValue;
+ return InstructionsEvaluationMessages.PushBoolean_push__1 + fValue;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushChar.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushChar.java
index d06f662eb..576439a3a 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushChar.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushChar.java
@@ -10,25 +10,25 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
/**
* Pushes a char literal onto the stack.
*/
public class PushChar extends SimpleInstruction {
-
+
private char fValue;
-
+
public PushChar(char value) {
fValue = value;
}
-
+
+ @Override
public void execute() {
pushNewValue(fValue);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushChar_push__1 + fValue;
+ return InstructionsEvaluationMessages.PushChar_push__1 + fValue;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushClassLiteralValue.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushClassLiteralValue.java
index 5c452f0fb..68ff72a7b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushClassLiteralValue.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushClassLiteralValue.java
@@ -20,20 +20,22 @@ public class PushClassLiteralValue extends CompoundInstruction {
public PushClassLiteralValue(int start) {
super(start);
}
-
+
/**
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaType type = (IJavaType)pop();
+ IJavaType type = (IJavaType) pop();
push(getClassObject(type));
}
/*
* @see Object#toString()
*/
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushClassLiteralValue_push_class_literal_value_1;
+ return InstructionsEvaluationMessages.PushClassLiteralValue_push_class_literal_value_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushDouble.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushDouble.java
index d73030fae..d7aa82ca9 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushDouble.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushDouble.java
@@ -10,25 +10,25 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
/**
* Pushes a double literal onto the stack.
*/
public class PushDouble extends SimpleInstruction {
-
+
private double fValue;
-
+
public PushDouble(double value) {
fValue = value;
}
-
+
+ @Override
public void execute() {
pushNewValue(fValue);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushDouble_push__1 + fValue;
+ return InstructionsEvaluationMessages.PushDouble_push__1 + fValue;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFieldVariable.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFieldVariable.java
index f8dad5cae..ca6015b9b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFieldVariable.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFieldVariable.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -21,54 +18,72 @@ import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDINullValue;
import org.eclipse.jdt.internal.debug.core.model.JDIObjectValue;
-
+
+import com.ibm.icu.text.MessageFormat;
+
/**
- * Pops an object off the stack, and pushes the value
- * of one of its fields onto the stack.
+ * Pops an object off the stack, and pushes the value of one of its fields onto
+ * the stack.
*/
public class PushFieldVariable extends CompoundInstruction {
-
+
private String fDeclaringTypeSignature;
-
+
private String fName;
-
- private int fSuperClassLevel;
-
+
+ private int fSuperClassLevel;
+
public PushFieldVariable(String name, int superClassLevel, int start) {
super(start);
- fName= name;
- fSuperClassLevel= superClassLevel;
+ fName = name;
+ fSuperClassLevel = superClassLevel;
}
-
- public PushFieldVariable(String name, String declaringTypeSignature, int start) {
+
+ public PushFieldVariable(String name, String declaringTypeSignature,
+ int start) {
super(start);
- fName= name;
- fDeclaringTypeSignature= declaringTypeSignature;
+ fName = name;
+ fDeclaringTypeSignature = declaringTypeSignature;
}
-
+
+ @Override
public void execute() throws CoreException {
- Object value= popValue();
+ Object value = popValue();
if (value instanceof JDINullValue) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.PushFieldVariable_0, null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
+ InstructionsEvaluationMessages.PushFieldVariable_0, null));
}
- IJavaObject receiver=(IJavaObject) value;
-
- IJavaVariable field= null;
-
+ IJavaObject receiver = (IJavaObject) value;
+
+ IJavaVariable field = null;
+
if (fDeclaringTypeSignature == null) {
- field= ((JDIObjectValue)receiver).getField(fName, fSuperClassLevel);
+ field = ((JDIObjectValue) receiver).getField(fName,
+ fSuperClassLevel);
} else {
- field= receiver.getField(fName, fDeclaringTypeSignature);
+ field = receiver.getField(fName, fDeclaringTypeSignature);
}
-
+
if (field == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.PushFieldVariable_Cannot_find_the_field__0__for_the_object__1__1, new String[] {fName, receiver.toString()}), null)); //
- }
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ MessageFormat
+ .format(InstructionsEvaluationMessages.PushFieldVariable_Cannot_find_the_field__0__for_the_object__1__1,
+ new String[] { fName,
+ receiver.toString() }),
+ null)); //
+ }
push(field);
}
-
+
+ @Override
public String toString() {
- return MessageFormat.format(InstructionsEvaluationMessages.PushFieldVariable_push_field__0__2, new String[] {fName});
+ return MessageFormat
+ .format(InstructionsEvaluationMessages.PushFieldVariable_push_field__0__2,
+ new String[] { fName });
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFloat.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFloat.java
index 224cfdada..528f1545a 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFloat.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushFloat.java
@@ -10,25 +10,25 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
/**
* Pushes a float literal onto the stack.
*/
public class PushFloat extends SimpleInstruction {
-
+
private float fValue;
-
+
public PushFloat(float value) {
fValue = value;
}
-
+
+ @Override
public void execute() {
pushNewValue(fValue);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushFloat_push__1 + fValue;
+ return InstructionsEvaluationMessages.PushFloat_push__1 + fValue;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushInt.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushInt.java
index 8bda715e7..2e9a2e155 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushInt.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushInt.java
@@ -10,25 +10,25 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
/**
* Pushes an int literal onto the stack.
*/
public class PushInt extends SimpleInstruction {
-
+
private int fValue;
-
+
public PushInt(int value) {
fValue = value;
}
-
+
+ @Override
public void execute() {
pushNewValue(fValue);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushInt_push__1 + fValue;
+ return InstructionsEvaluationMessages.PushInt_push__1 + fValue;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLocalVariable.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLocalVariable.java
index 7470c48a6..bb461638e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLocalVariable.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLocalVariable.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -20,53 +17,62 @@ import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext;
-
+
+import com.ibm.icu.text.MessageFormat;
+
/**
- * Pushes the value of a local, instance, or static
- * variable onto the stack.
+ * Pushes the value of a local, instance, or static variable onto the stack.
*/
public class PushLocalVariable extends SimpleInstruction {
-
+
/**
* Name of variable to push.
*/
private String fName;
-
+
public PushLocalVariable(String name) {
fName = name;
}
-
+
+ @Override
public void execute() throws CoreException {
- IVariable internalVariable= getInternalVariable(fName);
+ IVariable internalVariable = getInternalVariable(fName);
if (internalVariable != null) {
push(internalVariable);
return;
}
- IRuntimeContext context= getContext();
+ IRuntimeContext context = getContext();
IJavaVariable[] locals = context.getLocals();
- for (int i = 0; i < locals.length; i++) {
- if (locals[i].getName().equals(getName())) {
- push(locals[i]);
+ for (IJavaVariable local : locals) {
+ if (local.getName().equals(getName())) {
+ push(local);
return;
}
}
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.PushLocalVariable_Cannot_find_the_variable____1, new String[]{fName}), null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ MessageFormat
+ .format(InstructionsEvaluationMessages.PushLocalVariable_Cannot_find_the_variable____1,
+ new String[] { fName }), null));
}
-
+
/**
- * Returns the name of the variable to push
- * onto the stack.
+ * Returns the name of the variable to push onto the stack.
*
- * @return the name of the variable to push
- * onto the stack
+ * @return the name of the variable to push onto the stack
*/
protected String getName() {
return fName;
}
+ @Override
public String toString() {
- return MessageFormat.format(InstructionsEvaluationMessages.PushLocalVariable_push____0___2, new String[]{getName()});
+ return MessageFormat.format(
+ InstructionsEvaluationMessages.PushLocalVariable_push____0___2,
+ new String[] { getName() });
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLong.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLong.java
index 63f020018..d34c4d680 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLong.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushLong.java
@@ -10,25 +10,25 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
/**
* Pushes a long literal onto the stack.
*/
public class PushLong extends SimpleInstruction {
-
+
private long fValue;
-
+
public PushLong(long value) {
fValue = value;
}
-
+
+ @Override
public void execute() {
pushNewValue(fValue);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushLong_push__1 + fValue;
+ return InstructionsEvaluationMessages.PushLong_push__1 + fValue;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushNull.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushNull.java
index c65f48d5b..be784f406 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushNull.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushNull.java
@@ -10,20 +10,18 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-
-
/**
* Pushes the 'null' onto the stack.
*/
public class PushNull extends SimpleInstruction {
-
+
+ @Override
public void execute() {
pushNullValue();
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushNull_push___null__1;
+ return InstructionsEvaluationMessages.PushNull_push___null__1;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushPrimitiveType.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushPrimitiveType.java
index c32517a79..2bea47273 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushPrimitiveType.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushPrimitiveType.java
@@ -10,32 +10,29 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.core.runtime.CoreException;
-
+
/**
* Pushes a primitive type onto the stack.
- *
+ *
* @since 3.4
*/
public class PushPrimitiveType extends SimpleInstruction {
-
+
private String fName;
-
-
+
public PushPrimitiveType(String name) {
- fName= name;
+ fName = name;
}
-
+
+ @Override
public void execute() throws CoreException {
push(getPrimitiveType(fName));
}
-
+
+ @Override
public String toString() {
- return "Push Primitive Type: " + fName; //$NON-NLS-1$
+ return "Push Primitive Type: " + fName; //$NON-NLS-1$
}
-
-
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java
index 1b662e8a6..e6f0ce349 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -21,43 +18,52 @@ import org.eclipse.jdt.debug.core.IJavaInterfaceType;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
-
+
+import com.ibm.icu.text.MessageFormat;
+
/**
- * Pushes the value of the static fields of the given type
- * onto the stack.
+ * Pushes the value of the static fields of the given type onto the stack.
*/
public class PushStaticFieldVariable extends CompoundInstruction {
-
+
private String fFieldName;
-
+
private String fQualifiedTypeName;
-
- public PushStaticFieldVariable(String fieldName, String qualifiedTypeName, int start) {
+
+ public PushStaticFieldVariable(String fieldName, String qualifiedTypeName,
+ int start) {
super(start);
- fFieldName= fieldName;
- fQualifiedTypeName= qualifiedTypeName;
+ fFieldName = fieldName;
+ fQualifiedTypeName = qualifiedTypeName;
}
-
+
+ @Override
public void execute() throws CoreException {
- IJavaType receiver= getType(fQualifiedTypeName);
-
- IJavaVariable field= null;
+ IJavaType receiver = getType(fQualifiedTypeName);
+
+ IJavaVariable field = null;
if (receiver instanceof IJavaInterfaceType) {
- field= ((IJavaInterfaceType)receiver).getField(fFieldName);
+ field = ((IJavaInterfaceType) receiver).getField(fFieldName);
} else if (receiver instanceof IJavaClassType) {
- field= ((IJavaClassType)receiver).getField(fFieldName);
+ field = ((IJavaClassType) receiver).getField(fFieldName);
}
if (field == null) {
- String message= MessageFormat.format(InstructionsEvaluationMessages.PushStaticFieldVariable_Cannot_find_the_field__0__in__1__1, new String[]{fFieldName, fQualifiedTypeName});
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, message, null)); // couldn't find the field
+ String message = MessageFormat
+ .format(InstructionsEvaluationMessages.PushStaticFieldVariable_Cannot_find_the_field__0__in__1__1,
+ new String[] { fFieldName, fQualifiedTypeName });
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, message,
+ null)); // couldn't find the field
}
push(field);
}
-
+
+ @Override
public String toString() {
- return MessageFormat.format(InstructionsEvaluationMessages.PushStaticFieldVariable_push_static_field__0__2, new String[]{fFieldName});
+ return MessageFormat
+ .format(InstructionsEvaluationMessages.PushStaticFieldVariable_push_static_field__0__2,
+ new String[] { fFieldName });
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushString.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushString.java
index 3ec8dadad..8af33b90b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushString.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushString.java
@@ -10,25 +10,25 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
/**
* Pushes a String literal onto the stack.
*/
public class PushString extends SimpleInstruction {
-
+
private String fValue;
-
+
public PushString(String value) {
fValue = value;
}
-
+
+ @Override
public void execute() {
pushNewValue(fValue);
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushString_push__1 + fValue;
+ return InstructionsEvaluationMessages.PushString_push__1 + fValue;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushThis.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushThis.java
index 592ad6f19..8e8b5d6ba 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushThis.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushThis.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -18,37 +17,45 @@ import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDIObjectValue;
import org.eclipse.jdt.internal.debug.eval.ast.engine.IRuntimeContext;
-
+
/**
* Pushes the 'this' object onto the stack.
*/
public class PushThis extends SimpleInstruction {
-
+
private int fEnclosingLevel;
-
+
public PushThis(int enclosingLevel) {
- fEnclosingLevel= enclosingLevel;
+ fEnclosingLevel = enclosingLevel;
}
-
+
+ @Override
public void execute() throws CoreException {
- IRuntimeContext context= getContext();
+ IRuntimeContext context = getContext();
IJavaObject thisInstance = context.getThis();
if (thisInstance == null) {
// static context
push(context.getReceivingType());
} else {
if (fEnclosingLevel != 0) {
- thisInstance= ((JDIObjectValue)thisInstance).getEnclosingObject(fEnclosingLevel);
+ thisInstance = ((JDIObjectValue) thisInstance)
+ .getEnclosingObject(fEnclosingLevel);
if (thisInstance == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.PushThis_Unable_to_retrieve_the_correct_enclosing_instance_of__this__2, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ InstructionsEvaluationMessages.PushThis_Unable_to_retrieve_the_correct_enclosing_instance_of__this__2,
+ null));
}
}
push(thisInstance);
}
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushThis_push___this__1;
+ return InstructionsEvaluationMessages.PushThis_push___this__1;
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushType.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushType.java
index acb004364..6a2316ee1 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushType.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushType.java
@@ -10,30 +10,27 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.core.runtime.CoreException;
-
+
/**
* Pushes a reference type onto the stack.
*/
public class PushType extends SimpleInstruction {
-
+
private String fTypeName;
-
-
+
public PushType(String signature) {
- fTypeName= signature;
+ fTypeName = signature;
}
-
+
+ @Override
public void execute() throws CoreException {
push(getType(fTypeName));
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PushType_push_type__1 + fTypeName;
+ return InstructionsEvaluationMessages.PushType_push_type__1 + fTypeName;
}
-
-
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderAssignmentOperator.java
index 9255ced65..eff60ad4d 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderAssignmentOperator.java
@@ -12,12 +12,14 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
public class RemainderAssignmentOperator extends RemainderOperator {
- public RemainderAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
+ public RemainderAssignmentOperator(int variableTypeId, int valueTypeId,
+ int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.RemainderAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.RemainderAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderOperator.java
index be99d14bb..79ee27acc 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RemainderOperator.java
@@ -18,42 +18,60 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
public class RemainderOperator extends BinaryOperator {
- public RemainderOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
+ public RemainderOperator(int resultId, int leftTypeId, int rightTypeId,
+ int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected RemainderOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ protected RemainderOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getDoubleValue() % ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getDoubleValue()
+ % ((IJavaPrimitiveValue) rightOperand).getDoubleValue();
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getFloatValue() % ((IJavaPrimitiveValue) rightOperand).getFloatValue();
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getFloatValue()
+ % ((IJavaPrimitiveValue) rightOperand).getFloatValue();
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
- protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
- int divisor= ((IJavaPrimitiveValue) rightOperand).getIntValue();
+ @Override
+ protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand)
+ throws CoreException {
+ int divisor = ((IJavaPrimitiveValue) rightOperand).getIntValue();
if (divisor == 0) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.RemainderOperator_Divide_by_zero_1, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ InstructionsEvaluationMessages.RemainderOperator_Divide_by_zero_1,
+ null));
}
return ((IJavaPrimitiveValue) leftOperand).getIntValue() % divisor;
}
@@ -61,10 +79,18 @@ public class RemainderOperator extends BinaryOperator {
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
- protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) throws CoreException {
- long divisor= ((IJavaPrimitiveValue) rightOperand).getLongValue();
+ @Override
+ protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand)
+ throws CoreException {
+ long divisor = ((IJavaPrimitiveValue) rightOperand).getLongValue();
if (divisor == 0) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.RemainderOperator_Divide_by_zero_2, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ InstructionsEvaluationMessages.RemainderOperator_Divide_by_zero_2,
+ null));
}
return ((IJavaPrimitiveValue) leftOperand).getLongValue() % divisor;
}
@@ -72,12 +98,15 @@ public class RemainderOperator extends BinaryOperator {
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.RemainderOperator______operator_3;
+ return InstructionsEvaluationMessages.RemainderOperator______operator_3;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ReturnInstruction.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ReturnInstruction.java
index 7c865f8d1..1048d34a6 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ReturnInstruction.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ReturnInstruction.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-
public class ReturnInstruction extends CompoundInstruction {
/**
* Constructor for ReturnInstruction.
+ *
* @param start
*/
public ReturnInstruction(int start) {
@@ -25,12 +24,14 @@ public class ReturnInstruction extends CompoundInstruction {
/**
* @see Instruction#execute()
*/
+ @Override
public void execute() {
stop();
}
-
+
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.ReturnInstruction_return;
+ return InstructionsEvaluationMessages.ReturnInstruction_return;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftAssignmentOperator.java
index 11b508c58..5a0724457 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftAssignmentOperator.java
@@ -12,12 +12,14 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
public class RightShiftAssignmentOperator extends RightShiftOperator {
- public RightShiftAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
+ public RightShiftAssignmentOperator(int variableTypeId, int valueTypeId,
+ int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.RightShiftAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.RightShiftAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftOperator.java
index 8f24db2c7..39cf86721 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RightShiftOperator.java
@@ -14,85 +14,103 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaValue;
public class RightShiftOperator extends BinaryOperator {
- public RightShiftOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
+ public RightShiftOperator(int resultId, int leftTypeId, int rightTypeId,
+ int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- protected RightShiftOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ protected RightShiftOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
// unary type promotion on both operands see 5.6.1 and 15.18
switch (fRightTypeId) {
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() >> ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- case T_short :
- case T_byte :
- case T_char :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() >> ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return 0;
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() >> ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ case T_short:
+ case T_byte:
+ case T_char:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() >> ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return 0;
}
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
// unary type promotion on both operands see 5.6.1 and 15.18
switch (fRightTypeId) {
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() >> ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- case T_short :
- case T_byte :
- case T_char :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() >> ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return 0;
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() >> ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ case T_short:
+ case T_byte:
+ case T_char:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() >> ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return 0;
}
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
protected int getInternResultType() {
// unary type promotion on both operands see 5.6.1 and 15.18
return getUnaryPromotionType(fLeftTypeId);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.RightShiftOperator_______operator_1;
+ return InstructionsEvaluationMessages.RightShiftOperator_______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RuntimeSignature.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RuntimeSignature.java
index 91fc7dfe5..c0d550047 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RuntimeSignature.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/RuntimeSignature.java
@@ -10,15 +10,12 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
import org.eclipse.jdt.core.compiler.CharOperation;
/**
- * Copy of org.eclipse.jdt.core.Signature. The class is copied here
- * solely for the purpose of commenting out the line:
- * CharOperation.replace(result, C_DOLLAR, C_DOT);
- * in the method toCharArray(char[]).
- * See Bug 22165
+ * Copy of org.eclipse.jdt.core.Signature. The class is copied here solely for
+ * the purpose of commenting out the line: CharOperation.replace(result,
+ * C_DOLLAR, C_DOT); in the method toCharArray(char[]). See Bug 22165
*/
public class RuntimeSignature {
public static final char C_BOOLEAN = 'Z';
@@ -60,12 +57,12 @@ public class RuntimeSignature {
private static final char[] VOID = { 'v', 'o', 'i', 'd' };
public static String toString(String signature)
- throws IllegalArgumentException {
+ throws IllegalArgumentException {
return new String(toCharArray(signature.toCharArray()));
}
public static char[] toCharArray(char[] signature)
- throws IllegalArgumentException {
+ throws IllegalArgumentException {
try {
int sigLength = signature.length;
@@ -80,57 +77,57 @@ public class RuntimeSignature {
resultLength += 2; // []
}
switch (signature[index]) {
- case C_BOOLEAN :
- resultLength += BOOLEAN.length;
- break;
- case C_BYTE :
- resultLength += BYTE.length;
- break;
- case C_CHAR :
- resultLength += CHAR.length;
- break;
- case C_DOUBLE :
- resultLength += DOUBLE.length;
- break;
- case C_FLOAT :
- resultLength += FLOAT.length;
- break;
- case C_INT :
- resultLength += INT.length;
- break;
- case C_LONG :
- resultLength += LONG.length;
- break;
- case C_SHORT :
- resultLength += SHORT.length;
- break;
- case C_VOID :
- resultLength += VOID.length;
- break;
- case C_RESOLVED :
- case C_UNRESOLVED :
- int end =
- CharOperation.indexOf(C_SEMICOLON, signature, index);
- if (end == -1)
- throw new IllegalArgumentException();
- int start = index + 1;
- resultLength += end - start;
- break;
- default :
+ case C_BOOLEAN:
+ resultLength += BOOLEAN.length;
+ break;
+ case C_BYTE:
+ resultLength += BYTE.length;
+ break;
+ case C_CHAR:
+ resultLength += CHAR.length;
+ break;
+ case C_DOUBLE:
+ resultLength += DOUBLE.length;
+ break;
+ case C_FLOAT:
+ resultLength += FLOAT.length;
+ break;
+ case C_INT:
+ resultLength += INT.length;
+ break;
+ case C_LONG:
+ resultLength += LONG.length;
+ break;
+ case C_SHORT:
+ resultLength += SHORT.length;
+ break;
+ case C_VOID:
+ resultLength += VOID.length;
+ break;
+ case C_RESOLVED:
+ case C_UNRESOLVED:
+ int end = CharOperation.indexOf(C_SEMICOLON, signature, index);
+ if (end == -1)
throw new IllegalArgumentException();
+ int start = index + 1;
+ resultLength += end - start;
+ break;
+ default:
+ throw new IllegalArgumentException();
}
char[] result = new char[resultLength];
copyType(signature, 0, result, 0, true);
/**
- * Converts '$' separated type signatures into '.' separated type signature.
- * NOTE: This assumes that the type signature is an inner type signature.
- * This is true in most cases, but someone can define a non-inner type
- * name containing a '$'. However to tell the difference, we would have
- * to resolve the signature, which cannot be done at this point.
+ * Converts '$' separated type signatures into '.' separated type
+ * signature. NOTE: This assumes that the type signature is an inner
+ * type signature. This is true in most cases, but someone can
+ * define a non-inner type name containing a '$'. However to tell
+ * the difference, we would have to resolve the signature, which
+ * cannot be done at this point.
*/
-// CharOperation.replace(result, C_DOLLAR, C_DOT);
+ // CharOperation.replace(result, C_DOLLAR, C_DOT);
return result;
} catch (ArrayIndexOutOfBoundsException e) {
@@ -138,15 +135,12 @@ public class RuntimeSignature {
}
}
- public static char[] toCharArray(
- char[] methodSignature,
- char[] methodName,
- char[][] parameterNames,
- boolean fullyQualifyTypeNames,
- boolean includeReturnType) {
+ public static char[] toCharArray(char[] methodSignature, char[] methodName,
+ char[][] parameterNames, boolean fullyQualifyTypeNames,
+ boolean includeReturnType) {
try {
- int firstParen =
- CharOperation.indexOf(C_PARAM_START, methodSignature);
+ int firstParen = CharOperation.indexOf(C_PARAM_START,
+ methodSignature);
if (firstParen == -1)
throw new IllegalArgumentException();
@@ -158,102 +152,99 @@ public class RuntimeSignature {
int paramCount = 0;
int lastParen = -1;
int resultLength = 0;
- signature : for (int i = firstParen; i < sigLength; i++) {
+ signature: for (int i = firstParen; i < sigLength; i++) {
switch (methodSignature[i]) {
- case C_ARRAY :
- resultLength += 2; // []
- continue signature;
- case C_BOOLEAN :
- resultLength += BOOLEAN.length;
- break;
- case C_BYTE :
- resultLength += BYTE.length;
- break;
- case C_CHAR :
- resultLength += CHAR.length;
- break;
- case C_DOUBLE :
- resultLength += DOUBLE.length;
- break;
- case C_FLOAT :
- resultLength += FLOAT.length;
- break;
- case C_INT :
- resultLength += INT.length;
- break;
- case C_LONG :
- resultLength += LONG.length;
- break;
- case C_SHORT :
- resultLength += SHORT.length;
- break;
- case C_VOID :
- resultLength += VOID.length;
- break;
- case C_RESOLVED :
- case C_UNRESOLVED :
- int end =
- CharOperation.indexOf(
- C_SEMICOLON,
- methodSignature,
- i);
- if (end == -1)
- throw new IllegalArgumentException();
- int start;
- if (fullyQualifyTypeNames) {
+ case C_ARRAY:
+ resultLength += 2; // []
+ continue signature;
+ case C_BOOLEAN:
+ resultLength += BOOLEAN.length;
+ break;
+ case C_BYTE:
+ resultLength += BYTE.length;
+ break;
+ case C_CHAR:
+ resultLength += CHAR.length;
+ break;
+ case C_DOUBLE:
+ resultLength += DOUBLE.length;
+ break;
+ case C_FLOAT:
+ resultLength += FLOAT.length;
+ break;
+ case C_INT:
+ resultLength += INT.length;
+ break;
+ case C_LONG:
+ resultLength += LONG.length;
+ break;
+ case C_SHORT:
+ resultLength += SHORT.length;
+ break;
+ case C_VOID:
+ resultLength += VOID.length;
+ break;
+ case C_RESOLVED:
+ case C_UNRESOLVED:
+ int end = CharOperation.indexOf(C_SEMICOLON,
+ methodSignature, i);
+ if (end == -1)
+ throw new IllegalArgumentException();
+ int start;
+ if (fullyQualifyTypeNames) {
+ start = i + 1;
+ } else {
+ start = CharOperation.lastIndexOf(C_DOT,
+ methodSignature, i, end) + 1;
+ if (start == 0)
start = i + 1;
- } else {
- start =
- CharOperation.lastIndexOf(
- C_DOT,
- methodSignature,
- i,
- end)
- + 1;
- if (start == 0)
- start = i + 1;
- }
- resultLength += end - start;
- i = end;
- break;
- case C_PARAM_START :
- // add space for "("
- resultLength++;
- continue signature;
- case C_PARAM_END :
- lastParen = i;
- if (includeReturnType) {
- if (paramCount > 0) {
- // remove space for ", " that was added with last parameter and remove space that is going to be added for ", " after return type
- // and add space for ") "
- resultLength -= 2;
- } //else
- // remove space that is going to be added for ", " after return type
+ }
+ resultLength += end - start;
+ i = end;
+ break;
+ case C_PARAM_START:
+ // add space for "("
+ resultLength++;
+ continue signature;
+ case C_PARAM_END:
+ lastParen = i;
+ if (includeReturnType) {
+ if (paramCount > 0) {
+ // remove space for ", " that was added with last
+ // parameter and remove space that is going to be
+ // added for ", " after return type
+ // and add space for ") "
+ resultLength -= 2;
+ } // else
+ // remove space that is going to be added for ", "
+ // after return type
// and add space for ") "
// -> noop
- // decrement param count because it is going to be added for return type
- paramCount--;
- continue signature;
- }
- if (paramCount > 0) {
- // remove space for ", " that was added with last parameter and add space for ")"
- resultLength--;
- } else {
- // add space for ")"
- resultLength++;
- }
- break signature;
- default :
- throw new IllegalArgumentException();
+ // decrement param count because it is going to be added
+ // for return type
+ paramCount--;
+ continue signature;
+ }
+ if (paramCount > 0) {
+ // remove space for ", " that was added with last
+ // parameter and add space for ")"
+ resultLength--;
+ } else {
+ // add space for ")"
+ resultLength++;
+ }
+ break signature;
+ default:
+ throw new IllegalArgumentException();
}
resultLength += 2; // add space for ", "
paramCount++;
}
// parameter names
- int parameterNamesLength =
- parameterNames == null ? 0 : parameterNames.length;
+ int parameterNamesLength = parameterNames == null ? 0
+ : parameterNames.length;
for (int i = 0; i < parameterNamesLength; i++) {
resultLength += parameterNames[i].length + 1;
// parameter name + space
@@ -269,13 +260,8 @@ public class RuntimeSignature {
// returned type
int index = 0;
if (includeReturnType) {
- long pos =
- copyType(
- methodSignature,
- lastParen + 1,
- result,
- index,
- fullyQualifyTypeNames);
+ long pos = copyType(methodSignature, lastParen + 1, result,
+ index, fullyQualifyTypeNames);
index = (int) (pos >>> 32);
result[index++] = ' ';
}
@@ -290,12 +276,7 @@ public class RuntimeSignature {
result[index++] = C_PARAM_START;
int sigPos = firstParen + 1;
for (int i = 0; i < paramCount; i++) {
- long pos =
- copyType(
- methodSignature,
- sigPos,
- result,
- index,
+ long pos = copyType(methodSignature, sigPos, result, index,
fullyQualifyTypeNames);
index = (int) (pos >>> 32);
sigPos = (int) pos;
@@ -303,12 +284,8 @@ public class RuntimeSignature {
result[index++] = ' ';
char[] parameterName = parameterNames[i];
int paramLength = parameterName.length;
- System.arraycopy(
- parameterName,
- 0,
- result,
- index,
- paramLength);
+ System.arraycopy(parameterName, 0, result, index,
+ paramLength);
index += paramLength;
}
if (i != paramCount - 1) {
@@ -328,88 +305,78 @@ public class RuntimeSignature {
}
}
- private static long copyType(
- char[] signature,
- int sigPos,
- char[] dest,
- int index,
- boolean fullyQualifyTypeNames) {
+ private static long copyType(char[] signature, int sigPos, char[] dest,
+ int index, boolean fullyQualifyTypeNames) {
int arrayCount = 0;
- loop : while (true) {
+ loop: while (true) {
switch (signature[sigPos++]) {
- case C_ARRAY :
- arrayCount++;
- break;
- case C_BOOLEAN :
- int length = BOOLEAN.length;
- System.arraycopy(BOOLEAN, 0, dest, index, length);
- index += length;
- break loop;
- case C_BYTE :
- length = BYTE.length;
- System.arraycopy(BYTE, 0, dest, index, length);
- index += length;
- break loop;
- case C_CHAR :
- length = CHAR.length;
- System.arraycopy(CHAR, 0, dest, index, length);
- index += length;
- break loop;
- case C_DOUBLE :
- length = DOUBLE.length;
- System.arraycopy(DOUBLE, 0, dest, index, length);
- index += length;
- break loop;
- case C_FLOAT :
- length = FLOAT.length;
- System.arraycopy(FLOAT, 0, dest, index, length);
- index += length;
- break loop;
- case C_INT :
- length = INT.length;
- System.arraycopy(INT, 0, dest, index, length);
- index += length;
- break loop;
- case C_LONG :
- length = LONG.length;
- System.arraycopy(LONG, 0, dest, index, length);
- index += length;
- break loop;
- case C_SHORT :
- length = SHORT.length;
- System.arraycopy(SHORT, 0, dest, index, length);
- index += length;
- break loop;
- case C_VOID :
- length = VOID.length;
- System.arraycopy(VOID, 0, dest, index, length);
- index += length;
- break loop;
- case C_RESOLVED :
- case C_UNRESOLVED :
- int end =
- CharOperation.indexOf(C_SEMICOLON, signature, sigPos);
- if (end == -1)
- throw new IllegalArgumentException();
- int start;
- if (fullyQualifyTypeNames) {
+ case C_ARRAY:
+ arrayCount++;
+ break;
+ case C_BOOLEAN:
+ int length = BOOLEAN.length;
+ System.arraycopy(BOOLEAN, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_BYTE:
+ length = BYTE.length;
+ System.arraycopy(BYTE, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_CHAR:
+ length = CHAR.length;
+ System.arraycopy(CHAR, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_DOUBLE:
+ length = DOUBLE.length;
+ System.arraycopy(DOUBLE, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_FLOAT:
+ length = FLOAT.length;
+ System.arraycopy(FLOAT, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_INT:
+ length = INT.length;
+ System.arraycopy(INT, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_LONG:
+ length = LONG.length;
+ System.arraycopy(LONG, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_SHORT:
+ length = SHORT.length;
+ System.arraycopy(SHORT, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_VOID:
+ length = VOID.length;
+ System.arraycopy(VOID, 0, dest, index, length);
+ index += length;
+ break loop;
+ case C_RESOLVED:
+ case C_UNRESOLVED:
+ int end = CharOperation.indexOf(C_SEMICOLON, signature, sigPos);
+ if (end == -1)
+ throw new IllegalArgumentException();
+ int start;
+ if (fullyQualifyTypeNames) {
+ start = sigPos;
+ } else {
+ start = CharOperation.lastIndexOf(C_DOT, signature, sigPos,
+ end) + 1;
+ if (start == 0)
start = sigPos;
- } else {
- start =
- CharOperation.lastIndexOf(
- C_DOT,
- signature,
- sigPos,
- end)
- + 1;
- if (start == 0)
- start = sigPos;
- }
- length = end - start;
- System.arraycopy(signature, start, dest, index, length);
- sigPos = end + 1;
- index += length;
- break loop;
+ }
+ length = end - start;
+ System.arraycopy(signature, start, dest, index, length);
+ sigPos = end + 1;
+ index += length;
+ break loop;
}
}
while (arrayCount-- > 0) {
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java
index 39e9a9955..c728bc075 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -20,44 +17,54 @@ import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
-
+
+import com.ibm.icu.text.MessageFormat;
+
/**
- * Sends an message to an instance. The arguments are on the
- * stack in reverse order, followed by the receiver.
- * Pushes the result, if any, onto the stack
+ * Sends an message to an instance. The arguments are on the stack in reverse
+ * order, followed by the receiver. Pushes the result, if any, onto the stack
*/
public class SendMessage extends CompoundInstruction {
-
+
private int fArgCount;
private String fSelector;
private String fSignature;
private String fDeclaringType;
-
- public SendMessage(String selector, String signature, int argCount, String declaringType, int start) {
+
+ public SendMessage(String selector, String signature, int argCount,
+ String declaringType, int start) {
super(start);
- fArgCount= argCount;
- fSelector= selector;
- fSignature= signature;
- fDeclaringType= declaringType;
+ fArgCount = argCount;
+ fSelector = selector;
+ fSignature = signature;
+ fDeclaringType = declaringType;
}
-
+
+ @Override
public void execute() throws CoreException {
IJavaValue[] args = new IJavaValue[fArgCount];
// args are in reverse order
- for (int i= fArgCount - 1; i >= 0; i--) {
+ for (int i = fArgCount - 1; i >= 0; i--) {
args[i] = popValue();
}
Object receiver = pop();
IJavaValue result = null;
-
+
if (receiver instanceof IJavaVariable) {
- receiver = ((IJavaVariable) receiver).getValue();
+ receiver = ((IJavaVariable) receiver).getValue();
}
-
+
if (receiver instanceof IJavaObject) {
- result = ((IJavaObject)receiver).sendMessage(fSelector, fSignature, args, getContext().getThread(), fDeclaringType);
+ result = ((IJavaObject) receiver).sendMessage(fSelector,
+ fSignature, args, getContext().getThread(), fDeclaringType);
} else {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.SendMessage_Attempt_to_send_a_message_to_a_non_object_value_1, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ InstructionsEvaluationMessages.SendMessage_Attempt_to_send_a_message_to_a_non_object_value_1,
+ null));
}
setLastValue(result);
if (!fSignature.endsWith(")V")) { //$NON-NLS-1$
@@ -65,9 +72,11 @@ public class SendMessage extends CompoundInstruction {
push(result);
}
}
-
+
+ @Override
public String toString() {
- return MessageFormat.format(InstructionsEvaluationMessages.SendMessage_send_message__0___1__2, new String[]{fSelector,fSignature});
+ return MessageFormat
+ .format(InstructionsEvaluationMessages.SendMessage_send_message__0___1__2,
+ new String[] { fSelector, fSignature });
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendStaticMessage.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendStaticMessage.java
index d0cf0ab68..f8e1484e9 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendStaticMessage.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendStaticMessage.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -20,40 +17,50 @@ import org.eclipse.jdt.debug.core.IJavaClassType;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
-
+
+import com.ibm.icu.text.MessageFormat;
+
/**
- * Sends a message. The arguments are on the
- * stack in reverse order, followed by the receiver.
- * Pushes the result, if any, onto the stack
+ * Sends a message. The arguments are on the stack in reverse order, followed by
+ * the receiver. Pushes the result, if any, onto the stack
*/
public class SendStaticMessage extends CompoundInstruction {
-
+
private int fArgCount;
private String fSelector;
private String fSignature;
private String fTypeName;
-
- public SendStaticMessage(String typeName, String selector, String signature, int argCount, int start) {
+
+ public SendStaticMessage(String typeName, String selector,
+ String signature, int argCount, int start) {
super(start);
- fArgCount= argCount;
- fSelector= selector;
- fSignature= signature;
- fTypeName= typeName;
+ fArgCount = argCount;
+ fSelector = selector;
+ fSignature = signature;
+ fTypeName = typeName;
}
-
+
+ @Override
public void execute() throws CoreException {
IJavaValue[] args = new IJavaValue[fArgCount];
// args are in reverse order
- for (int i= fArgCount - 1; i >= 0; i--) {
+ for (int i = fArgCount - 1; i >= 0; i--) {
args[i] = popValue();
}
-
- IJavaType receiver= getType(fTypeName);
+
+ IJavaType receiver = getType(fTypeName);
IJavaValue result;
if (receiver instanceof IJavaClassType) {
- result= ((IJavaClassType)receiver).sendMessage(fSelector, fSignature, args, getContext().getThread());
+ result = ((IJavaClassType) receiver).sendMessage(fSelector,
+ fSignature, args, getContext().getThread());
} else {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.SendStaticMessage_Cannot_send_a_static_message_to_a_non_class_type_object_1, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ InstructionsEvaluationMessages.SendStaticMessage_Cannot_send_a_static_message_to_a_non_class_type_object_1,
+ null));
}
setLastValue(result);
if (!fSignature.endsWith(")V")) { //$NON-NLS-1$
@@ -61,9 +68,11 @@ public class SendStaticMessage extends CompoundInstruction {
push(result);
}
}
-
+
+ @Override
public String toString() {
- return MessageFormat.format(InstructionsEvaluationMessages.SendStaticMessage_send_static_message__0___1__2, new String[]{fSelector, fSignature});
+ return MessageFormat
+ .format(InstructionsEvaluationMessages.SendStaticMessage_send_static_message__0___1__2,
+ new String[] { fSelector, fSignature });
}
}
-
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SimpleInstruction.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SimpleInstruction.java
index 93e7bbf4b..f10f89101 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SimpleInstruction.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SimpleInstruction.java
@@ -10,11 +10,9 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-
/**
- * A simple instruction cannot contain other instructions
- * so its size is always one.
+ * A simple instruction cannot contain other instructions so its size is always
+ * one.
*/
public abstract class SimpleInstruction extends Instruction {
@@ -24,14 +22,10 @@ public abstract class SimpleInstruction extends Instruction {
protected SimpleInstruction() {
super();
}
-
+
+ @Override
public int getSize() {
return 1;
}
-
-
-
-
-
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ThrowInstruction.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ThrowInstruction.java
index 037f078a2..54e7a10e9 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ThrowInstruction.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/ThrowInstruction.java
@@ -30,8 +30,9 @@ public class ThrowInstruction extends CompoundInstruction {
/**
* @see org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaObject exception= (IJavaObject)popValue();
+ IJavaObject exception = (IJavaObject) popValue();
final IJavaThread javaThread = getContext().getThread();
javaThread.stop(exception);
javaThread.queueRunnable(new Runnable() {
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/TwiddleOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/TwiddleOperator.java
index 92042c7f3..8758deb0e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/TwiddleOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/TwiddleOperator.java
@@ -22,23 +22,25 @@ public class TwiddleOperator extends UnaryOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaPrimitiveValue value= (IJavaPrimitiveValue)popValue();
+ IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
switch (fExpressionTypeId) {
- case T_long:
- pushNewValue(~value.getLongValue());
- break;
- case T_byte:
- case T_short:
- case T_int:
- case T_char:
- pushNewValue(~value.getIntValue());
- break;
+ case T_long:
+ pushNewValue(~value.getLongValue());
+ break;
+ case T_byte:
+ case T_short:
+ case T_int:
+ case T_char:
+ pushNewValue(~value.getIntValue());
+ break;
}
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.TwiddleOperator______operator_1;
+ return InstructionsEvaluationMessages.TwiddleOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryMinusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryMinusOperator.java
index f9ebe5913..34a23bc24 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryMinusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryMinusOperator.java
@@ -22,32 +22,34 @@ public class UnaryMinusOperator extends UnaryOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaPrimitiveValue value= (IJavaPrimitiveValue)popValue();
+ IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
switch (fExpressionTypeId) {
- case T_double:
- pushNewValue(-value.getDoubleValue());
- break;
- case T_float:
- pushNewValue(-value.getFloatValue());
- break;
- case T_long:
- pushNewValue(-value.getLongValue());
- break;
- case T_byte:
- case T_short:
- case T_int:
- case T_char:
- pushNewValue(-value.getIntValue());
- break;
+ case T_double:
+ pushNewValue(-value.getDoubleValue());
+ break;
+ case T_float:
+ pushNewValue(-value.getFloatValue());
+ break;
+ case T_long:
+ pushNewValue(-value.getLongValue());
+ break;
+ case T_byte:
+ case T_short:
+ case T_int:
+ case T_char:
+ pushNewValue(-value.getIntValue());
+ break;
}
}
/*
* @see Object#toString()
*/
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.UnaryMinusOperator_unary_minus_operator_1;
+ return InstructionsEvaluationMessages.UnaryMinusOperator_unary_minus_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryOperator.java
index 2866b5730..297f0f546 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryOperator.java
@@ -12,9 +12,9 @@ package org.eclipse.jdt.internal.debug.eval.ast.instructions;
public abstract class UnaryOperator extends CompoundInstruction {
protected int fExpressionTypeId;
-
+
public UnaryOperator(int expressionTypeId, int start) {
super(start);
- fExpressionTypeId= expressionTypeId;
+ fExpressionTypeId = expressionTypeId;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryPlusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryPlusOperator.java
index b70d45251..a9ed5b97e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryPlusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnaryPlusOperator.java
@@ -22,29 +22,31 @@ public class UnaryPlusOperator extends UnaryOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
- IJavaPrimitiveValue value= (IJavaPrimitiveValue)popValue();
+ IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
switch (fExpressionTypeId) {
- case T_double:
- pushNewValue(+value.getDoubleValue());
- break;
- case T_float:
- pushNewValue(+value.getFloatValue());
- break;
- case T_long:
- pushNewValue(+value.getLongValue());
- break;
- case T_byte:
- case T_short:
- case T_int:
- case T_char:
- pushNewValue(+value.getIntValue());
- break;
+ case T_double:
+ pushNewValue(+value.getDoubleValue());
+ break;
+ case T_float:
+ pushNewValue(+value.getFloatValue());
+ break;
+ case T_long:
+ pushNewValue(+value.getLongValue());
+ break;
+ case T_byte:
+ case T_short:
+ case T_int:
+ case T_char:
+ pushNewValue(+value.getIntValue());
+ break;
}
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.UnaryPlusOperator_unary_plus_operator_1;
+ return InstructionsEvaluationMessages.UnaryPlusOperator_unary_plus_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftAssignmentOperator.java
index 0f01ff16b..76aceb197 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftAssignmentOperator.java
@@ -10,14 +10,17 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-public class UnsignedRightShiftAssignmentOperator extends UnsignedRightShiftOperator {
+public class UnsignedRightShiftAssignmentOperator extends
+ UnsignedRightShiftOperator {
- public UnsignedRightShiftAssignmentOperator(int variableTypeId, int valueTypeId, int start) {
+ public UnsignedRightShiftAssignmentOperator(int variableTypeId,
+ int valueTypeId, int start) {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.UnsignedRightShiftAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.UnsignedRightShiftAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftOperator.java
index ecbc0aa04..216c5bc2c 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/UnsignedRightShiftOperator.java
@@ -14,85 +14,103 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaValue;
public class UnsignedRightShiftOperator extends BinaryOperator {
- public UnsignedRightShiftOperator(int resultId, int leftTypeId, int rightTypeId, int start) {
+ public UnsignedRightShiftOperator(int resultId, int leftTypeId,
+ int rightTypeId, int start) {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- public UnsignedRightShiftOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ public UnsignedRightShiftOperator(int resultId, int leftTypeId,
+ int rightTypeId, boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return false;
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
// unary type promotion on both operands see 5.6.1 and 15.18
switch (fRightTypeId) {
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() >>> ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- case T_short :
- case T_byte :
- case T_char :
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() >>> ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return 0;
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() >>> ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ case T_short:
+ case T_byte:
+ case T_char:
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue() >>> ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return 0;
}
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
// unary type promotion on both operands see 5.6.1 and 15.18
switch (fRightTypeId) {
- case T_long :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() >>> ((IJavaPrimitiveValue) rightOperand).getLongValue();
- case T_int :
- case T_short :
- case T_byte :
- case T_char :
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() >>> ((IJavaPrimitiveValue) rightOperand).getIntValue();
- default :
- return 0;
+ case T_long:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() >>> ((IJavaPrimitiveValue) rightOperand)
+ .getLongValue();
+ case T_int:
+ case T_short:
+ case T_byte:
+ case T_char:
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue() >>> ((IJavaPrimitiveValue) rightOperand)
+ .getIntValue();
+ default:
+ return 0;
}
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
protected int getInternResultType() {
// unary type promotion on both operands see 5.6.1 and 15.18
return getUnaryPromotionType(fLeftTypeId);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.UnsignedRightShiftOperator________operator_1;
+ return InstructionsEvaluationMessages.UnsignedRightShiftOperator________operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Value.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Value.java
index f1686bc36..014211d77 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Value.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/Value.java
@@ -17,14 +17,18 @@ import org.eclipse.core.runtime.CoreException;
*/
public class Value extends CompoundInstruction {
-
public Value(int start) {
super(start);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction#execute
+ * ()
*/
+ @Override
public void execute() throws CoreException {
push(popValue());
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XfixOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XfixOperator.java
index 8f0747ed2..36e2dd341 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XfixOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XfixOperator.java
@@ -10,16 +10,13 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.instructions;
-
-
public abstract class XfixOperator extends CompoundInstruction {
protected int fVariableTypeId;
-
+
public XfixOperator(int variableTypeId, int start) {
super(start);
fVariableTypeId = variableTypeId;
}
-
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorAssignmentOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorAssignmentOperator.java
index d57249bc0..73a22a693 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorAssignmentOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorAssignmentOperator.java
@@ -16,8 +16,9 @@ public class XorAssignmentOperator extends XorOperator {
super(variableTypeId, variableTypeId, valueTypeId, true, start);
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.XorAssignmentOperator_operator_1;
+ return InstructionsEvaluationMessages.XorAssignmentOperator_operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorOperator.java
index 280ff88bf..81ffbd741 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/XorOperator.java
@@ -18,54 +18,69 @@ public class XorOperator extends BinaryOperator {
this(resultId, leftTypeId, rightTypeId, false, start);
}
- public XorOperator(int resultId, int leftTypeId, int rightTypeId, boolean isAssignmentOperator, int start) {
+ public XorOperator(int resultId, int leftTypeId, int rightTypeId,
+ boolean isAssignmentOperator, int start) {
super(resultId, leftTypeId, rightTypeId, isAssignmentOperator, start);
}
/*
* @see BinaryOperator#getBooleanResult(IJavaValue, IJavaValue)
*/
- protected boolean getBooleanResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getBooleanValue() ^ ((IJavaPrimitiveValue) rightOperand).getBooleanValue();
+ @Override
+ protected boolean getBooleanResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
+ return ((IJavaPrimitiveValue) leftOperand).getBooleanValue()
+ ^ ((IJavaPrimitiveValue) rightOperand).getBooleanValue();
}
/*
* @see BinaryOperator#getDoubleResult(IJavaValue, IJavaValue)
*/
- protected double getDoubleResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected double getDoubleResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getFloatResult(IJavaValue, IJavaValue)
*/
- protected float getFloatResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected float getFloatResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return 0;
}
/*
* @see BinaryOperator#getIntResult(IJavaValue, IJavaValue)
*/
+ @Override
protected int getIntResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getIntValue() ^ ((IJavaPrimitiveValue) rightOperand).getIntValue();
+ return ((IJavaPrimitiveValue) leftOperand).getIntValue()
+ ^ ((IJavaPrimitiveValue) rightOperand).getIntValue();
}
/*
* @see BinaryOperator#getLongResult(IJavaValue, IJavaValue)
*/
+ @Override
protected long getLongResult(IJavaValue leftOperand, IJavaValue rightOperand) {
- return ((IJavaPrimitiveValue) leftOperand).getLongValue() ^ ((IJavaPrimitiveValue) rightOperand).getLongValue();
+ return ((IJavaPrimitiveValue) leftOperand).getLongValue()
+ ^ ((IJavaPrimitiveValue) rightOperand).getLongValue();
}
/*
* @see BinaryOperator#getStringResult(IJavaValue, IJavaValue)
*/
- protected String getStringResult(IJavaValue leftOperand, IJavaValue rightOperand) {
+ @Override
+ protected String getStringResult(IJavaValue leftOperand,
+ IJavaValue rightOperand) {
return null;
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.XorOperator______operator_1;
+ return InstructionsEvaluationMessages.XorOperator______operator_1;
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/AbsentInformationException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/AbsentInformationException.java
index 7f85fe6eb..ca0625ed5 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/AbsentInformationException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/AbsentInformationException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/AbsentInformationException.html
+ */
+public class AbsentInformationException extends Exception {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public AbsentInformationException() {
+ }
-public class AbsentInformationException extends Exception {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public AbsentInformationException() { }
public AbsentInformationException(String arg1) {
- super(arg1);
+ super(arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Accessible.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Accessible.java
index 86cf90a1b..5fc51fcf0 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Accessible.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Accessible.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Accessible.html
+ */
public interface Accessible {
public boolean isPackagePrivate();
public boolean isPrivate();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayReference.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayReference.java
index 2a2c93142..e0aa7e8aa 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayReference.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,15 +10,16 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ArrayReference.html
+ */
public interface ArrayReference extends ObjectReference {
public Value getValue(int arg1);
- public List getValues();
- public List getValues(int arg1, int arg2);
+ public List<Value> getValues();
+ public List<Value> getValues(int arg1, int arg2);
public int length();
public void setValue(int arg1, Value arg2) throws InvalidTypeException, ClassNotLoadedException;
- public void setValues(int arg1, List arg2, int arg3, int arg4) throws InvalidTypeException, ClassNotLoadedException;
- public void setValues(List arg1) throws InvalidTypeException, ClassNotLoadedException;
+ public void setValues(int arg1, List<? extends Value> arg2, int arg3, int arg4)throws InvalidTypeException, ClassNotLoadedException;
+ public void setValues(List<? extends Value> arg1) throws InvalidTypeException, ClassNotLoadedException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayType.java
index 2a227a3c9..95214d5c9 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ArrayType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ArrayType.html
+ */
public interface ArrayType extends ReferenceType {
public String componentSignature();
public Type componentType() throws ClassNotLoadedException;
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanType.java
index 393da28db..b35d35627 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/BooleanType.html
+ */
public interface BooleanType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanValue.java
index 844446d5e..1f93c1141 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/BooleanValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/BooleanValue.html
+ */
public interface BooleanValue extends PrimitiveValue {
public boolean equals(Object arg1);
public int hashCode();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Bootstrap.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Bootstrap.java
index 6df6c262a..d259acce1 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Bootstrap.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Bootstrap.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Bootstrap.html
+ */
public class Bootstrap {
static public VirtualMachineManager virtualMachineManager() {
return null;
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteType.java
index c94ce5140..224d65d4f 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ByteType.html
+ */
public interface ByteType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteValue.java
index f3540aec2..07008be0d 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ByteValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface ByteValue extends PrimitiveValue, Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ByteValue.html
+ */
+public interface ByteValue extends PrimitiveValue, Comparable<ByteValue> {
public boolean equals(Object arg1);
public int hashCode();
public byte value();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharType.java
index 53155886b..f868772b2 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/CharType.html
+ */
public interface CharType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharValue.java
index e22c31a2d..942ae8bfa 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/CharValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface CharValue extends PrimitiveValue, Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/CharValue.html
+ */
+public interface CharValue extends PrimitiveValue, Comparable<CharValue> {
public boolean equals(Object arg1);
public int hashCode();
public char value();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassLoaderReference.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassLoaderReference.java
index cb2bacf75..834cb5829 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassLoaderReference.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassLoaderReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ClassLoaderReference.html
+ */
public interface ClassLoaderReference extends ObjectReference {
- public List definedClasses();
- public List visibleClasses();
+ public List<ReferenceType> definedClasses();
+ public List<ReferenceType> visibleClasses();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotLoadedException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotLoadedException.java
index 6fd49fdff..36c4e8756 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotLoadedException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotLoadedException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,24 +9,28 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ClassNotLoadedException.html
+ */
+public class ClassNotLoadedException extends Exception {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
-public class ClassNotLoadedException extends Exception {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
public ClassNotLoadedException(String className) {
name = className;
}
-
+
public ClassNotLoadedException(String className, String msg) {
super(msg);
name = className;
}
-
- public String className() { return name; }
+
+ public String className() {
+ return name;
+ }
+
private String name;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotPreparedException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotPreparedException.java
index 6e1c8e4bc..40f823161 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotPreparedException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassNotPreparedException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,16 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ClassNotPreparedException.html
+ */
+public class ClassNotPreparedException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public ClassNotPreparedException() {
+ }
-public class ClassNotPreparedException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public ClassNotPreparedException() { }
public ClassNotPreparedException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassObjectReference.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassObjectReference.java
index d09351dcb..ad8a8a472 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassObjectReference.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassObjectReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ClassObjectReference.html
+ */
public abstract interface ClassObjectReference extends ObjectReference {
public abstract ReferenceType reflectedType();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassType.java
index b24b24ebd..963f02ca5 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,18 +10,19 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ClassType.html
+ */
public interface ClassType extends ReferenceType {
public static final int INVOKE_SINGLE_THREADED = 1;
- public List allInterfaces();
+ public List<InterfaceType> allInterfaces();
public Method concreteMethodByName(String arg1, String arg2);
- public List interfaces();
- public Value invokeMethod(ThreadReference arg1, Method arg2, List arg3, int arg4) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException;
+ public List<InterfaceType> interfaces();
+ public Value invokeMethod(ThreadReference arg1, Method arg2, List<? extends Value> arg3, int arg4) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException;
public boolean isEnum();
- public ObjectReference newInstance(ThreadReference arg1, Method arg2, List arg3, int arg4) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException;
+ public ObjectReference newInstance(ThreadReference arg1, Method arg2, List<? extends Value> arg3, int arg4) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException;
public void setValue(Field arg1, Value arg2) throws InvalidTypeException, ClassNotLoadedException;
- public List subclasses();
+ public List<ClassType> subclasses();
public ClassType superclass();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleType.java
index 11db46dc7..e243a705a 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/DoubleType.html
+ */
public interface DoubleType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleValue.java
index 16f2fed6d..83da83ef3 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/DoubleValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface DoubleValue extends PrimitiveValue , Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/DoubleValue.html
+ */
+public interface DoubleValue extends PrimitiveValue, Comparable<DoubleValue> {
public boolean equals(Object arg1);
public int hashCode();
public double value();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Field.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Field.java
index 1faa6059d..b5c1e6159 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Field.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Field.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface Field extends TypeComponent , Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Field.html
+ */
+public interface Field extends TypeComponent, Comparable<Field> {
public boolean equals(Object arg1);
public int hashCode();
public boolean isEnumConstant();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatType.java
index b0dfab1af..69cf95566 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/FloatType.html
+ */
public interface FloatType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatValue.java
index 88e0a9631..1b9aec43e 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/FloatValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface FloatValue extends PrimitiveValue, Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/FloatValue.html
+ */
+public interface FloatValue extends PrimitiveValue, Comparable<FloatValue> {
public boolean equals(Object arg1);
public int hashCode();
public float value();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IncompatibleThreadStateException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IncompatibleThreadStateException.java
index 7cab2d5e6..18dc85203 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IncompatibleThreadStateException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IncompatibleThreadStateException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,16 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/IncompatibleThreadStateException.html
+ */
+public class IncompatibleThreadStateException extends Exception {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public IncompatibleThreadStateException() {
+ }
-public class IncompatibleThreadStateException extends Exception {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public IncompatibleThreadStateException() { }
public IncompatibleThreadStateException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InconsistentDebugInfoException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InconsistentDebugInfoException.java
index c645044e8..e9660fea7 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InconsistentDebugInfoException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InconsistentDebugInfoException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,16 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InconsistentDebugInfoException.html
+ */
+public class InconsistentDebugInfoException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public InconsistentDebugInfoException() {
+ }
-public class InconsistentDebugInfoException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public InconsistentDebugInfoException() { }
public InconsistentDebugInfoException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerType.java
index 55128f792..7fa6c654f 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/IntegerType.html
+ */
public interface IntegerType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerValue.java
index c4148e96e..81103fa67 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/IntegerValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface IntegerValue extends PrimitiveValue , Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/IntegerValue.html
+ */
+public interface IntegerValue extends PrimitiveValue, Comparable<IntegerValue> {
public boolean equals(Object arg1);
public int hashCode();
public int value();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InterfaceType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InterfaceType.java
index 9e3946dc2..d99186fd0 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InterfaceType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InterfaceType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InterfaceType.html
+ */
public interface InterfaceType extends ReferenceType {
- public List implementors();
- public List subinterfaces();
- public List superinterfaces();
+ public List<ClassType> implementors();
+ public List<InterfaceType> subinterfaces();
+ public List<InterfaceType> superinterfaces();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InternalException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InternalException.java
index 86c538b09..3a3f6bac5 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InternalException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InternalException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,33 +9,35 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InternalException.html
+ */
+public class InternalException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public InternalException() {
+ }
-public class InternalException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public InternalException() { }
-
public InternalException(int errorCode) {
error = errorCode;
}
-
+
public InternalException(java.lang.String s) {
super(s);
}
-
+
public InternalException(java.lang.String s, int errorCode) {
super(s);
error = errorCode;
}
-
- public int errorCode() {
- return error;
+
+ public int errorCode() {
+ return error;
}
-
+
private int error;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidCodeIndexException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidCodeIndexException.java
index 52c24a8f3..176e44c51 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidCodeIndexException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidCodeIndexException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,22 +11,30 @@
package com.sun.jdi;
/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InvalidCodeIndexException.html
* @deprecated This exception is no longer thrown.
*/
+@Deprecated
public class InvalidCodeIndexException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
/**
- * @deprecated
+ * @deprecated no longer thrown
*/
- public InvalidCodeIndexException() { }
+ @Deprecated
+ public InvalidCodeIndexException() {
+ }
+
/**
- * @deprecated
+ * @param arg1
+ * the message
+ * @deprecated no longer thrown
*/
+ @Deprecated
public InvalidCodeIndexException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidLineNumberException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidLineNumberException.java
index 8c1d4f3d1..183d98725 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidLineNumberException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidLineNumberException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,23 +11,31 @@
package com.sun.jdi;
/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InvalidLineNumberException.html
* @deprecated This exception is no longer thrown.
*/
+@Deprecated
public class InvalidLineNumberException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
/**
- * @deprecated
+ * @deprecated no longer thrown
*/
- public InvalidLineNumberException() { }
+ @Deprecated
+ public InvalidLineNumberException() {
+ }
+
/**
- * @deprecated
+ * @param arg1
+ * the message
+ * @deprecated no longer thrown
*/
+ @Deprecated
public InvalidLineNumberException(String arg1) {
- super(arg1);
+ super(arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidStackFrameException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidStackFrameException.java
index e4659dcf4..1e3b0c637 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidStackFrameException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidStackFrameException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InvalidStackFrameException.html
+ */
+public class InvalidStackFrameException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public InvalidStackFrameException() {
+ }
-public class InvalidStackFrameException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public InvalidStackFrameException() { }
public InvalidStackFrameException(String arg1) {
- super(arg1);
+ super(arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidTypeException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidTypeException.java
index 1270e46fb..9079e0858 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidTypeException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvalidTypeException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InvalidTypeException.html
+ */
+public class InvalidTypeException extends Exception {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public InvalidTypeException() {
+ }
-public class InvalidTypeException extends Exception {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public InvalidTypeException() { }
public InvalidTypeException(String arg1) {
- super(arg1);
+ super(arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvocationException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvocationException.java
index b0b64aa90..3f01e2e0c 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvocationException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/InvocationException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,20 +9,23 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/InvocationException.html
+ */
+public class InvocationException extends Exception {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
-public class InvocationException extends Exception {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
private ObjectReference exception;
+
public InvocationException(ObjectReference arg1) {
exception = arg1;
}
+
public ObjectReference exception() {
- return exception;
+ return exception;
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/JDIPermission.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/JDIPermission.java
index cf1831d9b..ffa4b3a70 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/JDIPermission.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/JDIPermission.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,14 +11,16 @@
package com.sun.jdi;
import java.security.BasicPermission;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/JDIPermission.html
+ */
+public class JDIPermission extends BasicPermission {
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
-public class JDIPermission extends BasicPermission {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
public JDIPermission(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LocalVariable.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LocalVariable.java
index 307bde2f1..a79bd6108 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LocalVariable.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LocalVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface LocalVariable extends Mirror , Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/LocalVariable.html
+ */
+public interface LocalVariable extends Mirror, Comparable<LocalVariable> {
public boolean equals(Object arg1);
public String genericSignature();
public int hashCode();
@@ -19,6 +20,6 @@ public interface LocalVariable extends Mirror , Comparable {
public boolean isVisible(StackFrame arg1);
public String name();
public String signature();
- public com.sun.jdi.Type type() throws ClassNotLoadedException;
+ public Type type() throws ClassNotLoadedException;
public String typeName();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Locatable.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Locatable.java
index 90502550c..1ff8e7908 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Locatable.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Locatable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Locatable.html
+ */
public interface Locatable {
public Location location();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Location.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Location.java
index 19a4355a9..532ea94a1 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Location.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Location.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,18 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface Location extends Mirror , Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Location.html
+ */
+public interface Location extends Mirror, Comparable<Locatable> {
public long codeIndex();
public ReferenceType declaringType();
public boolean equals(Object arg1);
public int hashCode();
public int lineNumber();
- public int lineNumber(String stratum);
+ public int lineNumber(String stratum);
public Method method();
- public String sourceName() throws AbsentInformationException;
- public String sourceName(String stratum) throws AbsentInformationException;
- public String sourcePath() throws AbsentInformationException;
- public String sourcePath(String stratum) throws AbsentInformationException;
+ public String sourceName() throws AbsentInformationException;
+ public String sourceName(String stratum) throws AbsentInformationException;
+ public String sourcePath() throws AbsentInformationException;
+ public String sourcePath(String stratum) throws AbsentInformationException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongType.java
index 5e9c66003..2f28ae14a 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/LongType.html
+ */
public interface LongType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongValue.java
index 7f2f3b815..690e4ff12 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/LongValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface LongValue extends PrimitiveValue , Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/LongValue.html
+ */
+public interface LongValue extends PrimitiveValue, Comparable<LongValue> {
public boolean equals(Object arg1);
public int hashCode();
public long value();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Method.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Method.java
index e1099824e..ffecaf1f9 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Method.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Method.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,15 +10,16 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
-public interface Method extends TypeComponent , Locatable , Comparable {
- public List allLineLocations() throws AbsentInformationException;
- public List allLineLocations(String arg1, String arg2) throws AbsentInformationException;
- public List arguments() throws AbsentInformationException;
- public List argumentTypeNames();
- public List argumentTypes() throws ClassNotLoadedException;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Method.html
+ */
+public interface Method extends TypeComponent, Locatable, Comparable<Method> {
+ public List<Location> allLineLocations() throws AbsentInformationException;
+ public List<Location> allLineLocations(String arg1, String arg2) throws AbsentInformationException;
+ public List<LocalVariable> arguments() throws AbsentInformationException;
+ public List<String> argumentTypeNames();
+ public List<Type> argumentTypes() throws ClassNotLoadedException;
public byte[] bytecodes();
public boolean equals(Object arg1);
public int hashCode();
@@ -31,10 +32,10 @@ public interface Method extends TypeComponent , Locatable , Comparable {
public boolean isSynchronized();
public boolean isVarArgs();
public Location locationOfCodeIndex(long arg1);
- public List locationsOfLine(int arg1) throws AbsentInformationException;
- public List locationsOfLine(String arg1, String arg2, int arg3) throws AbsentInformationException;
+ public List<Location> locationsOfLine(int arg1) throws AbsentInformationException;
+ public List<Location> locationsOfLine(String arg1, String arg2, int arg3) throws AbsentInformationException;
public Type returnType() throws ClassNotLoadedException;
public String returnTypeName();
- public List variables() throws AbsentInformationException;
- public List variablesByName(String arg1) throws AbsentInformationException;
+ public List<LocalVariable> variables() throws AbsentInformationException;
+ public List<LocalVariable> variablesByName(String arg1) throws AbsentInformationException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Mirror.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Mirror.java
index fd2f3c631..f5f85f3ca 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Mirror.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Mirror.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Mirror.html
+ */
public interface Mirror {
public String toString();
public VirtualMachine virtualMachine();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/MonitorInfo.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/MonitorInfo.java
index 0d934f5ef..02a937dac 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/MonitorInfo.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/MonitorInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,11 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/MonitorInfo.html
+ */
public interface MonitorInfo extends Mirror {
- public ObjectReference monitor();
- public int stackDepth();
- public ThreadReference thread();
+ public ObjectReference monitor();
+ public int stackDepth();
+ public ThreadReference thread();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/NativeMethodException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/NativeMethodException.java
index 2232f2da7..6996a8be1 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/NativeMethodException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/NativeMethodException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/NativeMethodException.html
+ */
+public class NativeMethodException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public NativeMethodException() {
+ }
-public class NativeMethodException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public NativeMethodException() { }
public NativeMethodException(String arg1) {
- super(arg1);
+ super(arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectCollectedException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectCollectedException.java
index d5561b608..8fec828f6 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectCollectedException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectCollectedException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ObjectCollectedException.html
+ */
+public class ObjectCollectedException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public ObjectCollectedException() {
+ }
-public class ObjectCollectedException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public ObjectCollectedException() { }
public ObjectCollectedException(String arg1) {
- super(arg1);
+ super(arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectReference.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectReference.java
index 25aa42463..d2b787085 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectReference.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ObjectReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
import java.util.Map;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ObjectReference.html
+ */
public interface ObjectReference extends com.sun.jdi.Value {
public static final int INVOKE_SINGLE_THREADED = 1;
public static final int INVOKE_NONVIRTUAL = 2;
@@ -22,14 +23,14 @@ public interface ObjectReference extends com.sun.jdi.Value {
public int entryCount() throws IncompatibleThreadStateException;
public boolean equals(Object arg1);
public Value getValue(Field arg1);
- public Map getValues(java.util.List arg1);
+ public Map<Field, Value> getValues(List<? extends Field> arg1);
public int hashCode();
- public Value invokeMethod(ThreadReference arg1, Method arg2, List arg3, int arg4) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException;
+ public Value invokeMethod(ThreadReference arg1, Method arg2, List<? extends Value> arg3, int arg4) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException;
public boolean isCollected();
public ThreadReference owningThread() throws IncompatibleThreadStateException;
- public com.sun.jdi.ReferenceType referenceType();
+ public ReferenceType referenceType();
public void setValue(Field arg1, Value arg2) throws InvalidTypeException, ClassNotLoadedException;
public long uniqueID();
- public List waitingThreads() throws IncompatibleThreadStateException;
- public List referringObjects(long arg1);
+ public List<ThreadReference> waitingThreads() throws IncompatibleThreadStateException;
+ public List<Value> referringObjects(long arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PathSearchingVirtualMachine.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PathSearchingVirtualMachine.java
index a6ae47cb5..d4d304db7 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PathSearchingVirtualMachine.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PathSearchingVirtualMachine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/PathSearchingVirtualMachine.html
+ */
public abstract interface PathSearchingVirtualMachine extends VirtualMachine {
- public abstract List classPath();
- public abstract List bootClassPath();
+ public abstract List<String> classPath();
+ public abstract List<String> bootClassPath();
public abstract String baseDirectory();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveType.java
index 097ee2b5a..7b150af39 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/PrimitiveType.html
+ */
public interface PrimitiveType extends Type {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveValue.java
index 44100b335..ffd83674d 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/PrimitiveValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/PrimitiveValue.html
+ */
public interface PrimitiveValue extends Value {
public boolean booleanValue();
public byte byteValue();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ReferenceType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ReferenceType.java
index f205b8304..e9a1a5d64 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ReferenceType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ReferenceType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,26 +10,27 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
import java.util.Map;
-
-public interface ReferenceType extends Type , Comparable , Accessible {
- public List allFields();
- public List allLineLocations() throws AbsentInformationException;
- public List allLineLocations(String arg1, String arg2) throws AbsentInformationException;
- public List allMethods();
- public List availableStrata();
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ReferenceType.html
+ */
+public interface ReferenceType extends Type, Comparable<ReferenceType>, Accessible {
+ public List<Field> allFields();
+ public List<Location> allLineLocations() throws AbsentInformationException;
+ public List<Location> allLineLocations(String arg1, String arg2) throws AbsentInformationException;
+ public List<Method> allMethods();
+ public List<String> availableStrata();
public ClassLoaderReference classLoader();
public ClassObjectReference classObject();
public String defaultStratum();
public boolean equals(Object arg1);
public boolean failedToInitialize();
public Field fieldByName(String arg1);
- public List fields();
+ public List<Field> fields();
public String genericSignature();
public Value getValue(Field arg1);
- public Map getValues(List arg1);
+ public Map<Field, Value> getValues(List<? extends Field> arg1);
public int hashCode();
public boolean isAbstract();
public boolean isFinal();
@@ -37,22 +38,22 @@ public interface ReferenceType extends Type , Comparable , Accessible {
public boolean isPrepared();
public boolean isStatic();
public boolean isVerified();
- public List locationsOfLine(int arg1) throws AbsentInformationException;
- public List locationsOfLine(String arg1, String arg2, int arg3) throws AbsentInformationException;
- public List methods();
- public List methodsByName(String arg1);
- public List methodsByName(String arg1, String arg2);
+ public List<Location> locationsOfLine(int arg1) throws AbsentInformationException;
+ public List<Location> locationsOfLine(String arg1, String arg2, int arg3) throws AbsentInformationException;
+ public List<Method> methods();
+ public List<Method> methodsByName(String arg1);
+ public List<Method> methodsByName(String arg1, String arg2);
public String name();
- public List nestedTypes();
+ public List<ReferenceType> nestedTypes();
public String sourceDebugExtension() throws AbsentInformationException;
public String sourceName() throws AbsentInformationException;
- public List sourceNames(String arg1) throws AbsentInformationException;
- public List sourcePaths(String arg1) throws AbsentInformationException;
- public List visibleFields();
- public List visibleMethods();
- public List instances(long arg1);
+ public List<String> sourceNames(String arg1) throws AbsentInformationException;
+ public List<String> sourcePaths(String arg1) throws AbsentInformationException;
+ public List<Field> visibleFields();
+ public List<Method> visibleMethods();
+ public List<ObjectReference> instances(long arg1);
public int majorVersion();
- public int minorVersion();
- public int constantPoolCount();
- public byte[] constantPool();
+ public int minorVersion();
+ public int constantPoolCount();
+ public byte[] constantPool();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortType.java
index 4455c5b47..cf66fe431 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ShortType.html
+ */
public interface ShortType extends PrimitiveType {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortValue.java
index bb42bfb6b..0ae6ddd16 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ShortValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface ShortValue extends PrimitiveValue , Comparable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ShortValue.html
+ */
+public interface ShortValue extends PrimitiveValue, Comparable<ShortValue> {
public boolean equals(Object arg1);
public int hashCode();
public short value();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StackFrame.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StackFrame.java
index 0fd5d2733..c81ce94f2 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StackFrame.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StackFrame.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,18 +10,19 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
import java.util.Map;
-
-public interface StackFrame extends Mirror , Locatable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/StackFrame.html
+ */
+public interface StackFrame extends Mirror, Locatable {
public Value getValue(LocalVariable arg1);
- public Map getValues(List arg1);
+ public Map<LocalVariable, Value> getValues(List<? extends LocalVariable> arg1);
public Location location();
public void setValue(LocalVariable arg1, Value arg2) throws InvalidTypeException, ClassNotLoadedException;
public ObjectReference thisObject();
public ThreadReference thread();
public LocalVariable visibleVariableByName(String arg1) throws AbsentInformationException;
- public List visibleVariables() throws AbsentInformationException;
- public List getArgumentValues();
+ public List<LocalVariable> visibleVariables() throws AbsentInformationException;
+ public List<Value> getArgumentValues();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StringReference.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StringReference.java
index d9c80d93a..9b5d81169 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StringReference.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/StringReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/StringReference.html
+ */
public interface StringReference extends ObjectReference {
public String value();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadGroupReference.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadGroupReference.java
index 4e6327b7d..8db51cc2f 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadGroupReference.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadGroupReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,15 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ThreadGroupReference.html
+ */
public interface ThreadGroupReference extends ObjectReference {
public String name();
public ThreadGroupReference parent();
public void resume();
public void suspend();
- public List threadGroups();
- public List threads();
+ public List<ThreadGroupReference> threadGroups();
+ public List<ThreadReference> threads();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadReference.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadReference.java
index e9e6abd6b..2bdee0937 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadReference.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/ThreadReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/ThreadReference.html
+ */
public interface ThreadReference extends ObjectReference {
public static final int THREAD_STATUS_UNKNOWN = -1;
public static final int THREAD_STATUS_ZOMBIE = 0;
@@ -24,13 +25,13 @@ public interface ThreadReference extends ObjectReference {
public ObjectReference currentContendedMonitor() throws IncompatibleThreadStateException;
public StackFrame frame(int arg1) throws IncompatibleThreadStateException;
public int frameCount() throws IncompatibleThreadStateException;
- public List frames() throws IncompatibleThreadStateException;
- public List frames(int arg1, int arg2) throws IncompatibleThreadStateException;
+ public List<StackFrame> frames() throws IncompatibleThreadStateException;
+ public List<StackFrame> frames(int arg1, int arg2) throws IncompatibleThreadStateException;
public void interrupt();
public boolean isAtBreakpoint();
public boolean isSuspended();
public String name();
- public List ownedMonitors() throws IncompatibleThreadStateException;
+ public List<ObjectReference> ownedMonitors() throws IncompatibleThreadStateException;
public void popFrames(StackFrame frame) throws IncompatibleThreadStateException;
public void resume();
public int status();
@@ -39,5 +40,5 @@ public interface ThreadReference extends ObjectReference {
public int suspendCount();
public ThreadGroupReference threadGroup();
public void forceEarlyReturn(Value arg1) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException;
- public List ownedMonitorsAndFrames()throws IncompatibleThreadStateException;
+ public List<MonitorInfo> ownedMonitorsAndFrames() throws IncompatibleThreadStateException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Type.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Type.java
index 14a0b44e1..63d80bee7 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Type.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Type.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Type.html
+ */
public interface Type extends Mirror {
public String name();
public String signature();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/TypeComponent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/TypeComponent.java
index 5645536d7..781e6bba9 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/TypeComponent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/TypeComponent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
-public interface TypeComponent extends Mirror , Accessible {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/TypeComponent.html
+ */
+public interface TypeComponent extends Mirror, Accessible {
public ReferenceType declaringType();
public String genericSignature();
public boolean isFinal();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMCannotBeModifiedException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMCannotBeModifiedException.java
index 8fc99f1bd..f5d4bc4cd 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMCannotBeModifiedException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMCannotBeModifiedException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,16 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VMCannotBeModifiedException.html
+ */
public class VMCannotBeModifiedException extends UnsupportedOperationException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
public VMCannotBeModifiedException() {
}
+
public VMCannotBeModifiedException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMDisconnectedException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMDisconnectedException.java
index 1ad4dd608..219053dc2 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMDisconnectedException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMDisconnectedException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,18 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VMDisconnectedException.html
+ */
+public class VMDisconnectedException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
-public class VMDisconnectedException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
public VMDisconnectedException() {
}
-
+
public VMDisconnectedException(java.lang.String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMMismatchException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMMismatchException.java
index 1708c88bc..81487596b 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMMismatchException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMMismatchException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VMMismatchException.html
+ */
+public class VMMismatchException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public VMMismatchException() {
+ }
-public class VMMismatchException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public VMMismatchException() { }
public VMMismatchException(String arg1) {
- super(arg1);
+ super(arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMOutOfMemoryException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMOutOfMemoryException.java
index 76ba34bfc..be96116c8 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMOutOfMemoryException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VMOutOfMemoryException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,17 +9,20 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VMOutOfMemoryException.html
+ */
+public class VMOutOfMemoryException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public VMOutOfMemoryException() {
+ }
-public class VMOutOfMemoryException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public VMOutOfMemoryException() { }
public VMOutOfMemoryException(String s) {
- super(s);
+ super(s);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Value.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Value.java
index 2db2be4a9..54116e963 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Value.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/Value.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/Value.html
+ */
public interface Value extends Mirror {
public Type type();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachine.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachine.java
index 79a306817..369310891 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachine.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,13 +10,14 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.util.List;
import java.util.Map;
import com.sun.jdi.event.EventQueue;
import com.sun.jdi.request.EventRequestManager;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VirtualMachine.html
+ */
public interface VirtualMachine extends Mirror {
public static final int TRACE_NONE = 0;
public static final int TRACE_SENDS = 1;
@@ -25,8 +26,8 @@ public interface VirtualMachine extends Mirror {
public static final int TRACE_REFTYPES = 8;
public static final int TRACE_OBJREFS = 16;
public static final int TRACE_ALL = 16777215;
- public List allClasses();
- public List allThreads();
+ public List<ReferenceType> allClasses();
+ public List<ThreadReference> allThreads();
public boolean canAddMethod();
public boolean canBeModified();
public boolean canGetBytecodes();
@@ -42,7 +43,7 @@ public interface VirtualMachine extends Mirror {
public boolean canUseInstanceFilters();
public boolean canWatchFieldAccess();
public boolean canWatchFieldModification();
- public List classesByName(String arg1);
+ public List<ReferenceType> classesByName(String arg1);
public String description();
public void dispose();
public EventQueue eventQueue();
@@ -60,21 +61,21 @@ public interface VirtualMachine extends Mirror {
public ShortValue mirrorOf(short arg1);
public String name();
public Process process();
- public void redefineClasses(Map arg1);
+ public void redefineClasses(Map<? extends ReferenceType,byte[]> arg1);
public void resume();
public void setDebugTraceMode(int arg1);
public void setDefaultStratum(String arg1);
public void suspend();
- public List topLevelThreadGroups();
+ public List<ThreadGroupReference> topLevelThreadGroups();
public String version();
public boolean canGetInstanceInfo();
- public long[] instanceCounts(List arg1);
+ public long[] instanceCounts(List<? extends ReferenceType> arg1);
public boolean canGetClassFileVersion();
- public boolean canGetConstantPool();
- public boolean canUseSourceNameFilters();
- public boolean canGetMethodReturnValues();
- public boolean canForceEarlyReturn();
- public boolean canRequestMonitorEvents();
- public boolean canGetMonitorFrameInfo();
- public VoidValue mirrorOfVoid();
+ public boolean canGetConstantPool();
+ public boolean canUseSourceNameFilters();
+ public boolean canGetMethodReturnValues();
+ public boolean canForceEarlyReturn();
+ public boolean canRequestMonitorEvents();
+ public boolean canGetMonitorFrameInfo();
+ public VoidValue mirrorOfVoid();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachineManager.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachineManager.java
index 4960e1c04..db1f3e2c8 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachineManager.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VirtualMachineManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,22 +10,26 @@
*******************************************************************************/
package com.sun.jdi;
-
import java.io.IOException;
import java.util.List;
+import com.sun.jdi.connect.AttachingConnector;
+import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.LaunchingConnector;
+import com.sun.jdi.connect.ListeningConnector;
import com.sun.jdi.connect.spi.Connection;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VirtualMachineManager.html
+ */
public interface VirtualMachineManager {
- public List allConnectors();
- public List attachingConnectors();
- public List connectedVirtualMachines();
+ public List<Connector> allConnectors();
+ public List<AttachingConnector> attachingConnectors();
+ public List<VirtualMachine> connectedVirtualMachines();
public VirtualMachine createVirtualMachine(Connection connection) throws IOException;
public VirtualMachine createVirtualMachine(Connection connection, Process process) throws IOException;
public LaunchingConnector defaultConnector();
- public List launchingConnectors();
- public List listeningConnectors();
+ public List<LaunchingConnector> launchingConnectors();
+ public List<ListeningConnector> listeningConnectors();
public int majorInterfaceVersion();
public int minorInterfaceVersion();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidType.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidType.java
index a2d5d3714..0ab1a8480 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidType.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VoidType.html
+ */
public interface VoidType extends Type {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidValue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidValue.java
index 77824c2f8..aca29647d 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidValue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/VoidValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/VoidValue.html
+ */
public interface VoidValue extends Value {
public boolean equals(Object arg1);
public int hashCode();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/AttachingConnector.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/AttachingConnector.java
index bd4213a52..57f79bb25 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/AttachingConnector.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/AttachingConnector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,12 +10,13 @@
*******************************************************************************/
package com.sun.jdi.connect;
-
import java.io.IOException;
import java.util.Map;
import com.sun.jdi.VirtualMachine;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/AttachingConnector.html
+ */
public interface AttachingConnector extends Connector {
- public VirtualMachine attach(Map arguments) throws IOException, IllegalConnectorArgumentsException;
+ public VirtualMachine attach(Map<String,? extends Connector.Argument> arguments) throws IOException, IllegalConnectorArgumentsException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Connector.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Connector.java
index 6e95abf47..690369ddf 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Connector.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Connector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,17 +10,20 @@
*******************************************************************************/
package com.sun.jdi.connect;
-
import java.io.Serializable;
import java.util.List;
import java.util.Map;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/Connector.html
+ */
public interface Connector {
- public Map defaultArguments();
+ public Map<String, Connector.Argument> defaultArguments();
public String description();
public String name();
public Transport transport();
-
+ /**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/Connector.Argument.html
+ */
public interface Argument extends Serializable {
public String description();
public boolean isValid(String arg1);
@@ -30,11 +33,15 @@ public interface Connector {
public void setValue(String arg1);
public String value();
}
-
+ /**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/Connector.StringArgument.html
+ */
public interface StringArgument extends Connector.Argument {
public boolean isValid(String arg1);
}
-
+ /**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/Connector.IntegerArgument.html
+ */
public interface IntegerArgument extends Connector.Argument {
public int intValue();
public boolean isValid(int arg1);
@@ -44,16 +51,20 @@ public interface Connector {
public void setValue(int arg1);
public String stringValueOf(int arg1);
}
-
+ /**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/Connector.BooleanArgument.html
+ */
public interface BooleanArgument extends Connector.Argument {
public boolean booleanValue();
public boolean isValid(String arg1);
public void setValue(boolean arg1);
public String stringValueOf(boolean arg1);
}
-
+ /**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/Connector.SelectedArgument.html
+ */
public interface SelectedArgument extends Connector.Argument {
- public List choices();
+ public List<String> choices();
public boolean isValid(String arg1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/IllegalConnectorArgumentsException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/IllegalConnectorArgumentsException.java
index d1ab8672b..db3981fc2 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/IllegalConnectorArgumentsException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/IllegalConnectorArgumentsException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,31 +10,32 @@
*******************************************************************************/
package com.sun.jdi.connect;
-
import java.util.ArrayList;
import java.util.List;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/IllegalConnectorArgumentsException.html
+ */
public class IllegalConnectorArgumentsException extends Exception {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- List fNames;
-
- public IllegalConnectorArgumentsException(String message, List argNames) {
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ List<String> fNames;
+
+ public IllegalConnectorArgumentsException(String message, List<String> argNames) {
super(message);
fNames = argNames;
}
-
+
public IllegalConnectorArgumentsException(String message, String argName) {
super(message);
- fNames = new ArrayList(1);
+ fNames = new ArrayList<String>(1);
fNames.add(argName);
}
-
- public List argumentNames() {
+
+ public List<String> argumentNames() {
return fNames;
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/LaunchingConnector.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/LaunchingConnector.java
index 40fd61bb9..3b77e88c5 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/LaunchingConnector.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/LaunchingConnector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,13 @@
*******************************************************************************/
package com.sun.jdi.connect;
-
import java.io.IOException;
+import java.util.Map;
import com.sun.jdi.VirtualMachine;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/LaunchingConnector.html
+ */
public interface LaunchingConnector extends Connector {
- public VirtualMachine launch(java.util.Map arg1) throws IOException, IllegalConnectorArgumentsException, VMStartException;
+ public VirtualMachine launch(Map<String,? extends Connector.Argument> arg1) throws IOException, IllegalConnectorArgumentsException, VMStartException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/ListeningConnector.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/ListeningConnector.java
index 317a3b571..0584abc65 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/ListeningConnector.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/ListeningConnector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,15 +10,16 @@
*******************************************************************************/
package com.sun.jdi.connect;
-
import java.io.IOException;
import java.util.Map;
import com.sun.jdi.VirtualMachine;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/ListeningConnector.html
+ */
public interface ListeningConnector extends Connector {
- public VirtualMachine accept(Map arg1) throws IOException, IllegalConnectorArgumentsException;
- public String startListening(Map arg1) throws IOException, IllegalConnectorArgumentsException;
- public void stopListening(Map arg1) throws IOException, IllegalConnectorArgumentsException;
+ public VirtualMachine accept(Map<String,? extends Connector.Argument> arg1) throws IOException, IllegalConnectorArgumentsException;
+ public String startListening(Map<String,? extends Connector.Argument> arg1) throws IOException, IllegalConnectorArgumentsException;
+ public void stopListening(Map<String,? extends Connector.Argument> arg1) throws IOException, IllegalConnectorArgumentsException;
public boolean supportsMultipleConnections() throws IOException, IllegalConnectorArgumentsException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Transport.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Transport.java
index ae13169e8..1d78c2300 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Transport.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/Transport.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.connect;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/Transport.html
+ */
public interface Transport {
public String name();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/TransportTimeoutException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/TransportTimeoutException.java
index b9e0a07f7..6339c74b4 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/TransportTimeoutException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/TransportTimeoutException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,16 +11,19 @@
package com.sun.jdi.connect;
import java.io.IOException;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/TransportTimeoutException.html
+ */
public class TransportTimeoutException extends IOException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
public TransportTimeoutException() {
}
+
public TransportTimeoutException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/VMStartException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/VMStartException.java
index 4b39bffce..40ecc9e6d 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/VMStartException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/VMStartException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,27 +9,28 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.connect;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/VMStartException.html
+ */
+public class VMStartException extends Exception {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
-public class VMStartException extends Exception {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
Process fProcess;
-
+
public VMStartException(Process proc) {
fProcess = proc;
}
-
+
public VMStartException(String str, Process proc) {
super(str);
fProcess = proc;
}
-
- public Process process() {
+
+ public Process process() {
return fProcess;
}
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/ClosedConnectionException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/ClosedConnectionException.java
index a7c2b1789..e5182f4bf 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/ClosedConnectionException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/ClosedConnectionException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,16 +11,19 @@
package com.sun.jdi.connect.spi;
import java.io.IOException;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/spi/ClosedConnectionException.html
+ */
public class ClosedConnectionException extends IOException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
public ClosedConnectionException() {
}
+
public ClosedConnectionException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/Connection.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/Connection.java
index 1b77a35d1..c61a5ee07 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/Connection.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/Connection.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,10 +11,15 @@
package com.sun.jdi.connect.spi;
import java.io.IOException;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/spi/Connection.html
+ */
public abstract class Connection {
public abstract void close() throws IOException;
+
public abstract boolean isOpen();
+
public abstract byte[] readPacket() throws IOException;
+
public abstract void writePacket(byte[] arg1) throws IOException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/TransportService.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/TransportService.java
index 99d3b4b72..609d7d06d 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/TransportService.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/connect/spi/TransportService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,24 +11,47 @@
package com.sun.jdi.connect.spi;
import java.io.IOException;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/spi/TransportService.html
+ */
public abstract class TransportService {
+ /**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/spi/TransportService.Capabilities.html
+ */
public abstract static class Capabilities {
public abstract boolean supportsAcceptTimeout();
+
public abstract boolean supportsAttachTimeout();
+
public abstract boolean supportsHandshakeTimeout();
+
public abstract boolean supportsMultipleConnections();
}
+ /**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/connect/spi/TransportService.ListenKey.html
+ */
public abstract static class ListenKey {
public abstract String address();
}
- public abstract Connection accept(ListenKey listenKey, long attachTimeout, long handshakeTimeout) throws IOException;
- public abstract Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException;
+
+ public abstract Connection accept(ListenKey listenKey, long attachTimeout,
+ long handshakeTimeout) throws IOException;
+
+ public abstract Connection attach(String address, long attachTimeout,
+ long handshakeTimeout) throws IOException;
+
public abstract TransportService.Capabilities capabilities();
+
public abstract String description();
+
public abstract String name();
- public abstract TransportService.ListenKey startListening() throws IOException;
- public abstract TransportService.ListenKey startListening(String arg1) throws IOException;
- public abstract void stopListening(TransportService.ListenKey arg1) throws IOException;
+
+ public abstract TransportService.ListenKey startListening()
+ throws IOException;
+
+ public abstract TransportService.ListenKey startListening(String arg1)
+ throws IOException;
+
+ public abstract void stopListening(TransportService.ListenKey arg1)
+ throws IOException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/AccessWatchpointEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/AccessWatchpointEvent.java
index eaa7c13c4..220d2a726 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/AccessWatchpointEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/AccessWatchpointEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.event;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/AccessWatchpointEvent.html
+ */
public interface AccessWatchpointEvent extends WatchpointEvent {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/BreakpointEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/BreakpointEvent.java
index 623489c29..e7a8923f2 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/BreakpointEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/BreakpointEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,5 +10,8 @@
*******************************************************************************/
package com.sun.jdi.event;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/BreakpointEvent.html
+ */
public interface BreakpointEvent extends LocatableEvent {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassPrepareEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassPrepareEvent.java
index 9c8491b8f..cc222ac43 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassPrepareEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassPrepareEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,12 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/ClassPrepareEvent.html
+ */
public interface ClassPrepareEvent extends Event {
public ReferenceType referenceType();
public ThreadReference thread();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassUnloadEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassUnloadEvent.java
index 41f985dd0..5b7cab2ae 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassUnloadEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ClassUnloadEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,9 @@
*******************************************************************************/
package com.sun.jdi.event;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/ClassUnloadEvent.html
+ */
public interface ClassUnloadEvent extends Event {
public String className();
public String classSignature();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/Event.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/Event.java
index dd84aa7dc..4a5134b8d 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/Event.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/Event.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,12 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Mirror;
import com.sun.jdi.request.EventRequest;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/Event.html
+ */
public interface Event extends Mirror {
public EventRequest request();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventIterator.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventIterator.java
index c4c084be2..ea1717807 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventIterator.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventIterator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import java.util.Iterator;
-
-public interface EventIterator extends Iterator {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/EventIterator.html
+ */
+public interface EventIterator extends Iterator<Event> {
public Event nextEvent();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventQueue.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventQueue.java
index 9d2177588..bc74c0775 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventQueue.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventQueue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Mirror;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/EventQueue.html
+ */
public interface EventQueue extends Mirror {
public EventSet remove() throws InterruptedException;
public EventSet remove(long arg1) throws InterruptedException;
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventSet.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventSet.java
index cd0ad9d41..bc426ae61 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventSet.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/EventSet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,12 +10,13 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import java.util.Collection;
import com.sun.jdi.Mirror;
-
-public interface EventSet extends Mirror , Collection {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/EventSet.html
+ */
+public interface EventSet extends Mirror, Collection<Event> {
public EventIterator eventIterator();
public void resume();
public int suspendPolicy();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ExceptionEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ExceptionEvent.java
index 877910d08..2385d768b 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ExceptionEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ExceptionEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Location;
import com.sun.jdi.ObjectReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/ExceptionEvent.html
+ */
public interface ExceptionEvent extends LocatableEvent {
public Location catchLocation();
public ObjectReference exception();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/LocatableEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/LocatableEvent.java
index e446de58b..cd779c34b 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/LocatableEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/LocatableEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Locatable;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/LocatableEvent.html
+ */
public abstract interface LocatableEvent extends Event, Locatable {
public abstract ThreadReference thread();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodEntryEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodEntryEvent.java
index 126676c03..849ad6d9d 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodEntryEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodEntryEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Method;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/MethodEntryEvent.html
+ */
public interface MethodEntryEvent extends LocatableEvent {
public Method method();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodExitEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodExitEvent.java
index 5aa13e58e..bf5200d35 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodExitEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MethodExitEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Method;
import com.sun.jdi.Value;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/MethodExitEvent.html
+ */
public interface MethodExitEvent extends LocatableEvent {
public Method method();
public Value returnValue();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ModificationWatchpointEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ModificationWatchpointEvent.java
index 12925914b..5c9cf26e4 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ModificationWatchpointEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ModificationWatchpointEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Value;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/ModificationWatchpointEvent.html
+ */
public interface ModificationWatchpointEvent extends WatchpointEvent {
public Value valueToBe();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnterEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnterEvent.java
index bd081a74f..39a57d344 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnterEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnterEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,9 @@ package com.sun.jdi.event;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/MonitorContendedEnterEvent.html
+ */
public interface MonitorContendedEnterEvent extends LocatableEvent {
public ThreadReference thread();
public ObjectReference monitor();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnteredEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnteredEvent.java
index b310db0ad..e8f3ae534 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnteredEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorContendedEnteredEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,9 @@ package com.sun.jdi.event;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/MonitorContendedEnteredEvent.html
+ */
public interface MonitorContendedEnteredEvent extends LocatableEvent {
public ThreadReference thread();
public ObjectReference monitor();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitEvent.java
index b6832cb13..6541e7982 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,9 @@ package com.sun.jdi.event;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/MonitorWaitEvent.html
+ */
public interface MonitorWaitEvent extends LocatableEvent {
public ThreadReference thread();
public ObjectReference monitor();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitedEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitedEvent.java
index 9d027a817..73573cf25 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitedEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/MonitorWaitedEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,9 @@ package com.sun.jdi.event;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/MonitorWaitedEvent.html
+ */
public interface MonitorWaitedEvent extends LocatableEvent {
public ThreadReference thread();
public ObjectReference monitor();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/StepEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/StepEvent.java
index d8830826e..086b3ca29 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/StepEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/StepEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.event;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/StepEvent.html
+ */
public interface StepEvent extends LocatableEvent {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadDeathEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadDeathEvent.java
index c6db339ca..663bb870c 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadDeathEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadDeathEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/ThreadDeathEvent.html
+ */
public interface ThreadDeathEvent extends Event {
public ThreadReference thread();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadStartEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadStartEvent.java
index 017104ff7..5071afd7c 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadStartEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/ThreadStartEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/ThreadStartEvent.html
+ */
public interface ThreadStartEvent extends Event {
public ThreadReference thread();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDeathEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDeathEvent.java
index 8f66df631..10ed85440 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDeathEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDeathEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.event;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/VMDeathEvent.html
+ */
public interface VMDeathEvent extends Event {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDisconnectEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDisconnectEvent.java
index 1d463868a..2063a5569 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDisconnectEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMDisconnectEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.event;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/VMDisconnectEvent.html
+ */
public interface VMDisconnectEvent extends Event {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMStartEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMStartEvent.java
index cbd49a29c..e0f190e35 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMStartEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/VMStartEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/VMStartEvent.html
+ */
public interface VMStartEvent extends Event {
public ThreadReference thread();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/WatchpointEvent.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/WatchpointEvent.java
index 0ef82f825..e2d986a64 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/WatchpointEvent.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/event/WatchpointEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package com.sun.jdi.event;
-
import com.sun.jdi.Field;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.Value;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/event/WatchpointEvent.html
+ */
public interface WatchpointEvent extends LocatableEvent {
public Field field();
public ObjectReference object();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/AccessWatchpointRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/AccessWatchpointRequest.java
index d76346779..989194b6a 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/AccessWatchpointRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/AccessWatchpointRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.request;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/AccessWatchpointRequest.html
+ */
public interface AccessWatchpointRequest extends WatchpointRequest {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/BreakpointRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/BreakpointRequest.java
index 8859b7802..59807e645 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/BreakpointRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/BreakpointRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,13 +10,14 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.Locatable;
import com.sun.jdi.Location;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
-
-public interface BreakpointRequest extends EventRequest , Locatable {
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/BreakpointRequest.html
+ */
+public interface BreakpointRequest extends EventRequest, Locatable {
public void addThreadFilter(ThreadReference arg1);
public void addInstanceFilter(ObjectReference instance);
public Location location();
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassPrepareRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassPrepareRequest.java
index 66c20155c..0c915187e 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassPrepareRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassPrepareRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.ReferenceType;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/ClassPrepareRequest.html
+ */
public interface ClassPrepareRequest extends EventRequest {
public void addClassExclusionFilter(String arg1);
public void addClassFilter(ReferenceType arg1);
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassUnloadRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassUnloadRequest.java
index ab434c31d..7162f5538 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassUnloadRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ClassUnloadRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,8 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.request;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/ClassUnloadRequest.html
+ */
public interface ClassUnloadRequest extends EventRequest {
public void addClassExclusionFilter(String arg1);
public void addClassFilter(String arg1);
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/DuplicateRequestException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/DuplicateRequestException.java
index 42f3718ef..d06a25374 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/DuplicateRequestException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/DuplicateRequestException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,16 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.request;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/DuplicateRequestException.html
+ */
+public class DuplicateRequestException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public DuplicateRequestException() {
+ }
-public class DuplicateRequestException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public DuplicateRequestException() { }
public DuplicateRequestException(String message) {
super(message);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequest.java
index ba984ea37..0490569e1 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,20 +10,30 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.Mirror;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/EventRequest.html
+ */
public interface EventRequest extends Mirror {
public static final int SUSPEND_NONE = 0;
public static final int SUSPEND_EVENT_THREAD = 1;
public static final int SUSPEND_ALL = 2;
+
public void addCountFilter(int arg1) throws InvalidRequestStateException;
+
public void disable();
+
public void enable();
+
public Object getProperty(Object key);
+
public boolean isEnabled();
+
public void putProperty(Object key, Object value);
+
public void setEnabled(boolean arg1);
+
public void setSuspendPolicy(int arg1);
+
public int suspendPolicy();
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequestManager.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequestManager.java
index 289d244e6..75134afde 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequestManager.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/EventRequestManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,24 +10,26 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import java.util.List;
import com.sun.jdi.Field;
import com.sun.jdi.Location;
import com.sun.jdi.Mirror;
+import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/EventRequestManager.html
+ */
public interface EventRequestManager extends Mirror {
- public List accessWatchpointRequests();
- public List breakpointRequests();
- public List classPrepareRequests();
- public List classUnloadRequests();
+ public List<AccessWatchpointRequest> accessWatchpointRequests();
+ public List<BreakpointRequest> breakpointRequests();
+ public List<ClassPrepareRequest> classPrepareRequests();
+ public List<ClassUnloadRequest> classUnloadRequests();
public AccessWatchpointRequest createAccessWatchpointRequest(Field arg1);
public BreakpointRequest createBreakpointRequest(Location arg1);
public ClassPrepareRequest createClassPrepareRequest();
public ClassUnloadRequest createClassUnloadRequest();
- public ExceptionRequest createExceptionRequest(com.sun.jdi.ReferenceType arg1, boolean arg2, boolean arg3);
+ public ExceptionRequest createExceptionRequest(ReferenceType arg1, boolean arg2, boolean arg3);
public MethodEntryRequest createMethodEntryRequest();
public MethodExitRequest createMethodExitRequest();
public MonitorContendedEnteredRequest createMonitorContendedEnteredRequest();
@@ -41,17 +43,17 @@ public interface EventRequestManager extends Mirror {
public VMDeathRequest createVMDeathRequest();
public void deleteAllBreakpoints();
public void deleteEventRequest(EventRequest arg1);
- public void deleteEventRequests(List arg1);
- public List exceptionRequests();
- public List methodEntryRequests();
- public List methodExitRequests();
- public List modificationWatchpointRequests();
- public List stepRequests();
- public List threadDeathRequests();
- public List threadStartRequests();
- public List vmDeathRequests();
- public List monitorContendedEnterRequests();
- public List monitorContendedEnteredRequests();
- public List monitorWaitRequests();
- public List monitorWaitedRequests();
-}
+ public void deleteEventRequests(List<? extends EventRequest> arg1);
+ public List<ExceptionRequest> exceptionRequests();
+ public List<MethodEntryRequest> methodEntryRequests();
+ public List<MethodExitRequest> methodExitRequests();
+ public List<ModificationWatchpointRequest> modificationWatchpointRequests();
+ public List<StepRequest> stepRequests();
+ public List<ThreadDeathRequest> threadDeathRequests();
+ public List<ThreadStartRequest> threadStartRequests();
+ public List<VMDeathRequest> vmDeathRequests();
+ public List<MonitorContendedEnterRequest> monitorContendedEnterRequests();
+ public List<MonitorContendedEnteredRequest> monitorContendedEnteredRequests();
+ public List<MonitorWaitRequest> monitorWaitRequests();
+ public List<MonitorWaitedRequest> monitorWaitedRequests();
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ExceptionRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ExceptionRequest.java
index cf2326865..16e1a4b0e 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ExceptionRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ExceptionRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,15 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/ExceptionRequest.html
+ */
public interface ExceptionRequest extends EventRequest {
public void addClassExclusionFilter(String arg1);
- public void addClassFilter(ReferenceType arg1);
+ public void addClassFilter(ReferenceType arg1);
public void addClassFilter(String arg1);
public void addInstanceFilter(ObjectReference instance);
public void addThreadFilter(ThreadReference arg1);
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/InvalidRequestStateException.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/InvalidRequestStateException.java
index b7d996080..65c46a292 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/InvalidRequestStateException.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/InvalidRequestStateException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,18 +9,19 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.request;
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/InvalidRequestStateException.html
+ */
+public class InvalidRequestStateException extends RuntimeException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
-public class InvalidRequestStateException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
public InvalidRequestStateException() {
}
-
+
public InvalidRequestStateException(String arg1) {
super(arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodEntryRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodEntryRequest.java
index 264325b6c..b2298c0df 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodEntryRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodEntryRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/MethodEntryRequest.html
+ */
public interface MethodEntryRequest extends EventRequest {
public void addClassExclusionFilter(String arg1);
public void addClassFilter(ReferenceType arg1);
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodExitRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodExitRequest.java
index 2ba9921e2..06495801b 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodExitRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MethodExitRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/MethodExitRequest.html
+ */
public interface MethodExitRequest extends EventRequest {
public void addClassExclusionFilter(String arg1);
public void addClassFilter(ReferenceType arg1);
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ModificationWatchpointRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ModificationWatchpointRequest.java
index 59903fffb..83431f4a8 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ModificationWatchpointRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ModificationWatchpointRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,8 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.request;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/ModificationWatchpointRequest.html
+ */
public interface ModificationWatchpointRequest extends WatchpointRequest {
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnterRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnterRequest.java
index 816972705..bb46e1fe2 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnterRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnterRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,11 +13,13 @@ package com.sun.jdi.request;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/MonitorContendedEnterRequest.html
+ */
public interface MonitorContendedEnterRequest extends EventRequest {
public void addClassExclusionFilter(String arg1) throws InvalidRequestStateException;
- public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
- public void addClassFilter(String arg1) throws InvalidRequestStateException;
+ public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
+ public void addClassFilter(String arg1) throws InvalidRequestStateException;
public void addInstanceFilter(ObjectReference arg1) throws InvalidRequestStateException;
public void addThreadFilter(ThreadReference arg1) throws InvalidRequestStateException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnteredRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnteredRequest.java
index 497454f7a..eca31c646 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnteredRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorContendedEnteredRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,11 +13,13 @@ package com.sun.jdi.request;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/MonitorContendedEnteredRequest.html
+ */
public interface MonitorContendedEnteredRequest extends EventRequest {
public void addClassExclusionFilter(String arg1) throws InvalidRequestStateException;
- public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
- public void addClassFilter(String arg1) throws InvalidRequestStateException;
+ public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
+ public void addClassFilter(String arg1) throws InvalidRequestStateException;
public void addInstanceFilter(ObjectReference arg1) throws InvalidRequestStateException;
- public void addThreadFilter(ThreadReference arg1) throws InvalidRequestStateException;
+ public void addThreadFilter(ThreadReference arg1) throws InvalidRequestStateException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitRequest.java
index 2a212b152..38ed2f887 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,11 +13,13 @@ package com.sun.jdi.request;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/MonitorWaitRequest.html
+ */
public interface MonitorWaitRequest extends EventRequest {
- public void addClassExclusionFilter(String arg1) throws InvalidRequestStateException;
- public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
- public void addClassFilter(String arg1) throws InvalidRequestStateException;
+ public void addClassExclusionFilter(String arg1) throws InvalidRequestStateException;
+ public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
+ public void addClassFilter(String arg1) throws InvalidRequestStateException;
public void addInstanceFilter(ObjectReference arg1) throws InvalidRequestStateException;
public void addThreadFilter(ThreadReference arg1) throws InvalidRequestStateException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitedRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitedRequest.java
index f8eacb0a5..4b9819afc 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitedRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/MonitorWaitedRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,11 +13,13 @@ package com.sun.jdi.request;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/MonitorWaitedRequest.html
+ */
public interface MonitorWaitedRequest extends EventRequest {
- public void addClassExclusionFilter(String arg1) throws InvalidRequestStateException;
- public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
- public void addClassFilter(String arg1) throws InvalidRequestStateException;
+ public void addClassExclusionFilter(String arg1) throws InvalidRequestStateException;
+ public void addClassFilter(ReferenceType arg1) throws InvalidRequestStateException;
+ public void addClassFilter(String arg1) throws InvalidRequestStateException;
public void addInstanceFilter(ObjectReference arg1) throws InvalidRequestStateException;
public void addThreadFilter(ThreadReference arg1) throws InvalidRequestStateException;
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/StepRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/StepRequest.java
index a7caeb457..2a2ba5cd4 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/StepRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/StepRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/StepRequest.html
+ */
public interface StepRequest extends EventRequest {
public static final int STEP_INTO = 1;
public static final int STEP_OVER = 2;
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadDeathRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadDeathRequest.java
index 202515f53..8dcb50639 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadDeathRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadDeathRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/ThreadDeathRequest.html
+ */
public interface ThreadDeathRequest extends EventRequest {
public void addThreadFilter(ThreadReference arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadStartRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadStartRequest.java
index fca3c76ed..669b6c578 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadStartRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/ThreadStartRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/ThreadStartRequest.html
+ */
public interface ThreadStartRequest extends EventRequest {
public void addThreadFilter(ThreadReference arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/VMDeathRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/VMDeathRequest.java
index 23df36a7d..86def1e9e 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/VMDeathRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/VMDeathRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,9 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.sun.jdi.request;
-
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/VMDeathRequest.html
+ */
public interface VMDeathRequest extends EventRequest {
}
-
diff --git a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/WatchpointRequest.java b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/WatchpointRequest.java
index c19105121..7cfe279c6 100644
--- a/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/WatchpointRequest.java
+++ b/org.eclipse.jdt.debug/jdi interfaces/com/sun/jdi/request/WatchpointRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,12 +10,13 @@
*******************************************************************************/
package com.sun.jdi.request;
-
import com.sun.jdi.Field;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
-
+/**
+ * See http://docs.oracle.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/WatchpointRequest.html
+ */
public interface WatchpointRequest extends EventRequest {
public void addClassExclusionFilter(String arg1);
public void addClassFilter(ReferenceType arg1);
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/Bootstrap.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/Bootstrap.java
index 84cbe9ea5..8d3a0a089 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/Bootstrap.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/Bootstrap.java
@@ -14,29 +14,34 @@ import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
-
-public class Bootstrap
-{
+public class Bootstrap {
private static com.sun.jdi.VirtualMachineManager fVirtualMachineManager;
- public Bootstrap() { }
-
+ public Bootstrap() {
+ }
+
public static synchronized com.sun.jdi.VirtualMachineManager virtualMachineManager() {
if (fVirtualMachineManager != null)
return fVirtualMachineManager;
-
+
try {
- IExtensionRegistry extensionRegistry= Platform.getExtensionRegistry();
- String className= null;
- if (extensionRegistry != null) { // is null if the platform was not started
- className= extensionRegistry.getExtensionPoint(JDIDebugPlugin.getUniqueIdentifier(), "jdiclient").getLabel(); //$NON-NLS-1$
+ IExtensionRegistry extensionRegistry = Platform
+ .getExtensionRegistry();
+ String className = null;
+ if (extensionRegistry != null) { // is null if the platform was not
+ // started
+ className = extensionRegistry
+ .getExtensionPoint(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ "jdiclient").getLabel(); //$NON-NLS-1$
}
- Class clazz= null;
+ Class clazz = null;
if (className != null) {
- clazz= Class.forName(className);
+ clazz = Class.forName(className);
}
if (clazz != null) {
- fVirtualMachineManager = (com.sun.jdi.VirtualMachineManager)clazz.newInstance();
+ fVirtualMachineManager = (com.sun.jdi.VirtualMachineManager) clazz
+ .newInstance();
}
} catch (ClassNotFoundException e) {
} catch (NoClassDefFoundError e) {
@@ -46,9 +51,9 @@ public class Bootstrap
if (fVirtualMachineManager == null) {
// If any exceptions occurred, we'll end up here
- fVirtualMachineManager= new org.eclipse.jdi.internal.VirtualMachineManagerImpl();
+ fVirtualMachineManager = new org.eclipse.jdi.internal.VirtualMachineManagerImpl();
}
-
+
return fVirtualMachineManager;
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/TimeoutException.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/TimeoutException.java
index f0917de7b..17d10e8c7 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/TimeoutException.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/TimeoutException.java
@@ -10,11 +10,13 @@
*******************************************************************************/
package org.eclipse.jdi;
-
public class TimeoutException extends RuntimeException {
- private static final long serialVersionUID = 6009335074727417445L;
- public TimeoutException() { }
+ private static final long serialVersionUID = 6009335074727417445L;
+
+ public TimeoutException() {
+ }
+
public TimeoutException(String message) {
- super(message);
+ super(message);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/VirtualMachine.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/VirtualMachine.java
index 647b44e24..6140a3986 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/VirtualMachine.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/VirtualMachine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,15 +10,16 @@
*******************************************************************************/
package org.eclipse.jdi;
-
public interface VirtualMachine {
/**
- * Sets request timeout in ms.
+ * Sets request timeout in milliseconds
+ *
+ * @param timeout the timeout for the request
*/
public void setRequestTimeout(int timeout);
-
+
/**
- * @return Returns request timeout in ms.
+ * @return Returns request timeout in milliseconds
*/
public int getRequestTimeout();
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/EventRequestManager.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/EventRequestManager.java
index bec0aa914..e1514b869 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/EventRequestManager.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/EventRequestManager.java
@@ -10,36 +10,40 @@
*******************************************************************************/
package org.eclipse.jdi.hcr;
-
+import com.sun.jdi.ObjectCollectedException;
import com.sun.jdi.ThreadReference;
+import com.sun.jdi.request.DuplicateRequestException;
+import com.sun.jdi.request.EventRequest;
/**
- * Hot code replacement extension to <code>com.sun.jdi.request.EventRequestManager</code>.
+ * Hot code replacement extension to
+ * <code>com.sun.jdi.request.EventRequestManager</code>.
*/
public interface EventRequestManager extends com.sun.jdi.Mirror {
/**
- * Creates a new disabled {@link ReenterStepRequest}.
- * The new event request is added to the list managed by this
- * EventRequestManager. Use {@link EventRequest#enable()} to
- * activate this event request.
+ * Creates a new disabled {@link ReenterStepRequest}. The new event request
+ * is added to the list managed by this EventRequestManager. Use
+ * {@link EventRequest#enable()} to activate this event request.
* <p>
* The returned request will control stepping only in the specified
* <code>thread</code>; all other threads will be unaffected.
* <p>
* Only one pending reenter step request is allowed per thread.
* <p>
- * Note that enabling such a request can throw an <code>OperationRefusedException</code>
- * if the VM refused to perform this operation.
- * This in recognition that the VM may be in an awkward state and unable to comply.
- * For example, execution is suspended in a native method and the arguments would be
- * unavailable on return .
- *
- * @param thread the thread in which to step
+ * Note that enabling such a request can throw an
+ * <code>OperationRefusedException</code> if the VM refused to perform this
+ * operation. This in recognition that the VM may be in an awkward state and
+ * unable to comply. For example, execution is suspended in a native method
+ * and the arguments would be unavailable on return .
+ *
+ * @param thread
+ * the thread in which to step
* @return the created {@link ReenterStepRequest}
- * @throws DuplicateRequestException if there is already a pending
- * step request for the specified thread.
- * @throws ObjectCollectedException if the thread object has been
- * garbage collected.
+ * @throws DuplicateRequestException
+ * if there is already a pending step request for the specified
+ * thread.
+ * @throws ObjectCollectedException
+ * if the thread object has been garbage collected.
*/
public ReenterStepRequest createReenterStepRequest(ThreadReference thread);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/OperationRefusedException.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/OperationRefusedException.java
index e997c79b8..519558f3a 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/OperationRefusedException.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/OperationRefusedException.java
@@ -10,20 +10,19 @@
*******************************************************************************/
package org.eclipse.jdi.hcr;
-
/**
* Thrown to indicate that the target VM refused to perform an operation.
*/
public class OperationRefusedException extends RuntimeException {
-
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
+
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
public OperationRefusedException() {
}
-
+
public OperationRefusedException(String s) {
super(s);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReenterStepRequest.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReenterStepRequest.java
index b64af21c8..48c30d23a 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReenterStepRequest.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReenterStepRequest.java
@@ -10,59 +10,64 @@
*******************************************************************************/
package org.eclipse.jdi.hcr;
-
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadReference;
import com.sun.jdi.request.StepRequest;
/**
- * A reenter step request is a step event request that will be activated when the given
- * thread is about to pop the top stack frame. At this point, the VM is expected to do
- * the following:
+ * A reenter step request is a step event request that will be activated when
+ * the given thread is about to pop the top stack frame. At this point, the VM
+ * is expected to do the following:
* <ol>
- * <li>The arguments to the method are carefully set aside, along with the identity of the
- * actual method.
- * <li>The stack frame is popped. Any value being returned is discarded. Any exception being
- * thrown is ignored. Instruction counter in caller is set <i>at</i> (rather than after) the
- * send bytecode.
- * <li>Suspend the thread depending on the suspend policy and report a <code>StepEvent</code>
- * for this request.
- * <li>When the thread is resumed, the method is re-retrieved; if the class had recently
- * been reloaded, this must find the new bytecodes. If the method is no longer present,
- * throw a <code>java.lang.NoSuchMethodError</code> as specified in the Java VM
- * Specification.
- * <li>The method is entered as per normal, using the saved arguments.
+ * <li>The arguments to the method are carefully set aside, along with the
+ * identity of the actual method.
+ * <li>The stack frame is popped. Any value being returned is discarded. Any
+ * exception being thrown is ignored. Instruction counter in caller is set
+ * <i>at</i> (rather than after) the send bytecode.
+ * <li>Suspend the thread depending on the suspend policy and report a
+ * <code>StepEvent</code> for this request.
+ * <li>When the thread is resumed, the method is re-retrieved; if the class had
+ * recently been reloaded, this must find the new bytecodes. If the method is no
+ * longer present, throw a <code>java.lang.NoSuchMethodError</code> as specified
+ * in the Java VM Specification.
+ * <li>The method is entered as per normal, using the saved arguments.
* </ol>
* <p>
- * Note that other events may need to be reported as well (e.g., hit breakpoint on first
- * instruction). Execution does not reenter the caller at any point; so no step out or step
- * into events are reported.
- *
+ * Note that other events may need to be reported as well (e.g., hit breakpoint
+ * on first instruction). Execution does not reenter the caller at any point; so
+ * no step out or step into events are reported.
+ *
*/
public interface ReenterStepRequest extends StepRequest {
/**
- * Restricts the events generated by this request to those
- * whose location is in a class whose name does NOT match this restricted
- * regular expression. e.g. "java.*" or "*.Foo".
- * @param classPattern the pattern String to filter against.
+ * Restricts the events generated by this request to those whose location is
+ * in a class whose name does NOT match this restricted regular expression.
+ * e.g. "java.*" or "*.Foo".
+ *
+ * @param classPattern
+ * the pattern String to filter against.
*/
public void addClassExclusionFilter(String classPattern);
-
+
/**
- * Restricts the events generated by this request to those
- * whose location is in this class..
- * @param clazz the class to filter on.
+ * Restricts the events generated by this request to those whose location is
+ * in this class..
+ *
+ * @param clazz
+ * the class to filter on.
*/
public void addClassFilter(ReferenceType clazz);
-
+
/**
- * Restricts the events generated by this request to those
- * whose location is in a class whose name matches this restricted
- * regular expression. e.g. "java.*" or "*.Foo".
- * @param classPattern the pattern String to filter for.
+ * Restricts the events generated by this request to those whose location is
+ * in a class whose name matches this restricted regular expression. e.g.
+ * "java.*" or "*.Foo".
+ *
+ * @param classPattern
+ * the pattern String to filter for.
*/
public void addClassFilter(String classPattern);
-
+
/**
* @return the thread on which the step event is being requested.
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReferenceType.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReferenceType.java
index 75c22ca1e..935c657ef 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReferenceType.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ReferenceType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,59 +10,68 @@
*******************************************************************************/
package org.eclipse.jdi.hcr;
-
/**
* Hot code replacement extension to <code>com.sun.jdi.ReferenceType</code>.
*/
public interface ReferenceType {
/**
- * An HCR-eligible class file may now be loaded and reloaded at some later point(s).
- * Methods on the stack may come from any of several versions of the same HCR-eligible class.
- * The debugger can query any class file related object (class, method, or field) for
- * information about the version of the class file from which it came.
+ * An HCR-eligible class file may now be loaded and reloaded at some later
+ * point(s). Methods on the stack may come from any of several versions of
+ * the same HCR-eligible class. The debugger can query any class file
+ * related object (class, method, or field) for information about the
+ * version of the class file from which it came.
* <p>
- * Classes loaded by a cooperating class loader are flagged as HCR-eligible for hot code
- * replacement.
+ * Classes loaded by a cooperating class loader are flagged as HCR-eligible
+ * for hot code replacement.
* <p>
- * Class file versions are identified by the CRC-32 of the entire class file contents.
+ * Class file versions are identified by the CRC-32 of the entire class file
+ * contents.
* <p>
- * The VM typically computes and remembers the CRC when it digests a class file. Note
- * this behavior is optional; VM need not retain any CRCs.
- * A debugger can query any class for its class CRC and eligibility:
+ * The VM typically computes and remembers the CRC when it digests a class
+ * file. Note this behavior is optional; VM need not retain any CRCs. A
+ * debugger can query any class for its class CRC and eligibility:
* <ul>
- * <li>The query can be made at at time.
- * <li>This is not directed to any specific thread.
- * <li>Threads may be running at the time; they are not stopped.
- * <li>Other JDI-level operations may be in progress.
- * <li>If a debugger knows only about a method or a field, it must first query its defining
- * class first to find out what is the CRC for this method or field.
+ * <li>The query can be made at at time.
+ * <li>This is not directed to any specific thread.
+ * <li>Threads may be running at the time; they are not stopped.
+ * <li>Other JDI-level operations may be in progress.
+ * <li>If a debugger knows only about a method or a field, it must first
+ * query its defining class first to find out what is the CRC for this
+ * method or field.
* </ul>
- * All information returned does not change over the lifetime of the reference type object
- * (replacing the class results in a new reference type object). This info can therefore be
- * cached client-side with impunity.
+ * All information returned does not change over the lifetime of the
+ * reference type object (replacing the class results in a new reference
+ * type object). This info can therefore be cached client-side with
+ * impunity.
* <p>
- * This simple mechanism allows the IDE to detect that an object does not belong to the current
- * class file base (debugger computes CRC of current class file and queries VM and compares to
- * its CRC). It also allows the debugger to quickly detect whether two objects come from
- * the same class file (debugger queries VM and compares CRCs). By checking the HCR-eligibility
- * bit, the debugger can determine whether the class could be hot replaced in principle.
+ * This simple mechanism allows the IDE to detect that an object does not
+ * belong to the current class file base (debugger computes CRC of current
+ * class file and queries VM and compares to its CRC). It also allows the
+ * debugger to quickly detect whether two objects come from the same class
+ * file (debugger queries VM and compares CRCs). By checking the
+ * HCR-eligibility bit, the debugger can determine whether the class could
+ * be hot replaced in principle.
* <p>
- * Returns the CRC-32 of the entire class file contents for this reference type.
- *
+ * @return the CRC-32 of the entire class file contents for this reference
+ * type.
+ *
* @see org.eclipse.jdi.hcr.VirtualMachine#classesHaveChanged
*/
public int getClassFileVersion();
-
+
/**
* Returns whether this reference type is eligible for hot code replacement.
- *
+ *
+ * @return whether this reference type is eligible for hot code replacement
+ *
* @see org.eclipse.jdi.hcr.ReferenceType#getClassFileVersion
*/
public boolean isHCREligible();
-
+
/**
- * Returns whether this reference type knows its class file version.
- * Returns false for <code>ArrayType</code>s.
+ * Returns whether this reference type knows its class file version. Returns
+ * false for <code>ArrayType</code>s.
+ * @return whether this reference type knows its class file version
*/
public boolean isVersionKnown();
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ThreadReference.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ThreadReference.java
index 1bd5401be..406899222 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ThreadReference.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/ThreadReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.hcr;
-
import com.sun.jdi.Value;
/**
@@ -18,59 +17,71 @@ import com.sun.jdi.Value;
*/
public interface ThreadReference {
/**
- * Resumes the execution of this thread as if the next instruction was a return
- * instruction with the given value. This causes the top stack frame to be popped with
- * the given value.
+ * Resumes the execution of this thread as if the next instruction was a
+ * return instruction with the given value. This causes the top stack frame
+ * to be popped with the given value.
* <p>
- * A breakpoint instruction at the current instruction is not triggered that is, this
- * operation takes precedence over breakpoints. <code>try-finally</code> blocks enclosing
- * the current location will be triggered in due course.
+ * A breakpoint instruction at the current instruction is not triggered that
+ * is, this operation takes precedence over breakpoints.
+ * <code>try-finally</code> blocks enclosing the current location will be
+ * triggered in due course.
* <p>
- * The triggerFinallyAndSynchronizedBlocks option on this operation controls whether
- * <code>try-finally</code> and <code>synchronized</code> blocks enclosing the current
- * location should be triggered:
+ * The triggerFinallyAndSynchronizedBlocks option on this operation controls
+ * whether <code>try-finally</code> and <code>synchronized</code> blocks
+ * enclosing the current location should be triggered:
+ * <ul>
+ * <li>If no, the stack frame is popped, the return value is returned, and
+ * execution continues back in the caller. Note that <code>finally</code>
+ * blocks are not run, and that if the code is nested within a
+ * <code>synchronized</code> statement, the monitor lock is not released
+ * (however, if the method is </code>synchronized</code> the monitor lock
+ * will be properly released). This mechanism is sure-fire, but at the risk
+ * of not letting the target program clean itself up (e.g., close its
+ * files).
+ * <li>If yes, the VM checks to see whether there might be a
+ * <code>finally</code> or <code>synchronized</code> block enclosing the
+ * current instruction.
+ * <ul>
+ * <li>If there is no enclosing <code>finally</code> block, the operation
+ * reduces to the above case.
+ * <li>If there is an enclosing <code>finally</code> block, the VM creates a
+ * VM exception and activates the <code>finally</code> block with it. If
+ * this exception eventually causes the stack frame to be popped, the
+ * exception is caught by the VM itself, the return value is returned, and
+ * execution continues back in the caller.
* <ul>
- * <li>If no, the stack frame is popped, the return value is returned, and execution
- * continues back in the caller. Note that <code>finally</code> blocks are not run,
- * and that if the code is nested within a <code>synchronized</code> statement, the
- * monitor lock is not released (however, if the method is </code>synchronized</code>
- * the monitor lock will be properly released). This mechanism is sure-fire, but at
- * the risk of not letting the target program clean itself up (e.g., close its files).
- * <li>If yes, the VM checks to see whether there might be a <code>finally</code> or
- * <code>synchronized</code> block enclosing the current instruction.
- * <ul>
- * <li>If there is no enclosing <code>finally</code> block, the operation reduces
- * to the above case.
- * <li>If there is an enclosing <code>finally</code> block, the VM creates a VM
- * exception and activates the <code>finally</code> block with it. If this
- * exception eventually causes the stack frame to be popped, the exception is
- * caught by the VM itself, the return value is returned, and execution continues
- * back in the caller.
- * <ul>
* </ul>
* <p>
- * Note that a <code>finally</code> block manifests itself as (and is indistinguishable
- * from) a <code>catch Throwable</code> block. <code>synchronized</code> statements
- * also compile to a <code> catch Throwable block<code>.The target program may inadventently
+ * Note that a <code>finally</code> block manifests itself as (and is
+ * indistinguishable from) a <code>catch Throwable</code> block.
+ * <code>synchronized</code> statements also compile to a
+ * <code> catch Throwable block<code>.The target program may inadventently
* end up catching this exception.
*
* Since the choices each have their pros and cons, making the decision
* is left to the debugger. However the later option is the recommended choice.
* <p>
- * The reply to the operation contains a flag indicating whether any <code>finally</code> or
- * <code>synchronized</code> blocks are enclosing the current instruction.
+ * The reply to the operation contains a flag indicating whether any <code>finally</code>
+ * or <code>synchronized</code> blocks are enclosing the current
+ * instruction.
* <p>
- * This operation is ignored if the thread was not suspended. If the thread was suspended multiple
- * times, wait for the same number of resumes before executing the return instruction.
+ * This operation is ignored if the thread was not suspended. If the thread
+ * was suspended multiple times, wait for the same number of resumes before
+ * executing the return instruction.
* <p>
* The returned value is ignored if the method returns void.
* <p>
- * Throws an <code>OperationRefusedException</code> if the VM refused to perform this operation.
- * This in recognition that the VM may be in an awkward state and unable to comply:
+ * Throws an <code>OperationRefusedException</code> if the VM refused to
+ * perform this operation. This in recognition that the VM may be in an
+ * awkward state and unable to comply:
* <ul>
- * <li>for example, execution is suspended in a native method,
- * <li>for example, execution is suspended during class preparation.
+ * <li>for example, execution is suspended in a native method,
+ * <li>for example, execution is suspended during class preparation.
* </ul>
+ * @param returnValue the value to return from the thread with
+ * @param triggerFinallyAndSynchronizedBlocks if finally / synchronization blocks should be executed before resuming
+ * @return if the forced return was successful
*/
- public boolean doReturn(Value returnValue, boolean triggerFinallyAndSynchronizedBlocks);
+ public boolean doReturn(Value returnValue,
+ boolean triggerFinallyAndSynchronizedBlocks);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/VirtualMachine.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/VirtualMachine.java
index 1ce0d4299..b28b81bcc 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/VirtualMachine.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/hcr/VirtualMachine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.hcr;
-
/**
* Hot code replacement extension to <code>com.sun.jdi.VirtualMachine</code>.
*/
@@ -22,113 +21,130 @@ public interface VirtualMachine {
/** The reload operation was ignored */
public static final int RELOAD_IGNORED = 2;
- /**
- * Determines if this implementation supports the early return
- * of the top stack frame of a thread.
- *
- * @return <code>true</code> if the feature is supported,
- * <code>false</code> otherwise.
+ /**
+ * Determines if this implementation supports the early return of the top
+ * stack frame of a thread.
+ *
+ * @return <code>true</code> if the feature is supported, <code>false</code>
+ * otherwise.
*/
public boolean canDoReturn();
-
- /**
- * Determines if this implementation supports the retrieval
- * of a class file version.
- *
- * @return <code>true</code> if the feature is supported,
- * <code>false</code> otherwise.
+
+ /**
+ * Determines if this implementation supports the retrieval of a class file
+ * version.
+ *
+ * @return <code>true</code> if the feature is supported, <code>false</code>
+ * otherwise.
*/
public boolean canGetClassFileVersion();
-
- /**
+
+ /**
* Determines if this implementation supports the reenter stepping.
- *
- * @return <code>true</code> if the feature is supported,
- * <code>false</code> otherwise.
+ *
+ * @return <code>true</code> if the feature is supported, <code>false</code>
+ * otherwise.
*/
public boolean canReenterOnExit();
-
- /**
- * Determines if this implementation supports the replacement
- * of classes on the fly.
- *
- * @return <code>true</code> if the feature is supported,
- * <code>false</code> otherwise.
+
+ /**
+ * Determines if this implementation supports the replacement of classes on
+ * the fly.
+ *
+ * @return <code>true</code> if the feature is supported, <code>false</code>
+ * otherwise.
*/
public boolean canReloadClasses();
-
+
/**
- * Notifies the VM that the class file base that it is running from has changed.
- * Classes are given by their names.
+ * Notifies the VM that the class file base that it is running from has
+ * changed. Classes are given by their names.
* <p>
- * The class file base is the collection of class files available on the various VM's class paths
- * consulted by the class loaders that are integral to the system. In JDK 1.2, these would
- * include all files on the boot class path (used by the bootstrap class loader), the extension
- * directory (used by the extension class loader), and the regular class path (used by the
- * application class loader). The notion is important because only those classes that the VM
- * knows to be in the class file base will be eligible for hot code replacement. Classes that
- * are actually loaded by non-standard class loaders cannot be replaced on the fly (because the
- * VM has no way of asking non-standard class loaders to reload them). Classes loaded from the
- * class file base by cooperating class loaders are said to be HCR-eligible.
+ * The class file base is the collection of class files available on the
+ * various VM's class paths consulted by the class loaders that are integral
+ * to the system. In JDK 1.2, these would include all files on the boot
+ * class path (used by the bootstrap class loader), the extension directory
+ * (used by the extension class loader), and the regular class path (used by
+ * the application class loader). The notion is important because only those
+ * classes that the VM knows to be in the class file base will be eligible
+ * for hot code replacement. Classes that are actually loaded by
+ * non-standard class loaders cannot be replaced on the fly (because the VM
+ * has no way of asking non-standard class loaders to reload them). Classes
+ * loaded from the class file base by cooperating class loaders are said to
+ * be HCR-eligible.
* <p>
* The VM is expected to:
* <ol>
- * <li>Suspend all running threads.
- * <li>For a given JNI signature, try to find the definition of the corresponding class.
- * <ul>
- * <li>If the class definition can be found then it replaces the previous definition
- * for that class.
- * <li>If a definition for the class is not found, then it is unloaded.
- * <ul>
- * <li>This operation returns only when the classes have been reloaded and/or deleted.
- * <li>If the suspend policy of the class unload event is not to suspend the VM, then the
- * VM resumes all the threads that it has suspended.
- * <li>Finally for each class that has been reloaded, the VM is expected to
- * <ul>
- * <li>send a class unload event,
- * <li>note the VM is already suspended if the suspend policy of class unload event
- * said so,
- * <li>when the frontend resumes the VM, send a class prepare event,
- * <li>suspend the VM according to the suspend policy of the class prepare event
- * request.
- * </ul>
- * <li>For each class that has been unloaded, the VM is expected to
- * <ul>
- * <li>send a class unload event,
- * <li>suspend the VM if it was requested by the class unload event request.
- * </ul>
+ * <li>Suspend all running threads.
+ * <li>For a given JNI signature, try to find the definition of the
+ * corresponding class.
+ * <ul>
+ * <li>If the class definition can be found then it replaces the previous
+ * definition for that class.
+ * <li>If a definition for the class is not found, then it is unloaded.
+ * <ul>
+ * <li>This operation returns only when the classes have been reloaded
+ * and/or deleted.
+ * <li>If the suspend policy of the class unload event is not to suspend the
+ * VM, then the VM resumes all the threads that it has suspended.
+ * <li>Finally for each class that has been reloaded, the VM is expected to
+ * <ul>
+ * <li>send a class unload event,
+ * <li>note the VM is already suspended if the suspend policy of class
+ * unload event said so,
+ * <li>when the frontend resumes the VM, send a class prepare event,
+ * <li>suspend the VM according to the suspend policy of the class prepare
+ * event request.
+ * </ul>
+ * <li>For each class that has been unloaded, the VM is expected to
+ * <ul>
+ * <li>send a class unload event,
+ * <li>suspend the VM if it was requested by the class unload event request.
+ * </ul>
* </ol>
* <p>
- * Subsequent references to classes will work with the new class definition. Note the existing
- * <code>com.sun.jdi.ReferenceType</code>, <code>com.sun.jdi.Method</code> and
- * <code>com.sun.jdi.Field</code> still refer to the old class definition. So they
- * should be discarded when the class unload event come in.
+ * Subsequent references to classes will work with the new class definition.
+ * Note the existing <code>com.sun.jdi.ReferenceType</code>,
+ * <code>com.sun.jdi.Method</code> and <code>com.sun.jdi.Field</code> still
+ * refer to the old class definition. So they should be discarded when the
+ * class unload event come in.
* <p>
* The VM does not discard stack frames automatically:
* <ul>
- * <li>methods on the stack are not affected, and could therefore be referencing
- * obsolete code
- * <li>replacing a class does not affect anything on the stack
- * <li>subsequent class and method lookups find the replacements
+ * <li>methods on the stack are not affected, and could therefore be
+ * referencing obsolete code
+ * <li>replacing a class does not affect anything on the stack
+ * <li>subsequent class and method lookups find the replacements
* </ul>
* <p>
- * Installed breakpoints are not automatically carried over to the reloaded class:
+ * Installed breakpoints are not automatically carried over to the reloaded
+ * class:
* <ul>
- * <li>breakpoints are resolved to particular locations in particular classes and methods
- * <li>the VM must clear breakpoints to methods in classes that have been reloaded or
- * unloaded (the debugger will reinstall them when it gets the class prepare event.)
+ * <li>breakpoints are resolved to particular locations in particular
+ * classes and methods
+ * <li>the VM must clear breakpoints to methods in classes that have been
+ * reloaded or unloaded (the debugger will reinstall them when it gets the
+ * class prepare event.)
* </ul>
* <p>
- * A change notice encompasses changes to the content of a class file in the base, the addition
- * of a class files to the base, and the removal of a class file from the base.
+ * A change notice encompasses changes to the content of a class file in the
+ * base, the addition of a class files to the base, and the removal of a
+ * class file from the base.
* <p>
- * Change notices apply to all classes that are HCR-eligible (i.e., loaded by one of the
- * cooperative system class loaders); other classes are never affected.
+ * Change notices apply to all classes that are HCR-eligible (i.e., loaded
+ * by one of the cooperative system class loaders); other classes are never
+ * affected.
* <p>
- * Returns whether the operation could be completed as specified above, whether it was
- * ignored (for example if the VM doesn't support this kind of replacement), or whether the
- * operation failed and the VM should be restarted.
- *
+ * Returns whether the operation could be completed as specified above,
+ * whether it was ignored (for example if the VM doesn't support this kind
+ * of replacement), or whether the operation failed and the VM should be
+ * restarted.
+ * @param arg1 the names of the classes that have changed
+ * @return whether the operation could be completed as specified above,
+ * whether it was ignored (for example if the VM doesn't support this kind
+ * of replacement), or whether the operation failed and the VM should be
+ * restarted
+ *
*/
public int classesHaveChanged(String[] arg1);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/AccessibleImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/AccessibleImpl.java
index ec532597f..07f3b3208 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/AccessibleImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/AccessibleImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,17 +10,15 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import com.sun.jdi.Accessible;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public abstract class AccessibleImpl extends MirrorImpl implements Accessible {
/** Modifier bit flag: Is synthetic. see MODIFIER_ACC_SYNTHETIC. */
@@ -39,63 +37,79 @@ public abstract class AccessibleImpl extends MirrorImpl implements Accessible {
public static final int MODIFIER_ACC_SYNCHRONIZED = 0x0020;
/** Modifier bit flag: Treat superclass methods specially in invokespecial. */
public static final int MODIFIER_ACC_SUPER = 0x0020;
- /** Modifier bit flag: Is bridge; the method is a synthetic method created to support generic types. */
+ /**
+ * Modifier bit flag: Is bridge; the method is a synthetic method created to
+ * support generic types.
+ */
public static final int MODIFIER_ACC_BRIDGE = 0x0040;
/** Modifier bit flag: Is volitile; cannot be reached. */
public static final int MODIFIER_ACC_VOLITILE = 0x0040;
- /** Modifier bit flag: Is transient; not written or read by a persistent object manager. */
+ /**
+ * Modifier bit flag: Is transient; not written or read by a persistent
+ * object manager.
+ */
public static final int MODIFIER_ACC_TRANSIENT = 0x0080;
- /** Modifier bit flag: Is varargs; the method has been declared with variable number of arguments. */
+ /**
+ * Modifier bit flag: Is varargs; the method has been declared with variable
+ * number of arguments.
+ */
public static final int MODIFIER_ACC_VARARGS = 0x0080;
- /** Modifier bit flag: Is enum; the field hold an element of an enumerated type. */
+ /**
+ * Modifier bit flag: Is enum; the field hold an element of an enumerated
+ * type.
+ */
public static final int MODIFIER_ACC_ENUM = 0x0100;
/** Modifier bit flag: Is native; implemented in a language other than Java. */
public static final int MODIFIER_ACC_NATIVE = 0x0100;
/** Modifier bit flag: Is abstract; no implementation is provided. */
public static final int MODIFIER_ACC_ABSTRACT = 0x0400;
- /** Modifier bit flag: Is strict; the method floating-point mode is FP-strict*/
+ /**
+ * Modifier bit flag: Is strict; the method floating-point mode is FP-strict
+ */
public static final int MODIFIER_ACC_STRICT = 0x0800;
/** Modifier bit flag: Is synthetic. see MODIFIER_SYNTHETIC. */
public static final int MODIFIER_ACC_SYNTHETIC = 0x1000;
-
+
/** Mapping of command codes to strings. */
private static String[] fgModifiers = null;
-
+
/**
* Creates new instance.
+ * @param description the description
+ * @param vmImpl the VM
*/
public AccessibleImpl(String description, VirtualMachineImpl vmImpl) {
super(description, vmImpl);
}
- /**
+ /**
* @return Returns true if object is package private.
*/
public boolean isPackagePrivate() {
return !(isPrivate() || isPublic() || isProtected());
}
-
- /**
+
+ /**
* @return Returns true if object is private.
*/
public boolean isPrivate() {
return (modifiers() & MODIFIER_ACC_PRIVATE) != 0;
}
-
- /**
+
+ /**
* @return Returns true if object is pubic.
*/
public boolean isPublic() {
return (modifiers() & MODIFIER_ACC_PUBLIC) != 0;
}
-
- /**
+
+ /**
* @return Returns true if object is protected.
*/
public boolean isProtected() {
return (modifiers() & MODIFIER_ACC_PROTECTED) != 0;
}
-
+
/**
* Retrieves constant mappings.
*/
@@ -103,29 +117,30 @@ public abstract class AccessibleImpl extends MirrorImpl implements Accessible {
if (fgModifiers != null) {
return;
}
-
+
Field[] fields = AccessibleImpl.class.getDeclaredFields();
fgModifiers = new String[32];
-
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- int modifiers= field.getModifiers();
- if ((modifiers & Modifier.PUBLIC) == 0 || (modifiers & Modifier.STATIC) == 0 || (modifiers & Modifier.FINAL) == 0)
+
+ for (Field field : fields) {
+ int modifiers = field.getModifiers();
+ if ((modifiers & Modifier.PUBLIC) == 0
+ || (modifiers & Modifier.STATIC) == 0
+ || (modifiers & Modifier.FINAL) == 0)
continue;
-
+
String name = field.getName();
if (!name.startsWith("MODIFIER_")) {//$NON-NLS-1$
continue;
}
-
+
name = name.substring(9);
-
+
try {
int value = field.getInt(null);
-
+
for (int j = 0; j < 32; j++) {
if ((1 << j & value) != 0) {
- fgModifiers[j]= name;
+ fgModifiers[j] = name;
break;
}
}
@@ -138,12 +153,12 @@ public abstract class AccessibleImpl extends MirrorImpl implements Accessible {
}
}
}
-
+
/**
* @return Returns an array with string representations of tags.
*/
- public static String[] getModifierStrings() {
- getConstantMaps();
- return fgModifiers;
- }
+ public static String[] getModifierStrings() {
+ getConstantMaps();
+ return fgModifiers;
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayReferenceImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayReferenceImpl.java
index 093f99a14..4394ab6f2 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayReferenceImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayReferenceImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -34,119 +33,140 @@ import com.sun.jdi.Type;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayReference {
+public class ArrayReferenceImpl extends ObjectReferenceImpl implements
+ ArrayReference {
/** JDWP Tag. */
public static final byte tag = JdwpID.ARRAY_TAG;
-
+
private int fLength = -1;
-
+
/**
* Creates new ArrayReferenceImpl.
+ * @param vmImpl the VM
+ * @param objectID the object ID
*/
public ArrayReferenceImpl(VirtualMachineImpl vmImpl, JdwpObjectID objectID) {
super("ArrayReference", vmImpl, objectID); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
+ * Returns the {@link Value} from the given index
+ * @param index the index
+ * @return the {@link Value} at the given index
+ * @throws IndexOutOfBoundsException if the index is outside the bounds of the array
* @returns Returns an array component value.
*/
public Value getValue(int index) throws IndexOutOfBoundsException {
- return (Value)getValues(index, 1).get(0);
+ return getValues(index, 1).get(0);
}
-
+
/**
- * @returns Returns all of the components in this array.
+ * @return all of the components in this array.
*/
- public List getValues() {
+ public List<Value> getValues() {
return getValues(0, -1);
}
-
+
/**
+ * Gets all of the values starting at firstIndex and ending at firstIndex+length
+ *
+ * @param firstIndex the start
+ * @param length the number of values to return
+ * @return the list of {@link Value}s
+ * @throws IndexOutOfBoundsException if the index is outside the bounds of the array
* @returns Returns a range of array components.
*/
- public List getValues(int firstIndex, int length) throws IndexOutOfBoundsException {
+ public List<Value> getValues(int firstIndex, int length)
+ throws IndexOutOfBoundsException {
- int arrayLength= length();
+ int arrayLength = length();
if (firstIndex < 0 || firstIndex >= arrayLength) {
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Invalid_index_1);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Invalid_index_1);
}
-
+
if (length == -1) {
// length == -1 means all elements to the end.
length = arrayLength - firstIndex;
} else if (length < -1) {
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Invalid_number_of_value_to_get_from_array_1);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Invalid_number_of_value_to_get_from_array_1);
} else if (firstIndex + length > arrayLength) {
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Attempted_to_get_more_values_from_array_than_length_of_array_2);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Attempted_to_get_more_values_from_array_than_length_of_array_2);
}
-
+
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
- write(this, outData); // arrayObject
+ write(this, outData); // arrayObject
writeInt(firstIndex, "firstIndex", outData); //$NON-NLS-1$
writeInt(length, "length", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.AR_GET_VALUES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.AR_GET_VALUES, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_INDEX:
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Invalid_index_of_array_reference_given_1);
+ case JdwpReplyPacket.INVALID_INDEX:
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Invalid_index_of_array_reference_given_1);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
-
- /* NOTE: The JDWP documentation is not clear on this: it turns out that the following is received from the VM:
- * - type tag;
- * - length of array;
- * - values of elements.
+
+ /*
+ * NOTE: The JDWP documentation is not clear on this: it turns out
+ * that the following is received from the VM: - type tag; - length
+ * of array; - values of elements.
*/
int type = readByte("type", JdwpID.tagMap(), replyData); //$NON-NLS-1$
int readLength = readInt("length", replyData); //$NON-NLS-1$
// See also ValueImpl.
- switch(type) {
- // Multidimensional array.
- case ArrayReferenceImpl.tag:
+ switch (type) {
+ // Multidimensional array.
+ case ArrayReferenceImpl.tag:
// Object references.
- case ClassLoaderReferenceImpl.tag:
- case ClassObjectReferenceImpl.tag:
- case StringReferenceImpl.tag:
- case ObjectReferenceImpl.tag:
- case ThreadGroupReferenceImpl.tag:
- case ThreadReferenceImpl.tag:
- return readObjectSequence(readLength, replyData);
+ case ClassLoaderReferenceImpl.tag:
+ case ClassObjectReferenceImpl.tag:
+ case StringReferenceImpl.tag:
+ case ObjectReferenceImpl.tag:
+ case ThreadGroupReferenceImpl.tag:
+ case ThreadReferenceImpl.tag:
+ return readObjectSequence(readLength, replyData);
// Primitive type.
- case BooleanValueImpl.tag:
- case ByteValueImpl.tag:
- case CharValueImpl.tag:
- case DoubleValueImpl.tag:
- case FloatValueImpl.tag:
- case IntegerValueImpl.tag:
- case LongValueImpl.tag:
- case ShortValueImpl.tag:
- return readPrimitiveSequence(readLength, type, replyData);
-
- case VoidValueImpl.tag:
- case 0:
- default:
- throw new InternalException(JDIMessages.ArrayReferenceImpl_Invalid_ArrayReference_Value_tag_encountered___2 + type);
+ case BooleanValueImpl.tag:
+ case ByteValueImpl.tag:
+ case CharValueImpl.tag:
+ case DoubleValueImpl.tag:
+ case FloatValueImpl.tag:
+ case IntegerValueImpl.tag:
+ case LongValueImpl.tag:
+ case ShortValueImpl.tag:
+ return readPrimitiveSequence(readLength, type, replyData);
+
+ case VoidValueImpl.tag:
+ case 0:
+ default:
+ throw new InternalException(
+ JDIMessages.ArrayReferenceImpl_Invalid_ArrayReference_Value_tag_encountered___2
+ + type);
}
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -157,33 +177,45 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
}
/**
+ * Reads the given length of objects from the given stream
+ * @param length the number of objects to read
+ * @param in the stream to read from
+ * @return the {@link List} of {@link ValueImpl}s
+ * @throws IOException if the reading fails
* @returns Returns sequence of object reference values.
*/
- private List readObjectSequence(int length, DataInputStream in) throws IOException {
- List elements = new ArrayList(length);
+ private List<Value> readObjectSequence(int length, DataInputStream in)
+ throws IOException {
+ List<Value> elements = new ArrayList<Value>(length);
for (int i = 0; i < length; i++) {
- ValueImpl value = ObjectReferenceImpl.readObjectRefWithTag(this, in);
+ ValueImpl value = ObjectReferenceImpl
+ .readObjectRefWithTag(this, in);
elements.add(value);
}
return elements;
}
-
+
/**
- * @param length the number of primitives to read
- * @param type the type
- * @param in the input stream
+ * @param length
+ * the number of primitives to read
+ * @param type
+ * the type
+ * @param in
+ * the input stream
* @return Returns sequence of values of primitive type.
- * @throws IOException if reading from the stream encounters a problem
+ * @throws IOException
+ * if reading from the stream encounters a problem
*/
- private List readPrimitiveSequence(int length, int type, DataInputStream in) throws IOException {
- List elements = new ArrayList(length);
+ private List<Value> readPrimitiveSequence(int length, int type, DataInputStream in)
+ throws IOException {
+ List<Value> elements = new ArrayList<Value>(length);
for (int i = 0; i < length; i++) {
ValueImpl value = ValueImpl.readWithoutTag(this, type, in);
elements.add(value);
}
return elements;
}
-
+
/**
* @return Returns the number of components in this array.
*/
@@ -191,7 +223,8 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
if (fLength == -1) {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.AR_LENGTH, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.AR_LENGTH, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
fLength = readInt("length", replyData); //$NON-NLS-1$
@@ -204,76 +237,107 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
}
return fLength;
}
-
+
/**
* Replaces an array component with another value.
- * @param index the index to set the value in
- * @param value the new value
- * @throws InvalidTypeException thrown if the types of the replacements do not match the underlying type of the {@link ArrayReference}
- * @throws ClassNotLoadedException thrown if the class type for the {@link ArrayReference} is not loaded or has been GC'd
+ *
+ * @param index
+ * the index to set the value in
+ * @param value
+ * the new value
+ * @throws InvalidTypeException
+ * thrown if the types of the replacements do not match the
+ * underlying type of the {@link ArrayReference}
+ * @throws ClassNotLoadedException
+ * thrown if the class type for the {@link ArrayReference} is
+ * not loaded or has been GC'd
* @see #setValues(int, List, int, int)
*/
- public void setValue(int index, Value value) throws InvalidTypeException, ClassNotLoadedException {
- ArrayList list = new ArrayList(1);
+ public void setValue(int index, Value value) throws InvalidTypeException,
+ ClassNotLoadedException {
+ ArrayList<Value> list = new ArrayList<Value>(1);
list.add(value);
setValues(index, list, 0, 1);
}
-
+
/**
* Replaces all array components with other values.
*
- * @param values the new values to set in the array
- * @throws InvalidTypeException thrown if the types of the replacements do not match the underlying type of the {@link ArrayReference}
- * @throws ClassNotLoadedException thrown if the class type for the {@link ArrayReference} is not loaded or has been GC'd
+ * @param values
+ * the new values to set in the array
+ * @throws InvalidTypeException
+ * thrown if the types of the replacements do not match the
+ * underlying type of the {@link ArrayReference}
+ * @throws ClassNotLoadedException
+ * thrown if the class type for the {@link ArrayReference} is
+ * not loaded or has been GC'd
* @see #setValues(int, List, int, int)
*/
- public void setValues(List values) throws InvalidTypeException, ClassNotLoadedException {
+ public void setValues(List<? extends Value> values) throws InvalidTypeException,
+ ClassNotLoadedException {
setValues(0, values, 0, -1);
}
-
+
/**
* Replaces a range of array components with other values.
*
- * @param index offset in this array to start replacing values at
- * @param values replacement values
- * @param srcIndex the first offset where values are copied from the given replacement values
- * @param length the number of values to replace in this array
- * @throws InvalidTypeException thrown if the types of the replacements do not match the underlying type of the {@link ArrayReference}
- * @throws ClassNotLoadedException thrown if the class type for the {@link ArrayReference} is not loaded or has been GC'd
+ * @param index
+ * offset in this array to start replacing values at
+ * @param values
+ * replacement values
+ * @param srcIndex
+ * the first offset where values are copied from the given
+ * replacement values
+ * @param length
+ * the number of values to replace in this array
+ * @throws InvalidTypeException
+ * thrown if the types of the replacements do not match the
+ * underlying type of the {@link ArrayReference}
+ * @throws ClassNotLoadedException
+ * thrown if the class type for the {@link ArrayReference} is
+ * not loaded or has been GC'd
*/
- public void setValues(int index, List values, int srcIndex, int length) throws InvalidTypeException, ClassNotLoadedException {
- if(values == null || values.size() == 0) {
- //trying to set nothing should do no work
+ public void setValues(int index, List<? extends Value> values, int srcIndex, int length)
+ throws InvalidTypeException, ClassNotLoadedException {
+ if (values == null || values.size() == 0) {
+ // trying to set nothing should do no work
return;
}
- int valuesSize= values.size();
- int arrayLength= length();
-
+ int valuesSize = values.size();
+ int arrayLength = length();
+
if (index < 0 || index >= arrayLength) {
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Invalid_index_1);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Invalid_index_1);
}
if (srcIndex < 0 || srcIndex >= valuesSize) {
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Invalid_srcIndex_2);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Invalid_srcIndex_2);
}
-
+
if (length < -1) {
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Invalid_number_of_value_to_set_in_array_3);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Invalid_number_of_value_to_set_in_array_3);
} else if (length == -1) {
// length == -1 indicates as much values as possible.
length = arrayLength - index;
- int lengthTmp= valuesSize - srcIndex;
+ int lengthTmp = valuesSize - srcIndex;
if (lengthTmp < length) {
- length= lengthTmp;
+ length = lengthTmp;
}
} else if (index + length > arrayLength) {
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Attempted_to_set_more_values_in_array_than_length_of_array_3);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Attempted_to_set_more_values_in_array_than_length_of_array_3);
} else if (srcIndex + length > valuesSize) {
// Check if enough values are given.
- throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Attempted_to_set_more_values_in_array_than_given_4);
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ArrayReferenceImpl_Attempted_to_set_more_values_in_array_than_given_4);
}
-
+
// check and convert the values if needed.
- List checkedValues= checkValues(values.subList(srcIndex, srcIndex + length), ((ArrayTypeImpl) referenceType()).componentType());
+ List<Value> checkedValues = checkValues(
+ values.subList(srcIndex, srcIndex + length),
+ ((ArrayTypeImpl) referenceType()).componentType());
// Note that this information should not be cached.
initJdwpRequest();
@@ -283,22 +347,23 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
write(this, outData);
writeInt(index, "index", outData); //$NON-NLS-1$
writeInt(length, "length", outData); //$NON-NLS-1$
- Iterator iterValues= checkedValues.iterator();
+ Iterator<Value> iterValues = checkedValues.iterator();
while (iterValues.hasNext()) {
- ValueImpl value= (ValueImpl)iterValues.next();
+ ValueImpl value = (ValueImpl) iterValues.next();
if (value != null) {
value.write(this, outData);
} else {
ValueImpl.writeNull(this, outData);
}
}
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.AR_SET_VALUES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.AR_SET_VALUES, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.TYPE_MISMATCH:
- throw new InvalidTypeException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotLoadedException(type().name());
+ case JdwpReplyPacket.TYPE_MISMATCH:
+ throw new InvalidTypeException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotLoadedException(type().name());
}
defaultReplyErrorHandler(replyPacket.errorCode());
} catch (IOException e) {
@@ -309,28 +374,37 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
}
/**
- * Check the type and the VM of the values. If the given type is a primitive type,
- * the values may be converted to match this type.
+ * Check the type and the VM of the values. If the given type is a primitive
+ * type, the values may be converted to match this type.
*
- * @param values the value(s) to check
- * @param type the type to compare the values to
+ * @param values
+ * the value(s) to check
+ * @param type
+ * the type to compare the values to
* @return the list of values converted to the given type
- * @throws InvalidTypeException if the underlying type of an object in the list is not compatible
+ * @throws InvalidTypeException
+ * if the underlying type of an object in the list is not
+ * compatible
*
* @see ValueImpl#checkValue(Value, Type, VirtualMachineImpl)
*/
- private List checkValues(List values, Type type) throws InvalidTypeException {
- List checkedValues= new ArrayList(values.size());
- Iterator iterValues= values.iterator();
+ private List<Value> checkValues(List<? extends Value> values, Type type)
+ throws InvalidTypeException {
+ List<Value> checkedValues = new ArrayList<Value>(values.size());
+ Iterator<? extends Value> iterValues = values.iterator();
while (iterValues.hasNext()) {
- checkedValues.add(ValueImpl.checkValue((Value) iterValues.next(), type, virtualMachineImpl()));
+ checkedValues.add(ValueImpl.checkValue(iterValues.next(),
+ type, virtualMachineImpl()));
}
return checkedValues;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdi.internal.ObjectReferenceImpl#toString()
*/
+ @Override
public String toString() {
try {
StringBuffer buf = new StringBuffer(type().name());
@@ -341,7 +415,8 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
buf.append(idString());
return buf.toString();
} catch (ObjectCollectedException e) {
- return JDIMessages.ArrayReferenceImpl__Garbage_Collected__ArrayReference_5 + "[" + length() + "] " + idString(); //$NON-NLS-1$ //$NON-NLS-2$
+ return JDIMessages.ArrayReferenceImpl__Garbage_Collected__ArrayReference_5
+ + "[" + length() + "] " + idString(); //$NON-NLS-1$ //$NON-NLS-2$
} catch (Exception e) {
return fDescription;
}
@@ -350,12 +425,16 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
/**
* Reads JDWP representation and returns new instance.
*
- * @param target the target {@link Mirror} object
- * @param in the input stream to read from
+ * @param target
+ * the target {@link Mirror} object
+ * @param in
+ * the input stream to read from
* @return Reads JDWP representation and returns new instance.
- * @throws IOException if there is a problem reading from the stream
+ * @throws IOException
+ * if there is a problem reading from the stream
*/
- public static ArrayReferenceImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ArrayReferenceImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpObjectID ID = new JdwpObjectID(vmImpl);
ID.read(in);
@@ -366,7 +445,7 @@ public class ArrayReferenceImpl extends ObjectReferenceImpl implements ArrayRefe
if (ID.isNull()) {
return null;
}
-
+
ArrayReferenceImpl mirror = new ArrayReferenceImpl(vmImpl, ID);
return mirror;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayTypeImpl.java
index 6030b9af3..92a183db7 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ArrayTypeImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -31,25 +30,29 @@ import com.sun.jdi.ArrayReference;
import com.sun.jdi.ArrayType;
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.Field;
+import com.sun.jdi.Location;
+import com.sun.jdi.Method;
+import com.sun.jdi.ReferenceType;
import com.sun.jdi.Type;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
/** JDWP Tag. */
public static final byte typeTag = JdwpID.TYPE_TAG_ARRAY;
/** component type */
private Type fComponentType;
- /** Component type name */
+ /** Component type name */
private String fComponentTypeName;
-
+
/**
* Creates new ArrayTypeImpl.
+ * @param vmImpl the VM
+ * @param arrayID the array ID
*/
public ArrayTypeImpl(VirtualMachineImpl vmImpl, JdwpArrayID arrayID) {
super("ArrayType", vmImpl, arrayID); //$NON-NLS-1$
@@ -57,23 +60,31 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
/**
* Creates new ArrayTypeImpl.
+ * @param vmImpl the VM
+ * @param arrayID the array ID
+ * @param signature the array type signature
+ * @param genericSignature the array type generic signature
*/
- public ArrayTypeImpl(VirtualMachineImpl vmImpl, JdwpArrayID arrayID, String signature, String genericSignature) {
+ public ArrayTypeImpl(VirtualMachineImpl vmImpl, JdwpArrayID arrayID,
+ String signature, String genericSignature) {
super("ArrayType", vmImpl, arrayID, signature, genericSignature); //$NON-NLS-1$
}
/**
* @return Returns type tag.
*/
+ @Override
public byte typeTag() {
return typeTag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
- return new ArrayReferenceImpl(virtualMachineImpl(), new JdwpObjectID(virtualMachineImpl()));
+ return new ArrayReferenceImpl(virtualMachineImpl(), new JdwpObjectID(
+ virtualMachineImpl()));
}
/**
@@ -84,11 +95,13 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
}
/**
- * @return Returns the type of the array components.
+ * @return Returns the type of the array components.
+ * @throws ClassNotLoadedException if the class has not been loaded
*/
public Type componentType() throws ClassNotLoadedException {
if (fComponentType == null) {
- fComponentType = TypeImpl.create(virtualMachineImpl(), componentSignature(), classLoader());
+ fComponentType = TypeImpl.create(virtualMachineImpl(),
+ componentSignature(), classLoader());
}
return fComponentType;
}
@@ -104,7 +117,9 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
}
/**
- * @return Creates and returns a new instance of this array class in the target VM.
+ * @param length the desired length of the new array
+ * @return Creates and returns a new instance of this array class in the
+ * target VM.
*/
public ArrayReference newInstance(int length) {
// Note that this information should not be cached.
@@ -114,12 +129,14 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
writeInt(length, "length", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.AT_NEW_INSTANCE, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.AT_NEW_INSTANCE, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
- ArrayReferenceImpl arrayRef = (ArrayReferenceImpl)ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
+ ArrayReferenceImpl arrayRef = (ArrayReferenceImpl) ObjectReferenceImpl
+ .readObjectRefWithTag(this, replyData);
return arrayRef;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -128,19 +145,26 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
handledJdwpRequest();
}
}
-
+
/**
- * @return Returns a List filled with all Location objects that map to the given line number.
+ * @return Returns a List filled with all Location objects that map to the
+ * given line number.
*/
- public List locationsOfLine(int line) {
- // If this reference type is an ArrayType, the returned list is always empty.
+ @Override
+ public List<Location> locationsOfLine(int line) {
+ // If this reference type is an ArrayType, the returned list is always
+ // empty.
return Collections.EMPTY_LIST;
}
-
+
/**
+ * @param target the target
+ * @param in the stream
* @return Reads JDWP representation and returns new instance.
+ * @throws IOException if the reading fails
*/
- public static ArrayTypeImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ArrayTypeImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpArrayID ID = new JdwpArrayID(vmImpl);
ID.read(in);
@@ -149,65 +173,81 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
if (ID.isNull())
return null;
-
- ArrayTypeImpl mirror = (ArrayTypeImpl)vmImpl.getCachedMirror(ID);
+
+ ArrayTypeImpl mirror = (ArrayTypeImpl) vmImpl.getCachedMirror(ID);
if (mirror == null) {
mirror = new ArrayTypeImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
}
return mirror;
- }
+ }
/**
* @return Returns modifier bits.
*/
+ @Override
public int modifiers() {
return MODIFIER_ACC_PUBLIC | MODIFIER_ACC_FINAL;
}
- /**
- * @return Returns a list containing each Field declared in this type.
+ /**
+ * @return Returns a list containing each Field declared in this type.
*/
- public List fields() {
+ @Override
+ public List<Field> fields() {
return Collections.EMPTY_LIST;
}
- /**
- * @return Returns a list containing each Method declared in this type.
+ /**
+ * @return Returns a list containing each Method declared in this type.
*/
- public List methods() {
+ @Override
+ public List<Method> methods() {
return Collections.EMPTY_LIST;
}
- /**
+ /**
* @return a Map of the requested static Field objects with their Value.
*/
- public Map getValues(List fields) {
+ @Override
+ public Map<Field, Value> getValues(List<? extends Field> fields) {
if (fields.isEmpty()) {
- return new HashMap();
+ return new HashMap<Field, Value>();
}
-
- throw new IllegalArgumentException(JDIMessages.ArrayTypeImpl_getValues_not_allowed_on_array_1);
+
+ throw new IllegalArgumentException(
+ JDIMessages.ArrayTypeImpl_getValues_not_allowed_on_array_1);
}
- /**
- * @return Returns a List containing each ReferenceType declared within this type.
+ /**
+ * @return Returns a List containing each ReferenceType declared within this
+ * type.
*/
- public List nestedTypes() {
+ @Override
+ public List<ReferenceType> nestedTypes() {
return Collections.EMPTY_LIST;
}
-
- /**
+
+ /**
* @return Returns status of class/interface.
*/
- protected int status() {
- return ReferenceTypeImpl.JDWP_CLASS_STATUS_INITIALIZED | ReferenceTypeImpl.JDWP_CLASS_STATUS_PREPARED | ReferenceTypeImpl.JDWP_CLASS_STATUS_VERIFIED;
+ @Override
+ protected int status() {
+ return ReferenceTypeImpl.JDWP_CLASS_STATUS_INITIALIZED
+ | ReferenceTypeImpl.JDWP_CLASS_STATUS_PREPARED
+ | ReferenceTypeImpl.JDWP_CLASS_STATUS_VERIFIED;
}
-
+
/**
+ * @param target the target
+ * @param withGenericSignature if the generic signature should be read
+ * @param in the stream
* @return Reads JDWP representation and returns new instance.
+ * @throws IOException if the read fails
*/
- public static ArrayTypeImpl readWithSignature(MirrorImpl target, boolean withGenericSignature, DataInputStream in) throws IOException {
+ public static ArrayTypeImpl readWithSignature(MirrorImpl target,
+ boolean withGenericSignature, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpArrayID ID = new JdwpArrayID(vmImpl);
ID.read(in);
@@ -215,14 +255,14 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
target.fVerboseWriter.println("arrayType", ID.value()); //$NON-NLS-1$
String signature = target.readString("signature", in); //$NON-NLS-1$
- String genericSignature= null;
+ String genericSignature = null;
if (withGenericSignature) {
- genericSignature= target.readString("generic signature", in); //$NON-NLS-1$
+ genericSignature = target.readString("generic signature", in); //$NON-NLS-1$
}
if (ID.isNull())
return null;
-
- ArrayTypeImpl mirror = (ArrayTypeImpl)vmImpl.getCachedMirror(ID);
+
+ ArrayTypeImpl mirror = (ArrayTypeImpl) vmImpl.getCachedMirror(ID);
if (mirror == null) {
mirror = new ArrayTypeImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
@@ -230,64 +270,81 @@ public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType {
mirror.setSignature(signature);
mirror.setGenericSignature(genericSignature);
return mirror;
- }
-
+ }
+
/**
* @see com.sun.jdi.ReferenceType#allLineLocations()
*/
- public List allLineLocations() {
- // If this reference type is an ArrayType, the returned list is always empty.
+ @Override
+ public List<Location> allLineLocations() {
+ // If this reference type is an ArrayType, the returned list is always
+ // empty.
return Collections.EMPTY_LIST;
}
+
/**
* @see com.sun.jdi.ReferenceType#allMethods()
*/
- public List allMethods() {
+ @Override
+ public List<Method> allMethods() {
return Collections.EMPTY_LIST;
}
+
/**
* @see com.sun.jdi.ReferenceType#allFields()
*/
- public List allFields() {
+ @Override
+ public List<Field> allFields() {
return Collections.EMPTY_LIST;
}
-
- /**
- * @return Returns an identifying name for the source corresponding to the declaration of this type.
+
+ /**
+ * @return Returns an identifying name for the source corresponding to the
+ * declaration of this type.
*/
+ @Override
public String sourceName() throws AbsentInformationException {
- throw new AbsentInformationException(JDIMessages.ArrayTypeImpl_No_source_name_for_Arrays_1);
+ throw new AbsentInformationException(
+ JDIMessages.ArrayTypeImpl_No_source_name_for_Arrays_1);
}
+
/**
* @see com.sun.jdi.ReferenceType#visibleFields()
*/
- public List visibleFields() {
+ @Override
+ public List<Field> visibleFields() {
return Collections.EMPTY_LIST;
}
/**
* @see com.sun.jdi.ReferenceType#visibleMethods()
*/
- public List visibleMethods() {
+ @Override
+ public List<Method> visibleMethods() {
return Collections.EMPTY_LIST;
}
+
/**
* @see com.sun.jdi.ReferenceType#fieldByName(String)
*/
+ @Override
public Field fieldByName(String arg1) {
return null;
}
+
/**
* @see com.sun.jdi.ReferenceType#methodsByName(String)
*/
- public List methodsByName(String arg1) {
+ @Override
+ public List<Method> methodsByName(String arg1) {
return Collections.EMPTY_LIST;
}
/**
* @see com.sun.jdi.ReferenceType#methodsByName(String, String)
*/
- public List methodsByName(String arg1, String arg2) {
+ @Override
+ public List<Method> methodsByName(String arg1, String arg2) {
return Collections.EMPTY_LIST;
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanTypeImpl.java
index 82fed8868..369d3b955 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanTypeImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,34 +10,35 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.BooleanType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class BooleanTypeImpl extends PrimitiveTypeImpl implements BooleanType {
/**
* Creates new instance.
+ * @param vmImpl the VM
*/
public BooleanTypeImpl(VirtualMachineImpl vmImpl) {
- super("BooleanType", vmImpl, "boolean" , "Z"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("BooleanType", vmImpl, "boolean", "Z"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return BooleanValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
return virtualMachineImpl().mirrorOf(false);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanValueImpl.java
index f6d537749..9febc4c31 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/BooleanValueImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,47 +20,55 @@ import com.sun.jdi.BooleanValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class BooleanValueImpl extends PrimitiveValueImpl implements BooleanValue {
+public class BooleanValueImpl extends PrimitiveValueImpl implements
+ BooleanValue {
/** JDWP Tag. */
public static final byte tag = JdwpID.BOOLEAN_TAG;
/**
* Creates new instance.
+ * @param vmImpl the VM
+ * @param value the underlying value
*/
public BooleanValueImpl(VirtualMachineImpl vmImpl, Boolean value) {
super("BooleanValue", vmImpl, value); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getBooleanType();
}
/**
- * @returns Value.
+ * @return the underlying value
*/
public boolean value() {
return booleanValue();
}
-
+
/**
+ * @param target the target
+ * @param in the stream
* @return Reads and returns new instance.
+ * @throws IOException if the read fails
*/
- public static BooleanValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static BooleanValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
boolean value = target.readBoolean("booleanValue", in); //$NON-NLS-1$
return new BooleanValueImpl(vmImpl, Boolean.valueOf(value));
@@ -70,7 +77,10 @@ public class BooleanValueImpl extends PrimitiveValueImpl implements BooleanValue
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeBoolean(((Boolean)fValue).booleanValue(), "booleanValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeBoolean(((Boolean) fValue).booleanValue(),
+ "booleanValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteTypeImpl.java
index 2046308da..12d7fa2f1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteTypeImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,35 +10,36 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.ByteType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ByteTypeImpl extends PrimitiveTypeImpl implements ByteType {
/**
* Creates new instance.
+ * @param vmImpl the VM
*/
public ByteTypeImpl(VirtualMachineImpl vmImpl) {
- super("ByteType", vmImpl, "byte" , "B"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("ByteType", vmImpl, "byte", "B"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return ByteValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
- return virtualMachineImpl().mirrorOf((byte)0);
+ return virtualMachineImpl().mirrorOf((byte) 0);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteValueImpl.java
index 1391a9bc6..4f603de69 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ByteValueImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,10 +20,9 @@ import com.sun.jdi.ByteValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ByteValueImpl extends PrimitiveValueImpl implements ByteValue {
/** JDWP Tag. */
@@ -32,6 +30,8 @@ public class ByteValueImpl extends PrimitiveValueImpl implements ByteValue {
/**
* Creates new instance.
+ * @param vmImpl the VM
+ * @param value the underlying byte value
*/
public ByteValueImpl(VirtualMachineImpl vmImpl, Byte value) {
super("ByteValue", vmImpl, value); //$NON-NLS-1$
@@ -40,37 +40,45 @@ public class ByteValueImpl extends PrimitiveValueImpl implements ByteValue {
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getByteType();
}
-
+
/**
- * @returns Value.
+ * @return the underlying byte value
*/
public byte value() {
return byteValue();
}
-
+
/**
+ * @param target the target
+ * @param in the stream
* @return Reads and returns new instance.
+ * @throws IOException if the read fails
*/
- public static ByteValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ByteValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
byte value = target.readByte("byteValue", in); //$NON-NLS-1$
return new ByteValueImpl(vmImpl, new Byte(value));
}
-
+
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeByte(((Byte)fValue).byteValue(), "byteValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeByte(((Byte) fValue).byteValue(), "byteValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharTypeImpl.java
index e9a6b7f7f..2793437d5 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharTypeImpl.java
@@ -10,35 +10,35 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.CharType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class CharTypeImpl extends PrimitiveTypeImpl implements CharType {
/**
* Creates new instance.
*/
public CharTypeImpl(VirtualMachineImpl vmImpl) {
- super("CharType", vmImpl, "char" , "C"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("CharType", vmImpl, "char", "C"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return CharValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
- return virtualMachineImpl().mirrorOf((char)0);
+ return virtualMachineImpl().mirrorOf((char) 0);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharValueImpl.java
index d2cc78cfe..8a28457ac 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/CharValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,10 +20,9 @@ import com.sun.jdi.CharValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class CharValueImpl extends PrimitiveValueImpl implements CharValue {
/** JDWP Tag. */
@@ -36,17 +34,19 @@ public class CharValueImpl extends PrimitiveValueImpl implements CharValue {
public CharValueImpl(VirtualMachineImpl vmImpl, Character value) {
super("CharValue", vmImpl, value); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getCharType();
}
@@ -57,20 +57,23 @@ public class CharValueImpl extends PrimitiveValueImpl implements CharValue {
public char value() {
return charValue();
}
-
+
/**
* @return Reads and returns new instance.
*/
- public static CharValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static CharValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
char value = target.readChar("charValue", in); //$NON-NLS-1$
return new CharValueImpl(vmImpl, new Character(value));
}
-
+
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeChar(((Character)fValue).charValue(), "charValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeChar(((Character) fValue).charValue(), "charValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassLoaderReferenceImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassLoaderReferenceImpl.java
index 64c5b898f..88170cab7 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassLoaderReferenceImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassLoaderReferenceImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
@@ -27,42 +26,47 @@ import com.sun.jdi.ClassNotPreparedException;
import com.sun.jdi.ReferenceType;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ClassLoaderReferenceImpl extends ObjectReferenceImpl implements ClassLoaderReference {
+public class ClassLoaderReferenceImpl extends ObjectReferenceImpl implements
+ ClassLoaderReference {
/** JDWP Tag. */
public static final byte tag = JdwpID.CLASS_LOADER_TAG;
/**
* Creates new ClassLoaderReferenceImpl.
*/
- public ClassLoaderReferenceImpl(VirtualMachineImpl vmImpl, JdwpClassLoaderID classLoaderID) {
+ public ClassLoaderReferenceImpl(VirtualMachineImpl vmImpl,
+ JdwpClassLoaderID classLoaderID) {
super("ClassLoaderReference", vmImpl, classLoaderID); //$NON-NLS-1$
}
/**
* @returns Value tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
- * @returns Returns a list of all loaded classes that were defined by this class loader.
+ * @returns Returns a list of all loaded classes that were defined by this
+ * class loader.
*/
- public List definedClasses() {
+ public List<ReferenceType> definedClasses() {
// Note that this information should not be cached.
- List visibleClasses= visibleClasses();
- List result = new ArrayList(visibleClasses.size());
- Iterator iter = visibleClasses.iterator();
+ List<ReferenceTypeImpl> visibleClasses = visibleClasses();
+ List<ReferenceType> result = new ArrayList<ReferenceType>(visibleClasses.size());
+ Iterator<ReferenceTypeImpl> iter = visibleClasses.iterator();
while (iter.hasNext()) {
try {
- ReferenceType type = (ReferenceType)iter.next();
- // Note that classLoader() is null for the bootstrap classloader.
- if (type.classLoader() != null && type.classLoader().equals(this))
+ ReferenceType type = iter.next();
+ // Note that classLoader() is null for the bootstrap
+ // classloader.
+ if (type.classLoader() != null
+ && type.classLoader().equals(this))
result.add(type);
} catch (ClassNotPreparedException e) {
continue;
@@ -72,19 +76,22 @@ public class ClassLoaderReferenceImpl extends ObjectReferenceImpl implements Cla
}
/**
- * @returns Returns a list of all loaded classes that are visible by this class loader.
+ * @returns Returns a list of all loaded classes that are visible by this
+ * class loader.
*/
- public List visibleClasses() {
+ public List<ReferenceTypeImpl> visibleClasses() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.CLR_VISIBLE_CLASSES, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.CLR_VISIBLE_CLASSES, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- List elements = new ArrayList(nrOfElements);
+ List<ReferenceTypeImpl> elements = new ArrayList<ReferenceTypeImpl>(nrOfElements);
for (int i = 0; i < nrOfElements; i++) {
- ReferenceTypeImpl elt = ReferenceTypeImpl.readWithTypeTag(this, replyData);
+ ReferenceTypeImpl elt = ReferenceTypeImpl.readWithTypeTag(this,
+ replyData);
if (elt == null)
continue;
elements.add(elt);
@@ -97,11 +104,12 @@ public class ClassLoaderReferenceImpl extends ObjectReferenceImpl implements Cla
handledJdwpRequest();
}
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ClassLoaderReferenceImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ClassLoaderReferenceImpl read(MirrorImpl target,
+ DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpClassLoaderID ID = new JdwpClassLoaderID(vmImpl);
ID.read(in);
@@ -111,7 +119,8 @@ public class ClassLoaderReferenceImpl extends ObjectReferenceImpl implements Cla
if (ID.isNull())
return null;
- ClassLoaderReferenceImpl mirror = new ClassLoaderReferenceImpl(vmImpl, ID);
+ ClassLoaderReferenceImpl mirror = new ClassLoaderReferenceImpl(vmImpl,
+ ID);
return mirror;
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassObjectReferenceImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassObjectReferenceImpl.java
index 95e9cbf37..6b35b17c8 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassObjectReferenceImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassObjectReferenceImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -23,36 +22,39 @@ import com.sun.jdi.ClassObjectReference;
import com.sun.jdi.ReferenceType;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ClassObjectReferenceImpl extends ObjectReferenceImpl implements ClassObjectReference {
+public class ClassObjectReferenceImpl extends ObjectReferenceImpl implements
+ ClassObjectReference {
/** JDWP Tag. */
public static final byte tag = JdwpID.CLASS_OBJECT_TAG;
/**
* Creates new ClassObjectReferenceImpl.
*/
- public ClassObjectReferenceImpl(VirtualMachineImpl vmImpl, JdwpClassObjectID classObjectID) {
+ public ClassObjectReferenceImpl(VirtualMachineImpl vmImpl,
+ JdwpClassObjectID classObjectID) {
super("ClassObjectReference", vmImpl, classObjectID); //$NON-NLS-1$
}
/**
* @returns Returns Value tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
- * @returns Returns the ReferenceType corresponding to this class object.
- */
+ * @returns Returns the ReferenceType corresponding to this class object.
+ */
public ReferenceType reflectedType() {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.COR_REFLECTED_TYPE, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.COR_REFLECTED_TYPE, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
return ReferenceTypeImpl.readWithTypeTag(this, replyData);
@@ -63,11 +65,12 @@ public class ClassObjectReferenceImpl extends ObjectReferenceImpl implements Cla
handledJdwpRequest();
}
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ClassObjectReferenceImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ClassObjectReferenceImpl read(MirrorImpl target,
+ DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpClassObjectID ID = new JdwpClassObjectID(vmImpl);
ID.read(in);
@@ -77,7 +80,8 @@ public class ClassObjectReferenceImpl extends ObjectReferenceImpl implements Cla
if (ID.isNull())
return null;
- ClassObjectReferenceImpl mirror = new ClassObjectReferenceImpl(vmImpl, ID);
+ ClassObjectReferenceImpl mirror = new ClassObjectReferenceImpl(vmImpl,
+ ID);
return mirror;
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassTypeImpl.java
index 06f50bfc4..516046d30 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ClassTypeImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -38,126 +37,143 @@ import com.sun.jdi.ThreadReference;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
-
+
/** JDWP Tag. */
public static final byte typeTag = JdwpID.TYPE_TAG_CLASS;
/** The following are the stored results of JDWP calls. */
private ClassTypeImpl fSuperclass = null;
-
+
/**
* Creates new ClassTypeImpl.
*/
public ClassTypeImpl(VirtualMachineImpl vmImpl, JdwpClassID classID) {
super("ClassType", vmImpl, classID); //$NON-NLS-1$
}
-
+
/**
* Creates new ClassTypeImpl.
*/
- public ClassTypeImpl(VirtualMachineImpl vmImpl, JdwpClassID classID, String signature, String genericSignature) {
+ public ClassTypeImpl(VirtualMachineImpl vmImpl, JdwpClassID classID,
+ String signature, String genericSignature) {
super("ClassType", vmImpl, classID, signature, genericSignature); //$NON-NLS-1$
}
/**
* @return Returns type tag.
*/
+ @Override
public byte typeTag() {
return typeTag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
- return new ClassObjectReferenceImpl(virtualMachineImpl(), new JdwpClassObjectID(virtualMachineImpl()));
+ return new ClassObjectReferenceImpl(virtualMachineImpl(),
+ new JdwpClassObjectID(virtualMachineImpl()));
}
/**
* Flushes all stored Jdwp results.
*/
+ @Override
public void flushStoredJdwpResults() {
super.flushStoredJdwpResults();
- // For all classes that have this class cached as superclass, this cache must be undone.
- Iterator itr = virtualMachineImpl().allCachedRefTypes();
+ // For all classes that have this class cached as superclass, this cache
+ // must be undone.
+ Iterator<Object> itr = virtualMachineImpl().allCachedRefTypes();
while (itr.hasNext()) {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)itr.next();
+ ReferenceTypeImpl refType = (ReferenceTypeImpl) itr.next();
if (refType instanceof ClassTypeImpl) {
- ClassTypeImpl classType = (ClassTypeImpl)refType;
- if (classType.fSuperclass != null && classType.fSuperclass.equals(this)) {
+ ClassTypeImpl classType = (ClassTypeImpl) refType;
+ if (classType.fSuperclass != null
+ && classType.fSuperclass.equals(this)) {
classType.flushStoredJdwpResults();
}
}
}
-
+
fSuperclass = null;
}
-
+
/**
* @return Returns Jdwp version of given options.
*/
private int optionsToJdwpOptions(int options) {
int jdwpOptions = 0;
- if ((options & INVOKE_SINGLE_THREADED) != 0)
- jdwpOptions |= MethodImpl.INVOKE_SINGLE_THREADED_JDWP;
- return jdwpOptions;
+ if ((options & INVOKE_SINGLE_THREADED) != 0)
+ jdwpOptions |= MethodImpl.INVOKE_SINGLE_THREADED_JDWP;
+ return jdwpOptions;
}
-
+
/**
- * @return Returns a the single non-abstract Method visible from this class that has the given name and signature.
+ * @return Returns a the single non-abstract Method visible from this class
+ * that has the given name and signature.
*/
public Method concreteMethodByName(String name, String signature) {
- /* Recursion is used to find the method:
- * The methods of its own (own methods() command);
- * The methods of it's superclass.
+ /*
+ * Recursion is used to find the method: The methods of its own (own
+ * methods() command); The methods of it's superclass.
*/
-
- Iterator methods = methods().iterator();
- MethodImpl method;
- while (methods.hasNext()) {
- method = (MethodImpl)methods.next();
- if (method.name().equals(name) && method.signature().equals(signature)) {
- if (method.isAbstract()) {
- return null;
- }
- return method;
- }
- }
-
+
+ Iterator methods = methods().iterator();
+ MethodImpl method;
+ while (methods.hasNext()) {
+ method = (MethodImpl) methods.next();
+ if (method.name().equals(name)
+ && method.signature().equals(signature)) {
+ if (method.isAbstract()) {
+ return null;
+ }
+ return method;
+ }
+ }
+
if (superclass() != null) {
return superclass().concreteMethodByName(name, signature);
}
-
+
return null;
}
/**
* Invokes the specified static Method in the target VM.
+ *
* @return Returns a Value mirror of the invoked method's return value.
*/
- public Value invokeMethod(ThreadReference thread, Method method, List arguments, int options) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException {
+ public Value invokeMethod(ThreadReference thread, Method method,
+ List arguments, int options) throws InvalidTypeException,
+ ClassNotLoadedException, IncompatibleThreadStateException,
+ InvocationException {
checkVM(thread);
checkVM(method);
- ThreadReferenceImpl threadImpl = (ThreadReferenceImpl)thread;
- MethodImpl methodImpl = (MethodImpl)method;
+ ThreadReferenceImpl threadImpl = (ThreadReferenceImpl) thread;
+ MethodImpl methodImpl = (MethodImpl) method;
// Perform some checks for IllegalArgumentException.
if (!visibleMethods().contains(method))
- throw new IllegalArgumentException(JDIMessages.ClassTypeImpl_Class_does_not_contain_given_method_1);
+ throw new IllegalArgumentException(
+ JDIMessages.ClassTypeImpl_Class_does_not_contain_given_method_1);
if (method.argumentTypeNames().size() != arguments.size())
- throw new IllegalArgumentException(JDIMessages.ClassTypeImpl_Number_of_arguments_doesn__t_match_2);
+ throw new IllegalArgumentException(
+ JDIMessages.ClassTypeImpl_Number_of_arguments_doesn__t_match_2);
if (method.isConstructor() || method.isStaticInitializer())
- throw new IllegalArgumentException(JDIMessages.ClassTypeImpl_Method_is_constructor_or_intitializer_3);
+ throw new IllegalArgumentException(
+ JDIMessages.ClassTypeImpl_Method_is_constructor_or_intitializer_3);
- // check the type and the vm of the arguments. Convert the values if needed
- List checkedArguments= ValueImpl.checkValues(arguments, method.argumentTypes(), virtualMachineImpl());
+ // check the type and the vm of the arguments. Convert the values if
+ // needed
+ List<ValueImpl> checkedArguments = ValueImpl.checkValues(arguments,
+ method.argumentTypes(), virtualMachineImpl());
initJdwpRequest();
try {
@@ -166,37 +182,40 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
write(this, outData);
threadImpl.write(this, outData);
methodImpl.write(this, outData);
-
+
writeInt(checkedArguments.size(), "size", outData); //$NON-NLS-1$
- Iterator iter = checkedArguments.iterator();
- while(iter.hasNext()) {
- ValueImpl elt = (ValueImpl)iter.next();
+ Iterator<ValueImpl> iter = checkedArguments.iterator();
+ while (iter.hasNext()) {
+ ValueImpl elt = iter.next();
if (elt != null) {
elt.writeWithTag(this, outData);
} else {
ValueImpl.writeNullWithTag(this, outData);
}
}
-
- writeInt(optionsToJdwpOptions(options),"options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.CT_INVOKE_METHOD, outBytes);
+
+ writeInt(optionsToJdwpOptions(options),
+ "options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.CT_INVOKE_METHOD, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_METHODID:
- throw new IllegalArgumentException();
- case JdwpReplyPacket.TYPE_MISMATCH:
- throw new InvalidTypeException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotLoadedException(name());
- case JdwpReplyPacket.INVALID_THREAD:
- throw new IncompatibleThreadStateException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.INVALID_METHODID:
+ throw new IllegalArgumentException();
+ case JdwpReplyPacket.TYPE_MISMATCH:
+ throw new InvalidTypeException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotLoadedException(name());
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
ValueImpl value = ValueImpl.readWithTag(this, replyData);
- ObjectReferenceImpl exception = ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
+ ObjectReferenceImpl exception = ObjectReferenceImpl
+ .readObjectRefWithTag(this, replyData);
if (exception != null)
throw new InvocationException(exception);
return value;
@@ -207,26 +226,35 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
handledJdwpRequest();
}
}
-
+
/**
- * Constructs a new instance of this type, using the given constructor Method in the target VM.
+ * Constructs a new instance of this type, using the given constructor
+ * Method in the target VM.
+ *
* @return Returns Mirror of this type.
*/
- public ObjectReference newInstance(ThreadReference thread, Method method, List arguments, int options) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException {
+ public ObjectReference newInstance(ThreadReference thread, Method method,
+ List arguments, int options) throws InvalidTypeException,
+ ClassNotLoadedException, IncompatibleThreadStateException,
+ InvocationException {
checkVM(thread);
checkVM(method);
- ThreadReferenceImpl threadImpl = (ThreadReferenceImpl)thread;
- MethodImpl methodImpl = (MethodImpl)method;
-
+ ThreadReferenceImpl threadImpl = (ThreadReferenceImpl) thread;
+ MethodImpl methodImpl = (MethodImpl) method;
+
// Perform some checks for IllegalArgumentException.
if (!methods().contains(method))
- throw new IllegalArgumentException(JDIMessages.ClassTypeImpl_Class_does_not_contain_given_method_4);
+ throw new IllegalArgumentException(
+ JDIMessages.ClassTypeImpl_Class_does_not_contain_given_method_4);
if (method.argumentTypeNames().size() != arguments.size())
- throw new IllegalArgumentException(JDIMessages.ClassTypeImpl_Number_of_arguments_doesn__t_match_5);
+ throw new IllegalArgumentException(
+ JDIMessages.ClassTypeImpl_Number_of_arguments_doesn__t_match_5);
if (!method.isConstructor())
- throw new IllegalArgumentException(JDIMessages.ClassTypeImpl_Method_is_not_a_constructor_6);
-
- List checkedArguments= ValueImpl.checkValues(arguments, method.argumentTypes(), virtualMachineImpl());
+ throw new IllegalArgumentException(
+ JDIMessages.ClassTypeImpl_Method_is_not_a_constructor_6);
+
+ List<ValueImpl> checkedArguments = ValueImpl.checkValues(arguments,
+ method.argumentTypes(), virtualMachineImpl());
initJdwpRequest();
try {
@@ -235,11 +263,11 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
write(this, outData);
threadImpl.write(this, outData);
methodImpl.write(this, outData);
-
+
writeInt(checkedArguments.size(), "size", outData); //$NON-NLS-1$
- Iterator iter = checkedArguments.iterator();
- while(iter.hasNext()) {
- ValueImpl elt = (ValueImpl)iter.next();
+ Iterator<ValueImpl> iter = checkedArguments.iterator();
+ while (iter.hasNext()) {
+ ValueImpl elt = iter.next();
if (elt != null) {
checkVM(elt);
elt.writeWithTag(this, outData);
@@ -247,26 +275,30 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
ValueImpl.writeNullWithTag(this, outData);
}
}
-
- writeInt(optionsToJdwpOptions(options),"options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.CT_NEW_INSTANCE, outBytes);
+
+ writeInt(optionsToJdwpOptions(options),
+ "options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.CT_NEW_INSTANCE, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_METHODID:
- throw new IllegalArgumentException();
- case JdwpReplyPacket.TYPE_MISMATCH:
- throw new InvalidTypeException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotLoadedException(name());
- case JdwpReplyPacket.INVALID_THREAD:
- throw new IncompatibleThreadStateException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.INVALID_METHODID:
+ throw new IllegalArgumentException();
+ case JdwpReplyPacket.TYPE_MISMATCH:
+ throw new InvalidTypeException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotLoadedException(name());
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- ObjectReferenceImpl object = ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
- ObjectReferenceImpl exception = ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
+ ObjectReferenceImpl object = ObjectReferenceImpl
+ .readObjectRefWithTag(this, replyData);
+ ObjectReferenceImpl exception = ObjectReferenceImpl
+ .readObjectRefWithTag(this, replyData);
if (exception != null)
throw new InvocationException(exception);
return object;
@@ -277,36 +309,40 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
handledJdwpRequest();
}
}
-
+
/**
* Assigns a value to a static field. .
*/
- public void setValue(Field field, Value value) throws InvalidTypeException, ClassNotLoadedException {
+ public void setValue(Field field, Value value) throws InvalidTypeException,
+ ClassNotLoadedException {
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
- writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
+ writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
checkVM(field);
- ((FieldImpl)field).write(this, outData);
-
- // check the type and the vm of the value. Convert the value if needed
- ValueImpl checkedValue= ValueImpl.checkValue(value, field.type(), virtualMachineImpl());
-
+ ((FieldImpl) field).write(this, outData);
+
+ // check the type and the vm of the value. Convert the value if
+ // needed
+ ValueImpl checkedValue = ValueImpl.checkValue(value, field.type(),
+ virtualMachineImpl());
+
if (checkedValue != null) {
checkedValue.write(this, outData);
} else {
ValueImpl.writeNull(this, outData);
}
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.CT_SET_VALUES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.CT_SET_VALUES, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.TYPE_MISMATCH:
- throw new InvalidTypeException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotLoadedException(name());
+ case JdwpReplyPacket.TYPE_MISMATCH:
+ throw new InvalidTypeException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotLoadedException(name());
}
defaultReplyErrorHandler(replyPacket.errorCode());
} catch (IOException e) {
@@ -315,20 +351,22 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
handledJdwpRequest();
}
}
-
+
/**
- * @return Returns the the currently loaded, direct subclasses of this class.
+ * @return Returns the the currently loaded, direct subclasses of this
+ * class.
*/
- public List subclasses() {
+ public List<ClassTypeImpl> subclasses() {
// Note that this information should not be cached.
- List subclasses = new ArrayList();
- Iterator itr = virtualMachineImpl().allRefTypes();
+ List<ClassTypeImpl> subclasses = new ArrayList<ClassTypeImpl>();
+ Iterator<ReferenceTypeImpl> itr = virtualMachineImpl().allRefTypes();
while (itr.hasNext()) {
try {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)itr.next();
+ ReferenceTypeImpl refType = itr.next();
if (refType instanceof ClassTypeImpl) {
- ClassTypeImpl classType = (ClassTypeImpl)refType;
- if (classType.superclass() != null && classType.superclass().equals(this)) {
+ ClassTypeImpl classType = (ClassTypeImpl) refType;
+ if (classType.superclass() != null
+ && classType.superclass().equals(this)) {
subclasses.add(classType);
}
}
@@ -338,17 +376,18 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
}
return subclasses;
}
-
+
/**
* @return Returns the superclass of this class.
*/
public ClassType superclass() {
if (fSuperclass != null)
return fSuperclass;
-
+
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.CT_SUPERCLASS, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.CT_SUPERCLASS, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
fSuperclass = ClassTypeImpl.read(this, replyData);
@@ -360,11 +399,13 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
handledJdwpRequest();
}
}
-
+
/*
- * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if ID is unknown a newly created ReferenceTypeImpl.
+ * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if
+ * ID is unknown a newly created ReferenceTypeImpl.
*/
- public static ClassTypeImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ClassTypeImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpClassID ID = new JdwpClassID(vmImpl);
ID.read(in);
@@ -374,18 +415,21 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
if (ID.isNull())
return null;
- ClassTypeImpl mirror = (ClassTypeImpl)vmImpl.getCachedMirror(ID);
+ ClassTypeImpl mirror = (ClassTypeImpl) vmImpl.getCachedMirror(ID);
if (mirror == null) {
mirror = new ClassTypeImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
}
return mirror;
- }
-
+ }
+
/*
- * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if ID is unknown a newly created ReferenceTypeImpl.
+ * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if
+ * ID is unknown a newly created ReferenceTypeImpl.
*/
- public static ClassTypeImpl readWithSignature(MirrorImpl target, boolean withGenericSignature, DataInputStream in) throws IOException {
+ public static ClassTypeImpl readWithSignature(MirrorImpl target,
+ boolean withGenericSignature, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpClassID ID = new JdwpClassID(vmImpl);
ID.read(in);
@@ -393,14 +437,14 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
target.fVerboseWriter.println("classType", ID.value()); //$NON-NLS-1$
String signature = target.readString("signature", in); //$NON-NLS-1$
- String genericSignature= null;
+ String genericSignature = null;
if (withGenericSignature) {
- genericSignature= target.readString("generic signature", in); //$NON-NLS-1$
+ genericSignature = target.readString("generic signature", in); //$NON-NLS-1$
}
if (ID.isNull())
return null;
-
- ClassTypeImpl mirror = (ClassTypeImpl)vmImpl.getCachedMirror(ID);
+
+ ClassTypeImpl mirror = (ClassTypeImpl) vmImpl.getCachedMirror(ID);
if (mirror == null) {
mirror = new ClassTypeImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
@@ -408,16 +452,17 @@ public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType {
mirror.setSignature(signature);
mirror.setGenericSignature(genericSignature);
return mirror;
- }
-
+ }
+
public boolean isEnum() {
if (virtualMachineImpl().isJdwpVersionGreaterOrEqual(1, 5)) {
// there is no modifier for this ... :(
ClassType superClass = superclass();
- return superClass != null && "<E:Ljava/lang/Enum<TE;>;>Ljava/lang/Object;Ljava/lang/Comparable<TE;>;Ljava/io/Serializable;".equals(superClass.genericSignature()); //$NON-NLS-1$
- }
+ return superClass != null
+ && "<E:Ljava/lang/Enum<TE;>;>Ljava/lang/Object;Ljava/lang/Comparable<TE;>;Ljava/io/Serializable;".equals(superClass.genericSignature()); //$NON-NLS-1$
+ }
// jdwp 1.5 only option
return false;
}
-
+
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleTypeImpl.java
index 87e37de77..b16c78c0f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleTypeImpl.java
@@ -10,34 +10,34 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.DoubleType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class DoubleTypeImpl extends PrimitiveTypeImpl implements DoubleType {
/**
* Creates new instance.
*/
public DoubleTypeImpl(VirtualMachineImpl vmImpl) {
- super("DoubleType", vmImpl, "double" , "D"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("DoubleType", vmImpl, "double", "D"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return DoubleValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
return virtualMachineImpl().mirrorOf(0.0D);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleValueImpl.java
index 0512cb5fe..7f1aac693 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/DoubleValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,10 +20,9 @@ import com.sun.jdi.DoubleValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class DoubleValueImpl extends PrimitiveValueImpl implements DoubleValue {
/** JDWP Tag. */
@@ -36,17 +34,19 @@ public class DoubleValueImpl extends PrimitiveValueImpl implements DoubleValue {
public DoubleValueImpl(VirtualMachineImpl vmImpl, Double value) {
super("DoubleValue", vmImpl, value); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getDoubleType();
}
@@ -57,20 +57,23 @@ public class DoubleValueImpl extends PrimitiveValueImpl implements DoubleValue {
public double value() {
return doubleValue();
}
-
+
/**
* @return Reads and returns new instance.
*/
- public static DoubleValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static DoubleValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
double value = target.readDouble("doubleValue", in); //$NON-NLS-1$
return new DoubleValueImpl(vmImpl, new Double(value));
}
-
+
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeDouble(((Double)fValue).doubleValue(), "doubleValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeDouble(((Double) fValue).doubleValue(), "doubleValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FieldImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FieldImpl.java
index 62512ae51..dfe22c747 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FieldImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FieldImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -22,10 +21,9 @@ import com.sun.jdi.Field;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class FieldImpl extends TypeComponentImpl implements Field {
/** ID that corresponds to this reference. */
@@ -36,19 +34,22 @@ public class FieldImpl extends TypeComponentImpl implements Field {
/**
* Creates new FieldImpl.
*/
- public FieldImpl(VirtualMachineImpl vmImpl, ReferenceTypeImpl declaringType, JdwpFieldID ID, String name, String signature, String genericSignature, int modifierBits) {
- super("Field", vmImpl, declaringType, name, signature, genericSignature, modifierBits); //$NON-NLS-1$
+ public FieldImpl(VirtualMachineImpl vmImpl,
+ ReferenceTypeImpl declaringType, JdwpFieldID ID, String name,
+ String signature, String genericSignature, int modifierBits) {
+ super(
+ "Field", vmImpl, declaringType, name, signature, genericSignature, modifierBits); //$NON-NLS-1$
fFieldID = ID;
}
-
+
/**
* Flushes all stored Jdwp results.
*/
public void flushStoredJdwpResults() {
// Note that no results are cached.
}
-
- /**
+
+ /**
* @return Returns fieldID of field.
*/
public JdwpFieldID getFieldID() {
@@ -56,28 +57,35 @@ public class FieldImpl extends TypeComponentImpl implements Field {
}
/**
- * @return Returns true if two mirrors refer to the same entity in the target VM.
+ * @return Returns true if two mirrors refer to the same entity in the
+ * target VM.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
return object != null
- && object.getClass().equals(this.getClass())
- && fFieldID.equals(((FieldImpl)object).fFieldID)
- && referenceTypeImpl().equals(((FieldImpl)object).referenceTypeImpl());
+ && object.getClass().equals(this.getClass())
+ && fFieldID.equals(((FieldImpl) object).fFieldID)
+ && referenceTypeImpl().equals(
+ ((FieldImpl) object).referenceTypeImpl());
}
/**
- * @return Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
+ * @return Returns a negative integer, zero, or a positive integer as this
+ * object is less than, equal to, or greater than the specified
+ * object.
*/
public int compareTo(Object object) {
if (object == null || !object.getClass().equals(this.getClass()))
- throw new ClassCastException(JDIMessages.FieldImpl_Can__t_compare_field_to_given_object_1);
-
- // See if declaring types are the same, if not return comparison between declaring types.
- Field type2 = (Field)object;
+ throw new ClassCastException(
+ JDIMessages.FieldImpl_Can__t_compare_field_to_given_object_1);
+
+ // See if declaring types are the same, if not return comparison between
+ // declaring types.
+ Field type2 = (Field) object;
if (!declaringType().equals(type2.declaringType()))
return declaringType().compareTo(type2.declaringType());
-
+
// Return comparison of position within declaring type.
int index1 = declaringType().fields().indexOf(this);
int index2 = type2.declaringType().fields().indexOf(type2);
@@ -85,16 +93,18 @@ public class FieldImpl extends TypeComponentImpl implements Field {
return -1;
else if (index1 > index2)
return 1;
- else return 0;
+ else
+ return 0;
}
-
- /**
+
+ /**
* @return Returns the hash code value.
*/
+ @Override
public int hashCode() {
return fFieldID.hashCode();
}
-
+
/**
* @return Returns a text representation of the declared type.
*/
@@ -104,35 +114,37 @@ public class FieldImpl extends TypeComponentImpl implements Field {
}
return fTypeName;
}
-
- /**
+
+ /**
* @return Returns the type of the this Field.
*/
public Type type() throws ClassNotLoadedException {
if (fType == null) {
- fType = TypeImpl.create(virtualMachineImpl(), signature(), declaringType().classLoader());
+ fType = TypeImpl.create(virtualMachineImpl(), signature(),
+ declaringType().classLoader());
}
return fType;
}
- /**
+ /**
* @return Returns true if object is transient.
*/
public boolean isTransient() {
return (fModifierBits & MODIFIER_ACC_TRANSIENT) != 0;
}
-
- /**
+
+ /**
* @return Returns true if object is volitile.
*/
public boolean isVolatile() {
return (fModifierBits & MODIFIER_ACC_VOLITILE) != 0;
}
-
+
/**
* Writes JDWP representation.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
fFieldID.write(out);
if (target.fVerboseWriter != null)
target.fVerboseWriter.println("field", fFieldID.value()); //$NON-NLS-1$
@@ -141,7 +153,8 @@ public class FieldImpl extends TypeComponentImpl implements Field {
/**
* Writes JDWP representation, including ReferenceType.
*/
- public void writeWithReferenceType(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void writeWithReferenceType(MirrorImpl target, DataOutputStream out)
+ throws IOException {
// See EventRequest case FieldOnly
referenceTypeImpl().write(target, out);
write(target, out);
@@ -150,10 +163,13 @@ public class FieldImpl extends TypeComponentImpl implements Field {
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static FieldImpl readWithReferenceTypeWithTag(MirrorImpl target, DataInputStream in) throws IOException {
+ public static FieldImpl readWithReferenceTypeWithTag(MirrorImpl target,
+ DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- // See Events FIELD_ACCESS and FIELD_MODIFICATION (refTypeTag + typeID + fieldID).
- ReferenceTypeImpl referenceType = ReferenceTypeImpl.readWithTypeTag(target, in);
+ // See Events FIELD_ACCESS and FIELD_MODIFICATION (refTypeTag + typeID +
+ // fieldID).
+ ReferenceTypeImpl referenceType = ReferenceTypeImpl.readWithTypeTag(
+ target, in);
if (referenceType == null)
return null;
@@ -166,14 +182,18 @@ public class FieldImpl extends TypeComponentImpl implements Field {
return null;
FieldImpl field = referenceType.findField(ID);
if (field == null)
- throw new InternalError(JDIMessages.FieldImpl_Got_FieldID_of_ReferenceType_that_is_not_a_member_of_the_ReferenceType_2);
+ throw new InternalError(
+ JDIMessages.FieldImpl_Got_FieldID_of_ReferenceType_that_is_not_a_member_of_the_ReferenceType_2);
return field;
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static FieldImpl readWithNameSignatureModifiers(ReferenceTypeImpl target, ReferenceTypeImpl referenceType, boolean withGenericSignature, DataInputStream in) throws IOException {
+ public static FieldImpl readWithNameSignatureModifiers(
+ ReferenceTypeImpl target, ReferenceTypeImpl referenceType,
+ boolean withGenericSignature, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpFieldID ID = new JdwpFieldID(vmImpl);
ID.read(in);
@@ -184,19 +204,21 @@ public class FieldImpl extends TypeComponentImpl implements Field {
return null;
String name = target.readString("name", in); //$NON-NLS-1$
String signature = target.readString("signature", in); //$NON-NLS-1$
- String genericSignature= null;
+ String genericSignature = null;
if (withGenericSignature) {
genericSignature = target.readString("generic signature", in); //$NON-NLS-1$
if ("".equals(genericSignature)) { //$NON-NLS-1$
- genericSignature= null;
+ genericSignature = null;
}
}
- int modifierBits = target.readInt("modifiers", AccessibleImpl.getModifierStrings(), in); //$NON-NLS-1$
-
- FieldImpl mirror = new FieldImpl(vmImpl, referenceType, ID, name, signature, genericSignature, modifierBits);
+ int modifierBits = target.readInt(
+ "modifiers", AccessibleImpl.getModifierStrings(), in); //$NON-NLS-1$
+
+ FieldImpl mirror = new FieldImpl(vmImpl, referenceType, ID, name,
+ signature, genericSignature, modifierBits);
return mirror;
}
-
+
public boolean isEnumConstant() {
return (fModifierBits & MODIFIER_ACC_ENUM) != 0;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatTypeImpl.java
index d4d534429..197b5cde2 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatTypeImpl.java
@@ -10,34 +10,34 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.FloatType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class FloatTypeImpl extends PrimitiveTypeImpl implements FloatType {
/**
* Creates new instance.
*/
public FloatTypeImpl(VirtualMachineImpl vmImpl) {
- super("FloatType", vmImpl, "float" , "F"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("FloatType", vmImpl, "float", "F"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return FloatValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
return virtualMachineImpl().mirrorOf(0.0f);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatValueImpl.java
index 0aeb869e9..be3820c82 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/FloatValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,10 +20,9 @@ import com.sun.jdi.FloatValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class FloatValueImpl extends PrimitiveValueImpl implements FloatValue {
/** JDWP Tag. */
@@ -36,17 +34,19 @@ public class FloatValueImpl extends PrimitiveValueImpl implements FloatValue {
public FloatValueImpl(VirtualMachineImpl vmImpl, Float value) {
super("FloatValue", vmImpl, value); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getFloatType();
}
@@ -57,20 +57,23 @@ public class FloatValueImpl extends PrimitiveValueImpl implements FloatValue {
public float value() {
return floatValue();
}
-
+
/**
* @return Reads and returns new instance.
*/
- public static FloatValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static FloatValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
float value = target.readFloat("floatValue", in); //$NON-NLS-1$
return new FloatValueImpl(vmImpl, new Float(value));
}
-
+
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeFloat(((Float)fValue).floatValue(), "floatValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeFloat(((Float) fValue).floatValue(), "floatValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/GenericSignature.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/GenericSignature.java
index 92428cbed..707f22b78 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/GenericSignature.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/GenericSignature.java
@@ -18,68 +18,71 @@ import java.util.List;
* Utility class to perform operations on generic signatures
*/
public class GenericSignature {
-
- private static final char C_CLASS_TYPE= 'L';
- private static final char C_TYPE_VARIABLE= 'T';
- private static final char C_ARRAY= '[';
- private static final char C_WILDCARD_PLUS= '+';
- private static final char C_WILDCARD_MINUS= '-';
-
- private static final char C_TYPE_END= ';';
- private static final char C_PARAMETERS_START= '(';
- private static final char C_PARAMETERS_END= ')';
- private static final char C_TYPE_ARGUMENTS_START= '<';
- private static final char C_TYPE_ARGUMENTS_END= '>';
-
+
+ private static final char C_CLASS_TYPE = 'L';
+ private static final char C_TYPE_VARIABLE = 'T';
+ private static final char C_ARRAY = '[';
+ private static final char C_WILDCARD_PLUS = '+';
+ private static final char C_WILDCARD_MINUS = '-';
+
+ private static final char C_TYPE_END = ';';
+ private static final char C_PARAMETERS_START = '(';
+ private static final char C_PARAMETERS_END = ')';
+ private static final char C_TYPE_ARGUMENTS_START = '<';
+ private static final char C_TYPE_ARGUMENTS_END = '>';
+
public static List getParameterTypes(String methodSignature) {
- int parameterStart= methodSignature.indexOf(C_PARAMETERS_START);
- int parametersEnd= methodSignature.lastIndexOf(C_PARAMETERS_END);
+ int parameterStart = methodSignature.indexOf(C_PARAMETERS_START);
+ int parametersEnd = methodSignature.lastIndexOf(C_PARAMETERS_END);
if (parameterStart == -1 || parametersEnd == -1) {
- // used to throw illegal argument exception, but now return empty list if we can't parse it
+ // used to throw illegal argument exception, but now return empty
+ // list if we can't parse it
return Collections.EMPTY_LIST;
}
- return getTypeSignatureList(methodSignature.substring(parameterStart + 1, parametersEnd));
+ return getTypeSignatureList(methodSignature.substring(
+ parameterStart + 1, parametersEnd));
}
-
+
private static List getTypeSignatureList(String typeSignatureList) {
- List list= new ArrayList();
- int pos= 0;
+ List list = new ArrayList();
+ int pos = 0;
while (pos < typeSignatureList.length()) {
- int signatureLength= nextTypeSignatureLength(typeSignatureList, pos);
- list.add(typeSignatureList.substring(pos, pos+= signatureLength));
+ int signatureLength = nextTypeSignatureLength(typeSignatureList,
+ pos);
+ list.add(typeSignatureList.substring(pos, pos += signatureLength));
}
return list;
}
-
+
private static int nextTypeSignatureLength(String signature, int startPos) {
- int inclusionLevel= 0;
- for (int i= startPos, length= signature.length(); i < length; i++) {
+ int inclusionLevel = 0;
+ for (int i = startPos, length = signature.length(); i < length; i++) {
if (inclusionLevel == 0) {
switch (signature.charAt(i)) {
- case C_CLASS_TYPE:
- case C_TYPE_VARIABLE:
- case C_WILDCARD_PLUS:
- case C_WILDCARD_MINUS:
- inclusionLevel= 1;
- break;
- case C_ARRAY:
- break;
- default:
- return i - startPos + 1;
+ case C_CLASS_TYPE:
+ case C_TYPE_VARIABLE:
+ case C_WILDCARD_PLUS:
+ case C_WILDCARD_MINUS:
+ inclusionLevel = 1;
+ break;
+ case C_ARRAY:
+ break;
+ default:
+ return i - startPos + 1;
}
} else {
switch (signature.charAt(i)) {
- case C_TYPE_END:
- if (inclusionLevel == 1) {
- return i - startPos + 1;
- }
- break;
- case C_TYPE_ARGUMENTS_START:
- inclusionLevel++;
- break;
- case C_TYPE_ARGUMENTS_END:
- inclusionLevel--;
- break;
+ case C_TYPE_END:
+ if (inclusionLevel == 1) {
+ return i - startPos + 1;
+ }
+ break;
+ case C_TYPE_ARGUMENTS_START:
+ inclusionLevel++;
+ break;
+ case C_TYPE_ARGUMENTS_END:
+ inclusionLevel--;
+ break;
}
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerTypeImpl.java
index 3327c8546..130b1ceaa 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerTypeImpl.java
@@ -10,34 +10,34 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.IntegerType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class IntegerTypeImpl extends PrimitiveTypeImpl implements IntegerType {
/**
* Creates new instance.
*/
public IntegerTypeImpl(VirtualMachineImpl vmImpl) {
- super("IntegerType", vmImpl, "int" , "I"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("IntegerType", vmImpl, "int", "I"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return IntegerValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
return virtualMachineImpl().mirrorOf(0);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerValueImpl.java
index 450f2594b..3cec79483 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/IntegerValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,12 +20,12 @@ import com.sun.jdi.IntegerValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class IntegerValueImpl extends PrimitiveValueImpl implements IntegerValue {
+public class IntegerValueImpl extends PrimitiveValueImpl implements
+ IntegerValue {
/** JDWP Tag. */
public static final byte tag = JdwpID.INT_TAG;
@@ -36,17 +35,19 @@ public class IntegerValueImpl extends PrimitiveValueImpl implements IntegerValue
public IntegerValueImpl(VirtualMachineImpl vmImpl, Integer value) {
super("IntegerValue", vmImpl, value); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getIntegerType();
}
@@ -57,20 +58,23 @@ public class IntegerValueImpl extends PrimitiveValueImpl implements IntegerValue
public int value() {
return intValue();
}
-
+
/**
* @return Reads and returns new instance.
*/
- public static IntegerValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static IntegerValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
int value = target.readInt("integerValue", in); //$NON-NLS-1$
return new IntegerValueImpl(vmImpl, new Integer(value));
}
-
+
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeInt(((Integer)fValue).intValue(), "intValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeInt(((Integer) fValue).intValue(), "intValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/InterfaceTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/InterfaceTypeImpl.java
index ea59f9d12..ee2cf1cef 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/InterfaceTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/InterfaceTypeImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
@@ -26,75 +25,85 @@ import com.sun.jdi.InterfaceType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class InterfaceTypeImpl extends ReferenceTypeImpl implements InterfaceType {
+public class InterfaceTypeImpl extends ReferenceTypeImpl implements
+ InterfaceType {
/** JDWP Tag. */
public static final byte typeTag = JdwpID.TYPE_TAG_INTERFACE;
/**
* Creates new InterfaceTypeImpl.
*/
- public InterfaceTypeImpl(VirtualMachineImpl vmImpl, JdwpInterfaceID interfaceID) {
+ public InterfaceTypeImpl(VirtualMachineImpl vmImpl,
+ JdwpInterfaceID interfaceID) {
super("InterfaceType", vmImpl, interfaceID); //$NON-NLS-1$
}
/**
* Creates new InterfaceTypeImpl.
*/
- public InterfaceTypeImpl(VirtualMachineImpl vmImpl, JdwpInterfaceID interfaceID, String signature, String genericSignature) {
+ public InterfaceTypeImpl(VirtualMachineImpl vmImpl,
+ JdwpInterfaceID interfaceID, String signature,
+ String genericSignature) {
super("InterfaceType", vmImpl, interfaceID, signature, genericSignature); //$NON-NLS-1$
}
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
- return new ClassObjectReferenceImpl(virtualMachineImpl(), new JdwpClassObjectID(virtualMachineImpl()));
+ return new ClassObjectReferenceImpl(virtualMachineImpl(),
+ new JdwpClassObjectID(virtualMachineImpl()));
}
/**
* @return Returns type tag.
*/
+ @Override
public byte typeTag() {
return typeTag;
}
-
+
/**
* Flushes all stored Jdwp results.
*/
+ @Override
public void flushStoredJdwpResults() {
super.flushStoredJdwpResults();
- // For all reftypes that have this interface cached, this cache must be undone.
- Iterator itr = virtualMachineImpl().allCachedRefTypes();
+ // For all reftypes that have this interface cached, this cache must be
+ // undone.
+ Iterator<Object> itr = virtualMachineImpl().allCachedRefTypes();
while (itr.hasNext()) {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)itr.next();
- if (refType.fInterfaces != null && refType.fInterfaces.contains(this)) {
+ ReferenceTypeImpl refType = (ReferenceTypeImpl) itr.next();
+ if (refType.fInterfaces != null
+ && refType.fInterfaces.contains(this)) {
refType.flushStoredJdwpResults();
}
}
-
+
}
-
+
/**
- * @return Returns the currently prepared classes which directly implement this interface.
+ * @return Returns the currently prepared classes which directly implement
+ * this interface.
*/
- public List implementors() {
+ public List<ClassTypeImpl> implementors() {
// Note that this information should not be cached.
- List implementors = new ArrayList();
- Iterator itr = virtualMachineImpl().allRefTypes();
+ List<ClassTypeImpl> implementors = new ArrayList<ClassTypeImpl>();
+ Iterator<ReferenceTypeImpl> itr = virtualMachineImpl().allRefTypes();
while (itr.hasNext()) {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)itr.next();
+ ReferenceTypeImpl refType = itr.next();
if (refType instanceof ClassTypeImpl) {
try {
- ClassTypeImpl classType = (ClassTypeImpl)refType;
+ ClassTypeImpl classType = (ClassTypeImpl) refType;
List interfaces = classType.interfaces();
if (interfaces.contains(this)) {
- implementors .add(classType);
+ implementors.add(classType);
}
} catch (ClassNotPreparedException e) {
continue;
@@ -103,19 +112,20 @@ public class InterfaceTypeImpl extends ReferenceTypeImpl implements InterfaceTyp
}
return implementors;
}
-
+
/**
- * @return Returns the currently prepared interfaces which directly extend this interface.
+ * @return Returns the currently prepared interfaces which directly extend
+ * this interface.
*/
- public List subinterfaces() {
+ public List<InterfaceTypeImpl> subinterfaces() {
// Note that this information should not be cached.
- List implementors = new ArrayList();
- Iterator itr = virtualMachineImpl().allRefTypes();
+ List<InterfaceTypeImpl> implementors = new ArrayList<InterfaceTypeImpl>();
+ Iterator<ReferenceTypeImpl> itr = virtualMachineImpl().allRefTypes();
while (itr.hasNext()) {
try {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)itr.next();
+ ReferenceTypeImpl refType = itr.next();
if (refType instanceof InterfaceTypeImpl) {
- InterfaceTypeImpl interFaceType = (InterfaceTypeImpl)refType;
+ InterfaceTypeImpl interFaceType = (InterfaceTypeImpl) refType;
List interfaces = interFaceType.superinterfaces();
if (interfaces.contains(this)) {
implementors.add(interFaceType);
@@ -127,25 +137,28 @@ public class InterfaceTypeImpl extends ReferenceTypeImpl implements InterfaceTyp
}
return implementors;
}
-
+
/**
- * @return Returns the interfaces directly extended by this interface.
+ * @return Returns the interfaces directly extended by this interface.
*/
public List superinterfaces() {
return interfaces();
}
-
- /**
+
+ /**
* @return Returns true if this type has been initialized.
*/
+ @Override
public boolean isInitialized() {
return isPrepared();
}
/**
- * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if ID is unknown a newly created ReferenceTypeImpl.
+ * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if
+ * ID is unknown a newly created ReferenceTypeImpl.
*/
- public static InterfaceTypeImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static InterfaceTypeImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpInterfaceID ID = new JdwpInterfaceID(vmImpl);
ID.read(in);
@@ -156,19 +169,23 @@ public class InterfaceTypeImpl extends ReferenceTypeImpl implements InterfaceTyp
if (ID.isNull()) {
return null;
}
-
- InterfaceTypeImpl mirror = (InterfaceTypeImpl)vmImpl.getCachedMirror(ID);
+
+ InterfaceTypeImpl mirror = (InterfaceTypeImpl) vmImpl
+ .getCachedMirror(ID);
if (mirror == null) {
mirror = new InterfaceTypeImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
}
return mirror;
- }
-
+ }
+
/**
- * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if ID is unknown a newly created ReferenceTypeImpl.
+ * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if
+ * ID is unknown a newly created ReferenceTypeImpl.
*/
- public static InterfaceTypeImpl readWithSignature(MirrorImpl target, boolean withGenericSignature, DataInputStream in) throws IOException {
+ public static InterfaceTypeImpl readWithSignature(MirrorImpl target,
+ boolean withGenericSignature, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpInterfaceID ID = new JdwpInterfaceID(vmImpl);
ID.read(in);
@@ -177,15 +194,16 @@ public class InterfaceTypeImpl extends ReferenceTypeImpl implements InterfaceTyp
}
String signature = target.readString("signature", in); //$NON-NLS-1$
- String genericSignature= null;
+ String genericSignature = null;
if (withGenericSignature) {
- genericSignature= target.readString("generic signature", in); //$NON-NLS-1$
+ genericSignature = target.readString("generic signature", in); //$NON-NLS-1$
}
if (ID.isNull()) {
return null;
}
-
- InterfaceTypeImpl mirror = (InterfaceTypeImpl)vmImpl.getCachedMirror(ID);
+
+ InterfaceTypeImpl mirror = (InterfaceTypeImpl) vmImpl
+ .getCachedMirror(ID);
if (mirror == null) {
mirror = new InterfaceTypeImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
@@ -193,5 +211,5 @@ public class InterfaceTypeImpl extends ReferenceTypeImpl implements InterfaceTyp
mirror.setSignature(signature);
mirror.setGenericSignature(genericSignature);
return mirror;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocalVariableImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocalVariableImpl.java
index 0d553aee5..fbfcaa27f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocalVariableImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocalVariableImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.LocalVariable;
import com.sun.jdi.StackFrame;
@@ -18,10 +17,9 @@ import com.sun.jdi.Type;
import com.sun.jdi.VMMismatchException;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class LocalVariableImpl extends MirrorImpl implements LocalVariable {
/** Method that holds local variable. */
@@ -39,14 +37,13 @@ public class LocalVariableImpl extends MirrorImpl implements LocalVariable {
/** The variables type name */
private String fTypeName;
/**
- * Unsigned value used in conjunction with codeIndex.
- * The variable can be get or set only when the current
- * codeIndex <= current frame code index < code index + length.
+ * Unsigned value used in conjunction with codeIndex. The variable can be
+ * get or set only when the current codeIndex <= current frame code index <
+ * code index + length.
* <p>
- * The length is set to -1 when this variable represents an
- * inferred argument (when local var info is unavailable).
- * We assume that such arguments are visible for the entire
- * method.
+ * The length is set to -1 when this variable represents an inferred
+ * argument (when local var info is unavailable). We assume that such
+ * arguments are visible for the entire method.
* </p>
* */
private int fLength;
@@ -54,158 +51,180 @@ public class LocalVariableImpl extends MirrorImpl implements LocalVariable {
private int fSlot;
/** Is the local variable an argument of its method? */
private boolean fIsArgument;
-
- public LocalVariableImpl(VirtualMachineImpl vmImpl, MethodImpl method, long codeIndex, String name, String signature, String genericSignature, int length, int slot, boolean isArgument) {
+
+ public LocalVariableImpl(VirtualMachineImpl vmImpl, MethodImpl method,
+ long codeIndex, String name, String signature,
+ String genericSignature, int length, int slot, boolean isArgument) {
super("LocalVariable", vmImpl); //$NON-NLS-1$
fMethod = method;
fCodeIndex = codeIndex;
fName = name;
fSignature = signature;
- fGenericSignature= genericSignature;
+ fGenericSignature = genericSignature;
fLength = length;
fSlot = slot;
fIsArgument = isArgument;
}
- /**
+ /**
* @return Returns local variable's index in its frame.
*/
public int slot() {
return fSlot;
}
-
- /**
+
+ /**
* @return Returns the hash code value.
*/
+ @Override
public int hashCode() {
- return fMethod.hashCode() + (int)fCodeIndex + fSlot;
+ return fMethod.hashCode() + (int) fCodeIndex + fSlot;
}
-
+
/**
- * @return Returns true if two mirrors refer to the same entity in the target VM.
+ * @return Returns true if two mirrors refer to the same entity in the
+ * target VM.
* @see java.lang.Object#equals(Object).
*/
+ @Override
public boolean equals(Object object) {
if (object != null && object.getClass().equals(this.getClass())) {
- LocalVariableImpl loc = (LocalVariableImpl)object;
- return fMethod.equals(loc.fMethod) && fCodeIndex == loc.fCodeIndex && fSlot == loc.fSlot;
+ LocalVariableImpl loc = (LocalVariableImpl) object;
+ return fMethod.equals(loc.fMethod) && fCodeIndex == loc.fCodeIndex
+ && fSlot == loc.fSlot;
}
return false;
}
-
+
/**
- * @return Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
+ * @return Returns a negative integer, zero, or a positive integer as this
+ * object is less than, equal to, or greater than the specified
+ * object.
*/
public int compareTo(Object object) {
if (object == null || !object.getClass().equals(this.getClass()))
- throw new ClassCastException(JDIMessages.LocalVariableImpl_Can__t_compare_local_variable_to_given_object_1);
-
- // See if methods are the same, if not return comparison between methods.
- LocalVariableImpl var2 = (LocalVariableImpl)object;
+ throw new ClassCastException(
+ JDIMessages.LocalVariableImpl_Can__t_compare_local_variable_to_given_object_1);
+
+ // See if methods are the same, if not return comparison between
+ // methods.
+ LocalVariableImpl var2 = (LocalVariableImpl) object;
if (!method().equals(var2.method()))
return method().compareTo(var2.method());
- // Return comparison between the index of each local variable in its stack frame.
- // Code indexes must be treated as unsigned. This matters if you have to compare them.
+ // Return comparison between the index of each local variable in its
+ // stack frame.
+ // Code indexes must be treated as unsigned. This matters if you have to
+ // compare them.
if (fCodeIndex < 0 || var2.fCodeIndex < 0)
- throw new InternalError(JDIMessages.LocalVariableImpl_Code_indexes_are_assumed_to_be_always_positive_2);
-
+ throw new InternalError(
+ JDIMessages.LocalVariableImpl_Code_indexes_are_assumed_to_be_always_positive_2);
+
long index2 = var2.fCodeIndex;
if (fCodeIndex < index2)
return -1;
else if (fCodeIndex > index2)
return 1;
- else return 0;
+ else
+ return 0;
}
-
- /**
+
+ /**
* @return Returns true if this variable is an argument to its method.
*/
public boolean isArgument() {
return fIsArgument;
}
-
- public boolean isVisible(StackFrame frame) throws IllegalArgumentException, VMMismatchException {
+
+ public boolean isVisible(StackFrame frame) throws IllegalArgumentException,
+ VMMismatchException {
checkVM(frame);
- StackFrameImpl frameImpl = (StackFrameImpl)frame;
+ StackFrameImpl frameImpl = (StackFrameImpl) frame;
if (!fMethod.equals(frameImpl.location().method()))
- throw new IllegalArgumentException(JDIMessages.LocalVariableImpl_The_stack_frame__s_method_does_not_match_this_variable__s_method_3);
+ throw new IllegalArgumentException(
+ JDIMessages.LocalVariableImpl_The_stack_frame__s_method_does_not_match_this_variable__s_method_3);
if (fLength == -1) {
// inferred argument - assume visible for entire method
return true;
}
long currentIndex = frameImpl.location().codeIndex();
-
- // Code indexes must be treated as unsigned. This matters if you have to compare them.
+
+ // Code indexes must be treated as unsigned. This matters if you have to
+ // compare them.
if (currentIndex >= 0 && fCodeIndex >= 0 && fCodeIndex + fLength >= 0)
- return fCodeIndex <= currentIndex && currentIndex < fCodeIndex + fLength;
+ return fCodeIndex <= currentIndex
+ && currentIndex < fCodeIndex + fLength;
- throw new InternalError(JDIMessages.LocalVariableImpl_Code_indexes_are_assumed_to_be_always_positive_4);
+ throw new InternalError(
+ JDIMessages.LocalVariableImpl_Code_indexes_are_assumed_to_be_always_positive_4);
}
-
- /**
+
+ /**
* @return Returns the name of the local variable.
*/
public String name() {
return fName;
}
-
- /**
+
+ /**
* @return Returns the signature of the local variable.
*/
public String signature() {
return fSignature;
}
-
- /**
- * @return Returns the type of the this LocalVariable.
+
+ /**
+ * @return Returns the type of the this LocalVariable.
*/
public Type type() throws ClassNotLoadedException {
if (fType == null) {
- fType = TypeImpl.create(virtualMachineImpl(), fSignature, method().declaringType().classLoader());
+ fType = TypeImpl.create(virtualMachineImpl(), fSignature, method()
+ .declaringType().classLoader());
}
return fType;
}
-
- /**
- * @return Returns a text representation of the declared type of this variable.
+
+ /**
+ * @return Returns a text representation of the declared type of this
+ * variable.
*/
public String typeName() {
if (fTypeName == null) {
- fTypeName = TypeImpl.signatureToName(fSignature);
+ fTypeName = TypeImpl.signatureToName(fSignature);
}
return fTypeName;
}
-
- /**
+
+ /**
* @return Returns the tag of the declared type of this variable.
*/
- public byte tag() {
+ public byte tag() {
return TypeImpl.signatureToTag(fSignature);
}
-
- /**
+
+ /**
* @return Returns the method that holds the local variable.
*/
- public MethodImpl method() {
+ public MethodImpl method() {
return fMethod;
}
-
- /**
+
+ /**
* @return Returns true if the local variable is the 'this' pointer.
*/
public boolean isThis() {
return slot() == 0 && !method().isStatic();
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
return fName;
}
-
+
public String genericSignature() {
return fGenericSignature;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocationImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocationImpl.java
index 0254699d4..4ad1ddd7a 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocationImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LocationImpl.java
@@ -10,32 +10,33 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
-import com.ibm.icu.text.MessageFormat;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.Location;
import com.sun.jdi.Method;
import com.sun.jdi.ReferenceType;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class LocationImpl extends MirrorImpl implements Location {
/** Line nr used if line numbers are not available. */
public static final int LINE_NR_NOT_AVAILABLE = -1;
-
+
/** Method that holds the location. */
MethodImpl fMethod;
- /** Index of location within the method, note: this value must be treated as UNSIGNED! */
+ /**
+ * Index of location within the method, note: this value must be treated as
+ * UNSIGNED!
+ */
long fIndex;
-
+
/**
* Creates new instance.
*/
@@ -44,91 +45,106 @@ public class LocationImpl extends MirrorImpl implements Location {
fMethod = method;
fIndex = index;
}
-
+
/**
* @return Returns the code position within this location's method.
*/
public long codeIndex() {
return fIndex;
}
-
+
/**
- * @return Returns the type to which this Location belongs.
+ * @return Returns the type to which this Location belongs.
*/
public ReferenceType declaringType() {
return fMethod.declaringType();
}
-
- /**
+
+ /**
* @return Returns the hash code value.
*/
+ @Override
public int hashCode() {
- return fMethod.hashCode() + (int)fIndex;
+ return fMethod.hashCode() + (int) fIndex;
}
-
+
/**
- * @return Returns true if two mirrors refer to the same entity in the target VM.
+ * @return Returns true if two mirrors refer to the same entity in the
+ * target VM.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
if (object != null && object.getClass().equals(this.getClass())) {
- LocationImpl loc = (LocationImpl)object;
+ LocationImpl loc = (LocationImpl) object;
return fMethod.equals(loc.fMethod) && fIndex == loc.fIndex;
}
return false;
}
-
+
/**
- * @return Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
+ * @return Returns a negative integer, zero, or a positive integer as this
+ * object is less than, equal to, or greater than the specified
+ * object.
*/
public int compareTo(Object object) {
if (object == null || !object.getClass().equals(this.getClass()))
- throw new ClassCastException(JDIMessages.LocationImpl_Can__t_compare_location_to_given_object_1);
-
- // See if methods are the same, if not return comparison between methods.
- LocationImpl location2 = (LocationImpl)object;
+ throw new ClassCastException(
+ JDIMessages.LocationImpl_Can__t_compare_location_to_given_object_1);
+
+ // See if methods are the same, if not return comparison between
+ // methods.
+ LocationImpl location2 = (LocationImpl) object;
if (!method().equals(location2.method()))
return method().compareTo(location2.method());
- // Return comparison between code-indexes.
- // Code indexes must be treated as unsigned. This matters if you have to compare them.
+ // Return comparison between code-indexes.
+ // Code indexes must be treated as unsigned. This matters if you have to
+ // compare them.
if (codeIndex() < 0 || location2.codeIndex() < 0)
- throw new InternalError(JDIMessages.LocationImpl_Code_indexes_are_assumed_to_be_always_positive_2);
+ throw new InternalError(
+ JDIMessages.LocationImpl_Code_indexes_are_assumed_to_be_always_positive_2);
if (codeIndex() < location2.codeIndex())
return -1;
else if (codeIndex() > location2.codeIndex())
return 1;
- else return 0;
+ else
+ return 0;
}
-
- /**
- * @return Returns an int specifying the line in the source, return -1 if the information is not available.
+
+ /**
+ * @return Returns an int specifying the line in the source, return -1 if
+ * the information is not available.
*/
public int lineNumber() {
return lineNumber(virtualMachine().getDefaultStratum());
}
-
- /**
+
+ /**
* @return Returns the Method if this location is in a method.
*/
public Method method() {
return fMethod;
}
-
- /**
+
+ /**
* @return a string specifying the source.
*/
public String sourceName() throws AbsentInformationException {
return sourceName(virtualMachine().getDefaultStratum());
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
try {
- return MessageFormat.format(JDIMessages.LocationImpl_sourcename___0___line___1__3, new String[]{sourceName(), Integer.toString(lineNumber())});
+ return MessageFormat
+ .format(JDIMessages.LocationImpl_sourcename___0___line___1__3,
+ new String[] { sourceName(),
+ Integer.toString(lineNumber()) });
} catch (Exception e) {
return fDescription;
}
@@ -137,17 +153,20 @@ public class LocationImpl extends MirrorImpl implements Location {
/**
* Writes JDWP representation.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
fMethod.writeWithReferenceTypeWithTag(target, out);
target.writeLong(fIndex, "index", out); //$NON-NLS-1$
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static LocationImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static LocationImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- // Notice that Locations are not stored or cached because they don't 'remember' any information.
+ // Notice that Locations are not stored or cached because they don't
+ // 'remember' any information.
MethodImpl method = MethodImpl.readWithReferenceTypeWithTag(target, in);
long index = target.readLong("index", in); //$NON-NLS-1$
if (method == null) {
@@ -155,7 +174,7 @@ public class LocationImpl extends MirrorImpl implements Location {
}
return new LocationImpl(vmImpl, method, index);
}
-
+
/**
* @see Location#lineNumber(String)
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongTypeImpl.java
index bb7d2a206..3af8fcb8e 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongTypeImpl.java
@@ -10,34 +10,34 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.LongType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class LongTypeImpl extends PrimitiveTypeImpl implements LongType {
/**
* Creates new instance.
*/
public LongTypeImpl(VirtualMachineImpl vmImpl) {
- super("LongType", vmImpl, "long" , "J"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("LongType", vmImpl, "long", "J"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return LongValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
return virtualMachineImpl().mirrorOf(0L);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongValueImpl.java
index e30baa700..e11e0746f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/LongValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,10 +20,9 @@ import com.sun.jdi.LongValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class LongValueImpl extends PrimitiveValueImpl implements LongValue {
/** JDWP Tag. */
@@ -36,17 +34,19 @@ public class LongValueImpl extends PrimitiveValueImpl implements LongValue {
public LongValueImpl(VirtualMachineImpl vmImpl, Long value) {
super("LongValue", vmImpl, value); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getLongType();
}
@@ -57,20 +57,23 @@ public class LongValueImpl extends PrimitiveValueImpl implements LongValue {
public long value() {
return longValue();
}
-
+
/**
* @return Reads and returns new instance.
*/
- public static LongValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static LongValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
long value = target.readLong("longValue", in); //$NON-NLS-1$
return new LongValueImpl(vmImpl, new Long(value));
}
-
+
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeLong(((Long)fValue).longValue(), "longValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeLong(((Long) fValue).longValue(), "longValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MethodImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MethodImpl.java
index 7aa5cee30..0369995f1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MethodImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MethodImpl.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -41,7 +40,6 @@ import com.sun.jdi.Location;
import com.sun.jdi.Method;
import com.sun.jdi.Type;
-
/**
* Implementation of com.sun.jdi.Method.
*/
@@ -49,36 +47,40 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
/** InvokeOptions Constants. */
public static final int INVOKE_SINGLE_THREADED_JDWP = 0x01;
public static final int INVOKE_NONVIRTUAL_JDWP = 0x02;
-
+
/** Map with Strings for flag bits. */
private static String[] fgInvokeOptions = null;
-
+
/** MethodTypeID that corresponds to this reference. */
private JdwpMethodID fMethodID;
-
+
/** The following are the stored results of JDWP calls. */
- private List fVariables = null;
+ private List<LocalVariableImpl> fVariables = null;
private long fLowestValidCodeIndex = -1;
private long fHighestValidCodeIndex = -1;
- private Map fCodeIndexToLine = null;
- private Map fLineToCodeIndexes = null;
- private Map fStratumAllLineLocations = null;
+ private Map<Long, Integer> fCodeIndexToLine = null;
+ private Map<Integer, List> fLineToCodeIndexes = null;
+ private Map<String, Map> fStratumAllLineLocations = null;
private int fArgumentSlotsCount = -1;
- private List fArguments = null;
- private List fArgumentTypes = null;
- private List fArgumentTypeNames = null;
+ private List<LocalVariableImpl> fArguments = null;
+ private List<TypeImpl> fArgumentTypes = null;
+ private List<String> fArgumentTypeNames = null;
private List fArgumentTypeSignatures = null;
private byte[] fByteCodes = null;
private long[] fCodeIndexTable;
private int[] fJavaStratumLineNumberTable;
-
- private String fReturnTypeName= null;
-
+
+ private String fReturnTypeName = null;
+
/**
* Creates new MethodImpl.
*/
- public MethodImpl(VirtualMachineImpl vmImpl, ReferenceTypeImpl declaringType, JdwpMethodID methodID, String name, String signature, String genericSignature, int modifierBits) {
- super("Method", vmImpl, declaringType, name, signature, genericSignature, modifierBits); //$NON-NLS-1$
+ public MethodImpl(VirtualMachineImpl vmImpl,
+ ReferenceTypeImpl declaringType, JdwpMethodID methodID,
+ String name, String signature, String genericSignature,
+ int modifierBits) {
+ super(
+ "Method", vmImpl, declaringType, name, signature, genericSignature, modifierBits); //$NON-NLS-1$
fMethodID = methodID;
}
@@ -92,8 +94,8 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
fCodeIndexToLine = null;
fLineToCodeIndexes = null;
fStratumAllLineLocations = null;
- fCodeIndexTable= null;
- fJavaStratumLineNumberTable= null;
+ fCodeIndexTable = null;
+ fJavaStratumLineNumberTable = null;
fArgumentSlotsCount = -1;
fArguments = null;
fArgumentTypes = null;
@@ -101,38 +103,40 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
fArgumentTypeSignatures = null;
fByteCodes = null;
}
-
- /**
+
+ /**
* @return Returns methodID of method.
*/
protected JdwpMethodID getMethodID() {
return fMethodID;
}
-
- /**
+
+ /**
* @return Returns map of location to line number.
*/
- protected Map javaStratumCodeIndexToLine() throws AbsentInformationException {
+ protected Map<Long, Integer> javaStratumCodeIndexToLine()
+ throws AbsentInformationException {
if (isAbstract()) {
return Collections.EMPTY_MAP;
}
getLineTable();
return fCodeIndexToLine;
}
-
- /**
+
+ /**
* @return Returns map of line number to locations.
*/
- protected List javaStratumLineToCodeIndexes(int line) throws AbsentInformationException {
+ protected List javaStratumLineToCodeIndexes(int line)
+ throws AbsentInformationException {
if (isAbstract() || isNative()) {
return null;
}
getLineTable();
-
- return (List)fLineToCodeIndexes.get(new Integer(line));
+
+ return fLineToCodeIndexes.get(new Integer(line));
}
-
- /**
+
+ /**
* Gets line table from VM.
*/
private void getLineTable() throws AbsentInformationException {
@@ -141,7 +145,8 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
}
if (fCodeIndexToLine != null) {
if (fCodeIndexToLine.isEmpty()) {
- throw new AbsentInformationException(JDIMessages.MethodImpl_Got_empty_line_number_table_for_this_method_1);
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_Got_empty_line_number_table_for_this_method_1);
}
return;
}
@@ -151,42 +156,46 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeWithReferenceType(this, outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.M_LINE_TABLE, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.M_LINE_TABLE, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.ABSENT_INFORMATION:
- throw new AbsentInformationException(JDIMessages.MethodImpl_No_line_number_information_available_2);
- case JdwpReplyPacket.NATIVE_METHOD:
- throw new AbsentInformationException(JDIMessages.MethodImpl_No_line_number_information_available_2);
+ case JdwpReplyPacket.ABSENT_INFORMATION:
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_No_line_number_information_available_2);
+ case JdwpReplyPacket.NATIVE_METHOD:
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_No_line_number_information_available_2);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
fLowestValidCodeIndex = readLong("lowest index", replyData); //$NON-NLS-1$
fHighestValidCodeIndex = readLong("highest index", replyData); //$NON-NLS-1$
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- fCodeIndexToLine = new HashMap();
- fLineToCodeIndexes = new HashMap();
+ fCodeIndexToLine = new HashMap<Long, Integer>();
+ fLineToCodeIndexes = new HashMap<Integer, List>();
if (nrOfElements == 0) {
- throw new AbsentInformationException(JDIMessages.MethodImpl_Got_empty_line_number_table_for_this_method_3);
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_Got_empty_line_number_table_for_this_method_3);
}
- fCodeIndexTable= new long[nrOfElements];
- fJavaStratumLineNumberTable= new int[nrOfElements];
+ fCodeIndexTable = new long[nrOfElements];
+ fJavaStratumLineNumberTable = new int[nrOfElements];
for (int i = 0; i < nrOfElements; i++) {
long lineCodeIndex = readLong("code index", replyData); //$NON-NLS-1$
Long lineCodeIndexLong = new Long(lineCodeIndex);
int lineNr = readInt("line nr", replyData); //$NON-NLS-1$
Integer lineNrInt = new Integer(lineNr);
-
+
// Add entry to code-index to line mapping.
fCodeIndexToLine.put(lineCodeIndexLong, lineNrInt);
-
- fCodeIndexTable[i]= lineCodeIndex;
- fJavaStratumLineNumberTable[i]= lineNr;
-
- List lineNrEntry = (List)fLineToCodeIndexes.get(lineNrInt);
+
+ fCodeIndexTable[i] = lineCodeIndex;
+ fJavaStratumLineNumberTable[i] = lineNr;
+
+ List<Long> lineNrEntry = fLineToCodeIndexes.get(lineNrInt);
if (lineNrEntry == null) {
- lineNrEntry= new ArrayList();
+ lineNrEntry = new ArrayList<Long>();
fLineToCodeIndexes.put(lineNrInt, lineNrEntry);
}
lineNrEntry.add(lineCodeIndexLong);
@@ -198,126 +207,135 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
} finally {
handledJdwpRequest();
}
- }
-
- /**
- * @return Returns the line number that corresponds to the given lineCodeIndex.
+ }
+
+ /**
+ * @return Returns the line number that corresponds to the given
+ * lineCodeIndex.
*/
- protected int javaStratumLineNumber(long lineCodeIndex) throws AbsentInformationException {
+ protected int javaStratumLineNumber(long lineCodeIndex)
+ throws AbsentInformationException {
if (isAbstract() || isNative() || isObsolete()) {
return -1;
}
getLineTable();
if (lineCodeIndex > fHighestValidCodeIndex) {
- throw new AbsentInformationException(JDIMessages.MethodImpl_Invalid_code_index_of_a_location_given_4);
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_Invalid_code_index_of_a_location_given_4);
}
Long lineCodeIndexObj;
Integer lineNrObj;
- long index= lineCodeIndex;
+ long index = lineCodeIndex;
// Search for the line where this code index is located.
do {
lineCodeIndexObj = new Long(index);
- lineNrObj = (Integer)javaStratumCodeIndexToLine().get(lineCodeIndexObj);
+ lineNrObj = javaStratumCodeIndexToLine().get(
+ lineCodeIndexObj);
} while (lineNrObj == null && --index >= fLowestValidCodeIndex);
if (lineNrObj == null) {
if (lineCodeIndex >= fLowestValidCodeIndex) {
- index= lineCodeIndex;
+ index = lineCodeIndex;
do {
lineCodeIndexObj = new Long(index);
- lineNrObj = (Integer)javaStratumCodeIndexToLine().get(lineCodeIndexObj);
+ lineNrObj = javaStratumCodeIndexToLine().get(
+ lineCodeIndexObj);
} while (lineNrObj == null && ++index <= fHighestValidCodeIndex);
if (lineNrObj != null) {
return lineNrObj.intValue();
}
}
- throw new AbsentInformationException (JDIMessages.MethodImpl_Invalid_code_index_of_a_location_given_4);
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_Invalid_code_index_of_a_location_given_4);
}
return lineNrObj.intValue();
}
-
/**
* @see com.sun.jdi.Method#allLineLocations()
*/
public List allLineLocations() throws AbsentInformationException {
return allLineLocations(virtualMachine().getDefaultStratum(), null);
}
-
+
/**
* @see com.sun.jdi.Method#arguments()
*/
- public List arguments() throws AbsentInformationException {
+ public List<LocalVariableImpl> arguments() throws AbsentInformationException {
if (isNative() || isAbstract()) {
- throw new AbsentInformationException(JDIMessages.MethodImpl_No_local_variable_information_available_9);
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_No_local_variable_information_available_9);
}
if (fArguments != null) {
return fArguments;
}
-
- List result = new ArrayList();
- Iterator iter = variables().iterator();
+
+ List<LocalVariableImpl> result = new ArrayList<LocalVariableImpl>();
+ Iterator<LocalVariableImpl> iter = variables().iterator();
while (iter.hasNext()) {
- LocalVariableImpl var = (LocalVariableImpl)iter.next();
+ LocalVariableImpl var = iter.next();
if (var.isArgument())
result.add(var);
}
fArguments = result;
return fArguments;
}
-
- /**
- * @return Returns a text representation of all declared argument types of this method.
+
+ /**
+ * @return Returns a text representation of all declared argument types of
+ * this method.
*/
- public List argumentTypeNames() {
+ public List<String> argumentTypeNames() {
if (fArgumentTypeNames != null) {
return fArgumentTypeNames;
}
- List argumentTypeSignatures= argumentTypeSignatures();
- List result= new ArrayList();
- for (Iterator iter= argumentTypeSignatures.iterator(); iter.hasNext();) {
+ List argumentTypeSignatures = argumentTypeSignatures();
+ List<String> result = new ArrayList<String>();
+ for (Iterator iter = argumentTypeSignatures.iterator(); iter.hasNext();) {
result.add(TypeImpl.signatureToName((String) iter.next()));
}
-
- fArgumentTypeNames= result;
+
+ fArgumentTypeNames = result;
return fArgumentTypeNames;
}
-
- /**
- * @return Returns a signatures of all declared argument types of this method.
+ /**
+ * @return Returns a signatures of all declared argument types of this
+ * method.
*/
private List argumentTypeSignatures() {
if (fArgumentTypeSignatures != null) {
return fArgumentTypeSignatures;
}
-
- fArgumentTypeSignatures= GenericSignature.getParameterTypes(signature());
+
+ fArgumentTypeSignatures = GenericSignature
+ .getParameterTypes(signature());
return fArgumentTypeSignatures;
}
- /**
- * @return Returns the list containing the type of each argument.
+ /**
+ * @return Returns the list containing the type of each argument.
*/
- public List argumentTypes() throws ClassNotLoadedException {
+ public List<TypeImpl> argumentTypes() throws ClassNotLoadedException {
if (fArgumentTypes != null) {
return fArgumentTypes;
}
- List result = new ArrayList();
+ List<TypeImpl> result = new ArrayList<TypeImpl>();
Iterator iter = argumentTypeSignatures().iterator();
- ClassLoaderReference classLoaderRef= declaringType().classLoader();
- VirtualMachineImpl vm= virtualMachineImpl();
+ ClassLoaderReference classLoaderRef = declaringType().classLoader();
+ VirtualMachineImpl vm = virtualMachineImpl();
while (iter.hasNext()) {
- String argumentTypeSignature = (String)iter.next();
- result.add(TypeImpl.create(vm, argumentTypeSignature, classLoaderRef));
+ String argumentTypeSignature = (String) iter.next();
+ result.add(TypeImpl.create(vm, argumentTypeSignature,
+ classLoaderRef));
}
fArgumentTypes = result;
return fArgumentTypes;
}
- /**
- * @return Returns an array containing the bytecodes for this method.
+ /**
+ * @return Returns an array containing the bytecodes for this method.
*/
public byte[] bytecodes() {
if (fByteCodes != null) {
@@ -329,10 +347,11 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeWithReferenceType(this, outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.M_BYTECODES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.M_BYTECODES, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int length = readInt("length", replyData); //$NON-NLS-1$
fByteCodes = readByteArray(length, "bytecodes", replyData); //$NON-NLS-1$
@@ -346,36 +365,44 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
}
}
- /**
+ /**
* @return Returns the hash code value.
*/
+ @Override
public int hashCode() {
return fMethodID.hashCode();
}
-
+
/**
- * @return Returns true if two mirrors refer to the same entity in the target VM.
+ * @return Returns true if two mirrors refer to the same entity in the
+ * target VM.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
return object != null
- && object.getClass().equals(this.getClass())
- && fMethodID.equals(((MethodImpl)object).fMethodID)
- && referenceTypeImpl().equals(((MethodImpl)object).referenceTypeImpl());
+ && object.getClass().equals(this.getClass())
+ && fMethodID.equals(((MethodImpl) object).fMethodID)
+ && referenceTypeImpl().equals(
+ ((MethodImpl) object).referenceTypeImpl());
}
/**
- * @return Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
+ * @return Returns a negative integer, zero, or a positive integer as this
+ * object is less than, equal to, or greater than the specified
+ * object.
*/
public int compareTo(Object object) {
if (object == null || !object.getClass().equals(this.getClass()))
- throw new ClassCastException(JDIMessages.MethodImpl_Can__t_compare_method_to_given_object_6);
-
- // See if declaring types are the same, if not return comparison between declaring types.
- Method type2 = (Method)object;
+ throw new ClassCastException(
+ JDIMessages.MethodImpl_Can__t_compare_method_to_given_object_6);
+
+ // See if declaring types are the same, if not return comparison between
+ // declaring types.
+ Method type2 = (Method) object;
if (!declaringType().equals(type2.declaringType()))
return declaringType().compareTo(type2.declaringType());
-
+
// Return comparison of position within declaring type.
int index1 = declaringType().methods().indexOf(this);
int index2 = type2.declaringType().methods().indexOf(type2);
@@ -387,44 +414,42 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
return 0;
}
}
-
-
+
/**
* @see com.sun.jdi.Method#isAbstract()
*/
public boolean isAbstract() {
return (fModifierBits & MODIFIER_ACC_ABSTRACT) != 0;
}
-
-
+
/**
* @see com.sun.jdi.Method#isConstructor()
*/
public boolean isConstructor() {
return name().equals("<init>"); //$NON-NLS-1$
}
-
+
/**
* @see com.sun.jdi.Method#isNative()
*/
public boolean isNative() {
return (fModifierBits & MODIFIER_ACC_NATIVE) != 0;
}
-
+
/**
* @see com.sun.jdi.Method#isStaticInitializer()
*/
public boolean isStaticInitializer() {
return name().equals("<clinit>"); //$NON-NLS-1$
}
-
+
/**
* @see com.sun.jdi.Method#isSynchronized()
*/
public boolean isSynchronized() {
return (fModifierBits & MODIFIER_ACC_SYNCHRONIZED) != 0;
}
-
+
/**
* @see com.sun.jdi.Method#locationOfCodeIndex(long)
*/
@@ -433,31 +458,38 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
return null;
}
try {
- Integer lineNrInt = (Integer)javaStratumCodeIndexToLine().get(new Long(index));
+ Integer lineNrInt = javaStratumCodeIndexToLine().get(
+ new Long(index));
if (lineNrInt == null) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.MethodImpl_No_valid_location_at_the_specified_code_index__0__2, new Object[]{Long.toString(index)}));
+ throw new AbsentInformationException(
+ MessageFormat
+ .format(JDIMessages.MethodImpl_No_valid_location_at_the_specified_code_index__0__2,
+ new Object[] { Long.toString(index) }));
}
- } catch (AbsentInformationException e ) {
+ } catch (AbsentInformationException e) {
}
return new LocationImpl(virtualMachineImpl(), this, index);
}
-
+
/**
* @see com.sun.jdi.Method#locationsOfLine(int)
*/
public List locationsOfLine(int line) throws AbsentInformationException {
return locationsOfLine(virtualMachine().getDefaultStratum(), null, line);
}
-
+
/**
* @see com.sun.jdi.Method#returnType()
*/
public Type returnType() throws ClassNotLoadedException {
- int startIndex = signature().lastIndexOf(')') + 1; // Signature position is just after ending brace.
- return TypeImpl.create(virtualMachineImpl(), signature().substring(startIndex), declaringType().classLoader());
+ int startIndex = signature().lastIndexOf(')') + 1; // Signature position
+ // is just after
+ // ending brace.
+ return TypeImpl.create(virtualMachineImpl(),
+ signature().substring(startIndex), declaringType()
+ .classLoader());
}
-
/**
* @see com.sun.jdi.Method#returnTypeName()
*/
@@ -465,20 +497,23 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
if (fReturnTypeName != null) {
return fReturnTypeName;
}
- int startIndex = signature().lastIndexOf(')') + 1; // Signature position is just after ending brace.
- fReturnTypeName= TypeImpl.signatureToName(signature().substring(startIndex));
+ int startIndex = signature().lastIndexOf(')') + 1; // Signature position
+ // is just after
+ // ending brace.
+ fReturnTypeName = TypeImpl.signatureToName(signature().substring(
+ startIndex));
return fReturnTypeName;
- }
-
-
+ }
+
/**
* @see com.sun.jdi.Method#variables()
*/
- public List variables() throws AbsentInformationException {
+ public List<LocalVariableImpl> variables() throws AbsentInformationException {
if (isNative() || isAbstract()) {
- throw new AbsentInformationException(JDIMessages.MethodImpl_No_local_variable_information_available_9);
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_No_local_variable_information_available_9);
}
-
+
if (fVariables != null) {
return fVariables;
}
@@ -488,43 +523,50 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeWithReferenceType(this, outData);
-
- boolean withGenericSignature= virtualMachineImpl().isJdwpVersionGreaterOrEqual(1, 5);
- int jdwpCommand= withGenericSignature ? JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC : JdwpCommandPacket.M_VARIABLE_TABLE;
+
+ boolean withGenericSignature = virtualMachineImpl()
+ .isJdwpVersionGreaterOrEqual(1, 5);
+ int jdwpCommand = withGenericSignature ? JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC
+ : JdwpCommandPacket.M_VARIABLE_TABLE;
JdwpReplyPacket replyPacket = requestVM(jdwpCommand, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.ABSENT_INFORMATION:
- return inferArguments();
+ case JdwpReplyPacket.ABSENT_INFORMATION:
+ return inferArguments();
}
-
+
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
fArgumentSlotsCount = readInt("arg count", replyData); //$NON-NLS-1$
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- List variables = new ArrayList(nrOfElements);
+ List<LocalVariableImpl> variables = new ArrayList<LocalVariableImpl>(nrOfElements);
for (int i = 0; i < nrOfElements; i++) {
long codeIndex = readLong("code index", replyData); //$NON-NLS-1$
String name = readString("name", replyData); //$NON-NLS-1$
String signature = readString("signature", replyData); //$NON-NLS-1$
- String genericSignature= null;
+ String genericSignature = null;
if (withGenericSignature) {
- genericSignature= readString("generic signature", replyData); //$NON-NLS-1$
+ genericSignature = readString(
+ "generic signature", replyData); //$NON-NLS-1$
if ("".equals(genericSignature)) { //$NON-NLS-1$
- genericSignature= null;
+ genericSignature = null;
}
}
int length = readInt("length", replyData); //$NON-NLS-1$
int slot = readInt("slot", replyData); //$NON-NLS-1$
boolean isArgument = slot < fArgumentSlotsCount;
- // Note that for instance methods, the first slot contains the this reference.
+ // Note that for instance methods, the first slot contains the
+ // this reference.
if (isStatic() || slot > 0) {
- LocalVariableImpl localVar = new LocalVariableImpl(virtualMachineImpl(), this, codeIndex, name, signature, genericSignature, length, slot, isArgument);
+ LocalVariableImpl localVar = new LocalVariableImpl(
+ virtualMachineImpl(), this, codeIndex, name,
+ signature, genericSignature, length, slot,
+ isArgument);
variables.add(localVar);
}
}
- fVariables= variables;
+ fVariables = variables;
return fVariables;
} catch (IOException e) {
fArgumentSlotsCount = -1;
@@ -535,56 +577,60 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
handledJdwpRequest();
}
}
-
-
+
/**
* @throws AbsentInformationException
*/
- private List inferArguments() throws AbsentInformationException {
+ private List<LocalVariableImpl> inferArguments() throws AbsentInformationException {
// infer arguments, if possible
-
+
// try to generate the right generic signature for each argument
- String genericSignature= genericSignature();
- String[] signatures= (String[]) argumentTypeSignatures().toArray(new String[0]);
+ String genericSignature = genericSignature();
+ String[] signatures = (String[]) argumentTypeSignatures().toArray(
+ new String[0]);
String[] genericSignatures;
if (genericSignature == null) {
- genericSignatures= new String[signatures.length];
+ genericSignatures = new String[signatures.length];
} else {
- genericSignatures= (String[]) GenericSignature.getParameterTypes(genericSignature).toArray(new String[0]);
- for (int i= 0; i < genericSignatures.length; i++) {
+ genericSignatures = (String[]) GenericSignature.getParameterTypes(
+ genericSignature).toArray(new String[0]);
+ for (int i = 0; i < genericSignatures.length; i++) {
if (genericSignatures[i].equals(signatures[i])) {
- genericSignatures[i]= null;
+ genericSignatures[i] = null;
}
}
}
-
+
int slot = 0;
if (!isStatic()) {
slot++;
}
- if (signatures.length >0) {
+ if (signatures.length > 0) {
fArgumentSlotsCount = signatures.length;
- fVariables = new ArrayList(fArgumentSlotsCount);
+ fVariables = new ArrayList<LocalVariableImpl>(fArgumentSlotsCount);
for (int i = 0; i < signatures.length; i++) {
String name = "arg" + i; //$NON-NLS-1$
- LocalVariableImpl localVar = new LocalVariableImpl(virtualMachineImpl(), this, 0, name, signatures[i], genericSignatures[i], -1, slot, true);
+ LocalVariableImpl localVar = new LocalVariableImpl(
+ virtualMachineImpl(), this, 0, name, signatures[i],
+ genericSignatures[i], -1, slot, true);
fVariables.add(localVar);
slot++;
}
return fVariables;
}
- throw new AbsentInformationException(JDIMessages.MethodImpl_No_local_variable_information_available_9);
+ throw new AbsentInformationException(
+ JDIMessages.MethodImpl_No_local_variable_information_available_9);
}
/**
* @see com.sun.jdi.Method#variablesByName(String)
*/
- public List variablesByName(String name) throws AbsentInformationException {
- Iterator iter = variables().iterator();
- List result = new ArrayList();
+ public List<LocalVariableImpl> variablesByName(String name) throws AbsentInformationException {
+ Iterator<LocalVariableImpl> iter = variables().iterator();
+ List<LocalVariableImpl> result = new ArrayList<LocalVariableImpl>();
while (iter.hasNext()) {
- LocalVariableImpl var = (LocalVariableImpl)iter.next();
+ LocalVariableImpl var = iter.next();
if (var.name().equals(name)) {
result.add(var);
}
@@ -603,30 +649,33 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
return new LocationImpl(virtualMachineImpl(), this, -1);
}
// First retrieve line code table.
- try {
+ try {
getLineTable();
} catch (AbsentInformationException e) {
return new LocationImpl(virtualMachineImpl(), this, -1);
}
// Return location with Lowest Valid Code Index.
- return new LocationImpl(virtualMachineImpl(), this, fLowestValidCodeIndex);
+ return new LocationImpl(virtualMachineImpl(), this,
+ fLowestValidCodeIndex);
}
-
+
/**
* Writes JDWP representation.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
fMethodID.write(out);
if (target.fVerboseWriter != null) {
target.fVerboseWriter.println("method", fMethodID.value()); //$NON-NLS-1$
}
}
-
+
/**
* Writes JDWP representation, including ReferenceType.
*/
- protected void writeWithReferenceType(MirrorImpl target, DataOutputStream out) throws IOException {
+ protected void writeWithReferenceType(MirrorImpl target,
+ DataOutputStream out) throws IOException {
referenceTypeImpl().write(target, out);
write(target, out);
}
@@ -634,7 +683,8 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
/**
* Writes JDWP representation, including ReferenceType with Tag.
*/
- protected void writeWithReferenceTypeWithTag(MirrorImpl target, DataOutputStream out) throws IOException {
+ protected void writeWithReferenceTypeWithTag(MirrorImpl target,
+ DataOutputStream out) throws IOException {
referenceTypeImpl().writeWithTag(target, out);
write(target, out);
}
@@ -642,10 +692,12 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
/**
* @return Reads JDWP representation and returns new instance.
*/
- protected static MethodImpl readWithReferenceTypeWithTag(MirrorImpl target, DataInputStream in) throws IOException {
+ protected static MethodImpl readWithReferenceTypeWithTag(MirrorImpl target,
+ DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- // See Location.
- ReferenceTypeImpl referenceType = ReferenceTypeImpl.readWithTypeTag(target, in);
+ // See Location.
+ ReferenceTypeImpl referenceType = ReferenceTypeImpl.readWithTypeTag(
+ target, in);
if (referenceType == null)
return null;
@@ -658,19 +710,23 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
if (ID.isNull()) {
return null;
}
-
+
// The method must be part of a known reference type.
MethodImpl method = referenceType.findMethod(ID);
if (method == null) {
- throw new InternalError(JDIMessages.MethodImpl_Got_MethodID_of_ReferenceType_that_is_not_a_member_of_the_ReferenceType_10);
+ throw new InternalError(
+ JDIMessages.MethodImpl_Got_MethodID_of_ReferenceType_that_is_not_a_member_of_the_ReferenceType_10);
}
return method;
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- protected static MethodImpl readWithNameSignatureModifiers(ReferenceTypeImpl target, ReferenceTypeImpl referenceType, boolean withGenericSignature, DataInputStream in) throws IOException {
+ protected static MethodImpl readWithNameSignatureModifiers(
+ ReferenceTypeImpl target, ReferenceTypeImpl referenceType,
+ boolean withGenericSignature, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpMethodID ID = new JdwpMethodID(vmImpl);
ID.read(in);
@@ -683,16 +739,18 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
}
String name = target.readString("name", in); //$NON-NLS-1$
String signature = target.readString("signature", in); //$NON-NLS-1$
- String genericSignature= null;
+ String genericSignature = null;
if (withGenericSignature) {
- genericSignature= target.readString("generic signature", in); //$NON-NLS-1$
+ genericSignature = target.readString("generic signature", in); //$NON-NLS-1$
if ("".equals(genericSignature)) { //$NON-NLS-1$
- genericSignature= null;
+ genericSignature = null;
}
}
- int modifierBits= target.readInt("modifiers", AccessibleImpl.getModifierStrings(), in); //$NON-NLS-1$
+ int modifierBits = target.readInt(
+ "modifiers", AccessibleImpl.getModifierStrings(), in); //$NON-NLS-1$
- MethodImpl mirror = new MethodImpl(vmImpl, referenceType, ID, name, signature, genericSignature, modifierBits);
+ MethodImpl mirror = new MethodImpl(vmImpl, referenceType, ID, name,
+ signature, genericSignature, modifierBits);
return mirror;
}
@@ -703,16 +761,17 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
if (fgInvokeOptions != null) {
return;
}
-
+
Field[] fields = MethodImpl.class.getDeclaredFields();
fgInvokeOptions = new String[32];
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
}
-
+
try {
String name = field.getName();
@@ -720,7 +779,7 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
int value = field.getInt(null);
for (int j = 0; j < fgInvokeOptions.length; j++) {
if ((1 << j & value) != 0) {
- fgInvokeOptions[j]= name;
+ fgInvokeOptions[j] = name;
break;
}
}
@@ -734,22 +793,23 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
}
}
}
-
+
/**
* @return Returns a map with string representations of tags.
*/
- protected static String[] getInvokeOptions() {
- getConstantMaps();
- return fgInvokeOptions;
- }
+ protected static String[] getInvokeOptions() {
+ getConstantMaps();
+ return fgInvokeOptions;
+ }
+
/**
* @see Method#isObsolete()
*
- * The JDK 1.4.0 specification states that obsolete methods
- * are given an ID of zero. It also states that when a method
- * is redefined, the new method gets the ID of the old method.
- * Thus, the JDWP query for isObsolete on JDK 1.4 will never return true
- * for a non-zero method ID. The query is therefore not needed
+ * The JDK 1.4.0 specification states that obsolete methods are given
+ * an ID of zero. It also states that when a method is redefined, the
+ * new method gets the ID of the old method. Thus, the JDWP query for
+ * isObsolete on JDK 1.4 will never return true for a non-zero method
+ * ID. The query is therefore not needed
*/
public boolean isObsolete() {
if (virtualMachineImpl().isJdwpVersionGreaterOrEqual(1, 4)) {
@@ -761,31 +821,40 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
/**
* @see Method#allLineLocations(String, String)
*/
- public List allLineLocations(String stratum, String sourceName) throws AbsentInformationException {
+ public List allLineLocations(String stratum, String sourceName)
+ throws AbsentInformationException {
if (isAbstract() || isNative()) {
return Collections.EMPTY_LIST;
}
- if (stratum == null) { // if stratum not defined use the default stratum for the declaring type
- stratum= declaringType().defaultStratum();
+ if (stratum == null) { // if stratum not defined use the default stratum
+ // for the declaring type
+ stratum = declaringType().defaultStratum();
}
- List allLineLocations= null;
- Map sourceNameAllLineLocations= null;
- if (fStratumAllLineLocations == null) { // the stratum map doesn't exist, create it
- fStratumAllLineLocations= new HashMap();
+ List allLineLocations = null;
+ Map<String, List> sourceNameAllLineLocations = null;
+ if (fStratumAllLineLocations == null) { // the stratum map doesn't
+ // exist, create it
+ fStratumAllLineLocations = new HashMap<String, Map>();
} else {
// get the source name map
- sourceNameAllLineLocations= (Map)fStratumAllLineLocations.get(stratum);
+ sourceNameAllLineLocations = fStratumAllLineLocations
+ .get(stratum);
}
- if (sourceNameAllLineLocations == null) { // the source name map doesn't exist, create it
- sourceNameAllLineLocations= new HashMap();
+ if (sourceNameAllLineLocations == null) { // the source name map doesn't
+ // exist, create it
+ sourceNameAllLineLocations = new HashMap<String, List>();
fStratumAllLineLocations.put(stratum, sourceNameAllLineLocations);
} else {
// get the line locations
- allLineLocations= (List)sourceNameAllLineLocations.get(sourceName);
+ allLineLocations = sourceNameAllLineLocations
+ .get(sourceName);
}
- if (allLineLocations == null) { // the line locations are not know, compute and store them
+ if (allLineLocations == null) { // the line locations are not know,
+ // compute and store them
getLineTable();
- allLineLocations= referenceTypeImpl().allLineLocations(stratum, sourceName, this, fCodeIndexTable, fJavaStratumLineNumberTable);
+ allLineLocations = referenceTypeImpl().allLineLocations(stratum,
+ sourceName, this, fCodeIndexTable,
+ fJavaStratumLineNumberTable);
sourceNameAllLineLocations.put(sourceName, allLineLocations);
}
return allLineLocations;
@@ -794,38 +863,45 @@ public class MethodImpl extends TypeComponentImpl implements Method, Locatable {
/**
* @see Method#locationsOfLine(String, String, int)
*/
- public List locationsOfLine(String stratum, String sourceName, int lineNumber) throws AbsentInformationException {
+ public List locationsOfLine(String stratum, String sourceName,
+ int lineNumber) throws AbsentInformationException {
if (isAbstract() || isNative()) {
return Collections.EMPTY_LIST;
}
- return referenceTypeImpl().locationsOfLine(stratum, sourceName, lineNumber, this);
+ return referenceTypeImpl().locationsOfLine(stratum, sourceName,
+ lineNumber, this);
}
/**
- * Return a list which contains a location for the each disjoin range of code indice
- * that have bean assigned to the given lines (by the compiler or/and the VM).
- * Return an empty list if there is not executable code at the specified lines.
- */
- protected List javaStratumLocationsOfLines(List javaLines) throws AbsentInformationException {
- Set tmpLocations= new TreeSet();
- for (Iterator iter = javaLines.iterator(); iter.hasNext();) {
- Integer key = (Integer)iter.next();
- List indexes= javaStratumLineToCodeIndexes(key.intValue());
+ * Return a list which contains a location for the each disjoin range of
+ * code indice that have bean assigned to the given lines (by the compiler
+ * or/and the VM). Return an empty list if there is not executable code at
+ * the specified lines.
+ */
+ protected List javaStratumLocationsOfLines(List<Integer> javaLines)
+ throws AbsentInformationException {
+ Set tmpLocations = new TreeSet();
+ for (Iterator<Integer> iter = javaLines.iterator(); iter.hasNext();) {
+ Integer key = iter.next();
+ List indexes = javaStratumLineToCodeIndexes(key.intValue());
if (indexes != null) {
tmpLocations.addAll(indexes);
}
}
List locations = new ArrayList();
for (Iterator iter = tmpLocations.iterator(); iter.hasNext();) {
- long index = ((Long)iter.next()).longValue();
- int position= Arrays.binarySearch(fCodeIndexTable, index);
- if (position == 0 || !tmpLocations.contains(new Long(fCodeIndexTable[position - 1]))) {
- locations.add(new LocationImpl(virtualMachineImpl(), this, index));
+ long index = ((Long) iter.next()).longValue();
+ int position = Arrays.binarySearch(fCodeIndexTable, index);
+ if (position == 0
+ || !tmpLocations.contains(new Long(
+ fCodeIndexTable[position - 1]))) {
+ locations.add(new LocationImpl(virtualMachineImpl(), this,
+ index));
}
}
return locations;
}
-
+
public boolean isBridge() {
return (fModifierBits & MODIFIER_ACC_BRIDGE) != 0;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MirrorImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MirrorImpl.java
index 4aae56ee4..ecdd3f890 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MirrorImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MirrorImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -38,47 +37,56 @@ import com.sun.jdi.VMOutOfMemoryException;
import com.sun.jdi.VirtualMachine;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class MirrorImpl implements Mirror {
-
+
/** Description of Mirror object. */
protected String fDescription;
/** Virtual Machine of Mirror object. */
private VirtualMachineImpl fVirtualMachineImpl;
- /** VerboseWriter where verbose info is written to, null if no verbose must be given. */
+ /**
+ * VerboseWriter where verbose info is written to, null if no verbose must
+ * be given.
+ */
protected VerboseWriter fVerboseWriter = null;
- /** True if a Jdwp request has been sent to the VM and the response is not yet (fully) processed. */
+ /**
+ * True if a Jdwp request has been sent to the VM and the response is not
+ * yet (fully) processed.
+ */
private boolean fPendingJdwpRequest = false;
-
+
/**
- * Constructor only to be used by Virtual Machine objects: stores description of Mirror object and Virtual Machine.
- */
+ * Constructor only to be used by Virtual Machine objects: stores
+ * description of Mirror object and Virtual Machine.
+ */
public MirrorImpl(String description) {
fDescription = description;
- fVirtualMachineImpl = (VirtualMachineImpl)this;
- PrintWriter writer = ((VirtualMachineManagerImpl)org.eclipse.jdi.Bootstrap.virtualMachineManager()).verbosePrintWriter();
+ fVirtualMachineImpl = (VirtualMachineImpl) this;
+ PrintWriter writer = ((VirtualMachineManagerImpl) org.eclipse.jdi.Bootstrap
+ .virtualMachineManager()).verbosePrintWriter();
if (writer != null)
fVerboseWriter = new VerboseWriter(writer);
}
/**
* Constructor stores description of Mirror object and its Virtual Machine.
- */
+ */
public MirrorImpl(String description, VirtualMachineImpl virtualMachineImpl) {
fVirtualMachineImpl = virtualMachineImpl;
fDescription = description;
- PrintWriter writer = ((VirtualMachineManagerImpl)org.eclipse.jdi.Bootstrap.virtualMachineManager()).verbosePrintWriter();
+ PrintWriter writer = ((VirtualMachineManagerImpl) org.eclipse.jdi.Bootstrap
+ .virtualMachineManager()).verbosePrintWriter();
if (writer != null)
fVerboseWriter = new VerboseWriter(writer);
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
return fDescription;
}
@@ -105,12 +113,15 @@ public class MirrorImpl implements Mirror {
fVerboseWriter.println("Received event set"); //$NON-NLS-1$
fVerboseWriter.println("length", commandPacket.getLength()); //$NON-NLS-1$
fVerboseWriter.println("id", commandPacket.getId()); //$NON-NLS-1$
- fVerboseWriter.println("flags", commandPacket.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
- fVerboseWriter.println("command set", (byte)(commandPacket.getCommand() >>> 8)); //$NON-NLS-1$
- fVerboseWriter.println("command", (byte)commandPacket.getCommand()); //$NON-NLS-1$
+ fVerboseWriter.println(
+ "flags", commandPacket.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
+ fVerboseWriter.println(
+ "command set", (byte) (commandPacket.getCommand() >>> 8)); //$NON-NLS-1$
+ fVerboseWriter
+ .println("command", (byte) commandPacket.getCommand()); //$NON-NLS-1$
}
}
-
+
/**
* Processing after each Jdwp Event.
*/
@@ -120,17 +131,17 @@ public class MirrorImpl implements Mirror {
fVerboseWriter.flush();
}
}
-
+
/**
- * Processing before each Jdwp request.
- * Note that this includes building the request message and parsing the response.
+ * Processing before each Jdwp request. Note that this includes building the
+ * request message and parsing the response.
*/
public void initJdwpRequest() {
if (fVerboseWriter != null) {
fVerboseWriter.gotoPosition(6);
}
}
-
+
/**
* Writes command packet header if verbose is on.
*/
@@ -144,13 +155,14 @@ public class MirrorImpl implements Mirror {
fVerboseWriter.println(")"); //$NON-NLS-1$
fVerboseWriter.println("length", commandPacket.getLength()); //$NON-NLS-1$
fVerboseWriter.println("id", commandPacket.getId()); //$NON-NLS-1$
- fVerboseWriter.println("flags", commandPacket.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
- fVerboseWriter.println("command set", (byte)(command >>> 8)); //$NON-NLS-1$
- fVerboseWriter.println("command", (byte)command); //$NON-NLS-1$
+ fVerboseWriter.println(
+ "flags", commandPacket.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
+ fVerboseWriter.println("command set", (byte) (command >>> 8)); //$NON-NLS-1$
+ fVerboseWriter.println("command", (byte) command); //$NON-NLS-1$
fVerboseWriter.gotoPosition(currentPosition);
}
}
-
+
/**
* Processing after each Jdwp Request.
*/
@@ -161,9 +173,10 @@ public class MirrorImpl implements Mirror {
}
fPendingJdwpRequest = false;
}
-
+
/**
* Performs a VM request.
+ *
* @return Returns reply data.
*/
public JdwpReplyPacket requestVM(int command, byte[] outData) {
@@ -174,7 +187,8 @@ public class MirrorImpl implements Mirror {
fPendingJdwpRequest = true;
writeVerboseCommandPacketHeader(commandPacket);
- JdwpReplyPacket reply = fVirtualMachineImpl.packetReceiveManager().getReply(commandPacket);
+ JdwpReplyPacket reply = fVirtualMachineImpl.packetReceiveManager()
+ .getReply(commandPacket);
long recieved = System.currentTimeMillis();
if (JDIDebugOptions.DEBUG_JDI_REQUEST_TIMES) {
StringBuffer buf = new StringBuffer();
@@ -193,23 +207,28 @@ public class MirrorImpl implements Mirror {
fVerboseWriter.println("Received reply"); //$NON-NLS-1$
fVerboseWriter.println("length", reply.getLength()); //$NON-NLS-1$
fVerboseWriter.println("id", reply.getId()); //$NON-NLS-1$
- fVerboseWriter.println("flags", reply.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
- fVerboseWriter.println("error code", reply.errorCode(), JdwpReplyPacket.errorMap()); //$NON-NLS-1$
+ fVerboseWriter.println(
+ "flags", reply.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
+ fVerboseWriter
+ .println(
+ "error code", reply.errorCode(), JdwpReplyPacket.errorMap()); //$NON-NLS-1$
}
-
+
return reply;
}
-
+
/**
* Performs a VM request.
+ *
* @return Returns reply data.
*/
public JdwpReplyPacket requestVM(int command, ByteArrayOutputStream outData) {
return requestVM(command, outData.toByteArray());
}
-
+
/**
* Performs a VM request for a specified object.
+ *
* @return Returns reply data.
*/
public JdwpReplyPacket requestVM(int command, ObjectReferenceImpl object) {
@@ -222,9 +241,10 @@ public class MirrorImpl implements Mirror {
}
return requestVM(command, byteOutStream);
}
-
+
/**
* Performs a VM request for a specified object.
+ *
* @return Returns reply data.
*/
public JdwpReplyPacket requestVM(int command, ReferenceTypeImpl refType) {
@@ -237,13 +257,14 @@ public class MirrorImpl implements Mirror {
}
return requestVM(command, byteOutStream);
}
-
+
/**
* Performs a VM request.
+ *
* @return Returns reply data.
*/
public JdwpReplyPacket requestVM(int command) {
- return requestVM(command, (byte[])null);
+ return requestVM(command, (byte[]) null);
}
/**
@@ -251,215 +272,252 @@ public class MirrorImpl implements Mirror {
*/
public void defaultReplyErrorHandler(int error) {
switch (error) {
- case JdwpReplyPacket.NONE:
- break;
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotPreparedException();
- case JdwpReplyPacket.CLASS_NOT_PREPARED:
- throw new ClassNotPreparedException();
- case JdwpReplyPacket.OUT_OF_MEMORY:
- throw new VMOutOfMemoryException();
- case JdwpReplyPacket.ILLEGAL_ARGUMENT:
- throw new IllegalArgumentException();
- case JdwpReplyPacket.NATIVE_METHOD:
- throw new NativeMethodException();
- case JdwpReplyPacket.INVALID_FRAMEID:
- throw new InvalidStackFrameException();
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException();
- case JdwpReplyPacket.HCR_OPERATION_REFUSED:
- throw new org.eclipse.jdi.hcr.OperationRefusedException();
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException();
- default:
- throw new InternalException(JDIMessages.MirrorImpl_Got_error_code_in_reply___1 + error, error);
- }
- }
-
- /**
- * Performs default handling of IOException in creating or interpreting a Jdwp packet.
+ case JdwpReplyPacket.NONE:
+ break;
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotPreparedException();
+ case JdwpReplyPacket.CLASS_NOT_PREPARED:
+ throw new ClassNotPreparedException();
+ case JdwpReplyPacket.OUT_OF_MEMORY:
+ throw new VMOutOfMemoryException();
+ case JdwpReplyPacket.ILLEGAL_ARGUMENT:
+ throw new IllegalArgumentException();
+ case JdwpReplyPacket.NATIVE_METHOD:
+ throw new NativeMethodException();
+ case JdwpReplyPacket.INVALID_FRAMEID:
+ throw new InvalidStackFrameException();
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException();
+ case JdwpReplyPacket.HCR_OPERATION_REFUSED:
+ throw new org.eclipse.jdi.hcr.OperationRefusedException();
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException();
+ default:
+ throw new InternalException(
+ JDIMessages.MirrorImpl_Got_error_code_in_reply___1 + error,
+ error);
+ }
+ }
+
+ /**
+ * Performs default handling of IOException in creating or interpreting a
+ * Jdwp packet.
*/
public void defaultIOExceptionHandler(Exception e) {
- throw new InternalException(JDIMessages.MirrorImpl_Got_invalid_data___2 + e);
+ throw new InternalException(JDIMessages.MirrorImpl_Got_invalid_data___2
+ + e);
}
-
+
/**
* Waits for a specified command packet from the VM.
+ *
* @return Returns Command Packet from VM.
*/
- public final JdwpCommandPacket getCommandVM(int command, long timeout) throws InterruptedException {
- return fVirtualMachineImpl.packetReceiveManager().getCommand(command, timeout);
+ public final JdwpCommandPacket getCommandVM(int command, long timeout)
+ throws InterruptedException {
+ return fVirtualMachineImpl.packetReceiveManager().getCommand(command,
+ timeout);
}
-
+
/**
- * @exception VMMismatchException is thrown if the Mirror argument and this mirror do not belong to the same VirtualMachine.
+ * @exception VMMismatchException
+ * is thrown if the Mirror argument and this mirror do not
+ * belong to the same VirtualMachine.
*/
public void checkVM(Mirror mirror) throws VMMismatchException {
- if (((MirrorImpl)mirror).virtualMachineImpl() != this.virtualMachineImpl())
+ if (((MirrorImpl) mirror).virtualMachineImpl() != this
+ .virtualMachineImpl())
throw new VMMismatchException();
}
-
+
/**
* Disconnects VM.
*/
public void disconnectVM() {
- fVirtualMachineImpl.setDisconnected(true);
+ fVirtualMachineImpl.setDisconnected(true);
fVirtualMachineImpl.packetSendManager().disconnectVM();
fVirtualMachineImpl.packetReceiveManager().disconnectVM();
- ((VirtualMachineManagerImpl) Bootstrap.virtualMachineManager()).removeConnectedVM(fVirtualMachineImpl);
+ ((VirtualMachineManagerImpl) Bootstrap.virtualMachineManager())
+ .removeConnectedVM(fVirtualMachineImpl);
}
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public byte readByte(String description, DataInputStream in) throws IOException {
+ public byte readByte(String description, DataInputStream in)
+ throws IOException {
byte result = in.readByte();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public short readShort(String description, DataInputStream in) throws IOException {
+ public short readShort(String description, DataInputStream in)
+ throws IOException {
short result = in.readShort();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public int readInt(String description, DataInputStream in) throws IOException {
+ public int readInt(String description, DataInputStream in)
+ throws IOException {
int result = in.readInt();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public long readLong(String description, DataInputStream in) throws IOException {
+ public long readLong(String description, DataInputStream in)
+ throws IOException {
long result = in.readLong();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public byte readByte(String description, Map valueToString, DataInputStream in) throws IOException {
+ public byte readByte(String description, Map<Integer, String> valueToString,
+ DataInputStream in) throws IOException {
byte result = in.readByte();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result, valueToString);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public short readShort(String description, Map valueToString, DataInputStream in) throws IOException {
+ public short readShort(String description, Map<Integer, String> valueToString,
+ DataInputStream in) throws IOException {
short result = in.readShort();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result, valueToString);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public int readInt(String description, Map valueToString, DataInputStream in) throws IOException {
+ public int readInt(String description, Map<Integer, String> valueToString, DataInputStream in)
+ throws IOException {
int result = in.readInt();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result, valueToString);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public String readString(String description, DataInputStream in) throws IOException {
+ public String readString(String description, DataInputStream in)
+ throws IOException {
String result = JdwpString.read(in);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public boolean readBoolean(String description, DataInputStream in) throws IOException {
+ public boolean readBoolean(String description, DataInputStream in)
+ throws IOException {
boolean result = in.readBoolean();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public char readChar(String description, DataInputStream in) throws IOException {
+ public char readChar(String description, DataInputStream in)
+ throws IOException {
char result = in.readChar();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public double readDouble(String description, DataInputStream in) throws IOException {
+ public double readDouble(String description, DataInputStream in)
+ throws IOException {
double result = in.readDouble();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public float readFloat(String description, DataInputStream in) throws IOException {
+ public float readFloat(String description, DataInputStream in)
+ throws IOException {
float result = in.readFloat();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result);
}
return result;
}
-
+
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public byte[] readByteArray(int length, String description, DataInputStream in) throws IOException {
+ public byte[] readByteArray(int length, String description,
+ DataInputStream in) throws IOException {
byte[] result = new byte[length];
in.readFully(result);
if (fVerboseWriter != null) {
@@ -467,11 +525,12 @@ public class MirrorImpl implements Mirror {
}
return result;
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeByte(byte value, String description, DataOutputStream out) throws IOException {
+ public void writeByte(byte value, String description, DataOutputStream out)
+ throws IOException {
out.writeByte(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
@@ -481,7 +540,8 @@ public class MirrorImpl implements Mirror {
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeShort(short value, String description, DataOutputStream out) throws IOException {
+ public void writeShort(short value, String description, DataOutputStream out)
+ throws IOException {
out.writeShort(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
@@ -491,7 +551,8 @@ public class MirrorImpl implements Mirror {
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeInt(int value, String description, DataOutputStream out) throws IOException {
+ public void writeInt(int value, String description, DataOutputStream out)
+ throws IOException {
out.writeInt(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
@@ -501,7 +562,8 @@ public class MirrorImpl implements Mirror {
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeLong(long value, String description, DataOutputStream out) throws IOException {
+ public void writeLong(long value, String description, DataOutputStream out)
+ throws IOException {
out.writeLong(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
@@ -511,87 +573,96 @@ public class MirrorImpl implements Mirror {
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeByte(byte value, String description, Map valueToString, DataOutputStream out) throws IOException {
+ public void writeByte(byte value, String description, Map<Integer, String> valueToString,
+ DataOutputStream out) throws IOException {
out.writeByte(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value, valueToString);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeShort(short value, String description, Map valueToString, DataOutputStream out) throws IOException {
+ public void writeShort(short value, String description, Map<Integer, String> valueToString,
+ DataOutputStream out) throws IOException {
out.writeShort(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value, valueToString);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeInt(int value, String description, Map valueToString, DataOutputStream out) throws IOException {
+ public void writeInt(int value, String description, Map<Integer, String> valueToString,
+ DataOutputStream out) throws IOException {
out.writeInt(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value, valueToString);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeString(String value, String description, DataOutputStream out) throws IOException {
+ public void writeString(String value, String description,
+ DataOutputStream out) throws IOException {
JdwpString.write(value, out);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeBoolean(boolean value, String description, DataOutputStream out) throws IOException {
+ public void writeBoolean(boolean value, String description,
+ DataOutputStream out) throws IOException {
out.writeBoolean(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeChar(char value, String description, DataOutputStream out) throws IOException {
+ public void writeChar(char value, String description, DataOutputStream out)
+ throws IOException {
out.writeChar(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeDouble(double value, String description, DataOutputStream out) throws IOException {
+ public void writeDouble(double value, String description,
+ DataOutputStream out) throws IOException {
out.writeDouble(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeFloat(float value, String description, DataOutputStream out) throws IOException {
+ public void writeFloat(float value, String description, DataOutputStream out)
+ throws IOException {
out.writeFloat(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value);
}
}
-
+
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeShort(short value, String description, String[] bitNames, DataOutputStream out) throws IOException {
+ public void writeShort(short value, String description, String[] bitNames,
+ DataOutputStream out) throws IOException {
out.writeShort(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value, bitNames);
@@ -601,7 +672,8 @@ public class MirrorImpl implements Mirror {
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeInt(int value, String description, String[] bitNames, DataOutputStream out) throws IOException {
+ public void writeInt(int value, String description, String[] bitNames,
+ DataOutputStream out) throws IOException {
out.writeInt(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value, bitNames);
@@ -610,21 +682,25 @@ public class MirrorImpl implements Mirror {
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public byte readByte(String description, String[] bitNames, DataInputStream in) throws IOException {
+ public byte readByte(String description, String[] bitNames,
+ DataInputStream in) throws IOException {
byte result = in.readByte();
if (fVerboseWriter != null) {
- fVerboseWriter.println(description, result, bitNames);
+ fVerboseWriter.println(description, result, bitNames);
}
return result;
}
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public short readShort(String description, String[] bitNames, DataInputStream in) throws IOException {
+ public short readShort(String description, String[] bitNames,
+ DataInputStream in) throws IOException {
short result = in.readShort();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result, bitNames);
@@ -634,9 +710,11 @@ public class MirrorImpl implements Mirror {
/**
* Reads Jdwp data and, if verbose is on, outputs verbose info.
+ *
* @return Returns value that has been read.
*/
- public int readInt(String description, String[] bitNames, DataInputStream in) throws IOException {
+ public int readInt(String description, String[] bitNames, DataInputStream in)
+ throws IOException {
int result = in.readInt();
if (fVerboseWriter != null) {
fVerboseWriter.println(description, result, bitNames);
@@ -647,17 +725,19 @@ public class MirrorImpl implements Mirror {
/**
* Writes Jdwp data and, if verbose is on, outputs verbose info.
*/
- public void writeByte(byte value, String description, String[] bitNames, DataOutputStream out) throws IOException {
+ public void writeByte(byte value, String description, String[] bitNames,
+ DataOutputStream out) throws IOException {
out.writeByte(value);
if (fVerboseWriter != null) {
fVerboseWriter.println(description, value, bitNames);
}
}
-
- /**
- * @return Returns VerboseWriter where verbose info is written to, null if no verbose must be given.
+
+ /**
+ * @return Returns VerboseWriter where verbose info is written to, null if
+ * no verbose must be given.
*/
public VerboseWriter verboseWriter() {
return fVerboseWriter;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MonitorInfoImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MonitorInfoImpl.java
index fdb1fc9ed..06ec116c9 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MonitorInfoImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/MonitorInfoImpl.java
@@ -16,9 +16,9 @@ import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
* @since 3.3
*/
public class MonitorInfoImpl extends MirrorImpl implements MonitorInfo {
@@ -26,15 +26,16 @@ public class MonitorInfoImpl extends MirrorImpl implements MonitorInfo {
private ThreadReference fThread;
private ObjectReference fMonitor;
private int fDepth;
-
+
/** constructor **/
- public MonitorInfoImpl(ThreadReference thread, int depth, ObjectReference monitor, VirtualMachineImpl virtualMachineImpl) {
+ public MonitorInfoImpl(ThreadReference thread, int depth,
+ ObjectReference monitor, VirtualMachineImpl virtualMachineImpl) {
super("MonitorInfoImpl", virtualMachineImpl); //$NON-NLS-1$
fThread = thread;
fDepth = depth;
fMonitor = monitor;
}
-
+
/**
* @see com.sun.jdi.MonitorInfo#monitor()
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java
index 71e5fa170..0c3bf753e 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -43,23 +42,22 @@ import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
/** JDWP Tag. */
public static final byte tag = JdwpID.OBJECT_TAG;
-
+
/** ObjectID of object that corresponds to this reference. */
private JdwpObjectID fObjectID;
/**
- * Cached reference type. This value is safe for caching because
- * the type of an object never changes.
+ * Cached reference type. This value is safe for caching because the type of
+ * an object never changes.
*/
private ReferenceType fReferenceType;
-
+
/**
* Creates new ObjectReferenceImpl.
*/
@@ -70,18 +68,20 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
/**
* Creates new ObjectReferenceImpl.
*/
- public ObjectReferenceImpl(String description, VirtualMachineImpl vmImpl, JdwpObjectID objectID) {
+ public ObjectReferenceImpl(String description, VirtualMachineImpl vmImpl,
+ JdwpObjectID objectID) {
super(description, vmImpl);
fObjectID = objectID;
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
* @return Returns Jdwp Object ID.
*/
@@ -89,42 +89,44 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
return fObjectID;
}
- /**
- * Prevents garbage collection for this object.
+ /**
+ * Prevents garbage collection for this object.
*/
public void disableCollection() {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_DISABLE_COLLECTION, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_DISABLE_COLLECTION, this);
defaultReplyErrorHandler(replyPacket.errorCode());
} finally {
handledJdwpRequest();
}
}
-
- /**
- * Permits garbage collection for this object.
+
+ /**
+ * Permits garbage collection for this object.
*/
public void enableCollection() {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_ENABLE_COLLECTION, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_ENABLE_COLLECTION, this);
defaultReplyErrorHandler(replyPacket.errorCode());
} finally {
handledJdwpRequest();
}
}
-
- /**
+
+ /**
* Inner class used to return monitor info.
*/
private class MonitorInfo {
ThreadReferenceImpl owner;
int entryCount;
- ArrayList waiters;
+ ArrayList<ThreadReference> waiters;
}
-
- /**
+
+ /**
* @return Returns monitor info.
*/
private MonitorInfo monitorInfo() throws IncompatibleThreadStateException {
@@ -134,22 +136,23 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_MONITOR_INFO, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_MONITOR_INFO, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new IncompatibleThreadStateException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException();
}
-
+
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
MonitorInfo result = new MonitorInfo();
result.owner = ThreadReferenceImpl.read(this, replyData);
result.entryCount = readInt("entry count", replyData); //$NON-NLS-1$
int nrOfWaiters = readInt("nr of waiters", replyData); //$NON-NLS-1$
- result.waiters = new ArrayList(nrOfWaiters);
+ result.waiters = new ArrayList<ThreadReference>(nrOfWaiters);
for (int i = 0; i < nrOfWaiters; i++)
result.waiters.add(ThreadReferenceImpl.read(this, replyData));
return result;
@@ -160,47 +163,56 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
handledJdwpRequest();
}
}
-
- /**
- * @return Returns an ThreadReference for the thread, if any, which currently owns this object's monitor.
+
+ /**
+ * @return Returns an ThreadReference for the thread, if any, which
+ * currently owns this object's monitor.
*/
- public ThreadReference owningThread() throws IncompatibleThreadStateException {
+ public ThreadReference owningThread()
+ throws IncompatibleThreadStateException {
return monitorInfo().owner;
}
- /**
- * @return Returns the number times this object's monitor has been entered by the current owning thread.
+ /**
+ * @return Returns the number times this object's monitor has been entered
+ * by the current owning thread.
*/
public int entryCount() throws IncompatibleThreadStateException {
return monitorInfo().entryCount;
}
- /**
- * @return Returns a List containing a ThreadReference for each thread currently waiting for this object's monitor.
+ /**
+ * @return Returns a List containing a ThreadReference for each thread
+ * currently waiting for this object's monitor.
*/
- public List waitingThreads() throws IncompatibleThreadStateException {
+ public List<ThreadReference> waitingThreads() throws IncompatibleThreadStateException {
return monitorInfo().waiters;
}
-
- /**
- * @return Returns the value of a given instance or static field in this object.
+
+ /**
+ * @return Returns the value of a given instance or static field in this
+ * object.
*/
public Value getValue(Field field) {
- ArrayList list = new ArrayList(1);
+ ArrayList<Field> list = new ArrayList<Field>(1);
list.add(field);
- return (ValueImpl)getValues(list).get(field);
+ return getValues(list).get(field);
}
-
+
/**
- * @return Returns objects that directly reference this object.
- * Only objects that are reachable for the purposes of garbage collection are returned.
- * Note that an object can also be referenced in other ways, such as from a local variable in a stack frame, or from a JNI global reference. Such non-object referrers are not returned by this method.
+ * @return Returns objects that directly reference this object. Only objects
+ * that are reachable for the purposes of garbage collection are
+ * returned. Note that an object can also be referenced in other
+ * ways, such as from a local variable in a stack frame, or from a
+ * JNI global reference. Such non-object referrers are not returned
+ * by this method.
*
* @since 3.3
*/
- public List referringObjects(long maxReferrers) throws UnsupportedOperationException, IllegalArgumentException {
+ public List<Value> referringObjects(long maxReferrers)
+ throws UnsupportedOperationException, IllegalArgumentException {
try {
- int max = (int)maxReferrers;
+ int max = (int) maxReferrers;
if (maxReferrers >= Integer.MAX_VALUE) {
max = Integer.MAX_VALUE;
}
@@ -208,80 +220,85 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
DataOutputStream outData = new DataOutputStream(outBytes);
this.getObjectID().write(outData);
writeInt(max, "max referrers", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_REFERRING_OBJECTS, outBytes);
- switch(replyPacket.errorCode()) {
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_27);
- case JdwpReplyPacket.ILLEGAL_ARGUMENT:
- throw new IllegalArgumentException(JDIMessages.ReferenceTypeImpl_26);
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException(JDIMessages.ObjectReferenceImpl_object_not_known);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_REFERRING_OBJECTS, outBytes);
+ switch (replyPacket.errorCode()) {
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_27);
+ case JdwpReplyPacket.ILLEGAL_ARGUMENT:
+ throw new IllegalArgumentException(
+ JDIMessages.ReferenceTypeImpl_26);
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException(
+ JDIMessages.ObjectReferenceImpl_object_not_known);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int elements = readInt("elements", replyData); //$NON-NLS-1$
- if(max > 0 && elements > max) {
+ if (max > 0 && elements > max) {
elements = max;
}
- ArrayList list = new ArrayList();
- for(int i = 0; i < elements; i++) {
+ ArrayList<Value> list = new ArrayList<Value>();
+ for (int i = 0; i < elements; i++) {
list.add(ValueImpl.readWithTag(this, replyData));
}
return list;
- }
- catch(IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return null;
} finally {
handledJdwpRequest();
}
}
-
- /**
- * @return Returns the value of multiple instance and/or static fields in this object.
+
+ /**
+ * @return Returns the value of multiple instance and/or static fields in
+ * this object.
*/
- public Map getValues(List allFields) {
+ public Map<Field, Value> getValues(List<? extends Field> allFields) {
// if the field list is empty, nothing to do.
if (allFields.isEmpty()) {
- return new HashMap();
+ return new HashMap<Field, Value>();
}
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
-
+
/*
- * Distinguish static fields from non-static fields:
- * For static fields ReferenceTypeImpl.getValues() must be used.
+ * Distinguish static fields from non-static fields: For static
+ * fields ReferenceTypeImpl.getValues() must be used.
*/
- List staticFields = new ArrayList();
- List nonStaticFields = new ArrayList();
-
+ List<Field> staticFields = new ArrayList<Field>();
+ List<FieldImpl> nonStaticFields = new ArrayList<FieldImpl>();
+
// Separate static and non-static fields.
int allFieldsSize = allFields.size();
for (int i = 0; i < allFieldsSize; i++) {
- FieldImpl field = (FieldImpl)allFields.get(i);
+ FieldImpl field = (FieldImpl) allFields.get(i);
checkVM(field);
- if (field.isStatic())
- staticFields.add(field);
- else
- nonStaticFields.add(field);
+ if (field.isStatic())
+ staticFields.add(field);
+ else
+ nonStaticFields.add(field);
}
-
+
// First get values for the static fields.
- Map resultMap;
+ Map<Field, Value> resultMap;
if (staticFields.isEmpty()) {
- resultMap= new HashMap();
+ resultMap = new HashMap<Field, Value>();
} else {
- resultMap= referenceType().getValues(staticFields);
+ resultMap = referenceType().getValues(staticFields);
}
-
- // if no non-static fields are requested, return directly the result.
+
+ // if no non-static fields are requested, return directly the
+ // result.
if (nonStaticFields.isEmpty()) {
return resultMap;
}
@@ -290,20 +307,23 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
write(this, outData);
writeInt(nonStaticFieldsSize, "size", outData); //$NON-NLS-1$
for (int i = 0; i < nonStaticFieldsSize; i++) {
- FieldImpl field = (FieldImpl)nonStaticFields.get(i);
+ FieldImpl field = nonStaticFields.get(i);
field.write(this, outData);
}
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_GET_VALUES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_GET_VALUES, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- if (nrOfElements != nonStaticFieldsSize)
- throw new InternalError(JDIMessages.ObjectReferenceImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_1);
-
+ if (nrOfElements != nonStaticFieldsSize)
+ throw new InternalError(
+ JDIMessages.ObjectReferenceImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_1);
+
for (int i = 0; i < nrOfElements; i++) {
- resultMap.put(nonStaticFields.get(i), ValueImpl.readWithTag(this, replyData));
+ resultMap.put(nonStaticFields.get(i),
+ ValueImpl.readWithTag(this, replyData));
}
return resultMap;
} catch (IOException e) {
@@ -313,62 +333,74 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
handledJdwpRequest();
}
}
-
- /**
+
+ /**
* @return Returns the hash code value.
*/
+ @Override
public int hashCode() {
return fObjectID.hashCode();
}
-
+
/**
- * @return Returns true if two mirrors refer to the same entity in the target VM.
+ * @return Returns true if two mirrors refer to the same entity in the
+ * target VM.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
return object != null
- && object.getClass().equals(this.getClass())
- && fObjectID.equals(((ObjectReferenceImpl)object).fObjectID)
- && virtualMachine().equals(((MirrorImpl)object).virtualMachine());
+ && object.getClass().equals(this.getClass())
+ && fObjectID.equals(((ObjectReferenceImpl) object).fObjectID)
+ && virtualMachine().equals(
+ ((MirrorImpl) object).virtualMachine());
}
-
+
/**
* @return Returns Jdwp version of given options.
*/
private int optionsToJdwpOptions(int options) {
int jdwpOptions = 0;
- if ((options & INVOKE_SINGLE_THREADED) != 0) {
- jdwpOptions |= MethodImpl.INVOKE_SINGLE_THREADED_JDWP;
- }
- if ((options & INVOKE_NONVIRTUAL) != 0) {
- jdwpOptions |= MethodImpl.INVOKE_NONVIRTUAL_JDWP;
- }
- return jdwpOptions;
+ if ((options & INVOKE_SINGLE_THREADED) != 0) {
+ jdwpOptions |= MethodImpl.INVOKE_SINGLE_THREADED_JDWP;
+ }
+ if ((options & INVOKE_NONVIRTUAL) != 0) {
+ jdwpOptions |= MethodImpl.INVOKE_NONVIRTUAL_JDWP;
+ }
+ return jdwpOptions;
}
-
+
/**
* Invokes the specified static Method in the target VM.
+ *
* @return Returns a Value mirror of the invoked method's return value.
*/
- public Value invokeMethod(ThreadReference thread, Method method, List arguments, int options) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException {
- checkVM(thread);
+ public Value invokeMethod(ThreadReference thread, Method method, List<? extends Value> arguments, int options) throws InvalidTypeException,
+ ClassNotLoadedException, IncompatibleThreadStateException,
+ InvocationException {
+ checkVM(thread);
checkVM(method);
- ThreadReferenceImpl threadImpl = (ThreadReferenceImpl)thread;
- MethodImpl methodImpl = (MethodImpl)method;
-
+ ThreadReferenceImpl threadImpl = (ThreadReferenceImpl) thread;
+ MethodImpl methodImpl = (MethodImpl) method;
+
// Perform some checks for IllegalArgumentException.
if (!isAValidMethod(method))
- throw new IllegalArgumentException(JDIMessages.ObjectReferenceImpl_Class_does_not_contain_given_method_2);
+ throw new IllegalArgumentException(
+ JDIMessages.ObjectReferenceImpl_Class_does_not_contain_given_method_2);
if (method.argumentTypeNames().size() != arguments.size())
- throw new IllegalArgumentException(JDIMessages.ObjectReferenceImpl_Number_of_arguments_doesn__t_match_3);
+ throw new IllegalArgumentException(
+ JDIMessages.ObjectReferenceImpl_Number_of_arguments_doesn__t_match_3);
if (method.isConstructor() || method.isStaticInitializer())
- throw new IllegalArgumentException(JDIMessages.ObjectReferenceImpl_Method_is_constructor_or_intitializer_4);
+ throw new IllegalArgumentException(
+ JDIMessages.ObjectReferenceImpl_Method_is_constructor_or_intitializer_4);
if ((options & INVOKE_NONVIRTUAL) != 0 && method.isAbstract())
- throw new IllegalArgumentException(JDIMessages.ObjectReferenceImpl_Method_is_abstract_and_can_therefore_not_be_invoked_nonvirtual_5);
+ throw new IllegalArgumentException(
+ JDIMessages.ObjectReferenceImpl_Method_is_abstract_and_can_therefore_not_be_invoked_nonvirtual_5);
- // check the type and the vm of the argument, convert the value if needed.
- List checkedArguments= ValueImpl.checkValues(arguments, method.argumentTypes(), virtualMachineImpl());
+ // check the type and the vm of the argument, convert the value if
+ // needed.
+ List<Value> checkedArguments = ValueImpl.checkValues(arguments, method.argumentTypes(), virtualMachineImpl());
initJdwpRequest();
try {
@@ -376,39 +408,43 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
threadImpl.write(this, outData);
- ((ReferenceTypeImpl)referenceType()).write(this, outData);
+ ((ReferenceTypeImpl) referenceType()).write(this, outData);
methodImpl.write(this, outData);
-
+
writeInt(checkedArguments.size(), "size", outData); //$NON-NLS-1$
- Iterator iter = checkedArguments.iterator();
- while(iter.hasNext()) {
- ValueImpl elt = (ValueImpl)iter.next();
+ Iterator<Value> iter = checkedArguments.iterator();
+ while (iter.hasNext()) {
+ ValueImpl elt = (ValueImpl) iter.next();
if (elt != null) {
elt.writeWithTag(this, outData);
} else {
ValueImpl.writeNullWithTag(this, outData);
}
}
-
- writeInt(optionsToJdwpOptions(options),"options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_INVOKE_METHOD, outBytes);
+
+ writeInt(optionsToJdwpOptions(options),
+ "options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_INVOKE_METHOD, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.TYPE_MISMATCH:
- throw new InvalidTypeException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotLoadedException(JDIMessages.ObjectReferenceImpl_One_of_the_arguments_of_ObjectReference_invokeMethod___6);
- case JdwpReplyPacket.INVALID_THREAD:
- throw new IncompatibleThreadStateException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException();
- case JdwpReplyPacket.INVALID_TYPESTATE:
- throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.TYPE_MISMATCH:
+ throw new InvalidTypeException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotLoadedException(
+ JDIMessages.ObjectReferenceImpl_One_of_the_arguments_of_ObjectReference_invokeMethod___6);
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException();
+ case JdwpReplyPacket.INVALID_TYPESTATE:
+ throw new IncompatibleThreadStateException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
ValueImpl value = ValueImpl.readWithTag(this, replyData);
- ObjectReferenceImpl exception = ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
+ ObjectReferenceImpl exception = ObjectReferenceImpl
+ .readObjectRefWithTag(this, replyData);
if (exception != null)
throw new InvocationException(exception);
return value;
@@ -421,37 +457,40 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
}
private boolean isAValidMethod(Method method) {
- ReferenceType refType= referenceType();
+ ReferenceType refType = referenceType();
if (refType instanceof ArrayType) {
- // if the object is an array, check if the method is declared in java.lang.Object
+ // if the object is an array, check if the method is declared in
+ // java.lang.Object
return "java.lang.Object".equals(method.declaringType().name()); //$NON-NLS-1$
}
return refType.allMethods().contains(method);
}
-
+
/**
- * @return Returns if this object has been garbage collected in the target VM.
+ * @return Returns if this object has been garbage collected in the target
+ * VM.
*/
public boolean isCollected() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_IS_COLLECTED, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_IS_COLLECTED, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_OBJECT:
+ case JdwpReplyPacket.INVALID_OBJECT:
+ return true;
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ // Workaround for problem in J2ME WTK (wireless toolkit)
+ // @see Bug 12966
+ try {
+ referenceType();
+ } catch (ObjectCollectedException e) {
return true;
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- // Workaround for problem in J2ME WTK (wireless toolkit)
- // @see Bug 12966
- try {
- referenceType();
- } catch (ObjectCollectedException e) {
- return true;
- }
- return false;
- default:
- defaultReplyErrorHandler(replyPacket.errorCode());
- break;
+ }
+ return false;
+ default:
+ defaultReplyErrorHandler(replyPacket.errorCode());
+ break;
}
DataInputStream replyData = replyPacket.dataInStream();
boolean result = readBoolean("is collected", replyData); //$NON-NLS-1$
@@ -464,7 +503,6 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
}
}
-
/**
* @return Returns the ReferenceType that mirrors the type of this object.
*/
@@ -474,10 +512,11 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
}
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_REFERENCE_TYPE, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_REFERENCE_TYPE, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- fReferenceType= ReferenceTypeImpl.readWithTypeTag(this, replyData);
+ fReferenceType = ReferenceTypeImpl.readWithTypeTag(this, replyData);
return fReferenceType;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -486,43 +525,48 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
handledJdwpRequest();
}
}
-
+
/**
* @return Returns the Type that mirrors the type of this object.
*/
+ @Override
public Type type() {
return referenceType();
}
-
+
/**
- * Sets the value of a given instance or static field in this object.
+ * Sets the value of a given instance or static field in this object.
*/
- public void setValue(Field field, Value value) throws InvalidTypeException, ClassNotLoadedException {
+ public void setValue(Field field, Value value) throws InvalidTypeException,
+ ClassNotLoadedException {
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
- writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
+ writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
checkVM(field);
- ((FieldImpl)field).write(this, outData);
+ ((FieldImpl) field).write(this, outData);
- // check the type and the vm of the value. Convert the value if needed
- ValueImpl checkedValue= ValueImpl.checkValue(value, field.type(), virtualMachineImpl());
+ // check the type and the vm of the value. Convert the value if
+ // needed
+ ValueImpl checkedValue = ValueImpl.checkValue(value, field.type(),
+ virtualMachineImpl());
if (checkedValue != null) {
checkedValue.write(this, outData);
} else {
ValueImpl.writeNull(this, outData);
}
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.OR_SET_VALUES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.OR_SET_VALUES, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.TYPE_MISMATCH:
- throw new InvalidTypeException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotLoadedException(referenceType().name());
+ case JdwpReplyPacket.TYPE_MISMATCH:
+ throw new InvalidTypeException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotLoadedException(referenceType().name());
}
defaultReplyErrorHandler(replyPacket.errorCode());
} catch (IOException e) {
@@ -531,14 +575,14 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
handledJdwpRequest();
}
}
-
+
/**
- * @return Returns a unique identifier for this ObjectReference.
+ * @return Returns a unique identifier for this ObjectReference.
*/
public long uniqueID() {
return fObjectID.value();
}
-
+
/**
* @return Returns string with value of ID.
*/
@@ -549,11 +593,13 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
try {
return type().toString() + " " + idString(); //$NON-NLS-1$
} catch (ObjectCollectedException e) {
- return JDIMessages.ObjectReferenceImpl__Garbage_Collected__ObjectReference__8 + idString();
+ return JDIMessages.ObjectReferenceImpl__Garbage_Collected__ObjectReference__8
+ + idString();
} catch (Exception e) {
return fDescription;
}
@@ -562,7 +608,8 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ObjectReferenceImpl readObjectRefWithoutTag(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ObjectReferenceImpl readObjectRefWithoutTag(
+ MirrorImpl target, DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpObjectID ID = new JdwpObjectID(vmImpl);
ID.read(in);
@@ -571,41 +618,46 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference {
if (ID.isNull())
return null;
-
+
ObjectReferenceImpl mirror = new ObjectReferenceImpl(vmImpl, ID);
return mirror;
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ObjectReferenceImpl readObjectRefWithTag(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ObjectReferenceImpl readObjectRefWithTag(MirrorImpl target,
+ DataInputStream in) throws IOException {
byte objectTag = target.readByte("object tag", JdwpID.tagMap(), in); //$NON-NLS-1$
switch (objectTag) {
- case 0:
- return null;
- case ObjectReferenceImpl.tag:
- return ObjectReferenceImpl.readObjectRefWithoutTag(target, in);
- case ArrayReferenceImpl.tag:
- return ArrayReferenceImpl.read(target, in);
- case ClassLoaderReferenceImpl.tag:
- return ClassLoaderReferenceImpl.read(target, in);
- case ClassObjectReferenceImpl.tag:
- return ClassObjectReferenceImpl.read(target, in);
- case StringReferenceImpl.tag:
- return StringReferenceImpl.read(target, in);
- case ThreadGroupReferenceImpl.tag:
- return ThreadGroupReferenceImpl.read(target, in);
- case ThreadReferenceImpl.tag:
- return ThreadReferenceImpl.read(target, in);
- }
- throw new InternalException(JDIMessages.ObjectReferenceImpl_Invalid_ObjectID_tag_encountered___9 + objectTag);
+ case 0:
+ return null;
+ case ObjectReferenceImpl.tag:
+ return ObjectReferenceImpl.readObjectRefWithoutTag(target, in);
+ case ArrayReferenceImpl.tag:
+ return ArrayReferenceImpl.read(target, in);
+ case ClassLoaderReferenceImpl.tag:
+ return ClassLoaderReferenceImpl.read(target, in);
+ case ClassObjectReferenceImpl.tag:
+ return ClassObjectReferenceImpl.read(target, in);
+ case StringReferenceImpl.tag:
+ return StringReferenceImpl.read(target, in);
+ case ThreadGroupReferenceImpl.tag:
+ return ThreadGroupReferenceImpl.read(target, in);
+ case ThreadReferenceImpl.tag:
+ return ThreadReferenceImpl.read(target, in);
+ }
+ throw new InternalException(
+ JDIMessages.ObjectReferenceImpl_Invalid_ObjectID_tag_encountered___9
+ + objectTag);
}
/**
* Writes JDWP representation without tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
fObjectID.write(out);
if (target.fVerboseWriter != null)
target.fVerboseWriter.println("objectReference", fObjectID.value()); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveTypeImpl.java
index 48d75d361..f14cd120b 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveTypeImpl.java
@@ -10,43 +10,55 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.PrimitiveType;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public abstract class PrimitiveTypeImpl extends TypeImpl implements PrimitiveType {
+public abstract class PrimitiveTypeImpl extends TypeImpl implements
+ PrimitiveType {
/**
* Creates new instance.
*/
- public PrimitiveTypeImpl(String description, VirtualMachineImpl vmImpl, String name, String signature) {
+ public PrimitiveTypeImpl(String description, VirtualMachineImpl vmImpl,
+ String name, String signature) {
super(description, vmImpl, name, signature);
}
-
+
/**
* Creates new instance based on primitive signature.
*/
- public static PrimitiveTypeImpl create(VirtualMachineImpl vmImpl, String signature) {
- // Notice that Primitive Types are not stored or cached because they don't 'remember' any information.
+ public static PrimitiveTypeImpl create(VirtualMachineImpl vmImpl,
+ String signature) {
+ // Notice that Primitive Types are not stored or cached because they
+ // don't 'remember' any information.
// See JNI 1.1 Specification, Table 3-2 Java VM Type Signatures.
switch (signature.charAt(0)) {
- case 'Z': return new BooleanTypeImpl(vmImpl);
- case 'B': return new ByteTypeImpl(vmImpl);
- case 'C': return new CharTypeImpl(vmImpl);
- case 'S': return new ShortTypeImpl(vmImpl);
- case 'I': return new IntegerTypeImpl(vmImpl);
- case 'J': return new LongTypeImpl(vmImpl);
- case 'F': return new FloatTypeImpl(vmImpl);
- case 'D': return new DoubleTypeImpl(vmImpl);
+ case 'Z':
+ return new BooleanTypeImpl(vmImpl);
+ case 'B':
+ return new ByteTypeImpl(vmImpl);
+ case 'C':
+ return new CharTypeImpl(vmImpl);
+ case 'S':
+ return new ShortTypeImpl(vmImpl);
+ case 'I':
+ return new IntegerTypeImpl(vmImpl);
+ case 'J':
+ return new LongTypeImpl(vmImpl);
+ case 'F':
+ return new FloatTypeImpl(vmImpl);
+ case 'D':
+ return new DoubleTypeImpl(vmImpl);
}
- throw new InternalError(JDIMessages.PrimitiveTypeImpl_Invalid_primitive_signature____1 + signature + JDIMessages.PrimitiveTypeImpl___2); //
+ throw new InternalError(
+ JDIMessages.PrimitiveTypeImpl_Invalid_primitive_signature____1
+ + signature + JDIMessages.PrimitiveTypeImpl___2); //
}
-
+
/**
* @returns primitive type tag.
*/
@@ -55,16 +67,22 @@ public abstract class PrimitiveTypeImpl extends TypeImpl implements PrimitiveTyp
/**
* @return Returns modifier bits.
*/
+ @Override
public int modifiers() {
- throw new InternalError(JDIMessages.PrimitiveTypeImpl_A_PrimitiveType_does_not_have_modifiers_3);
+ throw new InternalError(
+ JDIMessages.PrimitiveTypeImpl_A_PrimitiveType_does_not_have_modifiers_3);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ return obj instanceof PrimitiveTypeImpl
+ && tag() == ((PrimitiveTypeImpl) obj).tag()
+ && virtualMachine().equals(
+ ((PrimitiveTypeImpl) obj).virtualMachine());
}
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return obj instanceof PrimitiveTypeImpl
- && tag() == ((PrimitiveTypeImpl)obj).tag()
- && virtualMachine().equals(((PrimitiveTypeImpl)obj).virtualMachine());
- }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveValueImpl.java
index 7a70c9ca0..32d7b8ad4 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/PrimitiveValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -20,43 +19,46 @@ import com.sun.jdi.PrimitiveType;
import com.sun.jdi.PrimitiveValue;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveValue, Comparable {
+public abstract class PrimitiveValueImpl extends ValueImpl implements
+ PrimitiveValue, Comparable {
/** Primitive value in wrapper. */
Object fValue;
-
+
/**
* Creates new ValueImpl.
*/
- public PrimitiveValueImpl(String description, VirtualMachineImpl vmImpl, Object value) {
+ public PrimitiveValueImpl(String description, VirtualMachineImpl vmImpl,
+ Object value) {
super(description, vmImpl);
fValue = value;
}
-
+
/**
* @return Returns Primitive Value converted to required type.
*/
public boolean booleanValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue();
+ return ((Boolean) fValue).booleanValue();
else if (fValue instanceof Character)
- return ((Character)fValue).charValue() != 0;
- else return ((Number)fValue).doubleValue() != 0;
+ return ((Character) fValue).charValue() != 0;
+ else
+ return ((Number) fValue).doubleValue() != 0;
}
-
+
/**
* @return Returns Primitive Value converted to required type.
*/
public char charValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue() ? (char)1 : (char)0;
+ return ((Boolean) fValue).booleanValue() ? (char) 1 : (char) 0;
else if (fValue instanceof Character)
- return ((Character)fValue).charValue();
- else return (char)((Number)fValue).intValue();
+ return ((Character) fValue).charValue();
+ else
+ return (char) ((Number) fValue).intValue();
}
/**
@@ -64,10 +66,11 @@ public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveV
*/
public byte byteValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue() ? (byte)1 : (byte)0;
+ return ((Boolean) fValue).booleanValue() ? (byte) 1 : (byte) 0;
else if (fValue instanceof Character)
- return (byte)((Character)fValue).charValue();
- else return ((Number)fValue).byteValue();
+ return (byte) ((Character) fValue).charValue();
+ else
+ return ((Number) fValue).byteValue();
}
/**
@@ -75,10 +78,11 @@ public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveV
*/
public double doubleValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue() ? (double)1 : (double)0;
+ return ((Boolean) fValue).booleanValue() ? (double) 1 : (double) 0;
else if (fValue instanceof Character)
- return ((Character)fValue).charValue();
- else return ((Number)fValue).doubleValue();
+ return ((Character) fValue).charValue();
+ else
+ return ((Number) fValue).doubleValue();
}
/**
@@ -86,10 +90,11 @@ public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveV
*/
public float floatValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue() ? (float)1 : (float)0;
+ return ((Boolean) fValue).booleanValue() ? (float) 1 : (float) 0;
else if (fValue instanceof Character)
- return ((Character)fValue).charValue();
- else return ((Number)fValue).floatValue();
+ return ((Character) fValue).charValue();
+ else
+ return ((Number) fValue).floatValue();
}
/**
@@ -97,10 +102,11 @@ public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveV
*/
public int intValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue() ? (int)1 : (int)0;
+ return ((Boolean) fValue).booleanValue() ? (int) 1 : (int) 0;
else if (fValue instanceof Character)
- return ((Character)fValue).charValue();
- else return ((Number)fValue).intValue();
+ return ((Character) fValue).charValue();
+ else
+ return ((Number) fValue).intValue();
}
/**
@@ -108,10 +114,11 @@ public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveV
*/
public long longValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue() ? (long)1 : (long)0;
+ return ((Boolean) fValue).booleanValue() ? (long) 1 : (long) 0;
else if (fValue instanceof Character)
- return ((Character)fValue).charValue();
- else return ((Number)fValue).longValue();
+ return ((Character) fValue).charValue();
+ else
+ return ((Number) fValue).longValue();
}
/**
@@ -119,58 +126,65 @@ public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveV
*/
public short shortValue() {
if (fValue instanceof Boolean)
- return ((Boolean)fValue).booleanValue() ? (short)1 : (short)0;
+ return ((Boolean) fValue).booleanValue() ? (short) 1 : (short) 0;
else if (fValue instanceof Character)
- return (short)((Character)fValue).charValue();
- else return ((Number)fValue).shortValue();
+ return (short) ((Character) fValue).charValue();
+ else
+ return ((Number) fValue).shortValue();
}
-
+
/**
* @return Returns true if two values are equal.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
- return object != null && object.getClass().equals(this.getClass()) && fValue.equals(((PrimitiveValueImpl)object).fValue);
+ return object != null && object.getClass().equals(this.getClass())
+ && fValue.equals(((PrimitiveValueImpl) object).fValue);
}
-
+
/**
* @return Returns a has code for this object.
* @see java.lang.Object#hashCode
*/
+ @Override
public int hashCode() {
return fValue.hashCode();
- }
-
+ }
+
/**
- * Compares this object with the specified object for order.
- * Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- *
- * May throw a ClassCastException if obj is not comparable. This is in accordance
- * with Java 1.4 compareTo(Object) methods.
+ * Compares this object with the specified object for order. Returns a
+ * negative integer, zero, or a positive integer as this object is less
+ * than, equal to, or greater than the specified object.
+ *
+ * May throw a ClassCastException if obj is not comparable. This is in
+ * accordance with Java 1.4 compareTo(Object) methods.
*/
public int compareTo(Object obj) {
if (fValue instanceof Character)
- return ((Character)fValue).compareTo((Character) obj);
+ return ((Character) fValue).compareTo((Character) obj);
else if (fValue instanceof Byte)
- return ((Byte)fValue).compareTo((Byte) obj);
+ return ((Byte) fValue).compareTo((Byte) obj);
else if (fValue instanceof Double)
- return ((Double)fValue).compareTo((Double) obj);
+ return ((Double) fValue).compareTo((Double) obj);
else if (fValue instanceof Float)
- return ((Float)fValue).compareTo((Float) obj);
+ return ((Float) fValue).compareTo((Float) obj);
else if (fValue instanceof Integer)
- return ((Integer)fValue).compareTo((Integer) obj);
+ return ((Integer) fValue).compareTo((Integer) obj);
else if (fValue instanceof Long)
- return ((Long)fValue).compareTo((Long) obj);
+ return ((Long) fValue).compareTo((Long) obj);
else if (fValue instanceof Short)
- return ((Short)fValue).compareTo((Short) obj);
-
- throw new InternalException(JDIMessages.PrimitiveValueImpl_Invalid_Primitive_Value_encountered_1);
-
+ return ((Short) fValue).compareTo((Short) obj);
+
+ throw new InternalException(
+ JDIMessages.PrimitiveValueImpl_Invalid_Primitive_Value_encountered_1);
+
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
return fValue.toString();
}
@@ -178,32 +192,37 @@ public abstract class PrimitiveValueImpl extends ValueImpl implements PrimitiveV
/**
* Writes value without value tag.
*/
- public abstract void write(MirrorImpl target, DataOutputStream out) throws IOException;
-
+ @Override
+ public abstract void write(MirrorImpl target, DataOutputStream out)
+ throws IOException;
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static PrimitiveValueImpl readWithoutTag(MirrorImpl target, PrimitiveType type, DataInputStream in) throws IOException {
- switch (((PrimitiveTypeImpl)type).tag()) {
- case 0:
- return null;
- case BooleanValueImpl.tag:
- return BooleanValueImpl.read(target, in);
- case ByteValueImpl.tag:
- return ByteValueImpl.read(target, in);
- case CharValueImpl.tag:
- return CharValueImpl.read(target, in);
- case DoubleValueImpl.tag:
- return DoubleValueImpl.read(target, in);
- case FloatValueImpl.tag:
- return FloatValueImpl.read(target, in);
- case IntegerValueImpl.tag:
- return IntegerValueImpl.read(target, in);
- case LongValueImpl.tag:
- return LongValueImpl.read(target, in);
- case ShortValueImpl.tag:
- return ShortValueImpl.read(target, in);
+ public static PrimitiveValueImpl readWithoutTag(MirrorImpl target,
+ PrimitiveType type, DataInputStream in) throws IOException {
+ switch (((PrimitiveTypeImpl) type).tag()) {
+ case 0:
+ return null;
+ case BooleanValueImpl.tag:
+ return BooleanValueImpl.read(target, in);
+ case ByteValueImpl.tag:
+ return ByteValueImpl.read(target, in);
+ case CharValueImpl.tag:
+ return CharValueImpl.read(target, in);
+ case DoubleValueImpl.tag:
+ return DoubleValueImpl.read(target, in);
+ case FloatValueImpl.tag:
+ return FloatValueImpl.read(target, in);
+ case IntegerValueImpl.tag:
+ return IntegerValueImpl.read(target, in);
+ case LongValueImpl.tag:
+ return LongValueImpl.read(target, in);
+ case ShortValueImpl.tag:
+ return ShortValueImpl.read(target, in);
}
- throw new InternalException(JDIMessages.PrimitiveValueImpl_Invalid_Primitive_Value_tag_encountered___2 + type);
+ throw new InternalException(
+ JDIMessages.PrimitiveValueImpl_Invalid_Primitive_Value_tag_encountered___2
+ + type);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ReferenceTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ReferenceTypeImpl.java
index 36cf68522..3aaf0cbc8 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ReferenceTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ReferenceTypeImpl.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -42,7 +41,9 @@ import com.sun.jdi.ClassNotPreparedException;
import com.sun.jdi.ClassObjectReference;
import com.sun.jdi.ClassType;
import com.sun.jdi.Field;
+import com.sun.jdi.InterfaceType;
import com.sun.jdi.InternalException;
+import com.sun.jdi.Method;
import com.sun.jdi.NativeMethodException;
import com.sun.jdi.ObjectCollectedException;
import com.sun.jdi.ReferenceType;
@@ -50,12 +51,12 @@ import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceType, org.eclipse.jdi.hcr.ReferenceType {
+public abstract class ReferenceTypeImpl extends TypeImpl implements
+ ReferenceType, org.eclipse.jdi.hcr.ReferenceType {
/** ClassStatus Constants. */
public static final int JDWP_CLASS_STATUS_VERIFIED = 1;
@@ -67,10 +68,11 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
private static String[] fgClassStatusStrings = null;
/**
- * Represent the data about one file info contained in one stratum in the SMAP.
- */
+ * Represent the data about one file info contained in one stratum in the
+ * SMAP.
+ */
protected static class FileInfo {
-
+
/**
* The id.
*/
@@ -85,66 +87,75 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
* The path of the source file.
*/
protected String fAbsoluteFileName;
-
+
/**
- * Map line number in the input source file
- * -> list of [start line in the output source file, range in the output source file].
- * (Integer -> List of int[2]).
+ * Map line number in the input source file -> list of [start line in
+ * the output source file, range in the output source file]. (Integer ->
+ * List of int[2]).
*/
- private HashMap fLineInfo;
+ private HashMap<Integer, List> fLineInfo;
/**
* FileInfo constructor.
*
- * @param fileId the id.
- * @param fileName the name of the source file.
- * @param absoluteFileName the path of the source file (can be <code>null</code>).
+ * @param fileId
+ * the id.
+ * @param fileName
+ * the name of the source file.
+ * @param absoluteFileName
+ * the path of the source file (can be <code>null</code>).
*/
public FileInfo(int fileId, String fileName, String absoluteFileName) {
- fFileId= fileId;
- fFileName= fileName;
- fAbsoluteFileName= absoluteFileName;
- fLineInfo= new HashMap();
+ fFileId = fileId;
+ fFileName = fileName;
+ fAbsoluteFileName = absoluteFileName;
+ fLineInfo = new HashMap<Integer, List>();
}
-
+
/**
- * Add information about the mapping of one line.
- * Associate a line in the input source file to a snippet of code
- * in the output source file.
+ * Add information about the mapping of one line. Associate a line in
+ * the input source file to a snippet of code in the output source file.
*
- * @param inputLine the line number in the input source file.
- * @param outputStartLine the number of the first line of the corresponding snippet in the output source file.
- * @param outputLineRange the size of the corresponding snippet in the output source file.
+ * @param inputLine
+ * the line number in the input source file.
+ * @param outputStartLine
+ * the number of the first line of the corresponding snippet
+ * in the output source file.
+ * @param outputLineRange
+ * the size of the corresponding snippet in the output source
+ * file.
*/
- public void addLineInfo(int inputLine, int outputStartLine, int outputLineRange) {
- Integer key= new Integer(inputLine);
- List outputLines= (List)fLineInfo.get(key);
+ public void addLineInfo(int inputLine, int outputStartLine,
+ int outputLineRange) {
+ Integer key = new Integer(inputLine);
+ List<int[]> outputLines = fLineInfo.get(key);
if (outputLines == null) {
- outputLines= new ArrayList();
+ outputLines = new ArrayList<int[]>();
fLineInfo.put(key, outputLines);
}
- outputLines.add(new int[] {outputStartLine, outputLineRange});
+ outputLines.add(new int[] { outputStartLine, outputLineRange });
}
/**
- * Return a list of line information about the code in the output source file
- * associated to the given line in the input source file.
+ * Return a list of line information about the code in the output source
+ * file associated to the given line in the input source file.
*
- * @param lineNumber the line number in the input source file.
+ * @param lineNumber
+ * the line number in the input source file.
* @return a List of int[2].
*/
- public List getOutputLinesForLine(int lineNumber) {
- List list= new ArrayList();
- List outputLines= (List)fLineInfo.get(new Integer(lineNumber));
+ public List<Integer> getOutputLinesForLine(int lineNumber) {
+ List<Integer> list = new ArrayList<Integer>();
+ List outputLines = fLineInfo.get(new Integer(lineNumber));
if (outputLines != null) {
for (Iterator iter = outputLines.iterator(); iter.hasNext();) {
- int[] info = (int[])iter.next();
- int outputLineNumber= info[0];
+ int[] info = (int[]) iter.next();
+ int outputLineNumber = info[0];
int length = info[1];
- if (length == 0){
+ if (length == 0) {
length = length + 1;
}
- for (int i= 0; i < length; i++) {
+ for (int i = 0; i < length; i++) {
list.add(new Integer(outputLineNumber++));
}
}
@@ -155,15 +166,16 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
if (!(object instanceof FileInfo)) {
return false;
}
- return fFileId == ((FileInfo)object).fFileId;
+ return fFileId == ((FileInfo) object).fFileId;
}
}
-
+
/**
* Represent the information contained in the SMAP about one stratum.
*/
@@ -173,58 +185,69 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
* The id of this stratum.
*/
private String fId;
-
+
/**
* The file info data associated to this stratum.
*/
- private List fFileInfos;
-
+ private List<FileInfo> fFileInfos;
+
/**
* Id of the primary file for this stratum.
- */
+ */
private int fPrimaryFileId;
-
+
/**
- * Map line number in the output source file -> list of line numbers in the input source file.
- * (Integer -> List of Integer)
+ * Map line number in the output source file -> list of line numbers in
+ * the input source file. (Integer -> List of Integer)
*/
- private HashMap fOutputLineToInputLine;
-
+ private HashMap<Integer, List> fOutputLineToInputLine;
+
/**
* Stratum constructor.
- * @param id The id of this stratum.
+ *
+ * @param id
+ * The id of this stratum.
*/
public Stratum(String id) {
- fId= id;
- fFileInfos= new ArrayList();
- fOutputLineToInputLine= new HashMap();
- fPrimaryFileId= -1;
+ fId = id;
+ fFileInfos = new ArrayList<FileInfo>();
+ fOutputLineToInputLine = new HashMap<Integer, List>();
+ fPrimaryFileId = -1;
}
-
+
/**
* Add a file info to this stratum.
*
- * @param fileId the id.
- * @param fileName the name of the source file.
+ * @param fileId
+ * the id.
+ * @param fileName
+ * the name of the source file.
*/
- public void addFileInfo(int fileId, String fileName) throws AbsentInformationException {
+ public void addFileInfo(int fileId, String fileName)
+ throws AbsentInformationException {
addFileInfo(fileId, fileName, null);
}
-
+
/**
* Add a file info to this stratum.
*
- * @param fileId the id.
- * @param fileName the name of the source file.
- * @param absoluteFileName the path of the source file.
+ * @param fileId
+ * the id.
+ * @param fileName
+ * the name of the source file.
+ * @param absoluteFileName
+ * the path of the source file.
*/
- public void addFileInfo(int fileId, String fileName, String absoluteFileName) throws AbsentInformationException {
+ public void addFileInfo(int fileId, String fileName,
+ String absoluteFileName) throws AbsentInformationException {
if (fPrimaryFileId == -1) {
- fPrimaryFileId= fileId;
+ fPrimaryFileId = fileId;
}
- FileInfo fileInfo= new FileInfo(fileId, fileName, absoluteFileName);
+ FileInfo fileInfo = new FileInfo(fileId, fileName, absoluteFileName);
if (fFileInfos.contains(fileInfo)) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.ReferenceTypeImpl_28, new String[] {Integer.toString(fileId), fId}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.ReferenceTypeImpl_28, new String[] {
+ Integer.toString(fileId), fId }));
}
fFileInfos.add(fileInfo);
}
@@ -232,34 +255,46 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* Add line mapping information.
*
- * @param inputStartLine number of the first line in the input source file.
- * @param lineFileId id of the input source file.
- * @param repeatCount number of iterations.
- * @param outputStartLine number of the first line in the output source file.
- * @param outputLineIncrement number of line to increment at each iteration.
+ * @param inputStartLine
+ * number of the first line in the input source file.
+ * @param lineFileId
+ * id of the input source file.
+ * @param repeatCount
+ * number of iterations.
+ * @param outputStartLine
+ * number of the first line in the output source file.
+ * @param outputLineIncrement
+ * number of line to increment at each iteration.
* @throws AbsentInformationException
*/
- public void addLineInfo(int inputStartLine, int lineFileId, int repeatCount, int outputStartLine, int outputLineIncrement) throws AbsentInformationException {
- FileInfo fileInfo= null;
+ public void addLineInfo(int inputStartLine, int lineFileId,
+ int repeatCount, int outputStartLine, int outputLineIncrement)
+ throws AbsentInformationException {
+ FileInfo fileInfo = null;
// get the FileInfo object
- for (Iterator iter = fFileInfos.iterator(); iter.hasNext();) {
- FileInfo element = (FileInfo)iter.next();
+ for (Iterator<FileInfo> iter = fFileInfos.iterator(); iter.hasNext();) {
+ FileInfo element = iter.next();
if (element.fFileId == lineFileId) {
- fileInfo= element;
+ fileInfo = element;
}
}
if (fileInfo == null) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.ReferenceTypeImpl_29, new String[] {Integer.toString(lineFileId)}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.ReferenceTypeImpl_29,
+ new String[] { Integer.toString(lineFileId) }));
}
// add the data to the different hash maps.
- for (int i= 0; i < repeatCount; i++, inputStartLine++) {
- fileInfo.addLineInfo(inputStartLine, outputStartLine, outputLineIncrement);
+ for (int i = 0; i < repeatCount; i++, inputStartLine++) {
+ fileInfo.addLineInfo(inputStartLine, outputStartLine,
+ outputLineIncrement);
if (outputLineIncrement == 0) {
// see bug 40022
- addLineInfoToMap(inputStartLine, lineFileId, outputStartLine);
+ addLineInfoToMap(inputStartLine, lineFileId,
+ outputStartLine);
} else {
- for (int j= 0; j < outputLineIncrement; j++, outputStartLine++) {
- addLineInfoToMap(inputStartLine, lineFileId, outputStartLine);
+ for (int j = 0; j < outputLineIncrement; j++, outputStartLine++) {
+ addLineInfoToMap(inputStartLine, lineFileId,
+ outputStartLine);
}
}
}
@@ -268,24 +303,28 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* Add the data to the map.
*/
- private void addLineInfoToMap(int inputStartLine, int lineFileId, int outputStartLine) {
- Integer key= new Integer(outputStartLine);
- List inputLines= (List)fOutputLineToInputLine.get(key);
+ private void addLineInfoToMap(int inputStartLine, int lineFileId,
+ int outputStartLine) {
+ Integer key = new Integer(outputStartLine);
+ List<int[]> inputLines = fOutputLineToInputLine.get(key);
if (inputLines == null) {
- inputLines= new ArrayList();
+ inputLines = new ArrayList<int[]>();
fOutputLineToInputLine.put(key, inputLines);
}
- inputLines.add(new int[] {lineFileId, inputStartLine});
+ inputLines.add(new int[] { lineFileId, inputStartLine });
}
/**
- * Return the FileInfo object for the specified source name.
- * Return <code>null</code> if the specified name is the source name of no file info.
- * @param sourceName the source name to search.
+ * Return the FileInfo object for the specified source name. Return
+ * <code>null</code> if the specified name is the source name of no file
+ * info.
+ *
+ * @param sourceName
+ * the source name to search.
*/
public FileInfo getFileInfo(String sourceName) {
- for (Iterator iter = fFileInfos.iterator(); iter.hasNext();) {
- FileInfo fileInfo = (FileInfo)iter.next();
+ for (Iterator<FileInfo> iter = fFileInfos.iterator(); iter.hasNext();) {
+ FileInfo fileInfo = iter.next();
if (fileInfo.fFileName.equals(sourceName)) {
return fileInfo;
}
@@ -298,104 +337,105 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
* @return
*/
public List getInputLineInfos(int outputLineNumber) {
- return (List)fOutputLineToInputLine.get(new Integer(outputLineNumber));
+ return fOutputLineToInputLine.get(new Integer(
+ outputLineNumber));
}
}
-
-
/** ReferenceTypeID that corresponds to this reference. */
private JdwpReferenceTypeID fReferenceTypeID;
/** The following are the stored results of JDWP calls. */
- protected List fInterfaces = null;
- private List fMethods = null;
- private Hashtable fMethodTable= null;
- private List fFields = null;
- private List fAllMethods = null;
- private List fVisibleMethods = null;
- private List fAllFields = null;
- private List fVisibleFields = null;
- private List fAllInterfaces = null;
- private Map fStratumAllLineLocations = null;
+ protected List<InterfaceType> fInterfaces = null;
+ private List<Method> fMethods = null;
+ private Hashtable<JdwpMethodID, Method> fMethodTable = null;
+ private List<Field> fFields = null;
+ private List<Method> fAllMethods = null;
+ private List<Method> fVisibleMethods = null;
+ private List<Field> fAllFields = null;
+ private List<Field> fVisibleFields = null;
+ private List<InterfaceType> fAllInterfaces = null;
+ private Map<String, Map> fStratumAllLineLocations = null;
private String fSourceName = null;
private int fModifierBits = -1;
private ClassLoaderReferenceImpl fClassLoader = null;
private ClassObjectReferenceImpl fClassObject = null;
-
+
private String fGenericSignature; // 1.5 addition
private boolean fGenericSignatureKnown; // 1.5 addition
- private boolean fGotClassFileVersion = false; // HCR addition.
- private int fClassFileVersion; // HCR addition.
- private boolean fIsHCREligible; // HCR addition.
- private boolean fIsVersionKnown; // HCR addition.
-
- private boolean fSourceDebugExtensionAvailable= true; // JSR-045 addition
-
+ private boolean fGotClassFileVersion = false; // HCR addition.
+ private int fClassFileVersion; // HCR addition.
+ private boolean fIsHCREligible; // HCR addition.
+ private boolean fIsVersionKnown; // HCR addition.
+
+ private boolean fSourceDebugExtensionAvailable = true; // JSR-045 addition
+
/**
* The default stratum id.
*/
private String fDefaultStratumId; // JSR-045 addition
/**
- * A map of the defined strata.
- * Map stratum id -> Stratum object.
- * (String -> Stratum).
+ * A map of the defined strata. Map stratum id -> Stratum object. (String ->
+ * Stratum).
*/
- private Map fStrata; // JSR-045 addition
+ private Map<String, Stratum> fStrata; // JSR-045 addition
/**
* The source map string returned by the VM.
*/
private String fSmap; // JSR-045 addition
-
+
/**
* Creates new instance.
*/
- protected ReferenceTypeImpl(String description, VirtualMachineImpl vmImpl, JdwpReferenceTypeID referenceTypeID) {
+ protected ReferenceTypeImpl(String description, VirtualMachineImpl vmImpl,
+ JdwpReferenceTypeID referenceTypeID) {
super(description, vmImpl);
fReferenceTypeID = referenceTypeID;
}
-
+
/**
* Creates new instance.
*/
- protected ReferenceTypeImpl(String description, VirtualMachineImpl vmImpl, JdwpReferenceTypeID referenceTypeID, String signature, String genericSignature) {
+ protected ReferenceTypeImpl(String description, VirtualMachineImpl vmImpl,
+ JdwpReferenceTypeID referenceTypeID, String signature,
+ String genericSignature) {
super(description, vmImpl);
fReferenceTypeID = referenceTypeID;
setSignature(signature);
setGenericSignature(genericSignature);
}
-
+
/**
* @return Returns type tag.
*/
public abstract byte typeTag();
-
+
/**
* Flushes all stored Jdwp results.
*/
public void flushStoredJdwpResults() {
- Iterator iter;
-
+ Iterator<Method> iter;
+
// Flush Methods.
if (fMethods != null) {
iter = fMethods.iterator();
while (iter.hasNext()) {
- MethodImpl method = (MethodImpl)iter.next();
+ MethodImpl method = (MethodImpl) iter.next();
method.flushStoredJdwpResults();
}
fMethods = null;
- fMethodTable= null;
+ fMethodTable = null;
}
// Flush Fields.
if (fFields != null) {
iter = fFields.iterator();
while (iter.hasNext()) {
- FieldImpl field = (FieldImpl)iter.next();
+ FieldImpl field = (FieldImpl) iter.next();
field.flushStoredJdwpResults();
}
fFields = null;
@@ -414,77 +454,84 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
fClassObject = null;
fGotClassFileVersion = false;
// java 1.5
- fGenericSignature= null;
- fGenericSignatureKnown= false;
-
+ fGenericSignature = null;
+ fGenericSignatureKnown = false;
+
// JSR-045
- fSourceDebugExtensionAvailable= true;
- fDefaultStratumId= null;
- fStrata= null;
- fSmap= null;
-
- // The following cached results are stored higher up in the class hierarchy.
+ fSourceDebugExtensionAvailable = true;
+ fDefaultStratumId = null;
+ fStrata = null;
+ fSmap = null;
+
+ // The following cached results are stored higher up in the class
+ // hierarchy.
fSignature = null;
fSourceName = null;
}
-
- /**
- * @return Returns the interfaces declared as implemented by this class. Interfaces indirectly implemented (extended by the implemented interface or implemented by a superclass) are not included.
+
+ /**
+ * @return Returns the interfaces declared as implemented by this class.
+ * Interfaces indirectly implemented (extended by the implemented
+ * interface or implemented by a superclass) are not included.
*/
- public List allInterfaces() {
+ public List<InterfaceType> allInterfaces() {
if (fAllInterfaces != null) {
return fAllInterfaces;
}
-
- /* Recursion:
- * The interfaces that it directly implements;
- * All interfaces that are implemented by its interfaces;
- * If it is a class, all interfaces that are implemented by its superclass.
+
+ /*
+ * Recursion: The interfaces that it directly implements; All interfaces
+ * that are implemented by its interfaces; If it is a class, all
+ * interfaces that are implemented by its superclass.
*/
// The interfaces are maintained in a set, to avoid duplicates.
- // The interfaces of its own (own interfaces() command) are first inserted.
- HashSet allInterfacesSet = new HashSet(interfaces());
-
+ // The interfaces of its own (own interfaces() command) are first
+ // inserted.
+ HashSet<InterfaceType> allInterfacesSet = new HashSet<InterfaceType>(interfaces());
+
// All interfaces of the interfaces it implements.
- Iterator interfaces = interfaces().iterator();
- InterfaceTypeImpl inter;
+ Iterator<InterfaceType> interfaces = interfaces().iterator();
+ InterfaceType inter;
while (interfaces.hasNext()) {
- inter = (InterfaceTypeImpl)interfaces.next();
- allInterfacesSet.addAll(inter.allInterfaces());
+ inter = interfaces.next();
+ allInterfacesSet.addAll(((InterfaceTypeImpl)inter).allInterfaces());
}
-
+
// If it is a class, all interfaces of it's superclass.
if (this instanceof ClassType) {
- ClassType superclass = ((ClassType)this).superclass();
+ ClassType superclass = ((ClassType) this).superclass();
if (superclass != null) {
allInterfacesSet.addAll(superclass.allInterfaces());
}
}
-
- fAllInterfaces = new ArrayList(allInterfacesSet);
+
+ fAllInterfaces = new ArrayList<InterfaceType>(allInterfacesSet);
return fAllInterfaces;
}
-
+
/**
- * @return Returns Jdwp Reference ID.
+ * @return Returns JDWP Reference ID.
*/
public JdwpReferenceTypeID getRefTypeID() {
return fReferenceTypeID;
}
-
+
/**
* @return Returns modifier bits.
*/
+ @Override
public int modifiers() {
if (fModifierBits != -1)
return fModifierBits;
-
+
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_MODIFIERS, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_MODIFIERS, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- fModifierBits = readInt("modifiers", AccessibleImpl.getModifierStrings(), replyData); //$NON-NLS-1$
+ fModifierBits = readInt(
+ "modifiers", AccessibleImpl.getModifierStrings(), replyData); //$NON-NLS-1$
return fModifierBits;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -493,121 +540,132 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
handledJdwpRequest();
}
}
-
- /**
- * Add methods to a set of methods if they are not overridden, add new names+signature combinations to set of names+signature combinations.
+
+ /**
+ * Add methods to a set of methods if they are not overridden, add new
+ * names+signature combinations to set of names+signature combinations.
*/
- private void addVisibleMethods(List inheritedMethods, Set nameAndSignatures, List resultMethods) {
- Iterator iter = inheritedMethods.iterator();
- MethodImpl inheritedMethod;
+ private void addVisibleMethods(List<Method> inheritedMethods, Set<String> nameAndSignatures, List<Method> resultMethods) {
+ Iterator<Method> iter = inheritedMethods.iterator();
+ Method inheritedMethod;
while (iter.hasNext()) {
- inheritedMethod = (MethodImpl)iter.next();
- if (!nameAndSignatures.contains(inheritedMethod.name() + inheritedMethod.signature())) {
+ inheritedMethod = iter.next();
+ if (!nameAndSignatures.contains(inheritedMethod.name()
+ + inheritedMethod.signature())) {
resultMethods.add(inheritedMethod);
}
}
}
-
+
/**
- * @return Returns a list containing each visible and unambiguous Method in this type.
+ * @return Returns a list containing each visible and unambiguous Method in
+ * this type.
*/
- public List visibleMethods() {
+ public List<Method> visibleMethods() {
if (fVisibleMethods != null)
return fVisibleMethods;
- /* Recursion:
- * The methods of its own (own methods() command);
- * All methods of the interfaces it implements;
- * If it is a class, all methods of it's superclass.
+ /*
+ * Recursion: The methods of its own (own methods() command); All
+ * methods of the interfaces it implements; If it is a class, all
+ * methods of it's superclass.
*/
- // The name+signature combinations of methods are maintained in a set, to avoid including methods that have been overridden.
- Set namesAndSignatures = new HashSet();
- List visibleMethods= new ArrayList();
-
+ // The name+signature combinations of methods are maintained in a set,
+ // to avoid including methods that have been overridden.
+ Set<String> namesAndSignatures = new HashSet<String>();
+ List<Method> visibleMethods = new ArrayList<Method>();
+
// The methods of its own (own methods() command).
- for (Iterator iter= methods().iterator(); iter.hasNext();) {
- MethodImpl method= (MethodImpl) iter.next();
+ for (Iterator<Method> iter = methods().iterator(); iter.hasNext();) {
+ MethodImpl method = (MethodImpl) iter.next();
namesAndSignatures.add(method.name() + method.signature());
visibleMethods.add(method);
}
// All methods of the interfaces it implements.
- Iterator interfaces = interfaces().iterator();
- InterfaceTypeImpl inter;
+ Iterator<InterfaceType> interfaces = interfaces().iterator();
+ InterfaceType inter;
while (interfaces.hasNext()) {
- inter = (InterfaceTypeImpl)interfaces.next();
- addVisibleMethods(inter.visibleMethods(), namesAndSignatures, visibleMethods);
+ inter = interfaces.next();
+ addVisibleMethods(inter.visibleMethods(), namesAndSignatures,
+ visibleMethods);
}
-
+
// If it is a class, all methods of it's superclass.
if (this instanceof ClassType) {
- ClassType superclass = ((ClassType)this).superclass();
+ ClassType superclass = ((ClassType) this).superclass();
if (superclass != null)
- addVisibleMethods(superclass.visibleMethods(), namesAndSignatures, visibleMethods);
+ addVisibleMethods(superclass.visibleMethods(),
+ namesAndSignatures, visibleMethods);
}
-
- fVisibleMethods= visibleMethods;
+
+ fVisibleMethods = visibleMethods;
return fVisibleMethods;
}
/**
- * @return Returns a list containing each Method declared in this type, and its super-classes, implemented interfaces, and/or super-interfaces.
+ * @return Returns a list containing each Method declared in this type, and
+ * its super-classes, implemented interfaces, and/or
+ * super-interfaces.
*/
- public List allMethods() {
+ public List<Method> allMethods() {
if (fAllMethods != null)
return fAllMethods;
- /* Recursion:
- * The methods of its own (own methods() command);
- * All methods of the interfaces it implements;
- * If it is a class, all methods of it's superclass.
+ /*
+ * Recursion: The methods of its own (own methods() command); All
+ * methods of the interfaces it implements; If it is a class, all
+ * methods of it's superclass.
*/
// The name+signature combinations of methods are maintained in a set.
- HashSet resultSet = new HashSet();
-
+ HashSet<Method> resultSet = new HashSet<Method>();
+
// The methods of its own (own methods() command).
resultSet.addAll(methods());
-
+
// All methods of the interfaces it implements.
- Iterator interfaces = interfaces().iterator();
- InterfaceTypeImpl inter;
+ Iterator<InterfaceType> interfaces = interfaces().iterator();
+ InterfaceType inter;
while (interfaces.hasNext()) {
- inter = (InterfaceTypeImpl)interfaces.next();
+ inter = interfaces.next();
resultSet.addAll(inter.allMethods());
}
-
+
// If it is a class, all methods of it's superclass.
if (this instanceof ClassType) {
- ClassType superclass = ((ClassType)this).superclass();
+ ClassType superclass = ((ClassType) this).superclass();
if (superclass != null)
resultSet.addAll(superclass.allMethods());
}
-
- fAllMethods = new ArrayList(resultSet);
+
+ fAllMethods = new ArrayList<Method>(resultSet);
return fAllMethods;
}
- /**
- * @return Returns the interfaces declared as implemented by this class. Interfaces indirectly implemented (extended by the implemented interface or implemented by a superclass) are not included.
+ /**
+ * @return Returns the interfaces declared as implemented by this class.
+ * Interfaces indirectly implemented (extended by the implemented
+ * interface or implemented by a superclass) are not included.
*/
- public List interfaces() {
+ public List<InterfaceType> interfaces() {
if (fInterfaces != null) {
return fInterfaces;
}
-
+
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_INTERFACES, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_INTERFACES, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.NOT_FOUND:
- // Workaround for problem in J2ME WTK (wireless toolkit)
- // @see Bug 12966
- return Collections.EMPTY_LIST;
- default:
- defaultReplyErrorHandler(replyPacket.errorCode());
+ case JdwpReplyPacket.NOT_FOUND:
+ // Workaround for problem in J2ME WTK (wireless toolkit)
+ // @see Bug 12966
+ return Collections.EMPTY_LIST;
+ default:
+ defaultReplyErrorHandler(replyPacket.errorCode());
}
DataInputStream replyData = replyPacket.dataInStream();
- List elements = new ArrayList();
+ List<InterfaceTypeImpl> elements = new ArrayList<InterfaceTypeImpl>();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
for (int i = 0; i < nrOfElements; i++) {
InterfaceTypeImpl ref = InterfaceTypeImpl.read(this, replyData);
@@ -625,15 +683,16 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
handledJdwpRequest();
}
}
-
- /**
- * Add fields to a set of fields if they are not overridden, add new field names to set of field names.
+
+ /**
+ * Add fields to a set of fields if they are not overridden, add new field
+ * names to set of field names.
*/
- private void addVisibleFields(List newFields, Set names, List resultFields) {
- Iterator iter = newFields.iterator();
+ private void addVisibleFields(List<Field> newFields, Set<String> names, List<Field> resultFields) {
+ Iterator<Field> iter = newFields.iterator();
FieldImpl field;
while (iter.hasNext()) {
- field = (FieldImpl)iter.next();
+ field = (FieldImpl) iter.next();
String name = field.name();
if (!names.contains(name)) {
resultFields.add(field);
@@ -641,84 +700,91 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
}
}
-
+
/**
- * @return Returns a list containing each visible and unambiguous Field in this type.
+ * @return Returns a list containing each visible and unambiguous Field in
+ * this type.
*/
- public List visibleFields() {
+ public List<Field> visibleFields() {
if (fVisibleFields != null)
return fVisibleFields;
- /* Recursion:
- * The fields of its own (own fields() command);
- * All fields of the interfaces it implements;
- * If it is a class, all fields of it's superclass.
+ /*
+ * Recursion: The fields of its own (own fields() command); All fields
+ * of the interfaces it implements; If it is a class, all fields of it's
+ * superclass.
*/
- // The names of fields are maintained in a set, to avoid including fields that have been overridden.
- HashSet fieldNames = new HashSet();
-
+ // The names of fields are maintained in a set, to avoid including
+ // fields that have been overridden.
+ HashSet<String> fieldNames = new HashSet<String>();
+
// The fields of its own (own fields() command).
- List visibleFields = new ArrayList();
+ List<Field> visibleFields = new ArrayList<Field>();
addVisibleFields(fields(), fieldNames, visibleFields);
-
+
// All fields of the interfaces it implements.
- Iterator interfaces = interfaces().iterator();
- InterfaceTypeImpl inter;
+ Iterator<InterfaceType> interfaces = interfaces().iterator();
+ InterfaceType inter;
while (interfaces.hasNext()) {
- inter = (InterfaceTypeImpl)interfaces.next();
+ inter = interfaces.next();
addVisibleFields(inter.visibleFields(), fieldNames, visibleFields);
}
-
+
// If it is a class, all fields of it's superclass.
if (this instanceof ClassType) {
- ClassType superclass = ((ClassType)this).superclass();
+ ClassType superclass = ((ClassType) this).superclass();
if (superclass != null)
- addVisibleFields(superclass.visibleFields(), fieldNames, visibleFields);
+ addVisibleFields(superclass.visibleFields(), fieldNames,
+ visibleFields);
}
-
+
fVisibleFields = visibleFields;
return fVisibleFields;
}
- /**
- * @return Returns a list containing each Field declared in this type, and its super-classes, implemented interfaces, and/or super-interfaces.
+ /**
+ * @return Returns a list containing each Field declared in this type, and
+ * its super-classes, implemented interfaces, and/or
+ * super-interfaces.
*/
- public List allFields() {
+ public List<Field> allFields() {
if (fAllFields != null)
return fAllFields;
- /* Recursion:
- * The fields of its own (own fields() command);
- * All fields of the interfaces it implements;
- * If it is a class, all fields of it's superclass.
+ /*
+ * Recursion: The fields of its own (own fields() command); All fields
+ * of the interfaces it implements; If it is a class, all fields of it's
+ * superclass.
*/
- // The names of fields are maintained in a set, to avoid including fields that have been inherited double.
- HashSet resultSet = new HashSet();
-
+ // The names of fields are maintained in a set, to avoid including
+ // fields that have been inherited double.
+ HashSet<Field> resultSet = new HashSet<Field>();
+
// The fields of its own (own fields() command).
resultSet.addAll(fields());
-
+
// All fields of the interfaces it implements.
- Iterator interfaces = interfaces().iterator();
- InterfaceTypeImpl inter;
+ Iterator<InterfaceType> interfaces = interfaces().iterator();
+ InterfaceType inter;
while (interfaces.hasNext()) {
- inter = (InterfaceTypeImpl)interfaces.next();
+ inter = interfaces.next();
resultSet.addAll(inter.allFields());
}
-
+
// If it is a class, all fields of it's superclass.
if (this instanceof ClassType) {
- ClassType superclass = ((ClassType)this).superclass();
+ ClassType superclass = ((ClassType) this).superclass();
if (superclass != null)
resultSet.addAll(superclass.allFields());
}
-
- fAllFields = new ArrayList(resultSet);
+
+ fAllFields = new ArrayList<Field>(resultSet);
return fAllFields;
}
-
- /**
- * @return Returns the class loader object which loaded the class corresponding to this type.
+
+ /**
+ * @return Returns the class loader object which loaded the class
+ * corresponding to this type.
*/
public ClassLoaderReference classLoader() {
if (fClassLoader != null)
@@ -726,21 +792,23 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_CLASS_LOADER, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_CLASS_LOADER, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
fClassLoader = ClassLoaderReferenceImpl.read(this, replyData);
return fClassLoader;
} catch (IOException e) {
defaultIOExceptionHandler(e);
- return null;
+ return null;
} finally {
handledJdwpRequest();
}
}
-
- /**
- * @return Returns the class object that corresponds to this type in the target VM.
+
+ /**
+ * @return Returns the class object that corresponds to this type in the
+ * target VM.
*/
public ClassObjectReference classObject() {
if (fClassObject != null)
@@ -748,27 +816,29 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_CLASS_OBJECT, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_CLASS_OBJECT, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
fClassObject = ClassObjectReferenceImpl.read(this, replyData);
return fClassObject;
} catch (IOException e) {
defaultIOExceptionHandler(e);
- return null;
+ return null;
} finally {
handledJdwpRequest();
}
}
- /**
+ /**
* @return Returns status of class/interface.
*/
- protected int status() {
+ protected int status() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_STATUS, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_STATUS, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
int status = readInt("status", classStatusStrings(), replyData); //$NON-NLS-1$
@@ -780,69 +850,73 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
handledJdwpRequest();
}
}
-
- /**
+
+ /**
* @return Returns true if initialization failed for this class.
*/
public boolean failedToInitialize() {
return (status() & JDWP_CLASS_STATUS_ERROR) != 0;
}
- /**
+ /**
* @return Returns true if this type has been initialized.
*/
public boolean isInitialized() {
return (status() & JDWP_CLASS_STATUS_INITIALIZED) != 0;
}
- /**
+ /**
* @return Returns true if this type has been prepared.
*/
public boolean isPrepared() {
return (status() & JDWP_CLASS_STATUS_PREPARED) != 0;
}
- /**
+ /**
* @return Returns true if this type has been verified.
*/
public boolean isVerified() {
return (status() & JDWP_CLASS_STATUS_VERIFIED) != 0;
}
- /**
- * @return Returns the visible Field with the given non-ambiguous name.
+ /**
+ * @return Returns the visible Field with the given non-ambiguous name.
*/
public Field fieldByName(String name) {
- Iterator iter = visibleFields().iterator();
+ Iterator<TypeComponentImpl> iter = visibleFields().iterator();
while (iter.hasNext()) {
- FieldImpl field = (FieldImpl)iter.next();
+ FieldImpl field = (FieldImpl) iter.next();
if (field.name().equals(name))
return field;
}
return null;
}
-
- /**
- * @return Returns a list containing each Field declared in this type.
+
+ /**
+ * @return Returns a list containing each Field declared in this type.
*/
- public List fields() {
+ public List<Field> fields() {
if (fFields != null) {
return fFields;
}
-
- // Note: Fields are returned in the order they occur in the class file, therefore their
+
+ // Note: Fields are returned in the order they occur in the class file,
+ // therefore their
// order in this list can be used for comparisons.
initJdwpRequest();
try {
- boolean withGenericSignature= virtualMachineImpl().isJdwpVersionGreaterOrEqual(1, 5);
- int jdwpCommand= withGenericSignature ? JdwpCommandPacket.RT_FIELDS_WITH_GENERIC : JdwpCommandPacket.RT_FIELDS;
+ boolean withGenericSignature = virtualMachineImpl()
+ .isJdwpVersionGreaterOrEqual(1, 5);
+ int jdwpCommand = withGenericSignature ? JdwpCommandPacket.RT_FIELDS_WITH_GENERIC
+ : JdwpCommandPacket.RT_FIELDS;
JdwpReplyPacket replyPacket = requestVM(jdwpCommand, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- List elements = new ArrayList();
+ List<Field> elements = new ArrayList<Field>();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
for (int i = 0; i < nrOfElements; i++) {
- FieldImpl elt = FieldImpl.readWithNameSignatureModifiers(this, this, withGenericSignature, replyData);
+ FieldImpl elt = FieldImpl.readWithNameSignatureModifiers(this,
+ this, withGenericSignature, replyData);
if (elt == null) {
continue;
}
@@ -857,54 +931,58 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
handledJdwpRequest();
}
}
-
- /**
- * @return Returns FieldImpl of a field in the reference specified by a given fieldID, or null if not found.
+
+ /**
+ * @return Returns FieldImpl of a field in the reference specified by a
+ * given fieldID, or null if not found.
*/
public FieldImpl findField(JdwpFieldID fieldID) {
- Iterator iter = fields().iterator();
- while(iter.hasNext()) {
- FieldImpl field = (FieldImpl)iter.next();
+ Iterator<TypeComponentImpl> iter = fields().iterator();
+ while (iter.hasNext()) {
+ FieldImpl field = (FieldImpl) iter.next();
if (field.getFieldID().equals(fieldID))
return field;
}
return null;
}
-
- /**
- * @return Returns MethodImpl of a method in the reference specified by a given methodID, or null if not found.
+
+ /**
+ * @return Returns MethodImpl of a method in the reference specified by a
+ * given methodID, or null if not found.
*/
public MethodImpl findMethod(JdwpMethodID methodID) {
if (methodID.value() == 0) {
- return new MethodImpl(virtualMachineImpl(), this, methodID, JDIMessages.ReferenceTypeImpl_Obsolete_method_1, "", null, -1); //$NON-NLS-1$
+ return new MethodImpl(virtualMachineImpl(), this, methodID,
+ JDIMessages.ReferenceTypeImpl_Obsolete_method_1,
+ "", null, -1); //$NON-NLS-1$
}
if (fMethodTable == null) {
- fMethodTable= new Hashtable();
- Iterator iter = methods().iterator();
- while(iter.hasNext()) {
- MethodImpl method = (MethodImpl)iter.next();
+ fMethodTable = new Hashtable<JdwpMethodID, MethodImpl>();
+ Iterator<TypeComponentImpl> iter = methods().iterator();
+ while (iter.hasNext()) {
+ MethodImpl method = (MethodImpl) iter.next();
fMethodTable.put(method.getMethodID(), method);
}
}
- return (MethodImpl)fMethodTable.get(methodID);
+ return fMethodTable.get(methodID);
}
-
- /**
- * @return Returns the Value of a given static Field in this type.
+
+ /**
+ * @return Returns the Value of a given static Field in this type.
*/
public Value getValue(Field field) {
- ArrayList list = new ArrayList(1);
+ ArrayList<Field> list = new ArrayList<Field>(1);
list.add(field);
- return (ValueImpl)getValues(list).get(field);
+ return getValues(list).get(field);
}
-
- /**
+
+ /**
* @return a Map of the requested static Field objects with their Value.
*/
- public Map getValues(List fields) {
+ public Map<Field, Value> getValues(List<? extends Field> fields) {
// if the field list is empty, nothing to do
if (fields.isEmpty()) {
- return new HashMap();
+ return new HashMap<Field, Value>();
}
// Note that this information should not be cached.
initJdwpRequest();
@@ -915,20 +993,22 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
write(this, outData);
writeInt(fieldsSize, "size", outData); //$NON-NLS-1$
for (int i = 0; i < fieldsSize; i++) {
- FieldImpl field = (FieldImpl)fields.get(i);
+ FieldImpl field = (FieldImpl) fields.get(i);
checkVM(field);
field.getFieldID().write(outData);
}
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_GET_VALUES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_GET_VALUES, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
- HashMap map = new HashMap();
+ HashMap<Field, Value> map = new HashMap<Field, Value>();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- if (nrOfElements != fieldsSize)
- throw new InternalError(JDIMessages.ReferenceTypeImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_3);
-
+ if (nrOfElements != fieldsSize)
+ throw new InternalError(
+ JDIMessages.ReferenceTypeImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_3);
+
for (int i = 0; i < nrOfElements; i++) {
map.put(fields.get(i), ValueImpl.readWithTag(this, replyData));
}
@@ -940,83 +1020,98 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
handledJdwpRequest();
}
}
-
- /**
+
+ /**
* @return Returns the hash code value.
*/
+ @Override
public int hashCode() {
return fReferenceTypeID.hashCode();
}
-
+
/**
- * @return Returns true if two mirrors refer to the same entity in the target VM.
+ * @return Returns true if two mirrors refer to the same entity in the
+ * target VM.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
return object != null
- && object.getClass().equals(this.getClass())
- && fReferenceTypeID.equals(((ReferenceTypeImpl)object).fReferenceTypeID)
- && virtualMachine().equals(((MirrorImpl)object).virtualMachine());
+ && object.getClass().equals(this.getClass())
+ && fReferenceTypeID
+ .equals(((ReferenceTypeImpl) object).fReferenceTypeID)
+ && virtualMachine().equals(
+ ((MirrorImpl) object).virtualMachine());
}
-
+
/**
- * @return Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
+ * @return Returns a negative integer, zero, or a positive integer as this
+ * object is less than, equal to, or greater than the specified
+ * object.
*/
public int compareTo(Object object) {
if (object == null || !object.getClass().equals(this.getClass()))
- throw new ClassCastException(JDIMessages.ReferenceTypeImpl_Can__t_compare_reference_type_to_given_object_4);
- return name().compareTo(((ReferenceType)object).name());
+ throw new ClassCastException(
+ JDIMessages.ReferenceTypeImpl_Can__t_compare_reference_type_to_given_object_4);
+ return name().compareTo(((ReferenceType) object).name());
}
-
- /**
+
+ /**
* @return Returns true if the type was declared abstract.
*/
public boolean isAbstract() {
return (modifiers() & MODIFIER_ACC_ABSTRACT) != 0;
}
-
- /**
+
+ /**
* @return Returns true if the type was declared final.
*/
public boolean isFinal() {
return (modifiers() & MODIFIER_ACC_FINAL) != 0;
}
-
- /**
+
+ /**
* @return Returns true if the type was declared static.
*/
public boolean isStatic() {
return (modifiers() & MODIFIER_ACC_STATIC) != 0;
}
-
+
/**
- * @return Returns a List filled with all Location objects that map to the given line number.
+ * @return Returns a List filled with all Location objects that map to the
+ * given line number.
*/
public List locationsOfLine(int line) throws AbsentInformationException {
return locationsOfLine(virtualMachine().getDefaultStratum(), null, line);
}
-
+
/**
- * @return Returns a list containing each Method declared directly in this type.
+ * @return Returns a list containing each Method declared directly in this
+ * type.
*/
- public List methods() {
- // Note that ArrayReference overwrites this method by returning an empty list.
+ public List<Method> methods() {
+ // Note that ArrayReference overwrites this method by returning an empty
+ // list.
if (fMethods != null)
return fMethods;
-
- // Note: Methods are returned in the order they occur in the class file, therefore their
+
+ // Note: Methods are returned in the order they occur in the class file,
+ // therefore their
// order in this list can be used for comparisons.
initJdwpRequest();
try {
- boolean withGenericSignature= virtualMachineImpl().isJdwpVersionGreaterOrEqual(1, 5);
- int jdwpCommand= withGenericSignature ? JdwpCommandPacket.RT_METHODS_WITH_GENERIC : JdwpCommandPacket.RT_METHODS;
+ boolean withGenericSignature = virtualMachineImpl()
+ .isJdwpVersionGreaterOrEqual(1, 5);
+ int jdwpCommand = withGenericSignature ? JdwpCommandPacket.RT_METHODS_WITH_GENERIC
+ : JdwpCommandPacket.RT_METHODS;
JdwpReplyPacket replyPacket = requestVM(jdwpCommand, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- List elements = new ArrayList();
+ List<Method> elements = new ArrayList<Method>();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
for (int i = 0; i < nrOfElements; i++) {
- MethodImpl elt = MethodImpl.readWithNameSignatureModifiers(this, this, withGenericSignature, replyData);
+ MethodImpl elt = MethodImpl.readWithNameSignatureModifiers(
+ this, this, withGenericSignature, replyData);
if (elt == null) {
continue;
}
@@ -1031,16 +1126,17 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
handledJdwpRequest();
}
}
-
+
/**
- * @return Returns a List containing each visible Method that has the given name.
+ * @return Returns a List containing each visible Method that has the given
+ * name.
*/
- public List methodsByName(String name) {
- List elements = new ArrayList();
- Iterator iter = visibleMethods().iterator();
+ public List<MethodImpl> methodsByName(String name) {
+ List<MethodImpl> elements = new ArrayList<MethodImpl>();
+ Iterator<MethodImpl> iter = visibleMethods().iterator();
while (iter.hasNext()) {
- MethodImpl method = (MethodImpl)iter.next();
- if (method.name().equals(name)){
+ MethodImpl method = iter.next();
+ if (method.name().equals(name)) {
elements.add(method);
}
}
@@ -1048,23 +1144,26 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * @return Returns a List containing each visible Method that has the given name and signature.
+ * @return Returns a List containing each visible Method that has the given
+ * name and signature.
*/
- public List methodsByName(String name, String signature) {
- List elements = new ArrayList();
- Iterator iter = visibleMethods().iterator();
+ public List<MethodImpl> methodsByName(String name, String signature) {
+ List<MethodImpl> elements = new ArrayList<MethodImpl>();
+ Iterator<MethodImpl> iter = visibleMethods().iterator();
while (iter.hasNext()) {
- MethodImpl method = (MethodImpl)iter.next();
- if (method.name().equals(name) && method.signature().equals(signature)) {
+ MethodImpl method = iter.next();
+ if (method.name().equals(name)
+ && method.signature().equals(signature)) {
elements.add(method);
}
}
return elements;
}
- /**
+ /**
* @return Returns the fully qualified name of this type.
*/
+ @Override
public String name() {
// Make sure that we know the signature, from which the name is derived.
if (fName == null) {
@@ -1072,42 +1171,48 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
return fName;
}
-
- /**
- * @return Returns the JNI-style signature for this type.
+
+ /**
+ * @return Returns the JNI-style signature for this type.
*/
+ @Override
public String signature() {
if (fSignature != null) {
return fSignature;
}
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_SIGNATURE, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_SIGNATURE, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
setSignature(readString("signature", replyData)); //$NON-NLS-1$
return fSignature;
} catch (IOException e) {
defaultIOExceptionHandler(e);
- return null;
+ return null;
} finally {
handledJdwpRequest();
}
}
- /**
- * @return Returns a List containing each ReferenceType declared within this type.
+ /**
+ * @return Returns a List containing each ReferenceType declared within this
+ * type.
*/
- public List nestedTypes() {
- // Note that the VM gives an empty reply on RT_NESTED_TYPES, therefore we search for the
+ public List<ReferenceType> nestedTypes() {
+ // Note that the VM gives an empty reply on RT_NESTED_TYPES, therefore
+ // we search for the
// nested types in the loaded types.
- List result = new ArrayList();
- Iterator itr = virtualMachineImpl().allRefTypes();
+ List<ReferenceType> result = new ArrayList<ReferenceType>();
+ Iterator<ReferenceType> itr = virtualMachineImpl().allRefTypes();
while (itr.hasNext()) {
try {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)itr.next();
+ ReferenceTypeImpl refType = (ReferenceTypeImpl) itr.next();
String refName = refType.name();
- if (refName.length() > name().length() && refName.startsWith(name()) && refName.charAt(name().length()) == '$') {
+ if (refName.length() > name().length()
+ && refName.startsWith(name())
+ && refName.charAt(name().length()) == '$') {
result.add(refType);
}
} catch (ClassNotPreparedException e) {
@@ -1117,26 +1222,31 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
return result;
}
- /**
- * @return Returns an identifying name for the source corresponding to the declaration of this type.
+ /**
+ * @return Returns an identifying name for the source corresponding to the
+ * declaration of this type.
*/
public String sourceName() throws AbsentInformationException {
- // sourceNames list in never empty, an AbsentInformationException is thrown
+ // sourceNames list in never empty, an AbsentInformationException is
+ // thrown
// if the source name is not known.
- return (String)sourceNames(virtualMachine().getDefaultStratum()).get(0);
+ return sourceNames(virtualMachine().getDefaultStratum())
+ .get(0);
}
/**
- * @return Returns the CRC-32 of the given reference type, undefined if unknown.
+ * @return Returns the CRC-32 of the given reference type, undefined if
+ * unknown.
*/
public int getClassFileVersion() {
virtualMachineImpl().checkHCRSupported();
if (fGotClassFileVersion)
return fClassFileVersion;
-
+
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.HCR_GET_CLASS_VERSION, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.HCR_GET_CLASS_VERSION, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
fIsHCREligible = readBoolean("HCR eligible", replyData); //$NON-NLS-1$
@@ -1146,12 +1256,12 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
return fClassFileVersion;
} catch (IOException e) {
defaultIOExceptionHandler(e);
- return 0;
+ return 0;
} finally {
handledJdwpRequest();
}
}
-
+
/**
* @return Returns whether the CRC-32 of the given reference type is known.
*/
@@ -1159,7 +1269,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
getClassFileVersion();
return fIsVersionKnown;
}
-
+
/**
* @return Returns whether the reference type is HCR-eligible.
*/
@@ -1167,91 +1277,110 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
getClassFileVersion();
return fIsHCREligible;
}
-
+
/**
* Writes JDWP representation.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
fReferenceTypeID.write(out);
if (target.fVerboseWriter != null)
- target.fVerboseWriter.println("referenceType", fReferenceTypeID.value()); //$NON-NLS-1$
+ target.fVerboseWriter.println(
+ "referenceType", fReferenceTypeID.value()); //$NON-NLS-1$
}
-
+
/**
* Writes representation of null referenceType.
*/
- public static void writeNull(MirrorImpl target, DataOutputStream out) throws IOException {
+ public static void writeNull(MirrorImpl target, DataOutputStream out)
+ throws IOException {
// create null id
- JdwpReferenceTypeID ID = new JdwpReferenceTypeID(target.virtualMachineImpl());
+ JdwpReferenceTypeID ID = new JdwpReferenceTypeID(
+ target.virtualMachineImpl());
ID.write(out);
if (target.fVerboseWriter != null)
target.fVerboseWriter.println("referenceType", ID.value()); //$NON-NLS-1$
}
-
+
/**
* Writes JDWP representation.
*/
- public void writeWithTag(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void writeWithTag(MirrorImpl target, DataOutputStream out)
+ throws IOException {
target.writeByte(typeTag(), "type tag", JdwpID.typeTagMap(), out); //$NON-NLS-1$
write(target, out);
}
-
+
/**
* @return Reads JDWP representation and returns new or cached instance.
*/
- public static ReferenceTypeImpl readWithTypeTag(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ReferenceTypeImpl readWithTypeTag(MirrorImpl target,
+ DataInputStream in) throws IOException {
byte typeTag = target.readByte("type tag", JdwpID.typeTagMap(), in); //$NON-NLS-1$
switch (typeTag) {
- case 0:
- return null;
- case ArrayTypeImpl.typeTag:
- return ArrayTypeImpl.read(target, in);
- case ClassTypeImpl.typeTag:
- return ClassTypeImpl.read(target, in);
- case InterfaceTypeImpl.typeTag:
- return InterfaceTypeImpl.read(target, in);
+ case 0:
+ return null;
+ case ArrayTypeImpl.typeTag:
+ return ArrayTypeImpl.read(target, in);
+ case ClassTypeImpl.typeTag:
+ return ClassTypeImpl.read(target, in);
+ case InterfaceTypeImpl.typeTag:
+ return InterfaceTypeImpl.read(target, in);
}
- throw new InternalException(JDIMessages.ReferenceTypeImpl_Invalid_ReferenceTypeID_tag_encountered___8 + typeTag);
+ throw new InternalException(
+ JDIMessages.ReferenceTypeImpl_Invalid_ReferenceTypeID_tag_encountered___8
+ + typeTag);
}
-
+
/**
- * @return Returns the Location objects for each executable source line in this reference type.
+ * @return Returns the Location objects for each executable source line in
+ * this reference type.
*/
public List allLineLocations() throws AbsentInformationException {
return allLineLocations(virtualMachine().getDefaultStratum(), null);
}
-
+
/**
* @return Reads JDWP representation and returns new or cached instance.
*/
- public static ReferenceTypeImpl readWithTypeTagAndSignature(MirrorImpl target, boolean withGenericSignature, DataInputStream in) throws IOException {
+ public static ReferenceTypeImpl readWithTypeTagAndSignature(
+ MirrorImpl target, boolean withGenericSignature, DataInputStream in)
+ throws IOException {
byte typeTag = target.readByte("type tag", JdwpID.typeTagMap(), in); //$NON-NLS-1$
switch (typeTag) {
- case 0:
- return null;
- case ArrayTypeImpl.typeTag:
- return ArrayTypeImpl.readWithSignature(target, withGenericSignature, in);
- case ClassTypeImpl.typeTag:
- return ClassTypeImpl.readWithSignature(target, withGenericSignature, in);
- case InterfaceTypeImpl.typeTag:
- return InterfaceTypeImpl.readWithSignature(target, withGenericSignature, in);
+ case 0:
+ return null;
+ case ArrayTypeImpl.typeTag:
+ return ArrayTypeImpl.readWithSignature(target,
+ withGenericSignature, in);
+ case ClassTypeImpl.typeTag:
+ return ClassTypeImpl.readWithSignature(target,
+ withGenericSignature, in);
+ case InterfaceTypeImpl.typeTag:
+ return InterfaceTypeImpl.readWithSignature(target,
+ withGenericSignature, in);
}
- throw new InternalException(JDIMessages.ReferenceTypeImpl_Invalid_ReferenceTypeID_tag_encountered___8 + typeTag);
+ throw new InternalException(
+ JDIMessages.ReferenceTypeImpl_Invalid_ReferenceTypeID_tag_encountered___8
+ + typeTag);
}
-
+
/**
* @return Returns new instance based on signature and classLoader.
- * @throws ClassNotLoadedException when the ReferenceType has not been loaded by the specified class loader.
+ * @throws ClassNotLoadedException
+ * when the ReferenceType has not been loaded by the specified
+ * class loader.
*/
- public static TypeImpl create(VirtualMachineImpl vmImpl, String signature, ClassLoaderReference classLoader) throws ClassNotLoadedException {
+ public static TypeImpl create(VirtualMachineImpl vmImpl, String signature,
+ ClassLoaderReference classLoader) throws ClassNotLoadedException {
ReferenceTypeImpl refTypeBootstrap = null;
- List classes= vmImpl.classesBySignature(signature);
+ List classes = vmImpl.classesBySignature(signature);
ReferenceTypeImpl type;
- Iterator iter= classes.iterator();
+ Iterator iter = classes.iterator();
while (iter.hasNext()) {
// First pass. Look for a class loaded by the given class loader
- type = (ReferenceTypeImpl)iter.next();
- if (type.classLoader() == null) { // bootstrap classloader
+ type = (ReferenceTypeImpl) iter.next();
+ if (type.classLoader() == null) { // bootstrap classloader
if (classLoader == null) {
return type;
}
@@ -1261,20 +1390,21 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
return type;
}
}
- // If no ReferenceType is found with the specified classloader, but there is one with the
+ // If no ReferenceType is found with the specified classloader, but
+ // there is one with the
// bootstrap classloader, the latter is returned.
if (refTypeBootstrap != null) {
return refTypeBootstrap;
}
-
- List visibleTypes;
- iter= classes.iterator();
+
+ List<ReferenceTypeImpl> visibleTypes;
+ iter = classes.iterator();
while (iter.hasNext()) {
// Second pass. Look for a class that is visible to
// the given class loader
- type = (ReferenceTypeImpl)iter.next();
- visibleTypes= classLoader.visibleClasses();
- Iterator visibleIter= visibleTypes.iterator();
+ type = (ReferenceTypeImpl) iter.next();
+ visibleTypes = classLoader.visibleClasses();
+ Iterator<ReferenceTypeImpl> visibleIter = visibleTypes.iterator();
while (visibleIter.hasNext()) {
if (type.equals(visibleIter.next())) {
return type;
@@ -1282,9 +1412,10 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
}
- throw new ClassNotLoadedException(classSignatureToName(signature), JDIMessages.ReferenceTypeImpl_Type_has_not_been_loaded_10);
+ throw new ClassNotLoadedException(classSignatureToName(signature),
+ JDIMessages.ReferenceTypeImpl_Type_has_not_been_loaded_10);
}
-
+
/**
* Retrieves constant mappings.
*/
@@ -1292,29 +1423,31 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
if (fgClassStatusStrings != null) {
return;
}
-
- java.lang.reflect.Field[] fields = ReferenceTypeImpl.class.getDeclaredFields();
+
+ java.lang.reflect.Field[] fields = ReferenceTypeImpl.class
+ .getDeclaredFields();
fgClassStatusStrings = new String[32];
-
- for (int i = 0; i < fields.length; i++) {
- java.lang.reflect.Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
+
+ for (java.lang.reflect.Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
}
-
+
String name = field.getName();
if (!name.startsWith("JDWP_CLASS_STATUS_")) { //$NON-NLS-1$
continue;
}
-
+
name = name.substring(18);
-
+
try {
int value = field.getInt(null);
-
+
for (int j = 0; j < fgClassStatusStrings.length; j++) {
if ((1 << j & value) != 0) {
- fgClassStatusStrings[j]= name;
+ fgClassStatusStrings[j] = name;
break;
}
}
@@ -1327,18 +1460,19 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
}
}
-
+
/**
* @return Returns a map with string representations of tags.
*/
- public static String[] classStatusStrings() {
- getConstantMaps();
- return fgClassStatusStrings;
- }
-
+ public static String[] classStatusStrings() {
+ getConstantMaps();
+ return fgClassStatusStrings;
+ }
+
/**
* @see TypeImpl#createNullValue()
*/
+ @Override
public Value createNullValue() {
return null;
}
@@ -1346,17 +1480,18 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* @see ReferenceType#sourceNames(String)
*/
- public List sourceNames(String stratumId) throws AbsentInformationException {
- List list= new ArrayList();
- Stratum stratum= getStratum(stratumId);
+ public List<String> sourceNames(String stratumId) throws AbsentInformationException {
+ List<String> list = new ArrayList<String>();
+ Stratum stratum = getStratum(stratumId);
if (stratum != null) {
// return the source names defined for this stratum in the SMAP.
- List fileInfos= stratum.fFileInfos;
+ List<FileInfo> fileInfos = stratum.fFileInfos;
if (fileInfos.isEmpty()) {
- throw new AbsentInformationException(JDIMessages.ReferenceTypeImpl_30);
+ throw new AbsentInformationException(
+ JDIMessages.ReferenceTypeImpl_30);
}
- for (Iterator iter = stratum.fFileInfos.iterator(); iter.hasNext();) {
- list.add(((FileInfo) iter.next()).fFileName);
+ for (Iterator<FileInfo> iter = stratum.fFileInfos.iterator(); iter.hasNext();) {
+ list.add(iter.next().fFileName);
}
return list;
}
@@ -1371,16 +1506,16 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* @see ReferenceType#sourcePaths(String)
*/
- public List sourcePaths(String stratumId) throws AbsentInformationException {
- List list= new ArrayList();
- Stratum stratum= getStratum(stratumId);
+ public List<String> sourcePaths(String stratumId) throws AbsentInformationException {
+ List<String> list = new ArrayList<String>();
+ Stratum stratum = getStratum(stratumId);
if (stratum != null) {
// return the source paths defined for this stratum in the SMAP.
- for (Iterator iter = stratum.fFileInfos.iterator(); iter.hasNext();) {
- FileInfo fileInfo= (FileInfo) iter.next();
- String path= fileInfo.fAbsoluteFileName;
+ for (Iterator<FileInfo> iter = stratum.fFileInfos.iterator(); iter.hasNext();) {
+ FileInfo fileInfo = iter.next();
+ String path = fileInfo.fAbsoluteFileName;
if (path == null) {
- path= getPath(fileInfo.fFileName);
+ path = getPath(fileInfo.fFileName);
}
list.add(path);
}
@@ -1393,7 +1528,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
list.add(getPath(fSourceName));
return list;
}
-
+
/**
* @see ReferenceType#sourceDebugExtension()
*/
@@ -1410,34 +1545,41 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* @see ReferenceType#allLineLocations(String, String)
*/
- public List allLineLocations(String stratum, String sourceName) throws AbsentInformationException {
- Iterator allMethods = methods().iterator();
+ public List allLineLocations(String stratum, String sourceName)
+ throws AbsentInformationException {
+ Iterator<TypeComponentImpl> allMethods = methods().iterator();
if (stratum == null) { // if stratum not defined use the default stratum
- stratum= defaultStratum();
+ stratum = defaultStratum();
}
- List allLineLocations= null;
- Map sourceNameAllLineLocations= null;
- if (fStratumAllLineLocations == null) { // the stratum map doesn't exist, create it
- fStratumAllLineLocations= new HashMap();
+ List allLineLocations = null;
+ Map<String, List> sourceNameAllLineLocations = null;
+ if (fStratumAllLineLocations == null) { // the stratum map doesn't
+ // exist, create it
+ fStratumAllLineLocations = new HashMap<String, Map>();
} else {
// get the source name map
- sourceNameAllLineLocations= (Map)fStratumAllLineLocations.get(stratum);
+ sourceNameAllLineLocations = fStratumAllLineLocations
+ .get(stratum);
}
- if (sourceNameAllLineLocations == null) { // the source name map doesn't exist, create it
- sourceNameAllLineLocations= new HashMap();
+ if (sourceNameAllLineLocations == null) { // the source name map doesn't
+ // exist, create it
+ sourceNameAllLineLocations = new HashMap<String, List>();
fStratumAllLineLocations.put(stratum, sourceNameAllLineLocations);
} else {
// get the line locations
- allLineLocations= (List)sourceNameAllLineLocations.get(sourceName);
+ allLineLocations = sourceNameAllLineLocations
+ .get(sourceName);
}
- if (allLineLocations == null) { // the line locations are not know, compute and store them
+ if (allLineLocations == null) { // the line locations are not know,
+ // compute and store them
allLineLocations = new ArrayList();
while (allMethods.hasNext()) {
- MethodImpl method = (MethodImpl)allMethods.next();
+ MethodImpl method = (MethodImpl) allMethods.next();
if (method.isAbstract() || method.isNative()) {
continue;
}
- allLineLocations.addAll(method.allLineLocations(stratum, sourceName));
+ allLineLocations.addAll(method.allLineLocations(stratum,
+ sourceName));
}
sourceNameAllLineLocations.put(sourceName, allLineLocations);
}
@@ -1447,23 +1589,26 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* @see ReferenceType#locationsOfLine(String, String, int)
*/
- public List locationsOfLine(String stratum, String sourceName, int lineNumber) throws AbsentInformationException {
- Iterator allMethods = methods().iterator();
- List locations= new ArrayList();
- boolean hasLineInformation= false;
- AbsentInformationException exception= null;
+ public List locationsOfLine(String stratum, String sourceName,
+ int lineNumber) throws AbsentInformationException {
+ Iterator<TypeComponentImpl> allMethods = methods().iterator();
+ List locations = new ArrayList();
+ boolean hasLineInformation = false;
+ AbsentInformationException exception = null;
while (allMethods.hasNext()) {
- MethodImpl method = (MethodImpl)allMethods.next();
+ MethodImpl method = (MethodImpl) allMethods.next();
if (method.isAbstract() || method.isNative()) {
- continue;
+ continue;
}
- // one line in the input source can be translate in multiple lines in different
+ // one line in the input source can be translate in multiple lines
+ // in different
// methods in the output source. We need all these locations.
try {
- locations.addAll(locationsOfLine(stratum, sourceName, lineNumber, method));
- hasLineInformation= true;
+ locations.addAll(locationsOfLine(stratum, sourceName,
+ lineNumber, method));
+ hasLineInformation = true;
} catch (AbsentInformationException e) {
- exception= e;
+ exception = e;
}
}
if (!hasLineInformation && exception != null) {
@@ -1475,8 +1620,8 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* @see ReferenceType#availableStrata()
*/
- public List availableStrata() {
- List list= new ArrayList();
+ public List<String> availableStrata() {
+ List<String> list = new ArrayList<String>();
// The strata defined in the SMAP.
if (isSourceDebugExtensionAvailable()) {
list.addAll(fStrata.keySet());
@@ -1498,36 +1643,38 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * Generate a source path from the given source name.
- * The returned string is the package name of this type converted to a platform dependent path
- * followed by the given source name.
- * For example, on a Unix platform, the type org.my.TestJsp with the source name test.jsp would
- * return "org/my/test.jsp".
+ * Generate a source path from the given source name. The returned string is
+ * the package name of this type converted to a platform dependent path
+ * followed by the given source name. For example, on a Unix platform, the
+ * type org.my.TestJsp with the source name test.jsp would return
+ * "org/my/test.jsp".
*/
private String getPath(String sourceName) {
- String name= name();
- int lastDotOffset= name.lastIndexOf('.');
+ String name = name();
+ int lastDotOffset = name.lastIndexOf('.');
if (lastDotOffset == -1) {
return sourceName;
}
- char fileSeparator= System.getProperty("file.separator").charAt(0); //$NON-NLS-1$
- return name.substring(0, lastDotOffset).replace('.', fileSeparator) + fileSeparator + sourceName;
+ char fileSeparator = System.getProperty("file.separator").charAt(0); //$NON-NLS-1$
+ return name.substring(0, lastDotOffset).replace('.', fileSeparator)
+ + fileSeparator + sourceName;
}
/**
- * Return the stratum object for this stratum Id.
- * If the the specified stratum id is not defined for this reference type,
- * return the stratum object for the default stratum.
- * If the specified stratum id (or the default stratum id, if the specified
- * stratum id is not defined) is <code>Java</code>, return <code>null</code>.
+ * Return the stratum object for this stratum Id. If the the specified
+ * stratum id is not defined for this reference type, return the stratum
+ * object for the default stratum. If the specified stratum id (or the
+ * default stratum id, if the specified stratum id is not defined) is
+ * <code>Java</code>, return <code>null</code>.
*/
private Stratum getStratum(String stratumId) {
- if (!VirtualMachineImpl.JAVA_STRATUM_NAME.equals(stratumId) && isSourceDebugExtensionAvailable()) {
+ if (!VirtualMachineImpl.JAVA_STRATUM_NAME.equals(stratumId)
+ && isSourceDebugExtensionAvailable()) {
if (stratumId == null || !fStrata.keySet().contains(stratumId)) {
- stratumId= fDefaultStratumId;
+ stratumId = fDefaultStratumId;
}
if (!VirtualMachineImpl.JAVA_STRATUM_NAME.equals(stratumId)) {
- return (Stratum)fStrata.get(stratumId);
+ return fStrata.get(stratumId);
}
}
return null;
@@ -1535,36 +1682,43 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* Get the source debug extension from the VM.
+ *
* @throws AbsentInformationException
- */
+ */
private void getSourceDebugExtension() throws AbsentInformationException {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION, this);
if (replyPacket.errorCode() == JdwpReplyPacket.ABSENT_INFORMATION) {
- throw new AbsentInformationException(JDIMessages.ReferenceTypeImpl_31);
+ throw new AbsentInformationException(
+ JDIMessages.ReferenceTypeImpl_31);
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- fSmap= readString(JDIMessages.ReferenceTypeImpl_32, replyData);
+ fSmap = readString(JDIMessages.ReferenceTypeImpl_32, replyData);
} catch (IOException e) {
defaultIOExceptionHandler(e);
} finally {
handledJdwpRequest();
}
- // TODO: remove the workaround when the J9SC20030415 bug is fixed (see bug 96485 of the vendor bug system).
- // Workaround to a J9SC bug. It returns an empty string instead of a ABSENT_INFORMATION
+ // TODO: remove the workaround when the J9SC20030415 bug is fixed (see
+ // bug 96485 of the vendor bug system).
+ // Workaround to a J9SC bug. It returns an empty string instead of a
+ // ABSENT_INFORMATION
// error if the source debug extension is not available.
if ("".equals(fSmap)) { //$NON-NLS-1$
- throw new AbsentInformationException(JDIMessages.ReferenceTypeImpl_31);
+ throw new AbsentInformationException(
+ JDIMessages.ReferenceTypeImpl_31);
}
// parse the source map.
- fStrata= new HashMap();
+ fStrata = new HashMap<String, Stratum>();
SourceDebugExtensionParser.parse(fSmap, this);
}
-
+
/**
* Get the name of the Java source file from the VM.
+ *
* @throws AbsentInformationException
*/
private void getSourceName() throws AbsentInformationException {
@@ -1573,13 +1727,15 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_SOURCE_FILE, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_SOURCE_FILE, this);
if (replyPacket.errorCode() == JdwpReplyPacket.ABSENT_INFORMATION) {
- throw new AbsentInformationException(JDIMessages.ReferenceTypeImpl_Source_name_is_not_known_7);
+ throw new AbsentInformationException(
+ JDIMessages.ReferenceTypeImpl_Source_name_is_not_known_7);
}
-
+
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
fSourceName = readString("source name", replyData); //$NON-NLS-1$
} catch (IOException e) {
@@ -1590,26 +1746,25 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * Check in the source debug extension is available.
- * To call before doing operations which need data from the SMAP.
- * Return <code>false</code> if the source debug extension is not available
- * for any reason. <code>true</code> indicates that the source debug extension
- * is available and the information has been parsed and stored in the
- * maps and lists.
+ * Check in the source debug extension is available. To call before doing
+ * operations which need data from the SMAP. Return <code>false</code> if
+ * the source debug extension is not available for any reason.
+ * <code>true</code> indicates that the source debug extension is available
+ * and the information has been parsed and stored in the maps and lists.
*/
private synchronized boolean isSourceDebugExtensionAvailable() {
if (!fSourceDebugExtensionAvailable) {
return false;
}
if (!virtualMachine().canGetSourceDebugExtension()) {
- fSourceDebugExtensionAvailable= false;
+ fSourceDebugExtensionAvailable = false;
return false;
}
if (fSmap == null) {
try {
- getSourceDebugExtension();
+ getSourceDebugExtension();
} catch (AbsentInformationException e) {
- fSourceDebugExtensionAvailable= false;
+ fSourceDebugExtensionAvailable = false;
return false;
}
}
@@ -1617,21 +1772,21 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * Set the output file name, i.e. the .java file used to generate
- * the bytecode.
+ * Set the output file name, i.e. the .java file used to generate the
+ * bytecode.
*/
protected void setOutputFileName(String outputFileName) {
- fSourceName= outputFileName;
+ fSourceName = outputFileName;
}
-
+
/**
- * Set the default stratum. This stratum will be used for the method
- * on strata related data, but with no stratum parameter.
+ * Set the default stratum. This stratum will be used for the method on
+ * strata related data, but with no stratum parameter.
*/
protected void setDefaultStratumId(String defaultStratumId) {
- fDefaultStratumId= defaultStratumId;
+ fDefaultStratumId = defaultStratumId;
}
-
+
/**
* Add a new stratum to this type.
*/
@@ -1640,19 +1795,22 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * Return the name of the input source file of which the given code index
- * is part of the translation, for this stratum.
- * If the code at the given index is not a part of the translation of
- * the given stratum code, return the name of the primary input source file.
+ * Return the name of the input source file of which the given code index is
+ * part of the translation, for this stratum. If the code at the given index
+ * is not a part of the translation of the given stratum code, return the
+ * name of the primary input source file.
*
- * @param codeIndex the index of the code.
- * @param method the method where is the code.
+ * @param codeIndex
+ * the index of the code.
+ * @param method
+ * the method where is the code.
* @param stratumId
*/
- protected String sourceName(long codeIndex, MethodImpl method, String stratumId) throws AbsentInformationException {
- Stratum stratum= getStratum(stratumId);
+ protected String sourceName(long codeIndex, MethodImpl method,
+ String stratumId) throws AbsentInformationException {
+ Stratum stratum = getStratum(stratumId);
if (stratum != null) {
- FileInfo fileInfo= fileInfo(codeIndex, method, stratum);
+ FileInfo fileInfo = fileInfo(codeIndex, method, stratum);
if (fileInfo != null) {
return fileInfo.fFileName;
}
@@ -1663,32 +1821,34 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
return fSourceName;
}
-
+
/**
- * Return the FileInfo object of the input source file of which the given code index
- * is part of the translation, for this stratum.
- * If the code at the given index is not a part of the translation of
- * the given stratum code, return the FileInfo of the primary input source file.
+ * Return the FileInfo object of the input source file of which the given
+ * code index is part of the translation, for this stratum. If the code at
+ * the given index is not a part of the translation of the given stratum
+ * code, return the FileInfo of the primary input source file.
*
- * @param codeIndex the index of the code.
- * @param method the method where is the code.
+ * @param codeIndex
+ * the index of the code.
+ * @param method
+ * the method where is the code.
* @param stratum
*/
private FileInfo fileInfo(long codeIndex, MethodImpl method, Stratum stratum) {
- int fileId= stratum.fPrimaryFileId;
+ int fileId = stratum.fPrimaryFileId;
if (stratum.fFileInfos.size() > 1) {
- List lineInfos= null;
+ List lineInfos = null;
try {
lineInfos = lineInfos(codeIndex, method, stratum);
} catch (AbsentInformationException e) {
// nothing to do, use the primary file id.
}
if (lineInfos != null) {
- fileId= ((int[])lineInfos.get(0))[0];
+ fileId = ((int[]) lineInfos.get(0))[0];
}
}
- for (Iterator iter = stratum.fFileInfos.iterator(); iter.hasNext();) {
- FileInfo fileInfo = (FileInfo)iter.next();
+ for (Iterator<FileInfo> iter = stratum.fFileInfos.iterator(); iter.hasNext();) {
+ FileInfo fileInfo = iter.next();
if (fileInfo.fFileId == fileId) {
return fileInfo;
}
@@ -1698,16 +1858,19 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * Return the list of line number in the input files of the stratum associated
- * with the code at the given address.
+ * Return the list of line number in the input files of the stratum
+ * associated with the code at the given address.
*
- * @param codeIndex the index of the code.
- * @param method the method where is the code.
+ * @param codeIndex
+ * the index of the code.
+ * @param method
+ * the method where is the code.
* @param stratum
* @return List of int[2]: [fileId, inputLineNumber]
*/
- private List lineInfos(long codeIndex, MethodImpl method, Stratum stratum) throws AbsentInformationException {
- int outputLineNumber= -1;
+ private List lineInfos(long codeIndex, MethodImpl method, Stratum stratum)
+ throws AbsentInformationException {
+ int outputLineNumber = -1;
try {
outputLineNumber = method.javaStratumLineNumber(codeIndex);
} catch (NativeMethodException e) { // Occurs in SUN VM.
@@ -1720,21 +1883,24 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * Return the path of the input source file of which the given code index
- * is part of the translation, for this stratum.
- * If the code at the given index is not a part of the translation of
- * the given stratum code, return the path of the primary input source file.
+ * Return the path of the input source file of which the given code index is
+ * part of the translation, for this stratum. If the code at the given index
+ * is not a part of the translation of the given stratum code, return the
+ * path of the primary input source file.
*
- * @param codeIndex the index of the code.
- * @param method the method where is the code.
+ * @param codeIndex
+ * the index of the code.
+ * @param method
+ * the method where is the code.
* @param stratumId
*/
- protected String sourcePath(long codeIndex, MethodImpl method, String stratumId) throws AbsentInformationException {
- Stratum stratum= getStratum(stratumId);
+ protected String sourcePath(long codeIndex, MethodImpl method,
+ String stratumId) throws AbsentInformationException {
+ Stratum stratum = getStratum(stratumId);
if (stratum != null) {
- FileInfo fileInfo= fileInfo(codeIndex, method, stratum);
+ FileInfo fileInfo = fileInfo(codeIndex, method, stratum);
if (fileInfo != null) {
- String path= fileInfo.fAbsoluteFileName;
+ String path = fileInfo.fAbsoluteFileName;
if (path == null) {
return getPath(fileInfo.fFileName);
}
@@ -1749,20 +1915,22 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
/**
- * Return the number of the line of which the given code index
- * is part of the translation, for this stratum.
+ * Return the number of the line of which the given code index is part of
+ * the translation, for this stratum.
*
- * @param codeIndex the index of the code.
- * @param method the method where is the code.
+ * @param codeIndex
+ * the index of the code.
+ * @param method
+ * the method where is the code.
* @param stratumId
*/
protected int lineNumber(long codeIndex, MethodImpl method, String stratumId) {
- Stratum stratum= getStratum(stratumId);
+ Stratum stratum = getStratum(stratumId);
try {
if (stratum != null) {
List lineInfos = lineInfos(codeIndex, method, stratum);
if (lineInfos != null) {
- return ((int[])lineInfos.get(0))[1];
+ return ((int[]) lineInfos.get(0))[1];
}
return LocationImpl.LINE_NR_NOT_AVAILABLE;
}
@@ -1779,83 +1947,105 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
/**
* Return the location which are part of the translation of the given line,
- * in the given stratum in the source file with the given source name.
- * If sourceName is <code>null</code>, return the locations for all source file
- * in the given stratum.
- * The returned location are in the given method.
+ * in the given stratum in the source file with the given source name. If
+ * sourceName is <code>null</code>, return the locations for all source file
+ * in the given stratum. The returned location are in the given method.
*
- * @param stratumId the stratum id.
- * @param sourceName the name of the source file.
- * @param lineNumber the number of the line.
+ * @param stratumId
+ * the stratum id.
+ * @param sourceName
+ * the name of the source file.
+ * @param lineNumber
+ * the number of the line.
* @param method
- * @throws AbsentInformationException if the specified sourceName is not valid.
+ * @throws AbsentInformationException
+ * if the specified sourceName is not valid.
*/
- public List locationsOfLine(String stratumId, String sourceName, int lineNumber, MethodImpl method) throws AbsentInformationException {
- Stratum stratum= getStratum(stratumId);
- List javaLines= new ArrayList();
+ public List locationsOfLine(String stratumId, String sourceName,
+ int lineNumber, MethodImpl method)
+ throws AbsentInformationException {
+ Stratum stratum = getStratum(stratumId);
+ List<Integer> javaLines = new ArrayList<Integer>();
if (stratum != null) {
- boolean found= false;
- for (Iterator iter = stratum.fFileInfos.iterator(); iter.hasNext() && !found;) {
- FileInfo fileInfo = (FileInfo)iter.next();
- if (sourceName == null || (found= sourceName.equals(fileInfo.fFileName))) {
- javaLines.addAll(fileInfo.getOutputLinesForLine(lineNumber));
+ boolean found = false;
+ for (Iterator<FileInfo> iter = stratum.fFileInfos.iterator(); iter.hasNext()
+ && !found;) {
+ FileInfo fileInfo = iter.next();
+ if (sourceName == null
+ || (found = sourceName.equals(fileInfo.fFileName))) {
+ javaLines
+ .addAll(fileInfo.getOutputLinesForLine(lineNumber));
}
}
if (sourceName != null && !found) {
- throw new AbsentInformationException(JDIMessages.ReferenceTypeImpl_34);
+ throw new AbsentInformationException(
+ JDIMessages.ReferenceTypeImpl_34);
}
- } else { // Java stratum
+ } else { // Java stratum
javaLines.add(new Integer(lineNumber));
}
return method.javaStratumLocationsOfLines(javaLines);
}
/**
- * Return the locations of all lines in the given source file of the given stratum which
- * are included in the given method.
- * If sourceName is <code>null</code>, return the locations for all source file
- * in the given stratum.
+ * Return the locations of all lines in the given source file of the given
+ * stratum which are included in the given method. If sourceName is
+ * <code>null</code>, return the locations for all source file in the given
+ * stratum.
*
- * @param stratumId the stratum id
- * @param sourceName the name of the source file
- * @param method
- * @param codeIndexTable the list of code indexes for the method, as get from the VM/JDWP
- * @param javaStratumLineNumberTable the list of line numbers in the java stratum for the method, as get from the VM/JDWP
+ * @param stratumId
+ * the stratum id
+ * @param sourceName
+ * the name of the source file
+ * @param method
+ * @param codeIndexTable
+ * the list of code indexes for the method, as get from the
+ * VM/JDWP
+ * @param javaStratumLineNumberTable
+ * the list of line numbers in the java stratum for the method,
+ * as get from the VM/JDWP
* @return
*/
- public List allLineLocations(String stratumId, String sourceName, MethodImpl method, long[] codeIndexTable, int[] javaStratumLineNumberTable) throws AbsentInformationException {
- Stratum stratum= getStratum(stratumId);
+ public List<LocationImpl> allLineLocations(String stratumId, String sourceName,
+ MethodImpl method, long[] codeIndexTable,
+ int[] javaStratumLineNumberTable) throws AbsentInformationException {
+ Stratum stratum = getStratum(stratumId);
if (stratum != null) {
- int[][] lineInfoTable= new int[codeIndexTable.length][];
+ int[][] lineInfoTable = new int[codeIndexTable.length][];
if (sourceName == null) {
- int lastIndex=0;
- for (int i = 0, length= javaStratumLineNumberTable.length; i < length; i++) {
- // for each executable line in the java source, get the associated lines in the stratum source
- List lineInfos= stratum.getInputLineInfos(javaStratumLineNumberTable[i]);
+ int lastIndex = 0;
+ for (int i = 0, length = javaStratumLineNumberTable.length; i < length; i++) {
+ // for each executable line in the java source, get the
+ // associated lines in the stratum source
+ List lineInfos = stratum
+ .getInputLineInfos(javaStratumLineNumberTable[i]);
if (lineInfos != null) {
- int[] lineInfo= (int[])lineInfos.get(0);
+ int[] lineInfo = (int[]) lineInfos.get(0);
if (!lineInfo.equals(lineInfoTable[lastIndex])) {
- lineInfoTable[i]= lineInfo;
- lastIndex= i;
+ lineInfoTable[i] = lineInfo;
+ lastIndex = i;
}
}
}
} else { // sourceName != null
- FileInfo fileInfo= stratum.getFileInfo(sourceName);
+ FileInfo fileInfo = stratum.getFileInfo(sourceName);
if (fileInfo == null) {
- throw new AbsentInformationException(JDIMessages.ReferenceTypeImpl_34);
+ throw new AbsentInformationException(
+ JDIMessages.ReferenceTypeImpl_34);
}
- int fileId= fileInfo.fFileId;
- int lastIndex= 0;
- for (int i = 0, length= javaStratumLineNumberTable.length; i < length; i++) {
- List lineInfos= stratum.getInputLineInfos(javaStratumLineNumberTable[i]);
+ int fileId = fileInfo.fFileId;
+ int lastIndex = 0;
+ for (int i = 0, length = javaStratumLineNumberTable.length; i < length; i++) {
+ List lineInfos = stratum
+ .getInputLineInfos(javaStratumLineNumberTable[i]);
if (lineInfos != null) {
- for (Iterator iter = lineInfos.iterator(); iter.hasNext();) {
- int[] lineInfo= (int[])iter.next();
+ for (Iterator iter = lineInfos.iterator(); iter
+ .hasNext();) {
+ int[] lineInfo = (int[]) iter.next();
if (lineInfo[0] == fileId) {
if (!lineInfo.equals(lineInfoTable[lastIndex])) {
- lineInfoTable[i]= lineInfo;
- lastIndex= i;
+ lineInfoTable[i] = lineInfo;
+ lastIndex = i;
}
break;
}
@@ -1863,24 +2053,26 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
}
}
}
- List locations= new ArrayList();
- for (int i = 0, length= lineInfoTable.length; i < length; i++) {
+ List<LocationImpl> locations = new ArrayList<LocationImpl>();
+ for (int i = 0, length = lineInfoTable.length; i < length; i++) {
if (lineInfoTable[i] != null) {
- locations.add(new LocationImpl(virtualMachineImpl(), method, codeIndexTable[i]));
+ locations.add(new LocationImpl(virtualMachineImpl(),
+ method, codeIndexTable[i]));
}
}
return locations;
}
// Java stratum
- List result = new ArrayList();
- for (int i = 0; i < codeIndexTable.length; i++) {
- result.add(new LocationImpl(virtualMachineImpl(), method, codeIndexTable[i]));
+ List<LocationImpl> result = new ArrayList<LocationImpl>();
+ for (long element : codeIndexTable) {
+ result.add(new LocationImpl(virtualMachineImpl(), method, element));
}
return result;
}
-
+
/*
* @since 3.0
+ *
* @since java 1.5
*/
public String genericSignature() {
@@ -1890,47 +2082,49 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
if (virtualMachineImpl().isJdwpVersionGreaterOrEqual(1, 5)) {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
setSignature(readString("signature", replyData)); //$NON-NLS-1$
- fGenericSignature= readString("generic signature", replyData); //$NON-NLS-1$
+ fGenericSignature = readString("generic signature", replyData); //$NON-NLS-1$
if (fGenericSignature.length() == 0) {
- fGenericSignature= null;
+ fGenericSignature = null;
}
- fGenericSignatureKnown= true;
+ fGenericSignatureKnown = true;
} catch (IOException e) {
defaultIOExceptionHandler(e);
- return null;
+ return null;
} finally {
handledJdwpRequest();
}
} else {
- fGenericSignatureKnown= true;
+ fGenericSignatureKnown = true;
}
return fGenericSignature;
}
-
+
/**
- * if genericSignature is <code>null</code>, the generic signature is set to not-known
- * (genericSignature() will ask the VM for the generic signature)
- * if genericSignature is an empty String, the generic signature is set to no-generic-signature
- * (genericSignature() will return null)
- * if genericSignature is an non-empty String, the generic signature is set to the specified value
- * (genericSignature() will return the specified value)
+ * if genericSignature is <code>null</code>, the generic signature is set to
+ * not-known (genericSignature() will ask the VM for the generic signature)
+ * if genericSignature is an empty String, the generic signature is set to
+ * no-generic-signature (genericSignature() will return null) if
+ * genericSignature is an non-empty String, the generic signature is set to
+ * the specified value (genericSignature() will return the specified value)
+ *
* @since 3.0
*/
public void setGenericSignature(String genericSignature) {
if (genericSignature == null) {
- fGenericSignature= null;
- fGenericSignatureKnown= false;
+ fGenericSignature = null;
+ fGenericSignatureKnown = false;
} else {
if (genericSignature.length() == 0) {
- fGenericSignature= null;
+ fGenericSignature = null;
} else {
- fGenericSignature= genericSignature;
+ fGenericSignature = genericSignature;
}
- fGenericSignatureKnown= true;
+ fGenericSignatureKnown = true;
}
}
@@ -1938,9 +2132,9 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
* @see com.sun.jdi.ReferenceType#instances(long)
* @since 3.3
*/
- public List instances(long maxInstances) {
+ public List<ValueImpl> instances(long maxInstances) {
try {
- int max = (int)maxInstances;
+ int max = (int) maxInstances;
if (maxInstances >= Integer.MAX_VALUE) {
max = Integer.MAX_VALUE;
}
@@ -1948,40 +2142,43 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
writeInt(max, "max instances", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_INSTANCES, outBytes);
- switch(replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_OBJECT:
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ObjectCollectedException(JDIMessages.class_or_object_not_known);
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_27);
- case JdwpReplyPacket.ILLEGAL_ARGUMENT:
- throw new IllegalArgumentException(JDIMessages.ReferenceTypeImpl_26);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_INSTANCES, outBytes);
+ switch (replyPacket.errorCode()) {
+ case JdwpReplyPacket.INVALID_OBJECT:
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ObjectCollectedException(
+ JDIMessages.class_or_object_not_known);
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_27);
+ case JdwpReplyPacket.ILLEGAL_ARGUMENT:
+ throw new IllegalArgumentException(
+ JDIMessages.ReferenceTypeImpl_26);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int elements = readInt("element count", replyData); //$NON-NLS-1$
- if(max > 0 && elements > max) {
+ if (max > 0 && elements > max) {
elements = max;
}
- ArrayList list = new ArrayList();
- for(int i = 0; i < elements; i++) {
+ ArrayList<ValueImpl> list = new ArrayList<ValueImpl>();
+ for (int i = 0; i < elements; i++) {
list.add(ValueImpl.readWithTag(this, replyData));
}
return list;
- }
- catch(IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return null;
} finally {
handledJdwpRequest();
}
}
-
+
/**
* @see com.sun.jdi.ReferenceType#majorVersion()
* @since 3.3
@@ -1991,32 +2188,34 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
getRefTypeID().write(outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_CLASS_VERSION, outBytes);
- switch(replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_CLASS:
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException(JDIMessages.class_or_object_not_known);
- case JdwpReplyPacket.ABSENT_INFORMATION:
- return 0;
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_no_class_version_support24);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_CLASS_VERSION, outBytes);
+ switch (replyPacket.errorCode()) {
+ case JdwpReplyPacket.INVALID_CLASS:
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException(
+ JDIMessages.class_or_object_not_known);
+ case JdwpReplyPacket.ABSENT_INFORMATION:
+ return 0;
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_no_class_version_support24);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
return readInt("major version", replyData); //$NON-NLS-1$
- }
- catch(IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return 0;
} finally {
handledJdwpRequest();
}
}
-
+
/**
* @see com.sun.jdi.ReferenceType#minorVersion()
* @since 3.3
@@ -2026,33 +2225,35 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
getRefTypeID().write(outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_CLASS_VERSION, outBytes);
- switch(replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_CLASS:
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException(JDIMessages.class_or_object_not_known);
- case JdwpReplyPacket.ABSENT_INFORMATION:
- return 0;
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_no_class_version_support24);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_CLASS_VERSION, outBytes);
+ switch (replyPacket.errorCode()) {
+ case JdwpReplyPacket.INVALID_CLASS:
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException(
+ JDIMessages.class_or_object_not_known);
+ case JdwpReplyPacket.ABSENT_INFORMATION:
+ return 0;
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_no_class_version_support24);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
readInt("major version", replyData); //$NON-NLS-1$
return readInt("minor version", replyData); //$NON-NLS-1$
- }
- catch(IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return 0;
} finally {
handledJdwpRequest();
- }
+ }
}
-
+
/**
* @see com.sun.jdi.ReferenceType#constantPoolCount()
* @since 3.3
@@ -2062,32 +2263,34 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
this.getRefTypeID().write(outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_CONSTANT_POOL, outBytes);
- switch(replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_CLASS:
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException(JDIMessages.class_or_object_not_known);
- case JdwpReplyPacket.ABSENT_INFORMATION:
- return 0;
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_no_constant_pool_support);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_CONSTANT_POOL, outBytes);
+ switch (replyPacket.errorCode()) {
+ case JdwpReplyPacket.INVALID_CLASS:
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException(
+ JDIMessages.class_or_object_not_known);
+ case JdwpReplyPacket.ABSENT_INFORMATION:
+ return 0;
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_no_constant_pool_support);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
return readInt("pool count", replyData); //$NON-NLS-1$
- }
- catch(IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return 0;
} finally {
handledJdwpRequest();
- }
+ }
}
-
+
/**
* @see com.sun.jdi.ReferenceType#constantPool()
* @since 3.3
@@ -2097,21 +2300,24 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
this.getRefTypeID().write(outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.RT_CONSTANT_POOL, outBytes);
- switch(replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_CLASS:
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException(JDIMessages.class_or_object_not_known);
- case JdwpReplyPacket.ABSENT_INFORMATION:
- return new byte[0];
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_no_constant_pool_support);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.RT_CONSTANT_POOL, outBytes);
+ switch (replyPacket.errorCode()) {
+ case JdwpReplyPacket.INVALID_CLASS:
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException(
+ JDIMessages.class_or_object_not_known);
+ case JdwpReplyPacket.ABSENT_INFORMATION:
+ return new byte[0];
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_no_constant_pool_support);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
readInt("pool count", replyData); //$NON-NLS-1$
int bytes = readInt("byte count", replyData); //$NON-NLS-1$
@@ -2120,12 +2326,11 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp
array[i] = readByte("byte read", replyData); //$NON-NLS-1$
}
return array;
- }
- catch(IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return null;
} finally {
handledJdwpRequest();
- }
+ }
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortTypeImpl.java
index b4aae866b..5d891598d 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortTypeImpl.java
@@ -10,35 +10,35 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.ShortType;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ShortTypeImpl extends PrimitiveTypeImpl implements ShortType {
/**
* Creates new instance.
*/
public ShortTypeImpl(VirtualMachineImpl vmImpl) {
- super("ShortType", vmImpl, "short" , "S"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("ShortType", vmImpl, "short", "S"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
/**
* @returns primitive type tag.
*/
+ @Override
public byte tag() {
return ShortValueImpl.tag;
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
- return virtualMachineImpl().mirrorOf((short)0);
+ return virtualMachineImpl().mirrorOf((short) 0);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortValueImpl.java
index a93a603dd..31aa5a70c 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ShortValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -21,10 +20,9 @@ import com.sun.jdi.ShortValue;
import com.sun.jdi.Type;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ShortValueImpl extends PrimitiveValueImpl implements ShortValue {
/** JDWP Tag. */
@@ -36,17 +34,19 @@ public class ShortValueImpl extends PrimitiveValueImpl implements ShortValue {
public ShortValueImpl(VirtualMachineImpl vmImpl, Short value) {
super("ShortValue", vmImpl, value); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return virtualMachineImpl().getShortType();
}
@@ -57,20 +57,23 @@ public class ShortValueImpl extends PrimitiveValueImpl implements ShortValue {
public short value() {
return shortValue();
}
-
+
/**
* @return Reads and returns new instance.
*/
- public static ShortValueImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ShortValueImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
short value = target.readShort("shortValue", in); //$NON-NLS-1$
return new ShortValueImpl(vmImpl, new Short(value));
}
-
+
/**
* Writes value without value tag.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
- target.writeShort(((Short)fValue).shortValue(), "shortValue", out); //$NON-NLS-1$
+ @Override
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
+ target.writeShort(((Short) fValue).shortValue(), "shortValue", out); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/SourceDebugExtensionParser.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/SourceDebugExtensionParser.java
index b84ac7a51..76aba2d45 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/SourceDebugExtensionParser.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/SourceDebugExtensionParser.java
@@ -10,55 +10,55 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.AbsentInformationException;
/**
*
*/
public class SourceDebugExtensionParser {
-
+
private static class Lexer {
-
- static final int UNKNOWN= 0;
- static final int SMAP= 1;
- static final int NON_ASTERISK_STRING= 2;
- static final int NUMBER= 3;
- static final int CR= 4;
- static final int ASTERISK_CHAR= 5;
- static final int ASTERISK_C= 6;
- static final int ASTERISK_E= 7;
- static final int ASTERISK_F= 8;
- static final int ASTERISK_L= 9;
- static final int ASTERISK_O= 10;
- static final int ASTERISK_S= 11;
- static final int ASTERISK_V= 12;
+
+ static final int UNKNOWN = 0;
+ static final int SMAP = 1;
+ static final int NON_ASTERISK_STRING = 2;
+ static final int NUMBER = 3;
+ static final int CR = 4;
+ static final int ASTERISK_CHAR = 5;
+ static final int ASTERISK_C = 6;
+ static final int ASTERISK_E = 7;
+ static final int ASTERISK_F = 8;
+ static final int ASTERISK_L = 9;
+ static final int ASTERISK_O = 10;
+ static final int ASTERISK_S = 11;
+ static final int ASTERISK_V = 12;
// never used
- //static final int WHITE_SPACE= 13;
- static final int COLON= 14;
- static final int COMMA= 15;
- static final int SHARP= 16;
- static final int PLUS= 17;
-
+ // static final int WHITE_SPACE= 13;
+ static final int COLON = 14;
+ static final int COMMA = 15;
+ static final int SHARP = 16;
+ static final int PLUS = 17;
+
private char[] fSmap;
private int fPointer;
private char fChar;
-
+
private char[] fLexem;
private int fLexemType;
-
+
private boolean fEOF;
-
- public Lexer (String smap) {
- fSmap= smap.toCharArray();
- fLexemType= UNKNOWN;
- fPointer= -1;
+
+ public Lexer(String smap) {
+ fSmap = smap.toCharArray();
+ fLexemType = UNKNOWN;
+ fPointer = -1;
nextChar();
}
-
+
/**
* Compute the next lexem.
*
@@ -66,54 +66,54 @@ public class SourceDebugExtensionParser {
*/
public int nextLexem() throws AbsentInformationException {
if (fEOF) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_0);
- }
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_0);
+ }
startWith();
return fLexemType;
}
-
private char nextChar() {
if (++fPointer == fSmap.length) {
- fEOF= true;
+ fEOF = true;
return '\000';
}
- fChar= fSmap[fPointer];
+ fChar = fSmap[fPointer];
return fChar;
}
-
- private void startWith() throws AbsentInformationException {
+
+ private void startWith() throws AbsentInformationException {
switch (fChar) {
- case '\n':
- case '\r':
- startWithCR();
- break;
- case '*':
- startWithAsterisk();
- break;
- case ':':
- fLexem= new char[] {':'};
- fLexemType= COLON;
- nextChar();
- break;
- case ',':
- fLexem= new char[] {','};
- fLexemType= COMMA;
- nextChar();
- break;
- case '#':
- fLexem= new char[] {'#'};
- fLexemType= SHARP;
- nextChar();
- break;
- case '+':
- fLexem= new char[] {'+'};
- fLexemType= PLUS;
- nextChar();
- break;
- default:
- startWithOtherChar();
- break;
+ case '\n':
+ case '\r':
+ startWithCR();
+ break;
+ case '*':
+ startWithAsterisk();
+ break;
+ case ':':
+ fLexem = new char[] { ':' };
+ fLexemType = COLON;
+ nextChar();
+ break;
+ case ',':
+ fLexem = new char[] { ',' };
+ fLexemType = COMMA;
+ nextChar();
+ break;
+ case '#':
+ fLexem = new char[] { '#' };
+ fLexemType = SHARP;
+ nextChar();
+ break;
+ case '+':
+ fLexem = new char[] { '+' };
+ fLexemType = PLUS;
+ nextChar();
+ break;
+ default:
+ startWithOtherChar();
+ break;
}
}
@@ -121,7 +121,7 @@ public class SourceDebugExtensionParser {
*
*/
private void startWithOtherChar() {
- int lexemStart= fPointer;
+ int lexemStart = fPointer;
consumeWhiteSpace();
if (fChar >= '0' && fChar <= '9') { // a number
number(lexemStart);
@@ -137,13 +137,14 @@ public class SourceDebugExtensionParser {
while (fChar != '\n' && fChar != '\r' && !fEOF) {
nextChar();
}
- int length= fPointer - lexemStart;
- fLexem= new char[length];
+ int length = fPointer - lexemStart;
+ fLexem = new char[length];
System.arraycopy(fSmap, lexemStart, fLexem, 0, length);
- if (length == 4 && fLexem[0] == 'S' && fLexem[1] == 'M' && fLexem[2] == 'A' && fLexem[3] == 'P') {
- fLexemType= SMAP;
+ if (length == 4 && fLexem[0] == 'S' && fLexem[1] == 'M'
+ && fLexem[2] == 'A' && fLexem[3] == 'P') {
+ fLexemType = SMAP;
} else {
- fLexemType= NON_ASTERISK_STRING;
+ fLexemType = NON_ASTERISK_STRING;
}
}
@@ -155,9 +156,9 @@ public class SourceDebugExtensionParser {
nextChar();
}
consumeWhiteSpace();
- fLexemType= NUMBER;
- int length= fPointer - lexemStart;
- fLexem= new char[length];
+ fLexemType = NUMBER;
+ int length = fPointer - lexemStart;
+ fLexem = new char[length];
System.arraycopy(fSmap, lexemStart, fLexem, 0, length);
}
@@ -167,35 +168,36 @@ public class SourceDebugExtensionParser {
private void startWithAsterisk() throws AbsentInformationException {
nextChar();
if (fEOF) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_0);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_0);
}
switch (fChar) {
- case 'C':
- fLexemType= ASTERISK_C;
- break;
- case 'E':
- fLexemType= ASTERISK_E;
- break;
- case 'F':
- fLexemType= ASTERISK_F;
- break;
- case 'L':
- fLexemType= ASTERISK_L;
- break;
- case 'O':
- fLexemType= ASTERISK_O;
- break;
- case 'S':
- fLexemType= ASTERISK_S;
- break;
- case 'V':
- fLexemType= ASTERISK_V;
- break;
- default:
- fLexemType= ASTERISK_CHAR;
- break;
+ case 'C':
+ fLexemType = ASTERISK_C;
+ break;
+ case 'E':
+ fLexemType = ASTERISK_E;
+ break;
+ case 'F':
+ fLexemType = ASTERISK_F;
+ break;
+ case 'L':
+ fLexemType = ASTERISK_L;
+ break;
+ case 'O':
+ fLexemType = ASTERISK_O;
+ break;
+ case 'S':
+ fLexemType = ASTERISK_S;
+ break;
+ case 'V':
+ fLexemType = ASTERISK_V;
+ break;
+ default:
+ fLexemType = ASTERISK_CHAR;
+ break;
}
- fLexem= new char[] {'*', fChar};
+ fLexem = new char[] { '*', fChar };
nextChar();
}
@@ -205,16 +207,16 @@ public class SourceDebugExtensionParser {
private void startWithCR() {
if (fChar == '\r') {
if (nextChar() == '\n') {
- fLexem= new char[] {'\r', '\n'};
+ fLexem = new char[] { '\r', '\n' };
nextChar();
} else {
- fLexem= new char[] {'\r'};
+ fLexem = new char[] { '\r' };
}
} else {
- fLexem= new char[] {fChar};
+ fLexem = new char[] { fChar };
nextChar();
}
- fLexemType= CR;
+ fLexemType = CR;
}
/**
@@ -232,52 +234,53 @@ public class SourceDebugExtensionParser {
public char[] lexem() {
return fLexem;
}
-
+
/**
* @return the type of the current lexem.
*/
public int lexemType() {
return fLexemType;
}
-
+
}
-
+
/**
* The reference type to which this source debug extension is associated.
*/
private ReferenceTypeImpl fReferenceType;
-
- private List fDefinedStrata;
-
+
+ private List<String> fDefinedStrata;
+
// parser data;
private ReferenceTypeImpl.Stratum fCurrentStratum;
private boolean fFileSectionDefinedForCurrentStratum;
private boolean fLineSectionDefinedForCurrentStratum;
private int fCurrentLineFileId;
-
- public static void parse(String smap, ReferenceTypeImpl referenceType) throws AbsentInformationException {
+ public static void parse(String smap, ReferenceTypeImpl referenceType)
+ throws AbsentInformationException {
new SourceDebugExtensionParser(referenceType).parseSmap(smap);
}
-
+
/**
* SourceDebugExtension constructor.
*/
private SourceDebugExtensionParser(ReferenceTypeImpl referenceType) {
- fReferenceType= referenceType;
- fDefinedStrata= new ArrayList();
+ fReferenceType = referenceType;
+ fDefinedStrata = new ArrayList<String>();
fDefinedStrata.add(VirtualMachineImpl.JAVA_STRATUM_NAME);
}
-
+
/**
*
*/
private void parseSmap(String smap) throws AbsentInformationException {
- Lexer lexer= new Lexer(smap);
+ Lexer lexer = new Lexer(smap);
parseHeader(lexer);
parseSections(lexer);
if (!fDefinedStrata.contains(fReferenceType.defaultStratum())) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_2);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_2);
}
}
@@ -285,19 +288,23 @@ public class SourceDebugExtensionParser {
* @param lexer
*/
private void parseHeader(Lexer lexer) throws AbsentInformationException {
- int lexemType= lexer.nextLexem();
+ int lexemType = lexer.nextLexem();
if (lexemType != Lexer.SMAP) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_3);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_3);
}
if (lexer.nextLexem() != Lexer.CR) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_4);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_4);
}
if (isAsteriskLexem(lexer.nextLexem())) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_5);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_5);
}
fReferenceType.setOutputFileName(getNonAsteriskString(lexer));
if (isAsteriskLexem(lexer.lexemType())) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_6);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_6);
}
fReferenceType.setDefaultStratumId(getNonAsteriskString(lexer));
}
@@ -314,53 +321,68 @@ public class SourceDebugExtensionParser {
/**
* @param lexer
*/
- private void parseStratumSection(Lexer lexer) throws AbsentInformationException {
+ private void parseStratumSection(Lexer lexer)
+ throws AbsentInformationException {
if (lexer.lexemType() != Lexer.ASTERISK_S) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_7);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_7);
}
if (isAsteriskLexem(lexer.nextLexem())) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_8);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_8);
}
- String stratumId= getNonAsteriskString(lexer);
+ String stratumId = getNonAsteriskString(lexer);
if (fDefinedStrata.contains(stratumId)) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_9, new String[] {stratumId}));
- }
- fCurrentStratum= new ReferenceTypeImpl.Stratum(stratumId);
- fFileSectionDefinedForCurrentStratum= false;
- fLineSectionDefinedForCurrentStratum= false;
- int lexemType= lexer.lexemType();
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_9,
+ new String[] { stratumId }));
+ }
+ fCurrentStratum = new ReferenceTypeImpl.Stratum(stratumId);
+ fFileSectionDefinedForCurrentStratum = false;
+ fLineSectionDefinedForCurrentStratum = false;
+ int lexemType = lexer.lexemType();
while (lexemType != Lexer.ASTERISK_E && lexemType != Lexer.ASTERISK_S) {
switch (lexemType) {
- case Lexer.ASTERISK_F:
- if (fFileSectionDefinedForCurrentStratum) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_10, new String[] {stratumId}));
- }
- parseFileSection(lexer);
- fFileSectionDefinedForCurrentStratum= true;
- break;
- case Lexer.ASTERISK_L:
- if (fLineSectionDefinedForCurrentStratum) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_11, new String[] {stratumId}));
- }
- parseLineSection(lexer);
- fLineSectionDefinedForCurrentStratum= true;
- break;
- case Lexer.ASTERISK_V:
- parseVendorSection(lexer);
- break;
- case Lexer.ASTERISK_CHAR:
- parseFutureSection(lexer);
- break;
- default:
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_12, new String[] {new String(lexer.lexem())}));
+ case Lexer.ASTERISK_F:
+ if (fFileSectionDefinedForCurrentStratum) {
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_10,
+ new String[] { stratumId }));
+ }
+ parseFileSection(lexer);
+ fFileSectionDefinedForCurrentStratum = true;
+ break;
+ case Lexer.ASTERISK_L:
+ if (fLineSectionDefinedForCurrentStratum) {
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_11,
+ new String[] { stratumId }));
+ }
+ parseLineSection(lexer);
+ fLineSectionDefinedForCurrentStratum = true;
+ break;
+ case Lexer.ASTERISK_V:
+ parseVendorSection(lexer);
+ break;
+ case Lexer.ASTERISK_CHAR:
+ parseFutureSection(lexer);
+ break;
+ default:
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_12,
+ new String[] { new String(lexer.lexem()) }));
}
- lexemType= lexer.lexemType();
+ lexemType = lexer.lexemType();
}
if (!fFileSectionDefinedForCurrentStratum) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_13, new String[] {stratumId}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_13,
+ new String[] { stratumId }));
}
if (!fLineSectionDefinedForCurrentStratum) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_14, new String[] {stratumId}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_14,
+ new String[] { stratumId }));
}
fDefinedStrata.add(stratumId);
fReferenceType.addStratum(fCurrentStratum);
@@ -369,9 +391,12 @@ public class SourceDebugExtensionParser {
/**
* @param lexer
*/
- private void parseFileSection(Lexer lexer) throws AbsentInformationException {
+ private void parseFileSection(Lexer lexer)
+ throws AbsentInformationException {
if (lexer.nextLexem() != Lexer.CR) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_12, new String[] {new String(lexer.lexem())}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_12,
+ new String[] { new String(lexer.lexem()) }));
}
lexer.nextLexem();
while (!isAsteriskLexem(lexer.lexemType())) {
@@ -383,38 +408,48 @@ public class SourceDebugExtensionParser {
* @param lexer
*/
private void parseFileInfo(Lexer lexer) throws AbsentInformationException {
- int lexemType= lexer.lexemType();
+ int lexemType = lexer.lexemType();
if (lexemType == Lexer.NUMBER) {
- int fileId= integerValue(lexer.lexem());
+ int fileId = integerValue(lexer.lexem());
if (isAsteriskLexem(lexer.nextLexem())) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_16);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_16);
}
fCurrentStratum.addFileInfo(fileId, getNonAsteriskString(lexer));
} else if (lexemType == Lexer.PLUS) {
if (lexer.nextLexem() != Lexer.NUMBER) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_17);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_17);
}
- int fileId= integerValue(lexer.lexem());
+ int fileId = integerValue(lexer.lexem());
if (isAsteriskLexem(lexer.nextLexem())) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_16);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_16);
}
- String fileName= getNonAsteriskString(lexer);
+ String fileName = getNonAsteriskString(lexer);
if (isAsteriskLexem(lexer.lexemType())) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_19);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_19);
}
- fCurrentStratum.addFileInfo(fileId, fileName, getNonAsteriskString(lexer));
+ fCurrentStratum.addFileInfo(fileId, fileName,
+ getNonAsteriskString(lexer));
} else {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_12, new String[] {new String(lexer.lexem())}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_12,
+ new String[] { new String(lexer.lexem()) }));
}
}
/**
* @param lexer
*/
- private void parseLineSection(Lexer lexer) throws AbsentInformationException {
- fCurrentLineFileId= 0;
+ private void parseLineSection(Lexer lexer)
+ throws AbsentInformationException {
+ fCurrentLineFileId = 0;
if (lexer.nextLexem() != Lexer.CR) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_12, new String[] {new String(lexer.lexem())}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_12,
+ new String[] { new String(lexer.lexem()) }));
}
lexer.nextLexem();
while (!isAsteriskLexem(lexer.lexemType())) {
@@ -427,58 +462,69 @@ public class SourceDebugExtensionParser {
*/
private void parseLineInfo(Lexer lexer) throws AbsentInformationException {
if (lexer.lexemType() != Lexer.NUMBER) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_22);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_22);
}
- int inputStartLine= integerValue(lexer.lexem());
- int lexemType= lexer.nextLexem();
+ int inputStartLine = integerValue(lexer.lexem());
+ int lexemType = lexer.nextLexem();
if (lexemType == Lexer.SHARP) {
if (lexer.nextLexem() != Lexer.NUMBER) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_23);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_23);
}
- fCurrentLineFileId= integerValue(lexer.lexem());
- lexemType= lexer.nextLexem();
+ fCurrentLineFileId = integerValue(lexer.lexem());
+ lexemType = lexer.nextLexem();
}
int repeatCount;
if (lexemType == Lexer.COMMA) {
if (lexer.nextLexem() != Lexer.NUMBER) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_24);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_24);
}
- repeatCount= integerValue(lexer.lexem());
- lexemType= lexer.nextLexem();
+ repeatCount = integerValue(lexer.lexem());
+ lexemType = lexer.nextLexem();
} else {
- repeatCount= 1;
+ repeatCount = 1;
}
if (lexemType != Lexer.COLON) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_25);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_25);
}
if (lexer.nextLexem() != Lexer.NUMBER) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_26);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_26);
}
- int outputStartLine= integerValue(lexer.lexem());
- lexemType= lexer.nextLexem();
+ int outputStartLine = integerValue(lexer.lexem());
+ lexemType = lexer.nextLexem();
int outputLineIncrement;
if (lexemType == Lexer.COMMA) {
if (lexer.nextLexem() != Lexer.NUMBER) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_27);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_27);
}
- outputLineIncrement= integerValue(lexer.lexem());
- lexemType= lexer.nextLexem();
+ outputLineIncrement = integerValue(lexer.lexem());
+ lexemType = lexer.nextLexem();
} else {
- outputLineIncrement= 1;
+ outputLineIncrement = 1;
}
if (lexemType != Lexer.CR) {
- throw new AbsentInformationException(JDIMessages.SourceDebugExtensionParser_28);
+ throw new AbsentInformationException(
+ JDIMessages.SourceDebugExtensionParser_28);
}
lexer.nextLexem();
- fCurrentStratum.addLineInfo(inputStartLine, fCurrentLineFileId, repeatCount, outputStartLine, outputLineIncrement);
+ fCurrentStratum.addLineInfo(inputStartLine, fCurrentLineFileId,
+ repeatCount, outputStartLine, outputLineIncrement);
}
/**
* @param lexer
*/
- private void parseVendorSection(Lexer lexer) throws AbsentInformationException {
+ private void parseVendorSection(Lexer lexer)
+ throws AbsentInformationException {
if (lexer.nextLexem() != Lexer.CR) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_12, new String[] {new String(lexer.lexem())}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_12,
+ new String[] { new String(lexer.lexem()) }));
}
lexer.nextLexem();
while (!isAsteriskLexem(lexer.lexemType())) {
@@ -490,9 +536,12 @@ public class SourceDebugExtensionParser {
/**
* @param lexer
*/
- private void parseFutureSection(Lexer lexer) throws AbsentInformationException {
+ private void parseFutureSection(Lexer lexer)
+ throws AbsentInformationException {
if (lexer.nextLexem() != Lexer.CR) {
- throw new AbsentInformationException(MessageFormat.format(JDIMessages.SourceDebugExtensionParser_12, new String[] {new String(lexer.lexem())}));
+ throw new AbsentInformationException(MessageFormat.format(
+ JDIMessages.SourceDebugExtensionParser_12,
+ new String[] { new String(lexer.lexem()) }));
}
lexer.nextLexem();
while (!isAsteriskLexem(lexer.lexemType())) {
@@ -501,51 +550,53 @@ public class SourceDebugExtensionParser {
}
}
- private String getNonAsteriskString(Lexer lexer) throws AbsentInformationException {
- StringBuffer string= new StringBuffer();
- int lexemType= lexer.lexemType();
+ private String getNonAsteriskString(Lexer lexer)
+ throws AbsentInformationException {
+ StringBuffer string = new StringBuffer();
+ int lexemType = lexer.lexemType();
while (lexemType != Lexer.CR) {
string.append(lexer.lexem());
- lexemType= lexer.nextLexem();
+ lexemType = lexer.nextLexem();
}
lexer.nextLexem();
// remove the leading white spaces
- int i= -1, length= string.length();
+ int i = -1, length = string.length();
char c;
- while (++i < length && ((c= string.charAt(i)) == ' ' || c == '\t'));
+ while (++i < length && ((c = string.charAt(i)) == ' ' || c == '\t'))
+ ;
return string.delete(0, i).toString();
}
-
+
private int integerValue(char[] lexem) {
- int i= 0;
- char c= lexem[0];
+ int i = 0;
+ char c = lexem[0];
while (c == ' ' || c == '\t') {
- c= lexem[++i];
+ c = lexem[++i];
}
- int value= 0;
+ int value = 0;
while (c >= '0' && c <= '9') {
- value= value * 10 + c - '0';
+ value = value * 10 + c - '0';
if (++i == lexem.length) {
break;
}
- c= lexem[i];
+ c = lexem[i];
}
return value;
}
private boolean isAsteriskLexem(int lexemType) {
switch (lexemType) {
- case Lexer.ASTERISK_C:
- case Lexer.ASTERISK_E:
- case Lexer.ASTERISK_F:
- case Lexer.ASTERISK_L:
- case Lexer.ASTERISK_O:
- case Lexer.ASTERISK_S:
- case Lexer.ASTERISK_V:
- case Lexer.ASTERISK_CHAR:
+ case Lexer.ASTERISK_C:
+ case Lexer.ASTERISK_E:
+ case Lexer.ASTERISK_F:
+ case Lexer.ASTERISK_L:
+ case Lexer.ASTERISK_O:
+ case Lexer.ASTERISK_S:
+ case Lexer.ASTERISK_V:
+ case Lexer.ASTERISK_CHAR:
return true;
- default:
- return false;
+ default:
+ return false;
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StackFrameImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StackFrameImpl.java
index 5420ec504..322b673c8 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StackFrameImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StackFrameImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -41,10 +40,9 @@ import com.sun.jdi.VMMismatchException;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable {
/** FrameID that corresponds to this reference. */
@@ -53,11 +51,12 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
private ThreadReferenceImpl fThread;
/** Location of the current instruction in the frame. */
private LocationImpl fLocation;
-
+
/**
* Creates new StackFrameImpl.
*/
- public StackFrameImpl(VirtualMachineImpl vmImpl, JdwpFrameID ID, ThreadReferenceImpl thread, LocationImpl location) {
+ public StackFrameImpl(VirtualMachineImpl vmImpl, JdwpFrameID ID,
+ ThreadReferenceImpl thread, LocationImpl location) {
super("StackFrame", vmImpl); //$NON-NLS-1$
fFrameID = ID;
fThread = thread;
@@ -65,40 +64,44 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
}
/**
- * @return Returns the Value of a LocalVariable in this frame.
+ * @return Returns the Value of a LocalVariable in this frame.
*/
- public Value getValue(LocalVariable variable) throws IllegalArgumentException, InvalidStackFrameException, VMMismatchException {
- ArrayList list = new ArrayList(1);
+ public Value getValue(LocalVariable variable)
+ throws IllegalArgumentException, InvalidStackFrameException,
+ VMMismatchException {
+ ArrayList<LocalVariable> list = new ArrayList<LocalVariable>(1);
list.add(variable);
- return (ValueImpl)getValues(list).get(variable);
+ return (ValueImpl) getValues(list).get(variable);
}
-
+
/**
* @return Returns the values of multiple local variables in this frame.
*/
- public Map getValues(List variables) throws IllegalArgumentException, InvalidStackFrameException, VMMismatchException {
+ public Map<LocalVariable, Value> getValues(List<LocalVariable> variables) throws IllegalArgumentException,
+ InvalidStackFrameException, VMMismatchException {
// Note that this information should not be cached.
- Map map = new HashMap(variables.size());
+ Map<LocalVariable, Value> map = new HashMap<LocalVariable, Value>(variables.size());
// if the variable list is empty, nothing to do
if (variables.isEmpty()) {
return map;
}
/*
* If 'this' is requested, we have to use a special JDWP request.
- * Therefore, we remember the positions in the list of requests for 'this'.
+ * Therefore, we remember the positions in the list of requests for
+ * 'this'.
*/
int sizeAll = variables.size();
int sizeThis = 0;
boolean[] isThisValue = new boolean[sizeAll];
for (int i = 0; i < sizeAll; i++) {
- LocalVariableImpl var = (LocalVariableImpl)variables.get(i);
+ LocalVariableImpl var = (LocalVariableImpl) variables.get(i);
isThisValue[i] = var.isThis();
if (isThisValue[i]) {
sizeThis++;
}
}
int sizeNotThis = sizeAll - sizeThis;
-
+
if (sizeThis > 0) {
Value thisValue = thisObject();
for (int i = 0; i < sizeAll; i++) {
@@ -107,12 +110,12 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
}
}
}
-
+
// If only 'this' was requested, we're finished.
if (sizeNotThis == 0) {
return map;
}
-
+
// Request values for local variables other than 'this'.
initJdwpRequest();
try {
@@ -122,23 +125,27 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
writeInt(sizeNotThis, "size", outData); //$NON-NLS-1$
for (int i = 0; i < sizeAll; i++) {
if (!isThisValue[i]) {
- LocalVariableImpl var = (LocalVariableImpl)variables.get(i);
+ LocalVariableImpl var = (LocalVariableImpl) variables
+ .get(i);
checkVM(var);
writeInt(var.slot(), "slot", outData); //$NON-NLS-1$
writeByte(var.tag(), "tag", JdwpID.tagMap(), outData); //$NON-NLS-1$
}
}
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.SF_GET_VALUES, outBytes);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.SF_GET_VALUES, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- if (nrOfElements != sizeNotThis)
- throw new InternalError(JDIMessages.StackFrameImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_1);
-
+ if (nrOfElements != sizeNotThis)
+ throw new InternalError(
+ JDIMessages.StackFrameImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_1);
+
for (int i = 0, j = 0; i < sizeAll; i++) {
if (!isThisValue[i])
- map.put(variables.get(j++), ValueImpl.readWithTag(this, replyData));
+ map.put(variables.get(j++),
+ ValueImpl.readWithTag(this, replyData));
}
return map;
} catch (IOException e) {
@@ -153,63 +160,67 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
* @see com.sun.jdi.StackFrame#getArgumentValues()
* @since 3.3
*/
- public List getArgumentValues() throws InvalidStackFrameException {
- if(!thread().isSuspended()) {
- throw new InvalidStackFrameException(JDIMessages.StackFrameImpl_no_argument_values_available);
+ public List<Value> getArgumentValues() throws InvalidStackFrameException {
+ if (!thread().isSuspended()) {
+ throw new InvalidStackFrameException(
+ JDIMessages.StackFrameImpl_no_argument_values_available);
}
try {
- List list = location().method().variables();
- ArrayList ret = new ArrayList();
+ List<LocalVariableImpl> list = location().method().variables();
+ ArrayList<Value> ret = new ArrayList<Value>();
LocalVariable var = null;
- for(Iterator iter = list.iterator(); iter.hasNext();){
- var = (LocalVariable) iter.next();
- if(var.isArgument()) {
+ for (Iterator<LocalVariableImpl> iter = list.iterator(); iter.hasNext();) {
+ var = iter.next();
+ if (var.isArgument()) {
ret.add(getValue(var));
}
}
return ret;
- }
- catch (AbsentInformationException e) {
+ } catch (AbsentInformationException e) {
JDIDebugPlugin.log(e);
return null;
}
}
-
+
/**
* @return Returns the Location of the current instruction in the frame.
*/
public Location location() {
return fLocation;
}
-
+
/**
- * Sets the Value of a LocalVariable in this frame.
+ * Sets the Value of a LocalVariable in this frame.
*/
- public void setValue(LocalVariable var, Value value) throws InvalidTypeException, ClassNotLoadedException {
+ public void setValue(LocalVariable var, Value value)
+ throws InvalidTypeException, ClassNotLoadedException {
// Note that this information should not be cached.
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
- ((ThreadReferenceImpl)thread()).write(this, outData);
+ ((ThreadReferenceImpl) thread()).write(this, outData);
write(this, outData);
- writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
+ writeInt(1, "size", outData); // We only set one field //$NON-NLS-1$
checkVM(var);
- writeInt(((LocalVariableImpl)var).slot(), "slot", outData); //$NON-NLS-1$
-
- // check the type and the vm of the value, convert the value if needed.
- ValueImpl checkedValue= ValueImpl.checkValue(value, var.type(), virtualMachineImpl());
-
+ writeInt(((LocalVariableImpl) var).slot(), "slot", outData); //$NON-NLS-1$
+
+ // check the type and the vm of the value, convert the value if
+ // needed.
+ ValueImpl checkedValue = ValueImpl.checkValue(value, var.type(),
+ virtualMachineImpl());
+
if (checkedValue != null) {
checkedValue.writeWithTag(this, outData);
} else {
ValueImpl.writeNullWithTag(this, outData);
}
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.SF_SET_VALUES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.SF_SET_VALUES, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_CLASS:
- throw new ClassNotLoadedException(var.typeName());
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new ClassNotLoadedException(var.typeName());
}
defaultReplyErrorHandler(replyPacket.errorCode());
} catch (IOException e) {
@@ -229,12 +240,14 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeWithThread(this, outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.SF_THIS_OBJECT, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.SF_THIS_OBJECT, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
- ObjectReference result = ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
+ ObjectReference result = ObjectReferenceImpl.readObjectRefWithTag(
+ this, replyData);
return result;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -250,31 +263,33 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
public ThreadReference thread() {
return fThread;
}
-
+
/**
- * @return Returns a LocalVariable that matches the given name and is visible at the current frame location.
+ * @return Returns a LocalVariable that matches the given name and is
+ * visible at the current frame location.
*/
- public LocalVariable visibleVariableByName(String name) throws AbsentInformationException {
+ public LocalVariable visibleVariableByName(String name)
+ throws AbsentInformationException {
Iterator iter = visibleVariables().iterator();
while (iter.hasNext()) {
- LocalVariableImpl var = (LocalVariableImpl)iter.next();
+ LocalVariableImpl var = (LocalVariableImpl) iter.next();
if (var.name().equals(name)) {
return var;
}
}
-
+
return null;
}
-
+
/**
- * @return Returns the values of multiple local variables in this frame.
+ * @return Returns the values of multiple local variables in this frame.
*/
public List visibleVariables() throws AbsentInformationException {
- List variables= fLocation.method().variables();
- Iterator iter = variables.iterator();
+ List<LocalVariableImpl> variables = fLocation.method().variables();
+ Iterator<LocalVariableImpl> iter = variables.iterator();
List visibleVars = new ArrayList(variables.size());
while (iter.hasNext()) {
- LocalVariableImpl var = (LocalVariableImpl)iter.next();
+ LocalVariableImpl var = iter.next();
// Only return local variables other than the this pointer.
if (var.isVisible(this) && !var.isThis()) {
visibleVars.add(var);
@@ -282,44 +297,52 @@ public class StackFrameImpl extends MirrorImpl implements StackFrame, Locatable
}
return visibleVars;
}
-
- /**
+
+ /**
* @return Returns the hash code value.
*/
+ @Override
public int hashCode() {
return fThread.hashCode() + fFrameID.hashCode();
}
-
+
/**
- * @return Returns true if two mirrors refer to the same entity in the target VM.
+ * @return Returns true if two mirrors refer to the same entity in the
+ * target VM.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
- return object != null && object.getClass().equals(this.getClass()) && fThread.equals(((StackFrameImpl)object).fThread) && fFrameID.equals(((StackFrameImpl)object).fFrameID);
+ return object != null && object.getClass().equals(this.getClass())
+ && fThread.equals(((StackFrameImpl) object).fThread)
+ && fFrameID.equals(((StackFrameImpl) object).fFrameID);
}
-
+
/**
* Writes JDWP representation.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
fFrameID.write(out);
if (target.fVerboseWriter != null) {
target.fVerboseWriter.println("stackFrame", fFrameID.value()); //$NON-NLS-1$
}
}
-
+
/**
* Writes JDWP representation.
*/
- public void writeWithThread(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void writeWithThread(MirrorImpl target, DataOutputStream out)
+ throws IOException {
fThread.write(target, out);
write(target, out);
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static StackFrameImpl readWithLocation(MirrorImpl target, ThreadReferenceImpl thread, DataInputStream in) throws IOException {
+ public static StackFrameImpl readWithLocation(MirrorImpl target,
+ ThreadReferenceImpl thread, DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpFrameID ID = new JdwpFrameID(vmImpl);
ID.read(in);
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StringReferenceImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StringReferenceImpl.java
index 068ecb4eb..fa2693ed9 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StringReferenceImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/StringReferenceImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -23,12 +22,12 @@ import com.sun.jdi.ObjectCollectedException;
import com.sun.jdi.StringReference;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class StringReferenceImpl extends ObjectReferenceImpl implements StringReference {
+public class StringReferenceImpl extends ObjectReferenceImpl implements
+ StringReference {
/** JDWP Tag. */
public static final byte tag = JdwpID.STRING_TAG;
@@ -42,20 +41,22 @@ public class StringReferenceImpl extends ObjectReferenceImpl implements StringRe
/**
* @returns Value tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
- * @returns Returns the StringReference as a String.
+ * @returns Returns the StringReference as a String.
*/
public String value() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.SR_VALUE, this);
+ JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.SR_VALUE,
+ this);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
String result = readString("value", replyData); //$NON-NLS-1$
return result;
@@ -66,11 +67,12 @@ public class StringReferenceImpl extends ObjectReferenceImpl implements StringRe
handledJdwpRequest();
}
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static StringReferenceImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static StringReferenceImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpStringID ID = new JdwpStringID(vmImpl);
ID.read(in);
@@ -83,15 +85,17 @@ public class StringReferenceImpl extends ObjectReferenceImpl implements StringRe
StringReferenceImpl mirror = new StringReferenceImpl(vmImpl, ID);
return mirror;
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
try {
return "\"" + value() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
} catch (ObjectCollectedException e) {
- return JDIMessages.StringReferenceImpl__Garbage_Collected__StringReference__3 + idString();
+ return JDIMessages.StringReferenceImpl__Garbage_Collected__StringReference__3
+ + idString();
} catch (Exception e) {
return fDescription;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadGroupReferenceImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadGroupReferenceImpl.java
index fa37dd82e..06f17cfb5 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadGroupReferenceImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadGroupReferenceImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
@@ -25,12 +24,12 @@ import org.eclipse.jdi.internal.jdwp.JdwpThreadGroupID;
import com.sun.jdi.ThreadGroupReference;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements ThreadGroupReference {
+public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements
+ ThreadGroupReference {
/** JDWP Tag. */
public static final byte tag = JdwpID.THREAD_GROUP_TAG;
/**
@@ -39,25 +38,29 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
*/
private String fName;
/**
- * The cached parent of this thread group. Once set, this value cannot be changed
+ * The cached parent of this thread group. Once set, this value cannot be
+ * changed
*/
- private ThreadGroupReference fParent= fgUnsetParent;
- private static ThreadGroupReferenceImpl fgUnsetParent= new ThreadGroupReferenceImpl(null, null);
-
+ private ThreadGroupReference fParent = fgUnsetParent;
+ private static ThreadGroupReferenceImpl fgUnsetParent = new ThreadGroupReferenceImpl(
+ null, null);
+
/**
* Creates new ThreadGroupReferenceImpl.
*/
- public ThreadGroupReferenceImpl(VirtualMachineImpl vmImpl, JdwpThreadGroupID threadGroupID) {
+ public ThreadGroupReferenceImpl(VirtualMachineImpl vmImpl,
+ JdwpThreadGroupID threadGroupID) {
super("ThreadGroupReference", vmImpl, threadGroupID); //$NON-NLS-1$
}
/**
* @returns Value tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
* @return Returns the name of this thread group.
*/
@@ -67,10 +70,11 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
}
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TGR_NAME, this);
+ JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TGR_NAME,
+ this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- fName= readString("name", replyData); //$NON-NLS-1$
+ fName = readString("name", replyData); //$NON-NLS-1$
return fName;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -79,7 +83,7 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
handledJdwpRequest();
}
}
-
+
/**
* @return Returns the parent of this thread group., or null if there isn't.
*/
@@ -89,10 +93,11 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
}
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TGR_PARENT, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TGR_PARENT, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- fParent= ThreadGroupReferenceImpl.read(this, replyData);
+ fParent = ThreadGroupReferenceImpl.read(this, replyData);
return fParent;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -101,56 +106,60 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
handledJdwpRequest();
}
}
-
+
/**
* Resumes all threads in this thread group (including subgroups).
*/
public void resume() {
- Iterator iter = allThreads().iterator();
+ Iterator<ThreadReferenceImpl> iter = allThreads().iterator();
while (iter.hasNext()) {
- ThreadReferenceImpl thr = (ThreadReferenceImpl)iter.next();
+ ThreadReferenceImpl thr = iter.next();
thr.resume();
}
}
-
+
/**
* Suspends all threads in this thread group (including subgroups).
*/
- public void suspend() {
- Iterator iter = allThreads().iterator();
+ public void suspend() {
+ Iterator<ThreadReferenceImpl> iter = allThreads().iterator();
while (iter.hasNext()) {
- ThreadReferenceImpl thr = (ThreadReferenceImpl)iter.next();
+ ThreadReferenceImpl thr = iter.next();
thr.suspend();
}
}
-
- /**
+
+ /**
* Inner class used to return children info.
*/
private class ChildrenInfo {
- List childThreads;
- List childThreadGroups;
+ List<ThreadReferenceImpl> childThreads;
+ List<ThreadGroupReferenceImpl> childThreadGroups;
}
-
+
/**
- * @return Returns a List containing each ThreadReference in this thread group.
+ * @return Returns a List containing each ThreadReference in this thread
+ * group.
*/
public ChildrenInfo childrenInfo() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TGR_CHILDREN, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TGR_CHILDREN, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
ChildrenInfo result = new ChildrenInfo();
int nrThreads = readInt("nr threads", replyData); //$NON-NLS-1$
- result.childThreads = new ArrayList(nrThreads);
+ result.childThreads = new ArrayList<ThreadReferenceImpl>(nrThreads);
for (int i = 0; i < nrThreads; i++)
- result.childThreads.add(ThreadReferenceImpl.read(this, replyData));
+ result.childThreads.add(ThreadReferenceImpl.read(this,
+ replyData));
int nrThreadGroups = readInt("nr thread groups", replyData); //$NON-NLS-1$
- result.childThreadGroups = new ArrayList(nrThreadGroups);
+ result.childThreadGroups = new ArrayList<ThreadGroupReferenceImpl>(nrThreadGroups);
for (int i = 0; i < nrThreadGroups; i++)
- result.childThreadGroups.add(ThreadGroupReferenceImpl.read(this, replyData));
+ result.childThreadGroups.add(ThreadGroupReferenceImpl.read(
+ this, replyData));
return result;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -161,37 +170,41 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
}
/**
- * @return Returns a List containing each ThreadGroupReference in this thread group.
+ * @return Returns a List containing each ThreadGroupReference in this
+ * thread group.
*/
- public List threadGroups() {
+ public List<ThreadGroupReferenceImpl> threadGroups() {
return childrenInfo().childThreadGroups;
}
-
+
/**
- * @return Returns a List containing each ThreadReference in this thread group.
+ * @return Returns a List containing each ThreadReference in this thread
+ * group.
*/
- public List threads() {
+ public List<ThreadReferenceImpl> threads() {
return childrenInfo().childThreads;
}
-
+
/**
- * @return Returns a List containing each ThreadGroupReference in this thread group and all of
- * its subgroups.
+ * @return Returns a List containing each ThreadGroupReference in this
+ * thread group and all of its subgroups.
*/
- private List allThreads() {
+ private List<ThreadReferenceImpl> allThreads() {
ChildrenInfo info = childrenInfo();
- List result = info.childThreads;
- Iterator iter = info.childThreadGroups.iterator();
+ List<ThreadReferenceImpl> result = info.childThreads;
+ Iterator<ThreadGroupReferenceImpl> iter = info.childThreadGroups.iterator();
while (iter.hasNext()) {
- ThreadGroupReferenceImpl tg = (ThreadGroupReferenceImpl)iter.next();
+ ThreadGroupReferenceImpl tg = iter
+ .next();
result.addAll(tg.allThreads());
}
return result;
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
try {
return name();
@@ -203,7 +216,8 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ThreadGroupReferenceImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ThreadGroupReferenceImpl read(MirrorImpl target,
+ DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpThreadGroupID ID = new JdwpThreadGroupID(vmImpl);
ID.read(in);
@@ -212,8 +226,9 @@ public class ThreadGroupReferenceImpl extends ObjectReferenceImpl implements Thr
if (ID.isNull())
return null;
-
- ThreadGroupReferenceImpl mirror = (ThreadGroupReferenceImpl)vmImpl.getCachedMirror(ID);
+
+ ThreadGroupReferenceImpl mirror = (ThreadGroupReferenceImpl) vmImpl
+ .getCachedMirror(ID);
if (mirror == null) {
mirror = new ThreadGroupReferenceImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadReferenceImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadReferenceImpl.java
index f8560fd00..235197a99 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadReferenceImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ThreadReferenceImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -43,14 +42,13 @@ import com.sun.jdi.VMCannotBeModifiedException;
import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.Value;
-
/**
- * This class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * This class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadReference, org.eclipse.jdi.hcr.ThreadReference {
+public class ThreadReferenceImpl extends ObjectReferenceImpl implements
+ ThreadReference, org.eclipse.jdi.hcr.ThreadReference {
/** ThreadStatus Constants. */
public static final int JDWP_THREAD_STATUS_ZOMBIE = 0;
public static final int JDWP_THREAD_STATUS_RUNNING = 1;
@@ -60,9 +58,9 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
/** SuspendStatus Constants. */
public static final int SUSPEND_STATUS_SUSPENDED = 0x01;
-
+
/** Mapping of command codes to strings. */
- private static Map fgThreadStatusMap = null;
+ private static Map<Integer, String> fgThreadStatusMap = null;
/** Map with Strings for flag bits. */
private static String[] fgSuspendStatusStrings = null;
@@ -72,7 +70,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
/** Is thread currently at a breakpoint? */
private boolean fIsAtBreakpoint = false;
-
+
/**
* The cached thread group. A thread's thread group cannot be changed.
*/
@@ -91,7 +89,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
public void setIsAtBreakpoint() {
fIsAtBreakpoint = true;
}
-
+
/**
* Reset flags that can be set when event occurs.
*/
@@ -102,31 +100,37 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
/**
* @returns Value tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
- * @returns Returns an ObjectReference for the monitor, if any, for which this thread is currently waiting.
+ * @returns Returns an ObjectReference for the monitor, if any, for which
+ * this thread is currently waiting.
*/
- public ObjectReference currentContendedMonitor() throws IncompatibleThreadStateException {
+ public ObjectReference currentContendedMonitor()
+ throws IncompatibleThreadStateException {
if (!virtualMachine().canGetCurrentContendedMonitor()) {
throw new UnsupportedOperationException();
}
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException(JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException(
+ JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
- ObjectReference result = ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
+ ObjectReference result = ObjectReferenceImpl.readObjectRefWithTag(
+ this, replyData);
return result;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -135,62 +139,72 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
* @see com.sun.jdi.ThreadReference#forceEarlyReturn(com.sun.jdi.Value)
* @since 3.3
*/
- public void forceEarlyReturn(Value value) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException {
- if(!virtualMachineImpl().canBeModified()) {
- throw new VMCannotBeModifiedException(JDIMessages.ThreadReferenceImpl_vm_read_only);
+ public void forceEarlyReturn(Value value) throws InvalidTypeException,
+ ClassNotLoadedException, IncompatibleThreadStateException {
+ if (!virtualMachineImpl().canBeModified()) {
+ throw new VMCannotBeModifiedException(
+ JDIMessages.ThreadReferenceImpl_vm_read_only);
}
initJdwpRequest();
ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream();
DataOutputStream dataOutStream = new DataOutputStream(byteOutStream);
try {
write(this, dataOutStream);
- if (value != null){
- ((ValueImpl)value).writeWithTag((ValueImpl)value, dataOutStream);
+ if (value != null) {
+ ((ValueImpl) value).writeWithTag((ValueImpl) value,
+ dataOutStream);
} else {
ValueImpl.writeNullWithTag(this, dataOutStream);
}
- JdwpReplyPacket reply = requestVM(JdwpCommandPacket.TR_FORCE_EARLY_RETURN, byteOutStream);
- switch(reply.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException(JDIMessages.ThreadReferenceImpl_thread_object_invalid);
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ClassNotLoadedException(JDIMessages.ThreadReferenceImpl_thread_or_value_unknown);
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- case JdwpReplyPacket.THREAD_NOT_ALIVE:
- throw new IncompatibleThreadStateException(JDIMessages.ThreadReferenceImpl_thread_not_suspended);
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ThreadReferenceImpl_no_force_early_return_on_threads);
- case JdwpReplyPacket.OPAQUE_FRAME:
- throw new NativeMethodException(JDIMessages.ThreadReferenceImpl_thread_cannot_force_native_method);
- case JdwpReplyPacket.NO_MORE_FRAMES:
- throw new InvalidStackFrameException(JDIMessages.ThreadReferenceImpl_thread_no_stackframes);
- case JdwpReplyPacket.TYPE_MISMATCH:
- throw new InvalidTypeException(JDIMessages.ThreadReferenceImpl_incapatible_return_type);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+ JdwpReplyPacket reply = requestVM(
+ JdwpCommandPacket.TR_FORCE_EARLY_RETURN, byteOutStream);
+ switch (reply.errorCode()) {
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException(
+ JDIMessages.ThreadReferenceImpl_thread_object_invalid);
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ClassNotLoadedException(
+ JDIMessages.ThreadReferenceImpl_thread_or_value_unknown);
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ case JdwpReplyPacket.THREAD_NOT_ALIVE:
+ throw new IncompatibleThreadStateException(
+ JDIMessages.ThreadReferenceImpl_thread_not_suspended);
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ThreadReferenceImpl_no_force_early_return_on_threads);
+ case JdwpReplyPacket.OPAQUE_FRAME:
+ throw new NativeMethodException(
+ JDIMessages.ThreadReferenceImpl_thread_cannot_force_native_method);
+ case JdwpReplyPacket.NO_MORE_FRAMES:
+ throw new InvalidStackFrameException(
+ JDIMessages.ThreadReferenceImpl_thread_no_stackframes);
+ case JdwpReplyPacket.TYPE_MISMATCH:
+ throw new InvalidTypeException(
+ JDIMessages.ThreadReferenceImpl_incapatible_return_type);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(reply.errorCode());
- }
- catch (IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
- }
- finally {
+ } finally {
handledJdwpRequest();
}
}
-
+
/**
- * @returns Returns the StackFrame at the given index in the thread's current call stack.
+ * @returns Returns the StackFrame at the given index in the thread's
+ * current call stack.
*/
public StackFrame frame(int index) throws IncompatibleThreadStateException {
- return (StackFrameImpl)frames(index, 1).get(0);
+ return frames(index, 1).get(0);
}
-
+
/**
* @see com.sun.jdi.ThreadReference#frameCount()
*/
@@ -198,15 +212,17 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_FRAME_COUNT, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_FRAME_COUNT, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException(JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException(
+ JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int result = readInt("frame count", replyData); //$NON-NLS-1$
return result;
@@ -217,18 +233,21 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
- * @returns Returns a List containing each StackFrame in the thread's current call stack.
+ * @returns Returns a List containing each StackFrame in the thread's
+ * current call stack.
*/
- public List frames() throws IncompatibleThreadStateException {
+ public List<StackFrameImpl> frames() throws IncompatibleThreadStateException {
return frames(0, -1);
}
-
+
/**
- * @returns Returns a List containing each StackFrame in the thread's current call stack.
+ * @returns Returns a List containing each StackFrame in the thread's
+ * current call stack.
*/
- public List frames(int start, int length) throws IndexOutOfBoundsException, IncompatibleThreadStateException {
+ public List<StackFrameImpl> frames(int start, int length) throws IndexOutOfBoundsException,
+ IncompatibleThreadStateException {
// Note that this information should not be cached.
initJdwpRequest();
try {
@@ -237,23 +256,27 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
write(this, outData);
writeInt(start, "start", outData); //$NON-NLS-1$
writeInt(length, "length", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_FRAMES, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_FRAMES, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException(JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
- case JdwpReplyPacket.INVALID_INDEX:
- throw new IndexOutOfBoundsException(JDIMessages.ThreadReferenceImpl_Invalid_index_of_stack_frames_given_4);
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException(
+ JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
+ case JdwpReplyPacket.INVALID_INDEX:
+ throw new IndexOutOfBoundsException(
+ JDIMessages.ThreadReferenceImpl_Invalid_index_of_stack_frames_given_4);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- List frames = new ArrayList(nrOfElements);
+ List<StackFrameImpl> frames = new ArrayList<StackFrameImpl>(nrOfElements);
for (int i = 0; i < nrOfElements; i++) {
- StackFrameImpl frame = StackFrameImpl.readWithLocation(this, this, replyData);
+ StackFrameImpl frame = StackFrameImpl.readWithLocation(this,
+ this, replyData);
if (frame == null) {
continue;
}
@@ -270,6 +293,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
/**
* Interrupts this thread
+ *
* @see com.sun.jdi.ThreadReference#interrupt()
*/
public void interrupt() {
@@ -290,22 +314,25 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
}
/**
- * @return Returns whether the thread has been suspended by the the debugger.
+ * @return Returns whether the thread has been suspended by the the
+ * debugger.
*/
public boolean isSuspended() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_STATUS, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_STATUS, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- //remove the thread status reply
+ // remove the thread status reply
readInt("thread status", threadStatusMap(), replyData); //$NON-NLS-1$
- int suspendStatus = readInt("suspend status", suspendStatusStrings(), replyData); //$NON-NLS-1$
+ int suspendStatus = readInt(
+ "suspend status", suspendStatusStrings(), replyData); //$NON-NLS-1$
boolean result = suspendStatus == SUSPEND_STATUS_SUSPENDED;
return result;
} catch (IOException e) {
@@ -322,10 +349,11 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
public String name() {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_NAME, this);
+ JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_NAME,
+ this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
@@ -337,31 +365,35 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
- * @return Returns a List containing an ObjectReference for each monitor owned by the thread.
+ * @return Returns a List containing an ObjectReference for each monitor
+ * owned by the thread.
*/
- public List ownedMonitors() throws IncompatibleThreadStateException {
+ public List<ObjectReferenceImpl> ownedMonitors() throws IncompatibleThreadStateException {
if (!virtualMachine().canGetOwnedMonitorInfo()) {
throw new UnsupportedOperationException();
}
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_OWNED_MONITORS, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_OWNED_MONITORS, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException(JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_5);
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException(
+ JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_5);
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
-
+
int nrOfMonitors = readInt("nr of monitors", replyData); //$NON-NLS-1$
- List result = new ArrayList(nrOfMonitors);
+ List<ObjectReferenceImpl> result = new ArrayList<ObjectReferenceImpl>(nrOfMonitors);
for (int i = 0; i < nrOfMonitors; i++) {
- result.add(ObjectReferenceImpl.readObjectRefWithTag(this, replyData));
+ result.add(ObjectReferenceImpl.readObjectRefWithTag(this,
+ replyData));
}
return result;
} catch (IOException e) {
@@ -376,58 +408,62 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
* @see com.sun.jdi.ThreadReference#ownedMonitorsAndFrames()
* @since 3.3
*/
- public List ownedMonitorsAndFrames() throws IncompatibleThreadStateException {
+ public List<MonitorInfoImpl> ownedMonitorsAndFrames()
+ throws IncompatibleThreadStateException {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_OWNED_MONITOR_STACK_DEPTH, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_OWNED_MONITOR_STACK_DEPTH, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException(JDIMessages.ThreadReferenceImpl_thread_object_invalid);
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException(JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_5);
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ThreadReferenceImpl_no_force_early_return_on_threads);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+ case JdwpReplyPacket.INVALID_THREAD:
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException(
+ JDIMessages.ThreadReferenceImpl_thread_object_invalid);
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException(
+ JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_5);
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ThreadReferenceImpl_no_force_early_return_on_threads);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
-
+
int owned = readInt("owned monitors", replyData); //$NON-NLS-1$
- List result = new ArrayList(owned);
+ List<MonitorInfoImpl> result = new ArrayList<MonitorInfoImpl>(owned);
ObjectReference monitor = null;
int depth = -1;
for (int i = 0; i < owned; i++) {
- monitor = ObjectReferenceImpl.readObjectRefWithTag(this, replyData);
+ monitor = ObjectReferenceImpl.readObjectRefWithTag(this,
+ replyData);
depth = readInt("stack depth", replyData); //$NON-NLS-1$
- result.add(new MonitorInfoImpl(this,
- depth,
- monitor,
+ result.add(new MonitorInfoImpl(this, depth, monitor,
virtualMachineImpl()));
}
return result;
- }
- catch (IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return null;
- }
- finally {
+ } finally {
handledJdwpRequest();
}
}
-
+
/**
* Resumes this thread.
- * @see com.sun.jdi.ThreadReference#resume()
+ *
+ * @see com.sun.jdi.ThreadReference#resume()
*/
public void resume() {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_RESUME, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_RESUME, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
resetEventFlags();
@@ -435,7 +471,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
* @return Returns the thread's status.
*/
@@ -443,32 +479,36 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_STATUS, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_STATUS, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.ABSENT_INFORMATION:
- return THREAD_STATUS_UNKNOWN;
- case JdwpReplyPacket.INVALID_THREAD:
- return THREAD_STATUS_NOT_STARTED;
+ case JdwpReplyPacket.ABSENT_INFORMATION:
+ return THREAD_STATUS_UNKNOWN;
+ case JdwpReplyPacket.INVALID_THREAD:
+ return THREAD_STATUS_NOT_STARTED;
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- int threadStatus = readInt("thread status", threadStatusMap(), replyData); //$NON-NLS-1$
+ int threadStatus = readInt(
+ "thread status", threadStatusMap(), replyData); //$NON-NLS-1$
readInt("suspend status", suspendStatusStrings(), replyData); //$NON-NLS-1$
switch (threadStatus) {
- case JDWP_THREAD_STATUS_ZOMBIE:
- return THREAD_STATUS_ZOMBIE;
- case JDWP_THREAD_STATUS_RUNNING:
- return THREAD_STATUS_RUNNING;
- case JDWP_THREAD_STATUS_SLEEPING:
- return THREAD_STATUS_SLEEPING;
- case JDWP_THREAD_STATUS_MONITOR:
- return THREAD_STATUS_MONITOR;
- case JDWP_THREAD_STATUS_WAIT:
- return THREAD_STATUS_WAIT;
- case -1: // see bug 30816
- return THREAD_STATUS_UNKNOWN;
+ case JDWP_THREAD_STATUS_ZOMBIE:
+ return THREAD_STATUS_ZOMBIE;
+ case JDWP_THREAD_STATUS_RUNNING:
+ return THREAD_STATUS_RUNNING;
+ case JDWP_THREAD_STATUS_SLEEPING:
+ return THREAD_STATUS_SLEEPING;
+ case JDWP_THREAD_STATUS_MONITOR:
+ return THREAD_STATUS_MONITOR;
+ case JDWP_THREAD_STATUS_WAIT:
+ return THREAD_STATUS_WAIT;
+ case -1: // see bug 30816
+ return THREAD_STATUS_UNKNOWN;
}
- throw new InternalException(JDIMessages.ThreadReferenceImpl_Unknown_thread_status_received___6 + threadStatus);
+ throw new InternalException(
+ JDIMessages.ThreadReferenceImpl_Unknown_thread_status_received___6
+ + threadStatus);
} catch (IOException e) {
defaultIOExceptionHandler(e);
return 0;
@@ -476,28 +516,31 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
* Stops this thread with an asynchronous exception.
- * @see com.sun.jdi.ThreadReference#stop(com.sun.jdi.ObjectReference)
+ *
+ * @see com.sun.jdi.ThreadReference#stop(com.sun.jdi.ObjectReference)
*/
public void stop(ObjectReference throwable) throws InvalidTypeException {
checkVM(throwable);
ObjectReferenceImpl throwableImpl = (ObjectReferenceImpl) throwable;
-
+
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
throwableImpl.write(this, outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_STOP, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_STOP,
+ outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
- case JdwpReplyPacket.INVALID_CLASS:
- throw new InvalidTypeException (JDIMessages.ThreadReferenceImpl_Stop_argument_not_an_instance_of_java_lang_Throwable_in_the_target_VM_7);
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_CLASS:
+ throw new InvalidTypeException(
+ JDIMessages.ThreadReferenceImpl_Stop_argument_not_an_instance_of_java_lang_Throwable_in_the_target_VM_7);
}
defaultReplyErrorHandler(replyPacket.errorCode());
} catch (IOException e) {
@@ -506,18 +549,20 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
* Suspends this thread.
- * @see com.sun.jdi.ThreadReference#suspend()
+ *
+ * @see com.sun.jdi.ThreadReference#suspend()
*/
public void suspend() {
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_SUSPEND, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_SUSPEND, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
} finally {
@@ -526,13 +571,14 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
}
/**
- * @return Returns the number of pending suspends for this thread.
+ * @return Returns the number of pending suspends for this thread.
*/
public int suspendCount() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_SUSPEND_COUNT, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_SUSPEND_COUNT, this);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
int result = readInt("suspend count", replyData); //$NON-NLS-1$
@@ -544,7 +590,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
* @return Returns this thread's thread group.
*/
@@ -554,14 +600,15 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
}
initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_THREAD_GROUP, this);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.TR_THREAD_GROUP, this);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
- fThreadGroup= ThreadGroupReferenceImpl.read(this, replyData);
+ fThreadGroup = ThreadGroupReferenceImpl.read(this, replyData);
return fThreadGroup;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -570,25 +617,33 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
- * Simulate the execution of a return instruction instead of executing the next bytecode in a method.
- * @return Returns whether any finally or synchronized blocks are enclosing the current instruction.
+ * Simulate the execution of a return instruction instead of executing the
+ * next bytecode in a method.
+ *
+ * @return Returns whether any finally or synchronized blocks are enclosing
+ * the current instruction.
*/
- public boolean doReturn(Value returnValue, boolean triggerFinallyAndSynchronized) throws org.eclipse.jdi.hcr.OperationRefusedException {
+ public boolean doReturn(Value returnValue,
+ boolean triggerFinallyAndSynchronized)
+ throws org.eclipse.jdi.hcr.OperationRefusedException {
virtualMachineImpl().checkHCRSupported();
ValueImpl valueImpl;
- if (returnValue != null) { // null is used if no value is returned.
+ if (returnValue != null) { // null is used if no value is returned.
checkVM(returnValue);
- valueImpl = (ValueImpl)returnValue;
+ valueImpl = (ValueImpl) returnValue;
} else {
try {
- TypeImpl returnType = (TypeImpl)frame(0).location().method().returnType();
- valueImpl = (ValueImpl)returnType.createNullValue();
+ TypeImpl returnType = (TypeImpl) frame(0).location().method()
+ .returnType();
+ valueImpl = (ValueImpl) returnType.createNullValue();
} catch (IncompatibleThreadStateException e) {
- throw new org.eclipse.jdi.hcr.OperationRefusedException(e.toString());
+ throw new org.eclipse.jdi.hcr.OperationRefusedException(
+ e.toString());
} catch (ClassNotLoadedException e) {
- throw new org.eclipse.jdi.hcr.OperationRefusedException(e.toString());
+ throw new org.eclipse.jdi.hcr.OperationRefusedException(
+ e.toString());
}
}
@@ -599,15 +654,17 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
DataOutputStream outData = new DataOutputStream(outBytes);
write(this, outData);
valueImpl.writeWithTag(this, outData);
- writeBoolean(triggerFinallyAndSynchronized, "trigger finaly+sync", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.HCR_DO_RETURN, outBytes);
+ writeBoolean(triggerFinallyAndSynchronized,
+ "trigger finaly+sync", outData); //$NON-NLS-1$
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.HCR_DO_RETURN, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new ObjectCollectedException();
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new ObjectCollectedException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
boolean result = readBoolean("is enclosed", replyData); //$NON-NLS-1$
return result;
@@ -618,15 +675,19 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
handledJdwpRequest();
}
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
try {
- return MessageFormat.format(JDIMessages.ThreadReferenceImpl_8, new String[]{type().toString(), name(), getObjectID().toString()});
+ return MessageFormat.format(JDIMessages.ThreadReferenceImpl_8,
+ new String[] { type().toString(), name(),
+ getObjectID().toString() });
} catch (ObjectCollectedException e) {
- return JDIMessages.ThreadReferenceImpl__Garbage_Collected__ThreadReference__9 + idString();
+ return JDIMessages.ThreadReferenceImpl__Garbage_Collected__ThreadReference__9
+ + idString();
} catch (Exception e) {
return fDescription;
}
@@ -635,7 +696,8 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ThreadReferenceImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ThreadReferenceImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
JdwpThreadID ID = new JdwpThreadID(vmImpl);
ID.read(in);
@@ -644,14 +706,15 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
if (ID.isNull())
return null;
-
- ThreadReferenceImpl mirror = (ThreadReferenceImpl)vmImpl.getCachedMirror(ID);
+
+ ThreadReferenceImpl mirror = (ThreadReferenceImpl) vmImpl
+ .getCachedMirror(ID);
if (mirror == null) {
mirror = new ThreadReferenceImpl(vmImpl, ID);
vmImpl.addCachedMirror(mirror);
}
return mirror;
- }
+ }
/**
* Retrieves constant mappings.
@@ -660,16 +723,17 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
if (fgThreadStatusMap != null) {
return;
}
-
+
Field[] fields = ThreadReferenceImpl.class.getDeclaredFields();
- fgThreadStatusMap = new HashMap();
+ fgThreadStatusMap = new HashMap<Integer, String>();
fgSuspendStatusStrings = new String[32]; // Int
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0)
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0)
continue;
-
+
try {
String name = field.getName();
int value = field.getInt(null);
@@ -682,7 +746,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
name = name.substring(15);
for (int j = 0; j < fgSuspendStatusStrings.length; j++) {
if ((1 << j & value) != 0) {
- fgSuspendStatusStrings[j]= name;
+ fgSuspendStatusStrings[j] = name;
break;
}
}
@@ -696,54 +760,59 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl implements ThreadRe
}
}
}
-
+
/**
* @return Returns a map with string representations of tags.
*/
- public static Map threadStatusMap() {
- getConstantMaps();
- return fgThreadStatusMap;
- }
+ public static Map<Integer, String> threadStatusMap() {
+ getConstantMaps();
+ return fgThreadStatusMap;
+ }
/**
* @return Returns a map with string representations of tags.
*/
- public static String[] suspendStatusStrings() {
- getConstantMaps();
- return fgSuspendStatusStrings;
- }
+ public static String[] suspendStatusStrings() {
+ getConstantMaps();
+ return fgSuspendStatusStrings;
+ }
/**
* @see ThreadReference#popFrames(StackFrame)
*/
- public void popFrames(StackFrame frameToPop) throws IncompatibleThreadStateException {
+ public void popFrames(StackFrame frameToPop)
+ throws IncompatibleThreadStateException {
if (!isSuspended()) {
throw new IncompatibleThreadStateException();
}
if (!virtualMachineImpl().canPopFrames()) {
throw new UnsupportedOperationException();
}
-
+
StackFrameImpl frame = (StackFrameImpl) frameToPop;
-
+
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
frame.writeWithThread(frame, outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.SF_POP_FRAME, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.SF_POP_FRAME, outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_THREAD:
- throw new InvalidStackFrameException();
- case JdwpReplyPacket.INVALID_FRAMEID:
- throw new InvalidStackFrameException(JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame_from_the_call_stack__Reasons_include__The_frame_id_was_invalid__The_thread_was_resumed__10);
- case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
- throw new IncompatibleThreadStateException(JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame__The_requested_stack_frame_is_not_suspended_11);
- case JdwpReplyPacket.NO_MORE_FRAMES:
- throw new InvalidStackFrameException(JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame_from_the_call_stack__Reasons_include__The_requested_frame_was_the_last_frame_on_the_call_stack__The_requested_frame_was_the_last_frame_above_a_native_frame__12);
- default:
- defaultReplyErrorHandler(replyPacket.errorCode());
+ case JdwpReplyPacket.INVALID_THREAD:
+ throw new InvalidStackFrameException();
+ case JdwpReplyPacket.INVALID_FRAMEID:
+ throw new InvalidStackFrameException(
+ JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame_from_the_call_stack__Reasons_include__The_frame_id_was_invalid__The_thread_was_resumed__10);
+ case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
+ throw new IncompatibleThreadStateException(
+ JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame__The_requested_stack_frame_is_not_suspended_11);
+ case JdwpReplyPacket.NO_MORE_FRAMES:
+ throw new InvalidStackFrameException(
+ JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame_from_the_call_stack__Reasons_include__The_requested_frame_was_the_last_frame_on_the_call_stack__The_requested_frame_was_the_last_frame_above_a_native_frame__12);
+ default:
+ defaultReplyErrorHandler(replyPacket.errorCode());
}
} catch (IOException ioe) {
defaultIOExceptionHandler(ioe);
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeComponentImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeComponentImpl.java
index 6fc3827c9..d59cd7e8f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeComponentImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeComponentImpl.java
@@ -10,17 +10,16 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.ReferenceType;
import com.sun.jdi.TypeComponent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public abstract class TypeComponentImpl extends AccessibleImpl implements TypeComponent {
+public abstract class TypeComponentImpl extends AccessibleImpl implements
+ TypeComponent {
/** Text representation of this type. */
private String fName = null;
/** JNI-style signature for this type. */
@@ -35,12 +34,14 @@ public abstract class TypeComponentImpl extends AccessibleImpl implements TypeCo
/**
* Creates new instance.
*/
- public TypeComponentImpl(String description, VirtualMachineImpl vmImpl, ReferenceTypeImpl declaringType, String name, String signature, String genericSignature, int modifierBits) {
+ public TypeComponentImpl(String description, VirtualMachineImpl vmImpl,
+ ReferenceTypeImpl declaringType, String name, String signature,
+ String genericSignature, int modifierBits) {
super(description, vmImpl);
fName = name;
fSignature = signature;
- fGenericSignature= genericSignature;
- fDeclaringType= declaringType;
+ fGenericSignature = genericSignature;
+ fDeclaringType = declaringType;
fModifierBits = modifierBits;
}
@@ -50,42 +51,43 @@ public abstract class TypeComponentImpl extends AccessibleImpl implements TypeCo
public int modifiers() {
return fModifierBits;
}
-
+
/**
- * @return Returns the ReferenceTypeImpl in which this component was declared.
+ * @return Returns the ReferenceTypeImpl in which this component was
+ * declared.
*/
- public ReferenceTypeImpl referenceTypeImpl() {
- return fDeclaringType;
- }
-
+ public ReferenceTypeImpl referenceTypeImpl() {
+ return fDeclaringType;
+ }
+
/**
* @return Returns the type in which this component was declared.
*/
public ReferenceType declaringType() {
- return fDeclaringType;
+ return fDeclaringType;
}
-
- /**
+
+ /**
* @return Returns true if type component is final.
*/
public boolean isFinal() {
return (fModifierBits & MODIFIER_ACC_FINAL) != 0;
}
-
- /**
+
+ /**
* @return Returns true if type component is static.
*/
public boolean isStatic() {
return (fModifierBits & MODIFIER_ACC_STATIC) != 0;
}
-
- /**
+
+ /**
* @return Returns true if type component is synthetic.
*/
public boolean isSynthetic() {
return (fModifierBits & (MODIFIER_SYNTHETIC | MODIFIER_ACC_SYNTHETIC)) != 0;
}
-
+
/**
* @return Returns text representation of this type.
*/
@@ -99,16 +101,17 @@ public abstract class TypeComponentImpl extends AccessibleImpl implements TypeCo
public String signature() {
return fSignature;
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
return fName;
}
-
+
public String genericSignature() {
return fGenericSignature;
}
-
+
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeImpl.java
index c10e61eb5..0fbb726bd 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/TypeImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.ClassLoaderReference;
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.ClassNotPreparedException;
@@ -18,10 +17,9 @@ import com.sun.jdi.Type;
import com.sun.jdi.Value;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public abstract class TypeImpl extends AccessibleImpl implements Type {
/** Text representation of this type. */
@@ -35,31 +33,37 @@ public abstract class TypeImpl extends AccessibleImpl implements Type {
protected TypeImpl(String description, VirtualMachineImpl vmImpl) {
super(description, vmImpl);
}
-
+
/**
* Creates new instance, used for PRIMITIVE types or VOID.
*/
- protected TypeImpl(String description, VirtualMachineImpl vmImpl, String name, String signature) {
+ protected TypeImpl(String description, VirtualMachineImpl vmImpl,
+ String name, String signature) {
super(description, vmImpl);
setName(name);
setSignature(signature);
}
/**
- * @return Returns new instance based on signature and (if it is a ReferenceType) classLoader.
- * @throws ClassNotLoadedException when type is a ReferenceType and it has not been loaded
- * by the specified class loader.
+ * @return Returns new instance based on signature and (if it is a
+ * ReferenceType) classLoader.
+ * @throws ClassNotLoadedException
+ * when type is a ReferenceType and it has not been loaded by
+ * the specified class loader.
*/
- public static TypeImpl create(VirtualMachineImpl vmImpl, String signature, ClassLoaderReference classLoader) throws ClassNotLoadedException {
+ public static TypeImpl create(VirtualMachineImpl vmImpl, String signature,
+ ClassLoaderReference classLoader) throws ClassNotLoadedException {
// For void values, a VoidType is always returned.
if (isVoidSignature(signature))
return new VoidTypeImpl(vmImpl);
-
- // For primitive variables, an appropriate PrimitiveType is always returned.
+
+ // For primitive variables, an appropriate PrimitiveType is always
+ // returned.
if (isPrimitiveSignature(signature))
return PrimitiveTypeImpl.create(vmImpl, signature);
-
- // For object variables, the appropriate ReferenceType is returned if it has
+
+ // For object variables, the appropriate ReferenceType is returned if it
+ // has
// been loaded through the enclosing type's class loader.
return ReferenceTypeImpl.create(vmImpl, signature, classLoader);
}
@@ -70,27 +74,28 @@ public abstract class TypeImpl extends AccessibleImpl implements Type {
public void setName(String name) {
fName = name;
}
-
+
/**
* Assigns signature.
*/
public void setSignature(String signature) {
fSignature = signature;
}
-
+
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
try {
return name();
} catch (ClassNotPreparedException e) {
- return JDIMessages.TypeImpl__Unloaded_Type__1;
+ return JDIMessages.TypeImpl__Unloaded_Type__1;
} catch (Exception e) {
return fDescription;
}
}
-
+
/**
* @return Create a null value instance of the type.
*/
@@ -102,109 +107,106 @@ public abstract class TypeImpl extends AccessibleImpl implements Type {
public String name() {
return fName;
}
-
+
/**
* @return JNI-style signature for this type.
*/
public String signature() {
return fSignature;
}
-
+
/**
* @return Returns modifier bits.
*/
public abstract int modifiers();
-
+
/**
* Converts a class name to a JNI signature.
*/
public static String classNameToSignature(String qualifiedName) {
- // L<classname>; : fully-qualified-class
- /* JNI signature examples:
- * int[][] -> [[I
- * long[] -> [J
- * java.lang.String -> Ljava/lang/String;
- * java.lang.String[] -> [Ljava/lang/String;
+ // L<classname>; : fully-qualified-class
+ /*
+ * JNI signature examples: int[][] -> [[I long[] -> [J java.lang.String
+ * -> Ljava/lang/String; java.lang.String[] -> [Ljava/lang/String;
*/
- StringBuffer signature= new StringBuffer();
+ StringBuffer signature = new StringBuffer();
- int firstBrace= qualifiedName.indexOf('[');
+ int firstBrace = qualifiedName.indexOf('[');
if (firstBrace < 0) {
// Not an array type. Must be class type.
signature.append('L');
- signature.append(qualifiedName.replace('.','/'));
+ signature.append(qualifiedName.replace('.', '/'));
signature.append(';');
return signature.toString();
}
-
- int index= 0;
- while ((index= (qualifiedName.indexOf('[', index) + 1)) > 0) {
+
+ int index = 0;
+ while ((index = (qualifiedName.indexOf('[', index) + 1)) > 0) {
signature.append('[');
}
- String name= qualifiedName.substring(0, firstBrace);
+ String name = qualifiedName.substring(0, firstBrace);
switch (name.charAt(0)) {
- // Check for primitive array type
- case 'b':
- if (name.equals("byte")) { //$NON-NLS-1$
- signature.append('B');
- return signature.toString();
- } else if (name.equals("boolean")) { //$NON-NLS-1$
- signature.append('Z');
- return signature.toString();
- }
- break;
- case 'i':
- if (name.equals("int")) { //$NON-NLS-1$
- signature.append('I');
- return signature.toString();
- }
- break;
- case 'd':
- if (name.equals("double")) { //$NON-NLS-1$
- signature.append('D');
- return signature.toString();
- }
- break;
- case 's':
- if (name.equals("short")) { //$NON-NLS-1$
- signature.append('S');
- return signature.toString();
- }
- break;
- case 'c':
- if (name.equals("char")) { //$NON-NLS-1$
- signature.append('C');
- return signature.toString();
- }
- break;
- case 'l':
- if (name.equals("long")) { //$NON-NLS-1$
- signature.append('J');
- return signature.toString();
- }
- break;
- case 'f':
- if (name.equals("float")) { //$NON-NLS-1$
- signature.append('F');
- return signature.toString();
- }
- break;
+ // Check for primitive array type
+ case 'b':
+ if (name.equals("byte")) { //$NON-NLS-1$
+ signature.append('B');
+ return signature.toString();
+ } else if (name.equals("boolean")) { //$NON-NLS-1$
+ signature.append('Z');
+ return signature.toString();
+ }
+ break;
+ case 'i':
+ if (name.equals("int")) { //$NON-NLS-1$
+ signature.append('I');
+ return signature.toString();
+ }
+ break;
+ case 'd':
+ if (name.equals("double")) { //$NON-NLS-1$
+ signature.append('D');
+ return signature.toString();
+ }
+ break;
+ case 's':
+ if (name.equals("short")) { //$NON-NLS-1$
+ signature.append('S');
+ return signature.toString();
+ }
+ break;
+ case 'c':
+ if (name.equals("char")) { //$NON-NLS-1$
+ signature.append('C');
+ return signature.toString();
+ }
+ break;
+ case 'l':
+ if (name.equals("long")) { //$NON-NLS-1$
+ signature.append('J');
+ return signature.toString();
+ }
+ break;
+ case 'f':
+ if (name.equals("float")) { //$NON-NLS-1$
+ signature.append('F');
+ return signature.toString();
+ }
+ break;
}
// Class type array
signature.append('L');
- signature.append(name.replace('.','/'));
+ signature.append(name.replace('.', '/'));
signature.append(';');
return signature.toString();
}
-
/**
* Converts a JNI class signature to a name.
*/
public static String classSignatureToName(String signature) {
- // L<classname>; : fully-qualified-class
- return signature.substring(1, signature.length() - 1).replace('/','.');
+ // L<classname>; : fully-qualified-class
+ return signature.substring(1, signature.length() - 1).replace('/', '.');
}
/**
@@ -215,15 +217,15 @@ public abstract class TypeImpl extends AccessibleImpl implements Type {
if (signature.indexOf('[') < 0) {
return signature;
}
- StringBuffer name= new StringBuffer();
- String type= signature.substring(signature.lastIndexOf('[') + 1);
+ StringBuffer name = new StringBuffer();
+ String type = signature.substring(signature.lastIndexOf('[') + 1);
if (type.length() == 1 && isPrimitiveSignature(type)) {
name.append(getPrimitiveSignatureToName(type.charAt(0)));
} else {
name.append(classSignatureToName(type));
}
- int index= 0;
- while ((index= (signature.indexOf('[', index) + 1)) > 0) {
+ int index = 0;
+ while ((index = (signature.indexOf('[', index) + 1)) > 0) {
name.append('[').append(']');
}
return signatureToName(signature.substring(1)) + "[]"; //$NON-NLS-1$
@@ -234,93 +236,98 @@ public abstract class TypeImpl extends AccessibleImpl implements Type {
*/
public static String signatureToName(String signature) {
// See JNI 1.1 Specification, Table 3-2 Java VM Type Signatures.
- String primitive= getPrimitiveSignatureToName(signature.charAt(0));
+ String primitive = getPrimitiveSignatureToName(signature.charAt(0));
if (primitive != null) {
return primitive;
}
switch (signature.charAt(0)) {
- case 'V':
- return "void"; //$NON-NLS-1$
- case 'L':
- return classSignatureToName(signature);
- case '[':
- return arraySignatureToName(signature);
- case '(':
- throw new InternalError(JDIMessages.TypeImpl_Can__t_convert_method_signature_to_name_2);
+ case 'V':
+ return "void"; //$NON-NLS-1$
+ case 'L':
+ return classSignatureToName(signature);
+ case '[':
+ return arraySignatureToName(signature);
+ case '(':
+ throw new InternalError(
+ JDIMessages.TypeImpl_Can__t_convert_method_signature_to_name_2);
}
- throw new InternalError(JDIMessages.TypeImpl_Invalid_signature____10 + signature + JDIMessages.TypeImpl___11); //
+ throw new InternalError(JDIMessages.TypeImpl_Invalid_signature____10
+ + signature + JDIMessages.TypeImpl___11); //
}
private static String getPrimitiveSignatureToName(char signature) {
switch (signature) {
- case 'Z':
- return "boolean"; //$NON-NLS-1$
- case 'B':
- return "byte"; //$NON-NLS-1$
- case 'C':
- return "char"; //$NON-NLS-1$
- case 'S':
- return "short"; //$NON-NLS-1$
- case 'I':
- return "int"; //$NON-NLS-1$
- case 'J':
- return "long"; //$NON-NLS-1$
- case 'F':
- return "float"; //$NON-NLS-1$
- case 'D':
- return "double"; //$NON-NLS-1$
- default:
- return null;
+ case 'Z':
+ return "boolean"; //$NON-NLS-1$
+ case 'B':
+ return "byte"; //$NON-NLS-1$
+ case 'C':
+ return "char"; //$NON-NLS-1$
+ case 'S':
+ return "short"; //$NON-NLS-1$
+ case 'I':
+ return "int"; //$NON-NLS-1$
+ case 'J':
+ return "long"; //$NON-NLS-1$
+ case 'F':
+ return "float"; //$NON-NLS-1$
+ case 'D':
+ return "double"; //$NON-NLS-1$
+ default:
+ return null;
}
}
-
+
/**
* @returns Returns Jdwp Tag, converted from a JNI signature.
*/
public static byte signatureToTag(String signature) {
switch (signature.charAt(0)) {
- case 'Z':
- return BooleanValueImpl.tag;
- case 'B':
- return ByteValueImpl.tag;
- case 'C':
- return CharValueImpl.tag;
- case 'S':
- return ShortValueImpl.tag;
- case 'I':
- return IntegerValueImpl.tag;
- case 'J':
- return LongValueImpl.tag;
- case 'F':
- return FloatValueImpl.tag;
- case 'D':
- return DoubleValueImpl.tag;
- case 'V':
- return VoidValueImpl.tag;
- case 'L':
- return ObjectReferenceImpl.tag;
- case '[':
- return ArrayReferenceImpl.tag;
- case '(':
- throw new InternalError(JDIMessages.TypeImpl_Can__t_covert_method_signature_to_tag___9 + signature);
+ case 'Z':
+ return BooleanValueImpl.tag;
+ case 'B':
+ return ByteValueImpl.tag;
+ case 'C':
+ return CharValueImpl.tag;
+ case 'S':
+ return ShortValueImpl.tag;
+ case 'I':
+ return IntegerValueImpl.tag;
+ case 'J':
+ return LongValueImpl.tag;
+ case 'F':
+ return FloatValueImpl.tag;
+ case 'D':
+ return DoubleValueImpl.tag;
+ case 'V':
+ return VoidValueImpl.tag;
+ case 'L':
+ return ObjectReferenceImpl.tag;
+ case '[':
+ return ArrayReferenceImpl.tag;
+ case '(':
+ throw new InternalError(
+ JDIMessages.TypeImpl_Can__t_covert_method_signature_to_tag___9
+ + signature);
}
- throw new InternalError(JDIMessages.TypeImpl_Invalid_signature____10 + signature + JDIMessages.TypeImpl___11); //
+ throw new InternalError(JDIMessages.TypeImpl_Invalid_signature____10
+ + signature + JDIMessages.TypeImpl___11); //
}
-
+
/**
* @returns Returns true if signature is an primitive signature.
*/
public static boolean isPrimitiveSignature(String signature) {
switch (signature.charAt(0)) {
- case 'Z':
- case 'B':
- case 'C':
- case 'S':
- case 'I':
- case 'J':
- case 'F':
- case 'D':
- return true;
+ case 'Z':
+ case 'B':
+ case 'C':
+ case 'S':
+ case 'I':
+ case 'J':
+ case 'F':
+ case 'D':
+ return true;
}
return false;
}
@@ -331,6 +338,5 @@ public abstract class TypeImpl extends AccessibleImpl implements Type {
public static boolean isVoidSignature(String signature) {
return (signature.charAt(0) == 'V');
}
-
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueCache.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueCache.java
index bd9cfb45d..8d23997d7 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueCache.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueCache.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
@@ -22,35 +21,37 @@ import java.util.List;
import java.util.Map;
/**
- * This class is used to cache values.
- * It uses soft references to store cached values. Once a value is garbage collected by the VM,
- * the corresponding entry is removed from the cache on the next invocation of put() or get().
- *
+ * This class is used to cache values. It uses soft references to store cached
+ * values. Once a value is garbage collected by the VM, the corresponding entry
+ * is removed from the cache on the next invocation of put() or get().
+ *
* Note that WeakHashMap can't be used for this purpose because in WeakHashMap
- * soft references are only used for the keys, and values may not have 'strong' references
- * to keys otherwise they will never be garbage collected.
- *
+ * soft references are only used for the keys, and values may not have 'strong'
+ * references to keys otherwise they will never be garbage collected.
+ *
*/
public class ValueCache {
/**
- * Map to store <key, Reference> pairs,
- * where Reference is a soft reference to an Object.
+ * Map to store <key, Reference> pairs, where Reference is a soft reference
+ * to an Object.
*/
- private Map cacheTable = new Hashtable();
+ private Map<Object, SoftReference<Object>> cacheTable = new Hashtable<Object, SoftReference<Object>>();
/**
- * Map to store <Reference, key> pairs,
- * to find the cacheTable-key of a garbage collected Reference.
+ * Map to store <Reference, key> pairs, to find the cacheTable-key of a
+ * garbage collected Reference.
*/
- private Map refTable = new Hashtable();
-
+ private Map<SoftReference<Object>, Object> refTable = new Hashtable<SoftReference<Object>, Object>();
+
/**
- * The reference-queue that is registered with the soft references.
- * The garbage collector will enqueue soft references that are garbage collected.
+ * The reference-queue that is registered with the soft references. The
+ * garbage collector will enqueue soft references that are garbage
+ * collected.
*/
private ReferenceQueue refQueue = new ReferenceQueue();
-
+
/**
- * Clean up all entries from the table for which the values were garbage collected.
+ * Clean up all entries from the table for which the values were garbage
+ * collected.
*/
private void cleanup() {
Reference ref;
@@ -67,40 +68,40 @@ public class ValueCache {
*/
public void put(Object key, Object value) {
cleanup();
- SoftReference ref = new SoftReference(value, refQueue);
+ SoftReference<Object> ref = new SoftReference<Object>(value, refQueue);
cacheTable.put(key, ref);
refTable.put(ref, key);
}
/**
* Get entry from the cache.
- * @return Returns value that is cached under the given key,
- * or null of one of the following is true:
- * - The value has not been cached.
- * - The value had been cached but is garbage collected.
+ *
+ * @return Returns value that is cached under the given key, or null of one
+ * of the following is true: - The value has not been cached. - The
+ * value had been cached but is garbage collected.
*/
public Object get(Object key) {
cleanup();
Object value = null;
- SoftReference ref = (SoftReference)cacheTable.get(key);
+ SoftReference ref = cacheTable.get(key);
if (ref != null) {
value = ref.get();
}
return value;
}
-
+
/**
* Returns a Collection view of the values contained in this cache.
*/
- public Collection values() {
+ public Collection<Object> values() {
cleanup();
- List returnValues = new ArrayList();
+ List<Object> returnValues = new ArrayList<Object>();
synchronized (cacheTable) {
- Iterator iter = cacheTable.values().iterator();
+ Iterator<SoftReference<Object>> iter = cacheTable.values().iterator();
SoftReference ref;
Object value;
while (iter.hasNext()) {
- ref = (SoftReference)iter.next();
+ ref = iter.next();
value = ref.get();
if (value != null) {
returnValues.add(value);
@@ -109,20 +110,20 @@ public class ValueCache {
}
return returnValues;
}
-
+
/**
- * Returns a Collection view of the values contained in this cache that have the same
- * runtime class as the given Class.
+ * Returns a Collection view of the values contained in this cache that have
+ * the same runtime class as the given Class.
*/
- public Collection valuesWithType(Class type) {
+ public Collection<Object> valuesWithType(Class type) {
cleanup();
- List returnValues = new ArrayList();
+ List<Object> returnValues = new ArrayList<Object>();
synchronized (cacheTable) {
- Iterator iter = cacheTable.values().iterator();
+ Iterator<SoftReference<Object>> iter = cacheTable.values().iterator();
SoftReference ref;
Object value;
while (iter.hasNext()) {
- ref = (SoftReference)iter.next();
+ ref = iter.next();
value = ref.get();
if (value != null && value.getClass().equals(type)) {
returnValues.add(value);
@@ -132,15 +133,16 @@ public class ValueCache {
return returnValues;
}
- /**
+ /**
* Removes the key and its corresponding value from this cache.
- * @return Returns The value to which the key had been mapped in this hashtable,
- * or null if the key did not have a mapping.
+ *
+ * @return Returns The value to which the key had been mapped in this
+ * hashtable, or null if the key did not have a mapping.
*/
public Object remove(Object key) {
cleanup();
Object value = null;
- SoftReference ref = (SoftReference)cacheTable.get(key);
+ SoftReference ref = cacheTable.get(key);
if (ref != null) {
value = ref.get();
refTable.remove(ref);
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueImpl.java
index b006622ea..0bf7cb057 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ValueImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -35,10 +34,9 @@ import com.sun.jdi.Value;
import com.sun.jdi.VoidType;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public abstract class ValueImpl extends MirrorImpl implements Value {
/**
@@ -57,65 +55,70 @@ public abstract class ValueImpl extends MirrorImpl implements Value {
* @returns type of value.
*/
public abstract byte getTag();
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ValueImpl readWithTag(MirrorImpl target, DataInputStream in) throws IOException {
+ public static ValueImpl readWithTag(MirrorImpl target, DataInputStream in)
+ throws IOException {
byte tag = target.readByte("object tag", JdwpID.tagMap(), in); //$NON-NLS-1$
- return readWithoutTag(target, tag, in);
+ return readWithoutTag(target, tag, in);
}
-
+
/**
* @return Reads JDWP representation and returns new instance.
*/
- public static ValueImpl readWithoutTag(MirrorImpl target, int type, DataInputStream in) throws IOException {
+ public static ValueImpl readWithoutTag(MirrorImpl target, int type,
+ DataInputStream in) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
// See also ArrayReference Impl.
- switch(type) {
- case ArrayReferenceImpl.tag:
- return ArrayReferenceImpl.read(target, in);
- case ClassLoaderReferenceImpl.tag:
- return ClassLoaderReferenceImpl.read(target, in);
- case ClassObjectReferenceImpl.tag:
- return ClassObjectReferenceImpl.read(target, in);
- case StringReferenceImpl.tag:
- return StringReferenceImpl.read(target, in);
- case ObjectReferenceImpl.tag:
- return ObjectReferenceImpl.readObjectRefWithoutTag(target, in);
- case ThreadGroupReferenceImpl.tag:
- return ThreadGroupReferenceImpl.read(target, in);
- case ThreadReferenceImpl.tag:
- return ThreadReferenceImpl.read(target, in);
- case BooleanValueImpl.tag:
- return BooleanValueImpl.read(target, in);
- case ByteValueImpl.tag:
- return ByteValueImpl.read(target, in);
- case CharValueImpl.tag:
- return CharValueImpl.read(target, in);
- case DoubleValueImpl.tag:
- return DoubleValueImpl.read(target, in);
- case FloatValueImpl.tag:
- return FloatValueImpl.read(target, in);
- case IntegerValueImpl.tag:
- return IntegerValueImpl.read(target, in);
- case LongValueImpl.tag:
- return LongValueImpl.read(target, in);
- case ShortValueImpl.tag:
- return ShortValueImpl.read(target, in);
- case VoidValueImpl.tag:
- return new VoidValueImpl(vmImpl);
- case 0:
- return null;
- default:
- throw new InternalException(JDIMessages.ValueImpl_Invalid_Value_tag_encountered___1 + type);
+ switch (type) {
+ case ArrayReferenceImpl.tag:
+ return ArrayReferenceImpl.read(target, in);
+ case ClassLoaderReferenceImpl.tag:
+ return ClassLoaderReferenceImpl.read(target, in);
+ case ClassObjectReferenceImpl.tag:
+ return ClassObjectReferenceImpl.read(target, in);
+ case StringReferenceImpl.tag:
+ return StringReferenceImpl.read(target, in);
+ case ObjectReferenceImpl.tag:
+ return ObjectReferenceImpl.readObjectRefWithoutTag(target, in);
+ case ThreadGroupReferenceImpl.tag:
+ return ThreadGroupReferenceImpl.read(target, in);
+ case ThreadReferenceImpl.tag:
+ return ThreadReferenceImpl.read(target, in);
+ case BooleanValueImpl.tag:
+ return BooleanValueImpl.read(target, in);
+ case ByteValueImpl.tag:
+ return ByteValueImpl.read(target, in);
+ case CharValueImpl.tag:
+ return CharValueImpl.read(target, in);
+ case DoubleValueImpl.tag:
+ return DoubleValueImpl.read(target, in);
+ case FloatValueImpl.tag:
+ return FloatValueImpl.read(target, in);
+ case IntegerValueImpl.tag:
+ return IntegerValueImpl.read(target, in);
+ case LongValueImpl.tag:
+ return LongValueImpl.read(target, in);
+ case ShortValueImpl.tag:
+ return ShortValueImpl.read(target, in);
+ case VoidValueImpl.tag:
+ return new VoidValueImpl(vmImpl);
+ case 0:
+ return null;
+ default:
+ throw new InternalException(
+ JDIMessages.ValueImpl_Invalid_Value_tag_encountered___1
+ + type);
}
}
/**
* Writes value with value tag.
*/
- public void writeWithTag(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void writeWithTag(MirrorImpl target, DataOutputStream out)
+ throws IOException {
target.writeByte(getTag(), "tag", JdwpID.tagMap(), out); //$NON-NLS-1$
write(target, out);
}
@@ -123,189 +126,226 @@ public abstract class ValueImpl extends MirrorImpl implements Value {
/**
* Writes value without value tag.
*/
- public abstract void write(MirrorImpl target, DataOutputStream out) throws IOException;
-
+ public abstract void write(MirrorImpl target, DataOutputStream out)
+ throws IOException;
+
/**
* Writes null value without value tag.
*/
- public static void writeNull(MirrorImpl target, DataOutputStream out) throws IOException {
+ public static void writeNull(MirrorImpl target, DataOutputStream out)
+ throws IOException {
JdwpObjectID nullID = new JdwpObjectID(target.virtualMachineImpl());
nullID.write(out);
if (target.fVerboseWriter != null)
target.fVerboseWriter.println("objectReference", nullID.value()); //$NON-NLS-1$
}
-
+
/**
* Writes null value with value tag.
*/
- public static void writeNullWithTag(MirrorImpl target, DataOutputStream out) throws IOException {
+ public static void writeNullWithTag(MirrorImpl target, DataOutputStream out)
+ throws IOException {
target.writeByte(ObjectReferenceImpl.tag, "tag", JdwpID.tagMap(), out); //$NON-NLS-1$
writeNull(target, out);
}
/**
- * Check the type and the vm of each values, according to the associated type.
- * For primitive values, convert the value for match the given type if needed.
- * The two list must have the same size.
+ * Check the type and the vm of each values, according to the associated
+ * type. For primitive values, convert the value for match the given type if
+ * needed. The two list must have the same size.
+ *
* @return the (converted) values.
* @see checkValue(Value, Type, VirtualMachineImpl)
*/
- protected static List checkValues(List values, List types, VirtualMachineImpl vm) throws InvalidTypeException {
- List result= new ArrayList(values.size());
- Iterator iterValues= values.iterator();
- Iterator iterTypes= types.iterator();
+ protected static List<Value> checkValues(List<?extends Value> values, List<Type> types,
+ VirtualMachineImpl vm) throws InvalidTypeException {
+ List<Value> result = new ArrayList<Value>(values.size());
+ Iterator<? extends Value> iterValues = values.iterator();
+ Iterator<Type> iterTypes = types.iterator();
while (iterValues.hasNext()) {
- Value value= (Value)iterValues.next();
- Type type= (Type)iterTypes.next();
+ Value value = iterValues.next();
+ Type type = iterTypes.next();
result.add(checkValue(value, type, vm));
}
return result;
}
/**
- * Check the type and the vm of the given value.
- * In case of primitive value, the value is converted if needed.
+ * Check the type and the vm of the given value. In case of primitive value,
+ * the value is converted if needed.
+ *
* @return the (converted) value.
- * @throws InvalidTypeException if the given value is no assignment
- * compatible with the given type.
- * @see checkPrimitiveValue(PrimitiveValueImpl, PrimitiveTypeImpl, PrimitiveTypeImpl)
+ * @throws InvalidTypeException
+ * if the given value is no assignment compatible with the given
+ * type.
+ * @see checkPrimitiveValue(PrimitiveValueImpl, PrimitiveTypeImpl,
+ * PrimitiveTypeImpl)
*/
- public static ValueImpl checkValue(Value value, Type type, VirtualMachineImpl vm) throws InvalidTypeException {
+ public static ValueImpl checkValue(Value value, Type type,
+ VirtualMachineImpl vm) throws InvalidTypeException {
if (value == null) {
if (!(type instanceof PrimitiveType)) {
- return null;
+ return null;
}
} else {
vm.checkVM(value);
- TypeImpl valueType= (TypeImpl)value.type();
- if (valueType instanceof PrimitiveType && type instanceof PrimitiveType) {
- return checkPrimitiveValue((PrimitiveValueImpl) value, (PrimitiveTypeImpl) valueType, (PrimitiveTypeImpl) type);
- }
- if (valueType instanceof ReferenceType && type instanceof ReferenceType) {
- checkReferenceType((ReferenceType) valueType, (ReferenceType) type);
- return (ValueImpl)value;
+ TypeImpl valueType = (TypeImpl) value.type();
+ if (valueType instanceof PrimitiveType
+ && type instanceof PrimitiveType) {
+ return checkPrimitiveValue((PrimitiveValueImpl) value,
+ (PrimitiveTypeImpl) valueType, (PrimitiveTypeImpl) type);
+ }
+ if (valueType instanceof ReferenceType
+ && type instanceof ReferenceType) {
+ checkReferenceType((ReferenceType) valueType,
+ (ReferenceType) type);
+ return (ValueImpl) value;
}
- if(valueType instanceof VoidType && type instanceof VoidType) {
+ if (valueType instanceof VoidType && type instanceof VoidType) {
return (VoidValueImpl) value;
}
}
- throw new InvalidTypeException(MessageFormat.format(JDIMessages.ValueImpl_Type_of_the_value_not_compatible_with_the_expected_type__1, new String[]{value != null ? value.type().name() : "null", type.name()})); //$NON-NLS-1$
+ throw new InvalidTypeException(
+ MessageFormat
+ .format(JDIMessages.ValueImpl_Type_of_the_value_not_compatible_with_the_expected_type__1,
+ new Object[] {
+ value != null ? value.type().name()
+ : "null", type.name() })); //$NON-NLS-1$
}
/**
*/
- private static void checkReferenceType(ReferenceType valueType, ReferenceType type) throws InvalidTypeException {
- if (valueType instanceof ArrayType) {
- if (type instanceof ArrayType) {
- try {
- Type valueComponentType= ((ArrayType) valueType).componentType();
- Type componentType= ((ArrayType) type).componentType();
- if (valueComponentType instanceof PrimitiveType) {
- if (valueComponentType.equals(componentType)) {
- return;
- }
- } else if (valueComponentType instanceof ReferenceType && componentType instanceof ReferenceType) {
- checkReferenceType((ReferenceType) valueComponentType, (ReferenceType) componentType);
- return;
- }
- } catch (ClassNotLoadedException e) {
- // should not append
- }
- } else {
- // an array can be assigned to an object
- if (type.signature().equals("Ljava/lang/Object;")) { //$NON-NLS-1$
- return;
- }
- }
- } else {
- if (type instanceof ClassType) {
- if (valueType instanceof ClassType) {
- ClassType superClass= (ClassType) valueType;
- while (superClass != null) {
- if (superClass.equals(type)) {
- return;
- }
- superClass= superClass.superclass();
- }
- } else if (valueType instanceof InterfaceType) {
- // an interface can be assigned to an object
- if (type.signature().equals("Ljava/lang/Object;")) { //$NON-NLS-1$
- return;
- }
- }
- } else if (type instanceof InterfaceType) {
- if (valueType instanceof InterfaceType) {
- if (checkInterfaceType((InterfaceType) valueType, (InterfaceType) type)) {
- return;
- }
- } else {
- List interfaces= ((ClassType)valueType).allInterfaces();
- for (Iterator iter= interfaces.iterator(); iter.hasNext();) {
- if (checkInterfaceType((InterfaceType) iter.next(), (InterfaceType) type)) {
- return;
- }
- }
- }
- }
- }
-
- throw new InvalidTypeException(MessageFormat.format(JDIMessages.ValueImpl_Type_of_the_value_not_compatible_with_the_expected_type__1, new String[]{valueType.name(), type.name()}));
- }
-
- private static boolean checkInterfaceType(InterfaceType valueType, InterfaceType type) {
- if (valueType.equals(type)) {
- return true;
- }
- List superInterfaces= valueType.superinterfaces();
- for (Iterator iter= superInterfaces.iterator(); iter.hasNext();) {
- if (checkInterfaceType((InterfaceType) iter.next(), type)) {
- return true;
- }
- }
- return false;
- }
+ private static void checkReferenceType(ReferenceType valueType,
+ ReferenceType type) throws InvalidTypeException {
+ if (valueType instanceof ArrayType) {
+ if (type instanceof ArrayType) {
+ try {
+ Type valueComponentType = ((ArrayType) valueType)
+ .componentType();
+ Type componentType = ((ArrayType) type).componentType();
+ if (valueComponentType instanceof PrimitiveType) {
+ if (valueComponentType.equals(componentType)) {
+ return;
+ }
+ } else if (valueComponentType instanceof ReferenceType
+ && componentType instanceof ReferenceType) {
+ checkReferenceType((ReferenceType) valueComponentType,
+ (ReferenceType) componentType);
+ return;
+ }
+ } catch (ClassNotLoadedException e) {
+ // should not append
+ }
+ } else {
+ // an array can be assigned to an object
+ if (type.signature().equals("Ljava/lang/Object;")) { //$NON-NLS-1$
+ return;
+ }
+ }
+ } else {
+ if (type instanceof ClassType) {
+ if (valueType instanceof ClassType) {
+ ClassType superClass = (ClassType) valueType;
+ while (superClass != null) {
+ if (superClass.equals(type)) {
+ return;
+ }
+ superClass = superClass.superclass();
+ }
+ } else if (valueType instanceof InterfaceType) {
+ // an interface can be assigned to an object
+ if (type.signature().equals("Ljava/lang/Object;")) { //$NON-NLS-1$
+ return;
+ }
+ }
+ } else if (type instanceof InterfaceType) {
+ if (valueType instanceof InterfaceType) {
+ if (checkInterfaceType((InterfaceType) valueType,
+ (InterfaceType) type)) {
+ return;
+ }
+ } else {
+ List<InterfaceType> interfaces = ((ClassType) valueType).allInterfaces();
+ for (Iterator<InterfaceType> iter = interfaces.iterator(); iter.hasNext();) {
+ if (checkInterfaceType(iter.next(),
+ (InterfaceType) type)) {
+ return;
+ }
+ }
+ }
+ }
+ }
- /**
+ throw new InvalidTypeException(
+ MessageFormat
+ .format(JDIMessages.ValueImpl_Type_of_the_value_not_compatible_with_the_expected_type__1,
+ new Object[] { valueType.name(), type.name() }));
+ }
+
+ private static boolean checkInterfaceType(InterfaceType valueType,
+ InterfaceType type) {
+ if (valueType.equals(type)) {
+ return true;
+ }
+ List<InterfaceType> superInterfaces = valueType.superinterfaces();
+ for (Iterator<InterfaceType> iter = superInterfaces.iterator(); iter.hasNext();) {
+ if (checkInterfaceType(iter.next(), type)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
* Check the type of the given value, and convert the value to the given
* type if needed (see Java Language Spec, section 5.2).
+ *
* @return the (converted) value.
- * @throws InvalidTypeException if the given value is no assignment
- * compatible with the given type.
+ * @throws InvalidTypeException
+ * if the given value is no assignment compatible with the given
+ * type.
*/
- protected static ValueImpl checkPrimitiveValue(PrimitiveValueImpl value, PrimitiveTypeImpl valueType, PrimitiveTypeImpl type) throws InvalidTypeException {
- char valueTypeSignature= valueType.signature().charAt(0);
- char typeSignature= type.signature().charAt(0);
+ protected static ValueImpl checkPrimitiveValue(PrimitiveValueImpl value,
+ PrimitiveTypeImpl valueType, PrimitiveTypeImpl type)
+ throws InvalidTypeException {
+ char valueTypeSignature = valueType.signature().charAt(0);
+ char typeSignature = type.signature().charAt(0);
if (valueTypeSignature == typeSignature) {
return value;
}
- VirtualMachineImpl vm= value.virtualMachineImpl();
+ VirtualMachineImpl vm = value.virtualMachineImpl();
switch (typeSignature) {
- case 'D':
- if (valueTypeSignature != 'Z') {
- return new DoubleValueImpl(vm, new Double(value.doubleValue()));
- }
- break;
- case 'F':
- if (valueTypeSignature != 'Z' && valueTypeSignature != 'D') {
- return new FloatValueImpl(vm, new Float(value.floatValue()));
- }
- break;
- case 'J':
- if (valueTypeSignature != 'Z' && valueTypeSignature != 'D' && valueTypeSignature != 'F') {
- return new LongValueImpl(vm, new Long(value.longValue()));
- }
- break;
- case 'I':
- if (valueTypeSignature == 'B' || valueTypeSignature == 'C' || valueTypeSignature == 'S') {
- return new IntegerValueImpl(vm, new Integer(value.intValue()));
- }
- break;
- case 'S':
- if (valueTypeSignature == 'B') {
- return new ShortValueImpl(vm, new Short(value.shortValue()));
- }
- break;
+ case 'D':
+ if (valueTypeSignature != 'Z') {
+ return new DoubleValueImpl(vm, new Double(value.doubleValue()));
+ }
+ break;
+ case 'F':
+ if (valueTypeSignature != 'Z' && valueTypeSignature != 'D') {
+ return new FloatValueImpl(vm, new Float(value.floatValue()));
+ }
+ break;
+ case 'J':
+ if (valueTypeSignature != 'Z' && valueTypeSignature != 'D'
+ && valueTypeSignature != 'F') {
+ return new LongValueImpl(vm, new Long(value.longValue()));
+ }
+ break;
+ case 'I':
+ if (valueTypeSignature == 'B' || valueTypeSignature == 'C'
+ || valueTypeSignature == 'S') {
+ return new IntegerValueImpl(vm, new Integer(value.intValue()));
+ }
+ break;
+ case 'S':
+ if (valueTypeSignature == 'B') {
+ return new ShortValueImpl(vm, new Short(value.shortValue()));
+ }
+ break;
}
- throw new InvalidTypeException(MessageFormat.format(JDIMessages.ValueImpl_Type_of_the_value_not_compatible_with_the_expected_type__1, new String[]{valueType.name(), type.name()}));
+ throw new InvalidTypeException(
+ MessageFormat
+ .format(JDIMessages.ValueImpl_Type_of_the_value_not_compatible_with_the_expected_type__1,
+ new Object[] { valueType.name(), type.name() }));
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VerboseWriter.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VerboseWriter.java
index b65c8d0d7..04b18dc95 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VerboseWriter.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VerboseWriter.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
@@ -22,42 +21,45 @@ public class VerboseWriter {
/** Number of hexadecimal verbose bytes per line. */
public static final int VERBOSE_HEX_BYTES_PER_LINE = 16;
/** Width of hex dump. */
- public static final int VERBOSE_HEX_WIDTH = 16*3+2;
-
- /** Number extra verbose lines. These are caused by hex dumps that span more than one line. */
+ public static final int VERBOSE_HEX_WIDTH = 16 * 3 + 2;
+
+ /**
+ * Number extra verbose lines. These are caused by hex dumps that span more
+ * than one line.
+ */
int fExtraVerboseLines = 0;
-
+
/** PrintWriter that is written to. */
private PrintWriter fOutput;
/** Buffer for output: one StringBuffer entry per line. */
- private List fLineBuffer;
+ private List<StringBuffer> fLineBuffer;
/** Position from where buffer is written to. */
private int fPosition;
/** True if the current line has not yet been written to. */
private boolean fNewLine = true;
/**
- * Creates new VerboseWriter that writes to the given PrintWriter.
- * Output is buffered and previous entries in the buffer can be rewritten.
+ * Creates new VerboseWriter that writes to the given PrintWriter. Output is
+ * buffered and previous entries in the buffer can be rewritten.
*/
public VerboseWriter(PrintWriter out) {
fOutput = out;
- fLineBuffer = new ArrayList();
+ fLineBuffer = new ArrayList<StringBuffer>();
fPosition = 0;
fLineBuffer.add(new StringBuffer());
}
-
+
/**
- * Terminate the current line by writing the line separator string.
- * If autoflush is set and there are extra vebose lines caused by printHex, these lines are
- * also printed.
+ * Terminate the current line by writing the line separator string. If
+ * autoflush is set and there are extra vebose lines caused by printHex,
+ * these lines are also printed.
*/
public void println() {
while (fExtraVerboseLines > 0) {
fExtraVerboseLines--;
markLn();
}
-
+
markLn();
}
@@ -69,7 +71,7 @@ public class VerboseWriter {
printHex(value);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -78,7 +80,7 @@ public class VerboseWriter {
printHex(value);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -87,7 +89,7 @@ public class VerboseWriter {
printHex(value);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -96,37 +98,37 @@ public class VerboseWriter {
printHex(value);
println();
}
-
+
/**
* Prints verbose line.
*/
- public void println(String description, byte value, Map valueToString) {
+ public void println(String description, byte value, Map<Integer, String> valueToString) {
printDescription(description);
printHex(value);
printValue(value, valueToString);
println();
}
-
+
/**
* Prints verbose line.
*/
- public void println(String description, short value, Map valueToString) {
+ public void println(String description, short value, Map<Integer, String> valueToString) {
printDescription(description);
printHex(value);
printValue(value, valueToString);
println();
}
-
+
/**
* Prints verbose line.
*/
- public void println(String description, int value, Map valueToString) {
+ public void println(String description, int value, Map<Integer, String> valueToString) {
printDescription(description);
printHex(value);
printValue(value, valueToString);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -136,7 +138,7 @@ public class VerboseWriter {
printValue(value, bitNames);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -146,7 +148,7 @@ public class VerboseWriter {
printValue(value, bitNames);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -156,7 +158,7 @@ public class VerboseWriter {
printValue(value, bitNames);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -166,7 +168,7 @@ public class VerboseWriter {
print(value);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -176,7 +178,7 @@ public class VerboseWriter {
print(Boolean.valueOf(value).toString());
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -186,7 +188,7 @@ public class VerboseWriter {
print(value);
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -196,7 +198,7 @@ public class VerboseWriter {
print(new Double(value).toString());
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -206,7 +208,7 @@ public class VerboseWriter {
print(new Float(value).toString());
println();
}
-
+
/**
* Prints verbose line.
*/
@@ -215,7 +217,7 @@ public class VerboseWriter {
printHex(value);
println();
}
-
+
/**
* Prints string with right size.
*/
@@ -228,14 +230,14 @@ public class VerboseWriter {
}
}
}
-
+
/**
* Prints description string with right size plus its seperator spaces.
*/
public void printDescription(String str) {
printWidth(str, VERBOSE_DESCRIPTION_LENGTH);
}
-
+
/**
* Prints hex substitution string with right size plus its seperator spaces.
*/
@@ -244,14 +246,14 @@ public class VerboseWriter {
print(' ');
printWidth(str, VERBOSE_HEX_WIDTH - 1);
}
-
+
/**
* Appends hex representation of given byte to an array.
*/
private static void appendHexByte(byte b, char[] buffer, int pos) {
int count = 2;
-
- int abspos = 3*pos;
+
+ int abspos = 3 * pos;
buffer[abspos] = ' ';
do {
int t = b & 15;
@@ -264,22 +266,22 @@ public class VerboseWriter {
b >>>= 4;
} while (count > 0);
}
-
+
/**
* Appends remaining spaces to hex dump.
*/
private static void appendHexSpaces(char[] buffer, int pos) {
- for (int i = 3*pos; i <= VERBOSE_HEX_WIDTH - 3; i+=3) {
+ for (int i = 3 * pos; i <= VERBOSE_HEX_WIDTH - 3; i += 3) {
buffer[i] = ' ';
- buffer[i+1] = ' ';
- buffer[i+2] = ' ';
+ buffer[i + 1] = ' ';
+ buffer[i + 2] = ' ';
}
-
+
// Two extra spaces as seperator
buffer[VERBOSE_HEX_WIDTH - 1] = ' ';
buffer[VERBOSE_HEX_WIDTH - 2] = ' ';
}
-
+
/**
* Prints hex representation of a byte.
*/
@@ -289,79 +291,79 @@ public class VerboseWriter {
appendHexSpaces(buffer, 1);
print(buffer);
}
-
+
/**
* Prints hex representation of an int.
*/
public void printHex(short s) {
char buffer[] = new char[VERBOSE_HEX_WIDTH];
for (int i = 1; i >= 0; i--)
- appendHexByte((byte)(s >>> i*8), buffer, 1 - i);
+ appendHexByte((byte) (s >>> i * 8), buffer, 1 - i);
appendHexSpaces(buffer, 2);
print(buffer);
}
-
+
/**
* Prints hex representation of an int.
*/
public void printHex(int integer) {
char buffer[] = new char[VERBOSE_HEX_WIDTH];
for (int i = 3; i >= 0; i--)
- appendHexByte((byte)(integer >>> i*8), buffer, 3 - i);
+ appendHexByte((byte) (integer >>> i * 8), buffer, 3 - i);
appendHexSpaces(buffer, 4);
print(buffer);
}
-
+
/**
* Prints hex representation of a long.
*/
public void printHex(long l) {
char buffer[] = new char[VERBOSE_HEX_WIDTH];
for (int i = 7; i >= 0; i--)
- appendHexByte((byte)(l >>> i*8), buffer, 7 - i);
+ appendHexByte((byte) (l >>> i * 8), buffer, 7 - i);
appendHexSpaces(buffer, 8);
print(buffer);
}
-
+
/**
* Prints hex representation of a long.
*/
public void printHex(boolean b) {
printHexSubstitution("<boolean>"); //$NON-NLS-1$
}
-
+
/**
* Prints hex representation of a long.
*/
public void printHex(char c) {
printHexSubstitution("<char>"); //$NON-NLS-1$
}
-
+
/**
* Prints hex representation of a long.
*/
public void printHex(double d) {
printHexSubstitution("<double>"); //$NON-NLS-1$
}
-
+
/**
* Prints hex representation of a long.
*/
public void printHex(float f) {
printHexSubstitution("<float>"); //$NON-NLS-1$
}
-
+
/**
* Prints hex representation of a String.
*/
public void printHex(String str) {
printHexSubstitution("<string>"); //$NON-NLS-1$
}
-
+
/**
- * Prints hex representation of a byte array.
- * Note that this can span more than one line, but is considered to be part of one
- * 'verbose line'. Therefore, a println after a printHex can result in more than one line
+ * Prints hex representation of a byte array. Note that this can span more
+ * than one line, but is considered to be part of one 'verbose line'.
+ * Therefore, a println after a printHex can result in more than one line
* being printed to the PrintWriter.
*/
public void printHex(byte[] bytes) {
@@ -370,7 +372,7 @@ public class VerboseWriter {
int extraLines = 0;
int byteOnLine = 0;
- for (int i = 0; i < bytes.length; i++) {
+ for (byte b : bytes) {
if (byteOnLine == VERBOSE_HEX_BYTES_PER_LINE) {
appendHexSpaces(linebuf, VERBOSE_HEX_BYTES_PER_LINE);
if (extraLines++ > 0) {
@@ -380,13 +382,13 @@ public class VerboseWriter {
markLn();
byteOnLine = 0;
}
- appendHexByte(bytes[i], linebuf, byteOnLine++);
+ appendHexByte(b, linebuf, byteOnLine++);
}
appendHexSpaces(linebuf, byteOnLine);
if (extraLines > 0) {
printDescription(""); //$NON-NLS-1$
}
-
+
fExtraVerboseLines += extraLines;
print(linebuf);
if (extraLines > 0) {
@@ -395,48 +397,52 @@ public class VerboseWriter {
}
/**
- * Prints string representation of a value given a Map from values to strings.
+ * Prints string representation of a value given a Map from values to
+ * strings.
*/
- public void printValue(int value, Map valueToString) {
+ public void printValue(int value, Map<Integer, String> valueToString) {
Integer val = new Integer(value);
if (valueToString == null) {
print(val.toString());
- return;
+ return;
}
- String result = (String)valueToString.get(val);
+ String result = valueToString.get(val);
if (result == null) {
- print(val.toString() + JDIMessages.VerboseWriter___unknown_value__1);
+ print(val.toString() + JDIMessages.VerboseWriter___unknown_value__1);
} else {
print(result);
}
}
-
+
/**
- * Prints string representation of a value given a Vector with the names of the bits.
+ * Prints string representation of a value given a Vector with the names of
+ * the bits.
*/
public void printValue(byte value, String[] bitNames) {
printValue(value & 0xff, bitNames);
}
/**
- * Prints string representation of a value given a Vector with the names of the bits.
+ * Prints string representation of a value given a Vector with the names of
+ * the bits.
*/
public void printValue(short value, String[] bitNames) {
printValue(value & 0xffff, bitNames);
}
/**
- * Prints string representation of a value given a Vector with the names of the bits.
+ * Prints string representation of a value given a Vector with the names of
+ * the bits.
*/
public void printValue(int value, String[] bitNames) {
Integer val = new Integer(value);
if (bitNames == null) {
print(val.toString());
- return;
+ return;
}
-
+
boolean bitsSet = false;
-
+
for (int i = 0; i < bitNames.length; i++) {
// Test if bit is set in value.
if ((1 << i & value) == 0) {
@@ -446,7 +452,7 @@ public class VerboseWriter {
// See if we have a desciption for the bit.
String bitString = bitNames[i];
if (bitString == null) {
- bitString = JDIMessages.VerboseWriter__unknown_bit__2;
+ bitString = JDIMessages.VerboseWriter__unknown_bit__2;
}
if (!bitsSet) {
@@ -459,27 +465,27 @@ public class VerboseWriter {
}
if (!bitsSet) {
- print(JDIMessages.VerboseWriter__none__4);
+ print(JDIMessages.VerboseWriter__none__4);
}
}
-
+
/**
- * Checks if a new line is written to. If so, first erase any data on that line.
- * Line is marked 'not new' after this command.
+ * Checks if a new line is written to. If so, first erase any data on that
+ * line. Line is marked 'not new' after this command.
*/
private void checkForNewLine() {
if (fNewLine) {
- ((StringBuffer)(fLineBuffer.get(fPosition))).setLength(0);
+ (fLineBuffer.get(fPosition)).setLength(0);
fNewLine = false;
}
}
-
+
/**
* Print a String.
*/
public void print(String str) {
checkForNewLine();
- ((StringBuffer)(fLineBuffer.get(fPosition))).append(str);
+ (fLineBuffer.get(fPosition)).append(str);
}
/**
@@ -487,7 +493,7 @@ public class VerboseWriter {
*/
public void print(char c) {
checkForNewLine();
- ((StringBuffer)(fLineBuffer.get(fPosition))).append(c);
+ (fLineBuffer.get(fPosition)).append(c);
}
/**
@@ -495,7 +501,7 @@ public class VerboseWriter {
*/
public void print(char[] c) {
checkForNewLine();
- ((StringBuffer)(fLineBuffer.get(fPosition))).append(c);
+ (fLineBuffer.get(fPosition)).append(c);
}
/**
@@ -507,33 +513,32 @@ public class VerboseWriter {
}
/**
- * Flush buffer.
- * If autoflush is off, this method is synchronized on the PrintWriter given in the constructor.
+ * Flush buffer. If autoflush is off, this method is synchronized on the
+ * PrintWriter given in the constructor.
*/
public void flush() {
- synchronized(fOutput) {
+ synchronized (fOutput) {
int bufSize = fLineBuffer.size();
-
+
for (int i = 0; i < bufSize - 1; i++)
- fOutput.println(new String((StringBuffer)fLineBuffer.get(i)));
-
+ fOutput.println(new String(fLineBuffer.get(i)));
+
// The last line should be printed without an extra newline
- StringBuffer lastLine = (StringBuffer)fLineBuffer.get(bufSize - 1);
+ StringBuffer lastLine = fLineBuffer.get(bufSize - 1);
if (lastLine.length() > 0)
fOutput.print(new String(lastLine));
-
+
fOutput.flush();
fLineBuffer.clear();
fPosition = 0;
fLineBuffer.add(new StringBuffer());
}
}
-
+
/**
- * Go to the given position in the buffer.
- * If the given position is smaller than the current position,
- * subsequent print commands overwrite existing lines in the buffer.
- * Else, new lines are added to the buffer.
+ * Go to the given position in the buffer. If the given position is smaller
+ * than the current position, subsequent print commands overwrite existing
+ * lines in the buffer. Else, new lines are added to the buffer.
*/
public void gotoPosition(int pos) {
int delta = pos - fPosition;
@@ -558,15 +563,16 @@ public class VerboseWriter {
public int position() {
return fPosition;
}
-
+
/**
- * Terminate the current line by writing the line separator string, start at end of next line.
+ * Terminate the current line by writing the line separator string, start at
+ * end of next line.
*/
public void markLn() {
if (++fPosition == fLineBuffer.size()) {
fLineBuffer.add(new StringBuffer());
}
-
+
fNewLine = true;
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java
index ee87d8342..41133d1d3 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -43,8 +42,10 @@ import com.sun.jdi.FloatValue;
import com.sun.jdi.IntegerValue;
import com.sun.jdi.LongValue;
import com.sun.jdi.ObjectCollectedException;
+import com.sun.jdi.ReferenceType;
import com.sun.jdi.ShortValue;
import com.sun.jdi.StringReference;
+import com.sun.jdi.Type;
import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.VoidValue;
@@ -53,60 +54,62 @@ import com.sun.jdi.event.EventQueue;
import com.sun.jdi.request.EventRequestManager;
/**
- * This class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * This class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, org.eclipse.jdi.hcr.VirtualMachine, org.eclipse.jdi.VirtualMachine {
+public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine,
+ org.eclipse.jdi.hcr.VirtualMachine, org.eclipse.jdi.VirtualMachine {
/** Result flags for Classes Have Changed command. */
public static final byte HCR_RELOAD_SUCCESS = 0;
public static final byte HCR_RELOAD_FAILURE = 1;
public static final byte HCR_RELOAD_IGNORED = 2;
- /* Indexes in HCR capabilities list.*/
+ /* Indexes in HCR capabilities list. */
private static final int HCR_CAN_RELOAD_CLASSES = 0;
private static final int HCR_CAN_GET_CLASS_VERSION = 1;
private static final int HCR_CAN_DO_RETURN = 2;
private static final int HCR_CAN_REENTER_ON_EXIT = 3;
-
- protected static final String JAVA_STRATUM_NAME= "Java"; //$NON-NLS-1$
-
+
+ protected static final String JAVA_STRATUM_NAME = "Java"; //$NON-NLS-1$
+
/** Timeout value for requests to VM if not overriden for a particular VM. */
private int fRequestTimeout;
/** Mapping of command codes to strings. */
-
- private static Map fgHCRResultMap = null;
+
+ private static Map<Integer, String> fgHCRResultMap = null;
/** EventRequestManager that creates event objects on request. */
private EventRequestManagerImpl fEventReqMgr;
/** EventQueue that returns EventSets from the Virtual Manager. */
private EventQueueImpl fEventQueue;
-
+
/** If a launchingconnector is used, we store the process. */
private Process fLaunchedProcess;
-
+
/**
- * The following field contains cached Mirrors.
- * Note that these are optional: their only purpose is to speed up the debugger by
- * being able to use the stored results of JDWP calls.
+ * The following field contains cached Mirrors. Note that these are
+ * optional: their only purpose is to speed up the debugger by being able to
+ * use the stored results of JDWP calls.
*/
private ValueCache fCachedReftypes = new ValueCache();
- private ValueCache fCachedObjects = new ValueCache();
+ private ValueCache fCachedObjects = new ValueCache();
/** The following are the stored results of JDWP calls. */
- private String fVersionDescription = null; // Text information on the VM version.
+ private String fVersionDescription = null; // Text information on the VM
+ // version.
private int fJdwpMajorVersion;
private int fJdwpMinorVersion;
- private String fVMVersion; // Target VM JRE version, as in the java.version property.
- private String fVMName; // Target VM name, as in the java.vm.name property.
+ private String fVMVersion; // Target VM JRE version, as in the java.version
+ // property.
+ private String fVMName; // Target VM name, as in the java.vm.name property.
private boolean fGotIDSizes = false;
private int fFieldIDSize;
private int fMethodIDSize;
private int fObjectIDSize;
private int fReferenceTypeIDSize;
private int fFrameIDSize;
-
+
private boolean fGotCapabilities = false;
private boolean fCanWatchFieldModification;
private boolean fCanWatchFieldAccess;
@@ -130,7 +133,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
private boolean fCanRequestMonitorEvents;
private boolean fCanGetMonitorFrameInfo;
private boolean[] fHcrCapabilities = null;
-
+
/*
* singletons for primitive types
*/
@@ -142,7 +145,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
private IntegerTypeImpl fIntegerType;
private LongTypeImpl fLongType;
private ShortTypeImpl fShortType;
-
+
/**
* Disconnected flag
*/
@@ -150,83 +153,86 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
/**
* The name of the current default stratum.
- */
+ */
private String fDefaultStratum;
- private PacketReceiveManager fPacketReceiveManager;
- private PacketSendManager fPacketSendManager;
-
- /**
+ private PacketReceiveManager fPacketReceiveManager;
+ private PacketSendManager fPacketSendManager;
+
+ /**
* Creates a new Virtual Machine.
*/
public VirtualMachineImpl(Connection connection) {
super("VirtualMachine"); //$NON-NLS-1$
fEventReqMgr = new EventRequestManagerImpl(this);
fEventQueue = new EventQueueImpl(this);
- fRequestTimeout = ((VirtualMachineManagerImpl) Bootstrap.virtualMachineManager()).getGlobalRequestTimeout();
-
+ fRequestTimeout = ((VirtualMachineManagerImpl) Bootstrap
+ .virtualMachineManager()).getGlobalRequestTimeout();
+
fPacketReceiveManager = new PacketReceiveManager(connection, this);
- Thread receiveThread = new Thread(fPacketReceiveManager, JDIMessages.VirtualMachineImpl_0);
- receiveThread.setDaemon(true);
+ Thread receiveThread = new Thread(fPacketReceiveManager,
+ JDIMessages.VirtualMachineImpl_0);
+ receiveThread.setDaemon(true);
fPacketReceiveManager.setPartnerThread(receiveThread);
receiveThread.start();
-
+
fPacketSendManager = new PacketSendManager(connection);
- Thread sendThread = new Thread(fPacketSendManager, JDIMessages.VirtualMachineImpl_1);
- sendThread.setDaemon(true);
+ Thread sendThread = new Thread(fPacketSendManager,
+ JDIMessages.VirtualMachineImpl_1);
+ sendThread.setDaemon(true);
fPacketReceiveManager.setPartnerThread(sendThread);
sendThread.start();
}
- /**
+ /**
* @return Returns size of JDWP ID.
*/
public final int fieldIDSize() {
return fFieldIDSize;
}
-
- /**
+
+ /**
* @return Returns size of JDWP ID.
*/
public final int methodIDSize() {
return fMethodIDSize;
}
-
- /**
+
+ /**
* @return Returns size of JDWP ID.
*/
public final int objectIDSize() {
return fObjectIDSize;
}
-
- /**
+
+ /**
* @return Returns size of JDWP ID.
*/
public final int referenceTypeIDSize() {
return fReferenceTypeIDSize;
}
-
- /**
+
+ /**
* @return Returns size of JDWP ID.
*/
public final int frameIDSize() {
return fFrameIDSize;
}
-
- /**
+
+ /**
* @return Returns cached mirror object, or null if method is not in cache.
*/
public ReferenceTypeImpl getCachedMirror(JdwpReferenceTypeID ID) {
- return (ReferenceTypeImpl)fCachedReftypes.get(ID);
+ return (ReferenceTypeImpl) fCachedReftypes.get(ID);
}
-
- /**
+
+ /**
* @return Returns cached mirror object, or null if method is not in cache.
*/
public ObjectReferenceImpl getCachedMirror(JdwpObjectID ID) {
- return (ObjectReferenceImpl)fCachedObjects.get(ID);
+ return (ObjectReferenceImpl) fCachedObjects.get(ID);
}
-
- /**
+
+ /**
* Adds mirror object to cache.
*/
public void addCachedMirror(ReferenceTypeImpl mirror) {
@@ -235,56 +241,58 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
// classes that we know of due to a limitation in the J9 VM.
// eventRequestManagerImpl().enableInternalClasUnloadEvent(mirror);
}
-
- /**
+
+ /**
* Adds mirror object to cache.
*/
public void addCachedMirror(ObjectReferenceImpl mirror) {
fCachedObjects.put(mirror.getObjectID(), mirror);
}
-
+
/**
* Flushes all stored Jdwp results.
*/
public void flushStoredJdwpResults() {
// All known classes also become invalid.
- Iterator iter = fCachedReftypes.values().iterator();
+ Iterator<Object> iter = fCachedReftypes.values().iterator();
while (iter.hasNext()) {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)iter.next();
+ ReferenceTypeImpl refType = (ReferenceTypeImpl) iter.next();
refType.flushStoredJdwpResults();
}
-
+
fVersionDescription = null;
fGotIDSizes = false;
fHcrCapabilities = null;
}
/*
- * Removes a known class.
- * A class/interface is known if we have ever received its ReferenceTypeID and we have
- * not received an unload event for it.
+ * Removes a known class. A class/interface is known if we have ever
+ * received its ReferenceTypeID and we have not received an unload event for
+ * it.
*/
public final void removeKnownRefType(String signature) {
List refTypeList = classesBySignature(signature);
if (refTypeList.isEmpty())
return;
- // If we have only one known class for this signature, we known that this is the class
+ // If we have only one known class for this signature, we known that
+ // this is the class
// to be removed.
if (refTypeList.size() == 1) {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)refTypeList.get(0);
+ ReferenceTypeImpl refType = (ReferenceTypeImpl) refTypeList.get(0);
refType.flushStoredJdwpResults();
fCachedReftypes.remove(refType.getRefTypeID());
return;
}
-
- // We have more than one known class for the signature, let's find the unloaded one(s).
+
+ // We have more than one known class for the signature, let's find the
+ // unloaded one(s).
Iterator iter = refTypeList.iterator();
while (iter.hasNext()) {
- ReferenceTypeImpl refType = (ReferenceTypeImpl)iter.next();
- boolean prepared= false;
+ ReferenceTypeImpl refType = (ReferenceTypeImpl) iter.next();
+ boolean prepared = false;
try {
- prepared= refType.isPrepared();
+ prepared = refType.isPrepared();
} catch (ObjectCollectedException exception) {
// The type is unloaded. Fall through
}
@@ -297,19 +305,23 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
}
/*
- * @exception Throws UnsupportedOperationException if VM does not support J9 HCR.
+ * @exception Throws UnsupportedOperationException if VM does not support J9
+ * HCR.
*/
public void checkHCRSupported() throws UnsupportedOperationException {
if (!isHCRSupported())
- throw new UnsupportedOperationException(MessageFormat.format(JDIMessages.VirtualMachineImpl_Target_VM__0__does_not_support_Hot_Code_Replacement_1, new String[]{name()}));
+ throw new UnsupportedOperationException(
+ MessageFormat
+ .format(JDIMessages.VirtualMachineImpl_Target_VM__0__does_not_support_Hot_Code_Replacement_1,
+ new String[] { name() }));
}
-
+
/*
* Returns whether J9 HCR is supported
*/
public boolean isHCRSupported() throws UnsupportedOperationException {
return name().equals("j9"); //$NON-NLS-1$
- }
+ }
/*
* @return Returns Manager for receiving packets from the Virtual Machine.
@@ -323,18 +335,21 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
public final PacketSendManager packetSendManager() {
/*
- * Before we send out first bytes to the VM by JDI calls, we need some initial requests:
- * - Get the sizes of the IDs (fieldID, method ID etc.) that the VM uses;
- * - Request class prepare and unload events. We used these to cache classes/interfaces and map their signatures.
+ * Before we send out first bytes to the VM by JDI calls, we need some
+ * initial requests: - Get the sizes of the IDs (fieldID, method ID
+ * etc.) that the VM uses; - Request class prepare and unload events. We
+ * used these to cache classes/interfaces and map their signatures.
*/
if (!fGotIDSizes) {
getIDSizes();
- if (!fGotIDSizes) { // We can't do much without them.
+ if (!fGotIDSizes) { // We can't do much without them.
disconnectVM();
- throw new VMDisconnectedException(JDIMessages.VirtualMachineImpl_Failed_to_get_ID_sizes_2);
+ throw new VMDisconnectedException(
+ JDIMessages.VirtualMachineImpl_Failed_to_get_ID_sizes_2);
}
- // tbd: This call should be moved to addKnownRefType() when it can be made specific
+ // tbd: This call should be moved to addKnownRefType() when it can
+ // be made specific
// for a referencetype.
eventRequestManagerImpl().enableInternalClasUnloadEvent();
}
@@ -343,22 +358,27 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
}
/**
- * Returns all loaded types (classes, interfaces, and array types).
- * For each loaded type in the target VM a ReferenceType will be placed in the returned list.
+ * Returns all loaded types (classes, interfaces, and array types). For each
+ * loaded type in the target VM a ReferenceType will be placed in the
+ * returned list.
*/
- public List allClasses() {
+ public List<ReferenceType> allClasses() {
// Note that this information should not be cached.
initJdwpRequest();
try {
- boolean withGenericSignature= virtualMachineImpl().isJdwpVersionGreaterOrEqual(1, 5);
- int jdwpCommand= withGenericSignature ? JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC : JdwpCommandPacket.VM_ALL_CLASSES;
- JdwpReplyPacket replyPacket = requestVM(jdwpCommand);
+ boolean withGenericSignature = virtualMachineImpl()
+ .isJdwpVersionGreaterOrEqual(1, 5);
+ int jdwpCommand = withGenericSignature ? JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC
+ : JdwpCommandPacket.VM_ALL_CLASSES;
+ JdwpReplyPacket replyPacket = requestVM(jdwpCommand);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- List elements = new ArrayList(nrOfElements);
+ List<ReferenceType> elements = new ArrayList<ReferenceType>(nrOfElements);
for (int i = 0; i < nrOfElements; i++) {
- ReferenceTypeImpl elt = ReferenceTypeImpl.readWithTypeTagAndSignature(this, withGenericSignature, replyData);
+ ReferenceTypeImpl elt = ReferenceTypeImpl
+ .readWithTypeTagAndSignature(this,
+ withGenericSignature, replyData);
if (elt == null) {
continue;
}
@@ -378,22 +398,23 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
/**
* @return Returns an iterator over all loaded classes.
*/
- protected final Iterator allRefTypes() {
+ protected final Iterator<ReferenceType> allRefTypes() {
return allClasses().iterator();
}
/**
* @return Returns an iterator over all cached classes.
*/
- protected final Iterator allCachedRefTypes() {
+ protected final Iterator<Object> allCachedRefTypes() {
return fCachedReftypes.values().iterator();
}
/**
- * Returns a list of the currently running threads.
- * For each running thread in the target VM, a ThreadReference that mirrors it is placed in the list.
+ * Returns a list of the currently running threads. For each running thread
+ * in the target VM, a ThreadReference that mirrors it is placed in the
+ * list.
*/
- public List allThreads() {
+ public List<ThreadReferenceImpl> allThreads() {
// Note that this information should not be cached.
initJdwpRequest();
try {
@@ -401,9 +422,10 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
- List elements = new ArrayList(nrOfElements);
+ List<ThreadReferenceImpl> elements = new ArrayList<ThreadReferenceImpl>(nrOfElements);
for (int i = 0; i < nrOfElements; i++) {
- ThreadReferenceImpl elt = ThreadReferenceImpl.read(this, replyData);
+ ThreadReferenceImpl elt = ThreadReferenceImpl.read(this,
+ replyData);
if (elt == null) {
continue;
}
@@ -417,57 +439,69 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
handledJdwpRequest();
}
}
-
+
/**
- * Retrieve this VM's capabilities.
+ * Retrieve this VM's capabilities.
*/
public void getCapabilities() {
if (fGotCapabilities)
return;
-
- int command = JdwpCommandPacket.VM_CAPABILITIES;
+
+ int command = JdwpCommandPacket.VM_CAPABILITIES;
if (isJdwpVersionGreaterOrEqual(1, 4)) {
command = JdwpCommandPacket.VM_CAPABILITIES_NEW;
}
-
+
initJdwpRequest();
try {
JdwpReplyPacket replyPacket = requestVM(command);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
-
- fCanWatchFieldModification = readBoolean("watch field modification", replyData); //$NON-NLS-1$
+
+ fCanWatchFieldModification = readBoolean(
+ "watch field modification", replyData); //$NON-NLS-1$
fCanWatchFieldAccess = readBoolean("watch field access", replyData); //$NON-NLS-1$
fCanGetBytecodes = readBoolean("get bytecodes", replyData); //$NON-NLS-1$
fCanGetSyntheticAttribute = readBoolean("synth. attr", replyData); //$NON-NLS-1$
- fCanGetOwnedMonitorInfo = readBoolean("owned monitor info", replyData); //$NON-NLS-1$
- fCanGetCurrentContendedMonitor = readBoolean("curr. contended monitor", replyData); //$NON-NLS-1$
+ fCanGetOwnedMonitorInfo = readBoolean(
+ "owned monitor info", replyData); //$NON-NLS-1$
+ fCanGetCurrentContendedMonitor = readBoolean(
+ "curr. contended monitor", replyData); //$NON-NLS-1$
fCanGetMonitorInfo = readBoolean("monitor info", replyData); //$NON-NLS-1$
if (command == JdwpCommandPacket.VM_CAPABILITIES_NEW) {
// extended capabilities
fCanRedefineClasses = readBoolean("redefine classes", replyData); //$NON-NLS-1$
fCanAddMethod = readBoolean("add method", replyData); //$NON-NLS-1$
- fCanUnrestrictedlyRedefineClasses = readBoolean("unrestrictedly redefine classes", replyData); //$NON-NLS-1$
+ fCanUnrestrictedlyRedefineClasses = readBoolean(
+ "unrestrictedly redefine classes", replyData); //$NON-NLS-1$
fCanPopFrames = readBoolean("pop frames", replyData); //$NON-NLS-1$
- fCanUseInstanceFilters = readBoolean("use instance filters", replyData); //$NON-NLS-1$
- fCanGetSourceDebugExtension = readBoolean("get source debug extension", replyData); //$NON-NLS-1$
- fCanRequestVMDeathEvent = readBoolean("request vm death", replyData); //$NON-NLS-1$
- fCanSetDefaultStratum= readBoolean("set default stratum", replyData); //$NON-NLS-1$
+ fCanUseInstanceFilters = readBoolean(
+ "use instance filters", replyData); //$NON-NLS-1$
+ fCanGetSourceDebugExtension = readBoolean(
+ "get source debug extension", replyData); //$NON-NLS-1$
+ fCanRequestVMDeathEvent = readBoolean(
+ "request vm death", replyData); //$NON-NLS-1$
+ fCanSetDefaultStratum = readBoolean(
+ "set default stratum", replyData); //$NON-NLS-1$
fCanGetInstanceInfo = readBoolean("instance info", replyData); //$NON-NLS-1$
- fCanRequestMonitorEvents = readBoolean("request monitor events", replyData); //$NON-NLS-1$
- fCanGetMonitorFrameInfo = readBoolean("monitor frame info", replyData); //$NON-NLS-1$
- fCanUseSourceNameFilters = readBoolean("source name filters", replyData); //$NON-NLS-1$
+ fCanRequestMonitorEvents = readBoolean(
+ "request monitor events", replyData); //$NON-NLS-1$
+ fCanGetMonitorFrameInfo = readBoolean(
+ "monitor frame info", replyData); //$NON-NLS-1$
+ fCanUseSourceNameFilters = readBoolean(
+ "source name filters", replyData); //$NON-NLS-1$
fCanGetConstantPool = readBoolean("constant pool", replyData); //$NON-NLS-1$
- fCanForceEarlyReturn = readBoolean("force early return", replyData); //$NON-NLS-1$
+ fCanForceEarlyReturn = readBoolean(
+ "force early return", replyData); //$NON-NLS-1$
} else {
fCanRedefineClasses = false;
fCanAddMethod = false;
fCanUnrestrictedlyRedefineClasses = false;
- fCanPopFrames = false;
+ fCanPopFrames = false;
fCanUseInstanceFilters = false;
fCanGetSourceDebugExtension = false;
fCanRequestVMDeathEvent = false;
- fCanSetDefaultStratum= false;
+ fCanSetDefaultStratum = false;
fCanGetInstanceInfo = false;
fCanGetConstantPool = false;
fCanUseSourceNameFilters = false;
@@ -483,7 +517,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
handledJdwpRequest();
}
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#canForceEarlyReturn()
* @since 3.3
@@ -492,23 +526,25 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getCapabilities();
return fCanForceEarlyReturn;
}
-
+
/**
- * @return Returns true if this implementation supports the retrieval of a method's bytecodes.
+ * @return Returns true if this implementation supports the retrieval of a
+ * method's bytecodes.
*/
public boolean canGetBytecodes() {
getCapabilities();
return fCanGetBytecodes;
}
-
+
/**
- * @return Returns true if this implementation supports the retrieval of the monitor for which a thread is currently waiting.
+ * @return Returns true if this implementation supports the retrieval of the
+ * monitor for which a thread is currently waiting.
*/
public boolean canGetCurrentContendedMonitor() {
getCapabilities();
return fCanGetCurrentContendedMonitor;
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#canGetInstanceInfo()
* @since 3.3
@@ -517,7 +553,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getCapabilities();
return fCanGetInstanceInfo;
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#canGetMethodReturnValues()
* @since 3.3
@@ -525,15 +561,16 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
public boolean canGetMethodReturnValues() {
return isJdwpVersionGreaterOrEqual(1, 6);
}
-
+
/**
- * @return Returns true if this implementation supports the retrieval of the monitor information for an object.
+ * @return Returns true if this implementation supports the retrieval of the
+ * monitor information for an object.
*/
public boolean canGetMonitorInfo() {
getCapabilities();
return fCanGetMonitorInfo;
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#canGetMonitorFrameInfo()
* @since 3.3
@@ -542,24 +579,25 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getCapabilities();
return fCanGetMonitorFrameInfo;
}
-
+
/**
- * @return Returns true if this implementation supports the retrieval of the monitors owned by a thread.
+ * @return Returns true if this implementation supports the retrieval of the
+ * monitors owned by a thread.
*/
public boolean canGetOwnedMonitorInfo() {
getCapabilities();
return fCanGetOwnedMonitorInfo;
}
-
- /**
- * @return Returns true if this implementation supports the query of the synthetic attribute of a method or field.
+ /**
+ * @return Returns true if this implementation supports the query of the
+ * synthetic attribute of a method or field.
*/
public boolean canGetSyntheticAttribute() {
getCapabilities();
return fCanGetSyntheticAttribute;
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#canRequestMonitorEvents()
* @since 3.3
@@ -568,23 +606,25 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getCapabilities();
return fCanRequestMonitorEvents;
}
-
+
/**
- * @return Returns true if this implementation supports watchpoints for field access.
+ * @return Returns true if this implementation supports watchpoints for
+ * field access.
*/
public boolean canWatchFieldAccess() {
getCapabilities();
return fCanWatchFieldAccess;
}
-
+
/**
- * @return Returns true if this implementation supports watchpoints for field modification.
+ * @return Returns true if this implementation supports watchpoints for
+ * field modification.
*/
public boolean canWatchFieldModification() {
getCapabilities();
return fCanWatchFieldModification;
}
-
+
/**
* @return Returns the loaded reference types that match a given signature.
*/
@@ -596,13 +636,15 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
DataOutputStream outData = new DataOutputStream(outBytes);
writeString(signature, "signature", outData); //$NON-NLS-1$
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE, outBytes);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
List elements = new ArrayList(nrOfElements);
for (int i = 0; i < nrOfElements; i++) {
- ReferenceTypeImpl elt = ReferenceTypeImpl.readWithTypeTag(this, replyData);
+ ReferenceTypeImpl elt = ReferenceTypeImpl.readWithTypeTag(this,
+ replyData);
readInt("status", ReferenceTypeImpl.classStatusStrings(), replyData); //$NON-NLS-1$
if (elt == null) {
continue;
@@ -617,7 +659,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
handledJdwpRequest();
}
}
-
+
/**
* @return Returns the loaded reference types that match a given name.
*/
@@ -625,7 +667,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
String signature = TypeImpl.classNameToSignature(name);
return classesBySignature(signature);
}
-
+
/**
* Invalidates this virtual machine mirror.
*/
@@ -640,30 +682,33 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
handledJdwpRequest();
}
}
-
+
/**
- * @return Returns EventQueue that returns EventSets from the Virtual Manager.
+ * @return Returns EventQueue that returns EventSets from the Virtual
+ * Manager.
*/
public EventQueue eventQueue() {
return fEventQueue;
}
/**
- * @return Returns EventRequestManager that creates all event objects on request.
+ * @return Returns EventRequestManager that creates all event objects on
+ * request.
*/
public EventRequestManager eventRequestManager() {
return fEventReqMgr;
}
-
+
/**
- * @return Returns EventRequestManagerImpl that creates all event objects on request.
+ * @return Returns EventRequestManagerImpl that creates all event objects on
+ * request.
*/
public EventRequestManagerImpl eventRequestManagerImpl() {
return fEventReqMgr;
}
/**
- * Causes the mirrored VM to terminate with the given error code.
+ * Causes the mirrored VM to terminate with the given error code.
*/
public void exit(int exitCode) {
initJdwpRequest();
@@ -683,63 +728,64 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
}
/**
- * @return Returns newly created ByteValue for the given value.
+ * @return Returns newly created ByteValue for the given value.
*/
public ByteValue mirrorOf(byte value) {
return new ByteValueImpl(virtualMachineImpl(), new Byte(value));
}
/**
- * @return Returns newly created CharValue for the given value.
+ * @return Returns newly created CharValue for the given value.
*/
public CharValue mirrorOf(char value) {
return new CharValueImpl(virtualMachineImpl(), new Character(value));
}
/**
- * @return Returns newly created DoubleValue for the given value.
+ * @return Returns newly created DoubleValue for the given value.
*/
public DoubleValue mirrorOf(double value) {
return new DoubleValueImpl(virtualMachineImpl(), new Double(value));
}
/**
- * @return Returns newly created FloatValue for the given value.
+ * @return Returns newly created FloatValue for the given value.
*/
public FloatValue mirrorOf(float value) {
return new FloatValueImpl(virtualMachineImpl(), new Float(value));
}
/**
- * @return Returns newly created IntegerValue for the given value.
+ * @return Returns newly created IntegerValue for the given value.
*/
public IntegerValue mirrorOf(int value) {
return new IntegerValueImpl(virtualMachineImpl(), new Integer(value));
}
/**
- * @return Returns newly created LongValue for the given value.
+ * @return Returns newly created LongValue for the given value.
*/
public LongValue mirrorOf(long value) {
return new LongValueImpl(virtualMachineImpl(), new Long(value));
}
/**
- * @return Returns newly created ShortValue for the given value.
+ * @return Returns newly created ShortValue for the given value.
*/
public ShortValue mirrorOf(short value) {
return new ShortValueImpl(virtualMachineImpl(), new Short(value));
}
/**
- * @return Returns newly created BooleanValue for the given value.
+ * @return Returns newly created BooleanValue for the given value.
*/
public BooleanValue mirrorOf(boolean value) {
- return new BooleanValueImpl(virtualMachineImpl(), Boolean.valueOf(value));
+ return new BooleanValueImpl(virtualMachineImpl(),
+ Boolean.valueOf(value));
}
-
+
/**
- * @return Returns newly created StringReference for the given value.
+ * @return Returns newly created StringReference for the given value.
*/
public StringReference mirrorOf(String value) {
initJdwpRequest();
@@ -747,10 +793,11 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeString(value, "string value", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.VM_CREATE_STRING, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.VM_CREATE_STRING, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
StringReference result = StringReferenceImpl.read(this, replyData);
return result;
@@ -761,7 +808,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
handledJdwpRequest();
}
}
-
+
/**
* Returns a void value from the VM.
*
@@ -772,21 +819,24 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
}
/**
- * @return Returns the Process object for this virtual machine if launched by a LaunchingConnector.
+ * @return Returns the Process object for this virtual machine if launched
+ * by a LaunchingConnector.
*/
public Process process() {
- return fLaunchedProcess;
+ return fLaunchedProcess;
}
-
+
/**
- * Sets Process object for this virtual machine if launched by a LaunchingConnector.
+ * Sets Process object for this virtual machine if launched by a
+ * LaunchingConnector.
*/
public void setLaunchedProcess(Process proc) {
fLaunchedProcess = proc;
}
-
- /**
- * Continues the execution of the application running in this virtual machine.
+
+ /**
+ * Continues the execution of the application running in this virtual
+ * machine.
*/
public void resume() {
initJdwpRequest();
@@ -798,12 +848,12 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
handledJdwpRequest();
}
}
-
+
public void setDebugTraceMode(int traceFlags) {
// We don't have trace info.
}
- /**
+ /**
* Suspends all threads.
*/
public void suspend() {
@@ -815,19 +865,20 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
handledJdwpRequest();
}
}
-
- public List topLevelThreadGroups() {
+
+ public List<ThreadGroupReferenceImpl> topLevelThreadGroups() {
// Note that this information should not be cached.
initJdwpRequest();
try {
JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.VM_TOP_LEVEL_THREAD_GROUPS);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int nrGroups = readInt("nr of groups", replyData); //$NON-NLS-1$
- ArrayList result = new ArrayList(nrGroups);
+ ArrayList<ThreadGroupReferenceImpl> result = new ArrayList<ThreadGroupReferenceImpl>(nrGroups);
for (int i = 0; i < nrGroups; i++) {
- ThreadGroupReferenceImpl threadGroup = ThreadGroupReferenceImpl.read(this, replyData);
+ ThreadGroupReferenceImpl threadGroup = ThreadGroupReferenceImpl
+ .read(this, replyData);
result.add(threadGroup);
}
return result;
@@ -839,38 +890,41 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
}
}
- /**
- * @return Returns the name of the target VM as reported by the property java.vm.name.
+ /**
+ * @return Returns the name of the target VM as reported by the property
+ * java.vm.name.
*/
public String name() {
getVersionInfo();
return fVMName;
}
-
- /**
- * @return Returns the version of the Java Runtime Environment in the target VM as reported by the property java.version.
+
+ /**
+ * @return Returns the version of the Java Runtime Environment in the target
+ * VM as reported by the property java.version.
*/
public String version() {
getVersionInfo();
return fVMVersion;
}
-
- /**
- * @return Returns text information on the target VM and the debugger support that mirrors it.
+
+ /**
+ * @return Returns text information on the target VM and the debugger
+ * support that mirrors it.
*/
public String description() {
getVersionInfo();
return fVersionDescription;
}
-
+
/**
* Reset event flags of all threads.
*/
private void resetThreadEventFlags() {
- Iterator iter = allThreads().iterator();
+ Iterator<ThreadReferenceImpl> iter = allThreads().iterator();
ThreadReferenceImpl thread;
while (iter.hasNext()) {
- thread = (ThreadReferenceImpl)iter.next();
+ thread = iter.next();
thread.resetEventFlags();
}
}
@@ -887,16 +941,18 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
* because getIDSizes() calls requestVM which calls packetSendManager.
*/
fGotIDSizes = true;
-
- // We use a different mirror to avoid having verbose output mixed with the initiating command.
+
+ // We use a different mirror to avoid having verbose output mixed with
+ // the initiating command.
MirrorImpl mirror = new VoidValueImpl(this);
-
+
mirror.initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = mirror.requestVM(JdwpCommandPacket.VM_ID_SIZES);
+ JdwpReplyPacket replyPacket = mirror
+ .requestVM(JdwpCommandPacket.VM_ID_SIZES);
mirror.defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
-
+
fFieldIDSize = mirror.readInt("field ID size", replyData); //$NON-NLS-1$
fMethodIDSize = mirror.readInt("method ID size", replyData); //$NON-NLS-1$
fObjectIDSize = mirror.readInt("object ID size", replyData); //$NON-NLS-1$
@@ -909,40 +965,40 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
mirror.handledJdwpRequest();
}
}
-
+
/**
* Retrieves version info of the VM.
*/
public void getVersionInfo() {
if (fVersionDescription != null)
return;
-
+
initJdwpRequest();
try {
JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.VM_VERSION);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
-
+
fVersionDescription = readString("version descr.", replyData); //$NON-NLS-1$
fJdwpMajorVersion = readInt("major version", replyData); //$NON-NLS-1$
fJdwpMinorVersion = readInt("minor version", replyData); //$NON-NLS-1$
fVMVersion = readString("version", replyData); //$NON-NLS-1$
fVMName = readString("name", replyData); //$NON-NLS-1$
-
+
if ((fVMName != null) && fVMName.equals("KVM")) { //$NON-NLS-1$
// KVM requires class preparation events in order
// to resolve things correctly
eventRequestManagerImpl().enableInternalClassPrepareEvent();
}
- } catch (IOException e) {
+ } catch (IOException e) {
fVersionDescription = null;
defaultIOExceptionHandler(e);
} finally {
handledJdwpRequest();
}
}
-
+
/**
* Retrieves the HCR capabilities of the VM.
*/
@@ -950,18 +1006,22 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
if (fHcrCapabilities != null)
return;
fHcrCapabilities = new boolean[HCR_CAN_REENTER_ON_EXIT + 1];
-
+
if (isHCRSupported()) {
initJdwpRequest();
try {
JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.HCR_CAPABILITIES);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
-
- fHcrCapabilities[HCR_CAN_RELOAD_CLASSES] = readBoolean("reload classes", replyData); //$NON-NLS-1$
- fHcrCapabilities[HCR_CAN_GET_CLASS_VERSION] = readBoolean("get class version", replyData); //$NON-NLS-1$
- fHcrCapabilities[HCR_CAN_DO_RETURN] = readBoolean("do return", replyData); //$NON-NLS-1$
- fHcrCapabilities[HCR_CAN_REENTER_ON_EXIT] = readBoolean("reenter on exit", replyData); //$NON-NLS-1$
+
+ fHcrCapabilities[HCR_CAN_RELOAD_CLASSES] = readBoolean(
+ "reload classes", replyData); //$NON-NLS-1$
+ fHcrCapabilities[HCR_CAN_GET_CLASS_VERSION] = readBoolean(
+ "get class version", replyData); //$NON-NLS-1$
+ fHcrCapabilities[HCR_CAN_DO_RETURN] = readBoolean(
+ "do return", replyData); //$NON-NLS-1$
+ fHcrCapabilities[HCR_CAN_REENTER_ON_EXIT] = readBoolean(
+ "reenter on exit", replyData); //$NON-NLS-1$
} catch (IOException e) {
fHcrCapabilities = null;
defaultIOExceptionHandler(e);
@@ -974,15 +1034,16 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
}
}
}
-
+
/**
- * @return Returns Whether VM can deal with the 'Classes have Changed' command.
+ * @return Returns Whether VM can deal with the 'Classes have Changed'
+ * command.
*/
public boolean canReloadClasses() {
getHCRCapabilities();
return fHcrCapabilities[HCR_CAN_RELOAD_CLASSES];
}
-
+
/**
* @return Returns Whether VM can get the version of a given class file.
*/
@@ -990,7 +1051,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getHCRCapabilities();
return fHcrCapabilities[HCR_CAN_GET_CLASS_VERSION];
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#canGetClassFileVersion()
* @since 3.3
@@ -998,7 +1059,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
public boolean canGetClassFileVersion() {
return isJdwpVersionGreaterOrEqual(1, 6);
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#canGetConstantPool()
* @since 3.3
@@ -1007,15 +1068,16 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getCapabilities();
return fCanGetConstantPool;
}
-
+
/**
- * @return Returns Whether VM can do a return in the middle of executing a method.
+ * @return Returns Whether VM can do a return in the middle of executing a
+ * method.
*/
public boolean canDoReturn() {
getHCRCapabilities();
return fHcrCapabilities[HCR_CAN_DO_RETURN];
}
-
+
/**
* @return Returns Whether VM can reenter a method on exit.
*/
@@ -1023,16 +1085,17 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getHCRCapabilities();
return fHcrCapabilities[HCR_CAN_REENTER_ON_EXIT];
}
-
+
/**
* Notify the VM that classes have changed due to Hot Code Replacement.
+ *
* @return Returns RELOAD_SUCCESS, RELOAD_FAILURE or RELOAD_IGNORED.
*/
public int classesHaveChanged(String[] names) {
checkHCRSupported();
// We convert the class/interface names to signatures.
String[] signatures = new String[names.length];
-
+
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
@@ -1042,21 +1105,24 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
signatures[i] = TypeImpl.classNameToSignature(names[i]);
writeString(signatures[i], "signature", outData); //$NON-NLS-1$
}
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
-
+
byte resultFlag = readByte("result", resultHCRMap(), replyData); //$NON-NLS-1$
switch (resultFlag) {
- case HCR_RELOAD_SUCCESS:
- return RELOAD_SUCCESS;
- case HCR_RELOAD_FAILURE:
- return RELOAD_FAILURE;
- case HCR_RELOAD_IGNORED:
- return RELOAD_IGNORED;
+ case HCR_RELOAD_SUCCESS:
+ return RELOAD_SUCCESS;
+ case HCR_RELOAD_FAILURE:
+ return RELOAD_FAILURE;
+ case HCR_RELOAD_IGNORED:
+ return RELOAD_IGNORED;
}
- throw new InternalError(JDIMessages.VirtualMachineImpl_Invalid_result_flag_in_Classes_Have_Changed_response___3 + resultFlag + JDIMessages.VirtualMachineImpl__4); //
+ throw new InternalError(
+ JDIMessages.VirtualMachineImpl_Invalid_result_flag_in_Classes_Have_Changed_response___3
+ + resultFlag + JDIMessages.VirtualMachineImpl__4); //
} catch (IOException e) {
defaultIOExceptionHandler(e);
return 0;
@@ -1068,6 +1134,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
try {
return name();
@@ -1083,15 +1150,16 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
if (fgHCRResultMap != null) {
return;
}
-
+
Field[] fields = VirtualMachineImpl.class.getDeclaredFields();
- fgHCRResultMap = new HashMap();
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
+ fgHCRResultMap = new HashMap<Integer, String>();
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
}
-
+
try {
String name = field.getName();
if (name.startsWith("HCR_RELOAD_")) { //$NON-NLS-1$
@@ -1108,94 +1176,102 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
}
}
}
-
+
/**
* @return Returns a map with string representations of tags.
*/
- public static Map resultHCRMap() {
- getConstantMaps();
- return fgHCRResultMap;
- }
-
+ public static Map<Integer, String> resultHCRMap() {
+ getConstantMaps();
+ return fgHCRResultMap;
+ }
+
/**
* Sets request timeout in ms.
*/
public void setRequestTimeout(int timeout) {
fRequestTimeout = timeout;
}
-
+
/**
* @return Returns request timeout in ms.
*/
public int getRequestTimeout() {
return fRequestTimeout;
}
-
+
/**
- * Returns whether the JDWP version is greater
- * than or equal to the specified major/minor
- * version numbers.
+ * Returns whether the JDWP version is greater than or equal to the
+ * specified major/minor version numbers.
*
- * @return whether the JDWP version is greater
- * than or equal to the specified major/minor
- * version numbers
+ * @return whether the JDWP version is greater than or equal to the
+ * specified major/minor version numbers
*/
public boolean isJdwpVersionGreaterOrEqual(int major, int minor) {
getVersionInfo();
- return (fJdwpMajorVersion > major) ||
- (fJdwpMajorVersion == major && fJdwpMinorVersion >= minor);
+ return (fJdwpMajorVersion > major)
+ || (fJdwpMajorVersion == major && fJdwpMinorVersion >= minor);
}
-
- public void redefineClasses(Map typesToBytes) {
+
+ public void redefineClasses(Map<ReferenceType, byte[]> typesToBytes) {
if (!canRedefineClasses()) {
throw new UnsupportedOperationException();
}
-
+
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeInt(typesToBytes.size(), "classes", outData); //$NON-NLS-1$
-
- Set types = typesToBytes.keySet();
- Iterator iter = types.iterator();
+
+ Set<ReferenceType> types = typesToBytes.keySet();
+ Iterator<ReferenceType> iter = types.iterator();
while (iter.hasNext()) {
ReferenceTypeImpl type = (ReferenceTypeImpl) iter.next();
type.write(this, outData);
- byte[] bytes = (byte[]) typesToBytes.get(type);
+ byte[] bytes = typesToBytes.get(type);
writeInt(bytes.length, "classfile", outData); //$NON-NLS-1$
- for (int i=0; i < bytes.length; i++) {
- writeByte(bytes[i], "classByte", outData); //$NON-NLS-1$
+ for (byte b : bytes) {
+ writeByte(b, "classByte", outData); //$NON-NLS-1$
}
- fCachedReftypes.remove(type.getRefTypeID()); // flush local cache of redefined types
+ fCachedReftypes.remove(type.getRefTypeID()); // flush local
+ // cache of
+ // redefined
+ // types
}
-
- JdwpReplyPacket reply = requestVM(JdwpCommandPacket.VM_REDEFINE_CLASSES, outBytes);
+
+ JdwpReplyPacket reply = requestVM(
+ JdwpCommandPacket.VM_REDEFINE_CLASSES, outBytes);
switch (reply.errorCode()) {
- case JdwpReplyPacket.UNSUPPORTED_VERSION:
- throw new UnsupportedClassVersionError();
- case JdwpReplyPacket.INVALID_CLASS_FORMAT:
- throw new ClassFormatError();
- case JdwpReplyPacket.CIRCULAR_CLASS_DEFINITION:
- throw new ClassCircularityError();
- case JdwpReplyPacket.FAILS_VERIFICATION:
- throw new VerifyError();
- case JdwpReplyPacket.NAMES_DONT_MATCH:
- throw new NoClassDefFoundError();
- case JdwpReplyPacket.ADD_METHOD_NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.VirtualMachineImpl_Add_method_not_implemented_1);
- case JdwpReplyPacket.SCHEMA_CHANGE_NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.VirtualMachineImpl_Scheme_change_not_implemented_2);
- case JdwpReplyPacket.HIERARCHY_CHANGE_NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.VirtualMachineImpl_Hierarchy_change_not_implemented_3);
- case JdwpReplyPacket.DELETE_METHOD_NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.VirtualMachineImpl_Delete_method_not_implemented_4);
- case JdwpReplyPacket.CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.VirtualMachineImpl_Class_modifiers_change_not_implemented_5);
- case JdwpReplyPacket.METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.VirtualMachineImpl_Method_modifiers_change_not_implemented_6);
- default:
- defaultReplyErrorHandler(reply.errorCode());
+ case JdwpReplyPacket.UNSUPPORTED_VERSION:
+ throw new UnsupportedClassVersionError();
+ case JdwpReplyPacket.INVALID_CLASS_FORMAT:
+ throw new ClassFormatError();
+ case JdwpReplyPacket.CIRCULAR_CLASS_DEFINITION:
+ throw new ClassCircularityError();
+ case JdwpReplyPacket.FAILS_VERIFICATION:
+ throw new VerifyError();
+ case JdwpReplyPacket.NAMES_DONT_MATCH:
+ throw new NoClassDefFoundError();
+ case JdwpReplyPacket.ADD_METHOD_NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.VirtualMachineImpl_Add_method_not_implemented_1);
+ case JdwpReplyPacket.SCHEMA_CHANGE_NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.VirtualMachineImpl_Scheme_change_not_implemented_2);
+ case JdwpReplyPacket.HIERARCHY_CHANGE_NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.VirtualMachineImpl_Hierarchy_change_not_implemented_3);
+ case JdwpReplyPacket.DELETE_METHOD_NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.VirtualMachineImpl_Delete_method_not_implemented_4);
+ case JdwpReplyPacket.CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.VirtualMachineImpl_Class_modifiers_change_not_implemented_5);
+ case JdwpReplyPacket.METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.VirtualMachineImpl_Method_modifiers_change_not_implemented_6);
+ default:
+ defaultReplyErrorHandler(reply.errorCode());
}
} catch (IOException ioe) {
defaultIOExceptionHandler(ioe);
@@ -1245,7 +1321,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getCapabilities();
return fCanUseSourceNameFilters;
}
-
+
/*
* @see VirtualMachine#canPopFrames()
*/
@@ -1269,7 +1345,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
getCapabilities();
return fCanRequestVMDeathEvent;
}
-
+
public boolean canSetDefaultStratum() {
getCapabilities();
return fCanSetDefaultStratum;
@@ -1279,94 +1355,101 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
* @see VirtualMachine#setDefaultStratum(String)
*/
public void setDefaultStratum(String stratum) {
- fDefaultStratum= stratum;
-
+ fDefaultStratum = stratum;
+
if (!canSetDefaultStratum()) {
- // TODO: how to inform the user that the VM doesn't manage setDefaultStartum ?
+ // TODO: how to inform the user that the VM doesn't manage
+ // setDefaultStartum ?
return;
}
if (stratum == null) {
- stratum= ""; //$NON-NLS-1$
+ stratum = ""; //$NON-NLS-1$
}
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeString(stratum, "stratum ID", outData); //$NON-NLS-1$
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.VM_SET_DEFAULT_STRATUM, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.VM_SET_DEFAULT_STRATUM, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
} catch (IOException e) {
defaultIOExceptionHandler(e);
} finally {
handledJdwpRequest();
}
}
-
+
/*
* @see VirtualMachine#getDefaultStratum()
*/
public String getDefaultStratum() {
return fDefaultStratum;
}
-
+
/**
* @see com.sun.jdi.VirtualMachine#instanceCounts(java.util.List)
* @since 3.3
*/
- public long[] instanceCounts(List refTypes) {
- if(refTypes == null) {
+ public long[] instanceCounts(List<Type> refTypes) {
+ if (refTypes == null) {
throw new NullPointerException(JDIMessages.VirtualMachineImpl_2);
}
int size = refTypes.size();
- if(size == 0) {
+ if (size == 0) {
if (isJdwpVersionGreaterOrEqual(1, 6)) {
return new long[0];
} else {
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_27);
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_27);
}
}
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
writeInt(size, "size", outData); //$NON-NLS-1$
- for(int i = 0; i < size; i++) {
- ((ReferenceTypeImpl)refTypes.get(i)).getRefTypeID().write(outData);
+ for (int i = 0; i < size; i++) {
+ ((ReferenceTypeImpl) refTypes.get(i)).getRefTypeID().write(
+ outData);
}
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.VM_INSTANCE_COUNTS, outBytes);
- switch(replyPacket.errorCode()) {
- case JdwpReplyPacket.INVALID_CLASS:
- case JdwpReplyPacket.INVALID_OBJECT:
- throw new ObjectCollectedException(JDIMessages.class_or_object_not_known);
- case JdwpReplyPacket.ILLEGAL_ARGUMENT:
- throw new IllegalArgumentException(JDIMessages.VirtualMachineImpl_count_less_than_zero);
- case JdwpReplyPacket.NOT_IMPLEMENTED:
- throw new UnsupportedOperationException(JDIMessages.ReferenceTypeImpl_27);
- case JdwpReplyPacket.VM_DEAD:
- throw new VMDisconnectedException(JDIMessages.vm_dead);
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.VM_INSTANCE_COUNTS, outBytes);
+ switch (replyPacket.errorCode()) {
+ case JdwpReplyPacket.INVALID_CLASS:
+ case JdwpReplyPacket.INVALID_OBJECT:
+ throw new ObjectCollectedException(
+ JDIMessages.class_or_object_not_known);
+ case JdwpReplyPacket.ILLEGAL_ARGUMENT:
+ throw new IllegalArgumentException(
+ JDIMessages.VirtualMachineImpl_count_less_than_zero);
+ case JdwpReplyPacket.NOT_IMPLEMENTED:
+ throw new UnsupportedOperationException(
+ JDIMessages.ReferenceTypeImpl_27);
+ case JdwpReplyPacket.VM_DEAD:
+ throw new VMDisconnectedException(JDIMessages.vm_dead);
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
+
DataInputStream replyData = replyPacket.dataInStream();
int counts = readInt("counts", replyData); //$NON-NLS-1$
- if(counts != size) {
+ if (counts != size) {
throw new InternalError(JDIMessages.VirtualMachineImpl_3);
}
long[] ret = new long[counts];
- for(int i = 0; i < counts; i++) {
+ for (int i = 0; i < counts; i++) {
ret[i] = readLong("ref count", replyData); //$NON-NLS-1$
}
return ret;
- }
- catch(IOException e) {
+ } catch (IOException e) {
defaultIOExceptionHandler(e);
return null;
} finally {
handledJdwpRequest();
}
}
-
+
/**
* Returns whether this VM is disconnected.
*
@@ -1379,18 +1462,19 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
/**
* Sets whether this VM is disconnected.
*
- * @param disconected whether this VM is disconnected
+ * @param disconected
+ * whether this VM is disconnected
*/
public synchronized void setDisconnected(boolean disconnected) {
fIsDisconnected = disconnected;
}
-
+
/**
* Return the boolean type for this VM.
*/
protected BooleanTypeImpl getBooleanType() {
if (fBooleanType == null) {
- fBooleanType= new BooleanTypeImpl(this);
+ fBooleanType = new BooleanTypeImpl(this);
}
return fBooleanType;
}
@@ -1400,7 +1484,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
protected ByteTypeImpl getByteType() {
if (fByteType == null) {
- fByteType= new ByteTypeImpl(this);
+ fByteType = new ByteTypeImpl(this);
}
return fByteType;
}
@@ -1410,7 +1494,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
protected CharTypeImpl getCharType() {
if (fCharType == null) {
- fCharType= new CharTypeImpl(this);
+ fCharType = new CharTypeImpl(this);
}
return fCharType;
}
@@ -1420,7 +1504,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
protected DoubleTypeImpl getDoubleType() {
if (fDoubleType == null) {
- fDoubleType= new DoubleTypeImpl(this);
+ fDoubleType = new DoubleTypeImpl(this);
}
return fDoubleType;
}
@@ -1430,7 +1514,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
protected FloatTypeImpl getFloatType() {
if (fFloatType == null) {
- fFloatType= new FloatTypeImpl(this);
+ fFloatType = new FloatTypeImpl(this);
}
return fFloatType;
}
@@ -1440,7 +1524,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
protected IntegerTypeImpl getIntegerType() {
if (fIntegerType == null) {
- fIntegerType= new IntegerTypeImpl(this);
+ fIntegerType = new IntegerTypeImpl(this);
}
return fIntegerType;
}
@@ -1450,7 +1534,7 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
protected LongTypeImpl getLongType() {
if (fLongType == null) {
- fLongType= new LongTypeImpl(this);
+ fLongType = new LongTypeImpl(this);
}
return fLongType;
}
@@ -1460,13 +1544,14 @@ public class VirtualMachineImpl extends MirrorImpl implements VirtualMachine, or
*/
protected ShortTypeImpl getShortType() {
if (fShortType == null) {
- fShortType= new ShortTypeImpl(this);
+ fShortType = new ShortTypeImpl(this);
}
return fShortType;
}
-
+
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see com.sun.jdi.VirtualMachine#canBeModified()
*/
public boolean canBeModified() {
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineManagerImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineManagerImpl.java
index f22453bb1..20adaaace 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineManagerImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VirtualMachineManagerImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +21,7 @@ import java.util.List;
import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
+import org.eclipse.jdi.internal.connect.ConnectorImpl;
import org.eclipse.jdi.internal.connect.SocketAttachingConnectorImpl;
import org.eclipse.jdi.internal.connect.SocketLaunchingConnectorImpl;
import org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl;
@@ -34,20 +34,22 @@ import com.sun.jdi.connect.LaunchingConnector;
import com.sun.jdi.connect.spi.Connection;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class VirtualMachineManagerImpl implements VirtualMachineManager {
/** Major interface version. */
public static int MAJOR_INTERFACE_VERSION = 1;
/** Minor interface version. */
public static int MINOR_INTERFACE_VERSION = 5;
- /** PrintWriter where verbose info is written to, null if no verbose must be given. */
+ /**
+ * PrintWriter where verbose info is written to, null if no verbose must be
+ * given.
+ */
private PrintWriter fVerbosePrintWriter = null;
/** List of all VMs that are currently connected. */
- List fConnectedVMs = new ArrayList();
+ List<VirtualMachineImpl> fConnectedVMs = new ArrayList<VirtualMachineImpl>();
/** True if in verbose mode. */
private boolean fVerbose = false;
/** Name of verbose file. */
@@ -57,9 +59,9 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager {
* Creates new VirtualMachineManagerImpl.
*/
public VirtualMachineManagerImpl() {
-
+
getPreferences();
-
+
// See if verbose info must be given.
if (fVerbose) {
OutputStream out;
@@ -68,7 +70,11 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager {
out = new FileOutputStream(fVerboseFile);
} catch (IOException e) {
out = System.out;
- System.out.println(JDIMessages.VirtualMachineManagerImpl_Could_not_open_verbose_file___1 + fVerboseFile + JDIMessages.VirtualMachineManagerImpl_____2 + e); //
+ System.out
+ .println(JDIMessages.VirtualMachineManagerImpl_Could_not_open_verbose_file___1
+ + fVerboseFile
+ + JDIMessages.VirtualMachineManagerImpl_____2
+ + e); //
}
} else {
out = System.out;
@@ -83,14 +89,14 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager {
public int majorInterfaceVersion() {
return MAJOR_INTERFACE_VERSION;
}
-
+
/**
* Returns the minor version number of the JDI interface.
*/
public int minorInterfaceVersion() {
return MINOR_INTERFACE_VERSION;
}
-
+
/**
* Loads the user preferences from the jdi.ini file.
*/
@@ -100,16 +106,17 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager {
if (url == null) {
return;
}
-
+
try {
InputStream stream = url.openStream();
PropertyResourceBundle prefs = new PropertyResourceBundle(stream);
-
- try {
- fVerbose = Boolean.valueOf(prefs.getString("User.verbose")).booleanValue(); //$NON-NLS-1$
+
+ try {
+ fVerbose = Boolean
+ .valueOf(prefs.getString("User.verbose")).booleanValue(); //$NON-NLS-1$
} catch (MissingResourceException e) {
}
-
+
try {
fVerboseFile = prefs.getString("Verbose.out"); //$NON-NLS-1$
} catch (MissingResourceException e) {
@@ -117,53 +124,56 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager {
} catch (IOException e) {
}
-
+
}
/**
- * @return Returns Timeout value for requests to VM, if not overridden for the VM.
- * This value is used to throw the exception TimeoutException in JDI calls.
- * NOTE: This is not in compliance with the Sun's JDI.
+ * @return Returns Timeout value for requests to VM, if not overridden for
+ * the VM. This value is used to throw the exception
+ * TimeoutException in JDI calls. NOTE: This is not in compliance
+ * with the Sun's JDI.
*/
public int getGlobalRequestTimeout() {
try {
if (JDIDebugModel.getPreferences() != null) {
- return JDIDebugModel.getPreferences().getInt(JDIDebugModel.PREF_REQUEST_TIMEOUT);
- }
+ return JDIDebugModel.getPreferences().getInt(
+ JDIDebugModel.PREF_REQUEST_TIMEOUT);
+ }
// JDI plug-in is not loaded
return JDIDebugModel.DEF_REQUEST_TIMEOUT;
} catch (NoClassDefFoundError e) {
}
- // return the hard coded preference if the jdi debug plug-in does not exist
+ // return the hard coded preference if the jdi debug plug-in does not
+ // exist
return 3000;
}
-
+
/**
- * Adds a VM to the connected VM list.
+ * Adds a VM to the connected VM list.
*/
public void addConnectedVM(VirtualMachineImpl vm) {
fConnectedVMs.add(vm);
}
/**
- * Removes a VM from the connected VM list.
+ * Removes a VM from the connected VM list.
*/
public void removeConnectedVM(VirtualMachineImpl vm) {
fConnectedVMs.remove(vm);
}
/**
- * @return Returns all target VMs which are connected to the debugger.
+ * @return Returns all target VMs which are connected to the debugger.
*/
- public List connectedVirtualMachines() {
+ public List<VirtualMachineImpl> connectedVirtualMachines() {
return fConnectedVMs;
}
/**
* @return Returns all connectors.
*/
- public List allConnectors() {
- List result = new ArrayList(attachingConnectors());
+ public List<ConnectorImpl> allConnectors() {
+ List<ConnectorImpl> result = new ArrayList<ConnectorImpl>(attachingConnectors());
result.addAll(launchingConnectors());
result.addAll(listeningConnectors());
return result;
@@ -172,53 +182,56 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager {
/**
* @return Returns attaching connectors.
*/
- public List attachingConnectors() {
- ArrayList list = new ArrayList(1);
+ public List<SocketAttachingConnectorImpl> attachingConnectors() {
+ ArrayList<SocketAttachingConnectorImpl> list = new ArrayList<SocketAttachingConnectorImpl>(1);
list.add(new SocketAttachingConnectorImpl(this));
return list;
}
-
+
/**
* @return Returns launching connectors.
*/
- public List launchingConnectors() {
- ArrayList list = new ArrayList(2);
+ public List<ConnectorImpl> launchingConnectors() {
+ ArrayList<ConnectorImpl> list = new ArrayList<ConnectorImpl>(2);
list.add(new SocketLaunchingConnectorImpl(this));
list.add(new SocketRawLaunchingConnectorImpl(this));
return list;
}
-
+
/**
* @return Returns listening connectors.
*/
- public List listeningConnectors() {
- ArrayList list = new ArrayList(1);
+ public List<SocketListeningConnectorImpl> listeningConnectors() {
+ ArrayList<SocketListeningConnectorImpl> list = new ArrayList<SocketListeningConnectorImpl>(1);
list.add(new SocketListeningConnectorImpl(this));
return list;
}
-
+
/**
* @return Returns default connector.
*/
public LaunchingConnector defaultConnector() {
return new SocketLaunchingConnectorImpl(this);
}
-
+
/**
- * @return Returns PrintWriter to which verbose info must be written, or null if no verbose must be given.
+ * @return Returns PrintWriter to which verbose info must be written, or
+ * null if no verbose must be given.
*/
public PrintWriter verbosePrintWriter() {
return fVerbosePrintWriter;
}
-
- public VirtualMachine createVirtualMachine(Connection connection) throws IOException {
- VirtualMachineImpl vmImpl = new VirtualMachineImpl(connection);
+
+ public VirtualMachine createVirtualMachine(Connection connection)
+ throws IOException {
+ VirtualMachineImpl vmImpl = new VirtualMachineImpl(connection);
return vmImpl;
}
-
- public VirtualMachine createVirtualMachine(Connection connection, Process process) throws IOException {
- VirtualMachineImpl vmImpl = new VirtualMachineImpl(connection);
- vmImpl.setLaunchedProcess(process);
+
+ public VirtualMachine createVirtualMachine(Connection connection,
+ Process process) throws IOException {
+ VirtualMachineImpl vmImpl = new VirtualMachineImpl(connection);
+ vmImpl.setLaunchedProcess(process);
return vmImpl;
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidTypeImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidTypeImpl.java
index ec48f70a9..74e10b86e 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidTypeImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidTypeImpl.java
@@ -10,34 +10,35 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import com.sun.jdi.Value;
import com.sun.jdi.VoidType;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class VoidTypeImpl extends TypeImpl implements VoidType {
/**
* Creates new instance.
*/
public VoidTypeImpl(VirtualMachineImpl vmImpl) {
- super("VoidType", vmImpl, "void" , "V"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ super("VoidType", vmImpl, "void", "V"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
/**
* @return Returns modifier bits.
*/
+ @Override
public int modifiers() {
- throw new InternalError(JDIMessages.VoidTypeImpl_A_VoidType_does_not_have_modifiers_1);
+ throw new InternalError(
+ JDIMessages.VoidTypeImpl_A_VoidType_does_not_have_modifiers_1);
}
-
+
/**
* @return Create a null value instance of the type.
*/
+ @Override
public Value createNullValue() {
return new VoidValueImpl(virtualMachineImpl());
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidValueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidValueImpl.java
index d0f679149..424d82156 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidValueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/VoidValueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal;
-
import java.io.DataOutputStream;
import org.eclipse.jdi.internal.jdwp.JdwpID;
@@ -19,10 +18,9 @@ import com.sun.jdi.Type;
import com.sun.jdi.VoidValue;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class VoidValueImpl extends ValueImpl implements VoidValue {
/** JDWP Tag. */
@@ -34,17 +32,19 @@ public class VoidValueImpl extends ValueImpl implements VoidValue {
public VoidValueImpl(VirtualMachineImpl vmImpl) {
super("VoidValue", vmImpl); //$NON-NLS-1$
}
-
+
/**
* @returns tag.
*/
+ @Override
public byte getTag() {
return tag;
}
-
+
/**
* @returns type of value.
- */
+ */
+ @Override
public Type type() {
return new VoidTypeImpl(virtualMachineImpl());
}
@@ -53,21 +53,24 @@ public class VoidValueImpl extends ValueImpl implements VoidValue {
* @return Returns true if two values are equal.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
return object != null && object.getClass().equals(this.getClass());
}
-
+
/**
* @return Returns a has code for this object.
* @see java.lang.Object#hashCode
*/
+ @Override
public int hashCode() {
return 0;
}
-
+
/**
* Writes value without value tag.
*/
+ @Override
public void write(MirrorImpl target, DataOutputStream out) {
// Nothing to write.
}
@@ -75,6 +78,7 @@ public class VoidValueImpl extends ValueImpl implements VoidValue {
/**
* @return Returns description of Mirror object.
*/
+ @Override
public String toString() {
return "(void)"; //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectorImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectorImpl.java
index 8a62acf7f..bff7a4ce6 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectorImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/ConnectorImpl.java
@@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import java.util.List;
@@ -25,12 +24,10 @@ import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.Transport;
import com.sun.jdi.connect.spi.Connection;
-
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public abstract class ConnectorImpl implements Connector {
/** Virtual machine manager that created this connector. */
@@ -40,10 +37,10 @@ public abstract class ConnectorImpl implements Connector {
protected Transport fTransport;
/** Virtual Machine that is connected. */
protected VirtualMachineImpl fVirtualMachine;
-
+
/**
* Creates a new Connector.
- */
+ */
public ConnectorImpl(VirtualMachineManagerImpl virtualMachineManager) {
fVirtualMachineManager = virtualMachineManager;
}
@@ -54,7 +51,7 @@ public abstract class ConnectorImpl implements Connector {
public VirtualMachineManagerImpl virtualMachineManager() {
return fVirtualMachineManager;
}
-
+
/**
* @return Returns Virtual Machine Manager.
*/
@@ -63,134 +60,155 @@ public abstract class ConnectorImpl implements Connector {
}
/**
- * @return Returns a human-readable description of this connector and its purpose.
- */
+ * @return Returns a human-readable description of this connector and its
+ * purpose.
+ */
public abstract String description();
-
+
/**
* @return Returns a short identifier for the connector.
- */
+ */
public abstract String name();
-
+
/**
* Assigns Transport.
- */
- /*package*/ void setTransport(Transport transport) {
+ */
+ /* package */void setTransport(Transport transport) {
fTransport = transport;
}
/**
- * @return Returns the transport mechanism used by this connector to establish connections with a target VM.
- */
+ * @return Returns the transport mechanism used by this connector to
+ * establish connections with a target VM.
+ */
public Transport transport() {
return fTransport;
}
-
+
/**
* Closes connection with Virtual Machine.
- */
- /*package*/ synchronized void close() {
+ */
+ /* package */synchronized void close() {
virtualMachineManager().removeConnectedVM(fVirtualMachine);
}
-
+
/**
* @return Returns a connected Virtual Machine.
- */
- protected VirtualMachine establishedConnection(Connection connection) throws IOException {
- fVirtualMachine = (VirtualMachineImpl) Bootstrap.virtualMachineManager().createVirtualMachine(connection);
+ */
+ protected VirtualMachine establishedConnection(Connection connection)
+ throws IOException {
+ fVirtualMachine = (VirtualMachineImpl) Bootstrap
+ .virtualMachineManager().createVirtualMachine(connection);
return fVirtualMachine;
}
-
+
/**
* Argument class for arguments that are used to establish a connection.
*/
- public abstract class ArgumentImpl implements com.sun.jdi.connect.Connector.Argument {
+ public abstract class ArgumentImpl implements
+ com.sun.jdi.connect.Connector.Argument {
/**
- * Serial version id.
+ * Serial version id.
*/
private static final long serialVersionUID = 8850533280769854833L;
-
+
private String fName;
private String fDescription;
private String fLabel;
private boolean fMustSpecify;
- protected ArgumentImpl(String name, String description, String label, boolean mustSpecify) {
- fName = name;
- fLabel = label;
- fDescription = description;
- fMustSpecify = mustSpecify;
- }
+ protected ArgumentImpl(String name, String description, String label,
+ boolean mustSpecify) {
+ fName = name;
+ fLabel = label;
+ fDescription = description;
+ fMustSpecify = mustSpecify;
+ }
- public String name() {
+ public String name() {
return fName;
}
-
+
public String description() {
return fDescription;
}
-
+
public String label() {
return fLabel;
}
-
+
public boolean mustSpecify() {
return fMustSpecify;
}
-
+
public abstract String value();
+
public abstract void setValue(String value);
+
public abstract boolean isValid(String value);
+
+ @Override
public abstract String toString();
}
-
- public class StringArgumentImpl extends ArgumentImpl implements com.sun.jdi.connect.Connector.StringArgument {
- private static final long serialVersionUID = 6009335074727417445L;
- private String fValue;
+ public class StringArgumentImpl extends ArgumentImpl implements
+ com.sun.jdi.connect.Connector.StringArgument {
+ private static final long serialVersionUID = 6009335074727417445L;
+
+ private String fValue;
+
+ protected StringArgumentImpl(String name, String description,
+ String label, boolean mustSpecify) {
+ super(name, description, label, mustSpecify);
+ }
- protected StringArgumentImpl(String name, String description, String label, boolean mustSpecify) {
- super(name, description, label, mustSpecify);
- }
-
+ @Override
public String value() {
return fValue;
}
-
+
+ @Override
public void setValue(String value) {
fValue = value;
}
+ @Override
public boolean isValid(String value) {
return true;
}
+ @Override
public String toString() {
return fValue;
}
}
-
- public class IntegerArgumentImpl extends ArgumentImpl implements com.sun.jdi.connect.Connector.IntegerArgument {
- private static final long serialVersionUID = 6009335074727417445L;
- private Integer fValue;
+
+ public class IntegerArgumentImpl extends ArgumentImpl implements
+ com.sun.jdi.connect.Connector.IntegerArgument {
+ private static final long serialVersionUID = 6009335074727417445L;
+ private Integer fValue;
private int fMin;
private int fMax;
- protected IntegerArgumentImpl(String name, String description, String label, boolean mustSpecify, int min, int max) {
- super(name, description, label, mustSpecify);
- fMin = min;
- fMax = max;
- }
-
+ protected IntegerArgumentImpl(String name, String description,
+ String label, boolean mustSpecify, int min, int max) {
+ super(name, description, label, mustSpecify);
+ fMin = min;
+ fMax = max;
+ }
+
+ @Override
public String value() {
return (fValue == null) ? null : fValue.toString();
}
-
+
+ @Override
public void setValue(String value) {
fValue = new Integer(value);
}
+ @Override
public boolean isValid(String value) {
Integer val;
try {
@@ -201,6 +219,7 @@ public abstract class ConnectorImpl implements Connector {
return isValid(val.intValue());
}
+ @Override
public String toString() {
return value();
}
@@ -208,7 +227,7 @@ public abstract class ConnectorImpl implements Connector {
public int intValue() {
return fValue.intValue();
}
-
+
public void setValue(int value) {
fValue = new Integer(value);
}
@@ -216,11 +235,11 @@ public abstract class ConnectorImpl implements Connector {
public int min() {
return fMin;
}
-
+
public int max() {
return fMax;
}
-
+
public boolean isValid(int value) {
return fMin <= value && value <= fMax;
}
@@ -229,27 +248,33 @@ public abstract class ConnectorImpl implements Connector {
return new Integer(value).toString();
}
}
-
- public class BooleanArgumentImpl extends ArgumentImpl implements com.sun.jdi.connect.Connector.BooleanArgument {
- private static final long serialVersionUID = 6009335074727417445L;
- private Boolean fValue;
-
- protected BooleanArgumentImpl(String name, String description, String label, boolean mustSpecify) {
- super(name, description, label, mustSpecify);
- }
-
+
+ public class BooleanArgumentImpl extends ArgumentImpl implements
+ com.sun.jdi.connect.Connector.BooleanArgument {
+ private static final long serialVersionUID = 6009335074727417445L;
+ private Boolean fValue;
+
+ protected BooleanArgumentImpl(String name, String description,
+ String label, boolean mustSpecify) {
+ super(name, description, label, mustSpecify);
+ }
+
+ @Override
public String value() {
return (fValue == null) ? null : fValue.toString();
}
-
+
+ @Override
public void setValue(String value) {
fValue = Boolean.valueOf(value);
}
+ @Override
public boolean isValid(String value) {
return true;
}
-
+
+ @Override
public String toString() {
return value();
}
@@ -261,25 +286,28 @@ public abstract class ConnectorImpl implements Connector {
public void setValue(boolean value) {
fValue = Boolean.valueOf(value);
}
-
+
public String stringValueOf(boolean value) {
return Boolean.valueOf(value).toString();
}
}
-
- public class SelectedArgumentImpl extends StringArgumentImpl implements com.sun.jdi.connect.Connector.SelectedArgument {
- private static final long serialVersionUID = 6009335074727417445L;
- private List fChoices;
-
- protected SelectedArgumentImpl(String name, String description, String label, boolean mustSpecify, List choices) {
- super(name, description, label, mustSpecify);
- fChoices = choices;
- }
-
+
+ public class SelectedArgumentImpl extends StringArgumentImpl implements
+ com.sun.jdi.connect.Connector.SelectedArgument {
+ private static final long serialVersionUID = 6009335074727417445L;
+ private List fChoices;
+
+ protected SelectedArgumentImpl(String name, String description,
+ String label, boolean mustSpecify, List choices) {
+ super(name, description, label, mustSpecify);
+ fChoices = choices;
+ }
+
public List choices() {
return fChoices;
}
-
+
+ @Override
public boolean isValid(java.lang.String value) {
return fChoices.contains(value);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketManager.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketManager.java
index 9becd40bc..420c6d7a0 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketManager.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketManager.java
@@ -10,40 +10,45 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import com.sun.jdi.connect.spi.Connection;
/**
- * This class implements threads that receive/send packets from/to the Virtual Machine.
- *
+ * This class implements threads that receive/send packets from/to the Virtual
+ * Machine.
+ *
*/
public abstract class PacketManager implements Runnable {
/** Connector that performs IO to Virtual Machine. */
private Connection fConnection;
- /** Thread that handles the communication the other way (e.g. if we are sending, the receiving thread). */
+ /**
+ * Thread that handles the communication the other way (e.g. if we are
+ * sending, the receiving thread).
+ */
private Thread fPartnerThread;
private IOException fDisconnectException;
-
+
/**
* Creates new PacketManager.
*/
protected PacketManager(Connection connection) {
fConnection = connection;
}
-
- public Connection getConnection() {
- return fConnection;
- }
-
+
+ public Connection getConnection() {
+ return fConnection;
+ }
+
/**
- * Used to indicate that an IO exception occurred, closes connection to Virtual Machine.
+ * Used to indicate that an IO exception occurred, closes connection to
+ * Virtual Machine.
*
- * @param disconnectException the IOException that occurred
+ * @param disconnectException
+ * the IOException that occurred
*/
public void disconnectVM(IOException disconnectException) {
- fDisconnectException= disconnectException;
+ fDisconnectException = disconnectException;
disconnectVM();
}
@@ -52,23 +57,24 @@ public abstract class PacketManager implements Runnable {
*/
public void disconnectVM() {
try {
- fConnection.close();
- } catch (IOException e) {
- fDisconnectException = e;
- }
- // Interrupt the sending thread if we are the receiving thread and vice versa.
+ fConnection.close();
+ } catch (IOException e) {
+ fDisconnectException = e;
+ }
+ // Interrupt the sending thread if we are the receiving thread and vice
+ // versa.
if (fPartnerThread != null) {
- fPartnerThread.interrupt();
+ fPartnerThread.interrupt();
}
}
-
+
/**
* @return Returns whether an IO exception has occurred.
*/
- public boolean VMIsDisconnected() {
+ public boolean VMIsDisconnected() {
return fConnection == null || !fConnection.isOpen();
}
-
+
/**
* Returns the IOException that caused this packet manager to disconnect or
* <code>null</code> if none.
@@ -76,7 +82,7 @@ public abstract class PacketManager implements Runnable {
public IOException getDisconnectException() {
return fDisconnectException;
}
-
+
/**
* Assigns thread of partner, to be notified if we have an IO exception.
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketReceiveManager.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketReceiveManager.java
index 0c9d8f0f8..05af76ca1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketReceiveManager.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketReceiveManager.java
@@ -33,250 +33,271 @@ import com.sun.jdi.connect.spi.Connection;
*/
public class PacketReceiveManager extends PacketManager {
- /** Generic timeout value for not blocking. */
- public static final int TIMEOUT_NOT_BLOCKING = 0;
+ /** Generic timeout value for not blocking. */
+ public static final int TIMEOUT_NOT_BLOCKING = 0;
- /** Generic timeout value for infinite timeout. */
- public static final int TIMEOUT_INFINITE = -1;
+ /** Generic timeout value for infinite timeout. */
+ public static final int TIMEOUT_INFINITE = -1;
- /** List of Command packets received from Virtual Machine. */
- private LinkedList fCommandPackets;
+ /** List of Command packets received from Virtual Machine. */
+ private LinkedList<JdwpCommandPacket> fCommandPackets;
- /** List of Reply packets received from Virtual Machine. */
- private LinkedList fReplyPackets;
+ /** List of Reply packets received from Virtual Machine. */
+ private LinkedList<JdwpReplyPacket> fReplyPackets;
- /** List of Packets that have timed out already. Maintained so that responses can be
- * discarded if/when they are received. */
- private ArrayList fTimedOutPackets;
-
- private VirtualMachineImpl fVM;
+ /**
+ * List of Packets that have timed out already. Maintained so that responses
+ * can be discarded if/when they are received.
+ */
+ private ArrayList<Integer> fTimedOutPackets;
- /**
- * Create a new thread that receives packets from the Virtual Machine.
- */
- public PacketReceiveManager(Connection connection, VirtualMachineImpl vmImpl) {
- super(connection);
- fVM = vmImpl;
- fCommandPackets = new LinkedList();
- fReplyPackets = new LinkedList();
- fTimedOutPackets = new ArrayList();
- }
+ private VirtualMachineImpl fVM;
- public void disconnectVM() {
- super.disconnectVM();
- synchronized (fCommandPackets) {
- fCommandPackets.notifyAll();
- }
- synchronized (fReplyPackets) {
- fReplyPackets.notifyAll();
- }
- }
+ /**
+ * Create a new thread that receives packets from the Virtual Machine.
+ */
+ public PacketReceiveManager(Connection connection, VirtualMachineImpl vmImpl) {
+ super(connection);
+ fVM = vmImpl;
+ fCommandPackets = new LinkedList<JdwpCommandPacket>();
+ fReplyPackets = new LinkedList<JdwpReplyPacket>();
+ fTimedOutPackets = new ArrayList<Integer>();
+ }
- /**
- * Thread's run method.
- */
- public void run() {
- try {
- while (!VMIsDisconnected()) {
- // Read a packet from the input stream.
- readAvailablePacket();
- }
- }
- //if the remote VM is interrupted, drop the connection and clean up, don't wait for it to happen on its own
- catch (InterruptedIOException e) {disconnectVM(e);}
- catch (IOException e) {disconnectVM(e);}
- }
+ @Override
+ public void disconnectVM() {
+ super.disconnectVM();
+ synchronized (fCommandPackets) {
+ fCommandPackets.notifyAll();
+ }
+ synchronized (fReplyPackets) {
+ fReplyPackets.notifyAll();
+ }
+ }
- /**
- * @return Returns a specified Command Packet from the Virtual Machine.
- */
- public JdwpCommandPacket getCommand(int command, long timeToWait) throws InterruptedException {
- JdwpCommandPacket packet = null;
- synchronized (fCommandPackets) {
- long remainingTime = timeToWait;
- long timeBeforeWait;
- long waitedTime;
+ /**
+ * Thread's run method.
+ */
+ public void run() {
+ try {
+ while (!VMIsDisconnected()) {
+ // Read a packet from the input stream.
+ readAvailablePacket();
+ }
+ }
+ // if the remote VM is interrupted, drop the connection and clean up,
+ // don't wait for it to happen on its own
+ catch (InterruptedIOException e) {
+ disconnectVM(e);
+ } catch (IOException e) {
+ disconnectVM(e);
+ }
+ }
- // Wait until command is available.
- while (!VMIsDisconnected() && (packet = removeCommandPacket(command)) == null && (timeToWait < 0 || remainingTime > 0)) {
- timeBeforeWait = System.currentTimeMillis();
- waitForPacketAvailable(remainingTime, fCommandPackets);
- waitedTime = System.currentTimeMillis() - timeBeforeWait;
- remainingTime -= waitedTime;
- }
- }
- // Check for an IO Exception.
- if (VMIsDisconnected()) {
- String message;
- if (getDisconnectException() == null) {
- message = ConnectMessages.PacketReceiveManager_Got_IOException_from_Virtual_Machine_1;
- }
- else {
- String exMessage = getDisconnectException().getMessage();
- if (exMessage == null) {
- message = MessageFormat.format(ConnectMessages.PacketReceiveManager_Got__0__from_Virtual_Machine_1, new String[] { getDisconnectException().getClass().getName() });
- }
- else {
- message = MessageFormat.format(ConnectMessages.PacketReceiveManager_Got__0__from_Virtual_Machine___1__1, new String[] { getDisconnectException().getClass().getName(), exMessage });
- }
- }
- throw new VMDisconnectedException(message);
- }
- // Check for a timeout.
- if (packet == null) {
- throw new TimeoutException();
- }
- return packet;
- }
+ /**
+ * @return Returns a specified Command Packet from the Virtual Machine.
+ */
+ public JdwpCommandPacket getCommand(int command, long timeToWait)
+ throws InterruptedException {
+ JdwpCommandPacket packet = null;
+ synchronized (fCommandPackets) {
+ long remainingTime = timeToWait;
+ long timeBeforeWait;
+ long waitedTime;
- /**
- * @return Returns a specified Reply Packet from the Virtual Machine.
- */
- public JdwpReplyPacket getReply(int id, long timeToWait) {
- JdwpReplyPacket packet = null;
- long remainingTime = timeToWait;
- synchronized (fReplyPackets) {
- final long timeBeforeWait = System.currentTimeMillis();
- // Wait until reply is available.
- while (!VMIsDisconnected() && remainingTime > 0) {
- packet = removeReplyPacket(id);
- if (packet != null) {
- break;
- }
- try {
- waitForPacketAvailable(remainingTime, fReplyPackets);
- }
- // if the remote VM is interrupted DO NOT drop the connection - see bug 171075
- // just stop waiting for the reply and treat it as a timeout
- catch (InterruptedException e) {
- break;
- }
- long waitedTime = System.currentTimeMillis() - timeBeforeWait;
- remainingTime = timeToWait - waitedTime;
- }
- }
- if (packet == null) {
- synchronized (fReplyPackets) {
- packet = removeReplyPacket(id);
- }
- }
- // Check for an IO Exception.
- if (VMIsDisconnected())
- throw new VMDisconnectedException(ConnectMessages.PacketReceiveManager_Got_IOException_from_Virtual_Machine_2);
- // Check for a timeout.
- if (packet == null) {
- synchronized (fTimedOutPackets) {
- fTimedOutPackets.add(new Integer(id));
- }
- throw new TimeoutException(MessageFormat.format(ConnectMessages.PacketReceiveManager_0, new String[] {id+""})); //$NON-NLS-1$
- }
- return packet;
- }
+ // Wait until command is available.
+ while (!VMIsDisconnected()
+ && (packet = removeCommandPacket(command)) == null
+ && (timeToWait < 0 || remainingTime > 0)) {
+ timeBeforeWait = System.currentTimeMillis();
+ waitForPacketAvailable(remainingTime, fCommandPackets);
+ waitedTime = System.currentTimeMillis() - timeBeforeWait;
+ remainingTime -= waitedTime;
+ }
+ }
+ // Check for an IO Exception.
+ if (VMIsDisconnected()) {
+ String message;
+ if (getDisconnectException() == null) {
+ message = ConnectMessages.PacketReceiveManager_Got_IOException_from_Virtual_Machine_1;
+ } else {
+ String exMessage = getDisconnectException().getMessage();
+ if (exMessage == null) {
+ message = MessageFormat
+ .format(ConnectMessages.PacketReceiveManager_Got__0__from_Virtual_Machine_1,
+ new String[] { getDisconnectException()
+ .getClass().getName() });
+ } else {
+ message = MessageFormat
+ .format(ConnectMessages.PacketReceiveManager_Got__0__from_Virtual_Machine___1__1,
+ new String[] {
+ getDisconnectException().getClass()
+ .getName(), exMessage });
+ }
+ }
+ throw new VMDisconnectedException(message);
+ }
+ // Check for a timeout.
+ if (packet == null) {
+ throw new TimeoutException();
+ }
+ return packet;
+ }
- /**
- * @return Returns a specified Reply Packet from the Virtual Machine.
- */
- public JdwpReplyPacket getReply(JdwpCommandPacket commandPacket) {
- return getReply(commandPacket.getId(), fVM.getRequestTimeout());
- }
+ /**
+ * @return Returns a specified Reply Packet from the Virtual Machine.
+ */
+ public JdwpReplyPacket getReply(int id, long timeToWait) {
+ JdwpReplyPacket packet = null;
+ long remainingTime = timeToWait;
+ synchronized (fReplyPackets) {
+ final long timeBeforeWait = System.currentTimeMillis();
+ // Wait until reply is available.
+ while (!VMIsDisconnected() && remainingTime > 0) {
+ packet = removeReplyPacket(id);
+ if (packet != null) {
+ break;
+ }
+ try {
+ waitForPacketAvailable(remainingTime, fReplyPackets);
+ }
+ // if the remote VM is interrupted DO NOT drop the connection -
+ // see bug 171075
+ // just stop waiting for the reply and treat it as a timeout
+ catch (InterruptedException e) {
+ break;
+ }
+ long waitedTime = System.currentTimeMillis() - timeBeforeWait;
+ remainingTime = timeToWait - waitedTime;
+ }
+ }
+ if (packet == null) {
+ synchronized (fReplyPackets) {
+ packet = removeReplyPacket(id);
+ }
+ }
+ // Check for an IO Exception.
+ if (VMIsDisconnected())
+ throw new VMDisconnectedException(
+ ConnectMessages.PacketReceiveManager_Got_IOException_from_Virtual_Machine_2);
+ // Check for a timeout.
+ if (packet == null) {
+ synchronized (fTimedOutPackets) {
+ fTimedOutPackets.add(new Integer(id));
+ }
+ throw new TimeoutException(MessageFormat.format(
+ ConnectMessages.PacketReceiveManager_0, new String[] { id
+ + "" })); //$NON-NLS-1$
+ }
+ return packet;
+ }
- /**
- * Wait for an available packet from the Virtual Machine.
- */
- private void waitForPacketAvailable(long timeToWait, Object lock) throws InterruptedException {
- if (timeToWait == 0)
- return;
- else if (timeToWait < 0)
- lock.wait();
- else
- lock.wait(timeToWait);
- }
+ /**
+ * @return Returns a specified Reply Packet from the Virtual Machine.
+ */
+ public JdwpReplyPacket getReply(JdwpCommandPacket commandPacket) {
+ return getReply(commandPacket.getId(), fVM.getRequestTimeout());
+ }
- /**
- * @return Returns and removes a specified command packet from the command
- * packet list.
- */
- private JdwpCommandPacket removeCommandPacket(int command) {
- ListIterator iter = fCommandPackets.listIterator();
- while (iter.hasNext()) {
- JdwpCommandPacket packet = (JdwpCommandPacket) iter.next();
- if (packet.getCommand() == command) {
- iter.remove();
- return packet;
- }
- }
- return null;
- }
+ /**
+ * Wait for an available packet from the Virtual Machine.
+ */
+ private void waitForPacketAvailable(long timeToWait, Object lock)
+ throws InterruptedException {
+ if (timeToWait == 0)
+ return;
+ else if (timeToWait < 0)
+ lock.wait();
+ else
+ lock.wait(timeToWait);
+ }
- /**
- * @return Returns a specified reply packet from the reply packet list.
- */
- private JdwpReplyPacket removeReplyPacket(int id) {
- ListIterator iter = fReplyPackets.listIterator();
- while (iter.hasNext()) {
- JdwpReplyPacket packet = (JdwpReplyPacket) iter.next();
- if (packet.getId() == id) {
- iter.remove();
- return packet;
- }
- }
- return null;
- }
+ /**
+ * @return Returns and removes a specified command packet from the command
+ * packet list.
+ */
+ private JdwpCommandPacket removeCommandPacket(int command) {
+ ListIterator<JdwpCommandPacket> iter = fCommandPackets.listIterator();
+ while (iter.hasNext()) {
+ JdwpCommandPacket packet = iter.next();
+ if (packet.getCommand() == command) {
+ iter.remove();
+ return packet;
+ }
+ }
+ return null;
+ }
- /**
- * Add a command packet to the command packet list.
- */
- private void addCommandPacket(JdwpCommandPacket packet) {
- if (isTimedOut(packet)) {
- return; // already timed out. No need to keep this one
- }
- synchronized (fCommandPackets) {
- fCommandPackets.add(packet);
- fCommandPackets.notifyAll();
- }
- }
-
- /**
- * Returns whether the request for the given packet has already timed out.
- *
- * @param packet response packet
- * @return whether the request for the given packet has already timed out
- */
- private boolean isTimedOut(JdwpPacket packet) {
- synchronized (fTimedOutPackets) {
- if (fTimedOutPackets.isEmpty()) {
- return false;
- }
- Integer id = new Integer(packet.getId());
- return fTimedOutPackets.remove(id);
- }
- }
+ /**
+ * @return Returns a specified reply packet from the reply packet list.
+ */
+ private JdwpReplyPacket removeReplyPacket(int id) {
+ ListIterator<JdwpReplyPacket> iter = fReplyPackets.listIterator();
+ while (iter.hasNext()) {
+ JdwpReplyPacket packet = iter.next();
+ if (packet.getId() == id) {
+ iter.remove();
+ return packet;
+ }
+ }
+ return null;
+ }
- /**
- * Add a reply packet to the reply packet list.
- */
- private void addReplyPacket(JdwpReplyPacket packet) {
- if (isTimedOut(packet)) {
- return; // already timed out. No need to keep this one
- }
- synchronized (fReplyPackets) {
- fReplyPackets.add(packet);
- fReplyPackets.notifyAll();
- }
- }
+ /**
+ * Add a command packet to the command packet list.
+ */
+ private void addCommandPacket(JdwpCommandPacket packet) {
+ if (isTimedOut(packet)) {
+ return; // already timed out. No need to keep this one
+ }
+ synchronized (fCommandPackets) {
+ fCommandPackets.add(packet);
+ fCommandPackets.notifyAll();
+ }
+ }
- /**
- * Read a packet from the input stream and add it to the appropriate packet
- * list.
- */
- private void readAvailablePacket() throws IOException {
- // Read a packet from the Input Stream.
- byte[] bytes = getConnection().readPacket();
- JdwpPacket packet = JdwpPacket.build(bytes);
- // Add packet to command or reply queue.
- if (packet instanceof JdwpCommandPacket)
- addCommandPacket((JdwpCommandPacket) packet);
- else
- addReplyPacket((JdwpReplyPacket) packet);
- }
+ /**
+ * Returns whether the request for the given packet has already timed out.
+ *
+ * @param packet
+ * response packet
+ * @return whether the request for the given packet has already timed out
+ */
+ private boolean isTimedOut(JdwpPacket packet) {
+ synchronized (fTimedOutPackets) {
+ if (fTimedOutPackets.isEmpty()) {
+ return false;
+ }
+ Integer id = new Integer(packet.getId());
+ return fTimedOutPackets.remove(id);
+ }
+ }
+
+ /**
+ * Add a reply packet to the reply packet list.
+ */
+ private void addReplyPacket(JdwpReplyPacket packet) {
+ if (isTimedOut(packet)) {
+ return; // already timed out. No need to keep this one
+ }
+ synchronized (fReplyPackets) {
+ fReplyPackets.add(packet);
+ fReplyPackets.notifyAll();
+ }
+ }
+
+ /**
+ * Read a packet from the input stream and add it to the appropriate packet
+ * list.
+ */
+ private void readAvailablePacket() throws IOException {
+ // Read a packet from the Input Stream.
+ byte[] bytes = getConnection().readPacket();
+ JdwpPacket packet = JdwpPacket.build(bytes);
+ // Add packet to command or reply queue.
+ if (packet instanceof JdwpCommandPacket)
+ addCommandPacket((JdwpCommandPacket) packet);
+ else
+ addReplyPacket((JdwpReplyPacket) packet);
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketSendManager.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketSendManager.java
index 72b7dafbc..0a56b2ef4 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketSendManager.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/PacketSendManager.java
@@ -12,39 +12,40 @@ package org.eclipse.jdi.internal.connect;
import java.io.IOException;
import java.io.InterruptedIOException;
-import com.ibm.icu.text.MessageFormat;
import java.util.LinkedList;
import org.eclipse.jdi.internal.jdwp.JdwpPacket;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.connect.spi.Connection;
/**
- * This class implements a thread that sends available packets to the Virtual Machine.
- *
+ * This class implements a thread that sends available packets to the Virtual
+ * Machine.
+ *
*/
public class PacketSendManager extends PacketManager {
/** List of packets to be sent to Virtual Machine */
- private LinkedList fOutgoingPackets;
+ private LinkedList<JdwpPacket> fOutgoingPackets;
- /**
+ /**
* Create a new thread that send packets to the Virtual Machine.
*/
public PacketSendManager(Connection connection) {
super(connection);
- fOutgoingPackets = new LinkedList();
+ fOutgoingPackets = new LinkedList<JdwpPacket>();
+ }
+
+ @Override
+ public void disconnectVM() {
+ super.disconnectVM();
+ synchronized (fOutgoingPackets) {
+ fOutgoingPackets.notifyAll();
+ }
}
-
- public void disconnectVM() {
- super.disconnectVM();
- synchronized (fOutgoingPackets) {
- fOutgoingPackets.notifyAll();
- }
- }
-
- /**
+ /**
* Thread's run method.
*/
public void run() {
@@ -52,59 +53,71 @@ public class PacketSendManager extends PacketManager {
try {
sendAvailablePackets();
}
- //in each case if the remote VM fails, or has been interrupted, disconnect and force a clean up, don't wait for it to happen
- catch (InterruptedException e) {disconnectVM();}
- catch (InterruptedIOException e) {disconnectVM(e);}
- catch (IOException e) {disconnectVM(e);}
+ // in each case if the remote VM fails, or has been interrupted,
+ // disconnect and force a clean up, don't wait for it to happen
+ catch (InterruptedException e) {
+ disconnectVM();
+ } catch (InterruptedIOException e) {
+ disconnectVM(e);
+ } catch (IOException e) {
+ disconnectVM(e);
+ }
}
}
-
- /**
+
+ /**
* Add a packet to be sent to the Virtual Machine.
*/
public void sendPacket(JdwpPacket packet) {
if (VMIsDisconnected()) {
String message;
if (getDisconnectException() == null) {
- message= ConnectMessages.PacketSendManager_Got_IOException_from_Virtual_Machine_1;
- }
- else {
+ message = ConnectMessages.PacketSendManager_Got_IOException_from_Virtual_Machine_1;
+ } else {
String exMessage = getDisconnectException().getMessage();
if (exMessage == null) {
- message= MessageFormat.format(ConnectMessages.PacketSendManager_Got__0__from_Virtual_Machine_1, new String[] {getDisconnectException().getClass().getName()});
- }
- else {
- message= MessageFormat.format(ConnectMessages.PacketSendManager_Got__0__from_Virtual_Machine___1__1, new String[] {getDisconnectException().getClass().getName(), exMessage});
+ message = MessageFormat
+ .format(ConnectMessages.PacketSendManager_Got__0__from_Virtual_Machine_1,
+ new String[] { getDisconnectException()
+ .getClass().getName() });
+ } else {
+ message = MessageFormat
+ .format(ConnectMessages.PacketSendManager_Got__0__from_Virtual_Machine___1__1,
+ new String[] {
+ getDisconnectException().getClass()
+ .getName(), exMessage });
}
}
throw new VMDisconnectedException(message);
}
-
- synchronized(fOutgoingPackets) {
- // Add packet to list of packets to send.
+
+ synchronized (fOutgoingPackets) {
+ // Add packet to list of packets to send.
fOutgoingPackets.add(packet);
- // Notify PacketSendThread that data is available.
+ // Notify PacketSendThread that data is available.
fOutgoingPackets.notifyAll();
}
}
-
- /**
+
+ /**
* Send available packets to the Virtual Machine.
*/
- private void sendAvailablePackets() throws InterruptedException, IOException {
- LinkedList packetsToSend = new LinkedList();
- synchronized (fOutgoingPackets) {
+ private void sendAvailablePackets() throws InterruptedException,
+ IOException {
+ LinkedList<JdwpPacket> packetsToSend = new LinkedList<JdwpPacket>();
+ synchronized (fOutgoingPackets) {
while (fOutgoingPackets.size() == 0) {
fOutgoingPackets.wait();
}
packetsToSend.addAll(fOutgoingPackets);
fOutgoingPackets.clear();
- }
+ }
// Put available packets on Output Stream.
while (packetsToSend.size() > 0) {
- // Note that only JdwpPackets are added to the list, so a ClassCastException can't occur.
- JdwpPacket packet = (JdwpPacket)packetsToSend.removeFirst();
+ // Note that only JdwpPackets are added to the list, so a
+ // ClassCastException can't occur.
+ JdwpPacket packet = packetsToSend.removeFirst();
byte[] bytes = packet.getPacketAsBytes();
getConnection().writePacket(bytes);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketAttachingConnectorImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketAttachingConnectorImpl.java
index a7942e163..bb0f97491 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketAttachingConnectorImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketAttachingConnectorImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -18,6 +17,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.jdi.internal.VirtualMachineManagerImpl;
+import org.eclipse.jdi.internal.connect.ConnectorImpl.ArgumentImpl;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.AttachingConnector;
@@ -25,97 +25,117 @@ import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
import com.sun.jdi.connect.spi.Connection;
-public class SocketAttachingConnectorImpl extends ConnectorImpl implements AttachingConnector {
+public class SocketAttachingConnectorImpl extends ConnectorImpl implements
+ AttachingConnector {
/** Hostname to which is attached. */
private String fHostname;
/** Port to which is attached. */
private int fPort;
- private int fTimeout;
-
+ private int fTimeout;
+
/**
* Creates new SocketAttachingConnectorImpl.
*/
- public SocketAttachingConnectorImpl(VirtualMachineManagerImpl virtualMachineManager) {
+ public SocketAttachingConnectorImpl(
+ VirtualMachineManagerImpl virtualMachineManager) {
super(virtualMachineManager);
-
+
// Create communication protocol specific transport.
SocketTransportImpl transport = new SocketTransportImpl();
setTransport(transport);
}
-
+
/**
* @return Returns the default arguments.
- */
- public Map defaultArguments() {
- HashMap arguments = new HashMap(2);
-
+ */
+ public Map<String, ArgumentImpl> defaultArguments() {
+ HashMap<String, ArgumentImpl> arguments = new HashMap<String, ArgumentImpl>(2);
+
// Hostname
- StringArgumentImpl strArg = new StringArgumentImpl("hostname", ConnectMessages.SocketAttachingConnectorImpl_Machine_name_to_which_to_attach_for_VM_connections_1, ConnectMessages.SocketAttachingConnectorImpl_Host_2, false); //$NON-NLS-1$
+ StringArgumentImpl strArg = new StringArgumentImpl(
+ "hostname", ConnectMessages.SocketAttachingConnectorImpl_Machine_name_to_which_to_attach_for_VM_connections_1, ConnectMessages.SocketAttachingConnectorImpl_Host_2, false); //$NON-NLS-1$
strArg.setValue("localhost"); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
-
+
// Port
- IntegerArgumentImpl intArg = new IntegerArgumentImpl("port", ConnectMessages.SocketAttachingConnectorImpl_Port_number_to_which_to_attach_for_VM_connections_3, ConnectMessages.SocketAttachingConnectorImpl_Port_4, true, SocketTransportImpl.MIN_PORTNR, SocketTransportImpl.MAX_PORTNR); //$NON-NLS-1$
+ IntegerArgumentImpl intArg = new IntegerArgumentImpl(
+ "port", ConnectMessages.SocketAttachingConnectorImpl_Port_number_to_which_to_attach_for_VM_connections_3, ConnectMessages.SocketAttachingConnectorImpl_Port_4, true, SocketTransportImpl.MIN_PORTNR, SocketTransportImpl.MAX_PORTNR); //$NON-NLS-1$
arguments.put(intArg.name(), intArg);
-
- // Timeout
- IntegerArgumentImpl timeoutArg = new IntegerArgumentImpl("timeout", ConnectMessages.SocketAttachingConnectorImpl_1, ConnectMessages.SocketAttachingConnectorImpl_2, false, 0, Integer.MAX_VALUE); //$NON-NLS-1$
- timeoutArg.setValue(0); // by default wait forever
- arguments.put(timeoutArg.name(), timeoutArg);
-
+
+ // Timeout
+ IntegerArgumentImpl timeoutArg = new IntegerArgumentImpl(
+ "timeout", ConnectMessages.SocketAttachingConnectorImpl_1, ConnectMessages.SocketAttachingConnectorImpl_2, false, 0, Integer.MAX_VALUE); //$NON-NLS-1$
+ timeoutArg.setValue(0); // by default wait forever
+ arguments.put(timeoutArg.name(), timeoutArg);
+
return arguments;
}
-
+
/**
* @return Returns a short identifier for the connector.
- */
+ */
+ @Override
public String name() {
return "com.sun.jdi.SocketAttach"; //$NON-NLS-1$
}
-
+
/**
- * @return Returns a human-readable description of this connector and its purpose.
- */
+ * @return Returns a human-readable description of this connector and its
+ * purpose.
+ */
+ @Override
public String description() {
- return ConnectMessages.SocketAttachingConnectorImpl_Attaches_by_socket_to_other_VMs_5;
+ return ConnectMessages.SocketAttachingConnectorImpl_Attaches_by_socket_to_other_VMs_5;
}
-
- /**
- * Retrieves connection arguments.
- */
- private void getConnectionArguments(Map connectionArgs) throws IllegalConnectorArgumentsException {
+
+ /**
+ * Retrieves connection arguments.
+ */
+ private void getConnectionArguments(Map connectionArgs)
+ throws IllegalConnectorArgumentsException {
String attribute = ""; //$NON-NLS-1$
try {
attribute = "hostname"; //$NON-NLS-1$
- fHostname = ((Connector.StringArgument)connectionArgs.get(attribute)).value();
- attribute = "port"; //$NON-NLS-1$
- fPort = ((Connector.IntegerArgument)connectionArgs.get(attribute)).intValue();
- attribute = "timeout"; //$NON-NLS-1$
- Object object = connectionArgs.get(attribute);
- if (object != null) {
- Connector.IntegerArgument timeoutArg = (IntegerArgument) object;
- if (timeoutArg.value() != null) {
- fTimeout = timeoutArg.intValue();
- }
- }
+ fHostname = ((Connector.StringArgument) connectionArgs
+ .get(attribute)).value();
+ attribute = "port"; //$NON-NLS-1$
+ fPort = ((Connector.IntegerArgument) connectionArgs.get(attribute))
+ .intValue();
+ attribute = "timeout"; //$NON-NLS-1$
+ Object object = connectionArgs.get(attribute);
+ if (object != null) {
+ Connector.IntegerArgument timeoutArg = (IntegerArgument) object;
+ if (timeoutArg.value() != null) {
+ fTimeout = timeoutArg.intValue();
+ }
+ }
} catch (ClassCastException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketAttachingConnectorImpl_Connection_argument_is_not_of_the_right_type_6, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketAttachingConnectorImpl_Connection_argument_is_not_of_the_right_type_6,
+ attribute);
} catch (NullPointerException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketAttachingConnectorImpl_Necessary_connection_argument_is_null_7, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketAttachingConnectorImpl_Necessary_connection_argument_is_null_7,
+ attribute);
} catch (NumberFormatException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketAttachingConnectorImpl_Connection_argument_is_not_a_number_8, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketAttachingConnectorImpl_Connection_argument_is_not_a_number_8,
+ attribute);
}
}
-
+
/**
* Establishes a connection to a virtual machine.
+ *
* @return Returns a connected Virtual Machine.
*/
- public VirtualMachine attach(Map connectionArgs) throws IOException, IllegalConnectorArgumentsException {
+ public VirtualMachine attach(Map connectionArgs) throws IOException,
+ IllegalConnectorArgumentsException {
getConnectionArguments(connectionArgs);
Connection connection = null;
try {
- connection = ((SocketTransportImpl)fTransport).attach(fHostname, fPort, fTimeout, 0);
+ connection = ((SocketTransportImpl) fTransport).attach(fHostname,
+ fPort, fTimeout, 0);
} catch (IllegalArgumentException e) {
List args = new ArrayList();
args.add("hostname"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketConnection.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketConnection.java
index 06a1e0f44..6817d529f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketConnection.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketConnection.java
@@ -19,107 +19,124 @@ import com.sun.jdi.connect.spi.Connection;
public class SocketConnection extends Connection {
- private SocketTransportService fTransport;
-
- SocketConnection(SocketTransportService transport) {
- fTransport = transport;
- }
-
- /* (non-Javadoc)
- * @see com.sun.jdi.connect.spi.Connection#close()
- */
- public synchronized void close() throws IOException {
- if (fTransport == null)
- return;
-
- fTransport.close();
- fTransport = null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.jdi.connect.spi.Connection#isOpen()
- */
- public synchronized boolean isOpen() {
- return fTransport != null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.jdi.connect.spi.Connection#readPacket()
- */
- public byte[] readPacket() throws IOException {
- DataInputStream stream;
- synchronized (this) {
- if (!isOpen()) {
- throw new ClosedConnectionException();
- }
- stream = new DataInputStream(fTransport.getInputStream());
- }
- synchronized (stream) {
- int packetLength = 0;
- try {
- packetLength = stream.readInt();
- } catch (IOException e) {
- throw new ClosedConnectionException();
- }
-
- if (packetLength < 11) {
- throw new IOException("JDWP Packet under 11 bytes"); //$NON-NLS-1$
- }
-
- byte[] packet = new byte[packetLength];
- packet[0] = (byte) ((packetLength >>> 24) & 0xFF);
- packet[1] = (byte) ((packetLength >>> 16) & 0xFF);
- packet[2] = (byte) ((packetLength >>> 8) & 0xFF);
- packet[3] = (byte) ((packetLength >>> 0) & 0xFF);
-
- stream.readFully(packet, 4, packetLength - 4);
- return packet;
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.jdi.connect.spi.Connection#writePacket(byte[])
- */
- public void writePacket(byte[] packet) throws IOException {
- if (!isOpen()) {
- throw new ClosedConnectionException();
- }
- if (packet == null){
- throw new IllegalArgumentException("Invalid JDWP Packet, packet cannot be null"); //$NON-NLS-1$
- }
- if (packet.length < 11) {
- throw new IllegalArgumentException("Invalid JDWP Packet, must be at least 11 bytes. PacketSize:" + packet.length); //$NON-NLS-1$
- }
-
- int packetSize = getPacketLength(packet);
- if (packetSize < 11) {
- throw new IllegalArgumentException("Invalid JDWP Packet, must be at least 11 bytes. PacketSize:" + packetSize); //$NON-NLS-1$
- }
-
- if (packetSize > packet.length) {
- throw new IllegalArgumentException("Invalid JDWP packet: Specified length is greater than actual length"); //$NON-NLS-1$
- }
-
- OutputStream stream = null;
- synchronized(this) {
- if (!isOpen()) {
- throw new ClosedConnectionException();
- }
- stream = fTransport.getOutputStream();
- }
-
- synchronized (stream) {
- // packet.length can be > packetSize. Sending too much will cause
- // errors on the other side
- stream.write(packet, 0, packetSize);
- }
- }
-
- private int getPacketLength(byte[] packet) {
- int len = 0;
- if (packet.length >= 4) {
- len = (((packet[0] & 0xFF) << 24) + ((packet[1] & 0xFF) << 16) + ((packet[2] & 0xFF) << 8) + ((packet[3] & 0xFF) << 0));
- }
- return len;
- }
+ private SocketTransportService fTransport;
+
+ SocketConnection(SocketTransportService transport) {
+ fTransport = transport;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.Connection#close()
+ */
+ @Override
+ public synchronized void close() throws IOException {
+ if (fTransport == null)
+ return;
+
+ fTransport.close();
+ fTransport = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.Connection#isOpen()
+ */
+ @Override
+ public synchronized boolean isOpen() {
+ return fTransport != null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.Connection#readPacket()
+ */
+ @Override
+ public byte[] readPacket() throws IOException {
+ DataInputStream stream;
+ synchronized (this) {
+ if (!isOpen()) {
+ throw new ClosedConnectionException();
+ }
+ stream = new DataInputStream(fTransport.getInputStream());
+ }
+ synchronized (stream) {
+ int packetLength = 0;
+ try {
+ packetLength = stream.readInt();
+ } catch (IOException e) {
+ throw new ClosedConnectionException();
+ }
+
+ if (packetLength < 11) {
+ throw new IOException("JDWP Packet under 11 bytes"); //$NON-NLS-1$
+ }
+
+ byte[] packet = new byte[packetLength];
+ packet[0] = (byte) ((packetLength >>> 24) & 0xFF);
+ packet[1] = (byte) ((packetLength >>> 16) & 0xFF);
+ packet[2] = (byte) ((packetLength >>> 8) & 0xFF);
+ packet[3] = (byte) ((packetLength >>> 0) & 0xFF);
+
+ stream.readFully(packet, 4, packetLength - 4);
+ return packet;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.Connection#writePacket(byte[])
+ */
+ @Override
+ public void writePacket(byte[] packet) throws IOException {
+ if (!isOpen()) {
+ throw new ClosedConnectionException();
+ }
+ if (packet == null) {
+ throw new IllegalArgumentException(
+ "Invalid JDWP Packet, packet cannot be null"); //$NON-NLS-1$
+ }
+ if (packet.length < 11) {
+ throw new IllegalArgumentException(
+ "Invalid JDWP Packet, must be at least 11 bytes. PacketSize:" + packet.length); //$NON-NLS-1$
+ }
+
+ int packetSize = getPacketLength(packet);
+ if (packetSize < 11) {
+ throw new IllegalArgumentException(
+ "Invalid JDWP Packet, must be at least 11 bytes. PacketSize:" + packetSize); //$NON-NLS-1$
+ }
+
+ if (packetSize > packet.length) {
+ throw new IllegalArgumentException(
+ "Invalid JDWP packet: Specified length is greater than actual length"); //$NON-NLS-1$
+ }
+
+ OutputStream stream = null;
+ synchronized (this) {
+ if (!isOpen()) {
+ throw new ClosedConnectionException();
+ }
+ stream = fTransport.getOutputStream();
+ }
+
+ synchronized (stream) {
+ // packet.length can be > packetSize. Sending too much will cause
+ // errors on the other side
+ stream.write(packet, 0, packetSize);
+ }
+ }
+
+ private int getPacketLength(byte[] packet) {
+ int len = 0;
+ if (packet.length >= 4) {
+ len = (((packet[0] & 0xFF) << 24) + ((packet[1] & 0xFF) << 16)
+ + ((packet[2] & 0xFF) << 8) + ((packet[3] & 0xFF) << 0));
+ }
+ return len;
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketLaunchingConnectorImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketLaunchingConnectorImpl.java
index f648b60ff..0f9dbfd4d 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketLaunchingConnectorImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketLaunchingConnectorImpl.java
@@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.ServerSocket;
@@ -22,6 +21,7 @@ import java.util.Map;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.VirtualMachineManagerImpl;
+import org.eclipse.jdi.internal.connect.ConnectorImpl.ArgumentImpl;
import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.VirtualMachine;
@@ -30,129 +30,161 @@ import com.sun.jdi.connect.IllegalConnectorArgumentsException;
import com.sun.jdi.connect.LaunchingConnector;
import com.sun.jdi.connect.VMStartException;
-
-public class SocketLaunchingConnectorImpl extends ConnectorImpl implements LaunchingConnector {
+public class SocketLaunchingConnectorImpl extends ConnectorImpl implements
+ LaunchingConnector {
/** Time that a launched VM is given to connect to us. */
- private static final int ACCEPT_TIMEOUT = 10*1000;
-
- /** Home directory of the SDK or runtime environment used to launch the application. */
+ private static final int ACCEPT_TIMEOUT = 10 * 1000;
+
+ /**
+ * Home directory of the SDK or runtime environment used to launch the
+ * application.
+ */
private String fHome;
/** Launched VM options. */
private String fOptions;
- /** Main class and arguments, or if -jar is an option, the main jar file and arguments. */
+ /**
+ * Main class and arguments, or if -jar is an option, the main jar file and
+ * arguments.
+ */
private String fMain;
/** All threads will be suspended before execution of main. */
private boolean fSuspend;
/** Name of the Java VM launcher. */
private String fLauncher;
-
+
/**
* Creates new SocketAttachingConnectorImpl.
*/
- public SocketLaunchingConnectorImpl(VirtualMachineManagerImpl virtualMachineManager) {
+ public SocketLaunchingConnectorImpl(
+ VirtualMachineManagerImpl virtualMachineManager) {
super(virtualMachineManager);
-
+
// Create communication protocol specific transport.
SocketTransportImpl transport = new SocketTransportImpl();
setTransport(transport);
}
-
+
/**
* @return Returns the default arguments.
- */
- public Map defaultArguments() {
- HashMap arguments = new HashMap(6);
-
+ */
+ public Map<String, ArgumentImpl> defaultArguments() {
+ HashMap<String, ArgumentImpl> arguments = new HashMap<String, ArgumentImpl>(6);
+
// Home
- StringArgumentImpl strArg = new StringArgumentImpl("home", ConnectMessages.SocketLaunchingConnectorImpl_Home_directory_of_the_SDK_or_runtime_environment_used_to_launch_the_application_1, ConnectMessages.SocketLaunchingConnectorImpl_Home_2, false); //$NON-NLS-1$
+ StringArgumentImpl strArg = new StringArgumentImpl(
+ "home", ConnectMessages.SocketLaunchingConnectorImpl_Home_directory_of_the_SDK_or_runtime_environment_used_to_launch_the_application_1, ConnectMessages.SocketLaunchingConnectorImpl_Home_2, false); //$NON-NLS-1$
strArg.setValue(System.getProperty("java.home")); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
-
+
// Options
- strArg = new StringArgumentImpl("options", ConnectMessages.SocketLaunchingConnectorImpl_Launched_VM_options_3, ConnectMessages.SocketLaunchingConnectorImpl_Options_4, false); //$NON-NLS-1$
+ strArg = new StringArgumentImpl(
+ "options", ConnectMessages.SocketLaunchingConnectorImpl_Launched_VM_options_3, ConnectMessages.SocketLaunchingConnectorImpl_Options_4, false); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
-
+
// Main
- strArg = new StringArgumentImpl("main", ConnectMessages.SocketLaunchingConnectorImpl_Main_class_and_arguments__or_if__jar_is_an_option__the_main_jar_file_and_arguments_5, ConnectMessages.SocketLaunchingConnectorImpl_Main_6, true); //$NON-NLS-1$
+ strArg = new StringArgumentImpl(
+ "main", ConnectMessages.SocketLaunchingConnectorImpl_Main_class_and_arguments__or_if__jar_is_an_option__the_main_jar_file_and_arguments_5, ConnectMessages.SocketLaunchingConnectorImpl_Main_6, true); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
// Suspend
- BooleanArgumentImpl boolArg = new BooleanArgumentImpl("suspend", ConnectMessages.SocketLaunchingConnectorImpl_All_threads_will_be_suspended_before_execution_of_main_7, ConnectMessages.SocketLaunchingConnectorImpl_Suspend_8, false); //$NON-NLS-1$
+ BooleanArgumentImpl boolArg = new BooleanArgumentImpl(
+ "suspend", ConnectMessages.SocketLaunchingConnectorImpl_All_threads_will_be_suspended_before_execution_of_main_7, ConnectMessages.SocketLaunchingConnectorImpl_Suspend_8, false); //$NON-NLS-1$
boolArg.setValue(true);
arguments.put(boolArg.name(), boolArg);
// Quote
- strArg = new StringArgumentImpl("quote", ConnectMessages.SocketLaunchingConnectorImpl_Character_used_to_combine_space_delimited_text_into_a_single_command_line_argument_9, ConnectMessages.SocketLaunchingConnectorImpl_Quote_10, true); //$NON-NLS-1$
+ strArg = new StringArgumentImpl(
+ "quote", ConnectMessages.SocketLaunchingConnectorImpl_Character_used_to_combine_space_delimited_text_into_a_single_command_line_argument_9, ConnectMessages.SocketLaunchingConnectorImpl_Quote_10, true); //$NON-NLS-1$
strArg.setValue("\""); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
// Launcher
- strArg = new StringArgumentImpl("vmexec", ConnectMessages.SocketLaunchingConnectorImpl_Name_of_the_Java_VM_launcher_11, ConnectMessages.SocketLaunchingConnectorImpl_Launcher_12, true); //$NON-NLS-1$
+ strArg = new StringArgumentImpl(
+ "vmexec", ConnectMessages.SocketLaunchingConnectorImpl_Name_of_the_Java_VM_launcher_11, ConnectMessages.SocketLaunchingConnectorImpl_Launcher_12, true); //$NON-NLS-1$
strArg.setValue("java"); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
return arguments;
}
-
+
/**
* @return Returns a short identifier for the connector.
- */
+ */
+ @Override
public String name() {
return "com.sun.jdi.CommandLineLaunch"; //$NON-NLS-1$
}
-
+
/**
- * @return Returns a human-readable description of this connector and its purpose.
- */
+ * @return Returns a human-readable description of this connector and its
+ * purpose.
+ */
+ @Override
public String description() {
- return ConnectMessages.SocketLaunchingConnectorImpl_Launches_target_using_Sun_Java_VM_command_line_and_attaches_to_it_13;
+ return ConnectMessages.SocketLaunchingConnectorImpl_Launches_target_using_Sun_Java_VM_command_line_and_attaches_to_it_13;
}
-
- /**
- * Retrieves connection arguments.
- */
- private void getConnectionArguments(Map connectionArgs) throws IllegalConnectorArgumentsException {
+
+ /**
+ * Retrieves connection arguments.
+ */
+ private void getConnectionArguments(Map connectionArgs)
+ throws IllegalConnectorArgumentsException {
String attribute = ""; //$NON-NLS-1$
try {
attribute = "home"; //$NON-NLS-1$
- fHome = ((Connector.StringArgument)connectionArgs.get(attribute)).value();
- attribute = "options"; //$NON-NLS-1$
- fOptions = ((Connector.StringArgument)connectionArgs.get(attribute)).value();
- attribute = "main"; //$NON-NLS-1$
- fMain = ((Connector.StringArgument)connectionArgs.get(attribute)).value();
- attribute = "suspend"; //$NON-NLS-1$
- fSuspend = ((Connector.BooleanArgument)connectionArgs.get(attribute)).booleanValue();
- attribute = "quote"; //$NON-NLS-1$
- ((Connector.StringArgument)connectionArgs.get(attribute)).value();
- attribute = "vmexec"; //$NON-NLS-1$
- fLauncher = ((Connector.StringArgument)connectionArgs.get(attribute)).value();
+ fHome = ((Connector.StringArgument) connectionArgs.get(attribute))
+ .value();
+ attribute = "options"; //$NON-NLS-1$
+ fOptions = ((Connector.StringArgument) connectionArgs
+ .get(attribute)).value();
+ attribute = "main"; //$NON-NLS-1$
+ fMain = ((Connector.StringArgument) connectionArgs.get(attribute))
+ .value();
+ attribute = "suspend"; //$NON-NLS-1$
+ fSuspend = ((Connector.BooleanArgument) connectionArgs
+ .get(attribute)).booleanValue();
+ attribute = "quote"; //$NON-NLS-1$
+ ((Connector.StringArgument) connectionArgs.get(attribute)).value();
+ attribute = "vmexec"; //$NON-NLS-1$
+ fLauncher = ((Connector.StringArgument) connectionArgs
+ .get(attribute)).value();
} catch (ClassCastException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketLaunchingConnectorImpl_Connection_argument_is_not_of_the_right_type_14, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketLaunchingConnectorImpl_Connection_argument_is_not_of_the_right_type_14,
+ attribute);
} catch (NullPointerException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketLaunchingConnectorImpl_Necessary_connection_argument_is_null_15, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketLaunchingConnectorImpl_Necessary_connection_argument_is_null_15,
+ attribute);
} catch (NumberFormatException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketLaunchingConnectorImpl_Connection_argument_is_not_a_number_16, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketLaunchingConnectorImpl_Connection_argument_is_not_a_number_16,
+ attribute);
}
}
/**
- * Launches an application and connects to its VM.
+ * Launches an application and connects to its VM.
+ *
* @return Returns a connected Virtual Machine.
*/
- public VirtualMachine launch(Map connectionArgs) throws IOException, IllegalConnectorArgumentsException, VMStartException {
+ public VirtualMachine launch(Map connectionArgs) throws IOException,
+ IllegalConnectorArgumentsException, VMStartException {
getConnectionArguments(connectionArgs);
-
- // A listening connector is used that waits for a connection of the VM that is started up.
+
+ // A listening connector is used that waits for a connection of the VM
+ // that is started up.
// Note that port number zero means that a free port is chosen.
- SocketListeningConnectorImpl listenConnector = new SocketListeningConnectorImpl(virtualMachineManager());
- Map args = listenConnector.defaultArguments();
- ((Connector.IntegerArgument)args.get("timeout")).setValue(ACCEPT_TIMEOUT); //$NON-NLS-1$
+ SocketListeningConnectorImpl listenConnector = new SocketListeningConnectorImpl(
+ virtualMachineManager());
+ Map<String, ArgumentImpl> args = listenConnector.defaultArguments();
+ ((Connector.IntegerArgument) args.get("timeout")).setValue(ACCEPT_TIMEOUT); //$NON-NLS-1$
String address = listenConnector.startListening(args);
-
+
// String for Executable.
String slash = System.getProperty("file.separator"); //$NON-NLS-1$
String execString = fHome + slash + "bin" + slash + fLauncher; //$NON-NLS-1$
-
+
// Add Debug options.
execString += " -Xdebug -Xnoagent -Djava.compiler=NONE"; //$NON-NLS-1$
execString += " -Xrunjdwp:transport=dt_socket,address=" + address + ",server=n,suspend=" + (fSuspend ? "y" : "n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -160,10 +192,10 @@ public class SocketLaunchingConnectorImpl extends ConnectorImpl implements Launc
// Add User specified options.
if (fOptions != null)
execString += " " + fOptions; //$NON-NLS-1$
-
+
// Add Main class.
execString += " " + fMain; //$NON-NLS-1$
-
+
// Start VM.
String[] cmdLine = DebugPlugin.parseArguments(execString);
Process proc = Runtime.getRuntime().exec(cmdLine);
@@ -171,29 +203,34 @@ public class SocketLaunchingConnectorImpl extends ConnectorImpl implements Launc
// The accept times out if the VM does not connect.
VirtualMachineImpl virtualMachine;
try {
- virtualMachine = (VirtualMachineImpl)listenConnector.accept(args);
+ virtualMachine = (VirtualMachineImpl) listenConnector.accept(args);
} catch (InterruptedIOException e) {
proc.destroy();
- String message= MessageFormat.format(ConnectMessages.SocketLaunchingConnectorImpl_VM_did_not_connect_within_given_time___0__ms_1, new String[]{((Connector.IntegerArgument)args.get("timeout")).value()}); //$NON-NLS-1$
+ String message = MessageFormat
+ .format(ConnectMessages.SocketLaunchingConnectorImpl_VM_did_not_connect_within_given_time___0__ms_1,
+ new String[] { ((Connector.IntegerArgument) args
+ .get("timeout")).value() }); //$NON-NLS-1$
throw new VMStartException(message, proc);
}
-
+
virtualMachine.setLaunchedProcess(proc);
return virtualMachine;
}
-
+
/**
- * Returns a free port number on localhost, or -1 if unable to find a free port.
+ * Returns a free port number on localhost, or -1 if unable to find a free
+ * port.
*
- * @return a free port number on localhost, or -1 if unable to find a free port
+ * @return a free port number on localhost, or -1 if unable to find a free
+ * port
* @since 3.2
*/
public static int findFreePort() {
- ServerSocket socket= null;
+ ServerSocket socket = null;
try {
- socket= new ServerSocket(0);
+ socket = new ServerSocket(0);
return socket.getLocalPort();
- } catch (IOException e) {
+ } catch (IOException e) {
} finally {
if (socket != null) {
try {
@@ -202,6 +239,6 @@ public class SocketLaunchingConnectorImpl extends ConnectorImpl implements Launc
}
}
}
- return -1;
- }
+ return -1;
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketListeningConnectorImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketListeningConnectorImpl.java
index 7707ce6de..340899b4c 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketListeningConnectorImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketListeningConnectorImpl.java
@@ -12,139 +12,162 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jdi.internal.VirtualMachineManagerImpl;
+import org.eclipse.jdi.internal.connect.ConnectorImpl.ArgumentImpl;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
import com.sun.jdi.connect.ListeningConnector;
-
-public class SocketListeningConnectorImpl extends ConnectorImpl implements ListeningConnector {
+public class SocketListeningConnectorImpl extends ConnectorImpl implements
+ ListeningConnector {
/** Port to which is attached. */
private int fPort;
/** Timeout before accept returns. */
private int fTimeout;
-
-
+
/**
* Creates new SocketAttachingConnectorImpl.
*/
- public SocketListeningConnectorImpl(VirtualMachineManagerImpl virtualMachineManager) {
+ public SocketListeningConnectorImpl(
+ VirtualMachineManagerImpl virtualMachineManager) {
super(virtualMachineManager);
-
+
// Create communication protocol specific transport.
SocketTransportImpl transport = new SocketTransportImpl();
setTransport(transport);
}
-
+
/**
* @return Returns the default arguments.
- */
- public Map defaultArguments() {
- HashMap arguments = new HashMap(1);
-
+ */
+ public Map<String, ArgumentImpl> defaultArguments() {
+ HashMap<String, ArgumentImpl> arguments = new HashMap<String, ArgumentImpl>(1);
+
// Port
- IntegerArgumentImpl intArg = new IntegerArgumentImpl("port", ConnectMessages.SocketListeningConnectorImpl_Port_number_at_which_to_listen_for_VM_connections_1, ConnectMessages.SocketListeningConnectorImpl_Port_2, true, SocketTransportImpl.MIN_PORTNR, SocketTransportImpl.MAX_PORTNR); //$NON-NLS-1$
+ IntegerArgumentImpl intArg = new IntegerArgumentImpl(
+ "port", ConnectMessages.SocketListeningConnectorImpl_Port_number_at_which_to_listen_for_VM_connections_1, ConnectMessages.SocketListeningConnectorImpl_Port_2, true, SocketTransportImpl.MIN_PORTNR, SocketTransportImpl.MAX_PORTNR); //$NON-NLS-1$
arguments.put(intArg.name(), intArg);
-
+
// Timeout
- intArg = new IntegerArgumentImpl("timeout", ConnectMessages.SocketListeningConnectorImpl_Timeout_before_accept_returns_3, ConnectMessages.SocketListeningConnectorImpl_Timeout_4, false, 0, Integer.MAX_VALUE); //$NON-NLS-1$
+ intArg = new IntegerArgumentImpl(
+ "timeout", ConnectMessages.SocketListeningConnectorImpl_Timeout_before_accept_returns_3, ConnectMessages.SocketListeningConnectorImpl_Timeout_4, false, 0, Integer.MAX_VALUE); //$NON-NLS-1$
arguments.put(intArg.name(), intArg);
-
+
return arguments;
}
-
+
/**
* @return Returns a short identifier for the connector.
- */
+ */
+ @Override
public String name() {
return "com.sun.jdi.SocketListen"; //$NON-NLS-1$
}
-
+
/**
- * @return Returns a human-readable description of this connector and its purpose.
- */
+ * @return Returns a human-readable description of this connector and its
+ * purpose.
+ */
+ @Override
public String description() {
- return ConnectMessages.SocketListeningConnectorImpl_Accepts_socket_connections_initiated_by_other_VMs_5;
+ return ConnectMessages.SocketListeningConnectorImpl_Accepts_socket_connections_initiated_by_other_VMs_5;
}
-
- /**
- * Retrieves connection arguments.
- */
- private void getConnectionArguments(Map connectionArgs) throws IllegalConnectorArgumentsException {
+
+ /**
+ * Retrieves connection arguments.
+ */
+ private void getConnectionArguments(Map<String, ArgumentImpl> connectionArgs)
+ throws IllegalConnectorArgumentsException {
String attribute = "port"; //$NON-NLS-1$
try {
- // If listening port is not specified, use port 0
- IntegerArgument argument = (IntegerArgument) connectionArgs.get(attribute);
+ // If listening port is not specified, use port 0
+ IntegerArgument argument = (IntegerArgument) connectionArgs
+ .get(attribute);
if (argument != null && argument.value() != null) {
fPort = argument.intValue();
} else {
fPort = 0;
}
- // Note that timeout is not used in SUN's ListeningConnector, but is used by our
- // LaunchingConnector.
- attribute = "timeout"; //$NON-NLS-1$
- argument = (IntegerArgument) connectionArgs.get(attribute);
- if (argument != null && argument.value() != null) {
- fTimeout = argument.intValue();
- } else {
- fTimeout = 0;
- }
+ // Note that timeout is not used in SUN's ListeningConnector, but is
+ // used by our
+ // LaunchingConnector.
+ attribute = "timeout"; //$NON-NLS-1$
+ argument = (IntegerArgument) connectionArgs.get(attribute);
+ if (argument != null && argument.value() != null) {
+ fTimeout = argument.intValue();
+ } else {
+ fTimeout = 0;
+ }
} catch (ClassCastException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_Connection_argument_is_not_of_the_right_type_6, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketListeningConnectorImpl_Connection_argument_is_not_of_the_right_type_6,
+ attribute);
} catch (NullPointerException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_Necessary_connection_argument_is_null_7, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketListeningConnectorImpl_Necessary_connection_argument_is_null_7,
+ attribute);
} catch (NumberFormatException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_Connection_argument_is_not_a_number_8, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketListeningConnectorImpl_Connection_argument_is_not_a_number_8,
+ attribute);
}
}
-
+
/**
- * Listens for one or more connections initiated by target VMs.
- * @return Returns the address at which the connector is listening for a connection.
+ * Listens for one or more connections initiated by target VMs.
+ *
+ * @return Returns the address at which the connector is listening for a
+ * connection.
*/
- public String startListening(Map connectionArgs) throws IOException, IllegalConnectorArgumentsException {
+ public String startListening(Map<String, ArgumentImpl> connectionArgs) throws IOException,
+ IllegalConnectorArgumentsException {
getConnectionArguments(connectionArgs);
String result = null;
try {
- result = ((SocketTransportImpl)fTransport).startListening(fPort);
+ result = ((SocketTransportImpl) fTransport).startListening(fPort);
} catch (IllegalArgumentException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_ListeningConnector_Socket_Port, "port"); //$NON-NLS-1$
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketListeningConnectorImpl_ListeningConnector_Socket_Port,
+ "port"); //$NON-NLS-1$
}
return result;
}
-
+
/**
- * Cancels listening for connections.
+ * Cancels listening for connections.
*/
public void stopListening(Map connectionArgs) throws IOException {
- ((SocketTransportImpl)fTransport).stopListening();
+ ((SocketTransportImpl) fTransport).stopListening();
}
-
+
/**
* Waits for a target VM to attach to this connector.
+ *
* @return Returns a connected Virtual Machine.
*/
- public VirtualMachine accept(Map connectionArgs) throws IOException, IllegalConnectorArgumentsException {
- getConnectionArguments(connectionArgs);
- SocketConnection connection = (SocketConnection) ((SocketTransportImpl)fTransport).accept(fTimeout, 0);
+ public VirtualMachine accept(Map<String, ArgumentImpl> connectionArgs) throws IOException,
+ IllegalConnectorArgumentsException {
+ getConnectionArguments(connectionArgs);
+ SocketConnection connection = (SocketConnection) ((SocketTransportImpl) fTransport)
+ .accept(fTimeout, 0);
return establishedConnection(connection);
}
-
+
/**
- * @return Returns whether this listening connector supports multiple connections for a single argument map.
+ * @return Returns whether this listening connector supports multiple
+ * connections for a single argument map.
*/
public boolean supportsMultipleConnections() {
return true;
}
-
+
/**
- * @return Returns port number that is listened to.
+ * @return Returns port number that is listened to.
*/
public int listeningPort() {
return fPort;
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketRawLaunchingConnectorImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketRawLaunchingConnectorImpl.java
index 03806f4ed..3007841fa 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketRawLaunchingConnectorImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketRawLaunchingConnectorImpl.java
@@ -10,128 +10,154 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import java.io.InterruptedIOException;
-import com.ibm.icu.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.VirtualMachineManagerImpl;
+import org.eclipse.jdi.internal.connect.ConnectorImpl.ArgumentImpl;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
import com.sun.jdi.connect.LaunchingConnector;
import com.sun.jdi.connect.VMStartException;
-
-public class SocketRawLaunchingConnectorImpl extends ConnectorImpl implements LaunchingConnector {
+public class SocketRawLaunchingConnectorImpl extends ConnectorImpl implements
+ LaunchingConnector {
/** Time that a launched VM is given to connect to us. */
private static final int ACCEPT_TIMEOUT = 10000;
/** Raw command to start the debugged application VM. */
private String fCommand;
- /** Address from which to listen for a connection after the raw command is run. */
+ /**
+ * Address from which to listen for a connection after the raw command is
+ * run.
+ */
private String fAddress;
-
+
/**
* Creates new SocketAttachingConnectorImpl.
*/
- public SocketRawLaunchingConnectorImpl(VirtualMachineManagerImpl virtualMachineManager) {
+ public SocketRawLaunchingConnectorImpl(
+ VirtualMachineManagerImpl virtualMachineManager) {
super(virtualMachineManager);
-
+
// Create communication protocol specific transport.
SocketTransportImpl transport = new SocketTransportImpl();
setTransport(transport);
}
-
+
/**
* @return Returns the default arguments.
- */
- public Map defaultArguments() {
- HashMap arguments = new HashMap(3);
-
+ */
+ public Map<String, ArgumentImpl> defaultArguments() {
+ HashMap<String, ArgumentImpl> arguments = new HashMap<String, ArgumentImpl>(3);
+
// Command
- StringArgumentImpl strArg = new StringArgumentImpl("command", ConnectMessages.SocketRawLaunchingConnectorImpl_Raw_command_to_start_the_debugged_application_VM_1, ConnectMessages.SocketRawLaunchingConnectorImpl_Command_2, true); //$NON-NLS-1$
+ StringArgumentImpl strArg = new StringArgumentImpl(
+ "command", ConnectMessages.SocketRawLaunchingConnectorImpl_Raw_command_to_start_the_debugged_application_VM_1, ConnectMessages.SocketRawLaunchingConnectorImpl_Command_2, true); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
-
+
// Address
- strArg = new StringArgumentImpl("address", ConnectMessages.SocketRawLaunchingConnectorImpl_Address_from_which_to_listen_for_a_connection_after_the_raw_command_is_run_3, ConnectMessages.SocketRawLaunchingConnectorImpl_Address_4, true); //$NON-NLS-1$
+ strArg = new StringArgumentImpl(
+ "address", ConnectMessages.SocketRawLaunchingConnectorImpl_Address_from_which_to_listen_for_a_connection_after_the_raw_command_is_run_3, ConnectMessages.SocketRawLaunchingConnectorImpl_Address_4, true); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
-
+
// Quote
- strArg = new StringArgumentImpl("quote", ConnectMessages.SocketRawLaunchingConnectorImpl_Character_used_to_combine_space_delimited_text_into_a_single_command_line_argument_5, ConnectMessages.SocketRawLaunchingConnectorImpl_Quote_6, true); //$NON-NLS-1$
+ strArg = new StringArgumentImpl(
+ "quote", ConnectMessages.SocketRawLaunchingConnectorImpl_Character_used_to_combine_space_delimited_text_into_a_single_command_line_argument_5, ConnectMessages.SocketRawLaunchingConnectorImpl_Quote_6, true); //$NON-NLS-1$
strArg.setValue("\""); //$NON-NLS-1$
arguments.put(strArg.name(), strArg);
return arguments;
}
-
+
/**
* @return Returns a short identifier for the connector.
- */
+ */
+ @Override
public String name() {
return "com.sun.jdi.RawCommandLineLaunch"; //$NON-NLS-1$
}
-
+
/**
- * @return Returns a human-readable description of this connector and its purpose.
- */
+ * @return Returns a human-readable description of this connector and its
+ * purpose.
+ */
+ @Override
public String description() {
- return ConnectMessages.SocketRawLaunchingConnectorImpl_Launches_target_using_user_specified_command_line_and_attaches_to_it_7;
+ return ConnectMessages.SocketRawLaunchingConnectorImpl_Launches_target_using_user_specified_command_line_and_attaches_to_it_7;
}
-
- /**
- * Retrieves connection arguments.
- */
- private void getConnectionArguments(Map connectionArgs) throws IllegalConnectorArgumentsException {
+
+ /**
+ * Retrieves connection arguments.
+ */
+ private void getConnectionArguments(Map connectionArgs)
+ throws IllegalConnectorArgumentsException {
String attribute = ""; //$NON-NLS-1$
try {
attribute = "command"; //$NON-NLS-1$
- fCommand = ((Connector.StringArgument)connectionArgs.get(attribute)).value();
- attribute = "address"; //$NON-NLS-1$
- fAddress = ((Connector.StringArgument)connectionArgs.get(attribute)).value();
- attribute = "quote"; //$NON-NLS-1$
- ((Connector.StringArgument)connectionArgs.get(attribute)).value();
+ fCommand = ((Connector.StringArgument) connectionArgs
+ .get(attribute)).value();
+ attribute = "address"; //$NON-NLS-1$
+ fAddress = ((Connector.StringArgument) connectionArgs
+ .get(attribute)).value();
+ attribute = "quote"; //$NON-NLS-1$
+ ((Connector.StringArgument) connectionArgs.get(attribute)).value();
} catch (ClassCastException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketRawLaunchingConnectorImpl_Connection_argument_is_not_of_the_right_type_8, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketRawLaunchingConnectorImpl_Connection_argument_is_not_of_the_right_type_8,
+ attribute);
} catch (NullPointerException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketRawLaunchingConnectorImpl_Necessary_connection_argument_is_null_9, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketRawLaunchingConnectorImpl_Necessary_connection_argument_is_null_9,
+ attribute);
} catch (NumberFormatException e) {
- throw new IllegalConnectorArgumentsException(ConnectMessages.SocketRawLaunchingConnectorImpl_Connection_argument_is_not_a_number_10, attribute);
+ throw new IllegalConnectorArgumentsException(
+ ConnectMessages.SocketRawLaunchingConnectorImpl_Connection_argument_is_not_a_number_10,
+ attribute);
}
}
/**
- * Launches an application and connects to its VM.
+ * Launches an application and connects to its VM.
+ *
* @return Returns a connected Virtual Machine.
*/
- public VirtualMachine launch(Map connectionArgs) throws IOException, IllegalConnectorArgumentsException, VMStartException {
+ public VirtualMachine launch(Map connectionArgs) throws IOException,
+ IllegalConnectorArgumentsException, VMStartException {
getConnectionArguments(connectionArgs);
-
- // A listening connector is used that waits for a connection of the VM that is started up.
+
+ // A listening connector is used that waits for a connection of the VM
+ // that is started up.
// Note that port number zero means that a free port is chosen.
- SocketListeningConnectorImpl listenConnector = new SocketListeningConnectorImpl(virtualMachineManager());
- Map args = listenConnector.defaultArguments();
- ((Connector.IntegerArgument)args.get("port")).setValue(fAddress); //$NON-NLS-1$
- ((Connector.IntegerArgument)args.get("timeout")).setValue(ACCEPT_TIMEOUT); //$NON-NLS-1$
+ SocketListeningConnectorImpl listenConnector = new SocketListeningConnectorImpl(
+ virtualMachineManager());
+ Map<String, ArgumentImpl> args = listenConnector.defaultArguments();
+ ((Connector.IntegerArgument) args.get("port")).setValue(fAddress); //$NON-NLS-1$
+ ((Connector.IntegerArgument) args.get("timeout")).setValue(ACCEPT_TIMEOUT); //$NON-NLS-1$
listenConnector.startListening(args);
-
+
// Start VM.
Process proc = Runtime.getRuntime().exec(fCommand);
// The accept times out it the VM does not connect.
VirtualMachineImpl virtualMachine;
try {
- virtualMachine = (VirtualMachineImpl)listenConnector.accept(args);
+ virtualMachine = (VirtualMachineImpl) listenConnector.accept(args);
} catch (InterruptedIOException e) {
proc.destroy();
- String message= MessageFormat.format(ConnectMessages.SocketLaunchingConnectorImpl_VM_did_not_connect_within_given_time___0__ms_1, new String[]{((Connector.IntegerArgument)args.get("timeout")).value()}); //$NON-NLS-1$
+ String message = MessageFormat
+ .format(ConnectMessages.SocketLaunchingConnectorImpl_VM_did_not_connect_within_given_time___0__ms_1,
+ new String[] { ((Connector.IntegerArgument) args
+ .get("timeout")).value() }); //$NON-NLS-1$
throw new VMStartException(message, proc);
}
-
+
virtualMachine.setLaunchedProcess(proc);
return virtualMachine;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportImpl.java
index ef23a8c15..8079f5b09 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import com.sun.jdi.connect.Transport;
@@ -18,43 +17,46 @@ import com.sun.jdi.connect.spi.Connection;
import com.sun.jdi.connect.spi.TransportService.ListenKey;
public class SocketTransportImpl implements Transport {
- public static final String TRANSPORT_NAME = "dt_socket"; //$NON-NLS-1$
+ public static final String TRANSPORT_NAME = "dt_socket"; //$NON-NLS-1$
public static final int MIN_PORTNR = 0;
public static final int MAX_PORTNR = 65535;
-
+
SocketTransportService service;
- private ListenKey fListenKey;
-
+ private ListenKey fListenKey;
+
/**
* Constructs new SocketTransportImpl.
- */
+ */
public SocketTransportImpl() {
service = new SocketTransportService();
}
- /* (non-Javadoc)
- * @see com.sun.jdi.connect.Transport#name()
- */
- public String name() {
- return TRANSPORT_NAME;
- }
-
- public Connection attach(String hostname, int port, long attachTimeout, long handshakeTimeout) throws IOException {
- return service.attach(hostname, port, attachTimeout, handshakeTimeout);
- }
-
- public String startListening(int port) throws IOException {
- fListenKey = service.startListening(port+""); //$NON-NLS-1$
- return fListenKey.address();
- }
-
- public void stopListening() throws IOException {
- service.stopListening(fListenKey);
- }
-
- public Connection accept(long attachTimeout, long handshakeTimeout) throws IOException {
- return service.accept(fListenKey, attachTimeout, handshakeTimeout);
- }
-
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.Transport#name()
+ */
+ public String name() {
+ return TRANSPORT_NAME;
+ }
+
+ public Connection attach(String hostname, int port, long attachTimeout,
+ long handshakeTimeout) throws IOException {
+ return service.attach(hostname, port, attachTimeout, handshakeTimeout);
+ }
+
+ public String startListening(int port) throws IOException {
+ fListenKey = service.startListening(port + ""); //$NON-NLS-1$
+ return fListenKey.address();
+ }
+
+ public void stopListening() throws IOException {
+ service.stopListening(fListenKey);
+ }
+
+ public Connection accept(long attachTimeout, long handshakeTimeout)
+ throws IOException {
+ return service.accept(fListenKey, attachTimeout, handshakeTimeout);
+ }
+
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportService.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportService.java
index cd4db1947..04040ee48 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportService.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketTransportService.java
@@ -30,298 +30,318 @@ import com.sun.jdi.connect.spi.Connection;
import com.sun.jdi.connect.spi.TransportService;
public class SocketTransportService extends TransportService {
- /** Handshake bytes used just after connecting VM. */
- private static final byte[] handshakeBytes = "JDWP-Handshake".getBytes(); //$NON-NLS-1$
-
- private Capabilities fCapabilities = new Capabilities() {
- public boolean supportsAcceptTimeout() {
- return true;
- }
-
- public boolean supportsAttachTimeout() {
- return true;
- }
-
- public boolean supportsHandshakeTimeout() {
- return true;
- }
-
- public boolean supportsMultipleConnections() {
- return false;
- }
- };
-
- private class SocketListenKey extends ListenKey {
- private String fAddress;
-
- SocketListenKey(String address) {
- fAddress = address;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService.ListenKey#address()
- */
- public String address() {
- return fAddress;
- }
- }
-
- // for attaching connector
- private Socket fSocket;
-
- private InputStream fInput;
-
- private OutputStream fOutput;
-
- // for listening or accepting connectors
- private ServerSocket fServerSocket;
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#accept(com.sun.jdi.connect.spi.TransportService.ListenKey,
- * long, long)
- */
- public Connection accept(ListenKey listenKey, long attachTimeout, long handshakeTimeout) throws IOException {
- if (attachTimeout > 0){
- if (attachTimeout > Integer.MAX_VALUE) {
- attachTimeout = Integer.MAX_VALUE; //approx 25 days!
- }
- fServerSocket.setSoTimeout((int) attachTimeout);
- }
- try {
- fSocket = fServerSocket.accept();
- } catch (SocketTimeoutException e) {
- throw new TransportTimeoutException();
- }
- fInput = fSocket.getInputStream();
- fOutput = fSocket.getOutputStream();
- performHandshake(fInput, fOutput, handshakeTimeout);
- return new SocketConnection(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#attach(java.lang.String,
- * long, long)
- */
- public Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException {
- String[] strings = address.split(":"); //$NON-NLS-1$
- String host = "localhost"; //$NON-NLS-1$
- int port = 0;
- if (strings.length == 2) {
- host = strings[0];
- port = Integer.parseInt(strings[1]);
- } else {
- port = Integer.parseInt(strings[0]);
- }
-
- return attach(host, port, attachTimeout, handshakeTimeout);
- }
-
- public Connection attach(final String host, final int port, long attachTimeout, final long handshakeTimeout) throws IOException {
- if (attachTimeout > 0){
- if (attachTimeout > Integer.MAX_VALUE) {
- attachTimeout = Integer.MAX_VALUE; //approx 25 days!
- }
- }
-
- final IOException[] ex = new IOException[1];
- Thread attachThread = new Thread(new Runnable() {
- public void run() {
- try {
- fSocket = new Socket(host, port);
- fInput = fSocket.getInputStream();
- fOutput = fSocket.getOutputStream();
- performHandshake(fInput, fOutput, handshakeTimeout);
- } catch (IOException e) {
- ex[0] = e;
- }
- }
- }, ConnectMessages.SocketTransportService_0);
- attachThread.setDaemon(true);
- attachThread.start();
- try {
- attachThread.join(attachTimeout);
- if (attachThread.isAlive()) {
- attachThread.interrupt();
- throw new TimeoutException();
- }
- } catch (InterruptedException e) {
- }
-
- if (ex[0] != null) {
- throw ex[0];
- }
-
-
- return new SocketConnection(this);
- }
-
- void performHandshake(final InputStream in, final OutputStream out, final long timeout) throws IOException {
- final IOException[] ex = new IOException[1];
- final boolean[] handshakeCompleted = new boolean[1];
-
- Thread t = new Thread(new Runnable() {
- public void run() {
- try {
- writeHandshake(out);
- readHandshake(in);
- handshakeCompleted[0] = true;
- } catch (IOException e) {
- ex[0] = e;
- }
- }
- }, ConnectMessages.SocketTransportService_1);
- t.setDaemon(true);
- t.start();
- try {
- t.join(timeout);
- } catch (InterruptedException e1) {
- }
-
- if (handshakeCompleted[0])
- return;
-
- try {
- in.close();
- out.close();
- } catch (IOException e) {
- }
-
- if (ex[0] != null)
- throw ex[0];
-
- throw new TransportTimeoutException();
- }
-
- private void readHandshake(InputStream input) throws IOException {
- try {
- DataInputStream in = new DataInputStream(input);
- byte[] handshakeInput = new byte[handshakeBytes.length];
- in.readFully(handshakeInput);
- if (!Arrays.equals(handshakeInput, handshakeBytes))
- throw new IOException("Received invalid handshake"); //$NON-NLS-1$
- } catch (EOFException e) {
- throw new ClosedConnectionException();
- }
- }
-
- private void writeHandshake(OutputStream out) throws IOException {
- out.write(handshakeBytes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#capabilities()
- */
- public Capabilities capabilities() {
- return fCapabilities;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#description()
- */
- public String description() {
- return "org.eclipse.jdt.debug: Socket Implementation of TransportService"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#name()
- */
- public String name() {
- return "org.eclipse.jdt.debug_SocketTransportService"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#startListening()
- */
- public ListenKey startListening() throws IOException {
- // not used by jdt debug.
- return startListening(null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#startListening(java.lang.String)
- */
- public ListenKey startListening(String address) throws IOException {
- String host = null;
- int port = 0; // jdt debugger will always specify an address in
- // the form localhost:port
- if (address != null) {
- String[] strings = address.split(":"); //$NON-NLS-1$
- host = "localhost"; //$NON-NLS-1$
- if (strings.length == 2) {
- host = strings[0];
- port = Integer.parseInt(strings[1]);
- } else {
- port = Integer.parseInt(strings[0]);
- }
- }
- if (host == null) {
- host = "localhost"; //$NON-NLS-1$
- }
-
- fServerSocket = new ServerSocket(port);
- port = fServerSocket.getLocalPort();
- ListenKey listenKey = new SocketListenKey(host + ":" + port); //$NON-NLS-1$
- return listenKey;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.jdi.connect.spi.TransportService#stopListening(com.sun.jdi.connect.spi.TransportService.ListenKey)
- */
- public void stopListening(ListenKey arg1) throws IOException {
- if (fServerSocket != null) {
- try {
- fServerSocket.close();
- } catch (IOException e) {
- }
- }
- fServerSocket = null;
- }
-
- /**
- * Closes the current open socket, the transport service will continue to listen
- * for new incoming connections.
- */
- public void close() {
- if (fSocket != null) {
- try {
- fSocket.close();
- } catch (IOException e) {
- }
- }
- fSocket = null;
- fInput = null;
- fOutput = null;
- }
-
- /**
- * @return current socket input stream or <code>null</code>
- */
- public InputStream getInputStream() {
- return fInput;
- }
-
- /**
- * @return curernt socket output stream or <code>null</code>
- */
- public OutputStream getOutputStream() {
- return fOutput;
- }
+ /** Handshake bytes used just after connecting VM. */
+ private static final byte[] handshakeBytes = "JDWP-Handshake".getBytes(); //$NON-NLS-1$
+
+ private Capabilities fCapabilities = new Capabilities() {
+ @Override
+ public boolean supportsAcceptTimeout() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAttachTimeout() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsHandshakeTimeout() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsMultipleConnections() {
+ return false;
+ }
+ };
+
+ private class SocketListenKey extends ListenKey {
+ private String fAddress;
+
+ SocketListenKey(String address) {
+ fAddress = address;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.TransportService.ListenKey#address()
+ */
+ @Override
+ public String address() {
+ return fAddress;
+ }
+ }
+
+ // for attaching connector
+ private Socket fSocket;
+
+ private InputStream fInput;
+
+ private OutputStream fOutput;
+
+ // for listening or accepting connectors
+ private ServerSocket fServerSocket;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.sun.jdi.connect.spi.TransportService#accept(com.sun.jdi.connect.spi
+ * .TransportService.ListenKey, long, long)
+ */
+ @Override
+ public Connection accept(ListenKey listenKey, long attachTimeout,
+ long handshakeTimeout) throws IOException {
+ if (attachTimeout > 0) {
+ if (attachTimeout > Integer.MAX_VALUE) {
+ attachTimeout = Integer.MAX_VALUE; // approx 25 days!
+ }
+ fServerSocket.setSoTimeout((int) attachTimeout);
+ }
+ try {
+ fSocket = fServerSocket.accept();
+ } catch (SocketTimeoutException e) {
+ throw new TransportTimeoutException();
+ }
+ fInput = fSocket.getInputStream();
+ fOutput = fSocket.getOutputStream();
+ performHandshake(fInput, fOutput, handshakeTimeout);
+ return new SocketConnection(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.TransportService#attach(java.lang.String,
+ * long, long)
+ */
+ @Override
+ public Connection attach(String address, long attachTimeout,
+ long handshakeTimeout) throws IOException {
+ String[] strings = address.split(":"); //$NON-NLS-1$
+ String host = "localhost"; //$NON-NLS-1$
+ int port = 0;
+ if (strings.length == 2) {
+ host = strings[0];
+ port = Integer.parseInt(strings[1]);
+ } else {
+ port = Integer.parseInt(strings[0]);
+ }
+
+ return attach(host, port, attachTimeout, handshakeTimeout);
+ }
+
+ public Connection attach(final String host, final int port,
+ long attachTimeout, final long handshakeTimeout) throws IOException {
+ if (attachTimeout > 0) {
+ if (attachTimeout > Integer.MAX_VALUE) {
+ attachTimeout = Integer.MAX_VALUE; // approx 25 days!
+ }
+ }
+
+ final IOException[] ex = new IOException[1];
+ Thread attachThread = new Thread(new Runnable() {
+ public void run() {
+ try {
+ fSocket = new Socket(host, port);
+ fInput = fSocket.getInputStream();
+ fOutput = fSocket.getOutputStream();
+ performHandshake(fInput, fOutput, handshakeTimeout);
+ } catch (IOException e) {
+ ex[0] = e;
+ }
+ }
+ }, ConnectMessages.SocketTransportService_0);
+ attachThread.setDaemon(true);
+ attachThread.start();
+ try {
+ attachThread.join(attachTimeout);
+ if (attachThread.isAlive()) {
+ attachThread.interrupt();
+ throw new TimeoutException();
+ }
+ } catch (InterruptedException e) {
+ }
+
+ if (ex[0] != null) {
+ throw ex[0];
+ }
+
+ return new SocketConnection(this);
+ }
+
+ void performHandshake(final InputStream in, final OutputStream out,
+ final long timeout) throws IOException {
+ final IOException[] ex = new IOException[1];
+ final boolean[] handshakeCompleted = new boolean[1];
+
+ Thread t = new Thread(new Runnable() {
+ public void run() {
+ try {
+ writeHandshake(out);
+ readHandshake(in);
+ handshakeCompleted[0] = true;
+ } catch (IOException e) {
+ ex[0] = e;
+ }
+ }
+ }, ConnectMessages.SocketTransportService_1);
+ t.setDaemon(true);
+ t.start();
+ try {
+ t.join(timeout);
+ } catch (InterruptedException e1) {
+ }
+
+ if (handshakeCompleted[0])
+ return;
+
+ try {
+ in.close();
+ out.close();
+ } catch (IOException e) {
+ }
+
+ if (ex[0] != null)
+ throw ex[0];
+
+ throw new TransportTimeoutException();
+ }
+
+ private void readHandshake(InputStream input) throws IOException {
+ try {
+ DataInputStream in = new DataInputStream(input);
+ byte[] handshakeInput = new byte[handshakeBytes.length];
+ in.readFully(handshakeInput);
+ if (!Arrays.equals(handshakeInput, handshakeBytes))
+ throw new IOException("Received invalid handshake"); //$NON-NLS-1$
+ } catch (EOFException e) {
+ throw new ClosedConnectionException();
+ }
+ }
+
+ private void writeHandshake(OutputStream out) throws IOException {
+ out.write(handshakeBytes);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.TransportService#capabilities()
+ */
+ @Override
+ public Capabilities capabilities() {
+ return fCapabilities;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.TransportService#description()
+ */
+ @Override
+ public String description() {
+ return "org.eclipse.jdt.debug: Socket Implementation of TransportService"; //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.TransportService#name()
+ */
+ @Override
+ public String name() {
+ return "org.eclipse.jdt.debug_SocketTransportService"; //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.jdi.connect.spi.TransportService#startListening()
+ */
+ @Override
+ public ListenKey startListening() throws IOException {
+ // not used by jdt debug.
+ return startListening(null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.sun.jdi.connect.spi.TransportService#startListening(java.lang.String)
+ */
+ @Override
+ public ListenKey startListening(String address) throws IOException {
+ String host = null;
+ int port = 0; // jdt debugger will always specify an address in
+ // the form localhost:port
+ if (address != null) {
+ String[] strings = address.split(":"); //$NON-NLS-1$
+ host = "localhost"; //$NON-NLS-1$
+ if (strings.length == 2) {
+ host = strings[0];
+ port = Integer.parseInt(strings[1]);
+ } else {
+ port = Integer.parseInt(strings[0]);
+ }
+ }
+ if (host == null) {
+ host = "localhost"; //$NON-NLS-1$
+ }
+
+ fServerSocket = new ServerSocket(port);
+ port = fServerSocket.getLocalPort();
+ ListenKey listenKey = new SocketListenKey(host + ":" + port); //$NON-NLS-1$
+ return listenKey;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.sun.jdi.connect.spi.TransportService#stopListening(com.sun.jdi.connect
+ * .spi.TransportService.ListenKey)
+ */
+ @Override
+ public void stopListening(ListenKey arg1) throws IOException {
+ if (fServerSocket != null) {
+ try {
+ fServerSocket.close();
+ } catch (IOException e) {
+ }
+ }
+ fServerSocket = null;
+ }
+
+ /**
+ * Closes the current open socket, the transport service will continue to
+ * listen for new incoming connections.
+ */
+ public void close() {
+ if (fSocket != null) {
+ try {
+ fSocket.close();
+ } catch (IOException e) {
+ }
+ }
+ fSocket = null;
+ fInput = null;
+ fOutput = null;
+ }
+
+ /**
+ * @return current socket input stream or <code>null</code>
+ */
+ public InputStream getInputStream() {
+ return fInput;
+ }
+
+ /**
+ * @return curernt socket output stream or <code>null</code>
+ */
+ public OutputStream getOutputStream() {
+ return fOutput;
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/TransportImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/TransportImpl.java
index 7a79abd22..321dae24b 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/TransportImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/TransportImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -18,25 +17,24 @@ import java.io.OutputStream;
import com.sun.jdi.connect.Transport;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public abstract class TransportImpl implements Transport {
/** Name of Transport. */
private String fName;
-
+
/**
* Constructs new SocketTransportImpl.
- */
+ */
public TransportImpl(String name) {
fName = name;
}
/**
* @return Returns a short identifier for the transport.
- */
+ */
public String name() {
return fName;
}
@@ -45,19 +43,19 @@ public abstract class TransportImpl implements Transport {
* @return Returns true if we have an open connection.
*/
public abstract boolean isOpen();
-
+
/**
* Closes connection.
- */
+ */
public abstract void close();
/**
* @return Returns InputStream from Virtual Machine.
- */
+ */
public abstract InputStream getInputStream() throws IOException;
-
+
/**
* @return Returns OutputStream to Virtual Machine.
- */
+ */
public abstract OutputStream getOutputStream() throws IOException;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/AccessWatchpointEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/AccessWatchpointEventImpl.java
index d0dec59ab..194115b78 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/AccessWatchpointEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/AccessWatchpointEventImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -21,29 +20,40 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.AccessWatchpointEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class AccessWatchpointEventImpl extends WatchpointEventImpl implements AccessWatchpointEvent {
- /** Jdwp Event Kind. */
+public class AccessWatchpointEventImpl extends WatchpointEventImpl implements
+ AccessWatchpointEvent {
+ /** JDWP Event Kind. */
public static final byte EVENT_KIND = EVENT_FIELD_ACCESS;
-
+
/**
* Creates new AccessWatchpointEventImpl.
+ * @param vmImpl the VM
+ * @param requestID the request ID
*/
- protected AccessWatchpointEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
+ protected AccessWatchpointEventImpl(VirtualMachineImpl vmImpl,
+ RequestID requestID) {
super("AccessWatchpointEvent", vmImpl, requestID); //$NON-NLS-1$
}
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @param target the target
+ * @param requestID the request ID
+ * @param dataInStream the stream
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
+ * @throws IOException if the read fails
*/
- public static WatchpointEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static WatchpointEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- AccessWatchpointEventImpl event = new AccessWatchpointEventImpl(vmImpl, requestID);
+ AccessWatchpointEventImpl event = new AccessWatchpointEventImpl(vmImpl,
+ requestID);
event.readWatchpointEventFields(target, dataInStream);
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/BreakpointEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/BreakpointEventImpl.java
index edeb3eddc..7a99b8aee 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/BreakpointEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/BreakpointEventImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -22,30 +21,39 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.BreakpointEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class BreakpointEventImpl extends LocatableEventImpl implements BreakpointEvent {
+public class BreakpointEventImpl extends LocatableEventImpl implements
+ BreakpointEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_BREAKPOINT;
/**
* Creates new BreakpointEventImpl.
+ * @param vmImpl the VM
+ * @param requestID the request ID
*/
private BreakpointEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("BreakpointEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @param target the target
+ * @param requestID the request ID
+ * @param dataInStream the stream
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
+ * @throws IOException if the read fails
*/
- public static BreakpointEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static BreakpointEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
BreakpointEventImpl event = new BreakpointEventImpl(vmImpl, requestID);
- event.readThreadAndLocation(target,dataInStream);
- ((ThreadReferenceImpl)event.thread()).setIsAtBreakpoint();
+ event.readThreadAndLocation(target, dataInStream);
+ ((ThreadReferenceImpl) event.thread()).setIsAtBreakpoint();
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassPrepareEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassPrepareEventImpl.java
index d4b6bce57..837884c88 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassPrepareEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassPrepareEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -24,46 +23,53 @@ import com.sun.jdi.ReferenceType;
import com.sun.jdi.event.ClassPrepareEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ClassPrepareEventImpl extends EventImpl implements ClassPrepareEvent {
+public class ClassPrepareEventImpl extends EventImpl implements
+ ClassPrepareEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_CLASS_PREPARE;
/** Reference type for which this event was generated. */
private ReferenceTypeImpl fReferenceType;
-
+
/**
* Creates new BreakpointEventImpl.
*/
private ClassPrepareEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("ClassPrepareEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static ClassPrepareEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static ClassPrepareEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- ClassPrepareEventImpl event = new ClassPrepareEventImpl(vmImpl, requestID);
+ ClassPrepareEventImpl event = new ClassPrepareEventImpl(vmImpl,
+ requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
- event.fReferenceType = ReferenceTypeImpl.readWithTypeTagAndSignature(target, false, dataInStream);
- target.readInt("class status", ReferenceTypeImpl.classStatusStrings(), dataInStream); //$NON-NLS-1$
+ event.fReferenceType = ReferenceTypeImpl.readWithTypeTagAndSignature(
+ target, false, dataInStream);
+ target.readInt(
+ "class status", ReferenceTypeImpl.classStatusStrings(), dataInStream); //$NON-NLS-1$
return event;
- }
-
+ }
+
/**
* @return Returns the reference type for which this event was generated.
*/
public ReferenceType referenceType() {
return fReferenceType;
}
-
+
/**
- * @return Returns the JNI-style signature of the class that has been unloaded.
+ * @return Returns the JNI-style signature of the class that has been
+ * unloaded.
*/
public String classSignature() {
return referenceType().signature();
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassUnloadEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassUnloadEventImpl.java
index e421b844c..5687a8602 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassUnloadEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ClassUnloadEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -22,10 +21,9 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.ClassUnloadEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ClassUnloadEventImpl extends EventImpl implements ClassUnloadEvent {
/** Jdwp Event Kind. */
@@ -42,26 +40,31 @@ public class ClassUnloadEventImpl extends EventImpl implements ClassUnloadEvent
}
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static ClassUnloadEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static ClassUnloadEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
ClassUnloadEventImpl event = new ClassUnloadEventImpl(vmImpl, requestID);
event.fSignature = target.readString("signature", dataInStream); //$NON-NLS-1$
- // Remove the class from classes that are known by the application to be loaded in the VM.
+ // Remove the class from classes that are known by the application to be
+ // loaded in the VM.
vmImpl.removeKnownRefType(event.fSignature);
return event;
- }
+ }
/**
* @return Returns the name of the class that has been unloaded.
- */
+ */
public String className() {
return TypeImpl.signatureToName(fSignature);
}
-
+
/**
- * @return Returns the JNI-style signature of the class that has been unloaded.
+ * @return Returns the JNI-style signature of the class that has been
+ * unloaded.
*/
public String classSignature() {
return fSignature;
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventImpl.java
index 60043688f..748111636 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventImpl.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
+import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
@@ -25,12 +25,10 @@ import com.sun.jdi.ThreadReference;
import com.sun.jdi.event.Event;
import com.sun.jdi.request.EventRequest;
-
/**
- * This class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * This class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public abstract class EventImpl extends MirrorImpl implements Event {
/** Constants for EventKind. */
@@ -56,16 +54,17 @@ public abstract class EventImpl extends MirrorImpl implements Event {
public static final byte EVENT_MONITOR_WAITED = 46;
public static final byte EVENT_VM_INIT = 90;
public static final byte EVENT_VM_DEATH = 99;
- public static final byte EVENT_VM_DISCONNECTED = 100; // Never sent by across JDWP.
+ public static final byte EVENT_VM_DISCONNECTED = 100; // Never sent by
+ // across JDWP.
public static final byte EVENT_VM_START = EVENT_VM_INIT;
public static final byte EVENT_THREAD_DEATH = EVENT_THREAD_END;
-
+
/** ThreadReference of thread that generated this event. */
protected ThreadReferenceImpl fThreadRef;
/** Mapping of command codes to strings. */
- private static HashMap fEventKindMap = null;
-
+ private static HashMap<Integer, String> fEventKindMap = null;
+
/** Request ID of event. */
private RequestID fRequestID;
@@ -75,28 +74,30 @@ public abstract class EventImpl extends MirrorImpl implements Event {
/**
* Creates new EventImpl, only used by subclasses.
*/
- protected EventImpl(String description, VirtualMachineImpl vmImpl, RequestID requestID) {
+ protected EventImpl(String description, VirtualMachineImpl vmImpl,
+ RequestID requestID) {
super(description, vmImpl);
fRequestID = requestID;
}
-
+
/**
* @return Returns ThreadReference of thread that generated this event.
*/
public ThreadReference thread() {
return fThreadRef;
}
-
+
/**
* @return Returns requestID.
*/
public RequestID requestID() {
- return fRequestID;
- }
-
+ return fRequestID;
+ }
+
/**
* @return Returns string representation.
*/
+ @Override
public String toString() {
return super.toString() + ": " + fRequestID; //$NON-NLS-1$
}
@@ -104,85 +105,99 @@ public abstract class EventImpl extends MirrorImpl implements Event {
/**
* @return Creates, reads and returns new EventImpl.
*/
- public static EventImpl read(MirrorImpl target, DataInputStream dataInStream) throws IOException {
- byte eventKind = target.readByte("event kind", eventKindMap(), dataInStream); //$NON-NLS-1$
+ public static EventImpl read(MirrorImpl target, DataInputStream dataInStream)
+ throws IOException {
+ byte eventKind = target.readByte(
+ "event kind", eventKindMap(), dataInStream); //$NON-NLS-1$
RequestID requestID = RequestID.read(target, dataInStream);
// Create, read and return Event of eventKind.
EventImpl result;
- switch(eventKind) {
- case 0:
- return null;
- case AccessWatchpointEventImpl.EVENT_KIND:
- result = AccessWatchpointEventImpl.read(target, requestID, dataInStream);
- break;
- case BreakpointEventImpl.EVENT_KIND:
- result = BreakpointEventImpl.read(target, requestID, dataInStream);
- break;
- case ClassPrepareEventImpl.EVENT_KIND:
- result = ClassPrepareEventImpl.read(target, requestID, dataInStream);
- break;
- case ClassUnloadEventImpl.EVENT_KIND:
- result = ClassUnloadEventImpl.read(target, requestID, dataInStream);
- break;
- case ExceptionEventImpl.EVENT_KIND:
- result = ExceptionEventImpl.read(target, requestID, dataInStream);
- break;
- case MethodEntryEventImpl.EVENT_KIND:
- result = MethodEntryEventImpl.read(target, requestID, dataInStream);
- break;
- case MethodExitEventImpl.EVENT_KIND:
- result = MethodExitEventImpl.read(target, requestID, dataInStream);
- break;
- case EVENT_METHOD_EXIT_WITH_RETURN_VALUE:
- result = MethodExitEventImpl.readWithReturnValue(target, requestID, dataInStream);
- break;
- case MonitorContendedEnteredEventImpl.EVENT_KIND:
- result = MonitorContendedEnteredEventImpl.read(target, requestID, dataInStream);
- break;
- case MonitorContendedEnterEventImpl.EVENT_KIND:
- result = MonitorContendedEnterEventImpl.read(target, requestID, dataInStream);
- break;
- case MonitorWaitedEventImpl.EVENT_KIND:
- result = MonitorWaitedEventImpl.read(target, requestID, dataInStream);
- break;
- case MonitorWaitEventImpl.EVENT_KIND:
- result = MonitorWaitEventImpl.read(target, requestID, dataInStream);
- break;
- case ModificationWatchpointEventImpl.EVENT_KIND:
- result = ModificationWatchpointEventImpl.read(target, requestID, dataInStream);
- break;
- case StepEventImpl.EVENT_KIND:
- result = StepEventImpl.read(target, requestID, dataInStream);
- break;
- case ThreadDeathEventImpl.EVENT_KIND:
- result = ThreadDeathEventImpl.read(target, requestID, dataInStream);
- break;
- case ThreadStartEventImpl.EVENT_KIND:
- result = ThreadStartEventImpl.read(target, requestID, dataInStream);
- break;
- case VMDeathEventImpl.EVENT_KIND:
- result = VMDeathEventImpl.read(target, requestID, dataInStream);
- break;
- case VMDisconnectEventImpl.EVENT_KIND:
- result = VMDisconnectEventImpl.read(target, requestID, dataInStream);
- break;
- case VMStartEventImpl.EVENT_KIND:
- result = VMStartEventImpl.read(target, requestID, dataInStream);
- break;
- default:
- throw new IOException(EventMessages.EventImpl_Read_invalid_EventKind___1 + eventKind);
+ switch (eventKind) {
+ case 0:
+ return null;
+ case AccessWatchpointEventImpl.EVENT_KIND:
+ result = AccessWatchpointEventImpl.read(target, requestID,
+ dataInStream);
+ break;
+ case BreakpointEventImpl.EVENT_KIND:
+ result = BreakpointEventImpl.read(target, requestID, dataInStream);
+ break;
+ case ClassPrepareEventImpl.EVENT_KIND:
+ result = ClassPrepareEventImpl
+ .read(target, requestID, dataInStream);
+ break;
+ case ClassUnloadEventImpl.EVENT_KIND:
+ result = ClassUnloadEventImpl.read(target, requestID, dataInStream);
+ break;
+ case ExceptionEventImpl.EVENT_KIND:
+ result = ExceptionEventImpl.read(target, requestID, dataInStream);
+ break;
+ case MethodEntryEventImpl.EVENT_KIND:
+ result = MethodEntryEventImpl.read(target, requestID, dataInStream);
+ break;
+ case MethodExitEventImpl.EVENT_KIND:
+ result = MethodExitEventImpl.read(target, requestID, dataInStream);
+ break;
+ case EVENT_METHOD_EXIT_WITH_RETURN_VALUE:
+ result = MethodExitEventImpl.readWithReturnValue(target, requestID,
+ dataInStream);
+ break;
+ case MonitorContendedEnteredEventImpl.EVENT_KIND:
+ result = MonitorContendedEnteredEventImpl.read(target, requestID,
+ dataInStream);
+ break;
+ case MonitorContendedEnterEventImpl.EVENT_KIND:
+ result = MonitorContendedEnterEventImpl.read(target, requestID,
+ dataInStream);
+ break;
+ case MonitorWaitedEventImpl.EVENT_KIND:
+ result = MonitorWaitedEventImpl.read(target, requestID,
+ dataInStream);
+ break;
+ case MonitorWaitEventImpl.EVENT_KIND:
+ result = MonitorWaitEventImpl.read(target, requestID, dataInStream);
+ break;
+ case ModificationWatchpointEventImpl.EVENT_KIND:
+ result = ModificationWatchpointEventImpl.read(target, requestID,
+ dataInStream);
+ break;
+ case StepEventImpl.EVENT_KIND:
+ result = StepEventImpl.read(target, requestID, dataInStream);
+ break;
+ case ThreadDeathEventImpl.EVENT_KIND:
+ result = ThreadDeathEventImpl.read(target, requestID, dataInStream);
+ break;
+ case ThreadStartEventImpl.EVENT_KIND:
+ result = ThreadStartEventImpl.read(target, requestID, dataInStream);
+ break;
+ case VMDeathEventImpl.EVENT_KIND:
+ result = VMDeathEventImpl.read(target, requestID, dataInStream);
+ break;
+ case VMDisconnectEventImpl.EVENT_KIND:
+ result = VMDisconnectEventImpl
+ .read(target, requestID, dataInStream);
+ break;
+ case VMStartEventImpl.EVENT_KIND:
+ result = VMStartEventImpl.read(target, requestID, dataInStream);
+ break;
+ default:
+ throw new IOException(
+ EventMessages.EventImpl_Read_invalid_EventKind___1
+ + eventKind);
}
// Find and store original request.
if (!requestID.isNull())
- result.fRequest = target.virtualMachineImpl().eventRequestManagerImpl().findRequest(result);
+ result.fRequest = target.virtualMachineImpl()
+ .eventRequestManagerImpl().findRequest(result);
return result;
}
-
+
/**
- * @return Returns EventRequest that caused this event to be generated by the Virtual Machine.
+ * @return Returns EventRequest that caused this event to be generated by
+ * the Virtual Machine.
*/
public EventRequest request() {
return fRequest;
@@ -194,14 +209,15 @@ public abstract class EventImpl extends MirrorImpl implements Event {
public static void getConstantMaps() {
if (fEventKindMap != null)
return;
-
+
java.lang.reflect.Field[] fields = EventImpl.class.getDeclaredFields();
- fEventKindMap = new HashMap();
- for (int i = 0; i < fields.length; i++) {
- java.lang.reflect.Field field = fields[i];
- if ((field.getModifiers() & java.lang.reflect.Modifier.PUBLIC) == 0 || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0 || (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0)
+ fEventKindMap = new HashMap<Integer, String>();
+ for (Field field : fields) {
+ if ((field.getModifiers() & java.lang.reflect.Modifier.PUBLIC) == 0
+ || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0
+ || (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0)
continue;
-
+
try {
String name = field.getName();
Integer intValue = new Integer(field.getInt(null));
@@ -219,13 +235,12 @@ public abstract class EventImpl extends MirrorImpl implements Event {
}
}
}
-
+
/**
* @return Returns a map with string representations of tags.
*/
- public static Map eventKindMap() {
- getConstantMaps();
- return fEventKindMap;
- }
+ public static Map<Integer, String> eventKindMap() {
+ getConstantMaps();
+ return fEventKindMap;
+ }
}
-
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventIteratorImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventIteratorImpl.java
index da3a6b2c0..9c01beb08 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventIteratorImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventIteratorImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,34 +10,32 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.util.ListIterator;
import com.sun.jdi.event.Event;
import com.sun.jdi.event.EventIterator;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class EventIteratorImpl implements EventIterator {
/** List iterator implementation of iterator. */
- private ListIterator fIterator;
-
+ private ListIterator<Event> fIterator;
+
/**
* Creates new EventIteratorImpl.
*/
- public EventIteratorImpl(ListIterator iter) {
+ public EventIteratorImpl(ListIterator<Event> iter) {
fIterator = iter;
}
/**
* @return Returns next Event from EventSet.
- */
+ */
public Event nextEvent() {
- return (Event)fIterator.next();
+ return fIterator.next();
}
/**
@@ -46,19 +44,21 @@ public class EventIteratorImpl implements EventIterator {
public boolean hasNext() {
return fIterator.hasNext();
}
-
+
/**
* @see java.util.Iterator#next()
*/
- public Object next() {
+ public Event next() {
return fIterator.next();
}
-
+
/**
* @see java.util.Iterator#remove()
- * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
+ * @exception UnsupportedOperationException
+ * always thrown since EventSets are unmodifiable.
*/
public void remove() {
- throw new UnsupportedOperationException(EventMessages.EventIteratorImpl_EventSets_are_unmodifiable_1);
+ throw new UnsupportedOperationException(
+ EventMessages.EventIteratorImpl_EventSets_are_unmodifiable_1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventQueueImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventQueueImpl.java
index 7f8e867e4..85a3f30ac 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventQueueImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventQueueImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.IOException;
import org.eclipse.jdi.TimeoutException;
@@ -25,15 +24,14 @@ import com.sun.jdi.event.EventQueue;
import com.sun.jdi.event.EventSet;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class EventQueueImpl extends MirrorImpl implements EventQueue {
/** Flag used to see if a VMDisconnectEvent has already been generated. */
private boolean genereatedVMDisconnectEvent = false;
-
+
/**
* Creates new EventQueueImpl.
*/
@@ -49,23 +47,29 @@ public class EventQueueImpl extends MirrorImpl implements EventQueue {
}
/*
- * @return Returns next EventSet from Virtual Machine, returns null if times out.
+ * @return Returns next EventSet from Virtual Machine, returns null if times
+ * out.
*/
public EventSet remove(long timeout) throws InterruptedException {
- // Return a received EventSet or null if no EventSet is received in time.
- // Note that handledJdwpEventSet() is not don in a 'finally' clause because
- // it must also be done when an 'empty' set is read (i.e. a set composed of internal
+ // Return a received EventSet or null if no EventSet is received in
+ // time.
+ // Note that handledJdwpEventSet() is not don in a 'finally' clause
+ // because
+ // it must also be done when an 'empty' set is read (i.e. a set composed
+ // of internal
// events only).
- try {
- // We remove elements from event sets that are generated from inside, therefore the set may become empty.
- EventSetImpl set;
- do {
- JdwpCommandPacket packet = getCommandVM(JdwpCommandPacket.E_COMPOSITE, timeout);
- initJdwpEventSet(packet);
- set = EventSetImpl.read(this, packet.dataInStream());
+ try {
+ // We remove elements from event sets that are generated from
+ // inside, therefore the set may become empty.
+ EventSetImpl set;
+ do {
+ JdwpCommandPacket packet = getCommandVM(
+ JdwpCommandPacket.E_COMPOSITE, timeout);
+ initJdwpEventSet(packet);
+ set = EventSetImpl.read(this, packet.dataInStream());
handledJdwpEventSet();
- } while (set.isEmpty());
- return set;
+ } while (set.isEmpty());
+ return set;
} catch (TimeoutException e) {
// Timeout in getCommand, JDI spec says return null.
handledJdwpEventSet();
@@ -75,14 +79,17 @@ public class EventQueueImpl extends MirrorImpl implements EventQueue {
handledJdwpEventSet();
defaultIOExceptionHandler(e);
return null;
- } catch(VMDisconnectedException e) {
- // JDI spec says that a VMDisconnectedException must always be preceeded by a VMDisconnectEvent.
+ } catch (VMDisconnectedException e) {
+ // JDI spec says that a VMDisconnectedException must always be
+ // preceeded by a VMDisconnectEvent.
handledJdwpEventSet();
if (!genereatedVMDisconnectEvent) {
genereatedVMDisconnectEvent = true;
- return new EventSetImpl(virtualMachineImpl(), new VMDisconnectEventImpl(virtualMachineImpl(), RequestID.nullID));
- }
+ return new EventSetImpl(virtualMachineImpl(),
+ new VMDisconnectEventImpl(virtualMachineImpl(),
+ RequestID.nullID));
+ }
throw e;
- }
+ }
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventSetImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventSetImpl.java
index 784251edd..c763d2348 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventSetImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/EventSetImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
@@ -24,45 +23,45 @@ import org.eclipse.jdi.internal.request.EventRequestImpl;
import com.sun.jdi.InternalException;
import com.sun.jdi.ThreadReference;
+import com.sun.jdi.event.Event;
import com.sun.jdi.event.EventIterator;
import com.sun.jdi.event.EventSet;
import com.sun.jdi.request.EventRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class EventSetImpl extends MirrorImpl implements EventSet {
/** Set that is used to store events. */
- private List fEvents;
+ private List<Event> fEvents;
/** Which threads were suspended by this composite event. */
private byte fSuspendPolicy;
- /**
+ /**
* Creates new EventSetImpl.
*/
private EventSetImpl(VirtualMachineImpl vmImpl) {
super("EventSet", vmImpl); //$NON-NLS-1$
}
- /**
+ /**
* Creates new EventSetImpl with events in a given array.
*/
public EventSetImpl(VirtualMachineImpl vmImpl, EventImpl[] events) {
this(vmImpl);
- fEvents = new ArrayList(events.length);
- for (int i = 0; i < events.length; i++)
- fEvents.add(events[i]);
+ fEvents = new ArrayList<Event>(events.length);
+ for (EventImpl event : events)
+ fEvents.add(event);
}
- /**
+ /**
* Creates new EventSetImpl with given event.
*/
public EventSetImpl(VirtualMachineImpl vmImpl, EventImpl event) {
this(vmImpl);
- fEvents = new ArrayList(1);
+ fEvents = new ArrayList<Event>(1);
fEvents.add(event);
}
@@ -77,36 +76,40 @@ public class EventSetImpl extends MirrorImpl implements EventSet {
* @return Returns which threads were suspended by this composite event.
*/
public int suspendPolicy() {
- switch(fSuspendPolicy) {
- case EventRequestImpl.SUSPENDPOL_NONE_JDWP:
- return EventRequest.SUSPEND_NONE;
- case EventRequestImpl.SUSPENDPOL_EVENT_THREAD_JDWP:
- return EventRequest.SUSPEND_EVENT_THREAD;
- case EventRequestImpl.SUSPENDPOL_ALL_JDWP:
- return EventRequest.SUSPEND_ALL;
- default:
- throw new InternalException(EventMessages.EventSetImpl_Invalid_suspend_policy_encountered___1 + fSuspendPolicy);
+ switch (fSuspendPolicy) {
+ case EventRequestImpl.SUSPENDPOL_NONE_JDWP:
+ return EventRequest.SUSPEND_NONE;
+ case EventRequestImpl.SUSPENDPOL_EVENT_THREAD_JDWP:
+ return EventRequest.SUSPEND_EVENT_THREAD;
+ case EventRequestImpl.SUSPENDPOL_ALL_JDWP:
+ return EventRequest.SUSPEND_ALL;
+ default:
+ throw new InternalException(
+ EventMessages.EventSetImpl_Invalid_suspend_policy_encountered___1
+ + fSuspendPolicy);
}
}
-
+
/**
* Resumes threads that were suspended by this event set.
*/
public void resume() {
- switch(fSuspendPolicy) {
- case EventRequestImpl.SUSPENDPOL_NONE_JDWP:
- break;
- case EventRequestImpl.SUSPENDPOL_EVENT_THREAD_JDWP:
- resumeThreads();
- break;
- case EventRequestImpl.SUSPENDPOL_ALL_JDWP:
- virtualMachineImpl().resume();
- break;
- default:
- throw new InternalException(EventMessages.EventSetImpl_Invalid_suspend_policy_encountered___1 + fSuspendPolicy);
+ switch (fSuspendPolicy) {
+ case EventRequestImpl.SUSPENDPOL_NONE_JDWP:
+ break;
+ case EventRequestImpl.SUSPENDPOL_EVENT_THREAD_JDWP:
+ resumeThreads();
+ break;
+ case EventRequestImpl.SUSPENDPOL_ALL_JDWP:
+ virtualMachineImpl().resume();
+ break;
+ default:
+ throw new InternalException(
+ EventMessages.EventSetImpl_Invalid_suspend_policy_encountered___1
+ + fSuspendPolicy);
}
}
-
+
/**
* Resumes threads that were suspended by this event set.
*/
@@ -114,58 +117,62 @@ public class EventSetImpl extends MirrorImpl implements EventSet {
if (fEvents.size() == 1) {
// Most event sets have only one event.
// Avoid expensive object creation.
- ThreadReference ref= ((EventImpl)fEvents.get(0)).thread();
+ ThreadReference ref = ((EventImpl)fEvents.get(0)).thread();
if (ref != null) {
ref.resume();
} else {
- ((EventImpl)fEvents.get(0)).virtualMachine().resume();
+ fEvents.get(0).virtualMachine().resume();
}
return;
}
- Iterator iter = fEvents.iterator();
- List resumedThreads= new ArrayList(fEvents.size());
+ Iterator<Event> iter = fEvents.iterator();
+ List<ThreadReference> resumedThreads = new ArrayList<ThreadReference>(fEvents.size());
while (iter.hasNext()) {
EventImpl event = (EventImpl)iter.next();
- ThreadReference thread= event.thread();
+ ThreadReference thread = event.thread();
if (thread == null) {
event.virtualMachine().resume();
return;
- }
+ }
if (!resumedThreads.contains(thread)) {
resumedThreads.add(thread);
}
}
- Iterator resumeIter= resumedThreads.iterator();
+ Iterator<ThreadReference> resumeIter = resumedThreads.iterator();
while (resumeIter.hasNext()) {
- ((ThreadReference)resumeIter.next()).resume();
+ resumeIter.next().resume();
}
}
-
+
/**
* @return Returns EventSetImpl that was read from InputStream.
*/
- public static EventSetImpl read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static EventSetImpl read(MirrorImpl target, DataInputStream in)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
EventSetImpl eventSet = new EventSetImpl(vmImpl);
-
+
// Read suspend policy.
- eventSet.fSuspendPolicy = target.readByte("suspendPolicy", EventRequestImpl.suspendPolicyMap(), in); //$NON-NLS-1$
+ eventSet.fSuspendPolicy = target.readByte(
+ "suspendPolicy", EventRequestImpl.suspendPolicyMap(), in); //$NON-NLS-1$
// Read size.
int size = target.readInt("size", in); //$NON-NLS-1$
// Create event list.
- eventSet.fEvents = new ArrayList(size);
-
+ eventSet.fEvents = new ArrayList<Event>(size);
+
while (size-- > 0) {
EventImpl event = EventImpl.read(target, in);
-
- // If event == null than it is an event that must not be given to the application.
+
+ // If event == null than it is an event that must not be given to
+ // the application.
// See ClassPrepareEvent.
if (event == null)
continue;
- EventRequestImpl request = (EventRequestImpl)event.request();
-
- // Check if the request corresponding to the event was not generated from inside this JDI implementation.
+ EventRequestImpl request = (EventRequestImpl) event.request();
+
+ // Check if the request corresponding to the event was not generated
+ // from inside this JDI implementation.
if (request == null || !request.isGeneratedInside())
eventSet.fEvents.add(event);
@@ -179,42 +186,45 @@ public class EventSetImpl extends MirrorImpl implements EventSet {
public boolean contains(Object event) {
return fEvents.contains(event);
}
-
- /**
- * @see java.util.Collection
+
+ /* (non-Javadoc)
+ * @see java.util.Collection#containsAll(java.util.Collection)
*/
- public boolean containsAll(Collection events) {
+ public boolean containsAll(Collection<?> events) {
return fEvents.containsAll(events);
}
-
+
/**
* @see java.util.Collection
*/
+ @Override
public boolean equals(Object object) {
- return object != null && object.getClass().equals(this.getClass()) && fEvents.equals(((EventSetImpl)object).fEvents);
+ return object != null && object.getClass().equals(this.getClass())
+ && fEvents.equals(((EventSetImpl) object).fEvents);
}
-
+
/**
* @see java.util.Collection
*/
+ @Override
public int hashCode() {
return fEvents.hashCode();
}
-
+
/**
* @see java.util.Collection
*/
public boolean isEmpty() {
return fEvents.isEmpty();
}
-
+
/**
* @see java.util.Collection#iterator()
*/
- public Iterator iterator() {
+ public Iterator<Event> iterator() {
return fEvents.iterator();
}
-
+
/**
* @see java.util.Collection#size()
*/
@@ -230,57 +240,65 @@ public class EventSetImpl extends MirrorImpl implements EventSet {
}
/**
- * @see java.util.Collection#toArray(Object[])
+ * @see java.util.Collection#clear()
+ * @exception UnsupportedOperationException
+ * always thrown since EventSets are unmodifiable.
*/
- public Object[] toArray(Object[] events) {
- return fEvents.toArray(events);
+ public void clear() {
+ throw new UnsupportedOperationException(
+ EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
}
/**
- * @see java.util.Collection#add(Object).
- * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
+ * @see java.util.Collection#remove(Object)
+ * @exception UnsupportedOperationException
+ * always thrown since EventSets are unmodifiable.
*/
- public boolean add(Object arg1) {
- throw new UnsupportedOperationException(EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
+ public boolean remove(Object arg1) {
+ throw new UnsupportedOperationException(
+ EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
}
/**
- * @see java.util.Collection#addAll(Collection)
- * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
+ * @see java.util.Collection#removeAll(Collection)
+ * @exception UnsupportedOperationException
+ * always thrown since EventSets are unmodifiable.
*/
- public boolean addAll(Collection arg1) {
- throw new UnsupportedOperationException(EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
+ public boolean removeAll(Collection<?> arg1) {
+ throw new UnsupportedOperationException(
+ EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
}
/**
- * @see java.util.Collection#clear()
- * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
+ * @see java.util.Collection#retainAll(Collection)
+ * @exception UnsupportedOperationException
+ * always thrown since EventSets are unmodifiable.
*/
- public void clear() {
- throw new UnsupportedOperationException(EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
+ public boolean retainAll(Collection<?> arg1) {
+ throw new UnsupportedOperationException(
+ EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
}
- /**
- * @see java.util.Collection#remove(Object)
- * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
+ /* (non-Javadoc)
+ * @see java.util.Collection#toArray(T[])
*/
- public boolean remove(Object arg1) {
- throw new UnsupportedOperationException(EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
+ public <T> T[] toArray(T[] a) {
+ return fEvents.toArray(a);
}
- /**
- * @see java.util.Collection#removeAll(Collection)
- * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
+ /* (non-Javadoc)
+ * @see java.util.Collection#add(java.lang.Object)
*/
- public boolean removeAll(Collection arg1) {
- throw new UnsupportedOperationException(EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
+ public boolean add(Event o) {
+ throw new UnsupportedOperationException(
+ EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
}
- /**
- * @see java.util.Collection#retainAll(Collection)
- * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
+ /* (non-Javadoc)
+ * @see java.util.Collection#addAll(java.util.Collection)
*/
- public boolean retainAll(Collection arg1) {
- throw new UnsupportedOperationException(EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
+ public boolean addAll(Collection<? extends Event> c) {
+ throw new UnsupportedOperationException(
+ EventMessages.EventSetImpl_EventSets_are_unmodifiable_3);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ExceptionEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ExceptionEventImpl.java
index 6df8e3786..feeeae7c8 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ExceptionEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ExceptionEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -25,12 +24,12 @@ import com.sun.jdi.ObjectReference;
import com.sun.jdi.event.ExceptionEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ExceptionEventImpl extends LocatableEventImpl implements ExceptionEvent {
+public class ExceptionEventImpl extends LocatableEventImpl implements
+ ExceptionEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_EXCEPTION;
@@ -45,18 +44,22 @@ public class ExceptionEventImpl extends LocatableEventImpl implements ExceptionE
private ExceptionEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("ExceptionEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static ExceptionEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static ExceptionEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
ExceptionEventImpl event = new ExceptionEventImpl(vmImpl, requestID);
event.readThreadAndLocation(target, dataInStream);
- event.fException = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream);
+ event.fException = ObjectReferenceImpl.readObjectRefWithTag(target,
+ dataInStream);
event.fCatchLocation = LocationImpl.read(target, dataInStream);
return event;
- }
+ }
/**
* @return Returns the location where the exception will be caught.
@@ -64,9 +67,9 @@ public class ExceptionEventImpl extends LocatableEventImpl implements ExceptionE
public Location catchLocation() {
return fCatchLocation;
}
-
+
/**
- * @return Returns the thrown exception object.
+ * @return Returns the thrown exception object.
*/
public ObjectReference exception() {
return fException;
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/LocatableEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/LocatableEventImpl.java
index 575899070..6318fa55f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/LocatableEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/LocatableEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -24,30 +23,31 @@ import com.sun.jdi.Locatable;
import com.sun.jdi.Location;
/**
- * This class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * This class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public abstract class LocatableEventImpl extends EventImpl implements Locatable {
/** Location where event occurred. */
protected LocationImpl fLocation;
-
+
/**
* Creates new LocatableEventImpl, only used by subclasses.
*/
- protected LocatableEventImpl(String description, VirtualMachineImpl vmImpl, RequestID requestID) {
+ protected LocatableEventImpl(String description, VirtualMachineImpl vmImpl,
+ RequestID requestID) {
super(description, vmImpl, requestID);
}
-
+
/**
* Reads Thread and Location.
*/
- public void readThreadAndLocation(MirrorImpl target, DataInputStream dataInStream) throws IOException {
+ public void readThreadAndLocation(MirrorImpl target,
+ DataInputStream dataInStream) throws IOException {
fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
fLocation = LocationImpl.read(target, dataInStream);
- }
-
+ }
+
/**
* @return Returns Location where event occurred.
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodEntryEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodEntryEventImpl.java
index f1c616ccc..98275b556 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodEntryEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodEntryEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -22,12 +21,12 @@ import com.sun.jdi.Method;
import com.sun.jdi.event.MethodEntryEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class MethodEntryEventImpl extends LocatableEventImpl implements MethodEntryEvent {
+public class MethodEntryEventImpl extends LocatableEventImpl implements
+ MethodEntryEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_METHOD_ENTRY;
@@ -37,17 +36,20 @@ public class MethodEntryEventImpl extends LocatableEventImpl implements MethodEn
private MethodEntryEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("MethodEntryEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static MethodEntryEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static MethodEntryEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
MethodEntryEventImpl event = new MethodEntryEventImpl(vmImpl, requestID);
event.readThreadAndLocation(target, dataInStream);
return event;
- }
-
+ }
+
/**
* @return Returns the method that was entered.
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodExitEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodExitEventImpl.java
index d86732fa3..da431c1fc 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodExitEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MethodExitEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -24,45 +23,51 @@ import com.sun.jdi.Value;
import com.sun.jdi.event.MethodExitEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class MethodExitEventImpl extends LocatableEventImpl implements MethodExitEvent {
+public class MethodExitEventImpl extends LocatableEventImpl implements
+ MethodExitEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_METHOD_EXIT;
-
+
/** return value for the method **/
private Value fReturnValue = null;
-
+
/**
* Creates new MethodExitEventImpl.
*/
private MethodExitEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("MethodExitEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static MethodExitEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static MethodExitEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
MethodExitEventImpl event = new MethodExitEventImpl(vmImpl, requestID);
event.readThreadAndLocation(target, dataInStream);
return event;
- }
-
+ }
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static MethodExitEventImpl readWithReturnValue(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static MethodExitEventImpl readWithReturnValue(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
MethodExitEventImpl event = new MethodExitEventImpl(vmImpl, requestID);
event.readThreadAndLocation(target, dataInStream);
event.fReturnValue = ValueImpl.readWithTag(target, dataInStream);
return event;
- }
+ }
/**
* @return Returns the method that was entered.
@@ -70,7 +75,7 @@ public class MethodExitEventImpl extends LocatableEventImpl implements MethodExi
public Method method() {
return fLocation.method();
}
-
+
/**
* @see com.sun.jdi.event.MethodExitEvent#returnValue()
* @since 3.3
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ModificationWatchpointEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ModificationWatchpointEventImpl.java
index 9ca068c46..0c6515803 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ModificationWatchpointEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ModificationWatchpointEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -23,38 +22,44 @@ import com.sun.jdi.Value;
import com.sun.jdi.event.ModificationWatchpointEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ModificationWatchpointEventImpl extends WatchpointEventImpl implements ModificationWatchpointEvent {
+public class ModificationWatchpointEventImpl extends WatchpointEventImpl
+ implements ModificationWatchpointEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_FIELD_MODIFICATION;
/** Value to be assigned. */
private ValueImpl fValueToBe;
-
+
/**
* Creates new ModificationWatchpointEventImpl.
*/
- private ModificationWatchpointEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
+ private ModificationWatchpointEventImpl(VirtualMachineImpl vmImpl,
+ RequestID requestID) {
super("ModificationWatchpointEvent", vmImpl, requestID); //$NON-NLS-1$
}
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static WatchpointEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static WatchpointEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- ModificationWatchpointEventImpl event = new ModificationWatchpointEventImpl(vmImpl, requestID);
+ ModificationWatchpointEventImpl event = new ModificationWatchpointEventImpl(
+ vmImpl, requestID);
event.readWatchpointEventFields(target, dataInStream);
event.fValueToBe = ValueImpl.readWithTag(target, dataInStream);
return event;
- }
-
- /**
- * @return Returns value that will be assigned to the field when the instruction completes.
+ }
+
+ /**
+ * @return Returns value that will be assigned to the field when the
+ * instruction completes.
*/
public Value valueToBe() {
return fValueToBe;
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnterEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnterEventImpl.java
index 44cd4039b..23c193dfa 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnterEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnterEventImpl.java
@@ -24,36 +24,46 @@ import com.sun.jdi.ObjectReference;
import com.sun.jdi.event.MonitorContendedEnterEvent;
/**
- * This class provides an implementation of MonitorContendedEnterEvent according to Sun's
- * 1.6 specs
+ * This class provides an implementation of MonitorContendedEnterEvent according
+ * to Sun's 1.6 specs
+ *
* @since 3.3
*/
-public class MonitorContendedEnterEventImpl extends LocatableEventImpl implements MonitorContendedEnterEvent {
+public class MonitorContendedEnterEventImpl extends LocatableEventImpl
+ implements MonitorContendedEnterEvent {
/** event kind iod **/
public static final byte EVENT_KIND = EVENT_MONITOR_CONTENDED_ENTER;
-
+
/** the monitor information **/
private ObjectReference fMonitor;
/** Constructor **/
- private MonitorContendedEnterEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
+ private MonitorContendedEnterEventImpl(VirtualMachineImpl vmImpl,
+ RequestID requestID) {
super("MonitorContendedEnter", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static MonitorContendedEnterEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static MonitorContendedEnterEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- MonitorContendedEnterEventImpl event = new MonitorContendedEnterEventImpl(vmImpl, requestID);
+ MonitorContendedEnterEventImpl event = new MonitorContendedEnterEventImpl(
+ vmImpl, requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
- event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream);
+ event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target,
+ dataInStream);
event.fLocation = LocationImpl.read(target, dataInStream);
return event;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see com.sun.jdi.event.MonitorContendedEnterEvent#monitor()
*/
public ObjectReference monitor() {
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnteredEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnteredEventImpl.java
index 8b2efd503..5f60334a1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnteredEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorContendedEnteredEventImpl.java
@@ -24,36 +24,46 @@ import com.sun.jdi.ObjectReference;
import com.sun.jdi.event.MonitorContendedEnteredEvent;
/**
- * This class provides an implementation of MonitorContendedEnteredEvent according to Sun's
- * 1.6 specs
+ * This class provides an implementation of MonitorContendedEnteredEvent
+ * according to Sun's 1.6 specs
+ *
* @since 3.3
*/
-public class MonitorContendedEnteredEventImpl extends LocatableEventImpl implements MonitorContendedEnteredEvent {
+public class MonitorContendedEnteredEventImpl extends LocatableEventImpl
+ implements MonitorContendedEnteredEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_MONITOR_CONTENDED_ENTERED;
-
+
/** the monitor information **/
private ObjectReference fMonitor;
-
+
/** Constructor **/
- private MonitorContendedEnteredEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
+ private MonitorContendedEnteredEventImpl(VirtualMachineImpl vmImpl,
+ RequestID requestID) {
super("MonitorContendedEntered", vmImpl, requestID); //$NON-NLS-1$
}
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static MonitorContendedEnteredEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static MonitorContendedEnteredEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- MonitorContendedEnteredEventImpl event = new MonitorContendedEnteredEventImpl(vmImpl, requestID);
+ MonitorContendedEnteredEventImpl event = new MonitorContendedEnteredEventImpl(
+ vmImpl, requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
- event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream);
+ event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target,
+ dataInStream);
event.fLocation = LocationImpl.read(target, dataInStream);
return event;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see com.sun.jdi.event.MonitorContendedEnteredEvent#monitor()
*/
public ObjectReference monitor() {
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitEventImpl.java
index 4cd36a5b9..baf8bb3e8 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitEventImpl.java
@@ -25,43 +25,53 @@ import com.sun.jdi.LongValue;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.event.MonitorWaitEvent;
-public class MonitorWaitEventImpl extends LocatableEventImpl implements MonitorWaitEvent {
+public class MonitorWaitEventImpl extends LocatableEventImpl implements
+ MonitorWaitEvent {
/** Jdwp event kind id **/
public static final byte EVENT_KIND = EVENT_MONITOR_WAIT;
-
+
/** howl ong the timeout is **/
private long fTimeOut;
-
+
/** the monitor reference **/
private ObjectReference fMonitor;
-
+
/** Constructor **/
private MonitorWaitEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("MonitorWait", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static MonitorWaitEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static MonitorWaitEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
MonitorWaitEventImpl event = new MonitorWaitEventImpl(vmImpl, requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
- event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream);
+ event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target,
+ dataInStream);
event.fLocation = LocationImpl.read(target, dataInStream);
- event.fTimeOut = ((LongValue)ValueImpl.readWithTag(target, dataInStream)).value();
+ event.fTimeOut = ((LongValue) ValueImpl.readWithTag(target,
+ dataInStream)).value();
return event;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see com.sun.jdi.event.MonitorWaitedEvent#monitor()
*/
public ObjectReference monitor() {
return fMonitor;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see com.sun.jdi.event.MonitorWaitEvent#timeout()
*/
public long timeout() {
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitedEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitedEventImpl.java
index 046094187..31d57041b 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitedEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/MonitorWaitedEventImpl.java
@@ -26,47 +26,60 @@ import com.sun.jdi.ObjectReference;
import com.sun.jdi.event.MonitorWaitedEvent;
/**
- * This class provides an implementation of MonitorContendedEnterEvent according to Sun's
- * 1.6 specs
+ * This class provides an implementation of MonitorContendedEnterEvent according
+ * to Sun's 1.6 specs
+ *
* @since 3.3
*/
-public class MonitorWaitedEventImpl extends LocatableEventImpl implements MonitorWaitedEvent {
+public class MonitorWaitedEventImpl extends LocatableEventImpl implements
+ MonitorWaitedEvent {
/** Jdwp event id **/
public static final byte EVENT_KIND = EVENT_MONITOR_WAITED;
-
+
/** if the wait timed out or not **/
private boolean fTimedOut;
-
+
/** the monitor reference **/
private ObjectReference fMonitor;
-
+
/** Constructor **/
- private MonitorWaitedEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
+ private MonitorWaitedEventImpl(VirtualMachineImpl vmImpl,
+ RequestID requestID) {
super("MonitorWaited", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static MonitorWaitedEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static MonitorWaitedEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- MonitorWaitedEventImpl event = new MonitorWaitedEventImpl(vmImpl, requestID);
+ MonitorWaitedEventImpl event = new MonitorWaitedEventImpl(vmImpl,
+ requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
- event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream);
+ event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target,
+ dataInStream);
event.fLocation = LocationImpl.read(target, dataInStream);
- event.fTimedOut = ((BooleanValue)ValueImpl.readWithTag(target, dataInStream)).value();
+ event.fTimedOut = ((BooleanValue) ValueImpl.readWithTag(target,
+ dataInStream)).value();
return event;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see com.sun.jdi.event.MonitorWaitedEvent#monitor()
*/
public ObjectReference monitor() {
return fMonitor;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see com.sun.jdi.event.MonitorWaitedEvent#timedout()
*/
public boolean timedout() {
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/StepEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/StepEventImpl.java
index 2387cfabb..36ff4d4e1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/StepEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/StepEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -21,10 +20,9 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.StepEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class StepEventImpl extends LocatableEventImpl implements StepEvent {
/** Jdwp Event Kind. */
@@ -36,14 +34,16 @@ public class StepEventImpl extends LocatableEventImpl implements StepEvent {
private StepEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("StepEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static StepEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static StepEventImpl read(MirrorImpl target, RequestID requestID,
+ DataInputStream dataInStream) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
StepEventImpl event = new StepEventImpl(vmImpl, requestID);
event.readThreadAndLocation(target, dataInStream);
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadDeathEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadDeathEventImpl.java
index 375f0a0e9..5aa81c7f5 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadDeathEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadDeathEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -22,10 +21,9 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.ThreadDeathEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ThreadDeathEventImpl extends EventImpl implements ThreadDeathEvent {
/** Jdwp Event Kind. */
@@ -37,14 +35,17 @@ public class ThreadDeathEventImpl extends EventImpl implements ThreadDeathEvent
private ThreadDeathEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("ThreadDeathEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static ThreadDeathEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static ThreadDeathEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
ThreadDeathEventImpl event = new ThreadDeathEventImpl(vmImpl, requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadStartEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadStartEventImpl.java
index c199d2c5a..9234f457a 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadStartEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/ThreadStartEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -22,10 +21,9 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.ThreadStartEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class ThreadStartEventImpl extends EventImpl implements ThreadStartEvent {
/** Jdwp Event Kind. */
@@ -37,14 +35,17 @@ public class ThreadStartEventImpl extends EventImpl implements ThreadStartEvent
private ThreadStartEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("ThreadStartEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static ThreadStartEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static ThreadStartEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream)
+ throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
ThreadStartEventImpl event = new ThreadStartEventImpl(vmImpl, requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDeathEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDeathEventImpl.java
index 3abda34f1..219e10966 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDeathEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDeathEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import org.eclipse.jdi.internal.MirrorImpl;
@@ -20,10 +19,9 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.VMDeathEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class VMDeathEventImpl extends EventImpl implements VMDeathEvent {
/** Jdwp Event Kind. */
@@ -37,11 +35,13 @@ public class VMDeathEventImpl extends EventImpl implements VMDeathEvent {
}
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static VMDeathEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) {
+ public static VMDeathEventImpl read(MirrorImpl target, RequestID requestID,
+ DataInputStream dataInStream) {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
VMDeathEventImpl event = new VMDeathEventImpl(vmImpl, requestID);
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDisconnectEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDisconnectEventImpl.java
index ab9ffa32a..cff8d77ea 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDisconnectEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMDisconnectEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import org.eclipse.jdi.internal.MirrorImpl;
@@ -20,12 +19,12 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.VMDisconnectEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class VMDisconnectEventImpl extends EventImpl implements VMDisconnectEvent {
+public class VMDisconnectEventImpl extends EventImpl implements
+ VMDisconnectEvent {
/** Jdwp Event Kind. */
public static final byte EVENT_KIND = EVENT_VM_DISCONNECTED;
@@ -37,11 +36,14 @@ public class VMDisconnectEventImpl extends EventImpl implements VMDisconnectEven
}
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static VMDisconnectEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) {
+ public static VMDisconnectEventImpl read(MirrorImpl target,
+ RequestID requestID, DataInputStream dataInStream) {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
- VMDisconnectEventImpl event = new VMDisconnectEventImpl(vmImpl, requestID);
+ VMDisconnectEventImpl event = new VMDisconnectEventImpl(vmImpl,
+ requestID);
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMStartEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMStartEventImpl.java
index 3f4775b9b..9662312e6 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMStartEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/VMStartEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -22,10 +21,9 @@ import org.eclipse.jdi.internal.request.RequestID;
import com.sun.jdi.event.VMStartEvent;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class VMStartEventImpl extends EventImpl implements VMStartEvent {
/** Jdwp Event Kind. */
@@ -37,14 +35,16 @@ public class VMStartEventImpl extends EventImpl implements VMStartEvent {
private VMStartEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
super("VMStartEvent", vmImpl, requestID); //$NON-NLS-1$
}
-
+
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public static VMStartEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream dataInStream) throws IOException {
+ public static VMStartEventImpl read(MirrorImpl target, RequestID requestID,
+ DataInputStream dataInStream) throws IOException {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
VMStartEventImpl event = new VMStartEventImpl(vmImpl, requestID);
event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
return event;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/WatchpointEventImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/WatchpointEventImpl.java
index e785097cd..382c55834 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/WatchpointEventImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/event/WatchpointEventImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;
-
import java.io.DataInputStream;
import java.io.IOException;
@@ -26,47 +25,51 @@ import com.sun.jdi.Value;
import com.sun.jdi.event.WatchpointEvent;
/**
- * This class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * This class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public abstract class WatchpointEventImpl extends LocatableEventImpl implements WatchpointEvent {
+public abstract class WatchpointEventImpl extends LocatableEventImpl implements
+ WatchpointEvent {
/** The field that is about to be accessed/modified. */
protected FieldImpl fField;
/** The object whose field is about to be accessed/modified. */
protected ObjectReferenceImpl fObjectReference;
-
- /**
+
+ /**
* Creates new WatchpointEventImpl.
*/
- protected WatchpointEventImpl(String description, VirtualMachineImpl vmImpl, RequestID requestID) {
+ protected WatchpointEventImpl(String description,
+ VirtualMachineImpl vmImpl, RequestID requestID) {
super(description, vmImpl, requestID);
}
/**
- * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
+ * @return Creates, reads and returns new EventImpl, of which requestID has
+ * already been read.
*/
- public void readWatchpointEventFields(MirrorImpl target, DataInputStream dataInStream) throws IOException {
+ public void readWatchpointEventFields(MirrorImpl target,
+ DataInputStream dataInStream) throws IOException {
readThreadAndLocation(target, dataInStream);
fField = FieldImpl.readWithReferenceTypeWithTag(target, dataInStream);
- fObjectReference = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream);
- }
+ fObjectReference = ObjectReferenceImpl.readObjectRefWithTag(target,
+ dataInStream);
+ }
- /**
+ /**
* Returns the field that is about to be accessed/modified.
*/
public Field field() {
return fField;
}
-
+
/**
* Returns the object whose field is about to be accessed/modified.
*/
public ObjectReference object() {
return fObjectReference;
}
-
+
/**
* Current value of the field.
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpArrayID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpArrayID.java
index d31623ecc..887f62d73 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpArrayID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpArrayID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpArrayID extends JdwpReferenceTypeID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassID.java
index 54282200f..d73f58ce7 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpClassID extends JdwpReferenceTypeID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassLoaderID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassLoaderID.java
index 19ac87d6b..dcc1937fd 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassLoaderID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassLoaderID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpClassLoaderID extends JdwpObjectID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassObjectID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassObjectID.java
index a505031c4..a78a7b265 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassObjectID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpClassObjectID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpClassObjectID extends JdwpObjectID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java
index 4c1653806..edbed0213 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpCommandPacket.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@@ -18,9 +17,9 @@ import java.util.HashMap;
import java.util.Map;
/**
- * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
- * declared by the JDWP specification.
- *
+ * This class implements the corresponding Java Debug Wire Protocol (JDWP)
+ * packet declared by the JDWP specification.
+ *
*/
public class JdwpCommandPacket extends JdwpPacket {
/** Command Sets. */
@@ -44,137 +43,140 @@ public class JdwpCommandPacket extends JdwpPacket {
public static final int CSET_HOT_CODE_REPLACEMENT = 128;
/** Commands VirtualMachine. */
- public static final int VM_VERSION = 1 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CLASSES_BY_SIGNATURE = 2 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ALL_CLASSES = 3 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ALL_THREADS = 4 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_TOP_LEVEL_THREAD_GROUPS = 5 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_DISPOSE = 6 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ID_SIZES = 7 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_SUSPEND = 8 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_RESUME = 9 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_EXIT = 10 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CREATE_STRING = 11 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CAPABILITIES = 12 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CLASS_PATHS = 13 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_DISPOSE_OBJECTS = 14 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_HOLD_EVENTS = 15 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_RELEASE_EVENTS = 16 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CAPABILITIES_NEW = 17 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_REDEFINE_CLASSES = 18 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_SET_DEFAULT_STRATUM = 19 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ALL_CLASSES_WITH_GENERIC= 20 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_INSTANCE_COUNTS = 21 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_VERSION = 1 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CLASSES_BY_SIGNATURE = 2 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ALL_CLASSES = 3 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ALL_THREADS = 4 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_TOP_LEVEL_THREAD_GROUPS = 5 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_DISPOSE = 6 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ID_SIZES = 7 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_SUSPEND = 8 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_RESUME = 9 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_EXIT = 10 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CREATE_STRING = 11 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CAPABILITIES = 12 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CLASS_PATHS = 13 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_DISPOSE_OBJECTS = 14 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_HOLD_EVENTS = 15 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_RELEASE_EVENTS = 16 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CAPABILITIES_NEW = 17 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_REDEFINE_CLASSES = 18 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_SET_DEFAULT_STRATUM = 19 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ALL_CLASSES_WITH_GENERIC = 20 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_INSTANCE_COUNTS = 21 + (CSET_VIRTUAL_MACHINE << 8);
/** Commands ReferenceType. */
- public static final int RT_SIGNATURE = 1 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_CLASS_LOADER = 2 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_MODIFIERS = 3 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_FIELDS = 4 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_METHODS = 5 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_GET_VALUES = 6 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_SOURCE_FILE = 7 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_NESTED_TYPES = 8 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_STATUS = 9 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_INTERFACES = 10 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_CLASS_OBJECT = 11 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_SOURCE_DEBUG_EXTENSION = 12 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_SIGNATURE_WITH_GENERIC = 13 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_FIELDS_WITH_GENERIC = 14 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_METHODS_WITH_GENERIC = 15 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_INSTANCES = 16 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_CLASS_VERSION = 17 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_CONSTANT_POOL = 18 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SIGNATURE = 1 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_CLASS_LOADER = 2 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_MODIFIERS = 3 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_FIELDS = 4 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_METHODS = 5 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_GET_VALUES = 6 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SOURCE_FILE = 7 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_NESTED_TYPES = 8 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_STATUS = 9 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_INTERFACES = 10 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_CLASS_OBJECT = 11 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SOURCE_DEBUG_EXTENSION = 12 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SIGNATURE_WITH_GENERIC = 13 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_FIELDS_WITH_GENERIC = 14 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_METHODS_WITH_GENERIC = 15 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_INSTANCES = 16 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_CLASS_VERSION = 17 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_CONSTANT_POOL = 18 + (CSET_REFERENCE_TYPE << 8);
/** Commands ClassType. */
- public static final int CT_SUPERCLASS = 1 + (CSET_CLASS_TYPE << 8);
- public static final int CT_SET_VALUES = 2 + (CSET_CLASS_TYPE << 8);
- public static final int CT_INVOKE_METHOD = 3 + (CSET_CLASS_TYPE << 8);
- public static final int CT_NEW_INSTANCE = 4 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_SUPERCLASS = 1 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_SET_VALUES = 2 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_INVOKE_METHOD = 3 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_NEW_INSTANCE = 4 + (CSET_CLASS_TYPE << 8);
/** Commands ArrayType. */
- public static final int AT_NEW_INSTANCE = 1 + (CSET_ARRAY_TYPE << 8);
+ public static final int AT_NEW_INSTANCE = 1 + (CSET_ARRAY_TYPE << 8);
/** Commands Method. */
- public static final int M_LINE_TABLE = 1 + (CSET_METHOD << 8);
- public static final int M_VARIABLE_TABLE = 2 + (CSET_METHOD << 8);
- public static final int M_BYTECODES = 3 + (CSET_METHOD << 8);
- public static final int M_OBSOLETE = 4 + (CSET_METHOD << 8);
- public static final int M_VARIABLE_TABLE_WITH_GENERIC = 5 + (CSET_METHOD << 8);
+ public static final int M_LINE_TABLE = 1 + (CSET_METHOD << 8);
+ public static final int M_VARIABLE_TABLE = 2 + (CSET_METHOD << 8);
+ public static final int M_BYTECODES = 3 + (CSET_METHOD << 8);
+ public static final int M_OBSOLETE = 4 + (CSET_METHOD << 8);
+ public static final int M_VARIABLE_TABLE_WITH_GENERIC = 5 + (CSET_METHOD << 8);
/** Commands ObjectReference. */
- public static final int OR_REFERENCE_TYPE = 1 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_GET_VALUES = 2 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_SET_VALUES = 3 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_MONITOR_INFO = 5 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_INVOKE_METHOD = 6 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_DISABLE_COLLECTION = 7 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_ENABLE_COLLECTION = 8 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_IS_COLLECTED = 9 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_REFERRING_OBJECTS = 10 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_REFERENCE_TYPE = 1 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_GET_VALUES = 2 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_SET_VALUES = 3 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_MONITOR_INFO = 5 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_INVOKE_METHOD = 6 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_DISABLE_COLLECTION = 7 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_ENABLE_COLLECTION = 8 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_IS_COLLECTED = 9 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_REFERRING_OBJECTS = 10 + (CSET_OBJECT_REFERENCE << 8);
/** Commands StringReference. */
- public static final int SR_VALUE = 1 + (CSET_STRING_REFERENCE << 8);
+ public static final int SR_VALUE = 1 + (CSET_STRING_REFERENCE << 8);
/** Commands ThreadReference. */
- public static final int TR_NAME = 1 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_SUSPEND = 2 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_RESUME = 3 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_STATUS = 4 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_THREAD_GROUP = 5 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_FRAMES = 6 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_FRAME_COUNT = 7 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_OWNED_MONITORS = 8 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_CURRENT_CONTENDED_MONITOR = 9 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_STOP = 10 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_INTERRUPT = 11 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_SUSPEND_COUNT = 12 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_OWNED_MONITOR_STACK_DEPTH = 13 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_FORCE_EARLY_RETURN = 14 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_NAME = 1 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_SUSPEND = 2 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_RESUME = 3 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_STATUS = 4 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_THREAD_GROUP = 5 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_FRAMES = 6 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_FRAME_COUNT = 7 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_OWNED_MONITORS = 8 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_CURRENT_CONTENDED_MONITOR = 9 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_STOP = 10 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_INTERRUPT = 11 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_SUSPEND_COUNT = 12 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_OWNED_MONITOR_STACK_DEPTH = 13 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_FORCE_EARLY_RETURN = 14 + (CSET_THREAD_REFERENCE << 8);
/** Commands ThreadGroupReference. */
- public static final int TGR_NAME = 1 + (CSET_THREAD_GROUP_REFERENCE << 8);
- public static final int TGR_PARENT = 2 + (CSET_THREAD_GROUP_REFERENCE << 8);
- public static final int TGR_CHILDREN = 3 + (CSET_THREAD_GROUP_REFERENCE << 8);
+ public static final int TGR_NAME = 1 + (CSET_THREAD_GROUP_REFERENCE << 8);
+ public static final int TGR_PARENT = 2 + (CSET_THREAD_GROUP_REFERENCE << 8);
+ public static final int TGR_CHILDREN = 3 + (CSET_THREAD_GROUP_REFERENCE << 8);
/** Commands ArrayReference. */
- public static final int AR_LENGTH = 1 + (CSET_ARRAY_REFERENCE << 8);
- public static final int AR_GET_VALUES = 2 + (CSET_ARRAY_REFERENCE << 8);
- public static final int AR_SET_VALUES = 3 + (CSET_ARRAY_REFERENCE << 8);
+ public static final int AR_LENGTH = 1 + (CSET_ARRAY_REFERENCE << 8);
+ public static final int AR_GET_VALUES = 2 + (CSET_ARRAY_REFERENCE << 8);
+ public static final int AR_SET_VALUES = 3 + (CSET_ARRAY_REFERENCE << 8);
/** Commands ClassLoaderReference. */
- public static final int CLR_VISIBLE_CLASSES = 1 + (CSET_CLASS_LOADER_REFERENCE << 8);
+ public static final int CLR_VISIBLE_CLASSES = 1 + (CSET_CLASS_LOADER_REFERENCE << 8);
/** Commands EventRequest. */
- public static final int ER_SET = 1 + (CSET_EVENT_REQUEST << 8);
- public static final int ER_CLEAR = 2 + (CSET_EVENT_REQUEST << 8);
- public static final int ER_CLEAR_ALL_BREAKPOINTS = 3 + (CSET_EVENT_REQUEST << 8);
+ public static final int ER_SET = 1 + (CSET_EVENT_REQUEST << 8);
+ public static final int ER_CLEAR = 2 + (CSET_EVENT_REQUEST << 8);
+ public static final int ER_CLEAR_ALL_BREAKPOINTS = 3 + (CSET_EVENT_REQUEST << 8);
/** Commands StackFrame. */
- public static final int SF_GET_VALUES = 1 + (CSET_STACK_FRAME << 8);
- public static final int SF_SET_VALUES = 2 + (CSET_STACK_FRAME << 8);
- public static final int SF_THIS_OBJECT = 3 + (CSET_STACK_FRAME << 8);
- public static final int SF_POP_FRAME = 4 + (CSET_STACK_FRAME << 8);
+ public static final int SF_GET_VALUES = 1 + (CSET_STACK_FRAME << 8);
+ public static final int SF_SET_VALUES = 2 + (CSET_STACK_FRAME << 8);
+ public static final int SF_THIS_OBJECT = 3 + (CSET_STACK_FRAME << 8);
+ public static final int SF_POP_FRAME = 4 + (CSET_STACK_FRAME << 8);
/** Commands ClassObjectReference. */
- public static final int COR_REFLECTED_TYPE = 1 + (CSET_CLASS_OBJECT_REFERENCE << 8);
+ public static final int COR_REFLECTED_TYPE = 1 + (CSET_CLASS_OBJECT_REFERENCE << 8);
/** Commands Event. */
- public static final int E_COMPOSITE = 100 + (CSET_EVENT << 8);
+ public static final int E_COMPOSITE = 100 + (CSET_EVENT << 8);
/** Commands Hot Code Replacement (OTI specific). */
- public static final int HCR_CLASSES_HAVE_CHANGED = 1 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_GET_CLASS_VERSION = 2 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_DO_RETURN = 3 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_REENTER_ON_EXIT = 4 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_CAPABILITIES = 5 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_CLASSES_HAVE_CHANGED = 1 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_GET_CLASS_VERSION = 2 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_DO_RETURN = 3 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_REENTER_ON_EXIT = 4 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_CAPABILITIES = 5 + (CSET_HOT_CODE_REPLACEMENT << 8);
/** Mapping of command codes to strings. */
- private static Map fgCommandMap = null;
+ private static Map<Integer, String> fgCommandMap = null;
/** Next id to be assigned. */
private static int fgNextId = 1;
- /** Command, note that this field is 256 * JDWP CommandSet (unsigned) + JDWP Command. */
+ /**
+ * Command, note that this field is 256 * JDWP CommandSet (unsigned) + JDWP
+ * Command.
+ */
private int fCommand;
/**
@@ -190,7 +192,7 @@ public class JdwpCommandPacket extends JdwpPacket {
setCommand(command);
setId(getNewId());
}
-
+
/**
* @return Returns unique id for command packet.
*/
@@ -202,7 +204,7 @@ public class JdwpCommandPacket extends JdwpPacket {
* @return Returns JDWP command set of packet.
*/
public byte getCommandSet() {
- return (byte)(fCommand >>> 8);
+ return (byte) (fCommand >>> 8);
}
/**
@@ -211,32 +213,35 @@ public class JdwpCommandPacket extends JdwpPacket {
public int getCommand() {
return fCommand;
}
-
+
/**
* Assigns command (256 * JDWP CommandSet (unsigned) + JDWP Command)
*/
public void setCommand(int command) {
fCommand = command;
}
-
+
/**
* Reads header fields that are specific for this type of packet.
*/
+ @Override
protected int readSpecificHeaderFields(byte[] bytes, int index) {
byte commandSet = bytes[index];
- fCommand = bytes[index+1] + (commandSet << 8);
+ fCommand = bytes[index + 1] + (commandSet << 8);
return 2;
}
/**
* Writes header fields that are specific for this type of packet.
*/
- protected int writeSpecificHeaderFields(byte[] bytes, int index) throws IOException {
- bytes[index] = getCommandSet();
- bytes[index+1] = (byte) fCommand;
- return 2;
+ @Override
+ protected int writeSpecificHeaderFields(byte[] bytes, int index)
+ throws IOException {
+ bytes[index] = getCommandSet();
+ bytes[index + 1] = (byte) fCommand;
+ return 2;
}
-
+
/**
* Retrieves constant mappings.
*/
@@ -244,14 +249,15 @@ public class JdwpCommandPacket extends JdwpPacket {
if (fgCommandMap != null) {
return;
}
-
+
Field[] fields = JdwpCommandPacket.class.getDeclaredFields();
-
+
// First get the set names.
- Map setNames = new HashMap(fields.length);
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0)
+ Map<Integer, String> setNames = new HashMap<Integer, String>(fields.length);
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0)
continue;
try {
@@ -270,30 +276,31 @@ public class JdwpCommandPacket extends JdwpPacket {
// in this class are numbers that are convertible to int.
}
}
-
- // Get the commands.
- fgCommandMap = new HashMap();
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
+
+ // Get the commands.
+ fgCommandMap = new HashMap<Integer, String>();
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
}
-
+
try {
String name = field.getName();
-
+
// If it is a set, continue.
if (name.startsWith("CSET_")) { //$NON-NLS-1$
continue;
}
- Integer val = (Integer)field.get(null);
- int value = val.intValue();
+ Integer val = (Integer) field.get(null);
+ int value = val.intValue();
int set = value >>> 8;
- String setName = (String)setNames.get(new Integer(set));
+ String setName = setNames.get(new Integer(set));
String entryName = setName + " - " + removePrefix(name); //$NON-NLS-1$
-
+
fgCommandMap.put(val, entryName);
-
+
} catch (IllegalAccessException e) {
// Will not occur for own class.
}
@@ -303,11 +310,11 @@ public class JdwpCommandPacket extends JdwpPacket {
/**
* @return Returns a map with string representations of error codes.
*/
- public static Map commandMap() {
+ public static Map<Integer, String> commandMap() {
getConstantMaps();
return fgCommandMap;
}
-
+
/**
* @return Returns string without XXX_ prefix.
*/
@@ -315,296 +322,299 @@ public class JdwpCommandPacket extends JdwpPacket {
int i = str.indexOf('_');
if (i < 0) {
return str;
- }
+ }
return str.substring(i + 1);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append('[');
buffer.append(getId());
buffer.append("] "); //$NON-NLS-1$
switch (getCommand()) {
-
- /** Commands VirtualMachine. */
- case VM_VERSION:
- buffer.append("VM_VERSION"); //$NON-NLS-1$
- break;
- case VM_CLASSES_BY_SIGNATURE:
- buffer.append("VM_CLASSES_BY_SIGNATURE"); //$NON-NLS-1$
- break;
- case VM_ALL_CLASSES:
- buffer.append("VM_ALL_CLASSES"); //$NON-NLS-1$
- break;
- case VM_ALL_THREADS:
- buffer.append("VM_ALL_THREADS"); //$NON-NLS-1$
- break;
- case VM_TOP_LEVEL_THREAD_GROUPS:
- buffer.append("VM_TOP_LEVEL_THREAD_GROUPS"); //$NON-NLS-1$
- break;
- case VM_DISPOSE:
- buffer.append("VM_DISPOSE"); //$NON-NLS-1$
- break;
- case VM_ID_SIZES:
- buffer.append("VM_ID_SIZES"); //$NON-NLS-1$
- break;
- case VM_SUSPEND:
- buffer.append("VM_SUSPEND"); //$NON-NLS-1$
- break;
- case VM_RESUME:
- buffer.append("VM_RESUME"); //$NON-NLS-1$
- break;
- case VM_EXIT:
- buffer.append("VM_EXIT"); //$NON-NLS-1$
- break;
- case VM_CREATE_STRING:
- buffer.append("VM_CREATE_STRING"); //$NON-NLS-1$
- break;
- case VM_CAPABILITIES:
- buffer.append("VM_CAPABILITIES"); //$NON-NLS-1$
- break;
- case VM_CLASS_PATHS:
- buffer.append("VM_CLASS_PATHS"); //$NON-NLS-1$
- break;
- case VM_DISPOSE_OBJECTS:
- buffer.append("VM_DISPOSE_OBJECTS"); //$NON-NLS-1$
- break;
- case VM_HOLD_EVENTS:
- buffer.append("VM_HOLD_EVENTS"); //$NON-NLS-1$
- break;
- case VM_RELEASE_EVENTS:
- buffer.append("VM_RELEASE_EVENTS"); //$NON-NLS-1$
- break;
- case VM_CAPABILITIES_NEW:
- buffer.append("VM_CAPABILITIES_NEW"); //$NON-NLS-1$
- break;
- case VM_REDEFINE_CLASSES:
- buffer.append("VM_REDEFINE_CLASSES"); //$NON-NLS-1$
- break;
- case VM_SET_DEFAULT_STRATUM:
- buffer.append("VM_SET_DEFAULT_STRATUM"); //$NON-NLS-1$
- break;
- case VM_ALL_CLASSES_WITH_GENERIC:
- buffer.append("VM_ALL_CLASSES_WITH_GENERIC"); //$NON-NLS-1$
- break;
-
- /** Commands ReferenceType. */
- case RT_SIGNATURE:
- buffer.append("RT_SIGNATURE"); //$NON-NLS-1$
- break;
- case RT_CLASS_LOADER:
- buffer.append("RT_CLASS_LOADER"); //$NON-NLS-1$
- break;
- case RT_MODIFIERS:
- buffer.append("RT_MODIFIERS"); //$NON-NLS-1$
- break;
- case RT_FIELDS:
- buffer.append("RT_FIELDS"); //$NON-NLS-1$
- break;
- case RT_METHODS:
- buffer.append("RT_METHODS"); //$NON-NLS-1$
- break;
- case RT_GET_VALUES:
- buffer.append("RT_GET_VALUES"); //$NON-NLS-1$
- break;
- case RT_SOURCE_FILE:
- buffer.append("RT_SOURCE_FILE"); //$NON-NLS-1$
- break;
- case RT_NESTED_TYPES:
- buffer.append("RT_NESTED_TYPES"); //$NON-NLS-1$
- break;
- case RT_STATUS:
- buffer.append("RT_STATUS"); //$NON-NLS-1$
- break;
- case RT_INTERFACES:
- buffer.append("RT_INTERFACES"); //$NON-NLS-1$
- break;
- case RT_CLASS_OBJECT:
- buffer.append("RT_CLASS_OBJECT"); //$NON-NLS-1$
- break;
- case RT_SOURCE_DEBUG_EXTENSION:
- buffer.append("RT_SOURCE_DEBUG_EXTENSION"); //$NON-NLS-1$
- break;
- case RT_SIGNATURE_WITH_GENERIC:
- buffer.append("RT_SIGNATURE_WITH_GENERIC"); //$NON-NLS-1$
- break;
- case RT_FIELDS_WITH_GENERIC:
- buffer.append("RT_FIELDS_WITH_GENERIC"); //$NON-NLS-1$
- break;
- case RT_METHODS_WITH_GENERIC:
- buffer.append("RT_METHODS_WITH_GENERIC"); //$NON-NLS-1$
- break;
-
- /** Commands ClassType. */
- case CT_SUPERCLASS:
- buffer.append("CT_SUPERCLASS"); //$NON-NLS-1$
- break;
- case CT_SET_VALUES:
- buffer.append("CT_SET_VALUES"); //$NON-NLS-1$
- break;
- case CT_INVOKE_METHOD:
- buffer.append("CT_INVOKE_METHOD"); //$NON-NLS-1$
- break;
- case CT_NEW_INSTANCE:
- buffer.append("CT_NEW_INSTANCE"); //$NON-NLS-1$
- break;
-
- /** Commands ArrayType. */
- case AT_NEW_INSTANCE:
- buffer.append("AT_NEW_INSTANCE"); //$NON-NLS-1$
- break;
-
- /** Commands Method. */
- case M_LINE_TABLE:
- buffer.append("M_LINE_TABLE"); //$NON-NLS-1$
- break;
- case M_VARIABLE_TABLE:
- buffer.append("M_VARIABLE_TABLE"); //$NON-NLS-1$
- break;
- case M_BYTECODES:
- buffer.append("M_BYTECODES"); //$NON-NLS-1$
- break;
- case M_OBSOLETE:
- buffer.append("M_OBSOLETE"); //$NON-NLS-1$
- break;
- case M_VARIABLE_TABLE_WITH_GENERIC:
- buffer.append("M_VARIABLE_TABLE_WITH_GENERIC"); //$NON-NLS-1$
- break;
-
- /** Commands ObjectReference. */
- case OR_REFERENCE_TYPE:
- buffer.append("OR_REFERENCE_TYPE"); //$NON-NLS-1$
- break;
- case OR_GET_VALUES:
- buffer.append("OR_GET_VALUES"); //$NON-NLS-1$
- break;
- case OR_SET_VALUES:
- buffer.append("OR_SET_VALUES"); //$NON-NLS-1$
- break;
- case OR_MONITOR_INFO:
- buffer.append("OR_MONITOR_INFO"); //$NON-NLS-1$
- break;
- case OR_INVOKE_METHOD:
- buffer.append("OR_INVOKE_METHOD"); //$NON-NLS-1$
- break;
- case OR_DISABLE_COLLECTION:
- buffer.append("OR_DISABLE_COLLECTION"); //$NON-NLS-1$
- break;
- case OR_ENABLE_COLLECTION:
- buffer.append("OR_ENABLE_COLLECTION"); //$NON-NLS-1$
- break;
- case OR_IS_COLLECTED:
- buffer.append("OR_IS_COLLECTED"); //$NON-NLS-1$
- break;
-
- /** Commands StringReference. */
- case SR_VALUE:
- buffer.append("SR_VALUE"); //$NON-NLS-1$
- break;
-
- /** Commands ThreadReference. */
- case TR_NAME:
- buffer.append("TR_NAME"); //$NON-NLS-1$
- break;
- case TR_SUSPEND:
- buffer.append("TR_SUSPEND"); //$NON-NLS-1$
- break;
- case TR_RESUME:
- buffer.append("TR_RESUME"); //$NON-NLS-1$
- break;
- case TR_STATUS:
- buffer.append("TR_STATUS"); //$NON-NLS-1$
- break;
- case TR_THREAD_GROUP:
- buffer.append("TR_THREAD_GROUP"); //$NON-NLS-1$
- break;
- case TR_FRAMES:
- buffer.append("TR_FRAMES"); //$NON-NLS-1$
- break;
- case TR_FRAME_COUNT:
- buffer.append("TR_FRAME_COUNT"); //$NON-NLS-1$
- break;
- case TR_OWNED_MONITORS:
- buffer.append("TR_OWNED_MONITORS"); //$NON-NLS-1$
- break;
- case TR_CURRENT_CONTENDED_MONITOR:
- buffer.append("TR_CURRENT_CONTENDED_MONITOR"); //$NON-NLS-1$
- break;
- case TR_STOP:
- buffer.append("TR_STOP"); //$NON-NLS-1$
- break;
- case TR_INTERRUPT:
- buffer.append("TR_INTERRUPT"); //$NON-NLS-1$
- break;
- case TR_SUSPEND_COUNT:
- buffer.append("TR_SUSPEND_COUNT"); //$NON-NLS-1$
- break;
-
- /** Commands ThreadGroupReference. */
- case TGR_NAME:
- buffer.append("TGR_NAME"); //$NON-NLS-1$
- break;
- case TGR_PARENT:
- buffer.append("TGR_PARENT"); //$NON-NLS-1$
- break;
- case TGR_CHILDREN:
- buffer.append("TGR_CHILDREN"); //$NON-NLS-1$
- break;
-
- /** Commands ArrayReference. */
- case AR_LENGTH:
- buffer.append("AR_LENGTH"); //$NON-NLS-1$
- break;
- case AR_GET_VALUES:
- buffer.append("AR_GET_VALUES"); //$NON-NLS-1$
- break;
- case AR_SET_VALUES:
- buffer.append("AR_SET_VALUES"); //$NON-NLS-1$
- break;
-
- /** Commands ClassLoaderReference. */
- case CLR_VISIBLE_CLASSES:
- buffer.append("CLR_VISIBLE_CLASSES"); //$NON-NLS-1$
- break;
-
- /** Commands EventRequest. */
- case ER_SET:
- buffer.append("ER_SET"); //$NON-NLS-1$
- break;
- case ER_CLEAR:
- buffer.append("ER_CLEAR"); //$NON-NLS-1$
- break;
- case ER_CLEAR_ALL_BREAKPOINTS:
- buffer.append("ER_CLEAR_ALL_BREAKPOINTS"); //$NON-NLS-1$
- break;
-
- /** Commands StackFrame. */
- case SF_GET_VALUES:
- buffer.append("SF_GET_VALUES"); //$NON-NLS-1$
- break;
- case SF_SET_VALUES:
- buffer.append("SF_SET_VALUES"); //$NON-NLS-1$
- break;
- case SF_THIS_OBJECT:
- buffer.append("SF_THIS_OBJECT"); //$NON-NLS-1$
- break;
- case SF_POP_FRAME:
- buffer.append("SF_POP_FRAME"); //$NON-NLS-1$
- break;
-
- /** Commands ClassObjectReference. */
- case COR_REFLECTED_TYPE:
- buffer.append("COR_REFLECTED_TYPE"); //$NON-NLS-1$
- break;
-
- /** Commands Event. */
- case E_COMPOSITE:
- buffer.append("E_COMPOSITE"); //$NON-NLS-1$
- break;
-
+
+ /** Commands VirtualMachine. */
+ case VM_VERSION:
+ buffer.append("VM_VERSION"); //$NON-NLS-1$
+ break;
+ case VM_CLASSES_BY_SIGNATURE:
+ buffer.append("VM_CLASSES_BY_SIGNATURE"); //$NON-NLS-1$
+ break;
+ case VM_ALL_CLASSES:
+ buffer.append("VM_ALL_CLASSES"); //$NON-NLS-1$
+ break;
+ case VM_ALL_THREADS:
+ buffer.append("VM_ALL_THREADS"); //$NON-NLS-1$
+ break;
+ case VM_TOP_LEVEL_THREAD_GROUPS:
+ buffer.append("VM_TOP_LEVEL_THREAD_GROUPS"); //$NON-NLS-1$
+ break;
+ case VM_DISPOSE:
+ buffer.append("VM_DISPOSE"); //$NON-NLS-1$
+ break;
+ case VM_ID_SIZES:
+ buffer.append("VM_ID_SIZES"); //$NON-NLS-1$
+ break;
+ case VM_SUSPEND:
+ buffer.append("VM_SUSPEND"); //$NON-NLS-1$
+ break;
+ case VM_RESUME:
+ buffer.append("VM_RESUME"); //$NON-NLS-1$
+ break;
+ case VM_EXIT:
+ buffer.append("VM_EXIT"); //$NON-NLS-1$
+ break;
+ case VM_CREATE_STRING:
+ buffer.append("VM_CREATE_STRING"); //$NON-NLS-1$
+ break;
+ case VM_CAPABILITIES:
+ buffer.append("VM_CAPABILITIES"); //$NON-NLS-1$
+ break;
+ case VM_CLASS_PATHS:
+ buffer.append("VM_CLASS_PATHS"); //$NON-NLS-1$
+ break;
+ case VM_DISPOSE_OBJECTS:
+ buffer.append("VM_DISPOSE_OBJECTS"); //$NON-NLS-1$
+ break;
+ case VM_HOLD_EVENTS:
+ buffer.append("VM_HOLD_EVENTS"); //$NON-NLS-1$
+ break;
+ case VM_RELEASE_EVENTS:
+ buffer.append("VM_RELEASE_EVENTS"); //$NON-NLS-1$
+ break;
+ case VM_CAPABILITIES_NEW:
+ buffer.append("VM_CAPABILITIES_NEW"); //$NON-NLS-1$
+ break;
+ case VM_REDEFINE_CLASSES:
+ buffer.append("VM_REDEFINE_CLASSES"); //$NON-NLS-1$
+ break;
+ case VM_SET_DEFAULT_STRATUM:
+ buffer.append("VM_SET_DEFAULT_STRATUM"); //$NON-NLS-1$
+ break;
+ case VM_ALL_CLASSES_WITH_GENERIC:
+ buffer.append("VM_ALL_CLASSES_WITH_GENERIC"); //$NON-NLS-1$
+ break;
+
+ /** Commands ReferenceType. */
+ case RT_SIGNATURE:
+ buffer.append("RT_SIGNATURE"); //$NON-NLS-1$
+ break;
+ case RT_CLASS_LOADER:
+ buffer.append("RT_CLASS_LOADER"); //$NON-NLS-1$
+ break;
+ case RT_MODIFIERS:
+ buffer.append("RT_MODIFIERS"); //$NON-NLS-1$
+ break;
+ case RT_FIELDS:
+ buffer.append("RT_FIELDS"); //$NON-NLS-1$
+ break;
+ case RT_METHODS:
+ buffer.append("RT_METHODS"); //$NON-NLS-1$
+ break;
+ case RT_GET_VALUES:
+ buffer.append("RT_GET_VALUES"); //$NON-NLS-1$
+ break;
+ case RT_SOURCE_FILE:
+ buffer.append("RT_SOURCE_FILE"); //$NON-NLS-1$
+ break;
+ case RT_NESTED_TYPES:
+ buffer.append("RT_NESTED_TYPES"); //$NON-NLS-1$
+ break;
+ case RT_STATUS:
+ buffer.append("RT_STATUS"); //$NON-NLS-1$
+ break;
+ case RT_INTERFACES:
+ buffer.append("RT_INTERFACES"); //$NON-NLS-1$
+ break;
+ case RT_CLASS_OBJECT:
+ buffer.append("RT_CLASS_OBJECT"); //$NON-NLS-1$
+ break;
+ case RT_SOURCE_DEBUG_EXTENSION:
+ buffer.append("RT_SOURCE_DEBUG_EXTENSION"); //$NON-NLS-1$
+ break;
+ case RT_SIGNATURE_WITH_GENERIC:
+ buffer.append("RT_SIGNATURE_WITH_GENERIC"); //$NON-NLS-1$
+ break;
+ case RT_FIELDS_WITH_GENERIC:
+ buffer.append("RT_FIELDS_WITH_GENERIC"); //$NON-NLS-1$
+ break;
+ case RT_METHODS_WITH_GENERIC:
+ buffer.append("RT_METHODS_WITH_GENERIC"); //$NON-NLS-1$
+ break;
+
+ /** Commands ClassType. */
+ case CT_SUPERCLASS:
+ buffer.append("CT_SUPERCLASS"); //$NON-NLS-1$
+ break;
+ case CT_SET_VALUES:
+ buffer.append("CT_SET_VALUES"); //$NON-NLS-1$
+ break;
+ case CT_INVOKE_METHOD:
+ buffer.append("CT_INVOKE_METHOD"); //$NON-NLS-1$
+ break;
+ case CT_NEW_INSTANCE:
+ buffer.append("CT_NEW_INSTANCE"); //$NON-NLS-1$
+ break;
+
+ /** Commands ArrayType. */
+ case AT_NEW_INSTANCE:
+ buffer.append("AT_NEW_INSTANCE"); //$NON-NLS-1$
+ break;
+
+ /** Commands Method. */
+ case M_LINE_TABLE:
+ buffer.append("M_LINE_TABLE"); //$NON-NLS-1$
+ break;
+ case M_VARIABLE_TABLE:
+ buffer.append("M_VARIABLE_TABLE"); //$NON-NLS-1$
+ break;
+ case M_BYTECODES:
+ buffer.append("M_BYTECODES"); //$NON-NLS-1$
+ break;
+ case M_OBSOLETE:
+ buffer.append("M_OBSOLETE"); //$NON-NLS-1$
+ break;
+ case M_VARIABLE_TABLE_WITH_GENERIC:
+ buffer.append("M_VARIABLE_TABLE_WITH_GENERIC"); //$NON-NLS-1$
+ break;
+
+ /** Commands ObjectReference. */
+ case OR_REFERENCE_TYPE:
+ buffer.append("OR_REFERENCE_TYPE"); //$NON-NLS-1$
+ break;
+ case OR_GET_VALUES:
+ buffer.append("OR_GET_VALUES"); //$NON-NLS-1$
+ break;
+ case OR_SET_VALUES:
+ buffer.append("OR_SET_VALUES"); //$NON-NLS-1$
+ break;
+ case OR_MONITOR_INFO:
+ buffer.append("OR_MONITOR_INFO"); //$NON-NLS-1$
+ break;
+ case OR_INVOKE_METHOD:
+ buffer.append("OR_INVOKE_METHOD"); //$NON-NLS-1$
+ break;
+ case OR_DISABLE_COLLECTION:
+ buffer.append("OR_DISABLE_COLLECTION"); //$NON-NLS-1$
+ break;
+ case OR_ENABLE_COLLECTION:
+ buffer.append("OR_ENABLE_COLLECTION"); //$NON-NLS-1$
+ break;
+ case OR_IS_COLLECTED:
+ buffer.append("OR_IS_COLLECTED"); //$NON-NLS-1$
+ break;
+
+ /** Commands StringReference. */
+ case SR_VALUE:
+ buffer.append("SR_VALUE"); //$NON-NLS-1$
+ break;
+
+ /** Commands ThreadReference. */
+ case TR_NAME:
+ buffer.append("TR_NAME"); //$NON-NLS-1$
+ break;
+ case TR_SUSPEND:
+ buffer.append("TR_SUSPEND"); //$NON-NLS-1$
+ break;
+ case TR_RESUME:
+ buffer.append("TR_RESUME"); //$NON-NLS-1$
+ break;
+ case TR_STATUS:
+ buffer.append("TR_STATUS"); //$NON-NLS-1$
+ break;
+ case TR_THREAD_GROUP:
+ buffer.append("TR_THREAD_GROUP"); //$NON-NLS-1$
+ break;
+ case TR_FRAMES:
+ buffer.append("TR_FRAMES"); //$NON-NLS-1$
+ break;
+ case TR_FRAME_COUNT:
+ buffer.append("TR_FRAME_COUNT"); //$NON-NLS-1$
+ break;
+ case TR_OWNED_MONITORS:
+ buffer.append("TR_OWNED_MONITORS"); //$NON-NLS-1$
+ break;
+ case TR_CURRENT_CONTENDED_MONITOR:
+ buffer.append("TR_CURRENT_CONTENDED_MONITOR"); //$NON-NLS-1$
+ break;
+ case TR_STOP:
+ buffer.append("TR_STOP"); //$NON-NLS-1$
+ break;
+ case TR_INTERRUPT:
+ buffer.append("TR_INTERRUPT"); //$NON-NLS-1$
+ break;
+ case TR_SUSPEND_COUNT:
+ buffer.append("TR_SUSPEND_COUNT"); //$NON-NLS-1$
+ break;
+
+ /** Commands ThreadGroupReference. */
+ case TGR_NAME:
+ buffer.append("TGR_NAME"); //$NON-NLS-1$
+ break;
+ case TGR_PARENT:
+ buffer.append("TGR_PARENT"); //$NON-NLS-1$
+ break;
+ case TGR_CHILDREN:
+ buffer.append("TGR_CHILDREN"); //$NON-NLS-1$
+ break;
+
+ /** Commands ArrayReference. */
+ case AR_LENGTH:
+ buffer.append("AR_LENGTH"); //$NON-NLS-1$
+ break;
+ case AR_GET_VALUES:
+ buffer.append("AR_GET_VALUES"); //$NON-NLS-1$
+ break;
+ case AR_SET_VALUES:
+ buffer.append("AR_SET_VALUES"); //$NON-NLS-1$
+ break;
+
+ /** Commands ClassLoaderReference. */
+ case CLR_VISIBLE_CLASSES:
+ buffer.append("CLR_VISIBLE_CLASSES"); //$NON-NLS-1$
+ break;
+
+ /** Commands EventRequest. */
+ case ER_SET:
+ buffer.append("ER_SET"); //$NON-NLS-1$
+ break;
+ case ER_CLEAR:
+ buffer.append("ER_CLEAR"); //$NON-NLS-1$
+ break;
+ case ER_CLEAR_ALL_BREAKPOINTS:
+ buffer.append("ER_CLEAR_ALL_BREAKPOINTS"); //$NON-NLS-1$
+ break;
+
+ /** Commands StackFrame. */
+ case SF_GET_VALUES:
+ buffer.append("SF_GET_VALUES"); //$NON-NLS-1$
+ break;
+ case SF_SET_VALUES:
+ buffer.append("SF_SET_VALUES"); //$NON-NLS-1$
+ break;
+ case SF_THIS_OBJECT:
+ buffer.append("SF_THIS_OBJECT"); //$NON-NLS-1$
+ break;
+ case SF_POP_FRAME:
+ buffer.append("SF_POP_FRAME"); //$NON-NLS-1$
+ break;
+
+ /** Commands ClassObjectReference. */
+ case COR_REFLECTED_TYPE:
+ buffer.append("COR_REFLECTED_TYPE"); //$NON-NLS-1$
+ break;
+
+ /** Commands Event. */
+ case E_COMPOSITE:
+ buffer.append("E_COMPOSITE"); //$NON-NLS-1$
+ break;
+
default:
buffer.append("UNKNOWN COMMAND: "); //$NON-NLS-1$
buffer.append(getCommand());
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFieldID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFieldID.java
index c1da29f26..29babcd35 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFieldID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFieldID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpFieldID extends JdwpID {
/**
@@ -25,10 +24,11 @@ public class JdwpFieldID extends JdwpID {
public JdwpFieldID(VirtualMachineImpl vmImpl) {
super(vmImpl);
}
-
+
/**
* @return Returns VM specific size of ID.
*/
+ @Override
public int getSize() {
return fVirtualMachine.fieldIDSize();
}
@@ -36,7 +36,8 @@ public class JdwpFieldID extends JdwpID {
/**
* @return Returns true if ID is null.
*/
+ @Override
public boolean isNull() {
return false;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFrameID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFrameID.java
index 685510ec6..c556ceeed 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFrameID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpFrameID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpFrameID extends JdwpID {
/**
@@ -25,10 +24,11 @@ public class JdwpFrameID extends JdwpID {
public JdwpFrameID(VirtualMachineImpl vmImpl) {
super(vmImpl);
}
-
+
/**
* @return Returns VM specific size of ID.
*/
+ @Override
public int getSize() {
return fVirtualMachine.frameIDSize();
}
@@ -36,7 +36,8 @@ public class JdwpFrameID extends JdwpID {
/**
* @return Returns true if ID is null.
*/
+ @Override
public boolean isNull() {
return false;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpID.java
index 2d90d0eb5..3aff5f34f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpID.java
@@ -10,91 +10,109 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jdi.internal.VirtualMachineImpl;
-
/**
- * From this class all Java Debug Wire Protocol (JDWP) IDs
- * declared by the JDWP specification are derived.
- *
+ * From this class all Java Debug Wire Protocol (JDWP) IDs declared by the JDWP
+ * specification are derived.
+ *
*/
public abstract class JdwpID {
/** Tag Constants. */
- public static final byte NULL_TAG = 91; // Used for tagged null values.
- public static final byte ARRAY_TAG = 91; // '[' - an array object (objectID size).
- public static final byte BYTE_TAG = 66; // 'B' - a byte value (1 byte).
- public static final byte CHAR_TAG = 67; // 'C' - a character value (2 bytes).
- public static final byte OBJECT_TAG = 76; // 'L' - an object (objectID size).
- public static final byte FLOAT_TAG = 70; // 'F' - a float value (4 bytes).
- public static final byte DOUBLE_TAG = 68; // 'D' - a double value (8 bytes).
- public static final byte INT_TAG = 73; // 'I' - an int value (4 bytes).
- public static final byte LONG_TAG = 74; // 'J' - a long value (8 bytes).
- public static final byte SHORT_TAG = 83; // 'S' - a short value (2 bytes).
- public static final byte VOID_TAG = 86; // 'V' - a void value (no bytes).
- public static final byte BOOLEAN_TAG = 90; // 'Z' - a boolean value (1 byte).
- public static final byte STRING_TAG = 115; // 's' - a String object (objectID size).
- public static final byte THREAD_TAG = 116; // 't' - a Thread object (objectID size).
- public static final byte THREAD_GROUP_TAG = 103; // 'g' - a ThreadGroup object (objectID size).
- public static final byte CLASS_LOADER_TAG = 108; // 'l' - a ClassLoader object (objectID size).
- public static final byte CLASS_OBJECT_TAG = 99; // 'c' - a class object object (objectID size).
-
+ public static final byte NULL_TAG = 91; // Used for tagged null values.
+ public static final byte ARRAY_TAG = 91; // '[' - an array object (objectID
+ // size).
+ public static final byte BYTE_TAG = 66; // 'B' - a byte value (1 byte).
+ public static final byte CHAR_TAG = 67; // 'C' - a character value (2
+ // bytes).
+ public static final byte OBJECT_TAG = 76; // 'L' - an object (objectID
+ // size).
+ public static final byte FLOAT_TAG = 70; // 'F' - a float value (4 bytes).
+ public static final byte DOUBLE_TAG = 68; // 'D' - a double value (8 bytes).
+ public static final byte INT_TAG = 73; // 'I' - an int value (4 bytes).
+ public static final byte LONG_TAG = 74; // 'J' - a long value (8 bytes).
+ public static final byte SHORT_TAG = 83; // 'S' - a short value (2 bytes).
+ public static final byte VOID_TAG = 86; // 'V' - a void value (no bytes).
+ public static final byte BOOLEAN_TAG = 90; // 'Z' - a boolean value (1
+ // byte).
+ public static final byte STRING_TAG = 115; // 's' - a String object
+ // (objectID size).
+ public static final byte THREAD_TAG = 116; // 't' - a Thread object
+ // (objectID size).
+ public static final byte THREAD_GROUP_TAG = 103; // 'g' - a ThreadGroup
+ // object (objectID
+ // size).
+ public static final byte CLASS_LOADER_TAG = 108; // 'l' - a ClassLoader
+ // object (objectID
+ // size).
+ public static final byte CLASS_OBJECT_TAG = 99; // 'c' - a class object
+ // object (objectID size).
+
/** TypeTag Constants. */
- public static final byte TYPE_TAG_CLASS = 1; // ReferenceType is a class.
- public static final byte TYPE_TAG_INTERFACE = 2; // ReferenceType is an interface.
- public static final byte TYPE_TAG_ARRAY = 3; // ReferenceType is an array.
+ public static final byte TYPE_TAG_CLASS = 1; // ReferenceType is a class.
+ public static final byte TYPE_TAG_INTERFACE = 2; // ReferenceType is an
+ // interface.
+ public static final byte TYPE_TAG_ARRAY = 3; // ReferenceType is an array.
/** Mapping of command codes to strings. */
- private static HashMap fTagMap = null;
- private static HashMap fTypeTagMap = null;
+ private static HashMap<Integer, String> fTagMap = null;
+ private static HashMap<Integer, String> fTypeTagMap = null;
/** Jdwp representation of null ID. */
protected static final int VALUE_NULL = 0;
/** The value of the ID */
protected long fValue = VALUE_NULL;
- /** The virtual machine of the mirror object that uses this ID (needed for ID sizes. */
+ /**
+ * The virtual machine of the mirror object that uses this ID (needed for ID
+ * sizes.
+ */
protected VirtualMachineImpl fVirtualMachine;
-
+
/**
* Creates new JdwpID.
*/
public JdwpID(VirtualMachineImpl vmImpl) {
fVirtualMachine = vmImpl;
}
-
+
/**
- * @return Returns true if two IDs refer to the same entity in the target VM.
+ * @return Returns true if two IDs refer to the same entity in the target
+ * VM.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
- return object instanceof JdwpID && fValue == ((JdwpID)object).fValue;
+ return object instanceof JdwpID && fValue == ((JdwpID) object).fValue;
}
-
+
/**
* @return Returns a has code for this object.
* @see java.lang.Object#hashCode
*/
+ @Override
public int hashCode() {
- return (int)fValue;
- }
-
+ return (int) fValue;
+ }
+
/**
* @return Returns value of ID.
*/
public final long value() {
return fValue;
- }
-
+ }
+
/**
* @return Returns string representation.
*/
+ @Override
public String toString() {
return new Long(fValue).toString();
}
@@ -108,7 +126,7 @@ public abstract class JdwpID {
* @return Returns true if ID is null.
*/
public abstract boolean isNull();
-
+
/**
* Reads ID.
*/
@@ -116,7 +134,8 @@ public abstract class JdwpID {
fValue = 0;
int size = getSize();
for (int i = 0; i < size; i++) {
- int b = inStream.readUnsignedByte(); // Note that the byte must be treated as unsigned.
+ int b = inStream.readUnsignedByte(); // Note that the byte must be
+ // treated as unsigned.
fValue = fValue << 8 | b;
}
}
@@ -127,26 +146,29 @@ public abstract class JdwpID {
public void write(DataOutputStream outStream) throws IOException {
int size = getSize();
for (int i = size - 1; i >= 0; i--) {
- byte b = (byte)(fValue >>> 8 * i); // Note that >>> must be used because fValue must be treated as unsigned.
+ byte b = (byte) (fValue >>> 8 * i); // Note that >>> must be used
+ // because fValue must be
+ // treated as unsigned.
outStream.write(b);
}
}
-
+
/**
* Retrieves constant mappings.
*/
public static void getConstantMaps() {
if (fTagMap != null)
return;
-
+
java.lang.reflect.Field[] fields = JdwpID.class.getDeclaredFields();
- fTagMap = new HashMap();
- fTypeTagMap = new HashMap();
- for (int i = 0; i < fields.length; i++) {
- java.lang.reflect.Field field = fields[i];
- if ((field.getModifiers() & java.lang.reflect.Modifier.PUBLIC) == 0 || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0 || (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0)
+ fTagMap = new HashMap<Integer, String>();
+ fTypeTagMap = new HashMap<Integer, String>();
+ for (Field field : fields) {
+ if ((field.getModifiers() & java.lang.reflect.Modifier.PUBLIC) == 0
+ || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0
+ || (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0)
continue;
-
+
try {
String name = field.getName();
Integer intValue = new Integer(field.getInt(null));
@@ -165,20 +187,20 @@ public abstract class JdwpID {
}
}
}
-
+
/**
* @return Returns a map with string representations of tags.
*/
- public static Map tagMap() {
- getConstantMaps();
- return fTagMap;
- }
+ public static Map<Integer, String> tagMap() {
+ getConstantMaps();
+ return fTagMap;
+ }
/**
* @return Returns a map with string representations of type tags.
*/
- public static Map typeTagMap() {
- getConstantMaps();
- return fTypeTagMap;
- }
+ public static Map<Integer, String> typeTagMap() {
+ getConstantMaps();
+ return fTypeTagMap;
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpInterfaceID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpInterfaceID.java
index 839965aee..73b819a08 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpInterfaceID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpInterfaceID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpInterfaceID extends JdwpReferenceTypeID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpMethodID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpMethodID.java
index 967bac39c..f1b667489 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpMethodID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpMethodID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpMethodID extends JdwpID {
/**
@@ -25,10 +24,11 @@ public class JdwpMethodID extends JdwpID {
public JdwpMethodID(VirtualMachineImpl vmImpl) {
super(vmImpl);
}
-
+
/**
* @return Returns VM specific size of ID.
*/
+ @Override
public int getSize() {
return fVirtualMachine.methodIDSize();
}
@@ -36,7 +36,8 @@ public class JdwpMethodID extends JdwpID {
/**
* @return Returns true if ID is null.
*/
+ @Override
public boolean isNull() {
return false;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpObjectID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpObjectID.java
index 857183000..f764fdb86 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpObjectID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpObjectID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpObjectID extends JdwpID {
/**
@@ -25,10 +24,11 @@ public class JdwpObjectID extends JdwpID {
public JdwpObjectID(VirtualMachineImpl vmImpl) {
super(vmImpl);
}
-
+
/**
* @return Returns VM specific size of ID.
*/
+ @Override
public int getSize() {
return fVirtualMachine.objectIDSize();
}
@@ -36,7 +36,8 @@ public class JdwpObjectID extends JdwpID {
/**
* @return Returns true if ID is null.
*/
+ @Override
public boolean isNull() {
return fValue == VALUE_NULL;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpPacket.java
index 3915d059f..0ceaef998 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpPacket.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
@@ -18,15 +17,15 @@ import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
/**
- * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
- * declared by the JDWP specification.
- *
+ * This class implements the corresponding Java Debug Wire Protocol (JDWP)
+ * packet declared by the JDWP specification.
+ *
*/
public abstract class JdwpPacket {
/** General JDWP constants. */
- public static final byte FLAG_REPLY_PACKET = (byte)0x80;
+ public static final byte FLAG_REPLY_PACKET = (byte) 0x80;
protected static final int MIN_PACKET_LENGTH = 11;
-
+
/** Map with Strings for flag bits. */
private static String[] fgFlagStrings = null;
@@ -34,11 +33,11 @@ public abstract class JdwpPacket {
protected int fId = 0;
protected byte fFlags = 0;
protected byte[] fDataBuf = null;
-
+
/**
* Set Id.
*/
- /*package*/ void setId(int id) {
+ /* package */void setId(int id) {
fId = id;
}
@@ -48,14 +47,14 @@ public abstract class JdwpPacket {
public int getId() {
return fId;
}
-
+
/**
* Set Flags.
*/
- /*package*/ void setFlags(byte flags) {
+ /* package */void setFlags(byte flags) {
fFlags = flags;
}
-
+
/**
* @return Returns Flags.
*/
@@ -69,14 +68,14 @@ public abstract class JdwpPacket {
public int getLength() {
return MIN_PACKET_LENGTH + getDataLength();
}
-
+
/**
* @return Returns length of data in packet.
*/
public int getDataLength() {
return fDataBuf == null ? 0 : fDataBuf.length;
}
-
+
/**
* @return Returns data of packet.
*/
@@ -85,13 +84,14 @@ public abstract class JdwpPacket {
}
/**
- * @return Returns DataInputStream with reply data, or an empty stream if there is none.
+ * @return Returns DataInputStream with reply data, or an empty stream if
+ * there is none.
*/
public DataInputStream dataInStream() {
if (fDataBuf != null) {
return new DataInputStream(new ByteArrayInputStream(fDataBuf));
}
-
+
return new DataInputStream(new ByteArrayInputStream(new byte[0]));
}
@@ -101,34 +101,36 @@ public abstract class JdwpPacket {
public void setData(byte[] data) {
fDataBuf = data;
}
-
+
/**
* Reads header fields that are specific for a type of packet.
*/
- protected abstract int readSpecificHeaderFields(byte[] bytes, int index) throws IOException;
-
+ protected abstract int readSpecificHeaderFields(byte[] bytes, int index)
+ throws IOException;
+
/**
* Writes header fields that are specific for a type of packet.
*/
- protected abstract int writeSpecificHeaderFields(byte[] bytes, int index) throws IOException;
-
+ protected abstract int writeSpecificHeaderFields(byte[] bytes, int index)
+ throws IOException;
+
/**
* Constructs a JdwpPacket from a byte[].
*/
public static JdwpPacket build(byte[] bytes) throws IOException {
// length (int)
- int a = (bytes[0]&0xff) << 24;
- int b = (bytes[1]&0xff) << 16;
- int c = (bytes[2]&0xff) << 8;
- int d = (bytes[3]&0xff) << 0;
- int packetLength = a+b+c+d;
+ int a = (bytes[0] & 0xff) << 24;
+ int b = (bytes[1] & 0xff) << 16;
+ int c = (bytes[2] & 0xff) << 8;
+ int d = (bytes[3] & 0xff) << 0;
+ int packetLength = a + b + c + d;
// id (int)
- a = (bytes[4]&0xff) << 24;
- b = (bytes[5]&0xff) << 16;
- c = (bytes[6]&0xff) << 8;
- d = (bytes[7]&0xff) << 0;
- int id = a+b+c+d;
+ a = (bytes[4] & 0xff) << 24;
+ b = (bytes[5] & 0xff) << 16;
+ c = (bytes[6] & 0xff) << 8;
+ d = (bytes[7] & 0xff) << 0;
+ int id = a + b + c + d;
// flags (byte)
byte flags = bytes[8];
@@ -139,51 +141,52 @@ public abstract class JdwpPacket {
packet = new JdwpReplyPacket();
else
packet = new JdwpCommandPacket();
-
+
// Assign generic header fields.
packet.setId(id);
packet.setFlags(flags);
-
+
// Read specific header fields and data.
int index = 9;
index += packet.readSpecificHeaderFields(bytes, 9);
if (packetLength - MIN_PACKET_LENGTH > 0) {
packet.fDataBuf = new byte[packetLength - MIN_PACKET_LENGTH];
- System.arraycopy(bytes, index, packet.fDataBuf, 0, packet.fDataBuf.length);
+ System.arraycopy(bytes, index, packet.fDataBuf, 0,
+ packet.fDataBuf.length);
}
-
+
return packet;
}
-
+
public byte[] getPacketAsBytes() throws IOException {
- int len = getLength();
- byte[] bytes = new byte[len];
-
- //convert len to bytes
- bytes[0] = (byte) (len >>> 24);
- bytes[1] = (byte) (len >>> 16);
- bytes[2] = (byte) (len >>> 8);
- bytes[3] = (byte) (len >>> 0);
-
- //convert id to bytes
- int id = getId();
- bytes[4] = (byte) (id >>> 24);
- bytes[5] = (byte) (id >>> 16);
- bytes[6] = (byte) (id >>> 8);
- bytes[7] = (byte) (id >>> 0);
-
- //flags
- bytes[8] = getFlags();
-
- //convert specific header fields
- int index = 9;
- index += writeSpecificHeaderFields(bytes, index);
-
- if (index < len && fDataBuf!=null) {
- //copy data
- System.arraycopy(fDataBuf, 0, bytes, index, fDataBuf.length);
- }
- return bytes;
+ int len = getLength();
+ byte[] bytes = new byte[len];
+
+ // convert len to bytes
+ bytes[0] = (byte) (len >>> 24);
+ bytes[1] = (byte) (len >>> 16);
+ bytes[2] = (byte) (len >>> 8);
+ bytes[3] = (byte) (len >>> 0);
+
+ // convert id to bytes
+ int id = getId();
+ bytes[4] = (byte) (id >>> 24);
+ bytes[5] = (byte) (id >>> 16);
+ bytes[6] = (byte) (id >>> 8);
+ bytes[7] = (byte) (id >>> 0);
+
+ // flags
+ bytes[8] = getFlags();
+
+ // convert specific header fields
+ int index = 9;
+ index += writeSpecificHeaderFields(bytes, index);
+
+ if (index < len && fDataBuf != null) {
+ // copy data
+ System.arraycopy(fDataBuf, 0, bytes, index, fDataBuf.length);
+ }
+ return bytes;
}
/**
@@ -193,29 +196,30 @@ public abstract class JdwpPacket {
if (fgFlagStrings != null) {
return;
}
-
+
Field[] fields = JdwpPacket.class.getDeclaredFields();
fgFlagStrings = new String[8];
-
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
+
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
}
-
+
String name = field.getName();
if (!name.startsWith("FLAG_")) {//$NON-NLS-1$
continue;
}
-
+
name = name.substring(5);
-
+
try {
byte value = field.getByte(null);
-
+
for (int j = 0; j < fgFlagStrings.length; j++) {
if ((1 << j & value) != 0) {
- fgFlagStrings[j]= name;
+ fgFlagStrings[j] = name;
break;
}
}
@@ -228,7 +232,7 @@ public abstract class JdwpPacket {
}
}
}
-
+
/**
* @return Returns a mapping with string representations of flags.
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReferenceTypeID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReferenceTypeID.java
index 20b5436f3..c2187eba1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReferenceTypeID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReferenceTypeID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpReferenceTypeID extends JdwpID {
/**
@@ -25,10 +24,11 @@ public class JdwpReferenceTypeID extends JdwpID {
public JdwpReferenceTypeID(VirtualMachineImpl vmImpl) {
super(vmImpl);
}
-
+
/**
* @return Returns VM specific size of ID.
*/
+ @Override
public int getSize() {
return fVirtualMachine.referenceTypeIDSize();
}
@@ -36,7 +36,8 @@ public class JdwpReferenceTypeID extends JdwpID {
/**
* @return Returns true if ID is null.
*/
+ @Override
public boolean isNull() {
return fValue == VALUE_NULL;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReplyPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReplyPacket.java
index ae3f96ce4..5b4533ec6 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReplyPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpReplyPacket.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@@ -18,9 +17,9 @@ import java.util.HashMap;
import java.util.Map;
/**
- * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
- * declared by the JDWP specification.
- *
+ * This class implements the corresponding Java Debug Wire Protocol (JDWP)
+ * packet declared by the JDWP specification.
+ *
*/
public class JdwpReplyPacket extends JdwpPacket {
/** Error code constants. */
@@ -30,7 +29,7 @@ public class JdwpReplyPacket extends JdwpPacket {
public static final short INVALID_PRIORITY = 12;
public static final short THREAD_NOT_SUSPENDED = 13;
public static final short THREAD_SUSPENDED = 14;
- public static final short THREAD_NOT_ALIVE = 15;
+ public static final short THREAD_NOT_ALIVE = 15;
public static final short INVALID_OBJECT = 20;
public static final short INVALID_CLASS = 21;
public static final short CLASS_NOT_PREPARED = 22;
@@ -81,27 +80,28 @@ public class JdwpReplyPacket extends JdwpPacket {
public static final short TRANSPORT_INIT = 510;
public static final short NATIVE_METHOD = 511;
public static final short INVALID_COUNT = 512;
- public static final short HCR_OPERATION_REFUSED = 900; // HCR specific.
-
+ public static final short HCR_OPERATION_REFUSED = 900; // HCR specific.
+
/** Mapping of error codes to strings. */
- private static HashMap fErrorMap = null;
+ private static HashMap<Integer, String> fErrorMap = null;
/** JDWP Error code. */
private short fErrorCode;
+
/**
* Creates new JdwpReplyPacket.
*/
public JdwpReplyPacket() {
setFlags(FLAG_REPLY_PACKET);
}
-
+
/**
* @return Returns JDWP Error code.
*/
public short errorCode() {
return fErrorCode;
}
-
+
/**
* Assigns JDWP Error code.
*/
@@ -112,18 +112,22 @@ public class JdwpReplyPacket extends JdwpPacket {
/**
* Reads header fields that are specific for this type of packet.
*/
- protected int readSpecificHeaderFields(byte[] bytes, int index) throws IOException {
- fErrorCode = (short)(((bytes[index] & 0xFF) << 8) + ((bytes[index+1] & 0xFF) << 0));
+ @Override
+ protected int readSpecificHeaderFields(byte[] bytes, int index)
+ throws IOException {
+ fErrorCode = (short) (((bytes[index] & 0xFF) << 8) + ((bytes[index + 1] & 0xFF) << 0));
return 2;
}
/**
* Writes header fields that are specific for this type of packet.
*/
- protected int writeSpecificHeaderFields(byte[] bytes, int index) throws IOException {
- bytes[index] = (byte) ((fErrorCode >>> 8) & 0xFF);
- bytes[index+1] = (byte) ((fErrorCode >>> 0) & 0xFF);
- return 2;
+ @Override
+ protected int writeSpecificHeaderFields(byte[] bytes, int index)
+ throws IOException {
+ bytes[index] = (byte) ((fErrorCode >>> 8) & 0xFF);
+ bytes[index + 1] = (byte) ((fErrorCode >>> 0) & 0xFF);
+ return 2;
}
/**
@@ -133,14 +137,15 @@ public class JdwpReplyPacket extends JdwpPacket {
if (fErrorMap != null) {
return;
}
-
+
Field[] fields = JdwpReplyPacket.class.getDeclaredFields();
- fErrorMap = new HashMap(fields.length);
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0)
+ fErrorMap = new HashMap<Integer, String>(fields.length);
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0)
continue;
-
+
try {
Integer intValue = new Integer(field.getInt(null));
fErrorMap.put(intValue, field.getName());
@@ -157,14 +162,17 @@ public class JdwpReplyPacket extends JdwpPacket {
/**
* @return Returns a map with string representations of error codes.
*/
- public static Map errorMap() {
+ public static Map<Integer, String> errorMap() {
getConstantMaps();
return fErrorMap;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("["); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpString.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpString.java
index 77f46992e..651130374 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpString.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpString.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -19,13 +18,12 @@ import java.io.UTFDataFormatException;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpString {
/**
- * Reads String from Jdwp stream.
- * Read a UTF where length has 4 bytes, and not just 2.
- * This code was based on the OTI Retysin source for readUTF.
+ * Reads String from Jdwp stream. Read a UTF where length has 4 bytes, and
+ * not just 2. This code was based on the OTI Retysin source for readUTF.
*/
public static String read(DataInputStream in) throws IOException {
int utfSize = in.readInt();
@@ -42,7 +40,8 @@ public class JdwpString {
int b = utfBytes[i + 1] & 0xFF;
if ((a >> 4) < 14) {
if ((b & 0xBF) == 0) {
- throw new UTFDataFormatException(JDWPMessages.JdwpString_Second_byte_input_does_not_match_UTF_Specification_1);
+ throw new UTFDataFormatException(
+ JDWPMessages.JdwpString_Second_byte_input_does_not_match_UTF_Specification_1);
}
strBuffer.append((char) (((a & 0x1F) << 6) | (b & 0x3F)));
i += 2;
@@ -50,12 +49,15 @@ public class JdwpString {
int c = utfBytes[i + 2] & 0xFF;
if ((a & 0xEF) > 0) {
if (((b & 0xBF) == 0) || ((c & 0xBF) == 0)) {
- throw new UTFDataFormatException(JDWPMessages.JdwpString_Second_or_third_byte_input_does_not_mach_UTF_Specification_2);
+ throw new UTFDataFormatException(
+ JDWPMessages.JdwpString_Second_or_third_byte_input_does_not_mach_UTF_Specification_2);
}
- strBuffer.append((char) (((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)));
+ strBuffer.append((char) (((a & 0x0F) << 12)
+ | ((b & 0x3F) << 6) | (c & 0x3F)));
i += 3;
} else {
- throw new UTFDataFormatException(JDWPMessages.JdwpString_Input_does_not_match_UTF_Specification_3);
+ throw new UTFDataFormatException(
+ JDWPMessages.JdwpString_Input_does_not_match_UTF_Specification_3);
}
}
}
@@ -63,25 +65,24 @@ public class JdwpString {
return strBuffer.toString();
}
-
/**
- * Writes String to Jdwp stream.
- * Write a UTF where length has 4 bytes, and not just 2.
- * This code was based on OTI Retsin source for writeUTF.
+ * Writes String to Jdwp stream. Write a UTF where length has 4 bytes, and
+ * not just 2. This code was based on OTI Retsin source for writeUTF.
*/
- public static void write(String str, DataOutputStream out) throws IOException {
+ public static void write(String str, DataOutputStream out)
+ throws IOException {
if (str == null)
- throw new NullPointerException(JDWPMessages.JdwpString_str_is_null_4);
+ throw new NullPointerException(
+ JDWPMessages.JdwpString_str_is_null_4);
int utfCount = 0;
for (int i = 0; i < str.length(); i++) {
int charValue = str.charAt(i);
if (charValue > 0 && charValue <= 127)
utfCount += 1;
+ else if (charValue <= 2047)
+ utfCount += 2;
else
- if (charValue <= 2047)
- utfCount += 2;
- else
- utfCount += 3;
+ utfCount += 3;
}
byte utfBytes[] = new byte[utfCount];
int utfIndex = 0;
@@ -89,15 +90,14 @@ public class JdwpString {
int charValue = str.charAt(i);
if (charValue > 0 && charValue <= 127)
utfBytes[utfIndex++] = (byte) charValue;
- else
- if (charValue <= 2047) {
- utfBytes[utfIndex++] = (byte) (0xc0 | (0x1f & (charValue >> 6)));
- utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & charValue));
- } else {
- utfBytes[utfIndex++] = (byte) (0xe0 | (0x0f & (charValue >> 12)));
- utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & (charValue >> 6)));
- utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & charValue));
- }
+ else if (charValue <= 2047) {
+ utfBytes[utfIndex++] = (byte) (0xc0 | (0x1f & (charValue >> 6)));
+ utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & charValue));
+ } else {
+ utfBytes[utfIndex++] = (byte) (0xe0 | (0x0f & (charValue >> 12)));
+ utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & (charValue >> 6)));
+ utfBytes[utfIndex++] = (byte) (0x80 | (0x3f & charValue));
+ }
}
out.writeInt(utfCount);
if (utfCount > 0)
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpStringID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpStringID.java
index 3500e397a..b4667cfa1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpStringID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpStringID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpStringID extends JdwpObjectID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadGroupID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadGroupID.java
index c911d048b..ccb6dcebd 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadGroupID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadGroupID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpThreadGroupID extends JdwpObjectID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadID.java
index 50cb76327..613d91482 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/jdwp/JdwpThreadID.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdi.internal.jdwp;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
/**
* This class implements the corresponding Java Debug Wire Protocol (JDWP) ID
* declared by the JDWP specification.
- *
+ *
*/
public class JdwpThreadID extends JdwpObjectID {
/**
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/AccessWatchpointRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/AccessWatchpointRequestImpl.java
index 7b3137110..6adff9b4f 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/AccessWatchpointRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/AccessWatchpointRequestImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,21 +10,21 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.AccessWatchpointEventImpl;
import com.sun.jdi.request.AccessWatchpointRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class AccessWatchpointRequestImpl extends WatchpointRequestImpl implements AccessWatchpointRequest {
+public class AccessWatchpointRequestImpl extends WatchpointRequestImpl
+ implements AccessWatchpointRequest {
/**
* Creates new AccessWatchpointRequest.
+ * @param vmImpl the VM
*/
public AccessWatchpointRequestImpl(VirtualMachineImpl vmImpl) {
super("AccessWatchpointRequest", vmImpl); //$NON-NLS-1$
@@ -33,6 +33,7 @@ public class AccessWatchpointRequestImpl extends WatchpointRequestImpl implement
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return AccessWatchpointEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/BreakpointRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/BreakpointRequestImpl.java
index a046d546a..20e81979e 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/BreakpointRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/BreakpointRequestImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.BreakpointEventImpl;
@@ -19,14 +18,15 @@ import com.sun.jdi.Location;
import com.sun.jdi.request.BreakpointRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class BreakpointRequestImpl extends EventRequestImpl implements BreakpointRequest, Locatable {
+public class BreakpointRequestImpl extends EventRequestImpl implements
+ BreakpointRequest, Locatable {
/**
* Creates new BreakpointRequest.
+ * @param vmImpl the VM
*/
public BreakpointRequestImpl(VirtualMachineImpl vmImpl) {
super("BreakpointRequest", vmImpl); //$NON-NLS-1$
@@ -36,12 +36,13 @@ public class BreakpointRequestImpl extends EventRequestImpl implements Breakpoin
* @return Returns location of Breakpoint Request.
*/
public Location location() {
- return (Location)fLocationFilters.get(0);
+ return fLocationFilters.get(0);
}
-
+
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return BreakpointEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassPrepareRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassPrepareRequestImpl.java
index 8cdc4c8b6..668eac1b2 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassPrepareRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassPrepareRequestImpl.java
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.ClassPrepareEventImpl;
import com.sun.jdi.request.ClassPrepareRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ClassPrepareRequestImpl extends EventRequestImpl implements ClassPrepareRequest {
+public class ClassPrepareRequestImpl extends EventRequestImpl implements
+ ClassPrepareRequest {
/**
* Creates new ClassPrepareRequest.
*/
@@ -33,8 +32,9 @@ public class ClassPrepareRequestImpl extends EventRequestImpl implements ClassPr
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return ClassPrepareEventImpl.EVENT_KIND;
}
-
+
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassUnloadRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassUnloadRequestImpl.java
index e78a559c7..a3f1e4ef1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassUnloadRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ClassUnloadRequestImpl.java
@@ -10,29 +10,29 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.ClassUnloadEventImpl;
import com.sun.jdi.request.ClassUnloadRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ClassUnloadRequestImpl extends EventRequestImpl implements ClassUnloadRequest {
+public class ClassUnloadRequestImpl extends EventRequestImpl implements
+ ClassUnloadRequest {
/**
* Creates new ClassUnloadRequest.
*/
public ClassUnloadRequestImpl(VirtualMachineImpl vmImpl) {
super("ClassUnloadRequest", vmImpl); //$NON-NLS-1$
}
-
+
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return ClassUnloadEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestImpl.java
index 9a201922f..151eef488 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestImpl.java
@@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@@ -40,21 +40,22 @@ import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.InvalidRequestStateException;
import com.sun.jdi.request.StepRequest;
-
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public abstract class EventRequestImpl extends MirrorImpl implements EventRequest {
+public abstract class EventRequestImpl extends MirrorImpl implements
+ EventRequest {
/** Jdwp constants for StepRequests. */
public static final byte STEP_SIZE_MIN_JDWP = 0;
public static final byte STEP_SIZE_LINE_JDWP = 1;
public static final byte STEP_DEPTH_INTO_JDWP = 0;
public static final byte STEP_DEPTH_OVER_JDWP = 1;
public static final byte STEP_DEPTH_OUT_JDWP = 2;
- public static final byte STEP_DEPTH_REENTER_JDWP_HCR = 3; // OTI specific for Hot Code Replacement.
+ public static final byte STEP_DEPTH_REENTER_JDWP_HCR = 3; // OTI specific
+ // for Hot Code
+ // Replacement.
/** Jdwp constants for SuspendPolicy. */
public static final byte SUSPENDPOL_NONE_JDWP = 0;
@@ -74,61 +75,72 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
public static final byte MODIF_KIND_STEP = 10;
public static final byte MODIF_KIND_INSTANCE = 11;
public static final byte MODIF_KIND_SOURCE_NAME_FILTER = 12;
-
+
/** Mapping of command codes to strings. */
- private static HashMap fStepSizeMap = null;
- private static HashMap fStepDepthMap = null;
- private static HashMap fSuspendPolicyMap = null;
- private static HashMap fModifierKindMap = null;
+ private static HashMap<Integer, String> fStepSizeMap = null;
+ private static HashMap<Integer, String> fStepDepthMap = null;
+ private static HashMap<Integer, String> fSuspendPolicyMap = null;
+ private static HashMap<Integer, String> fModifierKindMap = null;
- /** Flag that indicates the request was generated from inside of this JDI implementation. */
+ /**
+ * Flag that indicates the request was generated from inside of this JDI
+ * implementation.
+ */
private boolean fGeneratedInside = false;
-
+
/** User property map. */
- private HashMap fPropertyMap;
-
- /** RequestId of EventRequest, assigned by the reply data of the JDWP Event Reuqest Set command, null if request had not yet been enabled. */
+ private HashMap<Object, Object> fPropertyMap;
+
+ /**
+ * RequestId of EventRequest, assigned by the reply data of the JDWP Event
+ * Reuqest Set command, null if request had not yet been enabled.
+ */
protected RequestID fRequestID = null;
- /** Determines the threads to suspend when the requested event occurs in the target VM. */
- private byte fSuspendPolicy = SUSPEND_ALL; // Default is as specified by JDI spec.
-
+ /**
+ * Determines the threads to suspend when the requested event occurs in the
+ * target VM.
+ */
+ private byte fSuspendPolicy = SUSPEND_ALL; // Default is as specified by JDI
+ // spec.
+
/**
* Modifiers.
- */
+ */
/** Count filters. */
- protected ArrayList fCountFilters;
-
+ protected ArrayList<Integer> fCountFilters;
+
/** Thread filters. */
- protected ArrayList fThreadFilters = null;
-
+ protected ArrayList<ThreadReference> fThreadFilters = null;
+
/** Class filters. */
- protected ArrayList fClassFilters = null;
-
+ protected ArrayList<String> fClassFilters = null;
+
/** Class filters. */
- protected ArrayList fClassFilterRefs = null;
-
+ protected ArrayList<ReferenceType> fClassFilterRefs = null;
+
/** Class Exclusion filters. */
- protected ArrayList fClassExclusionFilters = null;
-
+ protected ArrayList<String> fClassExclusionFilters = null;
+
/** Location filters. */
- protected ArrayList fLocationFilters = null;
-
+ protected ArrayList<LocationImpl> fLocationFilters = null;
+
/** Exception filters. */
- protected ArrayList fExceptionFilters = null;
-
+ protected ArrayList<ExceptionFilter> fExceptionFilters = null;
+
/** Field filters. */
- protected ArrayList fFieldFilters = null;
-
+ protected ArrayList<FieldImpl> fFieldFilters = null;
+
/** Thread step filters. */
- protected ArrayList fThreadStepFilters = null;
-
+ protected ArrayList<ThreadStepFilter> fThreadStepFilters = null;
+
/** Instance filters. */
- protected ArrayList fInstanceFilters = null;
- /**
+ protected ArrayList<ObjectReference> fInstanceFilters = null;
+ /**
* source name filters
+ *
* @since 3.3
*/
- protected ArrayList fSourceNameFilters = null;
+ protected ArrayList<String> fSourceNameFilters = null;
/**
* Creates new EventRequest.
@@ -136,14 +148,17 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
protected EventRequestImpl(String description, VirtualMachineImpl vmImpl) {
super(description, vmImpl);
}
-
+
/**
* @return Returns string representation.
*/
+ @Override
public String toString() {
- return super.toString() + (fRequestID == null ? RequestMessages.EventRequestImpl___not_enabled__1 : RequestMessages.EventRequestImpl____2 + fRequestID); //
+ return super.toString()
+ + (fRequestID == null ? RequestMessages.EventRequestImpl___not_enabled__1
+ : RequestMessages.EventRequestImpl____2 + fRequestID); //
}
-
+
/**
* @return Returns the value of the property with the specified key.
*/
@@ -151,32 +166,34 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
if (fPropertyMap == null) {
return null;
}
-
+
return fPropertyMap.get(key);
}
-
+
/**
* Add an arbitrary key/value "property" to this request.
*/
public void putProperty(Object key, Object value) {
if (fPropertyMap == null)
- fPropertyMap = new HashMap();
-
+ fPropertyMap = new HashMap<Object, Object>();
+
if (value == null)
fPropertyMap.remove(key);
else
fPropertyMap.put(key, value);
}
-
+
/**
- * Sets the generated inside flag. Used for requests that are not generated by JDI requests from outside.
+ * Sets the generated inside flag. Used for requests that are not generated
+ * by JDI requests from outside.
*/
public void setGeneratedInside() {
fGeneratedInside = true;
}
-
+
/**
- * @return Returns whether the event request was generated from inside of this JDI implementation.
+ * @return Returns whether the event request was generated from inside of
+ * this JDI implementation.
*/
public final boolean isGeneratedInside() {
return fGeneratedInside;
@@ -188,22 +205,25 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
public synchronized void disable() {
if (!isEnabled())
return;
-
+
initJdwpRequest();
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
- writeByte(eventKind(), "event kind", EventImpl.eventKindMap(), outData); //$NON-NLS-1$
+ writeByte(eventKind(),
+ "event kind", EventImpl.eventKindMap(), outData); //$NON-NLS-1$
fRequestID.write(this, outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.ER_CLEAR, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.ER_CLEAR,
+ outBytes);
switch (replyPacket.errorCode()) {
- case JdwpReplyPacket.NOT_FOUND:
- throw new InvalidRequestStateException();
+ case JdwpReplyPacket.NOT_FOUND:
+ throw new InvalidRequestStateException();
}
defaultReplyErrorHandler(replyPacket.errorCode());
-
- virtualMachineImpl().eventRequestManagerImpl().removeRequestIDMapping(this);
+
+ virtualMachineImpl().eventRequestManagerImpl()
+ .removeRequestIDMapping(this);
fRequestID = null;
} catch (IOException e) {
defaultIOExceptionHandler(e);
@@ -211,7 +231,7 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
handledJdwpRequest();
}
}
-
+
/**
* Enables event request.
*/
@@ -223,16 +243,21 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
- writeByte(eventKind(), "event kind", EventImpl.eventKindMap(), outData); //$NON-NLS-1$
- writeByte(suspendPolicyJDWP(), "suspend policy", EventRequestImpl.suspendPolicyMap(), outData); //$NON-NLS-1$
+ writeByte(eventKind(),
+ "event kind", EventImpl.eventKindMap(), outData); //$NON-NLS-1$
+ writeByte(
+ suspendPolicyJDWP(),
+ "suspend policy", EventRequestImpl.suspendPolicyMap(), outData); //$NON-NLS-1$
writeInt(modifierCount(), "modifiers", outData); //$NON-NLS-1$
writeModifiers(outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.ER_SET, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.ER_SET,
+ outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
fRequestID = RequestID.read(this, replyData);
- virtualMachineImpl().eventRequestManagerImpl().addRequestIDMapping(this);
+ virtualMachineImpl().eventRequestManagerImpl().addRequestIDMapping(
+ this);
} catch (IOException e) {
defaultIOExceptionHandler(e);
} finally {
@@ -246,7 +271,8 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
public static void clearAllBreakpoints(MirrorImpl mirror) {
mirror.initJdwpRequest();
try {
- JdwpReplyPacket replyPacket = mirror.requestVM(JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS);
+ JdwpReplyPacket replyPacket = mirror
+ .requestVM(JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS);
mirror.defaultReplyErrorHandler(replyPacket.errorCode());
} finally {
mirror.handledJdwpRequest();
@@ -271,18 +297,19 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
}
/**
- * @exception InvalidRequestStateException is thrown if this request is enabled.
+ * @exception InvalidRequestStateException
+ * is thrown if this request is enabled.
*/
public void checkDisabled() throws InvalidRequestStateException {
if (isEnabled())
throw new InvalidRequestStateException();
}
-
+
/**
* Sets suspend policy.
*/
public void setSuspendPolicy(int suspendPolicy) {
- fSuspendPolicy = (byte)suspendPolicy;
+ fSuspendPolicy = (byte) suspendPolicy;
if (isEnabled()) {
disable();
enable();
@@ -302,91 +329,105 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
public final RequestID requestID() {
return fRequestID;
}
-
+
/**
* Sets countfilter.
*/
public void addCountFilter(int count) throws InvalidRequestStateException {
checkDisabled();
if (fCountFilters == null)
- fCountFilters = new ArrayList();
-
+ fCountFilters = new ArrayList<Integer>();
+
fCountFilters.add(new Integer(count));
}
-
+
/**
* Restricts reported events to those in the given thread.
*/
- public void addThreadFilter(ThreadReference threadFilter) throws ObjectCollectedException, VMMismatchException, InvalidRequestStateException {
+ public void addThreadFilter(ThreadReference threadFilter)
+ throws ObjectCollectedException, VMMismatchException,
+ InvalidRequestStateException {
checkVM(threadFilter);
checkDisabled();
if (threadFilter.isCollected())
throw new ObjectCollectedException();
if (fThreadFilters == null)
- fThreadFilters = new ArrayList();
-
+ fThreadFilters = new ArrayList<ThreadReference>();
+
fThreadFilters.add(threadFilter);
}
/**
- * Restricts the events generated by this request to the preparation of reference types whose name matches this restricted regular expression.
+ * Restricts the events generated by this request to the preparation of
+ * reference types whose name matches this restricted regular expression.
*/
- public void addClassFilter(ReferenceType filter) throws VMMismatchException, InvalidRequestStateException {
+ public void addClassFilter(ReferenceType filter)
+ throws VMMismatchException, InvalidRequestStateException {
checkVM(filter);
checkDisabled();
if (fClassFilterRefs == null)
- fClassFilterRefs = new ArrayList();
-
+ fClassFilterRefs = new ArrayList<ReferenceType>();
+
fClassFilterRefs.add(filter);
}
-
+
/**
- * Restricts the events generated by this request to be the preparation of the given reference type and any subtypes.
+ * Restricts the events generated by this request to be the preparation of
+ * the given reference type and any subtypes.
*/
- public void addClassFilter(String filter) throws InvalidRequestStateException {
+ public void addClassFilter(String filter)
+ throws InvalidRequestStateException {
checkDisabled();
if (fClassFilters == null)
- fClassFilters = new ArrayList();
-
+ fClassFilters = new ArrayList<String>();
+
fClassFilters.add(filter);
}
-
+
/**
- * Restricts the events generated by this request to the preparation of reference types whose name does not match this restricted regular expression.
+ * Restricts the events generated by this request to the preparation of
+ * reference types whose name does not match this restricted regular
+ * expression.
*/
- public void addClassExclusionFilter(String filter) throws InvalidRequestStateException {
+ public void addClassExclusionFilter(String filter)
+ throws InvalidRequestStateException {
checkDisabled();
if (fClassExclusionFilters == null)
- fClassExclusionFilters = new ArrayList();
-
+ fClassExclusionFilters = new ArrayList<String>();
+
fClassExclusionFilters.add(filter);
}
- /**
- * Restricts the events generated by this request to those that occur at the given location.
+ /**
+ * Restricts the events generated by this request to those that occur at the
+ * given location.
*/
- public void addLocationFilter(LocationImpl location) throws VMMismatchException {
+ public void addLocationFilter(LocationImpl location)
+ throws VMMismatchException {
checkDisabled();
// Used in createBreakpointRequest.
checkVM(location);
if (fLocationFilters == null)
- fLocationFilters = new ArrayList();
-
+ fLocationFilters = new ArrayList<LocationImpl>();
+
fLocationFilters.add(location);
}
-
- /**
- * Restricts reported exceptions by their class and whether they are caught or uncaught.
+
+ /**
+ * Restricts reported exceptions by their class and whether they are caught
+ * or uncaught.
*/
- public void addExceptionFilter(ReferenceTypeImpl refType, boolean notifyCaught, boolean notifyUncaught) throws VMMismatchException {
- checkDisabled();
+ public void addExceptionFilter(ReferenceTypeImpl refType,
+ boolean notifyCaught, boolean notifyUncaught)
+ throws VMMismatchException {
+ checkDisabled();
// refType Null means report exceptions of all types.
if (refType != null)
checkVM(refType);
-
+
if (fExceptionFilters == null)
- fExceptionFilters = new ArrayList();
-
+ fExceptionFilters = new ArrayList<ExceptionFilter>();
+
ExceptionFilter filter = new ExceptionFilter();
filter.fException = refType;
filter.fNotifyCaught = notifyCaught;
@@ -394,65 +435,70 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
fExceptionFilters.add(filter);
}
- /**
- * Restricts reported events to those that occur for a given field.
+ /**
+ * Restricts reported events to those that occur for a given field.
*/
- public void addFieldFilter(FieldImpl field) throws VMMismatchException {
- checkDisabled();
+ public void addFieldFilter(FieldImpl field) throws VMMismatchException {
+ checkDisabled();
// Used in createXWatchpointRequest methods.
checkVM(field);
if (fFieldFilters == null)
- fFieldFilters = new ArrayList();
-
+ fFieldFilters = new ArrayList<FieldImpl>();
+
fFieldFilters.add(field);
}
- /**
- * Restricts reported step events to those which satisfy depth and size constraints.
+ /**
+ * Restricts reported step events to those which satisfy depth and size
+ * constraints.
*/
- public void addStepFilter(ThreadReferenceImpl thread, int size, int depth) throws VMMismatchException {
- checkDisabled();
+ public void addStepFilter(ThreadReferenceImpl thread, int size, int depth)
+ throws VMMismatchException {
+ checkDisabled();
// Used in createStepRequest.
- checkVM(thread);
-
+ checkVM(thread);
+
if (fThreadStepFilters == null)
- fThreadStepFilters = new ArrayList();
-
+ fThreadStepFilters = new ArrayList<ThreadStepFilter>();
+
ThreadStepFilter filter = new ThreadStepFilter();
- filter.fThread = thread;
- filter.fThreadStepSize = size;
- filter.fThreadStepDepth = depth;
- fThreadStepFilters.add(filter);
- }
-
- /**
- * Helper method which allows instance filters to be added
- * @param instance the object ref instance to add to the listing
- */
- public void addInstanceFilter(ObjectReference instance) {
- checkDisabled();
- checkVM(instance);
- if (fInstanceFilters == null) {
- fInstanceFilters = new ArrayList();
- }
- fInstanceFilters.add(instance);
- }
-
- /**
- * Adds a source name filter to the request. An exact match or pattern beginning
- * OR ending in '*'.
- *
- * @param pattern source name pattern
- * @since 3.3
- */
- public void addSourceNameFilter(String pattern) {
- checkDisabled();
- if(fSourceNameFilters == null) {
- fSourceNameFilters = new ArrayList();
- }
- fSourceNameFilters.add(pattern);
- }
-
+ filter.fThread = thread;
+ filter.fThreadStepSize = size;
+ filter.fThreadStepDepth = depth;
+ fThreadStepFilters.add(filter);
+ }
+
+ /**
+ * Helper method which allows instance filters to be added
+ *
+ * @param instance
+ * the object ref instance to add to the listing
+ */
+ public void addInstanceFilter(ObjectReference instance) {
+ checkDisabled();
+ checkVM(instance);
+ if (fInstanceFilters == null) {
+ fInstanceFilters = new ArrayList<ObjectReference>();
+ }
+ fInstanceFilters.add(instance);
+ }
+
+ /**
+ * Adds a source name filter to the request. An exact match or pattern
+ * beginning OR ending in '*'.
+ *
+ * @param pattern
+ * source name pattern
+ * @since 3.3
+ */
+ public void addSourceNameFilter(String pattern) {
+ checkDisabled();
+ if (fSourceNameFilters == null) {
+ fSourceNameFilters = new ArrayList<String>();
+ }
+ fSourceNameFilters.add(pattern);
+ }
+
/**
* From here on JDWP functionality of EventRequest is implemented.
*/
@@ -462,14 +508,16 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
*/
public byte suspendPolicyJDWP() {
switch (fSuspendPolicy) {
- case SUSPEND_NONE:
- return SUSPENDPOL_NONE_JDWP;
- case SUSPEND_EVENT_THREAD:
- return SUSPENDPOL_EVENT_THREAD_JDWP;
- case SUSPEND_ALL:
- return SUSPENDPOL_ALL_JDWP;
- default:
- throw new InternalException(RequestMessages.EventRequestImpl_Invalid_suspend_policy_encountered___3 + fSuspendPolicy);
+ case SUSPEND_NONE:
+ return SUSPENDPOL_NONE_JDWP;
+ case SUSPEND_EVENT_THREAD:
+ return SUSPENDPOL_EVENT_THREAD_JDWP;
+ case SUSPEND_ALL:
+ return SUSPENDPOL_ALL_JDWP;
+ default:
+ throw new InternalException(
+ RequestMessages.EventRequestImpl_Invalid_suspend_policy_encountered___3
+ + fSuspendPolicy);
}
}
@@ -478,28 +526,32 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
*/
public int threadStepSizeJDWP(int threadStepSize) {
switch (threadStepSize) {
- case StepRequest.STEP_MIN:
- return STEP_SIZE_MIN_JDWP;
- case StepRequest.STEP_LINE:
- return STEP_SIZE_LINE_JDWP;
- default:
- throw new InternalException(RequestMessages.EventRequestImpl_Invalid_step_size_encountered___4 + threadStepSize);
+ case StepRequest.STEP_MIN:
+ return STEP_SIZE_MIN_JDWP;
+ case StepRequest.STEP_LINE:
+ return STEP_SIZE_LINE_JDWP;
+ default:
+ throw new InternalException(
+ RequestMessages.EventRequestImpl_Invalid_step_size_encountered___4
+ + threadStepSize);
}
}
-
+
/**
* @return Returns JDWP constant for step depth.
*/
public int threadStepDepthJDWP(int threadStepDepth) {
switch (threadStepDepth) {
- case StepRequest.STEP_INTO:
- return STEP_DEPTH_INTO_JDWP;
- case StepRequest.STEP_OVER:
- return STEP_DEPTH_OVER_JDWP;
- case StepRequest.STEP_OUT:
- return STEP_DEPTH_OUT_JDWP;
- default:
- throw new InternalException(RequestMessages.EventRequestImpl_Invalid_step_depth_encountered___5 + threadStepDepth);
+ case StepRequest.STEP_INTO:
+ return STEP_DEPTH_INTO_JDWP;
+ case StepRequest.STEP_OVER:
+ return STEP_DEPTH_OVER_JDWP;
+ case StepRequest.STEP_OUT:
+ return STEP_DEPTH_OUT_JDWP;
+ default:
+ throw new InternalException(
+ RequestMessages.EventRequestImpl_Invalid_step_depth_encountered___5
+ + threadStepDepth);
}
}
@@ -512,8 +564,8 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
* @return Returns number of modifiers.
*/
protected int modifierCount() {
- int count = 0;
-
+ int count = 0;
+
if (fCountFilters != null)
count += fCountFilters.size();
if (fThreadFilters != null)
@@ -534,7 +586,7 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
count += fThreadStepFilters.size();
if (fInstanceFilters != null)
count += fInstanceFilters.size();
- if(fSourceNameFilters != null) {
+ if (fSourceNameFilters != null) {
if (supportsSourceNameFilters()) {
count += fSourceNameFilters.size();
}
@@ -546,83 +598,107 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
* Writes JDWP bytestream representation of modifiers.
*/
protected void writeModifiers(DataOutputStream outData) throws IOException {
- // Note: for some reason the order of these modifiers matters when communicating with SUN's VM.
+ // Note: for some reason the order of these modifiers matters when
+ // communicating with SUN's VM.
// It seems to expect them 'the wrong way around'.
if (fThreadStepFilters != null) {
for (int i = 0; i < fThreadStepFilters.size(); i++) {
- ThreadStepFilter filter = (ThreadStepFilter)fThreadStepFilters.get(i);
- writeByte(MODIF_KIND_STEP, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ ThreadStepFilter filter = fThreadStepFilters
+ .get(i);
+ writeByte(MODIF_KIND_STEP,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
filter.fThread.write(this, outData);
- writeInt(threadStepSizeJDWP(filter.fThreadStepSize), "step size", outData); //$NON-NLS-1$
- writeInt(threadStepDepthJDWP(filter.fThreadStepDepth), "step depth", outData); //$NON-NLS-1$
+ writeInt(threadStepSizeJDWP(filter.fThreadStepSize),
+ "step size", outData); //$NON-NLS-1$
+ writeInt(threadStepDepthJDWP(filter.fThreadStepDepth),
+ "step depth", outData); //$NON-NLS-1$
}
}
if (fFieldFilters != null) {
for (int i = 0; i < fFieldFilters.size(); i++) {
- writeByte(MODIF_KIND_FIELDONLY, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- ((FieldImpl)fFieldFilters.get(i)).writeWithReferenceType(this, outData);
+ writeByte(MODIF_KIND_FIELDONLY,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ fFieldFilters.get(i).writeWithReferenceType(this,
+ outData);
}
}
if (fExceptionFilters != null) {
for (int i = 0; i < fExceptionFilters.size(); i++) {
- ExceptionFilter filter = (ExceptionFilter)fExceptionFilters.get(i);
- writeByte(MODIF_KIND_EXCEPTIONONLY, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ ExceptionFilter filter = fExceptionFilters
+ .get(i);
+ writeByte(MODIF_KIND_EXCEPTIONONLY,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
if (filter.fException != null)
filter.fException.write(this, outData);
else
ReferenceTypeImpl.writeNull(this, outData);
-
+
writeBoolean(filter.fNotifyCaught, "notify caught", outData); //$NON-NLS-1$
writeBoolean(filter.fNotifyUncaught, "notify uncaught", outData); //$NON-NLS-1$
}
}
if (fLocationFilters != null) {
for (int i = 0; i < fLocationFilters.size(); i++) {
- writeByte(MODIF_KIND_LOCATIONONLY, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- ((LocationImpl)fLocationFilters.get(i)).write(this, outData);
+ writeByte(MODIF_KIND_LOCATIONONLY,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ fLocationFilters.get(i).write(this, outData);
}
}
if (fClassExclusionFilters != null) {
for (int i = 0; i < fClassExclusionFilters.size(); i++) {
- writeByte(MODIF_KIND_CLASSEXCLUDE, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- writeString((String)fClassExclusionFilters.get(i), "class excl. filter", outData); //$NON-NLS-1$
+ writeByte(MODIF_KIND_CLASSEXCLUDE,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ writeString(fClassExclusionFilters.get(i),
+ "class excl. filter", outData); //$NON-NLS-1$
}
}
if (fClassFilters != null) {
for (int i = 0; i < fClassFilters.size(); i++) {
- writeByte(MODIF_KIND_CLASSMATCH, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- writeString((String)fClassFilters.get(i), "class filter", outData); //$NON-NLS-1$
+ writeByte(MODIF_KIND_CLASSMATCH,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ writeString(fClassFilters.get(i),
+ "class filter", outData); //$NON-NLS-1$
}
}
if (fClassFilterRefs != null) {
for (int i = 0; i < fClassFilterRefs.size(); i++) {
- writeByte(MODIF_KIND_CLASSONLY, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- ((ReferenceTypeImpl)fClassFilterRefs.get(i)).write(this, outData);
+ writeByte(MODIF_KIND_CLASSONLY,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ ((ReferenceTypeImpl) fClassFilterRefs.get(i)).write(this,
+ outData);
}
}
if (fThreadFilters != null) {
for (int i = 0; i < fThreadFilters.size(); i++) {
- writeByte(MODIF_KIND_THREADONLY, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- ((ThreadReferenceImpl)fThreadFilters.get(i)).write(this, outData);
+ writeByte(MODIF_KIND_THREADONLY,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ ((ThreadReferenceImpl) fThreadFilters.get(i)).write(this,
+ outData);
}
}
if (fCountFilters != null) {
for (int i = 0; i < fCountFilters.size(); i++) {
- writeByte(MODIF_KIND_COUNT, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- writeInt(((Integer)fCountFilters.get(i)).intValue(), "count filter", outData); //$NON-NLS-1$
+ writeByte(MODIF_KIND_COUNT,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ writeInt(fCountFilters.get(i).intValue(),
+ "count filter", outData); //$NON-NLS-1$
}
}
if (fInstanceFilters != null) {
for (int i = 0; i < fInstanceFilters.size(); i++) {
- writeByte(MODIF_KIND_INSTANCE, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- ((ObjectReferenceImpl)fInstanceFilters.get(i)).write(this, outData);
+ writeByte(MODIF_KIND_INSTANCE,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ ((ObjectReferenceImpl) fInstanceFilters.get(i)).write(this,
+ outData);
}
}
- if(fSourceNameFilters != null) {
+ if (fSourceNameFilters != null) {
if (supportsSourceNameFilters()) {
for (int i = 0; i < fSourceNameFilters.size(); i++) {
- writeByte(MODIF_KIND_SOURCE_NAME_FILTER, "modifier", modifierKindMap(), outData); //$NON-NLS-1$
- writeString((String)fSourceNameFilters.get(i), "modifier", outData); //$NON-NLS-1$
+ writeByte(MODIF_KIND_SOURCE_NAME_FILTER,
+ "modifier", modifierKindMap(), outData); //$NON-NLS-1$
+ writeString(fSourceNameFilters.get(i),
+ "modifier", outData); //$NON-NLS-1$
}
}
}
@@ -634,7 +710,8 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
* @return whether JDWP supports source name filters
*/
private boolean supportsSourceNameFilters() {
- return ((VirtualMachineImpl)virtualMachine()).isJdwpVersionGreaterOrEqual(1, 6);
+ return ((VirtualMachineImpl) virtualMachine())
+ .isJdwpVersionGreaterOrEqual(1, 6);
}
/**
@@ -643,17 +720,19 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
public static void getConstantMaps() {
if (fStepSizeMap != null)
return;
-
- java.lang.reflect.Field[] fields = EventRequestImpl.class.getDeclaredFields();
- fStepSizeMap = new HashMap();
- fStepDepthMap = new HashMap();
- fSuspendPolicyMap = new HashMap();
- fModifierKindMap = new HashMap();
- for (int i = 0; i < fields.length; i++) {
- java.lang.reflect.Field field = fields[i];
- if ((field.getModifiers() & java.lang.reflect.Modifier.PUBLIC) == 0 || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0 || (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0)
+
+ java.lang.reflect.Field[] fields = EventRequestImpl.class
+ .getDeclaredFields();
+ fStepSizeMap = new HashMap<Integer, String>();
+ fStepDepthMap = new HashMap<Integer, String>();
+ fSuspendPolicyMap = new HashMap<Integer, String>();
+ fModifierKindMap = new HashMap<Integer, String>();
+ for (Field field : fields) {
+ if ((field.getModifiers() & java.lang.reflect.Modifier.PUBLIC) == 0
+ || (field.getModifiers() & java.lang.reflect.Modifier.STATIC) == 0
+ || (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0)
continue;
-
+
try {
String name = field.getName();
Integer intValue = new Integer(field.getInt(null));
@@ -679,48 +758,51 @@ public abstract class EventRequestImpl extends MirrorImpl implements EventReques
}
}
}
-
+
/**
* @return Returns a map with string representations of tags.
*/
- public static Map stepSizeMap() {
- getConstantMaps();
- return fStepSizeMap;
- }
+ public static Map<Integer, String> stepSizeMap() {
+ getConstantMaps();
+ return fStepSizeMap;
+ }
/**
* @return Returns a map with string representations of tags.
*/
- public static Map stepDepthMap() {
- getConstantMaps();
- return fStepDepthMap;
- }
+ public static Map<Integer, String> stepDepthMap() {
+ getConstantMaps();
+ return fStepDepthMap;
+ }
/**
* @return Returns a map with string representations of type tags.
*/
- public static Map suspendPolicyMap() {
- getConstantMaps();
- return fSuspendPolicyMap;
- }
-
+ public static Map<Integer, String> suspendPolicyMap() {
+ getConstantMaps();
+ return fSuspendPolicyMap;
+ }
+
/**
* @return Returns a map with string representations of type tags.
*/
- public static Map modifierKindMap() {
- getConstantMaps();
- return fModifierKindMap;
- }
+ public static Map<Integer, String> modifierKindMap() {
+ getConstantMaps();
+ return fModifierKindMap;
+ }
class ExceptionFilter {
- /** If non-null, specifies that exceptions which are instances of fExceptionFilterRef will be reported. */
+ /**
+ * If non-null, specifies that exceptions which are instances of
+ * fExceptionFilterRef will be reported.
+ */
ReferenceTypeImpl fException = null;
/** If true, caught exceptions will be reported. */
boolean fNotifyCaught = false;
/** If true, uncaught exceptions will be reported. */
boolean fNotifyUncaught = false;
}
-
+
class ThreadStepFilter {
/** ThreadReference of thread in which to step. */
protected ThreadReferenceImpl fThread = null;
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestManagerImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestManagerImpl.java
index e85e1dd6a..c3a48617b 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestManagerImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/EventRequestManagerImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,10 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import java.util.ArrayList;
-import java.util.Enumeration;
+import java.util.Collection;
+import java.util.HashMap;
import java.util.HashSet;
-import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
@@ -71,250 +70,258 @@ import com.sun.jdi.request.ThreadStartRequest;
import com.sun.jdi.request.VMDeathRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class EventRequestManagerImpl extends MirrorImpl implements EventRequestManager, org.eclipse.jdi.hcr.EventRequestManager {
- /** Indexes used in arrays of request types. */
- private static final int ACCESS_WATCHPOINT_INDEX = 0;
- private static final int BREAKPOINT_INDEX = 1;
- private static final int CLASS_PREPARE_INDEX = 2;
- private static final int CLASS_UNLOAD_INDEX = 3;
- private static final int EXCEPTION_INDEX = 4;
- private static final int METHOD_ENTRY_INDEX = 5;
- private static final int METHOD_EXIT_INDEX = 6;
- private static final int MODIFICATION_WATCHPOINT_INDEX = 7;
- private static final int STEP_INDEX = 8;
- private static final int THREAD_DEATH_INDEX = 9;
- private static final int THREAD_START_INDEX = 10;
- private static final int VM_DEATH_INDEX = 11;
- private static final int MONITOR_CONTENDED_ENTERED_INDEX = 12;
- private static final int MONITOR_CONTENDED_ENTER_INDEX = 13;
- private static final int MONITOR_WAITED_INDEX = 14;
- private static final int MONITOR_WAIT_INDEX = 15;
-
- /** Set of all existing requests per request type. */
- private HashSet[] fRequests;
-
- /** Maps per request type of requestIDs to enabled requests. */
- private Hashtable[] fEnabledRequests;
+ private final HashSet<AccessWatchpointRequest> accesswpReqs = new HashSet<AccessWatchpointRequest>(8);
+ private final HashSet<BreakpointRequest> bpReqs = new HashSet<BreakpointRequest>(8);
+ private final HashSet<ClassPrepareRequest> cpReqs = new HashSet<ClassPrepareRequest>(8);
+ private final HashSet<ClassUnloadRequest> cuReqs = new HashSet<ClassUnloadRequest>(8);
+ private final HashSet<ExceptionRequest> exReqs = new HashSet<ExceptionRequest>(8);
+ private final HashSet<MethodEntryRequest> menReqs = new HashSet<MethodEntryRequest>(8);
+ private final HashSet<MethodExitRequest> mexReqs = new HashSet<MethodExitRequest>(8);
+ private final HashSet<ModificationWatchpointRequest> mwpReqs = new HashSet<ModificationWatchpointRequest>(8);
+ private final HashSet<StepRequest> stepReqs = new HashSet<StepRequest>(8);
+ private final HashSet<ThreadDeathRequest> tdReqs = new HashSet<ThreadDeathRequest>(8);
+ private final HashSet<ThreadStartRequest> tsReqs = new HashSet<ThreadStartRequest>(8);
+ private final HashSet<VMDeathRequest> vmdReqs = new HashSet<VMDeathRequest>(8);
+ private final HashSet<MonitorContendedEnteredRequest> mcenteredReqs = new HashSet<MonitorContendedEnteredRequest>(8);
+ private final HashSet<MonitorContendedEnterRequest> mcenterReqs = new HashSet<MonitorContendedEnterRequest>(8);
+ private final HashSet<MonitorWaitedRequest> mwaitedReqs = new HashSet<MonitorWaitedRequest>(8);
+ private final HashSet<MonitorWaitRequest> mwaitReqs = new HashSet<MonitorWaitRequest>(8);
+
+ HashMap<Class<?>, HashSet<? extends EventRequest>> requests = null;
+ HashMap<Class<?>, HashMap<RequestID, EventRequest>> enabled = null;
/**
* Creates new EventRequestManager.
*/
public EventRequestManagerImpl(VirtualMachineImpl vmImpl) {
super("EventRequestManager", vmImpl); //$NON-NLS-1$
-
- // Initialize list of requests.
- fRequests = new HashSet[MONITOR_WAIT_INDEX + 1];
- for (int i = 0; i < fRequests.length; i++)
- fRequests[i] = new HashSet();
-
- // Initialize map of request IDs to enabled requests.
- fEnabledRequests = new Hashtable[MONITOR_WAIT_INDEX + 1];
- for (int i = 0; i < fEnabledRequests.length; i++)
- fEnabledRequests[i] = new Hashtable();
+ requests = new HashMap<Class<?>, HashSet<? extends EventRequest>>();
+ requests.put(AccessWatchpointRequestImpl.class, accesswpReqs);
+ requests.put(BreakpointRequestImpl.class, bpReqs);
+ requests.put(ClassPrepareRequestImpl.class, cpReqs);
+ requests.put(ClassUnloadRequestImpl.class, cuReqs);
+ requests.put(ExceptionRequestImpl.class, exReqs);
+ requests.put(MethodEntryRequestImpl.class, menReqs);
+ requests.put(MethodExitRequestImpl.class, mexReqs);
+ requests.put(ModificationWatchpointRequestImpl.class, mwpReqs);
+ requests.put(StepRequestImpl.class, stepReqs);
+ requests.put(ThreadDeathRequestImpl.class, tdReqs);
+ requests.put(ThreadStartRequestImpl.class, tsReqs);
+ requests.put(VMDeathRequestImpl.class, vmdReqs);
+ requests.put(MonitorContendedEnteredRequestImpl.class, mcenteredReqs);
+ requests.put(MonitorContendedEnterRequestImpl.class, mcenterReqs);
+ requests.put(MonitorWaitedRequestImpl.class, mwaitedReqs);
+ requests.put(MonitorWaitRequestImpl.class, mwaitReqs);
+ enabled = new HashMap<Class<?>, HashMap<RequestID,EventRequest>>();
}
/**
* Creates AccessWatchpointRequest.
- */
+ */
public AccessWatchpointRequest createAccessWatchpointRequest(Field field) {
- FieldImpl fieldImpl = (FieldImpl)field;
+ FieldImpl fieldImpl = (FieldImpl) field;
AccessWatchpointRequestImpl req = new AccessWatchpointRequestImpl(virtualMachineImpl());
req.addFieldFilter(fieldImpl);
- addEventRequest(ACCESS_WATCHPOINT_INDEX, req);
+ accesswpReqs.add(req);
return req;
}
/**
* Creates BreakpointRequest.
- */
+ */
public BreakpointRequest createBreakpointRequest(Location location) throws VMMismatchException {
- LocationImpl locImpl = (LocationImpl)location;
+ LocationImpl locImpl = (LocationImpl) location;
BreakpointRequestImpl req = new BreakpointRequestImpl(virtualMachineImpl());
req.addLocationFilter(locImpl);
- addEventRequest(BREAKPOINT_INDEX, req);
+ bpReqs.add(req);
return req;
}
/**
* Creates ClassPrepareRequest.
- */
+ */
public ClassPrepareRequest createClassPrepareRequest() {
ClassPrepareRequestImpl req = new ClassPrepareRequestImpl(virtualMachineImpl());
- addEventRequest(CLASS_PREPARE_INDEX, req);
+ cpReqs.add(req);
return req;
- }
-
+ }
+
/**
* Creates ClassUnloadRequest.
- */
+ */
public ClassUnloadRequest createClassUnloadRequest() {
ClassUnloadRequestImpl req = new ClassUnloadRequestImpl(virtualMachineImpl());
- addEventRequest(CLASS_UNLOAD_INDEX, req);
+ cuReqs.add(req);
return req;
- }
+ }
/**
* Creates ExceptionRequest.
- */
+ */
public ExceptionRequest createExceptionRequest(ReferenceType refType, boolean notifyCaught, boolean notifyUncaught) {
- ReferenceTypeImpl refTypeImpl = (ReferenceTypeImpl)refType;
+ ReferenceTypeImpl refTypeImpl = (ReferenceTypeImpl) refType;
ExceptionRequestImpl req = new ExceptionRequestImpl(virtualMachineImpl());
req.addExceptionFilter(refTypeImpl, notifyCaught, notifyUncaught);
- addEventRequest(EXCEPTION_INDEX, req);
+ exReqs.add(req);
return req;
- }
+ }
/**
* Creates MethodEntryRequest.
- */
+ */
public MethodEntryRequest createMethodEntryRequest() {
MethodEntryRequestImpl req = new MethodEntryRequestImpl(virtualMachineImpl());
- addEventRequest(METHOD_ENTRY_INDEX, req);
+ menReqs.add(req);
return req;
- }
+ }
/**
* Creates MethodExitRequest.
*/
public MethodExitRequest createMethodExitRequest() {
MethodExitRequestImpl req = new MethodExitRequestImpl(virtualMachineImpl());
- addEventRequest(METHOD_EXIT_INDEX, req);
+ mexReqs.add(req);
return req;
- }
-
+ }
+
/**
* Creates a MonitorContendedEnteredRequest
+ *
* @since 3.3
*/
public MonitorContendedEnteredRequest createMonitorContendedEnteredRequest() {
MonitorContendedEnteredRequestImpl req = new MonitorContendedEnteredRequestImpl(virtualMachineImpl());
- addEventRequest(MONITOR_CONTENDED_ENTERED_INDEX, req);
+ mcenteredReqs.add(req);
return req;
}
-
+
/**
* Creates a MonitorContendedEnterRequest
+ *
* @since 3.3
*/
public MonitorContendedEnterRequest createMonitorContendedEnterRequest() {
MonitorContendedEnterRequestImpl req = new MonitorContendedEnterRequestImpl(virtualMachineImpl());
- addEventRequest(MONITOR_CONTENDED_ENTER_INDEX, req);
+ mcenterReqs.add(req);
return req;
}
-
+
/**
* Creates a MonitorWaitedRequest
+ *
* @since 3.3
*/
public MonitorWaitedRequest createMonitorWaitedRequest() {
MonitorWaitedRequestImpl req = new MonitorWaitedRequestImpl(virtualMachineImpl());
- addEventRequest(MONITOR_WAITED_INDEX, req);
+ mwaitedReqs.add(req);
return req;
}
-
+
/**
* Creates a MonitorWaitRequest
+ *
* @since 3.3
*/
public MonitorWaitRequest createMonitorWaitRequest() {
MonitorWaitRequestImpl req = new MonitorWaitRequestImpl(virtualMachineImpl());
- addEventRequest(MONITOR_WAIT_INDEX, req);
+ mwaitReqs.add(req);
return req;
}
-
+
/**
* Creates ModificationWatchpointRequest.
- */
+ */
public ModificationWatchpointRequest createModificationWatchpointRequest(Field field) {
- FieldImpl fieldImpl = (FieldImpl)field;
+ FieldImpl fieldImpl = (FieldImpl) field;
ModificationWatchpointRequestImpl req = new ModificationWatchpointRequestImpl(virtualMachineImpl());
req.addFieldFilter(fieldImpl);
- addEventRequest(MODIFICATION_WATCHPOINT_INDEX, req);
+ mwpReqs.add(req);
return req;
- }
-
+ }
+
/**
* Creates StepRequest.
- */
- public StepRequest createStepRequest(ThreadReference thread, int size, int depth) throws DuplicateRequestException, ObjectCollectedException {
- ThreadReferenceImpl threadImpl = (ThreadReferenceImpl)thread;
- StepRequestImpl req = new StepRequestImpl(virtualMachineImpl());
+ */
+ public StepRequest createStepRequest(ThreadReference thread, int size, int depth) throws DuplicateRequestException, ObjectCollectedException {
+ ThreadReferenceImpl threadImpl = (ThreadReferenceImpl) thread;
+ StepRequestImpl req = new StepRequestImpl(virtualMachineImpl());
req.addStepFilter(threadImpl, size, depth);
- addEventRequest(STEP_INDEX, req);
+ stepReqs.add(req);
return req;
- }
+ }
/**
* Creates ThreadDeathRequest.
- */
+ */
public ThreadDeathRequest createThreadDeathRequest() {
ThreadDeathRequestImpl req = new ThreadDeathRequestImpl(virtualMachineImpl());
- addEventRequest(THREAD_DEATH_INDEX, req);
+ tdReqs.add(req);
return req;
- }
+ }
/**
* Creates ThreadStartRequest.
- */
+ */
public ThreadStartRequest createThreadStartRequest() {
ThreadStartRequestImpl req = new ThreadStartRequestImpl(virtualMachineImpl());
- addEventRequest(THREAD_START_INDEX, req);
+ tsReqs.add(req);
return req;
}
-
/*
* @see EventRequestManager#createVMDeathRequest()
*/
public VMDeathRequest createVMDeathRequest() {
VMDeathRequestImpl req = new VMDeathRequestImpl(virtualMachineImpl());
- addEventRequest(VM_DEATH_INDEX, req);
+ vmdReqs.add(req);
return req;
- }
+ }
/**
* Creates ReenterStepRequest (for OTI specific Hot Code Replacement).
- */
+ */
public org.eclipse.jdi.hcr.ReenterStepRequest createReenterStepRequest(ThreadReference thread) {
virtualMachineImpl().checkHCRSupported();
- ThreadReferenceImpl threadImpl = (ThreadReferenceImpl)thread;
+ ThreadReferenceImpl threadImpl = (ThreadReferenceImpl) thread;
ReenterStepRequestImpl req = new ReenterStepRequestImpl(virtualMachineImpl());
// Note that the StepFilter is only used to specify the thread.
- // The size is ignored and the depth will always be writter as HCR_STEP_DEPTH_REENTER_JDWP.
+ // The size is ignored and the depth will always be writter as
+ // HCR_STEP_DEPTH_REENTER_JDWP.
req.addStepFilter(threadImpl, StepRequest.STEP_MIN, 0);
- // Since this is a special case of a step request, we use the same request list.
- addEventRequest(STEP_INDEX, req);
+ // Since this is a special case of a step request, we use the same
+ // request list.
+ stepReqs.add(req);
return req;
}
-
+
/**
- * Enables class prepare requests for all loaded classes. This is
- * necessary for current versions of the KVM to function correctly.
- * This method is only called when the remote VM is determined to be
- * the KVM.
+ * Enables class prepare requests for all loaded classes. This is necessary
+ * for current versions of the KVM to function correctly. This method is
+ * only called when the remote VM is determined to be the KVM.
*/
public void enableInternalClassPrepareEvent() {
- // Note that these requests are not stored in the set of outstanding requests because
+ // Note that these requests are not stored in the set of outstanding
+ // requests because
// they must be invisible from outside.
- ClassPrepareRequestImpl requestPrepare =
- new ClassPrepareRequestImpl(virtualMachineImpl());
+ ClassPrepareRequestImpl requestPrepare = new ClassPrepareRequestImpl(virtualMachineImpl());
requestPrepare.setGeneratedInside();
requestPrepare.setSuspendPolicy(EventRequest.SUSPEND_NONE);
requestPrepare.enable();
}
-
+
/**
- * Creates ClassUnloadRequest for maintaining class information for within JDI.
- * Needed to known when to flush the cache.
- */
- public void enableInternalClasUnloadEvent(/* tbd: ReferenceTypeImpl refType*/) {
- // Note that these requests are not stored in the set of outstanding requests because
+ * Creates ClassUnloadRequest for maintaining class information for within
+ * JDI. Needed to known when to flush the cache.
+ */
+ public void enableInternalClasUnloadEvent(/* tbd: ReferenceTypeImpl refType */) {
+ // Note that these requests are not stored in the set of outstanding
+ // requests because
// they must be invisible from outside.
ClassUnloadRequestImpl reqUnload = new ClassUnloadRequestImpl(virtualMachineImpl());
reqUnload.setGeneratedInside();
@@ -327,354 +334,241 @@ public class EventRequestManagerImpl extends MirrorImpl implements EventRequestM
/**
* Checks if a steprequest is for the given thread is already enabled.
- */
+ */
boolean existsEnabledStepRequest(ThreadReferenceImpl threadImpl) {
- Enumeration enumeration = fEnabledRequests[STEP_INDEX].elements();
- StepRequestImpl step;
- while (enumeration.hasMoreElements()) {
- step = (StepRequestImpl)enumeration.nextElement();
- if (step.thread() == threadImpl)
+ Collection<EventRequest> reqs = enabled.get(StepRequestImpl.class).values();
+ StepRequest step;
+ for (EventRequest req : reqs) {
+ step = (StepRequest) req;
+ if (step.thread() == threadImpl) {
return true;
+ }
}
return false;
}
/**
* Deletes all Breakpoints.
- */
+ */
public void deleteAllBreakpoints() {
EventRequestImpl.clearAllBreakpoints(this);
- fRequests[BREAKPOINT_INDEX].clear();
- fEnabledRequests[BREAKPOINT_INDEX].clear();
- }
-
- /**
- * Adds an EventRequests to the given list.
- */
- public void addEventRequest(int index, EventRequest req) {
- fRequests[index].add(req);
- }
-
- /**
- * Deletes an EventRequest.
- */
- private void deleteEventRequest(int index, EventRequest req) throws VMMismatchException {
- // Remove request from list of requests and from the mapping of requestIDs to requests.
- checkVM(req);
- EventRequestImpl requestImpl = (EventRequestImpl)req;
- fRequests[index].remove(requestImpl);
- if (requestImpl.requestID() != null)
- fEnabledRequests[index].remove(requestImpl.requestID());
+ bpReqs.clear();
+ enabled.get(BreakpointRequestImpl.class).clear();
}
- /**
- * Deletes an EventRequest.
- */
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#deleteEventRequest(com.sun.jdi.request.EventRequest)
+ */
public void deleteEventRequest(EventRequest req) {
- // Disable request, note that this also causes the event request to be removed from fEnabledRequests.
+ // Disable request, note that this also causes the event request to be
+ // removed from fEnabledRequests.
try {
req.disable();
} catch (InvalidRequestStateException exception) {
// The event has already been removed from the VM.
}
-
- // Remove request from list.
- if (req instanceof AccessWatchpointRequestImpl)
- deleteEventRequest(ACCESS_WATCHPOINT_INDEX, req);
- else if (req instanceof BreakpointRequestImpl)
- deleteEventRequest(BREAKPOINT_INDEX, req);
- else if (req instanceof ClassPrepareRequestImpl)
- deleteEventRequest(CLASS_PREPARE_INDEX, req);
- else if (req instanceof ClassUnloadRequestImpl)
- deleteEventRequest(CLASS_UNLOAD_INDEX, req);
- else if (req instanceof ExceptionRequestImpl)
- deleteEventRequest(EXCEPTION_INDEX, req);
- else if (req instanceof MethodEntryRequestImpl)
- deleteEventRequest(METHOD_ENTRY_INDEX, req);
- else if (req instanceof MethodExitRequestImpl)
- deleteEventRequest(METHOD_EXIT_INDEX, req);
- else if (req instanceof ModificationWatchpointRequestImpl)
- deleteEventRequest(MODIFICATION_WATCHPOINT_INDEX, req);
- else if (req instanceof StepRequestImpl)
- deleteEventRequest(STEP_INDEX, req);
- else if (req instanceof ThreadDeathRequestImpl)
- deleteEventRequest(THREAD_DEATH_INDEX, req);
- else if (req instanceof ThreadStartRequestImpl)
- deleteEventRequest(THREAD_START_INDEX, req);
- else if(req instanceof MonitorContendedEnterRequestImpl) {
- deleteEventRequest(MONITOR_CONTENDED_ENTER_INDEX, req);
- }
- else if(req instanceof MonitorContendedEnteredRequestImpl) {
- deleteEventRequest(MONITOR_CONTENDED_ENTERED_INDEX, req);
+ EventRequestImpl reqimpl = (EventRequestImpl) req;
+ boolean removed = requests.get(req.getClass()).remove(req);
+ removed |= (enabled.get(req.getClass()).remove(reqimpl.requestID()) != null);
+ if(!removed) {
+ throw new InternalError(
+ MessageFormat
+ .format(RequestMessages.EventRequestManagerImpl_EventRequest_type_of__0__is_unknown_1,
+ new Object[] { req.toString() }));
}
- else if(req instanceof MonitorWaitRequestImpl) {
- deleteEventRequest(MONITOR_WAIT_INDEX, req);
- }
- else if(req instanceof MonitorWaitedRequestImpl) {
- deleteEventRequest(MONITOR_WAITED_INDEX, req);
- }
- else
-
- throw new InternalError(MessageFormat.format(RequestMessages.EventRequestManagerImpl_EventRequest_type_of__0__is_unknown_1, new String[]{req.toString()}));
}
- /**
- * Deletes all EventRequests from the given list.
- */
- public void deleteEventRequests(List requests) throws VMMismatchException {
- Iterator iter = requests.iterator();
- while(iter.hasNext()) {
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#deleteEventRequests(java.util.List)
+ */
+ public void deleteEventRequests(List<? extends EventRequest> requests) throws VMMismatchException {
+ Iterator<? extends EventRequest> iter = requests.iterator();
+ while (iter.hasNext()) {
Object obj = iter.next();
- deleteEventRequest((EventRequest)obj);
+ deleteEventRequest((EventRequest) obj);
}
}
- /**
- * @return Returns list of AccessWatchpointRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#accessWatchpointRequests()
*/
- public List accessWatchpointRequests() {
- return new ArrayList(fRequests[ACCESS_WATCHPOINT_INDEX]);
+ public List<AccessWatchpointRequest> accessWatchpointRequests() {
+ return new ArrayList<AccessWatchpointRequest>(accesswpReqs);
}
- /**
- * @return Returns list of BreakpointRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#breakpointRequests()
*/
- public List breakpointRequests() {
- return new ArrayList(fRequests[BREAKPOINT_INDEX]);
+ public List<BreakpointRequest> breakpointRequests() {
+ return new ArrayList<BreakpointRequest>(bpReqs);
}
- /**
- * @return Returns list of ClassPrepareRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#classPrepareRequests()
*/
- public List classPrepareRequests() {
- return new ArrayList(fRequests[CLASS_PREPARE_INDEX]);
+ public List<ClassPrepareRequest> classPrepareRequests() {
+ return new ArrayList<ClassPrepareRequest>(cpReqs);
}
- /**
- * @return Returns list of ClassUnloadRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#classUnloadRequests()
*/
- public List classUnloadRequests() {
- return new ArrayList(fRequests[CLASS_UNLOAD_INDEX]);
+ public List<ClassUnloadRequest> classUnloadRequests() {
+ return new ArrayList<ClassUnloadRequest>(cuReqs);
}
- /**
- * @return Returns list of ExceptionRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#exceptionRequests()
*/
- public List exceptionRequests() {
- return new ArrayList(fRequests[EXCEPTION_INDEX]);
+ public List<ExceptionRequest> exceptionRequests() {
+ return new ArrayList<ExceptionRequest>(exReqs);
}
- /**
- * @return Returns list of MethodEntryRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#methodEntryRequests()
*/
- public List methodEntryRequests() {
- return new ArrayList(fRequests[METHOD_ENTRY_INDEX]);
+ public List<MethodEntryRequest> methodEntryRequests() {
+ return new ArrayList<MethodEntryRequest>(menReqs);
}
- /**
- * @return Returns list of MethodExitRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#methodExitRequests()
*/
- public List methodExitRequests() {
- return new ArrayList(fRequests[METHOD_EXIT_INDEX]);
+ public List<MethodExitRequest> methodExitRequests() {
+ return new ArrayList<MethodExitRequest>(mexReqs);
}
-
- /**
- * @return Returns list of ModificationWatchpointRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#modificationWatchpointRequests()
*/
- public List modificationWatchpointRequests() {
- return new ArrayList(fRequests[MODIFICATION_WATCHPOINT_INDEX]);
+ public List<ModificationWatchpointRequest> modificationWatchpointRequests() {
+ return new ArrayList<ModificationWatchpointRequest>(mwpReqs);
}
- /**
- * @return Returns list of StepRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#stepRequests()
*/
- public List stepRequests() {
- return new ArrayList(fRequests[STEP_INDEX]);
+ public List<StepRequest> stepRequests() {
+ return new ArrayList<StepRequest>(stepReqs);
}
- /**
- * @return Returns list of ThreadDeathRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#threadDeathRequests()
*/
- public List threadDeathRequests() {
- return new ArrayList(fRequests[THREAD_DEATH_INDEX]);
+ public List<ThreadDeathRequest> threadDeathRequests() {
+ return new ArrayList<ThreadDeathRequest>(tdReqs);
}
- /**
- * @return Returns list of ThreadStartRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#threadStartRequests()
*/
- public List threadStartRequests() {
- return new ArrayList(fRequests[THREAD_START_INDEX]);
+ public List<ThreadStartRequest> threadStartRequests() {
+ return new ArrayList<ThreadStartRequest>(tsReqs);
}
-
- /**
- * @return Returns list of VMDeathRequests.
- * For changes, the appropriate EventRequestManager methods should be used.
+
+ /* (non-Javadoc)
+ * @see com.sun.jdi.request.EventRequestManager#vmDeathRequests()
*/
- public List vmDeathRequests() {
- return new ArrayList(fRequests[VM_DEATH_INDEX]);
+ public List<VMDeathRequest> vmDeathRequests() {
+ return new ArrayList<VMDeathRequest>(vmdReqs);
}
+ /**
+ * @param req
+ */
public void removeRequestIDMapping(EventRequestImpl req) {
- if (req instanceof AccessWatchpointRequestImpl)
- fEnabledRequests[ACCESS_WATCHPOINT_INDEX].remove(req.requestID());
- else if (req instanceof BreakpointRequestImpl)
- fEnabledRequests[BREAKPOINT_INDEX].remove(req.requestID());
- else if (req instanceof ClassPrepareRequestImpl)
- fEnabledRequests[CLASS_PREPARE_INDEX].remove(req.requestID());
- else if (req instanceof ClassUnloadRequestImpl)
- fEnabledRequests[CLASS_UNLOAD_INDEX].remove(req.requestID());
- else if (req instanceof ExceptionRequestImpl)
- fEnabledRequests[EXCEPTION_INDEX].remove(req.requestID());
- else if (req instanceof MethodEntryRequestImpl)
- fEnabledRequests[METHOD_ENTRY_INDEX].remove(req.requestID());
- else if (req instanceof MethodExitRequestImpl)
- fEnabledRequests[METHOD_EXIT_INDEX].remove(req.requestID());
- else if (req instanceof ModificationWatchpointRequestImpl)
- fEnabledRequests[MODIFICATION_WATCHPOINT_INDEX].remove(req.requestID());
- else if (req instanceof StepRequestImpl)
- fEnabledRequests[STEP_INDEX].remove(req.requestID());
- else if (req instanceof ThreadDeathRequestImpl)
- fEnabledRequests[THREAD_DEATH_INDEX].remove(req.requestID());
- else if (req instanceof ThreadStartRequestImpl)
- fEnabledRequests[THREAD_START_INDEX].remove(req.requestID());
- else if(req instanceof MonitorContendedEnterRequestImpl) {
- fEnabledRequests[MONITOR_CONTENDED_ENTER_INDEX].remove(req.requestID());
- }
- else if(req instanceof MonitorContendedEnteredRequestImpl) {
- fEnabledRequests[MONITOR_CONTENDED_ENTERED_INDEX].remove(req.requestID());
- }
- else if(req instanceof MonitorWaitRequestImpl) {
- fEnabledRequests[MONITOR_WAIT_INDEX].remove(req.requestID());
- }
- else if(req instanceof MonitorWaitedRequestImpl) {
- fEnabledRequests[MONITOR_WAITED_INDEX].remove(req.requestID());
- }
+ enabled.get(req.getClass()).remove(req.requestID());
}
-
+
/**
* Maps a request ID to requests.
- */
+ */
public void addRequestIDMapping(EventRequestImpl req) {
- if (req instanceof AccessWatchpointRequestImpl)
- fEnabledRequests[ACCESS_WATCHPOINT_INDEX].put(req.requestID(), req);
- else if (req instanceof BreakpointRequestImpl)
- fEnabledRequests[BREAKPOINT_INDEX].put(req.requestID(), req);
- else if (req instanceof ClassPrepareRequestImpl)
- fEnabledRequests[CLASS_PREPARE_INDEX].put(req.requestID(), req);
- else if (req instanceof ClassUnloadRequestImpl)
- fEnabledRequests[CLASS_UNLOAD_INDEX].put(req.requestID(), req);
- else if (req instanceof ExceptionRequestImpl)
- fEnabledRequests[EXCEPTION_INDEX].put(req.requestID(), req);
- else if (req instanceof MethodEntryRequestImpl)
- fEnabledRequests[METHOD_ENTRY_INDEX].put(req.requestID(), req);
- else if (req instanceof MethodExitRequestImpl)
- fEnabledRequests[METHOD_EXIT_INDEX].put(req.requestID(), req);
- else if (req instanceof ModificationWatchpointRequestImpl)
- fEnabledRequests[MODIFICATION_WATCHPOINT_INDEX].put(req.requestID(), req);
- else if (req instanceof StepRequestImpl)
- fEnabledRequests[STEP_INDEX].put(req.requestID(), req);
- else if (req instanceof ThreadDeathRequestImpl)
- fEnabledRequests[THREAD_DEATH_INDEX].put(req.requestID(), req);
- else if (req instanceof ThreadStartRequestImpl)
- fEnabledRequests[THREAD_START_INDEX].put(req.requestID(), req);
- else if(req instanceof MonitorWaitRequestImpl) {
- fEnabledRequests[MONITOR_WAIT_INDEX].put(req.requestID(), req);
- }
- else if(req instanceof MonitorWaitedRequestImpl) {
- fEnabledRequests[MONITOR_WAITED_INDEX].put(req.requestID(), req);
- }
- else if(req instanceof MonitorContendedEnterRequestImpl) {
- fEnabledRequests[MONITOR_CONTENDED_ENTER_INDEX].put(req.requestID(), req);
- }
- else if(req instanceof MonitorContendedEnteredRequestImpl) {
- fEnabledRequests[MONITOR_CONTENDED_ENTERED_INDEX].put(req.requestID(), req);
- }
+ enabled.get(req.getClass()).put(req.requestID(), req);
}
/**
* Find Request that matches event.
- */
+ */
public EventRequestImpl findRequest(EventImpl event) {
- if (event instanceof AccessWatchpointEventImpl)
- return (EventRequestImpl)fEnabledRequests[ACCESS_WATCHPOINT_INDEX].get(event.requestID());
- else if (event instanceof BreakpointEventImpl)
- return (EventRequestImpl)fEnabledRequests[BREAKPOINT_INDEX].get(event.requestID());
- else if (event instanceof ClassPrepareEventImpl)
- return (ClassPrepareRequestImpl)fEnabledRequests[CLASS_PREPARE_INDEX].get(event.requestID());
- else if (event instanceof ClassUnloadEventImpl)
- return (EventRequestImpl)fEnabledRequests[CLASS_UNLOAD_INDEX].get(event.requestID());
- else if (event instanceof ExceptionEventImpl)
- return (EventRequestImpl)fEnabledRequests[EXCEPTION_INDEX].get(event.requestID());
- else if (event instanceof MethodEntryEventImpl)
- return (EventRequestImpl)fEnabledRequests[METHOD_ENTRY_INDEX].get(event.requestID());
- else if (event instanceof MethodExitEventImpl)
- return (EventRequestImpl)fEnabledRequests[METHOD_EXIT_INDEX].get(event.requestID());
- else if (event instanceof ModificationWatchpointEventImpl)
- return (EventRequestImpl)fEnabledRequests[MODIFICATION_WATCHPOINT_INDEX].get(event.requestID());
- else if (event instanceof StepEventImpl)
- return (EventRequestImpl)fEnabledRequests[STEP_INDEX].get(event.requestID());
- else if (event instanceof ThreadDeathEventImpl)
- return (EventRequestImpl)fEnabledRequests[THREAD_DEATH_INDEX].get(event.requestID());
- else if (event instanceof ThreadStartEventImpl)
- return (EventRequestImpl)fEnabledRequests[THREAD_START_INDEX].get(event.requestID());
- else if (event instanceof VMDeathEventImpl)
- return (EventRequestImpl)fEnabledRequests[VM_DEATH_INDEX].get(event.requestID());
- else if(event instanceof MonitorWaitEventImpl) {
- return (EventRequestImpl)fEnabledRequests[MONITOR_WAIT_INDEX].get(event.requestID());
+ if (event instanceof AccessWatchpointEventImpl) {
+ return (EventRequestImpl) enabled.get(AccessWatchpointRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof BreakpointEventImpl) {
+ return (EventRequestImpl) enabled.get(BreakpointRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof ClassPrepareEventImpl) {
+ return (EventRequestImpl) enabled.get(ClassPrepareRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof ClassUnloadEventImpl) {
+ return (EventRequestImpl) enabled.get(ClassUnloadRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof ExceptionEventImpl) {
+ return (EventRequestImpl) enabled.get(ExceptionRequestImpl.class).get(event.requestID());
}
- else if(event instanceof MonitorWaitedEventImpl) {
- return (EventRequestImpl)fEnabledRequests[MONITOR_WAITED_INDEX].get(event.requestID());
+ else if (event instanceof MethodEntryEventImpl) {
+ return (EventRequestImpl) enabled.get(MethodEntryRequestImpl.class).get(event.requestID());
}
- else if(event instanceof MonitorContendedEnterEventImpl) {
- return (EventRequestImpl)fEnabledRequests[MONITOR_CONTENDED_ENTER_INDEX].get(event.requestID());
+ else if (event instanceof MethodExitEventImpl) {
+ return (EventRequestImpl) enabled.get(MethodExitRequestImpl.class).get(event.requestID());
}
- else if(event instanceof MonitorContendedEnteredEventImpl) {
- return (EventRequestImpl)fEnabledRequests[MONITOR_CONTENDED_ENTERED_INDEX].get(event.requestID());
+ else if (event instanceof ModificationWatchpointEventImpl) {
+ return (EventRequestImpl) enabled.get(ModificationWatchpointRequestImpl.class).get(event.requestID());
}
- else
- throw new InternalError(RequestMessages.EventRequestManagerImpl_Got_event_of_unknown_type_2);
+ else if (event instanceof StepEventImpl) {
+ return (EventRequestImpl) enabled.get(StepRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof ThreadDeathEventImpl) {
+ return (EventRequestImpl) enabled.get(ThreadDeathRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof ThreadStartEventImpl) {
+ return (EventRequestImpl) enabled.get(ThreadStartRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof VMDeathEventImpl) {
+ return (EventRequestImpl) enabled.get(VMDeathRequestImpl.class).get(event.requestID());
+ }
+ else if (event instanceof MonitorWaitEventImpl) {
+ return (EventRequestImpl) enabled.get(MonitorWaitRequestImpl.class).get(event.requestID());
+ } else if (event instanceof MonitorWaitedEventImpl) {
+ return (EventRequestImpl) enabled.get(MonitorWaitedRequestImpl.class).get(event.requestID());
+ } else if (event instanceof MonitorContendedEnterEventImpl) {
+ return (EventRequestImpl) enabled.get(MonitorContendedEnterRequestImpl.class).get(event.requestID());
+ } else if (event instanceof MonitorContendedEnteredEventImpl) {
+ return (EventRequestImpl) enabled.get(MonitorContendedEnteredRequestImpl.class).get(event.requestID());
+ } else
+ throw new InternalError(
+ RequestMessages.EventRequestManagerImpl_Got_event_of_unknown_type_2);
}
/**
* @see com.sun.jdi.request.EventRequestManager#monitorContendedEnterRequests()
* @since 3.3
*/
- public List monitorContendedEnterRequests() {
- return new ArrayList(fRequests[MONITOR_CONTENDED_ENTER_INDEX]);
+ public List<MonitorContendedEnterRequest> monitorContendedEnterRequests() {
+ return new ArrayList<MonitorContendedEnterRequest>(mcenterReqs);
+ }
+
+ /**
+ * @see com.sun.jdi.request.EventRequestManager#monitorContendedEnteredRequests()
+ * @since 3.3
+ */
+ public List<MonitorContendedEnteredRequest> monitorContendedEnteredRequests() {
+ return new ArrayList<MonitorContendedEnteredRequest>(mcenteredReqs);
+ }
+
+ /**
+ * @see com.sun.jdi.request.EventRequestManager#monitorWaitRequests()
+ * @since 3.3
+ */
+ public List<MonitorWaitRequest> monitorWaitRequests() {
+ return new ArrayList<MonitorWaitRequest>(mwaitReqs);
+ }
+
+ /**
+ * @see com.sun.jdi.request.EventRequestManager#monitorWaitedRequests()
+ * @since 3.3
+ */
+ public List<MonitorWaitedRequest> monitorWaitedRequests() {
+ return new ArrayList<MonitorWaitedRequest>(mwaitedReqs);
}
-
- /**
- * @see com.sun.jdi.request.EventRequestManager#monitorContendedEnteredRequests()
- * @since 3.3
- */
- public List monitorContendedEnteredRequests() {
- return new ArrayList(fRequests[MONITOR_CONTENDED_ENTERED_INDEX]);
- }
-
- /**
- * @see com.sun.jdi.request.EventRequestManager#monitorWaitRequests()
- * @since 3.3
- */
- public List monitorWaitRequests() {
- return new ArrayList(fRequests[MONITOR_WAIT_INDEX]);
- }
-
- /**
- * @see com.sun.jdi.request.EventRequestManager#monitorWaitedRequests()
- * @since 3.3
- */
- public List monitorWaitedRequests() {
- return new ArrayList(fRequests[MONITOR_WAITED_INDEX]);
- }
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ExceptionRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ExceptionRequestImpl.java
index 9bd37b0c8..1a6a46ae0 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ExceptionRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ExceptionRequestImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.ExceptionEventImpl;
@@ -18,12 +17,12 @@ import com.sun.jdi.ReferenceType;
import com.sun.jdi.request.ExceptionRequest;
/**
- * This class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * This class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ExceptionRequestImpl extends EventRequestImpl implements ExceptionRequest {
+public class ExceptionRequestImpl extends EventRequestImpl implements
+ ExceptionRequest {
/**
* Creates new EventRequestManager.
*/
@@ -35,26 +34,27 @@ public class ExceptionRequestImpl extends EventRequestImpl implements ExceptionR
* Returns exception type for which exception events are requested.
*/
public ReferenceType exception() {
- return ((EventRequestImpl.ExceptionFilter)fExceptionFilters.get(0)).fException;
+ return fExceptionFilters.get(0).fException;
}
-
+
/**
* @return Returns true if caught exceptions will be reported.
*/
public boolean notifyCaught() {
- return ((EventRequestImpl.ExceptionFilter)fExceptionFilters.get(0)).fNotifyCaught;
+ return fExceptionFilters.get(0).fNotifyCaught;
}
-
+
/**
* @return Returns true if uncaught exceptions will be reported.
*/
public boolean notifyUncaught() {
- return ((EventRequestImpl.ExceptionFilter)fExceptionFilters.get(0)).fNotifyUncaught;
+ return fExceptionFilters.get(0).fNotifyUncaught;
}
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return ExceptionEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodEntryRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodEntryRequestImpl.java
index 24e4f6b2a..e057a26cd 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodEntryRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodEntryRequestImpl.java
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.MethodEntryEventImpl;
import com.sun.jdi.request.MethodEntryRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class MethodEntryRequestImpl extends EventRequestImpl implements MethodEntryRequest {
+public class MethodEntryRequestImpl extends EventRequestImpl implements
+ MethodEntryRequest {
/**
* Creates new MethodEntryRequest.
*/
@@ -33,6 +32,7 @@ public class MethodEntryRequestImpl extends EventRequestImpl implements MethodEn
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return MethodEntryEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodExitRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodExitRequestImpl.java
index a93613e09..64047fa19 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodExitRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MethodExitRequestImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.EventImpl;
import org.eclipse.jdi.internal.event.MethodExitEventImpl;
@@ -18,12 +17,12 @@ import org.eclipse.jdi.internal.event.MethodExitEventImpl;
import com.sun.jdi.request.MethodExitRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class MethodExitRequestImpl extends EventRequestImpl implements MethodExitRequest {
+public class MethodExitRequestImpl extends EventRequestImpl implements
+ MethodExitRequest {
/**
* Creates new MethodExitRequest.
*/
@@ -34,6 +33,7 @@ public class MethodExitRequestImpl extends EventRequestImpl implements MethodExi
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
if (virtualMachine().canGetMethodReturnValues()) {
return EventImpl.EVENT_METHOD_EXIT_WITH_RETURN_VALUE;
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ModificationWatchpointRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ModificationWatchpointRequestImpl.java
index f92d330c0..d952f67f1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ModificationWatchpointRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ModificationWatchpointRequestImpl.java
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.ModificationWatchpointEventImpl;
import com.sun.jdi.request.ModificationWatchpointRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ModificationWatchpointRequestImpl extends WatchpointRequestImpl implements ModificationWatchpointRequest {
+public class ModificationWatchpointRequestImpl extends WatchpointRequestImpl
+ implements ModificationWatchpointRequest {
/**
* Creates new ModificationWatchpointRequest.
*/
@@ -33,6 +32,7 @@ public class ModificationWatchpointRequestImpl extends WatchpointRequestImpl imp
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return ModificationWatchpointEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnterRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnterRequestImpl.java
index 47f4d93f7..4cae39296 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnterRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnterRequestImpl.java
@@ -16,12 +16,13 @@ import org.eclipse.jdi.internal.event.MonitorContendedEnterEventImpl;
import com.sun.jdi.request.MonitorContendedEnterRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
* @since 3.3
*/
-public class MonitorContendedEnterRequestImpl extends EventRequestImpl implements MonitorContendedEnterRequest {
+public class MonitorContendedEnterRequestImpl extends EventRequestImpl
+ implements MonitorContendedEnterRequest {
/**
* Creates new MethodExitRequest.
@@ -33,6 +34,7 @@ public class MonitorContendedEnterRequestImpl extends EventRequestImpl implement
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected byte eventKind() {
return MonitorContendedEnterEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnteredRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnteredRequestImpl.java
index d60cac99c..9cfa29b64 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnteredRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorContendedEnteredRequestImpl.java
@@ -16,12 +16,13 @@ import org.eclipse.jdi.internal.event.MonitorContendedEnteredEventImpl;
import com.sun.jdi.request.MonitorContendedEnteredRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
* @since 3.3
*/
-public class MonitorContendedEnteredRequestImpl extends EventRequestImpl implements MonitorContendedEnteredRequest {
+public class MonitorContendedEnteredRequestImpl extends EventRequestImpl
+ implements MonitorContendedEnteredRequest {
/**
* Creates new MethodExitRequest.
@@ -33,6 +34,7 @@ public class MonitorContendedEnteredRequestImpl extends EventRequestImpl impleme
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return MonitorContendedEnteredEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitRequestImpl.java
index 65f85daa6..5505aba0a 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitRequestImpl.java
@@ -16,13 +16,14 @@ import org.eclipse.jdi.internal.event.MonitorWaitEventImpl;
import com.sun.jdi.request.MonitorWaitRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
* @since 3.3
*/
-public class MonitorWaitRequestImpl extends EventRequestImpl implements MonitorWaitRequest {
-
+public class MonitorWaitRequestImpl extends EventRequestImpl implements
+ MonitorWaitRequest {
+
public MonitorWaitRequestImpl(VirtualMachineImpl vmImpl) {
super("MonitorWaitRequest", vmImpl); //$NON-NLS-1$
}
@@ -30,6 +31,7 @@ public class MonitorWaitRequestImpl extends EventRequestImpl implements MonitorW
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected byte eventKind() {
return MonitorWaitEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitedRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitedRequestImpl.java
index e9044e748..d47cc8876 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitedRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/MonitorWaitedRequestImpl.java
@@ -14,12 +14,13 @@ import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.MonitorWaitedEventImpl;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
* @since 3.3
*/
-public class MonitorWaitedRequestImpl extends EventRequestImpl implements com.sun.jdi.request.MonitorWaitedRequest {
+public class MonitorWaitedRequestImpl extends EventRequestImpl implements
+ com.sun.jdi.request.MonitorWaitedRequest {
/** constructor **/
public MonitorWaitedRequestImpl(VirtualMachineImpl vmImpl) {
@@ -29,6 +30,7 @@ public class MonitorWaitedRequestImpl extends EventRequestImpl implements com.su
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected byte eventKind() {
return MonitorWaitedEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ReenterStepRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ReenterStepRequestImpl.java
index f898c2445..f9c7ffd75 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ReenterStepRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ReenterStepRequestImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -22,22 +21,23 @@ import org.eclipse.jdi.internal.jdwp.JdwpCommandPacket;
import org.eclipse.jdi.internal.jdwp.JdwpReplyPacket;
/**
- * this class implements the corresponding interfaces
- * declared by the OTI Hot Code Replacement extentions of the
- * JDI specification.
+ * this class implements the corresponding interfaces declared by the OTI Hot
+ * Code Replacement extentions of the JDI specification.
*/
-public class ReenterStepRequestImpl extends StepRequestImpl implements org.eclipse.jdi.hcr.ReenterStepRequest {
+public class ReenterStepRequestImpl extends StepRequestImpl implements
+ org.eclipse.jdi.hcr.ReenterStepRequest {
/**
* Creates new ReenterStepRequestImpl.
*/
public ReenterStepRequestImpl(VirtualMachineImpl vmImpl) {
super("ReenterStepRequest", vmImpl); //$NON-NLS-1$
}
-
+
/**
* @return Returns JDWP constant for step depth.
*/
+ @Override
public int threadStepDepthJDWP(int threadStepDepth) {
return STEP_DEPTH_REENTER_JDWP_HCR;
}
@@ -45,6 +45,7 @@ public class ReenterStepRequestImpl extends StepRequestImpl implements org.eclip
/**
* Enables event request.
*/
+ @Override
public void enable() {
if (isEnabled())
return;
@@ -53,16 +54,19 @@ public class ReenterStepRequestImpl extends StepRequestImpl implements org.eclip
try {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DataOutputStream outData = new DataOutputStream(outBytes);
- writeByte(eventKind(), "event kind", EventImpl.eventKindMap(), outData); // Always 01 for Step event. //$NON-NLS-1$
+ writeByte(eventKind(),
+ "event kind", EventImpl.eventKindMap(), outData); // Always 01 for Step event. //$NON-NLS-1$
writeByte(suspendPolicyJDWP(), "suspend policy", outData); //$NON-NLS-1$
writeInt(modifierCount(), "modifiers", outData); //$NON-NLS-1$
writeModifiers(outData);
-
- JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.HCR_REENTER_ON_EXIT, outBytes);
+
+ JdwpReplyPacket replyPacket = requestVM(
+ JdwpCommandPacket.HCR_REENTER_ON_EXIT, outBytes);
defaultReplyErrorHandler(replyPacket.errorCode());
DataInputStream replyData = replyPacket.dataInStream();
fRequestID = RequestID.read(this, replyData);
- virtualMachineImpl().eventRequestManagerImpl().addRequestIDMapping(this);
+ virtualMachineImpl().eventRequestManagerImpl().addRequestIDMapping(
+ this);
} catch (IOException e) {
defaultIOExceptionHandler(e);
} finally {
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/RequestID.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/RequestID.java
index f235950ec..23cb63439 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/RequestID.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/RequestID.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -18,46 +17,54 @@ import java.io.IOException;
import org.eclipse.jdi.internal.MirrorImpl;
public class RequestID {
- /** Null request ID, returned by Virtual Machine in events that were not requested. */
+ /**
+ * Null request ID, returned by Virtual Machine in events that were not
+ * requested.
+ */
private static final int NULL_REQUEST_ID = 0;
public static final RequestID nullID = new RequestID(NULL_REQUEST_ID);
- /** Integer representation of request ID.*/
+ /** Integer representation of request ID. */
private int fRequestID;
-
+
/**
* Creates new request ID.
*/
private RequestID(int ID) {
fRequestID = ID;
}
-
+
/**
- * @return Returns whether the request ID is a NULL ID, which means that there is no corresponding request.
+ * @return Returns whether the request ID is a NULL ID, which means that
+ * there is no corresponding request.
*/
public boolean isNull() {
return fRequestID == NULL_REQUEST_ID;
}
-
+
/**
* @return Returns true if two RequestIDs are the same.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
- return object != null && object.getClass().equals(this.getClass()) && fRequestID == ((RequestID)object).fRequestID;
+ return object != null && object.getClass().equals(this.getClass())
+ && fRequestID == ((RequestID) object).fRequestID;
}
-
+
/**
* @return Returns a has code for this object.
* @see java.lang.Object#hashCode
*/
+ @Override
public int hashCode() {
return fRequestID;
}
-
+
/**
* @return Returns string representation.
*/
+ @Override
public String toString() {
return new Long(fRequestID).toString();
}
@@ -65,14 +72,16 @@ public class RequestID {
/**
* Writes IDto stream.
*/
- public void write(MirrorImpl target, DataOutputStream out) throws IOException {
+ public void write(MirrorImpl target, DataOutputStream out)
+ throws IOException {
target.writeInt(fRequestID, "request ID", out); //$NON-NLS-1$
}
-
+
/**
* @return Returns a new request ID read from stream.
*/
- public static RequestID read(MirrorImpl target, DataInputStream in) throws IOException {
+ public static RequestID read(MirrorImpl target, DataInputStream in)
+ throws IOException {
int result = target.readInt("request ID", in); //$NON-NLS-1$
return new RequestID(result);
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/StepRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/StepRequestImpl.java
index 8cc33b6c6..53ae5ab6d 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/StepRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/StepRequestImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.StepEventImpl;
@@ -18,10 +17,9 @@ import com.sun.jdi.ThreadReference;
import com.sun.jdi.request.StepRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
public class StepRequestImpl extends EventRequestImpl implements StepRequest {
/**
@@ -42,26 +40,27 @@ public class StepRequestImpl extends EventRequestImpl implements StepRequest {
* @return Returns the relative call stack limit.
*/
public int depth() {
- return ((EventRequestImpl.ThreadStepFilter)fThreadStepFilters.get(0)).fThreadStepDepth;
+ return fThreadStepFilters.get(0).fThreadStepDepth;
}
-
+
/**
* @return Returns the size of each step.
*/
public int size() {
- return ((EventRequestImpl.ThreadStepFilter)fThreadStepFilters.get(0)).fThreadStepSize;
+ return fThreadStepFilters.get(0).fThreadStepSize;
}
-
+
/**
* @return Returns ThreadReference of thread in which to step.
*/
public ThreadReference thread() {
- return ((EventRequestImpl.ThreadStepFilter)fThreadStepFilters.get(0)).fThread;
+ return fThreadStepFilters.get(0).fThread;
}
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return StepEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadDeathRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadDeathRequestImpl.java
index 5615cf8ff..2fb2050cf 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadDeathRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadDeathRequestImpl.java
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.ThreadDeathEventImpl;
import com.sun.jdi.request.ThreadDeathRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ThreadDeathRequestImpl extends EventRequestImpl implements ThreadDeathRequest {
+public class ThreadDeathRequestImpl extends EventRequestImpl implements
+ ThreadDeathRequest {
/**
* Creates new ThreadDeathRequest.
*/
@@ -33,6 +32,7 @@ public class ThreadDeathRequestImpl extends EventRequestImpl implements ThreadDe
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return ThreadDeathEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadStartRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadStartRequestImpl.java
index aa8ca0f6a..794982052 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadStartRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/ThreadStartRequestImpl.java
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.event.ThreadStartEventImpl;
import com.sun.jdi.request.ThreadStartRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public class ThreadStartRequestImpl extends EventRequestImpl implements ThreadStartRequest {
+public class ThreadStartRequestImpl extends EventRequestImpl implements
+ ThreadStartRequest {
/**
* Creates new ThreadStartRequest.
*/
@@ -33,6 +32,7 @@ public class ThreadStartRequestImpl extends EventRequestImpl implements ThreadSt
/**
* @return Returns JDWP EventKind.
*/
+ @Override
protected final byte eventKind() {
return ThreadStartEventImpl.EVENT_KIND;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/VMDeathRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/VMDeathRequestImpl.java
index dc40efeb3..72f43d64d 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/VMDeathRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/VMDeathRequestImpl.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
-
import org.eclipse.jdi.internal.event.VMDeathEventImpl;
+
import com.sun.jdi.request.VMDeathRequest;
-public class VMDeathRequestImpl extends EventRequestImpl implements VMDeathRequest {
-
+public class VMDeathRequestImpl extends EventRequestImpl implements
+ VMDeathRequest {
+
public VMDeathRequestImpl(VirtualMachineImpl vmImpl) {
super("VMDeathRequest", vmImpl); //$NON-NLS-1$
}
@@ -25,8 +25,8 @@ public class VMDeathRequestImpl extends EventRequestImpl implements VMDeathReque
/**
* @return JDWP event kind
*/
+ @Override
protected byte eventKind() {
return VMDeathEventImpl.EVENT_KIND;
}
}
-
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/WatchpointRequestImpl.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/WatchpointRequestImpl.java
index 8f2f7abd0..f273097ed 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/WatchpointRequestImpl.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/request/WatchpointRequestImpl.java
@@ -10,30 +10,29 @@
*******************************************************************************/
package org.eclipse.jdi.internal.request;
-
import org.eclipse.jdi.internal.VirtualMachineImpl;
import com.sun.jdi.Field;
import com.sun.jdi.request.WatchpointRequest;
/**
- * this class implements the corresponding interfaces
- * declared by the JDI specification. See the com.sun.jdi package
- * for more information.
- *
+ * this class implements the corresponding interfaces declared by the JDI
+ * specification. See the com.sun.jdi package for more information.
+ *
*/
-public abstract class WatchpointRequestImpl extends EventRequestImpl implements WatchpointRequest {
+public abstract class WatchpointRequestImpl extends EventRequestImpl implements
+ WatchpointRequest {
/**
* Creates new WatchpointRequest, only used by subclasses.
*/
public WatchpointRequestImpl(String description, VirtualMachineImpl vmImpl) {
super(description, vmImpl);
}
-
+
/**
* @return Returns field for which Watchpoint requests is issued.
*/
public Field field() {
- return (Field)fFieldFilters.get(0);
+ return fFieldFilters.get(0);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java
index c79adf1b7..baa776730 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpCommandPacket.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.spy;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -20,9 +19,9 @@ import java.util.HashMap;
import java.util.Map;
/**
- * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
- * declared by the JDWP specification.
- *
+ * This class implements the corresponding Java Debug Wire Protocol (JDWP)
+ * packet declared by the JDWP specification.
+ *
*/
public class JdwpCommandPacket extends JdwpPacket {
/** Command Sets. */
@@ -46,131 +45,134 @@ public class JdwpCommandPacket extends JdwpPacket {
public static final int CSET_HOT_CODE_REPLACEMENT = 128;
/** Commands VirtualMachine. */
- public static final int VM_VERSION = 1 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CLASSES_BY_SIGNATURE = 2 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ALL_CLASSES = 3 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ALL_THREADS = 4 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_TOP_LEVEL_THREAD_GROUPS = 5 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_DISPOSE = 6 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ID_SIZES = 7 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_SUSPEND = 8 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_RESUME = 9 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_EXIT = 10 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CREATE_STRING = 11 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CAPABILITIES = 12 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CLASS_PATHS = 13 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_DISPOSE_OBJECTS = 14 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_HOLD_EVENTS = 15 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_RELEASE_EVENTS = 16 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_CAPABILITIES_NEW = 17 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_REDEFINE_CLASSES = 18 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_SET_DEFAULT_STRATUM = 19 + (CSET_VIRTUAL_MACHINE << 8);
- public static final int VM_ALL_CLASSES_WITH_GENERIC= 20 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_VERSION = 1 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CLASSES_BY_SIGNATURE = 2 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ALL_CLASSES = 3 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ALL_THREADS = 4 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_TOP_LEVEL_THREAD_GROUPS = 5 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_DISPOSE = 6 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ID_SIZES = 7 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_SUSPEND = 8 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_RESUME = 9 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_EXIT = 10 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CREATE_STRING = 11 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CAPABILITIES = 12 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CLASS_PATHS = 13 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_DISPOSE_OBJECTS = 14 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_HOLD_EVENTS = 15 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_RELEASE_EVENTS = 16 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_CAPABILITIES_NEW = 17 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_REDEFINE_CLASSES = 18 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_SET_DEFAULT_STRATUM = 19 + (CSET_VIRTUAL_MACHINE << 8);
+ public static final int VM_ALL_CLASSES_WITH_GENERIC = 20 + (CSET_VIRTUAL_MACHINE << 8);
/** Commands ReferenceType. */
- public static final int RT_SIGNATURE = 1 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_CLASS_LOADER = 2 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_MODIFIERS = 3 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_FIELDS = 4 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_METHODS = 5 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_GET_VALUES = 6 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_SOURCE_FILE = 7 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_NESTED_TYPES = 8 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_STATUS = 9 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_INTERFACES = 10 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_CLASS_OBJECT = 11 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_SOURCE_DEBUG_EXTENSION = 12 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_SIGNATURE_WITH_GENERIC = 13 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_FIELDS_WITH_GENERIC = 14 + (CSET_REFERENCE_TYPE << 8);
- public static final int RT_METHODS_WITH_GENERIC = 15 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SIGNATURE = 1 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_CLASS_LOADER = 2 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_MODIFIERS = 3 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_FIELDS = 4 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_METHODS = 5 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_GET_VALUES = 6 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SOURCE_FILE = 7 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_NESTED_TYPES = 8 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_STATUS = 9 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_INTERFACES = 10 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_CLASS_OBJECT = 11 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SOURCE_DEBUG_EXTENSION = 12 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_SIGNATURE_WITH_GENERIC = 13 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_FIELDS_WITH_GENERIC = 14 + (CSET_REFERENCE_TYPE << 8);
+ public static final int RT_METHODS_WITH_GENERIC = 15 + (CSET_REFERENCE_TYPE << 8);
/** Commands ClassType. */
- public static final int CT_SUPERCLASS = 1 + (CSET_CLASS_TYPE << 8);
- public static final int CT_SET_VALUES = 2 + (CSET_CLASS_TYPE << 8);
- public static final int CT_INVOKE_METHOD = 3 + (CSET_CLASS_TYPE << 8);
- public static final int CT_NEW_INSTANCE = 4 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_SUPERCLASS = 1 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_SET_VALUES = 2 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_INVOKE_METHOD = 3 + (CSET_CLASS_TYPE << 8);
+ public static final int CT_NEW_INSTANCE = 4 + (CSET_CLASS_TYPE << 8);
/** Commands ArrayType. */
- public static final int AT_NEW_INSTANCE = 1 + (CSET_ARRAY_TYPE << 8);
+ public static final int AT_NEW_INSTANCE = 1 + (CSET_ARRAY_TYPE << 8);
/** Commands Method. */
- public static final int M_LINE_TABLE = 1 + (CSET_METHOD << 8);
- public static final int M_VARIABLE_TABLE = 2 + (CSET_METHOD << 8);
- public static final int M_BYTECODES = 3 + (CSET_METHOD << 8);
- public static final int M_IS_OBSOLETE = 4 + (CSET_METHOD << 8);
- public static final int M_VARIABLE_TABLE_WITH_GENERIC = 5 + (CSET_METHOD << 8);
+ public static final int M_LINE_TABLE = 1 + (CSET_METHOD << 8);
+ public static final int M_VARIABLE_TABLE = 2 + (CSET_METHOD << 8);
+ public static final int M_BYTECODES = 3 + (CSET_METHOD << 8);
+ public static final int M_IS_OBSOLETE = 4 + (CSET_METHOD << 8);
+ public static final int M_VARIABLE_TABLE_WITH_GENERIC = 5 + (CSET_METHOD << 8);
/** Commands ObjectReference. */
- public static final int OR_REFERENCE_TYPE = 1 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_GET_VALUES = 2 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_SET_VALUES = 3 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_MONITOR_INFO = 5 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_INVOKE_METHOD = 6 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_DISABLE_COLLECTION = 7 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_ENABLE_COLLECTION = 8 + (CSET_OBJECT_REFERENCE << 8);
- public static final int OR_IS_COLLECTED = 9 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_REFERENCE_TYPE = 1 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_GET_VALUES = 2 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_SET_VALUES = 3 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_MONITOR_INFO = 5 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_INVOKE_METHOD = 6 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_DISABLE_COLLECTION = 7 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_ENABLE_COLLECTION = 8 + (CSET_OBJECT_REFERENCE << 8);
+ public static final int OR_IS_COLLECTED = 9 + (CSET_OBJECT_REFERENCE << 8);
/** Commands StringReference. */
- public static final int SR_VALUE = 1 + (CSET_STRING_REFERENCE << 8);
+ public static final int SR_VALUE = 1 + (CSET_STRING_REFERENCE << 8);
/** Commands ThreadReference. */
- public static final int TR_NAME = 1 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_SUSPEND = 2 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_RESUME = 3 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_STATUS = 4 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_THREAD_GROUP = 5 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_FRAMES = 6 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_FRAME_COUNT = 7 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_OWNED_MONITORS = 8 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_CURRENT_CONTENDED_MONITOR = 9 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_STOP = 10 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_INTERRUPT = 11 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_SUSPEND_COUNT = 12 + (CSET_THREAD_REFERENCE << 8);
- public static final int TR_POP_TOP_FRAME = 13 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_NAME = 1 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_SUSPEND = 2 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_RESUME = 3 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_STATUS = 4 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_THREAD_GROUP = 5 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_FRAMES = 6 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_FRAME_COUNT = 7 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_OWNED_MONITORS = 8 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_CURRENT_CONTENDED_MONITOR = 9 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_STOP = 10 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_INTERRUPT = 11 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_SUSPEND_COUNT = 12 + (CSET_THREAD_REFERENCE << 8);
+ public static final int TR_POP_TOP_FRAME = 13 + (CSET_THREAD_REFERENCE << 8);
/** Commands ThreadGroupReference. */
- public static final int TGR_NAME = 1 + (CSET_THREAD_GROUP_REFERENCE << 8);
- public static final int TGR_PARENT = 2 + (CSET_THREAD_GROUP_REFERENCE << 8);
- public static final int TGR_CHILDREN = 3 + (CSET_THREAD_GROUP_REFERENCE << 8);
+ public static final int TGR_NAME = 1 + (CSET_THREAD_GROUP_REFERENCE << 8);
+ public static final int TGR_PARENT = 2 + (CSET_THREAD_GROUP_REFERENCE << 8);
+ public static final int TGR_CHILDREN = 3 + (CSET_THREAD_GROUP_REFERENCE << 8);
/** Commands ArrayReference. */
- public static final int AR_LENGTH = 1 + (CSET_ARRAY_REFERENCE << 8);
- public static final int AR_GET_VALUES = 2 + (CSET_ARRAY_REFERENCE << 8);
- public static final int AR_SET_VALUES = 3 + (CSET_ARRAY_REFERENCE << 8);
+ public static final int AR_LENGTH = 1 + (CSET_ARRAY_REFERENCE << 8);
+ public static final int AR_GET_VALUES = 2 + (CSET_ARRAY_REFERENCE << 8);
+ public static final int AR_SET_VALUES = 3 + (CSET_ARRAY_REFERENCE << 8);
/** Commands ClassLoaderReference. */
- public static final int CLR_VISIBLE_CLASSES = 1 + (CSET_CLASS_LOADER_REFERENCE << 8);
+ public static final int CLR_VISIBLE_CLASSES = 1 + (CSET_CLASS_LOADER_REFERENCE << 8);
/** Commands EventRequest. */
- public static final int ER_SET = 1 + (CSET_EVENT_REQUEST << 8);
- public static final int ER_CLEAR = 2 + (CSET_EVENT_REQUEST << 8);
- public static final int ER_CLEAR_ALL_BREAKPOINTS = 3 + (CSET_EVENT_REQUEST << 8);
+ public static final int ER_SET = 1 + (CSET_EVENT_REQUEST << 8);
+ public static final int ER_CLEAR = 2 + (CSET_EVENT_REQUEST << 8);
+ public static final int ER_CLEAR_ALL_BREAKPOINTS = 3 + (CSET_EVENT_REQUEST << 8);
/** Commands StackFrame. */
- public static final int SF_GET_VALUES = 1 + (CSET_STACK_FRAME << 8);
- public static final int SF_SET_VALUES = 2 + (CSET_STACK_FRAME << 8);
- public static final int SF_THIS_OBJECT = 3 + (CSET_STACK_FRAME << 8);
- public static final int SF_POP_FRAME = 4 + (CSET_STACK_FRAME << 8);
+ public static final int SF_GET_VALUES = 1 + (CSET_STACK_FRAME << 8);
+ public static final int SF_SET_VALUES = 2 + (CSET_STACK_FRAME << 8);
+ public static final int SF_THIS_OBJECT = 3 + (CSET_STACK_FRAME << 8);
+ public static final int SF_POP_FRAME = 4 + (CSET_STACK_FRAME << 8);
/** Commands ClassObjectReference. */
- public static final int COR_REFLECTED_TYPE = 1 + (CSET_CLASS_OBJECT_REFERENCE << 8);
+ public static final int COR_REFLECTED_TYPE = 1 + (CSET_CLASS_OBJECT_REFERENCE << 8);
/** Commands Event. */
- public static final int E_COMPOSITE = 100 + (CSET_EVENT << 8);
+ public static final int E_COMPOSITE = 100 + (CSET_EVENT << 8);
/** Commands Hot Code Replacement (OTI specific). */
- public static final int HCR_CLASSES_HAVE_CHANGED = 1 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_GET_CLASS_VERSION = 2 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_DO_RETURN = 3 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_REENTER_ON_EXIT = 4 + (CSET_HOT_CODE_REPLACEMENT << 8);
- public static final int HCR_CAPABILITIES = 5 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_CLASSES_HAVE_CHANGED = 1 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_GET_CLASS_VERSION = 2 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_DO_RETURN = 3 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_REENTER_ON_EXIT = 4 + (CSET_HOT_CODE_REPLACEMENT << 8);
+ public static final int HCR_CAPABILITIES = 5 + (CSET_HOT_CODE_REPLACEMENT << 8);
/** Mapping of command codes to strings. */
- private static Map fgCommandMap = null;
+ private static Map<Integer, String> fgCommandMap = null;
/** Next id to be assigned. */
private static int fgNextId = 1;
- /** Command, note that this field is 256 * JDWP CommandSet (unsigned) + JDWP Command. */
+ /**
+ * Command, note that this field is 256 * JDWP CommandSet (unsigned) + JDWP
+ * Command.
+ */
private int fCommand;
/**
@@ -186,7 +188,7 @@ public class JdwpCommandPacket extends JdwpPacket {
setCommand(command);
setId(getNewId());
}
-
+
/**
* @return Returns unique id for command packet.
*/
@@ -198,7 +200,7 @@ public class JdwpCommandPacket extends JdwpPacket {
* @return Returns JDWP command set of packet.
*/
public byte getCommandSet() {
- return (byte)(fCommand >>> 8);
+ return (byte) (fCommand >>> 8);
}
/**
@@ -207,30 +209,34 @@ public class JdwpCommandPacket extends JdwpPacket {
public int getCommand() {
return fCommand;
}
-
+
/**
* Assigns command (256 * JDWP CommandSet (unsigned) + JDWP Command)
*/
public void setCommand(int command) {
fCommand = command;
}
-
+
/**
* Reads header fields that are specific for this type of packet.
*/
- protected void readSpecificHeaderFields(DataInputStream dataInStream) throws IOException {
+ @Override
+ protected void readSpecificHeaderFields(DataInputStream dataInStream)
+ throws IOException {
byte commandSet = dataInStream.readByte();
- fCommand = dataInStream.readByte() + (commandSet << 8);
+ fCommand = dataInStream.readByte() + (commandSet << 8);
}
/**
* Writes header fields that are specific for this type of packet.
*/
- protected void writeSpecificHeaderFields(DataOutputStream dataOutStream) throws IOException {
+ @Override
+ protected void writeSpecificHeaderFields(DataOutputStream dataOutStream)
+ throws IOException {
dataOutStream.writeByte(getCommandSet());
- dataOutStream.writeByte((byte)fCommand);
+ dataOutStream.writeByte((byte) fCommand);
}
-
+
/**
* Retrieves constant mappings.
*/
@@ -238,14 +244,15 @@ public class JdwpCommandPacket extends JdwpPacket {
if (fgCommandMap != null) {
return;
}
-
+
Field[] fields = JdwpCommandPacket.class.getDeclaredFields();
-
+
// First get the set names.
- Map setNames = new HashMap(fields.length);
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0)
+ Map<Integer, String> setNames = new HashMap<Integer, String>(fields.length);
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0)
continue;
try {
@@ -264,30 +271,31 @@ public class JdwpCommandPacket extends JdwpPacket {
// in this class are numbers that are convertible to int.
}
}
-
- // Get the commands.
- fgCommandMap = new HashMap();
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
+
+ // Get the commands.
+ fgCommandMap = new HashMap<Integer, String>();
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
}
-
+
try {
String name = field.getName();
-
+
// If it is a set, continue.
if (name.startsWith("CSET_")) { //$NON-NLS-1$
continue;
}
- Integer val = (Integer)field.get(null);
- int value = val.intValue();
+ Integer val = (Integer) field.get(null);
+ int value = val.intValue();
int set = value >>> 8;
- String setName = (String)setNames.get(new Integer(set));
+ String setName = setNames.get(new Integer(set));
String entryName = setName + " - " + removePrefix(name); //$NON-NLS-1$
-
+
fgCommandMap.put(val, entryName);
-
+
} catch (IllegalAccessException e) {
// Will not occur for own class.
}
@@ -297,11 +305,11 @@ public class JdwpCommandPacket extends JdwpPacket {
/**
* @return Returns a map with string representations of error codes.
*/
- public static Map commandMap() {
+ public static Map<Integer, String> commandMap() {
getConstantMaps();
return fgCommandMap;
}
-
+
/**
* @return Returns string without XXX_ prefix.
*/
@@ -309,7 +317,7 @@ public class JdwpCommandPacket extends JdwpPacket {
int i = str.indexOf('_');
if (i < 0) {
return str;
- }
+ }
return str.substring(i + 1);
}
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpConversation.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpConversation.java
index fd46ae3e7..ed7fddaef 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpConversation.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpConversation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.jdi.internal.spy;
import com.ibm.icu.text.MessageFormat;
-
public class JdwpConversation {
private int fId;
private JdwpCommandPacket fCommand;
@@ -24,14 +23,18 @@ public class JdwpConversation {
void setCommand(JdwpCommandPacket command) {
if (fCommand != null) {
- throw new IllegalArgumentException(MessageFormat.format("Attempt to overwrite command with {0}", new String[] {command.toString()})); //$NON-NLS-1$
+ throw new IllegalArgumentException(
+ MessageFormat
+ .format("Attempt to overwrite command with {0}", new Object[] { command.toString() })); //$NON-NLS-1$
}
fCommand = command;
}
void setReply(JdwpReplyPacket reply) {
if (fReply != null) {
- throw new IllegalArgumentException(MessageFormat.format("Attempt to overwrite reply with {0}", new String[] {reply.toString()})); //$NON-NLS-1$
+ throw new IllegalArgumentException(
+ MessageFormat
+ .format("Attempt to overwrite reply with {0}", new Object[] { reply.toString() })); //$NON-NLS-1$
}
fReply = reply;
}
@@ -43,7 +46,7 @@ public class JdwpConversation {
public JdwpReplyPacket getReply() {
return fReply;
}
-
+
public int getId() {
return fId;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpPacket.java
index 312479579..abef480b8 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpPacket.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.spy;
-
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -21,15 +20,15 @@ import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
/**
- * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
- * declared by the JDWP specification.
- *
+ * This class implements the corresponding Java Debug Wire Protocol (JDWP)
+ * packet declared by the JDWP specification.
+ *
*/
public abstract class JdwpPacket {
/** General JDWP constants. */
- public static final byte FLAG_REPLY_PACKET = (byte)0x80;
+ public static final byte FLAG_REPLY_PACKET = (byte) 0x80;
protected static final int MIN_PACKET_LENGTH = 11;
-
+
/** Map with Strings for flag bits. */
private static String[] fgFlagStrings = null;
@@ -37,11 +36,11 @@ public abstract class JdwpPacket {
protected int fId = 0;
protected byte fFlags = 0;
protected byte[] fDataBuf = null;
-
+
/**
* Set Id.
*/
- /*package*/ void setId(int id) {
+ /* package */void setId(int id) {
fId = id;
}
@@ -51,14 +50,14 @@ public abstract class JdwpPacket {
public int getId() {
return fId;
}
-
+
/**
* Set Flags.
*/
- /*package*/ void setFlags(byte flags) {
+ /* package */void setFlags(byte flags) {
fFlags = flags;
}
-
+
/**
* @return Returns Flags.
*/
@@ -72,14 +71,14 @@ public abstract class JdwpPacket {
public int getLength() {
return MIN_PACKET_LENGTH + getDataLength();
}
-
+
/**
* @return Returns length of data in packet.
*/
public int getDataLength() {
return fDataBuf == null ? 0 : fDataBuf.length;
}
-
+
/**
* @return Returns data of packet.
*/
@@ -88,13 +87,14 @@ public abstract class JdwpPacket {
}
/**
- * @return Returns DataInputStream with reply data, or an empty stream if there is none.
+ * @return Returns DataInputStream with reply data, or an empty stream if
+ * there is none.
*/
public DataInputStream dataInStream() {
if (fDataBuf != null) {
return new DataInputStream(new ByteArrayInputStream(fDataBuf));
}
-
+
return new DataInputStream(new ByteArrayInputStream(new byte[0]));
}
@@ -104,17 +104,19 @@ public abstract class JdwpPacket {
public void setData(byte[] data) {
fDataBuf = data;
}
-
+
/**
* Reads header fields that are specific for a type of packet.
*/
- protected abstract void readSpecificHeaderFields(DataInputStream dataInStream) throws IOException;
-
+ protected abstract void readSpecificHeaderFields(
+ DataInputStream dataInStream) throws IOException;
+
/**
* Writes header fields that are specific for a type of packet.
*/
- protected abstract void writeSpecificHeaderFields(DataOutputStream dataOutStream) throws IOException;
-
+ protected abstract void writeSpecificHeaderFields(
+ DataOutputStream dataOutStream) throws IOException;
+
/**
* Reads complete packet.
*/
@@ -132,41 +134,42 @@ public abstract class JdwpPacket {
packet = new JdwpReplyPacket();
else
packet = new JdwpCommandPacket();
-
+
// Assign generic header fields.
packet.setId(id);
packet.setFlags(flags);
-
+
// Read specific header fields and data.
packet.readSpecificHeaderFields(dataInStream);
if (packetLength - MIN_PACKET_LENGTH > 0) {
packet.fDataBuf = new byte[packetLength - MIN_PACKET_LENGTH];
dataInStream.readFully(packet.fDataBuf);
}
-
+
return packet;
}
-
+
/**
* Writes complete packet.
*/
public void write(OutputStream outStream) throws IOException {
DataOutputStream dataOutStream = new DataOutputStream(outStream);
-
+
writeHeader(dataOutStream);
writeData(dataOutStream);
}
-
+
/**
* Writes header of packet.
*/
- protected void writeHeader(DataOutputStream dataOutStream) throws IOException {
+ protected void writeHeader(DataOutputStream dataOutStream)
+ throws IOException {
dataOutStream.writeInt(getLength());
dataOutStream.writeInt(getId());
dataOutStream.writeByte(getFlags());
writeSpecificHeaderFields(dataOutStream);
}
-
+
/**
* Writes data of packet.
*/
@@ -176,7 +179,6 @@ public abstract class JdwpPacket {
}
}
-
/**
* Retrieves constant mappings.
*/
@@ -184,29 +186,30 @@ public abstract class JdwpPacket {
if (fgFlagStrings != null) {
return;
}
-
+
Field[] fields = JdwpPacket.class.getDeclaredFields();
fgFlagStrings = new String[8];
-
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0) {
+
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0) {
continue;
}
-
+
String name = field.getName();
if (!name.startsWith("FLAG_")) {//$NON-NLS-1$
continue;
}
-
+
name = name.substring(5);
-
+
try {
byte value = field.getByte(null);
-
+
for (int j = 0; j < fgFlagStrings.length; j++) {
if ((1 << j & value) != 0) {
- fgFlagStrings[j]= name;
+ fgFlagStrings[j] = name;
break;
}
}
@@ -219,7 +222,7 @@ public abstract class JdwpPacket {
}
}
}
-
+
/**
* @return Returns a mapping with string representations of flags.
*/
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpReplyPacket.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpReplyPacket.java
index 0c127121b..de9f2b5f6 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpReplyPacket.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/JdwpReplyPacket.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.spy;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -20,9 +19,9 @@ import java.util.HashMap;
import java.util.Map;
/**
- * This class implements the corresponding Java Debug Wire Protocol (JDWP) packet
- * declared by the JDWP specification.
- *
+ * This class implements the corresponding Java Debug Wire Protocol (JDWP)
+ * packet declared by the JDWP specification.
+ *
*/
public class JdwpReplyPacket extends JdwpPacket {
/** Error code constants. */
@@ -82,27 +81,28 @@ public class JdwpReplyPacket extends JdwpPacket {
public static final short TRANSPORT_INIT = 510;
public static final short NATIVE_METHOD = 511;
public static final short INVALID_COUNT = 512;
- public static final short HCR_OPERATION_REFUSED = 900; // HCR specific.
-
+ public static final short HCR_OPERATION_REFUSED = 900; // HCR specific.
+
/** Mapping of error codes to strings. */
- private static HashMap fErrorMap = null;
+ private static HashMap<Integer, String> fErrorMap = null;
/** JDWP Error code. */
private short fErrorCode;
+
/**
* Creates new JdwpReplyPacket.
*/
public JdwpReplyPacket() {
setFlags(FLAG_REPLY_PACKET);
}
-
+
/**
* @return Returns JDWP Error code.
*/
public short errorCode() {
return fErrorCode;
}
-
+
/**
* Assigns JDWP Error code.
*/
@@ -113,14 +113,18 @@ public class JdwpReplyPacket extends JdwpPacket {
/**
* Reads header fields that are specific for this type of packet.
*/
- protected void readSpecificHeaderFields(DataInputStream dataInStream) throws IOException {
+ @Override
+ protected void readSpecificHeaderFields(DataInputStream dataInStream)
+ throws IOException {
fErrorCode = dataInStream.readShort();
}
/**
* Writes header fields that are specific for this type of packet.
*/
- protected void writeSpecificHeaderFields(DataOutputStream dataOutStream) throws IOException {
+ @Override
+ protected void writeSpecificHeaderFields(DataOutputStream dataOutStream)
+ throws IOException {
dataOutStream.writeShort(fErrorCode);
}
@@ -131,14 +135,15 @@ public class JdwpReplyPacket extends JdwpPacket {
if (fErrorMap != null) {
return;
}
-
+
Field[] fields = JdwpReplyPacket.class.getDeclaredFields();
- fErrorMap = new HashMap(fields.length);
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if ((field.getModifiers() & Modifier.PUBLIC) == 0 || (field.getModifiers() & Modifier.STATIC) == 0 || (field.getModifiers() & Modifier.FINAL) == 0)
+ fErrorMap = new HashMap<Integer, String>(fields.length);
+ for (Field field : fields) {
+ if ((field.getModifiers() & Modifier.PUBLIC) == 0
+ || (field.getModifiers() & Modifier.STATIC) == 0
+ || (field.getModifiers() & Modifier.FINAL) == 0)
continue;
-
+
try {
Integer intValue = new Integer(field.getInt(null));
fErrorMap.put(intValue, field.getName());
@@ -155,7 +160,7 @@ public class JdwpReplyPacket extends JdwpPacket {
/**
* @return Returns a map with string representations of error codes.
*/
- public static Map errorMap() {
+ public static Map<Integer, String> errorMap() {
getConstantMaps();
return fErrorMap;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/TcpipSpy.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/TcpipSpy.java
index f8df6bef1..0c21c62a8 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/TcpipSpy.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/TcpipSpy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.spy;
-
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
@@ -26,33 +25,33 @@ import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
-import com.ibm.icu.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
+import com.ibm.icu.text.MessageFormat;
+
/**
- * This class can be used to spy all JDWP packets. It should be configured 'in between' the debugger
- * application and the VM (or J9 debug proxy).
- * Its parameters are:
- * 1) The port number to which the debugger application connects;
- * 2) The name of the host on which the VM or proxy waits for a JDWP connection;
- * 3) The port number on which the VM or proxy waits for a JDWP connection;
- * 4) The file where the trace is written to.
- *
+ * This class can be used to spy all JDWP packets. It should be configured 'in
+ * between' the debugger application and the VM (or J9 debug proxy). Its
+ * parameters are: 1) The port number to which the debugger application
+ * connects; 2) The name of the host on which the VM or proxy waits for a JDWP
+ * connection; 3) The port number on which the VM or proxy waits for a JDWP
+ * connection; 4) The file where the trace is written to.
+ *
* Note that if this program is used for tracing JDWP activity of Leapfrog, the
- * 'debug remote program' option must be used, and the J9 proxy must first be started up by hand
- * on the port to which Leapfrog will connect.
- * The J9 proxy that is started up by Leapfrog is not used and will return immediately.
+ * 'debug remote program' option must be used, and the J9 proxy must first be
+ * started up by hand on the port to which Leapfrog will connect. The J9 proxy
+ * that is started up by Leapfrog is not used and will return immediately.
*/
public class TcpipSpy extends Thread {
- private static final byte[] handshakeBytes= "JDWP-Handshake".getBytes(); //$NON-NLS-1$
+ private static final byte[] handshakeBytes = "JDWP-Handshake".getBytes(); //$NON-NLS-1$
private boolean fVMtoDebugger;
private DataInputStream fDataIn;
private DataOutputStream fDataOut;
- private static VerbosePacketStream out= new VerbosePacketStream(System.out);
- private static Map fPackets= new HashMap();
+ private static VerbosePacketStream out = new VerbosePacketStream(System.out);
+ private static Map<Integer, JdwpConversation> fPackets = new HashMap<Integer, JdwpConversation>();
private static int fFieldIDSize;
private static int fMethodIDSize;
@@ -62,66 +61,74 @@ public class TcpipSpy extends Thread {
private static boolean fHasSizes;
public TcpipSpy(boolean VMtoDebugger, InputStream in, OutputStream out) {
- fVMtoDebugger= VMtoDebugger;
- fDataIn= new DataInputStream(new BufferedInputStream(in));
- fDataOut= new DataOutputStream(new BufferedOutputStream(out));
- fHasSizes= false;
+ fVMtoDebugger = VMtoDebugger;
+ fDataIn = new DataInputStream(new BufferedInputStream(in));
+ fDataOut = new DataOutputStream(new BufferedOutputStream(out));
+ fHasSizes = false;
}
public static void main(String[] args) {
- int inPort= 0;
- String serverHost= null;
- int outPort= 0;
- String outputFile= null;
+ int inPort = 0;
+ String serverHost = null;
+ int outPort = 0;
+ String outputFile = null;
try {
- inPort= Integer.parseInt(args[0]);
- serverHost= args[1];
- outPort= Integer.parseInt(args[2]);
+ inPort = Integer.parseInt(args[0]);
+ serverHost = args[1];
+ outPort = Integer.parseInt(args[2]);
if (args.length > 3) {
- outputFile= args[3];
+ outputFile = args[3];
}
} catch (Exception e) {
- out.println("usage: TcpipSpy <client port> <server host> <server port> [<output file>]"); //$NON-NLS-1$
+ out.println("usage: TcpipSpy <client port> <server host> <server port> [<output file>]"); //$NON-NLS-1$
System.exit(-1);
}
if (outputFile != null) {
- File file= new File(outputFile);
- out.println(MessageFormat.format("Writing output to {0}", new String[] {file.getAbsolutePath()})); //$NON-NLS-1$
+ File file = new File(outputFile);
+ out.println(MessageFormat
+ .format("Writing output to {0}", new Object[] { file.getAbsolutePath() })); //$NON-NLS-1$
try {
- out= new VerbosePacketStream(new BufferedOutputStream(new FileOutputStream(file)));
+ out = new VerbosePacketStream(new BufferedOutputStream(
+ new FileOutputStream(file)));
} catch (FileNotFoundException e) {
- out.println(MessageFormat.format("Could not open {0}. Using stdout instead", new String[] {file.getAbsolutePath()})); //$NON-NLS-1$
+ out.println(MessageFormat
+ .format("Could not open {0}. Using stdout instead", new Object[] { file.getAbsolutePath() })); //$NON-NLS-1$
}
}
out.println();
try {
- ServerSocket serverSock= new ServerSocket(inPort);
- Socket inSock= serverSock.accept();
- Socket outSock= new Socket(InetAddress.getByName(serverHost), outPort);
- new TcpipSpy(false, inSock.getInputStream(), outSock.getOutputStream()).start();
- new TcpipSpy(true, outSock.getInputStream(), inSock.getOutputStream()).start();
+ ServerSocket serverSock = new ServerSocket(inPort);
+ Socket inSock = serverSock.accept();
+ Socket outSock = new Socket(InetAddress.getByName(serverHost),
+ outPort);
+ new TcpipSpy(false, inSock.getInputStream(),
+ outSock.getOutputStream()).start();
+ new TcpipSpy(true, outSock.getInputStream(),
+ inSock.getOutputStream()).start();
} catch (Exception e) {
out.println(e);
}
}
+ @Override
public void run() {
try {
// Skip handshake.
int handshakeLength;
- handshakeLength= handshakeBytes.length;
+ handshakeLength = handshakeBytes.length;
while (handshakeLength-- > 0) {
- int b= fDataIn.read();
+ int b = fDataIn.read();
fDataOut.write(b);
}
fDataOut.flush();
// Print all packages.
while (true) {
- JdwpPacket p= JdwpPacket.read(fDataIn);
- // we need to store conversation only for command send by the debugger,
+ JdwpPacket p = JdwpPacket.read(fDataIn);
+ // we need to store conversation only for command send by the
+ // debugger,
// as there is no answer from the debugger to VM commands.
if (!(fVMtoDebugger && (p.getFlags() & JdwpPacket.FLAG_REPLY_PACKET) == 0)) {
store(p);
@@ -134,7 +141,8 @@ public class TcpipSpy extends Thread {
} catch (EOFException e) {
} catch (SocketException e) {
} catch (IOException e) {
- out.println(MessageFormat.format("Caught exception: {0}", new String[] {e.toString()})); //$NON-NLS-1$
+ out.println(MessageFormat.format(
+ "Caught exception: {0}", new Object[] { e.toString() })); //$NON-NLS-1$
e.printStackTrace(out);
} finally {
try {
@@ -147,17 +155,19 @@ public class TcpipSpy extends Thread {
}
public static JdwpCommandPacket getCommand(int id) {
- JdwpConversation conversation= (JdwpConversation) fPackets.get(new Integer(id));
+ JdwpConversation conversation = fPackets
+ .get(new Integer(id));
if (conversation != null)
return conversation.getCommand();
return null;
}
protected static void store(JdwpPacket packet) {
- int id= packet.getId();
- JdwpConversation conversation= (JdwpConversation) fPackets.get(new Integer(id));
+ int id = packet.getId();
+ JdwpConversation conversation = fPackets
+ .get(new Integer(id));
if (conversation == null) {
- conversation= new JdwpConversation(id);
+ conversation = new JdwpConversation(id);
fPackets.put(new Integer(id), conversation);
}
@@ -168,14 +178,16 @@ public class TcpipSpy extends Thread {
}
}
- public static int getCommand(JdwpPacket packet) throws UnableToParseDataException {
- JdwpCommandPacket command= null;
+ public static int getCommand(JdwpPacket packet)
+ throws UnableToParseDataException {
+ JdwpCommandPacket command = null;
if (packet instanceof JdwpCommandPacket) {
- command= (JdwpCommandPacket) packet;
+ command = (JdwpCommandPacket) packet;
} else {
- command= getCommand(packet.getId());
+ command = getCommand(packet.getId());
if (command == null) {
- throw new UnableToParseDataException("This packet is marked as reply, but there is no command with the same id.", null); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "This packet is marked as reply, but there is no command with the same id.", null); //$NON-NLS-1$
}
}
return command.getCommand();
@@ -186,11 +198,11 @@ public class TcpipSpy extends Thread {
}
public static void setHasSizes(boolean value) {
- fHasSizes= value;
+ fHasSizes = value;
}
public static void setFieldIDSize(int fieldIDSize) {
- fFieldIDSize= fieldIDSize;
+ fFieldIDSize = fieldIDSize;
}
public static int getFieldIDSize() {
@@ -198,7 +210,7 @@ public class TcpipSpy extends Thread {
}
public static void setMethodIDSize(int methodIDSize) {
- fMethodIDSize= methodIDSize;
+ fMethodIDSize = methodIDSize;
}
public static int getMethodIDSize() {
@@ -206,7 +218,7 @@ public class TcpipSpy extends Thread {
}
public static void setObjectIDSize(int objectIDSize) {
- fObjectIDSize= objectIDSize;
+ fObjectIDSize = objectIDSize;
}
public static int getObjectIDSize() {
@@ -214,7 +226,7 @@ public class TcpipSpy extends Thread {
}
public static void setReferenceTypeIDSize(int referenceTypeIDSize) {
- fReferenceTypeIDSize= referenceTypeIDSize;
+ fReferenceTypeIDSize = referenceTypeIDSize;
}
public static int getReferenceTypeIDSize() {
@@ -222,7 +234,7 @@ public class TcpipSpy extends Thread {
}
public static void setFrameIDSize(int frameIDSize) {
- fFrameIDSize= frameIDSize;
+ fFrameIDSize = frameIDSize;
}
public static int getFrameIDSize() {
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/UnableToParseDataException.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/UnableToParseDataException.java
index 901b2c068..66221b9e1 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/UnableToParseDataException.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/UnableToParseDataException.java
@@ -10,25 +10,24 @@
*******************************************************************************/
package org.eclipse.jdi.internal.spy;
-
/**
* Exception throws when the spy have not enough information form correctly
* parse the data.
*/
public class UnableToParseDataException extends Exception {
- /**
- * All serializable objects should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
private byte[] fRemainingData;
public UnableToParseDataException(String message, byte[] remainingData) {
super(message);
- fRemainingData= remainingData;
+ fRemainingData = remainingData;
}
-
+
public byte[] getRemainingData() {
return fRemainingData;
}
diff --git a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/VerbosePacketStream.java b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/VerbosePacketStream.java
index 5143e264c..9d05da794 100644
--- a/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/VerbosePacketStream.java
+++ b/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/spy/VerbosePacketStream.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,149 +11,162 @@
*******************************************************************************/
package org.eclipse.jdi.internal.spy;
-
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.UTFDataFormatException;
-import com.ibm.icu.text.MessageFormat;
import java.util.Arrays;
+import com.ibm.icu.text.MessageFormat;
+
/**
- * The <code>VerbosePacketWriter</code> is responsible for writing
- * out JdwpPacket data in human readable form.
+ * The <code>VerbosePacketWriter</code> is responsible for writing out
+ * JdwpPacket data in human readable form.
*/
public class VerbosePacketStream extends PrintStream {
/** Tag Constants. */
-// public static final byte NULL_TAG = 91; // Used for tagged null values.
- public static final byte ARRAY_TAG = 91; // '[' - an array object (objectID size).
- public static final byte BYTE_TAG = 66; // 'B' - a byte value (1 byte).
- public static final byte CHAR_TAG = 67; // 'C' - a character value (2 bytes).
- public static final byte OBJECT_TAG = 76; // 'L' - an object (objectID size).
- public static final byte FLOAT_TAG = 70; // 'F' - a float value (4 bytes).
- public static final byte DOUBLE_TAG = 68; // 'D' - a double value (8 bytes).
- public static final byte INT_TAG = 73; // 'I' - an int value (4 bytes).
- public static final byte LONG_TAG = 74; // 'J' - a long value (8 bytes).
- public static final byte SHORT_TAG = 83; // 'S' - a short value (2 bytes).
- public static final byte VOID_TAG = 86; // 'V' - a void value (no bytes).
- public static final byte BOOLEAN_TAG = 90; // 'Z' - a boolean value (1 byte).
- public static final byte STRING_TAG = 115; // 's' - a String object (objectID size).
- public static final byte THREAD_TAG = 116; // 't' - a Thread object (objectID size).
- public static final byte THREAD_GROUP_TAG = 103; // 'g' - a ThreadGroup object (objectID size).
- public static final byte CLASS_LOADER_TAG = 108; // 'l' - a ClassLoader object (objectID size).
- public static final byte CLASS_OBJECT_TAG = 99; // 'c' - a class object object (objectID size).
-
+ // public static final byte NULL_TAG = 91; // Used for tagged null values.
+ public static final byte ARRAY_TAG = 91; // '[' - an array object (objectID
+ // size).
+ public static final byte BYTE_TAG = 66; // 'B' - a byte value (1 byte).
+ public static final byte CHAR_TAG = 67; // 'C' - a character value (2
+ // bytes).
+ public static final byte OBJECT_TAG = 76; // 'L' - an object (objectID
+ // size).
+ public static final byte FLOAT_TAG = 70; // 'F' - a float value (4 bytes).
+ public static final byte DOUBLE_TAG = 68; // 'D' - a double value (8 bytes).
+ public static final byte INT_TAG = 73; // 'I' - an int value (4 bytes).
+ public static final byte LONG_TAG = 74; // 'J' - a long value (8 bytes).
+ public static final byte SHORT_TAG = 83; // 'S' - a short value (2 bytes).
+ public static final byte VOID_TAG = 86; // 'V' - a void value (no bytes).
+ public static final byte BOOLEAN_TAG = 90; // 'Z' - a boolean value (1
+ // byte).
+ public static final byte STRING_TAG = 115; // 's' - a String object
+ // (objectID size).
+ public static final byte THREAD_TAG = 116; // 't' - a Thread object
+ // (objectID size).
+ public static final byte THREAD_GROUP_TAG = 103; // 'g' - a ThreadGroup
+ // object (objectID
+ // size).
+ public static final byte CLASS_LOADER_TAG = 108; // 'l' - a ClassLoader
+ // object (objectID
+ // size).
+ public static final byte CLASS_OBJECT_TAG = 99; // 'c' - a class object
+ // object (objectID size).
+
/** TypeTag Constants. */
- public static final byte TYPE_TAG_CLASS = 1; // ReferenceType is a class.
- public static final byte TYPE_TAG_INTERFACE = 2; // ReferenceType is an interface.
- public static final byte TYPE_TAG_ARRAY = 3; // ReferenceType is an array.
-
+ public static final byte TYPE_TAG_CLASS = 1; // ReferenceType is a class.
+ public static final byte TYPE_TAG_INTERFACE = 2; // ReferenceType is an
+ // interface.
+ public static final byte TYPE_TAG_ARRAY = 3; // ReferenceType is an array.
+
/** ClassStatus Constants. */
public static final int JDWP_CLASS_STATUS_VERIFIED = 1;
public static final int JDWP_CLASS_STATUS_PREPARED = 2;
public static final int JDWP_CLASS_STATUS_INITIALIZED = 4;
public static final int JDWP_CLASS_STATUS_ERROR = 8;
-
+
/** access_flags Constants */
- public static final int ACC_PUBLIC= 0x0001;
- public static final int ACC_PRIVATE= 0x0002;
- public static final int ACC_PROTECTED= 0x0004;
- public static final int ACC_STATIC= 0x0008;
- public static final int ACC_FINAL= 0x0010;
- public static final int ACC_SUPER= 0x0020;
- public static final int ACC_VOLATILE= 0x0040;
- public static final int ACC_TRANSIENT= 0x0080;
- public static final int ACC_NATIVE= 0x0100;
- public static final int ACC_INTERFACE= 0x0200;
- public static final int ACC_ABSTRACT= 0x0400;
- public static final int ACC_STRICT= 0x0800;
- public static final int ACC_ENUM= 0x0100;
- public static final int ACC_VARARGS= 0x0080;
- public static final int ACC_BRIDGE= 0x0040;
- public static final int ACC_SYNTHETIC= 0x1000;
- public static final int ACC_SYNCHRONIZED=0x0020;
-
- public static final int ACC_EXT_SYNTHETIC= 0xf0000000;
-
+ public static final int ACC_PUBLIC = 0x0001;
+ public static final int ACC_PRIVATE = 0x0002;
+ public static final int ACC_PROTECTED = 0x0004;
+ public static final int ACC_STATIC = 0x0008;
+ public static final int ACC_FINAL = 0x0010;
+ public static final int ACC_SUPER = 0x0020;
+ public static final int ACC_VOLATILE = 0x0040;
+ public static final int ACC_TRANSIENT = 0x0080;
+ public static final int ACC_NATIVE = 0x0100;
+ public static final int ACC_INTERFACE = 0x0200;
+ public static final int ACC_ABSTRACT = 0x0400;
+ public static final int ACC_STRICT = 0x0800;
+ public static final int ACC_ENUM = 0x0100;
+ public static final int ACC_VARARGS = 0x0080;
+ public static final int ACC_BRIDGE = 0x0040;
+ public static final int ACC_SYNTHETIC = 0x1000;
+ public static final int ACC_SYNCHRONIZED = 0x0020;
+
+ public static final int ACC_EXT_SYNTHETIC = 0xf0000000;
+
/** Invoke options constants */
- public static final int INVOKE_SINGLE_THREADED= 0x01;
- public static final int INVOKE_NONVIRTUAL= 0x02;
-
+ public static final int INVOKE_SINGLE_THREADED = 0x01;
+ public static final int INVOKE_NONVIRTUAL = 0x02;
+
/** ThreadStatus Constants */
- public static final int THREAD_STATUS_ZOMBIE= 0;
- public static final int THREAD_STATUS_RUNNING= 1;
- public static final int THREAD_STATUS_SLEEPING= 2;
- public static final int THREAD_STATUS_MONITOR= 3;
- public static final int THREAD_STATUS_WAIT= 4;
-
+ public static final int THREAD_STATUS_ZOMBIE = 0;
+ public static final int THREAD_STATUS_RUNNING = 1;
+ public static final int THREAD_STATUS_SLEEPING = 2;
+ public static final int THREAD_STATUS_MONITOR = 3;
+ public static final int THREAD_STATUS_WAIT = 4;
+
/** EventKind Constants */
- public static final int EVENTKIND_SINGLE_STEP= 1;
- public static final int EVENTKIND_BREAKPOINT= 2;
- public static final int EVENTKIND_FRAME_POP= 3;
- public static final int EVENTKIND_EXCEPTION= 4;
- public static final int EVENTKIND_USER_DEFINED= 5;
- public static final int EVENTKIND_THREAD_START= 6;
- public static final int EVENTKIND_THREAD_END= 7;
- public static final int EVENTKIND_THREAD_DEATH= EVENTKIND_THREAD_END;
- public static final int EVENTKIND_CLASS_PREPARE= 8;
- public static final int EVENTKIND_CLASS_UNLOAD= 9;
- public static final int EVENTKIND_CLASS_LOAD= 10;
- public static final int EVENTKIND_FIELD_ACCESS= 20;
- public static final int EVENTKIND_FIELD_MODIFICATION= 21;
- public static final int EVENTKIND_EXCEPTION_CATCH= 30;
- public static final int EVENTKIND_METHOD_ENTRY= 40;
- public static final int EVENTKIND_METHOD_EXIT= 41;
- public static final int EVENTKIND_VM_INIT= 90;
- public static final int EVENTKIND_VM_START= EVENTKIND_VM_INIT;
- public static final int EVENTKIND_VM_DEATH= 99;
- public static final int EVENTKIND_VM_DISCONNECTED= 100;
-
+ public static final int EVENTKIND_SINGLE_STEP = 1;
+ public static final int EVENTKIND_BREAKPOINT = 2;
+ public static final int EVENTKIND_FRAME_POP = 3;
+ public static final int EVENTKIND_EXCEPTION = 4;
+ public static final int EVENTKIND_USER_DEFINED = 5;
+ public static final int EVENTKIND_THREAD_START = 6;
+ public static final int EVENTKIND_THREAD_END = 7;
+ public static final int EVENTKIND_THREAD_DEATH = EVENTKIND_THREAD_END;
+ public static final int EVENTKIND_CLASS_PREPARE = 8;
+ public static final int EVENTKIND_CLASS_UNLOAD = 9;
+ public static final int EVENTKIND_CLASS_LOAD = 10;
+ public static final int EVENTKIND_FIELD_ACCESS = 20;
+ public static final int EVENTKIND_FIELD_MODIFICATION = 21;
+ public static final int EVENTKIND_EXCEPTION_CATCH = 30;
+ public static final int EVENTKIND_METHOD_ENTRY = 40;
+ public static final int EVENTKIND_METHOD_EXIT = 41;
+ public static final int EVENTKIND_VM_INIT = 90;
+ public static final int EVENTKIND_VM_START = EVENTKIND_VM_INIT;
+ public static final int EVENTKIND_VM_DEATH = 99;
+ public static final int EVENTKIND_VM_DISCONNECTED = 100;
+
/** SuspendStatus Constants */
- public static final int SUSPEND_STATUS_SUSPENDED= 0x01;
-
+ public static final int SUSPEND_STATUS_SUSPENDED = 0x01;
+
/** SuspendPolicy Constants */
- public static final int SUSPENDPOLICY_NONE= 0;
- public static final int SUSPENDPOLICY_EVENT_THREAD= 1;
- public static final int SUSPENDPOLICY_ALL= 2;
-
+ public static final int SUSPENDPOLICY_NONE = 0;
+ public static final int SUSPENDPOLICY_EVENT_THREAD = 1;
+ public static final int SUSPENDPOLICY_ALL = 2;
+
/** StepDepth Constants */
- public static final int STEPDEPTH_INTO= 0;
- public static final int STEPDEPTH_OVER= 1;
- public static final int STEPDEPTH_OUT= 2;
+ public static final int STEPDEPTH_INTO = 0;
+ public static final int STEPDEPTH_OVER = 1;
+ public static final int STEPDEPTH_OUT = 2;
/** StepSize Constants */
- public static final int STEPSIZE_MIN= 0;
- public static final int STEPSIZE_LINE= 1;
-
+ public static final int STEPSIZE_MIN = 0;
+ public static final int STEPSIZE_LINE = 1;
+
private static final byte[] padding;
static {
- padding= new byte[256];
- Arrays.fill(padding, (byte)' ');
+ padding = new byte[256];
+ Arrays.fill(padding, (byte) ' ');
}
-
- private static final String shift= new String(padding, 0, 32);
+
+ private static final String shift = new String(padding, 0, 32);
public VerbosePacketStream(OutputStream out) {
super(out);
}
-
+
private static final byte[] zeros;
static {
- zeros= new byte[16];
- Arrays.fill(zeros, (byte)'0');
+ zeros = new byte[16];
+ Arrays.fill(zeros, (byte) '0');
}
-
- public synchronized void print(JdwpPacket packet, boolean fromVM) throws IOException {
+
+ public synchronized void print(JdwpPacket packet, boolean fromVM)
+ throws IOException {
try {
printHeader(packet, fromVM);
printData(packet);
println();
} catch (UnableToParseDataException e) {
println("\n" + e.getMessage() + ':'); //$NON-NLS-1$
- printDescription("Remaining data:"); //$NON-NLS-1$
- byte[] data= e.getRemainingData();
+ printDescription("Remaining data:"); //$NON-NLS-1$
+ byte[] data = e.getRemainingData();
if (data == null) {
printHex(packet.data());
} else {
@@ -162,32 +175,34 @@ public class VerbosePacketStream extends PrintStream {
println();
}
}
-
- protected void printHeader(JdwpPacket packet, boolean fromVM) throws UnableToParseDataException {
+
+ protected void printHeader(JdwpPacket packet, boolean fromVM)
+ throws UnableToParseDataException {
if (fromVM) {
- println("From VM"); //$NON-NLS-1$
+ println("From VM"); //$NON-NLS-1$
} else {
- println("From Debugger"); //$NON-NLS-1$
+ println("From Debugger"); //$NON-NLS-1$
}
-
- printDescription("Packet ID:"); //$NON-NLS-1$
+
+ printDescription("Packet ID:"); //$NON-NLS-1$
printHex(packet.getId());
println();
-
- printDescription("Length:"); //$NON-NLS-1$
+
+ printDescription("Length:"); //$NON-NLS-1$
print(packet.getLength());
println();
-
- printDescription("Flags:"); //$NON-NLS-1$
- byte flags= packet.getFlags();
+
+ printDescription("Flags:"); //$NON-NLS-1$
+ byte flags = packet.getFlags();
printHex(flags);
if ((flags & JdwpPacket.FLAG_REPLY_PACKET) != 0) {
- print(MessageFormat.format(" (REPLY to {0})", new String[] {(String) JdwpCommandPacket.commandMap().get(new Integer(TcpipSpy.getCommand(packet)))})); //$NON-NLS-1$
+ print(MessageFormat
+ .format(" (REPLY to {0})", new Object[] { JdwpCommandPacket.commandMap().get(new Integer(TcpipSpy.getCommand(packet))) })); //$NON-NLS-1$
} else {
- print(" (COMMAND)"); //$NON-NLS-1$
+ print(" (COMMAND)"); //$NON-NLS-1$
}
println();
-
+
printSpecificHeaderFields(packet);
}
@@ -200,14 +215,14 @@ public class VerbosePacketStream extends PrintStream {
}
protected void printCommand(JdwpCommandPacket commandPacket) {
- printDescription("Command set:"); //$NON-NLS-1$
- int commandAndSet= commandPacket.getCommand();
- byte set= (byte)(commandAndSet >> 8);
- byte command= (byte)commandAndSet;
+ printDescription("Command set:"); //$NON-NLS-1$
+ int commandAndSet = commandPacket.getCommand();
+ byte set = (byte) (commandAndSet >> 8);
+ byte command = (byte) commandAndSet;
printHex(set);
printParanthetical(set);
println();
- printDescription("Command:"); //$NON-NLS-1$
+ printDescription("Command:"); //$NON-NLS-1$
printHex(command);
printParanthetical(command);
print(" ("); //$NON-NLS-1$
@@ -216,9 +231,9 @@ public class VerbosePacketStream extends PrintStream {
}
protected void printError(JdwpReplyPacket reply) {
- int error= reply.errorCode();
-
- printDescription("Error:"); //$NON-NLS-1$
+ int error = reply.errorCode();
+
+ printDescription("Error:"); //$NON-NLS-1$
printHex(error);
if (error != 0) {
print(" ("); //$NON-NLS-1$
@@ -228,7 +243,8 @@ public class VerbosePacketStream extends PrintStream {
println();
}
- protected void printData(JdwpPacket packet) throws IOException, UnableToParseDataException {
+ protected void printData(JdwpPacket packet) throws IOException,
+ UnableToParseDataException {
if ((packet.getFlags() & JdwpPacket.FLAG_REPLY_PACKET) != 0) {
printReplyData((JdwpReplyPacket) packet);
} else {
@@ -236,615 +252,620 @@ public class VerbosePacketStream extends PrintStream {
}
}
- private void printCommandData(JdwpCommandPacket command) throws IOException, UnableToParseDataException {
- byte[] data= command.data();
+ private void printCommandData(JdwpCommandPacket command)
+ throws IOException, UnableToParseDataException {
+ byte[] data = command.data();
if (data == null)
return;
- DataInputStream in= new DataInputStream(new ByteArrayInputStream(data));
- int commandId= command.getCommand();
+ DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
+ int commandId = command.getCommand();
switch (commandId) {
- /** Commands VirtualMachine. */
- case JdwpCommandPacket.VM_VERSION:
- // no data
- break;
- case JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE:
- printVmClassesBySignatureCommand(in);
- break;
- case JdwpCommandPacket.VM_ALL_CLASSES:
- // no data
- break;
- case JdwpCommandPacket.VM_ALL_THREADS:
- // no data
- break;
- case JdwpCommandPacket.VM_TOP_LEVEL_THREAD_GROUPS:
- // no data
- break;
- case JdwpCommandPacket.VM_DISPOSE:
- // no data
- break;
- case JdwpCommandPacket.VM_ID_SIZES:
- // no data
- break;
- case JdwpCommandPacket.VM_SUSPEND:
- // no data
- break;
- case JdwpCommandPacket.VM_RESUME:
- // no data
- break;
- case JdwpCommandPacket.VM_EXIT:
- printVmExitCommand(in);
- break;
- case JdwpCommandPacket.VM_CREATE_STRING:
- printVmCreateStringCommand(in);
- break;
- case JdwpCommandPacket.VM_CAPABILITIES:
- // no data
- break;
- case JdwpCommandPacket.VM_CLASS_PATHS:
- // no data
- break;
- case JdwpCommandPacket.VM_DISPOSE_OBJECTS:
- printVmDisposeObjectsCommand(in);
- break;
- case JdwpCommandPacket.VM_HOLD_EVENTS:
- // no data
- break;
- case JdwpCommandPacket.VM_RELEASE_EVENTS:
- // no data
- break;
- case JdwpCommandPacket.VM_CAPABILITIES_NEW:
- // no data
- break;
- case JdwpCommandPacket.VM_REDEFINE_CLASSES:
- printVmRedefineClassCommand(in);
- break;
- case JdwpCommandPacket.VM_SET_DEFAULT_STRATUM:
- printVmSetDefaultStratumCommand(in);
- break;
- case JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC:
- // no data
- break;
-
- /** Commands ReferenceType. */
- case JdwpCommandPacket.RT_SIGNATURE:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_CLASS_LOADER:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_MODIFIERS:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_FIELDS:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_METHODS:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_GET_VALUES:
- printRtGetValuesCommand(in);
- break;
- case JdwpCommandPacket.RT_SOURCE_FILE:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_NESTED_TYPES:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_STATUS:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_INTERFACES:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_CLASS_OBJECT:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_FIELDS_WITH_GENERIC:
- printRtDefaultCommand(in);
- break;
- case JdwpCommandPacket.RT_METHODS_WITH_GENERIC:
- printRtDefaultCommand(in);
- break;
-
- /** Commands ClassType. */
- case JdwpCommandPacket.CT_SUPERCLASS:
- printCtSuperclassCommand(in);
- break;
- case JdwpCommandPacket.CT_SET_VALUES:
- printCtSetValuesCommand(in);
- break;
- case JdwpCommandPacket.CT_INVOKE_METHOD:
- printCtInvokeMethodCommand(in);
- break;
- case JdwpCommandPacket.CT_NEW_INSTANCE:
- printCtNewInstanceCommand(in);
- break;
-
- /** Commands ArrayType. */
- case JdwpCommandPacket.AT_NEW_INSTANCE:
- printAtNewInstanceCommand(in);
- break;
-
- /** Commands Method. */
- case JdwpCommandPacket.M_LINE_TABLE:
- printMDefaultCommand(in);
- break;
- case JdwpCommandPacket.M_VARIABLE_TABLE:
- printMDefaultCommand(in);
- break;
- case JdwpCommandPacket.M_BYTECODES:
- printMDefaultCommand(in);
- break;
- case JdwpCommandPacket.M_IS_OBSOLETE:
- printMDefaultCommand(in);
- break;
- case JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC:
- printMDefaultCommand(in);
- break;
-
- /** Commands ObjectReference. */
- case JdwpCommandPacket.OR_REFERENCE_TYPE:
- printOrDefaultCommand(in);
- break;
- case JdwpCommandPacket.OR_GET_VALUES:
- printOrGetValuesCommand(in);
- break;
- case JdwpCommandPacket.OR_SET_VALUES:
- printOrSetValuesCommand(in);
- break;
- case JdwpCommandPacket.OR_MONITOR_INFO:
- printOrDefaultCommand(in);
- break;
- case JdwpCommandPacket.OR_INVOKE_METHOD:
- printOrInvokeMethodCommand(in);
- break;
- case JdwpCommandPacket.OR_DISABLE_COLLECTION:
- printOrDefaultCommand(in);
- break;
- case JdwpCommandPacket.OR_ENABLE_COLLECTION:
- printOrDefaultCommand(in);
- break;
- case JdwpCommandPacket.OR_IS_COLLECTED:
- printOrDefaultCommand(in);
- break;
-
- /** Commands StringReference. */
- case JdwpCommandPacket.SR_VALUE:
- printSrValueCommand(in);
- break;
-
- /** Commands ThreadReference. */
- case JdwpCommandPacket.TR_NAME:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_SUSPEND:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_RESUME:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_STATUS:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_THREAD_GROUP:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_FRAMES:
- printTrFramesCommand(in);
- break;
- case JdwpCommandPacket.TR_FRAME_COUNT:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_OWNED_MONITORS:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_STOP:
- printTrStopCommand(in);
- break;
- case JdwpCommandPacket.TR_INTERRUPT:
- printTrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TR_SUSPEND_COUNT:
- printTrDefaultCommand(in);
- break;
-/* no more in the jdwp spec
- case JdwpCommandPacket.TR_POP_TOP_FRAME:
- break;
-*/
-
- /** Commands ThreadGroupReference. */
- case JdwpCommandPacket.TGR_NAME:
- printTgrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TGR_PARENT:
- printTgrDefaultCommand(in);
- break;
- case JdwpCommandPacket.TGR_CHILDREN:
- printTgrDefaultCommand(in);
- break;
-
- /** Commands ArrayReference. */
- case JdwpCommandPacket.AR_LENGTH:
- printArLengthCommand(in);
- break;
- case JdwpCommandPacket.AR_GET_VALUES:
- printArGetValuesCommand(in);
- break;
- case JdwpCommandPacket.AR_SET_VALUES:
- printArSetValuesCommand(in);
- break;
-
- /** Commands ClassLoaderReference. */
- case JdwpCommandPacket.CLR_VISIBLE_CLASSES:
- printClrVisibleClassesCommand(in);
- break;
-
- /** Commands EventRequest. */
- case JdwpCommandPacket.ER_SET:
- printErSetCommand(in);
- break;
- case JdwpCommandPacket.ER_CLEAR:
- printErClearCommand(in);
- break;
- case JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS:
- // no data
- break;
-
- /** Commands StackFrame. */
- case JdwpCommandPacket.SF_GET_VALUES:
- printSfGetValuesCommand(in);
- break;
- case JdwpCommandPacket.SF_SET_VALUES:
- printSfSetValuesCommand(in);
- break;
- case JdwpCommandPacket.SF_THIS_OBJECT:
- printSfDefaultCommand(in);
- break;
- case JdwpCommandPacket.SF_POP_FRAME:
- printSfDefaultCommand(in);
- break;
-
- /** Commands ClassObjectReference. */
- case JdwpCommandPacket.COR_REFLECTED_TYPE:
- printCorReflectedTypeCommand(in);
- break;
-
- /** Commands Event. */
- case JdwpCommandPacket.E_COMPOSITE:
- printECompositeCommand(in);
- break;
-
- /** Commands Hot Code Replacement (OTI specific). */
- case JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED:
- case JdwpCommandPacket.HCR_GET_CLASS_VERSION:
- case JdwpCommandPacket.HCR_DO_RETURN:
- case JdwpCommandPacket.HCR_REENTER_ON_EXIT:
- case JdwpCommandPacket.HCR_CAPABILITIES:
- throw new UnableToParseDataException("NOT MANAGED COMMAND", remainderData(in)); //$NON-NLS-1$
-
- default:
- int cset= commandId >> 8;
- int cmd= commandId & 0xFF;
- println(MessageFormat.format("Unknown command : {0} {1}", new String[] {"" + cset, "" + cmd})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
+ /** Commands VirtualMachine. */
+ case JdwpCommandPacket.VM_VERSION:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE:
+ printVmClassesBySignatureCommand(in);
+ break;
+ case JdwpCommandPacket.VM_ALL_CLASSES:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_ALL_THREADS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_TOP_LEVEL_THREAD_GROUPS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_DISPOSE:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_ID_SIZES:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_SUSPEND:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_RESUME:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_EXIT:
+ printVmExitCommand(in);
+ break;
+ case JdwpCommandPacket.VM_CREATE_STRING:
+ printVmCreateStringCommand(in);
+ break;
+ case JdwpCommandPacket.VM_CAPABILITIES:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_CLASS_PATHS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_DISPOSE_OBJECTS:
+ printVmDisposeObjectsCommand(in);
+ break;
+ case JdwpCommandPacket.VM_HOLD_EVENTS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_RELEASE_EVENTS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_CAPABILITIES_NEW:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_REDEFINE_CLASSES:
+ printVmRedefineClassCommand(in);
+ break;
+ case JdwpCommandPacket.VM_SET_DEFAULT_STRATUM:
+ printVmSetDefaultStratumCommand(in);
+ break;
+ case JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC:
+ // no data
+ break;
+
+ /** Commands ReferenceType. */
+ case JdwpCommandPacket.RT_SIGNATURE:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_CLASS_LOADER:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_MODIFIERS:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_FIELDS:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_METHODS:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_GET_VALUES:
+ printRtGetValuesCommand(in);
+ break;
+ case JdwpCommandPacket.RT_SOURCE_FILE:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_NESTED_TYPES:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_STATUS:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_INTERFACES:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_CLASS_OBJECT:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_FIELDS_WITH_GENERIC:
+ printRtDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.RT_METHODS_WITH_GENERIC:
+ printRtDefaultCommand(in);
+ break;
+
+ /** Commands ClassType. */
+ case JdwpCommandPacket.CT_SUPERCLASS:
+ printCtSuperclassCommand(in);
+ break;
+ case JdwpCommandPacket.CT_SET_VALUES:
+ printCtSetValuesCommand(in);
+ break;
+ case JdwpCommandPacket.CT_INVOKE_METHOD:
+ printCtInvokeMethodCommand(in);
+ break;
+ case JdwpCommandPacket.CT_NEW_INSTANCE:
+ printCtNewInstanceCommand(in);
+ break;
+
+ /** Commands ArrayType. */
+ case JdwpCommandPacket.AT_NEW_INSTANCE:
+ printAtNewInstanceCommand(in);
+ break;
+
+ /** Commands Method. */
+ case JdwpCommandPacket.M_LINE_TABLE:
+ printMDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.M_VARIABLE_TABLE:
+ printMDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.M_BYTECODES:
+ printMDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.M_IS_OBSOLETE:
+ printMDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC:
+ printMDefaultCommand(in);
+ break;
+
+ /** Commands ObjectReference. */
+ case JdwpCommandPacket.OR_REFERENCE_TYPE:
+ printOrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.OR_GET_VALUES:
+ printOrGetValuesCommand(in);
+ break;
+ case JdwpCommandPacket.OR_SET_VALUES:
+ printOrSetValuesCommand(in);
+ break;
+ case JdwpCommandPacket.OR_MONITOR_INFO:
+ printOrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.OR_INVOKE_METHOD:
+ printOrInvokeMethodCommand(in);
+ break;
+ case JdwpCommandPacket.OR_DISABLE_COLLECTION:
+ printOrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.OR_ENABLE_COLLECTION:
+ printOrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.OR_IS_COLLECTED:
+ printOrDefaultCommand(in);
+ break;
+
+ /** Commands StringReference. */
+ case JdwpCommandPacket.SR_VALUE:
+ printSrValueCommand(in);
+ break;
+
+ /** Commands ThreadReference. */
+ case JdwpCommandPacket.TR_NAME:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_SUSPEND:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_RESUME:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_STATUS:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_THREAD_GROUP:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_FRAMES:
+ printTrFramesCommand(in);
+ break;
+ case JdwpCommandPacket.TR_FRAME_COUNT:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_OWNED_MONITORS:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_STOP:
+ printTrStopCommand(in);
+ break;
+ case JdwpCommandPacket.TR_INTERRUPT:
+ printTrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TR_SUSPEND_COUNT:
+ printTrDefaultCommand(in);
+ break;
+ /*
+ * no more in the jdwp spec case JdwpCommandPacket.TR_POP_TOP_FRAME:
+ * break;
+ */
+
+ /** Commands ThreadGroupReference. */
+ case JdwpCommandPacket.TGR_NAME:
+ printTgrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TGR_PARENT:
+ printTgrDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.TGR_CHILDREN:
+ printTgrDefaultCommand(in);
+ break;
+
+ /** Commands ArrayReference. */
+ case JdwpCommandPacket.AR_LENGTH:
+ printArLengthCommand(in);
+ break;
+ case JdwpCommandPacket.AR_GET_VALUES:
+ printArGetValuesCommand(in);
+ break;
+ case JdwpCommandPacket.AR_SET_VALUES:
+ printArSetValuesCommand(in);
+ break;
+
+ /** Commands ClassLoaderReference. */
+ case JdwpCommandPacket.CLR_VISIBLE_CLASSES:
+ printClrVisibleClassesCommand(in);
+ break;
+
+ /** Commands EventRequest. */
+ case JdwpCommandPacket.ER_SET:
+ printErSetCommand(in);
+ break;
+ case JdwpCommandPacket.ER_CLEAR:
+ printErClearCommand(in);
+ break;
+ case JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS:
+ // no data
+ break;
+
+ /** Commands StackFrame. */
+ case JdwpCommandPacket.SF_GET_VALUES:
+ printSfGetValuesCommand(in);
+ break;
+ case JdwpCommandPacket.SF_SET_VALUES:
+ printSfSetValuesCommand(in);
+ break;
+ case JdwpCommandPacket.SF_THIS_OBJECT:
+ printSfDefaultCommand(in);
+ break;
+ case JdwpCommandPacket.SF_POP_FRAME:
+ printSfDefaultCommand(in);
+ break;
+
+ /** Commands ClassObjectReference. */
+ case JdwpCommandPacket.COR_REFLECTED_TYPE:
+ printCorReflectedTypeCommand(in);
+ break;
+
+ /** Commands Event. */
+ case JdwpCommandPacket.E_COMPOSITE:
+ printECompositeCommand(in);
+ break;
+
+ /** Commands Hot Code Replacement (OTI specific). */
+ case JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED:
+ case JdwpCommandPacket.HCR_GET_CLASS_VERSION:
+ case JdwpCommandPacket.HCR_DO_RETURN:
+ case JdwpCommandPacket.HCR_REENTER_ON_EXIT:
+ case JdwpCommandPacket.HCR_CAPABILITIES:
+ throw new UnableToParseDataException(
+ "NOT MANAGED COMMAND", remainderData(in)); //$NON-NLS-1$
+
+ default:
+ int cset = commandId >> 8;
+ int cmd = commandId & 0xFF;
+ println(MessageFormat
+ .format("Unknown command : {0} {1}", new Object[] { "" + cset, "" + cmd })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
}
}
-
- private void printReplyData(JdwpReplyPacket reply) throws IOException, UnableToParseDataException {
- byte[] data= reply.data();
+ private void printReplyData(JdwpReplyPacket reply) throws IOException,
+ UnableToParseDataException {
+ byte[] data = reply.data();
if (data == null)
return;
- DataInputStream in= new DataInputStream(new ByteArrayInputStream(data));
- JdwpCommandPacket command= TcpipSpy.getCommand(reply.getId());
- int commandId= command.getCommand();
+ DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
+ JdwpCommandPacket command = TcpipSpy.getCommand(reply.getId());
+ int commandId = command.getCommand();
switch (commandId) {
- /** Commands VirtualMachine. */
- case JdwpCommandPacket.VM_VERSION:
- printVmVersionReply(in);
- break;
- case JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE:
- printVmClassesBySignatureReply(in);
- break;
- case JdwpCommandPacket.VM_ALL_CLASSES:
- printVmAllClassesReply(in);
- break;
- case JdwpCommandPacket.VM_ALL_THREADS:
- printVmAllThreadsReply(in);
- break;
- case JdwpCommandPacket.VM_TOP_LEVEL_THREAD_GROUPS:
- printVmTopLevelThreadGroupReply(in);
- break;
- case JdwpCommandPacket.VM_DISPOSE:
- // no data
- break;
- case JdwpCommandPacket.VM_ID_SIZES:
- printVmIdSizesReply(in);
- break;
- case JdwpCommandPacket.VM_SUSPEND:
- // no data
- break;
- case JdwpCommandPacket.VM_RESUME:
- // no data
- break;
- case JdwpCommandPacket.VM_EXIT:
- // no data
- break;
- case JdwpCommandPacket.VM_CREATE_STRING:
- printVmCreateStringReply(in);
- break;
- case JdwpCommandPacket.VM_CAPABILITIES:
- printVmCapabilitiesReply(in);
- break;
- case JdwpCommandPacket.VM_CLASS_PATHS:
- printVmClassPathsReply(in);
- break;
- case JdwpCommandPacket.VM_DISPOSE_OBJECTS:
- // no data
- break;
- case JdwpCommandPacket.VM_HOLD_EVENTS:
- // no data
- break;
- case JdwpCommandPacket.VM_RELEASE_EVENTS:
- // no data
- break;
- case JdwpCommandPacket.VM_CAPABILITIES_NEW:
- printVmCapabilitiesNewReply(in);
- break;
- case JdwpCommandPacket.VM_REDEFINE_CLASSES:
- // no data
- break;
- case JdwpCommandPacket.VM_SET_DEFAULT_STRATUM:
- // no data
- break;
- case JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC:
- printVmAllClassesWithGenericReply(in);
- break;
-
- /** Commands ReferenceType. */
- case JdwpCommandPacket.RT_SIGNATURE:
- printRtSignatureReply(in);
- break;
- case JdwpCommandPacket.RT_CLASS_LOADER:
- printRtClassLoaderReply(in);
- break;
- case JdwpCommandPacket.RT_MODIFIERS:
- printRtModifiersReply(in);
- break;
- case JdwpCommandPacket.RT_FIELDS:
- printRtFieldsReply(in);
- break;
- case JdwpCommandPacket.RT_METHODS:
- printRtMethodsReply(in);
- break;
- case JdwpCommandPacket.RT_GET_VALUES:
- printRtGetValuesReply(in);
- break;
- case JdwpCommandPacket.RT_SOURCE_FILE:
- printRtSourceFileReply(in);
- break;
- case JdwpCommandPacket.RT_NESTED_TYPES:
- printRtNestedTypesReply(in);
- break;
- case JdwpCommandPacket.RT_STATUS:
- printRtStatusReply(in);
- break;
- case JdwpCommandPacket.RT_INTERFACES:
- printRtInterfacesReply(in);
- break;
- case JdwpCommandPacket.RT_CLASS_OBJECT:
- printRtClassObjectReply(in);
- break;
- case JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION:
- printRtSourceDebugExtensionReply(in);
- break;
- case JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC:
- printRtSignatureWithGenericReply(in);
- break;
- case JdwpCommandPacket.RT_FIELDS_WITH_GENERIC:
- printRtFieldsWithGenericReply(in);
- break;
- case JdwpCommandPacket.RT_METHODS_WITH_GENERIC:
- printRtMethodsWithGenericReply(in);
- break;
-
- /** Commands ClassType. */
- case JdwpCommandPacket.CT_SUPERCLASS:
- printCtSuperclassReply(in);
- break;
- case JdwpCommandPacket.CT_SET_VALUES:
- // no data
- break;
- case JdwpCommandPacket.CT_INVOKE_METHOD:
- printCtInvokeMethodReply(in);
- break;
- case JdwpCommandPacket.CT_NEW_INSTANCE:
- printCtNewInstanceReply(in);
- break;
-
- /** Commands ArrayType. */
- case JdwpCommandPacket.AT_NEW_INSTANCE:
- printAtNewInstanceReply(in);
- break;
-
- /** Commands Method. */
- case JdwpCommandPacket.M_LINE_TABLE:
- printMLineTableReply(in);
- break;
- case JdwpCommandPacket.M_VARIABLE_TABLE:
- printMVariableTableReply(in);
- break;
- case JdwpCommandPacket.M_BYTECODES:
- printMBytecodesReply(in);
- break;
- case JdwpCommandPacket.M_IS_OBSOLETE:
- printMIsObsoleteReply(in);
- break;
- case JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC:
- printMVariableTableWithGenericReply(in);
- break;
-
- /** Commands ObjectReference. */
- case JdwpCommandPacket.OR_REFERENCE_TYPE:
- printOrReferenceTypeReply(in);
- break;
- case JdwpCommandPacket.OR_GET_VALUES:
- printOrGetValuesReply(in);
- break;
- case JdwpCommandPacket.OR_SET_VALUES:
- // no data
- break;
- case JdwpCommandPacket.OR_MONITOR_INFO:
- printOrMonitorInfoReply(in);
- break;
- case JdwpCommandPacket.OR_INVOKE_METHOD:
- printOrInvokeMethodReply(in);
- break;
- case JdwpCommandPacket.OR_DISABLE_COLLECTION:
- // no data
- break;
- case JdwpCommandPacket.OR_ENABLE_COLLECTION:
- // no data
- break;
- case JdwpCommandPacket.OR_IS_COLLECTED:
- printOrIsCollectedReply(in);
- break;
-
- /** Commands StringReference. */
- case JdwpCommandPacket.SR_VALUE:
- printSrValueReply(in);
- break;
-
- /** Commands ThreadReference. */
- case JdwpCommandPacket.TR_NAME:
- printTrNameReply(in);
- break;
- case JdwpCommandPacket.TR_SUSPEND:
- // no data
- break;
- case JdwpCommandPacket.TR_RESUME:
- // no data
- break;
- case JdwpCommandPacket.TR_STATUS:
- printTrStatusReply(in);
- break;
- case JdwpCommandPacket.TR_THREAD_GROUP:
- printTrThreadGroupReply(in);
- break;
- case JdwpCommandPacket.TR_FRAMES:
- printTrFramesReply(in);
- break;
- case JdwpCommandPacket.TR_FRAME_COUNT:
- printTrFrameCountReply(in);
- break;
- case JdwpCommandPacket.TR_OWNED_MONITORS:
- printTrOwnedMonitorsReply(in);
- break;
- case JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR:
- printTrCurrentContendedMonitorReply(in);
- break;
- case JdwpCommandPacket.TR_STOP:
- // no data
- break;
- case JdwpCommandPacket.TR_INTERRUPT:
- // no data
- break;
- case JdwpCommandPacket.TR_SUSPEND_COUNT:
- printTrSuspendCountReply(in);
- break;
-/* no more in the jdwp spec
- case JdwpCommandPacket.TR_POP_TOP_FRAME:
- break;
-*/
- /** Commands ThreadGroupReference. */
- case JdwpCommandPacket.TGR_NAME:
- printTgrNameReply(in);
- break;
- case JdwpCommandPacket.TGR_PARENT:
- printTgrParentReply(in);
- break;
- case JdwpCommandPacket.TGR_CHILDREN:
- printTgrChildrenReply(in);
- break;
-
- /** Commands ArrayReference. */
- case JdwpCommandPacket.AR_LENGTH:
- printArLengthReply(in);
- break;
- case JdwpCommandPacket.AR_GET_VALUES:
- printArGetValuesReply(in);
- break;
- case JdwpCommandPacket.AR_SET_VALUES:
- // no data
- break;
-
- /** Commands ClassLoaderReference. */
- case JdwpCommandPacket.CLR_VISIBLE_CLASSES:
- printClrVisibleClassesReply(in);
- break;
-
- /** Commands EventRequest. */
- case JdwpCommandPacket.ER_SET:
- printErSetReply(in);
- break;
- case JdwpCommandPacket.ER_CLEAR:
- // no data
- break;
- case JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS:
- // no data
- break;
-
- /** Commands StackFrame. */
- case JdwpCommandPacket.SF_GET_VALUES:
- printSfGetValuesReply(in);
- break;
- case JdwpCommandPacket.SF_SET_VALUES:
- // no data
- break;
- case JdwpCommandPacket.SF_THIS_OBJECT:
- printSfThisObjectReply(in);
- break;
- case JdwpCommandPacket.SF_POP_FRAME:
- // no data
- break;
-
- /** Commands ClassObjectReference. */
- case JdwpCommandPacket.COR_REFLECTED_TYPE:
- printCorReflectedTypeReply(in);
- break;
-
- /** Commands Event. */
-/* no reply
- case JdwpCommandPacket.E_COMPOSITE:
- break;*/
-
- /** Commands Hot Code Replacement (OTI specific). */
- case JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED:
- case JdwpCommandPacket.HCR_GET_CLASS_VERSION:
- case JdwpCommandPacket.HCR_DO_RETURN:
- case JdwpCommandPacket.HCR_REENTER_ON_EXIT:
- case JdwpCommandPacket.HCR_CAPABILITIES:
- throw new UnableToParseDataException("NOT MANAGED COMMAND", remainderData(in)); //$NON-NLS-1$
-
- default:
- int cset= commandId >> 8;
- int cmd= commandId & 0xFF;
- println(MessageFormat.format("Unknown command : {0} {1}", new String[] {"" + cset, "" + cmd})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- break;
+ /** Commands VirtualMachine. */
+ case JdwpCommandPacket.VM_VERSION:
+ printVmVersionReply(in);
+ break;
+ case JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE:
+ printVmClassesBySignatureReply(in);
+ break;
+ case JdwpCommandPacket.VM_ALL_CLASSES:
+ printVmAllClassesReply(in);
+ break;
+ case JdwpCommandPacket.VM_ALL_THREADS:
+ printVmAllThreadsReply(in);
+ break;
+ case JdwpCommandPacket.VM_TOP_LEVEL_THREAD_GROUPS:
+ printVmTopLevelThreadGroupReply(in);
+ break;
+ case JdwpCommandPacket.VM_DISPOSE:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_ID_SIZES:
+ printVmIdSizesReply(in);
+ break;
+ case JdwpCommandPacket.VM_SUSPEND:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_RESUME:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_EXIT:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_CREATE_STRING:
+ printVmCreateStringReply(in);
+ break;
+ case JdwpCommandPacket.VM_CAPABILITIES:
+ printVmCapabilitiesReply(in);
+ break;
+ case JdwpCommandPacket.VM_CLASS_PATHS:
+ printVmClassPathsReply(in);
+ break;
+ case JdwpCommandPacket.VM_DISPOSE_OBJECTS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_HOLD_EVENTS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_RELEASE_EVENTS:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_CAPABILITIES_NEW:
+ printVmCapabilitiesNewReply(in);
+ break;
+ case JdwpCommandPacket.VM_REDEFINE_CLASSES:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_SET_DEFAULT_STRATUM:
+ // no data
+ break;
+ case JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC:
+ printVmAllClassesWithGenericReply(in);
+ break;
+
+ /** Commands ReferenceType. */
+ case JdwpCommandPacket.RT_SIGNATURE:
+ printRtSignatureReply(in);
+ break;
+ case JdwpCommandPacket.RT_CLASS_LOADER:
+ printRtClassLoaderReply(in);
+ break;
+ case JdwpCommandPacket.RT_MODIFIERS:
+ printRtModifiersReply(in);
+ break;
+ case JdwpCommandPacket.RT_FIELDS:
+ printRtFieldsReply(in);
+ break;
+ case JdwpCommandPacket.RT_METHODS:
+ printRtMethodsReply(in);
+ break;
+ case JdwpCommandPacket.RT_GET_VALUES:
+ printRtGetValuesReply(in);
+ break;
+ case JdwpCommandPacket.RT_SOURCE_FILE:
+ printRtSourceFileReply(in);
+ break;
+ case JdwpCommandPacket.RT_NESTED_TYPES:
+ printRtNestedTypesReply(in);
+ break;
+ case JdwpCommandPacket.RT_STATUS:
+ printRtStatusReply(in);
+ break;
+ case JdwpCommandPacket.RT_INTERFACES:
+ printRtInterfacesReply(in);
+ break;
+ case JdwpCommandPacket.RT_CLASS_OBJECT:
+ printRtClassObjectReply(in);
+ break;
+ case JdwpCommandPacket.RT_SOURCE_DEBUG_EXTENSION:
+ printRtSourceDebugExtensionReply(in);
+ break;
+ case JdwpCommandPacket.RT_SIGNATURE_WITH_GENERIC:
+ printRtSignatureWithGenericReply(in);
+ break;
+ case JdwpCommandPacket.RT_FIELDS_WITH_GENERIC:
+ printRtFieldsWithGenericReply(in);
+ break;
+ case JdwpCommandPacket.RT_METHODS_WITH_GENERIC:
+ printRtMethodsWithGenericReply(in);
+ break;
+
+ /** Commands ClassType. */
+ case JdwpCommandPacket.CT_SUPERCLASS:
+ printCtSuperclassReply(in);
+ break;
+ case JdwpCommandPacket.CT_SET_VALUES:
+ // no data
+ break;
+ case JdwpCommandPacket.CT_INVOKE_METHOD:
+ printCtInvokeMethodReply(in);
+ break;
+ case JdwpCommandPacket.CT_NEW_INSTANCE:
+ printCtNewInstanceReply(in);
+ break;
+
+ /** Commands ArrayType. */
+ case JdwpCommandPacket.AT_NEW_INSTANCE:
+ printAtNewInstanceReply(in);
+ break;
+
+ /** Commands Method. */
+ case JdwpCommandPacket.M_LINE_TABLE:
+ printMLineTableReply(in);
+ break;
+ case JdwpCommandPacket.M_VARIABLE_TABLE:
+ printMVariableTableReply(in);
+ break;
+ case JdwpCommandPacket.M_BYTECODES:
+ printMBytecodesReply(in);
+ break;
+ case JdwpCommandPacket.M_IS_OBSOLETE:
+ printMIsObsoleteReply(in);
+ break;
+ case JdwpCommandPacket.M_VARIABLE_TABLE_WITH_GENERIC:
+ printMVariableTableWithGenericReply(in);
+ break;
+
+ /** Commands ObjectReference. */
+ case JdwpCommandPacket.OR_REFERENCE_TYPE:
+ printOrReferenceTypeReply(in);
+ break;
+ case JdwpCommandPacket.OR_GET_VALUES:
+ printOrGetValuesReply(in);
+ break;
+ case JdwpCommandPacket.OR_SET_VALUES:
+ // no data
+ break;
+ case JdwpCommandPacket.OR_MONITOR_INFO:
+ printOrMonitorInfoReply(in);
+ break;
+ case JdwpCommandPacket.OR_INVOKE_METHOD:
+ printOrInvokeMethodReply(in);
+ break;
+ case JdwpCommandPacket.OR_DISABLE_COLLECTION:
+ // no data
+ break;
+ case JdwpCommandPacket.OR_ENABLE_COLLECTION:
+ // no data
+ break;
+ case JdwpCommandPacket.OR_IS_COLLECTED:
+ printOrIsCollectedReply(in);
+ break;
+
+ /** Commands StringReference. */
+ case JdwpCommandPacket.SR_VALUE:
+ printSrValueReply(in);
+ break;
+
+ /** Commands ThreadReference. */
+ case JdwpCommandPacket.TR_NAME:
+ printTrNameReply(in);
+ break;
+ case JdwpCommandPacket.TR_SUSPEND:
+ // no data
+ break;
+ case JdwpCommandPacket.TR_RESUME:
+ // no data
+ break;
+ case JdwpCommandPacket.TR_STATUS:
+ printTrStatusReply(in);
+ break;
+ case JdwpCommandPacket.TR_THREAD_GROUP:
+ printTrThreadGroupReply(in);
+ break;
+ case JdwpCommandPacket.TR_FRAMES:
+ printTrFramesReply(in);
+ break;
+ case JdwpCommandPacket.TR_FRAME_COUNT:
+ printTrFrameCountReply(in);
+ break;
+ case JdwpCommandPacket.TR_OWNED_MONITORS:
+ printTrOwnedMonitorsReply(in);
+ break;
+ case JdwpCommandPacket.TR_CURRENT_CONTENDED_MONITOR:
+ printTrCurrentContendedMonitorReply(in);
+ break;
+ case JdwpCommandPacket.TR_STOP:
+ // no data
+ break;
+ case JdwpCommandPacket.TR_INTERRUPT:
+ // no data
+ break;
+ case JdwpCommandPacket.TR_SUSPEND_COUNT:
+ printTrSuspendCountReply(in);
+ break;
+ /*
+ * no more in the jdwp spec case JdwpCommandPacket.TR_POP_TOP_FRAME:
+ * break;
+ */
+ /** Commands ThreadGroupReference. */
+ case JdwpCommandPacket.TGR_NAME:
+ printTgrNameReply(in);
+ break;
+ case JdwpCommandPacket.TGR_PARENT:
+ printTgrParentReply(in);
+ break;
+ case JdwpCommandPacket.TGR_CHILDREN:
+ printTgrChildrenReply(in);
+ break;
+
+ /** Commands ArrayReference. */
+ case JdwpCommandPacket.AR_LENGTH:
+ printArLengthReply(in);
+ break;
+ case JdwpCommandPacket.AR_GET_VALUES:
+ printArGetValuesReply(in);
+ break;
+ case JdwpCommandPacket.AR_SET_VALUES:
+ // no data
+ break;
+
+ /** Commands ClassLoaderReference. */
+ case JdwpCommandPacket.CLR_VISIBLE_CLASSES:
+ printClrVisibleClassesReply(in);
+ break;
+
+ /** Commands EventRequest. */
+ case JdwpCommandPacket.ER_SET:
+ printErSetReply(in);
+ break;
+ case JdwpCommandPacket.ER_CLEAR:
+ // no data
+ break;
+ case JdwpCommandPacket.ER_CLEAR_ALL_BREAKPOINTS:
+ // no data
+ break;
+
+ /** Commands StackFrame. */
+ case JdwpCommandPacket.SF_GET_VALUES:
+ printSfGetValuesReply(in);
+ break;
+ case JdwpCommandPacket.SF_SET_VALUES:
+ // no data
+ break;
+ case JdwpCommandPacket.SF_THIS_OBJECT:
+ printSfThisObjectReply(in);
+ break;
+ case JdwpCommandPacket.SF_POP_FRAME:
+ // no data
+ break;
+
+ /** Commands ClassObjectReference. */
+ case JdwpCommandPacket.COR_REFLECTED_TYPE:
+ printCorReflectedTypeReply(in);
+ break;
+
+ /** Commands Event. */
+ /*
+ * no reply case JdwpCommandPacket.E_COMPOSITE: break;
+ */
+
+ /** Commands Hot Code Replacement (OTI specific). */
+ case JdwpCommandPacket.HCR_CLASSES_HAVE_CHANGED:
+ case JdwpCommandPacket.HCR_GET_CLASS_VERSION:
+ case JdwpCommandPacket.HCR_DO_RETURN:
+ case JdwpCommandPacket.HCR_REENTER_ON_EXIT:
+ case JdwpCommandPacket.HCR_CAPABILITIES:
+ throw new UnableToParseDataException(
+ "NOT MANAGED COMMAND", remainderData(in)); //$NON-NLS-1$
+
+ default:
+ int cset = commandId >> 8;
+ int cmd = commandId & 0xFF;
+ println(MessageFormat
+ .format("Unknown command : {0} {1}", new Object[] { "" + cset, "" + cmd })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ break;
}
}
-
+
private void printRefTypeTag(byte refTypeTag) {
- printDescription("Type tag:"); //$NON-NLS-1$
+ printDescription("Type tag:"); //$NON-NLS-1$
printRefTypeTagValue(refTypeTag);
println();
}
@@ -853,35 +874,35 @@ public class VerbosePacketStream extends PrintStream {
printHex(refTypeTag);
print(" ("); //$NON-NLS-1$
switch (refTypeTag) {
- case TYPE_TAG_CLASS:
- print("CLASS"); //$NON-NLS-1$
- break;
- case TYPE_TAG_INTERFACE:
- print("INTERFACE"); //$NON-NLS-1$
- break;
- case TYPE_TAG_ARRAY:
- print("ARRAY"); //$NON-NLS-1$
- break;
- default:
- print("unknown"); //$NON-NLS-1$
+ case TYPE_TAG_CLASS:
+ print("CLASS"); //$NON-NLS-1$
+ break;
+ case TYPE_TAG_INTERFACE:
+ print("INTERFACE"); //$NON-NLS-1$
+ break;
+ case TYPE_TAG_ARRAY:
+ print("ARRAY"); //$NON-NLS-1$
+ break;
+ default:
+ print("unknown"); //$NON-NLS-1$
}
print(')');
}
-
+
private void printClassStatus(int status) {
- printDescription("Status:"); //$NON-NLS-1$
+ printDescription("Status:"); //$NON-NLS-1$
printHex(status);
print(" ("); //$NON-NLS-1$
- boolean spaceNeeded= false;
+ boolean spaceNeeded = false;
if ((status & JDWP_CLASS_STATUS_VERIFIED) != 0) {
print("VERIFIED"); //$NON-NLS-1$
- spaceNeeded= true;
+ spaceNeeded = true;
}
if ((status & JDWP_CLASS_STATUS_PREPARED) != 0) {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("PREPARED"); //$NON-NLS-1$
}
@@ -889,7 +910,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("INITIALIZED"); //$NON-NLS-1$
}
@@ -897,25 +918,25 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
}
- print("unknown"); //$NON-NLS-1$
+ print("unknown"); //$NON-NLS-1$
}
println(')');
}
-
+
private void printClassModifiers(int modifiers) {
- printDescription("Modifiers:"); //$NON-NLS-1$
+ printDescription("Modifiers:"); //$NON-NLS-1$
printHex(modifiers);
print(" ("); //$NON-NLS-1$
- boolean spaceNeeded= false;
+ boolean spaceNeeded = false;
if ((modifiers & ACC_PUBLIC) != 0) {
print("PUBLIC"); //$NON-NLS-1$
- spaceNeeded= true;
+ spaceNeeded = true;
}
if ((modifiers & ACC_PRIVATE) != 0) {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("PRIVATE"); //$NON-NLS-1$
}
@@ -923,7 +944,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("PROTECTED"); //$NON-NLS-1$
}
@@ -931,7 +952,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("STATIC"); //$NON-NLS-1$
}
@@ -939,7 +960,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("FINAL"); //$NON-NLS-1$
}
@@ -947,7 +968,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("SUPER"); //$NON-NLS-1$
}
@@ -955,7 +976,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("INTERFACE"); //$NON-NLS-1$
}
@@ -963,7 +984,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("ABSTRACT"); //$NON-NLS-1$
}
@@ -971,7 +992,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("SYNTHETIC"); //$NON-NLS-1$
}
@@ -979,19 +1000,19 @@ public class VerbosePacketStream extends PrintStream {
}
private void printMethodModifiers(int modifiers) {
- printDescription("Modifiers:"); //$NON-NLS-1$
+ printDescription("Modifiers:"); //$NON-NLS-1$
printHex(modifiers);
print(" ("); //$NON-NLS-1$
- boolean spaceNeeded= false;
+ boolean spaceNeeded = false;
if ((modifiers & ACC_PUBLIC) != 0) {
print("PUBLIC"); //$NON-NLS-1$
- spaceNeeded= true;
+ spaceNeeded = true;
}
if ((modifiers & ACC_PRIVATE) != 0) {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("PRIVATE"); //$NON-NLS-1$
}
@@ -999,7 +1020,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("PROTECTED"); //$NON-NLS-1$
}
@@ -1007,7 +1028,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("STATIC"); //$NON-NLS-1$
}
@@ -1015,7 +1036,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("FINAL"); //$NON-NLS-1$
}
@@ -1023,7 +1044,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("SYNCHRONIZED"); //$NON-NLS-1$
}
@@ -1031,7 +1052,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("BRIDGE"); //$NON-NLS-1$
}
@@ -1039,7 +1060,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("VARARGS"); //$NON-NLS-1$
}
@@ -1047,7 +1068,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("NATIVE"); //$NON-NLS-1$
}
@@ -1055,7 +1076,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("ABSTRACT"); //$NON-NLS-1$
}
@@ -1063,35 +1084,35 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("STRICT"); //$NON-NLS-1$
}
- if ((modifiers & (ACC_EXT_SYNTHETIC | ACC_SYNTHETIC )) != 0) {
+ if ((modifiers & (ACC_EXT_SYNTHETIC | ACC_SYNTHETIC)) != 0) {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("SYNTHETIC"); //$NON-NLS-1$
}
println(')');
}
-
+
private void printFieldModifiers(int modifiers) {
- printDescription("Modifiers:"); //$NON-NLS-1$
+ printDescription("Modifiers:"); //$NON-NLS-1$
printHex(modifiers);
print(" ("); //$NON-NLS-1$
- boolean spaceNeeded= false;
+ boolean spaceNeeded = false;
if ((modifiers & ACC_PUBLIC) != 0) {
print("PUBLIC"); //$NON-NLS-1$
- spaceNeeded= true;
+ spaceNeeded = true;
}
if ((modifiers & ACC_PRIVATE) != 0) {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("PRIVATE"); //$NON-NLS-1$
}
@@ -1099,7 +1120,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("PROTECTED"); //$NON-NLS-1$
}
@@ -1107,7 +1128,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("STATIC"); //$NON-NLS-1$
}
@@ -1115,7 +1136,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("FINAL"); //$NON-NLS-1$
}
@@ -1123,7 +1144,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("VOLATILE"); //$NON-NLS-1$
}
@@ -1131,7 +1152,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("TRANSIENT"); //$NON-NLS-1$
}
@@ -1139,7 +1160,7 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("ENUM"); //$NON-NLS-1$
}
@@ -1147,21 +1168,21 @@ public class VerbosePacketStream extends PrintStream {
if (spaceNeeded) {
print(' ');
} else {
- spaceNeeded= true;
+ spaceNeeded = true;
}
print("SYNTHETIC"); //$NON-NLS-1$
}
println(')');
}
-
+
private void printInvocationOptions(int invocationOptions) {
- printDescription("Invocation Options:"); //$NON-NLS-1$
+ printDescription("Invocation Options:"); //$NON-NLS-1$
printHex(invocationOptions);
print(" ("); //$NON-NLS-1$
- boolean spaceNeeded= false;
+ boolean spaceNeeded = false;
if ((invocationOptions & INVOKE_SINGLE_THREADED) != 0) {
print("SINGLE_THREADED"); //$NON-NLS-1$
- spaceNeeded= true;
+ spaceNeeded = true;
}
if ((invocationOptions & INVOKE_NONVIRTUAL) != 0) {
if (spaceNeeded) {
@@ -1171,36 +1192,36 @@ public class VerbosePacketStream extends PrintStream {
}
println(')');
}
-
+
private void printThreadStatus(int threadStatus) {
- printDescription("Thread status:"); //$NON-NLS-1$
+ printDescription("Thread status:"); //$NON-NLS-1$
printHex(threadStatus);
print(" ("); //$NON-NLS-1$
switch (threadStatus) {
- case THREAD_STATUS_ZOMBIE:
- print("ZOMBIE"); //$NON-NLS-1$
- break;
- case THREAD_STATUS_RUNNING:
- print("RUNNING"); //$NON-NLS-1$
- break;
- case THREAD_STATUS_SLEEPING:
- print("SLEEPING"); //$NON-NLS-1$
- break;
- case THREAD_STATUS_MONITOR:
- print("MONITOR"); //$NON-NLS-1$
- break;
- case THREAD_STATUS_WAIT:
- print("WAIT"); //$NON-NLS-1$
- break;
- default:
- print("unknown"); //$NON-NLS-1$
- break;
+ case THREAD_STATUS_ZOMBIE:
+ print("ZOMBIE"); //$NON-NLS-1$
+ break;
+ case THREAD_STATUS_RUNNING:
+ print("RUNNING"); //$NON-NLS-1$
+ break;
+ case THREAD_STATUS_SLEEPING:
+ print("SLEEPING"); //$NON-NLS-1$
+ break;
+ case THREAD_STATUS_MONITOR:
+ print("MONITOR"); //$NON-NLS-1$
+ break;
+ case THREAD_STATUS_WAIT:
+ print("WAIT"); //$NON-NLS-1$
+ break;
+ default:
+ print("unknown"); //$NON-NLS-1$
+ break;
}
println(')');
}
-
+
private void printSuspendStatus(int suspendStatus) {
- printDescription("Suspend status:"); //$NON-NLS-1$
+ printDescription("Suspend status:"); //$NON-NLS-1$
printHex(suspendStatus);
print(" ("); //$NON-NLS-1$
if ((suspendStatus & SUSPEND_STATUS_SUSPENDED) != 0) {
@@ -1208,209 +1229,214 @@ public class VerbosePacketStream extends PrintStream {
}
println(')');
}
-
+
private void printEventKind(byte eventKind) {
- printDescription("Event kind:"); //$NON-NLS-1$
+ printDescription("Event kind:"); //$NON-NLS-1$
printHex(eventKind);
print(" ("); //$NON-NLS-1$
switch (eventKind) {
- case EVENTKIND_SINGLE_STEP:
- print("SINGLE_STEP"); //$NON-NLS-1$
- break;
- case EVENTKIND_BREAKPOINT:
- print("BREAKPOINT"); //$NON-NLS-1$
- break;
- case EVENTKIND_FRAME_POP:
- print("FRAME_POP"); //$NON-NLS-1$
- break;
- case EVENTKIND_EXCEPTION:
- print("EXCEPTION"); //$NON-NLS-1$
- break;
- case EVENTKIND_USER_DEFINED:
- print("USER_DEFINED"); //$NON-NLS-1$
- break;
- case EVENTKIND_THREAD_START:
- print("THREAD_START"); //$NON-NLS-1$
- break;
- case EVENTKIND_THREAD_END:
- print("THREAD_END"); //$NON-NLS-1$
- break;
- case EVENTKIND_CLASS_PREPARE:
- print("CLASS_PREPARE"); //$NON-NLS-1$
- break;
- case EVENTKIND_CLASS_UNLOAD:
- print("CLASS_UNLOAD"); //$NON-NLS-1$
- break;
- case EVENTKIND_CLASS_LOAD:
- print("CLASS_LOAD"); //$NON-NLS-1$
- break;
- case EVENTKIND_FIELD_ACCESS:
- print("FIELD_ACCESS"); //$NON-NLS-1$
- break;
- case EVENTKIND_FIELD_MODIFICATION:
- print("FIELD_MODIFICATION"); //$NON-NLS-1$
- break;
- case EVENTKIND_EXCEPTION_CATCH:
- print("EXCEPTION_CATCH"); //$NON-NLS-1$
- break;
- case EVENTKIND_METHOD_ENTRY:
- print("METHOD_ENTRY"); //$NON-NLS-1$
- break;
- case EVENTKIND_METHOD_EXIT:
- print("METHOD_EXIT"); //$NON-NLS-1$
- break;
- case EVENTKIND_VM_INIT:
- print("VM_INIT"); //$NON-NLS-1$
- break;
- case EVENTKIND_VM_DEATH:
- print("VM_DEATH"); //$NON-NLS-1$
- break;
- case EVENTKIND_VM_DISCONNECTED:
- print("VM_DISCONNECTED"); //$NON-NLS-1$
- break;
- default:
- print("unknown"); //$NON-NLS-1$
- break;
+ case EVENTKIND_SINGLE_STEP:
+ print("SINGLE_STEP"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_BREAKPOINT:
+ print("BREAKPOINT"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_FRAME_POP:
+ print("FRAME_POP"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_EXCEPTION:
+ print("EXCEPTION"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_USER_DEFINED:
+ print("USER_DEFINED"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_THREAD_START:
+ print("THREAD_START"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_THREAD_END:
+ print("THREAD_END"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_CLASS_PREPARE:
+ print("CLASS_PREPARE"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_CLASS_UNLOAD:
+ print("CLASS_UNLOAD"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_CLASS_LOAD:
+ print("CLASS_LOAD"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_FIELD_ACCESS:
+ print("FIELD_ACCESS"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_FIELD_MODIFICATION:
+ print("FIELD_MODIFICATION"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_EXCEPTION_CATCH:
+ print("EXCEPTION_CATCH"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_METHOD_ENTRY:
+ print("METHOD_ENTRY"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_METHOD_EXIT:
+ print("METHOD_EXIT"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_VM_INIT:
+ print("VM_INIT"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_VM_DEATH:
+ print("VM_DEATH"); //$NON-NLS-1$
+ break;
+ case EVENTKIND_VM_DISCONNECTED:
+ print("VM_DISCONNECTED"); //$NON-NLS-1$
+ break;
+ default:
+ print("unknown"); //$NON-NLS-1$
+ break;
}
println(')');
}
private void printSuspendPolicy(byte suspendPolicy) {
- printDescription("Suspend policy:"); //$NON-NLS-1$
+ printDescription("Suspend policy:"); //$NON-NLS-1$
printHex(suspendPolicy);
print(" ("); //$NON-NLS-1$
switch (suspendPolicy) {
- case SUSPENDPOLICY_NONE:
- print("NONE"); //$NON-NLS-1$
- break;
- case SUSPENDPOLICY_EVENT_THREAD:
- print("EVENT_THREAD"); //$NON-NLS-1$
- break;
- case SUSPENDPOLICY_ALL:
- print("ALL"); //$NON-NLS-1$
- break;
- default:
- print("unknown"); //$NON-NLS-1$
- break;
+ case SUSPENDPOLICY_NONE:
+ print("NONE"); //$NON-NLS-1$
+ break;
+ case SUSPENDPOLICY_EVENT_THREAD:
+ print("EVENT_THREAD"); //$NON-NLS-1$
+ break;
+ case SUSPENDPOLICY_ALL:
+ print("ALL"); //$NON-NLS-1$
+ break;
+ default:
+ print("unknown"); //$NON-NLS-1$
+ break;
}
println(')');
}
-
+
private void printStepDepth(int setDepth) {
- printDescription("Step depth:"); //$NON-NLS-1$
+ printDescription("Step depth:"); //$NON-NLS-1$
printHex(setDepth);
print(" ("); //$NON-NLS-1$
switch (setDepth) {
- case STEPDEPTH_INTO:
- print("INTO"); //$NON-NLS-1$
- break;
- case STEPDEPTH_OVER:
- print("OVER"); //$NON-NLS-1$
- break;
- case STEPDEPTH_OUT:
- print("OUT"); //$NON-NLS-1$
- break;
- default:
- print("unknown"); //$NON-NLS-1$
- break;
+ case STEPDEPTH_INTO:
+ print("INTO"); //$NON-NLS-1$
+ break;
+ case STEPDEPTH_OVER:
+ print("OVER"); //$NON-NLS-1$
+ break;
+ case STEPDEPTH_OUT:
+ print("OUT"); //$NON-NLS-1$
+ break;
+ default:
+ print("unknown"); //$NON-NLS-1$
+ break;
}
println(')');
}
-
+
private void printStepSize(int setSize) {
- printDescription("Step size:"); //$NON-NLS-1$
+ printDescription("Step size:"); //$NON-NLS-1$
printHex(setSize);
print(" ("); //$NON-NLS-1$
switch (setSize) {
- case STEPSIZE_MIN:
- print("MIN"); //$NON-NLS-1$
- break;
- case STEPSIZE_LINE:
- print("LINE"); //$NON-NLS-1$
- break;
- default:
- print("unknown"); //$NON-NLS-1$
- break;
+ case STEPSIZE_MIN:
+ print("MIN"); //$NON-NLS-1$
+ break;
+ case STEPSIZE_LINE:
+ print("LINE"); //$NON-NLS-1$
+ break;
+ default:
+ print("unknown"); //$NON-NLS-1$
+ break;
}
println(')');
}
private void printVmVersionReply(DataInputStream in) throws IOException {
- String description= readString(in);
- int jdwpMajor= in.readInt();
- int jdwpMinor= in.readInt();
- String vmVersion= readString(in);
- String vmName= readString(in);
-
- println("VM Description:", description); //$NON-NLS-1$
- println("JDWP Major Version:", jdwpMajor); //$NON-NLS-1$
- println("JDWP Minor Version:", jdwpMinor); //$NON-NLS-1$
- println("VM Version:", vmVersion); //$NON-NLS-1$
- println("VM Name:", vmName); //$NON-NLS-1$
- }
-
- private void printVmClassesBySignatureCommand(DataInputStream in) throws IOException {
- String signature= readString(in);
- println("Class signature:", signature); //$NON-NLS-1$
- }
-
- private void printVmClassesBySignatureReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int classesCount= in.readInt();
- println("Classes count:", classesCount); //$NON-NLS-1$
- for(int i= 0; i < classesCount; i++) {
- byte refTypeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
- int status= in.readInt();
+ String description = readString(in);
+ int jdwpMajor = in.readInt();
+ int jdwpMinor = in.readInt();
+ String vmVersion = readString(in);
+ String vmName = readString(in);
+
+ println("VM Description:", description); //$NON-NLS-1$
+ println("JDWP Major Version:", jdwpMajor); //$NON-NLS-1$
+ println("JDWP Minor Version:", jdwpMinor); //$NON-NLS-1$
+ println("VM Version:", vmVersion); //$NON-NLS-1$
+ println("VM Name:", vmName); //$NON-NLS-1$
+ }
+
+ private void printVmClassesBySignatureCommand(DataInputStream in)
+ throws IOException {
+ String signature = readString(in);
+ println("Class signature:", signature); //$NON-NLS-1$
+ }
+
+ private void printVmClassesBySignatureReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int classesCount = in.readInt();
+ println("Classes count:", classesCount); //$NON-NLS-1$
+ for (int i = 0; i < classesCount; i++) {
+ byte refTypeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
+ int status = in.readInt();
printRefTypeTag(refTypeTag);
- printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
+ printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
printClassStatus(status);
- }
+ }
}
- private void printVmAllClassesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int classesCount= in.readInt();
- println("Classes count:", classesCount); //$NON-NLS-1$
- for(int i= 0; i < classesCount; i++) {
- byte refTypeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
- String signature= readString(in);
- int status= in.readInt();
+ private void printVmAllClassesReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int classesCount = in.readInt();
+ println("Classes count:", classesCount); //$NON-NLS-1$
+ for (int i = 0; i < classesCount; i++) {
+ byte refTypeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
+ String signature = readString(in);
+ int status = in.readInt();
printRefTypeTag(refTypeTag);
- printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
- println("Class signature:", signature); //$NON-NLS-1$
+ printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
+ println("Class signature:", signature); //$NON-NLS-1$
printClassStatus(status);
}
}
-
- private void printVmAllThreadsReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int threadsCount= in.readInt();
- println("Threads count:", threadsCount); //$NON-NLS-1$
- for(int i= 0; i < threadsCount; i++) {
- long threadId= readObjectID(in);
- printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
+
+ private void printVmAllThreadsReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int threadsCount = in.readInt();
+ println("Threads count:", threadsCount); //$NON-NLS-1$
+ for (int i = 0; i < threadsCount; i++) {
+ long threadId = readObjectID(in);
+ printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
}
}
-
- private void printVmTopLevelThreadGroupReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int groupsCount= in.readInt();
- println("Threads count:", groupsCount); //$NON-NLS-1$
- for(int i= 0; i < groupsCount; i++) {
- long threadGroupId= readObjectID(in);
- printlnObjectId("Thread id:", threadGroupId); //$NON-NLS-1$
+
+ private void printVmTopLevelThreadGroupReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int groupsCount = in.readInt();
+ println("Threads count:", groupsCount); //$NON-NLS-1$
+ for (int i = 0; i < groupsCount; i++) {
+ long threadGroupId = readObjectID(in);
+ printlnObjectId("Thread id:", threadGroupId); //$NON-NLS-1$
}
}
-
+
private void printVmIdSizesReply(DataInputStream in) throws IOException {
- int fieldIDSize= in.readInt();
- int methodIDSize= in.readInt();
- int objectIDSize= in.readInt();
- int referenceTypeIDSize= in.readInt();
- int frameIDSize= in.readInt();
- println("Field ID size:", fieldIDSize); //$NON-NLS-1$
- println("Method ID size:", methodIDSize); //$NON-NLS-1$
- println("Object ID size:", objectIDSize); //$NON-NLS-1$
- println("Reference type ID size:", referenceTypeIDSize); //$NON-NLS-1$
- println("Frame ID size:", frameIDSize); //$NON-NLS-1$
+ int fieldIDSize = in.readInt();
+ int methodIDSize = in.readInt();
+ int objectIDSize = in.readInt();
+ int referenceTypeIDSize = in.readInt();
+ int frameIDSize = in.readInt();
+ println("Field ID size:", fieldIDSize); //$NON-NLS-1$
+ println("Method ID size:", methodIDSize); //$NON-NLS-1$
+ println("Object ID size:", objectIDSize); //$NON-NLS-1$
+ println("Reference type ID size:", referenceTypeIDSize); //$NON-NLS-1$
+ println("Frame ID size:", frameIDSize); //$NON-NLS-1$
TcpipSpy.setFieldIDSize(fieldIDSize);
TcpipSpy.setMethodIDSize(methodIDSize);
TcpipSpy.setObjectIDSize(objectIDSize);
@@ -1420,148 +1446,156 @@ public class VerbosePacketStream extends PrintStream {
}
private void printVmExitCommand(DataInputStream in) throws IOException {
- int exitCode= in.readInt();
- println("Exit code:", exitCode); //$NON-NLS-1$
- }
-
- private void printVmCreateStringCommand(DataInputStream in) throws IOException {
- String string= readString(in);
- println("String:", string); //$NON-NLS-1$
- }
-
- private void printVmCreateStringReply(DataInputStream in) throws IOException, UnableToParseDataException {
- long stringId= readObjectID(in);
- printlnObjectId("String id:", stringId); //$NON-NLS-1$
- }
-
- private void printVmCapabilitiesReply(DataInputStream in) throws IOException {
- boolean canWatchFieldModification= in.readBoolean();
- boolean canWatchFieldAccess= in.readBoolean();
- boolean canGetBytecodes= in.readBoolean();
- boolean canGetSyntheticAttribute= in.readBoolean();
- boolean canGetOwnedMonitorInfo= in.readBoolean();
- boolean canGetCurrentContendedMonitor= in.readBoolean();
- boolean canGetMonitorInfo= in.readBoolean();
- println("Can watch field modification:", canWatchFieldModification); //$NON-NLS-1$
- println("can watch field access:", canWatchFieldAccess); //$NON-NLS-1$
- println("Can get bytecodes:", canGetBytecodes); //$NON-NLS-1$
- println("Can get synthetic attribute:", canGetSyntheticAttribute); //$NON-NLS-1$
- println("Can get owned monitor info:", canGetOwnedMonitorInfo); //$NON-NLS-1$
- println("Can get currently contended monitor:", canGetCurrentContendedMonitor); //$NON-NLS-1$
- println("Can get monitor info:", canGetMonitorInfo); //$NON-NLS-1$
- }
-
+ int exitCode = in.readInt();
+ println("Exit code:", exitCode); //$NON-NLS-1$
+ }
+
+ private void printVmCreateStringCommand(DataInputStream in)
+ throws IOException {
+ String string = readString(in);
+ println("String:", string); //$NON-NLS-1$
+ }
+
+ private void printVmCreateStringReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long stringId = readObjectID(in);
+ printlnObjectId("String id:", stringId); //$NON-NLS-1$
+ }
+
+ private void printVmCapabilitiesReply(DataInputStream in)
+ throws IOException {
+ boolean canWatchFieldModification = in.readBoolean();
+ boolean canWatchFieldAccess = in.readBoolean();
+ boolean canGetBytecodes = in.readBoolean();
+ boolean canGetSyntheticAttribute = in.readBoolean();
+ boolean canGetOwnedMonitorInfo = in.readBoolean();
+ boolean canGetCurrentContendedMonitor = in.readBoolean();
+ boolean canGetMonitorInfo = in.readBoolean();
+ println("Can watch field modification:", canWatchFieldModification); //$NON-NLS-1$
+ println("can watch field access:", canWatchFieldAccess); //$NON-NLS-1$
+ println("Can get bytecodes:", canGetBytecodes); //$NON-NLS-1$
+ println("Can get synthetic attribute:", canGetSyntheticAttribute); //$NON-NLS-1$
+ println("Can get owned monitor info:", canGetOwnedMonitorInfo); //$NON-NLS-1$
+ println("Can get currently contended monitor:", canGetCurrentContendedMonitor); //$NON-NLS-1$
+ println("Can get monitor info:", canGetMonitorInfo); //$NON-NLS-1$
+ }
+
private void printVmClassPathsReply(DataInputStream in) throws IOException {
- String baseDir= readString(in);
- println("Base directory:", baseDir); //$NON-NLS-1$
- int classpathCount= in.readInt();
- println("Classpaths count:", classpathCount); //$NON-NLS-1$
- for (int i= 0; i < classpathCount; i++) {
- String path= readString(in);
- println("Classpath:", path); //$NON-NLS-1$
- }
- int bootclasspathCount= in.readInt();
- println("Bootclasspaths count:", bootclasspathCount); //$NON-NLS-1$
- for (int i= 0; i < bootclasspathCount; i++) {
- String path= readString(in);
- println("Bootclasspath:", path); //$NON-NLS-1$
- }
- }
-
- private void printVmDisposeObjectsCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- int requestsCount= in.readInt();
- println("Requests Count:", requestsCount); //$NON-NLS-1$
- for (int i=0; i < requestsCount; i++) {
- long objectId= readObjectID(in);
- int refsCounts= in.readInt();
- printlnObjectId("Object id:", objectId); //$NON-NLS-1$
- println("References count:", refsCounts); //$NON-NLS-1$
- }
- }
-
- private void printVmCapabilitiesNewReply(DataInputStream in) throws IOException {
+ String baseDir = readString(in);
+ println("Base directory:", baseDir); //$NON-NLS-1$
+ int classpathCount = in.readInt();
+ println("Classpaths count:", classpathCount); //$NON-NLS-1$
+ for (int i = 0; i < classpathCount; i++) {
+ String path = readString(in);
+ println("Classpath:", path); //$NON-NLS-1$
+ }
+ int bootclasspathCount = in.readInt();
+ println("Bootclasspaths count:", bootclasspathCount); //$NON-NLS-1$
+ for (int i = 0; i < bootclasspathCount; i++) {
+ String path = readString(in);
+ println("Bootclasspath:", path); //$NON-NLS-1$
+ }
+ }
+
+ private void printVmDisposeObjectsCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int requestsCount = in.readInt();
+ println("Requests Count:", requestsCount); //$NON-NLS-1$
+ for (int i = 0; i < requestsCount; i++) {
+ long objectId = readObjectID(in);
+ int refsCounts = in.readInt();
+ printlnObjectId("Object id:", objectId); //$NON-NLS-1$
+ println("References count:", refsCounts); //$NON-NLS-1$
+ }
+ }
+
+ private void printVmCapabilitiesNewReply(DataInputStream in)
+ throws IOException {
printVmCapabilitiesReply(in);
- boolean canRedefineClasses= in.readBoolean();
- boolean canAddMethod= in.readBoolean();
- boolean canUnrestrictedlyRedefineClasses= in.readBoolean();
- boolean canPopFrames= in.readBoolean();
- boolean canUseInstanceFilters= in.readBoolean();
- boolean canGetSourceDebugExtension= in.readBoolean();
- boolean canRequestVMDeathEvent= in.readBoolean();
- boolean canSetDefaultStratum= in.readBoolean();
- boolean reserved16= in.readBoolean();
- boolean reserved17= in.readBoolean();
- boolean reserved18= in.readBoolean();
- boolean reserved19= in.readBoolean();
- boolean reserved20= in.readBoolean();
- boolean reserved21= in.readBoolean();
- boolean reserved22= in.readBoolean();
- boolean reserved23= in.readBoolean();
- boolean reserved24= in.readBoolean();
- boolean reserved25= in.readBoolean();
- boolean reserved26= in.readBoolean();
- boolean reserved27= in.readBoolean();
- boolean reserved28= in.readBoolean();
- boolean reserved29= in.readBoolean();
- boolean reserved30= in.readBoolean();
- boolean reserved31= in.readBoolean();
- boolean reserved32= in.readBoolean();
- println("Can redefine classes:", canRedefineClasses); //$NON-NLS-1$
- println("Can add method:", canAddMethod); //$NON-NLS-1$
- println("Can unrestrictedly rd. classes:", canUnrestrictedlyRedefineClasses); //$NON-NLS-1$
- println("Can pop frames:", canPopFrames); //$NON-NLS-1$
- println("Can use instance filters:", canUseInstanceFilters); //$NON-NLS-1$
- println("Can get source debug extension:", canGetSourceDebugExtension); //$NON-NLS-1$
- println("Can request VMDeath event:", canRequestVMDeathEvent); //$NON-NLS-1$
- println("Can set default stratum:", canSetDefaultStratum); //$NON-NLS-1$
- println("Reserved:", reserved16); //$NON-NLS-1$
- println("Reserved:", reserved17); //$NON-NLS-1$
- println("Reserved:", reserved18); //$NON-NLS-1$
- println("Reserved:", reserved19); //$NON-NLS-1$
- println("Reserved:", reserved20); //$NON-NLS-1$
- println("Reserved:", reserved21); //$NON-NLS-1$
- println("Reserved:", reserved22); //$NON-NLS-1$
- println("Reserved:", reserved23); //$NON-NLS-1$
- println("Reserved:", reserved24); //$NON-NLS-1$
- println("Reserved:", reserved25); //$NON-NLS-1$
- println("Reserved:", reserved26); //$NON-NLS-1$
- println("Reserved:", reserved27); //$NON-NLS-1$
- println("Reserved:", reserved28); //$NON-NLS-1$
- println("Reserved:", reserved29); //$NON-NLS-1$
- println("Reserved:", reserved30); //$NON-NLS-1$
- println("Reserved:", reserved31); //$NON-NLS-1$
- println("Reserved:", reserved32); //$NON-NLS-1$
- }
-
- private void printVmRedefineClassCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- int typesCount= in.readInt();
- println("Types count:", typesCount); //$NON-NLS-1$
- for (int i= 0; i < typesCount; i++) {
- long typeId= readReferenceTypeID(in);
- int classfileLength= in.readInt();
- printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
+ boolean canRedefineClasses = in.readBoolean();
+ boolean canAddMethod = in.readBoolean();
+ boolean canUnrestrictedlyRedefineClasses = in.readBoolean();
+ boolean canPopFrames = in.readBoolean();
+ boolean canUseInstanceFilters = in.readBoolean();
+ boolean canGetSourceDebugExtension = in.readBoolean();
+ boolean canRequestVMDeathEvent = in.readBoolean();
+ boolean canSetDefaultStratum = in.readBoolean();
+ boolean reserved16 = in.readBoolean();
+ boolean reserved17 = in.readBoolean();
+ boolean reserved18 = in.readBoolean();
+ boolean reserved19 = in.readBoolean();
+ boolean reserved20 = in.readBoolean();
+ boolean reserved21 = in.readBoolean();
+ boolean reserved22 = in.readBoolean();
+ boolean reserved23 = in.readBoolean();
+ boolean reserved24 = in.readBoolean();
+ boolean reserved25 = in.readBoolean();
+ boolean reserved26 = in.readBoolean();
+ boolean reserved27 = in.readBoolean();
+ boolean reserved28 = in.readBoolean();
+ boolean reserved29 = in.readBoolean();
+ boolean reserved30 = in.readBoolean();
+ boolean reserved31 = in.readBoolean();
+ boolean reserved32 = in.readBoolean();
+ println("Can redefine classes:", canRedefineClasses); //$NON-NLS-1$
+ println("Can add method:", canAddMethod); //$NON-NLS-1$
+ println("Can unrestrictedly rd. classes:", canUnrestrictedlyRedefineClasses); //$NON-NLS-1$
+ println("Can pop frames:", canPopFrames); //$NON-NLS-1$
+ println("Can use instance filters:", canUseInstanceFilters); //$NON-NLS-1$
+ println("Can get source debug extension:", canGetSourceDebugExtension); //$NON-NLS-1$
+ println("Can request VMDeath event:", canRequestVMDeathEvent); //$NON-NLS-1$
+ println("Can set default stratum:", canSetDefaultStratum); //$NON-NLS-1$
+ println("Reserved:", reserved16); //$NON-NLS-1$
+ println("Reserved:", reserved17); //$NON-NLS-1$
+ println("Reserved:", reserved18); //$NON-NLS-1$
+ println("Reserved:", reserved19); //$NON-NLS-1$
+ println("Reserved:", reserved20); //$NON-NLS-1$
+ println("Reserved:", reserved21); //$NON-NLS-1$
+ println("Reserved:", reserved22); //$NON-NLS-1$
+ println("Reserved:", reserved23); //$NON-NLS-1$
+ println("Reserved:", reserved24); //$NON-NLS-1$
+ println("Reserved:", reserved25); //$NON-NLS-1$
+ println("Reserved:", reserved26); //$NON-NLS-1$
+ println("Reserved:", reserved27); //$NON-NLS-1$
+ println("Reserved:", reserved28); //$NON-NLS-1$
+ println("Reserved:", reserved29); //$NON-NLS-1$
+ println("Reserved:", reserved30); //$NON-NLS-1$
+ println("Reserved:", reserved31); //$NON-NLS-1$
+ println("Reserved:", reserved32); //$NON-NLS-1$
+ }
+
+ private void printVmRedefineClassCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int typesCount = in.readInt();
+ println("Types count:", typesCount); //$NON-NLS-1$
+ for (int i = 0; i < typesCount; i++) {
+ long typeId = readReferenceTypeID(in);
+ int classfileLength = in.readInt();
+ printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
println("Classfile length:", classfileLength); //$NON-NLS-1$
- while((classfileLength -= in.skipBytes(classfileLength)) != 0) {
+ while ((classfileLength -= in.skipBytes(classfileLength)) != 0) {
}
printDescription("Class bytes:"); //$NON-NLS-1$
println("skipped"); //$NON-NLS-1$
}
}
-
- private void printVmSetDefaultStratumCommand(DataInputStream in) throws IOException {
- String stratumId= readString(in);
+
+ private void printVmSetDefaultStratumCommand(DataInputStream in)
+ throws IOException {
+ String stratumId = readString(in);
println("Stratum id:", stratumId); //$NON-NLS-1$
}
-
- private void printVmAllClassesWithGenericReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int classesCount= in.readInt();
+
+ private void printVmAllClassesWithGenericReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int classesCount = in.readInt();
println("Classes count:", classesCount); //$NON-NLS-1$
- for(int i= 0; i < classesCount; i++) {
- byte refTypeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
- String signature= readString(in);
- String genericSignature= readString(in);
- int status= in.readInt();
+ for (int i = 0; i < classesCount; i++) {
+ byte refTypeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
+ String signature = readString(in);
+ String genericSignature = readString(in);
+ int status = in.readInt();
printRefTypeTag(refTypeTag);
printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
println("Class signature:", signature); //$NON-NLS-1$
@@ -1569,132 +1603,144 @@ public class VerbosePacketStream extends PrintStream {
printClassStatus(status);
}
}
-
- private void printRtDefaultCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long typeId= readReferenceTypeID(in);
+
+ private void printRtDefaultCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long typeId = readReferenceTypeID(in);
printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
}
-
+
private void printRtSignatureReply(DataInputStream in) throws IOException {
- String signature= readString(in);
+ String signature = readString(in);
println("Signature:", signature); //$NON-NLS-1$
}
-
- private void printRtClassLoaderReply(DataInputStream in) throws IOException, UnableToParseDataException {
- long classLoaderId= readObjectID(in);
+
+ private void printRtClassLoaderReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long classLoaderId = readObjectID(in);
printlnObjectId("ClassLoader id:", classLoaderId); //$NON-NLS-1$
}
private void printRtModifiersReply(DataInputStream in) throws IOException {
- int modifiers= in.readInt();
+ int modifiers = in.readInt();
printClassModifiers(modifiers);
}
- private void printRtFieldsReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int fieldsCount= in.readInt();
+ private void printRtFieldsReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int fieldsCount = in.readInt();
println("Fields count:", fieldsCount); //$NON-NLS-1$
- for (int i= 0; i < fieldsCount; i++) {
- long fieldId= readFieldID(in);
- String name= readString(in);
- String signature= readString(in);
- int modifiers= in.readInt();
+ for (int i = 0; i < fieldsCount; i++) {
+ long fieldId = readFieldID(in);
+ String name = readString(in);
+ String signature = readString(in);
+ int modifiers = in.readInt();
printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
println("Name:", name); //$NON-NLS-1$
println("Signature:", signature); //$NON-NLS-1$
printFieldModifiers(modifiers);
}
}
-
- private void printRtMethodsReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int methodsCount= in.readInt();
+
+ private void printRtMethodsReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int methodsCount = in.readInt();
println("Methods count:", methodsCount); //$NON-NLS-1$
- for (int i= 0; i < methodsCount; i++) {
- long methodId= readMethodID(in);
- String name= readString(in);
- String signature= readString(in);
- int modifiers= in.readInt();
+ for (int i = 0; i < methodsCount; i++) {
+ long methodId = readMethodID(in);
+ String name = readString(in);
+ String signature = readString(in);
+ int modifiers = in.readInt();
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
println("Name:", name); //$NON-NLS-1$
println("Signature:", signature); //$NON-NLS-1$
printMethodModifiers(modifiers);
}
}
-
- private void printRtGetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long typeId= readReferenceTypeID(in);
- int fieldsCount= in.readInt();
+
+ private void printRtGetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long typeId = readReferenceTypeID(in);
+ int fieldsCount = in.readInt();
printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
println("Fields count:", fieldsCount); //$NON-NLS-1$
- for (int i= 0; i < fieldsCount; i++) {
- long fieldId= readFieldID(in);
+ for (int i = 0; i < fieldsCount; i++) {
+ long fieldId = readFieldID(in);
printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
}
}
- private void printRtGetValuesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int valuesCount= in.readInt();
+ private void printRtGetValuesReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int valuesCount = in.readInt();
println("Values count:", valuesCount); //$NON-NLS-1$
- for (int i= 0; i < valuesCount; i++) {
+ for (int i = 0; i < valuesCount; i++) {
readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
}
}
-
+
private void printRtSourceFileReply(DataInputStream in) throws IOException {
- String sourceFile= readString(in);
+ String sourceFile = readString(in);
println("Source file:", sourceFile); //$NON-NLS-1$
}
-
- private void printRtNestedTypesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int typesCount= in.readInt();
+
+ private void printRtNestedTypesReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int typesCount = in.readInt();
println("Types count:", typesCount); //$NON-NLS-1$
- for (int i= 0; i < typesCount; i++) {
- byte typeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
+ for (int i = 0; i < typesCount; i++) {
+ byte typeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
printRefTypeTag(typeTag);
printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
}
}
-
+
private void printRtStatusReply(DataInputStream in) throws IOException {
- int status= in.readInt();
+ int status = in.readInt();
printClassStatus(status);
}
-
- private void printRtInterfacesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int interfacesCount= in.readInt();
+
+ private void printRtInterfacesReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int interfacesCount = in.readInt();
println("Interfaces count:", interfacesCount); //$NON-NLS-1$
- for (int i= 0; i < interfacesCount; i ++) {
- long interfaceId= readReferenceTypeID(in);
+ for (int i = 0; i < interfacesCount; i++) {
+ long interfaceId = readReferenceTypeID(in);
printlnReferenceTypeId("Interface type id:", interfaceId); //$NON-NLS-1$
}
}
-
- private void printRtClassObjectReply(DataInputStream in) throws IOException, UnableToParseDataException {
- long classObjectId= readObjectID(in);
+
+ private void printRtClassObjectReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long classObjectId = readObjectID(in);
printlnObjectId("Class object id:", classObjectId); //$NON-NLS-1$
}
-
- private void printRtSourceDebugExtensionReply(DataInputStream in) throws IOException {
- String extension= readString(in);
+
+ private void printRtSourceDebugExtensionReply(DataInputStream in)
+ throws IOException {
+ String extension = readString(in);
println("Extension:", extension); //$NON-NLS-1$
}
-
- private void printRtSignatureWithGenericReply(DataInputStream in) throws IOException {
- String signature= readString(in);
- String genericSignature= readString(in);
- println("Signature:", signature); //$NON-NLS-1$
+
+ private void printRtSignatureWithGenericReply(DataInputStream in)
+ throws IOException {
+ String signature = readString(in);
+ String genericSignature = readString(in);
+ println("Signature:", signature); //$NON-NLS-1$
println("Generic signature:", genericSignature); //$NON-NLS-1$
}
-
- private void printRtFieldsWithGenericReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int fieldsCount= in.readInt();
+
+ private void printRtFieldsWithGenericReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int fieldsCount = in.readInt();
println("Fields count:", fieldsCount); //$NON-NLS-1$
- for (int i= 0; i < fieldsCount; i++) {
- long fieldId= readFieldID(in);
- String name= readString(in);
- String signature= readString(in);
- String genericSignature= readString(in);
- int modifiers= in.readInt();
+ for (int i = 0; i < fieldsCount; i++) {
+ long fieldId = readFieldID(in);
+ String name = readString(in);
+ String signature = readString(in);
+ String genericSignature = readString(in);
+ int modifiers = in.readInt();
printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
println("Name:", name); //$NON-NLS-1$
println("Signature:", signature); //$NON-NLS-1$
@@ -1702,123 +1748,139 @@ public class VerbosePacketStream extends PrintStream {
printFieldModifiers(modifiers);
}
}
-
- private void printRtMethodsWithGenericReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int methodsCount= in.readInt();
+
+ private void printRtMethodsWithGenericReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int methodsCount = in.readInt();
println("Methods count:", methodsCount); //$NON-NLS-1$
- for (int i= 0; i < methodsCount; i++) {
- long methodId= readMethodID(in);
- String name= readString(in);
- String genericSignature= readString(in);
- int modifiers= in.readInt();
+ for (int i = 0; i < methodsCount; i++) {
+ long methodId = readMethodID(in);
+ String name = readString(in);
+ String genericSignature = readString(in);
+ int modifiers = in.readInt();
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
println("Name:", name); //$NON-NLS-1$
-// println(TcpIpSpyMessages.VerbosePacketStream_Signature__106, signature);
- println("Generic signature:", genericSignature); //$NON-NLS-1$
+ // println(TcpIpSpyMessages.VerbosePacketStream_Signature__106,
+ // signature);
+ println("Generic signature:", genericSignature); //$NON-NLS-1$
printMethodModifiers(modifiers);
}
}
-
- private void printCtSuperclassCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long classTypeId= readReferenceTypeID(in);
+
+ private void printCtSuperclassCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long classTypeId = readReferenceTypeID(in);
printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
}
-
- private void printCtSuperclassReply(DataInputStream in) throws IOException, UnableToParseDataException {
- long superclassTypeId= readReferenceTypeID(in);
+
+ private void printCtSuperclassReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long superclassTypeId = readReferenceTypeID(in);
printlnReferenceTypeId("Superclass type id:", superclassTypeId); //$NON-NLS-1$
}
- private void printCtSetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long classTypeId= readReferenceTypeID(in);
- int fieldsCount= in.readInt();
+ private void printCtSetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long classTypeId = readReferenceTypeID(in);
+ int fieldsCount = in.readInt();
printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
println("Fields count:", fieldsCount); //$NON-NLS-1$
- throw new UnableToParseDataException("List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
- }
-
- private void printCtInvokeMethodCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long classTypeId= readReferenceTypeID(in);
- long threadId= readObjectID(in);
- long methodId= readMethodID(in);
- int argumentsCount= in.readInt();
+ throw new UnableToParseDataException(
+ "List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
+ }
+
+ private void printCtInvokeMethodCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long classTypeId = readReferenceTypeID(in);
+ long threadId = readObjectID(in);
+ long methodId = readMethodID(in);
+ int argumentsCount = in.readInt();
printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
println("Arguments count:", argumentsCount); //$NON-NLS-1$
- for (int i= 0; i < argumentsCount; i++) {
+ for (int i = 0; i < argumentsCount; i++) {
readAndPrintlnTaggedValue("Argument:", in); //$NON-NLS-1$
}
- int invocationOptions= in.readInt();
+ int invocationOptions = in.readInt();
printInvocationOptions(invocationOptions);
}
-
- private void printCtInvokeMethodReply(DataInputStream in) throws IOException, UnableToParseDataException {
+
+ private void printCtInvokeMethodReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
readAndPrintlnTaggedValue("Return value:", in); //$NON-NLS-1$
- byte signatureByte= in.readByte();
- long exception= readObjectID(in);
+ byte signatureByte = in.readByte();
+ long exception = readObjectID(in);
printlnTaggedObjectId("Exception object id:", exception, signatureByte); //$NON-NLS-1$
}
- private void printCtNewInstanceCommand(DataInputStream in) throws IOException, UnableToParseDataException {
+ private void printCtNewInstanceCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
printCtInvokeMethodCommand(in);
}
-
- private void printCtNewInstanceReply(DataInputStream in) throws IOException, UnableToParseDataException {
- byte objectSignatureByte= in.readByte();
- long newObjectId= readObjectID(in);
- byte exceptionSignatureByte= in.readByte();
- long exception= readObjectID(in);
- printlnTaggedObjectId("New object id:", newObjectId, objectSignatureByte); //$NON-NLS-1$
- printlnTaggedObjectId("Exception object id:", exception, exceptionSignatureByte); //$NON-NLS-1$
- }
-
- private void printAtNewInstanceCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long arrayTypeId= readReferenceTypeID(in);
- int length= in.readInt();
+
+ private void printCtNewInstanceReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ byte objectSignatureByte = in.readByte();
+ long newObjectId = readObjectID(in);
+ byte exceptionSignatureByte = in.readByte();
+ long exception = readObjectID(in);
+ printlnTaggedObjectId(
+ "New object id:", newObjectId, objectSignatureByte); //$NON-NLS-1$
+ printlnTaggedObjectId(
+ "Exception object id:", exception, exceptionSignatureByte); //$NON-NLS-1$
+ }
+
+ private void printAtNewInstanceCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long arrayTypeId = readReferenceTypeID(in);
+ int length = in.readInt();
printlnReferenceTypeId("Array type id:", arrayTypeId); //$NON-NLS-1$
println("Length:", length); //$NON-NLS-1$
}
-
- private void printAtNewInstanceReply(DataInputStream in) throws IOException, UnableToParseDataException {
- byte signatureByte= in.readByte();
- long newArrayId= readObjectID(in);
+
+ private void printAtNewInstanceReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ byte signatureByte = in.readByte();
+ long newArrayId = readObjectID(in);
printlnTaggedObjectId("New array id:", newArrayId, signatureByte); //$NON-NLS-1$
}
-
- private void printMDefaultCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long classTypeId= readReferenceTypeID(in);
- long methodId= readMethodID(in);
+
+ private void printMDefaultCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long classTypeId = readReferenceTypeID(in);
+ long methodId = readMethodID(in);
printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
}
-
+
private void printMLineTableReply(DataInputStream in) throws IOException {
- long start= in.readLong();
- long end= in.readLong();
- int lines= in.readInt();
+ long start = in.readLong();
+ long end = in.readLong();
+ int lines = in.readInt();
println("Lowest valid code index:", start); //$NON-NLS-1$
println("Highest valid code index:", end); //$NON-NLS-1$
println("Number of lines:", lines); //$NON-NLS-1$
- for (int i= 0; i < lines; i++) {
- long lineCodeIndex= in.readLong();
- int lineNumber= in.readInt();
+ for (int i = 0; i < lines; i++) {
+ long lineCodeIndex = in.readLong();
+ int lineNumber = in.readInt();
println("Line code Index:", lineCodeIndex); //$NON-NLS-1$
println("Line number:", lineNumber); //$NON-NLS-1$
}
}
-
- private void printMVariableTableReply(DataInputStream in) throws IOException {
- int slotsUsedByArgs= in.readInt();
- int variablesCount= in.readInt();
+
+ private void printMVariableTableReply(DataInputStream in)
+ throws IOException {
+ int slotsUsedByArgs = in.readInt();
+ int variablesCount = in.readInt();
println("Nb of slots used by all args:", slotsUsedByArgs); //$NON-NLS-1$
println("Nb of variables:", variablesCount); //$NON-NLS-1$
- for (int i= 0; i < variablesCount; i++) {
- long codeIndex= in.readLong();
- String name= readString(in);
- String signature= readString(in);
- int length= in.readInt();
- int slotId= in.readInt();
+ for (int i = 0; i < variablesCount; i++) {
+ long codeIndex = in.readLong();
+ String name = readString(in);
+ String signature = readString(in);
+ int length = in.readInt();
+ int slotId = in.readInt();
println("First code index:", codeIndex); //$NON-NLS-1$
println("Variable name:", name); //$NON-NLS-1$
println("Variable type signature:", signature); //$NON-NLS-1$
@@ -1826,33 +1888,34 @@ public class VerbosePacketStream extends PrintStream {
println("Slot id:", slotId); //$NON-NLS-1$
}
}
-
+
private void printMBytecodesReply(DataInputStream in) throws IOException {
- int bytes= in.readInt();
+ int bytes = in.readInt();
println("Nb of bytes:", bytes); //$NON-NLS-1$
- while((bytes -= in.skipBytes(bytes)) != 0) {
+ while ((bytes -= in.skipBytes(bytes)) != 0) {
}
printDescription("Method bytes:"); //$NON-NLS-1$
println("skipped"); //$NON-NLS-1$
}
-
+
private void printMIsObsoleteReply(DataInputStream in) throws IOException {
- boolean isObsolete= in.readBoolean();
+ boolean isObsolete = in.readBoolean();
println("Is obsolete:", isObsolete); //$NON-NLS-1$
}
-
- private void printMVariableTableWithGenericReply(DataInputStream in) throws IOException {
- int slotsUsedByArgs= in.readInt();
- int variablesCount= in.readInt();
+
+ private void printMVariableTableWithGenericReply(DataInputStream in)
+ throws IOException {
+ int slotsUsedByArgs = in.readInt();
+ int variablesCount = in.readInt();
println("Nb of slots used by all args:", slotsUsedByArgs); //$NON-NLS-1$
println("Nb of variables:", variablesCount); //$NON-NLS-1$
- for (int i= 0; i < variablesCount; i++) {
- long codeIndex= in.readLong();
- String name= readString(in);
- String signature= readString(in);
- String genericSignature= readString(in);
- int length= in.readInt();
- int slotId= in.readInt();
+ for (int i = 0; i < variablesCount; i++) {
+ long codeIndex = in.readLong();
+ String name = readString(in);
+ String signature = readString(in);
+ String genericSignature = readString(in);
+ int length = in.readInt();
+ int slotId = in.readInt();
println("First code index:", codeIndex); //$NON-NLS-1$
println("Variable name:", name); //$NON-NLS-1$
println("Variable type signature:", signature); //$NON-NLS-1$
@@ -1861,500 +1924,539 @@ public class VerbosePacketStream extends PrintStream {
println("Slot id:", slotId); //$NON-NLS-1$
}
}
-
- private void printOrDefaultCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long objectId= readObjectID(in);
+
+ private void printOrDefaultCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long objectId = readObjectID(in);
println("Object id:", objectId); //$NON-NLS-1$
}
-
- private void printOrReferenceTypeReply(DataInputStream in) throws IOException, UnableToParseDataException {
- byte refTypeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
+
+ private void printOrReferenceTypeReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ byte refTypeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
printRefTypeTag(refTypeTag);
printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
}
-
- private void printOrGetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long objectId= readObjectID(in);
- int fieldsCount= in.readInt();
+
+ private void printOrGetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long objectId = readObjectID(in);
+ int fieldsCount = in.readInt();
println("Object id:", objectId); //$NON-NLS-1$
println("Fields count:", fieldsCount); //$NON-NLS-1$
- for (int i= 0; i < fieldsCount; i++) {
- long fieldId= readFieldID(in);
+ for (int i = 0; i < fieldsCount; i++) {
+ long fieldId = readFieldID(in);
println("Field id:", fieldId); //$NON-NLS-1$
}
}
-
- private void printOrGetValuesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int valuesCount= in.readInt();
+
+ private void printOrGetValuesReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int valuesCount = in.readInt();
println("Values count:", valuesCount); //$NON-NLS-1$
- for (int i= 0; i < valuesCount; i++) {
+ for (int i = 0; i < valuesCount; i++) {
readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
}
}
-
- private void printOrSetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long objectId= readObjectID(in);
- int fieldsCount= in.readInt();
+
+ private void printOrSetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long objectId = readObjectID(in);
+ int fieldsCount = in.readInt();
println("Object id:", objectId); //$NON-NLS-1$
println("Fields count:", fieldsCount); //$NON-NLS-1$
- throw new UnableToParseDataException("List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
}
-
- private void printOrMonitorInfoReply(DataInputStream in) throws IOException, UnableToParseDataException {
- long ownerThreadId= readObjectID(in);
- int entryCount= in.readInt();
- int waiters= in.readInt();
+
+ private void printOrMonitorInfoReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long ownerThreadId = readObjectID(in);
+ int entryCount = in.readInt();
+ int waiters = in.readInt();
printlnObjectId("Owner thread id:", ownerThreadId); //$NON-NLS-1$
println("Entry count:", entryCount); //$NON-NLS-1$
println("Nb of waiters:", waiters); //$NON-NLS-1$
long waiterThreadId;
- for (int i= 0; i < waiters; i++) {
- waiterThreadId= readObjectID(in);
+ for (int i = 0; i < waiters; i++) {
+ waiterThreadId = readObjectID(in);
printlnObjectId("Waiting thread id:", waiterThreadId); //$NON-NLS-1$
}
}
-
- private void printOrInvokeMethodCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long objectId= readObjectID(in);
- long threadId= readObjectID(in);
- long classTypeId= readReferenceTypeID(in);
- long methodId= readMethodID(in);
- int argsCount= in.readInt();
+
+ private void printOrInvokeMethodCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long objectId = readObjectID(in);
+ long threadId = readObjectID(in);
+ long classTypeId = readReferenceTypeID(in);
+ long methodId = readMethodID(in);
+ int argsCount = in.readInt();
printlnObjectId("Object id:", objectId); //$NON-NLS-1$
printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
printlnReferenceTypeId("Class type id:", classTypeId); //$NON-NLS-1$
printlnMethodId("Method id:", methodId); //$NON-NLS-1$
println("Arguments count:", argsCount); //$NON-NLS-1$
- for (int i= 0; i < argsCount; i++) {
+ for (int i = 0; i < argsCount; i++) {
readAndPrintlnTaggedValue("Argument:", in); //$NON-NLS-1$
}
- int invocationOption= in.readInt();
+ int invocationOption = in.readInt();
printInvocationOptions(invocationOption);
}
-
- private void printOrInvokeMethodReply(DataInputStream in) throws IOException, UnableToParseDataException {
+
+ private void printOrInvokeMethodReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
readAndPrintlnTaggedValue("Return value:", in); //$NON-NLS-1$
- byte signatureByte= in.readByte();
- long exception= readObjectID(in);
+ byte signatureByte = in.readByte();
+ long exception = readObjectID(in);
printlnTaggedObjectId("Exception object id:", exception, signatureByte); //$NON-NLS-1$
}
-
+
private void printOrIsCollectedReply(DataInputStream in) throws IOException {
- boolean isCollected= in.readBoolean();
+ boolean isCollected = in.readBoolean();
println("Is collected:", isCollected); //$NON-NLS-1$
}
-
- private void printSrValueCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long stringObjectId= readObjectID(in);
+
+ private void printSrValueCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long stringObjectId = readObjectID(in);
printlnObjectId("String object id:", stringObjectId); //$NON-NLS-1$
}
-
+
private void printSrValueReply(DataInputStream in) throws IOException {
- String value= readString(in);
+ String value = readString(in);
println("Value:", value); //$NON-NLS-1$
}
-
- private void printTrDefaultCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadId= readObjectID(in);
+
+ private void printTrDefaultCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long threadId = readObjectID(in);
printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
}
-
+
private void printTrNameReply(DataInputStream in) throws IOException {
- String threadName= readString(in);
+ String threadName = readString(in);
println("Name:", threadName); //$NON-NLS-1$
}
-
+
private void printTrStatusReply(DataInputStream in) throws IOException {
- int threadStatus= in.readInt();
- int suspendStatus= in.readInt();
+ int threadStatus = in.readInt();
+ int suspendStatus = in.readInt();
printThreadStatus(threadStatus);
printSuspendStatus(suspendStatus);
}
-
- private void printTrThreadGroupReply(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadGroupId= readObjectID(in);
+
+ private void printTrThreadGroupReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long threadGroupId = readObjectID(in);
printlnObjectId("Thread group id:", threadGroupId); //$NON-NLS-1$
}
-
- private void printTrFramesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadId= readObjectID(in);
- int startFrame= in.readInt();
- int length= in.readInt();
+
+ private void printTrFramesCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long threadId = readObjectID(in);
+ int startFrame = in.readInt();
+ int length = in.readInt();
printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
println("First frame:", startFrame); //$NON-NLS-1$
println("Number of frame:", length); //$NON-NLS-1$
}
-
- private void printTrFramesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int framesCount= in.readInt();
+
+ private void printTrFramesReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int framesCount = in.readInt();
println("Frames count:", framesCount); //$NON-NLS-1$
- for (int i= 0; i < framesCount; i++) {
- long frameId= readFrameID(in);
+ for (int i = 0; i < framesCount; i++) {
+ long frameId = readFrameID(in);
printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
readAndPrintLocation(in);
}
}
-
+
private void printTrFrameCountReply(DataInputStream in) throws IOException {
- int framesCount= in.readInt();
+ int framesCount = in.readInt();
println("Frames count:", framesCount); //$NON-NLS-1$
}
-
- private void printTrOwnedMonitorsReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int monitorsCount= in.readInt();
+
+ private void printTrOwnedMonitorsReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int monitorsCount = in.readInt();
println("Monitors count:", monitorsCount); //$NON-NLS-1$
- for (int i= 0; i < monitorsCount; i++) {
- byte signatureByte= in.readByte();
- long monitorObjectId= readObjectID(in);
- printlnTaggedObjectId("Monitor object id:", monitorObjectId, signatureByte); //$NON-NLS-1$
- }
- }
-
- private void printTrCurrentContendedMonitorReply(DataInputStream in) throws IOException, UnableToParseDataException {
- byte signatureByte= in.readByte();
- long monitorObjectId= readObjectID(in);
- printlnTaggedObjectId("Monitor object id:", monitorObjectId, signatureByte); //$NON-NLS-1$
- }
-
- private void printTrStopCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadId= readObjectID(in);
- long exceptionObjectId= readObjectID(in);
+ for (int i = 0; i < monitorsCount; i++) {
+ byte signatureByte = in.readByte();
+ long monitorObjectId = readObjectID(in);
+ printlnTaggedObjectId(
+ "Monitor object id:", monitorObjectId, signatureByte); //$NON-NLS-1$
+ }
+ }
+
+ private void printTrCurrentContendedMonitorReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ byte signatureByte = in.readByte();
+ long monitorObjectId = readObjectID(in);
+ printlnTaggedObjectId(
+ "Monitor object id:", monitorObjectId, signatureByte); //$NON-NLS-1$
+ }
+
+ private void printTrStopCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long threadId = readObjectID(in);
+ long exceptionObjectId = readObjectID(in);
printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
printlnObjectId("Exception object id:", exceptionObjectId); //$NON-NLS-1$
}
-
- private void printTrSuspendCountReply(DataInputStream in) throws IOException {
- int suspendCount= in.readInt();
+
+ private void printTrSuspendCountReply(DataInputStream in)
+ throws IOException {
+ int suspendCount = in.readInt();
println("Suspend count:", suspendCount); //$NON-NLS-1$
}
-
- private void printTgrDefaultCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadGroupId= readObjectID(in);
+
+ private void printTgrDefaultCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long threadGroupId = readObjectID(in);
printlnObjectId("Thread group id:", threadGroupId); //$NON-NLS-1$
}
-
+
private void printTgrNameReply(DataInputStream in) throws IOException {
- String name= readString(in);
+ String name = readString(in);
println("Name:", name); //$NON-NLS-1$
}
-
- private void printTgrParentReply(DataInputStream in) throws IOException, UnableToParseDataException {
- long parentThreadGroupId= readObjectID(in);
+
+ private void printTgrParentReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long parentThreadGroupId = readObjectID(in);
printlnObjectId("Parent thread group id:", parentThreadGroupId); //$NON-NLS-1$
}
-
- private void printTgrChildrenReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int childThreadsCount= in.readInt();
+
+ private void printTgrChildrenReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int childThreadsCount = in.readInt();
println("Child threads count:", childThreadsCount); //$NON-NLS-1$
- for (int i= 0; i < childThreadsCount; i++) {
- long childThreadId= readObjectID(in);
+ for (int i = 0; i < childThreadsCount; i++) {
+ long childThreadId = readObjectID(in);
printlnObjectId("Child thread id:", childThreadId); //$NON-NLS-1$
}
- int childGroupThreadsCount= in.readInt();
+ int childGroupThreadsCount = in.readInt();
println("Child group threads count:", childGroupThreadsCount); //$NON-NLS-1$
- for (int i= 0; i < childGroupThreadsCount; i++) {
- long childGroupThreadId= readObjectID(in);
+ for (int i = 0; i < childGroupThreadsCount; i++) {
+ long childGroupThreadId = readObjectID(in);
printlnObjectId("Child group thread id:", childGroupThreadId); //$NON-NLS-1$
}
}
-
- private void printArLengthCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long arrayObjectId= readObjectID(in);
+
+ private void printArLengthCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long arrayObjectId = readObjectID(in);
printlnObjectId("Array object id:", arrayObjectId); //$NON-NLS-1$
}
-
+
private void printArLengthReply(DataInputStream in) throws IOException {
- int length= in.readInt();
+ int length = in.readInt();
println("Length:", length); //$NON-NLS-1$
}
-
- private void printArGetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long arrayObjectId= readObjectID(in);
- int firstIndex= in.readInt();
- int length= in.readInt();
+
+ private void printArGetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long arrayObjectId = readObjectID(in);
+ int firstIndex = in.readInt();
+ int length = in.readInt();
printlnObjectId("Array object id:", arrayObjectId); //$NON-NLS-1$
println("First index:", firstIndex); //$NON-NLS-1$
println("Length:", length); //$NON-NLS-1$
}
-
- private void printArGetValuesReply(DataInputStream in) throws IOException, UnableToParseDataException {
+
+ private void printArGetValuesReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
readAndPrintArrayRegion(in);
}
-
- private void printArSetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long arrayObjectId= readObjectID(in);
- int firstIndex= in.readInt();
- int length= in.readInt();
+
+ private void printArSetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long arrayObjectId = readObjectID(in);
+ int firstIndex = in.readInt();
+ int length = in.readInt();
printlnObjectId("Array object id:", arrayObjectId); //$NON-NLS-1$
println("First index:", firstIndex); //$NON-NLS-1$
println("Length:", length); //$NON-NLS-1$
- throw new UnableToParseDataException("List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "List of values: NOT MANAGED", remainderData(in)); //$NON-NLS-1$
}
-
- private void printClrVisibleClassesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long classLoaderObjectId= readObjectID(in);
+
+ private void printClrVisibleClassesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long classLoaderObjectId = readObjectID(in);
printlnObjectId("Class loader object id:", classLoaderObjectId); //$NON-NLS-1$
}
- private void printClrVisibleClassesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int classesCount= in.readInt();
+ private void printClrVisibleClassesReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ int classesCount = in.readInt();
println("Classes count:", classesCount); //$NON-NLS-1$
- for (int i= 0; i < classesCount; i++) {
- byte refTypeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
+ for (int i = 0; i < classesCount; i++) {
+ byte refTypeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
printRefTypeTag(refTypeTag);
printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
}
}
-
- private void printErSetCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- byte eventKind= in.readByte();
- byte suspendPolicy= in.readByte();
- int modifiersCount= in.readInt();
+
+ private void printErSetCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ byte eventKind = in.readByte();
+ byte suspendPolicy = in.readByte();
+ int modifiersCount = in.readInt();
printEventKind(eventKind);
printSuspendPolicy(suspendPolicy);
println("Modifiers count:", modifiersCount); //$NON-NLS-1$
- for (int i= 0; i < modifiersCount; i++) {
- byte modKind= in.readByte();
+ for (int i = 0; i < modifiersCount; i++) {
+ byte modKind = in.readByte();
printDescription("Modifier kind:"); //$NON-NLS-1$
printHex(modKind);
switch (modKind) {
- case 1: // count
- println(" (Count)"); //$NON-NLS-1$
- int count= in.readInt();
- println("Count:", count); //$NON-NLS-1$
- break;
- case 2: // conditional
- println(" (Conditional)"); //$NON-NLS-1$
- int exprId= in.readInt();
- println("Expression id:", exprId); //$NON-NLS-1$
- break;
- case 3: // thread only
- println(" (ThreadOnly)"); //$NON-NLS-1$
- long threadId= readObjectID(in);
- printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
- break;
- case 4: // class only
- println(" (ClassOnly)"); //$NON-NLS-1$
- long classId= readReferenceTypeID(in);
- printlnReferenceTypeId("Class type id:", classId); //$NON-NLS-1$
- break;
- case 5: // class match
- println(" (ClassMatch)"); //$NON-NLS-1$
- String classPatern= readString(in);
- println("Class pattern:", classPatern); //$NON-NLS-1$
- break;
- case 6: // class exclude
- println(" (ClassExclude)"); //$NON-NLS-1$
- classPatern= readString(in);
- println("Class pattern:", classPatern); //$NON-NLS-1$
- break;
- case 7: // location only
- println(" (LocationOnly)"); //$NON-NLS-1$
- readAndPrintLocation(in);
- break;
- case 8: // exception only
- println(" (ExceptionOnly)"); //$NON-NLS-1$
- long typeId= readReferenceTypeID(in);
- boolean caught= in.readBoolean();
- boolean uncaught= in.readBoolean();
- printlnReferenceTypeId("Exception type id:", typeId); //$NON-NLS-1$
- println("Caught:", caught); //$NON-NLS-1$
- println("Uncaught:", uncaught); //$NON-NLS-1$
- break;
- case 9: // field only
- println(" (FieldOnly)"); //$NON-NLS-1$
- long declaringTypeId= readReferenceTypeID(in);
- long fieldId= readFieldID(in);
- printlnReferenceTypeId("Declaring type id:", declaringTypeId); //$NON-NLS-1$
- printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
- break;
- case 10: // step
- println(" (Step)"); //$NON-NLS-1$
- threadId= readObjectID(in);
- int stepSize= in.readInt();
- int stepDepth= in.readInt();
- printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
- printStepSize(stepSize);
- printStepDepth(stepDepth);
- break;
- case 11: // instance only
- println(" (InstanceOnly)"); //$NON-NLS-1$
- long objectId= readObjectID(in);
- printlnObjectId("Object id:", objectId); //$NON-NLS-1$
- break;
+ case 1: // count
+ println(" (Count)"); //$NON-NLS-1$
+ int count = in.readInt();
+ println("Count:", count); //$NON-NLS-1$
+ break;
+ case 2: // conditional
+ println(" (Conditional)"); //$NON-NLS-1$
+ int exprId = in.readInt();
+ println("Expression id:", exprId); //$NON-NLS-1$
+ break;
+ case 3: // thread only
+ println(" (ThreadOnly)"); //$NON-NLS-1$
+ long threadId = readObjectID(in);
+ printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
+ break;
+ case 4: // class only
+ println(" (ClassOnly)"); //$NON-NLS-1$
+ long classId = readReferenceTypeID(in);
+ printlnReferenceTypeId("Class type id:", classId); //$NON-NLS-1$
+ break;
+ case 5: // class match
+ println(" (ClassMatch)"); //$NON-NLS-1$
+ String classPatern = readString(in);
+ println("Class pattern:", classPatern); //$NON-NLS-1$
+ break;
+ case 6: // class exclude
+ println(" (ClassExclude)"); //$NON-NLS-1$
+ classPatern = readString(in);
+ println("Class pattern:", classPatern); //$NON-NLS-1$
+ break;
+ case 7: // location only
+ println(" (LocationOnly)"); //$NON-NLS-1$
+ readAndPrintLocation(in);
+ break;
+ case 8: // exception only
+ println(" (ExceptionOnly)"); //$NON-NLS-1$
+ long typeId = readReferenceTypeID(in);
+ boolean caught = in.readBoolean();
+ boolean uncaught = in.readBoolean();
+ printlnReferenceTypeId("Exception type id:", typeId); //$NON-NLS-1$
+ println("Caught:", caught); //$NON-NLS-1$
+ println("Uncaught:", uncaught); //$NON-NLS-1$
+ break;
+ case 9: // field only
+ println(" (FieldOnly)"); //$NON-NLS-1$
+ long declaringTypeId = readReferenceTypeID(in);
+ long fieldId = readFieldID(in);
+ printlnReferenceTypeId("Declaring type id:", declaringTypeId); //$NON-NLS-1$
+ printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
+ break;
+ case 10: // step
+ println(" (Step)"); //$NON-NLS-1$
+ threadId = readObjectID(in);
+ int stepSize = in.readInt();
+ int stepDepth = in.readInt();
+ printlnObjectId("Thread id:", threadId); //$NON-NLS-1$
+ printStepSize(stepSize);
+ printStepDepth(stepDepth);
+ break;
+ case 11: // instance only
+ println(" (InstanceOnly)"); //$NON-NLS-1$
+ long objectId = readObjectID(in);
+ printlnObjectId("Object id:", objectId); //$NON-NLS-1$
+ break;
}
}
}
-
+
private void printErSetReply(DataInputStream in) throws IOException {
- int requestId= in.readInt();
+ int requestId = in.readInt();
println("Request id:", requestId); //$NON-NLS-1$
}
-
+
private void printErClearCommand(DataInputStream in) throws IOException {
- byte eventKind= in.readByte();
- int requestId= in.readInt();
+ byte eventKind = in.readByte();
+ int requestId = in.readInt();
printEventKind(eventKind);
println("Request id:", requestId); //$NON-NLS-1$
}
-
- private void printSfDefaultCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadId= readObjectID(in);
- long frameId= readFrameID(in);
+
+ private void printSfDefaultCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ long threadId = readObjectID(in);
+ long frameId = readFrameID(in);
printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
}
-
- private void printSfGetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadId= readObjectID(in);
- long frameId= readFrameID(in);
- int slotsCount= in.readInt();
+
+ private void printSfGetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long threadId = readObjectID(in);
+ long frameId = readFrameID(in);
+ int slotsCount = in.readInt();
printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
println("Slots count:", slotsCount); //$NON-NLS-1$
- for (int i= 0; i < slotsCount; i++) {
- int slotIndex= in.readInt();
- byte signatureTag= in.readByte();
+ for (int i = 0; i < slotsCount; i++) {
+ int slotIndex = in.readInt();
+ byte signatureTag = in.readByte();
println("Slot index:", slotIndex); //$NON-NLS-1$
printDescription("Signature tag:"); //$NON-NLS-1$
printSignatureByte(signatureTag, true);
println();
}
}
-
- private void printSfGetValuesReply(DataInputStream in) throws IOException, UnableToParseDataException {
- int valuesCount= in.readInt();
- println("Values count:", valuesCount); //$NON-NLS-1$
- for (int i= 0; i < valuesCount; i++) {
+
+ private void printSfGetValuesReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ int valuesCount = in.readInt();
+ println("Values count:", valuesCount); //$NON-NLS-1$
+ for (int i = 0; i < valuesCount; i++) {
readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
}
}
-
- private void printSfSetValuesCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long threadId= readObjectID(in);
- long frameId= readFrameID(in);
- int slotsCount= in.readInt();
+
+ private void printSfSetValuesCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long threadId = readObjectID(in);
+ long frameId = readFrameID(in);
+ int slotsCount = in.readInt();
printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
printlnFrameId("Frame id:", frameId); //$NON-NLS-1$
println("Slots count:", slotsCount); //$NON-NLS-1$
- for (int i= 0; i < slotsCount; i++) {
- int slotIndex= in.readInt();
+ for (int i = 0; i < slotsCount; i++) {
+ int slotIndex = in.readInt();
println("Slot index:", slotIndex); //$NON-NLS-1$
readAndPrintlnTaggedValue("Values:", in); //$NON-NLS-1$
}
}
-
- private void printSfThisObjectReply(DataInputStream in) throws IOException, UnableToParseDataException {
- byte signatureByte= in.readByte();
- long objectId= readObjectID(in);
+
+ private void printSfThisObjectReply(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ byte signatureByte = in.readByte();
+ long objectId = readObjectID(in);
printlnTaggedObjectId("'this' object id:", objectId, signatureByte); //$NON-NLS-1$
}
-
- private void printCorReflectedTypeCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- long classObjectId= readObjectID(in);
+
+ private void printCorReflectedTypeCommand(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ long classObjectId = readObjectID(in);
printlnObjectId("Class object id:", classObjectId); //$NON-NLS-1$
}
-
- private void printCorReflectedTypeReply(DataInputStream in) throws IOException, UnableToParseDataException {
- byte refTypeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
+
+ private void printCorReflectedTypeReply(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ byte refTypeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
printRefTypeTag(refTypeTag);
printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
}
- private void printECompositeCommand(DataInputStream in) throws IOException, UnableToParseDataException {
- byte suspendPolicy= in.readByte();
- int eventsCount= in.readInt();
+ private void printECompositeCommand(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ byte suspendPolicy = in.readByte();
+ int eventsCount = in.readInt();
printSuspendPolicy(suspendPolicy);
println("Events count:", eventsCount); //$NON-NLS-1$
- for (int i= 0; i < eventsCount; i++) {
- byte eventKind= in.readByte();
- int requestId= in.readInt();
+ for (int i = 0; i < eventsCount; i++) {
+ byte eventKind = in.readByte();
+ int requestId = in.readInt();
printEventKind(eventKind);
println("Request id:", requestId); //$NON-NLS-1$
switch (eventKind) {
- case EVENTKIND_VM_START:
- long threadId= readObjectID(in);
- printlnObjectId("Initial thread object id:", threadId); //$NON-NLS-1$
- break;
- case EVENTKIND_SINGLE_STEP:
- case EVENTKIND_BREAKPOINT:
- case EVENTKIND_METHOD_ENTRY:
- case EVENTKIND_METHOD_EXIT:
- threadId= readObjectID(in);
- printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
- readAndPrintLocation(in);
- break;
- case EVENTKIND_EXCEPTION:
- threadId= readObjectID(in);
- readAndPrintLocation(in);
- byte signatureByte= in.readByte();
- long objectId= readObjectID(in);
- printlnTaggedObjectId("Exception object id:", objectId, signatureByte); //$NON-NLS-1$
- readAndPrintLocation(in);
- break;
- case EVENTKIND_THREAD_START:
- case EVENTKIND_THREAD_DEATH:
- threadId= readObjectID(in);
- printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
- break;
- case EVENTKIND_CLASS_PREPARE:
- threadId= readObjectID(in);
- byte refTypeTag= in.readByte();
- long typeId= readReferenceTypeID(in);
- String typeSignature= readString(in);
- int status= in.readInt();
- printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
- printRefTypeTag(refTypeTag);
- printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
- println("Type signature:", typeSignature); //$NON-NLS-1$
- println("Status:", status); //$NON-NLS-1$
- break;
- case EVENTKIND_CLASS_UNLOAD:
- typeSignature= readString(in);
- println("Type signature:", typeSignature); //$NON-NLS-1$
- break;
- case EVENTKIND_FIELD_ACCESS:
- threadId= readObjectID(in);
- printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
- readAndPrintLocation(in);
- refTypeTag= in.readByte();
- typeId= readReferenceTypeID(in);
- long fieldId= readFieldID(in);
- signatureByte= in.readByte();
- objectId= readObjectID(in);
- printRefTypeTag(refTypeTag);
- printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
- printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
- printlnTaggedObjectId("Object id:", objectId, signatureByte); //$NON-NLS-1$
- break;
- case EVENTKIND_FIELD_MODIFICATION:
- threadId= readObjectID(in);
- printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
- readAndPrintLocation(in);
- refTypeTag= in.readByte();
- typeId= readReferenceTypeID(in);
- fieldId= readFieldID(in);
- signatureByte= in.readByte();
- objectId= readObjectID(in);
- printRefTypeTag(refTypeTag);
- printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
- printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
- printlnTaggedObjectId("Object id:", objectId, signatureByte); //$NON-NLS-1$
- readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
- break;
- case EVENTKIND_VM_DEATH:
- break;
+ case EVENTKIND_VM_START:
+ long threadId = readObjectID(in);
+ printlnObjectId("Initial thread object id:", threadId); //$NON-NLS-1$
+ break;
+ case EVENTKIND_SINGLE_STEP:
+ case EVENTKIND_BREAKPOINT:
+ case EVENTKIND_METHOD_ENTRY:
+ case EVENTKIND_METHOD_EXIT:
+ threadId = readObjectID(in);
+ printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
+ readAndPrintLocation(in);
+ break;
+ case EVENTKIND_EXCEPTION:
+ threadId = readObjectID(in);
+ readAndPrintLocation(in);
+ byte signatureByte = in.readByte();
+ long objectId = readObjectID(in);
+ printlnTaggedObjectId(
+ "Exception object id:", objectId, signatureByte); //$NON-NLS-1$
+ readAndPrintLocation(in);
+ break;
+ case EVENTKIND_THREAD_START:
+ case EVENTKIND_THREAD_DEATH:
+ threadId = readObjectID(in);
+ printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
+ break;
+ case EVENTKIND_CLASS_PREPARE:
+ threadId = readObjectID(in);
+ byte refTypeTag = in.readByte();
+ long typeId = readReferenceTypeID(in);
+ String typeSignature = readString(in);
+ int status = in.readInt();
+ printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
+ printRefTypeTag(refTypeTag);
+ printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
+ println("Type signature:", typeSignature); //$NON-NLS-1$
+ println("Status:", status); //$NON-NLS-1$
+ break;
+ case EVENTKIND_CLASS_UNLOAD:
+ typeSignature = readString(in);
+ println("Type signature:", typeSignature); //$NON-NLS-1$
+ break;
+ case EVENTKIND_FIELD_ACCESS:
+ threadId = readObjectID(in);
+ printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
+ readAndPrintLocation(in);
+ refTypeTag = in.readByte();
+ typeId = readReferenceTypeID(in);
+ long fieldId = readFieldID(in);
+ signatureByte = in.readByte();
+ objectId = readObjectID(in);
+ printRefTypeTag(refTypeTag);
+ printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
+ printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
+ printlnTaggedObjectId("Object id:", objectId, signatureByte); //$NON-NLS-1$
+ break;
+ case EVENTKIND_FIELD_MODIFICATION:
+ threadId = readObjectID(in);
+ printlnObjectId("Thread object id:", threadId); //$NON-NLS-1$
+ readAndPrintLocation(in);
+ refTypeTag = in.readByte();
+ typeId = readReferenceTypeID(in);
+ fieldId = readFieldID(in);
+ signatureByte = in.readByte();
+ objectId = readObjectID(in);
+ printRefTypeTag(refTypeTag);
+ printlnReferenceTypeId("Type id:", typeId); //$NON-NLS-1$
+ printlnFieldId("Field id:", fieldId); //$NON-NLS-1$
+ printlnTaggedObjectId("Object id:", objectId, signatureByte); //$NON-NLS-1$
+ readAndPrintlnTaggedValue("Value:", in); //$NON-NLS-1$
+ break;
+ case EVENTKIND_VM_DEATH:
+ break;
}
}
}
/**
- * Reads String from Jdwp stream.
- * Read a UTF where length has 4 bytes, and not just 2.
- * This code was based on the OTI Retysin source for readUTF.
+ * Reads String from Jdwp stream. Read a UTF where length has 4 bytes, and
+ * not just 2. This code was based on the OTI Retysin source for readUTF.
*/
private static String readString(DataInputStream in) throws IOException {
int utfSize = in.readInt();
@@ -2371,7 +2473,8 @@ public class VerbosePacketStream extends PrintStream {
int b = utfBytes[i + 1] & 0xFF;
if ((a >> 4) < 14) {
if ((b & 0xBF) == 0) {
- throw new UTFDataFormatException("Second byte input does not match UTF Specification"); //$NON-NLS-1$
+ throw new UTFDataFormatException(
+ "Second byte input does not match UTF Specification"); //$NON-NLS-1$
}
strBuffer.append((char) (((a & 0x1F) << 6) | (b & 0x3F)));
i += 2;
@@ -2379,64 +2482,77 @@ public class VerbosePacketStream extends PrintStream {
int c = utfBytes[i + 2] & 0xFF;
if ((a & 0xEF) > 0) {
if (((b & 0xBF) == 0) || ((c & 0xBF) == 0)) {
- throw new UTFDataFormatException("Second or third byte input does not mach UTF Specification_"); //$NON-NLS-1$
+ throw new UTFDataFormatException(
+ "Second or third byte input does not mach UTF Specification_"); //$NON-NLS-1$
}
- strBuffer.append((char) (((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)));
+ strBuffer.append((char) (((a & 0x0F) << 12)
+ | ((b & 0x3F) << 6) | (c & 0x3F)));
i += 3;
} else {
- throw new UTFDataFormatException("Input does not match UTF Specification"); //$NON-NLS-1$
+ throw new UTFDataFormatException(
+ "Input does not match UTF Specification"); //$NON-NLS-1$
}
}
}
}
return strBuffer.toString();
}
-
+
private byte[] remainderData(DataInputStream in) throws IOException {
- byte[] buffer= new byte[100];
+ byte[] buffer = new byte[100];
byte[] res = new byte[0], newRes;
- int resLength= 0, length;
- while ((length= in.read(buffer)) != -1) {
- newRes= new byte[resLength + length];
+ int resLength = 0, length;
+ while ((length = in.read(buffer)) != -1) {
+ newRes = new byte[resLength + length];
System.arraycopy(res, 0, newRes, 0, resLength);
System.arraycopy(buffer, 0, newRes, resLength, length);
- res= newRes;
+ res = newRes;
resLength += length;
}
return res;
}
-
- private long readObjectID(DataInputStream in) throws IOException, UnableToParseDataException {
+
+ private long readObjectID(DataInputStream in) throws IOException,
+ UnableToParseDataException {
if (!TcpipSpy.hasSizes()) {
- throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
}
return readID(in, TcpipSpy.getObjectIDSize());
}
- private long readReferenceTypeID(DataInputStream in) throws IOException, UnableToParseDataException {
+ private long readReferenceTypeID(DataInputStream in) throws IOException,
+ UnableToParseDataException {
if (!TcpipSpy.hasSizes()) {
- throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
}
return readID(in, TcpipSpy.getReferenceTypeIDSize());
}
- private long readFieldID(DataInputStream in) throws IOException, UnableToParseDataException {
+ private long readFieldID(DataInputStream in) throws IOException,
+ UnableToParseDataException {
if (!TcpipSpy.hasSizes()) {
- throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
}
return readID(in, TcpipSpy.getFieldIDSize());
}
- private long readMethodID(DataInputStream in) throws IOException, UnableToParseDataException {
+ private long readMethodID(DataInputStream in) throws IOException,
+ UnableToParseDataException {
if (!TcpipSpy.hasSizes()) {
- throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
}
return readID(in, TcpipSpy.getMethodIDSize());
}
- private long readFrameID(DataInputStream in) throws IOException, UnableToParseDataException {
+ private long readFrameID(DataInputStream in) throws IOException,
+ UnableToParseDataException {
if (!TcpipSpy.hasSizes()) {
- throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
+ throw new UnableToParseDataException(
+ "Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
}
return readID(in, TcpipSpy.getFrameIDSize());
}
@@ -2444,71 +2560,76 @@ public class VerbosePacketStream extends PrintStream {
private long readID(DataInputStream in, int size) throws IOException {
long id = 0;
for (int i = 0; i < size; i++) {
- int b = in.readUnsignedByte(); // Note that the byte must be treated as unsigned.
+ int b = in.readUnsignedByte(); // Note that the byte must be treated
+ // as unsigned.
id = id << 8 | b;
- }
+ }
return id;
}
-
- private void readAndPrintlnTaggedValue(String description, DataInputStream in) throws IOException, UnableToParseDataException {
- byte tag= in.readByte();
+
+ private void readAndPrintlnTaggedValue(String description,
+ DataInputStream in) throws IOException, UnableToParseDataException {
+ byte tag = in.readByte();
readAndPrintlnUntaggedValue(description, in, tag, true);
}
-
- private void readAndPrintlnUntaggedValue(String description, DataInputStream in, byte tag, boolean printTagValue) throws IOException, UnableToParseDataException {
+
+ private void readAndPrintlnUntaggedValue(String description,
+ DataInputStream in, byte tag, boolean printTagValue)
+ throws IOException, UnableToParseDataException {
printDescription(description);
int size;
- boolean isId= false;
+ boolean isId = false;
switch (tag) {
- case VOID_TAG:
- printSignatureByte(tag, printTagValue);
- println();
- return;
- case BOOLEAN_TAG:
- if (printTagValue) {
- printSignatureByte(tag, true);
- print(' ');
- println(in.readBoolean());
- } else {
- println(in.readBoolean());
- print(' ');
- printSignatureByte(tag, false);
- }
- return;
- case BYTE_TAG:
- size= 1;
- break;
- case CHAR_TAG:
- case SHORT_TAG:
- size= 2;
- break;
- case INT_TAG:
- case FLOAT_TAG:
- size= 4;
- break;
- case DOUBLE_TAG:
- case LONG_TAG:
- size= 8;
- break;
- case ARRAY_TAG:
- case OBJECT_TAG:
- case STRING_TAG:
- case THREAD_TAG:
- case THREAD_GROUP_TAG:
- case CLASS_LOADER_TAG:
- case CLASS_OBJECT_TAG:
- if (!TcpipSpy.hasSizes()) {
- throw new UnableToParseDataException("Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
- }
- size= TcpipSpy.getObjectIDSize();
- isId= true;
- break;
- default:
- size= 0;
- break;
+ case VOID_TAG:
+ printSignatureByte(tag, printTagValue);
+ println();
+ return;
+ case BOOLEAN_TAG:
+ if (printTagValue) {
+ printSignatureByte(tag, true);
+ print(' ');
+ println(in.readBoolean());
+ } else {
+ println(in.readBoolean());
+ print(' ');
+ printSignatureByte(tag, false);
+ }
+ return;
+ case BYTE_TAG:
+ size = 1;
+ break;
+ case CHAR_TAG:
+ case SHORT_TAG:
+ size = 2;
+ break;
+ case INT_TAG:
+ case FLOAT_TAG:
+ size = 4;
+ break;
+ case DOUBLE_TAG:
+ case LONG_TAG:
+ size = 8;
+ break;
+ case ARRAY_TAG:
+ case OBJECT_TAG:
+ case STRING_TAG:
+ case THREAD_TAG:
+ case THREAD_GROUP_TAG:
+ case CLASS_LOADER_TAG:
+ case CLASS_OBJECT_TAG:
+ if (!TcpipSpy.hasSizes()) {
+ throw new UnableToParseDataException(
+ "Unable to parse remaining data", remainderData(in)); //$NON-NLS-1$
+ }
+ size = TcpipSpy.getObjectIDSize();
+ isId = true;
+ break;
+ default:
+ size = 0;
+ break;
}
-
- long value= readID(in, size);
+
+ long value = readID(in, size);
if (printTagValue) {
printSignatureByte(tag, true);
print(' ');
@@ -2547,61 +2668,61 @@ public class VerbosePacketStream extends PrintStream {
}
println();
}
-
+
private void printSignatureByte(byte signatureByte, boolean printValue) {
String type;
switch (signatureByte) {
- case VOID_TAG:
- type= "void"; //$NON-NLS-1$
- break;
- case BOOLEAN_TAG:
- type= "boolean"; //$NON-NLS-1$
- break;
- case BYTE_TAG:
- type= "byte"; //$NON-NLS-1$
- break;
- case CHAR_TAG:
- type= "char"; //$NON-NLS-1$
- break;
- case SHORT_TAG:
- type= "short"; //$NON-NLS-1$
- break;
- case INT_TAG:
- type= "int"; //$NON-NLS-1$
- break;
- case FLOAT_TAG:
- type= "float"; //$NON-NLS-1$
- break;
- case DOUBLE_TAG:
- type= "double"; //$NON-NLS-1$
- break;
- case LONG_TAG:
- type= "long"; //$NON-NLS-1$
- break;
- case ARRAY_TAG:
- type= "array id"; //$NON-NLS-1$
- break;
- case OBJECT_TAG:
- type= "object id"; //$NON-NLS-1$
- break;
- case STRING_TAG:
- type= "string id"; //$NON-NLS-1$
- break;
- case THREAD_TAG:
- type= "thread id"; //$NON-NLS-1$
- break;
- case THREAD_GROUP_TAG:
- type= "thread group id"; //$NON-NLS-1$
- break;
- case CLASS_LOADER_TAG:
- type= "class loader id"; //$NON-NLS-1$
- break;
- case CLASS_OBJECT_TAG:
- type= "class object id"; //$NON-NLS-1$
- break;
- default:
- type= "unknown"; //$NON-NLS-1$
- break;
+ case VOID_TAG:
+ type = "void"; //$NON-NLS-1$
+ break;
+ case BOOLEAN_TAG:
+ type = "boolean"; //$NON-NLS-1$
+ break;
+ case BYTE_TAG:
+ type = "byte"; //$NON-NLS-1$
+ break;
+ case CHAR_TAG:
+ type = "char"; //$NON-NLS-1$
+ break;
+ case SHORT_TAG:
+ type = "short"; //$NON-NLS-1$
+ break;
+ case INT_TAG:
+ type = "int"; //$NON-NLS-1$
+ break;
+ case FLOAT_TAG:
+ type = "float"; //$NON-NLS-1$
+ break;
+ case DOUBLE_TAG:
+ type = "double"; //$NON-NLS-1$
+ break;
+ case LONG_TAG:
+ type = "long"; //$NON-NLS-1$
+ break;
+ case ARRAY_TAG:
+ type = "array id"; //$NON-NLS-1$
+ break;
+ case OBJECT_TAG:
+ type = "object id"; //$NON-NLS-1$
+ break;
+ case STRING_TAG:
+ type = "string id"; //$NON-NLS-1$
+ break;
+ case THREAD_TAG:
+ type = "thread id"; //$NON-NLS-1$
+ break;
+ case THREAD_GROUP_TAG:
+ type = "thread group id"; //$NON-NLS-1$
+ break;
+ case CLASS_LOADER_TAG:
+ type = "class loader id"; //$NON-NLS-1$
+ break;
+ case CLASS_OBJECT_TAG:
+ type = "class object id"; //$NON-NLS-1$
+ break;
+ default:
+ type = "unknown"; //$NON-NLS-1$
+ break;
}
if (printValue) {
printHex(signatureByte);
@@ -2613,84 +2734,88 @@ public class VerbosePacketStream extends PrintStream {
}
print(type + ')');
}
-
- private void readAndPrintLocation(DataInputStream in) throws IOException, UnableToParseDataException {
- byte typeTag= in.readByte();
- long classId= readReferenceTypeID(in);
- long methodId= readMethodID(in);
- long index= in.readLong();
- printlnReferenceTypeIdWithTypeTag("Location: class id:", classId, typeTag); //$NON-NLS-1$
+
+ private void readAndPrintLocation(DataInputStream in) throws IOException,
+ UnableToParseDataException {
+ byte typeTag = in.readByte();
+ long classId = readReferenceTypeID(in);
+ long methodId = readMethodID(in);
+ long index = in.readLong();
+ printlnReferenceTypeIdWithTypeTag(
+ "Location: class id:", classId, typeTag); //$NON-NLS-1$
printlnMethodId(" method id:", methodId); //$NON-NLS-1$
println(" index:", index); //$NON-NLS-1$
}
-
- private void readAndPrintArrayRegion(DataInputStream in) throws IOException, UnableToParseDataException {
- byte signatureByte= in.readByte();
- int valuesCount= in.readInt();
+
+ private void readAndPrintArrayRegion(DataInputStream in)
+ throws IOException, UnableToParseDataException {
+ byte signatureByte = in.readByte();
+ int valuesCount = in.readInt();
printDescription("Signature byte:"); //$NON-NLS-1$
printSignatureByte(signatureByte, true);
println();
println("Values count:", valuesCount); //$NON-NLS-1$
switch (signatureByte) {
- case ARRAY_TAG:
- case OBJECT_TAG:
- case STRING_TAG:
- case THREAD_TAG:
- case THREAD_GROUP_TAG:
- case CLASS_LOADER_TAG:
- case CLASS_OBJECT_TAG:
- for (int i= 0; i < valuesCount; i ++) {
- readAndPrintlnTaggedValue("Value", in); //$NON-NLS-1$
- }
- break;
- default:
- for (int i= 0; i < valuesCount; i ++) {
- readAndPrintlnUntaggedValue("Value", in, signatureByte, false); //$NON-NLS-1$
- }
- break;
+ case ARRAY_TAG:
+ case OBJECT_TAG:
+ case STRING_TAG:
+ case THREAD_TAG:
+ case THREAD_GROUP_TAG:
+ case CLASS_LOADER_TAG:
+ case CLASS_OBJECT_TAG:
+ for (int i = 0; i < valuesCount; i++) {
+ readAndPrintlnTaggedValue("Value", in); //$NON-NLS-1$
+ }
+ break;
+ default:
+ for (int i = 0; i < valuesCount; i++) {
+ readAndPrintlnUntaggedValue("Value", in, signatureByte, false); //$NON-NLS-1$
+ }
+ break;
}
}
-
+
protected void println(String description, int value) {
printDescription(description);
printHex(value);
printParanthetical(value);
println();
}
-
+
protected void println(String description, long value) {
printDescription(description);
printHex(value);
printParanthetical(value);
println();
}
-
+
protected void println(String description, String value) {
printDescription(description);
print('\"');
- StringBuffer val= new StringBuffer();
- int pos= 0, lastPos= 0;
- while ((pos= value.indexOf('\n', lastPos)) != -1) {
+ StringBuffer val = new StringBuffer();
+ int pos = 0, lastPos = 0;
+ while ((pos = value.indexOf('\n', lastPos)) != -1) {
pos++;
val.append(value.substring(lastPos, pos));
val.append(shift);
- lastPos= pos;
+ lastPos = pos;
}
val.append(value.substring(lastPos, value.length()));
print(val);
println('"');
}
-
+
protected void println(String description, boolean value) {
printDescription(description);
println(value);
}
-
+
protected void printlnReferenceTypeId(String description, long value) {
println(description, value, TcpipSpy.getReferenceTypeIDSize());
}
-
- protected void printlnReferenceTypeIdWithTypeTag(String description, long value, byte typeTag) {
+
+ protected void printlnReferenceTypeIdWithTypeTag(String description,
+ long value, byte typeTag) {
printDescription(description);
printRefTypeTagValue(typeTag);
print(" - "); //$NON-NLS-1$
@@ -2698,7 +2823,7 @@ public class VerbosePacketStream extends PrintStream {
printParanthetical(value);
println();
}
-
+
protected void printlnObjectId(String description, long value) {
printDescription(description);
printHex(value, TcpipSpy.getObjectIDSize());
@@ -2709,8 +2834,9 @@ public class VerbosePacketStream extends PrintStream {
println();
}
}
-
- protected void printlnTaggedObjectId(String description, long value, byte signatureByte) {
+
+ protected void printlnTaggedObjectId(String description, long value,
+ byte signatureByte) {
printDescription(description);
printSignatureByte(signatureByte, true);
print(' ');
@@ -2722,65 +2848,64 @@ public class VerbosePacketStream extends PrintStream {
println();
}
}
-
-
+
protected void printlnFieldId(String description, long value) {
println(description, value, TcpipSpy.getFieldIDSize());
}
-
+
protected void printlnMethodId(String description, long value) {
println(description, value, TcpipSpy.getMethodIDSize());
}
-
+
protected void printlnFrameId(String description, long value) {
println(description, value, TcpipSpy.getFrameIDSize());
}
-
+
protected void println(String description, long value, int size) {
printDescription(description);
printHex(value, size);
printParanthetical(value);
println();
}
-
+
protected void printDescription(String description) {
// current max length = 36 (+2 pad)
int width = 38 - description.length();
print(description);
write(padding, 0, width);
}
-
+
protected void printHexString(String hex, int width) {
- width-= hex.length();
+ width -= hex.length();
print("0x"); //$NON-NLS-1$
write(zeros, 0, width);
print(hex);
}
-
+
protected void printHex(long l, int byteNumber) {
printHexString(Long.toHexString(l).toUpperCase(), byteNumber * 2);
}
-
+
protected void printHex(byte b) {
printHexString(Integer.toHexString(b & 0xFF).toUpperCase(), 2);
}
protected void printHex(int i) {
printHexString(Integer.toHexString(i).toUpperCase(), 8);
- }
-
+ }
+
protected void printHex(long l) {
printHexString(Long.toHexString(l).toUpperCase(), 16);
- }
-
+ }
+
protected void printHex(byte[] b) {
if (b == null) {
println("NULL"); //$NON-NLS-1$
return;
}
int i, length;
- for (i= 0, length= b.length; i < length; i ++) {
- String hexa= Integer.toHexString(b[i]).toUpperCase();
+ for (i = 0, length = b.length; i < length; i++) {
+ String hexa = Integer.toHexString(b[i]).toUpperCase();
if (hexa.length() == 1) {
print('0');
}
@@ -2793,54 +2918,54 @@ public class VerbosePacketStream extends PrintStream {
}
}
println();
- }
-
+ }
+
protected void printParanthetical(byte i) {
print(" ("); //$NON-NLS-1$
print(i);
print(')');
- }
+ }
protected void printParanthetical(char i) {
print(" ("); //$NON-NLS-1$
print(i);
print(')');
- }
+ }
protected void printParanthetical(short i) {
print(" ("); //$NON-NLS-1$
print(i);
print(')');
- }
+ }
protected void printParanthetical(int i) {
print(" ("); //$NON-NLS-1$
print(i);
print(')');
- }
-
+ }
+
protected void printParanthetical(long l) {
print(" ("); //$NON-NLS-1$
print(l);
print(')');
- }
-
+ }
+
protected void printParanthetical(float f) {
print(" ("); //$NON-NLS-1$
print(f);
print(')');
- }
-
+ }
+
protected void printParanthetical(double d) {
print(" ("); //$NON-NLS-1$
print(d);
print(')');
- }
-
+ }
+
protected void printParanthetical(String s) {
print(" ("); //$NON-NLS-1$
print(s);
print(')');
- }
-
+ }
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IEvaluationRunnable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IEvaluationRunnable.java
index cd6764262..c3a3576ef 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IEvaluationRunnable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IEvaluationRunnable.java
@@ -10,31 +10,34 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugException;
-
+
/**
- * A runnable that represents one logical evaluation
- * to be run in a target thread.
+ * A runnable that represents one logical evaluation to be run in a target
+ * thread.
* <p>
* Clients are intended to implement this interface.
* </p>
*
- * @see org.eclipse.jdt.debug.core.IJavaThread#runEvaluation(IEvaluationRunnable, IProgressMonitor, int, boolean)
+ * @see org.eclipse.jdt.debug.core.IJavaThread#runEvaluation(IEvaluationRunnable,
+ * IProgressMonitor, int, boolean)
* @since 2.0
- */
+ */
public interface IEvaluationRunnable {
-
+
/**
- * Runs this evaluation in the specified thread, reporting
- * progress to the given progress monitor.
+ * Runs this evaluation in the specified thread, reporting progress to the
+ * given progress monitor.
*
- * @param thread the thread in which to run the evaluation
- * @param monitor progress monitor (may be <code>null</code>)
- * @exception DebugException if an exception occurs during
- * the evaluation
+ * @param thread
+ * the thread in which to run the evaluation
+ * @param monitor
+ * progress monitor (may be <code>null</code>)
+ * @exception DebugException
+ * if an exception occurs during the evaluation
*/
- public abstract void run(IJavaThread thread, IProgressMonitor monitor) throws DebugException;
+ public abstract void run(IJavaThread thread, IProgressMonitor monitor)
+ throws DebugException;
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArray.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArray.java
index 201152759..bd21e451f 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArray.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArray.java
@@ -10,12 +10,12 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IIndexedValue;
/**
* A value referencing an array on a target VM.
+ *
* @see IJavaValue
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
@@ -23,91 +23,108 @@ import org.eclipse.debug.core.model.IIndexedValue;
*/
public interface IJavaArray extends IJavaObject, IIndexedValue {
-
+
/**
* Returns the values contained in this array.
*
* @return the values contained in this array
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public IJavaValue[] getValues() throws DebugException;
-
+
/**
- * Returns the value at the given index in
- * this array.
+ * Returns the value at the given index in this array.
*
- * @param index the index of the value to return
+ * @param index
+ * the index of the value to return
* @return the value at the given index
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @exception java.lang.IndexOutOfBoundsException if the index is
- * not within the bounds of this array.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
+ * @exception java.lang.IndexOutOfBoundsException
+ * if the index is not within the bounds of this array.
*/
public IJavaValue getValue(int index) throws DebugException;
-
+
/**
* Returns the length of this array.
*
* @return the length of this array
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul
*/
public int getLength() throws DebugException;
-
+
/**
- * Sets the value at the given index to the specified
- * value.
+ * Sets the value at the given index to the specified value.
*
- * @param index the index at which to assign a new value
- * @param value the new value
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The given value is not compatible with the type of this
- * array</li>
- * </ul>
- * @exception java.lang.IndexOutOfBoundsException if the index is
- * not within the bounds of this array.
+ * @param index
+ * the index at which to assign a new value
+ * @param value
+ * the new value
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The given value is not compatible with the type of
+ * this array</li>
+ * </ul>
+ * @exception java.lang.IndexOutOfBoundsException
+ * if the index is not within the bounds of this array.
*/
public void setValue(int index, IJavaValue value) throws DebugException;
-
+
/**
- * Replaces values in this array. If the given replacement values length is less
- * that the length of this array, only the number of values in the given array
- * are replaced. If the given replacement values length is longer than the length of
- * this array, values in positions greater than the length of this array are ignored.
+ * Replaces values in this array. If the given replacement values length is
+ * less that the length of this array, only the number of values in the
+ * given array are replaced. If the given replacement values length is
+ * longer than the length of this array, values in positions greater than
+ * the length of this array are ignored.
*
- * @param values replacement values
- * @exception DebugException if an exception occurs replacing values
+ * @param values
+ * replacement values
+ * @exception DebugException
+ * if an exception occurs replacing values
* @since 3.4
*/
public void setValues(IJavaValue[] values) throws DebugException;
-
+
/**
- * Replaces a range of values in this array.
+ * Replaces a range of values in this array.
*
- * @param offset offset in this array to start replacing values at
- * @param length the number of values to replace in this array
- * @param values replacement values
- * @param startOffset the first offset where values are copied from the
- * given replacement values
- * @exception DebugException if an exception occurs replacing values or if the given
- * offsets and length are not within the range of this array or the replacement
- * values
+ * @param offset
+ * offset in this array to start replacing values at
+ * @param length
+ * the number of values to replace in this array
+ * @param values
+ * replacement values
+ * @param startOffset
+ * the first offset where values are copied from the given
+ * replacement values
+ * @exception DebugException
+ * if an exception occurs replacing values or if the given
+ * offsets and length are not within the range of this array
+ * or the replacement values
* @since 3.4
*/
- public void setValues(int offset, int length, IJavaValue[] values, int startOffset) throws DebugException;
+ public void setValues(int offset, int length, IJavaValue[] values,
+ int startOffset) throws DebugException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArrayType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArrayType.java
index d53905266..a2d44f0d9 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArrayType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaArrayType.java
@@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
/**
* The type of an array on a Java debug target.
+ *
* @see IJavaValue
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
@@ -24,30 +24,34 @@ import org.eclipse.debug.core.DebugException;
public interface IJavaArrayType extends IJavaReferenceType {
/**
- * Returns a new instance of an array of this type,
- * with the specified length.
- *
- * @param size the length of the new array
+ * Returns a new instance of an array of this type, with the specified
+ * length.
+ *
+ * @param size
+ * the length of the new array
* @return a new array of the specified length
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public IJavaArray newInstance(int size) throws DebugException;
/**
* Returns the type of the elements in this array.
- *
+ *
* @return type
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The exception's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The exception's
+ * status code contains the underlying exception responsible
+ * for the failure.</li>
+ * </ul>
*/
public IJavaType getComponentType() throws DebugException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpoint.java
index bab0f5a35..1fec036de 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,172 +10,197 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IBreakpoint;
/**
- * A breakpoint specific to the Java debug model. A Java breakpoint
- * supports:
+ * A breakpoint specific to the Java debug model. A Java breakpoint supports:
* <ul>
* <li>a hit count</li>
- * <li>a suspend policy that determines if the entire VM or
- * a single thread is suspended when hit</li>
- * <li>a thread filter to restrict a breakpoint to a specific
- * thread within a VM</li>
+ * <li>a suspend policy that determines if the entire VM or a single thread is
+ * suspended when hit</li>
+ * <li>a thread filter to restrict a breakpoint to a specific thread within a VM
+ * </li>
* <li>an installed property that indicates a breakpoint was successfully
- * installed in a VM</li>
+ * installed in a VM</li>
* </ul>
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaBreakpoint extends IBreakpoint {
-
+
/**
- * Suspend policy constant indicating a breakpoint will
- * suspend the target VM when hit.
+ * Suspend policy constant indicating a breakpoint will suspend the target
+ * VM when hit.
*/
public static final int SUSPEND_VM = 1;
-
+
/**
- * Default suspend policy constant indicating a breakpoint will
- * suspend only the thread in which it occurred.
+ * Default suspend policy constant indicating a breakpoint will suspend only
+ * the thread in which it occurred.
*/
public static final int SUSPEND_THREAD = 2;
-
+
/**
- * Returns whether this breakpoint is installed in at least
- * one debug target.
+ * Returns whether this breakpoint is installed in at least one debug
+ * target.
*
* @return whether this breakpoint is installed
- * @exception CoreException if unable to access the property
- * on this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
*/
public boolean isInstalled() throws CoreException;
+
/**
- * Returns the fully qualified name of the type this breakpoint
- * is located in, or <code>null</code> if this breakpoint
- * is not located in a specific type - for example, a pattern breakpoint.
+ * Returns the fully qualified name of the type this breakpoint is located
+ * in, or <code>null</code> if this breakpoint is not located in a specific
+ * type - for example, a pattern breakpoint.
*
- * @return the fully qualified name of the type this breakpoint
- * is located in, or <code>null</code>
- * @exception CoreException if unable to access the property
- * from this breakpoint's underlying marker
+ * @return the fully qualified name of the type this breakpoint is located
+ * in, or <code>null</code>
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public String getTypeName() throws CoreException;
+
/**
- * Returns this breakpoint's hit count or, -1 if this
- * breakpoint does not have a hit count.
+ * Returns this breakpoint's hit count or, -1 if this breakpoint does not
+ * have a hit count.
*
* @return this breakpoint's hit count, or -1
- * @exception CoreException if unable to access the property
- * from this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public int getHitCount() throws CoreException;
+
/**
- * Sets the hit count attribute of this breakpoint.
- * If this breakpoint is currently disabled and the hit count
- * is set greater than -1, this breakpoint is automatically enabled.
+ * Sets the hit count attribute of this breakpoint. If this breakpoint is
+ * currently disabled and the hit count is set greater than -1, this
+ * breakpoint is automatically enabled.
*
- * @param count the new hit count
- * @exception CoreException if unable to set the property
- * on this breakpoint's underlying marker
+ * @param count
+ * the new hit count
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
- public void setHitCount(int count) throws CoreException;
-
+ public void setHitCount(int count) throws CoreException;
+
/**
- * Sets whether all threads in the target VM will be suspended
- * when this breakpoint is hit. When <code>SUSPEND_VM</code> the target
- * VM is suspended, and when <code>SUSPEND_THREAD</code> only the thread
- * in which this breakpoint occurred is suspended.
+ * Sets whether all threads in the target VM will be suspended when this
+ * breakpoint is hit. When <code>SUSPEND_VM</code> the target VM is
+ * suspended, and when <code>SUSPEND_THREAD</code> only the thread in which
+ * this breakpoint occurred is suspended.
*
- * @param suspendPolicy one of <code>SUSPEND_VM</code> or
- * <code>SUSPEND_THREAD</code>
- * @exception CoreException if unable to set the property
- * on this breakpoint's underlying marker
+ * @param suspendPolicy
+ * one of <code>SUSPEND_VM</code> or <code>SUSPEND_THREAD</code>
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
public void setSuspendPolicy(int suspendPolicy) throws CoreException;
-
+
/**
* Returns the suspend policy used by this breakpoint, one of
* <code>SUSPEND_VM</code> or <code>SUSPEND_THREAD</code>.
*
* @return one of <code>SUSPEND_VM</code> or <code>SUSPEND_THREAD</code>
- * @exception CoreException if unable to access the property
- * from this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public int getSuspendPolicy() throws CoreException;
-
+
/**
- * Restricts this breakpoint to suspend only in the given thread
- * when encountered in the given thread's target. A breakpoint can
- * only be restricted to one thread per target. Any previous
- * thread filter for the same target is lost.
- * A thread filter is not persisted
- * across workbench invocations.
+ * Restricts this breakpoint to suspend only in the given thread when
+ * encountered in the given thread's target. A breakpoint can only be
+ * restricted to one thread per target. Any previous thread filter for the
+ * same target is lost. A thread filter is not persisted across workbench
+ * invocations.
*
- * @exception CoreException if unable to set the thread filter
+ * @param thread
+ * the thread to add the filter to
+ *
+ * @exception CoreException
+ * if unable to set the thread filter
*/
public void setThreadFilter(IJavaThread thread) throws CoreException;
-
+
/**
- * Removes this breakpoint's thread filter in the given target, if any.
- * Has no effect if this breakpoint does not have a filter in the given target.
+ * Removes this breakpoint's thread filter in the given target, if any. Has
+ * no effect if this breakpoint does not have a filter in the given target.
*
- * @param target the target whose thread filter will be removed
- * @exception CoreException if unable to remove the thread filter
+ * @param target
+ * the target whose thread filter will be removed
+ * @exception CoreException
+ * if unable to remove the thread filter
*/
- public void removeThreadFilter(IJavaDebugTarget target) throws CoreException;
-
+ public void removeThreadFilter(IJavaDebugTarget target)
+ throws CoreException;
+
/**
- * Returns the thread in the given target in which this breakpoint
- * is enabled or <code>null</code> if this breakpoint is enabled in
- * all threads in the given target.
+ * Returns the thread in the given target in which this breakpoint is
+ * enabled or <code>null</code> if this breakpoint is enabled in all threads
+ * in the given target.
*
- * @return the thread in the given target that this breakpoint is enabled for
- * @exception CoreException if unable to determine this breakpoint's thread
- * filter
+ * @param target
+ * the debug target
+ *
+ * @return the thread in the given target that this breakpoint is enabled
+ * for
+ * @exception CoreException
+ * if unable to determine this breakpoint's thread filter
*/
- public IJavaThread getThreadFilter(IJavaDebugTarget target) throws CoreException;
+ public IJavaThread getThreadFilter(IJavaDebugTarget target)
+ throws CoreException;
+
/**
* Returns all thread filters set on this breakpoint.
*
* @return the threads that this breakpoint is restricted to
- * @exception CoreException if unable to determine this breakpoint's
- * thread filters
+ * @exception CoreException
+ * if unable to determine this breakpoint's thread filters
*/
- public IJavaThread[] getThreadFilters() throws CoreException;
-
+ public IJavaThread[] getThreadFilters() throws CoreException;
+
/**
- * Adds the given object to the list of objects in which this
- * breakpoint is restricted to suspend execution. Has no effect
- * if the object has already been added. Note that clients should
- * first ensure that a breakpoint supports instance filters.
+ * Adds the given object to the list of objects in which this breakpoint is
+ * restricted to suspend execution. Has no effect if the object has already
+ * been added. Note that clients should first ensure that a breakpoint
+ * supports instance filters.
* <p>
- * Note: This implementation will add more than one filter. However, if there is
- * more than one instance filter for a debug target, the breakpoint will never be hit
- * in that target, as the current context cannot be two different instances at the
- * same time.
+ * Note: This implementation will add more than one filter. However, if
+ * there is more than one instance filter for a debug target, the breakpoint
+ * will never be hit in that target, as the current context cannot be two
+ * different instances at the same time.
* </p>
*
- * @param object instance filter to add
- * @exception CoreException if unable to add the given instance filter
+ * @param object
+ * instance filter to add
+ * @exception CoreException
+ * if unable to add the given instance filter
* @since 2.1
*/
public void addInstanceFilter(IJavaObject object) throws CoreException;
-
+
/**
* Removes the given object from the list of objects in which this
* breakpoint is restricted to suspend execution. Has no effect if the
* object has not yet been added as an instance filter.
*
- * @param object instance filter to remove
- * @exception CoreException if unable to remove the given instance filter
+ * @param object
+ * instance filter to remove
+ * @exception CoreException
+ * if unable to remove the given instance filter
* @since 2.1
*/
public void removeInstanceFilter(IJavaObject object) throws CoreException;
-
+
/**
* Returns whether this breakpoints supports instance filters.
*
@@ -183,14 +208,15 @@ public interface IJavaBreakpoint extends IBreakpoint {
* @since 3.0
*/
public boolean supportsInstanceFilters();
-
+
/**
* Returns the current set of active instance filters.
*
* @return the current set of active instance filters.
- * @exception CoreException if unable to retrieve the list
+ * @exception CoreException
+ * if unable to retrieve the list
* @since 2.1
- */
+ */
public IJavaObject[] getInstanceFilters() throws CoreException;
/**
@@ -200,37 +226,43 @@ public interface IJavaBreakpoint extends IBreakpoint {
* @since 3.0
*/
public boolean supportsThreadFilters();
-
+
/**
- * Returns a collection of identifiers of breakpoint listener extensions registered
- * for this breakpoint, possibly empty.
+ * Returns a collection of identifiers of breakpoint listener extensions
+ * registered for this breakpoint, possibly empty.
*
- * @return breakpoint listener extension identifiers registered on this breakpoint
- * @throws CoreException if unable to retrieve the collection
+ * @return breakpoint listener extension identifiers registered on this
+ * breakpoint
+ * @throws CoreException
+ * if unable to retrieve the collection
* @since 3.5
*/
public String[] getBreakpointListeners() throws CoreException;
-
+
/**
- * Adds the breakpoint listener extension with specified identifier to this breakpoint.
- * Has no effect if an identical listener is already registered.
- *
- * @param identifier breakpoint listener extension identifier
- * @throws CoreException if unable to add the listener
+ * Adds the breakpoint listener extension with specified identifier to this
+ * breakpoint. Has no effect if an identical listener is already registered.
+ *
+ * @param identifier
+ * breakpoint listener extension identifier
+ * @throws CoreException
+ * if unable to add the listener
* @since 3.5
*/
public void addBreakpointListener(String identifier) throws CoreException;
-
+
/**
- * Removes the breakpoint listener extension with the specified identifier from this
- * breakpoint and returns whether the listener was removed.
+ * Removes the breakpoint listener extension with the specified identifier
+ * from this breakpoint and returns whether the listener was removed.
*
- * @param identifier breakpoint listener extension identifier
+ * @param identifier
+ * breakpoint listener extension identifier
* @return whether the listener was removed
- * @throws CoreException if an error occurs removing the listener
+ * @throws CoreException
+ * if an error occurs removing the listener
* @since 3.5
*/
- public boolean removeBreakpointListener(String identifier) throws CoreException;
+ public boolean removeBreakpointListener(String identifier)
+ throws CoreException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpointListener.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpointListener.java
index 65a0133ec..25a2586e6 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpointListener.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpointListener.java
@@ -13,154 +13,176 @@ package org.eclipse.jdt.debug.core;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.core.dom.Message;
-
/**
- * Provides event and error notification for Java breakpoints.
- * Listeners register with the <code>JDIDebugModel</code>.
+ * Provides event and error notification for Java breakpoints. Listeners
+ * register with the <code>JDIDebugModel</code>.
* <p>
* Since 3.5, clients can also register breakpoint listeners using the
- * <code>org.eclipse.jdt.debug.breakpointListeners</code> extension point.
- * A listener can be contributed to receive notifications from all Java
+ * <code>org.eclipse.jdt.debug.breakpointListeners</code> extension point. A
+ * listener can be contributed to receive notifications from all Java
* breakpoints or receive notifications about specific breakpoints by
* programmatically registering the extension with a breakpoint.
* </p>
* <p>
* Clients are intended to implement this interface.
* </p>
+ *
* @since 2.0
* @see JDIDebugModel
* @see IJavaBreakpoint
*/
public interface IJavaBreakpointListener {
-
+
/**
- * Return code in response to a "breakpoint hit" notification, indicating
- * a vote to suspend the associated thread.
+ * Return code in response to a "breakpoint hit" notification, indicating a
+ * vote to suspend the associated thread.
*
* @since 3.0
*/
- public static int SUSPEND= 0x0001;
+ public static int SUSPEND = 0x0001;
/**
- * Return code in response to a "breakpoint hit" notification, indicating
- * a vote to not suspend (i.e. resume) the associated thread.
+ * Return code in response to a "breakpoint hit" notification, indicating a
+ * vote to not suspend (i.e. resume) the associated thread.
*
* @since 3.0
*/
- public static int DONT_SUSPEND= 0x0002;
+ public static int DONT_SUSPEND = 0x0002;
/**
- * Return code in response to an "installing" notification, indicating
- * a vote to install the associated breakpoint.
+ * Return code in response to an "installing" notification, indicating a
+ * vote to install the associated breakpoint.
*
* @since 3.0
*/
- public static int INSTALL= 0x0001;
+ public static int INSTALL = 0x0001;
/**
- * Return code in response to an "installing" notification, indicating
- * a vote to not install the associated breakpoint.
+ * Return code in response to an "installing" notification, indicating a
+ * vote to not install the associated breakpoint.
*
* @since 3.0
*/
- public static int DONT_INSTALL= 0x0002;
+ public static int DONT_INSTALL = 0x0002;
/**
- * Return code indicating that this listener should not be considered
- * in a vote to suspend a thread or install a breakpoint.
+ * Return code indicating that this listener should not be considered in a
+ * vote to suspend a thread or install a breakpoint.
*
* @since 3.0
*/
- public static int DONT_CARE= 0x0004;
-
+ public static int DONT_CARE = 0x0004;
+
/**
- * Notification that the given breakpoint is about to be added to
- * the specified target. This message is sent before the breakpoint
- * is actually added to the debut target (i.e. this is a
- * pre-notification).
+ * Notification that the given breakpoint is about to be added to the
+ * specified target. This message is sent before the breakpoint is actually
+ * added to the debut target (i.e. this is a pre-notification).
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
*/
- public void addingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint);
-
+ public void addingBreakpoint(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint);
+
/**
- * Notification that the given breakpoint is about to be installed in
- * the specified target, in the specified type. Allows this listener to
- * vote to determine if the given breakpoint should be installed in
- * the specified type and target. If at least one listener votes to
- * <code>INSTALL</code>, the breakpoint will be installed. If there
- * are no votes to install the breakpoint, there must be at least one
- * <code>DONT_INSTALL</code> vote to cancel the installation. If all
- * listeners vote <code>DONT_CARE</code>, the breakpoint will be installed
- * by default.
+ * Notification that the given breakpoint is about to be installed in the
+ * specified target, in the specified type. Allows this listener to vote to
+ * determine if the given breakpoint should be installed in the specified
+ * type and target. If at least one listener votes to <code>INSTALL</code>,
+ * the breakpoint will be installed. If there are no votes to install the
+ * breakpoint, there must be at least one <code>DONT_INSTALL</code> vote to
+ * cancel the installation. If all listeners vote <code>DONT_CARE</code>,
+ * the breakpoint will be installed by default.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
- * @param type the type (class or interface) the breakpoint is about to be installed in
- * or <code>null</code> if the given breakpoint is not installed in a specific type
- * (one of <code>IJavaClassType</code>, <code>IJavaInterfaceType</code>, or
- * <code>IJavaArrayType</code>)
- * @return whether the the breakpoint should be installed in the given type and target,
- * or whether this listener doesn't care - one of <code>INSTALL</code>,
- * <code>DONT_INSTALL</code>, or <code>DONT_CARE</code>
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
+ * @param type
+ * the type (class or interface) the breakpoint is about to be
+ * installed in or <code>null</code> if the given breakpoint is
+ * not installed in a specific type (one of
+ * <code>IJavaClassType</code>, <code>IJavaInterfaceType</code>,
+ * or <code>IJavaArrayType</code>)
+ * @return whether the the breakpoint should be installed in the given type
+ * and target, or whether this listener doesn't care - one of
+ * <code>INSTALL</code>, <code>DONT_INSTALL</code>, or
+ * <code>DONT_CARE</code>
* @since 3.0
*/
- public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type);
-
+ public int installingBreakpoint(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint, IJavaType type);
+
/**
- * Notification that the given breakpoint has been installed in
- * the specified target.
+ * Notification that the given breakpoint has been installed in the
+ * specified target.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
*/
- public void breakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint);
-
+ public void breakpointInstalled(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint);
+
/**
- * Notification that the given breakpoint has been hit
- * in the specified thread. Allows this listener to
- * vote to determine if the given thread should be suspended in
- * response to the breakpoint. If at least one listener votes to
- * <code>SUSPEND</code>, the thread will suspend. If there
+ * Notification that the given breakpoint has been hit in the specified
+ * thread. Allows this listener to vote to determine if the given thread
+ * should be suspended in response to the breakpoint. If at least one
+ * listener votes to <code>SUSPEND</code>, the thread will suspend. If there
* are no votes to suspend the thread, there must be at least one
* <code>DONT_SUSPEND</code> vote to avoid the suspension (resume). If all
- * listeners vote <code>DONT_CARE</code>, the thread will suspend by default.
+ * listeners vote <code>DONT_CARE</code>, the thread will suspend by
+ * default.
* <p>
- * The thread the breakpoint has been encountered in is now suspended. Listeners
- * may query thread state and perform evaluations. All subsequent breakpoints
- * in this thread will be ignored until voting has completed.
+ * The thread the breakpoint has been encountered in is now suspended.
+ * Listeners may query thread state and perform evaluations. All subsequent
+ * breakpoints in this thread will be ignored until voting has completed.
* </p>
- * @param thread Java thread
- * @param breakpoint Java breakpoint
- * @return whether the thread should suspend or whether this
- * listener doesn't care - one of <code>SUSPEND</code>,
- * <code>DONT_SUSPEND</code>, or <code>DONT_CARE</code>
+ *
+ * @param thread
+ * Java thread
+ * @param breakpoint
+ * Java breakpoint
+ * @return whether the thread should suspend or whether this listener
+ * doesn't care - one of <code>SUSPEND</code>,
+ * <code>DONT_SUSPEND</code>, or <code>DONT_CARE</code>
* @since 3.0
*/
- public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint);
-
+ public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint);
+
/**
- * Notification that the given breakpoint has been removed
- * from the specified target.
+ * Notification that the given breakpoint has been removed from the
+ * specified target.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
*/
- public void breakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint);
-
+ public void breakpointRemoved(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint);
+
/**
- * Notification that the given breakpoint had runtime errors in its conditional
- * expression.
+ * Notification that the given breakpoint had runtime errors in its
+ * conditional expression.
*
- * @param breakpoint the breakpoint
- * @param exception the debug exception that occurred evaluating the breakpoint's
- * condition
+ * @param breakpoint
+ * the breakpoint
+ * @param exception
+ * the debug exception that occurred evaluating the breakpoint's
+ * condition
*/
- public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception);
-
+ public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint,
+ DebugException exception);
+
/**
- * Notification that the given breakpoint has compilation errors in its conditional
- * expression.
+ * Notification that the given breakpoint has compilation errors in its
+ * conditional expression.
*
- * @param breakpoint the breakpoint
- * @param errors the compilation errors in the breakpoint's condition
+ * @param breakpoint
+ * the breakpoint
+ * @param errors
+ * the compilation errors in the breakpoint's condition
*/
- public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors);
+ public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint,
+ Message[] errors);
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassObject.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassObject.java
index d8272fa89..1dd698e13 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassObject.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassObject.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
/**
- * An object referencing an instance of <code>java.lang.Class</code> on a
- * target VM.
+ * An object referencing an instance of <code>java.lang.Class</code> on a target
+ * VM.
+ *
* @see IJavaValue
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
@@ -21,15 +21,12 @@ package org.eclipse.jdt.debug.core;
*/
public interface IJavaClassObject extends IJavaObject {
-
+
/**
- * Returns the type associated with instances of this
- * class.
+ * Returns the type associated with instances of this class.
*
- * @return the type associated with instances of this
- * class
- */
+ * @return the type associated with instances of this class
+ */
IJavaType getInstanceType();
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassPrepareBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassPrepareBreakpoint.java
index 106cf6279..5d1249db1 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassPrepareBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassPrepareBreakpoint.java
@@ -13,31 +13,32 @@ package org.eclipse.jdt.debug.core;
import org.eclipse.core.runtime.CoreException;
/**
- * A breakpoint that suspends execution when a class is prepared in
- * a target VM.
+ * A breakpoint that suspends execution when a class is prepared in a target VM.
+ *
* @since 3.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaClassPrepareBreakpoint extends IJavaBreakpoint {
-
+
/**
- * Constant indicating a class prepare breakpoint is associated with a
- * class type.
+ * Constant indicating a class prepare breakpoint is associated with a class
+ * type.
*/
public static final int TYPE_CLASS = 0;
/**
* Constant indicating a class prepare breakpoint is associated with an
- * interface type.
- */
+ * interface type.
+ */
public static final int TYPE_INTERFACE = 1;
-
+
/**
- * Returns a constant indicating what kind of type this breakpoint
- * is associated with.
+ * Returns a constant indicating what kind of type this breakpoint is
+ * associated with.
*
* @return one of <code>TYPE_CLASS</code> or <code>TYPE_INTERFACE</code>
- * @throws CoreException if unable to retrieve the attribute
+ * @throws CoreException
+ * if unable to retrieve the attribute
*/
public int getMemberType() throws CoreException;
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassType.java
index d28242d6c..903f54275 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaClassType.java
@@ -10,133 +10,159 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
-
+
/**
* The class of an object on a Java debug target.
+ *
* @see IJavaValue
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface IJavaClassType extends IJavaReferenceType {
-
+public interface IJavaClassType extends IJavaReferenceType {
+
/**
- * Returns a new instance of this class by invoking the
- * constructor with the given signature and arguments in
- * the specified thread. The given thread is resumed to perform this
- * method invocation and suspends in its original location when
- * this method invocation is complete. This method does not return
- * until the method invocation is complete. Resuming the specified thread
- * can result in breakpoints being hit, infinite loops, and deadlock.
+ * Returns a new instance of this class by invoking the constructor with the
+ * given signature and arguments in the specified thread. The given thread
+ * is resumed to perform this method invocation and suspends in its original
+ * location when this method invocation is complete. This method does not
+ * return until the method invocation is complete. Resuming the specified
+ * thread can result in breakpoints being hit, infinite loops, and deadlock.
*
- * @param signature the JNI style signature of the method to be invoked
- * @param args the arguments of the constructor, which can be
- * <code>null</code> or empty if there are none
- * @param thread the thread in which to invoke the constructor
+ * @param signature
+ * the JNI style signature of the method to be invoked
+ * @param args
+ * the arguments of the constructor, which can be
+ * <code>null</code> or empty if there are none
+ * @param thread
+ * the thread in which to invoke the constructor
* @return the result of invoking the constructor
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This type does not implement the specified constructor</li>
- * <li>An exception occurs while invoking the specified constructor</li>
- * <li>The given thread is already performing a message send,
- * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
- * <li>The given thread is not currently suspended
- * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
- * <li>The given thread was explicitly suspended
- * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This type does not implement the specified constructor
+ * </li>
+ * <li>An exception occurs while invoking the specified
+ * constructor</li>
+ * <li>The given thread is already performing a message send,
+ * (status code
+ * <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
+ * <li>The given thread is not currently suspended (status
+ * code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
+ * <li>The given thread was explicitly suspended (status code
+ * <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
+ * </ul>
*/
- public IJavaObject newInstance(String signature, IJavaValue[] args, IJavaThread thread) throws DebugException;
-
+ public IJavaObject newInstance(String signature, IJavaValue[] args,
+ IJavaThread thread) throws DebugException;
+
/**
- * Returns the result of sending the specified message to this class
- * with the given arguments in the specified thread (invokes a static
- * method on this type). The given thread is resumed to perform this
- * method invocation and suspends in its original location when this
- * method invocation is complete. This method does not return until the
- * method invocation is complete. Resuming the specified thread can
- * result in breakpoints being hit, infinite loops, and deadlock.
+ * Returns the result of sending the specified message to this class with
+ * the given arguments in the specified thread (invokes a static method on
+ * this type). The given thread is resumed to perform this method invocation
+ * and suspends in its original location when this method invocation is
+ * complete. This method does not return until the method invocation is
+ * complete. Resuming the specified thread can result in breakpoints being
+ * hit, infinite loops, and deadlock.
*
- * @param selector the selector of the method to be invoked
- * @param signature the JNI style signature of the method to be invoked
- * @param args the arguments of the method, which can be
- * <code>null</code> or empty if there are none
- * @param thread the thread in which to invoke the method
+ * @param selector
+ * the selector of the method to be invoked
+ * @param signature
+ * the JNI style signature of the method to be invoked
+ * @param args
+ * the arguments of the method, which can be <code>null</code> or
+ * empty if there are none
+ * @param thread
+ * the thread in which to invoke the method
* @return the result of invoking the method
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This object does not implement the specified method</li>
- * <li>An exception occurs while invoking the specified method</li>
- * <li>The given thread is already performing a message send,
- * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
- * <li>The given thread is not currently suspended
- * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
- * <li>The given thread was explicitly suspended
- * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This object does not implement the specified method</li>
+ * <li>An exception occurs while invoking the specified
+ * method</li>
+ * <li>The given thread is already performing a message send,
+ * (status code
+ * <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
+ * <li>The given thread is not currently suspended (status
+ * code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
+ * <li>The given thread was explicitly suspended (status code
+ * <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
+ * </ul>
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread) throws DebugException;
-
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread) throws DebugException;
+
/**
- * Returns the superclass of this class type, or <code>null</code>
- * if no such class exists.
+ * Returns the superclass of this class type, or <code>null</code> if no
+ * such class exists.
*
* @return the superclass of this class type, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public IJavaClassType getSuperclass() throws DebugException;
-
+
/**
- * Returns the interface objects associated with the interfaces this class directly implements.
- * Only those interfaces declared in the <code>implements</code> clause for this class are included.
+ * Returns the interface objects associated with the interfaces this class
+ * directly implements. Only those interfaces declared in the
+ * <code>implements</code> clause for this class are included.
*
- * @return the interface objects associated with the interfaces this class directly implements
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @return the interface objects associated with the interfaces this class
+ * directly implements
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 3.0
*/
public IJavaInterfaceType[] getInterfaces() throws DebugException;
/**
- * Returns the interface objects associated with <em>all</em> interfaces this class implements,
- * directly or indirectly.
+ * Returns the interface objects associated with <em>all</em> interfaces
+ * this class implements, directly or indirectly.
*
- * @return the interface objects associated with the interfaces this class directly implements,
- * directly or indirectly
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @return the interface objects associated with the interfaces this class
+ * directly implements, directly or indirectly
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 3.0
*/
public IJavaInterfaceType[] getAllInterfaces() throws DebugException;
-
+
/**
* Returns whether this type is declared as a type safe enumeration.
*
* @return <code>true</code> if this type is a type safe enumeration,
- * <code>false</code> otherwise.
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * <code>false</code> otherwise.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 3.1
*/
public boolean isEnum() throws DebugException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaDebugTarget.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaDebugTarget.java
index b03737ba4..97d83ce79 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaDebugTarget.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaDebugTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,197 +12,218 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IStepFilters;
/**
* A Java virtual machine.
+ *
* @see IDebugTarget
- * @see org.eclipse.core.runtime.IAdaptable
+ * @see org.eclipse.core.runtime.IAdaptable
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
/**
- * Searches for and returns a variable with the given name,
- * or <code>null</code> if unable to resolve a variable with the name.
+ * Searches for and returns a variable with the given name, or
+ * <code>null</code> if unable to resolve a variable with the name.
* <p>
- * Variable lookup works only when a debug target has one or more
- * threads suspended. Lookup is performed in each suspended thread,
- * returning the first successful match, or <code>null</code> if no
- * match if found. If this debug target has no suspended threads,
- * <code>null</code> is returned.
+ * Variable lookup works only when a debug target has one or more threads
+ * suspended. Lookup is performed in each suspended thread, returning the
+ * first successful match, or <code>null</code> if no match if found. If
+ * this debug target has no suspended threads, <code>null</code> is
+ * returned.
* </p>
- * @param variableName name of the variable
+ *
+ * @param variableName
+ * name of the variable
* @return a variable with the given name, or <code>null</code> if none
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
- public abstract IJavaVariable findVariable(String variableName) throws DebugException;
-
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
+ */
+ public abstract IJavaVariable findVariable(String variableName)
+ throws DebugException;
+
/**
* Returns the types loaded in this debug target with the given fully
- * qualified name, or <code>null</code> of no type with the given
- * name is loaded.
+ * qualified name, or <code>null</code> of no type with the given name is
+ * loaded.
*
- * @param name fully qualified name of type, for example
- * <code>java.lang.String</code>
+ * @param name
+ * fully qualified name of type, for example
+ * <code>java.lang.String</code>
* @return the types with the given name, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public abstract IJavaType[] getJavaTypes(String name) throws DebugException;
/**
* Returns a value from this target that corresponds to the given boolean.
- * The returned value can be used for setting and comparing against a value
+ * The returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a boolean from which to create a value
+ * @param value
+ * a boolean from which to create a value
* @return a corresponding value from this target
- */
- public abstract IJavaValue newValue(boolean value);
+ */
+ public abstract IJavaValue newValue(boolean value);
/**
- * Returns a value from this target that corresponds to the given byte.
- * The returned value can be used for setting and comparing against a value
+ * Returns a value from this target that corresponds to the given byte. The
+ * returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a byte from which to create a value
+ * @param value
+ * a byte from which to create a value
* @return a corresponding value from this target
- */
- public abstract IJavaValue newValue(byte value);
+ */
+ public abstract IJavaValue newValue(byte value);
/**
- * Returns a value from this target that corresponds to the given char.
- * The returned value can be used for setting and comparing against a value
+ * Returns a value from this target that corresponds to the given char. The
+ * returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a char from which to create a value
+ * @param value
+ * a char from which to create a value
* @return a corresponding value from this target
- */
+ */
public abstract IJavaValue newValue(char value);
-
+
/**
* Returns a value from this target that corresponds to the given double.
- * The returned value can be used for setting and comparing against a value
+ * The returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a double from which to create a value
+ * @param value
+ * a double from which to create a value
* @return a corresponding value from this target
- */
- public abstract IJavaValue newValue(double value);
-
+ */
+ public abstract IJavaValue newValue(double value);
+
/**
- * Returns a value from this target that corresponds to the given float.
- * The returned value can be used for setting and comparing against a value
+ * Returns a value from this target that corresponds to the given float. The
+ * returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a float from which to create a value
+ * @param value
+ * a float from which to create a value
* @return a corresponding value from this target
- */
- public abstract IJavaValue newValue(float value);
-
+ */
+ public abstract IJavaValue newValue(float value);
+
/**
- * Returns a value from this target that corresponds to the given int.
- * The returned value can be used for setting and comparing against a value
+ * Returns a value from this target that corresponds to the given int. The
+ * returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value an int from which to create a value
+ * @param value
+ * an int from which to create a value
* @return a corresponding value from this target
- */
+ */
public abstract IJavaValue newValue(int value);
-
+
/**
- * Returns a value from this target that corresponds to the given long.
- * The returned value can be used for setting and comparing against a value
+ * Returns a value from this target that corresponds to the given long. The
+ * returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a long from which to create a value
+ * @param value
+ * a long from which to create a value
* @return a corresponding value from this target
- */
- public abstract IJavaValue newValue(long value);
-
+ */
+ public abstract IJavaValue newValue(long value);
+
/**
- * Returns a value from this target that corresponds to the given short.
- * The returned value can be used for setting and comparing against a value
+ * Returns a value from this target that corresponds to the given short. The
+ * returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a short from which to create a value
+ * @param value
+ * a short from which to create a value
* @return a corresponding value from this target
- */
+ */
public abstract IJavaValue newValue(short value);
-
+
/**
* Returns a value from this target that corresponds to the given string.
- * The returned value can be used for setting and comparing against a value
+ * The returned value can be used for setting and comparing against a value
* retrieved from this debug target.
*
- * @param value a string from which to create a value
+ * @param value
+ * a string from which to create a value
* @return a corresponding value from this target
- */
- public abstract IJavaValue newValue(String value);
-
+ */
+ public abstract IJavaValue newValue(String value);
+
/**
* Returns a value from this target that corresponds to <code>null</code>.
- * The returned value can be used for setting
- * and comparing against a value retrieved from this debug target.
+ * The returned value can be used for setting and comparing against a value
+ * retrieved from this debug target.
*
* @return a value corresponding to <code>null</code>
- */
+ */
public abstract IJavaValue nullValue();
-
+
/**
- * Returns a value from this target that corresponds to
- * <code>void</code>. The returned value can be used for setting
- * and comparing against a value retrieved from this debug target.
+ * Returns a value from this target that corresponds to <code>void</code>.
+ * The returned value can be used for setting and comparing against a value
+ * retrieved from this debug target.
*
* @return a value corresponding to <code>void</code>
- */
+ */
public abstract IJavaValue voidValue();
+
/**
- * Returns whether any of the threads associated with this debug target
- * are running code in the VM that is out of synch with the code
- * in the workspace.
+ * Returns whether any of the threads associated with this debug target are
+ * running code in the VM that is out of synch with the code in the
+ * workspace.
*
* @return whether this debug target is out of synch with the workspace.
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
*/
public abstract boolean isOutOfSynch() throws DebugException;
+
/**
- * Returns whether any of the threads associated with this debug target
- * may be running code in the VM that is out of synch with the code
- * in the workspace.
+ * Returns whether any of the threads associated with this debug target may
+ * be running code in the VM that is out of synch with the code in the
+ * workspace.
*
* @return whether this debug target may be out of synch with the workspace.
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
*/
public abstract boolean mayBeOutOfSynch() throws DebugException;
+
/**
* Returns whether this target supports hot code replace.
*
* @return whether this target supports hot code replace
*/
public boolean supportsHotCodeReplace();
+
/**
* Returns whether this target is currently performing a hot code replace.
*
@@ -210,6 +231,7 @@ public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
* @since 2.1
*/
public boolean isPerformingHotCodeReplace();
+
/**
* Returns whether this target supports instance breakpoints.
*
@@ -217,25 +239,23 @@ public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
* @since 2.1
*/
public boolean supportsInstanceBreakpoints();
-
+
/**
- * Returns whether synthetic methods are filtered
- * when stepping, if step filters are enabled.
+ * Returns whether synthetic methods are filtered when stepping, if step
+ * filters are enabled.
*
- * @return whether synthetic methods are filtered
- * when stepping
+ * @return whether synthetic methods are filtered when stepping
*/
public abstract boolean isFilterSynthetics();
-
+
/**
- * Sets whether synthetic methods are filtered
- * when stepping.
+ * Sets whether synthetic methods are filtered when stepping.
*
- * @param filter whether to synthetic methods are filtered
- * when stepping
+ * @param filter
+ * whether to synthetic methods are filtered when stepping
*/
public abstract void setFilterSynthetics(boolean filter);
-
+
/**
* Returns whether simple getters are filtered when stepping.
*
@@ -245,14 +265,14 @@ public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
public abstract boolean isFilterGetters();
/**
- * Sets whether simple getters are filtered
- * when stepping.
+ * Sets whether simple getters are filtered when stepping.
*
- * @param filter whether to filter simple getters when stepping
+ * @param filter
+ * whether to filter simple getters when stepping
* @since 3.7
*/
public abstract void setFilterGetters(boolean filter);
-
+
/**
* Returns whether simple setters are filtered when stepping.
*
@@ -262,117 +282,117 @@ public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
public abstract boolean isFilterSetters();
/**
- * Sets whether simple setters are filtered
- * when stepping.
+ * Sets whether simple setters are filtered when stepping.
*
- * @param filter whether to filter simple setters when stepping
+ * @param filter
+ * whether to filter simple setters when stepping
* @since 3.7
*/
public abstract void setFilterSetters(boolean filter);
-
-
+
/**
- * Returns whether static initializers are filtered
- * when stepping, if step filters are enabled.
+ * Returns whether static initializers are filtered when stepping, if step
+ * filters are enabled.
*
- * @return whether static initializers are filtered
- * when stepping
+ * @return whether static initializers are filtered when stepping
*/
public abstract boolean isFilterStaticInitializers();
-
+
/**
- * Sets whether to filter static initializers when
- * stepping.
+ * Sets whether to filter static initializers when stepping.
*
- * @param filter whether to filter static initializers when
- * stepping
+ * @param filter
+ * whether to filter static initializers when stepping
*/
public abstract void setFilterStaticInitializers(boolean filter);
-
+
/**
- * Returns whether constructors are filtered when stepping,
- * if step filters are enabled.
+ * Returns whether constructors are filtered when stepping, if step filters
+ * are enabled.
*
* @return whether constructors are filtered when stepping
*/
public abstract boolean isFilterConstructors();
-
+
/**
* Sets whether to filter constructors when stepping.
*
- * @param filter whether to filter constructors when stepping
+ * @param filter
+ * whether to filter constructors when stepping
*/
public abstract void setFilterConstructors(boolean filter);
-
+
/**
- * Returns the list of active step filters in this target.
- * The list is a collection of Strings. Each string is the
- * fully qualified name/pattern of a type/package to filter
- * when stepping. For example <code>java.lang.*</code> or
- * <code>java.lang.String</code>.
+ * Returns the list of active step filters in this target. The list is a
+ * collection of Strings. Each string is the fully qualified name/pattern of
+ * a type/package to filter when stepping. For example
+ * <code>java.lang.*</code> or <code>java.lang.String</code>.
*
* @return the list of active step filters, or <code>null</code>
*/
public abstract String[] getStepFilters();
-
+
/**
- * Sets the list of active step filters in this target.
- * The list is a collection of Strings. Each string is the
- * fully qualified name/pattern of a type/package to filter
- * when stepping. For example <code>java.lang.*</code> or
- * <code>java.lang.String</code>.
+ * Sets the list of active step filters in this target. The list is a
+ * collection of Strings. Each string is the fully qualified name/pattern of
+ * a type/package to filter when stepping. For example
+ * <code>java.lang.*</code> or <code>java.lang.String</code>.
*
- * @param list active step filters, or <code>null</code>
+ * @param list
+ * active step filters, or <code>null</code>
*/
public abstract void setStepFilters(String[] list);
-
+
/**
- * Sets whether a step that lands in a filtered location should continue through
- * to an un-filtered location, or return to where the step originated.
+ * Sets whether a step that lands in a filtered location should continue
+ * through to an un-filtered location, or return to where the step
+ * originated.
*
- * @param thru whether to step thru a filtered location or return to location where
- * step originated
+ * @param thru
+ * whether to step thru a filtered location or return to location
+ * where step originated
* @since 3.5
*/
- public void setStepThruFilters(boolean thru);
-
+ public void setStepThruFilters(boolean thru);
+
/**
- * Returns whether a step that lands in a filtered location should
- * proceed through to an un-filtered location or return to the location where
- * a step originated.
+ * Returns whether a step that lands in a filtered location should proceed
+ * through to an un-filtered location or return to the location where a step
+ * originated.
*
- * @return whether a step that lands in a filtered location should
- * proceed through to an un-filtered location or return to the location where
- * a step originated
+ * @return whether a step that lands in a filtered location should proceed
+ * through to an un-filtered location or return to the location
+ * where a step originated
* @since 3.5
*/
public boolean isStepThruFilters();
-
+
/**
- * Returns whether this debug target supports a request timeout -
- * a maximum time for a JDI request to receive a response. This option
- * is only supported by the Eclipse JDI implementation.
+ * Returns whether this debug target supports a request timeout - a maximum
+ * time for a JDI request to receive a response. This option is only
+ * supported by the Eclipse JDI implementation.
*
- * @return whether this debug target supports a request timeout
+ * @return whether this debug target supports a request timeout
*/
public boolean supportsRequestTimeout();
-
+
/**
- * Sets the timeout value for JDI requests in milliseconds. Has
- * no effect if this target does not support a request timeout.
+ * Sets the timeout value for JDI requests in milliseconds. Has no effect if
+ * this target does not support a request timeout.
*
- * @param timeout the communication timeout, in milliseconds
+ * @param timeout
+ * the communication timeout, in milliseconds
*/
public void setRequestTimeout(int timeout);
-
+
/**
- * Returns the timeout value for JDI requests in milliseconds,
- * or -1 if not supported.
+ * Returns the timeout value for JDI requests in milliseconds, or -1 if not
+ * supported.
*
* @return timeout value, in milliseconds, or -1 if not supported
*/
public int getRequestTimeout();
-
+
/**
* Returns whether this target supports providing monitor information.
*
@@ -380,7 +400,7 @@ public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
* @since 2.1
*/
public boolean supportsMonitorInformation();
-
+
/**
* Returns whether this target supports access watchpoints.
*
@@ -388,64 +408,67 @@ public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
* @since 3.0
*/
public boolean supportsAccessWatchpoints();
-
+
/**
* Returns whether this target supports modification watchpoints.
*
* @return whether this target supports modification watchpoints
* @since 3.0
*/
- public boolean supportsModificationWatchpoints();
-
+ public boolean supportsModificationWatchpoints();
+
/**
* Set the default stratum used in this debug target.
*
- * @param stratum the new default stratum, or <code>null</code> to indicate per-class
- * default stratum
+ * @param stratum
+ * the new default stratum, or <code>null</code> to indicate
+ * per-class default stratum
* @since 3.0
*/
public void setDefaultStratum(String stratum);
-
+
/**
- * Return the default stratum used in this the target, or <code>null</code> to indicate
- * a per-class default stratum.
+ * Return the default stratum used in this the target, or <code>null</code>
+ * to indicate a per-class default stratum.
*
- * @return the default stratum, or <code>null</code> to indicate a per-class default
- * stratum
+ * @return the default stratum, or <code>null</code> to indicate a per-class
+ * default stratum
* @see #setDefaultStratum(String)
* @since 3.0
*/
public String getDefaultStratum();
-
+
/**
- * Returns the top level thread groups in this target. Top level thread groups
- * do not have a parent.
+ * Returns the top level thread groups in this target. Top level thread
+ * groups do not have a parent.
*
* @return top level thread groups
* @throws DebugException
+ * if an exception occurs
* @since 3.2
*/
public IJavaThreadGroup[] getRootThreadGroups() throws DebugException;
-
+
/**
* Returns all thread groups in this target.
*
* @return all thread groups in this target
* @throws DebugException
+ * if an exception occurs
* @since 3.2
*/
public IJavaThreadGroup[] getAllThreadGroups() throws DebugException;
-
+
/**
- * Returns whether this VM supports instance and reference retrieval
- * for types and objects.
+ * Returns whether this VM supports instance and reference retrieval for
+ * types and objects.
*
- * @return whether this VM supports instance and reference retrieval
- * for types and objects
+ * @return whether this VM supports instance and reference retrieval for
+ * types and objects
* @since 3.3
*/
public boolean supportsInstanceRetrieval();
-
+
/**
* Returns whether this VM supports the ability to force an early return
* from methods.
@@ -455,88 +478,105 @@ public interface IJavaDebugTarget extends IDebugTarget, IStepFilters {
* @see IJavaThread
*/
public boolean supportsForceReturn();
-
+
/**
- * Returns whether this VM supports the ability to enable and disable garbage
- * collection of individual objects.
+ * Returns whether this VM supports the ability to enable and disable
+ * garbage collection of individual objects.
*
- * @return whether this VM supports the ability to enable and disable garbage
- * collection of individual objects
+ * @return whether this VM supports the ability to enable and disable
+ * garbage collection of individual objects
* @see IJavaObject
* @since 3.4
*/
public boolean supportsSelectiveGarbageCollection();
-
+
/**
- * Returns the name of the underlying virtual machine as defined by the system
- * property <code>java.vm.name</code>.
+ * Returns the name of the underlying virtual machine as defined by the
+ * system property <code>java.vm.name</code>.
*
* @return virtual machine name
- * @exception DebugException if retrieving the name fails
+ * @exception DebugException
+ * if retrieving the name fails
* @since 3.4
*/
public String getVMName() throws DebugException;
-
+
/**
- * Returns the version of the underlying virtual machine as defined by the system
- * property <code>java.version</code>.
+ * Returns the version of the underlying virtual machine as defined by the
+ * system property <code>java.version</code>.
*
* @return <code>java.version</code> system property
- * @exception DebugException if retrieving the version property fails
+ * @exception DebugException
+ * if retrieving the version property fails
* @since 3.4
*/
- public String getVersion() throws DebugException;
-
+ public String getVersion() throws DebugException;
+
/**
- * Refreshes the state of the Java debug model elements (client) with the current
- * state of the debug target.
+ * Refreshes the state of the Java debug model elements (client) with the
+ * current state of the debug target.
* <p>
- * For example, a {@link IJavaThread} may currently have a suspended state, but was
- * somehow resumed on the target. Calling this method will causes all threads to update
- * their state based on the current state of the target. Elements will fire debug events
- * associated with any state changes. For example, a thread would fire a resume event
- * if it discovered it was in a running state when it thought it was suspended.
+ * For example, a {@link IJavaThread} may currently have a suspended state,
+ * but was somehow resumed on the target. Calling this method will causes
+ * all threads to update their state based on the current state of the
+ * target. Elements will fire debug events associated with any state
+ * changes. For example, a thread would fire a resume event if it discovered
+ * it was in a running state when it thought it was suspended.
* </p>
- * @throws DebugException if an exception occurs
+ *
+ * @throws DebugException
+ * if an exception occurs
* @since 3.6
*/
public void refreshState() throws DebugException;
-
+
/**
- * Sends a JDWP command to the back end and returns the JDWP reply packet as bytes.
- * This method creates an appropriate command header and packet id, before sending
- * to the back end.
- *
- * @param commandSet command set identifier as defined by JDWP
- * @param commandId command identifier as defined by JDWP
- * @param data any bytes required for the command that follow the command header
- * or <code>null</code> for commands that have no data
+ * Sends a JDWP command to the back end and returns the JDWP reply packet as
+ * bytes. This method creates an appropriate command header and packet id,
+ * before sending to the back end.
+ *
+ * @param commandSet
+ * command set identifier as defined by JDWP
+ * @param commandId
+ * command identifier as defined by JDWP
+ * @param data
+ * any bytes required for the command that follow the command
+ * header or <code>null</code> for commands that have no data
* @return raw reply packet as bytes defined by JDWP
- * @exception DebugException if an error occurs sending the packet or receiving the reply
+ * @exception DebugException
+ * if an error occurs sending the packet or receiving the
+ * reply
* @since 3.6
*/
- public byte[] sendCommand(byte commandSet, byte commandId, byte[] data) throws DebugException;
-
+ public byte[] sendCommand(byte commandSet, byte commandId, byte[] data)
+ throws DebugException;
+
/**
- * Adds the given listener to this target for hot code replace notifications. Has
- * no effect if an identical listener is already registered.
+ * Adds the given listener to this target for hot code replace
+ * notifications. Has no effect if an identical listener is already
+ * registered.
* <p>
- * When a hot code replace listener is added to a specific target, general hot code
- * replace notifications via {@link JDIDebugModel} are not reported for that target.
- * This allows a target to override general/default hot code replace listeners/handlers.
+ * When a hot code replace listener is added to a specific target, general
+ * hot code replace notifications via {@link JDIDebugModel} are not reported
+ * for that target. This allows a target to override general/default hot
+ * code replace listeners/handlers.
* </p>
- * @param listener hot code replace listener
+ *
+ * @param listener
+ * hot code replace listener
* @since 3.6
*/
public void addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener);
-
+
/**
- * Removes the given listener from this target. Has no effect if an identical
- * listener is not already registered.
+ * Removes the given listener from this target. Has no effect if an
+ * identical listener is not already registered.
*
- * @param listener hot code replace listener
+ * @param listener
+ * hot code replace listener
* @since 3.6
*/
- public void removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener);
-
+ public void removeHotCodeReplaceListener(
+ IJavaHotCodeReplaceListener listener);
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java
index da44f3778..5a3d39b27 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java
@@ -10,163 +10,187 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
/**
- * A breakpoint that suspends execution when a corresponding exception
- * is thrown in a target VM. An exception breakpoint can be configured
- * to suspend execution when the corresponding exception is thrown in
- * a caught or uncaught location. As well, the location can be filtered
- * inclusively or exclusively by type name patterns.
+ * A breakpoint that suspends execution when a corresponding exception is thrown
+ * in a target VM. An exception breakpoint can be configured to suspend
+ * execution when the corresponding exception is thrown in a caught or uncaught
+ * location. As well, the location can be filtered inclusively or exclusively by
+ * type name patterns.
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaExceptionBreakpoint extends IJavaBreakpoint {
/**
- * Sets the inclusion filters that will define the scope for the associated exception.
- * Filters are a collection of strings of type name prefixes.
+ * Sets the inclusion filters that will define the scope for the associated
+ * exception. Filters are a collection of strings of type name prefixes.
* Default packages should be specified as the empty string.
*
- * @param filters the array of filters to apply
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * @param filters
+ * the array of filters to apply
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
* @since 2.1
*/
public void setInclusionFilters(String[] filters) throws CoreException;
/**
- * Returns the inclusive filters that define the scope for the associated exception.
- * Filters are a collection of strings of type name prefixes.
+ * Returns the inclusive filters that define the scope for the associated
+ * exception. Filters are a collection of strings of type name prefixes.
*
* @return the array of defined inclusive filters
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
* @since 2.1
*/
public String[] getInclusionFilters() throws CoreException;
/**
- * Returns whether this breakpoint suspends execution when the
- * associated exception is thrown in a caught location (in
- * a try/catch statement).
+ * Returns whether this breakpoint suspends execution when the associated
+ * exception is thrown in a caught location (in a try/catch statement).
*
- * @return <code>true</code> if this is a caught exception
- * breakpoint
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return <code>true</code> if this is a caught exception breakpoint
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public boolean isCaught() throws CoreException;
+
/**
- * Returns whether this breakpoint suspends execution when the
- * associated exception is thrown in an uncaught location (not
- * caught by a try/catch statement).
+ * Returns whether this breakpoint suspends execution when the associated
+ * exception is thrown in an uncaught location (not caught by a try/catch
+ * statement).
*
- * @return <code>true</code> if this is an uncaught exception
- * breakpoint.
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return <code>true</code> if this is an uncaught exception breakpoint.
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
- public boolean isUncaught() throws CoreException;
+ public boolean isUncaught() throws CoreException;
+
/**
* Sets whether this breakpoint suspends execution when the associated
- * exception is thrown in a caught location (in a try/catch
- * statement).
- *
- * @param caught whether or not this breakpoint suspends execution when the
- * associated exception is thrown in a caught location
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * exception is thrown in a caught location (in a try/catch statement).
+ *
+ * @param caught
+ * whether or not this breakpoint suspends execution when the
+ * associated exception is thrown in a caught location
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
public void setCaught(boolean caught) throws CoreException;
+
/**
* Sets whether this breakpoint suspends execution when the associated
* exception is thrown in an uncaught location.
*
- * @param uncaught whether or not this breakpoint suspends execution when the
- * associated exception is thrown in an uncaught location
- * @exception CoreException if unable to set the property
- * on this breakpoint's underlying marker
- */
+ * @param uncaught
+ * whether or not this breakpoint suspends execution when the
+ * associated exception is thrown in an uncaught location
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
+ */
public void setUncaught(boolean uncaught) throws CoreException;
+
/**
* Returns whether the exception associated with this breakpoint is a
* checked exception (compiler detected).
*
- * @return <code>true</code> if the exception associated with this breakpoint
- * is a checked exception
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return <code>true</code> if the exception associated with this
+ * breakpoint is a checked exception
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public boolean isChecked() throws CoreException;
-
+
/**
- * Returns the fully qualified type name of the exception that
- * last caused this breakpoint to suspend, of <code>null</code>
- * if this breakpoint has not caused a thread to suspend. Note
- * that this name may be a sub type of the exception that this
- * breakpoint is associated with.
+ * Returns the fully qualified type name of the exception that last caused
+ * this breakpoint to suspend, of <code>null</code> if this breakpoint has
+ * not caused a thread to suspend. Note that this name may be a sub type of
+ * the exception that this breakpoint is associated with.
*
* @return fully qualified exception name or <code>null</code>
*/
public String getExceptionTypeName();
-
+
/**
* Sets the filters that will define the scope for the associated exception.
- * Filters are a collection of strings of type name prefixes.
- * Default packages should be specified as the empty string.
+ * Filters are a collection of strings of type name prefixes. Default
+ * packages should be specified as the empty string.
*
- * @param filters the array of filters to apply
- * @param inclusive whether or not to apply the filters as inclusive or exclusive
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
- * @deprecated Exception breakpoints can have a mixed set of filters. Use setInclusiveFilters(String[] filters) or setExclusiveFilters(String[] filters)
+ * @param filters
+ * the array of filters to apply
+ * @param inclusive
+ * whether or not to apply the filters as inclusive or exclusive
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
+ * @deprecated Exception breakpoints can have a mixed set of filters. Use
+ * setInclusiveFilters(String[] filters) or
+ * setExclusiveFilters(String[] filters)
*/
- public void setFilters(String[] filters, boolean inclusive) throws CoreException;
-
+ @Deprecated
+ public void setFilters(String[] filters, boolean inclusive)
+ throws CoreException;
+
/**
- * Sets the exclusion filters that will define the scope for the associated exception.
- * Filters are a collection of strings of type name prefixes.
+ * Sets the exclusion filters that will define the scope for the associated
+ * exception. Filters are a collection of strings of type name prefixes.
* Default packages should be specified as the empty string.
*
- * @param filters the array of filters to apply
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * @param filters
+ * the array of filters to apply
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
* @since 2.1
*/
public void setExclusionFilters(String[] filters) throws CoreException;
-
+
/**
* Returns the filters that define the scope for the associated exception.
* Filters are a collection of strings of type name prefixes.
*
* @return the array of defined filters
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
* @deprecated Use getExclusionFilters() or getInclusionFilters()
*/
+ @Deprecated
public String[] getFilters() throws CoreException;
-
+
/**
- * Returns the exclusive filters that define the scope for the associated exception.
- * Filters are a collection of strings of type name prefixes.
+ * Returns the exclusive filters that define the scope for the associated
+ * exception. Filters are a collection of strings of type name prefixes.
*
* @return the array of defined inclusive filters
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
* @since 2.1
*/
public String[] getExclusionFilters() throws CoreException;
-
+
/**
* Returns whether any inclusive filters have been applied.
+ *
* @return <code>true</code> if the inclusive filters have been applied
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
- * @deprecated Exception breakpoints can have a mixed set of filters
- * and this method is maintained strictly for API backwards compatibility
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
+ * @deprecated Exception breakpoints can have a mixed set of filters and
+ * this method is maintained strictly for API backwards
+ * compatibility
*/
+ @Deprecated
public boolean isInclusiveFiltered() throws CoreException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaFieldVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaFieldVariable.java
index 649fa9e6d..15743c9ac 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaFieldVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaFieldVariable.java
@@ -10,56 +10,63 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
/**
* A variable that contains the value of an instance or class variable.
+ *
* @see org.eclipse.debug.core.model.IVariable
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaFieldVariable extends IJavaVariable {
-
+
/**
* Returns whether this variable is declared as transient.
- *
+ *
* @return whether this variable has been declared as transient
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isTransient() throws DebugException;
-
+
/**
* Returns whether this variable is declared as volatile.
*
* @return whether this variable has been declared as volatile
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isVolatile() throws DebugException;
-
+
/**
* Returns the type that declares this variable.
*
* @return the type that declares this variable
*/
- public IJavaType getDeclaringType();
-
+ public IJavaType getDeclaringType();
+
/**
- * Returns the object that contains this field variable, or <code>null</code>
- * if no object contains this field variable (static field variable).
+ * Returns the object that contains this field variable, or
+ * <code>null</code> if no object contains this field variable (static field
+ * variable).
*
* @return the object that contains this field variable
* @since 3.0
*/
public IJavaObject getReceiver();
-
+
/**
* Returns the type that contains this field variable.
*
@@ -67,7 +74,5 @@ public interface IJavaFieldVariable extends IJavaVariable {
* @since 3.0
*/
public IJavaReferenceType getReceivingType();
-
-}
-
+}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaHotCodeReplaceListener.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaHotCodeReplaceListener.java
index 543fba774..3366fa5a7 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaHotCodeReplaceListener.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaHotCodeReplaceListener.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
/**
* Notification of hot code replace failure and success. As resources are
- * modified in the workspace, targets that support hot code replace are
- * updated with new class files.
+ * modified in the workspace, targets that support hot code replace are updated
+ * with new class files.
* <p>
* Clients may implement this interface
* </p>
+ *
* @since 2.0
*/
public interface IJavaHotCodeReplaceListener {
@@ -27,30 +27,33 @@ public interface IJavaHotCodeReplaceListener {
/**
* Notification that a hot code replace attempt failed in the given target.
*
- * @param target the target in which the hot code replace failed
- * @param exception the exception generated by the hot code replace
- * failure, or <code>null</code> if the hot code replace failed because
- * the target VM does not support hot code replace
+ * @param target
+ * the target in which the hot code replace failed
+ * @param exception
+ * the exception generated by the hot code replace failure, or
+ * <code>null</code> if the hot code replace failed because the
+ * target VM does not support hot code replace
*/
- public void hotCodeReplaceFailed(IJavaDebugTarget target, DebugException exception);
-
+ public void hotCodeReplaceFailed(IJavaDebugTarget target,
+ DebugException exception);
+
/**
- * Notification that a hot code replace attempt succeeded in the
- * given target.
+ * Notification that a hot code replace attempt succeeded in the given
+ * target.
*
- * @param target the target in which the hot code replace succeeded
+ * @param target
+ * the target in which the hot code replace succeeded
*/
- public void hotCodeReplaceSucceeded(IJavaDebugTarget target);
-
+ public void hotCodeReplaceSucceeded(IJavaDebugTarget target);
+
/**
- * Notification that obsolete methods remain on the stack
- * in one or more threads in the given target after a hot code
- * replace.
+ * Notification that obsolete methods remain on the stack in one or more
+ * threads in the given target after a hot code replace.
*
- * @param target the target in which obsolete methods remain after
- * a hot code replace
+ * @param target
+ * the target in which obsolete methods remain after a hot code
+ * replace
*/
public void obsoleteMethods(IJavaDebugTarget target);
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaInterfaceType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaInterfaceType.java
index c4475a841..4000fd3ff 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaInterfaceType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaInterfaceType.java
@@ -10,62 +10,72 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
-
+
/**
* An interface an object implements on a Java debug target.
+ *
* @see IJavaValue
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface IJavaInterfaceType extends IJavaReferenceType {
-
- /**
- * Returns the class objects associated with the implementors of this interface type.
- * Returns an empty array if there are none.
- *
- * @return the class objects associated with the implementors of this interface type
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- * @since 3.0
- */
+public interface IJavaInterfaceType extends IJavaReferenceType {
+
+ /**
+ * Returns the class objects associated with the implementors of this
+ * interface type. Returns an empty array if there are none.
+ *
+ * @return the class objects associated with the implementors of this
+ * interface type
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
+ * @since 3.0
+ */
public IJavaClassType[] getImplementors() throws DebugException;
-
+
/**
- * Returns the interface objects associated with the sub-interfaces of this interface type.
- * Returns an empty array if there are none. The sub-interfaces are those interfaces
- * that directly extend this interface, that is, those interfaces that declared this interface
- * in their <code>extends</code> clause.
+ * Returns the interface objects associated with the sub-interfaces of this
+ * interface type. Returns an empty array if there are none. The
+ * sub-interfaces are those interfaces that directly extend this interface,
+ * that is, those interfaces that declared this interface in their
+ * <code>extends</code> clause.
*
- * @return the interface objects associated with the sub-interfaces of this interface type
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @return the interface objects associated with the sub-interfaces of this
+ * interface type
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 3.0
*/
public IJavaInterfaceType[] getSubInterfaces() throws DebugException;
/**
- * Returns the interface objects associated with the super-interfaces of this interface type.
- * Returns an empty array if there are none. The super-interfaces are those interfaces
- * that are directly extended by this interface, that is, those interfaces that this
- * interface declared to be extended.
+ * Returns the interface objects associated with the super-interfaces of
+ * this interface type. Returns an empty array if there are none. The
+ * super-interfaces are those interfaces that are directly extended by this
+ * interface, that is, those interfaces that this interface declared to be
+ * extended.
*
- * @return the interface objects associated with the super-interfaces of this interface type
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @return the interface objects associated with the super-interfaces of
+ * this interface type
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 3.0
*/
public IJavaInterfaceType[] getSuperInterfaces() throws DebugException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaLineBreakpoint.java
index b726c49b8..f85ad640c 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaLineBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,93 +10,111 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.ILineBreakpoint;
-
/**
- * A breakpoint that suspends execution when a particular line of code
- * is reached.
+ * A breakpoint that suspends execution when a particular line of code is
+ * reached.
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface IJavaLineBreakpoint extends IJavaBreakpoint, ILineBreakpoint {
-
+public interface IJavaLineBreakpoint extends IJavaBreakpoint, ILineBreakpoint {
+
/**
- * Returns whether this breakpoint supports a conditional
- * expression. Conditional breakpoints only suspend when
- * their associated condition evaluates to <code>true</code>.
+ * Returns whether this breakpoint supports a conditional expression.
+ * Conditional breakpoints only suspend when their associated condition
+ * evaluates to <code>true</code>.
*
* @return whether this breakpoint supports a condition
*/
public boolean supportsCondition();
+
/**
- * Returns the conditional expression associated with this breakpoint,
- * or <code>null</code> if this breakpoint does not have a condition.
+ * Returns the conditional expression associated with this breakpoint, or
+ * <code>null</code> if this breakpoint does not have a condition.
*
* @return this breakpoint's conditional expression, or <code>null</code>
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
*/
public String getCondition() throws CoreException;
+
/**
- * Sets the condition associated with this breakpoint.
- * When the condition is enabled, this breakpoint will only suspend execution
- * when the given condition evaluates to <code>true</code>.
- * Setting the condition to <code>null</code> or an empty string removes
- * the condition.
+ * Sets the condition associated with this breakpoint. When the condition is
+ * enabled, this breakpoint will only suspend execution when the given
+ * condition evaluates to <code>true</code>. Setting the condition to
+ * <code>null</code> or an empty string removes the condition.
* <p>
* If this breakpoint does not support conditions, setting the condition has
* no effect.
* </p>
- * @param condition conditional expression
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ *
+ * @param condition
+ * conditional expression
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
public void setCondition(String condition) throws CoreException;
+
/**
* Returns whether the condition on this breakpoint is enabled.
*
* @return whether this breakpoint's condition is enabled
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
*/
public boolean isConditionEnabled() throws CoreException;
+
/**
- * Sets the enabled state of this breakpoint's condition to the given
- * state. When enabled, this breakpoint will only suspend when its
- * condition evaluates to true. When disabled, this breakpoint will suspend
- * as it would with no condition defined.
+ * Sets the enabled state of this breakpoint's condition to the given state.
+ * When enabled, this breakpoint will only suspend when its condition
+ * evaluates to true. When disabled, this breakpoint will suspend as it
+ * would with no condition defined.
+ *
+ * @param enabled
+ * the enabled state of the condition
*
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
public void setConditionEnabled(boolean enabled) throws CoreException;
+
/**
* Returns whether the breakpoint suspends when the value of the condition
* is <code>true</code> or when the value of the condition changes.
*
* @return <code>true</code> if this breakpoint suspends when the value of
- * the condition is <code>true</code>, <code>false</code> if this breakpoint
- * suspends when the value of the condition changes.
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
+ * the condition is <code>true</code>, <code>false</code> if this
+ * breakpoint suspends when the value of the condition changes.
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
* @since 2.1
*/
public boolean isConditionSuspendOnTrue() throws CoreException;
+
/**
* Set the suspend state of this breakpoint's condition. If the value is
* <code>true</code>, the breakpoint will stop when the value of the
* condition is <code>true</code>. If the value is <code>false</code>, the
* breakpoint will stop when the value of the condition changes.
*
- * @exception CoreException if unable to access the property on this
- * breakpoint's underlying marker
+ * @param suspendOnTrue
+ * if the condition should suspend when true
+ *
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
* @since 2.1
*/
- public void setConditionSuspendOnTrue(boolean suspendOnTrue) throws CoreException;
+ public void setConditionSuspendOnTrue(boolean suspendOnTrue)
+ throws CoreException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodBreakpoint.java
index 3d595169c..3131c5a57 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IDebugTarget;
/**
- * A method breakpoint suspends execution when a
- * method is entered or exited.
+ * A method breakpoint suspends execution when a method is entered or exited.
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
@@ -24,120 +23,133 @@ import org.eclipse.debug.core.model.IDebugTarget;
public interface IJavaMethodBreakpoint extends IJavaLineBreakpoint {
/**
- * Returns the name of the method(s) this breakpoint suspends
- * execution in, or <code>null</code> if this breakpoint does
- * not suspend execution based on method name.
+ * Returns the name of the method(s) this breakpoint suspends execution in,
+ * or <code>null</code> if this breakpoint does not suspend execution based
+ * on method name.
*
- * @return the name of the method(s) this breakpoint suspends
- * execution in, or <code>null</code> if this breakpoint does
- * not suspend execution based on method name
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return the name of the method(s) this breakpoint suspends execution in,
+ * or <code>null</code> if this breakpoint does not suspend
+ * execution based on method name
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public String getMethodName() throws CoreException;
-
+
/**
- * Returns the signature of the method(s) this breakpoint suspends
- * execution in, or <code>null</code> if this breakpoint does not
- * suspend execution based on method signature.
+ * Returns the signature of the method(s) this breakpoint suspends execution
+ * in, or <code>null</code> if this breakpoint does not suspend execution
+ * based on method signature.
*
- * @return the signature of the method(s) this breakpoint suspends
- * execution in, or <code>null</code> if this breakpoint does not
- * suspend execution based on method signature
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return the signature of the method(s) this breakpoint suspends execution
+ * in, or <code>null</code> if this breakpoint does not suspend
+ * execution based on method signature
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
- public String getMethodSignature() throws CoreException;
-
+ public String getMethodSignature() throws CoreException;
+
/**
- * Returns the pattern specifying the fully qualified name of type(s)
- * this breakpoint suspends execution in. Patterns are limited to exact
- * matches and patterns that begin or end with '*'.
+ * Returns the pattern specifying the fully qualified name of type(s) this
+ * breakpoint suspends execution in. Patterns are limited to exact matches
+ * and patterns that begin or end with '*'.
*
- * @return the pattern specifying the fully qualified name of type(s)
- * this breakpoint suspends execution in
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return the pattern specifying the fully qualified name of type(s) this
+ * breakpoint suspends execution in
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
* @see IJavaBreakpoint#getTypeName()
*/
- public String getTypeName() throws CoreException;
-
+ public String getTypeName() throws CoreException;
+
/**
- * Returns whether this breakpoint causes execution to suspend
- * on entry to methods.
+ * Returns whether this breakpoint causes execution to suspend on entry to
+ * methods.
*
- * @return whether this breakpoint causes execution to suspend
- * on entry to methods
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return whether this breakpoint causes execution to suspend on entry to
+ * methods
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public boolean isEntry() throws CoreException;
-
+
/**
- * Returns whether this breakpoint causes execution to suspend
- * on exit of methods.
+ * Returns whether this breakpoint causes execution to suspend on exit of
+ * methods.
*
- * @return whether this breakpoint causes execution to suspend
- * on exit of methods
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return whether this breakpoint causes execution to suspend on exit of
+ * methods
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
- public boolean isExit() throws CoreException;
-
+ public boolean isExit() throws CoreException;
+
/**
- * Sets whether this breakpoint causes execution to suspend
- * on entry to methods.
+ * Sets whether this breakpoint causes execution to suspend on entry to
+ * methods.
*
- * @param entry whether this breakpoint causes execution to suspend
- * on entry to methods
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * @param entry
+ * whether this breakpoint causes execution to suspend on entry
+ * to methods
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
- public void setEntry(boolean entry) throws CoreException;
-
+ public void setEntry(boolean entry) throws CoreException;
+
/**
- * Sets whether this breakpoint causes execution to suspend
- * on exit of methods.
+ * Sets whether this breakpoint causes execution to suspend on exit of
+ * methods.
*
- * @param exit whether this breakpoint causes execution to suspend
- * on exit of methods
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * @param exit
+ * whether this breakpoint causes execution to suspend on exit of
+ * methods
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
- public void setExit(boolean exit) throws CoreException;
-
+ public void setExit(boolean exit) throws CoreException;
+
/**
- * Sets whether this breakpoint causes execution to suspend
- * only on entry/exit of native methods.
+ * Sets whether this breakpoint causes execution to suspend only on
+ * entry/exit of native methods.
*
- * @param nativeOnly whether this breakpoint causes execution to suspend
- * only on entry/exit of native methods
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * @param nativeOnly
+ * whether this breakpoint causes execution to suspend only on
+ * entry/exit of native methods
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
*/
- public void setNativeOnly(boolean nativeOnly) throws CoreException;
-
+ public void setNativeOnly(boolean nativeOnly) throws CoreException;
+
/**
- * Returns whether this breakpoint causes execution to suspend
- * only on entry/exit of native methods.
+ * Returns whether this breakpoint causes execution to suspend only on
+ * entry/exit of native methods.
*
- * @return whether this breakpoint causes execution to suspend
- * only on entry/exit of native methods
- * @exception CoreException if unable to access the property
- * on this breakpoint's underlying marker
+ * @return whether this breakpoint causes execution to suspend only on
+ * entry/exit of native methods
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
*/
- public boolean isNativeOnly() throws CoreException;
-
+ public boolean isNativeOnly() throws CoreException;
+
/**
- * Returns whether this breakpoint last suspended in the given
- * target due to a method entry (<code>true</code>) or exit
- * (<code>false</code>).
+ * Returns whether this breakpoint last suspended in the given target due to
+ * a method entry (<code>true</code>) or exit (<code>false</code>).
+ *
+ * @param target
+ * the debug target
*
* @return <code>true</code> if this breakpoint last suspended the given
- * target due to a method entry; <code>false</code> if this breakpoint last
- * suspended in the given target due to a method exit or if this
- * breakpoint hasn't suspended the given target.
+ * target due to a method entry; <code>false</code> if this
+ * breakpoint last suspended in the given target due to a method
+ * exit or if this breakpoint hasn't suspended the given target.
*/
- public boolean isEntrySuspend(IDebugTarget target);
+ public boolean isEntrySuspend(IDebugTarget target);
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodEntryBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodEntryBreakpoint.java
index aaee66c54..e551281de 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodEntryBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaMethodEntryBreakpoint.java
@@ -10,22 +10,20 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
/**
- * A method entry breakpoint suspends execution on the first
- * executable line of a method when entered. Entry breakpoints
- * can only be installed in methods that have executable code (i.e.
- * do not work in native methods).
+ * A method entry breakpoint suspends execution on the first executable line of
+ * a method when entered. Entry breakpoints can only be installed in methods
+ * that have executable code (i.e. do not work in native methods).
* <p>
* This breakpoint provides a subset of the function provided by
- * <code>IJavaMethodBreakpoint</code> - i.e. break on enter. The
- * implementation of this breakpoint is more efficient than the
- * general method breakpoint, as the implementation is based on line
- * breakpoints and does not require method enter/exit tracing in the
- * target VM.
+ * <code>IJavaMethodBreakpoint</code> - i.e. break on enter. The implementation
+ * of this breakpoint is more efficient than the general method breakpoint, as
+ * the implementation is based on line breakpoints and does not require method
+ * enter/exit tracing in the target VM.
* </p>
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
@@ -33,26 +31,24 @@ import org.eclipse.core.runtime.CoreException;
public interface IJavaMethodEntryBreakpoint extends IJavaLineBreakpoint {
/**
- * Returns the name of the method this breakpoint suspends
- * execution in.
+ * Returns the name of the method this breakpoint suspends execution in.
*
- * @return the name of the method this breakpoint suspends
- * execution in
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return the name of the method this breakpoint suspends execution in
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public String getMethodName() throws CoreException;
-
+
/**
- * Returns the signature of the method this breakpoint suspends
- * execution in.
+ * Returns the signature of the method this breakpoint suspends execution
+ * in.
*
- * @return the signature of the method this breakpoint suspends
- * execution in
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return the signature of the method this breakpoint suspends execution in
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
- public String getMethodSignature() throws CoreException;
-
-}
+ public String getMethodSignature() throws CoreException;
+}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaModifiers.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaModifiers.java
index dce76ab62..05e84b45e 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaModifiers.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaModifiers.java
@@ -10,93 +10,117 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
/**
- * Modifiers common to Java debug elements that have associated Java
- * member declarations. For example, the method associated with a stack frame,
- * or the field associated with a variable.
+ * Modifiers common to Java debug elements that have associated Java member
+ * declarations. For example, the method associated with a stack frame, or the
+ * field associated with a variable.
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface IJavaModifiers {
+public interface IJavaModifiers {
/**
* Returns whether the associated Java construct is declared as public.
- *
+ *
* @return whether the associated Java construct is declared as public
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isPublic() throws DebugException;
+
/**
* Returns whether the associated Java construct is declared as private.
- *
+ *
* @return whether the associated Java construct is declared as private
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isPrivate() throws DebugException;
+
/**
* Returns whether the associated Java construct is declared as protected.
- *
+ *
* @return whether the associated Java construct is declared as protected
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isProtected() throws DebugException;
+
/**
- * Returns whether the associated Java construct is declared with
- * no protection modifier (package private protection).
- *
- * @return whether the associated Java construct is declared as package private
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * Returns whether the associated Java construct is declared with no
+ * protection modifier (package private protection).
+ *
+ * @return whether the associated Java construct is declared as package
+ * private
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isPackagePrivate() throws DebugException;
+
/**
* Returns whether the associated Java construct is declared as final.
*
* @return whether the associated Java construct is declared as final
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isFinal() throws DebugException;
+
/**
* Returns whether the associated Java construct is declared as static.
*
* @return whether the associated Java construct is declared as static
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isStatic() throws DebugException;
+
/**
- * Returns whether the associated Java construct is synthetic.
- * Synthetic members are generated by the compiler
- * and are not present in source code.
- *
+ * Returns whether the associated Java construct is synthetic. Synthetic
+ * members are generated by the compiler and are not present in source code.
+ *
* @return whether the associated Java construct is synthetic
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public boolean isSynthetic() throws DebugException;
-
}
-
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaObject.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaObject.java
index 8d7372c65..f34c3b9db 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaObject.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaObject.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,179 +14,226 @@ import org.eclipse.debug.core.DebugException;
/**
* A value referencing an object on a target VM.
+ *
* @see IJavaValue
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaObject extends IJavaValue {
-
+
/**
- * Returns the result of sending the specified message to this object
- * with the given arguments in the specified thread. The given
- * thread is resumed to perform the method invocation. The thread will suspend
- * in its original location when the method invocation is complete. This
- * method does not return until the method invocation is complete.
- * Invoking a method in the target VM can result in breakpoints being
- * hit, infinite loops, and deadlock.
+ * Returns the result of sending the specified message to this object with
+ * the given arguments in the specified thread. The given thread is resumed
+ * to perform the method invocation. The thread will suspend in its original
+ * location when the method invocation is complete. This method does not
+ * return until the method invocation is complete. Invoking a method in the
+ * target VM can result in breakpoints being hit, infinite loops, and
+ * deadlock.
*
- * @param selector the selector of the method to be invoked
- * @param signature the JNI style signature of the method to be invoked
- * @param args the arguments of the method, which can be
- * <code>null</code> or empty if there are none
- * @param thread the thread in which to invoke the method
- * @param superSend <code>true</code> if the method lookup should
- * begin in this object's superclass
+ * @param selector
+ * the selector of the method to be invoked
+ * @param signature
+ * the JNI style signature of the method to be invoked
+ * @param args
+ * the arguments of the method, which can be <code>null</code> or
+ * empty if there are none
+ * @param thread
+ * the thread in which to invoke the method
+ * @param superSend
+ * <code>true</code> if the method lookup should begin in this
+ * object's superclass
* @return the result of invoking the method
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This object does not implement the specified method</li>
- * <li>An exception occurs while invoking the specified method</li>
- * <li>The given thread is already performing a message send,
- * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
- * <li>The given thread is not currently suspended
- * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
- * <li>The given thread was explicitly suspended
- * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This object does not implement the specified method</li>
+ * <li>An exception occurs while invoking the specified
+ * method</li>
+ * <li>The given thread is already performing a message send,
+ * (status code
+ * <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
+ * <li>The given thread is not currently suspended (status
+ * code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
+ * <li>The given thread was explicitly suspended (status code
+ * <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
+ * </ul>
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, boolean superSend) throws DebugException;
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, boolean superSend)
+ throws DebugException;
+
/**
- * Returns the result of sending the specified message on the specified declaring type
- * to this object with the given arguments in the specified thread. The given
- * thread is resumed to perform the method invocation. The thread will suspend
- * in its original location when the method invocation is complete. This
- * method does not return until the method invocation is complete.
- * Invoking a method in the target VM can result in breakpoints being
- * hit, infinite loops, and deadlock.
+ * Returns the result of sending the specified message on the specified
+ * declaring type to this object with the given arguments in the specified
+ * thread. The given thread is resumed to perform the method invocation. The
+ * thread will suspend in its original location when the method invocation
+ * is complete. This method does not return until the method invocation is
+ * complete. Invoking a method in the target VM can result in breakpoints
+ * being hit, infinite loops, and deadlock.
*
- * @param selector the selector of the method to be invoked
- * @param signature the JNI style signature of the method to be invoked
- * @param args the arguments of the method, which can be
- * <code>null</code> or empty if there are none
- * @param thread the thread in which to invoke the method
- * @param typeSignature the signature of the type in which the method
- * is defined or <code>null</code> if the method should be invoked normally using
- * polymorphism
+ * @param selector
+ * the selector of the method to be invoked
+ * @param signature
+ * the JNI style signature of the method to be invoked
+ * @param args
+ * the arguments of the method, which can be <code>null</code> or
+ * empty if there are none
+ * @param thread
+ * the thread in which to invoke the method
+ * @param typeSignature
+ * the signature of the type in which the method is defined or
+ * <code>null</code> if the method should be invoked normally
+ * using polymorphism
* @return the result of invoking the method
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This object does not implement the specified method</li>
- * <li>An exception occurs while invoking the specified method</li>
- * <li>The given thread is already performing a message send,
- * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
- * <li>The given thread is not currently suspended
- * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
- * <li>The given thread was explicitly suspended
- * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This object does not implement the specified method</li>
+ * <li>An exception occurs while invoking the specified
+ * method</li>
+ * <li>The given thread is already performing a message send,
+ * (status code
+ * <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
+ * <li>The given thread is not currently suspended (status
+ * code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
+ * <li>The given thread was explicitly suspended (status code
+ * <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
+ * </ul>
* @since 2.0.1
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, String typeSignature) throws DebugException;
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, String typeSignature)
+ throws DebugException;
+
/**
- * Returns a variable representing the field in this object
- * with the given name, or <code>null</code> if there is no
- * field with the given name, or the name is ambiguous.
+ * Returns a variable representing the field in this object with the given
+ * name, or <code>null</code> if there is no field with the given name, or
+ * the name is ambiguous.
*
- * @param name field name
- * @param superField whether or not to get the field in the superclass
- * of this objects.
+ * @param name
+ * field name
+ * @param superField
+ * whether or not to get the field in the superclass of this
+ * objects.
* @return the variable representing the field, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
*/
- public IJavaFieldVariable getField(String name, boolean superField) throws DebugException;
+ public IJavaFieldVariable getField(String name, boolean superField)
+ throws DebugException;
+
/**
- * Returns a variable representing the field in this object
- * with the given name declared in the type with the given
- * signature, or <code>null</code> if there is no
- * field with the given name, or the name is ambiguous.
+ * Returns a variable representing the field in this object with the given
+ * name declared in the type with the given signature, or <code>null</code>
+ * if there is no field with the given name, or the name is ambiguous.
*
- * @param name field name
- * @param typeSignature the signature of the type in which the field
- * is defined
+ * @param name
+ * field name
+ * @param typeSignature
+ * the signature of the type in which the field is defined
* @return the variable representing the field, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
*/
- public IJavaFieldVariable getField(String name, String typeSignature) throws DebugException;
-
+ public IJavaFieldVariable getField(String name, String typeSignature)
+ throws DebugException;
+
/**
* Returns the threads waiting for the monitor associated to this object, or
* <code>null</code> if no thread is waiting for the monitor.
*
* @return the thread waiting for the monitor, or <code>null</code>.
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>The VM is not able to retrieve the monitor information</li>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>The VM is not able to retrieve the monitor information
+ * </li>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 3.1
*/
public IJavaThread[] getWaitingThreads() throws DebugException;
-
+
/**
- * Returns the threads which owns for the monitor associated to this object, or
- * <code>null</code> if no thread owns the monitor.
+ * Returns the threads which owns for the monitor associated to this object,
+ * or <code>null</code> if no thread owns the monitor.
*
* @return the thread which owns the monitor, or <code>null</code>.
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>The VM is not able to retrieve the monitor information</li>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>The VM is not able to retrieve the monitor information
+ * </li>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 3.1
*/
public IJavaThread getOwningThread() throws DebugException;
-
+
/**
* Returns objects that directly reference this object.
*
- * @param max the maximum number of references to retrieve or 0 for all references
+ * @param max
+ * the maximum number of references to retrieve or 0 for all
+ * references
* @return objects that directly reference this object
* @throws DebugException
- * @since 3.3
+ * if the request fails
+ * @since 3.3
*/
public IJavaObject[] getReferringObjects(long max) throws DebugException;
-
-
+
/**
- * Permits this object to be garbage collected. Has no effect if this
- * VM does not support enabling/disabling of garbage collection of
- * specific objects.
- *
- * @throws CoreException if request fails
+ * Permits this object to be garbage collected. Has no effect if this VM
+ * does not support enabling/disabling of garbage collection of specific
+ * objects.
+ *
+ * @throws DebugException
+ * if request fails
* @see IJavaDebugTarget
* @since 3.4
*/
public void enableCollection() throws DebugException;
-
+
/**
* Prevents this object from being garbage collected. Has no effect if this
* VM does not support enabling/disabling of garbage collection of specific
* objects.
- *
- * @throws CoreException if request fails
+ *
+ * @throws DebugException
+ * if request fails
* @see IJavaDebugTarget
* @since 3.4
- */
+ */
public void disableCollection() throws DebugException;
-
+
/**
* Returns the unique id for this object.
*
* @return unique id or -1 if this value is <code>null</code>
* @throws DebugException
+ * if the request fails
* @since 3.4
*/
public long getUniqueId() throws DebugException;
-
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPatternBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPatternBreakpoint.java
index 82ed90ee1..49ec0b3e5 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPatternBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPatternBreakpoint.java
@@ -10,42 +10,44 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
/**
* A line breakpoint installed in types associated with a specific source file
- * (based on source file name debug attribute) and whose fully
- * qualified name matches a specified pattern.
+ * (based on source file name debug attribute) and whose fully qualified name
+ * matches a specified pattern.
+ *
* @since 2.0
* @deprecated use <code>IJavaStratumLineBreakpoint</code> instead
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
+@Deprecated
public interface IJavaPatternBreakpoint extends IJavaLineBreakpoint {
/**
- * Returns the type name pattern this breakpoint uses to identify types
- * in which to install itself.
+ * Returns the type name pattern this breakpoint uses to identify types in
+ * which to install itself.
*
- * @return the type name pattern this breakpoint uses to identify types
- * in which to install itself
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @return the type name pattern this breakpoint uses to identify types in
+ * which to install itself
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public String getPattern() throws CoreException;
-
+
/**
- * Returns the source file name in which this breakpoint is set.
- * When this breakpoint specifies a source file name, this breakpoint is
- * only installed in types whose source file name debug attribute
- * match this value.
+ * Returns the source file name in which this breakpoint is set. When this
+ * breakpoint specifies a source file name, this breakpoint is only
+ * installed in types whose source file name debug attribute match this
+ * value.
*
* @return the source file name in which this breakpoint is set
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
- public String getSourceName() throws CoreException;
+ public String getSourceName() throws CoreException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPrimitiveValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPrimitiveValue.java
index 0b322656b..c0c3687b5 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPrimitiveValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPrimitiveValue.java
@@ -10,64 +10,64 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
/**
* A primitive value on a Java debug target.
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaPrimitiveValue extends IJavaValue {
-
+
/**
* Returns this value as a boolean.
*
* @return this value as a boolean
*/
public boolean getBooleanValue();
-
+
/**
* Returns this value as a byte
*
* @return this value as a byte
*/
public byte getByteValue();
-
+
/**
* Returns this value as a char
*
* @return this value as a char
*/
public char getCharValue();
-
+
/**
* Returns this value as a double
*
* @return this value as a double
*/
public double getDoubleValue();
-
+
/**
* Returns this value as a float
*
* @return this value as a float
*/
public float getFloatValue();
-
+
/**
* Returns this value as an int
*
* @return this value as an int
*/
public int getIntValue();
-
+
/**
* Returns this value as a long
*
* @return this value as a long
*/
public long getLongValue();
-
+
/**
* Returns this value as a short
*
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaReferenceType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaReferenceType.java
index efca6309d..3d96605e7 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaReferenceType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaReferenceType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,151 +15,180 @@ import org.eclipse.debug.core.DebugException;
/**
* Represents the type of an object in a virtual machine - including classes,
* interfaces and array types.
+ *
* @since 3.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaReferenceType extends IJavaType {
-
+
/**
- * Returns a variable representing the static field in this type
- * with the given name, or <code>null</code> if there is no
- * field with the given name, or the name is ambiguous.
+ * Returns a variable representing the static field in this type with the
+ * given name, or <code>null</code> if there is no field with the given
+ * name, or the name is ambiguous.
*
- * @param name field name
+ * @param name
+ * field name
* @return the variable representing the static field, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
- public IJavaFieldVariable getField(String name) throws DebugException;
-
+ public IJavaFieldVariable getField(String name) throws DebugException;
+
/**
* Returns the class object associated with this type.
*
* @return the class object associated with this type
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public IJavaClassObject getClassObject() throws DebugException;
-
+
/**
* Returns a collection of strata available for this type.
*
* @return a collection of strata available for this type
- * @throws DebugException if unable to retrieve available strata
+ * @throws DebugException
+ * if unable to retrieve available strata
*/
public String[] getAvailableStrata() throws DebugException;
-
+
/**
* Returns the default stratum for this type.
*
* @return the default stratum for this type
- * @throws DebugException if unable to retrieve the default stratum
+ * @throws DebugException
+ * if unable to retrieve the default stratum
*/
public String getDefaultStratum() throws DebugException;
-
+
/**
* Returns a collection of the names of the fields declared in this type.
*
* @return a collection of the names of the field declared in this type
- * @throws DebugException if unable to retrieve declared field names
+ * @throws DebugException
+ * if unable to retrieve declared field names
*/
public String[] getDeclaredFieldNames() throws DebugException;
-
+
/**
* Returns a collection of the names of all of the fields declared in this
- * type, all of its super classes, implemented interfaces and super interfaces.
+ * type, all of its super classes, implemented interfaces and super
+ * interfaces.
*
* @return a collection of the names of all of the fields declared in this
- * type, all of its super classes, implemented interfaces and super interfaces
- * @throws DebugException if unable to retrieve field names
+ * type, all of its super classes, implemented interfaces and super
+ * interfaces
+ * @throws DebugException
+ * if unable to retrieve field names
*/
public String[] getAllFieldNames() throws DebugException;
-
- /**
- * Returns the class loader object that loaded the class corresponding to this
- * type, or <code>null</code> if this type was loaded by the bootstrap loader.
- *
- * @return the class loader object that loaded the class corresponding to this
- * type or <code>null</code>
- * @throws DebugException
- * @since 3.1
- */
- public IJavaObject getClassLoaderObject() throws DebugException;
-
+
/**
- * Returns the generic signature as defined in the JVM
- * specification for this type.
- * Returns <code>null</code> if this type is not a generic type.
- *
- * @return signature, or <code>null</code> if generic signature not available
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li><ul>
+ * Returns the class loader object that loaded the class corresponding to
+ * this type, or <code>null</code> if this type was loaded by the bootstrap
+ * loader.
+ *
+ * @return the class loader object that loaded the class corresponding to
+ * this type or <code>null</code>
+ * @throws DebugException
+ * if unable to get the class loader
* @since 3.1
*/
- public String getGenericSignature() throws DebugException;
-
- /**
- * Returns the unqualified name of the source file corresponding to this type,
- * or <code>null</code> if source name debug attribute is not present.
- * The source name returned is based on this target's default stratum.
- *
- * @return unqualified source file name or <code>null</code>
- * @throws DebugException if an exception occurs retrieving the source name
- * @since 3.2
- */
- public String getSourceName() throws DebugException;
-
- /**
- * Returns the unqualified names of the source files corresponding to this type in
- * the specified stratum, or <code>null</code> if the source name debug attribute is
- * not present.
- *
- * @param stratum stratum identifier or <code>null</code> to use this type's default stratum
- * @return unqualified source file names or <code>null</code>
- * @throws DebugException if an exception occurs retrieving the source name
- * @since 3.2
- */
- public String[] getSourceNames(String stratum) throws DebugException;
-
- /**
- * Returns the qualified names of the source files corresponding to this type in
- * the specified stratum, or <code>null</code> if the source name debug attribute is
- * not present.
- *
- * @param stratum stratum identifier or <code>null</code> to use this type's default stratum
- * @return qualified source file names or <code>null</code>
- * @throws DebugException if an exception occurs retrieving the source name
- * @since 3.2
- */
- public String[] getSourcePaths(String stratum) throws DebugException;
-
- /**
- * Retrieves and returns instances of this reference type.
- *
- * @param max the maximum number of instances to retrieve or 0 to retrieve all instances
- * @return instances of this reference type
- * @throws DebugException on failure
- * @since 3.3
- */
- public IJavaObject[] getInstances(long max) throws DebugException;
-
- /**
- * Returns the number of instances of this type currently allocated in the target
- * virtual machine, or -1 if instance counts are not supported by the target.
- *
- * @return number of instances of this type, or -1 if unsupported
- * @throws DebugException on failure
- * @since 3.6
- */
- public long getInstanceCount() throws DebugException;
-
+ public IJavaObject getClassLoaderObject() throws DebugException;
+
+ /**
+ * Returns the generic signature as defined in the JVM specification for
+ * this type. Returns <code>null</code> if this type is not a generic type.
+ *
+ * @return signature, or <code>null</code> if generic signature not
+ * available
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <ul>
+ * @since 3.1
+ */
+ public String getGenericSignature() throws DebugException;
+
+ /**
+ * Returns the unqualified name of the source file corresponding to this
+ * type, or <code>null</code> if source name debug attribute is not present.
+ * The source name returned is based on this target's default stratum.
+ *
+ * @return unqualified source file name or <code>null</code>
+ * @throws DebugException
+ * if an exception occurs retrieving the source name
+ * @since 3.2
+ */
+ public String getSourceName() throws DebugException;
+
+ /**
+ * Returns the unqualified names of the source files corresponding to this
+ * type in the specified stratum, or <code>null</code> if the source name
+ * debug attribute is not present.
+ *
+ * @param stratum
+ * stratum identifier or <code>null</code> to use this type's
+ * default stratum
+ * @return unqualified source file names or <code>null</code>
+ * @throws DebugException
+ * if an exception occurs retrieving the source name
+ * @since 3.2
+ */
+ public String[] getSourceNames(String stratum) throws DebugException;
+
+ /**
+ * Returns the qualified names of the source files corresponding to this
+ * type in the specified stratum, or <code>null</code> if the source name
+ * debug attribute is not present.
+ *
+ * @param stratum
+ * stratum identifier or <code>null</code> to use this type's
+ * default stratum
+ * @return qualified source file names or <code>null</code>
+ * @throws DebugException
+ * if an exception occurs retrieving the source name
+ * @since 3.2
+ */
+ public String[] getSourcePaths(String stratum) throws DebugException;
+
+ /**
+ * Retrieves and returns instances of this reference type.
+ *
+ * @param max
+ * the maximum number of instances to retrieve or 0 to retrieve
+ * all instances
+ * @return instances of this reference type
+ * @throws DebugException
+ * on failure
+ * @since 3.3
+ */
+ public IJavaObject[] getInstances(long max) throws DebugException;
+
+ /**
+ * Returns the number of instances of this type currently allocated in the
+ * target virtual machine, or -1 if instance counts are not supported by the
+ * target.
+ *
+ * @return number of instances of this type, or -1 if unsupported
+ * @throws DebugException
+ * on failure
+ * @since 3.6
+ */
+ public long getInstanceCount() throws DebugException;
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStackFrame.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStackFrame.java
index b76536c9a..b66fb8528 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStackFrame.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStackFrame.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import java.util.List;
import org.eclipse.debug.core.DebugException;
@@ -24,453 +23,512 @@ import org.eclipse.debug.core.model.IStackFrame;
* Since 3.1, <code>IJavaStackFrame</code> also implements
* {@link org.eclipse.debug.core.model.IDropToFrame}.
* </p>
+ *
* @see org.eclipse.debug.core.model.IStackFrame
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-
-public interface IJavaStackFrame extends IStackFrame, IJavaModifiers, IFilteredStep, IDropToFrame {
+@SuppressWarnings("deprecation")
+public interface IJavaStackFrame extends IStackFrame, IJavaModifiers,
+ IFilteredStep, IDropToFrame {
/**
- * Status code indicating a stack frame is invalid. A stack frame becomes invalid
- * when the thread containing the stack frame resumes. A stack frame may or may
- * not be valid if the thread subsequently suspends, depending on the location
- * where the thread suspends.
+ * Status code indicating a stack frame is invalid. A stack frame becomes
+ * invalid when the thread containing the stack frame resumes. A stack frame
+ * may or may not be valid if the thread subsequently suspends, depending on
+ * the location where the thread suspends.
*
* @since 3.1
*/
public static final int ERR_INVALID_STACK_FRAME = 130;
-
+
/**
- * Returns whether this stack frame currently supports the drop
- * to frame operation. Note that not all VMs support the operation.
- *
+ * Returns whether this stack frame currently supports the drop to frame
+ * operation. Note that not all VMs support the operation.
+ *
* @return whether this stack frame currently supports drop to frame
- * @deprecated since 3.1, IJavaStackFrame extends org.eclipse.debug.core.IDropToFrame
- * which defines canDropToFrame(). Use this method instead.
+ * @deprecated since 3.1, IJavaStackFrame extends
+ * org.eclipse.debug.core.IDropToFrame which defines
+ * canDropToFrame(). Use this method instead.
*/
+ @Deprecated
boolean supportsDropToFrame();
+
/**
- * Returns whether the method associated with this stack frame
- * is a constructor.
+ * Returns whether the method associated with this stack frame is a
+ * constructor.
*
* @return whether this stack frame is associated with a constructor
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public boolean isConstructor() throws DebugException;
-
+
/**
- * Returns whether the method associated with this stack frame
- * has been declared as native.
+ * Returns whether the method associated with this stack frame has been
+ * declared as native.
*
* @return whether this stack frame has been declared as native
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public boolean isNative() throws DebugException;
+
/**
- * Returns whether the method associated with this stack frame
- * is a static initializer.
+ * Returns whether the method associated with this stack frame is a static
+ * initializer.
*
* @return whether this stack frame is a static initializer
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public boolean isStaticInitializer() throws DebugException;
+
/**
- * Returns whether the method associated with this stack frame
- * has been declared as synchronized.
- *
+ * Returns whether the method associated with this stack frame has been
+ * declared as synchronized.
+ *
* @return whether this stack frame has been declared as synchronized
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public boolean isSynchronized() throws DebugException;
+
/**
- * Returns whether the method associated with this stack frame
- * is running code in the VM that is out of synch with the code
- * in the workspace.
+ * Returns whether the method associated with this stack frame is running
+ * code in the VM that is out of synch with the code in the workspace.
*
* @return whether this stack frame is out of synch with the workspace.
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 2.0
*/
public boolean isOutOfSynch() throws DebugException;
+
/**
- * Returns whether the method associated with this stack frame is
- * obsolete, that is, it is running old byte codes that have been
- * replaced in the VM. This can occur when a hot code replace
- * succeeds but the VM is unable to pop a call to an affected
- * method from the call stack.
+ * Returns whether the method associated with this stack frame is obsolete,
+ * that is, it is running old byte codes that have been replaced in the VM.
+ * This can occur when a hot code replace succeeds but the VM is unable to
+ * pop a call to an affected method from the call stack.
+ *
* @return whether this stack frame's method is obsolete
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 2.0
*/
public boolean isObsolete() throws DebugException;
+
/**
* Returns the fully qualified name of the type that declares the method
* associated with this stack frame.
- *
+ *
* @return declaring type name
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public String getDeclaringTypeName() throws DebugException;
+
/**
* Returns the fully qualified name of the type that is the receiving object
* associated with this stack frame
- *
+ *
* @return receiving type name
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public String getReceivingTypeName() throws DebugException;
-
+
/**
- * Returns the JNI signature for the method this stack frame is associated with.
- *
+ * Returns the JNI signature for the method this stack frame is associated
+ * with.
+ *
* @return signature
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public String getSignature() throws DebugException;
-
+
/**
- * Returns a list of fully qualified type names of the arguments for the method
- * associated with this stack frame.
- *
- * @return argument type names, or an empty list if this method has no arguments
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * Returns a list of fully qualified type names of the arguments for the
+ * method associated with this stack frame.
+ *
+ * @return argument type names, or an empty list if this method has no
+ * arguments
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
- public List getArgumentTypeNames() throws DebugException;
-
+ public List<String> getArgumentTypeNames() throws DebugException;
+
/**
* Returns the name of the method associated with this stack frame
- *
+ *
* @return method name
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public String getMethodName() throws DebugException;
-
+
/**
- * Returns the local, static, or "this" variable with the given
- * name, or <code>null</code> if unable to resolve a variable with the name.
- *
- * @param variableName the name of the variable to search for
+ * Returns the local, static, or "this" variable with the given name, or
+ * <code>null</code> if unable to resolve a variable with the name.
+ *
+ * @param variableName
+ * the name of the variable to search for
* @return a variable, or <code>null</code> if none
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
- public IJavaVariable findVariable(String variableName) throws DebugException;
-
+ public IJavaVariable findVariable(String variableName)
+ throws DebugException;
+
/**
- * Returns the line number of the instruction pointer in
- * this stack frame that corresponds to the line in the associated source
- * element in the specified stratum, or <code>-1</code> if line number
- * information is unavailable.
- *
- * @param stratum the stratum to use.
- * @return line number of instruction pointer in this stack frame, or
- * <code>-1</code> if line number information is unavailable
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the debug target. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * Returns the line number of the instruction pointer in this stack frame
+ * that corresponds to the line in the associated source element in the
+ * specified stratum, or <code>-1</code> if line number information is
+ * unavailable.
+ *
+ * @param stratum
+ * the stratum to use.
+ * @return line number of instruction pointer in this stack frame, or
+ * <code>-1</code> if line number information is unavailable
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the debug target. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*
* @since 3.0
*/
public int getLineNumber(String stratum) throws DebugException;
-
+
/**
* Returns the source name debug attribute associated with the declaring
* type of this stack frame, or <code>null</code> if the source name debug
* attribute not present.
*
* @return source name debug attribute, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public String getSourceName() throws DebugException;
-
+
/**
* Returns the source name debug attribute associated with the declaring
* type of this stack frame in the specified stratum, or <code>null</code>
* if the source name debug attribute not present.
*
- * @param stratum the stratum to use.
+ * @param stratum
+ * the stratum to use.
* @return source name debug attribute, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*
* @since 3.0
*/
public String getSourceName(String stratum) throws DebugException;
-
+
/**
- * Returns the source path debug attribute associated with
- * this stack frame in the specified stratum, or
- * <code>null</code> if the source path is not known.
+ * Returns the source path debug attribute associated with this stack frame
+ * in the specified stratum, or <code>null</code> if the source path is not
+ * known.
*
- * @param stratum the stratum to use.
+ * @param stratum
+ * the stratum to use.
* @return source path debug attribute, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 3.0
*/
public String getSourcePath(String stratum) throws DebugException;
-
+
/**
- * Returns the source path debug attribute associated with
- * this stack frame, or <code>null</code> if the source path
- * is not known.
+ * Returns the source path debug attribute associated with this stack frame,
+ * or <code>null</code> if the source path is not known.
*
* @return source path debug attribute, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 3.0
*/
- public String getSourcePath() throws DebugException;
-
+ public String getSourcePath() throws DebugException;
+
/**
- * Returns a collection of local variables that are visible
- * at the current point of execution in this stack frame. The
- * list includes arguments.
+ * Returns a collection of local variables that are visible at the current
+ * point of execution in this stack frame. The list includes arguments.
*
* @return collection of locals and arguments
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 2.0
*/
public IJavaVariable[] getLocalVariables() throws DebugException;
-
+
/**
- * Returns a reference to the receiver of the method associated
- * with this stack frame, or <code>null</code> if this stack frame
- * represents a static method.
+ * Returns a reference to the receiver of the method associated with this
+ * stack frame, or <code>null</code> if this stack frame represents a static
+ * method.
*
* @return 'this' object, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
*/
public IJavaObject getThis() throws DebugException;
-
+
/**
- * Returns the class in which this stack frame's method is
- * declared.
+ * Returns the class in which this stack frame's method is declared.
*
- * @return the class in which this stack frame's method is
- * declared
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @return the class in which this stack frame's method is declared
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 2.0
- * @deprecated Use <code>getReferenceType()</code> instead, as a method is not
- * restricted to occur in a class. An interface may contain a synthetic
- * class initializer methods. Since 3.1, this method throws a
- * <code>DebugException</code> when a stack frame's method is contained
- * in an interface.
+ * @deprecated Use <code>getReferenceType()</code> instead, as a method is
+ * not restricted to occur in a class. An interface may contain
+ * a synthetic class initializer methods. Since 3.1, this method
+ * throws a <code>DebugException</code> when a stack frame's
+ * method is contained in an interface.
*/
- public IJavaClassType getDeclaringType() throws DebugException;
-
+ @Deprecated
+ public IJavaClassType getDeclaringType() throws DebugException;
+
/**
- * Returns the type in which this stack frame's method is
- * declared.
+ * Returns the type in which this stack frame's method is declared.
*
- * @return the type in which this stack frame's method is
- * declared
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @return the type in which this stack frame's method is declared
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 3.1
*/
- public IJavaReferenceType getReferenceType() throws DebugException;
-
+ public IJavaReferenceType getReferenceType() throws DebugException;
+
/**
- * Returns whether local variable information was available
- * when local variables were retrieved from the target for this
- * frame. Returns <code>true</code> if locals have never been
- * retrieved. This data is available after the fact, since variable
- * retrieval is expensive.
+ * Returns whether local variable information was available when local
+ * variables were retrieved from the target for this frame. Returns
+ * <code>true</code> if locals have never been retrieved. This data is
+ * available after the fact, since variable retrieval is expensive.
*
- * @return whether local variable information was available
- * when variables were retrieved from the target. Returns
- * <code>true</code> if locals have never been retrieved
+ * @return whether local variable information was available when variables
+ * were retrieved from the target. Returns <code>true</code> if
+ * locals have never been retrieved
*
* @since 2.0
*/
public boolean wereLocalsAvailable();
-
+
/**
- * Returns whether the method associated with this stack frame accepts
- * a variable number of arguments.
+ * Returns whether the method associated with this stack frame accepts a
+ * variable number of arguments.
*
- * @return <code>true</code> if the method associated with this stack
- * frame accepts a variable number of arguments, <code>false</code> otherwise.
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This stack frame is no longer valid. That is, the thread
- * containing this stack frame has since been resumed.</li>
- * </ul>
+ * @return <code>true</code> if the method associated with this stack frame
+ * accepts a variable number of arguments, <code>false</code>
+ * otherwise.
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This stack frame is no longer valid. That is, the
+ * thread containing this stack frame has since been resumed.
+ * </li>
+ * </ul>
* @since 3.1
*/
public boolean isVarArgs() throws DebugException;
-
+
/**
- * Returns whether this frame currently supports a force return operation. That is,
- * can this method force a return before it reaches a return statement. Not all VMs
- * support this feature.
+ * Returns whether this frame currently supports a force return operation.
+ * That is, can this method force a return before it reaches a return
+ * statement. Not all VMs support this feature.
* <p>
* Force return is only available when a thread is suspended.
* </p>
+ *
* @return whether force return can be performed currently
* @since 3.3
*/
public boolean canForceReturn();
-
+
/**
- * Steps out of this frame's method returning the given value. No further instructions
- * in the method are executed but locks acquired by entering synchronized blocks are released.
- * The following conditions must be satisfied:
+ * Steps out of this frame's method returning the given value. No further
+ * instructions in the method are executed but locks acquired by entering
+ * synchronized blocks are released. The following conditions must be
+ * satisfied:
* <ul>
* <li>This frame must be suspended in a non-native method.</li>
- * <li>The return value must be assignment compatible with this frame's method's
- * return type. Use a void value when a method return type is void
+ * <li>The return value must be assignment compatible with this frame's
+ * method's return type. Use a void value when a method return type is void
* (see <code>IJavaDebugTarget.voidValue()</code>).</li>
* </ul>
*
- * @param value return value that must be assignment compatible with this frame's
- * method's return value
- * @throws DebugException if the operation fails
+ * @param value
+ * return value that must be assignment compatible with this
+ * frame's method's return value
+ * @throws DebugException
+ * if the operation fails
* @since 3.3
*/
- public void forceReturn(IJavaValue value) throws DebugException;
+ public void forceReturn(IJavaValue value) throws DebugException;
}
-
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStratumLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStratumLineBreakpoint.java
index e193f2900..fd2d6a57a 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStratumLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaStratumLineBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,12 +10,12 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
/**
- * A line breakpoint identified by its source file name and/or path, and
- * stratum that it is relative to.
+ * A line breakpoint identified by its source file name and/or path, and stratum
+ * that it is relative to.
+ *
* @since 3.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
@@ -23,58 +23,62 @@ import org.eclipse.core.runtime.CoreException;
public interface IJavaStratumLineBreakpoint extends IJavaLineBreakpoint {
/**
- * Returns the type name pattern this breakpoint uses to identify types
- * in which to install itself. Patterns may begin or end with '*'. Will
- * not return <code>null</code>. In the case that a stratum breakpoint
- * was created with a <code>null</code> pattern, "*" is returned.
+ * Returns the type name pattern this breakpoint uses to identify types in
+ * which to install itself. Patterns may begin or end with '*'. Will not
+ * return <code>null</code>. In the case that a stratum breakpoint was
+ * created with a <code>null</code> pattern, "*" is returned.
* <p>
- * Multiple patterns can be specified in this breakpoint by delimiting
- * the patterns with a comma - e.g. "x.y.z,a.b.c".
+ * Multiple patterns can be specified in this breakpoint by delimiting the
+ * patterns with a comma - e.g. "x.y.z,a.b.c".
* </p>
- * @return the type name patterns this breakpoint uses to identify types
- * in which to install itself.
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ *
+ * @return the type name patterns this breakpoint uses to identify types in
+ * which to install itself.
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public String getPattern() throws CoreException;
-
+
/**
- * Returns the simple name of the source file in which this breakpoint
- * is set, or <code>null</code>. When this breakpoint specifies a
- * source file name, this breakpoint is only installed in types whose
- * source file name debug attribute matches this value, relative
- * to this breakpoint's stratum.
+ * Returns the simple name of the source file in which this breakpoint is
+ * set, or <code>null</code>. When this breakpoint specifies a source file
+ * name, this breakpoint is only installed in types whose source file name
+ * debug attribute matches this value, relative to this breakpoint's
+ * stratum.
*
* @return the source file name in which this breakpoint is set, or
- * <code>null</code>
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * <code>null</code>
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
public String getSourceName() throws CoreException;
-
+
/**
- * Returns the stratum that this breakpoint's source name, source path,
- * and line number are relative to, or <code>null</code> if this breakpoint
- * is relative to a type's default stratum.
- *
- * @return the stratum that this breakpoint's source name, source path,
- * and line number are relative to, or <code>null</code>
- * @throws CoreException if unable to access the property from this
- * breakpoint's underlying marker
+ * Returns the stratum that this breakpoint's source name, source path, and
+ * line number are relative to, or <code>null</code> if this breakpoint is
+ * relative to a type's default stratum.
+ *
+ * @return the stratum that this breakpoint's source name, source path, and
+ * line number are relative to, or <code>null</code>
+ * @throws CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
- public String getStratum() throws CoreException;
-
+ public String getStratum() throws CoreException;
+
/**
* Returns the qualified source file path in which this breakpoint is set,
- * or <code>null</code>. When specified, this breakpoint is
- * only installed in types whose source file path debug attribute
- * matches this value, relative to this breakpoint's stratum.
+ * or <code>null</code>. When specified, this breakpoint is only installed
+ * in types whose source file path debug attribute matches this value,
+ * relative to this breakpoint's stratum.
*
* @return the qualified source file path in which this breakpoint is set,
- * or <code>null</code>
+ * or <code>null</code>
* @throws CoreException
+ * if unable to get the source path
*/
public String getSourcePath() throws CoreException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaTargetPatternBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaTargetPatternBreakpoint.java
index bf40e3a3c..c319ebd86 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaTargetPatternBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaTargetPatternBreakpoint.java
@@ -10,17 +10,16 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
/**
* A line breakpoint installed in types associated with a specific source file
- * (based on source file name debug attribute) and whose fully
- * qualified name matches a specified pattern per target.
- * The {target, type name pattern} pairs are not persisted with this breakpoint, as
- * targets are transient. Clients that use this type of breakpoint are intended
- * to be breakpoint listeners that set a pattern per target as each breakpoint
- * is added to a target.
+ * (based on source file name debug attribute) and whose fully qualified name
+ * matches a specified pattern per target. The {target, type name pattern} pairs
+ * are not persisted with this breakpoint, as targets are transient. Clients
+ * that use this type of breakpoint are intended to be breakpoint listeners that
+ * set a pattern per target as each breakpoint is added to a target.
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpointListener
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
@@ -29,35 +28,40 @@ import org.eclipse.core.runtime.CoreException;
public interface IJavaTargetPatternBreakpoint extends IJavaLineBreakpoint {
/**
- * Returns the type name pattern this breakpoint uses to identify types
- * in which to install itself in the given target
+ * Returns the type name pattern this breakpoint uses to identify types in
+ * which to install itself in the given target
*
- * @param target debug target
- * @return the type name pattern this breakpoint uses to identify types
- * in which to install itself in the given target
+ * @param target
+ * debug target
+ * @return the type name pattern this breakpoint uses to identify types in
+ * which to install itself in the given target
*/
public String getPattern(IJavaDebugTarget target);
-
- /**
- * Sets the type name pattern this breakpoint uses to identify types
- * in which to install itself in the given target
+
+ /**
+ * Sets the type name pattern this breakpoint uses to identify types in
+ * which to install itself in the given target
*
- * @param target debug target
- * @param pattern type name pattern
- * @exception CoreException if changing the pattern for this breakpoint fails
+ * @param target
+ * debug target
+ * @param pattern
+ * type name pattern
+ * @exception CoreException
+ * if changing the pattern for this breakpoint fails
*/
- public void setPattern(IJavaDebugTarget target, String pattern) throws CoreException;
+ public void setPattern(IJavaDebugTarget target, String pattern)
+ throws CoreException;
/**
- * Returns the source file name in which this breakpoint is set.
- * When this breakpoint specifies a source file name, this breakpoint is
- * only installed in types whose source file name debug attribute
- * match this value.
+ * Returns the source file name in which this breakpoint is set. When this
+ * breakpoint specifies a source file name, this breakpoint is only
+ * installed in types whose source file name debug attribute match this
+ * value.
*
* @return the source file name in which this breakpoint is set
- * @exception CoreException if unable to access the property from
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property from this breakpoint's
+ * underlying marker
*/
- public String getSourceName() throws CoreException;
+ public String getSourceName() throws CoreException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThread.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThread.java
index 048386f32..601f5183b 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThread.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThread.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IFilteredStep;
@@ -18,265 +17,298 @@ import org.eclipse.debug.core.model.IThread;
/**
* A thread in a Java virtual machine.
+ *
* @see org.eclipse.debug.core.model.IThread
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
+@SuppressWarnings("deprecation")
public interface IJavaThread extends IThread, IFilteredStep {
-
+
/**
- * Status code indicating a request failed because a thread
- * was not suspended.
+ * Status code indicating a request failed because a thread was not
+ * suspended.
*/
public static final int ERR_THREAD_NOT_SUSPENDED = 100;
-
+
/**
- * Status code indicating a request to perform a message send
- * failed because a thread was already performing a message send.
+ * Status code indicating a request to perform a message send failed because
+ * a thread was already performing a message send.
*
- * @see IJavaObject#sendMessage(String, String, IJavaValue[], IJavaThread, boolean)
- * @see IJavaClassType#sendMessage(String, String, IJavaValue[], IJavaThread)
+ * @see IJavaObject#sendMessage(String, String, IJavaValue[], IJavaThread,
+ * boolean)
+ * @see IJavaClassType#sendMessage(String, String, IJavaValue[],
+ * IJavaThread)
* @see IJavaClassType#newInstance(String, IJavaValue[], IJavaThread)
*/
- public static final int ERR_NESTED_METHOD_INVOCATION = 101;
+ public static final int ERR_NESTED_METHOD_INVOCATION = 101;
/**
- * Status code indicating a request to perform a message send
- * failed because a thread was not suspended by a step or
- * breakpoint event. When a thread is suspended explicitly via
- * the <code>suspend()</code> method, it is not able to perform
- * method invocations (this is a JDI limitation).
+ * Status code indicating a request to perform a message send failed because
+ * a thread was not suspended by a step or breakpoint event. When a thread
+ * is suspended explicitly via the <code>suspend()</code> method, it is not
+ * able to perform method invocations (this is a JDI limitation).
*
- * @see IJavaObject#sendMessage(String, String, IJavaValue[], IJavaThread, boolean)
- * @see IJavaClassType#sendMessage(String, String, IJavaValue[], IJavaThread)
+ * @see IJavaObject#sendMessage(String, String, IJavaValue[], IJavaThread,
+ * boolean)
+ * @see IJavaClassType#sendMessage(String, String, IJavaValue[],
+ * IJavaThread)
* @see IJavaClassType#newInstance(String, IJavaValue[], IJavaThread)
*/
public static final int ERR_INCOMPATIBLE_THREAD_STATE = 102;
-
+
/**
* Returns whether this thread is a system thread.
- *
+ *
* @return whether this thread is a system thread
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
boolean isSystemThread() throws DebugException;
+
/**
- * Returns whether any of the stack frames associated with this thread
- * are running code in the VM that is out of synch with the code
- * in the workspace.
+ * Returns whether any of the stack frames associated with this thread are
+ * running code in the VM that is out of synch with the code in the
+ * workspace.
*
* @return whether this thread is out of synch with the workspace.
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
* @since 2.0
*/
boolean isOutOfSynch() throws DebugException;
+
/**
- * Returns whether this thread may be running code in the VM that
- * is out of synch with the code in the workspace.
+ * Returns whether this thread may be running code in the VM that is out of
+ * synch with the code in the workspace.
*
* @return whether this thread may be out of synch with the workspace.
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
* @since 2.0
*/
- boolean mayBeOutOfSynch() throws DebugException;
+ boolean mayBeOutOfSynch() throws DebugException;
+
/**
- * Returns whether this thread is currently performing
- * an evaluation.
+ * Returns whether this thread is currently performing an evaluation.
*
- * @return whether this thread is currently performing
- * an evaluation
+ * @return whether this thread is currently performing an evaluation
* @since 2.0
*/
boolean isPerformingEvaluation();
+
/**
- * Returns the name of the thread group this thread belongs to,
- * or <code>null</code> if none.
- *
+ * Returns the name of the thread group this thread belongs to, or
+ * <code>null</code> if none.
+ *
* @return thread group name, or <code>null</code> if none
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
String getThreadGroupName() throws DebugException;
-
+
/**
- * Returns a variable with the given name, or <code>null</code> if
- * unable to resolve a variable with the name, or if this
- * thread is not currently suspended.
+ * Returns a variable with the given name, or <code>null</code> if unable to
+ * resolve a variable with the name, or if this thread is not currently
+ * suspended.
* <p>
- * Variable lookup works only when a thread is suspended.
- * Lookup is performed in all stack frames, in a top-down
- * order, returning the first successful match, or <code>null</code>
- * if no match is found.
+ * Variable lookup works only when a thread is suspended. Lookup is
+ * performed in all stack frames, in a top-down order, returning the first
+ * successful match, or <code>null</code> if no match is found.
* </p>
- * @param variableName the name of the variable to search for
+ *
+ * @param variableName
+ * the name of the variable to search for
* @return a variable, or <code>null</code> if none
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
IJavaVariable findVariable(String variableName) throws DebugException;
-
+
/**
- * Invokes the given evaluation with the specified progress
- * monitor. This thread fires a resume event
- * when the evaluation begins, and a suspend event when the evaluation
- * completes or throws an exception. The events are given a detail
- * as specified by <code>evaluationDetail</code> (one of
+ * Invokes the given evaluation with the specified progress monitor. This
+ * thread fires a resume event when the evaluation begins, and a suspend
+ * event when the evaluation completes or throws an exception. The events
+ * are given a detail as specified by <code>evaluationDetail</code> (one of
* <code>DebugEvent.EVALUATION</code> or
* <code>DebugEvent.EVALUATION_IMPLICIT</code>).
* <p>
- * Since 3.5, the <code>org.eclipse.jdt.debug.breakpointListeners</code> extension
- * point supports evaluation execution during a listener call back. Suspend and
- * resume events are not fired during listener call backs. Unspecified model specific
- * events are fired.
+ * Since 3.5, the <code>org.eclipse.jdt.debug.breakpointListeners</code>
+ * extension point supports evaluation execution during a listener call
+ * back. Suspend and resume events are not fired during listener call backs.
+ * Unspecified model specific events are fired.
* </p>
- * @param evaluation the evaluation to perform
- * @param monitor progress monitor (may be <code>null</code>
- * @param evaluationDetail one of <code>DebugEvent.EVALUATION</code> or
- * <code>DebugEvent.EVALUATION_IMPLICIT</code>
- * @param hitBreakpoints whether or not breakpoints should be honored
- * in this thread during the evaluation. If <code>false</code>, breakpoints
- * hit in this thread during the evaluation will be ignored.
- * @exception DebugException if an exception occurs performing
- * the evaluation
+ *
+ * @param evaluation
+ * the evaluation to perform
+ * @param monitor
+ * progress monitor (may be <code>null</code>
+ * @param evaluationDetail
+ * one of <code>DebugEvent.EVALUATION</code> or
+ * <code>DebugEvent.EVALUATION_IMPLICIT</code>
+ * @param hitBreakpoints
+ * whether or not breakpoints should be honored in this thread
+ * during the evaluation. If <code>false</code>, breakpoints hit
+ * in this thread during the evaluation will be ignored.
+ * @exception DebugException
+ * if an exception occurs performing the evaluation
* @since 2.0
*/
- public void runEvaluation(IEvaluationRunnable evaluation, IProgressMonitor monitor, int evaluationDetail, boolean hitBreakpoints) throws DebugException;
+ public void runEvaluation(IEvaluationRunnable evaluation,
+ IProgressMonitor monitor, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException;
/**
- * Queues the given runnable with the list of runnables associated with this thread.
- * Runnables are executed asynchronously in a separate thread. This method should be
- * used to execute any code which performs an operation like a method invocation.
+ * Queues the given runnable with the list of runnables associated with this
+ * thread. Runnables are executed asynchronously in a separate thread. This
+ * method should be used to execute any code which performs an operation
+ * like a method invocation.
*
- * @param runnable the runnable to execute.
+ * @param runnable
+ * the runnable to execute.
* @since 2.1
- */
- public void queueRunnable(Runnable runnable);
+ */
+ public void queueRunnable(Runnable runnable);
/**
- * Attempts to terminate the currently executing <code>IEvaluationRunnable</code>
- * in this thread, if any.
+ * Attempts to terminate the currently executing
+ * <code>IEvaluationRunnable</code> in this thread, if any.
*
- * Evaluations may be composed of a series of instructions.
- * Terminating an evaluation means stopping the evaluation after
- * the current instruction completes. A single instruction (such as a method invocation)
- * cannot be interrupted.
+ * Evaluations may be composed of a series of instructions. Terminating an
+ * evaluation means stopping the evaluation after the current instruction
+ * completes. A single instruction (such as a method invocation) cannot be
+ * interrupted.
*
- * @exception DebugException if an exception occurs while
- * terminating the evaluation.
+ * @exception DebugException
+ * if an exception occurs while terminating the evaluation.
* @since 2.1
*/
public void terminateEvaluation() throws DebugException;
+
/**
* Returns whether the currently executing <code>IEvaluationRunnable</code>
- * supports termination. An IEvaluationRunnable supports termination
- * if it implements <code>ITerminate</code>
+ * supports termination. An IEvaluationRunnable supports termination if it
+ * implements <code>ITerminate</code>
*
* @return whether the current evaluation supports termination
* @since 2.1
*/
public boolean canTerminateEvaluation();
-
+
/**
- * Returns a Java object for the monitor for
- * which this thread is currently waiting or <code>null</code>.
- *
- * @return IJavaObject the contended monitor object or <code>null</code> if this
- * thread is not waiting on a monitor.
- * @exception DebugException if an exception occurs while
- * retrieving the contended monitor.
+ * Returns a Java object for the monitor for which this thread is currently
+ * waiting or <code>null</code>.
+ *
+ * @return IJavaObject the contended monitor object or <code>null</code> if
+ * this thread is not waiting on a monitor.
+ * @exception DebugException
+ * if an exception occurs while retrieving the contended
+ * monitor.
* @since 2.1
*/
public IJavaObject getContendedMonitor() throws DebugException;
-
+
/**
- * Returns the monitors owned by this thread or <code>null</code>
- * if this thread owns no monitors.
+ * Returns the monitors owned by this thread or <code>null</code> if this
+ * thread owns no monitors.
*
* @return the owned monitors
- * @exception DebugException if an exception occurs while retrieving
- * the owned monitors of this thread.
+ * @exception DebugException
+ * if an exception occurs while retrieving the owned monitors
+ * of this thread.
* @since 2.1
*/
public IJavaObject[] getOwnedMonitors() throws DebugException;
-
+
/**
* Returns whether this threads owns at least one monitor.
*
* @return boolean whether this thread owns a monitor
- * @exception DebugException if an exception occurs determining
- * if there are owned monitors.
+ * @exception DebugException
+ * if an exception occurs determining if there are owned
+ * monitors.
* @since 2.1
*/
public boolean hasOwnedMonitors() throws DebugException;
-
+
/**
* Request to stops this thread with the given exception.<br>
- * The result will be the same as calling java.lang.Thread#stop(java.lang.Throwable).<br>
+ * The result will be the same as calling
+ * java.lang.Thread#stop(java.lang.Throwable).<br>
* If the thread is suspended when the method is called, the thread must be
* resumed to complete the action.<br>
*
* <em>exception</em> must represent an exception.
*
- * @param exception the exception to throw.
+ * @param exception
+ * the exception to throw.
* @exception DebugException
+ * if the request fails
* @since 3.0
* @see java.lang.Thread#stop(java.lang.Throwable)
*/
public void stop(IJavaObject exception) throws DebugException;
-
+
/**
- * Returns the thread group this thread belongs to or <code>null</code> if none.
+ * Returns the thread group this thread belongs to or <code>null</code> if
+ * none.
*
* @return thread group or <code>null</code>
* @throws DebugException
+ * if the thread group cannot be computed
* @since 3.2
*/
public IJavaThreadGroup getThreadGroup() throws DebugException;
-
+
/**
* Returns whether this thread is a daemon thread.
*
* @return whether this thread is a daemon thread
- * @throws DebugException if an exception occurs while determining status
+ * @throws DebugException
+ * if an exception occurs while determining status
* @since 3.3
*/
public boolean isDaemon() throws DebugException;
-
+
/**
* Returns the number of frames in this thread.
*
* @return number of stack frames
- * @throws DebugException if an exception occurs while retrieving the count
+ * @throws DebugException
+ * if an exception occurs while retrieving the count
* @since 3.3
*/
public int getFrameCount() throws DebugException;
-
+
/**
* Returns the object reference associated with this thread.
*
- * @return thread object reference
- * @throws DebugException if unable to retrieve an object reference
+ * @return thread object reference
+ * @throws DebugException
+ * if unable to retrieve an object reference
* @since 3.6
*/
public IJavaObject getThreadObject() throws DebugException;
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThreadGroup.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThreadGroup.java
index bc146f1ea..612eebeb5 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThreadGroup.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaThreadGroup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,53 +23,59 @@ import org.eclipse.debug.core.model.IDebugElement;
public interface IJavaThreadGroup extends IDebugElement {
/**
- * Returns the threads in this thread group. Does not include
- * threads in subgroups.
+ * Returns the threads in this thread group. Does not include threads in
+ * subgroups.
*
* @return threads in this group
* @throws DebugException
+ * if the request fails
*/
public IJavaThread[] getThreads() throws DebugException;
-
+
/**
* Returns whether this group contains any threads.
*
* @return whether this group contains any threads
* @throws DebugException
+ * if the request fails
*/
public boolean hasThreads() throws DebugException;
-
+
/**
- * Returns the thread group this thread group is contained in or <code>null</code>
- * if none.
+ * Returns the thread group this thread group is contained in or
+ * <code>null</code> if none.
*
* @return parent thread group or <code>null</code>
* @throws DebugException
+ * if the request fails
*/
public IJavaThreadGroup getThreadGroup() throws DebugException;
-
+
/**
* Returns whether this thread group contains subgroups.
*
* @return whether this thread group contains subgroups
* @throws DebugException
+ * if the request fails
*/
public boolean hasThreadGroups() throws DebugException;
-
+
/**
- * Returns immediate thread groups contained in this thread. Does not include
- * subgroups of immediate groups.
+ * Returns immediate thread groups contained in this thread. Does not
+ * include subgroups of immediate groups.
*
* @return thread groups contained in this group
* @throws DebugException
+ * if the request fails
*/
public IJavaThreadGroup[] getThreadGroups() throws DebugException;
-
+
/**
* Returns the name of this thread group.
*
* @return thread group name
* @throws DebugException
+ * if the request fails
*/
public String getName() throws DebugException;
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaType.java
index 6992cc013..95c08c2ca 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaType.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IDebugElement;
-
+
/**
- * The type of a value on a Java debug target - a primitive
- * data type, class, interface, or array.
+ * The type of a value on a Java debug target - a primitive data type, class,
+ * interface, or array.
* <p>
* Since 3.2, an <code>IJavaType</code> is also a debug element
* </p>
+ *
* @see IJavaValue
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
@@ -27,24 +27,30 @@ import org.eclipse.debug.core.model.IDebugElement;
public interface IJavaType extends IDebugElement {
/**
* Returns the JNI-style signature for this type.
- *
+ *
* @return signature
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public String getSignature() throws DebugException;
-
+
/**
- * Returns the name of this type. For example, <code>"java.lang.String"</code>.
+ * Returns the name of this type. For example,
+ * <code>"java.lang.String"</code>.
*
* @return the name of this type
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
public String getName() throws DebugException;
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaValue.java
index 67ab1264b..3620ba216 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,65 +10,73 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IValue;
/**
* An object, primitive data type, or array, on a Java virtual machine.
+ *
* @see org.eclipse.debug.core.model.IValue
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaValue extends IValue {
/**
- * Returns the JNI-style signature for the type of this
- * value, or <code>null</code> if the value is <code>null</code>.
- *
+ * Returns the JNI-style signature for the type of this value, or
+ * <code>null</code> if the value is <code>null</code>.
+ *
* @return signature, or <code>null</code> if signature is <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The type associated with the signature is not yet loaded</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The type associated with the signature is not yet
+ * loaded</li>
+ * </ul>
*/
public String getSignature() throws DebugException;
-
+
/**
- * Returns the generic signature as defined in the JVM
- * specification for the type of this value.
- * Returns <code>null</code> if the value is <code>null</code>,
- * or if the type of this value is not a generic type.
- *
- * @return signature, or <code>null</code> if generic signature not available
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The type associated with the signature is not yet loaded</li></ul>
+ * Returns the generic signature as defined in the JVM specification for the
+ * type of this value. Returns <code>null</code> if the value is
+ * <code>null</code>, or if the type of this value is not a generic type.
+ *
+ * @return signature, or <code>null</code> if generic signature not
+ * available
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The type associated with the signature is not yet
+ * loaded</li>
+ * </ul>
* @since 3.1
*/
public String getGenericSignature() throws DebugException;
-
+
/**
- * Returns the type of this value, or <code>null</code>
- * if this value represents the <code>null</code> value
+ * Returns the type of this value, or <code>null</code> if this value
+ * represents the <code>null</code> value
*
- * @return the type of this value, or <code>null</code>
- * if this value represents the <code>null</code> value
+ * @return the type of this value, or <code>null</code> if this value
+ * represents the <code>null</code> value
+ * @throws DebugException
+ * if the request fails
*
* @since 2.0
*/
public IJavaType getJavaType() throws DebugException;
-
+
/**
* Returns whether this value represents <code>null</code>.
- *
+ *
* @return whether this value represents <code>null</code>
* @since 3.5
*/
public boolean isNull();
-
-}
-
+}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaVariable.java
index 15d7b475d..7ca8eb21d 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaVariable.java
@@ -10,75 +10,87 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IVariable;
/**
* A local variable, field slot, or receiver (this) in a Java virtual machine.
+ *
* @see org.eclipse.debug.core.model.IVariable
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
public interface IJavaVariable extends IVariable, IJavaModifiers {
-
+
/**
- * Returns the JNI-style signature for the declared type of this
- * variable, or <code>null</code> if the type associated with the
- * signature is not yet loaded in the target VM.
- *
+ * Returns the JNI-style signature for the declared type of this variable,
+ * or <code>null</code> if the type associated with the signature is not yet
+ * loaded in the target VM.
+ *
* @return signature, or <code>null</code> if not accessible
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The type associated with the signature is not yet loaded</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The type associated with the signature is not yet
+ * loaded</li>
+ * </ul>
*/
public String getSignature() throws DebugException;
-
+
/**
- * Returns the generic signature as defined in the JVM
- * specification for the declared type of this variable,
- * or <code>null</code> if the type associated with the
- * signature is not yet loaded in the target VM.
- * Returns the same value as #getSignature() if the declared type
- * of this variable is not a generic type.
- *
+ * Returns the generic signature as defined in the JVM specification for the
+ * declared type of this variable, or <code>null</code> if the type
+ * associated with the signature is not yet loaded in the target VM. Returns
+ * the same value as #getSignature() if the declared type of this variable
+ * is not a generic type.
+ *
* @return generic signature, or <code>null</code> if not accessible
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The type associated with the signature is not yet loaded</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The type associated with the signature is not yet
+ * loaded</li>
+ * </ul>
* @since 3.1
*/
public String getGenericSignature() throws DebugException;
-
+
/**
* Returns the declared type of this variable.
*
* @return the declared type of this variable
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The type associated with the signature is not yet loaded</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The type associated with the signature is not yet
+ * loaded</li>
+ * </ul>
* @since 2.0
*/
- public IJavaType getJavaType() throws DebugException;
-
+ public IJavaType getJavaType() throws DebugException;
+
/**
* Returns whether this variable is local.
*
* @return whether this variable is a local variable
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
* @since 2.1
*/
public boolean isLocal() throws DebugException;
-
-}
-
+}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaWatchpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaWatchpoint.java
index 9bfd379ad..70cb9234c 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaWatchpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaWatchpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,42 +10,46 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IWatchpoint;
/**
- * A breakpoint on a field. If a watchpoint is an access watchpoint,
- * it will suspend execution when its field is accessed. If a watchpoint
- * is a modification watchpoint, it will suspend execution when its field
- * is modified.
+ * A breakpoint on a field. If a watchpoint is an access watchpoint, it will
+ * suspend execution when its field is accessed. If a watchpoint is a
+ * modification watchpoint, it will suspend execution when its field is
+ * modified.
* <p>
* Since 3.1, <code>IJavaWatchpoint</code> also implements
* {@link org.eclipse.debug.core.model.IWatchpoint}.
* </p>
+ *
* @since 2.0
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface IJavaWatchpoint extends IJavaLineBreakpoint, IWatchpoint {
+public interface IJavaWatchpoint extends IJavaLineBreakpoint, IWatchpoint {
/**
* Returns the name of the field associated with this watchpoint
*
* @return field the name of the field on which this watchpoint is installed
- * @exception CoreException if unable to access the property on
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if unable to access the property on this breakpoint's
+ * underlying marker
*/
- public String getFieldName() throws CoreException;
+ public String getFieldName() throws CoreException;
+
/**
- * Returns whether this breakpoint last suspended in this target due to an access
- * (<code>true</code>) or modification (<code>false</code>).
+ * Returns whether this breakpoint last suspended in this target due to an
+ * access (<code>true</code>) or modification (<code>false</code>).
+ *
+ * @param target
+ * the debug target
*
* @return <code>true</code> if this watchpoint last suspended the given
- * target due to a field access; <code>false</code> if this watchpoint last
- * suspended the given target due to a modification access or if this
- * watchpoint hasn't suspended the given target.
+ * target due to a field access; <code>false</code> if this
+ * watchpoint last suspended the given target due to a modification
+ * access or if this watchpoint hasn't suspended the given target.
*/
public boolean isAccessSuspend(IDebugTarget target);
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/JDIDebugModel.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/JDIDebugModel.java
index a8b617f79..56fbdcd37 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/JDIDebugModel.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/JDIDebugModel.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.debug.core;
-
import java.util.HashMap;
import java.util.Map;
@@ -21,6 +20,8 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
import org.eclipse.debug.core.ILaunch;
@@ -38,6 +39,7 @@ import org.eclipse.jdt.internal.debug.core.breakpoints.JavaStratumLineBreakpoint
import org.eclipse.jdt.internal.debug.core.breakpoints.JavaTargetPatternBreakpoint;
import org.eclipse.jdt.internal.debug.core.breakpoints.JavaWatchpoint;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
+import org.osgi.service.prefs.BackingStoreException;
import com.sun.jdi.VirtualMachine;
@@ -45,119 +47,140 @@ import com.sun.jdi.VirtualMachine;
* Provides utility methods for creating debug targets and breakpoints specific
* to the JDI debug model.
* <p>
- * To provide access to behavior and information specific to the JDI
- * debug model, a set of interfaces are defined which extend the base
- * set of debug element interfaces. For example, <code>IJavaStackFrame</code>
- * is declared to extend <code>IStackFrame</code>, and provides methods
- * specific to this debug model. The specialized interfaces are also
- * available as adapters from the debug elements generated from this
- * model.
+ * To provide access to behavior and information specific to the JDI debug
+ * model, a set of interfaces are defined which extend the base set of debug
+ * element interfaces. For example, <code>IJavaStackFrame</code> is declared to
+ * extend <code>IStackFrame</code>, and provides methods specific to this debug
+ * model. The specialized interfaces are also available as adapters from the
+ * debug elements generated from this model.
* </p>
* <p>
* This class provides static utility methods only.
* </p>
+ *
* @noinstantiate This class is not intended to be instantiated by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
public class JDIDebugModel {
-
+
/**
* Preference key for default JDI request timeout value.
*/
- public static final String PREF_REQUEST_TIMEOUT = getPluginIdentifier() + ".PREF_REQUEST_TIMEOUT"; //$NON-NLS-1$
-
+ public static final String PREF_REQUEST_TIMEOUT = getPluginIdentifier()
+ + ".PREF_REQUEST_TIMEOUT"; //$NON-NLS-1$
+
/**
* Preference key for specifying if hot code replace should be performed
* when a replacement class file contains compilation errors.
*/
- public static final String PREF_HCR_WITH_COMPILATION_ERRORS= getPluginIdentifier() + ".PREF_HCR_WITH_COMPILATION_ERRORS"; //$NON-NLS-1$
-
+ public static final String PREF_HCR_WITH_COMPILATION_ERRORS = getPluginIdentifier()
+ + ".PREF_HCR_WITH_COMPILATION_ERRORS"; //$NON-NLS-1$
+
/**
* The default JDI request timeout when no preference is set.
*/
public static final int DEF_REQUEST_TIMEOUT = 3000;
-
+
/**
- * Boolean preference controlling whether breakpoints are
- * hit during an evaluation operation.
- * If true, breakpoints will be hit as usual during evaluations.
- * If false, the breakpoint manager will be automatically disabled
- * during evaluations.
+ * Boolean preference controlling whether breakpoints are hit during an
+ * evaluation operation. If true, breakpoints will be hit as usual during
+ * evaluations. If false, the breakpoint manager will be automatically
+ * disabled during evaluations.
*
* @since 3.0
*/
- public static final String PREF_SUSPEND_FOR_BREAKPOINTS_DURING_EVALUATION = getPluginIdentifier() + ".suspend_for_breakpoints_during_evaluation"; //$NON-NLS-1$
-
+ public static final String PREF_SUSPEND_FOR_BREAKPOINTS_DURING_EVALUATION = getPluginIdentifier()
+ + ".suspend_for_breakpoints_during_evaluation"; //$NON-NLS-1$
+
/**
* Not to be instantiated.
*/
private JDIDebugModel() {
super();
}
-
+
/**
- * Creates and returns a debug target for the given VM, with
- * the specified name, and associates the debug target with the
- * given process for console I/O. The allow terminate flag specifies whether
- * the debug target will support termination (<code>ITerminate</code>).
- * The allow disconnect flag specifies whether the debug target will
- * support disconnection (<code>IDisconnect</code>). Launching the actual
- * VM is a client responsibility. By default, the target VM will be
- * resumed on startup.
- * The debug target is added to the given launch.
- *
- * @param launch the launch the new debug target will be contained in
- * @param vm the VM to create a debug target for
- * @param name the name to associate with the VM, which will be
- * returned from <code>IDebugTarget.getName</code>. If <code>null</code>
- * the name will be retrieved from the underlying VM.
- * @param process the process to associate with the debug target,
- * which will be returned from <code>IDebugTarget.getProcess</code>
- * @param allowTerminate whether the target will support termination
- * @param allowDisconnect whether the target will support disconnection
+ * Creates and returns a debug target for the given VM, with the specified
+ * name, and associates the debug target with the given process for console
+ * I/O. The allow terminate flag specifies whether the debug target will
+ * support termination (<code>ITerminate</code>). The allow disconnect flag
+ * specifies whether the debug target will support disconnection (
+ * <code>IDisconnect</code>). Launching the actual VM is a client
+ * responsibility. By default, the target VM will be resumed on startup. The
+ * debug target is added to the given launch.
+ *
+ * @param launch
+ * the launch the new debug target will be contained in
+ * @param vm
+ * the VM to create a debug target for
+ * @param name
+ * the name to associate with the VM, which will be returned from
+ * <code>IDebugTarget.getName</code>. If <code>null</code> the
+ * name will be retrieved from the underlying VM.
+ * @param process
+ * the process to associate with the debug target, which will be
+ * returned from <code>IDebugTarget.getProcess</code>
+ * @param allowTerminate
+ * whether the target will support termination
+ * @param allowDisconnect
+ * whether the target will support disconnection
* @return a debug target
* @see org.eclipse.debug.core.model.ITerminate
* @see org.eclipse.debug.core.model.IDisconnect
* @since 2.0
*/
- public static IDebugTarget newDebugTarget(ILaunch launch, VirtualMachine vm, String name, IProcess process, boolean allowTerminate, boolean allowDisconnect) {
- return newDebugTarget(launch, vm, name, process, allowTerminate, allowDisconnect, true);
+ public static IDebugTarget newDebugTarget(ILaunch launch,
+ VirtualMachine vm, String name, IProcess process,
+ boolean allowTerminate, boolean allowDisconnect) {
+ return newDebugTarget(launch, vm, name, process, allowTerminate,
+ allowDisconnect, true);
}
/**
- * Creates and returns a debug target for the given VM, with
- * the specified name, and associates the debug target with the
- * given process for console I/O. The allow terminate flag specifies whether
- * the debug target will support termination (<code>ITerminate</code>).
- * The allow disconnect flag specifies whether the debug target will
- * support disconnection (<code>IDisconnect</code>). The resume
- * flag specifies if the target VM should be resumed on startup (has
- * no effect if the VM was already running when the connection to the
- * VM was established). Launching the actual VM is a client responsibility.
- * The debug target is added to the given launch.
- *
- * @param launch the launch the new debug target will be contained in
- * @param vm the VM to create a debug target for
- * @param name the name to associate with the VM, which will be
- * returned from <code>IDebugTarget.getName</code>. If <code>null</code>
- * the name will be retrieved from the underlying VM.
- * @param process the process to associate with the debug target,
- * which will be returned from <code>IDebugTarget.getProcess</code>
- * @param allowTerminate whether the target will support termination
- * @param allowDisconnect whether the target will support disconnection
- * @param resume whether the target is to be resumed on startup. Has
- * no effect if the target was already running when the connection
- * to the VM was established.
+ * Creates and returns a debug target for the given VM, with the specified
+ * name, and associates the debug target with the given process for console
+ * I/O. The allow terminate flag specifies whether the debug target will
+ * support termination (<code>ITerminate</code>). The allow disconnect flag
+ * specifies whether the debug target will support disconnection (
+ * <code>IDisconnect</code>). The resume flag specifies if the target VM
+ * should be resumed on startup (has no effect if the VM was already running
+ * when the connection to the VM was established). Launching the actual VM
+ * is a client responsibility. The debug target is added to the given
+ * launch.
+ *
+ * @param launch
+ * the launch the new debug target will be contained in
+ * @param vm
+ * the VM to create a debug target for
+ * @param name
+ * the name to associate with the VM, which will be returned from
+ * <code>IDebugTarget.getName</code>. If <code>null</code> the
+ * name will be retrieved from the underlying VM.
+ * @param process
+ * the process to associate with the debug target, which will be
+ * returned from <code>IDebugTarget.getProcess</code>
+ * @param allowTerminate
+ * whether the target will support termination
+ * @param allowDisconnect
+ * whether the target will support disconnection
+ * @param resume
+ * whether the target is to be resumed on startup. Has no effect
+ * if the target was already running when the connection to the
+ * VM was established.
* @return a debug target
* @see org.eclipse.debug.core.model.ITerminate
* @see org.eclipse.debug.core.model.IDisconnect
* @since 2.0
*/
- public static IDebugTarget newDebugTarget(final ILaunch launch, final VirtualMachine vm, final String name, final IProcess process, final boolean allowTerminate, final boolean allowDisconnect, final boolean resume) {
+ public static IDebugTarget newDebugTarget(final ILaunch launch,
+ final VirtualMachine vm, final String name, final IProcess process,
+ final boolean allowTerminate, final boolean allowDisconnect,
+ final boolean resume) {
final IJavaDebugTarget[] target = new IJavaDebugTarget[1];
IWorkspaceRunnable r = new IWorkspaceRunnable() {
public void run(IProgressMonitor m) {
- target[0]= new JDIDebugTarget(launch, vm, name, allowTerminate, allowDisconnect, process, resume);
+ target[0] = new JDIDebugTarget(launch, vm, name,
+ allowTerminate, allowDisconnect, process, resume);
}
};
try {
@@ -167,428 +190,623 @@ public class JDIDebugModel {
}
return target[0];
}
-
+
/**
* Returns the identifier for the JDI debug model plug-in
- *
+ *
* @return plug-in identifier
*/
public static String getPluginIdentifier() {
return JDIDebugPlugin.getUniqueIdentifier();
}
-
+
/**
* Registers the given listener for hot code replace notifications. Has no
* effect if an identical listener is already registered.
* <p>
- * Note that since 3.6, if an {@link IJavaDebugTarget} has hot code replace listeners
- * registered with it directly, listeners registered with this class are not notified
- * of hot code replace events for that target. This allows a target to have custom
- * hot code replace notification behavior.
+ * Note that since 3.6, if an {@link IJavaDebugTarget} has hot code replace
+ * listeners registered with it directly, listeners registered with this
+ * class are not notified of hot code replace events for that target. This
+ * allows a target to have custom hot code replace notification behavior.
* </p>
- * @param listener hot code replace listener
+ *
+ * @param listener
+ * hot code replace listener
* @see IJavaHotCodeReplaceListener
* @see IJavaDebugTarget#addHotCodeReplaceListener(IJavaHotCodeReplaceListener)
* @since 2.0
*/
- public static void addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
+ public static void addHotCodeReplaceListener(
+ IJavaHotCodeReplaceListener listener) {
JDIDebugPlugin.getDefault().addHotCodeReplaceListener(listener);
}
-
+
/**
* Unregisters the given listener for hot code replace notifications. Has no
* effect if an identical listener is not already registered.
*
- * @param listener hot code replace listener
+ * @param listener
+ * hot code replace listener
* @see IJavaHotCodeReplaceListener
* @since 2.0
*/
- public static void removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
+ public static void removeHotCodeReplaceListener(
+ IJavaHotCodeReplaceListener listener) {
JDIDebugPlugin.getDefault().removeHotCodeReplaceListener(listener);
}
-
+
/**
- * Registers the given listener for breakpoint notifications. Has no
- * effect if an identical listener is already registered.
+ * Registers the given listener for breakpoint notifications. Has no effect
+ * if an identical listener is already registered.
*
- * @param listener breakpoint listener
+ * @param listener
+ * breakpoint listener
* @see IJavaBreakpointListener
* @since 2.0
*/
- public static void addJavaBreakpointListener(IJavaBreakpointListener listener) {
+ public static void addJavaBreakpointListener(
+ IJavaBreakpointListener listener) {
JDIDebugPlugin.getDefault().addJavaBreakpointListener(listener);
- }
+ }
/**
* Unregisters the given listener for breakpoint notifications. Has no
* effect if an identical listener is not already registered.
*
- * @param listener breakpoint listener
+ * @param listener
+ * breakpoint listener
* @see IJavaBreakpointListener
* @since 2.0
*/
- public static void removeJavaBreakpointListener(IJavaBreakpointListener listener) {
+ public static void removeJavaBreakpointListener(
+ IJavaBreakpointListener listener) {
JDIDebugPlugin.getDefault().removeJavaBreakpointListener(listener);
- }
-
-
+ }
+
/**
- * Creates and returns a line breakpoint in the type with the
- * given name, at the given line number. The marker associated with the
- * breakpoint will be created on the specified resource. If a character
- * range within the line is known, it may be specified by charStart/charEnd.
- * If hitCount is > 0, the breakpoint will suspend execution when it is
- * "hit" the specified number of times.
+ * Creates and returns a line breakpoint in the type with the given name, at
+ * the given line number. The marker associated with the breakpoint will be
+ * created on the specified resource. If a character range within the line
+ * is known, it may be specified by charStart/charEnd. If hitCount is > 0,
+ * the breakpoint will suspend execution when it is "hit" the specified
+ * number of times.
*
- * @param resource the resource on which to create the associated breakpoint
- * marker
- * @param typeName the fully qualified name of the type the breakpoint is
- * to be installed in. If the breakpoint is to be installed in an inner type,
- * it is sufficient to provide the name of the top level enclosing type.
- * If an inner class name is specified, it should be formatted as the
- * associated class file name (i.e. with <code>$</code>). For example,
- * <code>example.SomeClass$InnerType</code>, could be specified, but
- * <code>example.SomeClass</code> is sufficient.
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param typeName
+ * the fully qualified name of the type the breakpoint is to be
+ * installed in. If the breakpoint is to be installed in an inner
+ * type, it is sufficient to provide the name of the top level
+ * enclosing type. If an inner class name is specified, it should
+ * be formatted as the associated class file name (i.e. with
+ * <code>$</code>). For example,
+ * <code>example.SomeClass$InnerType</code>, could be specified,
+ * but <code>example.SomeClass</code> is sufficient.
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file in which the
+ * breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a line breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @since 2.0
*/
- public static IJavaLineBreakpoint createLineBreakpoint(IResource resource, String typeName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException {
+ public static IJavaLineBreakpoint createLineBreakpoint(IResource resource,
+ String typeName, int lineNumber, int charStart, int charEnd,
+ int hitCount, boolean register, Map<String, Object> attributes)
+ throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
- }
- return new JavaLineBreakpoint(resource, typeName, lineNumber, charStart, charEnd, hitCount, register, attributes);
+ attributes = new HashMap<String, Object>(10);
+ }
+ return new JavaLineBreakpoint(resource, typeName, lineNumber,
+ charStart, charEnd, hitCount, register, attributes);
}
-
+
/**
* Creates and returns a pattern breakpoint for the given resource at the
- * given line number, which is installed in all classes whose fully
- * qualified name matches the given pattern.
- * If hitCount > 0, the breakpoint will suspend execution when it is
- * "hit" the specified number of times.
+ * given line number, which is installed in all classes whose fully
+ * qualified name matches the given pattern. If hitCount > 0, the breakpoint
+ * will suspend execution when it is "hit" the specified number of times.
*
- * @param resource the resource on which to create the associated breakpoint
- * marker
- * @param sourceName the name of the source file in which the breakpoint is
- * set, or <code>null</code>. When specified, the pattern breakpoint will
- * install itself in classes that have a source file name debug attribute
- * that matches this value, and satisfies the class name pattern.
- * @param pattern the class name pattern in which the pattern breakpoint should
- * be installed. The pattern breakpoint will install itself in every class which
- * matches the pattern.
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param sourceName
+ * the name of the source file in which the breakpoint is set, or
+ * <code>null</code>. When specified, the pattern breakpoint will
+ * install itself in classes that have a source file name debug
+ * attribute that matches this value, and satisfies the class
+ * name pattern.
+ * @param pattern
+ * the class name pattern in which the pattern breakpoint should
+ * be installed. The pattern breakpoint will install itself in
+ * every class which matches the pattern.
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file in which the
+ * breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a pattern breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @deprecated use <code>createStratumBreakpoint</code> instead
*/
- public static IJavaPatternBreakpoint createPatternBreakpoint(IResource resource, String sourceName, String pattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException {
+ @Deprecated
+ public static IJavaPatternBreakpoint createPatternBreakpoint(
+ IResource resource, String sourceName, String pattern,
+ int lineNumber, int charStart, int charEnd, int hitCount,
+ boolean register, Map<String, Object> attributes) throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
- }
- return new JavaPatternBreakpoint(resource, sourceName, pattern, lineNumber, charStart, charEnd, hitCount, register, attributes);
- }
-
+ attributes = new HashMap<String, Object>(10);
+ }
+ return new JavaPatternBreakpoint(resource, sourceName, pattern,
+ lineNumber, charStart, charEnd, hitCount, register, attributes);
+ }
+
/**
- * Creates and returns a line breakpoint identified by its source file
- * name and/or path, and stratum that it is relative to.
+ * Creates and returns a line breakpoint identified by its source file name
+ * and/or path, and stratum that it is relative to.
*
- * @param resource the resource on which to create the associated breakpoint
- * marker
- * @param stratum the stratum in which the source name, source path and line number
- * are relative, or <code>null</code>. If <code>null</code> or if the specified stratum
- * is not defined for a type, the source name, source path and line number are
- * relative to the type's default stratum.
- * @param sourceName the simple name of the source file in which the breakpoint is
- * set, or <code>null</code>. The breakpoint will install itself in classes that have a source
- * file name debug attribute that matches this value in the specified stratum,
- * and satisfies the class name pattern and source path attribute. When <code>null</code>,
- * the source file name debug attribute is not considered.
- * @param sourcePath the qualified source file name in which the breakpoint is
- * set, or <code>null</code>. The breakpoint will install itself in classes that
- * have a source file path in the specified stratum that matches this value, and
- * satisfies the class name pattern and source name attribute. When <code>null</code>,
- * the source path attribute is not considered.
- * @param classNamePattern the class name pattern to which the breakpoint should
- * be restricted, or <code>null</code>. The breakpoint will install itself in each type that
- * matches this class name pattern, with a satisfying source name and source path.
- * Patterns may begin or end with '*', which matches 0 or more characters. A pattern that
- * does not contain a '*' is equivalent to a pattern ending in '*'. Specifying <code>null</code>,
- * or an empty string is the equivalent to "*". Multiple patterns can be specified
- * by delimiting the patterns with a comma - e.g. "x.y.z,a.b.c". When multiple patterns
- * are specified, The breakpoint will install itself in each of the types that
- * match any of the specified class pattern, with a satisfying source name and source path.
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file (stratum) in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param stratum
+ * the stratum in which the source name, source path and line
+ * number are relative, or <code>null</code>. If
+ * <code>null</code> or if the specified stratum is not defined
+ * for a type, the source name, source path and line number are
+ * relative to the type's default stratum.
+ * @param sourceName
+ * the simple name of the source file in which the breakpoint is
+ * set, or <code>null</code>. The breakpoint will install itself
+ * in classes that have a source file name debug attribute that
+ * matches this value in the specified stratum, and satisfies the
+ * class name pattern and source path attribute. When
+ * <code>null</code>, the source file name debug attribute is not
+ * considered.
+ * @param sourcePath
+ * the qualified source file name in which the breakpoint is set,
+ * or <code>null</code>. The breakpoint will install itself in
+ * classes that have a source file path in the specified stratum
+ * that matches this value, and satisfies the class name pattern
+ * and source name attribute. When <code>null</code>, the source
+ * path attribute is not considered.
+ * @param classNamePattern
+ * the class name pattern to which the breakpoint should be
+ * restricted, or <code>null</code>. The breakpoint will install
+ * itself in each type that matches this class name pattern, with
+ * a satisfying source name and source path. Patterns may begin
+ * or end with '*', which matches 0 or more characters. A pattern
+ * that does not contain a '*' is equivalent to a pattern ending
+ * in '*'. Specifying <code>null</code>, or an empty string is
+ * the equivalent to "*". Multiple patterns can be specified by
+ * delimiting the patterns with a comma - e.g. "x.y.z,a.b.c".
+ * When multiple patterns are specified, The breakpoint will
+ * install itself in each of the types that match any of the
+ * specified class pattern, with a satisfying source name and
+ * source path.
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file (stratum) in
+ * which the breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a stratum breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @since 3.0
*/
- public static IJavaStratumLineBreakpoint createStratumBreakpoint(IResource resource, String stratum, String sourceName, String sourcePath, String classNamePattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException {
+ public static IJavaStratumLineBreakpoint createStratumBreakpoint(
+ IResource resource, String stratum, String sourceName,
+ String sourcePath, String classNamePattern, int lineNumber,
+ int charStart, int charEnd, int hitCount, boolean register,
+ Map<String, Object> attributes) throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
- }
- return new JavaStratumLineBreakpoint(resource, stratum, sourceName, sourcePath, classNamePattern, lineNumber, charStart, charEnd, hitCount, register, attributes);
- }
-
+ attributes = new HashMap<String, Object>(10);
+ }
+ return new JavaStratumLineBreakpoint(resource, stratum, sourceName,
+ sourcePath, classNamePattern, lineNumber, charStart, charEnd,
+ hitCount, register, attributes);
+ }
+
/**
- * Creates and returns a target pattern breakpoint for the given resource at the
- * given line number. Clients must set the class name pattern per target for
- * this type of breakpoint.
- * If hitCount > 0, the breakpoint will suspend execution when it is
- * "hit" the specified number of times.
+ * Creates and returns a target pattern breakpoint for the given resource at
+ * the given line number. Clients must set the class name pattern per target
+ * for this type of breakpoint. If hitCount > 0, the breakpoint will suspend
+ * execution when it is "hit" the specified number of times.
*
- * @param resource the resource on which to create the associated breakpoint
- * marker
- * @param sourceName the name of the source file in which the breakpoint is
- * set, or <code>null</code>. When specified, the pattern breakpoint will
- * install itself in classes that have a source file name debug attribute
- * that matches this value, and satisfies the class name pattern.
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param sourceName
+ * the name of the source file in which the breakpoint is set, or
+ * <code>null</code>. When specified, the pattern breakpoint will
+ * install itself in classes that have a source file name debug
+ * attribute that matches this value, and satisfies the class
+ * name pattern.
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file in which the
+ * breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a target pattern breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
*/
- public static IJavaTargetPatternBreakpoint createTargetPatternBreakpoint(IResource resource, String sourceName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException {
+ public static IJavaTargetPatternBreakpoint createTargetPatternBreakpoint(
+ IResource resource, String sourceName, int lineNumber,
+ int charStart, int charEnd, int hitCount, boolean register,
+ Map<String, Object> attributes) throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
- }
- return new JavaTargetPatternBreakpoint(resource, sourceName, lineNumber, charStart, charEnd, hitCount, register, attributes);
- }
-
+ attributes = new HashMap<String, Object>(10);
+ }
+ return new JavaTargetPatternBreakpoint(resource, sourceName,
+ lineNumber, charStart, charEnd, hitCount, register, attributes);
+ }
+
/**
- * Creates and returns an exception breakpoint for an exception with the given name.
- * The marker associated with the breakpoint will be created on the specified resource.
- * Caught and uncaught specify where the exception
- * should cause thread suspensions - that is, in caught and/or uncaught locations.
- * Checked indicates if the given exception is a checked exception.
+ * Creates and returns an exception breakpoint for an exception with the
+ * given name. The marker associated with the breakpoint will be created on
+ * the specified resource. Caught and uncaught specify where the exception
+ * should cause thread suspensions - that is, in caught and/or uncaught
+ * locations. Checked indicates if the given exception is a checked
+ * exception.
*
- * @param resource the resource on which to create the associated
- * breakpoint marker
- * @param exceptionName the fully qualified name of the exception for
- * which to create the breakpoint
- * @param caught whether to suspend in caught locations
- * @param uncaught whether to suspend in uncaught locations
- * @param checked whether the exception is a checked exception (i.e. compiler
- * detected)
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param exceptionName
+ * the fully qualified name of the exception for which to create
+ * the breakpoint
+ * @param caught
+ * whether to suspend in caught locations
+ * @param uncaught
+ * whether to suspend in uncaught locations
+ * @param checked
+ * whether the exception is a checked exception (i.e. compiler
+ * detected)
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation or
+ * <code>null</code> if none.
* @return an exception breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @since 2.0
*/
- public static IJavaExceptionBreakpoint createExceptionBreakpoint(IResource resource, String exceptionName, boolean caught, boolean uncaught, boolean checked, boolean register, Map attributes) throws CoreException {
+ public static IJavaExceptionBreakpoint createExceptionBreakpoint(
+ IResource resource, String exceptionName, boolean caught,
+ boolean uncaught, boolean checked, boolean register, Map<String, Object> attributes)
+ throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
+ attributes = new HashMap<String, Object>(10);
}
- return new JavaExceptionBreakpoint(resource, exceptionName, caught, uncaught, checked, register, attributes);
+ return new JavaExceptionBreakpoint(resource, exceptionName, caught,
+ uncaught, checked, register, attributes);
}
/**
- * Creates and returns a watchpoint on a field with the given name
- * in a type with the given name.
- * The marker associated with the breakpoint will be created on the specified resource.
- * If hitCount > 0, the breakpoint will suspend execution when it is
- * "hit" the specified number of times.
+ * Creates and returns a watchpoint on a field with the given name in a type
+ * with the given name. The marker associated with the breakpoint will be
+ * created on the specified resource. If hitCount > 0, the breakpoint will
+ * suspend execution when it is "hit" the specified number of times.
*
- * @param resource the resource on which to create the associated breakpoint
- * marker
- * @param typeName the fully qualified name of the type the breakpoint is
- * to be installed in. If the breakpoint is to be installed in an inner type,
- * it is sufficient to provide the name of the top level enclosing type.
- * If an inner class name is specified, it should be formatted as the
- * associated class file name (i.e. with <code>$</code>). For example,
- * <code>example.SomeClass$InnerType</code>, could be specified, but
- * <code>example.SomeClass</code> is sufficient.
- * @param fieldName the name of the field on which to suspend (on access or modification)
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param typeName
+ * the fully qualified name of the type the breakpoint is to be
+ * installed in. If the breakpoint is to be installed in an inner
+ * type, it is sufficient to provide the name of the top level
+ * enclosing type. If an inner class name is specified, it should
+ * be formatted as the associated class file name (i.e. with
+ * <code>$</code>). For example,
+ * <code>example.SomeClass$InnerType</code>, could be specified,
+ * but <code>example.SomeClass</code> is sufficient.
+ * @param fieldName
+ * the name of the field on which to suspend (on access or
+ * modification)
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file in which the
+ * breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a watchpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The CoreException's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The
+ * CoreException's status contains the underlying exception
+ * responsible for the failure.</li>
+ * </ul>
* @since 2.0
*/
- public static IJavaWatchpoint createWatchpoint(IResource resource, String typeName, String fieldName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException {
+ public static IJavaWatchpoint createWatchpoint(IResource resource,
+ String typeName, String fieldName, int lineNumber, int charStart,
+ int charEnd, int hitCount, boolean register, Map<String, Object> attributes)
+ throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
- }
- return new JavaWatchpoint(resource, typeName, fieldName, lineNumber, charStart, charEnd, hitCount, register, attributes);
+ attributes = new HashMap<String, Object>(10);
+ }
+ return new JavaWatchpoint(resource, typeName, fieldName, lineNumber,
+ charStart, charEnd, hitCount, register, attributes);
}
-
+
/**
- * Creates and returns a method breakpoint with the specified
- * criteria.
- *
- * @param resource the resource on which to create the associated
- * breakpoint marker
- * @param typePattern the pattern specifying the fully qualified name of type(s)
- * this breakpoint suspends execution in. Patterns are limited to exact
- * matches and patterns that begin or end with '*'.
- * @param methodName the name of the method(s) this breakpoint suspends
- * execution in, or <code>null</code> if this breakpoint does
- * not suspend execution based on method name
- * @param methodSignature the signature of the method(s) this breakpoint suspends
- * execution in, or <code>null</code> if this breakpoint does not
- * suspend execution based on method signature
- * @param entry whether this breakpoint causes execution to suspend
- * on entry of methods
- * @param exit whether this breakpoint causes execution to suspend
- * on exit of methods
- * @param nativeOnly whether this breakpoint causes execution to suspend
- * on entry/exit of native methods only
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * Creates and returns a method breakpoint with the specified criteria.
+ *
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param typePattern
+ * the pattern specifying the fully qualified name of type(s)
+ * this breakpoint suspends execution in. Patterns are limited to
+ * exact matches and patterns that begin or end with '*'.
+ * @param methodName
+ * the name of the method(s) this breakpoint suspends execution
+ * in, or <code>null</code> if this breakpoint does not suspend
+ * execution based on method name
+ * @param methodSignature
+ * the signature of the method(s) this breakpoint suspends
+ * execution in, or <code>null</code> if this breakpoint does not
+ * suspend execution based on method signature
+ * @param entry
+ * whether this breakpoint causes execution to suspend on entry
+ * of methods
+ * @param exit
+ * whether this breakpoint causes execution to suspend on exit of
+ * methods
+ * @param nativeOnly
+ * whether this breakpoint causes execution to suspend on
+ * entry/exit of native methods only
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file in which the
+ * breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a method breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @since 2.0
*/
- public static IJavaMethodBreakpoint createMethodBreakpoint(IResource resource, String typePattern, String methodName, String methodSignature, boolean entry, boolean exit, boolean nativeOnly, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException {
+ public static IJavaMethodBreakpoint createMethodBreakpoint(
+ IResource resource, String typePattern, String methodName,
+ String methodSignature, boolean entry, boolean exit,
+ boolean nativeOnly, int lineNumber, int charStart, int charEnd,
+ int hitCount, boolean register, Map<String, Object> attributes)
+ throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
+ attributes = new HashMap<String, Object>(10);
}
- return new JavaMethodBreakpoint(resource, typePattern, methodName, methodSignature, entry, exit, nativeOnly, lineNumber, charStart, charEnd, hitCount, register, attributes);
+ return new JavaMethodBreakpoint(resource, typePattern, methodName,
+ methodSignature, entry, exit, nativeOnly, lineNumber,
+ charStart, charEnd, hitCount, register, attributes);
}
-
+
/**
* Creates and returns a method entry breakpoint with the specified
* criteria. A method entry breakpoint will only be installed for methods
- * that have executable code (i.e. will not work for native methods).
- *
- * @param resource the resource on which to create the associated
- * breakpoint marker
- * @param typeName the fully qualified name of type
- * this breakpoint suspends execution in.
- * @param methodName the name of the method this breakpoint suspends
- * execution in
- * @param methodSignature the signature of the method this breakpoint suspends
- * execution in
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * that have executable code (i.e. will not work for native methods).
+ *
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param typeName
+ * the fully qualified name of type this breakpoint suspends
+ * execution in.
+ * @param methodName
+ * the name of the method this breakpoint suspends execution in
+ * @param methodSignature
+ * the signature of the method this breakpoint suspends execution
+ * in
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file in which the
+ * breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a method entry breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @since 2.0
*/
- public static IJavaMethodEntryBreakpoint createMethodEntryBreakpoint(IResource resource, String typeName, String methodName, String methodSignature, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException {
+ public static IJavaMethodEntryBreakpoint createMethodEntryBreakpoint(
+ IResource resource, String typeName, String methodName,
+ String methodSignature, int lineNumber, int charStart, int charEnd,
+ int hitCount, boolean register, Map<String, Object> attributes)
+ throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
+ attributes = new HashMap<String, Object>(10);
}
- return new JavaMethodEntryBreakpoint(resource, typeName, methodName, methodSignature, lineNumber, charStart, charEnd, hitCount, register, attributes);
- }
-
+ return new JavaMethodEntryBreakpoint(resource, typeName, methodName,
+ methodSignature, lineNumber, charStart, charEnd, hitCount,
+ register, attributes);
+ }
+
/**
- * Returns a Java line breakpoint that is already registered with the breakpoint
- * manager for a type with the given name at the given line number.
+ * Returns a Java line breakpoint that is already registered with the
+ * breakpoint manager for a type with the given name at the given line
+ * number.
*
- * @param typeName fully qualified type name
- * @param lineNumber line number
- * @return a Java line breakpoint that is already registered with the breakpoint
- * manager for a type with the given name at the given line number or <code>null</code>
- * if no such breakpoint is registered
- * @exception CoreException if unable to retrieve the associated marker
- * attributes (line number).
+ * @param typeName
+ * fully qualified type name
+ * @param lineNumber
+ * line number
+ * @return a Java line breakpoint that is already registered with the
+ * breakpoint manager for a type with the given name at the given
+ * line number or <code>null</code> if no such breakpoint is
+ * registered
+ * @exception CoreException
+ * if unable to retrieve the associated marker attributes
+ * (line number).
*/
- public static IJavaLineBreakpoint lineBreakpointExists(String typeName, int lineNumber) throws CoreException {
- String modelId= getPluginIdentifier();
- String markerType= JavaLineBreakpoint.getMarkerType();
- IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
- IBreakpoint[] breakpoints= manager.getBreakpoints(modelId);
+ public static IJavaLineBreakpoint lineBreakpointExists(String typeName,
+ int lineNumber) throws CoreException {
+ String modelId = getPluginIdentifier();
+ String markerType = JavaLineBreakpoint.getMarkerType();
+ IBreakpointManager manager = DebugPlugin.getDefault()
+ .getBreakpointManager();
+ IBreakpoint[] breakpoints = manager.getBreakpoints(modelId);
for (int i = 0; i < breakpoints.length; i++) {
if (!(breakpoints[i] instanceof IJavaLineBreakpoint)) {
continue;
}
IJavaLineBreakpoint breakpoint = (IJavaLineBreakpoint) breakpoints[i];
IMarker marker = breakpoint.getMarker();
- if (marker != null && marker.exists() && marker.getType().equals(markerType)) {
+ if (marker != null && marker.exists()
+ && marker.getType().equals(markerType)) {
String breakpointTypeName = breakpoint.getTypeName();
- if (breakpointTypeName.equals(typeName) || breakpointTypeName.startsWith(typeName + '$')) {
+ if (breakpointTypeName.equals(typeName)
+ || breakpointTypeName.startsWith(typeName + '$')) {
if (breakpoint.getLineNumber() == lineNumber) {
return breakpoint;
}
@@ -597,94 +815,156 @@ public class JDIDebugModel {
}
return null;
}
-
+
/**
- * Returns a Java line breakpoint that is already registered with the breakpoint
- * manager for a type with the given name at the given line number in the given resource.
+ * Returns a Java line breakpoint that is already registered with the
+ * breakpoint manager for a type with the given name at the given line
+ * number in the given resource.
*
- * @param resource the resource
- * @param typeName fully qualified type name
- * @param lineNumber line number
- * @return a Java line breakpoint that is already registered with the breakpoint
- * manager for a type with the given name at the given line number or <code>null</code>
- * if no such breakpoint is registered
- * @exception CoreException if unable to retrieve the associated marker
- * attributes (line number).
+ * @param resource
+ * the resource
+ * @param typeName
+ * fully qualified type name
+ * @param lineNumber
+ * line number
+ * @return a Java line breakpoint that is already registered with the
+ * breakpoint manager for a type with the given name at the given
+ * line number or <code>null</code> if no such breakpoint is
+ * registered
+ * @exception CoreException
+ * if unable to retrieve the associated marker attributes
+ * (line number).
* @since 3.1
*/
- public static IJavaLineBreakpoint lineBreakpointExists(IResource resource, String typeName, int lineNumber) throws CoreException {
- String modelId= getPluginIdentifier();
- String markerType= JavaLineBreakpoint.getMarkerType();
- IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
- IBreakpoint[] breakpoints= manager.getBreakpoints(modelId);
+ public static IJavaLineBreakpoint lineBreakpointExists(IResource resource,
+ String typeName, int lineNumber) throws CoreException {
+ String modelId = getPluginIdentifier();
+ String markerType = JavaLineBreakpoint.getMarkerType();
+ IBreakpointManager manager = DebugPlugin.getDefault()
+ .getBreakpointManager();
+ IBreakpoint[] breakpoints = manager.getBreakpoints(modelId);
for (int i = 0; i < breakpoints.length; i++) {
if (!(breakpoints[i] instanceof IJavaLineBreakpoint)) {
continue;
}
IJavaLineBreakpoint breakpoint = (IJavaLineBreakpoint) breakpoints[i];
IMarker marker = breakpoint.getMarker();
- if (marker != null && marker.exists() && marker.getType().equals(markerType)) {
+ if (marker != null && marker.exists()
+ && marker.getType().equals(markerType)) {
String breakpointTypeName = breakpoint.getTypeName();
- if ((breakpointTypeName.equals(typeName) || breakpointTypeName.startsWith(typeName + '$')) &&
- breakpoint.getLineNumber() == lineNumber &&
- resource.equals(marker.getResource())) {
- return breakpoint;
+ if ((breakpointTypeName.equals(typeName) || breakpointTypeName
+ .startsWith(typeName + '$'))
+ && breakpoint.getLineNumber() == lineNumber
+ && resource.equals(marker.getResource())) {
+ return breakpoint;
}
}
}
return null;
- }
-
+ }
+
/**
- * Returns the preference store for this plug-in or <code>null</code>
- * if the store is not available.
+ * Returns the preference store for this plug-in or <code>null</code> if the
+ * store is not available.
+ * <br><br>
+ * The Preferences class has been deprecated and clients should directly be using the
+ * InstanceScope node for JDIDebugPlugin rather than this convenience method.
+ * <br><br>
+ * For example:
+ * <pre>
+ * IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ * if(node != null) {
+ * ...
+ * }
+ * </pre>
*
* @return the preference store for this plug-in
* @since 2.0
+ * @deprecated the {@link Preferences} class has been deprecated, use the {@link IEclipsePreferences} accessors instead
*/
public static Preferences getPreferences() {
- JDIDebugPlugin deflt= JDIDebugPlugin.getDefault();
+ JDIDebugPlugin deflt = JDIDebugPlugin.getDefault();
if (deflt != null) {
return deflt.getPluginPreferences();
}
return null;
}
-
+
/**
* Saves the preference store for this plug-in.
- *
+ * <br><br>
+ * The Preferences class has been deprecated and clients should directly be using the
+ * InstanceScope node for JDIDebugPlugin rather than this convenience method.
+ * <br><br>
+ * For example:
+ * <pre>
+ * IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ * if(node != null) {
+ * try {
+ * node.flush();
+ * } catch (BackingStoreException e) {
+ * log(e);
+ * }
+ * }
+ * </pre>
* @since 2.0
+ * @deprecated the {@link Preferences} class has been deprecated, use the {@link IEclipsePreferences} accessors instead
*/
public static void savePreferences() {
- JDIDebugPlugin.getDefault().savePluginPreferences();
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ if(node != null) {
+ try {
+ node.flush();
+ } catch (BackingStoreException bse) {
+ JDIDebugPlugin.log(bse);
+ }
+ }
}
-
+
/**
- * Creates and returns a class prepare breakpoint for a type with the given name.
- * The marker associated with the breakpoint will be created on the specified resource.
+ * Creates and returns a class prepare breakpoint for a type with the given
+ * name. The marker associated with the breakpoint will be created on the
+ * specified resource.
*
- * @param resource the resource on which to create the associated
- * breakpoint marker
- * @param typeName the fully qualified name of the type for
- * which to create the breakpoint
- * @param memberType one of <code>TYPE_CLASS</code> or <code>TYPE_INTERFACE</code>
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param typeName
+ * the fully qualified name of the type for which to create the
+ * breakpoint
+ * @param memberType
+ * one of <code>TYPE_CLASS</code> or <code>TYPE_INTERFACE</code>
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation or
+ * <code>null</code> if none.
* @return a class prepare breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @since 3.0
*/
- public static IJavaClassPrepareBreakpoint createClassPrepareBreakpoint(IResource resource, String typeName, int memberType, int charStart, int charEnd, boolean register, Map attributes) throws CoreException {
+ public static IJavaClassPrepareBreakpoint createClassPrepareBreakpoint(
+ IResource resource, String typeName, int memberType, int charStart,
+ int charEnd, boolean register, Map<String, Object> attributes) throws CoreException {
if (attributes == null) {
- attributes = new HashMap(10);
+ attributes = new HashMap<String, Object>(10);
}
- return new JavaClassPrepareBreakpoint(resource, typeName, memberType, charStart, charEnd, register, attributes);
- }
+ return new JavaClassPrepareBreakpoint(resource, typeName, memberType,
+ charStart, charEnd, register, attributes);
+ }
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/EventDispatcher.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/EventDispatcher.java
index 43350cb44..38c483925 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/EventDispatcher.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/EventDispatcher.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -40,22 +39,20 @@ import com.sun.jdi.event.VMStartEvent;
import com.sun.jdi.request.EventRequest;
/**
- * Dispatches events generated by an underlying VM.
- * There is one event dispatcher per JDI debug target.
+ * Dispatches events generated by an underlying VM. There is one event
+ * dispatcher per JDI debug target.
* <p>
- * Event listeners register with a debug target to handle
- * specific event requests. A debug target forwards event
- * listeners and requests to its event dispatcher. As events
- * are received from the underlying VM, those listeners that
- * registered to handle the specific events are notified.
+ * Event listeners register with a debug target to handle specific event
+ * requests. A debug target forwards event listeners and requests to its event
+ * dispatcher. As events are received from the underlying VM, those listeners
+ * that registered to handle the specific events are notified.
* </p>
* <p>
- * Events are processed in event sets. It is possible that one
- * event can trigger more than one event request to be processed.
- * In such cases all event requests triggered by that one event are
- * processed, and each event listener votes on whether the thread
- * in which the event occurred should be resumed. A thread is only
- * resumed in if all event handlers agree that the thread should be
+ * Events are processed in event sets. It is possible that one event can trigger
+ * more than one event request to be processed. In such cases all event requests
+ * triggered by that one event are processed, and each event listener votes on
+ * whether the thread in which the event occurred should be resumed. A thread is
+ * only resumed in if all event handlers agree that the thread should be
* resumed.
* </p>
*/
@@ -70,36 +67,35 @@ public class EventDispatcher implements Runnable {
*/
private boolean fShutdown;
/**
- * Table of event listeners. Table is
- * a mapping of <code>EventRequest</code>
+ * Table of event listeners. Table is a mapping of <code>EventRequest</code>
* to <code>IJDIEventListener</code>.
*/
- private HashMap fEventHandlers;
-
+ private HashMap<EventRequest, IJDIEventListener> fEventHandlers;
+
/**
- * Queue of debug model events to fire, created
- * when processing events on the target VM. Keyed by
- * event sets, processed independently.
+ * Queue of debug model events to fire, created when processing events on
+ * the target VM. Keyed by event sets, processed independently.
*/
- private Map fSetToQueue = new HashMap();
-
+ private Map<EventSet, List<DebugEvent>> fSetToQueue = new HashMap<EventSet, List<DebugEvent>>();
+
/**
- * Constructs a new event dispatcher listening for events
- * originating from the specified debug target's underlying
- * VM.
+ * Constructs a new event dispatcher listening for events originating from
+ * the specified debug target's underlying VM.
*
- * @param target the target this event dispatcher belongs to
+ * @param target
+ * the target this event dispatcher belongs to
*/
public EventDispatcher(JDIDebugTarget target) {
- fEventHandlers = new HashMap(10);
- fTarget= target;
+ fEventHandlers = new HashMap<EventRequest, IJDIEventListener>(10);
+ fTarget = target;
fShutdown = false;
}
/**
* Dispatch the given event set.
*
- * @param eventSet events to dispatch
+ * @param eventSet
+ * events to dispatch
*/
private void dispatch(EventSet eventSet) {
if (isShutdown()) {
@@ -116,32 +112,33 @@ public class EventDispatcher implements Runnable {
}
System.out.println("}"); //$NON-NLS-1$
}
- EventIterator iter= eventSet.eventIterator();
+ EventIterator iter = eventSet.eventIterator();
IJDIEventListener[] listeners = new IJDIEventListener[eventSet.size()];
- boolean vote = false;
+ boolean vote = false;
boolean resume = true;
- int index=-1;
- List deferredEvents = null;
+ int index = -1;
+ List<Event> deferredEvents = null;
while (iter.hasNext()) {
index++;
if (isShutdown()) {
return;
}
- Event event= iter.nextEvent();
+ Event event = iter.nextEvent();
if (event == null) {
continue;
}
// Dispatch events to registered listeners, if any
- IJDIEventListener listener = (IJDIEventListener)fEventHandlers.get(event.request());
+ IJDIEventListener listener = fEventHandlers.get(event.request());
listeners[index] = listener;
if (listener != null) {
if (listener instanceof IJavaLineBreakpoint) {
- // Event dispatch to conditional breakpoints is deferred until after
+ // Event dispatch to conditional breakpoints is deferred
+ // until after
// other listeners vote.
try {
- if (((IJavaLineBreakpoint)listener).isConditionEnabled()) {
+ if (((IJavaLineBreakpoint) listener).isConditionEnabled()) {
if (deferredEvents == null) {
- deferredEvents = new ArrayList(5);
+ deferredEvents = new ArrayList<Event>(5);
}
deferredEvents.add(event);
continue;
@@ -154,7 +151,7 @@ public class EventDispatcher implements Runnable {
resume = listener.handleEvent(event, fTarget, !resume, eventSet) && resume;
continue;
}
-
+
// Dispatch VM start/end events
if (event instanceof VMDeathEvent) {
fTarget.handleVMDeath((VMDeathEvent) event);
@@ -163,25 +160,26 @@ public class EventDispatcher implements Runnable {
fTarget.handleVMDisconnect((VMDisconnectEvent) event);
shutdown(); // stop listening for events
} else if (event instanceof VMStartEvent) {
- fTarget.handleVMStart((VMStartEvent)event);
+ fTarget.handleVMStart((VMStartEvent) event);
} else {
// not handled
}
}
-
+
// process deferred conditional breakpoint events
if (deferredEvents != null) {
- Iterator deferredIter= deferredEvents.iterator();
+ Iterator<Event> deferredIter = deferredEvents.iterator();
while (deferredIter.hasNext()) {
if (isShutdown()) {
return;
}
- Event event= (Event)deferredIter.next();
+ Event event = deferredIter.next();
if (event == null) {
continue;
}
// Dispatch events to registered listeners, if any
- IJDIEventListener listener = (IJDIEventListener)fEventHandlers.get(event.request());
+ IJDIEventListener listener = fEventHandlers
+ .get(event.request());
if (listener != null) {
vote = true;
resume = listener.handleEvent(event, fTarget, !resume, eventSet) && resume;
@@ -189,30 +187,31 @@ public class EventDispatcher implements Runnable {
}
}
}
-
+
// notify handlers of the end result
index = -1;
iter = eventSet.eventIterator();
while (iter.hasNext()) {
index++;
- Event event= iter.nextEvent();
+ Event event = iter.nextEvent();
// notify registered listener, if any
IJDIEventListener listener = listeners[index];
if (listener != null) {
listener.eventSetComplete(event, fTarget, !resume, eventSet);
}
}
-
+
// fire queued DEBUG events
fireEvents(eventSet);
-
+
if (vote && resume) {
try {
eventSet.resume();
} catch (VMDisconnectedException e) {
} catch (RuntimeException e) {
try {
- fTarget.targetRequestFailed(JDIDebugMessages.EventDispatcher_0, e);
+ fTarget.targetRequestFailed(
+ JDIDebugMessages.EventDispatcher_0, e);
} catch (DebugException de) {
JDIDebugPlugin.log(de);
}
@@ -221,46 +220,46 @@ public class EventDispatcher implements Runnable {
}
/**
- * Continuously reads events that are coming from the event queue,
- * until this event dispatcher is shutdown. A debug target starts
- * a thread on this method on startup.
+ * Continuously reads events that are coming from the event queue, until
+ * this event dispatcher is shutdown. A debug target starts a thread on this
+ * method on startup.
*
* @see #shutdown()
*/
public void run() {
VirtualMachine vm = fTarget.getVM();
if (vm != null) {
- EventQueue q= vm.eventQueue();
- EventSet eventSet= null;
+ EventQueue q = vm.eventQueue();
+ EventSet eventSet = null;
while (!isShutdown()) {
try {
try {
// Get the next event set.
- eventSet= q.remove(1000);
+ eventSet = q.remove(1000);
} catch (VMDisconnectedException e) {
break;
}
-
- if(!isShutdown() && eventSet != null) {
+
+ if (!isShutdown() && eventSet != null) {
final EventSet set = eventSet;
Job job = new Job("JDI Event Dispatch") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
dispatch(set);
return Status.OK_STATUS;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
- */
+
+ @Override
public boolean belongsTo(Object family) {
if (family instanceof Class) {
- Class clazz = (Class) family;
+ Class<?> clazz = (Class<?>) family;
EventIterator iterator = set.eventIterator();
while (iterator.hasNext()) {
Event event = iterator.nextEvent();
if (clazz.isInstance(event)) {
return true;
}
- }
+ }
}
return false;
}
@@ -276,88 +275,90 @@ public class EventDispatcher implements Runnable {
}
/**
- * Shutdown this event dispatcher - i.e. causes this event
- * dispatcher to stop reading and dispatching events from the
- * event queue. The thread associated with this runnable
- * will exit.
+ * Shutdown this event dispatcher - i.e. causes this event dispatcher to
+ * stop reading and dispatching events from the event queue. The thread
+ * associated with this runnable will exit.
*/
public void shutdown() {
- fShutdown= true;
+ fShutdown = true;
}
-
+
/**
- * Returns whether this event dispatcher has been
- * shutdown.
+ * Returns whether this event dispatcher has been shutdown.
*
- * @return whether this event dispatcher has been
- * shutdown
+ * @return whether this event dispatcher has been shutdown
*/
private boolean isShutdown() {
return fShutdown;
}
-
+
/**
- * Registers the given listener for with the given event request.
- * When an event is received from the underlying VM, that is
- * assocaited with the given event request, the listener will
- * be notified.
+ * Registers the given listener for with the given event request. When an
+ * event is received from the underlying VM, that is associated with the
+ * given event request, the listener will be notified.
*
- * @param listener the listener to register
- * @param request the event request associated with events
- * the listener is interested in
+ * @param listener
+ * the listener to register
+ * @param request
+ * the event request associated with events the listener is
+ * interested in
*/
- public void addJDIEventListener(IJDIEventListener listener, EventRequest request) {
+ public void addJDIEventListener(IJDIEventListener listener,
+ EventRequest request) {
fEventHandlers.put(request, listener);
}
/**
- * Deregisters the given listener and event request. The listener
- * will no longer be notified of events associated with the request.
- * Listeners are responsible for deleting the associated event
- * request if required.
+ * De-registers the given listener and event request. The listener will no
+ * longer be notified of events associated with the request. Listeners are
+ * responsible for deleting the associated event request if required.
*
- * @param listener the listener to deregister
- * @param request the event request to deregister
- */
+ * @param listener
+ * the listener to de-register
+ * @param request
+ * the event request to de-register
+ */
public void removeJDIEventListener(IJDIEventListener listener, EventRequest request) {
fEventHandlers.remove(request);
}
-
- /**
+
+ /**
* Adds the given event to the queue of debug events to fire when done
* dispatching events from the given event set.
*
- * @param event the event to queue
- * @param the event set the event is associated with
+ * @param event
+ * the event to queue
+ * @param set
+ * event set the event is associated with
*/
public void queue(DebugEvent event, EventSet set) {
synchronized (fSetToQueue) {
- List list = (List)fSetToQueue.get(set);
+ List<DebugEvent> list = fSetToQueue.get(set);
if (list == null) {
- list = new ArrayList(5);
+ list = new ArrayList<DebugEvent>(5);
fSetToQueue.put(set, list);
}
list.add(event);
}
}
-
+
/**
* Fires debug events in the event queue associated with the given event
* set, and clears the queue.
+ * @param set the set to fire events for
*/
private void fireEvents(EventSet set) {
- DebugPlugin plugin= DebugPlugin.getDefault();
- if (plugin != null) { //check that not in the process of shutting down
- List list = null;
+ DebugPlugin plugin = DebugPlugin.getDefault();
+ if (plugin != null) { // check that not in the process of shutting down
+ List<DebugEvent> list = null;
synchronized (fSetToQueue) {
- list = (List) fSetToQueue.remove(set);
+ list = fSetToQueue.remove(set);
}
if (list != null) {
- DebugEvent[] events = (DebugEvent[])list.toArray(new DebugEvent[list.size()]);
+ DebugEvent[] events = list.toArray(new DebugEvent[list.size()]);
plugin.fireDebugEventSet(events);
}
}
}
-
-}
+}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/HeapWalkingManager.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/HeapWalkingManager.java
index 7725b3ca1..d21d357c4 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/HeapWalkingManager.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/HeapWalkingManager.java
@@ -10,112 +10,174 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.jdt.debug.core.IJavaDebugTarget;
+import org.osgi.service.prefs.BackingStoreException;
/**
- * Controls preferences related to heap walking so that they are available in java
- * debug model code, but can be updated through the UI.
+ * Controls preferences related to heap walking so that they are available in
+ * java debug model code, but can be updated through the UI.
*
* @since 3.3
*/
-public class HeapWalkingManager{
-
+public class HeapWalkingManager {
+
private static HeapWalkingManager fgSingleton;
-
+
/**
* Constructor. Intended to be called by getDefault()
*/
- protected HeapWalkingManager() {}
-
+ protected HeapWalkingManager() {
+ }
+
/**
- * Returns whether the given parent object is a debug element with a debug target
- * that supports retrieval of instance and reference information from the VM.
+ * Returns whether the given parent object is a debug element with a debug
+ * target that supports retrieval of instance and reference information from
+ * the VM.
*
- * @param object the object to test, can be <code>null</code>
- * @return whether the given object has a debug target that supports heap walking
+ * @param object
+ * the object to test, can be <code>null</code>
+ * @return whether the given object has a debug target that supports heap
+ * walking
*/
- public static boolean supportsHeapWalking(Object object){
- if (object instanceof IDebugElement){
- IDebugTarget target = ((IDebugElement)object).getDebugTarget();
- if (target instanceof IJavaDebugTarget){
- return ((IJavaDebugTarget)target).supportsInstanceRetrieval();
+ public static boolean supportsHeapWalking(Object object) {
+ if (object instanceof IDebugElement) {
+ IDebugTarget target = ((IDebugElement) object).getDebugTarget();
+ if (target instanceof IJavaDebugTarget) {
+ return ((IJavaDebugTarget) target).supportsInstanceRetrieval();
} else if (target != null) {
Object adapter = target.getAdapter(IJavaDebugTarget.class);
- if (adapter instanceof IJavaDebugTarget){
+ if (adapter instanceof IJavaDebugTarget) {
return ((IJavaDebugTarget) adapter).supportsInstanceRetrieval();
}
}
}
return false;
}
-
+
/**
* @return the default singleton instance of the manager
*/
public static HeapWalkingManager getDefault() {
- if (fgSingleton == null){
+ if (fgSingleton == null) {
fgSingleton = new HeapWalkingManager();
}
return fgSingleton;
}
-
+
/**
- * @return preference dictating whether to display references as variables in variables view.
+ * @return preference dictating whether to display references as variables
+ * in variables view.
*/
public boolean isShowReferenceInVarView() {
- return JDIDebugPlugin.getDefault().getPluginPreferences().getBoolean(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW);
+ return Platform.getPreferencesService().getBoolean(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW,
+ false,
+ null);
}
-
+
/**
- * @return preference dictating the maximum number of references that should be displayed to the user
+ * @return preference dictating the maximum number of references that should
+ * be displayed to the user
*/
public int getAllReferencesMaxCount() {
- return JDIDebugPlugin.getDefault().getPluginPreferences().getInt(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT);
+ return Platform.getPreferencesService().getInt(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT,
+ 100,
+ null);
}
-
+
/**
- * @return preference dictating the maximum number of instances that should be displayed to the user
+ * @return preference dictating the maximum number of instances that should
+ * be displayed to the user
*/
public int getAllInstancesMaxCount() {
- return JDIDebugPlugin.getDefault().getPluginPreferences().getInt(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT);
+ return Platform.getPreferencesService().getInt(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT,
+ 100,
+ null);
}
-
+
/**
* Stores the passed vale in the preference store
*
- * @param value whether to display references as variables in the variables view
+ * @param value
+ * whether to display references as variables in the variables
+ * view
*/
public void setShowReferenceInVarView(boolean value) {
- JDIDebugPlugin.getDefault().getPluginPreferences().setValue(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW,value);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ if(node != null) {
+ node.putBoolean(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW, value);
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ JDIDebugPlugin.log(e);
+ }
+ }
}
-
+
/**
* Stores the passed value in the preference store
*
- * @param max the maximum number of references that should be displayed to the user
+ * @param max
+ * the maximum number of references that should be displayed to
+ * the user
*/
- public void setAllReferencesMaxCount(int max){
- JDIDebugPlugin.getDefault().getPluginPreferences().setValue(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT, max);
+ public void setAllReferencesMaxCount(int max) {
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ if(node != null) {
+ node.putInt(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT, max);
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ JDIDebugPlugin.log(e);
+ }
+ }
}
-
+
/**
* Stores the passed value in the preference store
*
- * @param max the maximum number of instances that should be displayed to the user
+ * @param max
+ * the maximum number of instances that should be displayed to
+ * the user
*/
- public void setAllInstancesMaxCount(int max){
- JDIDebugPlugin.getDefault().getPluginPreferences().setValue(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT, max);
+ public void setAllInstancesMaxCount(int max) {
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ if(node != null) {
+ node.putInt(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT, max);
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ JDIDebugPlugin.log(e);
+ }
+ }
}
-
+
/**
- * Resets the preferences controlled by this manager to their default settings
+ * Resets the preferences controlled by this manager to their default
+ * settings
*/
- public void resetToDefaultSettings(){
- JDIDebugPlugin.getDefault().getPluginPreferences().setToDefault(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW);
- JDIDebugPlugin.getDefault().getPluginPreferences().setToDefault(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT);
- JDIDebugPlugin.getDefault().getPluginPreferences().setToDefault(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT);
+ public void resetToDefaultSettings() {
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ if(node != null) {
+ node.putBoolean(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW, false);
+ node.putInt(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT, 100);
+ node.putInt(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT, 100);
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ JDIDebugPlugin.log(e);
+ }
+ }
}
-
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJDIEventListener.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJDIEventListener.java
index 23fe17316..8e3f5b822 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJDIEventListener.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJDIEventListener.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core;
-
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
import com.sun.jdi.event.Event;
import com.sun.jdi.event.EventSet;
+import com.sun.jdi.request.EventRequest;
/**
- * A jdi event listener is notified of events associated with
- * a specific jdi event request. A listener registers/deregisters
- * event requests with a debug target.
+ * A jdi event listener is notified of events associated with a specific jdi
+ * event request. A listener registers/deregisters event requests with a debug
+ * target.
*
* @see JDIDebugTarget#addJDIEventListener(IJDIEventListener, EventRequest)
* @see JDIDebugTarget#removeJDIEventListener(IJDIEventListener, EventRequest)
@@ -27,36 +27,46 @@ import com.sun.jdi.event.EventSet;
public interface IJDIEventListener {
/**
- * Handles the given event that this listener has registered for and
- * returns whether the thread in which the event occurred should
- * be resumed. All event handlers for the events in an event set
- * are given a chance to vote on whether the thread should be
- * resumed. If all agree, the thread is resumed by the event dispatcher.
- * If any event handler returns <code>false</code> the thread in which
- * the event originated is left in a suspended state.
+ * Handles the given event that this listener has registered for and returns
+ * whether the thread in which the event occurred should be resumed. All
+ * event handlers for the events in an event set are given a chance to vote
+ * on whether the thread should be resumed. If all agree, the thread is
+ * resumed by the event dispatcher. If any event handler returns
+ * <code>false</code> the thread in which the event originated is left in a
+ * suspended state.
* <p>
* Event listeners are provided with the current state of the suspend vote.
* For example, this could allow a conditional breakpoint to not bother
- * running its evaluation since the vote is already to suspend (if it coincides
- * with a step end).
+ * running its evaluation since the vote is already to suspend (if it
+ * coincides with a step end).
* </p>
- * @param event the event to handle
- * @param target the debug target in which the event occurred
- * @param suspendVote whether the current vote among event listeners is to suspend
- * @param eventSet the event set the event is contained in
+ *
+ * @param event
+ * the event to handle
+ * @param target
+ * the debug target in which the event occurred
+ * @param suspendVote
+ * whether the current vote among event listeners is to suspend
+ * @param eventSet
+ * the event set the event is contained in
* @return whether the thread in which the event occurred should be resumed
*/
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet);
-
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet);
+
/**
* Notification that all event handlers for an event set have handled their
* associated events and whether the event set will suspend.
*
- * @param event event the listener was registered for/handled
- * @param target target in which the event occurred
- * @param suspend whether the event will cause the event thread to suspend
- * @param eventSet the event set the event is contained in
+ * @param event
+ * event the listener was registered for/handled
+ * @param target
+ * target in which the event occurred
+ * @param suspend
+ * whether the event will cause the event thread to suspend
+ * @param eventSet
+ * the event set the event is contained in
*/
- public void eventSetComplete(Event event, JDIDebugTarget target, boolean suspend, EventSet eventSet);
+ public void eventSetComplete(Event event, JDIDebugTarget target,
+ boolean suspend, EventSet eventSet);
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugOptions.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugOptions.java
index 70e2a9f42..c2e9e9afb 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugOptions.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugOptions.java
@@ -27,19 +27,24 @@ public class JDIDebugOptions {
public static boolean DEBUG_JDI_REQUEST_TIMES = false;
public static boolean DEBUG_AST_EVAL = false;
public static boolean DEBUG_AST_EVAL_THREAD_TRACE = false;
-
+
// used to format debug messages
- public static final DateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); //$NON-NLS-1$
+ public static final DateFormat FORMAT = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss.SSS"); //$NON-NLS-1$
public static void initDebugOptions() {
- DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.jdt.debug/debug")); //$NON-NLS-1$//$NON-NLS-2$
- DEBUG_JDI_EVENTS = DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.jdt.debug/debug/jdiEvents")); //$NON-NLS-1$
- DEBUG_JDI_REQUEST_TIMES = DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.jdt.debug/debug/jdiRequestTimes")); //$NON-NLS-1$
- DEBUG_AST_EVAL = DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.jdt.debug/debug/astEvaluations")); //$NON-NLS-1$
- DEBUG_AST_EVAL_THREAD_TRACE = DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.jdt.debug/debug/astEvaluations/callingThreads")); //$NON-NLS-1$
+ DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.jdt.debug/debug")); //$NON-NLS-1$//$NON-NLS-2$
+ DEBUG_JDI_EVENTS = DEBUG
+ && "true".equals( //$NON-NLS-1$
+ Platform.getDebugOption("org.eclipse.jdt.debug/debug/jdiEvents")); //$NON-NLS-1$
+ DEBUG_JDI_REQUEST_TIMES = DEBUG
+ && "true".equals( //$NON-NLS-1$
+ Platform.getDebugOption("org.eclipse.jdt.debug/debug/jdiRequestTimes")); //$NON-NLS-1$
+ DEBUG_AST_EVAL = DEBUG
+ && "true".equals( //$NON-NLS-1$
+ Platform.getDebugOption("org.eclipse.jdt.debug/debug/astEvaluations")); //$NON-NLS-1$
+ DEBUG_AST_EVAL_THREAD_TRACE = DEBUG
+ && "true".equals( //$NON-NLS-1$
+ Platform.getDebugOption("org.eclipse.jdt.debug/debug/astEvaluations/callingThreads")); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPlugin.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPlugin.java
index cb782ae66..84d5212f9 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPlugin.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,10 +18,11 @@ import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchManager;
@@ -43,83 +44,93 @@ import org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
import org.eclipse.jdt.internal.debug.core.model.JDIThread;
import org.osgi.framework.BundleContext;
+import org.osgi.service.prefs.BackingStoreException;
import com.sun.jdi.VirtualMachineManager;
/**
* The plug-in class for the JDI Debug Model plug-in.
*/
-public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChangeListener {
-
+public class JDIDebugPlugin extends Plugin implements IEclipsePreferences.IPreferenceChangeListener {
+
/**
- * integer preference controlling if we should, by default, suspend the VM instead of the thread
+ * integer preference controlling if we should, by default, suspend the VM
+ * instead of the thread
*
* @since 3.2
*/
- public static final String PREF_DEFAULT_BREAKPOINT_SUSPEND_POLICY = JDIDebugPlugin.getUniqueIdentifier() + ".default_breakpoint_suspend_policy"; //$NON-NLS-1$
-
+ public static final String PREF_DEFAULT_BREAKPOINT_SUSPEND_POLICY = JDIDebugPlugin
+ .getUniqueIdentifier() + ".default_breakpoint_suspend_policy"; //$NON-NLS-1$
+
/**
- * integer preference controlling which default suspend option to set on new watchpoints
+ * integer preference controlling which default suspend option to set on new
+ * watchpoints
*
* @since 3.3.1
*/
- public static final String PREF_DEFAULT_WATCHPOINT_SUSPEND_POLICY = JDIDebugPlugin.getUniqueIdentifier() + "default_watchpoint_suspend_policy"; //$NON-NLS-1$
-
+ public static final String PREF_DEFAULT_WATCHPOINT_SUSPEND_POLICY = JDIDebugPlugin
+ .getUniqueIdentifier() + "default_watchpoint_suspend_policy"; //$NON-NLS-1$
+
/**
- * Boolean preference controlling if references should be displayed as variables in the variables and expressions view
+ * Boolean preference controlling if references should be displayed as
+ * variables in the variables and expressions view
*
* @since 3.3
*/
- public static final String PREF_SHOW_REFERENCES_IN_VAR_VIEW = JDIDebugPlugin.getUniqueIdentifier() + ".show_references_in_var_view"; //$NON-NLS-1$
-
+ public static final String PREF_SHOW_REFERENCES_IN_VAR_VIEW = JDIDebugPlugin
+ .getUniqueIdentifier() + ".show_references_in_var_view"; //$NON-NLS-1$
+
/**
- * Integer preference determining the maximum number of references that should be returned to the user when displaying reference information
+ * Integer preference determining the maximum number of references that
+ * should be returned to the user when displaying reference information
*
* @since 3.3
*/
- public static final String PREF_ALL_REFERENCES_MAX_COUNT = JDIDebugPlugin.getUniqueIdentifier() + "._all_references_max_count"; //$NON-NLS-1$
-
+ public static final String PREF_ALL_REFERENCES_MAX_COUNT = JDIDebugPlugin
+ .getUniqueIdentifier() + "._all_references_max_count"; //$NON-NLS-1$
+
/**
- * Integer preference determining the maximum number of instances that should be returned to the user when displaying instance information
+ * Integer preference determining the maximum number of instances that
+ * should be returned to the user when displaying instance information
*
* @since 3.3
*/
- public static final String PREF_ALL_INSTANCES_MAX_COUNT = JDIDebugPlugin.getUniqueIdentifier() + ".all_instances_max_count"; //$NON-NLS-1$
-
+ public static final String PREF_ALL_INSTANCES_MAX_COUNT = JDIDebugPlugin
+ .getUniqueIdentifier() + ".all_instances_max_count"; //$NON-NLS-1$
+
/**
* Extension point for java logical structures.
*
* @since 3.1
*/
- public static final String EXTENSION_POINT_JAVA_LOGICAL_STRUCTURES= "javaLogicalStructures"; //$NON-NLS-1$
-
-
+ public static final String EXTENSION_POINT_JAVA_LOGICAL_STRUCTURES = "javaLogicalStructures"; //$NON-NLS-1$
+
/**
* Extension point for java breakpoint action delegates.
*
* @since 3.5
*/
- public static final String EXTENSION_POINT_JAVA_BREAKPOINT_LISTENERS= "breakpointListeners"; //$NON-NLS-1$
+ public static final String EXTENSION_POINT_JAVA_BREAKPOINT_LISTENERS = "breakpointListeners"; //$NON-NLS-1$
/**
* Status code indicating an unexpected error.
*/
- public static final int ERROR = 120;
-
+ public static final int ERROR = 120;
+
/**
- * Status code indicating an unexpected internal error. Internal errors
- * should never be displayed to the user in dialogs or status text.
- * Internal error messages are not translated.
+ * Status code indicating an unexpected internal error. Internal errors
+ * should never be displayed to the user in dialogs or status text. Internal
+ * error messages are not translated.
*/
public static final int INTERNAL_ERROR = 125;
-
+
private static JDIDebugPlugin fgPlugin;
-
+
/**
* Breakpoint listener list.
*/
private ListenerList fBreakpointListeners = null;
-
+
/**
* Breakpoint notification types
*/
@@ -128,95 +139,103 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
private static final int REMOVED = 3;
private static final int COMPILATION_ERRORS = 4;
private static final int RUNTIME_EXCEPTION = 5;
-
+
/**
- * Whether this plug-in is in trace mode.
- * Extra messages are logged in trace mode.
+ * Whether this plug-in is in trace mode. Extra messages are logged in trace
+ * mode.
*/
private boolean fTrace = false;
-
+
/**
* Detected (speculated) JDI interface version
*/
private static int[] fJDIVersion = null;
/**
- * Status code used by the debug model to retrieve a thread to use
- * for evaluations, via a status handler. A status handler is contributed by
- * the Java debug UI. When not present, the debug model uses any suspended thread.
+ * Status code used by the debug model to retrieve a thread to use for
+ * evaluations, via a status handler. A status handler is contributed by the
+ * Java debug UI. When not present, the debug model uses any suspended
+ * thread.
*
- * @since 3.0
+ * @since 3.0
*/
public static final int INFO_EVALUATION_THREAD = 110;
-
+
/**
* Associated status to retrieve a thread.
*/
- public static final IStatus STATUS_GET_EVALUATION_THREAD = new Status(IStatus.INFO, getUniqueIdentifier(), INFO_EVALUATION_THREAD, "Provides thread context for an evaluation", null); //$NON-NLS-1$
-
+ public static final IStatus STATUS_GET_EVALUATION_THREAD = new Status(
+ IStatus.INFO, getUniqueIdentifier(), INFO_EVALUATION_THREAD,
+ "Provides thread context for an evaluation", null); //$NON-NLS-1$
+
/**
- * Status code used by the debug model to retrieve a frame to use
- * for evaluations, via a status handler. A status handler is contributed by
- * the Java debug UI. When not present, the debug model uses any suspended thread.
+ * Status code used by the debug model to retrieve a frame to use for
+ * evaluations, via a status handler. A status handler is contributed by the
+ * Java debug UI. When not present, the debug model uses any suspended
+ * thread.
*
- * @since 3.0
+ * @since 3.0
*/
- public static final int INFO_EVALUATION_STACK_FRAME = 111;
+ public static final int INFO_EVALUATION_STACK_FRAME = 111;
/**
* Associated status to retrieve a stack frame.
*/
- public static IStatus STATUS_GET_EVALUATION_FRAME = new Status(IStatus.INFO, getUniqueIdentifier(), INFO_EVALUATION_STACK_FRAME, "Provides thread context for an evaluation", null); //$NON-NLS-1$
-
+ public static IStatus STATUS_GET_EVALUATION_FRAME = new Status(
+ IStatus.INFO, getUniqueIdentifier(), INFO_EVALUATION_STACK_FRAME,
+ "Provides thread context for an evaluation", null); //$NON-NLS-1$
+
/**
* Manages breakpoint listener extensions
*/
private BreakpointListenerManager fJavaBreakpointManager;
-
+
/**
- * Returns whether the debug UI plug-in is in trace
- * mode.
+ * Returns whether the debug UI plug-in is in trace mode.
*
- * @return whether the debug UI plug-in is in trace
- * mode
+ * @return whether the debug UI plug-in is in trace mode
*/
public boolean isTraceMode() {
return fTrace;
}
-
+
/**
* Logs the given message if in trace mode.
*
- * @param String message to log
+ * @param message the string to log
*/
public static void logTraceMessage(String message) {
if (getDefault().isTraceMode()) {
- IStatus s = new Status(IStatus.WARNING, JDIDebugPlugin.getUniqueIdentifier(), INTERNAL_ERROR, message, null);
+ IStatus s = new Status(IStatus.WARNING,
+ JDIDebugPlugin.getUniqueIdentifier(), INTERNAL_ERROR,
+ message, null);
getDefault().getLog().log(s);
}
- }
-
+ }
+
/**
- * Return the singleton instance of the JDI Debug Model plug-in.
+ * Return the singleton instance of the JDI Debug Model plug-in.
+ *
* @return the singleton instance of JDIDebugPlugin
*/
public static JDIDebugPlugin getDefault() {
return fgPlugin;
}
-
+
/**
* Convenience method which returns the unique identifier of this plug-in.
+ * <br><br>
+ * Value is: <code>org.eclipse.jdt.debug</code>
+ * @return the unique id of the JDT debug core plug-in
*/
public static String getUniqueIdentifier() {
- // TODO review this change. Unclear how the plug-in id could ever be different
- // should likely just be a constant reference.
return "org.eclipse.jdt.debug"; //$NON-NLS-1$
}
-
+
/**
- * Returns the detected version of JDI support. This
- * is intended to distinguish between clients that support
- * JDI 1.4 methods like hot code replace.
+ * Returns the detected version of JDI support. This is intended to
+ * distinguish between clients that support JDI 1.4 methods like hot code
+ * replace.
*
* @return an array of version numbers, major followed by minor
* @since 2.1
@@ -230,52 +249,75 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
}
return fJDIVersion;
}
-
+
/**
* Returns if the JDI version being used is greater than or equal to the
* given version (major, minor).
*
- * @param version
+ * @param version the array of version number identifiers to compare
* @return boolean
*/
public static boolean isJdiVersionGreaterThanOrEqual(int[] version) {
int[] runningVersion = getJDIVersion();
return runningVersion[0] > version[0] || (runningVersion[0] == version[0] && runningVersion[1] >= version[1]);
}
-
+
public JDIDebugPlugin() {
- super();
+ super();
fgPlugin = this;
}
-
+
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
JDIDebugOptions.initDebugOptions();
- ResourcesPlugin.getWorkspace().addSaveParticipant(this, new ISaveParticipant() {
- public void doneSaving(ISaveContext c) {}
- public void prepareToSave(ISaveContext c) throws CoreException {}
- public void rollback(ISaveContext c) {}
- public void saving(ISaveContext c) throws CoreException {
- savePluginPreferences();
- }
- });
+ ResourcesPlugin.getWorkspace().addSaveParticipant(getUniqueIdentifier(),
+ new ISaveParticipant() {
+ public void doneSaving(ISaveContext c) {
+ }
+
+ public void prepareToSave(ISaveContext c)
+ throws CoreException {
+ }
+
+ public void rollback(ISaveContext c) {
+ }
+
+ public void saving(ISaveContext c) throws CoreException {
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(getUniqueIdentifier());
+ if(node != null) {
+ try {
+ node.flush();
+ } catch (BackingStoreException bse) {
+ log(bse);
+ }
+ }
+ }
+ });
JavaHotCodeReplaceManager.getDefault().startup();
fBreakpointListeners = new ListenerList();
fJavaBreakpointManager = new BreakpointListenerManager();
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(getUniqueIdentifier());
+ if(node != null) {
+ node.addPreferenceChangeListener(this);
+ }
}
-
+
/**
* Adds the given hot code replace listener to the collection of listeners
* that will be notified by the hot code replace manager in this plug-in.
+ * @param listener the listener to add
*/
public void addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
JavaHotCodeReplaceManager.getDefault().addHotCodeReplaceListener(listener);
}
/**
- * Removes the given hot code replace listener from the collection of listeners
- * that will be notified by the hot code replace manager in this plug-in.
- */
+ * Removes the given hot code replace listener from the collection of
+ * listeners that will be notified by the hot code replace manager in this
+ * plug-in.
+ * @param listener the listener to remove
+ */
public void removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
JavaHotCodeReplaceManager.getDefault().removeHotCodeReplaceListener(listener);
}
@@ -283,172 +325,199 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
/**
* Shutdown the HCR manager and the Java debug targets.
*
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)@see org.eclipse.core.runtime.Plugin#shutdown()
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ * @see org.eclipse.core.runtime.Plugin#shutdown()
*/
+ @Override
public void stop(BundleContext context) throws Exception {
try {
- getPluginPreferences().removePropertyChangeListener(this); //added in the preference initializer
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(getUniqueIdentifier());
+ if(node != null) {
+ node.removePreferenceChangeListener(this);
+ }
JavaHotCodeReplaceManager.getDefault().shutdown();
- ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager();
- IDebugTarget[] targets= launchManager.getDebugTargets();
- for (int i= 0 ; i < targets.length; i++) {
- IDebugTarget target= targets[i];
+ ILaunchManager launchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ IDebugTarget[] targets = launchManager.getDebugTargets();
+ for (IDebugTarget target : targets) {
if (target instanceof JDIDebugTarget) {
- ((JDIDebugTarget)target).shutdown();
+ ((JDIDebugTarget) target).shutdown();
}
}
fBreakpointListeners = null;
- ResourcesPlugin.getWorkspace().removeSaveParticipant(this);
+ ResourcesPlugin.getWorkspace().removeSaveParticipant(getUniqueIdentifier());
} finally {
fgPlugin = null;
super.stop(context);
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
+ */
+ public void preferenceChange(PreferenceChangeEvent event) {
+ if (event.getKey().equals(JDIDebugModel.PREF_REQUEST_TIMEOUT)) {
+ int value = ((Integer)event.getNewValue()).intValue();
+ IDebugTarget[] targets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
+ for (IDebugTarget target : targets) {
+ if (target instanceof IJavaDebugTarget) {
+ ((IJavaDebugTarget) target).setRequestTimeout(value);
+ }
+ }
+ }
+ }
/**
- * Logs the specified throwable with this plug-in's log.
+ * Logs the specified {@link Throwable} with this plug-in's log.
*
- * @param t throwable to log
+ * @param t {@link Throwable} to log
*/
public static void log(Throwable t) {
- Throwable top= t;
+ Throwable top = t;
if (t instanceof CoreException) {
- CoreException de = (CoreException)t;
+ CoreException de = (CoreException) t;
IStatus status = de.getStatus();
if (status.getException() != null) {
top = status.getException();
}
- }
- // this message is intentionally not internationalized, as an exception may
- // be due to the resource bundle itself
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, "Internal error logged from JDI Debug: ", top)); //$NON-NLS-1$
+ }
+ // this message is intentionally not internationalized, as an exception
+ // may be due to the resource bundle itself
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR,
+ "Internal error logged from JDI Debug: ", top)); //$NON-NLS-1$
}
-
+
/**
* Logs the specified status with this plug-in's log.
*
- * @param status status to log
+ * @param status
+ * status to log
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
-
+
/**
- * @see IJavaBreakpointListener#breakpointHasRuntimeException(IJavaLineBreakpoint, DebugException)
+ * @param breakpoint the breakpoint with problems
+ * @param errors the error set to notify about
+ * @see IJavaBreakpointListener#breakpointHasRuntimeException(IJavaLineBreakpoint,
+ * DebugException)
*/
public void fireBreakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors) {
getBreakpointNotifier().notify(null, breakpoint, COMPILATION_ERRORS, errors, null);
}
-
+
/**
+ * @param breakpoint the breakpoint with problems
+ * @param exception the exception to notify about
* @see IJavaBreakpointListener#breakpointHasCompilationErrors(IJavaLineBreakpoint, Message[])
*/
public void fireBreakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception) {
getBreakpointNotifier().notify(null, breakpoint, RUNTIME_EXCEPTION, null, exception);
}
-
+
/**
* Adds the given breakpoint listener to the JDI debug model.
*
- * @param listener breakpoint listener
+ * @param listener
+ * breakpoint listener
*/
public void addJavaBreakpointListener(IJavaBreakpointListener listener) {
fBreakpointListeners.add(listener);
- }
+ }
/**
* Removes the given breakpoint listener from the JDI debug model.
*
- * @param listener breakpoint listener
+ * @param listener
+ * breakpoint listener
*/
public void removeJavaBreakpointListener(IJavaBreakpointListener listener) {
fBreakpointListeners.remove(listener);
}
-
+
/**
- * Notifies listeners that the given breakpoint is about to be
- * added.
+ * Notifies listeners that the given breakpoint is about to be added.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
*/
- public void fireBreakpointAdding(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void fireBreakpointAdding(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
getBreakpointNotifier().notify(target, breakpoint, ADDING, null, null);
}
-
+
/**
* Notifies listeners that the given breakpoint has been installed.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
- */
- public void fireBreakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
- getBreakpointNotifier().notify(target, breakpoint, INSTALLED, null, null);
- }
-
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
+ */
+ public void fireBreakpointInstalled(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
+ getBreakpointNotifier().notify(target, breakpoint, INSTALLED, null,
+ null);
+ }
+
/**
* Notifies listeners that the given breakpoint has been removed.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
*/
- public void fireBreakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void fireBreakpointRemoved(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
getBreakpointNotifier().notify(target, breakpoint, REMOVED, null, null);
}
-
+
/**
- * Notifies listeners that the given breakpoint has been hit.
- * Returns whether the thread should suspend.
+ * Notifies listeners that the given breakpoint has been hit. Returns
+ * whether the thread should suspend.
*
- * @param target Java debug target
+ * @param thread the current thread context
* @param breakpoint Java breakpoint
+ * @return if the thread should suspend
*/
public boolean fireBreakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
return getHitNotifier().notifyHit(thread, breakpoint);
}
-
+
/**
- * Notifies listeners that the given breakpoint is about to be installed
- * in the given type. Returns whether the breakpoint should be
- * installed.
+ * Notifies listeners that the given breakpoint is about to be installed in
+ * the given type. Returns whether the breakpoint should be installed.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
- * @param type the type the breakpoint is about to be installed in
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
+ * @param type
+ * the type the breakpoint is about to be installed in
* @return whether the breakpoint should be installed
*/
- public boolean fireInstalling(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type) {
- return getInstallingNotifier().notifyInstalling(target, breakpoint, type);
- }
-
- /**
- * Save preferences and update all debug targets when the timeout changes.
- *
- * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(JDIDebugModel.PREF_REQUEST_TIMEOUT)) {
- int value = getPluginPreferences().getInt(JDIDebugModel.PREF_REQUEST_TIMEOUT);
- IDebugTarget[] targets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
- for (int i = 0; i < targets.length; i++) {
- if (targets[i] instanceof IJavaDebugTarget) {
- ((IJavaDebugTarget)targets[i]).setRequestTimeout(value);
- }
- }
- }
+ public boolean fireInstalling(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint, IJavaType type) {
+ return getInstallingNotifier().notifyInstalling(target, breakpoint,
+ type);
}
-
+
private BreakpointNotifier getBreakpointNotifier() {
return new BreakpointNotifier();
}
-
+
abstract class AbstractNotifier implements ISafeRunnable {
-
+
private IJavaBreakpoint fBreakpoint;
private IJavaBreakpointListener fListener;
-
+
/**
* Iterates through listeners calling this notifier's safe runnable.
+ * @param breakpoint the breakpoint to notify about
*/
protected void notifyListeners(IJavaBreakpoint breakpoint) {
fBreakpoint = breakpoint;
@@ -460,31 +529,33 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
}
// breakpoint specific listener extensions
if (ids != null && ids.length > 0) {
- for (int i = 0; i < ids.length; i++) {
- fListener = fJavaBreakpointManager.getBreakpointListener(ids[i]);
+ for (String id : ids) {
+ fListener = fJavaBreakpointManager
+ .getBreakpointListener(id);
if (fListener != null) {
SafeRunner.run(this);
}
}
}
// global listener extensions
- IJavaBreakpointListener[] global = fJavaBreakpointManager.getGlobalListeners();
+ IJavaBreakpointListener[] global = fJavaBreakpointManager
+ .getGlobalListeners();
if (global.length > 0) {
- for (int i = 0; i < global.length; i++) {
- fListener = global[i];
+ for (IJavaBreakpointListener element : global) {
+ fListener = element;
SafeRunner.run(this);
}
}
// programmatic global listeners
Object[] listeners = fBreakpointListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- fListener = (IJavaBreakpointListener)listeners[i];
- SafeRunner.run(this);
+ for (Object listener : listeners) {
+ fListener = (IJavaBreakpointListener) listener;
+ SafeRunner.run(this);
}
fBreakpoint = null;
fListener = null;
}
-
+
/**
* Returns the breakpoint for which notification is proceeding or
* <code>null</code> if not in notification.
@@ -494,25 +565,25 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
protected IJavaBreakpoint getBreakpoint() {
return fBreakpoint;
}
-
+
/**
- * Returns the listener for which notification is proceeding or <code>null</code>
- * if not in notification loop.
+ * Returns the listener for which notification is proceeding or
+ * <code>null</code> if not in notification loop.
*
* @return breakpoint listener or <code>null</code>
*/
protected IJavaBreakpointListener getListener() {
return fListener;
}
- }
+ }
class BreakpointNotifier extends AbstractNotifier {
-
+
private IJavaDebugTarget fTarget;
private int fKind;
private Message[] fErrors;
private DebugException fException;
-
+
/**
* @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
*/
@@ -524,35 +595,42 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
*/
public void run() throws Exception {
switch (fKind) {
- case ADDING:
- getListener().addingBreakpoint(fTarget, getBreakpoint());
- break;
- case INSTALLED:
- getListener().breakpointInstalled(fTarget, getBreakpoint());
- break;
- case REMOVED:
- getListener().breakpointRemoved(fTarget, getBreakpoint());
- break;
- case COMPILATION_ERRORS:
- getListener().breakpointHasCompilationErrors((IJavaLineBreakpoint)getBreakpoint(), fErrors);
- break;
- case RUNTIME_EXCEPTION:
- getListener().breakpointHasRuntimeException((IJavaLineBreakpoint)getBreakpoint(), fException);
- break;
- }
+ case ADDING:
+ getListener().addingBreakpoint(fTarget, getBreakpoint());
+ break;
+ case INSTALLED:
+ getListener().breakpointInstalled(fTarget, getBreakpoint());
+ break;
+ case REMOVED:
+ getListener().breakpointRemoved(fTarget, getBreakpoint());
+ break;
+ case COMPILATION_ERRORS:
+ getListener().breakpointHasCompilationErrors(
+ (IJavaLineBreakpoint) getBreakpoint(), fErrors);
+ break;
+ case RUNTIME_EXCEPTION:
+ getListener().breakpointHasRuntimeException(
+ (IJavaLineBreakpoint) getBreakpoint(), fException);
+ break;
+ }
}
/**
- * Notifies listeners of the given addition, install, or
- * remove.
+ * Notifies listeners of the given addition, install, or remove.
*
- * @param target debug target
- * @param breakpoint the associated breakpoint
- * @param kind one of ADDED, REMOVED, INSTALLED
- * @param errors associated errors, or <code>null</code> if none
- * @param exception associated exception, or <code>null</code> if none
+ * @param target
+ * debug target
+ * @param breakpoint
+ * the associated breakpoint
+ * @param kind
+ * one of ADDED, REMOVED, INSTALLED
+ * @param errors
+ * associated errors, or <code>null</code> if none
+ * @param exception
+ * associated exception, or <code>null</code> if none
*/
- public void notify(IJavaDebugTarget target, IJavaBreakpoint breakpoint, int kind, Message[] errors, DebugException exception) {
+ public void notify(IJavaDebugTarget target, IJavaBreakpoint breakpoint,
+ int kind, Message[] errors, DebugException exception) {
fTarget = target;
fKind = kind;
fErrors = errors;
@@ -563,17 +641,17 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
fException = null;
}
}
-
+
private InstallingNotifier getInstallingNotifier() {
return new InstallingNotifier();
}
-
+
class InstallingNotifier extends AbstractNotifier {
-
+
private IJavaDebugTarget fTarget;
private IJavaType fType;
private int fInstall;
-
+
/**
* @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
*/
@@ -584,9 +662,11 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
public void run() throws Exception {
- fInstall = fInstall | getListener().installingBreakpoint(fTarget, getBreakpoint(), fType);
+ fInstall = fInstall
+ | getListener().installingBreakpoint(fTarget,
+ getBreakpoint(), fType);
}
-
+
private void dispose() {
fTarget = null;
fType = null;
@@ -597,32 +677,37 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
* in the given type. Returns whether the breakpoint should be
* installed.
*
- * @param target Java debug target
- * @param breakpoint Java breakpoint
- * @param type the type the breakpoint is about to be installed in
+ * @param target
+ * Java debug target
+ * @param breakpoint
+ * Java breakpoint
+ * @param type
+ * the type the breakpoint is about to be installed in
* @return whether the breakpoint should be installed
*/
- public boolean notifyInstalling(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type) {
+ public boolean notifyInstalling(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint, IJavaType type) {
fTarget = target;
fType = type;
fInstall = IJavaBreakpointListener.DONT_CARE;
notifyListeners(breakpoint);
dispose();
- // install if any listener voted to install, or if no one voted to not install
- return (fInstall & IJavaBreakpointListener.INSTALL) > 0 ||
- (fInstall & IJavaBreakpointListener.DONT_INSTALL) == 0;
+ // install if any listener voted to install, or if no one voted to
+ // not install
+ return (fInstall & IJavaBreakpointListener.INSTALL) > 0
+ || (fInstall & IJavaBreakpointListener.DONT_INSTALL) == 0;
}
- }
-
+ }
+
private HitNotifier getHitNotifier() {
return new HitNotifier();
}
-
+
class HitNotifier extends AbstractNotifier {
-
+
private IJavaThread fThread;
private int fSuspend;
-
+
/**
* @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
*/
@@ -634,22 +719,26 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
*/
public void run() throws Exception {
if (fThread instanceof JDIThread) {
- if (((JDIThread)fThread).hasClientRequestedSuspend()) {
- // abort notification to breakpoint listeners if a client suspend
+ if (((JDIThread) fThread).hasClientRequestedSuspend()) {
+ // abort notification to breakpoint listeners if a client
+ // suspend
// request is received
fSuspend = fSuspend | IJavaBreakpointListener.SUSPEND;
return;
}
}
- fSuspend = fSuspend | getListener().breakpointHit(fThread, getBreakpoint());
+ fSuspend = fSuspend
+ | getListener().breakpointHit(fThread, getBreakpoint());
}
/**
- * Notifies listeners that the given breakpoint has been hit.
- * Returns whether the thread should suspend.
+ * Notifies listeners that the given breakpoint has been hit. Returns
+ * whether the thread should suspend.
*
- * @param thread thread in which the breakpoint was hit
- * @param breakpoint Java breakpoint
+ * @param thread
+ * thread in which the breakpoint was hit
+ * @param breakpoint
+ * Java breakpoint
* @return whether the thread should suspend
*/
public boolean notifyHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
@@ -657,28 +746,29 @@ public class JDIDebugPlugin extends Plugin implements Preferences.IPropertyChang
fSuspend = IJavaBreakpointListener.DONT_CARE;
notifyListeners(breakpoint);
fThread = null;
- // Suspend if any listener voted to suspend or no one voted "don't suspend"
- return (fSuspend & IJavaBreakpointListener.SUSPEND) > 0 ||
- (fSuspend & IJavaBreakpointListener.DONT_SUSPEND) == 0;
+ // Suspend if any listener voted to suspend or no one voted
+ // "don't suspend"
+ return (fSuspend & IJavaBreakpointListener.SUSPEND) > 0
+ || (fSuspend & IJavaBreakpointListener.DONT_SUSPEND) == 0;
}
}
-
+
/**
- * Returns an evaluation engine for the given project in the given debug target or
- * <code>null</code> if target does not have a IJavaDebugTarget that is a JDIDebugTarget
- * implementation.
- *
- * @see JavaEvaluationEngineManager#getEvaluationEngine(IJavaProject, IJavaDebugTarget)
+ * Returns an evaluation engine for the given project in the given debug
+ * target or <code>null</code> if target does not have a IJavaDebugTarget
+ * that is a JDIDebugTarget implementation.
*
* @param project java project
* @param target the debug target
* @return evaluation engine or <code>null</code>
*/
- public IAstEvaluationEngine getEvaluationEngine(IJavaProject project, IJavaDebugTarget target) {
+ public IAstEvaluationEngine getEvaluationEngine(IJavaProject project,
+ IJavaDebugTarget target) {
// get adapter for those that wrapper us
- IJavaDebugTarget javaTarget = (IJavaDebugTarget) target.getAdapter(IJavaDebugTarget.class);
+ IJavaDebugTarget javaTarget = (IJavaDebugTarget) target
+ .getAdapter(IJavaDebugTarget.class);
if (javaTarget instanceof JDIDebugTarget) {
- return ((JDIDebugTarget)javaTarget).getEvaluationEngine(project);
+ return ((JDIDebugTarget) javaTarget).getEvaluationEngine(project);
}
return null;
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPluginPreferenceInitializer.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPluginPreferenceInitializer.java
index 28c88ae32..7cf10a948 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPluginPreferenceInitializer.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JDIDebugPluginPreferenceInitializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,31 +10,36 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core;
-import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jdt.debug.core.IJavaBreakpoint;
import org.eclipse.jdt.debug.core.JDIDebugModel;
-public class JDIDebugPluginPreferenceInitializer extends AbstractPreferenceInitializer {
+public class JDIDebugPluginPreferenceInitializer extends
+ AbstractPreferenceInitializer {
public JDIDebugPluginPreferenceInitializer() {
super();
}
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
+ * initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
- Preferences prefs = JDIDebugPlugin.getDefault().getPluginPreferences();
- prefs.setDefault(JDIDebugModel.PREF_REQUEST_TIMEOUT, JDIDebugModel.DEF_REQUEST_TIMEOUT);
- prefs.setDefault(JDIDebugModel.PREF_HCR_WITH_COMPILATION_ERRORS, true);
- prefs.setDefault(JDIDebugModel.PREF_SUSPEND_FOR_BREAKPOINTS_DURING_EVALUATION, true);
- prefs.setDefault(JDIDebugPlugin.PREF_DEFAULT_BREAKPOINT_SUSPEND_POLICY, IJavaBreakpoint.SUSPEND_THREAD);
- //0 is the first index, meaning both access and modification
- prefs.setDefault(JDIDebugPlugin.PREF_DEFAULT_WATCHPOINT_SUSPEND_POLICY, 0);
- prefs.setDefault(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW, false);
- prefs.setDefault(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT, 100);
- prefs.setDefault(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT, 100);
- prefs.addPropertyChangeListener(JDIDebugPlugin.getDefault());
+ IEclipsePreferences node = DefaultScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ node.putInt(JDIDebugModel.PREF_REQUEST_TIMEOUT, JDIDebugModel.DEF_REQUEST_TIMEOUT);
+ node.putBoolean(JDIDebugModel.PREF_HCR_WITH_COMPILATION_ERRORS, true);
+ node.putBoolean(JDIDebugModel.PREF_SUSPEND_FOR_BREAKPOINTS_DURING_EVALUATION, true);
+ node.putInt(JDIDebugPlugin.PREF_DEFAULT_BREAKPOINT_SUSPEND_POLICY, IJavaBreakpoint.SUSPEND_THREAD);
+ // 0 is the first index, meaning both access and modification
+ node.putInt(JDIDebugPlugin.PREF_DEFAULT_WATCHPOINT_SUSPEND_POLICY, 0);
+ node.putBoolean(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW, false);
+ node.putInt(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT, 100);
+ node.putInt(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT, 100);
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugPropertyTester.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugPropertyTester.java
index 6a066b3be..70d078745 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugPropertyTester.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugPropertyTester.java
@@ -20,22 +20,27 @@ import org.eclipse.jdt.debug.core.IJavaStackFrame;
*/
public class JavaDebugPropertyTester extends PropertyTester {
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (property.equals("isMultiStrata")) { //$NON-NLS-1$
- if (receiver instanceof IStackFrame) {
- IJavaStackFrame frame = (IJavaStackFrame) ((IStackFrame)receiver).getAdapter(IJavaStackFrame.class);
- if (frame != null) {
- try {
- return frame.getReferenceType().getAvailableStrata().length > 1;
- } catch (DebugException e) {
- }
- }
- }
- }
- return false;
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object,
+ * java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+ if (property.equals("isMultiStrata")) { //$NON-NLS-1$
+ if (receiver instanceof IStackFrame) {
+ IJavaStackFrame frame = (IJavaStackFrame) ((IStackFrame) receiver)
+ .getAdapter(IJavaStackFrame.class);
+ if (frame != null) {
+ try {
+ return frame.getReferenceType().getAvailableStrata().length > 1;
+ } catch (DebugException e) {
+ }
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugUtils.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugUtils.java
index 0795b1d56..df9a294e7 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugUtils.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaDebugUtils.java
@@ -51,73 +51,82 @@ import com.sun.jdi.VMDisconnectedException;
*/
public class JavaDebugUtils {
- /**
- * Resolves and returns a type from the Java model that corresponds to the
- * declaring type of the given stack frame, or <code>null</code> if none.
- *
- * @param frame frame to resolve declaring type for
- * @return corresponding Java model type or <code>null</code>
- * @exception CoreException if an exception occurs during the resolution
- * @since 3.2
- */
- public static IType resolveDeclaringType(IJavaStackFrame frame) throws CoreException {
- IJavaElement javaElement = resolveJavaElement(frame, frame.getLaunch());
- if (javaElement != null) {
- return resolveType(frame.getDeclaringTypeName(), javaElement);
- }
- return null;
- }
-
- /**
- * Resolves and returns a type from the Java model that corresponds to the
- * type of the given value, or <code>null</code> if none.
- *
- * @param value value to resolve type for
- * @return corresponding Java model type or <code>null</code>
- * @exception CoreException if an exception occurs during the resolution
- */
- public static IType resolveType(IJavaValue value) throws CoreException {
- IJavaElement javaElement = resolveJavaElement(value, value.getLaunch());
- if (javaElement != null) {
- return resolveType(value.getJavaType().getName(), javaElement);
- }
- return null;
- }
-
- /**
- * Resolves and returns the Java model type associated with the given
- * Java debug type, or <code>null</code> if none.
- *
- * @param type Java debug model type
- * @return Java model type or <code>null</code>
- * @throws CoreException
- */
- public static IType resolveType(IJavaType type) throws CoreException {
- IJavaElement element = resolveJavaElement(type, type.getLaunch());
- if (element != null ) {
- return resolveType(type.getName(), element);
- }
- return null;
- }
-
/**
- * Returns the source name associated with the given object, or <code>null</code>
- * if none.
+ * Resolves and returns a type from the Java model that corresponds to the
+ * declaring type of the given stack frame, or <code>null</code> if none.
*
- * @param object an object with an <code>IJavaStackFrame</code> adapter, an IJavaValue
- * or an IJavaType
- * @return the source name associated with the given object, or <code>null</code>
- * if none
- * @exception CoreException if unable to retrieve the source name
+ * @param frame
+ * frame to resolve declaring type for
+ * @return corresponding Java model type or <code>null</code>
+ * @exception CoreException
+ * if an exception occurs during the resolution
+ * @since 3.2
+ */
+ public static IType resolveDeclaringType(IJavaStackFrame frame)
+ throws CoreException {
+ IJavaElement javaElement = resolveJavaElement(frame, frame.getLaunch());
+ if (javaElement != null) {
+ return resolveType(frame.getDeclaringTypeName(), javaElement);
+ }
+ return null;
+ }
+
+ /**
+ * Resolves and returns a type from the Java model that corresponds to the
+ * type of the given value, or <code>null</code> if none.
+ *
+ * @param value
+ * value to resolve type for
+ * @return corresponding Java model type or <code>null</code>
+ * @exception CoreException
+ * if an exception occurs during the resolution
+ */
+ public static IType resolveType(IJavaValue value) throws CoreException {
+ IJavaElement javaElement = resolveJavaElement(value, value.getLaunch());
+ if (javaElement != null) {
+ return resolveType(value.getJavaType().getName(), javaElement);
+ }
+ return null;
+ }
+
+ /**
+ * Resolves and returns the Java model type associated with the given Java
+ * debug type, or <code>null</code> if none.
+ *
+ * @param type
+ * Java debug model type
+ * @return Java model type or <code>null</code>
+ * @throws CoreException if resolving the type fails
+ */
+ public static IType resolveType(IJavaType type) throws CoreException {
+ IJavaElement element = resolveJavaElement(type, type.getLaunch());
+ if (element != null) {
+ return resolveType(type.getName(), element);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the source name associated with the given object, or
+ * <code>null</code> if none.
+ *
+ * @param object
+ * an object with an <code>IJavaStackFrame</code> adapter, an
+ * IJavaValue or an IJavaType
+ * @return the source name associated with the given object, or
+ * <code>null</code> if none
+ * @exception CoreException
+ * if unable to retrieve the source name
*/
public static String getSourceName(Object object) throws CoreException {
if (object instanceof String) {
// assume it's a file name
- return (String)object;
+ return (String) object;
}
IJavaStackFrame frame = null;
if (object instanceof IAdaptable) {
- frame = (IJavaStackFrame) ((IAdaptable)object).getAdapter(IJavaStackFrame.class);
+ frame = (IJavaStackFrame) ((IAdaptable) object)
+ .getAdapter(IJavaStackFrame.class);
}
String typeName = null;
try {
@@ -136,23 +145,24 @@ public class JavaDebugUtils {
} else {
if (object instanceof IJavaValue) {
// look at its type
- object = ((IJavaValue)object).getJavaType();
+ object = ((IJavaValue) object).getJavaType();
}
if (object instanceof IJavaReferenceType) {
- IJavaReferenceType refType = (IJavaReferenceType)object;
+ IJavaReferenceType refType = (IJavaReferenceType) object;
String[] sourcePaths = refType.getSourcePaths(null);
if (sourcePaths != null && sourcePaths.length > 0) {
return sourcePaths[0];
}
}
if (object instanceof IJavaType) {
- typeName = ((IJavaType)object).getName();
+ typeName = ((IJavaType) object).getName();
}
}
} catch (DebugException e) {
int code = e.getStatus().getCode();
- if (code == IJavaThread.ERR_THREAD_NOT_SUSPENDED || code == IJavaStackFrame.ERR_INVALID_STACK_FRAME ||
- e.getStatus().getException() instanceof VMDisconnectedException) {
+ if (code == IJavaThread.ERR_THREAD_NOT_SUSPENDED
+ || code == IJavaStackFrame.ERR_INVALID_STACK_FRAME
+ || e.getStatus().getException() instanceof VMDisconnectedException) {
return null;
}
throw e;
@@ -161,15 +171,16 @@ public class JavaDebugUtils {
return generateSourceName(typeName);
}
return null;
- }
-
+ }
+
/**
* Generates and returns a source file path based on a qualified type name.
- * For example, when <code>java.lang.String</code> is provided,
- * the returned source name is <code>java/lang/String.java</code>.
+ * For example, when <code>java.lang.String</code> is provided, the returned
+ * source name is <code>java/lang/String.java</code>.
*
- * @param qualifiedTypeName fully qualified type name that may contain inner types
- * denoted with <code>$</code> character
+ * @param qualifiedTypeName
+ * fully qualified type name that may contain inner types denoted
+ * with <code>$</code> character
* @return a source file path corresponding to the type name
*/
public static String generateSourceName(String qualifiedTypeName) {
@@ -189,190 +200,220 @@ public class JavaDebugUtils {
qualifiedTypeName = qualifiedTypeName + ".java"; //$NON-NLS-1$
}
return qualifiedTypeName;
- }
-
- /**
- * Resolves the type corresponding to the given name contained in the given top-level
- * Java element (class file, compilation unit, or type).
- *
- * @param qualifiedName fully qualified type name
- * @param javaElement java element containing the type
- * @return type
- */
- private static IType resolveType(final String qualifiedName, IJavaElement javaElement) {
- IType type = null;
- String[] typeNames = getNestedTypeNames(qualifiedName);
- if (javaElement instanceof IClassFile) {
- type = ((IClassFile)javaElement).getType();
- } else if (javaElement instanceof ICompilationUnit) {
- type = ((ICompilationUnit)javaElement).getType(typeNames[0]);
- } else if (javaElement instanceof IType) {
- type = (IType)javaElement;
- }
- if (type != null) {
- for (int i = 1; i < typeNames.length; i++) {
- String innerTypeName= typeNames[i];
-
- class ResultException extends RuntimeException {
- private static final long serialVersionUID= 1L;
+ }
+
+ /**
+ * Resolves the type corresponding to the given name contained in the given
+ * top-level Java element (class file, compilation unit, or type).
+ *
+ * @param qualifiedName
+ * fully qualified type name
+ * @param javaElement
+ * java element containing the type
+ * @return type
+ */
+ private static IType resolveType(final String qualifiedName,
+ IJavaElement javaElement) {
+ IType type = null;
+ String[] typeNames = getNestedTypeNames(qualifiedName);
+ if (javaElement instanceof IClassFile) {
+ type = ((IClassFile) javaElement).getType();
+ } else if (javaElement instanceof ICompilationUnit) {
+ type = ((ICompilationUnit) javaElement).getType(typeNames[0]);
+ } else if (javaElement instanceof IType) {
+ type = (IType) javaElement;
+ }
+ if (type != null) {
+ for (int i = 1; i < typeNames.length; i++) {
+ String innerTypeName = typeNames[i];
+
+ class ResultException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
private final IType fResult;
- public ResultException(IType result) {
- fResult= result;
- }
- }
- if (innerTypeName.length() > 0) {
- try {
- Integer.parseInt(innerTypeName.substring(0, 1)); // throws NFE if not an integer
-
- // perform expensive lookup for anonymous types:
- ASTParser parser = ASTParser.newParser(AST.JLS4);
- parser.setResolveBindings(true);
- parser.setSource(type.getTypeRoot());
- CompilationUnit cu = (CompilationUnit) parser.createAST(null);
- cu.accept(new ASTVisitor(false) {
- public boolean visit(AnonymousClassDeclaration node) {
- ITypeBinding binding = node.resolveBinding();
- if (binding == null)
- return false;
- if (qualifiedName.equals(binding.getBinaryName()))
- throw new ResultException((IType) binding.getJavaElement());
- return true;
- }
- public boolean visit(TypeDeclaration node) {
- ITypeBinding binding = node.resolveBinding();
- if (binding == null)
- return false;
- if (qualifiedName.equals(binding.getBinaryName()))
- throw new ResultException((IType) binding.getJavaElement());
- return true;
- }
- });
- return type; // return enclosing type if exact type not found
- } catch (NumberFormatException e) {
- // normal nested type, continue
- } catch (IllegalStateException e) {
- return type; // binary class without source
- } catch (ResultException e) {
- return e.fResult;
- }
- }
- type = type.getType(innerTypeName);
- }
- }
- return type;
- }
-
- /**
- * Returns the Java element corresponding to the given object or <code>null</code>
- * if none, in the context of the given launch.
- *
- * @param launch provides source locator
- * @param object object to resolve Java model element for
- * @return corresponding Java element or <code>null</code>
- * @throws CoreException
- */
- public static IJavaElement resolveJavaElement(Object object, ILaunch launch) throws CoreException {
- Object sourceElement = resolveSourceElement(object, launch);
- return getJavaElement(sourceElement);
- }
+
+ public ResultException(IType result) {
+ fResult = result;
+ }
+ }
+ if (innerTypeName.length() > 0) {
+ try {
+ Integer.parseInt(innerTypeName.substring(0, 1)); // throws
+ // NFE
+ // if
+ // not
+ // an
+ // integer
+
+ // perform expensive lookup for anonymous types:
+ ASTParser parser = ASTParser.newParser(AST.JLS4);
+ parser.setResolveBindings(true);
+ parser.setSource(type.getTypeRoot());
+ CompilationUnit cu = (CompilationUnit) parser
+ .createAST(null);
+ cu.accept(new ASTVisitor(false) {
+ @Override
+ public boolean visit(AnonymousClassDeclaration node) {
+ ITypeBinding binding = node.resolveBinding();
+ if (binding == null)
+ return false;
+ if (qualifiedName.equals(binding
+ .getBinaryName()))
+ throw new ResultException((IType) binding
+ .getJavaElement());
+ return true;
+ }
+
+ @Override
+ public boolean visit(TypeDeclaration node) {
+ ITypeBinding binding = node.resolveBinding();
+ if (binding == null)
+ return false;
+ if (qualifiedName.equals(binding
+ .getBinaryName()))
+ throw new ResultException((IType) binding
+ .getJavaElement());
+ return true;
+ }
+ });
+ return type; // return enclosing type if exact type not
+ // found
+ } catch (NumberFormatException e) {
+ // normal nested type, continue
+ } catch (IllegalStateException e) {
+ return type; // binary class without source
+ } catch (ResultException e) {
+ return e.fResult;
+ }
+ }
+ type = type.getType(innerTypeName);
+ }
+ }
+ return type;
+ }
+
+ /**
+ * Returns the Java element corresponding to the given object or
+ * <code>null</code> if none, in the context of the given launch.
+ *
+ * @param launch
+ * provides source locator
+ * @param object
+ * object to resolve Java model element for
+ * @return corresponding Java element or <code>null</code>
+ * @throws CoreException if an exception occurs
+ */
+ public static IJavaElement resolveJavaElement(Object object, ILaunch launch)
+ throws CoreException {
+ Object sourceElement = resolveSourceElement(object, launch);
+ return getJavaElement(sourceElement);
+ }
/**
- * Returns the {@link IJavaElement} associated with the given source element or <code>null</code>
- * if none.
+ * Returns the {@link IJavaElement} associated with the given source element
+ * or <code>null</code> if none.
*
- * @param sourceElement a java element, object that adapts to a java element, or a resource
+ * @param sourceElement
+ * a java element, object that adapts to a java element, or a
+ * resource
* @return corresponding {@link IJavaElement} or <code>null</code>
* @since 3.4.0
*/
public static IJavaElement getJavaElement(Object sourceElement) {
IJavaElement javaElement = null;
- if (sourceElement instanceof IJavaElement) {
- javaElement = (IJavaElement) sourceElement;
- } else if (sourceElement instanceof IAdaptable) {
- javaElement = (IJavaElement) ((IAdaptable)sourceElement).getAdapter(IJavaElement.class);
- }
- if (javaElement == null && sourceElement instanceof IResource) {
- javaElement= JavaCore.create((IResource)sourceElement);
- }
- if (javaElement == null) {
- return null;
- }
- if (!javaElement.exists()) {
- return null;
- }
- return javaElement;
- }
-
- /**
- * Returns the source element corresponding to the given object or <code>null</code>
- * if none, in the context of the given launch.
- *
- * @param launch provides source locator
- * @param object object to resolve source element for
- * @return corresponding source element or <code>null</code>
- * @throws CoreException
- */
- public static Object resolveSourceElement(Object object, ILaunch launch) throws CoreException {
- ISourceLocator sourceLocator = launch.getSourceLocator();
+ if (sourceElement instanceof IJavaElement) {
+ javaElement = (IJavaElement) sourceElement;
+ } else if (sourceElement instanceof IAdaptable) {
+ javaElement = (IJavaElement) ((IAdaptable) sourceElement)
+ .getAdapter(IJavaElement.class);
+ }
+ if (javaElement == null && sourceElement instanceof IResource) {
+ javaElement = JavaCore.create((IResource) sourceElement);
+ }
+ if (javaElement == null) {
+ return null;
+ }
+ if (!javaElement.exists()) {
+ return null;
+ }
+ return javaElement;
+ }
+
+ /**
+ * Returns the source element corresponding to the given object or
+ * <code>null</code> if none, in the context of the given launch.
+ *
+ * @param launch
+ * provides source locator
+ * @param object
+ * object to resolve source element for
+ * @return corresponding source element or <code>null</code>
+ * @throws CoreException if an exception occurs
+ */
+ public static Object resolveSourceElement(Object object, ILaunch launch)
+ throws CoreException {
+ ISourceLocator sourceLocator = launch.getSourceLocator();
if (sourceLocator instanceof ISourceLookupDirector) {
ISourceLookupDirector director = (ISourceLookupDirector) sourceLocator;
Object[] objects = director.findSourceElements(object);
if (objects.length > 0) {
- return objects[0];
+ return objects[0];
}
}
return null;
- }
+ }
+
+ /**
+ * Returns an array of simple type names that are part of the given type's
+ * qualified name. For example, if the given name is <code>x.y.A$B</code>,
+ * an array with <code>["A", "B"]</code> is returned.
+ *
+ * @param typeName
+ * fully qualified type name
+ * @return array of nested type names
+ */
+ private static String[] getNestedTypeNames(String typeName) {
+ int index = typeName.lastIndexOf('.');
+ if (index >= 0) {
+ typeName = typeName.substring(index + 1);
+ }
+ index = typeName.indexOf('$');
+ List<String> list = new ArrayList<String>(1);
+ while (index >= 0) {
+ list.add(typeName.substring(0, index));
+ typeName = typeName.substring(index + 1);
+ index = typeName.indexOf('$');
+ }
+ list.add(typeName);
+ return list.toArray(new String[list.size()]);
+ }
- /**
- * Returns an array of simple type names that are
- * part of the given type's qualified name. For
- * example, if the given name is <code>x.y.A$B</code>,
- * an array with <code>["A", "B"]</code> is returned.
- *
- * @param typeName fully qualified type name
- * @return array of nested type names
- */
- private static String[] getNestedTypeNames(String typeName) {
- int index = typeName.lastIndexOf('.');
- if (index >= 0) {
- typeName= typeName.substring(index + 1);
- }
- index = typeName.indexOf('$');
- List list = new ArrayList(1);
- while (index >= 0) {
- list.add(typeName.substring(0, index));
- typeName = typeName.substring(index + 1);
- index = typeName.indexOf('$');
- }
- list.add(typeName);
- return (String[])list.toArray(new String[list.size()]);
- }
-
- /**
- * Returns the class file or compilation unit containing the given fully qualified name in the
- * specified project. All registered java like file extensions are considered.
- *
- * @param qualifiedTypeName fully qualified type name
- * @param project project to search in
- * @return class file or compilation unit or <code>null</code>
- */
- public static IJavaElement findElement(String qualifiedTypeName, IJavaProject project) throws CoreException{
- String[] javaLikeExtensions = JavaCore.getJavaLikeExtensions();
- String path = qualifiedTypeName;
+ /**
+ * Returns the class file or compilation unit containing the given fully
+ * qualified name in the specified project. All registered java like file
+ * extensions are considered.
+ *
+ * @param qualifiedTypeName
+ * fully qualified type name
+ * @param project
+ * project to search in
+ * @return class file or compilation unit or <code>null</code>
+ * @throws CoreException if an exception occurs
+ */
+ public static IJavaElement findElement(String qualifiedTypeName, IJavaProject project) throws CoreException {
+ String[] javaLikeExtensions = JavaCore.getJavaLikeExtensions();
+ String path = qualifiedTypeName;
int pos = path.indexOf('$');
if (pos != -1) {
- path= path.substring(0, pos);
+ path = path.substring(0, pos);
}
path = path.replace('.', IPath.SEPARATOR);
path += "."; //$NON-NLS-1$
- for (int i = 0; i < javaLikeExtensions.length; i++) {
- String ext = javaLikeExtensions[i];
+ for (String ext : javaLikeExtensions) {
IJavaElement element = project.findElement(new Path(path + ext));
if (element != null) {
return element;
}
}
- return null;
- }
+ return null;
+ }
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/BreakpointListenerManager.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/BreakpointListenerManager.java
index 5c16e4699..41ec23895 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/BreakpointListenerManager.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/BreakpointListenerManager.java
@@ -42,57 +42,65 @@ public class BreakpointListenerManager {
/**
* Map java breakpoint listeners by id
*/
- private static Map fgJavaBreakpointListenersMap;
-
+ private static Map<String, JavaBreakpointListenerProxy> fgJavaBreakpointListenersMap;
+
/**
* Global listeners
*/
private static IJavaBreakpointListener[] fgGlobalListeners;
-
+
private static final String VALUE_GLOBAL = "*"; //$NON-NLS-1$
private static final String ATTR_ID = "id"; //$NON-NLS-1$
private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
private static final String ATTR_FILTER = "filter"; //$NON-NLS-1$
-
+
/**
* Proxy to a breakpoint listener
*/
- private class JavaBreakpointListenerProxy implements IJavaBreakpointListener {
+ private class JavaBreakpointListenerProxy implements
+ IJavaBreakpointListener {
private IConfigurationElement fConfigElement;
private IJavaBreakpointListener fDelegate;
-
+
public JavaBreakpointListenerProxy(IConfigurationElement element) {
fConfigElement = element;
}
-
+
/**
* Returns the underlying delegate or <code>null</code> if none/error
*
* @return breakpoint listener extension
*/
private synchronized IJavaBreakpointListener getDelegate() {
- if (fDelegate == null) {
+ if (fDelegate == null) {
try {
- fDelegate = (IJavaBreakpointListener) fConfigElement.createExecutableExtension(ATTR_CLASS);
+ fDelegate = (IJavaBreakpointListener) fConfigElement
+ .createExecutableExtension(ATTR_CLASS);
} catch (CoreException e) {
JDIDebugPlugin.log(e);
}
}
-
- return fDelegate;
+
+ return fDelegate;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#addingBreakpoint(org.eclipse.jdt.debug.core.IJavaDebugTarget, org.eclipse.jdt.debug.core.IJavaBreakpoint)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpointListener#addingBreakpoint
+ * (org.eclipse.jdt.debug.core.IJavaDebugTarget,
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint)
*/
- public void addingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void addingBreakpoint(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
IJavaBreakpointListener delegate = getDelegate();
if (delegate != null) {
delegate.addingBreakpoint(target, breakpoint);
}
}
-
+
/**
* Whether this listener is for all breakpoints.
*
@@ -106,28 +114,45 @@ public class BreakpointListenerManager {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointHasCompilationErrors(org.eclipse.jdt.debug.core.IJavaLineBreakpoint, org.eclipse.jdt.core.dom.Message[])
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#
+ * breakpointHasCompilationErrors
+ * (org.eclipse.jdt.debug.core.IJavaLineBreakpoint,
+ * org.eclipse.jdt.core.dom.Message[])
*/
- public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors) {
+ public void breakpointHasCompilationErrors(
+ IJavaLineBreakpoint breakpoint, Message[] errors) {
IJavaBreakpointListener delegate = getDelegate();
if (delegate != null) {
delegate.breakpointHasCompilationErrors(breakpoint, errors);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointHasRuntimeException(org.eclipse.jdt.debug.core.IJavaLineBreakpoint, org.eclipse.debug.core.DebugException)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#
+ * breakpointHasRuntimeException
+ * (org.eclipse.jdt.debug.core.IJavaLineBreakpoint,
+ * org.eclipse.debug.core.DebugException)
*/
- public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception) {
+ public void breakpointHasRuntimeException(
+ IJavaLineBreakpoint breakpoint, DebugException exception) {
IJavaBreakpointListener delegate = getDelegate();
if (delegate != null) {
delegate.breakpointHasRuntimeException(breakpoint, exception);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointHit(org.eclipse.jdt.debug.core.IJavaThread, org.eclipse.jdt.debug.core.IJavaBreakpoint)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointHit(
+ * org.eclipse.jdt.debug.core.IJavaThread,
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint)
*/
public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
IJavaBreakpointListener delegate = getDelegate();
@@ -137,54 +162,82 @@ public class BreakpointListenerManager {
return IJavaBreakpointListener.DONT_CARE;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointInstalled(org.eclipse.jdt.debug.core.IJavaDebugTarget, org.eclipse.jdt.debug.core.IJavaBreakpoint)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointInstalled
+ * (org.eclipse.jdt.debug.core.IJavaDebugTarget,
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint)
*/
- public void breakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void breakpointInstalled(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
IJavaBreakpointListener delegate = getDelegate();
if (delegate != null) {
delegate.breakpointInstalled(target, breakpoint);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointRemoved(org.eclipse.jdt.debug.core.IJavaDebugTarget, org.eclipse.jdt.debug.core.IJavaBreakpoint)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpointListener#breakpointRemoved
+ * (org.eclipse.jdt.debug.core.IJavaDebugTarget,
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint)
*/
- public void breakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void breakpointRemoved(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
IJavaBreakpointListener delegate = getDelegate();
if (delegate != null) {
delegate.breakpointRemoved(target, breakpoint);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpointListener#installingBreakpoint(org.eclipse.jdt.debug.core.IJavaDebugTarget, org.eclipse.jdt.debug.core.IJavaBreakpoint, org.eclipse.jdt.debug.core.IJavaType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpointListener#installingBreakpoint
+ * (org.eclipse.jdt.debug.core.IJavaDebugTarget,
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint,
+ * org.eclipse.jdt.debug.core.IJavaType)
*/
- public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type) {
+ public int installingBreakpoint(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint, IJavaType type) {
IJavaBreakpointListener delegate = getDelegate();
if (delegate != null) {
return delegate.installingBreakpoint(target, breakpoint, type);
}
return IJavaBreakpointListener.DONT_CARE;
}
-
+
}
-
+
/**
* Load extensions.
*/
private synchronized void init() {
if (fgJavaBreakpointListenersMap == null) {
- fgJavaBreakpointListenersMap = new HashMap();
- List global = new ArrayList();
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.EXTENSION_POINT_JAVA_BREAKPOINT_LISTENERS);
- IConfigurationElement[] actionDelegateElements= extensionPoint.getConfigurationElements();
- for (int i= 0; i < actionDelegateElements.length; i++) {
+ fgJavaBreakpointListenersMap = new HashMap<String, JavaBreakpointListenerProxy>();
+ List<JavaBreakpointListenerProxy> global = new ArrayList<JavaBreakpointListenerProxy>();
+ IExtensionPoint extensionPoint = Platform
+ .getExtensionRegistry()
+ .getExtensionPoint(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.EXTENSION_POINT_JAVA_BREAKPOINT_LISTENERS);
+ IConfigurationElement[] actionDelegateElements = extensionPoint
+ .getConfigurationElements();
+ for (IConfigurationElement actionDelegateElement : actionDelegateElements) {
try {
- String id = actionDelegateElements[i].getAttribute(ATTR_ID);
+ String id = actionDelegateElement.getAttribute(ATTR_ID);
if (id == null)
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), "Java breakpoint listener requires an identifier attribute.")); //$NON-NLS-1$
- JavaBreakpointListenerProxy listener = new JavaBreakpointListenerProxy(actionDelegateElements[i]);
+ throw new CoreException(
+ new Status(IStatus.ERROR, JDIDebugPlugin
+ .getUniqueIdentifier(),
+ "Java breakpoint listener requires an identifier attribute.")); //$NON-NLS-1$
+ JavaBreakpointListenerProxy listener = new JavaBreakpointListenerProxy(
+ actionDelegateElement);
fgJavaBreakpointListenersMap.put(id, listener);
if (listener.isGlobal()) {
global.add(listener);
@@ -193,25 +246,27 @@ public class BreakpointListenerManager {
JDIDebugPlugin.log(e);
}
}
- fgGlobalListeners = (IJavaBreakpointListener[]) global.toArray(new IJavaBreakpointListener[global.size()]);
+ fgGlobalListeners = global
+ .toArray(new IJavaBreakpointListener[global.size()]);
}
}
/**
- * Returns the listener registered with the given identifier or <code>null</code>
- * if none.
+ * Returns the listener registered with the given identifier or
+ * <code>null</code> if none.
*
- * @param id extension identifier
+ * @param id
+ * extension identifier
* @return breakpoint listener or <code>null</code>
*/
public IJavaBreakpointListener getBreakpointListener(String id) {
init();
- return (IJavaBreakpointListener)fgJavaBreakpointListenersMap.get(id);
+ return fgJavaBreakpointListenersMap.get(id);
}
/**
- * Returns breakpoint listener extensions registered to listen for changes to
- * all breakpoints.
+ * Returns breakpoint listener extensions registered to listen for changes
+ * to all breakpoints.
*
* @return global listeners
*/
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java
index 013f821dc..4d4b231cd 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,50 +44,51 @@ import com.sun.jdi.VMDisconnectedException;
* @since 3.5
*/
public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
-
+
/**
* Whether the condition had compile or runtime errors
*/
private boolean fHasErrors = false;
-
+
/**
- * Listens for evaluation completion for condition evaluation.
- * If an evaluation evaluates <code>true</code> or has an error, this breakpoint
- * will suspend the thread in which the breakpoint was hit.
- * If the evaluation returns <code>false</code>, the thread is resumed.
+ * Listens for evaluation completion for condition evaluation. If an
+ * evaluation evaluates <code>true</code> or has an error, this breakpoint
+ * will suspend the thread in which the breakpoint was hit. If the
+ * evaluation returns <code>false</code>, the thread is resumed.
*/
class EvaluationListener implements IEvaluationListener {
-
+
/**
* Lock for synchronizing evaluation
*/
private Object fLock = new Object();
-
+
/**
* The breakpoint that was hit
*/
private JavaLineBreakpoint fBreakpoint;
-
+
/**
* Result of the vote
*/
private int fVote;
-
+
EvaluationListener(JavaLineBreakpoint breakpoint) {
fBreakpoint = breakpoint;
}
-
+
public void evaluationComplete(IEvaluationResult result) {
fVote = determineVote(result);
synchronized (fLock) {
fLock.notifyAll();
}
}
-
+
/**
* Processes the result to determine whether to suspend or resume.
*
- * @param result evaluation result
+ * @param result
+ * evaluation result
* @return vote
*/
private int determineVote(IEvaluationResult result) {
@@ -95,10 +96,11 @@ public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
// indicates the user terminated the evaluation
return SUSPEND;
}
- JDIThread thread= (JDIThread)result.getThread();
+ JDIThread thread = (JDIThread) result.getThread();
if (result.hasErrors()) {
- DebugException exception= result.getException();
- Throwable wrappedException= exception.getStatus().getException();
+ DebugException exception = result.getException();
+ Throwable wrappedException = exception.getStatus()
+ .getException();
if (wrappedException instanceof VMDisconnectedException) {
// VM terminated/disconnected during evaluation
return DONT_SUSPEND;
@@ -108,12 +110,13 @@ public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
}
} else {
try {
- IValue value= result.getValue();
+ IValue value = result.getValue();
if (fBreakpoint.isConditionSuspendOnTrue()) {
if (value instanceof IJavaPrimitiveValue) {
// Suspend when the condition evaluates true
- IJavaPrimitiveValue javaValue= (IJavaPrimitiveValue)value;
- if (javaValue.getJavaType().getName().equals("boolean")) { //$NON-NLS-1$
+ IJavaPrimitiveValue javaValue = (IJavaPrimitiveValue) value;
+ if (javaValue.getJavaType().getName()
+ .equals("boolean")) { //$NON-NLS-1$
if (javaValue.getBooleanValue()) {
return SUSPEND;
} else {
@@ -121,14 +124,17 @@ public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
}
}
}
+ IStatus status = new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ MessageFormat.format(JDIDebugBreakpointMessages.ConditionalBreakpointHandler_1, value.getReferenceTypeName()));
// result was not boolean
- fireConditionHasRuntimeErrors(fBreakpoint, new DebugException(
- new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(),
- MessageFormat.format(JDIDebugBreakpointMessages.ConditionalBreakpointHandler_1, new String[]{value.getReferenceTypeName()}))));
+ fireConditionHasRuntimeErrors(fBreakpoint, new DebugException(status));
return SUSPEND;
} else {
- IDebugTarget debugTarget= thread.getDebugTarget();
- IValue lastValue= fBreakpoint.setCurrentConditionValue(debugTarget, value);
+ IDebugTarget debugTarget = thread.getDebugTarget();
+ IValue lastValue = fBreakpoint
+ .setCurrentConditionValue(debugTarget, value);
if (!value.equals(lastValue)) {
return SUSPEND;
} else {
@@ -142,17 +148,17 @@ public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
}
}
}
-
+
/**
- * Result of the conditional expression evaluation - to resume or not resume, that
- * is the question.
+ * Result of the conditional expression evaluation - to resume or not
+ * resume, that is the question.
*
* @return vote result
*/
int getVote() {
return fVote;
}
-
+
/**
* Returns the lock object to synchronize this evaluation.
*
@@ -161,56 +167,77 @@ public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
Object getLock() {
return fLock;
}
- }
+ }
- public void addingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void addingBreakpoint(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
}
- public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors) {
+ public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint,
+ Message[] errors) {
}
- public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception) {
+ public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint,
+ DebugException exception) {
}
public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
if (breakpoint instanceof IJavaLineBreakpoint) {
JavaLineBreakpoint lineBreakpoint = (JavaLineBreakpoint) breakpoint;
try {
- final String condition= lineBreakpoint.getCondition();
+ final String condition = lineBreakpoint.getCondition();
if (condition == null) {
return SUSPEND;
}
- EvaluationListener listener= new EvaluationListener(lineBreakpoint);
- IJavaStackFrame frame = (IJavaStackFrame) thread.getTopStackFrame();
- IJavaProject project= lineBreakpoint.getJavaProject(frame);
+ EvaluationListener listener = new EvaluationListener(
+ lineBreakpoint);
+ IJavaStackFrame frame = (IJavaStackFrame) thread
+ .getTopStackFrame();
+ IJavaProject project = lineBreakpoint.getJavaProject(frame);
if (project == null) {
- fireConditionHasErrors(lineBreakpoint, new Message[]{new Message(JDIDebugBreakpointMessages.JavaLineBreakpoint_Unable_to_compile_conditional_breakpoint___missing_Java_project_context__1, -1)});
+ fireConditionHasErrors(
+ lineBreakpoint,
+ new Message[] { new Message(
+ JDIDebugBreakpointMessages.JavaLineBreakpoint_Unable_to_compile_conditional_breakpoint___missing_Java_project_context__1,
+ -1) });
return SUSPEND;
}
- IJavaDebugTarget target = (IJavaDebugTarget) thread.getDebugTarget();
- IAstEvaluationEngine engine = getEvaluationEngine(target, project);
+ IJavaDebugTarget target = (IJavaDebugTarget) thread
+ .getDebugTarget();
+ IAstEvaluationEngine engine = getEvaluationEngine(target,
+ project);
if (engine == null) {
// If no engine is available, suspend
return SUSPEND;
}
- ICompiledExpression expression= lineBreakpoint.getExpression(thread);
+ ICompiledExpression expression = lineBreakpoint
+ .getExpression(thread);
if (expression == null) {
- expression= engine.getCompiledExpression(condition, frame);
+ expression = engine.getCompiledExpression(condition, frame);
lineBreakpoint.setExpression(thread, expression);
}
if (expression.hasErrors()) {
- fireConditionHasErrors(lineBreakpoint, getMessages(expression));
+ fireConditionHasErrors(lineBreakpoint,
+ getMessages(expression));
return SUSPEND;
}
Object lock = listener.getLock();
synchronized (lock) {
- engine.evaluateExpression(expression, frame, listener, DebugEvent.EVALUATION_IMPLICIT, false);
+ engine.evaluateExpression(expression, frame, listener,
+ DebugEvent.EVALUATION_IMPLICIT, false);
// TODO: timeout?
try {
lock.wait();
} catch (InterruptedException e) {
- fireConditionHasRuntimeErrors(lineBreakpoint, new DebugException(
- new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugBreakpointMessages.ConditionalBreakpointHandler_0, e)));
+ fireConditionHasRuntimeErrors(
+ lineBreakpoint,
+ new DebugException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin
+ .getUniqueIdentifier(),
+ JDIDebugBreakpointMessages.ConditionalBreakpointHandler_0,
+ e)));
return SUSPEND;
}
}
@@ -228,24 +255,30 @@ public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
return SUSPEND;
}
- public void breakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void breakpointInstalled(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
}
- public void breakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {
+ public void breakpointRemoved(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint) {
}
- public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type) {
+ public int installingBreakpoint(IJavaDebugTarget target,
+ IJavaBreakpoint breakpoint, IJavaType type) {
return 0;
}
/**
* Returns an evaluation engine for evaluating this breakpoint's condition
* in the given target and project context.
+ * @param vm the VM to get an evaluation engine for
+ * @param project the project context
+ * @return a new {@link IAstEvaluationEngine}
*/
- private IAstEvaluationEngine getEvaluationEngine(IJavaDebugTarget vm, IJavaProject project) {
- return ((JDIDebugTarget)vm).getEvaluationEngine(project);
- }
-
+ private IAstEvaluationEngine getEvaluationEngine(IJavaDebugTarget vm, IJavaProject project) {
+ return ((JDIDebugTarget) vm).getEvaluationEngine(project);
+ }
+
private void fireConditionHasRuntimeErrors(IJavaLineBreakpoint breakpoint, DebugException exception) {
fHasErrors = true;
JDIDebugPlugin.getDefault().fireBreakpointHasRuntimeException(breakpoint, exception);
@@ -254,27 +287,32 @@ public class ConditionalBreakpointHandler implements IJavaBreakpointListener {
/**
* Notifies listeners that a conditional breakpoint expression has been
* compiled that contains errors
+ * @param breakpoint the breakpoint that has errors in its condition
+ * @param messages the error messages
*/
private void fireConditionHasErrors(IJavaLineBreakpoint breakpoint, Message[] messages) {
fHasErrors = true;
JDIDebugPlugin.getDefault().fireBreakpointHasCompilationErrors(breakpoint, messages);
}
-
+
/**
* Convert an array of <code>String</code> to an array of
* <code>Message</code>.
+ * @param expression the expression to get messages from
+ * @return the array of {@link Message}s from the expression
*/
private Message[] getMessages(ICompiledExpression expression) {
- String[] errorMessages= expression.getErrorMessages();
- Message[] messages= new Message[errorMessages.length];
- for (int i= 0; i < messages.length; i++) {
- messages[i]= new Message(errorMessages[i], -1);
+ String[] errorMessages = expression.getErrorMessages();
+ Message[] messages = new Message[errorMessages.length];
+ for (int i = 0; i < messages.length; i++) {
+ messages[i] = new Message(errorMessages[i], -1);
}
return messages;
}
-
+
/**
- * Returns whether errors were encountered when evaluating the condition (compilation or runtime).
+ * Returns whether errors were encountered when evaluating the condition
+ * (compilation or runtime).
*
* @return whether errors were encountered when evaluating the condition
*/
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpoint.java
index babe3374b..f9ae657bb 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -24,7 +23,7 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
@@ -32,6 +31,7 @@ import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.model.Breakpoint;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.jdt.debug.core.IJavaBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaBreakpointListener;
import org.eclipse.jdt.debug.core.IJavaDebugTarget;
import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaThread;
@@ -61,152 +61,164 @@ import com.sun.jdi.request.EventRequestManager;
public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoint, IJDIEventListener, IDebugEventSetListener {
/**
- * Breakpoint attribute storing the expired value (value <code>"org.eclipse.jdt.debug.core.expired"</code>).
- * This attribute is stored as a <code>boolean</code>. Once a hit count has
- * been reached, a breakpoint is considered to be "expired".
+ * Breakpoint attribute storing the expired value (value
+ * <code>"org.eclipse.jdt.debug.core.expired"</code>). This attribute is
+ * stored as a <code>boolean</code>. Once a hit count has been reached, a
+ * breakpoint is considered to be "expired".
*/
protected static final String EXPIRED = "org.eclipse.jdt.debug.core.expired"; //$NON-NLS-1$
/**
- * Breakpoint attribute storing a breakpoint's hit count value
- * (value <code>"org.eclipse.jdt.debug.core.hitCount"</code>). This attribute is stored as an
- * <code>int</code>.
+ * Breakpoint attribute storing a breakpoint's hit count value (value
+ * <code>"org.eclipse.jdt.debug.core.hitCount"</code>). This attribute is
+ * stored as an <code>int</code>.
*/
protected static final String HIT_COUNT = "org.eclipse.jdt.debug.core.hitCount"; //$NON-NLS-1$
/**
- * Breakpoint attribute storing the number of debug targets a
- * breakpoint is installed in (value <code>"org.eclipse.jdt.debug.core.installCount"</code>).
- * This attribute is a <code>int</code>.
+ * Breakpoint attribute storing the number of debug targets a breakpoint is
+ * installed in (value
+ * <code>"org.eclipse.jdt.debug.core.installCount"</code>). This attribute
+ * is a <code>int</code>.
*/
protected static final String INSTALL_COUNT = "org.eclipse.jdt.debug.core.installCount"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing the fully qualified name of the type
- * this breakpoint is located in.
- * (value <code>"org.eclipse.jdt.debug.core.typeName"</code>). This attribute is a <code>String</code>.
+ * Breakpoint attribute storing the fully qualified name of the type this
+ * breakpoint is located in. (value
+ * <code>"org.eclipse.jdt.debug.core.typeName"</code>). This attribute is a
+ * <code>String</code>.
*/
protected static final String TYPE_NAME = "org.eclipse.jdt.debug.core.typeName"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing suspend policy code for
- * this breakpoint.
- * (value <code>"org.eclipse.jdt.debug.core.suspendPolicy</code>).
- * This attribute is an <code>int</code> corresponding
- * to <code>IJavaBreakpoint.SUSPEND_VM</code> or
+ * Breakpoint attribute storing suspend policy code for this breakpoint.
+ * (value <code>"org.eclipse.jdt.debug.core.suspendPolicy</code>). This
+ * attribute is an <code>int</code> corresponding to
+ * <code>IJavaBreakpoint.SUSPEND_VM</code> or
* <code>IJavaBreakpoint.SUSPEND_THREAD</code>.
*/
protected static final String SUSPEND_POLICY = "org.eclipse.jdt.debug.core.suspendPolicy"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing a comma delimited list of extension identifiers of
- * breakpoint listeners. The listeners will be notified in the order specified in the list.
+ * Breakpoint attribute storing a comma delimited list of extension
+ * identifiers of breakpoint listeners. The listeners will be notified in
+ * the order specified in the list.
+ *
* @since 3.5
*/
public static final String BREAKPOINT_LISTENERS = JDIDebugPlugin.EXTENSION_POINT_JAVA_BREAKPOINT_LISTENERS;
-
+
/**
* Stores the collection of requests that this breakpoint has installed in
- * debug targets.
- * key: a debug target
- * value: the requests this breakpoint has installed in that target
+ * debug targets. key: a debug target value: the requests this breakpoint
+ * has installed in that target
*/
- protected HashMap fRequestsByTarget;
-
+ protected HashMap<JDIDebugTarget, List<EventRequest>> fRequestsByTarget;
+
/**
- * The list of threads (ThreadReference objects) in which this breakpoint will suspend,
- * associated with the target in which each thread exists (JDIDebugTarget).
- * key: targets the debug targets (IJavaDebugTarget)
+ * The list of threads (ThreadReference objects) in which this breakpoint
+ * will suspend, associated with the target in which each thread exists
+ * (JDIDebugTarget). key: targets the debug targets (IJavaDebugTarget)
* value: thread the filtered thread (IJavaThread) in the given target
*/
- protected Map fFilteredThreadsByTarget;
-
+ protected Map<JDIDebugTarget, IJavaThread> fFilteredThreadsByTarget;
+
/**
- * Stores the type name that this breakpoint was last installed
- * in. When a breakpoint is created, the TYPE_NAME attribute assigned to it
- * is that of its top level enclosing type. When installed, the type
- * may actually be an inner type. We need to keep track of the type
- * type the breakpoint was installed in, in case we need to re-install
- * the breakpoint for HCR (i.e. in case an inner type is HCR'd).
+ * Stores the type name that this breakpoint was last installed in. When a
+ * breakpoint is created, the TYPE_NAME attribute assigned to it is that of
+ * its top level enclosing type. When installed, the type may actually be an
+ * inner type. We need to keep track of the type type the breakpoint was
+ * installed in, in case we need to re-install the breakpoint for HCR (i.e.
+ * in case an inner type is HCR'd).
*/
protected String fInstalledTypeName = null;
-
+
/**
- * List of targets in which this breakpoint is installed.
- * Used to prevent firing of more than one install notification
- * when a breakpoint's requests are re-created.
+ * List of targets in which this breakpoint is installed. Used to prevent
+ * firing of more than one install notification when a breakpoint's requests
+ * are re-created.
*/
- protected Set fInstalledTargets = null;
-
+ protected Set<IJavaDebugTarget> fInstalledTargets = null;
+
/**
- * List of active instance filters for this breakpoint
- * (list of <code>IJavaObject</code>).
+ * List of active instance filters for this breakpoint (list of
+ * <code>IJavaObject</code>).
*/
- protected List fInstanceFilters = null;
-
+ protected List<IJavaObject> fInstanceFilters = null;
+
/**
* List of breakpoint listener identifiers corresponding to breakpoint
- * listener extensions. Listeners are cached with the breakpoint object
- * such that they can be notified when a breakpoint is removed.
+ * listener extensions. Listeners are cached with the breakpoint object such
+ * that they can be notified when a breakpoint is removed.
*/
- private List fBreakpointListenerIds = null;
-
+ private List<String> fBreakpointListenerIds = null;
+
/**
* Empty instance filters array.
*/
protected static final IJavaObject[] fgEmptyInstanceFilters = new IJavaObject[0];
-
+
/**
* Property identifier for a breakpoint object on an event request
*/
public static final String JAVA_BREAKPOINT_PROPERTY = "org.eclipse.jdt.debug.breakpoint"; //$NON-NLS-1$
-
+
/**
* JavaBreakpoint attributes
- */
- protected static final String[] fgExpiredEnabledAttributes= new String[]{EXPIRED, ENABLED};
-
+ */
+ protected static final String[] fgExpiredEnabledAttributes = new String[] {
+ EXPIRED, ENABLED };
+
public JavaBreakpoint() {
- fRequestsByTarget = new HashMap(1);
- fFilteredThreadsByTarget= new HashMap(1);
- }
+ fRequestsByTarget = new HashMap<JDIDebugTarget, List<EventRequest>>(1);
+ fFilteredThreadsByTarget = new HashMap<JDIDebugTarget, IJavaThread>(1);
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IBreakpoint#getModelIdentifier()
*/
public String getModelIdentifier() {
return JDIDebugModel.getPluginIdentifier();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.Breakpoint#setMarker(org.eclipse.core.resources.IMarker)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.Breakpoint#setMarker(org.eclipse.core.resources
+ * .IMarker)
*/
+ @Override
public void setMarker(IMarker marker) throws CoreException {
super.setMarker(marker);
configureAtStartup();
}
/**
- * Add this breakpoint to the breakpoint manager,
- * or sets it as unregistered.
+ * Add this breakpoint to the breakpoint manager, or sets it as
+ * unregistered.
*/
protected void register(boolean register) throws CoreException {
- DebugPlugin plugin = DebugPlugin.getDefault();
+ DebugPlugin plugin = DebugPlugin.getDefault();
if (plugin != null && register) {
- plugin.getBreakpointManager().addBreakpoint(this);
+ plugin.getBreakpointManager().addBreakpoint(this);
} else {
setRegistered(false);
}
- }
-
+ }
+
/**
- * Add the given event request to the given debug target. If
- * the request is the breakpoint request associated with this
- * breakpoint, increment the install count.
+ * Add the given event request to the given debug target. If the request is
+ * the breakpoint request associated with this breakpoint, increment the
+ * install count.
*/
- protected void registerRequest(EventRequest request, JDIDebugTarget target) throws CoreException {
+ protected void registerRequest(EventRequest request, JDIDebugTarget target)
+ throws CoreException {
if (request == null) {
return;
}
- List reqs = getRequests(target);
+ List<EventRequest> reqs = getRequests(target);
if (reqs.isEmpty()) {
fRequestsByTarget.put(target, reqs);
}
@@ -215,47 +227,48 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
// update the install attribute on the breakpoint
if (!(request instanceof ClassPrepareRequest)) {
incrementInstallCount();
- // notification
+ // notification
fireInstalled(target);
}
}
-
+
/**
- * Returns a String corresponding to the reference type
- * name to the top enclosing type in which this breakpoint
- * is located or <code>null</code> if no reference type could be
- * found.
+ * Returns a String corresponding to the reference type name to the top
+ * enclosing type in which this breakpoint is located or <code>null</code>
+ * if no reference type could be found.
*/
protected String getEnclosingReferenceTypeName() throws CoreException {
- String name= getTypeName();
+ String name = getTypeName();
int index = name.indexOf('$');
if (index == -1) {
return name;
}
return name.substring(0, index);
- }
-
+ }
+
/**
- * Returns the requests that this breakpoint has installed
- * in the given target.
+ * Returns the requests that this breakpoint has installed in the given
+ * target.
*/
- protected ArrayList getRequests(JDIDebugTarget target) {
- ArrayList list= (ArrayList)fRequestsByTarget.get(target);
+ protected ArrayList<EventRequest> getRequests(JDIDebugTarget target) {
+ ArrayList<EventRequest> list = (ArrayList<EventRequest>) fRequestsByTarget.get(target);
if (list == null) {
- list= new ArrayList(2);
+ list = new ArrayList<EventRequest>(2);
}
return list;
}
-
+
/**
- * Remove the given request from the given target. If the request
- * is the breakpoint request associated with this breakpoint,
- * decrement the install count.
+ * Remove the given request from the given target. If the request is the
+ * breakpoint request associated with this breakpoint, decrement the install
+ * count.
*/
- protected void deregisterRequest(EventRequest request, JDIDebugTarget target) throws CoreException {
+ protected void deregisterRequest(EventRequest request, JDIDebugTarget target)
+ throws CoreException {
target.removeJDIEventListener(this, request);
// A request may be getting de-registered because the breakpoint has
- // been deleted. It may be that this occurred because of a marker deletion.
+ // been deleted. It may be that this occurred because of a marker
+ // deletion.
// Don't try updating the marker (decrementing the install count) if
// it no longer exists.
if (!(request instanceof ClassPrepareRequest) && getMarker().exists()) {
@@ -263,15 +276,22 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.IJDIEventListener#handleEvent(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.IJDIEventListener#handleEvent(com
+ * .sun.jdi.event.Event,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
*/
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet) {
if (event instanceof ClassPrepareEvent) {
- return handleClassPrepareEvent((ClassPrepareEvent)event, target, suspendVote);
+ return handleClassPrepareEvent((ClassPrepareEvent) event, target,
+ suspendVote);
}
- ThreadReference threadRef= ((LocatableEvent)event).thread();
- JDIThread thread= target.findThread(threadRef);
+ ThreadReference threadRef = ((LocatableEvent) event).thread();
+ JDIThread thread = target.findThread(threadRef);
if (thread == null) {
// wait for any thread start event sets to complete processing
// see bug 271700
@@ -280,28 +300,34 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
} catch (OperationCanceledException e) {
} catch (InterruptedException e) {
}
- thread = target.findThread(threadRef);
+ thread = target.findThread(threadRef);
}
if (thread == null || thread.isIgnoringBreakpoints()) {
return true;
}
- return handleBreakpointEvent(event, thread, suspendVote);
+ return handleBreakpointEvent(event, thread, suspendVote);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete
+ * (com.sun.jdi.event.Event,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
*/
- public void eventSetComplete(Event event, JDIDebugTarget target, boolean suspend, EventSet eventSet) {
+ public void eventSetComplete(Event event, JDIDebugTarget target,
+ boolean suspend, EventSet eventSet) {
ThreadReference threadRef = null;
if (event instanceof ClassPrepareEvent) {
- threadRef = ((ClassPrepareEvent)event).thread();
+ threadRef = ((ClassPrepareEvent) event).thread();
} else if (event instanceof LocatableEvent) {
- threadRef = ((LocatableEvent)event).thread();
+ threadRef = ((LocatableEvent) event).thread();
}
if (threadRef == null) {
return;
}
- JDIThread thread= target.findThread(threadRef);
+ JDIThread thread = target.findThread(threadRef);
if (thread == null || thread.isIgnoringBreakpoints()) {
return;
}
@@ -311,77 +337,90 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
thread.completeBreakpointHandling(this, suspend, true, eventSet);
}
}
-
+
+ /**
+ * Call-back that the class prepare event has completed
+ * @param event the event
+ * @param thread the thread that sent the event
+ * @param suspend if the the thread was suspended
+ * @param eventSet the event set context
+ */
protected void classPrepareComplete(Event event, JDIThread thread, boolean suspend, EventSet eventSet) {
- // resume the thread if this is a class load event to install a deferred breakpoint (and the vote is to resume)
+ // resume the thread if this is a class load event to install a deferred
+ // breakpoint (and the vote is to resume)
if (thread != null && !suspend) {
thread.resumedFromClassPrepare();
}
}
/**
- * Handle the given class prepare event, which was generated by the
- * class prepare event installed in the given target by this breakpoint.
+ * Handle the given class prepare event, which was generated by the class
+ * prepare event installed in the given target by this breakpoint.
*
* If the class which has been loaded is a class in which this breakpoint
* should install, create a breakpoint request for that class.
- */
+ * @param event the event
+ * @param target the target
+ * @param suspendVote the current suspend vote
+ * @return is the thread should suspend or not
+ */
public boolean handleClassPrepareEvent(ClassPrepareEvent event, JDIDebugTarget target, boolean suspendVote) {
try {
if (!installableReferenceType(event.referenceType(), target)) {
// Don't install this breakpoint in an
// inappropriate type
return true;
- }
+ }
createRequest(target, event.referenceType());
} catch (CoreException e) {
JDIDebugPlugin.log(e);
}
return true;
}
-
+
/**
* @see IJDIEventListener#handleEvent(Event, JDIDebugTarget)
*
- * Handle the given event, which was generated by the breakpoint request
- * installed in the given target by this breakpoint.
+ * Handle the given event, which was generated by the breakpoint
+ * request installed in the given target by this breakpoint.
*/
- public boolean handleBreakpointEvent(Event event, JDIThread thread, boolean suspendVote) {
+ public boolean handleBreakpointEvent(Event event, JDIThread thread,
+ boolean suspendVote) {
expireHitCount(event);
return !suspend(thread, suspendVote); // Resume if suspend fails
}
-
+
/**
- * Delegates to the given thread to suspend, and
- * returns whether the thread suspended
- * It is possible that the thread will not suspend
- * as directed by a Java breakpoint listener.
+ * Delegates to the given thread to suspend, and returns whether the thread
+ * suspended It is possible that the thread will not suspend as directed by
+ * a Java breakpoint listener.
*
* @see IJavaBreakpointListener#breakpointHit(IJavaThread, IJavaBreakpoint)
*/
protected boolean suspend(JDIThread thread, boolean suspendVote) {
return thread.handleSuspendForBreakpoint(this, suspendVote);
}
-
+
/**
* Returns whether the given reference type is appropriate for this
* breakpoint to be installed in the given target. Query registered
* breakpoint listeners.
*/
- protected boolean installableReferenceType(ReferenceType type, JDIDebugTarget target) throws CoreException {
- String installableType= getTypeName();
- String queriedType= type.name();
+ protected boolean installableReferenceType(ReferenceType type,
+ JDIDebugTarget target) throws CoreException {
+ String installableType = getTypeName();
+ String queriedType = type.name();
if (installableType == null || queriedType == null) {
return false;
}
- int index= queriedType.indexOf('<');
+ int index = queriedType.indexOf('<');
if (index != -1) {
- queriedType= queriedType.substring(0, index);
+ queriedType = queriedType.substring(0, index);
}
if (installableType.equals(queriedType)) {
return queryInstallListeners(target, type);
}
- index= queriedType.indexOf('$', 0);
+ index = queriedType.indexOf('$', 0);
if (index == -1) {
return false;
}
@@ -390,43 +429,47 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
return false;
}
-
+
/**
- * Called when a breakpoint event is encountered. Expires the
- * hit count in the event's request and updates the marker.
- * @param event the event whose request should have its hit count
- * expired or <code>null</code> to only update the breakpoint marker.
+ * Called when a breakpoint event is encountered. Expires the hit count in
+ * the event's request and updates the marker.
+ *
+ * @param event
+ * the event whose request should have its hit count expired or
+ * <code>null</code> to only update the breakpoint marker.
*/
protected void expireHitCount(Event event) {
- Integer requestCount= null;
- EventRequest request= null;
+ Integer requestCount = null;
+ EventRequest request = null;
if (event != null) {
- request= event.request();
- requestCount= (Integer) request.getProperty(HIT_COUNT);
+ request = event.request();
+ requestCount = (Integer) request.getProperty(HIT_COUNT);
}
if (requestCount != null) {
if (request != null) {
request.putProperty(EXPIRED, Boolean.TRUE);
}
try {
- setAttributes(fgExpiredEnabledAttributes, new Object[]{Boolean.TRUE, Boolean.FALSE});
+ setAttributes(fgExpiredEnabledAttributes, new Object[] {
+ Boolean.TRUE, Boolean.FALSE });
// make a note that we auto-disabled this breakpoint.
} catch (CoreException ce) {
JDIDebugPlugin.log(ce);
}
}
}
-
+
/**
- * Returns whether this breakpoint should be "skipped". Breakpoints
- * are skipped if the breakpoint manager is disabled and the breakpoint
- * is registered with the manager
+ * Returns whether this breakpoint should be "skipped". Breakpoints are
+ * skipped if the breakpoint manager is disabled and the breakpoint is
+ * registered with the manager
*
* @return whether this breakpoint should be skipped
*/
public boolean shouldSkipBreakpoint() throws CoreException {
DebugPlugin plugin = DebugPlugin.getDefault();
- return plugin != null && isRegistered() && !plugin.getBreakpointManager().isEnabled();
+ return plugin != null && isRegistered()
+ && !plugin.getBreakpointManager().isEnabled();
}
/**
@@ -435,22 +478,22 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
*
* @return Whether a request was created
*/
- protected boolean createRequest(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ protected boolean createRequest(JDIDebugTarget target, ReferenceType type)
+ throws CoreException {
if (shouldSkipBreakpoint()) {
return false;
}
- EventRequest[] requests= newRequests(target, type);
+ EventRequest[] requests = newRequests(target, type);
if (requests == null) {
return false;
}
fInstalledTypeName = type.name();
- for (int i = 0; i < requests.length; i++) {
- EventRequest request = requests[i];
- registerRequest(request, target);
- }
+ for (EventRequest request : requests) {
+ registerRequest(request, target);
+ }
return true;
}
-
+
/**
* Configure a breakpoint request with common properties:
* <ul>
@@ -458,10 +501,10 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
* <li><code>HIT_COUNT</code></li>
* <li><code>EXPIRED</code></li>
* </ul>
- * and sets the suspend policy of the request to suspend
- * the event thread.
+ * and sets the suspend policy of the request to suspend the event thread.
*/
- protected void configureRequest(EventRequest request, JDIDebugTarget target) throws CoreException {
+ protected void configureRequest(EventRequest request, JDIDebugTarget target)
+ throws CoreException {
request.setSuspendPolicy(getJDISuspendPolicy());
request.putProperty(JAVA_BREAKPOINT_PROPERTY, this);
configureRequestThreadFilter(request, target);
@@ -470,68 +513,77 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
// Important: only enable a request after it has been configured
updateEnabledState(request, target);
}
-
+
/**
* Adds an instance filter to the given request. Since the implementation is
* request specific, subclasses must override.
*
* @param request
- * @param object instance filter
+ * @param object
+ * instance filter
*/
- protected abstract void addInstanceFilter(EventRequest request, ObjectReference object);
-
+ protected abstract void addInstanceFilter(EventRequest request,
+ ObjectReference object);
+
/**
* Configure the thread filter property of the given request.
*/
- protected void configureRequestThreadFilter(EventRequest request, JDIDebugTarget target) {
- IJavaThread thread= (IJavaThread)fFilteredThreadsByTarget.get(target);
+ protected void configureRequestThreadFilter(EventRequest request,
+ JDIDebugTarget target) {
+ IJavaThread thread = fFilteredThreadsByTarget.get(target);
if (thread == null || (!(thread instanceof JDIThread))) {
return;
}
- setRequestThreadFilter(request, ((JDIThread)thread).getUnderlyingThread());
+ setRequestThreadFilter(request,
+ ((JDIThread) thread).getUnderlyingThread());
}
-
+
/**
* Configure the given request's hit count
*/
- protected void configureRequestHitCount(EventRequest request) throws CoreException {
- int hitCount= getHitCount();
+ protected void configureRequestHitCount(EventRequest request)
+ throws CoreException {
+ int hitCount = getHitCount();
if (hitCount > 0) {
request.addCountFilter(hitCount);
request.putProperty(HIT_COUNT, new Integer(hitCount));
}
}
-
- protected void configureInstanceFilters(EventRequest request, JDIDebugTarget target) {
+
+ protected void configureInstanceFilters(EventRequest request,
+ JDIDebugTarget target) {
if (fInstanceFilters != null && !fInstanceFilters.isEmpty()) {
- Iterator iter = fInstanceFilters.iterator();
+ Iterator<IJavaObject> iter = fInstanceFilters.iterator();
while (iter.hasNext()) {
- IJavaObject object = (IJavaObject)iter.next();
+ IJavaObject object = iter.next();
if (object.getDebugTarget().equals(target)) {
- addInstanceFilter(request, ((JDIObjectValue)object).getUnderlyingObject());
+ addInstanceFilter(request,
+ ((JDIObjectValue) object).getUnderlyingObject());
}
}
}
- }
-
+ }
+
/**
- * Creates, installs, and returns all event requests for this breakpoint
- * in the given reference type and and target.
+ * Creates, installs, and returns all event requests for this breakpoint in
+ * the given reference type and and target.
*
- * @return the event requests created or <code>null</code> if creation failed
+ * @return the event requests created or <code>null</code> if creation
+ * failed
*/
- protected abstract EventRequest[] newRequests(JDIDebugTarget target, ReferenceType type) throws CoreException;
-
+ protected abstract EventRequest[] newRequests(JDIDebugTarget target,
+ ReferenceType type) throws CoreException;
+
/**
- * Add this breakpoint to the given target. After it has been
- * added to the given target, this breakpoint will suspend
- * execution of that target as appropriate.
+ * Add this breakpoint to the given target. After it has been added to the
+ * given target, this breakpoint will suspend execution of that target as
+ * appropriate.
*/
public void addToTarget(JDIDebugTarget target) throws CoreException {
fireAdding(target);
createRequests(target);
}
-
+
/**
* Creates event requests for the given target
*/
@@ -539,80 +591,84 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
if (target.isTerminated() || shouldSkipBreakpoint()) {
return;
}
- String referenceTypeName= getTypeName();
- String enclosingTypeName= getEnclosingReferenceTypeName();
+ String referenceTypeName = getTypeName();
+ String enclosingTypeName = getEnclosingReferenceTypeName();
if (referenceTypeName == null || enclosingTypeName == null) {
return;
}
// create request to listen to class loads
if (referenceTypeName.indexOf('$') == -1) {
- registerRequest(target.createClassPrepareRequest(enclosingTypeName), target);
- //register to ensure we hear about local and anonymous inner classes
- registerRequest(target.createClassPrepareRequest(enclosingTypeName + "$*"), target); //$NON-NLS-1$
+ registerRequest(
+ target.createClassPrepareRequest(enclosingTypeName), target);
+ // register to ensure we hear about local and anonymous inner
+ // classes
+ registerRequest(
+ target.createClassPrepareRequest(enclosingTypeName + "$*"), target); //$NON-NLS-1$
} else {
- registerRequest(target.createClassPrepareRequest(referenceTypeName), target);
- //register to ensure we hear about local and anonymous inner classes
- registerRequest(target.createClassPrepareRequest(enclosingTypeName + "$*", referenceTypeName), target); //$NON-NLS-1$
+ registerRequest(
+ target.createClassPrepareRequest(referenceTypeName), target);
+ // register to ensure we hear about local and anonymous inner
+ // classes
+ registerRequest(target.createClassPrepareRequest(enclosingTypeName
+ + "$*", referenceTypeName), target); //$NON-NLS-1$
}
// create breakpoint requests for each class currently loaded
- List classes= target.jdiClassesByName(referenceTypeName);
+ List<ReferenceType> classes = target.jdiClassesByName(referenceTypeName);
if (classes.isEmpty() && enclosingTypeName.equals(referenceTypeName)) {
return;
}
- boolean success= false;
- Iterator iter = classes.iterator();
+ boolean success = false;
+ Iterator<ReferenceType> iter = classes.iterator();
while (iter.hasNext()) {
- ReferenceType type= (ReferenceType) iter.next();
+ ReferenceType type = iter.next();
if (createRequest(target, type)) {
- success= true;
+ success = true;
}
}
if (!success) {
addToTargetForLocalType(target, enclosingTypeName);
- }
+ }
}
-
+
/**
* Local types (types defined in methods) are handled specially due to the
- * different types that the local type is associated with as well as the
- * performance problems of using ReferenceType#nestedTypes. From the Java
- * model perspective a local type is defined within a method of a type.
+ * different types that the local type is associated with as well as the
+ * performance problems of using ReferenceType#nestedTypes. From the Java
+ * model perspective a local type is defined within a method of a type.
* Therefore the type of a breakpoint placed in a local type is the type
- * that encloses the method where the local type was defined.
- * The local type is enclosed within the top level type according
- * to the VM.
- * So if "normal" attempts to create a request when a breakpoint is
- * being added to a target fail, we must be dealing with a local type and therefore resort
- * to looking up all of the nested types of the top level enclosing type.
+ * that encloses the method where the local type was defined. The local type
+ * is enclosed within the top level type according to the VM. So if "normal"
+ * attempts to create a request when a breakpoint is being added to a target
+ * fail, we must be dealing with a local type and therefore resort to
+ * looking up all of the nested types of the top level enclosing type.
+ *
+ * @param target the target
+ * @param enclosingTypeName the type name of the enclosing type
+ * @throws CoreException if something bad happens
*/
protected void addToTargetForLocalType(JDIDebugTarget target, String enclosingTypeName) throws CoreException {
- List classes= target.jdiClassesByName(enclosingTypeName);
- if (!classes.isEmpty()) {
- Iterator iter = classes.iterator();
- while (iter.hasNext()) {
- ReferenceType type= (ReferenceType) iter.next();
- Iterator nestedTypes= type.nestedTypes().iterator();
- while (nestedTypes.hasNext()) {
- ReferenceType nestedType= (ReferenceType) nestedTypes.next();
- if (createRequest(target, nestedType)) {
- break;
- }
+ List<ReferenceType> classes = target.jdiClassesByName(enclosingTypeName);
+ for(ReferenceType type : classes) {
+ for(ReferenceType nestedType : type.nestedTypes()) {
+ if (createRequest(target, nestedType)) {
+ break;
}
}
}
}
-
+
/**
- * Returns the JDI suspend policy that corresponds to this
- * breakpoint's suspend policy
+ * Returns the JDI suspend policy that corresponds to this breakpoint's
+ * suspend policy
*
- * @return the JDI suspend policy that corresponds to this
- * breakpoint's suspend policy
- * @exception CoreException if unable to access this breakpoint's
- * suspend policy setting
+ * @return the JDI suspend policy that corresponds to this breakpoint's
+ * suspend policy
+ * @exception CoreException
+ * if unable to access this breakpoint's suspend policy
+ * setting
*/
protected int getJDISuspendPolicy() throws CoreException {
int breakpointPolicy = getSuspendPolicy();
@@ -623,35 +679,40 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
/**
- * returns the default suspend policy based on the pref setting on the
+ * returns the default suspend policy based on the pref setting on the
* Java-Debug pref page
+ *
* @return the default suspend policy
* @since 3.2
*/
protected int getDefaultSuspendPolicy() {
- Preferences store = JDIDebugModel.getPreferences();
- return store.getInt(JDIDebugPlugin.PREF_DEFAULT_BREAKPOINT_SUSPEND_POLICY);
+ return Platform.getPreferencesService().getInt(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.PREF_DEFAULT_BREAKPOINT_SUSPEND_POLICY,
+ IJavaBreakpoint.SUSPEND_THREAD,
+ null);
}
-
/**
- * Returns whether the hitCount of this breakpoint is equal to the hitCount of
- * the associated request.
+ * Returns whether the hitCount of this breakpoint is equal to the hitCount
+ * of the associated request.
*/
- protected boolean hasHitCountChanged(EventRequest request) throws CoreException {
- int hitCount= getHitCount();
- Integer requestCount= (Integer) request.getProperty(HIT_COUNT);
+ protected boolean hasHitCountChanged(EventRequest request)
+ throws CoreException {
+ int hitCount = getHitCount();
+ Integer requestCount = (Integer) request.getProperty(HIT_COUNT);
int oldCount = -1;
- if (requestCount != null) {
+ if (requestCount != null) {
oldCount = requestCount.intValue();
- }
+ }
return hitCount != oldCount;
}
-
+
/**
* Removes this breakpoint from the given target.
*/
- public void removeFromTarget(final JDIDebugTarget target) throws CoreException {
+ public void removeFromTarget(final JDIDebugTarget target)
+ throws CoreException {
removeRequests(target);
Object removed = fFilteredThreadsByTarget.remove(target);
boolean changed = removed != null;
@@ -659,76 +720,84 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
if (!markerExists || (markerExists && getInstallCount() == 0)) {
fInstalledTypeName = null;
}
-
- // remove instance filters
+
+ // remove instance filters
if (fInstanceFilters != null && !fInstanceFilters.isEmpty()) {
for (int i = 0; i < fInstanceFilters.size(); i++) {
- IJavaObject object = (IJavaObject)fInstanceFilters.get(i);
+ IJavaObject object = fInstanceFilters.get(i);
if (object.getDebugTarget().equals(target)) {
fInstanceFilters.remove(i);
changed = true;
}
}
}
-
+
// fire change notification if required
if (changed) {
fireChanged();
}
-
+
// notification
fireRemoved(target);
- }
-
+ }
+
/**
- * Remove all requests that this breakpoint has installed in the given
- * debug target.
+ * Remove all requests that this breakpoint has installed in the given debug
+ * target.
*/
- protected void removeRequests(final JDIDebugTarget target) throws CoreException {
+ protected void removeRequests(final JDIDebugTarget target)
+ throws CoreException {
// removing was previously done is a workspace runnable, but that is
- // not possible since it can be a resource callback (marker deletion) that
+ // not possible since it can be a resource callback (marker deletion)
+ // that
// causes a breakpoint to be removed
- ArrayList requests= (ArrayList)getRequests(target).clone();
+ ArrayList<EventRequest> requests = (ArrayList<EventRequest>) getRequests(target).clone();
// Iterate over a copy of the requests since this list of requests
- // can be changed in other threads which would cause an ConcurrentModificationException
- Iterator iter = requests.iterator();
+ // can be changed in other threads which would cause an
+ // ConcurrentModificationException
+ Iterator<EventRequest> iter = requests.iterator();
EventRequest req;
while (iter.hasNext()) {
- req = (EventRequest)iter.next();
+ req = iter.next();
try {
- if (target.isAvailable() && !isExpired(req)) { // cannot delete an expired request
- EventRequestManager manager = target.getEventRequestManager();
+ if (target.isAvailable() && !isExpired(req)) { // cannot delete
+ // an expired
+ // request
+ EventRequestManager manager = target
+ .getEventRequestManager();
if (manager != null) {
- manager.deleteEventRequest(req); // disable & remove
- }
+ manager.deleteEventRequest(req); // disable & remove
+ }
}
} catch (VMDisconnectedException e) {
if (target.isAvailable()) {
JDIDebugPlugin.log(e);
}
} catch (RuntimeException e) {
- target.internalError(e);
+ target.internalError(e);
} finally {
deregisterRequest(req, target);
}
}
fRequestsByTarget.remove(target);
}
-
+
/**
- * Update the enabled state of the given request in the given target, which is associated
- * with this breakpoint. Set the enabled state of the request
+ * Update the enabled state of the given request in the given target, which
+ * is associated with this breakpoint. Set the enabled state of the request
* to the enabled state of this breakpoint.
*/
- protected void updateEnabledState(EventRequest request, JDIDebugTarget target) throws CoreException {
+ protected void updateEnabledState(EventRequest request,
+ JDIDebugTarget target) throws CoreException {
internalUpdateEnabledState(request, isEnabled(), target);
}
-
+
/**
- * Set the enabled state of the given request to the given
- * value, also taking into account instance filters.
+ * Set the enabled state of the given request to the given value, also
+ * taking into account instance filters.
*/
- protected void internalUpdateEnabledState(EventRequest request, boolean enabled, JDIDebugTarget target) {
+ protected void internalUpdateEnabledState(EventRequest request,
+ boolean enabled, JDIDebugTarget target) {
if (request.isEnabled() != enabled) {
// change the enabled state
try {
@@ -743,73 +812,77 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
}
}
-
+
/**
* Returns whether this breakpoint has expired.
*/
public boolean isExpired() throws CoreException {
return ensureMarker().getAttribute(EXPIRED, false);
- }
-
+ }
+
/**
* Returns whether the given request is expired
*/
protected boolean isExpired(EventRequest request) {
- Boolean requestExpired= (Boolean) request.getProperty(EXPIRED);
+ Boolean requestExpired = (Boolean) request.getProperty(EXPIRED);
if (requestExpired == null) {
- return false;
+ return false;
}
return requestExpired.booleanValue();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#isInstalled()
*/
public boolean isInstalled() throws CoreException {
return ensureMarker().getAttribute(INSTALL_COUNT, 0) > 0;
- }
-
+ }
+
/**
* Increments the install count of this breakpoint
*/
- protected void incrementInstallCount() throws CoreException {
+ protected void incrementInstallCount() throws CoreException {
int count = getInstallCount();
setAttribute(INSTALL_COUNT, count + 1);
- }
-
+ }
+
/**
- * Returns the <code>INSTALL_COUNT</code> attribute of this breakpoint
- * or 0 if the attribute is not set.
+ * Returns the <code>INSTALL_COUNT</code> attribute of this breakpoint or 0
+ * if the attribute is not set.
*/
public int getInstallCount() throws CoreException {
return ensureMarker().getAttribute(INSTALL_COUNT, 0);
- }
+ }
/**
* Decrements the install count of this breakpoint.
*/
protected void decrementInstallCount() throws CoreException {
- int count= getInstallCount();
+ int count = getInstallCount();
if (count > 0) {
- setAttribute(INSTALL_COUNT, count - 1);
+ setAttribute(INSTALL_COUNT, count - 1);
}
if (count == 1) {
if (isExpired()) {
// if breakpoint was auto-disabled, re-enable it
- setAttributes(fgExpiredEnabledAttributes,
- new Object[]{Boolean.FALSE, Boolean.TRUE});
+ setAttributes(fgExpiredEnabledAttributes, new Object[] {
+ Boolean.FALSE, Boolean.TRUE });
}
}
}
-
+
/**
* Sets the type name in which to install this breakpoint.
*/
protected void setTypeName(String typeName) throws CoreException {
setAttribute(TYPE_NAME, typeName);
- }
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#getTypeName()
*/
public String getTypeName() throws CoreException {
@@ -818,25 +891,25 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
return fInstalledTypeName;
}
-
+
/**
- * Resets the install count attribute on this breakpoint's marker
- * to "0". Resets the expired attribute on all breakpoint markers to <code>false</code>.
- * Resets the enabled attribute on the breakpoint marker to <code>true</code>.
- * If a workbench crashes, the attributes could have been persisted
- * in an incorrect state.
+ * Resets the install count attribute on this breakpoint's marker to "0".
+ * Resets the expired attribute on all breakpoint markers to
+ * <code>false</code>. Resets the enabled attribute on the breakpoint marker
+ * to <code>true</code>. If a workbench crashes, the attributes could have
+ * been persisted in an incorrect state.
*/
private void configureAtStartup() throws CoreException {
- List attributes= null;
- List values = new ArrayList(3);
+ List<String> attributes = null;
+ List<Object> values = new ArrayList<Object>(3);
if (isInstalled()) {
- attributes= new ArrayList(3);
+ attributes = new ArrayList<String>(3);
attributes.add(INSTALL_COUNT);
values.add(new Integer(0));
}
if (isExpired()) {
if (attributes == null) {
- attributes= new ArrayList(3);
+ attributes = new ArrayList<String>(3);
}
// if breakpoint was auto-disabled, re-enable it
attributes.add(EXPIRED);
@@ -845,122 +918,136 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
values.add(Boolean.TRUE);
}
if (attributes != null) {
- String[] strAttributes= new String[attributes.size()];
- setAttributes((String[])attributes.toArray(strAttributes), values.toArray());
+ String[] strAttributes = new String[attributes.size()];
+ setAttributes(attributes.toArray(strAttributes), values.toArray());
}
String[] listeners = readBreakpointListeners();
if (listeners.length > 0) {
- fBreakpointListenerIds = new ArrayList();
- for (int i = 0; i < listeners.length; i++) {
- fBreakpointListenerIds.add(listeners[i]);
+ fBreakpointListenerIds = new ArrayList<String>();
+ for (String listener : listeners) {
+ fBreakpointListenerIds.add(listener);
}
}
- }
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#getHitCount()
*/
public int getHitCount() throws CoreException {
return ensureMarker().getAttribute(HIT_COUNT, -1);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#setHitCount(int)
*/
- public void setHitCount(int count) throws CoreException {
+ public void setHitCount(int count) throws CoreException {
if (getHitCount() != count) {
if (!isEnabled() && count > -1) {
- setAttributes(new String []{ENABLED, HIT_COUNT, EXPIRED},
- new Object[]{Boolean.TRUE, new Integer(count), Boolean.FALSE});
+ setAttributes(new String[] { ENABLED, HIT_COUNT, EXPIRED },
+ new Object[] { Boolean.TRUE, new Integer(count),
+ Boolean.FALSE });
} else {
- setAttributes(new String[]{HIT_COUNT, EXPIRED},
- new Object[]{new Integer(count), Boolean.FALSE});
+ setAttributes(new String[] { HIT_COUNT, EXPIRED },
+ new Object[] { new Integer(count), Boolean.FALSE });
}
recreate();
}
}
-
+
protected String getMarkerMessage(int hitCount, int suspendPolicy) {
- StringBuffer buff= new StringBuffer();
- if (hitCount > 0){
- buff.append(MessageFormat.format(JDIDebugBreakpointMessages.JavaBreakpoint___Hit_Count___0___1, new Object[]{Integer.toString(hitCount)}));
+ StringBuffer buff = new StringBuffer();
+ if (hitCount > 0) {
+ buff.append(MessageFormat
+ .format(JDIDebugBreakpointMessages.JavaBreakpoint___Hit_Count___0___1,
+ new Object[] { Integer.toString(hitCount) }));
buff.append(' ');
}
String suspendPolicyString;
if (suspendPolicy == IJavaBreakpoint.SUSPEND_THREAD) {
- suspendPolicyString= JDIDebugBreakpointMessages.JavaBreakpoint__suspend_policy__thread__1;
+ suspendPolicyString = JDIDebugBreakpointMessages.JavaBreakpoint__suspend_policy__thread__1;
} else {
- suspendPolicyString= JDIDebugBreakpointMessages.JavaBreakpoint__suspend_policy__VM__2;
+ suspendPolicyString = JDIDebugBreakpointMessages.JavaBreakpoint__suspend_policy__VM__2;
}
-
+
buff.append(suspendPolicyString);
return buff.toString();
- }
-
+ }
+
/**
* Sets whether this breakpoint's hit count has expired.
*/
public void setExpired(boolean expired) throws CoreException {
- setAttribute(EXPIRED, expired);
- }
+ setAttribute(EXPIRED, expired);
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#getSuspendPolicy()
*/
public int getSuspendPolicy() throws CoreException {
- return ensureMarker().getAttribute(SUSPEND_POLICY, IJavaBreakpoint.SUSPEND_THREAD);
+ return ensureMarker().getAttribute(SUSPEND_POLICY,
+ IJavaBreakpoint.SUSPEND_THREAD);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#setSuspendPolicy(int)
*/
public void setSuspendPolicy(int suspendPolicy) throws CoreException {
- if(getSuspendPolicy() != suspendPolicy) {
+ if (getSuspendPolicy() != suspendPolicy) {
setAttribute(SUSPEND_POLICY, suspendPolicy);
recreate();
}
}
-
+
/**
- * Notifies listeners this breakpoint is to be added to the
- * given target.
+ * Notifies listeners this breakpoint is to be added to the given target.
*
- * @param target debug target
+ * @param target
+ * debug target
*/
protected void fireAdding(IJavaDebugTarget target) {
JDIDebugPlugin plugin = JDIDebugPlugin.getDefault();
- if (plugin != null)
- plugin.fireBreakpointAdding(target, this);
+ if (plugin != null)
+ plugin.fireBreakpointAdding(target, this);
}
-
+
/**
- * Notifies listeners this breakpoint has been removed from the
- * given target.
+ * Notifies listeners this breakpoint has been removed from the given
+ * target.
*
- * @param target debug target
+ * @param target
+ * debug target
*/
protected void fireRemoved(IJavaDebugTarget target) {
JDIDebugPlugin plugin = JDIDebugPlugin.getDefault();
- if (plugin != null) {
- plugin.fireBreakpointRemoved(target, this);
- setInstalledIn(target, false);
- }
- }
-
+ if (plugin != null) {
+ plugin.fireBreakpointRemoved(target, this);
+ setInstalledIn(target, false);
+ }
+ }
+
/**
- * Notifies listeners this breakpoint has been installed in the
- * given target.
+ * Notifies listeners this breakpoint has been installed in the given
+ * target.
*
- * @param target debug target
+ * @param target
+ * debug target
*/
protected void fireInstalled(IJavaDebugTarget target) {
- JDIDebugPlugin plugin = JDIDebugPlugin.getDefault();
- if (plugin!= null && !isInstalledIn(target)) {
- plugin.fireBreakpointInstalled(target, this);
+ JDIDebugPlugin plugin = JDIDebugPlugin.getDefault();
+ if (plugin != null && !isInstalledIn(target)) {
+ plugin.fireBreakpointInstalled(target, this);
setInstalledIn(target, true);
}
- }
-
+ }
+
/**
* Returns whether this breakpoint is installed in the given target.
*
@@ -970,17 +1057,18 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
protected boolean isInstalledIn(IJavaDebugTarget target) {
return fInstalledTargets != null && fInstalledTargets.contains(target);
}
-
+
/**
* Sets this breakpoint as installed in the given target
*
* @param target
- * @param installed whether installed
+ * @param installed
+ * whether installed
*/
protected void setInstalledIn(IJavaDebugTarget target, boolean installed) {
if (installed) {
if (fInstalledTargets == null) {
- fInstalledTargets = new HashSet();
+ fInstalledTargets = new HashSet<IJavaDebugTarget>();
}
fInstalledTargets.add(target);
} else {
@@ -989,18 +1077,23 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#setThreadFilter(org.eclipse.jdt.debug.core.IJavaThread)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#setThreadFilter(org.eclipse
+ * .jdt.debug.core.IJavaThread)
*/
public void setThreadFilter(IJavaThread thread) throws CoreException {
- if (!(thread.getDebugTarget() instanceof JDIDebugTarget) || !(thread instanceof JDIThread)) {
+ if (!(thread.getDebugTarget() instanceof JDIDebugTarget)
+ || !(thread instanceof JDIThread)) {
return;
}
- JDIDebugTarget target= (JDIDebugTarget)thread.getDebugTarget();
- if (thread != fFilteredThreadsByTarget.put(target, thread) ) {
+ JDIDebugTarget target = (JDIDebugTarget) thread.getDebugTarget();
+ if (thread != fFilteredThreadsByTarget.put(target, thread)) {
// recreate the breakpoint only if it is not the same thread
-
+
// Other breakpoints set attributes on the underlying
// marker and the marker changes are eventually
// propagated to the target. The target then asks the
@@ -1012,40 +1105,42 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
fireChanged();
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse
+ * .debug.core.DebugEvent[])
*/
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
+ for (DebugEvent event : events) {
if (event.getKind() == DebugEvent.TERMINATE) {
- Object source= event.getSource();
+ Object source = event.getSource();
if (!(source instanceof JDIThread)) {
return;
}
try {
- cleanupForThreadTermination((JDIThread)source);
+ cleanupForThreadTermination((JDIThread) source);
} catch (VMDisconnectedException exception) {
// Thread death often occurs at shutdown.
- // A VMDisconnectedException trying to
+ // A VMDisconnectedException trying to
// update the breakpoint request is
// acceptable.
}
}
}
}
-
+
/**
- * Removes cached information relevant to this thread which has
- * terminated.
+ * Removes cached information relevant to this thread which has terminated.
*
* Remove thread filters for terminated threads
*
* Subclasses may override but need to call super.
*/
protected void cleanupForThreadTermination(JDIThread thread) {
- JDIDebugTarget target= (JDIDebugTarget)thread.getDebugTarget();
+ JDIDebugTarget target = (JDIDebugTarget) thread.getDebugTarget();
try {
if (thread == getThreadFilter(target)) {
removeThreadFilter(target);
@@ -1054,148 +1149,180 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
JDIDebugPlugin.log(exception);
}
}
-
- /**
- * EventRequest does not support thread filters, so they
- * can't be set generically here. However, each of the breakpoint
- * subclasses of EventRequest do support thread filters. So
- * subclasses can set thread filters on their specific
- * request type.
- */
- protected abstract void setRequestThreadFilter(EventRequest request, ThreadReference thread);
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#getThreadFilter(org.eclipse.jdt.debug.core.IJavaDebugTarget)
+
+ /**
+ * EventRequest does not support thread filters, so they can't be set
+ * generically here. However, each of the breakpoint subclasses of
+ * EventRequest do support thread filters. So subclasses can set thread
+ * filters on their specific request type.
+ */
+ protected abstract void setRequestThreadFilter(EventRequest request,
+ ThreadReference thread);
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#getThreadFilter(org.eclipse
+ * .jdt.debug.core.IJavaDebugTarget)
*/
public IJavaThread getThreadFilter(IJavaDebugTarget target) {
- return (IJavaThread)fFilteredThreadsByTarget.get(target);
+ return fFilteredThreadsByTarget.get(target);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#getThreadFilters()
*/
public IJavaThread[] getThreadFilters() {
- IJavaThread[] threads= null;
- Collection values= fFilteredThreadsByTarget.values();
- threads= new IJavaThread[values.size()];
+ IJavaThread[] threads = null;
+ Collection<IJavaThread> values = fFilteredThreadsByTarget.values();
+ threads = new IJavaThread[values.size()];
values.toArray(threads);
return threads;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#removeThreadFilter(org.eclipse.jdt.debug.core.IJavaDebugTarget)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#removeThreadFilter(org.eclipse
+ * .jdt.debug.core.IJavaDebugTarget)
*/
- public void removeThreadFilter(IJavaDebugTarget javaTarget) throws CoreException {
+ public void removeThreadFilter(IJavaDebugTarget javaTarget)
+ throws CoreException {
if (!(javaTarget instanceof JDIDebugTarget)) {
return;
}
- JDIDebugTarget target= (JDIDebugTarget)javaTarget;
+ JDIDebugTarget target = (JDIDebugTarget) javaTarget;
if (fFilteredThreadsByTarget.remove(target) != null) {
recreate(target);
fireChanged();
}
}
-
+
/**
- * Returns whether this breakpoint should be installed in the given reference
- * type in the given target according to registered breakpoint listeners.
+ * Returns whether this breakpoint should be installed in the given
+ * reference type in the given target according to registered breakpoint
+ * listeners.
*
- * @param target debug target
- * @param type reference type or <code>null</code> if this breakpoint is
- * not installed in a specific type
- */
- protected boolean queryInstallListeners(JDIDebugTarget target, ReferenceType type) {
- JDIDebugPlugin plugin = JDIDebugPlugin.getDefault();
- if (plugin != null) {
- IJavaType jt = null;
- if (type != null) {
- jt = JDIType.createType(target, type);
- }
- return plugin.fireInstalling(target, this, jt);
- }
- return false;
+ * @param target
+ * debug target
+ * @param type
+ * reference type or <code>null</code> if this breakpoint is not
+ * installed in a specific type
+ */
+ protected boolean queryInstallListeners(JDIDebugTarget target,
+ ReferenceType type) {
+ JDIDebugPlugin plugin = JDIDebugPlugin.getDefault();
+ if (plugin != null) {
+ IJavaType jt = null;
+ if (type != null) {
+ jt = JDIType.createType(target, type);
+ }
+ return plugin.fireInstalling(target, this, jt);
+ }
+ return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#addInstanceFilter(org.eclipse.jdt.debug.core.IJavaObject)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#addInstanceFilter(org.eclipse
+ * .jdt.debug.core.IJavaObject)
*/
public void addInstanceFilter(IJavaObject object) throws CoreException {
if (fInstanceFilters == null) {
- fInstanceFilters= new ArrayList();
+ fInstanceFilters = new ArrayList<IJavaObject>();
}
if (!fInstanceFilters.contains(object)) {
fInstanceFilters.add(object);
- recreate((JDIDebugTarget)object.getDebugTarget());
+ recreate((JDIDebugTarget) object.getDebugTarget());
fireChanged();
}
}
-
+
/**
- * Change notification when there are no marker changes. If the marker
- * does not exist, do not fire a change notification (the marker may not
- * exist if the associated project was closed).
+ * Change notification when there are no marker changes. If the marker does
+ * not exist, do not fire a change notification (the marker may not exist if
+ * the associated project was closed).
*/
protected void fireChanged() {
- DebugPlugin plugin = DebugPlugin.getDefault();
- if (plugin != null && markerExists()) {
- plugin.getBreakpointManager().fireBreakpointChanged(this);
- }
+ DebugPlugin plugin = DebugPlugin.getDefault();
+ if (plugin != null && markerExists()) {
+ plugin.getBreakpointManager().fireBreakpointChanged(this);
+ }
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#getInstanceFilters()
*/
public IJavaObject[] getInstanceFilters() {
if (fInstanceFilters == null || fInstanceFilters.isEmpty()) {
return fgEmptyInstanceFilters;
}
- return (IJavaObject[])fInstanceFilters.toArray(new IJavaObject[fInstanceFilters.size()]);
+ return fInstanceFilters
+ .toArray(new IJavaObject[fInstanceFilters.size()]);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#removeInstanceFilter(org.eclipse.jdt.debug.core.IJavaObject)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#removeInstanceFilter(org.eclipse
+ * .jdt.debug.core.IJavaObject)
*/
public void removeInstanceFilter(IJavaObject object) throws CoreException {
if (fInstanceFilters == null) {
return;
}
if (fInstanceFilters.remove(object)) {
- recreate((JDIDebugTarget)object.getDebugTarget());
+ recreate((JDIDebugTarget) object.getDebugTarget());
fireChanged();
}
}
-
+
/**
* An attribute of this breakpoint has changed - recreate event requests in
* all targets.
*/
protected void recreate() throws CoreException {
DebugPlugin plugin = DebugPlugin.getDefault();
- if (plugin != null) {
- IDebugTarget[] targets = plugin.getLaunchManager().getDebugTargets();
- for (int i = 0; i < targets.length; i++) {
- IDebugTarget target = targets[i];
- MultiStatus multiStatus = new MultiStatus(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, JDIDebugBreakpointMessages.JavaBreakpoint_Exception, null);
- IJavaDebugTarget jdiTarget = (IJavaDebugTarget) target.getAdapter(IJavaDebugTarget.class);
- if (jdiTarget instanceof JDIDebugTarget) {
- try {
- recreate((JDIDebugTarget) jdiTarget);
- } catch (CoreException e) {
- multiStatus.add(e.getStatus());
- }
- }
- if (!multiStatus.isOK()) {
- throw new CoreException(multiStatus);
- }
- }
- }
- }
-
+ if (plugin != null) {
+ IDebugTarget[] targets = plugin.getLaunchManager()
+ .getDebugTargets();
+ for (IDebugTarget target : targets) {
+ MultiStatus multiStatus = new MultiStatus(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.ERROR,
+ JDIDebugBreakpointMessages.JavaBreakpoint_Exception,
+ null);
+ IJavaDebugTarget jdiTarget = (IJavaDebugTarget) target
+ .getAdapter(IJavaDebugTarget.class);
+ if (jdiTarget instanceof JDIDebugTarget) {
+ try {
+ recreate((JDIDebugTarget) jdiTarget);
+ } catch (CoreException e) {
+ multiStatus.add(e.getStatus());
+ }
+ }
+ if (!multiStatus.isOK()) {
+ throw new CoreException(multiStatus);
+ }
+ }
+ }
+ }
+
/**
- * Recreate this breakpoint in the given target, as long as the
- * target already contains this breakpoint.
+ * Recreate this breakpoint in the given target, as long as the target
+ * already contains this breakpoint.
*
- * @param target the target in which to re-create the breakpoint
+ * @param target
+ * the target in which to re-create the breakpoint
*/
protected void recreate(JDIDebugTarget target) throws CoreException {
if (target.isAvailable() && target.getBreakpoints().contains(this)) {
@@ -1204,61 +1331,80 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.Breakpoint#setEnabled(boolean)
*/
+ @Override
public void setEnabled(boolean enabled) throws CoreException {
super.setEnabled(enabled);
recreate();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#supportsInstanceFilters()
*/
public boolean supportsInstanceFilters() {
return true;
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#supportsThreadFilters()
*/
public boolean supportsThreadFilters() {
return true;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#addBreakpointListener(java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#addBreakpointListener(java
+ * .lang.String)
*/
- public synchronized void addBreakpointListener(String identifier) throws CoreException {
+ public synchronized void addBreakpointListener(String identifier)
+ throws CoreException {
if (fBreakpointListenerIds == null) {
- fBreakpointListenerIds = new ArrayList();
+ fBreakpointListenerIds = new ArrayList<String>();
}
if (!fBreakpointListenerIds.contains(identifier)) {
fBreakpointListenerIds.add(identifier);
writeBreakpointListeners();
}
}
-
+
/**
- * Writes the current breakpoint listener collection to the underlying marker.
+ * Writes the current breakpoint listener collection to the underlying
+ * marker.
*
* @throws CoreException
*/
private void writeBreakpointListeners() throws CoreException {
StringBuffer buf = new StringBuffer();
- Iterator iterator = fBreakpointListenerIds.iterator();
+ Iterator<String> iterator = fBreakpointListenerIds.iterator();
while (iterator.hasNext()) {
- buf.append((String)iterator.next());
+ buf.append(iterator.next());
if (iterator.hasNext()) {
buf.append(","); //$NON-NLS-1$
}
}
setAttribute(BREAKPOINT_LISTENERS, buf.toString());
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#removeBreakpointListener(java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#removeBreakpointListener(java
+ * .lang.String)
*/
- public synchronized boolean removeBreakpointListener(String identifier) throws CoreException {
+ public synchronized boolean removeBreakpointListener(String identifier)
+ throws CoreException {
if (fBreakpointListenerIds != null) {
if (fBreakpointListenerIds.remove(identifier)) {
writeBreakpointListeners();
@@ -1267,8 +1413,10 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
}
return false;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#getBreakpointListeners()
*/
public synchronized String[] getBreakpointListeners() throws CoreException {
@@ -1276,20 +1424,24 @@ public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoi
if (fBreakpointListenerIds == null) {
return new String[0];
}
- return (String[]) fBreakpointListenerIds.toArray(new String[fBreakpointListenerIds.size()]);
+ return fBreakpointListenerIds
+ .toArray(new String[fBreakpointListenerIds.size()]);
}
-
+
/**
* Reads breakpoint listeners from the underlying marker.
*
- * @return breakpoint listener identifiers stored in this breakpoint's marker
- * @throws CoreException if no marker
+ * @return breakpoint listener identifiers stored in this breakpoint's
+ * marker
+ * @throws CoreException
+ * if no marker
*/
private String[] readBreakpointListeners() throws CoreException {
- String value = ensureMarker().getAttribute(BREAKPOINT_LISTENERS, (String) null);
+ String value = ensureMarker().getAttribute(BREAKPOINT_LISTENERS,
+ (String) null);
if (value == null) {
return new String[0];
}
return value.split(","); //$NON-NLS-1$
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java
index 20d93f356..bbe281a4b 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java
@@ -11,7 +11,6 @@
package org.eclipse.jdt.internal.debug.core.breakpoints;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Stack;
@@ -53,22 +52,24 @@ import org.eclipse.jdt.debug.core.IJavaWatchpoint;
*
* @since 3.5
*/
-public class JavaBreakpointImportParticipant implements IBreakpointImportParticipant {
+public class JavaBreakpointImportParticipant implements
+ IBreakpointImportParticipant {
class BreakpointVerifier extends ASTVisitor {
final int TYPE = 0;
final int METHOD = 1;
final int FIELD = 2;
-
+
String fTypename = null;
String fName = null;
String fSignature = null;
IBreakpoint fBreakpoint = null;
CompilationUnit fUnit = null;
- Stack fTypeNameStack = null;
-
+ Stack<String> fTypeNameStack = null;
+
/**
* Constructor
+ *
* @param breakpoint
* @param unit
*/
@@ -78,130 +79,152 @@ public class JavaBreakpointImportParticipant implements IBreakpointImportPartici
fSignature = getMemberSignature(breakpoint);
fBreakpoint = breakpoint;
fUnit = unit;
- fTypeNameStack = new Stack();
+ fTypeNameStack = new Stack<String>();
}
-
+
/**
- * Returns the value of the {@link JavaBreakpoint#TYPE_NAME} attribute from the breakpoint or <code>null</code>
+ * Returns the value of the {@link JavaBreakpoint#TYPE_NAME} attribute
+ * from the breakpoint or <code>null</code>
+ *
* @param breakpoint
* @return the value of the type name attribute
*/
String getBreakpointTypeName(IBreakpoint breakpoint) {
- return breakpoint.getMarker().getAttribute(JavaBreakpoint.TYPE_NAME, null);
+ return breakpoint.getMarker().getAttribute(
+ JavaBreakpoint.TYPE_NAME, null);
}
-
+
/**
- * Returns the name of the member from the breakpoint attributes. The name will be one of
- * (1) {@link JavaWatchpoint#FIELD_NAME}, if the breakpoint is a watchpoint, or
- * (2) {@link JavaMethodBreakpoint#METHOD_NAME} if the breakpoint is a method or method entry breakpoint
- * (3) <code>null</code> if there is no member name
+ * Returns the name of the member from the breakpoint attributes. The
+ * name will be one of (1) {@link JavaWatchpoint#FIELD_NAME}, if the
+ * breakpoint is a watchpoint, or (2)
+ * {@link JavaMethodBreakpoint#METHOD_NAME} if the breakpoint is a
+ * method or method entry breakpoint (3) <code>null</code> if there is
+ * no member name
+ *
* @param breakpoint
* @return the member name or <code>null</code>
*/
String getMemberName(IBreakpoint breakpoint) {
- if(breakpoint instanceof IJavaWatchpoint) {
- return breakpoint.getMarker().getAttribute(JavaWatchpoint.FIELD_NAME, null);
+ if (breakpoint instanceof IJavaWatchpoint) {
+ return breakpoint.getMarker().getAttribute(
+ JavaWatchpoint.FIELD_NAME, null);
}
- return breakpoint.getMarker().getAttribute(JavaMethodBreakpoint.METHOD_NAME, null);
+ return breakpoint.getMarker().getAttribute(
+ JavaMethodBreakpoint.METHOD_NAME, null);
}
-
+
/**
- * Returns the signature of the member, defined with the {@link JavaMethodBreakpoint#METHOD_SIGNATURE} attribute,
- * or <code>null</code>
+ * Returns the signature of the member, defined with the
+ * {@link JavaMethodBreakpoint#METHOD_SIGNATURE} attribute, or
+ * <code>null</code>
+ *
* @param breakpoint
* @return the signature of the member or <code>null</code>
*/
- String getMemberSignature(IBreakpoint breakpoint){
- return breakpoint.getMarker().getAttribute(JavaMethodBreakpoint.METHOD_SIGNATURE, null);
+ String getMemberSignature(IBreakpoint breakpoint) {
+ return breakpoint.getMarker().getAttribute(
+ JavaMethodBreakpoint.METHOD_SIGNATURE, null);
}
-
+
/**
- * Returns the fully qualified name of the enclosing type for the given node
+ * Returns the fully qualified name of the enclosing type for the given
+ * node
+ *
* @param node
* @return the fully qualified name of the enclosing type
*/
private String getTypeName(ASTNode node) {
return getTypeName(node, new StringBuffer());
}
-
+
/**
* Constructs the qualified name of the enclosing parent type
- * @param node the node to get the parent name for
- * @param buffer the buffer to write the name into
- * @return the fully qualified name of the parent
+ *
+ * @param node
+ * the node to get the parent name for
+ * @param buffer
+ * the buffer to write the name into
+ * @return the fully qualified name of the parent
*/
private String getTypeName(ASTNode node, StringBuffer buffer) {
- switch(node.getNodeType()) {
- case ASTNode.COMPILATION_UNIT : {
- CompilationUnit unit = (CompilationUnit) node;
- PackageDeclaration packageDeclaration = unit.getPackage();
- if (packageDeclaration != null) {
- buffer.insert(0, '.');
- buffer.insert(0, packageDeclaration.getName().getFullyQualifiedName());
- }
- return String.valueOf(buffer);
+ switch (node.getNodeType()) {
+ case ASTNode.COMPILATION_UNIT: {
+ CompilationUnit unit = (CompilationUnit) node;
+ PackageDeclaration packageDeclaration = unit.getPackage();
+ if (packageDeclaration != null) {
+ buffer.insert(0, '.');
+ buffer.insert(0, packageDeclaration.getName()
+ .getFullyQualifiedName());
}
- default : {
- if (node instanceof AbstractTypeDeclaration) {
- AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) node;
- ITypeBinding binding = typeDeclaration.resolveBinding();
- if(binding != null) {
- return binding.getBinaryName();
- }
- else {
- if (typeDeclaration.isPackageMemberTypeDeclaration()) {
- buffer.insert(0, typeDeclaration.getName().getIdentifier());
- }
- else {
- buffer.insert(0, typeDeclaration.getName().getFullyQualifiedName());
- buffer.insert(0, '$');
- }
+ return String.valueOf(buffer);
+ }
+ default: {
+ if (node instanceof AbstractTypeDeclaration) {
+ AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) node;
+ ITypeBinding binding = typeDeclaration.resolveBinding();
+ if (binding != null) {
+ return binding.getBinaryName();
+ } else {
+ if (typeDeclaration.isPackageMemberTypeDeclaration()) {
+ buffer.insert(0, typeDeclaration.getName()
+ .getIdentifier());
+ } else {
+ buffer.insert(0, typeDeclaration.getName()
+ .getFullyQualifiedName());
+ buffer.insert(0, '$');
}
}
}
}
+ }
return getTypeName(node.getParent(), buffer);
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclaration)
*/
+ @Override
public boolean visit(TypeDeclaration node) {
return doTypeVisit(node);
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.TypeDeclaration)
*/
+ @Override
public void endVisit(TypeDeclaration node) {
doEndTypeVisit();
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumDeclaration)
*/
+ @Override
public boolean visit(EnumDeclaration node) {
return doTypeVisit(node);
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnumDeclaration)
*/
+ @Override
public void endVisit(EnumDeclaration node) {
doEndTypeVisit();
}
-
+
/**
* Cleans up after a type visit has ended
*/
private void doEndTypeVisit() {
- if(!fTypeNameStack.isEmpty()) {
+ if (!fTypeNameStack.isEmpty()) {
fTypeNameStack.pop();
}
}
-
+
/**
* Visits the type node and return if children should be visited
+ *
* @param node
* @return true if child nodes should be visited false otherwise
*/
@@ -209,205 +232,230 @@ public class JavaBreakpointImportParticipant implements IBreakpointImportPartici
SimpleName name = node.getName();
String typename = getTypeName(node);
fTypeNameStack.push(typename);
- if(!fTypename.startsWith(typename)) {
- //we are examining the wrong type stop and process other types
+ if (!fTypename.startsWith(typename)) {
+ // we are examining the wrong type stop and process other types
return false;
}
- if(fBreakpoint instanceof JavaClassPrepareBreakpoint &&
- name != null &&
- typename.equals(fTypename)) {
+ if (fBreakpoint instanceof JavaClassPrepareBreakpoint
+ && name != null && typename.equals(fTypename)) {
int charstart = name.getStartPosition();
IMarker marker = fBreakpoint.getMarker();
try {
marker.setAttribute(IMarker.CHAR_START, charstart);
- marker.setAttribute(IMarker.CHAR_END, charstart + name.getLength());
+ marker.setAttribute(IMarker.CHAR_END,
+ charstart + name.getLength());
+ } catch (CoreException ce) {
}
- catch(CoreException ce) {}
- //found the node we were looking for, do not visit children
+ // found the node we were looking for, do not visit children
return false;
}
return fTypename.indexOf('$') > -1 || name != null;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldDeclaration)
*/
+ @Override
public boolean visit(FieldDeclaration node) {
- if(!fTypename.equals(fTypeNameStack.peek())) {
+ if (!fTypename.equals(fTypeNameStack.peek())) {
return false;
}
- List fragments = node.fragments();
- VariableDeclarationFragment fragment = null;
+ List<VariableDeclarationFragment> fragments = node.fragments();
SimpleName name = null;
IMarker marker = fBreakpoint.getMarker();
int currentstart = marker.getAttribute(IMarker.CHAR_START, -1);
- for(Iterator iter = fragments.iterator(); iter.hasNext();) {
- fragment = (VariableDeclarationFragment) iter.next();
+ for (VariableDeclarationFragment fragment : fragments) {
name = fragment.getName();
- if(name != null && name.getFullyQualifiedName().equals(fName)) {
- //found field update the charstart / charend
+ if (name != null && name.getFullyQualifiedName().equals(fName)) {
+ // found field update the charstart / charend
int charstart = name.getStartPosition();
- if(currentstart != charstart) {
+ if (currentstart != charstart) {
try {
marker.setAttribute(IMarker.CHAR_START, charstart);
- marker.setAttribute(IMarker.CHAR_END, charstart + name.getLength());
+ marker.setAttribute(IMarker.CHAR_END, charstart
+ + name.getLength());
+ } catch (CoreException ce) {
}
- catch(CoreException ce) {}
}
}
}
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodDeclaration)
*/
+ @Override
public boolean visit(MethodDeclaration node) {
SimpleName name = node.getName();
- String typename = (String) fTypeNameStack.peek();
- if(!fTypename.equals(typename) && !fTypename.startsWith(typename)) {
+ String typename = fTypeNameStack.peek();
+ if (!fTypename.equals(typename) && !fTypename.startsWith(typename)) {
return false;
}
- if(name != null && name.getFullyQualifiedName().equals(fName)) {
+ if (name != null && name.getFullyQualifiedName().equals(fName)) {
String sig = getMethodSignatureFromNode(node);
- if(sig != null) {
+ if (sig != null) {
sig = sig.replaceAll("\\.", "/"); //$NON-NLS-1$ //$NON-NLS-2$
- if(sig.equals(fSignature)) {
+ if (sig.equals(fSignature)) {
IMarker marker = fBreakpoint.getMarker();
- int currentstart = marker.getAttribute(IMarker.CHAR_START, -1);
+ int currentstart = marker.getAttribute(
+ IMarker.CHAR_START, -1);
int charstart = name.getStartPosition();
- if(currentstart != charstart) {
+ if (currentstart != charstart) {
try {
- marker.setAttribute(IMarker.CHAR_START, charstart);
- marker.setAttribute(IMarker.CHAR_END, charstart + name.getLength());
+ marker.setAttribute(IMarker.CHAR_START,
+ charstart);
+ marker.setAttribute(IMarker.CHAR_END, charstart
+ + name.getLength());
+ } catch (CoreException ce) {
}
- catch(CoreException ce) {}
}
}
}
}
- //visit children in the event we have a class load breakpoint on a local type
+ // visit children in the event we have a class load breakpoint on a
+ // local type
return fBreakpoint instanceof JavaClassPrepareBreakpoint;
}
-
+
/**
* Creates a method signature from a specified {@link MethodDeclaration}
+ *
* @param node
* @return the signature for the given method node or <code>null</code>
*/
private String getMethodSignatureFromNode(MethodDeclaration node) {
Assert.isNotNull(node);
- List params = node.parameters();
- List rparams = getParametersTypeNames(params);
- if(rparams.size() == params.size()) {
- if(!node.isConstructor()) {
+ List<SingleVariableDeclaration> params = node.parameters();
+ List<String> rparams = getParametersTypeNames(params);
+ if (rparams.size() == params.size()) {
+ if (!node.isConstructor()) {
Type returnType = node.getReturnType2();
if (returnType != null) {
String rtype = getTypeSignature(returnType);
- if(rtype != null) {
- return Signature.createMethodSignature((String[]) rparams.toArray(new String[rparams.size()]), rtype);
+ if (rtype != null) {
+ return Signature
+ .createMethodSignature(
+ rparams
+ .toArray(new String[rparams
+ .size()]), rtype);
}
}
- }
- else {
+ } else {
StringBuffer buffer = new StringBuffer();
buffer.append("<init>"); //$NON-NLS-1$
collectSyntheticParam(node, rparams);
- buffer.append(Signature.createMethodSignature((String[]) rparams.toArray(new String[rparams.size()]), Signature.SIG_VOID));
+ buffer.append(Signature.createMethodSignature(
+ rparams.toArray(new String[rparams
+ .size()]), Signature.SIG_VOID));
return buffer.toString();
}
}
return null;
}
-
+
/**
* Returns the listing of the signatures of the parameters passed in
+ *
* @param rawparams
* @return a listing of signatures for the specified parameters
*/
- private List getParametersTypeNames(List rawparams) {
- List rparams = new ArrayList(rawparams.size());
- SingleVariableDeclaration param = null;
+ private List<String> getParametersTypeNames(List<SingleVariableDeclaration> rawparams) {
+ List<String> rparams = new ArrayList<String>(rawparams.size());
String pname = null;
- for(Iterator iter = rawparams.iterator(); iter.hasNext();) {
- param = (SingleVariableDeclaration) iter.next();
+ for (SingleVariableDeclaration param : rawparams) {
pname = getTypeSignature(param.getType());
- if(pname != null) {
+ if (pname != null) {
rparams.add(pname);
}
}
return rparams;
}
-
+
/**
* Processes the signature for the given {@link Type}
- * @param type the type to process
- * @return the signature for the type or <code>null</code> if one could not be
- * derived
+ *
+ * @param type
+ * the type to process
+ * @return the signature for the type or <code>null</code> if one could
+ * not be derived
*/
private String getTypeSignature(Type type) {
ITypeBinding binding = type.resolveBinding();
- if(binding == null) {
+ if (binding == null) {
return null;
}
- switch(type.getNodeType()) {
+ switch (type.getNodeType()) {
case ASTNode.PRIMITIVE_TYPE:
case ASTNode.QUALIFIED_TYPE:
- case ASTNode.SIMPLE_TYPE: {
- return Signature.createTypeSignature(binding.getQualifiedName(), true);
- }
- case ASTNode.ARRAY_TYPE: {
- ArrayType a = (ArrayType) type;
- return Signature.createArraySignature(getTypeSignature(a.getElementType()), a.getDimensions());
- }
- case ASTNode.PARAMETERIZED_TYPE: {
- //we don't need to care about the other scoping types only the base type
- return getTypeSignature(((ParameterizedType) type).getType());
- }
+ case ASTNode.SIMPLE_TYPE: {
+ return Signature.createTypeSignature(
+ binding.getQualifiedName(), true);
+ }
+ case ASTNode.ARRAY_TYPE: {
+ ArrayType a = (ArrayType) type;
+ return Signature
+ .createArraySignature(
+ getTypeSignature(a.getElementType()),
+ a.getDimensions());
+ }
+ case ASTNode.PARAMETERIZED_TYPE: {
+ // we don't need to care about the other scoping types only the
+ // base type
+ return getTypeSignature(((ParameterizedType) type).getType());
+ }
}
return null;
}
-
+
/**
- * Collects the synthetic parameter of the fully qualified name of the enclosing context for a constructor of an inner type
- * @param method the constructor declaration
- * @param rparams the listing of parameters to add to
+ * Collects the synthetic parameter of the fully qualified name of the
+ * enclosing context for a constructor of an inner type
+ *
+ * @param method
+ * the constructor declaration
+ * @param rparams
+ * the listing of parameters to add to
*/
- private void collectSyntheticParam(final MethodDeclaration method, List rparams) {
+ private void collectSyntheticParam(final MethodDeclaration method,
+ List<String> rparams) {
Assert.isNotNull(method);
- if(isInTopLevelType(method)) {
+ if (isInTopLevelType(method)) {
return;
}
ASTNode parent = method.getParent();
StringBuffer name = new StringBuffer();
- while(parent != null) {
+ while (parent != null) {
parent = parent.getParent();
- if(parent instanceof AbstractTypeDeclaration) {
+ if (parent instanceof AbstractTypeDeclaration) {
AbstractTypeDeclaration type = (AbstractTypeDeclaration) parent;
name.insert(0, type.getName().getFullyQualifiedName());
- if(type.isMemberTypeDeclaration()) {
+ if (type.isMemberTypeDeclaration()) {
name.insert(0, '$');
}
continue;
}
- if(parent instanceof CompilationUnit) {
+ if (parent instanceof CompilationUnit) {
CompilationUnit cunit = (CompilationUnit) parent;
PackageDeclaration pdec = cunit.getPackage();
- if(pdec != null) {
+ if (pdec != null) {
name.insert(0, '.');
- name.insert(0, cunit.getPackage().getName().getFullyQualifiedName());
+ name.insert(0, cunit.getPackage().getName()
+ .getFullyQualifiedName());
}
}
}
name.insert(0, "L"); //$NON-NLS-1$
name.append(';');
- if(name.length() > 2) {
+ if (name.length() > 2) {
rparams.add(0, name.toString());
}
}
-
+
/**
- * Determines if the given {@link MethodDeclaration} is present in a top level type
+ * Determines if the given {@link MethodDeclaration} is present in a top
+ * level type
+ *
* @param method
* @return
*/
@@ -416,92 +464,115 @@ public class JavaBreakpointImportParticipant implements IBreakpointImportPartici
return type != null && type.isPackageMemberTypeDeclaration();
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IBreakpointImportParticipant#matches(java.util.Map, org.eclipse.debug.core.model.IBreakpoint)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IBreakpointImportParticipant#matches(java
+ * .util.Map, org.eclipse.debug.core.model.IBreakpoint)
*/
- public boolean matches(Map attributes, IBreakpoint breakpoint) throws CoreException {
- if(attributes == null || breakpoint == null) {
+ public boolean matches(Map attributes, IBreakpoint breakpoint)
+ throws CoreException {
+ if (attributes == null || breakpoint == null) {
return false;
}
String type = (String) attributes.get("type"); //$NON-NLS-1$
- if(type == null) {
+ if (type == null) {
return false;
}
- if(!breakpoint.getMarker().getType().equals(type)) {
+ if (!breakpoint.getMarker().getType().equals(type)) {
return false;
}
- if(breakpoint instanceof JavaClassPrepareBreakpoint) {
- return matchesClassBreakpoint(attributes, (JavaClassPrepareBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaClassPrepareBreakpoint) {
+ return matchesClassBreakpoint(attributes,
+ (JavaClassPrepareBreakpoint) breakpoint);
}
- if(breakpoint instanceof JavaExceptionBreakpoint) {
- return matchesExceptionBreakpoint(attributes, (JavaExceptionBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaExceptionBreakpoint) {
+ return matchesExceptionBreakpoint(attributes,
+ (JavaExceptionBreakpoint) breakpoint);
}
- if(breakpoint instanceof JavaMethodBreakpoint) {
- return matchesMethodBreakpoint(attributes, (JavaMethodBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaMethodBreakpoint) {
+ return matchesMethodBreakpoint(attributes,
+ (JavaMethodBreakpoint) breakpoint);
}
- if(breakpoint instanceof JavaMethodEntryBreakpoint) {
- return matchesMethodEntryBreakpoint(attributes, (JavaMethodEntryBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaMethodEntryBreakpoint) {
+ return matchesMethodEntryBreakpoint(attributes,
+ (JavaMethodEntryBreakpoint) breakpoint);
}
- if(breakpoint instanceof JavaWatchpoint){
+ if (breakpoint instanceof JavaWatchpoint) {
return matchesWatchpoint(attributes, (JavaWatchpoint) breakpoint);
}
- if(breakpoint instanceof JavaStratumLineBreakpoint) {
- return matchesStratumLineBreakpoint(attributes, (JavaStratumLineBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaStratumLineBreakpoint) {
+ return matchesStratumLineBreakpoint(attributes,
+ (JavaStratumLineBreakpoint) breakpoint);
}
- if(breakpoint instanceof JavaPatternBreakpoint) {
- return matchesPatternBreakpoint(attributes, (JavaPatternBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaPatternBreakpoint) {
+ return matchesPatternBreakpoint(attributes,
+ (JavaPatternBreakpoint) breakpoint);
}
- if(breakpoint instanceof JavaTargetPatternBreakpoint){
- return matchesTargetPatternBreakpoint(attributes, (JavaTargetPatternBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaTargetPatternBreakpoint) {
+ return matchesTargetPatternBreakpoint(attributes,
+ (JavaTargetPatternBreakpoint) breakpoint);
}
- if(breakpoint instanceof JavaLineBreakpoint) {
- return matchesLineBreakpoint(attributes, (JavaLineBreakpoint) breakpoint);
+ if (breakpoint instanceof JavaLineBreakpoint) {
+ return matchesLineBreakpoint(attributes,
+ (JavaLineBreakpoint) breakpoint);
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IBreakpointImportParticipant#verify(org.eclipse.debug.core.model.IBreakpoint)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IBreakpointImportParticipant#verify(org.
+ * eclipse.debug.core.model.IBreakpoint)
*/
public void verify(IBreakpoint breakpoint) throws CoreException {
IResource resource = breakpoint.getMarker().getResource();
CompilationUnit unit = null;
- if(resource != null && resource.getType() == IResource.FILE) {
- ICompilationUnit cunit = JavaCore.createCompilationUnitFrom((IFile) resource);
- if(cunit != null) {
+ if (resource != null && resource.getType() == IResource.FILE) {
+ ICompilationUnit cunit = JavaCore
+ .createCompilationUnitFrom((IFile) resource);
+ if (cunit != null) {
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(cunit);
parser.setResolveBindings(true);
- unit = (CompilationUnit) parser.createAST(new NullProgressMonitor());
+ unit = (CompilationUnit) parser
+ .createAST(new NullProgressMonitor());
}
}
- if(unit != null) {
- if(breakpoint instanceof JavaClassPrepareBreakpoint ||
- breakpoint instanceof JavaWatchpoint ||
- breakpoint instanceof JavaMethodEntryBreakpoint ||
- breakpoint instanceof JavaMethodBreakpoint) {
+ if (unit != null) {
+ if (breakpoint instanceof JavaClassPrepareBreakpoint
+ || breakpoint instanceof JavaWatchpoint
+ || breakpoint instanceof JavaMethodEntryBreakpoint
+ || breakpoint instanceof JavaMethodBreakpoint) {
unit.accept(new BreakpointVerifier(breakpoint, unit));
- }
- else if(breakpoint instanceof JavaLineBreakpoint) {
+ } else if (breakpoint instanceof JavaLineBreakpoint) {
JavaLineBreakpoint bp = (JavaLineBreakpoint) breakpoint;
- //line breakpoint use the ValidBreakpointLocationLocator to (re)place it
+ // line breakpoint use the ValidBreakpointLocationLocator to
+ // (re)place it
int currentline = bp.getLineNumber();
- ValidBreakpointLocationLocator locator = new ValidBreakpointLocationLocator(unit, currentline, true, true);
+ ValidBreakpointLocationLocator locator = new ValidBreakpointLocationLocator(
+ unit, currentline, true, true);
unit.accept(locator);
int newline = locator.getLineLocation();
- if(locator.getLocationType() == ValidBreakpointLocationLocator.LOCATION_LINE) {
- if(currentline != newline) {
- bp.getMarker().setAttribute(JavaBreakpoint.TYPE_NAME, locator.getFullyQualifiedTypeName());
- bp.getMarker().setAttribute(IMarker.LINE_NUMBER, newline);
+ if (locator.getLocationType() == ValidBreakpointLocationLocator.LOCATION_LINE) {
+ if (currentline != newline) {
+ bp.getMarker().setAttribute(JavaBreakpoint.TYPE_NAME,
+ locator.getFullyQualifiedTypeName());
+ bp.getMarker().setAttribute(IMarker.LINE_NUMBER,
+ newline);
int length = bp.getCharEnd() - bp.getCharStart();
int pos = unit.getPosition(newline, 1);
bp.getMarker().setAttribute(IMarker.CHAR_START, pos);
- bp.getMarker().setAttribute(IMarker.CHAR_END, pos+length);
+ bp.getMarker().setAttribute(IMarker.CHAR_END,
+ pos + length);
}
- }
- else {
- //the line breakpoint will not be a line breakpoint anymore get rid of it
+ } else {
+ // the line breakpoint will not be a line breakpoint anymore
+ // get rid of it
throw new CoreException(Status.CANCEL_STATUS);
}
}
@@ -510,13 +581,16 @@ public class JavaBreakpointImportParticipant implements IBreakpointImportPartici
/**
* Compares two attributes in a <code>null</code> safe way
- * @param attr1 the first attribute
- * @param attr2 the second attribute
- * @return true if the attributes are equal, false otherwise. If both attributes are <code>null</code>
- * they are considered to be equal
+ *
+ * @param attr1
+ * the first attribute
+ * @param attr2
+ * the second attribute
+ * @return true if the attributes are equal, false otherwise. If both
+ * attributes are <code>null</code> they are considered to be equal
*/
private boolean attributesEqual(Object attr1, Object attr2) {
- if(attr1 == null) {
+ if (attr1 == null) {
return attr2 == null;
}
return attr1.equals(attr2);
@@ -524,121 +598,177 @@ public class JavaBreakpointImportParticipant implements IBreakpointImportPartici
/**
* Returns if the given map of attributes matches the given line breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesLineBreakpoint(Map attributes, JavaLineBreakpoint breakpoint) throws CoreException {
+ private boolean matchesLineBreakpoint(Map<String, Object> attributes,
+ JavaLineBreakpoint breakpoint) throws CoreException {
Integer line = (Integer) attributes.get(IMarker.LINE_NUMBER);
- return breakpoint.getLineNumber() == (line == null ? -1 : line.intValue()) &&
- attributesEqual(breakpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME));
+ return breakpoint.getLineNumber() == (line == null ? -1 : line.intValue())
+ && attributesEqual(breakpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME));
}
-
+
/**
- * Returns if the given map of attributes matches the given class prepare breakpoint
+ * Returns if the given map of attributes matches the given class prepare
+ * breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesClassBreakpoint(Map attributes, JavaClassPrepareBreakpoint breakpoint) throws CoreException {
- Integer type = (Integer) attributes.get(JavaClassPrepareBreakpoint.MEMBER_TYPE);
- return attributesEqual(breakpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME)) &&
- breakpoint.getMemberType() == (type == null ? -1 : type.intValue());
+ private boolean matchesClassBreakpoint(Map<String, Object> attributes,
+ JavaClassPrepareBreakpoint breakpoint) throws CoreException {
+ Integer type = (Integer) attributes
+ .get(JavaClassPrepareBreakpoint.MEMBER_TYPE);
+ return attributesEqual(breakpoint.getTypeName(),
+ attributes.get(JavaBreakpoint.TYPE_NAME))
+ && breakpoint.getMemberType() == (type == null ? -1 : type
+ .intValue());
}
-
+
/**
- * Returns if the given map of attributes matches the given exception breakpoint
+ * Returns if the given map of attributes matches the given exception
+ * breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesExceptionBreakpoint(Map attributes, JavaExceptionBreakpoint breakpoint) throws CoreException {
- return attributesEqual(breakpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME));
+ private boolean matchesExceptionBreakpoint(Map<String, Object> attributes,
+ JavaExceptionBreakpoint breakpoint) throws CoreException {
+ return attributesEqual(breakpoint.getTypeName(),
+ attributes.get(JavaBreakpoint.TYPE_NAME));
}
-
+
/**
- * Returns if the given map of attributes matches the given method breakpoint
+ * Returns if the given map of attributes matches the given method
+ * breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesMethodBreakpoint(Map attributes, JavaMethodBreakpoint breakpoint) throws CoreException {
- return attributesEqual(breakpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME)) &&
- attributesEqual(breakpoint.getMethodName(), attributes.get(JavaMethodBreakpoint.METHOD_NAME)) &&
- attributesEqual(breakpoint.getMethodSignature(), attributes.get(JavaMethodBreakpoint.METHOD_SIGNATURE));
+ private boolean matchesMethodBreakpoint(Map<String, Object> attributes,
+ JavaMethodBreakpoint breakpoint) throws CoreException {
+ return attributesEqual(breakpoint.getTypeName(),
+ attributes.get(JavaBreakpoint.TYPE_NAME))
+ && attributesEqual(breakpoint.getMethodName(),
+ attributes.get(JavaMethodBreakpoint.METHOD_NAME))
+ && attributesEqual(breakpoint.getMethodSignature(),
+ attributes.get(JavaMethodBreakpoint.METHOD_SIGNATURE));
}
-
+
/**
- * Returns if the given map of attributes matches the given method entry breakpoint
+ * Returns if the given map of attributes matches the given method entry
+ * breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesMethodEntryBreakpoint(Map attributes, JavaMethodEntryBreakpoint breakpoint) throws CoreException {
- return attributesEqual(breakpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME)) &&
- attributesEqual(breakpoint.getMethodName(), attributes.get(JavaMethodBreakpoint.METHOD_NAME)) &&
- attributesEqual(breakpoint.getMethodSignature(), attributes.get(JavaMethodBreakpoint.METHOD_SIGNATURE));
+ private boolean matchesMethodEntryBreakpoint(Map<String, Object> attributes,
+ JavaMethodEntryBreakpoint breakpoint) throws CoreException {
+ return attributesEqual(breakpoint.getTypeName(),
+ attributes.get(JavaBreakpoint.TYPE_NAME))
+ && attributesEqual(breakpoint.getMethodName(),
+ attributes.get(JavaMethodBreakpoint.METHOD_NAME))
+ && attributesEqual(breakpoint.getMethodSignature(),
+ attributes.get(JavaMethodBreakpoint.METHOD_SIGNATURE));
}
-
+
/**
* Returns if the given map of attributes matches the given watchpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the watchpoints' attributes, false otherwise
+ * @return true if the attributes match the watchpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesWatchpoint(Map attributes, JavaWatchpoint watchpoint) throws CoreException {
- return watchpoint.getFieldName().equals(attributes.get(JavaWatchpoint.FIELD_NAME)) &&
- attributesEqual(watchpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME));
+ private boolean matchesWatchpoint(Map<String, Object> attributes, JavaWatchpoint watchpoint)
+ throws CoreException {
+ return watchpoint.getFieldName().equals(
+ attributes.get(JavaWatchpoint.FIELD_NAME))
+ && attributesEqual(watchpoint.getTypeName(),
+ attributes.get(JavaBreakpoint.TYPE_NAME));
}
-
+
/**
- * Returns if the given map of attributes matches the given stratum line breakpoint
+ * Returns if the given map of attributes matches the given stratum line
+ * breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesStratumLineBreakpoint(Map attributes, JavaStratumLineBreakpoint breakpoint) throws CoreException {
+ private boolean matchesStratumLineBreakpoint(Map<String, Object> attributes,
+ JavaStratumLineBreakpoint breakpoint) throws CoreException {
Integer line = (Integer) attributes.get(IMarker.LINE_NUMBER);
- return breakpoint.getLineNumber() == (line == null ? -1 : line.intValue()) &&
- attributesEqual(breakpoint.getSourceName(), attributes.get(JavaLineBreakpoint.SOURCE_NAME)) &&
- attributesEqual(breakpoint.getStratum(), attributes.get(JavaStratumLineBreakpoint.STRATUM)) &&
- attributesEqual(breakpoint.getSourcePath(), attributes.get(JavaStratumLineBreakpoint.SOURCE_PATH));
+ return breakpoint.getLineNumber() == (line == null ? -1 : line
+ .intValue())
+ && attributesEqual(breakpoint.getSourceName(),
+ attributes.get(JavaLineBreakpoint.SOURCE_NAME))
+ && attributesEqual(breakpoint.getStratum(),
+ attributes.get(JavaStratumLineBreakpoint.STRATUM))
+ && attributesEqual(breakpoint.getSourcePath(),
+ attributes.get(JavaStratumLineBreakpoint.SOURCE_PATH));
}
-
+
/**
- * Returns if the given map of attributes matches the given pattern breakpoint
+ * Returns if the given map of attributes matches the given pattern
+ * breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesPatternBreakpoint(Map attributes, JavaPatternBreakpoint breakpoint) throws CoreException {
+ private boolean matchesPatternBreakpoint(Map<String, Object> attributes,
+ JavaPatternBreakpoint breakpoint) throws CoreException {
Integer line = (Integer) attributes.get(IMarker.LINE_NUMBER);
- return breakpoint.getLineNumber() == (line == null ? -1 : line.intValue()) &&
- attributesEqual(breakpoint.getSourceName(), attributes.get(JavaLineBreakpoint.SOURCE_NAME)) &&
- //TDOD comparing pattern too restrictive??
- breakpoint.getPattern().equals(attributes.get(JavaPatternBreakpoint.PATTERN));
+ return breakpoint.getLineNumber() == (line == null ? -1 : line
+ .intValue())
+ && attributesEqual(breakpoint.getSourceName(),
+ attributes.get(JavaLineBreakpoint.SOURCE_NAME)) &&
+ // TDOD comparing pattern too restrictive??
+ breakpoint.getPattern().equals(
+ attributes.get(JavaPatternBreakpoint.PATTERN));
}
-
+
/**
- * Returns if the given map of attributes matches the given target pattern breakpoint
+ * Returns if the given map of attributes matches the given target pattern
+ * breakpoint
+ *
* @param attributes
* @param breakpoint
- * @return true if the attributes match the breakpoints' attributes, false otherwise
+ * @return true if the attributes match the breakpoints' attributes, false
+ * otherwise
* @throws CoreException
*/
- private boolean matchesTargetPatternBreakpoint(Map attributes, JavaTargetPatternBreakpoint breakpoint) throws CoreException {
+ private boolean matchesTargetPatternBreakpoint(Map<String, Object> attributes,
+ JavaTargetPatternBreakpoint breakpoint) throws CoreException {
Integer line = (Integer) attributes.get(IMarker.LINE_NUMBER);
- return breakpoint.getLineNumber() == (line == null ? -1 : line.intValue()) &&
- attributesEqual(breakpoint.getTypeName(), attributes.get(JavaBreakpoint.TYPE_NAME)) &&
- attributesEqual(breakpoint.getSourceName(), attributes.get(JavaLineBreakpoint.SOURCE_NAME));
+ return breakpoint.getLineNumber() == (line == null ? -1 : line
+ .intValue())
+ && attributesEqual(breakpoint.getTypeName(),
+ attributes.get(JavaBreakpoint.TYPE_NAME))
+ && attributesEqual(breakpoint.getSourceName(),
+ attributes.get(JavaLineBreakpoint.SOURCE_NAME));
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaClassPrepareBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaClassPrepareBreakpoint.java
index 9b0fcf4f0..bd4b57d33 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaClassPrepareBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaClassPrepareBreakpoint.java
@@ -42,132 +42,177 @@ import com.sun.jdi.request.EventRequest;
*
* @since 3.0
*/
-public class JavaClassPrepareBreakpoint extends JavaBreakpoint implements IJavaClassPrepareBreakpoint {
-
- public static final String JAVA_CLASS_PREPARE_BREAKPOINT= "org.eclipse.jdt.debug.javaClassPrepareBreakpointMarker"; //$NON-NLS-1$
-
+public class JavaClassPrepareBreakpoint extends JavaBreakpoint implements
+ IJavaClassPrepareBreakpoint {
+
+ public static final String JAVA_CLASS_PREPARE_BREAKPOINT = "org.eclipse.jdt.debug.javaClassPrepareBreakpointMarker"; //$NON-NLS-1$
+
/**
* Class prepare breakpoint attribute storing the type of member this
- * breakpoint is associated with
- * (value <code>"org.eclipse.jdt.debug.core.memberType"</code>), encoded
- * as an integer.
+ * breakpoint is associated with (value
+ * <code>"org.eclipse.jdt.debug.core.memberType"</code>), encoded as an
+ * integer.
*/
protected static final String MEMBER_TYPE = "org.eclipse.jdt.debug.core.memberType"; //$NON-NLS-1$
-
+
/**
- * Creates and returns a Java class prepare breakpoint for the
- * given type.
- * @param resource the resource on which to create the associated
- * breakpoint marker
- * @param typeName the fully qualified name of the type for
- * which to create the breakpoint
- * @param memberType one of <code>TYPE_CLASS</code> or <code>TYPE_INTERFACE</code>
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param add whether to add this breakpoint to the breakpoint manager
+ * Creates and returns a Java class prepare breakpoint for the given type.
+ *
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param typeName
+ * the fully qualified name of the type for which to create the
+ * breakpoint
+ * @param memberType
+ * one of <code>TYPE_CLASS</code> or <code>TYPE_INTERFACE</code>
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param add
+ * whether to add this breakpoint to the breakpoint manager
* @return a Java class prepare breakpoint
- * @exception DebugException if unable to create the associated marker due
- * to a lower level exception.
- */
- public JavaClassPrepareBreakpoint(final IResource resource, final String typeName, final int memberType, final int charStart, final int charEnd, final boolean add, final Map attributes) throws DebugException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+ * @exception DebugException
+ * if unable to create the associated marker due to a lower
+ * level exception.
+ */
+ public JavaClassPrepareBreakpoint(final IResource resource,
+ final String typeName, final int memberType, final int charStart,
+ final int charEnd, final boolean add, final Map<String, Object> attributes)
+ throws DebugException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
+ public void run(IProgressMonitor monitor) throws CoreException {
// create the marker
setMarker(resource.createMarker(JAVA_CLASS_PREPARE_BREAKPOINT));
-
+
// add attributes
attributes.put(IBreakpoint.ID, getModelIdentifier());
attributes.put(IMarker.CHAR_START, new Integer(charStart));
- attributes.put(IMarker.CHAR_END, new Integer(charEnd));
+ attributes.put(IMarker.CHAR_END, new Integer(charEnd));
attributes.put(TYPE_NAME, typeName);
attributes.put(MEMBER_TYPE, new Integer(memberType));
attributes.put(ENABLED, Boolean.TRUE);
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
-
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
+
ensureMarker().setAttributes(attributes);
-
+
register(add);
}
};
run(getMarkerRule(resource), wr);
- }
-
+ }
+
public JavaClassPrepareBreakpoint() {
}
-
+
/**
* Creates event requests for the given target
*/
+ @Override
protected void createRequests(JDIDebugTarget target) throws CoreException {
if (target.isTerminated() || shouldSkipBreakpoint()) {
return;
}
- String referenceTypeName= getTypeName();
+ String referenceTypeName = getTypeName();
if (referenceTypeName == null) {
return;
}
- ClassPrepareRequest request = target.createClassPrepareRequest(referenceTypeName, null, false);
+ ClassPrepareRequest request = target.createClassPrepareRequest(
+ referenceTypeName, null, false);
configureRequestHitCount(request);
updateEnabledState(request, target);
registerRequest(request, target);
// TODO: do we show anything for types already loaded?
incrementInstallCount();
}
-
+
/**
- * Remove the given request from the given target. If the request
- * is the breakpoint request associated with this breakpoint,
- * decrement the install count.
+ * Remove the given request from the given target. If the request is the
+ * breakpoint request associated with this breakpoint, decrement the install
+ * count.
*/
- protected void deregisterRequest(EventRequest request, JDIDebugTarget target) throws CoreException {
+ @Override
+ protected void deregisterRequest(EventRequest request, JDIDebugTarget target)
+ throws CoreException {
target.removeJDIEventListener(this, request);
// A request may be getting deregistered because the breakpoint has
- // been deleted. It may be that this occurred because of a marker deletion.
+ // been deleted. It may be that this occurred because of a marker
+ // deletion.
// Don't try updating the marker (decrementing the install count) if
// it no longer exists.
if (getMarker().exists()) {
decrementInstallCount();
}
- }
-
- /* (non-Javadoc)
+ }
+
+ /*
+ * (non-Javadoc)
*
* Not supported for class prepare breakpoints.
*
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(com.sun.jdi.request.EventRequest, com.sun.jdi.ObjectReference)
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * addInstanceFilter(com.sun.jdi.request.EventRequest,
+ * com.sun.jdi.ObjectReference)
*/
- protected void addInstanceFilter(EventRequest request, ObjectReference object) {
+ @Override
+ protected void addInstanceFilter(EventRequest request,
+ ObjectReference object) {
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
*
* This method not used for class prepare breakpoints.
*
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#newRequest(org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, com.sun.jdi.ReferenceType)
+ * @see
+ * org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#newRequest
+ * (org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget,
+ * com.sun.jdi.ReferenceType)
*/
- protected EventRequest[] newRequests(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ @Override
+ protected EventRequest[] newRequests(JDIDebugTarget target,
+ ReferenceType type) throws CoreException {
return null;
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
*
* Not supported for class prepare breakpoints.
*
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#setRequestThreadFilter(com.sun.jdi.request.EventRequest, com.sun.jdi.ThreadReference)
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * setRequestThreadFilter(com.sun.jdi.request.EventRequest,
+ * com.sun.jdi.ThreadReference)
*/
- protected void setRequestThreadFilter(EventRequest request, ThreadReference thread) {
+ @Override
+ protected void setRequestThreadFilter(EventRequest request,
+ ThreadReference thread) {
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#handleClassPrepareEvent(com.sun.jdi.event.ClassPrepareEvent, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * handleClassPrepareEvent(com.sun.jdi.event.ClassPrepareEvent,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
*/
- public boolean handleClassPrepareEvent(ClassPrepareEvent event, JDIDebugTarget target, boolean suspendVote) {
+ @Override
+ public boolean handleClassPrepareEvent(ClassPrepareEvent event,
+ JDIDebugTarget target, boolean suspendVote) {
try {
- if (isEnabled() && event.referenceType().name().equals(getTypeName())) {
- ThreadReference threadRef= event.thread();
- JDIThread thread= target.findThread(threadRef);
+ if (isEnabled()
+ && event.referenceType().name().equals(getTypeName())) {
+ ThreadReference threadRef = event.thread();
+ JDIThread thread = target.findThread(threadRef);
if (thread == null || thread.isIgnoringBreakpoints()) {
return true;
}
@@ -177,43 +222,78 @@ public class JavaClassPrepareBreakpoint extends JavaBreakpoint implements IJavaC
}
return true;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#classPrepareComplete(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIThread, boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * classPrepareComplete(com.sun.jdi.event.Event,
+ * org.eclipse.jdt.internal.debug.core.model.JDIThread, boolean)
*/
- protected void classPrepareComplete(Event event, JDIThread thread, boolean suspend, EventSet eventSet) {
+ @Override
+ protected void classPrepareComplete(Event event, JDIThread thread,
+ boolean suspend, EventSet eventSet) {
thread.completeBreakpointHandling(this, suspend, true, eventSet);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaClassPrepareBreakpoint#getMemberType()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaClassPrepareBreakpoint#getMemberType()
*/
public int getMemberType() throws CoreException {
- return ensureMarker().getAttribute(MEMBER_TYPE, IJavaClassPrepareBreakpoint.TYPE_CLASS);
+ return ensureMarker().getAttribute(MEMBER_TYPE,
+ IJavaClassPrepareBreakpoint.TYPE_CLASS);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#supportsInstanceFilters()
*/
+ @Override
public boolean supportsInstanceFilters() {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#addInstanceFilter(org.eclipse.jdt.debug.core.IJavaObject)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#addInstanceFilter(org.eclipse
+ * .jdt.debug.core.IJavaObject)
*/
+ @Override
public void addInstanceFilter(IJavaObject object) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.REQUEST_FAILED, JDIDebugBreakpointMessages.JavaClassPrepareBreakpoint_2, null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ JDIDebugBreakpointMessages.JavaClassPrepareBreakpoint_2, null));
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaBreakpoint#setThreadFilter(org.eclipse.jdt.debug.core.IJavaThread)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaBreakpoint#setThreadFilter(org.eclipse
+ * .jdt.debug.core.IJavaThread)
*/
+ @Override
public void setThreadFilter(IJavaThread thread) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.REQUEST_FAILED, JDIDebugBreakpointMessages.JavaClassPrepareBreakpoint_3, null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.REQUEST_FAILED,
+ JDIDebugBreakpointMessages.JavaClassPrepareBreakpoint_3, null));
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaBreakpoint#supportsThreadFilters()
*/
+ @Override
public boolean supportsThreadFilters() {
return false;
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaExceptionBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaExceptionBreakpoint.java
index 2076c7d70..346023134 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaExceptionBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaExceptionBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -45,98 +44,117 @@ import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.ExceptionRequest;
-public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExceptionBreakpoint {
+public class JavaExceptionBreakpoint extends JavaBreakpoint implements
+ IJavaExceptionBreakpoint {
+
+ public static final String JAVA_EXCEPTION_BREAKPOINT = "org.eclipse.jdt.debug.javaExceptionBreakpointMarker"; //$NON-NLS-1$
- public static final String JAVA_EXCEPTION_BREAKPOINT= "org.eclipse.jdt.debug.javaExceptionBreakpointMarker"; //$NON-NLS-1$
-
/**
- * Exception breakpoint attribute storing the suspend on caught value
- * (value <code>"org.eclipse.jdt.debug.core.caught"</code>). This attribute is stored as a <code>boolean</code>.
- * When this attribute is <code>true</code>, a caught exception of the associated
- * type will cause execcution to suspend .
+ * Exception breakpoint attribute storing the suspend on caught value (value
+ * <code>"org.eclipse.jdt.debug.core.caught"</code>). This attribute is
+ * stored as a <code>boolean</code>. When this attribute is
+ * <code>true</code>, a caught exception of the associated type will cause
+ * execution to suspend .
*/
protected static final String CAUGHT = "org.eclipse.jdt.debug.core.caught"; //$NON-NLS-1$
/**
* Exception breakpoint attribute storing the suspend on uncaught value
- * (value <code>"org.eclipse.jdt.debug.core.uncaught"</code>). This attribute is stored as a
- * <code>boolean</code>. When this attribute is <code>true</code>, an uncaught
- * exception of the associated type will cause excecution to suspend.
+ * (value <code>"org.eclipse.jdt.debug.core.uncaught"</code>). This
+ * attribute is stored as a <code>boolean</code>. When this attribute is
+ * <code>true</code>, an uncaught exception of the associated type will
+ * cause execution to suspend.
*/
protected static final String UNCAUGHT = "org.eclipse.jdt.debug.core.uncaught"; //$NON-NLS-1$
/**
- * Exception breakpoint attribute storing the checked value (value <code>"org.eclipse.jdt.debug.core.checked"</code>).
- * This attribute is stored as a <code>boolean</code>, indicating whether an
- * exception is a checked exception.
+ * Exception breakpoint attribute storing the checked value (value
+ * <code>"org.eclipse.jdt.debug.core.checked"</code>). This attribute is
+ * stored as a <code>boolean</code>, indicating whether an exception is a
+ * checked exception.
*/
protected static final String CHECKED = "org.eclipse.jdt.debug.core.checked"; //$NON-NLS-1$
-
+
/**
- * Exception breakpoint attribute storing the String value (value <code>"org.eclipse.jdt.debug.core.filters"</code>).
- * This attribute is stored as a <code>String</code>, a comma delimited list
- * of class filters. The filters are applied as inclusion or exclusion depending on
+ * Exception breakpoint attribute storing the String value (value
+ * <code>"org.eclipse.jdt.debug.core.filters"</code>). This attribute is
+ * stored as a <code>String</code>, a comma delimited list of class filters.
+ * The filters are applied as inclusion or exclusion depending on
* INCLUSIVE_FILTERS.
*/
protected static final String INCLUSION_FILTERS = "org.eclipse.jdt.debug.core.inclusion_filters"; //$NON-NLS-1$
-
+
/**
- * Exception breakpoint attribute storing the String value (value <code>"org.eclipse.jdt.debug.core.filters"</code>).
- * This attribute is stored as a <code>String</code>, a comma delimited list
- * of class filters. The filters are applied as inclusion or exclusion depending on
+ * Exception breakpoint attribute storing the String value (value
+ * <code>"org.eclipse.jdt.debug.core.filters"</code>). This attribute is
+ * stored as a <code>String</code>, a comma delimited list of class filters.
+ * The filters are applied as inclusion or exclusion depending on
* INCLUSIVE_FILTERS.
*/
protected static final String EXCLUSION_FILTERS = "org.eclipse.jdt.debug.core.exclusion_filters"; //$NON-NLS-1$
/**
- * Allows the user to specify whether we should suspend if subclasses of the specified exception are thrown/caught
+ * Allows the user to specify whether we should suspend if subclasses of the
+ * specified exception are thrown/caught
+ *
* @since 3.2
*/
protected static final String SUSPEND_ON_SUBCLASSES = "org.eclipse.jdt.debug.core.suspend_on_subclasses"; //$NON-NLS-1$
-
+
/**
- * Name of the exception that was actually hit (could be a
- * subtype of the type that is being caught).
+ * Name of the exception that was actually hit (could be a sub-type of the
+ * type that is being caught).
*/
protected String fExceptionName = null;
-
+
/**
* The current set of inclusion class filters.
*/
- protected String[] fInclusionClassFilters= null;
-
+ protected String[] fInclusionClassFilters = null;
+
/**
* The current set of inclusion class filters.
*/
- protected String[] fExclusionClassFilters= null;
-
+ protected String[] fExclusionClassFilters = null;
+
private ObjectReference fLastException;
private JDIDebugTarget fLastTarget;
-
+
public JavaExceptionBreakpoint() {
}
-
- /**
- * Creates and returns an exception breakpoint for the
- * given (throwable) type. Caught and uncaught specify where the exception
- * should cause thread suspensions - that is, in caught and/or uncaught locations.
- * Checked indicates if the given exception is a checked exception.
- * @param resource the resource on which to create the associated
- * breakpoint marker
- * @param exceptionName the fully qualified name of the exception for
- * which to create the breakpoint
- * @param caught whether to suspend in caught locations
- * @param uncaught whether to suspend in uncaught locations
- * @param checked whether the exception is a checked exception
- * @param add whether to add this breakpoint to the breakpoint manager
+
+ /**
+ * Creates and returns an exception breakpoint for the given (throwable)
+ * type. Caught and uncaught specify where the exception should cause thread
+ * suspensions - that is, in caught and/or uncaught locations. Checked
+ * indicates if the given exception is a checked exception.
+ *
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param exceptionName
+ * the fully qualified name of the exception for which to create
+ * the breakpoint
+ * @param caught
+ * whether to suspend in caught locations
+ * @param uncaught
+ * whether to suspend in uncaught locations
+ * @param checked
+ * whether the exception is a checked exception
+ * @param add
+ * whether to add this breakpoint to the breakpoint manager
* @return a Java exception breakpoint
- * @exception DebugException if unable to create the associated marker due
- * to a lower level exception.
- */
- public JavaExceptionBreakpoint(final IResource resource, final String exceptionName, final boolean caught, final boolean uncaught, final boolean checked, final boolean add, final Map attributes) throws DebugException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+ * @exception DebugException
+ * if unable to create the associated marker due to a lower
+ * level exception.
+ */
+ public JavaExceptionBreakpoint(final IResource resource,
+ final String exceptionName, final boolean caught,
+ final boolean uncaught, final boolean checked, final boolean add,
+ final Map<String, Object> attributes) throws DebugException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
+ public void run(IProgressMonitor monitor) throws CoreException {
// create the marker
setMarker(resource.createMarker(JAVA_EXCEPTION_BREAKPOINT));
-
+
// add attributes
attributes.put(IBreakpoint.ID, getModelIdentifier());
attributes.put(TYPE_NAME, exceptionName);
@@ -144,35 +162,41 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
attributes.put(CAUGHT, Boolean.valueOf(caught));
attributes.put(UNCAUGHT, Boolean.valueOf(uncaught));
attributes.put(CHECKED, Boolean.valueOf(checked));
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
-
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
+
ensureMarker().setAttributes(attributes);
-
+
register(add);
}
};
run(getMarkerRule(resource), wr);
}
-
+
/**
* Creates a request in the given target to suspend when the given exception
- * type is thrown. The request is returned installed, configured, and enabled
- * as appropriate for this breakpoint.
+ * type is thrown. The request is returned installed, configured, and
+ * enabled as appropriate for this breakpoint.
*/
- protected EventRequest[] newRequests(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ @Override
+ protected EventRequest[] newRequests(JDIDebugTarget target,
+ ReferenceType type) throws CoreException {
if (!isCaught() && !isUncaught()) {
return null;
}
- ExceptionRequest request= null;
+ ExceptionRequest request = null;
EventRequestManager manager = target.getEventRequestManager();
if (manager == null) {
- target.requestFailed(JDIDebugBreakpointMessages.JavaExceptionBreakpoint_Unable_to_create_breakpoint_request___VM_disconnected__1, null);
+ target.requestFailed(
+ JDIDebugBreakpointMessages.JavaExceptionBreakpoint_Unable_to_create_breakpoint_request___VM_disconnected__1,
+ null);
return null;
}
try {
- request= manager.createExceptionRequest(type, isCaught(), isUncaught());
+ request = manager.createExceptionRequest(type, isCaught(),
+ isUncaught());
configureRequest(request, target);
} catch (VMDisconnectedException e) {
if (target.isAvailable()) {
@@ -182,45 +206,47 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
} catch (RuntimeException e) {
target.internalError(e);
return null;
- }
- return new EventRequest[]{request};
+ }
+ return new EventRequest[] { request };
}
/**
* Enable this exception breakpoint.
*
- * If the exception breakpoint is not catching caught or uncaught,
- * turn both modes on. If this isn't done, the resulting
- * state (enabled with caught and uncaught both disabled)
- * is ambiguous.
+ * If the exception breakpoint is not catching caught or uncaught, turn both
+ * modes on. If this isn't done, the resulting state (enabled with caught
+ * and uncaught both disabled) is ambiguous.
*/
- public void setEnabled(boolean enabled) throws CoreException {
+ @Override
+ public void setEnabled(boolean enabled) throws CoreException {
if (enabled) {
if (!(isCaught() || isUncaught())) {
- setAttributes(new String[] {CAUGHT, UNCAUGHT}, new Object[] {Boolean.TRUE, Boolean.TRUE});
+ setAttributes(new String[] { CAUGHT, UNCAUGHT }, new Object[] {
+ Boolean.TRUE, Boolean.TRUE });
}
}
super.setEnabled(enabled);
}
-
+
/**
- * Sets the values for whether this breakpoint will
- * suspend execution when the associated exception is thrown
- * and caught or not caught.
+ * Sets the values for whether this breakpoint will suspend execution when
+ * the associated exception is thrown and caught or not caught.
*/
- protected void setCaughtAndUncaught(boolean caught, boolean uncaught) throws CoreException {
- Object[] values= new Object[]{Boolean.valueOf(caught), Boolean.valueOf(uncaught)};
- String[] attributes= new String[]{CAUGHT, UNCAUGHT};
+ protected void setCaughtAndUncaught(boolean caught, boolean uncaught)
+ throws CoreException {
+ Object[] values = new Object[] { Boolean.valueOf(caught),
+ Boolean.valueOf(uncaught) };
+ String[] attributes = new String[] { CAUGHT, UNCAUGHT };
setAttributes(attributes, values);
}
-
+
/**
* @see IJavaExceptionBreakpoint#isCaught()
*/
public boolean isCaught() throws CoreException {
return ensureMarker().getAttribute(CAUGHT, false);
}
-
+
/**
* @see IJavaExceptionBreakpoint#setCaught(boolean)
*/
@@ -236,31 +262,39 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
}
recreate();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#setSuspendOnSubclasses(boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#setSuspendOnSubclasses
+ * (boolean)
*/
public void setSuspendOnSubclasses(boolean suspend) throws CoreException {
- if(suspend != isSuspendOnSubclasses()) {
+ if (suspend != isSuspendOnSubclasses()) {
setAttribute(SUSPEND_ON_SUBCLASSES, suspend);
recreate();
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#isSuspendOnSubclasses()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#isSuspendOnSubclasses
+ * ()
*/
public boolean isSuspendOnSubclasses() throws CoreException {
return ensureMarker().getAttribute(SUSPEND_ON_SUBCLASSES, false);
}
-
+
/**
* @see IJavaExceptionBreakpoint#isUncaught()
*/
public boolean isUncaught() throws CoreException {
return ensureMarker().getAttribute(UNCAUGHT, false);
- }
-
+ }
+
/**
* @see IJavaExceptionBreakpoint#setUncaught(boolean)
*/
@@ -276,37 +310,42 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
}
recreate();
}
-
+
/**
* @see IJavaExceptionBreakpoint#isChecked()
*/
public boolean isChecked() throws CoreException {
return ensureMarker().getAttribute(CHECKED, false);
}
-
+
/**
* @see JavaBreakpoint#setRequestThreadFilter(EventRequest)
*/
- protected void setRequestThreadFilter(EventRequest request, ThreadReference thread) {
- ((ExceptionRequest)request).addThreadFilter(thread);
+ @Override
+ protected void setRequestThreadFilter(EventRequest request,
+ ThreadReference thread) {
+ ((ExceptionRequest) request).addThreadFilter(thread);
}
-
+
/**
- * @see JavaBreakpoint#handleBreakpointEvent(Event, JDIDebugTarget, JDIThread)
- * Decides how to handle an exception being thrown
+ * @see JavaBreakpoint#handleBreakpointEvent(Event, JDIDebugTarget,
+ * JDIThread) Decides how to handle an exception being thrown
*
* @return true if we do not want to suspend false otherwise
*/
- public boolean handleBreakpointEvent(Event event, JDIThread thread, boolean suspendVote) {
+ @Override
+ public boolean handleBreakpointEvent(Event event, JDIThread thread,
+ boolean suspendVote) {
if (event instanceof ExceptionEvent) {
- ObjectReference ex = ((ExceptionEvent)event).exception();
+ ObjectReference ex = ((ExceptionEvent) event).exception();
fLastTarget = thread.getJavaDebugTarget();
fLastException = ex;
String name = null;
try {
name = ex.type().name();
- if(!name.equals(getTypeName())) {
- if(!isSuspendOnSubclasses() & isSubclass((ClassType) ex.type(), getTypeName())) {
+ if (!name.equals(getTypeName())) {
+ if (!isSuspendOnSubclasses()
+ & isSubclass((ClassType) ex.type(), getTypeName())) {
return true;
}
}
@@ -320,43 +359,44 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
} catch (DebugException de) {
JDIDebugPlugin.log(e);
return false;
- }
+ }
}
setExceptionName(name);
- if (getExclusionClassFilters().length >= 1
- || getInclusionClassFilters().length >= 1
- || filtersIncludeDefaultPackage(fInclusionClassFilters)
- || filtersIncludeDefaultPackage(fExclusionClassFilters)) {
- Location location = ((ExceptionEvent)event).location();
- String typeName = location.declaringType().name();
- boolean defaultPackage = typeName.indexOf('.') == -1;
- boolean included = true;
- String[] filters = getInclusionClassFilters();
- if (filters.length > 0) {
- included = matchesFilters(filters, typeName, defaultPackage);
- }
- boolean excluded = false;
- filters = getExclusionClassFilters();
- if (filters.length > 0) {
- excluded = matchesFilters(filters, typeName, defaultPackage);
- }
- if (included && !excluded) {
- return !suspend(thread, suspendVote);
- }
- return true;
- }
+ if (getExclusionClassFilters().length >= 1
+ || getInclusionClassFilters().length >= 1
+ || filtersIncludeDefaultPackage(fInclusionClassFilters)
+ || filtersIncludeDefaultPackage(fExclusionClassFilters)) {
+ Location location = ((ExceptionEvent) event).location();
+ String typeName = location.declaringType().name();
+ boolean defaultPackage = typeName.indexOf('.') == -1;
+ boolean included = true;
+ String[] filters = getInclusionClassFilters();
+ if (filters.length > 0) {
+ included = matchesFilters(filters, typeName, defaultPackage);
+ }
+ boolean excluded = false;
+ filters = getExclusionClassFilters();
+ if (filters.length > 0) {
+ excluded = matchesFilters(filters, typeName, defaultPackage);
+ }
+ if (included && !excluded) {
+ return !suspend(thread, suspendVote);
+ }
+ return true;
+ }
return !suspend(thread, suspendVote);
- }
+ }
return true;
}
-
+
/**
- * Returns whether the given class type is a subclass of the classs
- * with the given name.
+ * Returns whether the given class type is a subclass of the classes with the
+ * given name.
*
- * @param type the class type reference
+ * @param type
+ * the class type reference
* @return true if the specified the class type is a subclass of the class
- * with the given name
+ * with the given name
* @since 3.2
*/
private boolean isSubclass(ClassType type, String typeName) {
@@ -369,10 +409,15 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
}
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#setInstalledIn(org.eclipse.jdt.debug.core.IJavaDebugTarget, boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#setInstalledIn
+ * (org.eclipse.jdt.debug.core.IJavaDebugTarget, boolean)
*/
+ @Override
protected void setInstalledIn(IJavaDebugTarget target, boolean installed) {
fLastException = null;
fLastTarget = null;
@@ -380,78 +425,94 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
}
/**
- * Determines of the filters for this exception include the default package or not
- * @param filters the list of filters to inspect
- * @return true if any one of the spcified filters include the default package
+ * Determines of the filters for this exception include the default package
+ * or not
+ *
+ * @param filters
+ * the list of filters to inspect
+ * @return true if any one of the specified filters include the default
+ * package
*/
protected boolean filtersIncludeDefaultPackage(String[] filters) {
- for (int i = 0; i < filters.length; i++) {
- if (filters[i].length() == 0 || (filters[i].indexOf('.') == -1)) {
+ for (String filter : filters) {
+ if (filter.length() == 0 || (filter.indexOf('.') == -1)) {
return true;
}
}
return false;
- }
-
+ }
+
/**
* Returns whether the given type is in the given filter set.
*
- * @param filters the filter set
- * @param typeName fully qualified type name
- * @param defaultPackage whether the type name is in the default package
+ * @param filters
+ * the filter set
+ * @param typeName
+ * fully qualified type name
+ * @param defaultPackage
+ * whether the type name is in the default package
* @return boolean
*/
- protected boolean matchesFilters(String[] filters, String typeName, boolean defaultPackage) {
- for (int i = 0; i < filters.length; i++) {
- String filter = filters[i];
- if (defaultPackage && filter.length() == 0) {
- return true;
- }
-
- filter = filter.replaceAll("\\.", "\\\\."); //$NON-NLS-1$//$NON-NLS-2$
- filter = filter.replaceAll("\\*", "\\.\\*"); //$NON-NLS-1$//$NON-NLS-2$
- Pattern pattern = Pattern.compile(filter);
- if (pattern.matcher(typeName).find()) {
- return true;
- }
+ protected boolean matchesFilters(String[] filters, String typeName,
+ boolean defaultPackage) {
+ for (String filter2 : filters) {
+ String filter = filter2;
+ if (defaultPackage && filter.length() == 0) {
+ return true;
+ }
+
+ filter = filter.replaceAll("\\.", "\\\\."); //$NON-NLS-1$//$NON-NLS-2$
+ filter = filter.replaceAll("\\*", "\\.\\*"); //$NON-NLS-1$//$NON-NLS-2$
+ Pattern pattern = Pattern.compile(filter);
+ if (pattern.matcher(typeName).find()) {
+ return true;
+ }
}
return false;
}
-
+
/**
* Sets the name of the exception that was last hit
*
- * @param name fully qualified exception name
+ * @param name
+ * fully qualified exception name
*/
protected void setExceptionName(String name) {
fExceptionName = name;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#getExceptionTypeName()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#getExceptionTypeName
+ * ()
*/
public String getExceptionTypeName() {
return fExceptionName;
}
-
+
/**
* @see IJavaExceptionBreakpoint#getFilters()
* @deprecated
*/
+ @Deprecated
public String[] getFilters() {
- String[] iFilters= getInclusionFilters();
- String[] eFilters= getExclusionFilters();
- String[] filters= new String[iFilters.length + eFilters.length];
+ String[] iFilters = getInclusionFilters();
+ String[] eFilters = getExclusionFilters();
+ String[] filters = new String[iFilters.length + eFilters.length];
System.arraycopy(iFilters, 0, filters, 0, iFilters.length);
System.arraycopy(eFilters, 0, filters, iFilters.length, eFilters.length);
return filters;
}
-
+
/**
* @see IJavaExceptionBreakpoint#setFilters(String[], boolean)
* @deprecated
*/
- public void setFilters(String[] filters, boolean inclusive) throws CoreException {
+ @Deprecated
+ public void setFilters(String[] filters, boolean inclusive)
+ throws CoreException {
if (inclusive) {
setInclusionFilters(filters);
} else {
@@ -459,18 +520,24 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
}
recreate();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#configureRequest(com.sun.jdi.request.EventRequest, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
- */
- protected void configureRequest(EventRequest eRequest, JDIDebugTarget target) throws CoreException {
- String[] iFilters= getInclusionClassFilters();
- String[] eFilters= getExclusionClassFilters();
-
- ExceptionRequest request= (ExceptionRequest)eRequest;
-
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * configureRequest(com.sun.jdi.request.EventRequest,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
+ */
+ @Override
+ protected void configureRequest(EventRequest eRequest, JDIDebugTarget target)
+ throws CoreException {
+ String[] iFilters = getInclusionClassFilters();
+ String[] eFilters = getExclusionClassFilters();
+
+ ExceptionRequest request = (ExceptionRequest) eRequest;
+
if (iFilters.length == 1) {
- if (eFilters.length ==0) {
+ if (eFilters.length == 0) {
request.addClassFilter(iFilters[0]);
}
} else if (eFilters.length == 1) {
@@ -478,70 +545,71 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
request.addClassExclusionFilter(eFilters[0]);
}
}
-
+
super.configureRequest(eRequest, target);
}
-
+
/**
- * Serializes the array of Strings into one comma
- * separated String.
- * Removes duplicates.
+ * Serializes the array of Strings into one comma separated String. Removes
+ * duplicates.
*/
protected String serializeList(String[] list) {
if (list == null) {
return ""; //$NON-NLS-1$
}
- Set set= new HashSet(list.length);
-
+ Set<String> set = new HashSet<String>(list.length);
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < list.length; i++) {
- if (i > 0) {
+ if (i > 0 && i < list.length-1) {
buffer.append(',');
}
- String pattern= list[i];
+ String pattern = list[i];
if (!set.contains(pattern)) {
if (pattern.length() == 0) {
- //serialize the default package
- pattern= "."; //$NON-NLS-1$
+ // serialize the default package
+ pattern = "."; //$NON-NLS-1$
}
buffer.append(pattern);
+ set.add(pattern);
}
}
return buffer.toString();
- }
-
+ }
+
/**
* Parses the comma separated String into an array of Strings
*/
protected String[] parseList(String listString) {
- List list = new ArrayList(10);
+ List<String> list = new ArrayList<String>(10);
StringTokenizer tokenizer = new StringTokenizer(listString, ","); //$NON-NLS-1$
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
if (token.equals(".")) { //$NON-NLS-1$
- //serialized form for the default package
- //@see serializeList(String[])
- token= ""; //$NON-NLS-1$
+ // serialized form for the default package
+ // @see serializeList(String[])
+ token = ""; //$NON-NLS-1$
}
list.add(token);
}
- return (String[])list.toArray(new String[list.size()]);
+ return list.toArray(new String[list.size()]);
}
-
+
/**
* @see IJavaExceptionBreakpoint#isInclusiveFiltered()
* @deprecated
*/
+ @Deprecated
public boolean isInclusiveFiltered() throws CoreException {
return ensureMarker().getAttribute(INCLUSION_FILTERS, "").length() > 0; //$NON-NLS-1$
}
-
+
protected String[] getInclusionClassFilters() {
if (fInclusionClassFilters == null) {
try {
- fInclusionClassFilters= parseList(ensureMarker().getAttribute(INCLUSION_FILTERS, "")); //$NON-NLS-1$
+ fInclusionClassFilters = parseList(ensureMarker().getAttribute(
+ INCLUSION_FILTERS, "")); //$NON-NLS-1$
} catch (CoreException ce) {
- fInclusionClassFilters= new String[]{};
+ fInclusionClassFilters = new String[] {};
}
}
return fInclusionClassFilters;
@@ -550,13 +618,14 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
protected void setInclusionClassFilters(String[] filters) {
fInclusionClassFilters = filters;
}
-
+
protected String[] getExclusionClassFilters() {
if (fExclusionClassFilters == null) {
try {
- fExclusionClassFilters= parseList(ensureMarker().getAttribute(EXCLUSION_FILTERS, "")); //$NON-NLS-1$
+ fExclusionClassFilters = parseList(ensureMarker().getAttribute(
+ EXCLUSION_FILTERS, "")); //$NON-NLS-1$
} catch (CoreException ce) {
- fExclusionClassFilters= new String[]{};
+ fExclusionClassFilters = new String[] {};
}
}
return fExclusionClassFilters;
@@ -565,22 +634,26 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
protected void setExclusionClassFilters(String[] filters) {
fExclusionClassFilters = filters;
}
-
+
/**
- * @see JavaBreakpoint#installableReferenceType(ReferenceType, JDIDebugTarget)
+ * @see JavaBreakpoint#installableReferenceType(ReferenceType,
+ * JDIDebugTarget)
*/
- protected boolean installableReferenceType(ReferenceType type, JDIDebugTarget target) throws CoreException {
- String installableType= getTypeName();
- String queriedType= type.name();
+ @Override
+ protected boolean installableReferenceType(ReferenceType type,
+ JDIDebugTarget target) throws CoreException {
+ String installableType = getTypeName();
+ String queriedType = type.name();
if (installableType == null || queriedType == null) {
return false;
}
if (installableType.equals(queriedType)) {
return queryInstallListeners(target, type);
}
-
+
return false;
}
+
/**
* @see org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#getExclusionFilters()
*/
@@ -599,16 +672,17 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
* @see org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#setExclusionFilters(String[])
*/
public void setExclusionFilters(String[] filters) throws CoreException {
- String serializedFilters= serializeList(filters);
-
- if (serializedFilters.equals(ensureMarker().getAttribute(EXCLUSION_FILTERS, ""))) { //$NON-NLS-1$
- //no change
+ String serializedFilters = serializeList(filters);
+
+ if (serializedFilters.equals(ensureMarker().getAttribute(
+ EXCLUSION_FILTERS, ""))) { //$NON-NLS-1$
+ // no change
return;
}
setExclusionClassFilters(filters);
-
- setAttribute(EXCLUSION_FILTERS, serializedFilters);
+
+ setAttribute(EXCLUSION_FILTERS, serializedFilters);
recreate();
}
@@ -616,28 +690,32 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
* @see org.eclipse.jdt.debug.core.IJavaExceptionBreakpoint#setInclusionFilters(String[])
*/
public void setInclusionFilters(String[] filters) throws CoreException {
- String serializedFilters= serializeList(filters);
-
- if (serializedFilters.equals(ensureMarker().getAttribute(INCLUSION_FILTERS, ""))) { //$NON-NLS-1$
- //no change
+ String serializedFilters = serializeList(filters);
+
+ if (serializedFilters.equals(ensureMarker().getAttribute(
+ INCLUSION_FILTERS, ""))) { //$NON-NLS-1$
+ // no change
return;
}
setInclusionClassFilters(filters);
-
+
setAttribute(INCLUSION_FILTERS, serializedFilters);
recreate();
}
-
+
/**
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(EventRequest, ObjectReference)
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(EventRequest,
+ * ObjectReference)
*/
- protected void addInstanceFilter(EventRequest request, ObjectReference object) {
+ @Override
+ protected void addInstanceFilter(EventRequest request,
+ ObjectReference object) {
if (request instanceof ExceptionRequest) {
- ((ExceptionRequest)request).addInstanceFilter(object);
+ ((ExceptionRequest) request).addInstanceFilter(object);
}
- }
-
+ }
+
/**
* Returns the last exception object that was encountered by this exception
*
@@ -647,9 +725,9 @@ public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExce
*/
public IJavaObject getLastException() {
if (fLastException != null) {
- return (IJavaObject) JDIValue.createValue(fLastTarget, fLastException);
+ return (IJavaObject) JDIValue.createValue(fLastTarget,
+ fLastException);
}
return null;
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java
index 44af46249..31cce4008 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -43,6 +42,7 @@ import org.eclipse.jdt.debug.core.IJavaReferenceType;
import org.eclipse.jdt.debug.core.IJavaStackFrame;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.core.IJavaType;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.debug.eval.ICompiledExpression;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
@@ -63,257 +63,305 @@ import com.sun.jdi.request.BreakpointRequest;
import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.EventRequestManager;
-public class JavaLineBreakpoint extends JavaBreakpoint implements IJavaLineBreakpoint {
+public class JavaLineBreakpoint extends JavaBreakpoint implements
+ IJavaLineBreakpoint {
/**
- * Breakpoint attribute storing a breakpoint's conditional expression
- * (value <code>"org.eclipse.jdt.debug.core.condition"</code>). This attribute is stored as a
- * <code>String</code>.
+ * Breakpoint attribute storing a breakpoint's conditional expression (value
+ * <code>"org.eclipse.jdt.debug.core.condition"</code>). This attribute is
+ * stored as a <code>String</code>.
*/
- protected static final String CONDITION= "org.eclipse.jdt.debug.core.condition"; //$NON-NLS-1$
+ protected static final String CONDITION = "org.eclipse.jdt.debug.core.condition"; //$NON-NLS-1$
/**
* Breakpoint attribute storing a breakpoint's condition enabled state
- * (value <code>"org.eclipse.jdt.debug.core.conditionEnabled"</code>). This attribute is stored as an
- * <code>boolean</code>.
+ * (value <code>"org.eclipse.jdt.debug.core.conditionEnabled"</code>). This
+ * attribute is stored as an <code>boolean</code>.
*/
- protected static final String CONDITION_ENABLED= "org.eclipse.jdt.debug.core.conditionEnabled"; //$NON-NLS-1$
-
+ protected static final String CONDITION_ENABLED = "org.eclipse.jdt.debug.core.conditionEnabled"; //$NON-NLS-1$
+
/**
* Breakpoint attribute storing a breakpoint's condition suspend policy
* (value <code>" org.eclipse.jdt.debug.core.conditionSuspendOnTrue"
* </code>). This attribute is stored as an <code>boolean</code>.
*/
- protected static final String CONDITION_SUSPEND_ON_TRUE= "org.eclipse.jdt.debug.core.conditionSuspendOnTrue"; //$NON-NLS-1$
-
+ protected static final String CONDITION_SUSPEND_ON_TRUE = "org.eclipse.jdt.debug.core.conditionSuspendOnTrue"; //$NON-NLS-1$
+
/**
- * Breakpoint attribute storing a breakpoint's source file name (debug attribute)
- * (value <code>"org.eclipse.jdt.debug.core.sourceName"</code>). This attribute is stored as
- * a <code>String</code>.
+ * Breakpoint attribute storing a breakpoint's source file name (debug
+ * attribute) (value <code>"org.eclipse.jdt.debug.core.sourceName"</code>).
+ * This attribute is stored as a <code>String</code>.
*/
- protected static final String SOURCE_NAME= "org.eclipse.jdt.debug.core.sourceName"; //$NON-NLS-1$
+ protected static final String SOURCE_NAME = "org.eclipse.jdt.debug.core.sourceName"; //$NON-NLS-1$
public static final String JAVA_LINE_BREAKPOINT = "org.eclipse.jdt.debug.javaLineBreakpointMarker"; //$NON-NLS-1$
-
+
/**
* Maps suspended threads to the suspend event that suspended them
*/
- private Map fSuspendEvents= new HashMap();
+ private Map<IJavaThread, ICompiledExpression> fSuspendEvents = new HashMap<IJavaThread, ICompiledExpression>();
/**
- * The map of cached compiled expressions (ICompiledExpression) for this breakpoint, keyed by thread.
- * This value must be cleared every time the breakpoint is added to a target.
+ * The map of cached compiled expressions (ICompiledExpression) for this
+ * breakpoint, keyed by thread. This value must be cleared every time the
+ * breakpoint is added to a target.
*/
- private Map fCompiledExpressions= new HashMap();
-
+ private Map<IJavaThread, ICompiledExpression> fCompiledExpressions = new HashMap<IJavaThread, ICompiledExpression>();
+
/**
- * Cache of projects for stack frames to avoid repetitive project resolution on conditional
- * breakpoints.
+ * Cache of projects for stack frames to avoid repetitive project resolution
+ * on conditional breakpoints.
*/
- private Map fProjectsByFrame= new HashMap();
-
+ private Map<IJavaStackFrame, IJavaProject> fProjectsByFrame = new HashMap<IJavaStackFrame, IJavaProject>();
+
/**
* The map of the result value of the condition (IValue) for this
* breakpoint, keyed by debug target.
*/
- private Map fConditionValues= new HashMap();
-
+ private Map<IDebugTarget, IValue> fConditionValues = new HashMap<IDebugTarget, IValue>();
+
/**
* Status code indicating that a request to create a breakpoint in a type
* with no line number attributes has occurred.
*/
- public static final int NO_LINE_NUMBERS= 162;
-
+ public static final int NO_LINE_NUMBERS = 162;
+
public JavaLineBreakpoint() {
}
/**
- * @see JDIDebugModel#createLineBreakpoint(IResource, String, int, int, int, int, boolean, Map)
+ * @see JDIDebugModel#createLineBreakpoint(IResource, String, int, int, int,
+ * int, boolean, Map)
*/
- public JavaLineBreakpoint(IResource resource, String typeName, int lineNumber, int charStart, int charEnd, int hitCount, boolean add, Map attributes) throws DebugException {
- this(resource, typeName, lineNumber, charStart, charEnd, hitCount, add, attributes, JAVA_LINE_BREAKPOINT);
+ public JavaLineBreakpoint(IResource resource, String typeName,
+ int lineNumber, int charStart, int charEnd, int hitCount,
+ boolean add, Map<String, Object> attributes) throws DebugException {
+ this(resource, typeName, lineNumber, charStart, charEnd, hitCount, add,
+ attributes, JAVA_LINE_BREAKPOINT);
}
-
- protected JavaLineBreakpoint(final IResource resource, final String typeName, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean add, final Map attributes, final String markerType) throws DebugException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+
+ protected JavaLineBreakpoint(final IResource resource,
+ final String typeName, final int lineNumber, final int charStart,
+ final int charEnd, final int hitCount, final boolean add,
+ final Map<String, Object> attributes, final String markerType)
+ throws DebugException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
-
+
// create the marker
setMarker(resource.createMarker(markerType));
-
+
// add attributes
- addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
+ addLineBreakpointAttributes(attributes, getModelIdentifier(),
+ true, lineNumber, charStart, charEnd);
addTypeNameAndHitCount(attributes, typeName, hitCount);
// set attributes
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
ensureMarker().setAttributes(attributes);
-
+
// add to breakpoint manager if requested
register(add);
}
};
run(getMarkerRule(resource), wr);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addToTarget(org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addToTarget
+ * (org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
*/
+ @Override
public void addToTarget(JDIDebugTarget target) throws CoreException {
clearCachedExpressionFor(target);
super.addToTarget(target);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#removeFromTarget(org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * removeFromTarget
+ * (org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
*/
+ @Override
public void removeFromTarget(JDIDebugTarget target) throws CoreException {
clearCachedExpressionFor(target);
clearCachedSuspendEvents(target);
fConditionValues.remove(target);
super.removeFromTarget(target);
}
-
+
/**
- * Removes all suspend events which are currently
- * being cached for threads in the given target.
+ * Removes all suspend events which are currently being cached for threads
+ * in the given target.
*/
protected void clearCachedSuspendEvents(JDIDebugTarget target) {
removeCachedThreads(fSuspendEvents, target);
}
-
- private void removeCachedThreads(Map map, JDIDebugTarget target) {
- Set threads= map.keySet();
- List threadsToRemove= new ArrayList();
- Iterator iter= threads.iterator();
+
+ private void removeCachedThreads(Map<IJavaThread, ICompiledExpression> map, JDIDebugTarget target) {
+ Set<IJavaThread> threads = map.keySet();
+ List<IJavaThread> threadsToRemove = new ArrayList<IJavaThread>();
+ Iterator<IJavaThread> iter = threads.iterator();
JDIThread thread;
while (iter.hasNext()) {
- thread= (JDIThread)iter.next();
+ thread = (JDIThread) iter.next();
if (thread.getDebugTarget() == target) {
threadsToRemove.add(thread);
}
}
- iter= threadsToRemove.iterator();
+ iter = threadsToRemove.iterator();
while (iter.hasNext()) {
map.remove(iter.next());
}
}
-
+
/**
- * Removes all compiled expressions which are currently
- * being cached for threads in the given target.
+ * Removes all compiled expressions which are currently being cached for
+ * threads in the given target.
*/
protected void clearCachedExpressionFor(JDIDebugTarget target) {
removeCachedThreads(fCompiledExpressions, target);
// clean up cached projects for stack frames
synchronized (fProjectsByFrame) {
- Set frames= fProjectsByFrame.keySet();
- List framesToRemove= new ArrayList();
- Iterator iter= frames.iterator();
+ Set<IJavaStackFrame> frames = fProjectsByFrame.keySet();
+ List<IJavaStackFrame> framesToRemove = new ArrayList<IJavaStackFrame>();
+ Iterator<IJavaStackFrame> iter = frames.iterator();
JDIStackFrame frame;
while (iter.hasNext()) {
- frame= (JDIStackFrame)iter.next();
+ frame = (JDIStackFrame) iter.next();
if (frame.getDebugTarget() == target) {
framesToRemove.add(frame);
}
}
- iter= framesToRemove.iterator();
+ iter = framesToRemove.iterator();
while (iter.hasNext()) {
fProjectsByFrame.remove(iter.next());
- }
+ }
}
-
+
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ILineBreakpoint#getLineNumber()
*/
public int getLineNumber() throws CoreException {
return ensureMarker().getAttribute(IMarker.LINE_NUMBER, -1);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ILineBreakpoint#getCharStart()
*/
public int getCharStart() throws CoreException {
return ensureMarker().getAttribute(IMarker.CHAR_START, -1);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ILineBreakpoint#getCharEnd()
*/
public int getCharEnd() throws CoreException {
return ensureMarker().getAttribute(IMarker.CHAR_END, -1);
- }
+ }
+
/**
* Returns the type of marker associated with Java line breakpoints
*/
public static String getMarkerType() {
return JAVA_LINE_BREAKPOINT;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#newRequest(org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, com.sun.jdi.ReferenceType)
- */
- protected EventRequest[] newRequests(JDIDebugTarget target, ReferenceType type) throws CoreException {
- int lineNumber = getLineNumber();
- List locations = determineLocations(lineNumber, type, target);
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#newRequest
+ * (org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget,
+ * com.sun.jdi.ReferenceType)
+ */
+ @Override
+ protected EventRequest[] newRequests(JDIDebugTarget target,
+ ReferenceType type) throws CoreException {
+ int lineNumber = getLineNumber();
+ List<Location> locations = determineLocations(lineNumber, type, target);
if (locations == null || locations.isEmpty()) {
- // could be an inner type not yet loaded, or line information not available
+ // could be an inner type not yet loaded, or line information not
+ // available
return null;
}
EventRequest[] requests = new EventRequest[locations.size()];
int i = 0;
- Iterator iterator = locations.iterator();
- while (iterator.hasNext()) {
- Location location = (Location) iterator.next();
- requests[i] = createLineBreakpointRequest(location, target);
- i++;
- }
- return requests;
- }
+ for(Location location : locations) {
+ requests[i] = createLineBreakpointRequest(location, target);
+ i++;
+ }
+ return requests;
+ }
/**
- * Creates, installs, and returns a line breakpoint request at
- * the given location for this breakpoint.
+ * Creates, installs, and returns a line breakpoint request at the given
+ * location for this breakpoint.
*/
- protected BreakpointRequest createLineBreakpointRequest(Location location, JDIDebugTarget target) throws CoreException {
+ protected BreakpointRequest createLineBreakpointRequest(Location location,
+ JDIDebugTarget target) throws CoreException {
BreakpointRequest request = null;
EventRequestManager manager = target.getEventRequestManager();
- if (manager == null) {
- target.requestFailed(JDIDebugBreakpointMessages.JavaLineBreakpoint_Unable_to_create_breakpoint_request___VM_disconnected__1, null);
- }
- try {
- request= manager.createBreakpointRequest(location);
- configureRequest(request, target);
- } catch (VMDisconnectedException e) {
- if (!target.isAvailable()) {
+ if (manager != null) {
+ try {
+ request = manager.createBreakpointRequest(location);
+ configureRequest(request, target);
+ } catch (VMDisconnectedException e) {
+ if (!target.isAvailable()) {
+ return null;
+ }
+ JDIDebugPlugin.log(e);
+ } catch (RuntimeException e) {
+ target.internalError(e);
return null;
- }
- JDIDebugPlugin.log(e);
- } catch (RuntimeException e) {
- target.internalError(e);
- return null;
+ }
+ return request;
}
- return request;
+ target.requestFailed(
+ JDIDebugBreakpointMessages.JavaLineBreakpoint_Unable_to_create_breakpoint_request___VM_disconnected__1,
+ null);
+ return null;
}
-
+
/**
* @see JavaBreakpoint#setRequestThreadFilter(EventRequest)
*/
- protected void setRequestThreadFilter(EventRequest request, ThreadReference thread) {
- ((BreakpointRequest)request).addThreadFilter(thread);
+ @Override
+ protected void setRequestThreadFilter(EventRequest request,
+ ThreadReference thread) {
+ ((BreakpointRequest) request).addThreadFilter(thread);
}
-
+
/**
* Returns a list of locations of the given line number in the given type.
* Returns <code>null</code> if locations cannot be determined.
*/
- protected List determineLocations(int lineNumber, ReferenceType type, JDIDebugTarget target) {
- List locations= null;
+ protected List<Location> determineLocations(int lineNumber, ReferenceType type,
+ JDIDebugTarget target) {
+ List<Location> locations = null;
try {
- locations= type.locationsOfLine(lineNumber);
+ locations = type.locationsOfLine(lineNumber);
} catch (AbsentInformationException aie) {
- IStatus status= new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), NO_LINE_NUMBERS, JDIDebugBreakpointMessages.JavaLineBreakpoint_Absent_Line_Number_Information_1, null);
- IStatusHandler handler= DebugPlugin.getDefault().getStatusHandler(status);
+ IStatus status = new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ NO_LINE_NUMBERS,
+ JDIDebugBreakpointMessages.JavaLineBreakpoint_Absent_Line_Number_Information_1,
+ null);
+ IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(
+ status);
if (handler != null) {
try {
handler.handleStatus(status, type);
@@ -335,97 +383,104 @@ public class JavaLineBreakpoint extends JavaBreakpoint implements IJavaLineBreak
}
return locations;
}
-
+
/**
- * Adds the standard attributes of a line breakpoint to
- * the given attribute map.
- * The standard attributes are:
+ * Adds the standard attributes of a line breakpoint to the given attribute
+ * map. The standard attributes are:
* <ol>
* <li>IBreakpoint.ID</li>
* <li>IBreakpoint.ENABLED</li>
* <li>IMarker.LINE_NUMBER</li>
* <li>IMarker.CHAR_START</li>
* <li>IMarker.CHAR_END</li>
- * </ol>
+ * </ol>
*
- */
- public void addLineBreakpointAttributes(Map attributes, String modelIdentifier, boolean enabled, int lineNumber, int charStart, int charEnd) {
+ */
+ public void addLineBreakpointAttributes(Map<String, Object> attributes,
+ String modelIdentifier, boolean enabled, int lineNumber,
+ int charStart, int charEnd) {
attributes.put(IBreakpoint.ID, modelIdentifier);
attributes.put(IBreakpoint.ENABLED, Boolean.valueOf(enabled));
attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
attributes.put(IMarker.CHAR_START, new Integer(charStart));
- attributes.put(IMarker.CHAR_END, new Integer(charEnd));
- }
-
+ attributes.put(IMarker.CHAR_END, new Integer(charEnd));
+ }
+
/**
- * Adds type name and hit count attributes to the given
- * map.
- *
+ * Adds type name and hit count attributes to the given map.
+ *
* If <code>hitCount > 0</code>, adds the <code>HIT_COUNT</code> attribute
- * to the given breakpoint, and resets the <code>EXPIRED</code> attribute
- * to false (since, if the hit count is changed, the breakpoint should no
+ * to the given breakpoint, and resets the <code>EXPIRED</code> attribute to
+ * false (since, if the hit count is changed, the breakpoint should no
* longer be expired).
*/
- public void addTypeNameAndHitCount(Map attributes, String typeName, int hitCount) {
+ public void addTypeNameAndHitCount(Map<String, Object> attributes, String typeName,
+ int hitCount) {
attributes.put(TYPE_NAME, typeName);
if (hitCount > 0) {
attributes.put(HIT_COUNT, new Integer(hitCount));
attributes.put(EXPIRED, Boolean.FALSE);
}
}
-
+
/**
* Returns whether this breakpoint has an enabled condition
*/
public boolean hasCondition() {
try {
String condition = getCondition();
- return isConditionEnabled() && condition != null && (condition.length() > 0);
+ return isConditionEnabled() && condition != null
+ && (condition.length() > 0);
} catch (CoreException exception) {
JDIDebugPlugin.log(exception);
return false;
}
}
-
+
/**
- * Suspends the given thread for the given breakpoint event. Returns
- * whether the thread suspends.
+ * Suspends the given thread for the given breakpoint event. Returns whether
+ * the thread suspends.
*/
- protected boolean suspendForEvent(Event event, JDIThread thread, boolean suspendVote) {
+ protected boolean suspendForEvent(Event event, JDIThread thread,
+ boolean suspendVote) {
expireHitCount(event);
return suspend(thread, suspendVote);
}
-
+
protected IJavaProject getJavaProject(IJavaStackFrame stackFrame) {
synchronized (fProjectsByFrame) {
- IJavaProject project= (IJavaProject) fProjectsByFrame.get(stackFrame);
- if (project == null) {
- project = computeJavaProject(stackFrame);
- if (project != null) {
- fProjectsByFrame.put(stackFrame, project);
- }
- }
- return project;
+ IJavaProject project = fProjectsByFrame
+ .get(stackFrame);
+ if (project == null) {
+ project = computeJavaProject(stackFrame);
+ if (project != null) {
+ fProjectsByFrame.put(stackFrame, project);
+ }
+ }
+ return project;
}
}
-
+
private IJavaProject computeJavaProject(IJavaStackFrame stackFrame) {
ILaunch launch = stackFrame.getLaunch();
if (launch == null) {
return null;
}
- ISourceLocator locator= launch.getSourceLocator();
+ ISourceLocator locator = launch.getSourceLocator();
if (locator == null)
return null;
-
- Object sourceElement= null;
+
+ Object sourceElement = null;
try {
- if (locator instanceof ISourceLookupDirector && !stackFrame.isStatic()) {
+ if (locator instanceof ISourceLookupDirector
+ && !stackFrame.isStatic()) {
IJavaType thisType = stackFrame.getThis().getJavaType();
if (thisType instanceof IJavaReferenceType) {
- String[] sourcePaths= ((IJavaReferenceType) thisType).getSourcePaths(null);
+ String[] sourcePaths = ((IJavaReferenceType) thisType)
+ .getSourcePaths(null);
if (sourcePaths != null && sourcePaths.length > 0) {
- sourceElement= ((ISourceLookupDirector) locator).getSourceElement(sourcePaths[0]);
+ sourceElement = ((ISourceLookupDirector) locator)
+ .getSourceElement(sourcePaths[0]);
}
}
}
@@ -435,39 +490,50 @@ public class JavaLineBreakpoint extends JavaBreakpoint implements IJavaLineBreak
if (sourceElement == null) {
sourceElement = locator.getSourceElement(stackFrame);
}
- if (!(sourceElement instanceof IJavaElement) && sourceElement instanceof IAdaptable) {
- Object element= ((IAdaptable)sourceElement).getAdapter(IJavaElement.class);
+ if (!(sourceElement instanceof IJavaElement)
+ && sourceElement instanceof IAdaptable) {
+ Object element = ((IAdaptable) sourceElement)
+ .getAdapter(IJavaElement.class);
if (element != null) {
- sourceElement= element;
+ sourceElement = element;
}
}
if (sourceElement instanceof IJavaElement) {
return ((IJavaElement) sourceElement).getJavaProject();
} else if (sourceElement instanceof IResource) {
- IJavaProject project = JavaCore.create(((IResource)sourceElement).getProject());
+ IJavaProject project = JavaCore.create(((IResource) sourceElement)
+ .getProject());
if (project.exists()) {
return project;
}
}
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#supportsCondition()
*/
public boolean supportsCondition() {
return true;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#getCondition()
*/
public String getCondition() throws CoreException {
return ensureMarker().getAttribute(CONDITION, null);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#setCondition(java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaLineBreakpoint#setCondition(java.lang
+ * .String)
*/
public void setCondition(String condition) throws CoreException {
// Clear the cached compiled expressions
@@ -477,103 +543,145 @@ public class JavaLineBreakpoint extends JavaBreakpoint implements IJavaLineBreak
if (condition != null && condition.trim().length() == 0) {
condition = null;
}
- setAttributes(new String []{CONDITION}, new Object[]{condition});
+ setAttributes(new String[] { CONDITION }, new Object[] { condition });
recreate();
}
- protected String getMarkerMessage(boolean conditionEnabled, String condition, int hitCount, int suspendPolicy, int lineNumber) {
- StringBuffer message= new StringBuffer(super.getMarkerMessage(hitCount, suspendPolicy));
+ protected String getMarkerMessage(boolean conditionEnabled,
+ String condition, int hitCount, int suspendPolicy, int lineNumber) {
+ StringBuffer message = new StringBuffer(super.getMarkerMessage(
+ hitCount, suspendPolicy));
if (lineNumber != -1) {
- message.append(MessageFormat.format(JDIDebugBreakpointMessages.JavaLineBreakpoint___line___0___1, new Object[]{Integer.toString(lineNumber)}));
+ message.append(MessageFormat
+ .format(JDIDebugBreakpointMessages.JavaLineBreakpoint___line___0___1,
+ new Object[] { Integer.toString(lineNumber) }));
}
if (conditionEnabled && condition != null) {
- message.append(MessageFormat.format(JDIDebugBreakpointMessages.JavaLineBreakpoint___Condition___0___2, new Object[]{condition}));
+ message.append(MessageFormat
+ .format(JDIDebugBreakpointMessages.JavaLineBreakpoint___Condition___0___2,
+ new Object[] { condition }));
}
-
+
return message.toString();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#isConditionEnabled()
*/
public boolean isConditionEnabled() throws CoreException {
return ensureMarker().getAttribute(CONDITION_ENABLED, false);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#setConditionEnabled(boolean)
- */
- public void setConditionEnabled(boolean conditionEnabled) throws CoreException {
- setAttributes(new String[]{CONDITION_ENABLED}, new Object[]{Boolean.valueOf(conditionEnabled)});
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaLineBreakpoint#setConditionEnabled(boolean
+ * )
+ */
+ public void setConditionEnabled(boolean conditionEnabled)
+ throws CoreException {
+ setAttributes(new String[] { CONDITION_ENABLED },
+ new Object[] { Boolean.valueOf(conditionEnabled) });
recreate();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#cleanupForThreadTermination(org.eclipse.jdt.internal.debug.core.model.JDIThread)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * cleanupForThreadTermination
+ * (org.eclipse.jdt.internal.debug.core.model.JDIThread)
*/
+ @Override
protected void cleanupForThreadTermination(JDIThread thread) {
fSuspendEvents.remove(thread);
fCompiledExpressions.remove(thread);
super.cleanupForThreadTermination(thread);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(com.sun.jdi.request.EventRequest, com.sun.jdi.ObjectReference)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * addInstanceFilter(com.sun.jdi.request.EventRequest,
+ * com.sun.jdi.ObjectReference)
*/
- protected void addInstanceFilter(EventRequest request,ObjectReference object) {
+ @Override
+ protected void addInstanceFilter(EventRequest request,
+ ObjectReference object) {
if (request instanceof BreakpointRequest) {
- ((BreakpointRequest)request).addInstanceFilter(object);
+ ((BreakpointRequest) request).addInstanceFilter(object);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#isConditionSuspendOnTrue()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaLineBreakpoint#isConditionSuspendOnTrue()
*/
public boolean isConditionSuspendOnTrue() throws DebugException {
return ensureMarker().getAttribute(CONDITION_SUSPEND_ON_TRUE, true);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#setConditionSuspendOnTrue(boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaLineBreakpoint#setConditionSuspendOnTrue
+ * (boolean)
*/
- public void setConditionSuspendOnTrue(boolean suspendOnTrue) throws CoreException {
+ public void setConditionSuspendOnTrue(boolean suspendOnTrue)
+ throws CoreException {
if (isConditionSuspendOnTrue() != suspendOnTrue) {
- setAttributes(new String[]{CONDITION_SUSPEND_ON_TRUE}, new Object[]{Boolean.valueOf(suspendOnTrue)});
+ setAttributes(new String[] { CONDITION_SUSPEND_ON_TRUE },
+ new Object[] { Boolean.valueOf(suspendOnTrue) });
fConditionValues.clear();
recreate();
}
}
-
+
/**
- * Returns existing compiled expression for the given thread or <code>null</code>.
+ * Returns existing compiled expression for the given thread or
+ * <code>null</code>.
*
- * @param thread thread the breakpoint was hit in
+ * @param thread
+ * thread the breakpoint was hit in
* @return compiled expression or <code>null</code>
*/
protected ICompiledExpression getExpression(IJavaThread thread) {
- return (ICompiledExpression) fCompiledExpressions.get(thread);
+ return fCompiledExpressions.get(thread);
}
-
+
/**
* Sets the compiled expression for a thread.
*
- * @param thread thread the breakpoint was hit in
- * @param expression associated compiled expression
+ * @param thread
+ * thread the breakpoint was hit in
+ * @param expression
+ * associated compiled expression
*/
- protected void setExpression(IJavaThread thread, ICompiledExpression expression) {
+ protected void setExpression(IJavaThread thread,
+ ICompiledExpression expression) {
fCompiledExpressions.put(thread, expression);
}
-
+
/**
- * Sets the current result value of the conditional expression evaluation for this breakpoint
- * in the given target, and returns the previous value or <code>null</code> if none
- *
- * @param target debug target
- * @param value current expression value
+ * Sets the current result value of the conditional expression evaluation
+ * for this breakpoint in the given target, and returns the previous value
+ * or <code>null</code> if none
+ *
+ * @param target
+ * debug target
+ * @param value
+ * current expression value
* @return previous value or <code>null</code>
*/
protected IValue setCurrentConditionValue(IDebugTarget target, IValue value) {
- IValue prev = (IValue) fConditionValues.get(target);
+ IValue prev = fConditionValues.get(target);
fConditionValues.put(target, value);
return prev;
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodBreakpoint.java
index df54c2d5f..b445b8061 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
@@ -48,406 +47,460 @@ import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.MethodEntryRequest;
import com.sun.jdi.request.MethodExitRequest;
-public class JavaMethodBreakpoint extends JavaLineBreakpoint implements IJavaMethodBreakpoint {
-
+public class JavaMethodBreakpoint extends JavaLineBreakpoint implements
+ IJavaMethodBreakpoint {
+
public static final String JAVA_METHOD_BREAKPOINT = "org.eclipse.jdt.debug.javaMethodBreakpointMarker"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing the name of the method
- * in which a breakpoint is contained.
- * (value <code>"org.eclipse.jdt.debug.core.methodName"</code>).
- * This attribute is a <code>String</code>.
+ * Breakpoint attribute storing the name of the method in which a breakpoint
+ * is contained. (value <code>"org.eclipse.jdt.debug.core.methodName"</code>
+ * ). This attribute is a <code>String</code>.
*/
protected static final String METHOD_NAME = "org.eclipse.jdt.debug.core.methodName"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing the signature of the method
- * in which a breakpoint is contained.
- * (value <code>"org.eclipse.jdt.debug.core.methodSignature"</code>).
- * This attribute is a <code>String</code>.
+ * Breakpoint attribute storing the signature of the method in which a
+ * breakpoint is contained. (value
+ * <code>"org.eclipse.jdt.debug.core.methodSignature"</code>). This
+ * attribute is a <code>String</code>.
*/
protected static final String METHOD_SIGNATURE = "org.eclipse.jdt.debug.core.methodSignature"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing whether this breakpoint
- * is an entry breakpoint.
- * (value <code>"org.eclipse.jdt.debug.core.entry"</code>).
- * This attribute is a <code>boolean</code>.
+ * Breakpoint attribute storing whether this breakpoint is an entry
+ * breakpoint. (value <code>"org.eclipse.jdt.debug.core.entry"</code>). This
+ * attribute is a <code>boolean</code>.
*/
protected static final String ENTRY = "org.eclipse.jdt.debug.core.entry"; //$NON-NLS-1$
/**
- * Breakpoint attribute storing whether this breakpoint
- * is an exit breakpoint.
- * (value <code>"org.eclipse.jdt.debug.core.exit"</code>).
- * This attribute is a <code>boolean</code>.
+ * Breakpoint attribute storing whether this breakpoint is an exit
+ * breakpoint. (value <code>"org.eclipse.jdt.debug.core.exit"</code>). This
+ * attribute is a <code>boolean</code>.
*/
protected static final String EXIT = "org.eclipse.jdt.debug.core.exit"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing whether this breakpoint
- * only applies to native methods.
- * (value <code>"org.eclipse.jdt.debug.core.native"</code>).
+ * Breakpoint attribute storing whether this breakpoint only applies to
+ * native methods. (value <code>"org.eclipse.jdt.debug.core.native"</code>).
* This attribute is a <code>boolean</code>.
*/
protected static final String NATIVE = "org.eclipse.jdt.debug.core.native"; //$NON-NLS-1$
-
+
/**
* Cache of method name attribute
*/
private String fMethodName = null;
-
+
/**
* Cache of method signature attribute
*/
private String fMethodSignature = null;
-
+
/**
- * Flag indicating that this breakpoint last suspended execution
- * due to a method entry
+ * Flag indicating that this breakpoint last suspended execution due to a
+ * method entry
*/
- protected static final Integer ENTRY_EVENT= new Integer(0);
-
+ protected static final Integer ENTRY_EVENT = new Integer(0);
+
/**
- * Flag indicating that this breakpoint last suspended execution
- * due to a method exit
+ * Flag indicating that this breakpoint last suspended execution due to a
+ * method exit
*/
- protected static final Integer EXIT_EVENT= new Integer(1);
-
+ protected static final Integer EXIT_EVENT = new Integer(1);
+
/**
- * Maps each debug target that is suspended for this breakpoint to reason that
- * this breakpoint suspended it. Reasons include:
+ * Maps each debug target that is suspended for this breakpoint to reason
+ * that this breakpoint suspended it. Reasons include:
* <ol>
* <li>Method entry (value <code>ENTRY_EVENT</code>)</li>
* <li>Method exit (value <code>EXIT_EVENT</code>)</li>
* </ol>
*/
- private Map fLastEventTypes= new HashMap(10);
-
+ private Map<IDebugTarget, Integer> fLastEventTypes = new HashMap<IDebugTarget, Integer>(10);
+
/**
- * Used to match type names
+ * Used to match type names
*/
private Pattern fPattern;
-
+
/**
* Cache of whether this breakpoint uses a type name pattern
*/
- private Boolean fUsesTypePattern= null;
-
+ private Boolean fUsesTypePattern = null;
+
/**
- * Constructs a new unconfigured method breakpoint
+ * Constructs a new method breakpoint
*/
public JavaMethodBreakpoint() {
}
-
- public JavaMethodBreakpoint(final IResource resource, final String typePattern, final String methodName, final String methodSignature, final boolean entry, final boolean exit, final boolean nativeOnly, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean register, final Map attributes) throws CoreException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+
+ public JavaMethodBreakpoint(final IResource resource,
+ final String typePattern, final String methodName,
+ final String methodSignature, final boolean entry,
+ final boolean exit, final boolean nativeOnly, final int lineNumber,
+ final int charStart, final int charEnd, final int hitCount,
+ final boolean register, final Map<String, Object> attributes) throws CoreException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
// create the marker
setMarker(resource.createMarker(JAVA_METHOD_BREAKPOINT));
-
+
// add attributes
- addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
- addMethodNameAndSignature(attributes, methodName, methodSignature);
+ addLineBreakpointAttributes(attributes, getModelIdentifier(),
+ true, lineNumber, charStart, charEnd);
+ addMethodNameAndSignature(attributes, methodName,
+ methodSignature);
addTypeNameAndHitCount(attributes, typePattern, hitCount);
attributes.put(ENTRY, Boolean.valueOf(entry));
attributes.put(EXIT, Boolean.valueOf(exit));
attributes.put(NATIVE, Boolean.valueOf(nativeOnly));
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
- //set attributes
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
+ // set attributes
ensureMarker().setAttributes(attributes);
register(register);
}
-
+
};
run(getMarkerRule(resource), wr);
String type = convertToRegularExpression(typePattern);
fPattern = Pattern.compile(type);
}
-
- /**
- * Creates and installs an entry and exit requests
- * in the given type name, configuring the requests as appropriate
- * for this breakpoint. The requests are then enabled based on whether
- * this breakpoint is an entry breakpoint, exit breakpoint, or
- * both. Finally, the requests are registered with the given target.
- */
- protected void createRequest(JDIDebugTarget target, String typePattern) throws CoreException {
- MethodEntryRequest entryRequest= createMethodEntryRequest(target, typePattern);
- MethodExitRequest exitRequest= createMethodExitRequest(target, typePattern);
-
+
+ /**
+ * Creates and installs an entry and exit requests in the given type name,
+ * configuring the requests as appropriate for this breakpoint. The requests
+ * are then enabled based on whether this breakpoint is an entry breakpoint,
+ * exit breakpoint, or both. Finally, the requests are registered with the
+ * given target.
+ */
+ protected void createRequest(JDIDebugTarget target, String typePattern)
+ throws CoreException {
+ MethodEntryRequest entryRequest = createMethodEntryRequest(target,
+ typePattern);
+ MethodExitRequest exitRequest = createMethodExitRequest(target,
+ typePattern);
+
registerRequest(entryRequest, target);
registerRequest(exitRequest, target);
}
-
+
/**
- * Returns a new method entry request for this breakpoint's
- * criteria
+ * Returns a new method entry request for this breakpoint's criteria
*
- * @param the target in which to create the request
- * @param type the type on which to create the request
+ * @param the
+ * target in which to create the request
+ * @param type
+ * the type on which to create the request
* @return method entry request
- * @exception CoreException if an exception occurs accessing
- * this breakpoint's underlying marker
- */
- protected MethodEntryRequest createMethodEntryRequest(JDIDebugTarget target, String typePattern) throws CoreException {
- return (MethodEntryRequest)createMethodRequest(target, typePattern, true);
+ * @exception CoreException
+ * if an exception occurs accessing this breakpoint's
+ * underlying marker
+ */
+ protected MethodEntryRequest createMethodEntryRequest(
+ JDIDebugTarget target, String typePattern) throws CoreException {
+ return (MethodEntryRequest) createMethodRequest(target, typePattern,
+ true);
}
-
+
/**
- * Returns a new method exit request for this breakpoint's
- * criteria
+ * Returns a new method exit request for this breakpoint's criteria
*
- * @param target the target in which to create the request
- * @param type the type on which to create the request
+ * @param target
+ * the target in which to create the request
+ * @param type
+ * the type on which to create the request
* @return method exit request
- * @exception CoreException if an exception occurs accessing
- * this breakpoint's underlying marker
- */
- protected MethodExitRequest createMethodExitRequest(JDIDebugTarget target, String typePattern) throws CoreException {
- return (MethodExitRequest)createMethodRequest(target, typePattern, false);
+ * @exception CoreException
+ * if an exception occurs accessing this breakpoint's
+ * underlying marker
+ */
+ protected MethodExitRequest createMethodExitRequest(JDIDebugTarget target,
+ String typePattern) throws CoreException {
+ return (MethodExitRequest) createMethodRequest(target, typePattern,
+ false);
}
-
+
/**
- * Returns a new method entry request for this breakpoint's
- * criteria
+ * Returns a new method entry request for this breakpoint's criteria
*
- * @param the target in which to create the request
- * @param type the type on which to create the request
+ * @param the
+ * target in which to create the request
+ * @param type
+ * the type on which to create the request
* @return method entry request
- * @exception CoreException if an exception occurs accessing
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if an exception occurs accessing this breakpoint's
+ * underlying marker
*/
- protected EventRequest createMethodEntryRequest(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ protected EventRequest createMethodEntryRequest(JDIDebugTarget target,
+ ReferenceType type) throws CoreException {
return createMethodRequest(target, type, true);
}
-
+
/**
* Returns a new method exit request for the given reference type
*
- * @param target the target in which to create the request
- * @param type the type on which to create the request
+ * @param target
+ * the target in which to create the request
+ * @param type
+ * the type on which to create the request
* @return method exit request
- * @exception CoreException if an exception occurs accessing
- * this breakpoint's underlying marker
+ * @exception CoreException
+ * if an exception occurs accessing this breakpoint's
+ * underlying marker
*/
- protected EventRequest createMethodExitRequest(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ protected EventRequest createMethodExitRequest(JDIDebugTarget target,
+ ReferenceType type) throws CoreException {
return createMethodRequest(target, type, false);
- }
-
- /**
- * @see JavaMethodBreakpoint#createMethodEntryRequest(JDIDebugTarget, ReferenceType)
- * or JavaMethodBreakpoint#createMethodExitRequest(JDIDebugTarget, ReferenceType)
- *
- * Returns a <code>MethodEntryRequest</code> or <code>BreakpointRequest</code>
- * if entry is <code>true</code>, a <code>MethodExitRequest</code> if entry is
- * <code>false</code>.
+ }
+
+ /**
+ * @see JavaMethodBreakpoint#createMethodEntryRequest(JDIDebugTarget,
+ * ReferenceType) or
+ * JavaMethodBreakpoint#createMethodExitRequest(JDIDebugTarget,
+ * ReferenceType)
*
- * @param target the debug target in which to create the request
- * @param classFilter a filter which specifies the scope of the method request. This parameter must
- * be either a <code>String</code> or a <code>ReferenceType</code>
- * @param entry whether or not the request will be a method entry request. If <code>false</code>,
- * the request will be a method exit request.
- */
- private EventRequest createMethodRequest(JDIDebugTarget target, Object classFilter, boolean entry) throws CoreException {
+ * Returns a <code>MethodEntryRequest</code> or
+ * <code>BreakpointRequest</code> if entry is <code>true</code>, a
+ * <code>MethodExitRequest</code> if entry is <code>false</code>.
+ *
+ * @param target
+ * the debug target in which to create the request
+ * @param classFilter
+ * a filter which specifies the scope of the method request. This
+ * parameter must be either a <code>String</code> or a
+ * <code>ReferenceType</code>
+ * @param entry
+ * whether or not the request will be a method entry request. If
+ * <code>false</code>, the request will be a method exit request.
+ */
+ private EventRequest createMethodRequest(JDIDebugTarget target,
+ Object classFilter, boolean entry) throws CoreException {
EventRequest request = null;
EventRequestManager manager = target.getEventRequestManager();
- if (manager == null) {
- target.requestFailed(JDIDebugBreakpointMessages.JavaMethodBreakpoint_Unable_to_create_breakpoint_request___VM_disconnected__1, null);
- }
- try {
- if (entry) {
- if (classFilter instanceof ClassType && getMethodName() != null && getMethodSignature() != null) {
- // use a line breakpoint if possible for better performance
- ClassType clazz = (ClassType)classFilter;
- if (clazz.name().equals(getTypeName())) {
- // only use line breakpoint when there is an exact match
- Method method = clazz.concreteMethodByName(getMethodName(), getMethodSignature());
- if (method != null && !method.isNative()) {
- Location location = method.location();
- if (location != null && location.codeIndex() != -1) {
- request = manager.createBreakpointRequest(location);
+ if (manager != null) {
+ try {
+ if (entry) {
+ if (classFilter instanceof ClassType && getMethodName() != null
+ && getMethodSignature() != null) {
+ // use a line breakpoint if possible for better performance
+ ClassType clazz = (ClassType) classFilter;
+ if (clazz.name().equals(getTypeName())) {
+ // only use line breakpoint when there is an exact match
+ Method method = clazz.concreteMethodByName(
+ getMethodName(), getMethodSignature());
+ if (method != null && !method.isNative()) {
+ Location location = method.location();
+ if (location != null && location.codeIndex() != -1) {
+ request = manager
+ .createBreakpointRequest(location);
+ }
}
}
}
- }
- if (request == null) {
- request = manager.createMethodEntryRequest();
+ if (request == null) {
+ request = manager.createMethodEntryRequest();
+ if (classFilter instanceof String) {
+ ((MethodEntryRequest) request)
+ .addClassFilter((String) classFilter);
+ } else if (classFilter instanceof ReferenceType) {
+ ((MethodEntryRequest) request)
+ .addClassFilter((ReferenceType) classFilter);
+ }
+ }
+ } else {
+ request = manager.createMethodExitRequest();
if (classFilter instanceof String) {
- ((MethodEntryRequest)request).addClassFilter((String)classFilter);
+ ((MethodExitRequest) request)
+ .addClassFilter((String) classFilter);
} else if (classFilter instanceof ReferenceType) {
- ((MethodEntryRequest)request).addClassFilter((ReferenceType)classFilter);
+ ((MethodExitRequest) request)
+ .addClassFilter((ReferenceType) classFilter);
}
}
- } else {
- request= manager.createMethodExitRequest();
- if (classFilter instanceof String) {
- ((MethodExitRequest)request).addClassFilter((String)classFilter);
- } else if (classFilter instanceof ReferenceType) {
- ((MethodExitRequest)request).addClassFilter((ReferenceType)classFilter);
+ configureRequest(request, target);
+ } catch (VMDisconnectedException e) {
+ if (!target.isAvailable()) {
+ return null;
}
+ JDIDebugPlugin.log(e);
+ } catch (RuntimeException e) {
+ target.internalError(e);
}
- configureRequest(request, target);
- } catch (VMDisconnectedException e) {
- if (!target.isAvailable()) {
- return null;
- }
- JDIDebugPlugin.log(e);
- } catch (RuntimeException e) {
- target.internalError(e);
- }
- return request;
+ return request;
+ }
+ target.requestFailed(
+ JDIDebugBreakpointMessages.JavaMethodBreakpoint_Unable_to_create_breakpoint_request___VM_disconnected__1,
+ null);
+ return null;
}
-
+
/**
* @see JavaBreakpoint#setRequestThreadFilter(EventRequest)
*/
- protected void setRequestThreadFilter(EventRequest request, ThreadReference thread) {
+ @Override
+ protected void setRequestThreadFilter(EventRequest request,
+ ThreadReference thread) {
if (request instanceof MethodEntryRequest) {
- ((MethodEntryRequest)request).addThreadFilter(thread);
- } else if (request instanceof MethodExitRequest){
- ((MethodExitRequest)request).addThreadFilter(thread);
+ ((MethodEntryRequest) request).addThreadFilter(thread);
+ } else if (request instanceof MethodExitRequest) {
+ ((MethodExitRequest) request).addThreadFilter(thread);
} else if (request instanceof BreakpointRequest) {
- ((BreakpointRequest)request).addThreadFilter(thread);
+ ((BreakpointRequest) request).addThreadFilter(thread);
}
}
/**
- * Configure the given request's hit count. Since method
- * entry/exit requests do not support hit counts, we simulate
- * a hit count by manually updating a counter stored on the
- * request.
+ * Configure the given request's hit count. Since method entry/exit requests
+ * do not support hit counts, we simulate a hit count by manually updating a
+ * counter stored on the request.
*/
- protected void configureRequestHitCount(EventRequest request) throws CoreException {
+ @Override
+ protected void configureRequestHitCount(EventRequest request)
+ throws CoreException {
if (request instanceof BreakpointRequest) {
super.configureRequestHitCount(request);
} else {
int hitCount = getHitCount();
if (hitCount > 0) {
request.putProperty(HIT_COUNT, new Integer(hitCount));
- }
+ }
}
}
-
+
/**
* @see JavaBreakpoint#updateEnabledState(EventRequest, JDIDebugTarget)
*/
- protected void updateEnabledState(EventRequest request, JDIDebugTarget target) throws CoreException {
- boolean enabled= isEnabled();
- if (request instanceof MethodEntryRequest || request instanceof BreakpointRequest) {
- enabled= enabled && isEntry();
+ @Override
+ protected void updateEnabledState(EventRequest request,
+ JDIDebugTarget target) throws CoreException {
+ boolean enabled = isEnabled();
+ if (request instanceof MethodEntryRequest
+ || request instanceof BreakpointRequest) {
+ enabled = enabled && isEntry();
} else if (request instanceof MethodExitRequest) {
- enabled= enabled && isExit();
+ enabled = enabled && isExit();
}
-
+
if (enabled != request.isEnabled()) {
internalUpdateEnabledState(request, enabled, target);
}
- }
-
+ }
+
/**
- * Adds the method name and signature attributes to the
- * given attribute map, and intializes the local cache
- * of method name and signature.
+ * Adds the method name and signature attributes to the given attribute map,
+ * and initializes the local cache of method name and signature.
*/
- private void addMethodNameAndSignature(Map attributes, String methodName, String methodSignature) {
- if (methodName != null) {
+ private void addMethodNameAndSignature(Map<String, Object> attributes, String methodName,
+ String methodSignature) {
+ if (methodName != null) {
attributes.put(METHOD_NAME, methodName);
}
if (methodSignature != null) {
attributes.put(METHOD_SIGNATURE, methodSignature);
}
- fMethodName= methodName;
- fMethodSignature= methodSignature;
+ fMethodName = methodName;
+ fMethodSignature = methodSignature;
}
/**
* @see IJavaMethodBreakpoint#isEntrySuspend(IDebugTarget)
*/
public boolean isEntrySuspend(IDebugTarget target) {
- Integer lastEventType= (Integer) fLastEventTypes.get(target);
+ Integer lastEventType = fLastEventTypes.get(target);
if (lastEventType == null) {
return false;
}
return lastEventType.equals(ENTRY_EVENT);
- }
-
+ }
+
/**
- * @see JavaBreakpoint#handleBreakpointEvent(Event, JDIDebugTarget, JDIThread)
+ * @see JavaBreakpoint#handleBreakpointEvent(Event, JDIDebugTarget,
+ * JDIThread)
*/
- public boolean handleBreakpointEvent(Event event, JDIThread thread, boolean suspendVote) {
+ @Override
+ public boolean handleBreakpointEvent(Event event, JDIThread thread,
+ boolean suspendVote) {
if (event instanceof MethodEntryEvent) {
- MethodEntryEvent entryEvent= (MethodEntryEvent) event;
+ MethodEntryEvent entryEvent = (MethodEntryEvent) event;
fLastEventTypes.put(thread.getDebugTarget(), ENTRY_EVENT);
- return handleMethodEvent(entryEvent, entryEvent.method(), thread, suspendVote);
+ return handleMethodEvent(entryEvent, entryEvent.method(), thread,
+ suspendVote);
} else if (event instanceof MethodExitEvent) {
- MethodExitEvent exitEvent= (MethodExitEvent) event;
+ MethodExitEvent exitEvent = (MethodExitEvent) event;
fLastEventTypes.put(thread.getDebugTarget(), EXIT_EVENT);
- return handleMethodEvent(exitEvent, exitEvent.method(), thread, suspendVote);
+ return handleMethodEvent(exitEvent, exitEvent.method(), thread,
+ suspendVote);
} else if (event instanceof BreakpointEvent) {
fLastEventTypes.put(thread.getDebugTarget(), ENTRY_EVENT);
return super.handleBreakpointEvent(event, thread, suspendVote);
}
return true;
}
-
+
/**
- * Method entry/exit events are fired each time any method is invoked in a class
- * in which a method entry/exit breakpoint has been installed.
- * When a method entry/exit event is received by this breakpoint, ensure that
- * the event has been fired by a method invocation that this breakpoint
- * is interested in. If it is not, do nothing.
+ * Method entry/exit events are fired each time any method is invoked in a
+ * class in which a method entry/exit breakpoint has been installed. When a
+ * method entry/exit event is received by this breakpoint, ensure that the
+ * event has been fired by a method invocation that this breakpoint is
+ * interested in. If it is not, do nothing.
*/
- protected boolean handleMethodEvent(LocatableEvent event, Method method, JDIThread thread, boolean suspendVote) {
+ protected boolean handleMethodEvent(LocatableEvent event, Method method,
+ JDIThread thread, boolean suspendVote) {
try {
if (isNativeOnly()) {
if (!method.isNative()) {
return true;
}
}
-
+
if (getMethodName() != null) {
if (!method.name().equals(getMethodName())) {
return true;
}
}
-
+
if (getMethodSignature() != null) {
String sig = method.signature();
- if(sig.indexOf('$') > -1) {
+ if (sig.indexOf('$') > -1) {
sig = sig.replace('$', '.');
}
if (!sig.equals(getMethodSignature())) {
return true;
}
}
-
+
if (fPattern != null) {
if (!fPattern.matcher(method.declaringType().name()).find()) {
return true;
}
}
-
+
// simulate hit count
- Integer count = (Integer)event.request().getProperty(HIT_COUNT);
+ Integer count = (Integer) event.request().getProperty(HIT_COUNT);
if (count != null && handleHitCount(event, count)) {
return true;
}
// no hit count
- return !suspendForEvent(event, thread, suspendVote); // Resume if suspend fails
+ return !suspendForEvent(event, thread, suspendVote); // Resume if
+ // suspend
+ // fails
} catch (CoreException e) {
JDIDebugPlugin.log(e);
}
return true;
}
-
+
/**
- * Method breakpoints simulate hit count.
- * When a method event is received, decrement the hit count
- * property on the request and suspend if the hit count reaches 0.
+ * Method breakpoints simulate hit count. When a method event is received,
+ * decrement the hit count property on the request and suspend if the hit
+ * count reaches 0.
*/
- private boolean handleHitCount(LocatableEvent event, Integer count) {
- // decrement count and suspend if 0
+ private boolean handleHitCount(LocatableEvent event, Integer count) {
+ // decrement count and suspend if 0
int hitCount = count.intValue();
if (hitCount > 0) {
hitCount--;
@@ -466,26 +519,33 @@ public class JavaMethodBreakpoint extends JavaLineBreakpoint implements IJavaMet
return false;
}
// count still > 0, keep running
- return true;
+ return true;
}
// hit count expired, keep running
return true;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaMethodEntryBreakpoint#getMethodName()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaMethodEntryBreakpoint#getMethodName()
*/
public String getMethodName() {
return fMethodName;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaMethodEntryBreakpoint#getMethodSignature()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaMethodEntryBreakpoint#getMethodSignature
+ * ()
*/
public String getMethodSignature() {
return fMethodSignature;
- }
-
+ }
+
/**
* @see IJavaMethodBreakpoint#isEntry()
*/
@@ -518,7 +578,7 @@ public class JavaMethodBreakpoint extends JavaLineBreakpoint implements IJavaMet
} else if (!(entry || isExit())) {
setEnabled(false);
}
- recreate();
+ recreate();
}
}
@@ -532,9 +592,9 @@ public class JavaMethodBreakpoint extends JavaLineBreakpoint implements IJavaMet
setEnabled(true);
} else if (!(exit || isEntry())) {
setEnabled(false);
- }
- recreate();
- }
+ }
+ recreate();
+ }
}
/**
@@ -546,70 +606,79 @@ public class JavaMethodBreakpoint extends JavaLineBreakpoint implements IJavaMet
recreate();
}
}
-
+
/**
* Initialize cache of attributes
*
* @see org.eclipse.debug.core.model.IBreakpoint#setMarker(IMarker)
*/
+ @Override
public void setMarker(IMarker marker) throws CoreException {
super.setMarker(marker);
fMethodName = marker.getAttribute(METHOD_NAME, null);
fMethodSignature = marker.getAttribute(METHOD_SIGNATURE, null);
- String typePattern= marker.getAttribute(TYPE_NAME, ""); //$NON-NLS-1$
+ String typePattern = marker.getAttribute(TYPE_NAME, ""); //$NON-NLS-1$
if (typePattern != null) {
try {
- fPattern = Pattern.compile(convertToRegularExpression(typePattern));
+ fPattern = Pattern
+ .compile(convertToRegularExpression(typePattern));
} catch (PatternSyntaxException e) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), JDIDebugBreakpointMessages.JavaMethodBreakpoint_0, e));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ JDIDebugBreakpointMessages.JavaMethodBreakpoint_0, e));
}
}
- }
-
+ }
+
/**
* converts the specified string to one which has been formated to our needs
- * @param stringMatcherPattern the initial pattern
+ *
+ * @param stringMatcherPattern
+ * the initial pattern
* @return the modified pattern
*/
private String convertToRegularExpression(String stringMatcherPattern) {
- String regex = stringMatcherPattern.replaceAll("\\.", "\\\\."); //$NON-NLS-1$//$NON-NLS-2$
- regex = regex.replaceAll("\\*", "\\.\\*"); //$NON-NLS-1$//$NON-NLS-2$
- regex = regex.replaceAll("\\$", "\\\\\\$"); //$NON-NLS-1$ //$NON-NLS-2$
- return regex;
+ String regex = stringMatcherPattern.replaceAll("\\.", "\\\\."); //$NON-NLS-1$//$NON-NLS-2$
+ regex = regex.replaceAll("\\*", "\\.\\*"); //$NON-NLS-1$//$NON-NLS-2$
+ regex = regex.replaceAll("\\$", "\\\\\\$"); //$NON-NLS-1$ //$NON-NLS-2$
+ return regex;
}
-
+
/**
- * If this breakpoint is not entry or exit enabled,
- * set the default (entry)
+ * If this breakpoint is not entry or exit enabled, set the default (entry)
*
* @see org.eclipse.debug.core.model.IBreakpoint#setEnabled(boolean)
*/
- public void setEnabled(boolean enabled) throws CoreException {
+ @Override
+ public void setEnabled(boolean enabled) throws CoreException {
if (enabled) {
- if (!(isEntry()|| isExit())) {
+ if (!(isEntry() || isExit())) {
setDefaultEntryAndExit();
}
}
super.setEnabled(enabled);
}
-
+
/**
- * Sets the default entry and exit attributes of the method breakpoint
- * The default values are:
+ * Sets the default entry and exit attributes of the method breakpoint The
+ * default values are:
* <ul>
* <li>entry = <code>true</code>
* <li>exit = <code>false</code>
* <ul>
*/
protected void setDefaultEntryAndExit() throws CoreException {
- Object[] values= new Object[]{Boolean.TRUE, Boolean.FALSE};
- String[] attributes= new String[]{ENTRY, EXIT};
+ Object[] values = new Object[] { Boolean.TRUE, Boolean.FALSE };
+ String[] attributes = new String[] { ENTRY, EXIT };
setAttributes(attributes, values);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaLineBreakpoint#supportsCondition()
*/
+ @Override
public boolean supportsCondition() {
return true;
}
@@ -617,29 +686,32 @@ public class JavaMethodBreakpoint extends JavaLineBreakpoint implements IJavaMet
/**
* @see JavaBreakpoint#addToTarget(JDIDebugTarget)
*/
+ @Override
public void addToTarget(JDIDebugTarget target) throws CoreException {
if (usesTypePattern()) {
// pre-notification
fireAdding(target);
-
- String referenceTypeNamePattern= getTypeName();
+
+ String referenceTypeNamePattern = getTypeName();
if (referenceTypeNamePattern == null) {
return;
}
-
+
createRequest(target, referenceTypeNamePattern);
} else {
super.addToTarget(target);
}
}
+
/**
* @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#removeFromTarget(JDIDebugTarget)
*/
+ @Override
public void removeFromTarget(JDIDebugTarget target) throws CoreException {
fLastEventTypes.remove(target);
super.removeFromTarget(target);
}
-
+
/**
* Returns whether this breakpoint uses type name pattern matching.
*
@@ -648,47 +720,57 @@ public class JavaMethodBreakpoint extends JavaLineBreakpoint implements IJavaMet
protected boolean usesTypePattern() throws CoreException {
if (fUsesTypePattern == null) {
String name = getTypeName();
- fUsesTypePattern= Boolean.valueOf(name != null && (name.startsWith("*") || name.endsWith("*"))); //$NON-NLS-1$ //$NON-NLS-2$
+ fUsesTypePattern = Boolean.valueOf(name != null
+ && (name.startsWith("*") || name.endsWith("*"))); //$NON-NLS-1$ //$NON-NLS-2$
}
return fUsesTypePattern.booleanValue();
}
-
+
/**
- * Used when this breakpoint is for a specific type (i.e. not using type name
- * pattern matching).
+ * Used when this breakpoint is for a specific type (i.e. not using type
+ * name pattern matching).
*
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#createRequest(JDIDebugTarget, ReferenceType)
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#createRequest(JDIDebugTarget,
+ * ReferenceType)
*/
- protected boolean createRequest(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ @Override
+ protected boolean createRequest(JDIDebugTarget target, ReferenceType type)
+ throws CoreException {
if (!type.name().equals(getTypeName()) || shouldSkipBreakpoint()) {
- // do not create requests for inner/outer types if this is for a specific type
+ // do not create requests for inner/outer types if this is for a
+ // specific type
return false;
}
- EventRequest entryRequest= createMethodEntryRequest(target, type);
- EventRequest exitRequest= createMethodExitRequest(target, type);
-
+ EventRequest entryRequest = createMethodEntryRequest(target, type);
+ EventRequest exitRequest = createMethodExitRequest(target, type);
+
registerRequest(entryRequest, target);
registerRequest(exitRequest, target);
return true;
}
+
/**
* @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#setTypeName(String)
*/
+ @Override
protected void setTypeName(String typeName) throws CoreException {
- fUsesTypePattern= null;
+ fUsesTypePattern = null;
super.setTypeName(typeName);
}
-
+
/**
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(EventRequest, ObjectReference)
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(EventRequest,
+ * ObjectReference)
*/
- protected void addInstanceFilter(EventRequest request, ObjectReference object) {
+ @Override
+ protected void addInstanceFilter(EventRequest request,
+ ObjectReference object) {
if (request instanceof MethodEntryRequest) {
- ((MethodEntryRequest)request).addInstanceFilter(object);
+ ((MethodEntryRequest) request).addInstanceFilter(object);
} else if (request instanceof MethodExitRequest) {
- ((MethodExitRequest)request).addInstanceFilter(object);
+ ((MethodExitRequest) request).addInstanceFilter(object);
} else {
super.addInstanceFilter(request, object);
}
- }
+ }
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodEntryBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodEntryBreakpoint.java
index 0e60438a7..05f87b65c 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodEntryBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaMethodEntryBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,15 +10,18 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
import java.util.Map;
+
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import org.eclipse.jdt.debug.core.IJavaMethodEntryBreakpoint;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
+
import com.sun.jdi.ClassType;
import com.sun.jdi.Location;
import com.sun.jdi.Method;
@@ -30,117 +33,131 @@ import com.sun.jdi.request.EventRequest;
* A line breakpoint at the first executable location in a specific method.
*/
-public class JavaMethodEntryBreakpoint extends JavaLineBreakpoint implements IJavaMethodEntryBreakpoint {
-
+public class JavaMethodEntryBreakpoint extends JavaLineBreakpoint implements
+ IJavaMethodEntryBreakpoint {
+
protected static final String JAVA_METHOD_ENTRY_BREAKPOINT = "org.eclipse.jdt.debug.javaMethodEntryBreakpointMarker"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing the name of the method
- * in which a breakpoint is contained.
- * (value <code>"org.eclipse.jdt.debug.core.methodName"</code>). This attribute is a <code>String</code>.
+ * Breakpoint attribute storing the name of the method in which a breakpoint
+ * is contained. (value <code>"org.eclipse.jdt.debug.core.methodName"</code>
+ * ). This attribute is a <code>String</code>.
*/
private static final String METHOD_NAME = "org.eclipse.jdt.debug.core.methodName"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing the signature of the method
- * in which a breakpoint is contained.
- * (value <code>"org.eclipse.jdt.debug.core.methodSignature"</code>). This attribute is a <code>String</code>.
+ * Breakpoint attribute storing the signature of the method in which a
+ * breakpoint is contained. (value
+ * <code>"org.eclipse.jdt.debug.core.methodSignature"</code>). This
+ * attribute is a <code>String</code>.
*/
private static final String METHOD_SIGNATURE = "org.eclipse.jdt.debug.core.methodSignature"; //$NON-NLS-1$
-
+
/**
* Cache of method name attribute
*/
private String fMethodName = null;
-
+
/**
* Cache of method signature attribute
*/
private String fMethodSignature = null;
-
+
/**
- * Constructs a new unconfigured method breakpoint
+ * Constructs a new method breakpoint
*/
public JavaMethodEntryBreakpoint() {
}
-
- public JavaMethodEntryBreakpoint(final IResource resource, final String typeName, final String methodName, final String methodSignature, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean register, final Map attributes) throws CoreException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+
+ public JavaMethodEntryBreakpoint(final IResource resource,
+ final String typeName, final String methodName,
+ final String methodSignature, final int lineNumber,
+ final int charStart, final int charEnd, final int hitCount,
+ final boolean register, final Map<String, Object> attributes) throws CoreException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
// create the marker
setMarker(resource.createMarker(JAVA_METHOD_ENTRY_BREAKPOINT));
-
+
// add attributes
- addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
- addMethodNameAndSignature(attributes, methodName, methodSignature);
+ addLineBreakpointAttributes(attributes, getModelIdentifier(),
+ true, lineNumber, charStart, charEnd);
+ addMethodNameAndSignature(attributes, methodName,
+ methodSignature);
addTypeNameAndHitCount(attributes, typeName, hitCount);
- //set attributes
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
+ // set attributes
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
ensureMarker().setAttributes(attributes);
-
+
register(register);
}
};
run(getMarkerRule(resource), wr);
}
-
+
/**
- * Adds the method name and signature attributes to the
- * given attribute map, and intializes the local cache
- * of method name and signature.
+ * Adds the method name and signature attributes to the given attribute map,
+ * and initializes the local cache of method name and signature.
*/
- private void addMethodNameAndSignature(Map attributes, String methodName, String methodSignature) {
- if (methodName != null) {
+ private void addMethodNameAndSignature(Map<String, Object> attributes, String methodName,
+ String methodSignature) {
+ if (methodName != null) {
attributes.put(METHOD_NAME, methodName);
}
if (methodSignature != null) {
attributes.put(METHOD_SIGNATURE, methodSignature);
}
- fMethodName= methodName;
- fMethodSignature= methodSignature;
+ fMethodName = methodName;
+ fMethodSignature = methodSignature;
}
-
+
/**
- * @see IJavaMethodEntryBreakpoint#getMethodName()
+ * @see IJavaMethodEntryBreakpoint#getMethodName()
*/
public String getMethodName() {
return fMethodName;
}
-
+
/**
- * @see IJavaMethodEntryBreakpoint#getMethodSignature()
+ * @see IJavaMethodEntryBreakpoint#getMethodSignature()
*/
public String getMethodSignature() {
return fMethodSignature;
- }
-
+ }
+
/**
* Initialize cache of attributes
*
* @see IBreakpoint#setMarker(IMarker)
*/
+ @Override
public void setMarker(IMarker marker) throws CoreException {
super.setMarker(marker);
fMethodName = marker.getAttribute(METHOD_NAME, null);
- fMethodSignature = marker.getAttribute(METHOD_SIGNATURE, null);
- }
-
+ fMethodSignature = marker.getAttribute(METHOD_SIGNATURE, null);
+ }
+
/**
* @see IJavaLineBreakpoint#supportsCondition()
*/
+ @Override
public boolean supportsCondition() {
return false;
}
-
+
/**
* @see JavaBreakpoint#newRequests(JDIDebugTarget, ReferenceType)
*/
- protected EventRequest[] newRequests(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ @Override
+ protected EventRequest[] newRequests(JDIDebugTarget target,
+ ReferenceType type) throws CoreException {
try {
if (type instanceof ClassType) {
- ClassType clazz = (ClassType)type;
- Method method = clazz.concreteMethodByName(getMethodName(), getMethodSignature());
+ ClassType clazz = (ClassType) type;
+ Method method = clazz.concreteMethodByName(getMethodName(),
+ getMethodSignature());
if (method == null) {
return null;
}
@@ -148,13 +165,15 @@ public class JavaMethodEntryBreakpoint extends JavaLineBreakpoint implements IJa
if (location == null || location.codeIndex() == -1) {
return null;
}
- BreakpointRequest req = type.virtualMachine().eventRequestManager().createBreakpointRequest(location);
+ BreakpointRequest req = type.virtualMachine()
+ .eventRequestManager()
+ .createBreakpointRequest(location);
configureRequest(req, target);
- return new EventRequest[]{req};
+ return new EventRequest[] { req };
}
return null;
} catch (RuntimeException e) {
- target.internalError(e);
+ target.internalError(e);
return null;
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaPatternBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaPatternBreakpoint.java
index a459c7b14..648750c83 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaPatternBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaPatternBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
-import com.ibm.icu.text.MessageFormat;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -22,72 +20,88 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaPatternBreakpoint;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.VirtualMachine;
-public class JavaPatternBreakpoint extends JavaLineBreakpoint implements IJavaPatternBreakpoint {
+public class JavaPatternBreakpoint extends JavaLineBreakpoint implements
+ IJavaPatternBreakpoint {
private static final String PATTERN_BREAKPOINT = "org.eclipse.jdt.debug.javaPatternBreakpointMarker"; //$NON-NLS-1$
-
+
/**
- * Breakpoint attribute storing the pattern identifier of the source
- * file in which a breakpoint is created
- * (value <code>"org.eclipse.jdt.debug.core.pattern"</code>). This attribute is a <code>String</code>.
+ * Breakpoint attribute storing the pattern identifier of the source file in
+ * which a breakpoint is created (value
+ * <code>"org.eclipse.jdt.debug.core.pattern"</code>). This attribute is a
+ * <code>String</code>.
*/
protected static final String PATTERN = "org.eclipse.jdt.debug.core.pattern"; //$NON-NLS-1$
-
+
public JavaPatternBreakpoint() {
}
-
+
/**
- * @see JDIDebugModel#createPatternBreakpoint(IResource, String, int, int, int, int, boolean, Map)
- */
- public JavaPatternBreakpoint(IResource resource, String sourceName, String pattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean add, Map attributes) throws DebugException {
- this(resource, sourceName, pattern, lineNumber, charStart, charEnd, hitCount, add, attributes, PATTERN_BREAKPOINT);
+ * @see JDIDebugModel#createPatternBreakpoint(IResource, String, int, int,
+ * int, int, boolean, Map)
+ */
+ public JavaPatternBreakpoint(IResource resource, String sourceName,
+ String pattern, int lineNumber, int charStart, int charEnd,
+ int hitCount, boolean add, Map<String, Object> attributes) throws DebugException {
+ this(resource, sourceName, pattern, lineNumber, charStart, charEnd,
+ hitCount, add, attributes, PATTERN_BREAKPOINT);
}
-
- public JavaPatternBreakpoint(final IResource resource, final String sourceName, final String pattern, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean add, final Map attributes, final String markerType) throws DebugException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+
+ public JavaPatternBreakpoint(final IResource resource,
+ final String sourceName, final String pattern,
+ final int lineNumber, final int charStart, final int charEnd,
+ final int hitCount, final boolean add, final Map<String, Object> attributes,
+ final String markerType) throws DebugException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
-
+
// create the marker
setMarker(resource.createMarker(markerType));
-
+
// add attributes
- addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
+ addLineBreakpointAttributes(attributes, getModelIdentifier(),
+ true, lineNumber, charStart, charEnd);
addPatternAndHitCount(attributes, sourceName, pattern, hitCount);
// set attributes
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
ensureMarker().setAttributes(attributes);
-
+
register(add);
}
};
run(getMarkerRule(resource), wr);
}
-
+
/**
* @see JavaBreakpoint#getReferenceTypeName()
*/
protected String getReferenceTypeName() {
- String name= ""; //$NON-NLS-1$
+ String name = ""; //$NON-NLS-1$
try {
- name= getPattern();
+ name = getPattern();
} catch (CoreException ce) {
JDIDebugPlugin.log(ce);
}
return name;
}
-
+
/**
* @see JavaBreakpoint#installableReferenceType(ReferenceType)
*/
- protected boolean installableReferenceType(ReferenceType type, JDIDebugTarget target) throws CoreException {
+ @Override
+ protected boolean installableReferenceType(ReferenceType type,
+ JDIDebugTarget target) throws CoreException {
// if the source name attribute is specified, check for a match with the
// debug attribute (if available)
if (getSourceName() != null) {
@@ -100,101 +114,111 @@ public class JavaPatternBreakpoint extends JavaLineBreakpoint implements IJavaPa
if (!target.isAvailable()) {
return false;
}
- target.targetRequestFailed(MessageFormat.format(JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name,new String[] {e.toString(), type.name()}) ,e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ target.targetRequestFailed(
+ MessageFormat.format(JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name, e.toString(), type.name()), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return false;
} catch (RuntimeException e) {
- target.targetRequestFailed(MessageFormat.format(JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name,new String[] {e.toString(), type.name()}) ,e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ target.targetRequestFailed(
+ MessageFormat.format(JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name, e.toString(), type.name()), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return false;
}
-
- // if the debug attribute matches the source name, attempt installion
+
+ // if the debug attribute matches the source name, attempt
+ // installation
if (sourceName != null) {
if (!getSourceName().equalsIgnoreCase(sourceName)) {
return false;
}
}
}
-
- String pattern= getPattern();
- String queriedType= type.name();
+
+ String pattern = getPattern();
+ String queriedType = type.name();
if (pattern == null || queriedType == null) {
return false;
}
if (queriedType.startsWith(pattern)) {
- // query registered listeners to see if this pattern breakpoint should
+ // query registered listeners to see if this pattern breakpoint
+ // should
// be installed in the given target
return queryInstallListeners(target, type);
}
return false;
- }
-
+ }
+
/**
* Adds the class name pattern and hit count attributes to the given map.
*/
- protected void addPatternAndHitCount(Map attributes, String sourceName, String pattern, int hitCount) {
+ protected void addPatternAndHitCount(Map<String, Object> attributes, String sourceName,
+ String pattern, int hitCount) {
attributes.put(PATTERN, pattern);
if (sourceName != null) {
attributes.put(SOURCE_NAME, sourceName);
- }
+ }
if (hitCount > 0) {
attributes.put(HIT_COUNT, new Integer(hitCount));
attributes.put(EXPIRED, Boolean.FALSE);
}
}
-
+
/**
* @see IJavaPatternBreakpoint#getPattern()
*/
public String getPattern() throws CoreException {
- return (String) ensureMarker().getAttribute(PATTERN);
- }
-
+ return (String) ensureMarker().getAttribute(PATTERN);
+ }
+
/**
* @see IJavaPatternBreakpoint#getSourceName()
*/
public String getSourceName() throws CoreException {
- return (String) ensureMarker().getAttribute(SOURCE_NAME);
- }
+ return (String) ensureMarker().getAttribute(SOURCE_NAME);
+ }
+ @Override
protected void createRequests(JDIDebugTarget target) throws CoreException {
if (target.isTerminated() || shouldSkipBreakpoint()) {
return;
}
- String referenceTypeName= getReferenceTypeName();
+ String referenceTypeName = getReferenceTypeName();
if (referenceTypeName == null) {
return;
}
-
- String classPrepareTypeName= referenceTypeName;
+
+ String classPrepareTypeName = referenceTypeName;
// create request to listen to class loads
- //name may only be partially resolved
+ // name may only be partially resolved
if (!referenceTypeName.endsWith("*")) { //$NON-NLS-1$
- classPrepareTypeName= classPrepareTypeName + '*';
+ classPrepareTypeName = classPrepareTypeName + '*';
}
- registerRequest(target.createClassPrepareRequest(classPrepareTypeName), target);
-
+ registerRequest(target.createClassPrepareRequest(classPrepareTypeName),
+ target);
+
// create breakpoint requests for each class currently loaded
VirtualMachine vm = target.getVM();
if (vm == null) {
- target.requestFailed(JDIDebugBreakpointMessages.JavaPatternBreakpoint_Unable_to_add_breakpoint___VM_disconnected__1, null);
+ target.requestFailed(
+ JDIDebugBreakpointMessages.JavaPatternBreakpoint_Unable_to_add_breakpoint___VM_disconnected__1,
+ null);
}
- List classes = null;
+ List<ReferenceType> classes = null;
try {
- classes= vm.allClasses();
+ classes = vm.allClasses();
} catch (RuntimeException e) {
- target.targetRequestFailed(JDIDebugBreakpointMessages.JavaPatternBreakpoint_0, e);
+ target.targetRequestFailed(
+ JDIDebugBreakpointMessages.JavaPatternBreakpoint_0, e);
}
if (classes != null) {
- Iterator iter = classes.iterator();
- String typeName= null;
- ReferenceType type= null;
+ Iterator<ReferenceType> iter = classes.iterator();
+ String typeName = null;
+ ReferenceType type = null;
while (iter.hasNext()) {
- type= (ReferenceType) iter.next();
- typeName= type.name();
+ type = iter.next();
+ typeName = type.name();
if (typeName != null && typeName.startsWith(referenceTypeName)) {
createRequest(target, type);
}
@@ -202,4 +226,3 @@ public class JavaPatternBreakpoint extends JavaLineBreakpoint implements IJavaPa
}
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaStratumLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaStratumLineBreakpoint.java
index ab1944021..a1eba8537 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaStratumLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaStratumLineBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.jdt.internal.debug.core.breakpoints;
import java.util.Iterator;
import java.util.List;
-import java.util.ListIterator;
import java.util.Map;
import org.eclipse.core.resources.IResource;
@@ -37,16 +36,17 @@ import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.VirtualMachine;
/**
- * A line breakpoint identified by its source file
- * name and/or path, and stratum that it is relative to.
+ * A line breakpoint identified by its source file name and/or path, and stratum
+ * that it is relative to.
*
* @since 3.0
*/
-public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJavaStratumLineBreakpoint {
- private static final String PATTERN= "org.eclipse.jdt.debug.pattern"; //$NON-NLS-1$
- protected static final String STRATUM= "org.eclipse.jdt.debug.stratum"; //$NON-NLS-1$
- protected static final String SOURCE_PATH= "org.eclipse.jdt.debug.source_path"; //$NON-NLS-1$
- private static final String STRATUM_BREAKPOINT= "org.eclipse.jdt.debug.javaStratumLineBreakpointMarker"; //$NON-NLS-1$
+public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements
+ IJavaStratumLineBreakpoint {
+ private static final String PATTERN = "org.eclipse.jdt.debug.pattern"; //$NON-NLS-1$
+ protected static final String STRATUM = "org.eclipse.jdt.debug.stratum"; //$NON-NLS-1$
+ protected static final String SOURCE_PATH = "org.eclipse.jdt.debug.source_path"; //$NON-NLS-1$
+ private static final String STRATUM_BREAKPOINT = "org.eclipse.jdt.debug.javaStratumLineBreakpointMarker"; //$NON-NLS-1$
private String[] fTypeNamePatterns;
// corresponds to type name patterns with beginning/trailing '*' removed
private String[] fSuffix;
@@ -56,73 +56,110 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
}
/**
- * Creates and returns a line breakpoint identified by its source file
- * name and/or path, and stratum that it is relative to.
+ * Creates and returns a line breakpoint identified by its source file name
+ * and/or path, and stratum that it is relative to.
*
- * @param resource the resource on which to create the associated breakpoint
- * marker
- * @param stratum the stratum in which the source name, source path and line number
- * are relative, or <code>null</code>. If <code>null</code> or if the specified stratum
- * is not defined for a type, the source name, source path and line number are
- * relative to the type's default stratum.
- * @param sourceName the simple name of the source file in which the breakpoint is
- * set, or <code>null</code>. The breakpoint will install itself in classes that have a source
- * file name debug attribute that matches this value in the specified stratum,
- * and satisfies the class name pattern and source path attribute. When <code>null</code>,
- * the source file name debug attribute is not considered.
- * @param sourcePath the qualified source file name in which the breakpoint is
- * set, or <code>null</code>. The breakpoint will install itself in classes that
- * have a source file path in the specified stratum that matches this value, and
- * satisfies the class name pattern and source name attribute. When <code>null</code>,
- * the source path attribute is not considered.
- * @param classNamePattern the class name pattern to which the breakpoint should
- * be restricted, or <code>null</code>. The breakpoint will install itself in each type that
- * matches this class name pattern, with a satisfying source name and source path.
- * Patterns may begin or end with '*', which matches 0 or more characters. A pattern that
- * does not contain a '*' is equivalent to a pattern ending in '*'. Specifying <code>null</code>,
- * or an empty string is the equivalent to "*".
- * @param lineNumber the lineNumber on which the breakpoint is set - line
- * numbers are 1 based, associated with the source file (stratum) in which
- * the breakpoint is set
- * @param charStart the first character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param charEnd the last character index associated with the breakpoint,
- * or -1 if unspecified, in the source file in which the breakpoint is set
- * @param hitCount the number of times the breakpoint will be hit before
- * suspending execution - 0 if it should always suspend
- * @param register whether to add this breakpoint to the breakpoint manager
- * @param attributes a map of client defined attributes that should be assigned
- * to the underlying breakpoint marker on creation, or <code>null</code> if none.
+ * @param resource
+ * the resource on which to create the associated breakpoint
+ * marker
+ * @param stratum
+ * the stratum in which the source name, source path and line
+ * number are relative, or <code>null</code>. If
+ * <code>null</code> or if the specified stratum is not defined
+ * for a type, the source name, source path and line number are
+ * relative to the type's default stratum.
+ * @param sourceName
+ * the simple name of the source file in which the breakpoint is
+ * set, or <code>null</code>. The breakpoint will install itself
+ * in classes that have a source file name debug attribute that
+ * matches this value in the specified stratum, and satisfies the
+ * class name pattern and source path attribute. When
+ * <code>null</code>, the source file name debug attribute is not
+ * considered.
+ * @param sourcePath
+ * the qualified source file name in which the breakpoint is set,
+ * or <code>null</code>. The breakpoint will install itself in
+ * classes that have a source file path in the specified stratum
+ * that matches this value, and satisfies the class name pattern
+ * and source name attribute. When <code>null</code>, the source
+ * path attribute is not considered.
+ * @param classNamePattern
+ * the class name pattern to which the breakpoint should be
+ * restricted, or <code>null</code>. The breakpoint will install
+ * itself in each type that matches this class name pattern, with
+ * a satisfying source name and source path. Patterns may begin
+ * or end with '*', which matches 0 or more characters. A pattern
+ * that does not contain a '*' is equivalent to a pattern ending
+ * in '*'. Specifying <code>null</code>, or an empty string is
+ * the equivalent to "*".
+ * @param lineNumber
+ * the lineNumber on which the breakpoint is set - line numbers
+ * are 1 based, associated with the source file (stratum) in
+ * which the breakpoint is set
+ * @param charStart
+ * the first character index associated with the breakpoint, or
+ * -1 if unspecified, in the source file in which the breakpoint
+ * is set
+ * @param charEnd
+ * the last character index associated with the breakpoint, or -1
+ * if unspecified, in the source file in which the breakpoint is
+ * set
+ * @param hitCount
+ * the number of times the breakpoint will be hit before
+ * suspending execution - 0 if it should always suspend
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @param attributes
+ * a map of client defined attributes that should be assigned to
+ * the underlying breakpoint marker on creation, or
+ * <code>null</code> if none.
* @return a stratum breakpoint
- * @exception CoreException If this method fails. Reasons include:<ul>
- *<li>Failure creating underlying marker. The exception's status contains
- * the underlying exception responsible for the failure.</li></ul>
+ * @exception CoreException
+ * If this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for
+ * the failure.</li>
+ * </ul>
* @since 3.0
*/
- public JavaStratumLineBreakpoint(IResource resource, String stratum, String sourceName, String sourcePath, String classNamePattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws DebugException {
- this(resource, stratum, sourceName, sourcePath, classNamePattern, lineNumber, charStart, charEnd, hitCount, register, attributes, STRATUM_BREAKPOINT);
+ public JavaStratumLineBreakpoint(IResource resource, String stratum,
+ String sourceName, String sourcePath, String classNamePattern,
+ int lineNumber, int charStart, int charEnd, int hitCount,
+ boolean register, Map<String, Object> attributes) throws DebugException {
+ this(resource, stratum, sourceName, sourcePath, classNamePattern,
+ lineNumber, charStart, charEnd, hitCount, register, attributes,
+ STRATUM_BREAKPOINT);
}
-
- protected JavaStratumLineBreakpoint(final IResource resource, final String stratum, final String sourceName, final String sourcePath, final String classNamePattern, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean register, final Map attributes, final String markerType) throws DebugException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+
+ protected JavaStratumLineBreakpoint(final IResource resource,
+ final String stratum, final String sourceName,
+ final String sourcePath, final String classNamePattern,
+ final int lineNumber, final int charStart, final int charEnd,
+ final int hitCount, final boolean register, final Map<String, Object> attributes,
+ final String markerType) throws DebugException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
-
+
// create the marker
setMarker(resource.createMarker(markerType));
-
+
// modify pattern
String pattern = classNamePattern;
if (pattern != null && pattern.length() == 0) {
pattern = null;
}
-
+
// add attributes
- addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
- addStratumPatternAndHitCount(attributes, stratum, sourceName, sourcePath, pattern, hitCount);
+ addLineBreakpointAttributes(attributes, getModelIdentifier(),
+ true, lineNumber, charStart, charEnd);
+ addStratumPatternAndHitCount(attributes, stratum, sourceName,
+ sourcePath, pattern, hitCount);
// set attributes
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
ensureMarker().setAttributes(attributes);
-
+
register(register);
}
};
@@ -130,9 +167,10 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
}
/**
- * Adds the class name pattern and hit count attributes to the gvien map.
+ * Adds the class name pattern and hit count attributes to the given map.
*/
- protected void addStratumPatternAndHitCount(Map attributes, String stratum, String sourceName, String sourcePath, String pattern, int hitCount) {
+ protected void addStratumPatternAndHitCount(Map<String, Object> attributes, String stratum,
+ String sourceName, String sourcePath, String pattern, int hitCount) {
attributes.put(PATTERN, pattern);
attributes.put(STRATUM, stratum);
if (sourceName != null) {
@@ -146,24 +184,30 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
attributes.put(EXPIRED, Boolean.FALSE);
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#installableReferenceType(com.sun.jdi.ReferenceType, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * installableReferenceType(com.sun.jdi.ReferenceType,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
*/
- protected boolean installableReferenceType(ReferenceType type, JDIDebugTarget target) throws CoreException {
+ @Override
+ protected boolean installableReferenceType(ReferenceType type,
+ JDIDebugTarget target) throws CoreException {
- // check the type name.
- String typeName= type.name();
+ // check the type name.
+ String typeName = type.name();
if (!validType(typeName)) {
return false;
}
String stratum = getStratum();
// check the source name.
- String bpSourceName= getSourceName();
+ String bpSourceName = getSourceName();
if (bpSourceName != null) {
- List sourceNames;
+ List<String> sourceNames;
try {
- sourceNames= type.sourceNames(stratum);
+ sourceNames = type.sourceNames(stratum);
} catch (AbsentInformationException e1) {
return false;
} catch (VMDisconnectedException e) {
@@ -176,13 +220,13 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
return false;
}
}
-
- String bpSourcePath= getSourcePath();
+
+ String bpSourcePath = getSourcePath();
if (bpSourcePath != null) {
// check that source paths match
- List sourcePaths;
+ List<String> sourcePaths;
try {
- sourcePaths= type.sourcePaths(stratum);
+ sourcePaths = type.sourcePaths(stratum);
} catch (AbsentInformationException e1) {
return false;
} catch (VMDisconnectedException e) {
@@ -197,16 +241,16 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
}
return queryInstallListeners(target, type);
}
-
- private boolean containsMatch(List strings, String key) {
- for (Iterator iter = strings.iterator(); iter.hasNext();) {
- if (((String) iter.next()).equals(key)) {
+
+ private boolean containsMatch(List<String> strings, String key) {
+ for (Iterator<String> iter = strings.iterator(); iter.hasNext();) {
+ if (iter.next().equals(key)) {
return true;
}
}
return false;
}
-
+
/**
* @param typeName
* @return
@@ -214,7 +258,7 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
private boolean validType(String typeName) throws CoreException {
String[] patterns = getTypeNamePatterns();
- for (int i=0; i<patterns.length; i++) {
+ for (int i = 0; i < patterns.length; i++) {
if (fSuffix[i] != null) {
// pattern starting with '*'
if (fSuffix[i].length() == 0) {
@@ -239,15 +283,24 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
* Returns a list of locations for the given line number in the given type.
* Returns <code>null</code> if a location cannot be determined.
*/
- protected List determineLocations(int lineNumber, ReferenceType type, JDIDebugTarget target) {
- List locations;
+ @Override
+ protected List<Location> determineLocations(int lineNumber, ReferenceType type,
+ JDIDebugTarget target) {
+ List<Location> locations;
String sourcePath;
try {
- locations= type.locationsOfLine(getStratum(), getSourceName(), lineNumber);
- sourcePath= getSourcePath();
+ locations = type.locationsOfLine(getStratum(), getSourceName(),
+ lineNumber);
+ sourcePath = getSourcePath();
} catch (AbsentInformationException aie) {
- IStatus status= new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), NO_LINE_NUMBERS, JDIDebugBreakpointMessages.JavaLineBreakpoint_Absent_Line_Number_Information_1, null);
- IStatusHandler handler= DebugPlugin.getDefault().getStatusHandler(status);
+ IStatus status = new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ NO_LINE_NUMBERS,
+ JDIDebugBreakpointMessages.JavaLineBreakpoint_Absent_Line_Number_Information_1,
+ null);
+ IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(
+ status);
if (handler != null) {
try {
handler.handleStatus(status, type);
@@ -257,77 +310,87 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
return null;
} catch (NativeMethodException e) {
return null;
- } catch (VMDisconnectedException e) {
+ } catch (VMDisconnectedException e) {
return null;
} catch (ClassNotPreparedException e) {
// could be a nested type that is not yet loaded
return null;
} catch (RuntimeException e) {
// not able to retrieve line info
- target.internalError(e);
+ target.internalError(e);
return null;
} catch (CoreException e) {
// not able to retrieve line info
JDIDebugPlugin.log(e);
return null;
}
-
+
if (sourcePath == null) {
if (locations.size() > 0) {
return locations;
}
} else {
- for (ListIterator iter = locations.listIterator(); iter.hasNext();) {
- Location location = (Location) iter.next();
+ for(Location location : locations) {
try {
if (!sourcePath.equals(location.sourcePath())) {
- iter.remove();
+ locations.remove(location);
}
} catch (AbsentInformationException e1) {
// nothing to do;
}
}
if (locations.size() > 0) {
- return locations;
+ return locations;
}
}
-
+
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint#getPattern()
*/
public String getPattern() throws CoreException {
return ensureMarker().getAttribute(PATTERN, "*"); //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint#getSourceName()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint#getSourceName()
*/
public String getSourceName() throws CoreException {
- return (String) ensureMarker().getAttribute(SOURCE_NAME);
+ return (String) ensureMarker().getAttribute(SOURCE_NAME);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint#getStratum()
*/
public String getStratum() throws CoreException {
- return (String) ensureMarker().getAttribute(STRATUM);
+ return (String) ensureMarker().getAttribute(STRATUM);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint#getSourcePath()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint#getSourcePath()
*/
public String getSourcePath() throws CoreException {
return (String) ensureMarker().getAttribute(SOURCE_PATH);
}
+ @Override
protected void createRequests(JDIDebugTarget target) throws CoreException {
if (target.isTerminated() || shouldSkipBreakpoint()) {
return;
}
-
+
String[] patterns = null;
try {
patterns = getTypeNamePatterns();
@@ -335,31 +398,33 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
JDIDebugPlugin.log(e1);
return;
}
-
+
String sourceName = getSourceName();
- for (int i=0; i<patterns.length; i++)
- {
- String classPrepareTypeName= patterns[i];
+ for (String classPrepareTypeName : patterns) {
// create request to listen to class loads
- //name may only be partially resolved
- registerRequest(target.createClassPrepareRequest(classPrepareTypeName, null, true, sourceName), target);
+ // name may only be partially resolved
+ registerRequest(target.createClassPrepareRequest(
+ classPrepareTypeName, null, true, sourceName), target);
}
-
+
// create breakpoint requests for each class currently loaded
VirtualMachine vm = target.getVM();
if (vm == null) {
- target.requestFailed(JDIDebugBreakpointMessages.JavaPatternBreakpoint_Unable_to_add_breakpoint___VM_disconnected__1, null);
+ target.requestFailed(
+ JDIDebugBreakpointMessages.JavaPatternBreakpoint_Unable_to_add_breakpoint___VM_disconnected__1,
+ null);
}
- List classes = null;
+ List<ReferenceType> classes = null;
try {
- classes= vm.allClasses();
+ classes = vm.allClasses();
} catch (RuntimeException e) {
- target.targetRequestFailed(JDIDebugBreakpointMessages.JavaPatternBreakpoint_0, e);
+ target.targetRequestFailed(
+ JDIDebugBreakpointMessages.JavaPatternBreakpoint_0, e);
}
if (classes != null) {
- Iterator iter = classes.iterator();
+ Iterator<ReferenceType> iter = classes.iterator();
while (iter.hasNext()) {
- ReferenceType type= (ReferenceType)iter.next();
+ ReferenceType type = iter.next();
if (installableReferenceType(type, target)) {
createRequest(target, type);
}
@@ -367,15 +432,14 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
}
}
- public synchronized String[] getTypeNamePatterns() throws CoreException
- {
+ public synchronized String[] getTypeNamePatterns() throws CoreException {
if (fTypeNamePatterns != null)
return fTypeNamePatterns;
-
+
String patterns = getPattern();
-
+
// delimit by ","
- fTypeNamePatterns = patterns.split(","); //$NON-NLS-1$
+ fTypeNamePatterns = patterns.split(","); //$NON-NLS-1$
fSuffix = new String[fTypeNamePatterns.length];
fPrefix = new String[fTypeNamePatterns.length];
for (int i = 0; i < fTypeNamePatterns.length; i++) {
@@ -388,11 +452,11 @@ public class JavaStratumLineBreakpoint extends JavaLineBreakpoint implements IJa
fSuffix[i] = ""; //$NON-NLS-1$
}
} else if (pattern.charAt(pattern.length() - 1) == '*') {
- fPrefix[i] = pattern.substring(0, pattern.length() - 1);
+ fPrefix[i] = pattern.substring(0, pattern.length() - 1);
}
}
-
+
return fTypeNamePatterns;
}
-
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaTargetPatternBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaTargetPatternBreakpoint.java
index a9644f411..9c855dee7 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaTargetPatternBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaTargetPatternBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,7 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
-import com.ibm.icu.text.MessageFormat;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -24,114 +21,132 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaDebugTarget;
import org.eclipse.jdt.debug.core.IJavaTargetPatternBreakpoint;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.VirtualMachine;
-public class JavaTargetPatternBreakpoint extends JavaLineBreakpoint implements IJavaTargetPatternBreakpoint {
+public class JavaTargetPatternBreakpoint extends JavaLineBreakpoint implements
+ IJavaTargetPatternBreakpoint {
private static final String TARGET_PATTERN_BREAKPOINT = "org.eclipse.jdt.debug.javaTargetPatternBreakpointMarker"; //$NON-NLS-1$
-
+
/**
* Table of targets to patterns
*/
- private HashMap fPatterns;
-
+ private HashMap<IJavaDebugTarget, String> fPatterns;
+
public JavaTargetPatternBreakpoint() {
}
-
+
/**
- * @see JDIDebugModel#createTargetPatternBreakpoint(IResource, String, int, int, int, int, boolean, Map)
- */
- public JavaTargetPatternBreakpoint(IResource resource, String sourceName, int lineNumber, int charStart, int charEnd, int hitCount, boolean add, Map attributes) throws DebugException {
- this(resource, sourceName, lineNumber, charStart, charEnd, hitCount, add, attributes, TARGET_PATTERN_BREAKPOINT);
+ * @see JDIDebugModel#createTargetPatternBreakpoint(IResource, String, int,
+ * int, int, int, boolean, Map)
+ */
+ public JavaTargetPatternBreakpoint(IResource resource, String sourceName,
+ int lineNumber, int charStart, int charEnd, int hitCount,
+ boolean add, Map<String, Object> attributes) throws DebugException {
+ this(resource, sourceName, lineNumber, charStart, charEnd, hitCount,
+ add, attributes, TARGET_PATTERN_BREAKPOINT);
}
-
- public JavaTargetPatternBreakpoint(final IResource resource, final String sourceName, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean add, final Map attributes, final String markerType) throws DebugException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
+
+ public JavaTargetPatternBreakpoint(final IResource resource,
+ final String sourceName, final int lineNumber, final int charStart,
+ final int charEnd, final int hitCount, final boolean add,
+ final Map<String, Object> attributes, final String markerType)
+ throws DebugException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
-
+
// create the marker
setMarker(resource.createMarker(markerType));
-
+
// add attributes
- addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
+ addLineBreakpointAttributes(attributes, getModelIdentifier(),
+ true, lineNumber, charStart, charEnd);
addSourceNameAndHitCount(attributes, sourceName, hitCount);
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
// set attributes
ensureMarker().setAttributes(attributes);
-
+
register(add);
}
};
run(getMarkerRule(resource), wr);
}
-
+
/**
- * Creates the event requests to:<ul>
+ * Creates the event requests to:
+ * <ul>
* <li>Listen to class loads related to the breakpoint</li>
* <li>Respond to the breakpoint being hit</li>
* </ul>
*/
+ @Override
public void addToTarget(JDIDebugTarget target) throws CoreException {
-
+
// pre-notification
fireAdding(target);
-
- String referenceTypeName= getPattern(target);
+
+ String referenceTypeName = getPattern(target);
if (referenceTypeName == null) {
return;
}
-
- String classPrepareTypeName= referenceTypeName;
+
+ String classPrepareTypeName = referenceTypeName;
// create request to listen to class loads
- //name may only be partially resolved
+ // name may only be partially resolved
if (!referenceTypeName.endsWith("*")) { //$NON-NLS-1$
- classPrepareTypeName= classPrepareTypeName + '*';
+ classPrepareTypeName = classPrepareTypeName + '*';
}
- registerRequest(target.createClassPrepareRequest(classPrepareTypeName), target);
-
+ registerRequest(target.createClassPrepareRequest(classPrepareTypeName),
+ target);
+
// create breakpoint requests for each class currently loaded
VirtualMachine vm = target.getVM();
- if (vm == null) {
- target.requestFailed(JDIDebugBreakpointMessages.JavaTargetPatternBreakpoint_Unable_to_add_breakpoint___VM_disconnected__1, null);
- }
- List classes= vm.allClasses();
- if (classes != null) {
- Iterator iter = classes.iterator();
- String typeName= null;
- ReferenceType type= null;
- while (iter.hasNext()) {
- type= (ReferenceType) iter.next();
- typeName= type.name();
- if (typeName != null && typeName.startsWith(referenceTypeName)) {
- createRequest(target, type);
+ if (vm != null) {
+ List<ReferenceType> classes = vm.allClasses();
+ if (classes != null) {
+ String typeName = null;
+ for(ReferenceType type : classes) {
+ typeName = type.name();
+ if (typeName != null && typeName.startsWith(referenceTypeName)) {
+ createRequest(target, type);
+ }
}
}
+ } else {
+ target.requestFailed(
+ JDIDebugBreakpointMessages.JavaTargetPatternBreakpoint_Unable_to_add_breakpoint___VM_disconnected__1,
+ null);
}
- }
-
+ }
+
/**
* @see JavaBreakpoint#getReferenceTypeName()
*/
protected String getReferenceTypeName() {
- String name= "*"; //$NON-NLS-1$
+ String name = "*"; //$NON-NLS-1$
try {
- name= getSourceName();
+ name = getSourceName();
} catch (CoreException ce) {
JDIDebugPlugin.log(ce);
}
return name;
}
-
+
/**
* @see JavaBreakpoint#installableReferenceType(ReferenceType)
*/
- protected boolean installableReferenceType(ReferenceType type, JDIDebugTarget target) throws CoreException {
+ @Override
+ protected boolean installableReferenceType(ReferenceType type,
+ JDIDebugTarget target) throws CoreException {
// if the source name attribute is specified, check for a match with the
// debug attribute (if available)
if (getSourceName() != null) {
@@ -144,90 +159,103 @@ public class JavaTargetPatternBreakpoint extends JavaLineBreakpoint implements I
if (!target.isAvailable()) {
return false;
}
- target.targetRequestFailed(MessageFormat.format(JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name,new String[] {e.toString(), type.name()}) ,e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ target.targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name,
+ e.toString(),
+ type.name()),
+ e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return false;
} catch (RuntimeException e) {
- target.targetRequestFailed(MessageFormat.format(JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name,new String[] {e.toString(), type.name()}) ,e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ target.targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugBreakpointMessages.JavaPatternBreakpoint_exception_source_name,
+ e.toString(),
+ type.name()), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return false;
}
-
- // if the debug attribute matches the source name, attempt installion
+
+ // if the debug attribute matches the source name, attempt
+ // installion
if (sourceName != null) {
if (!getSourceName().equalsIgnoreCase(sourceName)) {
return false;
}
}
}
-
- String pattern= getPattern(target);
- String queriedType= type.name();
+
+ String pattern = getPattern(target);
+ String queriedType = type.name();
if (pattern == null || queriedType == null) {
return false;
}
if (queriedType.startsWith(pattern)) {
- // query registered listeners to see if this pattern breakpoint should
+ // query registered listeners to see if this pattern breakpoint
+ // should
// be installed in the given target
return queryInstallListeners(target, type);
}
return false;
- }
-
+ }
+
/**
* Adds the source name and hit count attributes to the given map.
*/
- protected void addSourceNameAndHitCount(Map attributes, String sourceName, int hitCount) {
+ protected void addSourceNameAndHitCount(Map<String, Object> attributes, String sourceName,
+ int hitCount) {
if (sourceName != null) {
attributes.put(SOURCE_NAME, sourceName);
- }
+ }
if (hitCount > 0) {
attributes.put(HIT_COUNT, new Integer(hitCount));
attributes.put(EXPIRED, Boolean.FALSE);
}
}
-
+
/**
* @see IJavaTargetPatternBreakpoint#getPattern(IJavaDebugTarget)
*/
public String getPattern(IJavaDebugTarget target) {
if (fPatterns != null) {
- return (String)fPatterns.get(target);
+ return fPatterns.get(target);
}
return null;
- }
-
+ }
+
/**
* @see IJavaTargetPatternBreakpoint#setPattern(IJavaDebugTarget, String)
*/
- public void setPattern(IJavaDebugTarget target, String pattern) throws CoreException {
+ public void setPattern(IJavaDebugTarget target, String pattern)
+ throws CoreException {
if (fPatterns == null) {
- fPatterns = new HashMap(2);
+ fPatterns = new HashMap<IJavaDebugTarget, String>(2);
}
// if pattern is changing then remove and re-add
String oldPattern = getPattern(target);
fPatterns.put(target, pattern);
if (oldPattern != null && !oldPattern.equals(pattern)) {
- recreate((JDIDebugTarget)target);
+ recreate((JDIDebugTarget) target);
fireChanged();
}
- }
-
+ }
+
/**
* @see IJavaTargetPatternBreakpoint#getSourceName()
*/
public String getSourceName() throws CoreException {
- return (String) ensureMarker().getAttribute(SOURCE_NAME);
+ return (String) ensureMarker().getAttribute(SOURCE_NAME);
}
-
+
/**
* @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#removeFromTarget(JDIDebugTarget)
*/
+ @Override
public void removeFromTarget(JDIDebugTarget target) throws CoreException {
fPatterns.remove(target);
super.removeFromTarget(target);
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaWatchpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaWatchpoint.java
index 65347eaf9..97cbc090e 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaWatchpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaWatchpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
-
import java.util.HashMap;
import java.util.Map;
@@ -22,8 +21,11 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import org.eclipse.jdt.debug.core.IJavaWatchpoint;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
@@ -42,178 +44,206 @@ import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.ModificationWatchpointRequest;
import com.sun.jdi.request.WatchpointRequest;
-public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoint {
-
- public static final String JAVA_WATCHPOINT= "org.eclipse.jdt.debug.javaWatchpointMarker"; //$NON-NLS-1$
+public class JavaWatchpoint extends JavaLineBreakpoint implements
+ IJavaWatchpoint {
+
+ public static final String JAVA_WATCHPOINT = "org.eclipse.jdt.debug.javaWatchpointMarker"; //$NON-NLS-1$
/**
- * Watchpoint attribute storing the access value (value <code>"org.eclipse.jdt.debug.core.access"</code>).
- * This attribute is stored as a <code>boolean</code>, indicating whether a
- * watchpoint is an access watchpoint.
+ * Watchpoint attribute storing the access value (value
+ * <code>"org.eclipse.jdt.debug.core.access"</code>). This attribute is
+ * stored as a <code>boolean</code>, indicating whether a watchpoint is an
+ * access watchpoint.
*/
- protected static final String ACCESS= "org.eclipse.jdt.debug.core.access"; //$NON-NLS-1$
+ protected static final String ACCESS = "org.eclipse.jdt.debug.core.access"; //$NON-NLS-1$
/**
- * Watchpoint attribute storing the modification value (value <code>"org.eclipse.jdt.debug.core.modification"</code>).
- * This attribute is stored as a <code>boolean</code>, indicating whether a
- * watchpoint is a modification watchpoint.
+ * Watchpoint attribute storing the modification value (value
+ * <code>"org.eclipse.jdt.debug.core.modification"</code>). This attribute
+ * is stored as a <code>boolean</code>, indicating whether a watchpoint is a
+ * modification watchpoint.
*/
- protected static final String MODIFICATION= "org.eclipse.jdt.debug.core.modification"; //$NON-NLS-1$
+ protected static final String MODIFICATION = "org.eclipse.jdt.debug.core.modification"; //$NON-NLS-1$
/**
- * Watchpoint attribute storing the auto_disabled value (value <code>"org.eclipse.jdt.debug.core.auto_disabled"</code>).
- * This attribute is stored as a <code>boolean</code>, indicating whether a
- * watchpoint has been auto-disabled (as opposed to being disabled explicitly by the user)
+ * Watchpoint attribute storing the auto_disabled value (value
+ * <code>"org.eclipse.jdt.debug.core.auto_disabled"</code>). This attribute
+ * is stored as a <code>boolean</code>, indicating whether a watchpoint has
+ * been auto-disabled (as opposed to being disabled explicitly by the user)
*/
- protected static final String AUTO_DISABLED="org.eclipse.jdt.debug.core.auto_disabled"; //$NON-NLS-1$
+ protected static final String AUTO_DISABLED = "org.eclipse.jdt.debug.core.auto_disabled"; //$NON-NLS-1$
/**
- * Breakpoint attribute storing the name of the field
- * on which a breakpoint is set.
- * (value <code>"org.eclipse.jdt.debug.core.fieldName"</code>). This attribute is a <code>String</code>.
+ * Breakpoint attribute storing the name of the field on which a breakpoint
+ * is set. (value <code>"org.eclipse.jdt.debug.core.fieldName"</code>). This
+ * attribute is a <code>String</code>.
*/
- protected static final String FIELD_NAME= "org.eclipse.jdt.debug.core.fieldName"; //$NON-NLS-1$
+ protected static final String FIELD_NAME = "org.eclipse.jdt.debug.core.fieldName"; //$NON-NLS-1$
/**
- * Flag indicating that this breakpoint last suspended execution
- * due to a field access
+ * Flag indicating that this breakpoint last suspended execution due to a
+ * field access
*/
- protected static final Integer ACCESS_EVENT= new Integer(0);
+ protected static final Integer ACCESS_EVENT = new Integer(0);
/**
- * Flag indicating that this breakpoint last suspended execution
- * due to a field modification
- */
- protected static final Integer MODIFICATION_EVENT= new Integer(1);
+ * Flag indicating that this breakpoint last suspended execution due to a
+ * field modification
+ */
+ protected static final Integer MODIFICATION_EVENT = new Integer(1);
/**
- * Maps each debug target that is suspended for this breakpiont to reason that
- * this breakpoint suspended it. Reasons include:
+ * Maps each debug target that is suspended for this breakpiont to reason
+ * that this breakpoint suspended it. Reasons include:
* <ol>
* <li>Field access (value <code>ACCESS_EVENT</code>)</li>
* <li>Field modification (value <code>MODIFICATION_EVENT</code>)</li>
* </ol>
*/
- private HashMap fLastEventTypes= new HashMap(10);
-
+ private HashMap<JDIDebugTarget, Integer> fLastEventTypes = new HashMap<JDIDebugTarget, Integer>(10);
+
public JavaWatchpoint() {
}
/**
- * @see JDIDebugModel#createWatchpoint(IResource, String, String, int, int, int, int, boolean, Map)
+ * @see JDIDebugModel#createWatchpoint(IResource, String, String, int, int,
+ * int, int, boolean, Map)
*/
- public JavaWatchpoint(final IResource resource, final String typeName, final String fieldName, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final boolean add, final Map attributes) throws DebugException {
- IWorkspaceRunnable wr= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
+ public JavaWatchpoint(final IResource resource, final String typeName,
+ final String fieldName, final int lineNumber, final int charStart,
+ final int charEnd, final int hitCount, final boolean add,
+ final Map<String, Object> attributes) throws DebugException {
+ IWorkspaceRunnable wr = new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
setMarker(resource.createMarker(JAVA_WATCHPOINT));
-
+
// add attributes
- addLineBreakpointAttributes(attributes, getModelIdentifier(), true, lineNumber, charStart, charEnd);
+ addLineBreakpointAttributes(attributes, getModelIdentifier(),
+ true, lineNumber, charStart, charEnd);
addTypeNameAndHitCount(attributes, typeName, hitCount);
- attributes.put(SUSPEND_POLICY, new Integer(getDefaultSuspendPolicy()));
+ attributes.put(SUSPEND_POLICY, new Integer(
+ getDefaultSuspendPolicy()));
// configure the field handle
addFieldName(attributes, fieldName);
// configure the access and modification flags to defaults
- addDefaultAccessAndModification(attributes);
-
+ addDefaultAccessAndModification(attributes);
+
// set attributes
ensureMarker().setAttributes(attributes);
-
+
register(add);
}
};
run(getMarkerRule(resource), wr);
}
-
+
/**
* @see JavaBreakpoint#createRequest(JDIDebugTarget, ReferenceType)
*
- * Creates and installs an access and modification watchpoint request
- * in the given reference type, configuring the requests as appropriate
- * for this watchpoint. The requests are then enabled based on whether
- * this watchpoint is an access watchpoint, modification watchpoint, or
- * both. Finally, the requests are registered with the given target.
- */
- protected boolean createRequest(JDIDebugTarget target, ReferenceType type) throws CoreException {
+ * Creates and installs an access and modification watchpoint request
+ * in the given reference type, configuring the requests as appropriate
+ * for this watchpoint. The requests are then enabled based on whether
+ * this watchpoint is an access watchpoint, modification watchpoint, or
+ * both. Finally, the requests are registered with the given target.
+ */
+ @Override
+ protected boolean createRequest(JDIDebugTarget target, ReferenceType type)
+ throws CoreException {
if (shouldSkipBreakpoint()) {
return false;
}
- Field field= null;
-
- field= type.fieldByName(getFieldName());
+ Field field = null;
+
+ field = type.fieldByName(getFieldName());
if (field == null) {
// error
return false;
}
- AccessWatchpointRequest accessRequest= null;
- ModificationWatchpointRequest modificationRequest= null;
+ AccessWatchpointRequest accessRequest = null;
+ ModificationWatchpointRequest modificationRequest = null;
if (target.supportsAccessWatchpoints()) {
- accessRequest= createAccessWatchpoint(target, field);
+ accessRequest = createAccessWatchpoint(target, field);
registerRequest(accessRequest, target);
} else {
- notSupported(JDIDebugBreakpointMessages.JavaWatchpoint_no_access_watchpoints);
+ notSupported(JDIDebugBreakpointMessages.JavaWatchpoint_no_access_watchpoints);
}
if (target.supportsModificationWatchpoints()) {
- modificationRequest= createModificationWatchpoint(target, field);
+ modificationRequest = createModificationWatchpoint(target, field);
if (modificationRequest == null) {
return false;
- }
+ }
registerRequest(modificationRequest, target);
return true;
}
- notSupported(JDIDebugBreakpointMessages.JavaWatchpoint_no_modification_watchpoints);
+ notSupported(JDIDebugBreakpointMessages.JavaWatchpoint_no_modification_watchpoints);
return false;
}
-
+
/**
* @see JavaBreakpoint#setRequestThreadFilter(EventRequest)
*/
- protected void setRequestThreadFilter(EventRequest request, ThreadReference thread) {
- ((WatchpointRequest)request).addThreadFilter(thread);
+ @Override
+ protected void setRequestThreadFilter(EventRequest request,
+ ThreadReference thread) {
+ ((WatchpointRequest) request).addThreadFilter(thread);
}
-
+
/**
- * Either access or modification watchpoints are not supported. Throw an appropriate exception.
+ * Either access or modification watchpoints are not supported. Throw an
+ * appropriate exception.
*
- * @param message the message that states that access or modification watchpoints
- * are not supported
+ * @param message
+ * the message that states that access or modification
+ * watchpoints are not supported
*/
protected void notSupported(String message) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.NOT_SUPPORTED, message, null)); //
+ throw new DebugException(new Status(IStatus.ERROR,
+ DebugPlugin.getUniqueIdentifier(),
+ DebugException.NOT_SUPPORTED, message, null)); //
}
-
+
/**
* Create an access watchpoint for the given breakpoint and associated field
*/
- protected AccessWatchpointRequest createAccessWatchpoint(JDIDebugTarget target, Field field) throws CoreException {
+ protected AccessWatchpointRequest createAccessWatchpoint(
+ JDIDebugTarget target, Field field) throws CoreException {
return (AccessWatchpointRequest) createWatchpoint(target, field, true);
}
-
+
/**
- * Create a modification watchpoint for the given breakpoint and associated field
+ * Create a modification watchpoint for the given breakpoint and associated
+ * field
*/
- protected ModificationWatchpointRequest createModificationWatchpoint(JDIDebugTarget target, Field field) throws CoreException {
- return (ModificationWatchpointRequest) createWatchpoint(target, field, false);
- }
-
+ protected ModificationWatchpointRequest createModificationWatchpoint(
+ JDIDebugTarget target, Field field) throws CoreException {
+ return (ModificationWatchpointRequest) createWatchpoint(target, field,
+ false);
+ }
+
/**
* Create a watchpoint for the given breakpoint and associated field.
*
- * @param target the target in which the request will be installed
- * @param field the field on which the request will be set
- * @param access <code>true</code> if an access watchpoint will be
- * created. <code>false</code> if a modification watchpoint will
- * be created.
+ * @param target
+ * the target in which the request will be installed
+ * @param field
+ * the field on which the request will be set
+ * @param access
+ * <code>true</code> if an access watchpoint will be created.
+ * <code>false</code> if a modification watchpoint will be
+ * created.
*
* @return an WatchpointRequest (AccessWatchpointRequest if access is
- * <code>true</code>; ModificationWatchpointRequest if access is <code>false</code>).
+ * <code>true</code>; ModificationWatchpointRequest if access is
+ * <code>false</code>).
*/
- protected WatchpointRequest createWatchpoint(JDIDebugTarget target, Field field, boolean access) throws CoreException {
- WatchpointRequest request= null;
+ protected WatchpointRequest createWatchpoint(JDIDebugTarget target,
+ Field field, boolean access) throws CoreException {
+ WatchpointRequest request = null;
EventRequestManager manager = target.getEventRequestManager();
if (manager == null) {
- target.requestFailed(JDIDebugBreakpointMessages.JavaWatchpoint_Unable_to_create_breakpoint_request___VM_disconnected__1, null);
- }
+ target.requestFailed(
+ JDIDebugBreakpointMessages.JavaWatchpoint_Unable_to_create_breakpoint_request___VM_disconnected__1,
+ null);
+ }
try {
if (access) {
- request= manager.createAccessWatchpointRequest(field);
+ request = manager.createAccessWatchpointRequest(field);
} else {
- request= manager.createModificationWatchpointRequest(field);
+ request = manager.createModificationWatchpointRequest(field);
}
configureRequest(request, target);
} catch (VMDisconnectedException e) {
@@ -232,13 +262,14 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
/**
* @see JavaBreakpoint#recreateRequest(EventRequest, JDIDebugTarget)
*/
- protected EventRequest recreateRequest(EventRequest request, JDIDebugTarget target) throws CoreException {
- try {
- Field field= ((WatchpointRequest) request).field();
+ protected EventRequest recreateRequest(EventRequest request,
+ JDIDebugTarget target) throws CoreException {
+ try {
+ Field field = ((WatchpointRequest) request).field();
if (request instanceof AccessWatchpointRequest) {
- request= createAccessWatchpoint(target, field);
+ request = createAccessWatchpoint(target, field);
} else if (request instanceof ModificationWatchpointRequest) {
- request= createModificationWatchpoint(target, field);
+ request = createModificationWatchpoint(target, field);
}
} catch (VMDisconnectedException e) {
if (!target.isAvailable()) {
@@ -247,7 +278,7 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
target.internalError(e);
return request;
} catch (RuntimeException e) {
- target.internalError(e);
+ target.internalError(e);
}
return request;
}
@@ -255,11 +286,11 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
/**
* @see IBreakpoint#setEnabled(boolean)
*
- * If the watchpoint is not watching access or modification,
- * set the default values. If this isn't done, the resulting
- * state (enabled with access and modification both disabled)
- * is ambiguous.
+ * If the watchpoint is not watching access or modification, set the
+ * default values. If this isn't done, the resulting state (enabled
+ * with access and modification both disabled) is ambiguous.
*/
+ @Override
public void setEnabled(boolean enabled) throws CoreException {
if (enabled) {
if (!(isAccess() || isModification())) {
@@ -268,29 +299,31 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
}
super.setEnabled(enabled);
}
-
+
/**
* @see org.eclipse.debug.core.model.IWatchpoint#isAccess()
*/
public boolean isAccess() throws CoreException {
return ensureMarker().getAttribute(ACCESS, false);
}
-
+
/**
* Sets whether this breakpoint will suspend execution when its associated
- * field is accessed. If true and this watchpoint is disabled, this watchpoint
- * is automatically enabled. If both access and modification are false,
- * this watchpoint is automatically disabled.
+ * field is accessed. If true and this watchpoint is disabled, this
+ * watchpoint is automatically enabled. If both access and modification are
+ * false, this watchpoint is automatically disabled.
*
- * @param access whether to suspend on field access
- * @exception CoreException if unable to set the property
- * on this breakpoint's underlying marker
+ * @param access
+ * whether to suspend on field access
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
* @see org.eclipse.debug.core.model.IWatchpoint#setAccess(boolean)
*/
public void setAccess(boolean access) throws CoreException {
if (access == isAccess()) {
return;
- }
+ }
setAttribute(ACCESS, access);
if (access && !isEnabled()) {
setEnabled(true);
@@ -299,23 +332,25 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
}
recreate();
}
-
+
/**
* @see org.eclipse.debug.core.model.IWatchpoint#isModification()
- */
+ */
public boolean isModification() throws CoreException {
return ensureMarker().getAttribute(MODIFICATION, false);
}
-
+
/**
* Sets whether this breakpoint will suspend execution when its associated
- * field is modified. If true and this watchpoint is disabled, this watchpoint
- * is automatically enabled. If both access and modification are false,
- * this watchpoint is automatically disabled.
+ * field is modified. If true and this watchpoint is disabled, this
+ * watchpoint is automatically enabled. If both access and modification are
+ * false, this watchpoint is automatically disabled.
*
- * @param modification whether to suspend on field modification
- * @exception CoreException if unable to set the property on
- * this breakpoint's underlying marker
+ * @param modification
+ * whether to suspend on field modification
+ * @exception CoreException
+ * if unable to set the property on this breakpoint's
+ * underlying marker
* @see org.eclipse.debug.core.model.IWatchpoint#setModification(boolean)
*/
public void setModification(boolean modification) throws CoreException {
@@ -330,7 +365,7 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
}
recreate();
}
-
+
/**
* Sets the default access and modification attributes of the watchpoint.
* The default values are:
@@ -343,65 +378,72 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
boolean[] def = getDefaultAccessAndModificationValues();
Object[] values = new Object[def.length];
for (int i = 0; i < def.length; i++) {
- values[i] = new Boolean(def[i]);
+ values[i] = new Boolean(def[i]);
}
- String[] attributes = new String[]{ACCESS, MODIFICATION};
+ String[] attributes = new String[] { ACCESS, MODIFICATION };
setAttributes(attributes, values);
}
/**
- * Returns the default access and modification suspend option for a new watchpoint based on the user preference settings
- * The return array will only ever contain two values, where the possibilities are:
+ * Returns the default access and modification suspend option for a new
+ * watchpoint based on the user preference settings The return array will
+ * only ever contain two values, where the possibilities are:
* <ul>
* <li> <code>{true, true}</code> - both access and modification are enabled</li>
- * <li> <code>{true, false}</code> - access is enabled and modification is disabled</li>
- * <li> <code>{false, true}</code> -access is disabled and modification is enabled</li>
+ * <li> <code>{true, false}</code> - access is enabled and modification is
+ * disabled</li>
+ * <li> <code>{false, true}</code> -access is disabled and modification is
+ * enabled</li>
* </ul>
* The default returned array is <code>{true, true}</code>
- * @return an array of two boolean values representing the default access and modification settings
+ *
+ * @return an array of two boolean values representing the default access
+ * and modification settings
*
* @since 3.3.1
*/
protected boolean[] getDefaultAccessAndModificationValues() {
- int value = JDIDebugPlugin.getDefault().getPluginPreferences().getInt(JDIDebugPlugin.PREF_DEFAULT_WATCHPOINT_SUSPEND_POLICY);
- switch(value) {
- case 0: {
- return new boolean[] {true, true};
- }
- case 1: {
- return new boolean[] {true, false};
- }
- case 2: {
- return new boolean[] {false, true};
- }
- default: {
- return new boolean[] {true, true};
- }
+ int value = JDIDebugPlugin.getDefault().getPluginPreferences()
+ .getInt(JDIDebugPlugin.PREF_DEFAULT_WATCHPOINT_SUSPEND_POLICY);
+ switch (value) {
+ case 0: {
+ return new boolean[] { true, true };
+ }
+ case 1: {
+ return new boolean[] { true, false };
+ }
+ case 2: {
+ return new boolean[] { false, true };
+ }
+ default: {
+ return new boolean[] { true, true };
+ }
}
}
/**
- * Adds the default access and modification attributes of
- * the watchpoint to the given map
+ * Adds the default access and modification attributes of the watchpoint to
+ * the given map
* <ul>
* <li>access = true
* <li>modification = true
* <li>auto disabled = false
* <ul>
*/
- protected void addDefaultAccessAndModification(Map attributes) {
+ protected void addDefaultAccessAndModification(Map<String, Object> attributes) {
boolean[] values = getDefaultAccessAndModificationValues();
attributes.put(ACCESS, (values[0] ? Boolean.TRUE : Boolean.FALSE));
- attributes.put(MODIFICATION, (values[1] ? Boolean.TRUE : Boolean.FALSE));
+ attributes
+ .put(MODIFICATION, (values[1] ? Boolean.TRUE : Boolean.FALSE));
attributes.put(AUTO_DISABLED, Boolean.FALSE);
}
-
+
/**
* Adds the field name to the given attribute map
*/
- protected void addFieldName(Map attributes, String fieldName) {
+ protected void addFieldName(Map<String, Object> attributes, String fieldName) {
attributes.put(FIELD_NAME, fieldName);
- }
+ }
/**
* @see IJavaWatchpoint#getFieldName()
@@ -409,29 +451,32 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
public String getFieldName() throws CoreException {
return ensureMarker().getAttribute(FIELD_NAME, null);
}
-
+
/**
- * Store the type of the event, then handle it as specified in
- * the superclass. This is useful for correctly generating the
- * thread text when asked (assumes thread text is requested after
- * the event is passed to this breakpoint.
+ * Store the type of the event, then handle it as specified in the
+ * superclass. This is useful for correctly generating the thread text when
+ * asked (assumes thread text is requested after the event is passed to this
+ * breakpoint.
*
* Also, @see JavaBreakpoint#handleEvent(Event, JDIDebugTarget)
*/
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
+ @Override
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet) {
if (event instanceof AccessWatchpointEvent) {
fLastEventTypes.put(target, ACCESS_EVENT);
} else if (event instanceof ModificationWatchpointEvent) {
fLastEventTypes.put(target, MODIFICATION_EVENT);
}
return super.handleEvent(event, target, suspendVote, eventSet);
- }
-
-
+ }
+
/**
* @see JavaBreakpoint#updateEnabledState(EventRequest, JDIDebugTarget)
*/
- protected void updateEnabledState(EventRequest request, JDIDebugTarget target) throws CoreException {
+ @Override
+ protected void updateEnabledState(EventRequest request,
+ JDIDebugTarget target) throws CoreException {
boolean enabled = isEnabled();
if (request instanceof AccessWatchpointRequest) {
if (isAccess()) {
@@ -456,20 +501,22 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
}
}
}
-
+
/**
* @see IJavaWatchpoint#isAccessSuspend(IDebugTarget)
*/
public boolean isAccessSuspend(IDebugTarget target) {
- Integer lastEventType= (Integer) fLastEventTypes.get(target);
+ Integer lastEventType = fLastEventTypes.get(target);
if (lastEventType == null) {
return false;
}
return lastEventType.equals(ACCESS_EVENT);
}
+
/**
* @see IJavaLineBreakpoint#supportsCondition()
*/
+ @Override
public boolean supportsCondition() {
return false;
}
@@ -477,47 +524,61 @@ public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoin
/**
* @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#removeFromTarget(JDIDebugTarget)
*/
+ @Override
public void removeFromTarget(JDIDebugTarget target) throws CoreException {
fLastEventTypes.remove(target);
super.removeFromTarget(target);
}
-
+
/**
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(EventRequest, ObjectReference)
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#addInstanceFilter(EventRequest,
+ * ObjectReference)
*/
- protected void addInstanceFilter(EventRequest request, ObjectReference object) {
+ @Override
+ protected void addInstanceFilter(EventRequest request,
+ ObjectReference object) {
if (request instanceof WatchpointRequest) {
- ((WatchpointRequest)request).addInstanceFilter(object);
+ ((WatchpointRequest) request).addInstanceFilter(object);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#supportsAccess()
- */
- public boolean supportsAccess() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IWatchpoint#supportsModification()
- */
- public boolean supportsModification() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#installableReferenceType(com.sun.jdi.ReferenceType, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
- */
- protected boolean installableReferenceType(ReferenceType type, JDIDebugTarget target) throws CoreException {
- String installableType= getTypeName();
- String queriedType= type.name();
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.core.model.IWatchpoint#supportsAccess()
+ */
+ public boolean supportsAccess() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.core.model.IWatchpoint#supportsModification()
+ */
+ public boolean supportsModification() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#
+ * installableReferenceType(com.sun.jdi.ReferenceType,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget)
+ */
+ @Override
+ protected boolean installableReferenceType(ReferenceType type,
+ JDIDebugTarget target) throws CoreException {
+ String installableType = getTypeName();
+ String queriedType = type.name();
if (installableType == null || queriedType == null) {
return false;
}
if (installableType.equals(queriedType)) {
return queryInstallListeners(target, type);
}
-
+
return false;
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java
index 32b31bc73..89edac815 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java
@@ -110,16 +110,17 @@ import org.eclipse.jdt.core.dom.WhileStatement;
import org.eclipse.jdt.core.dom.WildcardType;
/**
- * Compute a valid location where to put a breakpoint from an JDOM CompilationUnit.
- * The result is the first valid location with a line number greater or equals than the given position.
+ * Compute a valid location where to put a breakpoint from an JDOM
+ * CompilationUnit. The result is the first valid location with a line number
+ * greater or equals than the given position.
*/
public class ValidBreakpointLocationLocator extends ASTVisitor {
-
- public static final int LOCATION_NOT_FOUND= 0;
- public static final int LOCATION_LINE= 1;
- public static final int LOCATION_METHOD= 2;
- public static final int LOCATION_FIELD= 3;
-
+
+ public static final int LOCATION_NOT_FOUND = 0;
+ public static final int LOCATION_LINE = 1;
+ public static final int LOCATION_METHOD = 2;
+ public static final int LOCATION_FIELD = 3;
+
private CompilationUnit fCompilationUnit;
private int fLineNumber;
private boolean fBindingsResolved;
@@ -131,50 +132,60 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
private String fTypeName;
private int fLineLocation;
private int fMemberOffset;
- private List fLabels;
+ private List<String> fLabels;
/**
- * @param compilationUnit the JDOM CompilationUnit of the source code.
- * @param lineNumber the line number in the source code where to put the breakpoint.
- * @param bestMatch if <code>true</code> look for the best match, otherwise look only for a valid line
+ * @param compilationUnit
+ * the JDOM CompilationUnit of the source code.
+ * @param lineNumber
+ * the line number in the source code where to put the
+ * breakpoint.
+ * @param bestMatch
+ * if <code>true</code> look for the best match, otherwise look
+ * only for a valid line
*/
- public ValidBreakpointLocationLocator(CompilationUnit compilationUnit, int lineNumber, boolean bindingsResolved, boolean bestMatch) {
- fCompilationUnit= compilationUnit;
- fLineNumber= lineNumber;
- fBindingsResolved= bindingsResolved;
- fBestMatch= bestMatch;
- fLocationFound= false;
+ public ValidBreakpointLocationLocator(CompilationUnit compilationUnit,
+ int lineNumber, boolean bindingsResolved, boolean bestMatch) {
+ fCompilationUnit = compilationUnit;
+ fLineNumber = lineNumber;
+ fBindingsResolved = bindingsResolved;
+ fBestMatch = bestMatch;
+ fLocationFound = false;
}
-
+
/**
- * Returns whether binding information would be helpful in validating a breakpoint
- * location. If this locator makes a pass of the tree and determines that binding
- * information would be helpful but was not available, this method returns
- * <code>true</code>.
+ * Returns whether binding information would be helpful in validating a
+ * breakpoint location. If this locator makes a pass of the tree and
+ * determines that binding information would be helpful but was not
+ * available, this method returns <code>true</code>.
*
- * @return whether binding information would be helpful in validating a breakpoint location
+ * @return whether binding information would be helpful in validating a
+ * breakpoint location
*/
public boolean isBindingsRequired() {
return fNeedBindings;
}
-
+
/**
* Return the type of the valid location found
- * @return one of LOCATION_NOT_FOUND, LOCATION_LINE, LOCATION_METHOD or LOCATION_FIELD
+ *
+ * @return one of LOCATION_NOT_FOUND, LOCATION_LINE, LOCATION_METHOD or
+ * LOCATION_FIELD
*/
public int getLocationType() {
return fLocationType;
}
-
+
/**
* Return of the type where the valid location is.
*/
public String getFullyQualifiedTypeName() {
return fTypeName;
}
-
+
/**
- * Return the line number of the computed valid location, if the location type is LOCATION_LINE.
+ * Return the line number of the computed valid location, if the location
+ * type is LOCATION_LINE.
*/
public int getLineLocation() {
if (fLocationType == LOCATION_LINE) {
@@ -182,19 +193,21 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
}
return -1;
}
-
+
/**
- * Return the offset of the member which is the valid location,
- * if the location type is LOCATION_METHOD or LOCATION_FIELD.
+ * Return the offset of the member which is the valid location, if the
+ * location type is LOCATION_METHOD or LOCATION_FIELD.
*/
public int getMemberOffset() {
return fMemberOffset;
}
-
+
/**
- * Compute the name of the type which contains this node.
- * <br><br>
- * Delegates to the old method of computing the type name if bindings are not available.
+ * Compute the name of the type which contains this node. <br>
+ * <br>
+ * Delegates to the old method of computing the type name if bindings are
+ * not available.
+ *
* @see #computeTypeName0(ASTNode)
* @since 3.6
*/
@@ -207,9 +220,9 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
}
node = node.getParent();
}
- if(type != null) {
+ if (type != null) {
ITypeBinding binding = type.resolveBinding();
- if(binding != null) {
+ if (binding != null) {
return binding.getBinaryName();
}
}
@@ -218,6 +231,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* Fall back to compute the type name if bindings are not resolved
+ *
* @param node
* @return the computed type name
*/
@@ -225,35 +239,42 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
String typeName = null;
while (!(node instanceof CompilationUnit)) {
if (node instanceof AbstractTypeDeclaration) {
- String identifier= ((AbstractTypeDeclaration)node).getName().getIdentifier();
+ String identifier = ((AbstractTypeDeclaration) node).getName()
+ .getIdentifier();
if (typeName == null) {
- typeName= identifier;
+ typeName = identifier;
} else {
- typeName= identifier + "$" + typeName; //$NON-NLS-1$
+ typeName = identifier + "$" + typeName; //$NON-NLS-1$
}
}
- node= node.getParent();
+ node = node.getParent();
}
- PackageDeclaration packageDecl= ((CompilationUnit)node).getPackage();
- String packageIdentifier= ""; //$NON-NLS-1$
+ PackageDeclaration packageDecl = ((CompilationUnit) node).getPackage();
+ String packageIdentifier = ""; //$NON-NLS-1$
if (packageDecl != null) {
- Name packageName= packageDecl.getName();
+ Name packageName = packageDecl.getName();
while (packageName.isQualifiedName()) {
- QualifiedName qualifiedName= (QualifiedName) packageName;
- packageIdentifier= qualifiedName.getName().getIdentifier() + "." + packageIdentifier; //$NON-NLS-1$
- packageName= qualifiedName.getQualifier();
+ QualifiedName qualifiedName = (QualifiedName) packageName;
+ packageIdentifier = qualifiedName.getName().getIdentifier()
+ + "." + packageIdentifier; //$NON-NLS-1$
+ packageName = qualifiedName.getQualifier();
}
- packageIdentifier= ((SimpleName)packageName).getIdentifier() + "." + packageIdentifier; //$NON-NLS-1$
+ packageIdentifier = ((SimpleName) packageName).getIdentifier()
+ + "." + packageIdentifier; //$NON-NLS-1$
}
return packageIdentifier + typeName;
}
-
+
/**
- * Return <code>true</code> if this node children may contain a valid location
- * for the breakpoint.
- * @param node the node.
- * @param isCode true indicated that the first line of the given node always
- * contains some executable code, even if split in multiple lines.
+ * Return <code>true</code> if this node children may contain a valid
+ * location for the breakpoint.
+ *
+ * @param node
+ * the node.
+ * @param isCode
+ * true indicated that the first line of the given node always
+ * contains some executable code, even if split in multiple
+ * lines.
*/
private boolean visit(ASTNode node, boolean isCode) {
// if we already found a correct location
@@ -261,134 +282,149 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
if (fLocationFound) {
return false;
}
- int startPosition= node.getStartPosition();
- int endLine= lineNumber(startPosition + node.getLength() - 1);
+ int startPosition = node.getStartPosition();
+ int endLine = lineNumber(startPosition + node.getLength() - 1);
// if the position is not in this part of the code
// no need to check the element inside.
if (endLine < fLineNumber) {
return false;
}
- // if the first line of this node always represents some executable code and the
- // breakpoint is requested on this line or on a previous line, this is a valid
+ // if the first line of this node always represents some executable code
+ // and the
+ // breakpoint is requested on this line or on a previous line, this is a
+ // valid
// location
int startLine = lineNumber(startPosition);
if (isCode && (fLineNumber <= startLine)) {
- fLineLocation= startLine;
- fLocationFound= true;
- fLocationType= LOCATION_LINE;
- fTypeName= computeTypeName(node);
+ fLineLocation = startLine;
+ fLocationFound = true;
+ fLocationType = LOCATION_LINE;
+ fTypeName = computeTypeName(node);
return false;
}
return true;
}
-
+
private boolean isReplacedByConstantValue(Expression node) {
switch (node.getNodeType()) {
- // literals are constant
- case ASTNode.BOOLEAN_LITERAL:
- case ASTNode.CHARACTER_LITERAL:
- case ASTNode.NUMBER_LITERAL:
- case ASTNode.STRING_LITERAL:
- return true;
- case ASTNode.SIMPLE_NAME:
- case ASTNode.QUALIFIED_NAME:
- return isReplacedByConstantValue((Name)node);
- case ASTNode.FIELD_ACCESS:
- return isReplacedByConstantValue((FieldAccess)node);
- case ASTNode.SUPER_FIELD_ACCESS:
- return isReplacedByConstantValue((SuperFieldAccess)node);
- case ASTNode.INFIX_EXPRESSION:
- return isReplacedByConstantValue((InfixExpression)node);
- case ASTNode.PREFIX_EXPRESSION:
- return isReplacedByConstantValue((PrefixExpression)node);
- case ASTNode.CAST_EXPRESSION:
- return isReplacedByConstantValue(((CastExpression)node).getExpression());
- default:
- return false;
+ // literals are constant
+ case ASTNode.BOOLEAN_LITERAL:
+ case ASTNode.CHARACTER_LITERAL:
+ case ASTNode.NUMBER_LITERAL:
+ case ASTNode.STRING_LITERAL:
+ return true;
+ case ASTNode.SIMPLE_NAME:
+ case ASTNode.QUALIFIED_NAME:
+ return isReplacedByConstantValue((Name) node);
+ case ASTNode.FIELD_ACCESS:
+ return isReplacedByConstantValue((FieldAccess) node);
+ case ASTNode.SUPER_FIELD_ACCESS:
+ return isReplacedByConstantValue((SuperFieldAccess) node);
+ case ASTNode.INFIX_EXPRESSION:
+ return isReplacedByConstantValue((InfixExpression) node);
+ case ASTNode.PREFIX_EXPRESSION:
+ return isReplacedByConstantValue((PrefixExpression) node);
+ case ASTNode.CAST_EXPRESSION:
+ return isReplacedByConstantValue(((CastExpression) node)
+ .getExpression());
+ default:
+ return false;
}
}
-
+
private boolean isReplacedByConstantValue(InfixExpression node) {
- // if all operands are constant value, the expression is replaced by a constant value
- if (!(isReplacedByConstantValue(node.getLeftOperand()) && isReplacedByConstantValue(node.getRightOperand()))) {
+ // if all operands are constant value, the expression is replaced by a
+ // constant value
+ if (!(isReplacedByConstantValue(node.getLeftOperand()) && isReplacedByConstantValue(node
+ .getRightOperand()))) {
return false;
}
if (node.hasExtendedOperands()) {
- for (Iterator iter = node.extendedOperands().iterator(); iter.hasNext(); ) {
- if (!isReplacedByConstantValue((Expression) iter.next())) {
+ for (Iterator<? extends Expression> iter = node.extendedOperands().iterator(); iter.hasNext();) {
+ if (!isReplacedByConstantValue(iter.next())) {
return false;
}
}
}
return true;
}
-
+
private boolean isReplacedByConstantValue(PrefixExpression node) {
// for '-', '+', '~' and '!', if the operand is a constant value,
// the expression is replaced by a constant value
Operator operator = node.getOperator();
- if (operator != PrefixExpression.Operator.INCREMENT && operator != PrefixExpression.Operator.DECREMENT) {
+ if (operator != PrefixExpression.Operator.INCREMENT
+ && operator != PrefixExpression.Operator.DECREMENT) {
return isReplacedByConstantValue(node.getOperand());
}
return false;
}
-
+
private boolean isReplacedByConstantValue(Name node) {
if (!fBindingsResolved) {
fNeedBindings = true;
return false;
}
// if node is a variable with a constant value (static final field)
- IBinding binding= node.resolveBinding();
+ IBinding binding = node.resolveBinding();
if (binding != null && binding.getKind() == IBinding.VARIABLE) {
- return ((IVariableBinding)binding).getConstantValue() != null;
+ return ((IVariableBinding) binding).getConstantValue() != null;
}
return false;
}
-
+
private boolean isReplacedByConstantValue(FieldAccess node) {
if (!fBindingsResolved) {
fNeedBindings = true;
return false;
}
// if the node is 'this.<field>', and the field is static final
- Expression expression= node.getExpression();
- IVariableBinding binding= node.resolveFieldBinding();
- if (binding != null && expression.getNodeType() == ASTNode.THIS_EXPRESSION) {
+ Expression expression = node.getExpression();
+ IVariableBinding binding = node.resolveFieldBinding();
+ if (binding != null
+ && expression.getNodeType() == ASTNode.THIS_EXPRESSION) {
return binding.getConstantValue() != null;
}
return false;
}
-
+
private boolean isReplacedByConstantValue(SuperFieldAccess node) {
if (!fBindingsResolved) {
fNeedBindings = true;
return false;
}
// if the field is static final
- IVariableBinding binding= node.resolveFieldBinding();
+ IVariableBinding binding = node.resolveFieldBinding();
if (binding != null) {
return binding.getConstantValue() != null;
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * AnnotationTypeDeclaration)
*/
+ @Override
public boolean visit(AnnotationTypeDeclaration node) {
if (visit(node, false)) {
- List bodyDeclaration= node.bodyDeclarations();
- for (Iterator iter= bodyDeclaration.iterator(); iter.hasNext();) {
- ((BodyDeclaration)iter.next()).accept(this);
+ List<BodyDeclaration> decls = node.bodyDeclarations();
+ for(BodyDeclaration decl : decls) {
+ decl.accept(this);
}
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * AnnotationTypeMemberDeclaration)
*/
+ @Override
public boolean visit(AnnotationTypeMemberDeclaration node) {
return false;
}
@@ -396,6 +432,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnonymousClassDeclaration)
*/
+ @Override
public boolean visit(AnonymousClassDeclaration node) {
return visit(node, false);
}
@@ -403,6 +440,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayAccess)
*/
+ @Override
public boolean visit(ArrayAccess node) {
return visit(node, true);
}
@@ -410,6 +448,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayCreation)
*/
+ @Override
public boolean visit(ArrayCreation node) {
return visit(node, node.getInitializer() == null);
}
@@ -417,6 +456,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayInitializer)
*/
+ @Override
public boolean visit(ArrayInitializer node) {
return visit(node, true);
}
@@ -424,6 +464,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayType)
*/
+ @Override
public boolean visit(ArrayType node) {
return false;
}
@@ -431,6 +472,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AssertStatement)
*/
+ @Override
public boolean visit(AssertStatement node) {
return visit(node, true);
}
@@ -438,20 +480,26 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Assignment)
*/
+ @Override
public boolean visit(Assignment node) {
if (visit(node, false)) {
- // if the left hand side represent a local variable, or a static field
+ // if the left hand side represent a local variable, or a static
+ // field
// and the breakpoint was requested on a line before the line where
- // starts the assigment, set the location to be the first executable
- // instruction of the right hand side, as it will be the first part of
- // this assigment to be executed
- Expression leftHandSide= node.getLeftHandSide();
+ // starts the assignment, set the location to be the first executable
+ // instruction of the right hand side, as it will be the first part
+ // of
+ // this assignment to be executed
+ Expression leftHandSide = node.getLeftHandSide();
if (leftHandSide instanceof Name) {
int startLine = lineNumber(node.getStartPosition());
if (fLineNumber < startLine) {
if (fBindingsResolved) {
- IVariableBinding binding= (IVariableBinding)((Name)leftHandSide).resolveBinding();
- if (binding != null && (!binding.isField() || Modifier.isStatic(binding.getModifiers()))) {
+ IVariableBinding binding = (IVariableBinding) ((Name) leftHandSide)
+ .resolveBinding();
+ if (binding != null
+ && (!binding.isField() || Modifier
+ .isStatic(binding.getModifiers()))) {
node.getRightHandSide().accept(this);
}
} else {
@@ -467,14 +515,18 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Block)
*/
+ @Override
public boolean visit(Block node) {
if (visit(node, false)) {
- if (node.statements().isEmpty() && node.getParent().getNodeType() == ASTNode.METHOD_DECLARATION) {
- // in case of an empty method, set the breakpoint on the last line of the empty block.
- fLineLocation= lineNumber(node.getStartPosition() + node.getLength() - 1);
- fLocationFound= true;
- fLocationType= LOCATION_LINE;
- fTypeName= computeTypeName(node);
+ if (node.statements().isEmpty()
+ && node.getParent().getNodeType() == ASTNode.METHOD_DECLARATION) {
+ // in case of an empty method, set the breakpoint on the last
+ // line of the empty block.
+ fLineLocation = lineNumber(node.getStartPosition()
+ + node.getLength() - 1);
+ fLocationFound = true;
+ fLocationType = LOCATION_LINE;
+ fTypeName = computeTypeName(node);
return false;
}
return true;
@@ -482,16 +534,21 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BlockComment)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * BlockComment)
*/
+ @Override
public boolean visit(BlockComment node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BooleanLiteral)
*/
+ @Override
public boolean visit(BooleanLiteral node) {
return visit(node, true);
}
@@ -499,6 +556,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BreakStatement)
*/
+ @Override
public boolean visit(BreakStatement node) {
return visit(node, true);
}
@@ -506,6 +564,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CastExpression)
*/
+ @Override
public boolean visit(CastExpression node) {
return visit(node, true);
}
@@ -513,6 +572,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CatchClause)
*/
+ @Override
public boolean visit(CatchClause node) {
return visit(node, false);
}
@@ -520,6 +580,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CharacterLiteral)
*/
+ @Override
public boolean visit(CharacterLiteral node) {
return visit(node, true);
}
@@ -527,6 +588,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ClassInstanceCreation)
*/
+ @Override
public boolean visit(ClassInstanceCreation node) {
return visit(node, true);
}
@@ -534,6 +596,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CompilationUnit)
*/
+ @Override
public boolean visit(CompilationUnit node) {
return visit(node, false);
}
@@ -541,6 +604,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ConditionalExpression)
*/
+ @Override
public boolean visit(ConditionalExpression node) {
return visit(node, true);
}
@@ -548,6 +612,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ConstructorInvocation)
*/
+ @Override
public boolean visit(ConstructorInvocation node) {
return visit(node, true);
}
@@ -555,6 +620,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ContinueStatement)
*/
+ @Override
public boolean visit(ContinueStatement node) {
return visit(node, true);
}
@@ -562,6 +628,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.DoStatement)
*/
+ @Override
public boolean visit(DoStatement node) {
return visit(node, false);
}
@@ -569,13 +636,18 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EmptyStatement)
*/
+ @Override
public boolean visit(EmptyStatement node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnhancedForStatement)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnhancedForStatement)
*/
+ @Override
public boolean visit(EnhancedForStatement node) {
if (visit(node, false)) {
node.getExpression().accept(this);
@@ -583,44 +655,53 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
}
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumConstantDeclaration)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnumConstantDeclaration)
*/
+ @Override
public boolean visit(EnumConstantDeclaration node) {
if (visit(node, false)) {
- List arguments= node.arguments();
- for (Iterator iter= arguments.iterator(); iter.hasNext();) {
- ((Expression)iter.next()).accept(this);
+ List<Expression> arguments = node.arguments();
+ for(Expression exp : arguments) {
+ exp.accept(this);
}
- AnonymousClassDeclaration decl= node.getAnonymousClassDeclaration();
+ AnonymousClassDeclaration decl = node.getAnonymousClassDeclaration();
if (decl != null) {
decl.accept(this);
}
}
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumDeclaration)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * EnumDeclaration)
*/
+ @Override
public boolean visit(EnumDeclaration node) {
if (visit(node, false)) {
- List enumConstants= node.enumConstants();
- for (Iterator iter = enumConstants.iterator(); iter.hasNext();) {
- ((EnumConstantDeclaration) iter.next()).accept(this);
+ List<EnumConstantDeclaration> enumConstants = node.enumConstants();
+ for(EnumConstantDeclaration econst : enumConstants) {
+ econst.accept(this);
}
- List bodyDeclaration= node.bodyDeclarations();
- for (Iterator iter= bodyDeclaration.iterator(); iter.hasNext();) {
- ((BodyDeclaration)iter.next()).accept(this);
+ List<BodyDeclaration> decls = node.bodyDeclarations();
+ for(BodyDeclaration body : decls) {
+ body.accept(this);
}
}
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ExpressionStatement)
*/
+ @Override
public boolean visit(ExpressionStatement node) {
return visit(node, false);
}
@@ -628,6 +709,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldAccess)
*/
+ @Override
public boolean visit(FieldAccess node) {
return visit(node, false);
}
@@ -635,26 +717,29 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldDeclaration)
*/
+ @Override
public boolean visit(FieldDeclaration node) {
if (visit(node, false)) {
if (fBestMatch) {
// check if the line contains a single field declaration.
- List fragments = node.fragments();
+ List<VariableDeclarationFragment> fragments = node.fragments();
if (fragments.size() == 1) {
- int offset= ((VariableDeclarationFragment)fragments.get(0)).getName().getStartPosition();
- // check if the breakpoint is to be set on the line which contains the name of the field
+ int offset = fragments.get(0).getName().getStartPosition();
+ // check if the breakpoint is to be set on the line which
+ // contains the name of the field
if (lineNumber(offset) == fLineNumber) {
- fMemberOffset= offset;
- fLocationType= LOCATION_FIELD;
- fLocationFound= true;
+ fMemberOffset = offset;
+ fLocationType = LOCATION_FIELD;
+ fLocationFound = true;
return false;
}
}
}
- // visit only the variable declaration fragments, no the variable names.
- List fragments= node.fragments();
- for (Iterator iter= fragments.iterator(); iter.hasNext();) {
- ((VariableDeclarationFragment)iter.next()).accept(this);
+ // visit only the variable declaration fragments, no the variable
+ // names.
+ List<VariableDeclarationFragment> fragments = node.fragments();
+ for(VariableDeclarationFragment frag : fragments) {
+ frag.accept(this);
}
}
return false;
@@ -663,14 +748,19 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ForStatement)
*/
+ @Override
public boolean visit(ForStatement node) {
- // in case on a "for(;;)", the breakpoint can be set on the first token of the node.
- return visit(node, node.initializers().isEmpty() && node.getExpression() == null && node.updaters().isEmpty());
+ // in case on a "for(;;)", the breakpoint can be set on the first token
+ // of the node.
+ return visit(node,
+ node.initializers().isEmpty() && node.getExpression() == null
+ && node.updaters().isEmpty());
}
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.IfStatement)
*/
+ @Override
public boolean visit(IfStatement node) {
return visit(node, false);
}
@@ -678,6 +768,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ImportDeclaration)
*/
+ @Override
public boolean visit(ImportDeclaration node) {
return false;
}
@@ -685,62 +776,65 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.InfixExpression)
*/
+ @Override
public boolean visit(InfixExpression node) {
- // if the breakpoint is to be set on a constant operand, the breakpoint needs to be
- // set on the first constant operand after the previous non-constant operand
- // (or the beginning of the expression, if there is no non-constant operand before).
- // ex: foo() + // previous non-constant operand
- // 1 + // breakpoint set here
- // 2 // breakpoint asked to be set here
+ // if the breakpoint is to be set on a constant operand, the breakpoint
+ // needs to be
+ // set on the first constant operand after the previous non-constant
+ // operand
+ // (or the beginning of the expression, if there is no non-constant
+ // operand before).
+ // ex: foo() + // previous non-constant operand
+ // 1 + // breakpoint set here
+ // 2 // breakpoint asked to be set here
if (visit(node, false)) {
- Expression leftOperand= node.getLeftOperand();
- Expression firstConstant= null;
+ Expression leftOperand = node.getLeftOperand();
+ Expression firstConstant = null;
if (visit(leftOperand, false)) {
leftOperand.accept(this);
return false;
- }
+ }
if (isReplacedByConstantValue(leftOperand)) {
- firstConstant= leftOperand;
+ firstConstant = leftOperand;
}
- Expression rightOperand= node.getRightOperand();
+ Expression rightOperand = node.getRightOperand();
if (visit(rightOperand, false)) {
- if (firstConstant == null || !isReplacedByConstantValue(rightOperand)) {
+ if (firstConstant == null
+ || !isReplacedByConstantValue(rightOperand)) {
rightOperand.accept(this);
return false;
}
} else {
if (isReplacedByConstantValue(rightOperand)) {
if (firstConstant == null) {
- firstConstant= rightOperand;
+ firstConstant = rightOperand;
}
} else {
- firstConstant= null;
+ firstConstant = null;
}
- List extendedOperands= node.extendedOperands();
- for (Iterator iter= extendedOperands.iterator(); iter.hasNext();) {
- Expression operand= (Expression) iter.next();
- if (visit(operand, false)) {
- if (firstConstant == null || !isReplacedByConstantValue(operand)) {
- operand.accept(this);
+ List<Expression> extendedOperands = node.extendedOperands();
+ for(Expression exp : extendedOperands) {
+ if (visit(exp, false)) {
+ if (firstConstant == null || !isReplacedByConstantValue(exp)) {
+ exp.accept(this);
return false;
}
break;
- }
- if (isReplacedByConstantValue(operand)) {
+ }
+ if (isReplacedByConstantValue(exp)) {
if (firstConstant == null) {
- firstConstant= operand;
+ firstConstant = exp;
}
} else {
- firstConstant= null;
+ firstConstant = null;
}
-
}
}
- if(firstConstant != null){
- fLineLocation= lineNumber(firstConstant.getStartPosition());
- fLocationFound= true;
- fLocationType= LOCATION_LINE;
- fTypeName= computeTypeName(firstConstant);
+ if (firstConstant != null) {
+ fLineLocation = lineNumber(firstConstant.getStartPosition());
+ fLocationFound = true;
+ fLocationType = LOCATION_LINE;
+ fTypeName = computeTypeName(firstConstant);
}
}
return false;
@@ -749,6 +843,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Initializer)
*/
+ @Override
public boolean visit(Initializer node) {
return visit(node, false);
}
@@ -756,6 +851,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.InstanceofExpression)
*/
+ @Override
public boolean visit(InstanceofExpression node) {
return visit(node, true);
}
@@ -763,6 +859,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Javadoc)
*/
+ @Override
public boolean visit(Javadoc node) {
return false;
}
@@ -770,80 +867,104 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.LabeledStatement)
*/
+ @Override
public boolean visit(LabeledStatement node) {
- nestLabel(node.getLabel().getFullyQualifiedName());
+ nestLabel(node.getLabel().getFullyQualifiedName());
return visit(node, false);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.LabeledStatement)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom
+ * .LabeledStatement)
*/
+ @Override
public void endVisit(LabeledStatement node) {
- popLabel();
- super.endVisit(node);
- }
-
- private String getLabel() {
- if (fLabels == null || fLabels.isEmpty()) {
- return null;
- }
- return (String) fLabels.get(fLabels.size() - 1);
- }
-
- private void nestLabel(String label) {
- if (fLabels == null) {
- fLabels = new ArrayList();
- }
- fLabels.add(label);
- }
-
- private void popLabel() {
- if (fLabels == null || fLabels.isEmpty()) {
- return;
- }
- fLabels.remove(fLabels.size() - 1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.LineComment)
+ popLabel();
+ super.endVisit(node);
+ }
+
+ private String getLabel() {
+ if (fLabels == null || fLabels.isEmpty()) {
+ return null;
+ }
+ return fLabels.get(fLabels.size() - 1);
+ }
+
+ private void nestLabel(String label) {
+ if (fLabels == null) {
+ fLabels = new ArrayList<String>();
+ }
+ fLabels.add(label);
+ }
+
+ private void popLabel() {
+ if (fLabels == null || fLabels.isEmpty()) {
+ return;
+ }
+ fLabels.remove(fLabels.size() - 1);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * LineComment)
*/
+ @Override
public boolean visit(LineComment node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MarkerAnnotation)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MarkerAnnotation)
*/
+ @Override
public boolean visit(MarkerAnnotation node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef
+ * )
*/
+ @Override
public boolean visit(MemberRef node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberValuePair)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MemberValuePair)
*/
+ @Override
public boolean visit(MemberValuePair node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodDeclaration)
*/
+ @Override
public boolean visit(MethodDeclaration node) {
if (visit(node, false)) {
if (fBestMatch) {
// check if we are on the line which contains the method name
- int nameOffset= node.getName().getStartPosition();
+ int nameOffset = node.getName().getStartPosition();
if (lineNumber(nameOffset) == fLineNumber) {
- fMemberOffset= nameOffset;
- fLocationType= LOCATION_METHOD;
- fLocationFound= true;
+ fMemberOffset = nameOffset;
+ fLocationType = LOCATION_METHOD;
+ fLocationFound = true;
return false;
}
}
@@ -859,41 +980,61 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodInvocation)
*/
+ @Override
public boolean visit(MethodInvocation node) {
return visit(node, true);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef
+ * )
*/
+ @Override
public boolean visit(MethodRef node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRefParameter)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MethodRefParameter)
*/
+ @Override
public boolean visit(MethodRefParameter node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier
+ * )
*/
+ @Override
public boolean visit(Modifier node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NormalAnnotation)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * NormalAnnotation)
*/
+ @Override
public boolean visit(NormalAnnotation node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NullLiteral)
*/
+ @Override
public boolean visit(NullLiteral node) {
return visit(node, true);
}
@@ -901,6 +1042,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NumberLiteral)
*/
+ @Override
public boolean visit(NumberLiteral node) {
return visit(node, true);
}
@@ -908,20 +1050,26 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PackageDeclaration)
*/
+ @Override
public boolean visit(PackageDeclaration node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ParameterizedType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * ParameterizedType)
*/
+ @Override
public boolean visit(ParameterizedType node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ParenthesizedExpression)
*/
+ @Override
public boolean visit(ParenthesizedExpression node) {
return visit(node, false);
}
@@ -929,6 +1077,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PostfixExpression)
*/
+ @Override
public boolean visit(PostfixExpression node) {
return visit(node, true);
}
@@ -936,13 +1085,14 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PrefixExpression)
*/
+ @Override
public boolean visit(PrefixExpression node) {
if (visit(node, false)) {
if (isReplacedByConstantValue(node)) {
- fLineLocation= lineNumber(node.getStartPosition());
- fLocationFound= true;
- fLocationType= LOCATION_LINE;
- fTypeName= computeTypeName(node);
+ fLineLocation = lineNumber(node.getStartPosition());
+ fLocationFound = true;
+ fLocationType = LOCATION_LINE;
+ fTypeName = computeTypeName(node);
return false;
}
return true;
@@ -953,6 +1103,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PrimitiveType)
*/
+ @Override
public boolean visit(PrimitiveType node) {
return false;
}
@@ -960,21 +1111,27 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.QualifiedName)
*/
+ @Override
public boolean visit(QualifiedName node) {
visit(node, true);
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.QualifiedType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * QualifiedType)
*/
+ @Override
public boolean visit(QualifiedType node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ReturnStatement)
*/
+ @Override
public boolean visit(ReturnStatement node) {
return visit(node, true);
}
@@ -982,28 +1139,35 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SimpleName)
*/
+ @Override
public boolean visit(SimpleName node) {
- // the name is only code if its not the current label (if any)
+ // the name is only code if its not the current label (if any)
return visit(node, !node.getFullyQualifiedName().equals(getLabel()));
}
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SimpleType)
*/
+ @Override
public boolean visit(SimpleType node) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * SingleMemberAnnotation)
*/
+ @Override
public boolean visit(SingleMemberAnnotation node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleVariableDeclaration)
*/
+ @Override
public boolean visit(SingleVariableDeclaration node) {
return visit(node, false);
}
@@ -1011,6 +1175,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.StringLiteral)
*/
+ @Override
public boolean visit(StringLiteral node) {
return visit(node, true);
}
@@ -1018,6 +1183,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SuperConstructorInvocation)
*/
+ @Override
public boolean visit(SuperConstructorInvocation node) {
return visit(node, true);
}
@@ -1025,6 +1191,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SuperFieldAccess)
*/
+ @Override
public boolean visit(SuperFieldAccess node) {
return visit(node, true);
}
@@ -1032,6 +1199,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SuperMethodInvocation)
*/
+ @Override
public boolean visit(SuperMethodInvocation node) {
return visit(node, true);
}
@@ -1039,6 +1207,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SwitchCase)
*/
+ @Override
public boolean visit(SwitchCase node) {
return false;
}
@@ -1046,6 +1215,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SwitchStatement)
*/
+ @Override
public boolean visit(SwitchStatement node) {
return visit(node, false);
}
@@ -1053,27 +1223,38 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SynchronizedStatement)
*/
+ @Override
public boolean visit(SynchronizedStatement node) {
return visit(node, false);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement
+ * )
*/
+ @Override
public boolean visit(TagElement node) {
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TextElement)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * TextElement)
*/
+ @Override
public boolean visit(TextElement node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ThisExpression)
*/
+ @Override
public boolean visit(ThisExpression node) {
return visit(node, true);
}
@@ -1081,6 +1262,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ThrowStatement)
*/
+ @Override
public boolean visit(ThrowStatement node) {
return visit(node, true);
}
@@ -1088,26 +1270,33 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TryStatement)
*/
+ @Override
public boolean visit(TryStatement node) {
return visit(node, false);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.UnionType)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.UnionType
+ * )
*/
+ @Override
public boolean visit(UnionType node) {
return visit(node, false);
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclaration)
*/
+ @Override
public boolean visit(TypeDeclaration node) {
if (visit(node, false)) {
// visit only the elements of the type declaration
- List bodyDeclaration= node.bodyDeclarations();
- for (Iterator iter= bodyDeclaration.iterator(); iter.hasNext();) {
- ((BodyDeclaration)iter.next()).accept(this);
+ List<BodyDeclaration> bodyDeclaration = node.bodyDeclarations();
+ for(BodyDeclaration body : bodyDeclaration) {
+ body.accept(this);
}
}
return false;
@@ -1116,20 +1305,26 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclarationStatement)
*/
+ @Override
public boolean visit(TypeDeclarationStatement node) {
return visit(node, false);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeParameter)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * TypeParameter)
*/
+ @Override
public boolean visit(TypeParameter node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeLiteral)
*/
+ @Override
public boolean visit(TypeLiteral node) {
return false;
}
@@ -1137,6 +1332,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationExpression)
*/
+ @Override
public boolean visit(VariableDeclarationExpression node) {
return visit(node, false);
}
@@ -1144,11 +1340,12 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationFragment)
*/
+ @Override
public boolean visit(VariableDeclarationFragment node) {
Expression initializer = node.getInitializer();
if (visit(node, false)) {
int startLine = lineNumber(node.getName().getStartPosition());
- if(initializer != null) {
+ if (initializer != null) {
if (fLineNumber == startLine) {
fLineLocation = startLine;
fLocationFound = true;
@@ -1157,11 +1354,11 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
return false;
}
initializer.accept(this);
- }
- else {
- //the variable has no initializer
+ } else {
+ // the variable has no initializer
int offset = node.getName().getStartPosition();
- // check if the breakpoint is to be set on the line which contains the name of the field
+ // check if the breakpoint is to be set on the line which
+ // contains the name of the field
if (lineNumber(offset) == fLineNumber) {
fMemberOffset = offset;
fLocationType = LOCATION_FIELD;
@@ -1172,23 +1369,27 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
}
return false;
}
-
- private int lineNumber(int offset) {
- int lineNumber = fCompilationUnit.getLineNumber(offset);
- return lineNumber < 1 ? 1 : lineNumber;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.WildcardType)
+ private int lineNumber(int offset) {
+ int lineNumber = fCompilationUnit.getLineNumber(offset);
+ return lineNumber < 1 ? 1 : lineNumber;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * WildcardType)
*/
+ @Override
public boolean visit(WildcardType node) {
return false;
}
-
+
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationStatement)
*/
+ @Override
public boolean visit(VariableDeclarationStatement node) {
return visit(node, false);
}
@@ -1196,6 +1397,7 @@ public class ValidBreakpointLocationLocator extends ASTVisitor {
/**
* @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.WhileStatement)
*/
+ @Override
public boolean visit(WhileStatement node) {
return visit(node, false);
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/CompilationUnitDelta.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/CompilationUnitDelta.java
index f3759065a..0d269dd1c 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/CompilationUnitDelta.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/CompilationUnitDelta.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.hcr;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -28,88 +27,89 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.MethodDeclaration;
/**
- * A <code>CompilationUnitDelta</code> represents the source code changes between
- * a CU in the workspace and the same CU at some point in the past
- * (from the local history).
+ * A <code>CompilationUnitDelta</code> represents the source code changes
+ * between a CU in the workspace and the same CU at some point in the past (from
+ * the local history).
* <p>
- * This functionality is used in the context of Hot Code Replace
- * to determine which stack frames are affected (and need to be dropped)
- * by a class reload in the Java VM.
+ * This functionality is used in the context of Hot Code Replace to determine
+ * which stack frames are affected (and need to be dropped) by a class reload in
+ * the Java VM.
* <p>
* Typically a <code>CompilationUnitDelta</code> object is generated for a CU
* when the associated class is replaced in the VM.
*/
public class CompilationUnitDelta {
-
- /**
- * AST of the current source code
- */
- private CompilationUnit fCurrentAst;
- /**
- * AST of the previous source code
- */
- private CompilationUnit fPrevAst;
-
- /**
- * AST parser
- */
- private ASTParser fParser = null;
-
- /**
- * AST matcher
- */
- private ASTMatcher fMatcher = null;
-
- private boolean fHasHistory= false;
-
+
+ /**
+ * AST of the current source code
+ */
+ private CompilationUnit fCurrentAst;
+ /**
+ * AST of the previous source code
+ */
+ private CompilationUnit fPrevAst;
+
+ /**
+ * AST parser
+ */
+ private ASTParser fParser = null;
+
+ /**
+ * AST matcher
+ */
+ private ASTMatcher fMatcher = null;
+
+ private boolean fHasHistory = false;
+
/**
- * Creates a new <code>CompilationUnitDelta object that calculates and stores
+ * Creates a new
+ * <code>CompilationUnitDelta object that calculates and stores
* the changes of the given CU since some point in time.
*/
- public CompilationUnitDelta(ICompilationUnit cu, long timestamp) throws CoreException {
-
+ public CompilationUnitDelta(ICompilationUnit cu, long timestamp)
+ throws CoreException {
+
if (cu.isWorkingCopy()) {
- cu= cu.getPrimary();
+ cu = cu.getPrimary();
}
-
+
// find underlying file
- IFile file= (IFile) cu.getUnderlyingResource();
+ IFile file = (IFile) cu.getUnderlyingResource();
// get available editions
- IFileState[] states= file.getHistory(null);
+ IFileState[] states = file.getHistory(null);
if (states == null || states.length <= 0) {
return;
}
- fHasHistory= true;
-
- IFileState found= null;
+ fHasHistory = true;
+
+ IFileState found = null;
// find edition just before the given time stamp
- for (int i= 0; i < states.length; i++) {
- IFileState state= states[i];
- long d= state.getModificationTime();
+ for (IFileState state : states) {
+ long d = state.getModificationTime();
if (d < timestamp) {
- found= state;
+ found = state;
break;
}
}
-
+
if (found == null) {
- found= states[states.length-1];
+ found = states[states.length - 1];
}
-
- InputStream oldContents= null;
- InputStream newContents= null;
+
+ InputStream oldContents = null;
+ InputStream newContents = null;
try {
- oldContents= found.getContents();
- newContents= file.getContents();
+ oldContents = found.getContents();
+ newContents = file.getContents();
} catch (CoreException ex) {
return;
}
-
+
fPrevAst = parse(oldContents, cu);
- fCurrentAst = parse(newContents, cu);
+ fCurrentAst = parse(newContents, cu);
}
-
+
/**
* Returns <code>true</code>
* <ul>
@@ -120,64 +120,69 @@ public class CompilationUnitDelta {
* after the initial timestamp.
*/
public boolean hasChanged(String methodName, String signature) {
- if (!fHasHistory) {
- return false; // optimistic: we have no history, so assume that member hasn't changed
- }
- if (fPrevAst == null || fCurrentAst == null) {
- return true; // pessimistic: unable to build parse trees
- }
- MethodSearchVisitor visitor = new MethodSearchVisitor();
- MethodDeclaration prev = findMethod(fPrevAst, visitor, methodName, signature);
- if (prev != null) {
- MethodDeclaration curr = findMethod(fCurrentAst, visitor, methodName, signature);
- if (curr != null) {
- return !getMatcher().match(prev, curr);
- }
- }
- return true;
+ if (!fHasHistory) {
+ return false; // optimistic: we have no history, so assume that
+ // member hasn't changed
+ }
+ if (fPrevAst == null || fCurrentAst == null) {
+ return true; // pessimistic: unable to build parse trees
+ }
+ MethodSearchVisitor visitor = new MethodSearchVisitor();
+ MethodDeclaration prev = findMethod(fPrevAst, visitor, methodName,
+ signature);
+ if (prev != null) {
+ MethodDeclaration curr = findMethod(fCurrentAst, visitor,
+ methodName, signature);
+ if (curr != null) {
+ return !getMatcher().match(prev, curr);
+ }
+ }
+ return true;
}
-
- private MethodDeclaration findMethod(CompilationUnit cu, MethodSearchVisitor visitor, String name, String signature) {
- visitor.setTargetMethod(name, signature);
- cu.accept(visitor);
- return visitor.getMatch();
+
+ private MethodDeclaration findMethod(CompilationUnit cu,
+ MethodSearchVisitor visitor, String name, String signature) {
+ visitor.setTargetMethod(name, signature);
+ cu.accept(visitor);
+ return visitor.getMatch();
}
-
- //---- private stuff ----------------------------------------------------------------
-
+
+ // ---- private stuff
+ // ----------------------------------------------------------------
+
/**
- * Parses the given input stream and returns a tree of JavaNodes
- * or a null in case of failure.
+ * Parses the given input stream and returns a tree of JavaNodes or a null
+ * in case of failure.
*/
private CompilationUnit parse(InputStream input, ICompilationUnit cu) {
-
- char[] buffer= readString(input);
+
+ char[] buffer = readString(input);
if (buffer != null) {
- if (fParser == null) {
- fParser = ASTParser.newParser(AST.JLS4);
- }
- fParser.setSource(buffer);
- fParser.setProject(cu.getJavaProject());
- fParser.setResolveBindings(true);
- fParser.setKind(ASTParser.K_COMPILATION_UNIT);
- fParser.setUnitName(cu.getElementName());
+ if (fParser == null) {
+ fParser = ASTParser.newParser(AST.JLS4);
+ }
+ fParser.setSource(buffer);
+ fParser.setProject(cu.getJavaProject());
+ fParser.setResolveBindings(true);
+ fParser.setKind(ASTParser.K_COMPILATION_UNIT);
+ fParser.setUnitName(cu.getElementName());
return (CompilationUnit) fParser.createAST(null);
- }
+ }
return null;
}
-
+
/**
* Returns an AST matcher
*
* @return AST matcher
*/
private ASTMatcher getMatcher() {
- if (fMatcher == null) {
- fMatcher = new ASTMatcher();
- }
- return fMatcher;
+ if (fMatcher == null) {
+ fMatcher = new ASTMatcher();
+ }
+ return fMatcher;
}
-
+
/**
* Returns null if an error occurred.
*/
@@ -185,21 +190,22 @@ public class CompilationUnitDelta {
if (is == null) {
return null;
}
- BufferedReader reader= null;
+ BufferedReader reader = null;
try {
- StringBuffer buffer= new StringBuffer();
- char[] part= new char[2048];
- int read= 0;
- reader= new BufferedReader(new InputStreamReader(is, ResourcesPlugin.getEncoding()));
+ StringBuffer buffer = new StringBuffer();
+ char[] part = new char[2048];
+ int read = 0;
+ reader = new BufferedReader(new InputStreamReader(is,
+ ResourcesPlugin.getEncoding()));
- while ((read= reader.read(part)) != -1) {
+ while ((read = reader.read(part)) != -1) {
buffer.append(part, 0, read);
}
-
- char[] b= new char[buffer.length()];
+
+ char[] b = new char[buffer.length()];
buffer.getChars(0, b.length, b, 0);
return b;
-
+
} catch (IOException ex) {
} finally {
if (reader != null) {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/JavaHotCodeReplaceManager.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/JavaHotCodeReplaceManager.java
index 2d7fcd26c..b2db03b17 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/JavaHotCodeReplaceManager.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/JavaHotCodeReplaceManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.hcr;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -38,6 +37,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
@@ -79,33 +79,34 @@ import com.sun.jdi.ReferenceType;
import com.sun.jdi.VirtualMachine;
/**
- * The hot code replace manager listens for changes to
- * class files and notifies running debug targets of the changes.
+ * The hot code replace manager listens for changes to class files and notifies
+ * running debug targets of the changes.
* <p>
* Currently, replacing .jar files has no effect on running targets.
*/
-public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaunchListener, IDebugEventSetListener {
+public class JavaHotCodeReplaceManager implements IResourceChangeListener,
+ ILaunchListener, IDebugEventSetListener {
/**
- * Singleton
+ * Singleton
*/
- private static JavaHotCodeReplaceManager fgInstance= null;
+ private static JavaHotCodeReplaceManager fgInstance = null;
/**
* The class file extension
*/
- private static final String CLASS_FILE_EXTENSION= "class"; //$NON-NLS-1$
-
+ private static final String CLASS_FILE_EXTENSION = "class"; //$NON-NLS-1$
+
/**
- * The list of <code>IJavaHotCodeReplaceListeners</code> which this hot code replace
- * manager will notify about hot code replace attempts.
+ * The list of <code>IJavaHotCodeReplaceListeners</code> which this hot code
+ * replace manager will notify about hot code replace attempts.
*/
- private ListenerList fHotCodeReplaceListeners= new ListenerList();
-
+ private ListenerList fHotCodeReplaceListeners = new ListenerList();
+
/**
* The lists of hot swap targets which support HCR and those which don't
*/
- private ArrayList fHotSwapTargets= new ArrayList(1);
- private ArrayList fNoHotSwapTargets= new ArrayList(1);
-
+ private ArrayList<JDIDebugTarget> fHotSwapTargets = new ArrayList<JDIDebugTarget>(1);
+ private ArrayList<JDIDebugTarget> fNoHotSwapTargets = new ArrayList<JDIDebugTarget>(1);
+
/**
* A mapping of the last time projects were built.
* <ol>
@@ -113,42 +114,40 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
* <li>value: build date (ProjectBuildTime)</li>
* </ol>
*/
- private Map fProjectBuildTimes= new HashMap();
- private static Date fStartupDate= new Date();
-
+ private Map<IProject, ProjectBuildTime> fProjectBuildTimes = new HashMap<IProject, ProjectBuildTime>();
+ private static Date fStartupDate = new Date();
+
/**
* Cache of compilation unit deltas renewed on each HCR attempt.
*/
- private Map fDeltaCache = new HashMap();
-
+ private Map<ICompilationUnit, CompilationUnitDelta> fDeltaCache = new HashMap<ICompilationUnit, CompilationUnitDelta>();
+
/**
- * Utility object used for tracking build times of projects.
- * The HCR manager receives notification of builds AFTER
- * the build has occurred but BEFORE the classfile
- * resource changed deltas are fired. Thus, when the
- * current build time is set, we need to hang onto
- * the last build time so that we can use the last build
- * time for comparing changes to compilation units (for smart
- * drop to frame).
+ * Utility object used for tracking build times of projects. The HCR manager
+ * receives notification of builds AFTER the build has occurred but BEFORE
+ * the classfile resource changed deltas are fired. Thus, when the current
+ * build time is set, we need to hang onto the last build time so that we
+ * can use the last build time for comparing changes to compilation units
+ * (for smart drop to frame).
*/
class ProjectBuildTime {
- private Date fCurrentDate= new Date();
- private Date fPreviousDate= new Date();
-
+ private Date fCurrentDate = new Date();
+ private Date fPreviousDate = new Date();
+
public void setCurrentBuildDate(Date date) {
- fPreviousDate= fCurrentDate;
- fCurrentDate= date;
+ fPreviousDate = fCurrentDate;
+ fCurrentDate = date;
}
-
+
public void setLastBuildDate(Date date) {
- fPreviousDate= date;
+ fPreviousDate = date;
if (fPreviousDate.getTime() > fCurrentDate.getTime()) {
// If the previous date is set later than the current
// date, move the current date up to the previous.
- fCurrentDate= fPreviousDate;
+ fCurrentDate = fPreviousDate;
}
}
-
+
/**
* Returns the last build time
*/
@@ -156,39 +155,41 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
return fPreviousDate;
}
}
-
+
/**
* Visitor for resource deltas.
*/
protected ChangedClassFilesVisitor fClassfileVisitor = new ChangedClassFilesVisitor();
-
+
/**
* Creates a new HCR manager
*/
private JavaHotCodeReplaceManager() {
}
+
/**
* Returns the singleton HCR manager
*/
public static synchronized JavaHotCodeReplaceManager getDefault() {
if (fgInstance == null) {
- fgInstance= new JavaHotCodeReplaceManager();
+ fgInstance = new JavaHotCodeReplaceManager();
}
return fgInstance;
}
+
/**
- * Registers this HCR manager as a resource change listener. This method
- * is called by the JDI debug model plugin on startup.
+ * Registers this HCR manager as a resource change listener. This method is
+ * called by the JDI debug model plug-in on startup.
*/
public void startup() {
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
DebugPlugin.getDefault().addDebugEventListener(this);
}
-
+
/**
- * Deregisters this HCR manager as a resource change listener. Removes all hot
- * code replace listeners. This method is called by the JDI debug model plugin
- * on shutdown.
+ * unregisters this HCR manager as a resource change listener. Removes all
+ * hot code replace listeners. This method is called by the JDI debug model
+ * plug-in on shutdown.
*/
public void shutdown() {
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
@@ -200,247 +201,272 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
fNoHotSwapTargets.clear();
}
}
+
/**
* Returns the workspace.
*/
protected IWorkspace getWorkspace() {
return ResourcesPlugin.getWorkspace();
}
-
+
/**
* Returns the launch manager.
*/
protected ILaunchManager getLaunchManager() {
return DebugPlugin.getDefault().getLaunchManager();
}
+
/**
* @see IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
public void resourceChanged(IResourceChangeEvent event) {
- List projects= getBuiltProjects(event);
+ List<IProject> projects = getBuiltProjects(event);
if (!projects.isEmpty()) {
updateProjectBuildTime(projects);
}
synchronized (this) {
if (fHotSwapTargets.isEmpty() && fNoHotSwapTargets.isEmpty()) {
- // If there are no targets to notify, only update the build times.
+ // If there are no targets to notify, only update the build
+ // times.
return;
}
}
ChangedClassFilesVisitor visitor = getChangedClassFiles(event);
if (visitor != null) {
- List resources = visitor.getChangedClassFiles();
- List names = visitor.getQualifiedNamesList();
+ List<IResource> resources = visitor.getChangedClassFiles();
+ List<String> names = visitor.getQualifiedNamesList();
if (!resources.isEmpty()) {
notifyTargets(resources, names);
}
}
}
-
+
/**
* Returns all projects which this event says may have been built.
*/
- protected List getBuiltProjects(IResourceChangeEvent event) {
- IResourceDelta delta= event.getDelta();
- if (event.getType() != IResourceChangeEvent.POST_BUILD || delta == null || event.getBuildKind() == 0) {
+ protected List<IProject> getBuiltProjects(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ if (event.getType() != IResourceChangeEvent.POST_BUILD || delta == null
+ || event.getBuildKind() == 0) {
return Collections.EMPTY_LIST;
}
- if (event.getBuildKind() == IncrementalProjectBuilder.AUTO_BUILD && !ResourcesPlugin.getWorkspace().isAutoBuilding()) {
+ if (event.getBuildKind() == IncrementalProjectBuilder.AUTO_BUILD
+ && !ResourcesPlugin.getWorkspace().isAutoBuilding()) {
// If this is an auto build and the workspace is not autobuilding,
// no projects will actually be compiled.
return Collections.EMPTY_LIST;
}
Object source = event.getSource();
if (source instanceof IProject) {
- List list= new ArrayList();
- list.add(source);
+ List<IProject> list = new ArrayList<IProject>();
+ list.add((IProject) source);
return list;
- } else if (source instanceof IWorkspace){
- IProject[] allProjects = ((IWorkspace) source).getRoot().getProjects();
+ } else if (source instanceof IWorkspace) {
+ IProject[] allProjects = ((IWorkspace) source).getRoot()
+ .getProjects();
return Arrays.asList(allProjects);
}
return Collections.EMPTY_LIST;
}
-
+
/**
- * If the given event contains a build notification, update the
- * last build time of the corresponding project
+ * If the given event contains a build notification, update the last build
+ * time of the corresponding project
*/
- private void updateProjectBuildTime(List projects) {
- Iterator iter= projects.iterator();
- IProject project= null;
- Date currentDate= new Date();
- ProjectBuildTime buildTime= null;
- while (iter.hasNext()) {
- project= (IProject) iter.next();
- buildTime= (ProjectBuildTime)fProjectBuildTimes.get(project);
+ private void updateProjectBuildTime(List<IProject> projects) {
+ Date currentDate = new Date();
+ ProjectBuildTime buildTime = null;
+ for(IProject project : projects) {
+ buildTime = fProjectBuildTimes.get(project);
if (buildTime == null) {
- buildTime= new ProjectBuildTime();
+ buildTime = new ProjectBuildTime();
fProjectBuildTimes.put(project, buildTime);
}
buildTime.setCurrentBuildDate(currentDate);
}
}
-
+
/**
- * Returns the last known build time for the given project.
- * If no build time is known for the given project, the
- * last known build time for the project is set to the
- * hot code replace manager's startup time.
+ * Returns the last known build time for the given project. If no build time
+ * is known for the given project, the last known build time for the project
+ * is set to the hot code replace manager's startup time.
*/
protected long getLastProjectBuildTime(IProject project) {
- ProjectBuildTime time= (ProjectBuildTime)fProjectBuildTimes.get(project);
+ ProjectBuildTime time = fProjectBuildTimes
+ .get(project);
if (time == null) {
- time= new ProjectBuildTime();
+ time = new ProjectBuildTime();
time.setLastBuildDate(fStartupDate);
fProjectBuildTimes.put(project, time);
}
return time.getLastBuildDate().getTime();
}
-
+
/**
* Notifies the targets of the changed types
*/
- private void notifyTargets(final List resources, final List qualifiedNames) {
- final List hotSwapTargets= getHotSwapTargets();
- final List noHotSwapTargets= getNoHotSwapTargets();
+ private void notifyTargets(final List<IResource> resources, final List<String> qualifiedNames) {
+ final List<JDIDebugTarget> hotSwapTargets = getHotSwapTargets();
+ final List<JDIDebugTarget> noHotSwapTargets = getNoHotSwapTargets();
if (!hotSwapTargets.isEmpty()) {
- Runnable runnable= new Runnable() {
+ Runnable runnable = new Runnable() {
public void run() {
doHotCodeReplace(hotSwapTargets, resources, qualifiedNames);
}
};
- DebugPlugin.getDefault().asyncExec(runnable);
+ DebugPlugin.getDefault().asyncExec(runnable);
}
if (!noHotSwapTargets.isEmpty()) {
- Runnable runnable= new Runnable() {
+ Runnable runnable = new Runnable() {
public void run() {
- notifyUnsupportedHCR(noHotSwapTargets, resources, qualifiedNames);
+ notifyUnsupportedHCR(noHotSwapTargets, resources,
+ qualifiedNames);
}
};
DebugPlugin.getDefault().asyncExec(runnable);
}
}
-
+
+ /**
+ * Filters elements out of the given collections of resources and qualified
+ * names if there is no type corresponding type loaded in the given debug
+ * target. This method allows us to avoid bogus HCR attempts and
+ * "HCR failed" notifications.
+ *
+ * @param target
+ * the debug target
+ * @param resources
+ * the list of resources to filter
+ * @param qualifiedNames
+ * the list of qualified names to filter, which corresponds to
+ * the list of resources on a one-to-one-basis
+ */
+ private void filterUnloadedTypes(JDIDebugTarget target, List<IResource> resources,
+ List<String> qualifiedNames) {
+ for (int i = 0, numElements = qualifiedNames.size(); i < numElements; i++) {
+ String name = qualifiedNames.get(i);
+ List<ReferenceType> list = target.jdiClassesByName(name);
+ if (list.isEmpty()) {
+ // If no classes with the given name are loaded in the VM, don't
+ // waste
+ // cycles trying to replace.
+ qualifiedNames.remove(i);
+ resources.remove(i);
+ // Decrement the index and number of elements to compensate for
+ // item removal
+ i--;
+ numElements--;
+ }
+ }
+ }
+
/**
- * Filters elements out of the given collections of resources and qualified names
- * if there is no type corresponding tyep loaded in the given debug target. This
- * method allows us to avoid bogus HCR attempts and "HCR failed" notifications.
- *
- * @param target the debug target
- * @param resources the list of resources to filter
- * @param qualifiedNames the list of qualified names to filter, which corresponds
- * to the list of resources on a one-to-one-basis
- */
- private void filterUnloadedTypes(JDIDebugTarget target, List resources, List qualifiedNames) {
- for (int i= 0, numElements= qualifiedNames.size(); i < numElements; i++) {
- String name= (String) qualifiedNames.get(i);
- List list = target.jdiClassesByName(name);
- if (list.isEmpty()) {
- // If no classes with the given name are loaded in the VM, don't waste
- // cycles trying to replace.
- qualifiedNames.remove(i);
- resources.remove(i);
- // Decrement the index and number of elements to compensate for item removal
- i--;
- numElements--;
- }
- }
- }
- /**
- * Notify the given targets that HCR failed for classes
- * with the given fully qualified names.
+ * Notify the given targets that HCR failed for classes with the given fully
+ * qualified names.
*/
- protected void notifyUnsupportedHCR(List targets, List resources, List qualifiedNames) {
- Iterator iter= targets.iterator();
- JDIDebugTarget target= null;
- while (iter.hasNext()) {
- target= (JDIDebugTarget) iter.next();
+ protected void notifyUnsupportedHCR(List<JDIDebugTarget> targets, List<IResource> resources,
+ List<String> qualifiedNames) {
+ Iterator<JDIDebugTarget> iter = targets.iterator();
+ JDIDebugTarget target = null;
+ while (iter.hasNext()) {
+ target = iter.next();
if (target.isAvailable()) {
- // Make a local copy of the resources/names to swap so we can filter
- // unloaded types on a per-target basis.
- List resourcesToReplace= new ArrayList(resources);
- List qualifiedNamesToReplace= new ArrayList(qualifiedNames);
- filterUnloadedTypes(target, resourcesToReplace, qualifiedNamesToReplace);
-
+ // Make a local copy of the resources/names to swap so we can
+ // filter
+ // unloaded types on a per-target basis.
+ List<IResource> resourcesToReplace = new ArrayList<IResource>(resources);
+ List<String> qualifiedNamesToReplace = new ArrayList<String>(qualifiedNames);
+ filterUnloadedTypes(target, resourcesToReplace,
+ qualifiedNamesToReplace);
+
if (!qualifiedNamesToReplace.isEmpty()) {
- // Don't notify if the changed types aren't loaded.
- fireHCRFailed(target, null);
- notifyFailedHCR(target, qualifiedNamesToReplace);
+ // Don't notify if the changed types aren't loaded.
+ fireHCRFailed(target, null);
+ notifyFailedHCR(target, qualifiedNamesToReplace);
}
} else {
- // Targets should be unregistered when they terminate,
- // but this is a fallback.
- deregisterTarget(target);
+ // Targets should be unregistered when they terminate,
+ // but this is a fall-back.
+ deregisterTarget(target);
}
}
}
-
- protected void notifyFailedHCR(JDIDebugTarget target, List qualifiedNames) {
+
+ protected void notifyFailedHCR(JDIDebugTarget target, List<String> qualifiedNames) {
if (target.isAvailable()) {
target.addOutOfSynchTypes(qualifiedNames);
target.fireChangeEvent(DebugEvent.STATE);
}
- }
-
+ }
+
/**
- * Returns the currently registered debug targets that support
- * hot code replace.
+ * Returns the currently registered debug targets that support hot code
+ * replace.
*/
- protected synchronized List getHotSwapTargets() {
- return (List) fHotSwapTargets.clone();
+ protected synchronized List<JDIDebugTarget> getHotSwapTargets() {
+ return (List<JDIDebugTarget>) fHotSwapTargets.clone();
}
-
+
/**
- * Returns the currently registered debug targets that do
- * not support hot code replace.
+ * Returns the currently registered debug targets that do not support hot
+ * code replace.
*/
- protected synchronized List getNoHotSwapTargets() {
- return (List) fNoHotSwapTargets.clone();
+ protected synchronized List<JDIDebugTarget> getNoHotSwapTargets() {
+ return (List<JDIDebugTarget>) fNoHotSwapTargets.clone();
}
-
+
/**
- * Perform a hot code replace with the given resources.
- * For a JDK 1.4 compliant VM this involves:
+ * Perform a hot code replace with the given resources. For a JDK 1.4
+ * compliant VM this involves:
* <ol>
- * <li>Popping all frames from all thread stacks which will be affected by reloading the given resources</li>
+ * <li>Popping all frames from all thread stacks which will be affected by
+ * reloading the given resources</li>
* <li>Telling the VirtualMachine to redefine the affected classes</li>
- * <li>Performing a step-into operation on all threads which were affected by the class redefinition.
- * This returns execution to the first (deepest) affected method on the stack</li>
+ * <li>Performing a step-into operation on all threads which were affected
+ * by the class redefinition. This returns execution to the first (deepest)
+ * affected method on the stack</li>
* </ol>
* For a J9 compliant VM this involves:
* <ol>
* <li>Telling the VirtualMachine to redefine the affected classes</li>
- * <li>Popping all frames from all thread stacks which were affected by reloading the given resources and then
- * performing a step-into operation on all threads which were affected by the class redefinition.</li>
+ * <li>Popping all frames from all thread stacks which were affected by
+ * reloading the given resources and then performing a step-into operation
+ * on all threads which were affected by the class redefinition.</li>
* </ol>
*
- * @param targets the targets in which to perform HCR
- * @param resources the resources which correspond to the changed classes
+ * @param targets
+ * the targets in which to perform HCR
+ * @param resources
+ * the resources which correspond to the changed classes
*/
- private void doHotCodeReplace(List targets, List resources, List qualifiedNames) {
- MultiStatus ms= new MultiStatus(JDIDebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, "At least one target failed to drop to frame after successful hot code replace.", null); //$NON-NLS-1$
- Iterator iter= targets.iterator();
+ private void doHotCodeReplace(List<JDIDebugTarget> targets, List<IResource> resources,
+ List<String> qualifiedNames) {
+ MultiStatus ms = new MultiStatus(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ DebugException.TARGET_REQUEST_FAILED,
+ "At least one target failed to drop to frame after successful hot code replace.", null); //$NON-NLS-1$
+ Iterator<JDIDebugTarget> iter = targets.iterator();
while (iter.hasNext()) {
- JDIDebugTarget target= (JDIDebugTarget) iter.next();
+ JDIDebugTarget target = iter.next();
if (!target.isAvailable()) {
- deregisterTarget(target);
+ deregisterTarget(target);
continue;
}
- // Make a local copy of the resources/names to swap so we can filter
- // unloaded types on a per-target basis.
- List resourcesToReplace= new ArrayList(resources);
- List qualifiedNamesToReplace= new ArrayList(qualifiedNames);
- filterUnloadedTypes(target, resourcesToReplace, qualifiedNamesToReplace);
+ // Make a local copy of the resources/names to swap so we can filter
+ // unloaded types on a per-target basis.
+ List<IResource> resourcesToReplace = new ArrayList<IResource>(resources);
+ List<String> qualifiedNamesToReplace = new ArrayList<String>(qualifiedNames);
+ filterUnloadedTypes(target, resourcesToReplace,
+ qualifiedNamesToReplace);
if (qualifiedNamesToReplace.isEmpty()) {
- // If none of the changed types are loaded, do nothing.
- continue;
+ // If none of the changed types are loaded, do nothing.
+ continue;
}
-
- List poppedThreads= new ArrayList();
+
+ List<IThread> poppedThreads = new ArrayList<IThread>();
target.setIsPerformingHotCodeReplace(true);
try {
- boolean framesPopped= false;
+ boolean framesPopped = false;
if (target.canPopFrames()) {
// JDK 1.4 drop to frame support:
// JDK 1.4 spec is faulty around methods that have
@@ -448,17 +474,19 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
// Thus, pop the frames that contain affected methods
// *before* the class redefinition to avoid problems.
try {
- attemptPopFrames(target, resourcesToReplace, qualifiedNamesToReplace, poppedThreads);
- framesPopped= true; // No exception occurred
+ attemptPopFrames(target, resourcesToReplace,
+ qualifiedNamesToReplace, poppedThreads);
+ framesPopped = true; // No exception occurred
} catch (DebugException de) {
- if (shouldLogHCRException(de)) {
- ms.merge(de.getStatus());
- }
+ if (shouldLogHCRException(de)) {
+ ms.merge(de.getStatus());
+ }
}
}
target.removeOutOfSynchTypes(qualifiedNamesToReplace);
if (target.supportsJDKHotCodeReplace()) {
- redefineTypesJDK(target, resourcesToReplace, qualifiedNamesToReplace);
+ redefineTypesJDK(target, resourcesToReplace,
+ qualifiedNamesToReplace);
} else if (target.supportsJ9HotCodeReplace()) {
redefineTypesJ9(target, qualifiedNamesToReplace);
}
@@ -471,25 +499,26 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
// All affected frames have been popped and the classes
// have been reloaded. Step into the first changed
// frame of each affected thread.
- // must re-set 'is doing HCR' to be able to step
- target.setIsPerformingHotCodeReplace(false);
- attemptStepIn(poppedThreads);
+ // must re-set 'is doing HCR' to be able to step
+ target.setIsPerformingHotCodeReplace(false);
+ attemptStepIn(poppedThreads);
} else {
// J9 drop to frame support:
// After redefining classes, drop to frame
- attemptDropToFrame(target, resourcesToReplace, qualifiedNamesToReplace);
+ attemptDropToFrame(target, resourcesToReplace,
+ qualifiedNamesToReplace);
}
} catch (DebugException de) {
- if (shouldLogHCRException(de)) {
- ms.merge(de.getStatus());
- }
+ if (shouldLogHCRException(de)) {
+ ms.merge(de.getStatus());
+ }
}
fireHCRSucceeded(target);
} catch (DebugException de) {
// target update failed
fireHCRFailed(target, de);
}
- // also re-set 'is doing HCR' here incase HCR failed
+ // also re-set 'is doing HCR' here in case HCR failed
target.setIsPerformingHotCodeReplace(false);
target.fireChangeEvent(DebugEvent.CONTENT);
}
@@ -498,291 +527,362 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
}
fDeltaCache.clear();
}
-
+
/**
- * Returns whether the given exception, which occurred during HCR, should be logged.
- * We anticipate that we can get IncompatibleThreadStateExceptions if the user happens
- * to resume a thread at just the right moment. Since this has no ill effects for HCR,
- * we don't log these exceptions.
+ * Returns whether the given exception, which occurred during HCR, should be
+ * logged. We anticipate that we can get IncompatibleThreadStateExceptions
+ * if the user happens to resume a thread at just the right moment. Since
+ * this has no ill effects for HCR, we don't log these exceptions.
*/
private boolean shouldLogHCRException(DebugException exception) {
- return !(exception.getStatus().getException() instanceof IncompatibleThreadStateException ||
- exception.getStatus().getCode() == IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE ||
- exception.getStatus().getCode() == IJavaThread.ERR_THREAD_NOT_SUSPENDED);
+ return !(exception.getStatus().getException() instanceof IncompatibleThreadStateException
+ || exception.getStatus().getCode() == IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE || exception
+ .getStatus().getCode() == IJavaThread.ERR_THREAD_NOT_SUSPENDED);
}
/**
- * Replaces the given types in the given J9 debug target.
- * A fully qualified name of each type must be supplied.
- *
- * Breakpoints are reinstalled automatically when the new
- * types are loaded.
- *
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The target VM was unable to reload a type due to a shape
- * change</li>
- * </ul>
+ * Replaces the given types in the given J9 debug target. A fully qualified
+ * name of each type must be supplied.
+ *
+ * Breakpoints are reinstalled automatically when the new types are loaded.
+ *
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The target VM was unable to reload a type due to a
+ * shape change</li>
+ * </ul>
*/
- private void redefineTypesJ9(JDIDebugTarget target, List qualifiedNames) throws DebugException {
- String[] typeNames = (String[]) qualifiedNames.toArray(new String[qualifiedNames.size()]);
+ private void redefineTypesJ9(JDIDebugTarget target, List<String> qualifiedNames)
+ throws DebugException {
+ String[] typeNames = qualifiedNames
+ .toArray(new String[qualifiedNames.size()]);
if (target.supportsJ9HotCodeReplace()) {
target.setHCROccurred(true);
- org.eclipse.jdi.hcr.VirtualMachine vm= (org.eclipse.jdi.hcr.VirtualMachine) target.getVM();
+ org.eclipse.jdi.hcr.VirtualMachine vm = (org.eclipse.jdi.hcr.VirtualMachine) target
+ .getVM();
if (vm == null) {
- target.requestFailed(JDIDebugHCRMessages.JavaHotCodeReplaceManager_Hot_code_replace_failed___VM_disconnected__1, null);
+ target.requestFailed(
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_Hot_code_replace_failed___VM_disconnected__1,
+ null);
}
- int result= org.eclipse.jdi.hcr.VirtualMachine.RELOAD_FAILURE;
+ int result = org.eclipse.jdi.hcr.VirtualMachine.RELOAD_FAILURE;
try {
- result= vm.classesHaveChanged(typeNames);
+ result = vm.classesHaveChanged(typeNames);
} catch (RuntimeException e) {
- target.targetRequestFailed(MessageFormat.format(JDIDebugHCRMessages.JavaHotCodeReplaceManager_exception_replacing_types, new String[] {e.toString()}), e);
+ target.targetRequestFailed(
+ MessageFormat.format(JDIDebugHCRMessages.JavaHotCodeReplaceManager_exception_replacing_types, e.toString()),
+ e);
}
switch (result) {
- case org.eclipse.jdi.hcr.VirtualMachine.RELOAD_SUCCESS:
- break;
- case org.eclipse.jdi.hcr.VirtualMachine.RELOAD_IGNORED:
- target.targetRequestFailed(JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_ignored, null);
- break;
- case org.eclipse.jdi.hcr.VirtualMachine.RELOAD_FAILURE:
- target.targetRequestFailed(JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_failed, null);
- target.addOutOfSynchTypes(qualifiedNames);
- break;
+ case org.eclipse.jdi.hcr.VirtualMachine.RELOAD_SUCCESS:
+ break;
+ case org.eclipse.jdi.hcr.VirtualMachine.RELOAD_IGNORED:
+ target.targetRequestFailed(
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_ignored,
+ null);
+ break;
+ case org.eclipse.jdi.hcr.VirtualMachine.RELOAD_FAILURE:
+ target.targetRequestFailed(
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_failed,
+ null);
+ target.addOutOfSynchTypes(qualifiedNames);
+ break;
}
} else {
- target.notSupported(JDIDebugHCRMessages.JavaHotCodeReplaceManager_does_not_support_hcr);
+ target.notSupported(JDIDebugHCRMessages.JavaHotCodeReplaceManager_does_not_support_hcr);
target.addOutOfSynchTypes(qualifiedNames);
}
}
-
+
/**
* Replaces the given types in the given JDK-compliant debug target.
*
* This method is to be used for JDK hot code replace.
*/
- private void redefineTypesJDK(JDIDebugTarget target, List resources, List qualifiedNames) throws DebugException {
+ private void redefineTypesJDK(JDIDebugTarget target, List<IResource> resources,
+ List<String> qualifiedNames) throws DebugException {
if (target.supportsJDKHotCodeReplace()) {
target.setHCROccurred(true);
- Map typesToBytes= getTypesToBytes(target, resources, qualifiedNames);
+ Map<ReferenceType, byte[]> typesToBytes = getTypesToBytes(target, resources,
+ qualifiedNames);
try {
VirtualMachine vm = target.getVM();
if (vm == null) {
- target.requestFailed(JDIDebugHCRMessages.JavaHotCodeReplaceManager_Hot_code_replace_failed___VM_disconnected__2, null);
+ target.requestFailed(
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_Hot_code_replace_failed___VM_disconnected__2,
+ null);
}
vm.redefineClasses(typesToBytes);
} catch (UnsupportedOperationException exception) {
- String detail= exception.getMessage();
+ String detail = exception.getMessage();
if (detail != null) {
- redefineTypesFailedJDK(target, qualifiedNames, MessageFormat.format(JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_unsupported_operation, new String[] {detail}), exception);
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ MessageFormat.format(
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_unsupported_operation,
+ detail),
+ exception);
} else {
- redefineTypesFailedJDK(target, qualifiedNames, JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_unsupported_redefinition, exception);
- }
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_unsupported_redefinition,
+ exception);
+ }
} catch (NoClassDefFoundError exception) {
- redefineTypesFailedJDK(target, qualifiedNames, JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_bad_bytes, exception);
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_bad_bytes,
+ exception);
} catch (VerifyError exception) {
- redefineTypesFailedJDK(target, qualifiedNames, JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_verify_error, exception);
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_verify_error,
+ exception);
} catch (UnsupportedClassVersionError exception) {
- redefineTypesFailedJDK(target, qualifiedNames, JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_unsupported_class_version, exception);
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_unsupported_class_version,
+ exception);
} catch (ClassFormatError exception) {
- redefineTypesFailedJDK(target, qualifiedNames, JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_class_format_error, exception);
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_class_format_error,
+ exception);
} catch (ClassCircularityError exception) {
- redefineTypesFailedJDK(target, qualifiedNames, JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_class_circularity_error, exception);
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_class_circularity_error,
+ exception);
} catch (RuntimeException exception) {
- redefineTypesFailedJDK(target, qualifiedNames, JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_failed, exception);
+ redefineTypesFailedJDK(
+ target,
+ qualifiedNames,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_failed,
+ exception);
}
target.reinstallBreakpointsIn(resources, qualifiedNames);
} else {
- target.notSupported(JDIDebugHCRMessages.JavaHotCodeReplaceManager_does_not_support_hcr);
+ target.notSupported(JDIDebugHCRMessages.JavaHotCodeReplaceManager_does_not_support_hcr);
}
}
-
+
/**
* Error handling for JDK hot code replace.
*
- * The given exception occurred when redefinition was attempted
- * for the given types.
+ * The given exception occurred when redefinition was attempted for the
+ * given types.
*/
- private void redefineTypesFailedJDK(JDIDebugTarget target, List qualifiedNames, String message, Throwable exception) throws DebugException {
+ private void redefineTypesFailedJDK(JDIDebugTarget target,
+ List<String> qualifiedNames, String message, Throwable exception)
+ throws DebugException {
target.addOutOfSynchTypes(qualifiedNames);
target.jdiRequestFailed(message, exception);
}
-
+
/**
- * Returns a mapping of class files to the bytes that make up those
- * class files.
+ * Returns a mapping of class files to the bytes that make up those class
+ * files.
*
- * @param target the debug target to query
- * @param resources the classfiles
- * @param qualifiedNames the fully qualified type names corresponding to the
- * classfiles. The typeNames correspond to the resources on a one-to-one
- * basis.
- * @return a mapping of class files to bytes
- * key: class file
- * value: the bytes which make up that classfile
+ * @param target
+ * the debug target to query
+ * @param resources
+ * the classfiles
+ * @param qualifiedNames
+ * the fully qualified type names corresponding to the
+ * classfiles. The typeNames correspond to the resources on a
+ * one-to-one basis.
+ * @return a mapping of class files to bytes key: class file value: the
+ * bytes which make up that classfile
*/
- private Map getTypesToBytes(JDIDebugTarget target, List resources, List qualifiedNames) {
- Map typesToBytes= new HashMap(resources.size());
- Iterator resourceIter= resources.iterator();
- Iterator nameIter= qualifiedNames.iterator();
+ private Map<ReferenceType, byte[]> getTypesToBytes(JDIDebugTarget target, List<IResource> resources,
+ List<String> qualifiedNames) {
+ Map<ReferenceType, byte[]> typesToBytes = new HashMap<ReferenceType, byte[]>(resources.size());
+ Iterator<IResource> resourceIter = resources.iterator();
+ Iterator<String> nameIter = qualifiedNames.iterator();
IResource resource;
String name;
while (resourceIter.hasNext()) {
- resource= (IResource) resourceIter.next();
- name= (String) nameIter.next();
- List classes= target.jdiClassesByName(name);
- byte[] bytes= null;
+ resource = resourceIter.next();
+ name = nameIter.next();
+ List<ReferenceType> classes = target.jdiClassesByName(name);
+ byte[] bytes = null;
try {
- bytes= Util.getResourceContentsAsByteArray((IFile) resource);
+ bytes = Util.getResourceContentsAsByteArray((IFile) resource);
} catch (JavaModelException jme) {
continue;
}
- Iterator classIter= classes.iterator();
- while (classIter.hasNext()) {
- ReferenceType type= (ReferenceType) classIter.next();
+ Iterator<ReferenceType> classIter = classes.iterator();
+ for(ReferenceType type : classes) {
typesToBytes.put(type, bytes);
}
}
return typesToBytes;
}
-
+
/**
* Return the listeners to notify for the given target. Target specific
* listeners take precedence over generic listeners registered with the
* debug model plug-in.
*
- * @param target Java debug target
+ * @param target
+ * Java debug target
* @return hot code replace listeners
*/
private Object[] getHotCodeReplaceListeners(IJavaDebugTarget target) {
Object[] listeners = null;
if (target instanceof JDIDebugTarget) {
- listeners = ((JDIDebugTarget)target).getHotCodeReplaceListeners();
+ listeners = ((JDIDebugTarget) target).getHotCodeReplaceListeners();
}
if (listeners == null || listeners.length == 0) {
- listeners= fHotCodeReplaceListeners.getListeners();
+ listeners = fHotCodeReplaceListeners.getListeners();
}
return listeners;
}
-
+
/**
* Notifies listeners that a hot code replace attempt succeeded
*/
private void fireHCRSucceeded(IJavaDebugTarget target) {
- Object[] listeners= getHotCodeReplaceListeners(target);
- for (int i=0; i<listeners.length; i++) {
- ((IJavaHotCodeReplaceListener)listeners[i]).hotCodeReplaceSucceeded(target);
- }
+ Object[] listeners = getHotCodeReplaceListeners(target);
+ for (Object listener : listeners) {
+ ((IJavaHotCodeReplaceListener) listener)
+ .hotCodeReplaceSucceeded(target);
+ }
}
-
+
/**
- * Notifies listeners that a hot code replace attempt failed with the given exception
+ * Notifies listeners that a hot code replace attempt failed with the given
+ * exception
*/
private void fireHCRFailed(JDIDebugTarget target, DebugException exception) {
- Object[] listeners= getHotCodeReplaceListeners(target);
- for (int i=0; i<listeners.length; i++) {
- ((IJavaHotCodeReplaceListener)listeners[i]).hotCodeReplaceFailed(target, exception);
+ Object[] listeners = getHotCodeReplaceListeners(target);
+ for (Object listener : listeners) {
+ ((IJavaHotCodeReplaceListener) listener).hotCodeReplaceFailed(
+ target, exception);
}
}
-
+
/**
* Notifies listeners that obsolete methods remain on the stack
*/
private void fireObsoleteMethods(JDIDebugTarget target) {
- Object[] listeners= getHotCodeReplaceListeners(target);
- for (int i=0; i<listeners.length; i++) {
- ((IJavaHotCodeReplaceListener)listeners[i]).obsoleteMethods(target);
+ Object[] listeners = getHotCodeReplaceListeners(target);
+ for (Object listener : listeners) {
+ ((IJavaHotCodeReplaceListener) listener).obsoleteMethods(target);
}
}
-
+
/**
- * Looks for the deepest affected stack frame in the stack
- * and forces a drop to frame. Does this for all of the active
- * stack frames in the target.
+ * Looks for the deepest affected stack frame in the stack and forces a drop
+ * to frame. Does this for all of the active stack frames in the target.
*
- * @param target the debug target in which frames are to be dropped
- * @param replacedClassNames the classes that have been redefined
+ * @param target
+ * the debug target in which frames are to be dropped
+ * @param replacedClassNames
+ * the classes that have been redefined
*/
- protected void attemptDropToFrame(JDIDebugTarget target, List resources, List replacedClassNames) throws DebugException {
- List dropFrames= getAffectedFrames(target.getThreads(), resources, replacedClassNames);
+ protected void attemptDropToFrame(JDIDebugTarget target, List<IResource> resources,
+ List<String> replacedClassNames) throws DebugException {
+ List<JDIStackFrame> dropFrames = getAffectedFrames(target.getThreads(), resources,
+ replacedClassNames);
- // All threads that want to drop to frame are able. Proceed with the drop
- JDIStackFrame dropFrame= null;
- Iterator iter= dropFrames.iterator();
+ // All threads that want to drop to frame are able. Proceed with the
+ // drop
+ JDIStackFrame dropFrame = null;
+ Iterator<JDIStackFrame> iter = dropFrames.iterator();
while (iter.hasNext()) {
try {
- dropFrame= ((JDIStackFrame)iter.next());
+ dropFrame = iter.next();
dropFrame.dropToFrame();
} catch (DebugException de) {
- notifyFailedDrop(((JDIThread)dropFrame.getThread()).computeStackFrames(), replacedClassNames);
+ notifyFailedDrop(
+ ((JDIThread) dropFrame.getThread())
+ .computeStackFrames(),
+ replacedClassNames);
}
}
}
-
+
/**
- * Looks for the deepest affected stack frame in the stack
- * and forces a drop to frame. Does this for all of the active
- * stack frames in the target.
+ * Looks for the deepest affected stack frame in the stack and forces a drop
+ * to frame. Does this for all of the active stack frames in the target.
*
- * @param target the debug target in which frames are to be dropped
- * @param replacedClassNames the classes that have been redefined
- * @param poppedThreads a list of the threads in which frames
- * were popped.This parameter may have entries added by this method
+ * @param target
+ * the debug target in which frames are to be dropped
+ * @param replacedClassNames
+ * the classes that have been redefined
+ * @param poppedThreads
+ * a list of the threads in which frames were popped.This
+ * parameter may have entries added by this method
*/
- protected void attemptPopFrames(JDIDebugTarget target, List resources, List replacedClassNames, List poppedThreads) throws DebugException {
- List popFrames= getAffectedFrames(target.getThreads(), resources, replacedClassNames);
+ protected void attemptPopFrames(JDIDebugTarget target, List<IResource> resources,
+ List<String> replacedClassNames, List<IThread> poppedThreads) throws DebugException {
+ List<JDIStackFrame> popFrames = getAffectedFrames(target.getThreads(), resources,
+ replacedClassNames);
- // All threads that want to drop to frame are able. Proceed with the drop
- JDIStackFrame popFrame= null;
- Iterator iter= popFrames.iterator();
+ // All threads that want to drop to frame are able. Proceed with the
+ // drop
+ JDIStackFrame popFrame = null;
+ Iterator<JDIStackFrame> iter = popFrames.iterator();
while (iter.hasNext()) {
try {
- popFrame= ((JDIStackFrame)iter.next());
+ popFrame = iter.next();
popFrame.popFrame();
poppedThreads.add(popFrame.getThread());
} catch (DebugException de) {
poppedThreads.remove(popFrame.getThread());
- notifyFailedDrop(((JDIThread)popFrame.getThread()).computeStackFrames(), replacedClassNames);
+ notifyFailedDrop(
+ ((JDIThread) popFrame.getThread()).computeStackFrames(),
+ replacedClassNames);
}
}
}
-
+
/**
- * Returns whether or not the given target contains stack frames with obsolete
- * methods.
+ * Returns whether or not the given target contains stack frames with
+ * obsolete methods.
*/
- protected boolean containsObsoleteMethods(JDIDebugTarget target) throws DebugException {
- IThread[] threads=target.getThreads();
- List frames= null;
- Iterator iter= null;
- for (int i= 0, numThreads= threads.length; i < numThreads; i++) {
- frames= ((JDIThread)threads[i]).computeNewStackFrames();
- iter= frames.iterator();
- while (iter.hasNext()) {
- if (((JDIStackFrame)iter.next()).isObsolete()) {
+ protected boolean containsObsoleteMethods(JDIDebugTarget target)
+ throws DebugException {
+ IThread[] threads = target.getThreads();
+ List<IJavaStackFrame> frames = null;
+ for (IThread thread : threads) {
+ frames = ((JDIThread) thread).computeNewStackFrames();
+ for(IJavaStackFrame frame : frames) {
+ if(frame.isObsolete()) {
return true;
}
}
}
return false;
}
-
+
/**
* Returns a list of frames which should be popped in the given threads.
*/
- protected List getAffectedFrames(IThread[] threads, List resourceList, List replacedClassNames) throws DebugException {
- JDIThread thread= null;
- JDIStackFrame affectedFrame= null;
- List popFrames= new ArrayList();
- int numThreads= threads.length;
- IResource[] resources= new IResource[resourceList.size()];
+ protected List<JDIStackFrame> getAffectedFrames(IThread[] threads, List<IResource> resourceList,
+ List<String> replacedClassNames) throws DebugException {
+ JDIThread thread = null;
+ JDIStackFrame affectedFrame = null;
+ List<JDIStackFrame> popFrames = new ArrayList<JDIStackFrame>();
+ int numThreads = threads.length;
+ IResource[] resources = new IResource[resourceList.size()];
resourceList.toArray(resources);
for (int i = 0; i < numThreads; i++) {
- thread= (JDIThread) threads[i];
+ thread = (JDIThread) threads[i];
if (thread.isSuspended()) {
- affectedFrame= getAffectedFrame(thread, replacedClassNames);
+ affectedFrame = getAffectedFrame(thread, replacedClassNames);
if (affectedFrame == null) {
// No frame to drop to in this thread
continue;
@@ -792,52 +892,62 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
} else {
// if any thread that should drop does not support the drop,
// do not drop in any threads.
- for (int j= 0; j < numThreads; j++) {
- notifyFailedDrop(((JDIThread)threads[i]).computeStackFrames(), replacedClassNames);
+ for (int j = 0; j < numThreads; j++) {
+ notifyFailedDrop(
+ ((JDIThread) threads[i]).computeStackFrames(),
+ replacedClassNames);
}
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.NOT_SUPPORTED, JDIDebugHCRMessages.JavaHotCodeReplaceManager_Drop_to_frame_not_supported, null));
+ throw new DebugException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.NOT_SUPPORTED,
+ JDIDebugHCRMessages.JavaHotCodeReplaceManager_Drop_to_frame_not_supported,
+ null));
}
}
}
return popFrames;
}
-
+
/**
- * Returns the stack frame that should be dropped to in the
- * given thread after a hot code replace.
- * This is calculated by determining if the threads contain stack frames
- * that reside in one of the given replaced class names. If possible, only
- * stack frames whose methods were directly affected (and not simply all frames
- * in affected types) will be returned.
+ * Returns the stack frame that should be dropped to in the given thread
+ * after a hot code replace. This is calculated by determining if the
+ * threads contain stack frames that reside in one of the given replaced
+ * class names. If possible, only stack frames whose methods were directly
+ * affected (and not simply all frames in affected types) will be returned.
*/
- protected JDIStackFrame getAffectedFrame(JDIThread thread, List replacedClassNames) throws DebugException {
- List frames= thread.computeStackFrames();
- JDIStackFrame affectedFrame= null;
- JDIStackFrame frame= null;
- ICompilationUnit compilationUnit= null;
- CompilationUnitDelta delta= null;
- IProject project= null;
- for (int j= frames.size() - 1; j >= 0; j--) {
- frame= (JDIStackFrame) frames.get(j);
+ protected JDIStackFrame getAffectedFrame(JDIThread thread,
+ List<String> replacedClassNames) throws DebugException {
+ List<IJavaStackFrame> frames = thread.computeStackFrames();
+ JDIStackFrame affectedFrame = null;
+ JDIStackFrame frame = null;
+ ICompilationUnit compilationUnit = null;
+ CompilationUnitDelta delta = null;
+ IProject project = null;
+ for (int j = frames.size() - 1; j >= 0; j--) {
+ frame = (JDIStackFrame) frames.get(j);
if (containsChangedType(frame, replacedClassNames)) {
// smart drop to frame support
- compilationUnit= getCompilationUnit(frame);
+ compilationUnit = getCompilationUnit(frame);
// if we can't find the source, then do type-based drop
if (compilationUnit != null) {
try {
- project= compilationUnit.getCorrespondingResource().getProject();
- delta = getDelta(compilationUnit, getLastProjectBuildTime(project));
- if (!delta.hasChanged(frame.getName(), frame.getSignature())) {
+ project = compilationUnit.getCorrespondingResource()
+ .getProject();
+ delta = getDelta(compilationUnit,
+ getLastProjectBuildTime(project));
+ if (!delta.hasChanged(frame.getName(),
+ frame.getSignature())) {
continue;
}
} catch (CoreException exception) {
- // If smart drop to frame fails, just do type-based drop
+ // If smart drop to frame fails, just do type-based drop
}
}
if (frame.supportsDropToFrame()) {
- affectedFrame= frame;
+ affectedFrame = frame;
break;
}
// The frame we wanted to drop to cannot be popped.
@@ -845,9 +955,9 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
// frame on the stack.
while (j > 0) {
j--;
- frame= (JDIStackFrame) frames.get(j);
+ frame = (JDIStackFrame) frames.get(j);
if (frame.supportsDropToFrame()) {
- affectedFrame= frame;
+ affectedFrame = frame;
break;
}
}
@@ -856,98 +966,107 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
}
return affectedFrame;
}
-
+
/**
* Returns the delta object for the given compilation unit
*
- * @param cu compilation unit
- * @param time time to compare to (i.e. compare to first version before this time)
+ * @param cu
+ * compilation unit
+ * @param time
+ * time to compare to (i.e. compare to first version before this
+ * time)
* @return delta object
*/
- private CompilationUnitDelta getDelta(ICompilationUnit cu, long time) throws CoreException {
- CompilationUnitDelta delta = (CompilationUnitDelta) fDeltaCache.get(cu);
- if (delta == null) {
- delta= new CompilationUnitDelta(cu, time);
- fDeltaCache.put(cu, delta);
- }
- return delta;
+ private CompilationUnitDelta getDelta(ICompilationUnit cu, long time)
+ throws CoreException {
+ CompilationUnitDelta delta = fDeltaCache.get(cu);
+ if (delta == null) {
+ delta = new CompilationUnitDelta(cu, time);
+ fDeltaCache.put(cu, delta);
+ }
+ return delta;
}
-
+
/**
- * Returns whether the given frame's declaring type was changed
- * based on the given list of changed class names.
+ * Returns whether the given frame's declaring type was changed based on the
+ * given list of changed class names.
*/
- protected boolean containsChangedType(JDIStackFrame frame, List replacedClassNames) throws DebugException {
- String declaringTypeName= frame.getDeclaringTypeName();
+ protected boolean containsChangedType(JDIStackFrame frame,
+ List<String> replacedClassNames) throws DebugException {
+ String declaringTypeName = frame.getDeclaringTypeName();
// Check if the frame's declaring type was changed
if (replacedClassNames.contains(declaringTypeName)) {
return true;
}
- // Check if one of the frame's declaring type's inner classes have changed
- Iterator iter= replacedClassNames.iterator();
+ // Check if one of the frame's declaring type's inner classes have
+ // changed
+ Iterator<String> iter = replacedClassNames.iterator();
int index;
- String className= null;
+ String className = null;
while (iter.hasNext()) {
- className= (String) iter.next();
- index= className.indexOf('$');
- if (index > -1 && declaringTypeName.equals(className.substring(0, index))) {
+ className = iter.next();
+ index = className.indexOf('$');
+ if (index > -1
+ && declaringTypeName.equals(className.substring(0, index))) {
return true;
}
}
return false;
}
-
+
/**
* Performs a "step into" operation on the given threads.
*/
- protected void attemptStepIn(List threads) throws DebugException {
- Iterator iter= threads.iterator();
+ protected void attemptStepIn(List<IThread> threads) throws DebugException {
+ Iterator<IThread> iter = threads.iterator();
while (iter.hasNext()) {
((JDIThread) iter.next()).stepInto();
}
}
-
+
/**
- * Returns the compilation unit associated with this
- * Java stack frame. Returns <code>null</code> for a binary
- * stack frame.
+ * Returns the compilation unit associated with this Java stack frame.
+ * Returns <code>null</code> for a binary stack frame.
*/
protected ICompilationUnit getCompilationUnit(IJavaStackFrame frame) {
- ILaunch launch= frame.getLaunch();
+ ILaunch launch = frame.getLaunch();
if (launch == null) {
return null;
}
- ISourceLocator locator= launch.getSourceLocator();
+ ISourceLocator locator = launch.getSourceLocator();
if (locator == null) {
return null;
}
IJavaDebugTarget target = (IJavaDebugTarget) frame.getDebugTarget();
String def = target.getDefaultStratum();
target.setDefaultStratum("Java"); //$NON-NLS-1$
- Object sourceElement= locator.getSourceElement(frame);
+ Object sourceElement = locator.getSourceElement(frame);
target.setDefaultStratum(def);
- if (!(sourceElement instanceof IJavaElement) && sourceElement instanceof IAdaptable) {
- sourceElement = ((IAdaptable)sourceElement).getAdapter(IJavaElement.class);
+ if (!(sourceElement instanceof IJavaElement)
+ && sourceElement instanceof IAdaptable) {
+ sourceElement = ((IAdaptable) sourceElement)
+ .getAdapter(IJavaElement.class);
}
if (sourceElement instanceof IType) {
- return ((IType)sourceElement).getCompilationUnit();
+ return ((IType) sourceElement).getCompilationUnit();
}
if (sourceElement instanceof ICompilationUnit) {
- return (ICompilationUnit)sourceElement;
+ return (ICompilationUnit) sourceElement;
}
return null;
}
-
+
/**
- * Returns the method in which this stack frame is
- * suspended or <code>null</code> if none can be found
+ * Returns the method in which this stack frame is suspended or
+ * <code>null</code> if none can be found
*/
- public IMethod getMethod(JDIStackFrame frame, ICompilationUnit unit) throws CoreException {
- String declaringTypeName= frame.getDeclaringTypeName();
- String methodName= frame.getMethodName();
- String[] arguments= null;
+ public IMethod getMethod(JDIStackFrame frame, ICompilationUnit unit)
+ throws CoreException {
+ String declaringTypeName = frame.getDeclaringTypeName();
+ String methodName = frame.getMethodName();
+ String[] arguments = null;
try {
- arguments= Signature.getParameterTypes(frame.getSignature());
+ arguments = Signature.getParameterTypes(frame.getSignature());
} catch (IllegalArgumentException exception) {
// If Signature can't parse the signature, we can't
// create the method
@@ -979,37 +1098,37 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
}
return null;
}
-
+
/**
* Given a fully qualified name, return the unqualified name.
*/
protected String getUnqualifiedName(String qualifiedName) {
- int index= qualifiedName.lastIndexOf('.');
+ int index = qualifiedName.lastIndexOf('.');
return qualifiedName.substring(index + 1);
}
-
+
/**
- * Notify the given frames that a drop to frame has failed after
- * an HCR with the given class names.
+ * Notify the given frames that a drop to frame has failed after an HCR with
+ * the given class names.
*/
- private void notifyFailedDrop(List frames, List replacedClassNames) throws DebugException {
- JDIStackFrame frame;
- Iterator iter= frames.iterator();
- while (iter.hasNext()) {
- frame= (JDIStackFrame) iter.next();
+ private void notifyFailedDrop(List<IJavaStackFrame> frames, List<String> replacedClassNames)
+ throws DebugException {
+ for(IJavaStackFrame frame : frames) {
if (replacedClassNames.contains(frame.getDeclaringTypeName())) {
- frame.setOutOfSynch(true);
+ ((JDIStackFrame)frame).setOutOfSynch(true);
}
}
}
+
/**
- * Returns the class file visitor after visiting the resource change.
- * The visitor contains the changed class files and qualified type names.
- * Returns <code>null</code> if the visitor encounters an exception,
- * or the delta is not a POST_BUILD.
+ * Returns the class file visitor after visiting the resource change. The
+ * visitor contains the changed class files and qualified type names.
+ * Returns <code>null</code> if the visitor encounters an exception, or the
+ * delta is not a POST_BUILD.
*/
- protected ChangedClassFilesVisitor getChangedClassFiles(IResourceChangeEvent event) {
- IResourceDelta delta= event.getDelta();
+ protected ChangedClassFilesVisitor getChangedClassFiles(
+ IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
if (event.getType() != IResourceChangeEvent.POST_BUILD || delta == null) {
return null;
}
@@ -1022,7 +1141,7 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
}
return fClassfileVisitor;
}
-
+
/**
* A visitor which collects changed class files.
*/
@@ -1030,121 +1149,148 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
/**
* The collection of changed class files.
*/
- protected List fFiles= null;
-
+ protected List<IResource> fFiles = null;
+
/**
* Collection of qualified type names, corresponding to class files.
*/
- protected List fNames= null;
-
+ protected List<String> fNames = null;
+
/**
* Answers whether children should be visited.
* <p>
- * If the associated resource is a class file which
- * has been changed, record it.
+ * If the associated resource is a class file which has been changed,
+ * record it.
*/
public boolean visit(IResourceDelta delta) {
- if (delta == null || 0 == (delta.getKind() & IResourceDelta.CHANGED)) {
+ if (delta == null
+ || 0 == (delta.getKind() & IResourceDelta.CHANGED)) {
return false;
}
- IResource resource= delta.getResource();
+ IResource resource = delta.getResource();
if (resource != null) {
switch (resource.getType()) {
- case IResource.FILE :
- if (0 == (delta.getFlags() & IResourceDelta.CONTENT))
- return false;
- if (CLASS_FILE_EXTENSION.equals(resource.getFullPath().getFileExtension())) {
- IPath localLocation = resource.getLocation();
- if (localLocation != null) {
- String path = localLocation.toOSString();
- IClassFileReader reader = ToolFactory.createDefaultClassFileReader(path, IClassFileReader.CLASSFILE_ATTRIBUTES);
- if (reader != null) {
- // this name is slash-delimited
- String qualifiedName = new String(reader.getClassName());
- boolean hasBlockingErrors= false;
- try {
- if (!JDIDebugModel.getPreferences().getBoolean(JDIDebugModel.PREF_HCR_WITH_COMPILATION_ERRORS)) {
- // If the user doesn't want to replace classfiles containing
- // compilation errors, get the source file associated with
- // the class file and query it for compilation errors
- IJavaProject pro = JavaCore.create(resource.getProject());
- ISourceAttribute sourceAttribute = reader.getSourceFileAttribute();
- String sourceName = null;
- if (sourceAttribute != null) {
- sourceName = new String(sourceAttribute.getSourceFileName());
- }
- IResource sourceFile= getSourceFile(pro, qualifiedName, sourceName);
- if (sourceFile != null) {
- IMarker[] problemMarkers= null;
- problemMarkers= sourceFile.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
- for (int i= 0; i < problemMarkers.length; i++) {
- if (problemMarkers[i].getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_ERROR) {
- hasBlockingErrors= true;
- break;
- }
+ case IResource.FILE:
+ if (0 == (delta.getFlags() & IResourceDelta.CONTENT))
+ return false;
+ if (CLASS_FILE_EXTENSION.equals(resource.getFullPath()
+ .getFileExtension())) {
+ IPath localLocation = resource.getLocation();
+ if (localLocation != null) {
+ String path = localLocation.toOSString();
+ IClassFileReader reader = ToolFactory
+ .createDefaultClassFileReader(
+ path,
+ IClassFileReader.CLASSFILE_ATTRIBUTES);
+ if (reader != null) {
+ // this name is slash-delimited
+ String qualifiedName = new String(
+ reader.getClassName());
+ boolean hasBlockingErrors = false;
+ try {
+ if (!Platform.getPreferencesService().getBoolean(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugModel.PREF_HCR_WITH_COMPILATION_ERRORS,
+ true,
+ null)) {
+ // If the user doesn't want to replace
+ // classfiles containing
+ // compilation errors, get the source
+ // file associated with
+ // the class file and query it for
+ // compilation errors
+ IJavaProject pro = JavaCore
+ .create(resource.getProject());
+ ISourceAttribute sourceAttribute = reader
+ .getSourceFileAttribute();
+ String sourceName = null;
+ if (sourceAttribute != null) {
+ sourceName = new String(
+ sourceAttribute
+ .getSourceFileName());
+ }
+ IResource sourceFile = getSourceFile(
+ pro, qualifiedName, sourceName);
+ if (sourceFile != null) {
+ IMarker[] problemMarkers = null;
+ problemMarkers = sourceFile
+ .findMarkers(
+ IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER,
+ true,
+ IResource.DEPTH_INFINITE);
+ for (IMarker problemMarker : problemMarkers) {
+ if (problemMarker.getAttribute(
+ IMarker.SEVERITY, -1) == IMarker.SEVERITY_ERROR) {
+ hasBlockingErrors = true;
+ break;
}
}
}
- } catch (CoreException e) {
- JDIDebugPlugin.log(e);
- }
- if (!hasBlockingErrors) {
- fFiles.add(resource);
- // dot-delimit the name
- fNames.add(qualifiedName.replace('/','.'));
}
+ } catch (CoreException e) {
+ JDIDebugPlugin.log(e);
+ }
+ if (!hasBlockingErrors) {
+ fFiles.add(resource);
+ // dot-delimit the name
+ fNames.add(qualifiedName.replace('/', '.'));
}
}
}
- return false;
-
- default :
- return true;
+ }
+ return false;
+
+ default:
+ return true;
}
}
return true;
}
+
/**
* Resets the file collection to empty
*/
public void reset() {
- fFiles = new ArrayList();
- fNames = new ArrayList();
+ fFiles = new ArrayList<IResource>();
+ fNames = new ArrayList<String>();
}
-
+
/**
* Answers a collection of changed class files or <code>null</code>
*/
- public List getChangedClassFiles() {
+ public List<IResource> getChangedClassFiles() {
return fFiles;
}
-
+
/**
* Returns a collection of qualified type names corresponding to the
* changed class files.
*
* @return List
*/
- public List getQualifiedNamesList() {
+ public List<String> getQualifiedNamesList() {
return fNames;
}
-
+
/**
* Returns the source file associated with the given type, or
* <code>null</code> if no source file could be found.
*
- * @param project the java project containing the classfile
- * @param qualifiedName fully qualified name of the type, slash
- * delimited
- * @param sourceAttribute debug source attribute, or <code>null</code>
- * if none
+ * @param project
+ * the java project containing the classfile
+ * @param qualifiedName
+ * fully qualified name of the type, slash delimited
+ * @param sourceAttribute
+ * debug source attribute, or <code>null</code> if none
*/
- private IResource getSourceFile(IJavaProject project, String qualifiedName, String sourceAttribute) {
+ private IResource getSourceFile(IJavaProject project,
+ String qualifiedName, String sourceAttribute) {
String name = null;
IJavaElement element = null;
try {
- if (sourceAttribute == null) {
- element = JavaDebugUtils.findElement(qualifiedName, project);
+ if (sourceAttribute == null) {
+ element = JavaDebugUtils
+ .findElement(qualifiedName, project);
} else {
int i = qualifiedName.lastIndexOf('/');
if (i > 0) {
@@ -1165,7 +1311,6 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
}
}
-
/**
* Adds the given listener to the collection of hot code replace listeners.
* Listeners are notified when hot code replace attempts succeed or fail.
@@ -1173,122 +1318,134 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
public void addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
fHotCodeReplaceListeners.add(listener);
}
-
+
/**
- * Removes the given listener from the collection of hot code replace listeners.
- * Once a listener is removed, it will no longer be notified of hot code replace
- * attempt successes or failures.
+ * Removes the given listener from the collection of hot code replace
+ * listeners. Once a listener is removed, it will no longer be notified of
+ * hot code replace attempt successes or failures.
*/
- public void removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
+ public void removeHotCodeReplaceListener(
+ IJavaHotCodeReplaceListener listener) {
fHotCodeReplaceListeners.remove(listener);
}
-
+
/**
* @see ILaunchListener#launchRemoved(ILaunch)
*/
public void launchRemoved(ILaunch launch) {
- IDebugTarget[] debugTargets= launch.getDebugTargets();
- for (int i = 0; i < debugTargets.length; i++) {
- IJavaDebugTarget jt = (IJavaDebugTarget)debugTargets[i].getAdapter(IJavaDebugTarget.class);
+ IDebugTarget[] debugTargets = launch.getDebugTargets();
+ for (IDebugTarget debugTarget : debugTargets) {
+ IJavaDebugTarget jt = (IJavaDebugTarget) debugTarget
+ .getAdapter(IJavaDebugTarget.class);
if (jt != null) {
- deregisterTarget((JDIDebugTarget)jt);
+ deregisterTarget((JDIDebugTarget) jt);
}
}
}
/**
- * Begin listening for resource changes when a launch is
- * registered with a hot swapable target.
+ * Begin listening for resource changes when a launch is registered with a
+ * hot swapable target.
*
* @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
*/
public void launchAdded(ILaunch launch) {
- IDebugTarget[] debugTargets= launch.getDebugTargets();
- for (int i = 0; i < debugTargets.length; i++) {
- IJavaDebugTarget jt = (IJavaDebugTarget)debugTargets[i].getAdapter(IJavaDebugTarget.class);
+ IDebugTarget[] debugTargets = launch.getDebugTargets();
+ for (IDebugTarget debugTarget : debugTargets) {
+ IJavaDebugTarget jt = (IJavaDebugTarget) debugTarget
+ .getAdapter(IJavaDebugTarget.class);
if (jt != null) {
- JDIDebugTarget target = (JDIDebugTarget)jt;
+ JDIDebugTarget target = (JDIDebugTarget) jt;
if (target.supportsHotCodeReplace()) {
addHotSwapTarget(target);
- } else if (target.isAvailable()){
+ } else if (target.isAvailable()) {
addNonHotSwapTarget(target);
- }
+ }
}
}
synchronized (this) {
if (!fHotSwapTargets.isEmpty() || !fNoHotSwapTargets.isEmpty()) {
- getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_BUILD);
- }
+ getWorkspace().addResourceChangeListener(this,
+ IResourceChangeEvent.POST_BUILD);
+ }
}
}
-
+
/**
- * Begin listening for resource changes when a launch is
- * registered with a hot swapable target.
+ * Begin listening for resource changes when a launch is registered with a
+ * hot swapable target.
*
* @see ILaunchListener#launchChanged(ILaunch)
*/
public void launchChanged(ILaunch launch) {
launchAdded(launch);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse
+ * .debug.core.DebugEvent[])
*/
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
+ for (DebugEvent event : events) {
if (event.getKind() == DebugEvent.TERMINATE) {
Object source = event.getSource();
- if (source instanceof IAdaptable && source instanceof IDebugTarget) {
- IJavaDebugTarget jt = (IJavaDebugTarget)((IAdaptable)source).getAdapter(IJavaDebugTarget.class);
+ if (source instanceof IAdaptable
+ && source instanceof IDebugTarget) {
+ IJavaDebugTarget jt = (IJavaDebugTarget) ((IAdaptable) source)
+ .getAdapter(IJavaDebugTarget.class);
if (jt != null) {
- deregisterTarget((JDIDebugTarget)jt);
- }
+ deregisterTarget((JDIDebugTarget) jt);
+ }
}
}
}
}
-
+
protected void deregisterTarget(JDIDebugTarget target) {
// Remove the target from its hot swap target cache.
if (!fHotSwapTargets.remove(target)) {
fNoHotSwapTargets.remove(target);
}
- ILaunch[] launches= DebugPlugin.getDefault().getLaunchManager().getLaunches();
+ ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager()
+ .getLaunches();
// If there are no more active JDIDebugTargets, stop
// listening to resource changes.
- for (int i= 0; i < launches.length; i++) {
- IDebugTarget[] targets = launches[i].getDebugTargets();
- for (int j = 0; j < targets.length; j++) {
- IDebugTarget debugTarget = targets[j];
- IJavaDebugTarget jt = (IJavaDebugTarget)debugTarget.getAdapter(IJavaDebugTarget.class);
+ for (ILaunch launche : launches) {
+ IDebugTarget[] targets = launche.getDebugTargets();
+ for (IDebugTarget debugTarget : targets) {
+ IJavaDebugTarget jt = (IJavaDebugTarget) debugTarget
+ .getAdapter(IJavaDebugTarget.class);
if (jt != null) {
- if (((JDIDebugTarget)jt).isAvailable()) {
+ if (((JDIDebugTarget) jt).isAvailable()) {
return;
}
}
}
}
}
-
+
/**
- * Adds the given target to the list of hot-swappable targets.
- * Has no effect if the target is already registered.
+ * Adds the given target to the list of hot-swappable targets. Has no effect
+ * if the target is already registered.
*
- * @param target a target that supports hot swap
+ * @param target
+ * a target that supports hot swap
*/
protected synchronized void addHotSwapTarget(JDIDebugTarget target) {
if (!fHotSwapTargets.contains(target)) {
fHotSwapTargets.add(target);
}
}
-
+
/**
- * Adds the given target to the list of non hot-swappable targets.
- * Has no effect if the target is already registered.
+ * Adds the given target to the list of non hot-swappable targets. Has no
+ * effect if the target is already registered.
*
- * @param target a target that does not support hot swap
+ * @param target
+ * a target that does not support hot swap
*/
protected synchronized void addNonHotSwapTarget(JDIDebugTarget target) {
if (!fNoHotSwapTargets.contains(target)) {
@@ -1297,4 +1454,3 @@ public class JavaHotCodeReplaceManager implements IResourceChangeListener, ILaun
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/MethodSearchVisitor.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/MethodSearchVisitor.java
index 10580ddc8..b8b18500f 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/MethodSearchVisitor.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/hcr/MethodSearchVisitor.java
@@ -103,324 +103,497 @@ import org.eclipse.jdt.core.dom.WildcardType;
* Visits an AST to find a method declaration
*/
public class MethodSearchVisitor extends ASTVisitor {
-
- /**
- * Method to search for
- */
- private String fName;
- private String[] fParameterTypes;
-
- /**
- * The search result, or <code>null</code> if none
- */
- private MethodDeclaration fMatch;
-
- /**
- * Sets the signature of the method to search for
- *
- * @param methodName name of method to search for
- * @param methodSignature signature of the method to search for
- */
- public void setTargetMethod(String methodName, String methodSignature) {
- fName = methodName;
- fParameterTypes = Signature.getParameterTypes(methodSignature);
- // convert parameter types same format that we get from the AST type bindings
- for (int i = 0; i < fParameterTypes.length; i++) {
- String type = fParameterTypes[i];
- type = type.replace('/','.');
- fParameterTypes[i] = type;
- }
- fMatch = null;
- }
-
- /**
- * Returns the search result, or <code>null</code> if none
- *
- * @return matching method declartion or <code>null</code>
- */
- public MethodDeclaration getMatch() {
- return fMatch;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodDeclaration)
- */
- public boolean visit(MethodDeclaration node) {
- if (node.getName().getIdentifier().equals(fName)) {
- IMethodBinding methodBinding = node.resolveBinding();
- if (methodBinding != null) {
- ITypeBinding[] typeBindings = methodBinding.getParameterTypes();
- if (typeBindings.length == fParameterTypes.length) {
- for (int i = 0; i < typeBindings.length; i++) {
- ITypeBinding typeBinding = typeBindings[i];
- String typeSignature = Signature.createTypeSignature(typeBinding.getQualifiedName(), true);
- if (!fParameterTypes[i].equals(typeSignature)) {
- return true;
- }
- }
- fMatch = node;
- }
- }
- }
- return isSearching();
- }
-
- /**
- * Returns whether this visitor is still searching for a match.
- *
- * @return whether this visitor is still searching for a match
- */
- private boolean isSearching() {
- return fMatch == null;
- }
- public boolean visit(AnnotationTypeDeclaration node) {
- return isSearching();
- }
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- return isSearching();
- }
- public boolean visit(AnonymousClassDeclaration node) {
- return isSearching();
- }
- public boolean visit(ArrayAccess node) {
- return isSearching();
- }
- public boolean visit(ArrayCreation node) {
- return isSearching();
- }
- public boolean visit(ArrayInitializer node) {
- return isSearching();
- }
- public boolean visit(ArrayType node) {
- return isSearching();
- }
- public boolean visit(AssertStatement node) {
- return isSearching();
- }
- public boolean visit(Assignment node) {
- return isSearching();
- }
- public boolean visit(Block node) {
- return isSearching();
- }
- public boolean visit(BlockComment node) {
- return isSearching();
- }
- public boolean visit(BooleanLiteral node) {
- return isSearching();
- }
- public boolean visit(BreakStatement node) {
- return isSearching();
- }
- public boolean visit(CastExpression node) {
- return isSearching();
- }
- public boolean visit(CatchClause node) {
- return isSearching();
- }
- public boolean visit(CharacterLiteral node) {
- return isSearching();
- }
- public boolean visit(ClassInstanceCreation node) {
- return isSearching();
- }
- public boolean visit(CompilationUnit node) {
- return isSearching();
- }
- public boolean visit(ConditionalExpression node) {
- return isSearching();
- }
- public boolean visit(ConstructorInvocation node) {
- return isSearching();
- }
- public boolean visit(ContinueStatement node) {
- return isSearching();
- }
- public boolean visit(DoStatement node) {
- return isSearching();
- }
- public boolean visit(EmptyStatement node) {
- return isSearching();
- }
- public boolean visit(EnhancedForStatement node) {
- return isSearching();
- }
- public boolean visit(EnumConstantDeclaration node) {
- return isSearching();
- }
- public boolean visit(EnumDeclaration node) {
- return isSearching();
- }
- public boolean visit(ExpressionStatement node) {
- return isSearching();
- }
- public boolean visit(FieldAccess node) {
- return isSearching();
- }
- public boolean visit(FieldDeclaration node) {
- return isSearching();
- }
- public boolean visit(ForStatement node) {
- return isSearching();
- }
- public boolean visit(IfStatement node) {
- return isSearching();
- }
- public boolean visit(ImportDeclaration node) {
- return isSearching();
- }
- public boolean visit(InfixExpression node) {
- return isSearching();
- }
- public boolean visit(Initializer node) {
- return isSearching();
- }
- public boolean visit(InstanceofExpression node) {
- return isSearching();
- }
- public boolean visit(Javadoc node) {
- return isSearching();
- }
- public boolean visit(LabeledStatement node) {
- return isSearching();
- }
- public boolean visit(LineComment node) {
- return isSearching();
- }
- public boolean visit(MarkerAnnotation node) {
- return isSearching();
- }
- public boolean visit(MemberRef node) {
- return isSearching();
- }
- public boolean visit(MemberValuePair node) {
- return isSearching();
- }
- public boolean visit(MethodInvocation node) {
- return isSearching();
- }
- public boolean visit(MethodRef node) {
- return isSearching();
- }
- public boolean visit(MethodRefParameter node) {
- return isSearching();
- }
- public boolean visit(Modifier node) {
- return isSearching();
- }
- public boolean visit(NormalAnnotation node) {
- return isSearching();
- }
- public boolean visit(NullLiteral node) {
- return isSearching();
- }
- public boolean visit(NumberLiteral node) {
- return isSearching();
- }
- public boolean visit(PackageDeclaration node) {
- return isSearching();
- }
- public boolean visit(ParameterizedType node) {
- return isSearching();
- }
- public boolean visit(ParenthesizedExpression node) {
- return isSearching();
- }
- public boolean visit(PostfixExpression node) {
- return isSearching();
- }
- public boolean visit(PrefixExpression node) {
- return isSearching();
- }
- public boolean visit(PrimitiveType node) {
- return isSearching();
- }
- public boolean visit(QualifiedName node) {
- return isSearching();
- }
- public boolean visit(QualifiedType node) {
- return isSearching();
- }
- public boolean visit(ReturnStatement node) {
- return isSearching();
- }
- public boolean visit(SimpleName node) {
- return isSearching();
- }
- public boolean visit(SimpleType node) {
- return isSearching();
- }
- public boolean visit(SingleMemberAnnotation node) {
- return isSearching();
- }
- public boolean visit(SingleVariableDeclaration node) {
- return isSearching();
- }
- public boolean visit(StringLiteral node) {
- return isSearching();
- }
- public boolean visit(SuperConstructorInvocation node) {
- return isSearching();
- }
- public boolean visit(SuperFieldAccess node) {
- return isSearching();
- }
- public boolean visit(SuperMethodInvocation node) {
- return isSearching();
- }
- public boolean visit(SwitchCase node) {
- return isSearching();
- }
- public boolean visit(SwitchStatement node) {
- return isSearching();
- }
- public boolean visit(SynchronizedStatement node) {
- return isSearching();
- }
- public boolean visit(TagElement node) {
- return isSearching();
- }
- public boolean visit(TextElement node) {
- return isSearching();
- }
- public boolean visit(ThisExpression node) {
- return isSearching();
- }
- public boolean visit(ThrowStatement node) {
- return isSearching();
- }
- public boolean visit(TryStatement node) {
- return isSearching();
- }
- public boolean visit(TypeDeclaration node) {
- return isSearching();
- }
- public boolean visit(TypeDeclarationStatement node) {
- return isSearching();
- }
- public boolean visit(TypeLiteral node) {
- return isSearching();
- }
- public boolean visit(TypeParameter node) {
- return isSearching();
- }
- public boolean visit(UnionType node) {
- return super.visit(node);
- }
- public boolean visit(VariableDeclarationExpression node) {
- return isSearching();
- }
- public boolean visit(VariableDeclarationFragment node) {
- return isSearching();
- }
- public boolean visit(VariableDeclarationStatement node) {
- return isSearching();
- }
- public boolean visit(WhileStatement node) {
- return isSearching();
- }
- public boolean visit(WildcardType node) {
- return isSearching();
- }
+
+ /**
+ * Method to search for
+ */
+ private String fName;
+ private String[] fParameterTypes;
+
+ /**
+ * The search result, or <code>null</code> if none
+ */
+ private MethodDeclaration fMatch;
+
+ /**
+ * Sets the signature of the method to search for
+ *
+ * @param methodName
+ * name of method to search for
+ * @param methodSignature
+ * signature of the method to search for
+ */
+ public void setTargetMethod(String methodName, String methodSignature) {
+ fName = methodName;
+ fParameterTypes = Signature.getParameterTypes(methodSignature);
+ // convert parameter types same format that we get from the AST type
+ // bindings
+ for (int i = 0; i < fParameterTypes.length; i++) {
+ String type = fParameterTypes[i];
+ type = type.replace('/', '.');
+ fParameterTypes[i] = type;
+ }
+ fMatch = null;
+ }
+
+ /**
+ * Returns the search result, or <code>null</code> if none
+ *
+ * @return matching method declartion or <code>null</code>
+ */
+ public MethodDeclaration getMatch() {
+ return fMatch;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.
+ * MethodDeclaration)
+ */
+ @Override
+ public boolean visit(MethodDeclaration node) {
+ if (node.getName().getIdentifier().equals(fName)) {
+ IMethodBinding methodBinding = node.resolveBinding();
+ if (methodBinding != null) {
+ ITypeBinding[] typeBindings = methodBinding.getParameterTypes();
+ if (typeBindings.length == fParameterTypes.length) {
+ for (int i = 0; i < typeBindings.length; i++) {
+ ITypeBinding typeBinding = typeBindings[i];
+ String typeSignature = Signature.createTypeSignature(
+ typeBinding.getQualifiedName(), true);
+ if (!fParameterTypes[i].equals(typeSignature)) {
+ return true;
+ }
+ }
+ fMatch = node;
+ }
+ }
+ }
+ return isSearching();
+ }
+
+ /**
+ * Returns whether this visitor is still searching for a match.
+ *
+ * @return whether this visitor is still searching for a match
+ */
+ private boolean isSearching() {
+ return fMatch == null;
+ }
+
+ @Override
+ public boolean visit(AnnotationTypeDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(AnnotationTypeMemberDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(AnonymousClassDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ArrayAccess node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ArrayCreation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ArrayInitializer node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ArrayType node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(AssertStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(Assignment node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(Block node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(BlockComment node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(BooleanLiteral node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(BreakStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(CastExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(CatchClause node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(CharacterLiteral node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ClassInstanceCreation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(CompilationUnit node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ConditionalExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ConstructorInvocation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ContinueStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(DoStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(EmptyStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(EnhancedForStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(EnumConstantDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(EnumDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ExpressionStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(FieldAccess node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(FieldDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ForStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(IfStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ImportDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(InfixExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(Initializer node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(InstanceofExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(Javadoc node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(LabeledStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(LineComment node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(MarkerAnnotation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(MemberRef node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(MemberValuePair node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(MethodInvocation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(MethodRef node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(MethodRefParameter node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(Modifier node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(NormalAnnotation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(NullLiteral node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(NumberLiteral node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(PackageDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ParameterizedType node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ParenthesizedExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(PostfixExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(PrefixExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(PrimitiveType node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(QualifiedName node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(QualifiedType node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ReturnStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SimpleName node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SimpleType node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SingleMemberAnnotation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SingleVariableDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(StringLiteral node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SuperConstructorInvocation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SuperFieldAccess node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SuperMethodInvocation node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SwitchCase node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SwitchStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(SynchronizedStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(TagElement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(TextElement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ThisExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(ThrowStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(TryStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(TypeDeclaration node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(TypeDeclarationStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(TypeLiteral node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(TypeParameter node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(UnionType node) {
+ return super.visit(node);
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationExpression node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationFragment node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(WhileStatement node) {
+ return isSearching();
+ }
+
+ @Override
+ public boolean visit(WildcardType node) {
+ return isSearching();
+ }
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/IJavaStructuresListener.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/IJavaStructuresListener.java
index c3164c128..5086e58bf 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/IJavaStructuresListener.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/IJavaStructuresListener.java
@@ -11,15 +11,14 @@
package org.eclipse.jdt.internal.debug.core.logicalstructures;
/**
- * Listener which can be notified when the Java logical
- * structures are changed in some way.
+ * Listener which can be notified when the Java logical structures are changed
+ * in some way.
*/
public interface IJavaStructuresListener {
- /**
- * Notifies this listener that the Java logical structures
- * have changed.
- */
- public void logicalStructuresChanged();
-
+ /**
+ * Notifies this listener that the Java logical structures have changed.
+ */
+ public void logicalStructuresChanged();
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIAllInstancesValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIAllInstancesValue.java
index a659b3020..d27de37df 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIAllInstancesValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIAllInstancesValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,8 +26,8 @@ import org.eclipse.jdt.internal.debug.core.model.JDIReferenceType;
import com.ibm.icu.text.MessageFormat;
/**
- * Java value containing an array of java objects. This value is used to hold a list of
- * all instances of a specific java type.
+ * Java value containing an array of java objects. This value is used to hold a
+ * list of all instances of a specific java type.
*
* @since 3.3
* @see org.eclipse.jdt.internal.debug.ui.heapwalking.AllInstancesActionDelegate
@@ -38,13 +38,15 @@ public class JDIAllInstancesValue extends JDIArrayValue {
private JDIReferenceType fRoot;
private IJavaArrayType fType;
private boolean fIsMoreThanPreference;
-
+
/**
- * Constructor, specifies whether there are more instances available than should be
- * displayed according to the user's preference settings.
+ * Constructor, specifies whether there are more instances available than
+ * should be displayed according to the user's preference settings.
*
- * @param target the target VM
- * @param root the root object to get instances for
+ * @param target
+ * the target VM
+ * @param root
+ * the root object to get instances for
*/
public JDIAllInstancesValue(JDIDebugTarget target, JDIReferenceType root) {
super(target, null);
@@ -54,27 +56,31 @@ public class JDIAllInstancesValue extends JDIArrayValue {
if (javaTypes.length > 0) {
fType = (IJavaArrayType) javaTypes[0];
}
- } catch (DebugException e) {}
+ } catch (DebugException e) {
+ }
}
-
+
/**
* @return an array of java objects that are instances of the root type
*/
- protected IJavaObject[] getInstances(){
- if (fInstances != null){
+ protected IJavaObject[] getInstances() {
+ if (fInstances != null) {
return fInstances;
} else {
IJavaObject[] instances = new IJavaObject[0];
fIsMoreThanPreference = false;
- if (fRoot != null){
- int max = HeapWalkingManager.getDefault().getAllInstancesMaxCount();
- try{
- if (max == 0){
+ if (fRoot != null) {
+ int max = HeapWalkingManager.getDefault()
+ .getAllInstancesMaxCount();
+ try {
+ if (max == 0) {
instances = fRoot.getInstances(max);
} else {
- instances = fRoot.getInstances(max+1);
- if (instances.length > max){
- instances[max] = new JDIPlaceholderValue((JDIDebugTarget)fRoot.getDebugTarget(),MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_2,new String[]{Integer.toString(max)}));
+ instances = fRoot.getInstances(max + 1);
+ if (instances.length > max) {
+ instances[max] = new JDIPlaceholderValue(
+ (JDIDebugTarget) fRoot.getDebugTarget(),
+ MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_2, Integer.toString(max)));
fIsMoreThanPreference = true;
}
}
@@ -87,59 +93,86 @@ public class JDIAllInstancesValue extends JDIArrayValue {
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getLength()
*/
+ @Override
public synchronized int getLength() throws DebugException {
return getInstances().length;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getSize()
*/
+ @Override
public int getSize() throws DebugException {
return getInstances().length;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getValue(int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getValue(int)
*/
+ @Override
public IJavaValue getValue(int index) throws DebugException {
- if(index > getInstances().length-1 || index < 0) {
+ if (index > getInstances().length - 1 || index < 0) {
internalError(LogicalStructuresMessages.JDIAllInstancesValue_0);
}
return getInstances()[index];
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getValues()
*/
+ @Override
public IJavaValue[] getValues() throws DebugException {
return getInstances();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getVariable(int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getVariable(int)
*/
+ @Override
public IVariable getVariable(int offset) throws DebugException {
- if(offset > getInstances().length-1 || offset < 0) {
+ if (offset > getInstances().length - 1 || offset < 0) {
internalError(LogicalStructuresMessages.JDIAllInstancesValue_1);
}
- if(isMoreThanPreference() && offset == getInstances().length-1){
- return new JDIPlaceholderVariable(LogicalStructuresMessages.JDIAllInstancesValue_4, getInstances()[offset]);
+ if (isMoreThanPreference() && offset == getInstances().length - 1) {
+ return new JDIPlaceholderVariable(
+ LogicalStructuresMessages.JDIAllInstancesValue_4,
+ getInstances()[offset]);
} else {
- return new JDIPlaceholderVariable(MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_5,new String[]{Integer.toString(offset)}), getInstances()[offset]);
+ return new JDIPlaceholderVariable(MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_5,
+ Integer.toString(offset)),
+ getInstances()[offset]);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getVariables(int, int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getVariables(int,
+ * int)
*/
- public IVariable[] getVariables(int offset, int length) throws DebugException {
- if (length == 0){
+ @Override
+ public IVariable[] getVariables(int offset, int length)
+ throws DebugException {
+ if (length == 0) {
return new IVariable[0];
}
- if(offset > getInstances().length-1 || offset < 0) {
+ if (offset > getInstances().length - 1 || offset < 0) {
internalError(LogicalStructuresMessages.JDIAllInstancesValue_1);
}
IVariable[] vars = new JDIPlaceholderVariable[length];
@@ -148,112 +181,152 @@ public class JDIAllInstancesValue extends JDIArrayValue {
}
return vars;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getVariables()
*/
+ @Override
public IVariable[] getVariables() throws DebugException {
return getVariables(0, getInstances().length);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getReferringObjects(long)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getReferringObjects
+ * (long)
*/
+ @Override
public IJavaObject[] getReferringObjects(long max) throws DebugException {
return new IJavaObject[0];
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#isAllocated()
*/
+ @Override
public boolean isAllocated() throws DebugException {
return getJavaDebugTarget().isAvailable();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getInitialOffset()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#getInitialOffset
+ * ()
*/
+ @Override
public int getInitialOffset() {
return 0;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#hasVariables()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIArrayValue#hasVariables()
*/
+ @Override
public boolean hasVariables() throws DebugException {
return getInstances().length > 0;
- }
-
- /* (non-Javadoc)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getJavaType()
*/
+ @Override
public IJavaType getJavaType() throws DebugException {
return fType;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getSignature()
*/
+ @Override
public String getSignature() throws DebugException {
return fType.getSignature();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getReferenceTypeName()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getReferenceTypeName
+ * ()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
return fType.getName();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getValueString()
*/
+ @Override
public String getValueString() throws DebugException {
- if (isMoreThanPreference()){
- return MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_7,new String[]{Integer.toString(getInstances().length-1)});
+ if (isMoreThanPreference()) {
+ return MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_7,
+ Integer.toString(getInstances().length - 1));
} else if (getInstances().length == 1) {
- return MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_8,new String[]{Integer.toString(getInstances().length)});
+ return MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_8,
+ Integer.toString(getInstances().length));
} else {
- return MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_9,new String[]{Integer.toString(getInstances().length)});
+ return MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_9,
+ Integer.toString(getInstances().length));
}
}
-
+
/**
- * Returns a string representation of this value intended to be displayed
- * in the detail pane of views. Lists the references on separate lines.
+ * Returns a string representation of this value intended to be displayed in
+ * the detail pane of views. Lists the references on separate lines.
*
- * @return a string representation of this value to display in the detail pane
+ * @return a string representation of this value to display in the detail
+ * pane
*/
- public String getDetailString(){
+ public String getDetailString() {
StringBuffer buf = new StringBuffer();
Object[] elements = getInstances();
- if (elements.length == 0){
+ if (elements.length == 0) {
buf.append(LogicalStructuresMessages.JDIAllInstancesValue_10);
- }
- else{
+ } else {
String length = null;
- if (isMoreThanPreference()){
- length = MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_11,new String[]{Integer.toString(elements.length-1)});
+ if (isMoreThanPreference()) {
+ length = MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_11,
+ Integer.toString(elements.length - 1));
} else {
length = Integer.toString(elements.length);
}
- if (elements.length == 1){
- buf.append(MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_12,new String[]{length}));
+ if (elements.length == 1) {
+ buf.append(MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_12, length));
} else {
- buf.append(MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_13,new String[]{length}));
+ buf.append(MessageFormat.format(LogicalStructuresMessages.JDIAllInstancesValue_13, length));
+ }
+ for (Object element : elements) {
+ buf.append(element + "\n"); //$NON-NLS-1$
}
- for (int i = 0; i < elements.length; i++) {
- buf.append(elements[i] + "\n"); //$NON-NLS-1$
- }
}
return buf.toString();
}
-
+
/**
- * @return whether there are more instances available than should be displayed
+ * @return whether there are more instances available than should be
+ * displayed
*/
protected boolean isMoreThanPreference() {
- getInstances(); //The instances must be requested to know if there are more than the preference
+ getInstances(); // The instances must be requested to know if there are
+ // more than the preference
return fIsMoreThanPreference;
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIPlaceholderVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIPlaceholderVariable.java
index 01896eb7a..5751c3ee6 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIPlaceholderVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIPlaceholderVariable.java
@@ -21,17 +21,18 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
/**
- * Encapsulates a name and a value. Used when a variable is required (such as for
- * the VariablesView), but we only have a value available (such as the result of
- * an evaluation for an object browser).
+ * Encapsulates a name and a value. Used when a variable is required (such as
+ * for the VariablesView), but we only have a value available (such as the
+ * result of an evaluation for an object browser).
*
* @since 3.0
*/
-public class JDIPlaceholderVariable extends PlatformObject implements IJavaVariable {
+public class JDIPlaceholderVariable extends PlatformObject implements
+ IJavaVariable {
private String fName;
private IJavaValue fValue;
-
+
/**
* When created for a logical structure we hold onto the original
* non-logical value for purposes of equality. This way a logical
@@ -45,209 +46,280 @@ public class JDIPlaceholderVariable extends PlatformObject implements IJavaVaria
fName = name;
fValue = value;
}
-
+
/**
* Constructs a place holder with the given name and value originating from
* the specified logical parent.
*
- * @param name variable name
- * @param value variable value
- * @param logicalParent original value this value is a logical child for or <code>null</code>
- * if none
+ * @param name
+ * variable name
+ * @param value
+ * variable value
+ * @param logicalParent
+ * original value this value is a logical child for or
+ * <code>null</code> if none
*/
- public JDIPlaceholderVariable(String name, IJavaValue value, IJavaValue logicalParent) {
+ public JDIPlaceholderVariable(String name, IJavaValue value,
+ IJavaValue logicalParent) {
this(name, value);
fLogicalParent = logicalParent;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getSignature()
*/
public String getSignature() throws DebugException {
- return ((IJavaValue)getValue()).getSignature();
+ return ((IJavaValue) getValue()).getSignature();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
- return ((IJavaValue)getValue()).getGenericSignature();
+ return ((IJavaValue) getValue()).getGenericSignature();
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getJavaType()
*/
public IJavaType getJavaType() throws DebugException {
- return ((IJavaValue)getValue()).getJavaType();
+ return ((IJavaValue) getValue()).getJavaType();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#isLocal()
*/
public boolean isLocal() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IVariable#getValue()
*/
public IValue getValue() {
return fValue;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IVariable#getName()
*/
public String getName() {
return fName;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
*/
public String getReferenceTypeName() throws DebugException {
- return ((IJavaValue)getValue()).getReferenceTypeName();
+ return ((IJavaValue) getValue()).getReferenceTypeName();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
*/
public boolean hasValueChanged() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isPublic()
*/
public boolean isPublic() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isPrivate()
*/
public boolean isPrivate() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isProtected()
*/
public boolean isProtected() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isPackagePrivate()
*/
public boolean isPackagePrivate() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isFinal()
*/
public boolean isFinal() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isStatic()
*/
public boolean isStatic() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isSynthetic()
*/
public boolean isSynthetic() {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
public String getModelIdentifier() {
return getValue().getModelIdentifier();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
public IDebugTarget getDebugTarget() {
- return ((IJavaValue)getValue()).getDebugTarget();
+ return ((IJavaValue) getValue()).getDebugTarget();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
public ILaunch getLaunch() {
return getValue().getLaunch();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String
+ * )
*/
public void setValue(String expression) {
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.
+ * debug.core.model.IValue)
*/
public void setValue(IValue value) {
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#supportsValueModification
+ * ()
*/
public boolean supportsValueModification() {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang
+ * .String)
*/
public boolean verifyValue(String expression) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse
+ * .debug.core.model.IValue)
*/
public boolean verifyValue(IValue value) {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
- if (IJavaVariable.class.equals(adapter) ||
- IJavaModifiers.class.equals(adapter)) {
+ if (IJavaVariable.class.equals(adapter)
+ || IJavaModifiers.class.equals(adapter)) {
return this;
}
return super.getAdapter(adapter);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof JDIPlaceholderVariable) {
- JDIPlaceholderVariable var = (JDIPlaceholderVariable)obj;
+ JDIPlaceholderVariable var = (JDIPlaceholderVariable) obj;
if (fLogicalParent != null) {
- return var.getName().equals(getName()) && fLogicalParent.equals(var.fLogicalParent);
+ return var.getName().equals(getName())
+ && fLogicalParent.equals(var.fLogicalParent);
} else {
- return var.getName().equals(getName()) && var.getValue().equals(getValue());
+ return var.getName().equals(getName())
+ && var.getValue().equals(getValue());
}
}
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
if (fLogicalParent != null) {
return fLogicalParent.hashCode() + fName.hashCode();
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java
index d04c19e25..7280d1d2b 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -57,8 +57,8 @@ public class JavaLogicalStructure implements ILogicalStructureType {
*/
private String fType;
/**
- * Indicate if this java logical structure should be used on object
- * instance of subtype of the specified type.
+ * Indicate if this java logical structure should be used on object instance
+ * of subtype of the specified type.
*/
private boolean fSubtypes;
/**
@@ -74,16 +74,16 @@ public class JavaLogicalStructure implements ILogicalStructureType {
*/
private String[][] fVariables;
/**
- * The plugin identifier of the plugin which contributed this logical structure
- * or <code>null</code> if this structure was defined by the user.
+ * The plugin identifier of the plugin which contributed this logical
+ * structure or <code>null</code> if this structure was defined by the user.
*/
- private String fContributingPluginId= null;
-
+ private String fContributingPluginId = null;
+
/**
* Performs the evaluations.
*/
private class EvaluationBlock implements IEvaluationListener {
-
+
private IJavaObject fEvaluationValue;
private IJavaReferenceType fEvaluationType;
private IJavaThread fThread;
@@ -92,44 +92,57 @@ public class JavaLogicalStructure implements ILogicalStructureType {
/**
* Constructor
+ *
* @param value
* @param type
* @param thread
* @param evaluationEngine
*/
- public EvaluationBlock(IJavaObject value, IJavaReferenceType type, IJavaThread thread, IAstEvaluationEngine evaluationEngine) {
- fEvaluationValue= value;
- fEvaluationType= type;
- fThread= thread;
- fEvaluationEngine= evaluationEngine;
+ public EvaluationBlock(IJavaObject value, IJavaReferenceType type,
+ IJavaThread thread, IAstEvaluationEngine evaluationEngine) {
+ fEvaluationValue = value;
+ fEvaluationType = type;
+ fThread = thread;
+ fEvaluationEngine = evaluationEngine;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.eval.IEvaluationListener#evaluationComplete(org.eclipse.jdt.debug.eval.IEvaluationResult)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.eval.IEvaluationListener#evaluationComplete
+ * (org.eclipse.jdt.debug.eval.IEvaluationResult)
*/
public void evaluationComplete(IEvaluationResult result) {
- synchronized(this) {
- fResult= result;
+ synchronized (this) {
+ fResult = result;
this.notify();
}
}
/**
- * Evaluates the specified snippet and returns the <code>IJavaValue</code> from the evaluation
- * @param snippet the snippet to evaluate
+ * Evaluates the specified snippet and returns the
+ * <code>IJavaValue</code> from the evaluation
+ *
+ * @param snippet
+ * the snippet to evaluate
* @return the <code>IJavaValue</code> from the evaluation
* @throws DebugException
*/
public IJavaValue evaluate(String snippet) throws DebugException {
- ICompiledExpression compiledExpression= fEvaluationEngine.getCompiledExpression(snippet, fEvaluationType);
+ ICompiledExpression compiledExpression = fEvaluationEngine
+ .getCompiledExpression(snippet, fEvaluationType);
if (compiledExpression.hasErrors()) {
String[] errorMessages = compiledExpression.getErrorMessages();
- log(errorMessages);
- return new JavaStructureErrorValue(errorMessages, fEvaluationValue);
+ log(errorMessages);
+ return new JavaStructureErrorValue(errorMessages,
+ fEvaluationValue);
}
- fResult= null;
- fEvaluationEngine.evaluateExpression(compiledExpression, fEvaluationValue, fThread, this, DebugEvent.EVALUATION_IMPLICIT, false);
- synchronized(this) {
+ fResult = null;
+ fEvaluationEngine.evaluateExpression(compiledExpression,
+ fEvaluationValue, fThread, this,
+ DebugEvent.EVALUATION_IMPLICIT, false);
+ synchronized (this) {
if (fResult == null) {
try {
this.wait();
@@ -138,7 +151,9 @@ public class JavaLogicalStructure implements ILogicalStructureType {
}
}
if (fResult == null) {
- return new JavaStructureErrorValue(LogicalStructuresMessages.JavaLogicalStructure_1, fEvaluationValue);
+ return new JavaStructureErrorValue(
+ LogicalStructuresMessages.JavaLogicalStructure_1,
+ fEvaluationValue);
}
if (fResult.hasErrors()) {
DebugException exception = fResult.getException();
@@ -147,79 +162,104 @@ public class JavaLogicalStructure implements ILogicalStructureType {
if (exception.getStatus().getException() instanceof UnsupportedOperationException) {
message = LogicalStructuresMessages.JavaLogicalStructure_0;
} else if (exception.getStatus().getCode() == IJavaThread.ERR_THREAD_NOT_SUSPENDED) {
- // throw this exception so the content provider can handle if (cancel the update)
+ // throw this exception so the content provider can
+ // handle if (cancel the update)
throw exception;
} else {
- message= MessageFormat.format(LogicalStructuresMessages.JavaLogicalStructure_2, new String[] { exception.getMessage() });
+ message = MessageFormat.format(LogicalStructuresMessages.JavaLogicalStructure_2, exception.getMessage());
}
} else {
- message= LogicalStructuresMessages.JavaLogicalStructure_3;
+ message = LogicalStructuresMessages.JavaLogicalStructure_3;
}
return new JavaStructureErrorValue(message, fEvaluationValue);
}
return fResult.getValue();
}
-
- /**
- * Logs the given error messages if this logical structure was contributed
- * via extension.
- */
- private void log(String[] messages) {
- if (isContributed()) {
- StringBuffer log= new StringBuffer();
- for (int i = 0; i < messages.length; i++) {
- log.append(messages[i]).append('\n');
- }
- JDIDebugPlugin.log(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.ERROR, log.toString(),null));
- }
- }
+
+ /**
+ * Logs the given error messages if this logical structure was
+ * contributed via extension.
+ */
+ private void log(String[] messages) {
+ if (isContributed()) {
+ StringBuffer log = new StringBuffer();
+ for (String message : messages) {
+ log.append(message).append('\n');
+ }
+ JDIDebugPlugin.log(new Status(IStatus.ERROR, JDIDebugPlugin
+ .getUniqueIdentifier(), IStatus.ERROR, log.toString(),
+ null));
+ }
+ }
}
/**
* Constructor from parameters.
*/
- public JavaLogicalStructure(String type, boolean subtypes, String value, String description, String[][] variables) {
- fType= type;
- fSubtypes= subtypes;
- fValue= value;
- fDescription= description;
- fVariables= variables;
+ public JavaLogicalStructure(String type, boolean subtypes, String value,
+ String description, String[][] variables) {
+ fType = type;
+ fSubtypes = subtypes;
+ fValue = value;
+ fDescription = description;
+ fVariables = variables;
}
/**
* Constructor from configuration element.
*/
- public JavaLogicalStructure(IConfigurationElement configurationElement) throws CoreException {
- fType= configurationElement.getAttribute("type"); //$NON-NLS-1$
+ public JavaLogicalStructure(IConfigurationElement configurationElement)
+ throws CoreException {
+ fType = configurationElement.getAttribute("type"); //$NON-NLS-1$
if (fType == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, LogicalStructuresMessages.JavaLogicalStructures_0, null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR,
+ LogicalStructuresMessages.JavaLogicalStructures_0, null));
}
- fSubtypes= Boolean.valueOf(configurationElement.getAttribute("subtypes")).booleanValue(); //$NON-NLS-1$
- fValue= configurationElement.getAttribute("value"); //$NON-NLS-1$
- fDescription= configurationElement.getAttribute("description"); //$NON-NLS-1$
+ fSubtypes = Boolean.valueOf(
+ configurationElement.getAttribute("subtypes")).booleanValue(); //$NON-NLS-1$
+ fValue = configurationElement.getAttribute("value"); //$NON-NLS-1$
+ fDescription = configurationElement.getAttribute("description"); //$NON-NLS-1$
if (fDescription == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, LogicalStructuresMessages.JavaLogicalStructures_4, null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR,
+ LogicalStructuresMessages.JavaLogicalStructures_4, null));
}
- IConfigurationElement[] variableElements= configurationElement.getChildren("variable"); //$NON-NLS-1$
- if (fValue== null && variableElements.length == 0) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, LogicalStructuresMessages.JavaLogicalStructures_1, null));
+ IConfigurationElement[] variableElements = configurationElement
+ .getChildren("variable"); //$NON-NLS-1$
+ if (fValue == null && variableElements.length == 0) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR,
+ LogicalStructuresMessages.JavaLogicalStructures_1, null));
}
- fVariables= new String[variableElements.length][2];
- for (int j= 0; j < fVariables.length; j++) {
- String variableName= variableElements[j].getAttribute("name"); //$NON-NLS-1$
+ fVariables = new String[variableElements.length][2];
+ for (int j = 0; j < fVariables.length; j++) {
+ String variableName = variableElements[j].getAttribute("name"); //$NON-NLS-1$
if (variableName == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, LogicalStructuresMessages.JavaLogicalStructures_2, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.ERROR,
+ LogicalStructuresMessages.JavaLogicalStructures_2,
+ null));
}
- fVariables[j][0]= variableName;
- String variableValue= variableElements[j].getAttribute("value"); //$NON-NLS-1$
+ fVariables[j][0] = variableName;
+ String variableValue = variableElements[j].getAttribute("value"); //$NON-NLS-1$
if (variableValue == null) {
- throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, LogicalStructuresMessages.JavaLogicalStructures_3, null));
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.ERROR,
+ LogicalStructuresMessages.JavaLogicalStructures_3,
+ null));
}
- fVariables[j][1]= variableValue;
+ fVariables[j][1] = variableValue;
}
- fContributingPluginId= configurationElement.getContributor().getName();
+ fContributingPluginId = configurationElement.getContributor().getName();
}
-
+
/**
* @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#providesLogicalStructure(IValue)
*/
@@ -237,63 +277,75 @@ public class JavaLogicalStructure implements ILogicalStructureType {
if (!(value instanceof IJavaObject)) {
return value;
}
- IJavaObject javaValue= (IJavaObject) value;
+ IJavaObject javaValue = (IJavaObject) value;
try {
IJavaReferenceType type = getType(javaValue);
if (type == null) {
return value;
}
- IJavaStackFrame stackFrame= getStackFrame(javaValue);
+ IJavaStackFrame stackFrame = getStackFrame(javaValue);
if (stackFrame == null) {
return value;
}
-
+
// find the project the snippets will be compiled in.
- ISourceLocator locator= javaValue.getLaunch().getSourceLocator();
- Object sourceElement= null;
+ ISourceLocator locator = javaValue.getLaunch().getSourceLocator();
+ Object sourceElement = null;
if (locator instanceof ISourceLookupDirector) {
- String[] sourcePaths= type.getSourcePaths(null);
+ String[] sourcePaths = type.getSourcePaths(null);
if (sourcePaths != null && sourcePaths.length > 0) {
- sourceElement= ((ISourceLookupDirector) locator).getSourceElement(sourcePaths[0]);
+ sourceElement = ((ISourceLookupDirector) locator)
+ .getSourceElement(sourcePaths[0]);
}
- if (!(sourceElement instanceof IJavaElement) && sourceElement instanceof IAdaptable) {
- sourceElement = ((IAdaptable)sourceElement).getAdapter(IJavaElement.class);
+ if (!(sourceElement instanceof IJavaElement)
+ && sourceElement instanceof IAdaptable) {
+ sourceElement = ((IAdaptable) sourceElement)
+ .getAdapter(IJavaElement.class);
}
}
if (sourceElement == null) {
sourceElement = locator.getSourceElement(stackFrame);
- if (!(sourceElement instanceof IJavaElement) && sourceElement instanceof IAdaptable) {
- sourceElement = ((IAdaptable)sourceElement).getAdapter(IJavaElement.class);
+ if (!(sourceElement instanceof IJavaElement)
+ && sourceElement instanceof IAdaptable) {
+ sourceElement = ((IAdaptable) sourceElement)
+ .getAdapter(IJavaElement.class);
}
}
- IJavaProject project= null;
+ IJavaProject project = null;
if (sourceElement instanceof IJavaElement) {
- project= ((IJavaElement) sourceElement).getJavaProject();
+ project = ((IJavaElement) sourceElement).getJavaProject();
} else if (sourceElement instanceof IResource) {
- IJavaProject resourceProject = JavaCore.create(((IResource)sourceElement).getProject());
+ IJavaProject resourceProject = JavaCore
+ .create(((IResource) sourceElement).getProject());
if (resourceProject.exists()) {
- project= resourceProject;
+ project = resourceProject;
}
}
if (project == null) {
return value;
}
-
- IAstEvaluationEngine evaluationEngine= JDIDebugPlugin.getDefault().getEvaluationEngine(project, (IJavaDebugTarget)stackFrame.getDebugTarget());
-
- EvaluationBlock evaluationBlock= new EvaluationBlock(javaValue, type, (IJavaThread)stackFrame.getThread(), evaluationEngine);
+
+ IAstEvaluationEngine evaluationEngine = JDIDebugPlugin.getDefault()
+ .getEvaluationEngine(project,
+ (IJavaDebugTarget) stackFrame.getDebugTarget());
+
+ EvaluationBlock evaluationBlock = new EvaluationBlock(javaValue,
+ type, (IJavaThread) stackFrame.getThread(),
+ evaluationEngine);
if (fValue == null) {
// evaluate each variable
- IJavaVariable[] variables= new IJavaVariable[fVariables.length];
- for (int i= 0; i < fVariables.length; i++) {
- variables[i]= new JDIPlaceholderVariable(fVariables[i][0], evaluationBlock.evaluate(fVariables[i][1]), javaValue);
+ IJavaVariable[] variables = new IJavaVariable[fVariables.length];
+ for (int i = 0; i < fVariables.length; i++) {
+ variables[i] = new JDIPlaceholderVariable(fVariables[i][0],
+ evaluationBlock.evaluate(fVariables[i][1]),
+ javaValue);
}
return new LogicalObjectStructureValue(javaValue, variables);
}
// evaluate the logical value
- IJavaValue logicalValue = evaluationBlock.evaluate(fValue);
- if (logicalValue instanceof JDIValue){
- ((JDIValue)logicalValue).setLogicalParent(javaValue);
+ IJavaValue logicalValue = evaluationBlock.evaluate(fValue);
+ if (logicalValue instanceof JDIValue) {
+ ((JDIValue) logicalValue).setLogicalParent(javaValue);
}
return logicalValue;
@@ -305,19 +357,22 @@ public class JavaLogicalStructure implements ILogicalStructureType {
}
return value;
}
-
+
/**
- * Returns the <code>IJavaReferenceType</code> from the specified <code>IJavaObject</code>
+ * Returns the <code>IJavaReferenceType</code> from the specified
+ * <code>IJavaObject</code>
+ *
* @param value
- * @return the <code>IJavaReferenceType</code> from the specified <code>IJavaObject</code>
+ * @return the <code>IJavaReferenceType</code> from the specified
+ * <code>IJavaObject</code>
*/
private IJavaReferenceType getType(IJavaObject value) {
try {
- IJavaType type= value.getJavaType();
+ IJavaType type = value.getJavaType();
if (!(type instanceof IJavaClassType)) {
return null;
}
- IJavaClassType classType= (IJavaClassType) type;
+ IJavaClassType classType = (IJavaClassType) type;
if (classType.getName().equals(fType)) {
// found the type
return classType;
@@ -326,19 +381,19 @@ public class JavaLogicalStructure implements ILogicalStructureType {
// if not checking the subtypes, stop here
return null;
}
- IJavaClassType superClass= classType.getSuperclass();
+ IJavaClassType superClass = classType.getSuperclass();
while (superClass != null) {
if (superClass.getName().equals(fType)) {
// found the type, it's a super class
return superClass;
}
- superClass= superClass.getSuperclass();
+ superClass = superClass.getSuperclass();
}
- IJavaInterfaceType[] superInterfaces= classType.getAllInterfaces();
- for (int i= 0; i < superInterfaces.length; i++) {
- if (superInterfaces[i].getName().equals(fType)) {
+ IJavaInterfaceType[] superInterfaces = classType.getAllInterfaces();
+ for (IJavaInterfaceType superInterface : superInterfaces) {
+ if (superInterface.getName().equals(fType)) {
// found the type, it's a super interface
- return superInterfaces[i];
+ return superInterface;
}
}
} catch (DebugException e) {
@@ -349,144 +404,177 @@ public class JavaLogicalStructure implements ILogicalStructureType {
}
/**
- * Return the current stack frame context, or a valid stack frame for the given value.
+ * Return the current stack frame context, or a valid stack frame for the
+ * given value.
+ *
* @param value
- * @return the current stack frame context, or a valid stack frame for the given value.
+ * @return the current stack frame context, or a valid stack frame for the
+ * given value.
* @throws CoreException
*/
private IJavaStackFrame getStackFrame(IValue value) throws CoreException {
IStatusHandler handler = getStackFrameProvider();
if (handler != null) {
- IJavaStackFrame stackFrame = (IJavaStackFrame)handler.handleStatus(JDIDebugPlugin.STATUS_GET_EVALUATION_FRAME, value);
+ IJavaStackFrame stackFrame = (IJavaStackFrame) handler
+ .handleStatus(JDIDebugPlugin.STATUS_GET_EVALUATION_FRAME,
+ value);
if (stackFrame != null) {
return stackFrame;
}
}
IDebugTarget target = value.getDebugTarget();
- IJavaDebugTarget javaTarget = (IJavaDebugTarget) target.getAdapter(IJavaDebugTarget.class);
+ IJavaDebugTarget javaTarget = (IJavaDebugTarget) target
+ .getAdapter(IJavaDebugTarget.class);
if (javaTarget != null) {
IThread[] threads = javaTarget.getThreads();
- for (int i = 0; i < threads.length; i++) {
- IThread thread = threads[i];
+ for (IThread thread : threads) {
if (thread.isSuspended()) {
- return (IJavaStackFrame)thread.getTopStackFrame();
+ return (IJavaStackFrame) thread.getTopStackFrame();
}
}
}
return null;
}
-
+
/**
* Returns the singleton stackframe provider
+ *
* @return the singleton stackframe provider
*/
private static IStatusHandler getStackFrameProvider() {
if (fgStackFrameProvider == null) {
- fgStackFrameProvider = DebugPlugin.getDefault().getStatusHandler(JDIDebugPlugin.STATUS_GET_EVALUATION_FRAME);
+ fgStackFrameProvider = DebugPlugin.getDefault().getStatusHandler(
+ JDIDebugPlugin.STATUS_GET_EVALUATION_FRAME);
}
return fgStackFrameProvider;
}
-
+
/**
* Returns if this logical structure should be used for subtypes too.
+ *
* @return if this logical structure should be used for subtypes too.
*/
public boolean isSubtypes() {
return fSubtypes;
}
-
+
/**
* Sets if this logical structure should be used for subtypes or not.
+ *
* @param subtypes
*/
public void setSubtypes(boolean subtypes) {
fSubtypes = subtypes;
}
-
+
/**
* Returns the name of the type this logical structure should be used for.
+ *
* @return the name of the type this logical structure should be used for.
*/
public String getQualifiedTypeName() {
return fType;
}
+
/**
* Sets the name of the type this logical structure should be used for.
+ *
* @param type
*/
public void setType(String type) {
fType = type;
}
+
/**
* Returns the code snippet to use to generate the logical structure.
+ *
* @return the code snippet to use to generate the logical structure.
*/
public String getValue() {
return fValue;
}
+
/**
* Sets the code snippet to use to generate the logical structure.
+ *
* @param value
*/
public void setValue(String value) {
fValue = value;
}
+
/**
* Returns the variables of this logical structure.
+ *
* @return the variables of this logical structure.
*/
public String[][] getVariables() {
return fVariables;
}
+
/**
* Sets the variables of this logical structure.
+ *
* @param variables
*/
public void setVariables(String[][] variables) {
fVariables = variables;
}
+
/**
* Set the description of this logical structure.
+ *
* @param description
*/
public void setDescription(String description) {
fDescription = description;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate2#getDescription(org.eclipse.debug.core.model.IValue)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.ILogicalStructureTypeDelegate2#getDescription
+ * (org.eclipse.debug.core.model.IValue)
*/
public String getDescription(IValue value) {
return getDescription();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILogicalStructureType#getDescription()
- */
- public String getDescription() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.core.ILogicalStructureType#getDescription()
+ */
+ public String getDescription() {
return fDescription;
}
-
- /**
- * Indicates if this logical structure was contributed by a plug-in
- * or defined by a user.
- * @return if this logical structure is contributed
- */
- public boolean isContributed() {
- return fContributingPluginId != null;
- }
-
+
/**
- * Returns the plugin identifier of the plugin which contributed this logical
- * structure or <code>null</code> if this structure was defined by the user.
- * @return the plugin identifier of the plugin which contributed this
- * structure or <code>null</code>
+ * Indicates if this logical structure was contributed by a plug-in or
+ * defined by a user.
+ *
+ * @return if this logical structure is contributed
*/
- public String getContributingPluginId() {
- return fContributingPluginId;
- }
+ public boolean isContributed() {
+ return fContributingPluginId != null;
+ }
+
+ /**
+ * Returns the plugin identifier of the plugin which contributed this
+ * logical structure or <code>null</code> if this structure was defined by
+ * the user.
+ *
+ * @return the plugin identifier of the plugin which contributed this
+ * structure or <code>null</code>
+ */
+ public String getContributingPluginId() {
+ return fContributingPluginId;
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.ILogicalStructureType#getId()
*/
public String getId() {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructures.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructures.java
index 268f3374f..d0c9651ca 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructures.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructures.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,8 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.ILogicalStructureProvider;
import org.eclipse.debug.core.ILogicalStructureType;
@@ -36,84 +38,94 @@ import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
+import org.osgi.service.prefs.BackingStoreException;
public class JavaLogicalStructures implements ILogicalStructureProvider {
-
+
// preference values
- static final char IS_SUBTYPE_TRUE= 'T';
- static final char IS_SUBTYPE_FALSE= 'F';
-
+ static final char IS_SUBTYPE_TRUE = 'T';
+ static final char IS_SUBTYPE_FALSE = 'F';
+
/**
* The list of java logical structures.
*/
- private static Map fJavaLogicalStructureMap;
+ private static Map<String, List<JavaLogicalStructure>> fJavaLogicalStructureMap;
/**
* The list of java logical structures in this Eclipse install.
*/
- private static List fPluginContributedJavaLogicalStructures;
-
+ private static List<JavaLogicalStructure> fPluginContributedJavaLogicalStructures;
+
/**
* The list of java logical structures defined by the user.
*/
- private static List fUserDefinedJavaLogicalStructures;
-
- /**
- * The list of java logical structures listeners.
- */
- private static Set fListeners= new HashSet();
-
+ private static List<JavaLogicalStructure> fUserDefinedJavaLogicalStructures;
+
+ /**
+ * The list of java logical structures listeners.
+ */
+ private static Set<IJavaStructuresListener> fListeners = new HashSet<IJavaStructuresListener>();
+
/**
* Preference key for the list of user defined Java logical structures
*
* @since 3.1
*/
- private static final String PREF_JAVA_LOGICAL_STRUCTURES= JDIDebugModel.getPluginIdentifier() + ".PREF_JAVA_LOGICAL_STRUCTURES"; //$NON-NLS-1$
-
+ private static final String PREF_JAVA_LOGICAL_STRUCTURES = JDIDebugModel
+ .getPluginIdentifier() + ".PREF_JAVA_LOGICAL_STRUCTURES"; //$NON-NLS-1$
+
/**
* Updates user defined logical structures if the preference changes
*/
static class PreferenceListener implements IPropertyChangeListener {
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#
+ * propertyChange
+ * (org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
if (PREF_JAVA_LOGICAL_STRUCTURES.equals(event.getProperty())) {
initUserDefinedJavaLogicalStructures();
- initJavaLogicalStructureMap();
- Iterator iter = fListeners.iterator();
- while (iter.hasNext()) {
- ((IJavaStructuresListener) iter.next()).logicalStructuresChanged();
- }
+ initJavaLogicalStructureMap();
+ Iterator<IJavaStructuresListener> iter = fListeners.iterator();
+ while (iter.hasNext()) {
+ iter.next()
+ .logicalStructuresChanged();
+ }
}
}
-
+
}
-
+
/**
- * Get the logical structure from the extension point and the preference store,
- * and initialize the map.
+ * Get the logical structure from the extension point and the preference
+ * store, and initialize the map.
*/
- static {
+ static {
initPluginContributedJavaLogicalStructure();
initUserDefinedJavaLogicalStructures();
initJavaLogicalStructureMap();
- JDIDebugPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new PreferenceListener());
+ JDIDebugPlugin.getDefault().getPluginPreferences()
+ .addPropertyChangeListener(new PreferenceListener());
}
-
- private static void initJavaLogicalStructureMap() {
- fJavaLogicalStructureMap= new HashMap();
- addAllLogicalStructures(fPluginContributedJavaLogicalStructures);
+
+ private static void initJavaLogicalStructureMap() {
+ fJavaLogicalStructureMap = new HashMap<String, List<JavaLogicalStructure>>();
+ addAllLogicalStructures(fPluginContributedJavaLogicalStructures);
addAllLogicalStructures(fUserDefinedJavaLogicalStructures);
- }
-
+ }
+
/**
* @param pluginContributedJavaLogicalStructures
*/
- private static void addAllLogicalStructures(List pluginContributedJavaLogicalStructures) {
- for (Iterator iter= pluginContributedJavaLogicalStructures.iterator(); iter.hasNext();) {
- addLogicalStructure((JavaLogicalStructure) iter.next());
+ private static void addAllLogicalStructures(
+ List<JavaLogicalStructure> pluginContributedJavaLogicalStructures) {
+ for (Iterator<JavaLogicalStructure> iter = pluginContributedJavaLogicalStructures.iterator(); iter
+ .hasNext();) {
+ addLogicalStructure(iter.next());
}
}
@@ -121,10 +133,10 @@ public class JavaLogicalStructures implements ILogicalStructureProvider {
* @param structure
*/
private static void addLogicalStructure(JavaLogicalStructure structure) {
- String typeName= structure.getQualifiedTypeName();
- List logicalStructure= (List)fJavaLogicalStructureMap.get(typeName);
+ String typeName = structure.getQualifiedTypeName();
+ List<JavaLogicalStructure> logicalStructure = fJavaLogicalStructureMap.get(typeName);
if (logicalStructure == null) {
- logicalStructure= new ArrayList();
+ logicalStructure = new ArrayList<JavaLogicalStructure>();
fJavaLogicalStructureMap.put(typeName, logicalStructure);
}
logicalStructure.add(structure);
@@ -134,150 +146,183 @@ public class JavaLogicalStructures implements ILogicalStructureProvider {
* Get the configuration elements for the extension point.
*/
private static void initPluginContributedJavaLogicalStructure() {
- fPluginContributedJavaLogicalStructures= new ArrayList();
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.EXTENSION_POINT_JAVA_LOGICAL_STRUCTURES);
- IConfigurationElement[] javaLogicalStructureElements= extensionPoint.getConfigurationElements();
- for (int i= 0; i < javaLogicalStructureElements.length; i++) {
+ fPluginContributedJavaLogicalStructures = new ArrayList<JavaLogicalStructure>();
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
+ .getExtensionPoint(JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.EXTENSION_POINT_JAVA_LOGICAL_STRUCTURES);
+ IConfigurationElement[] javaLogicalStructureElements = extensionPoint
+ .getConfigurationElements();
+ for (IConfigurationElement javaLogicalStructureElement : javaLogicalStructureElements) {
try {
- fPluginContributedJavaLogicalStructures.add(new JavaLogicalStructure(javaLogicalStructureElements[i]));
+ fPluginContributedJavaLogicalStructures
+ .add(new JavaLogicalStructure(
+ javaLogicalStructureElement));
} catch (CoreException e) {
JDIDebugPlugin.log(e);
}
}
}
-
+
/**
* Get the user defined logical structures (from the preference store).
*/
- private static void initUserDefinedJavaLogicalStructures() {
- fUserDefinedJavaLogicalStructures= new ArrayList();
- String logicalStructuresString= JDIDebugModel.getPreferences().getString(PREF_JAVA_LOGICAL_STRUCTURES);
- StringTokenizer tokenizer= new StringTokenizer(logicalStructuresString, "\0", true); //$NON-NLS-1$
+ private static void initUserDefinedJavaLogicalStructures() {
+ fUserDefinedJavaLogicalStructures = new ArrayList<JavaLogicalStructure>();
+ String logicalStructuresString = Platform.getPreferencesService().getString(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ PREF_JAVA_LOGICAL_STRUCTURES,
+ "", //$NON-NLS-1$
+ null);
+ StringTokenizer tokenizer = new StringTokenizer(
+ logicalStructuresString, "\0", true); //$NON-NLS-1$
while (tokenizer.hasMoreTokens()) {
- String type= tokenizer.nextToken();
+ String type = tokenizer.nextToken();
tokenizer.nextToken();
- String description= tokenizer.nextToken();
+ String description = tokenizer.nextToken();
tokenizer.nextToken();
- String isSubtypeValue= tokenizer.nextToken();
- boolean isSubtype= isSubtypeValue.charAt(0) == IS_SUBTYPE_TRUE;
+ String isSubtypeValue = tokenizer.nextToken();
+ boolean isSubtype = isSubtypeValue.charAt(0) == IS_SUBTYPE_TRUE;
tokenizer.nextToken();
- String value= tokenizer.nextToken();
+ String value = tokenizer.nextToken();
if (value.charAt(0) == '\0') {
- value= null;
+ value = null;
} else {
tokenizer.nextToken();
}
- String variablesCounterValue= tokenizer.nextToken();
- int variablesCounter= Integer.parseInt(variablesCounterValue);
+ String variablesCounterValue = tokenizer.nextToken();
+ int variablesCounter = Integer.parseInt(variablesCounterValue);
tokenizer.nextToken();
- String[][] variables= new String[variablesCounter][2];
- for (int i= 0; i < variablesCounter; i++) {
- variables[i][0]= tokenizer.nextToken();
+ String[][] variables = new String[variablesCounter][2];
+ for (int i = 0; i < variablesCounter; i++) {
+ variables[i][0] = tokenizer.nextToken();
tokenizer.nextToken();
- variables[i][1]= tokenizer.nextToken();
+ variables[i][1] = tokenizer.nextToken();
tokenizer.nextToken();
}
- fUserDefinedJavaLogicalStructures.add(new JavaLogicalStructure(type, isSubtype, value, description, variables));
+ fUserDefinedJavaLogicalStructures.add(new JavaLogicalStructure(
+ type, isSubtype, value, description, variables));
}
}
-
+
/**
* Save the user defined logical structures in the preference store.
*/
public static void saveUserDefinedJavaLogicalStructures() {
- StringBuffer logicalStructuresString= new StringBuffer();
- for (Iterator iter= fUserDefinedJavaLogicalStructures.iterator(); iter.hasNext();) {
- JavaLogicalStructure logicalStructure= (JavaLogicalStructure) iter.next();
- logicalStructuresString.append(logicalStructure.getQualifiedTypeName()).append('\0');
- logicalStructuresString.append(logicalStructure.getDescription()).append('\0');
- logicalStructuresString.append(logicalStructure.isSubtypes() ? IS_SUBTYPE_TRUE : IS_SUBTYPE_FALSE).append('\0');
- String value= logicalStructure.getValue();
+ StringBuffer logicalStructuresString = new StringBuffer();
+ for (Iterator<JavaLogicalStructure> iter = fUserDefinedJavaLogicalStructures.iterator(); iter
+ .hasNext();) {
+ JavaLogicalStructure logicalStructure = iter
+ .next();
+ logicalStructuresString.append(
+ logicalStructure.getQualifiedTypeName()).append('\0');
+ logicalStructuresString.append(logicalStructure.getDescription())
+ .append('\0');
+ logicalStructuresString.append(
+ logicalStructure.isSubtypes() ? IS_SUBTYPE_TRUE
+ : IS_SUBTYPE_FALSE).append('\0');
+ String value = logicalStructure.getValue();
if (value != null) {
logicalStructuresString.append(value);
}
logicalStructuresString.append('\0');
- String[][] variables= logicalStructure.getVariables();
+ String[][] variables = logicalStructure.getVariables();
logicalStructuresString.append(variables.length).append('\0');
- for (int i= 0; i < variables.length; i++) {
- String[] strings= variables[i];
+ for (String[] strings : variables) {
logicalStructuresString.append(strings[0]).append('\0');
logicalStructuresString.append(strings[1]).append('\0');
}
}
- JDIDebugModel.getPreferences().setValue(PREF_JAVA_LOGICAL_STRUCTURES, logicalStructuresString.toString());
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier());
+ if(node != null) {
+ node.put(PREF_JAVA_LOGICAL_STRUCTURES, logicalStructuresString.toString());
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ JDIDebugPlugin.log(e);
+ }
+ }
}
/**
* Return all the defined logical structures.
*/
public static JavaLogicalStructure[] getJavaLogicalStructures() {
- JavaLogicalStructure[] logicalStructures= new JavaLogicalStructure[fPluginContributedJavaLogicalStructures.size() + fUserDefinedJavaLogicalStructures.size()];
- int i= 0;
- for (Iterator iter= fPluginContributedJavaLogicalStructures.iterator(); iter.hasNext();) {
- logicalStructures[i++]= (JavaLogicalStructure) iter.next();
+ JavaLogicalStructure[] logicalStructures = new JavaLogicalStructure[fPluginContributedJavaLogicalStructures
+ .size() + fUserDefinedJavaLogicalStructures.size()];
+ int i = 0;
+ for (Iterator<JavaLogicalStructure> iter = fPluginContributedJavaLogicalStructures.iterator(); iter
+ .hasNext();) {
+ logicalStructures[i++] = iter.next();
}
- for (Iterator iter= fUserDefinedJavaLogicalStructures.iterator(); iter.hasNext();) {
- logicalStructures[i++]= (JavaLogicalStructure) iter.next();
+ for (Iterator<JavaLogicalStructure> iter = fUserDefinedJavaLogicalStructures.iterator(); iter
+ .hasNext();) {
+ logicalStructures[i++] = iter.next();
}
- return logicalStructures;
+ return logicalStructures;
}
/**
* Set the user defined logical structures.
*/
- public static void setUserDefinedJavaLogicalStructures(JavaLogicalStructure[] logicalStructures) {
- fUserDefinedJavaLogicalStructures= Arrays.asList(logicalStructures);
+ public static void setUserDefinedJavaLogicalStructures(
+ JavaLogicalStructure[] logicalStructures) {
+ fUserDefinedJavaLogicalStructures = Arrays.asList(logicalStructures);
saveUserDefinedJavaLogicalStructures();
}
-
- public static void addStructuresListener(IJavaStructuresListener listener) {
- fListeners.add(listener);
- }
-
- public static void removeStructuresListener(IJavaStructuresListener listener) {
- fListeners.remove(listener);
- }
+
+ public static void addStructuresListener(IJavaStructuresListener listener) {
+ fListeners.add(listener);
+ }
+
+ public static void removeStructuresListener(IJavaStructuresListener listener) {
+ fListeners.remove(listener);
+ }
public ILogicalStructureType[] getLogicalStructureTypes(IValue value) {
if (!(value instanceof IJavaObject)) {
return new ILogicalStructureType[0];
}
- IJavaObject javaValue= (IJavaObject) value;
- List logicalStructures= new ArrayList();
+ IJavaObject javaValue = (IJavaObject) value;
+ List<JavaLogicalStructure> logicalStructures = new ArrayList<JavaLogicalStructure>();
try {
- IJavaType type= javaValue.getJavaType();
+ IJavaType type = javaValue.getJavaType();
if (!(type instanceof IJavaClassType)) {
return new ILogicalStructureType[0];
}
- IJavaClassType classType= (IJavaClassType) type;
- List list= (List)fJavaLogicalStructureMap.get(classType.getName());
+ IJavaClassType classType = (IJavaClassType) type;
+ List<JavaLogicalStructure> list = fJavaLogicalStructureMap
+ .get(classType.getName());
if (list != null) {
logicalStructures.addAll(list);
}
- IJavaClassType superClass= classType.getSuperclass();
+ IJavaClassType superClass = classType.getSuperclass();
while (superClass != null) {
- addIfIsSubtype(logicalStructures, (List)fJavaLogicalStructureMap.get(superClass.getName()));
- superClass= superClass.getSuperclass();
+ addIfIsSubtype(logicalStructures,
+ fJavaLogicalStructureMap.get(superClass
+ .getName()));
+ superClass = superClass.getSuperclass();
}
- IJavaInterfaceType[] superInterfaces= classType.getAllInterfaces();
- for (int i= 0; i < superInterfaces.length; i++) {
- addIfIsSubtype(logicalStructures, (List)fJavaLogicalStructureMap.get(superInterfaces[i].getName()));
+ IJavaInterfaceType[] superInterfaces = classType.getAllInterfaces();
+ for (IJavaInterfaceType superInterface : superInterfaces) {
+ addIfIsSubtype(logicalStructures,
+ fJavaLogicalStructureMap.get(superInterface
+ .getName()));
}
} catch (DebugException e) {
JDIDebugPlugin.log(e);
return new ILogicalStructureType[0];
}
- return (ILogicalStructureType[]) logicalStructures.toArray(new ILogicalStructureType[logicalStructures.size()]);
+ return logicalStructures
+ .toArray(new ILogicalStructureType[logicalStructures.size()]);
}
- private void addIfIsSubtype(List logicalStructures, List list) {
+ private void addIfIsSubtype(List<JavaLogicalStructure> logicalStructures, List<JavaLogicalStructure> list) {
if (list == null) {
return;
}
- for (Iterator iter= list.iterator(); iter.hasNext();) {
- JavaLogicalStructure logicalStructure= (JavaLogicalStructure) iter.next();
- if (logicalStructure.isSubtypes()) {
- logicalStructures.add(logicalStructure);
+ for(JavaLogicalStructure jls : list) {
+ if (jls.isSubtypes()) {
+ logicalStructures.add(jls);
}
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaStructureErrorValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaStructureErrorValue.java
index 57720fee6..6e5deb1e7 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaStructureErrorValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaStructureErrorValue.java
@@ -22,124 +22,154 @@ import org.eclipse.jdt.debug.core.JDIDebugModel;
*
*/
public class JavaStructureErrorValue implements IJavaValue {
-
+
private String[] fMessages;
- private IJavaValue fValue;
+ private IJavaValue fValue;
public JavaStructureErrorValue(String errorMessage, IJavaValue value) {
- fMessages= new String[] { errorMessage };
- fValue= value;
- }
-
- public JavaStructureErrorValue(String[] errorMessages, IJavaValue value) {
- fMessages= errorMessages;
- fValue= value;
- }
-
- /**
- * Returns this error node's parent value. This is the value for which a
- * logical structure could not be calculated.
- * @return the parent value of this error node
- */
- public IJavaValue getParentValue() {
- return fValue;
- }
-
- /* (non-Javadoc)
+ fMessages = new String[] { errorMessage };
+ fValue = value;
+ }
+
+ public JavaStructureErrorValue(String[] errorMessages, IJavaValue value) {
+ fMessages = errorMessages;
+ fValue = value;
+ }
+
+ /**
+ * Returns this error node's parent value. This is the value for which a
+ * logical structure could not be calculated.
+ *
+ * @return the parent value of this error node
+ */
+ public IJavaValue getParentValue() {
+ return fValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#getSignature()
*/
public String getSignature() throws DebugException {
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#getJavaType()
*/
public IJavaType getJavaType() throws DebugException {
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
*/
public String getReferenceTypeName() throws DebugException {
return ""; //$NON-NLS-1$
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#getValueString()
*/
public String getValueString() throws DebugException {
return fMessages[0];
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#isAllocated()
*/
public boolean isAllocated() throws DebugException {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#getVariables()
*/
public IVariable[] getVariables() throws DebugException {
- IVariable[] variables= new IVariable[fMessages.length];
- for (int i = 0; i < variables.length; i++) {
- StringBuffer varName= new StringBuffer();
- if (variables.length > 1) {
- varName.append(LogicalStructuresMessages.JavaStructureErrorValue_0).append('[').append(i).append(']');
- } else {
- varName.append(LogicalStructuresMessages.JavaStructureErrorValue_1);
- }
- variables[i]= new JDIPlaceholderVariable(varName.toString(), new JavaStructureErrorValue(fMessages[i], fValue));
- }
+ IVariable[] variables = new IVariable[fMessages.length];
+ for (int i = 0; i < variables.length; i++) {
+ StringBuffer varName = new StringBuffer();
+ if (variables.length > 1) {
+ varName.append(
+ LogicalStructuresMessages.JavaStructureErrorValue_0)
+ .append('[').append(i).append(']');
+ } else {
+ varName.append(LogicalStructuresMessages.JavaStructureErrorValue_1);
+ }
+ variables[i] = new JDIPlaceholderVariable(varName.toString(),
+ new JavaStructureErrorValue(fMessages[i], fValue));
+ }
return variables;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
public boolean hasVariables() throws DebugException {
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
public String getModelIdentifier() {
return JDIDebugModel.getPluginIdentifier();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
public IDebugTarget getDebugTarget() {
return fValue.getDebugTarget();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
public ILaunch getLaunch() {
return getDebugTarget().getLaunch();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
public Object getAdapter(Class adapter) {
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#isNull()
*/
public boolean isNull() {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/LogicalObjectStructureValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/LogicalObjectStructureValue.java
index a1c8c2695..36bd7ce05 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/LogicalObjectStructureValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/LogicalObjectStructureValue.java
@@ -25,177 +25,240 @@ import org.eclipse.jdt.debug.core.IJavaVariable;
* A proxy to an object representing the logical structure of that object.
*/
public class LogicalObjectStructureValue implements IJavaObject {
-
+
private IJavaObject fObject;
private IJavaVariable[] fVariables;
-
+
/**
- * Constructs a proxy to the given object, with the given variables
- * as children.
+ * Constructs a proxy to the given object, with the given variables as
+ * children.
*
- * @param object original object
- * @param variables java variables to add as children to this object
+ * @param object
+ * original object
+ * @param variables
+ * java variables to add as children to this object
*/
- public LogicalObjectStructureValue(IJavaObject object, IJavaVariable[] variables) {
+ public LogicalObjectStructureValue(IJavaObject object,
+ IJavaVariable[] variables) {
fObject = object;
fVariables = variables;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String,
+ * java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread, boolean)
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, boolean superSend) throws DebugException {
- return fObject.sendMessage(selector, signature, args, thread, superSend);
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, boolean superSend)
+ throws DebugException {
+ return fObject
+ .sendMessage(selector, signature, args, thread, superSend);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String,
+ * java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, String typeSignature) throws DebugException {
- return fObject.sendMessage(selector, signature, args, thread, typeSignature);
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, String typeSignature)
+ throws DebugException {
+ return fObject.sendMessage(selector, signature, args, thread,
+ typeSignature);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String,
+ * boolean)
*/
- public IJavaFieldVariable getField(String name, boolean superField) throws DebugException {
+ public IJavaFieldVariable getField(String name, boolean superField)
+ throws DebugException {
return fObject.getField(name, superField);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String,
+ * java.lang.String)
*/
- public IJavaFieldVariable getField(String name, String typeSignature) throws DebugException {
+ public IJavaFieldVariable getField(String name, String typeSignature)
+ throws DebugException {
return fObject.getField(name, typeSignature);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#getSignature()
*/
public String getSignature() throws DebugException {
return fObject.getSignature();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
return fObject.getGenericSignature();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#getJavaType()
*/
public IJavaType getJavaType() throws DebugException {
return fObject.getJavaType();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
*/
public String getReferenceTypeName() throws DebugException {
return fObject.getReferenceTypeName();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#getValueString()
*/
public String getValueString() throws DebugException {
return fObject.getValueString();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#isAllocated()
*/
public boolean isAllocated() throws DebugException {
return fObject.isAllocated();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#getVariables()
*/
public IVariable[] getVariables() {
return fVariables;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
public boolean hasVariables() {
return fVariables.length > 0;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
public String getModelIdentifier() {
return fObject.getModelIdentifier();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
public IDebugTarget getDebugTarget() {
return fObject.getDebugTarget();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
public ILaunch getLaunch() {
return fObject.getLaunch();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
public Object getAdapter(Class adapter) {
return fObject.getAdapter(adapter);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getWaitingThreads()
*/
public IJavaThread[] getWaitingThreads() throws DebugException {
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getOwningThread()
*/
public IJavaThread getOwningThread() throws DebugException {
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getReferringObjects(long)
*/
public IJavaObject[] getReferringObjects(long max) throws DebugException {
return fObject.getReferringObjects(max);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#disableCollection()
*/
public void disableCollection() throws DebugException {
fObject.disableCollection();
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#enableCollection()
*/
public void enableCollection() throws DebugException {
fObject.enableCollection();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getUniqueId()
*/
public long getUniqueId() throws DebugException {
return fObject.getUniqueId();
- }
-
- /* (non-Javadoc)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#isNull()
*/
public boolean isNull() {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/ITimeoutListener.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/ITimeoutListener.java
index 8da026186..a969ab098 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/ITimeoutListener.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/ITimeoutListener.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
/**
* A timeout listener is notified when a timer expires.
+ *
* @see Timer
*/
public interface ITimeoutListener {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayEntryVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayEntryVariable.java
index ef72f5c60..dc7a43985 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayEntryVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayEntryVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdt.debug.core.IJavaValue;
+import org.eclipse.jdt.debug.core.IJavaVariable;
import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ArrayReference;
@@ -30,22 +31,22 @@ import com.sun.jdi.Value;
*/
public class JDIArrayEntryVariable extends JDIModificationVariable {
-
+
/**
* The index of the variable entry
*/
private int fIndex;
-
+
/**
* The array object
*/
private ArrayReference fArray;
-
+
/**
* The reference type name of this variable. Cached lazily.
*/
- private String fReferenceTypeName= null;
-
+ private String fReferenceTypeName = null;
+
/**
* When created for a logical structure we hold onto the original
* non-logical object for purposes of equality. This way a logical
@@ -54,28 +55,34 @@ public class JDIArrayEntryVariable extends JDIModificationVariable {
* This is <code>null</code> when not created for a logical structure.
*/
private IJavaValue fLogicalParent;
-
+
/**
* Constructs an array entry at the given index in an array.
*
- * @param target debug target containing the array entry
- * @param array array containing the entry
- * @param index index into the array
- * @param logicalParent original logical parent value, or <code>null</code> if not a child
- * of a logical structure
+ * @param target
+ * debug target containing the array entry
+ * @param array
+ * array containing the entry
+ * @param index
+ * index into the array
+ * @param logicalParent
+ * original logical parent value, or <code>null</code> if not a
+ * child of a logical structure
*/
- public JDIArrayEntryVariable(JDIDebugTarget target, ArrayReference array, int index, IJavaValue logicalParent) {
+ public JDIArrayEntryVariable(JDIDebugTarget target, ArrayReference array,
+ int index, IJavaValue logicalParent) {
super(target);
- fArray= array;
- fIndex= index;
+ fArray = array;
+ fIndex = index;
fLogicalParent = logicalParent;
}
/**
* Returns this variable's current underlying value.
*/
+ @Override
protected Value retrieveValue() {
- ArrayReference ar= getArrayReference();
+ ArrayReference ar = getArrayReference();
if (ar != null) {
return ar.getValue(getIndex());
}
@@ -89,20 +96,32 @@ public class JDIArrayEntryVariable extends JDIModificationVariable {
return "[" + getIndex() + "]"; //$NON-NLS-2$ //$NON-NLS-1$
}
+ @Override
protected void setJDIValue(Value value) throws DebugException {
- ArrayReference ar= getArrayReference();
+ ArrayReference ar = getArrayReference();
if (ar == null) {
- requestFailed(JDIDebugModelMessages.JDIArrayEntryVariable_value_modification_failed, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIArrayEntryVariable_value_modification_failed,
+ null);
}
try {
ar.setValue(getIndex(), value);
fireChangeEvent(DebugEvent.CONTENT);
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_modifying_variable_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_modifying_variable_value,
+ e.toString()), e);
} catch (InvalidTypeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_modifying_variable_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_modifying_variable_value,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_modifying_variable_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_modifying_variable_value,
+ e.toString()), e);
}
}
@@ -110,112 +129,139 @@ public class JDIArrayEntryVariable extends JDIModificationVariable {
protected ArrayReference getArrayReference() {
return fArray;
}
-
+
protected int getIndex() {
return fIndex;
}
-
+
/**
* @see IVariable#getReferenceTypeName()
*/
public String getReferenceTypeName() throws DebugException {
try {
if (fReferenceTypeName == null) {
- fReferenceTypeName= stripBrackets(JDIReferenceType.getGenericName(getArrayReference().referenceType()));
+ fReferenceTypeName = stripBrackets(JDIReferenceType
+ .getGenericName(getArrayReference().referenceType()));
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_retrieving_reference_type, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_retrieving_reference_type,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
return null;
}
return fReferenceTypeName;
}
-
+
/**
- * Given a type name, strip out one set of array brackets and
- * return the result. Example: "int[][][]" becomes "int[][]".
+ * Given a type name, strip out one set of array brackets and return the
+ * result. Example: "int[][][]" becomes "int[][]".
*/
protected String stripBrackets(String typeName) {
- int lastLeft= typeName.lastIndexOf("[]"); //$NON-NLS-1$
+ int lastLeft = typeName.lastIndexOf("[]"); //$NON-NLS-1$
if (lastLeft < 0) {
return typeName;
}
- StringBuffer buffer= new StringBuffer(typeName);
+ StringBuffer buffer = new StringBuffer(typeName);
buffer.replace(lastLeft, lastLeft + 2, ""); //$NON-NLS-1$
return buffer.toString();
}
-
+
/**
* @see IJavaVariable#getSignature()
*/
public String getSignature() throws DebugException {
try {
- return ((ArrayType) getArrayReference().type()).componentSignature();
+ return ((ArrayType) getArrayReference().type())
+ .componentSignature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_retrieving_type_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_retrieving_type_signature,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
return null;
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
try {
- ReferenceType referenceType= getArrayReference().referenceType();
- String genericSignature= referenceType.genericSignature();
+ ReferenceType referenceType = getArrayReference().referenceType();
+ String genericSignature = referenceType.genericSignature();
if (genericSignature != null) {
return genericSignature;
}
return referenceType.signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_retrieving_type_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_retrieving_type_signature,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
return null;
}
}
-
+
/**
* @see JDIVariable#getUnderlyingType()
*/
+ @Override
protected Type getUnderlyingType() throws DebugException {
try {
- return ((ArrayType)getArrayReference().type()).componentType();
+ return ((ArrayType) getArrayReference().type()).componentType();
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_while_retrieving_type_of_array_entry, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_while_retrieving_type_of_array_entry,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayEntryVariable_exception_while_retrieving_type_of_array_entry, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayEntryVariable_exception_while_retrieving_type_of_array_entry,
+ e.toString()), e);
}
- // this line will not be exceucted as an exception
+ // this line will not be executed as an exception
// will be throw in type retrieval fails
return null;
- }
- /* (non-Javadoc)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof JDIArrayEntryVariable) {
- JDIArrayEntryVariable entry = (JDIArrayEntryVariable)obj;
+ JDIArrayEntryVariable entry = (JDIArrayEntryVariable) obj;
if (fLogicalParent != null) {
try {
- return fLogicalParent.equals(entry.fLogicalParent) &&
- getValue().equals(entry.getValue());
+ return fLogicalParent.equals(entry.fLogicalParent)
+ && getValue().equals(entry.getValue());
} catch (CoreException e) {
}
}
- return entry.getArrayReference().equals(getArrayReference()) &&
- entry.getIndex() == getIndex();
+ return entry.getArrayReference().equals(getArrayReference())
+ && entry.getIndex() == getIndex();
}
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
if (fLogicalParent != null) {
return fLogicalParent.hashCode() + getIndex();
@@ -224,4 +270,3 @@ public class JDIArrayEntryVariable extends JDIModificationVariable {
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayType.java
index 9f730068c..5e6a2dd7a 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,12 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaArray;
import org.eclipse.jdt.debug.core.IJavaArrayType;
import org.eclipse.jdt.debug.core.IJavaType;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ArrayReference;
import com.sun.jdi.ArrayType;
import com.sun.jdi.ClassNotLoadedException;
@@ -29,21 +27,26 @@ import com.sun.jdi.Type;
public class JDIArrayType extends JDIReferenceType implements IJavaArrayType {
/**
- * Cosntructs a new array type on the given target referencing
- * the specified array type.
+ * Constructs a new array type on the given target referencing the specified
+ * array type.
*/
public JDIArrayType(JDIDebugTarget target, ArrayType type) {
super(target, type);
}
+
/**
* @see IJavaArrayType#newInstance(int)
*/
public IJavaArray newInstance(int size) throws DebugException {
try {
- ArrayReference ar = ((ArrayType)getUnderlyingType()).newInstance(size);
- return (IJavaArray)JDIValue.createValue(getJavaDebugTarget(), ar);
+ ArrayReference ar = ((ArrayType) getUnderlyingType())
+ .newInstance(size);
+ return (IJavaArray) JDIValue.createValue(getJavaDebugTarget(), ar);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayType_exception_while_creating_new_instance_of_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayType_exception_while_creating_new_instance_of_array,
+ e.toString()), e);
}
// execution will not reach this line as
// an exception will be thrown
@@ -55,12 +58,18 @@ public class JDIArrayType extends JDIReferenceType implements IJavaArrayType {
*/
public IJavaType getComponentType() throws DebugException {
try {
- Type type = ((ArrayType)getUnderlyingType()).componentType();
+ Type type = ((ArrayType) getUnderlyingType()).componentType();
return JDIType.createType(getJavaDebugTarget(), type);
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayType_exception_while_retrieving_component_type_of_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayType_exception_while_retrieving_component_type_of_array,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayType_exception_while_retrieving_component_type_of_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayType_exception_while_retrieving_component_type_of_array,
+ e.toString()), e);
}
// execution will not reach this line as
// an exception will be thrown
@@ -68,4 +77,3 @@ public class JDIArrayType extends JDIReferenceType implements IJavaArrayType {
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayValue.java
index cc084f025..c2c24be23 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIArrayValue.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -27,14 +26,18 @@ import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.Value;
-public class JDIArrayValue extends JDIObjectValue implements IJavaArray, IIndexedValue{
-
- private int fLength = -1;
+public class JDIArrayValue extends JDIObjectValue implements IJavaArray,
+ IIndexedValue {
+
+ private int fLength = -1;
/**
* Constructs a value which is a reference to an array.
- * @param target debug target on which the array exists
- * @param value the reference to the array
+ *
+ * @param target
+ * debug target on which the array exists
+ * @param value
+ * the reference to the array
*/
public JDIArrayValue(JDIDebugTarget target, ArrayReference value) {
super(target, value);
@@ -44,13 +47,13 @@ public class JDIArrayValue extends JDIObjectValue implements IJavaArray, IIndexe
* @see IJavaArray#getValues()
*/
public IJavaValue[] getValues() throws DebugException {
- List list = getUnderlyingValues();
+ List<Value> list = getUnderlyingValues();
int count = list.size();
IJavaValue[] values = new IJavaValue[count];
JDIDebugTarget target = (JDIDebugTarget) getDebugTarget();
for (int i = 0; i < count; i++) {
- Value value = (Value)list.get(i);
+ Value value = list.get(i);
values[i] = JDIValue.createValue(target, value);
}
return values;
@@ -61,7 +64,7 @@ public class JDIArrayValue extends JDIObjectValue implements IJavaArray, IIndexe
*/
public IJavaValue getValue(int index) throws DebugException {
Value v = getUnderlyingValue(index);
- return JDIValue.createValue((JDIDebugTarget)getDebugTarget(), v);
+ return JDIValue.createValue((JDIDebugTarget) getDebugTarget(), v);
}
/**
@@ -72,7 +75,10 @@ public class JDIArrayValue extends JDIObjectValue implements IJavaArray, IIndexe
try {
fLength = getArrayReference().length();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_retrieving_array_length, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_retrieving_array_length,
+ e.toString()), e);
}
}
return fLength;
@@ -83,39 +89,52 @@ public class JDIArrayValue extends JDIObjectValue implements IJavaArray, IIndexe
*/
public void setValue(int index, IJavaValue value) throws DebugException {
try {
- getArrayReference().setValue(index, ((JDIValue)value).getUnderlyingValue());
+ getArrayReference().setValue(index,
+ ((JDIValue) value).getUnderlyingValue());
} catch (IndexOutOfBoundsException e) {
throw e;
} catch (InvalidTypeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array,
+ e.toString()), e);
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array,
+ e.toString()), e);
}
}
/**
- * Returns the underlying array reference for this
- * array.
+ * Returns the underlying array reference for this array.
*
* @return underlying array reference
*/
+ @Override
protected ArrayReference getArrayReference() {
- return (ArrayReference)getUnderlyingValue();
+ return (ArrayReference) getUnderlyingValue();
}
-
+
/**
- * Returns the underlying value at the given index
- * from the underlying array reference.
+ * Returns the underlying value at the given index from the underlying array
+ * reference.
*
- * @param index the index at which to retrieve a value
+ * @param index
+ * the index at which to retrieve a value
* @return value
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected Value getUnderlyingValue(int index) throws DebugException {
try {
@@ -123,111 +142,149 @@ public class JDIArrayValue extends JDIObjectValue implements IJavaArray, IIndexe
} catch (IndexOutOfBoundsException e) {
throw e;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_retrieving_value_from_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_retrieving_value_from_array,
+ e.toString()), e);
}
// execution will not reach this line as
// an exception will be thrown
return null;
}
-
+
/**
- * Returns the underlying values
- * from the underlying array reference.
+ * Returns the underlying values from the underlying array reference.
*
* @return list of values
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
- protected List getUnderlyingValues() throws DebugException {
+ protected List<Value> getUnderlyingValues() throws DebugException {
try {
return getArrayReference().getValues();
} catch (IndexOutOfBoundsException e) {
return Collections.EMPTY_LIST;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_retrieving_values_from_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_retrieving_values_from_array,
+ e.toString()), e);
}
// execution will not reach this line as
// an exception will be thrown
return null;
- }
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getSize()
*/
public int getSize() throws DebugException {
return getLength();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getVariable(int)
*/
public IVariable getVariable(int offset) throws DebugException {
if (offset >= getLength()) {
- requestFailed(JDIDebugModelMessages.JDIArrayValue_6, null);
+ requestFailed(JDIDebugModelMessages.JDIArrayValue_6, null);
}
- return new JDIArrayEntryVariable(getJavaDebugTarget(), getArrayReference(), offset, fLogicalParent);
+ return new JDIArrayEntryVariable(getJavaDebugTarget(),
+ getArrayReference(), offset, fLogicalParent);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getVariables(int, int)
*/
- public IVariable[] getVariables(int offset, int length) throws DebugException {
+ public IVariable[] getVariables(int offset, int length)
+ throws DebugException {
if (offset >= getLength()) {
- requestFailed(JDIDebugModelMessages.JDIArrayValue_6, null);
+ requestFailed(JDIDebugModelMessages.JDIArrayValue_6, null);
}
if ((offset + length - 1) >= getLength()) {
- requestFailed(JDIDebugModelMessages.JDIArrayValue_8, null);
+ requestFailed(JDIDebugModelMessages.JDIArrayValue_8, null);
}
IVariable[] variables = new IVariable[length];
int index = offset;
for (int i = 0; i < length; i++) {
- variables[i] = new JDIArrayEntryVariable(getJavaDebugTarget(), getArrayReference(), index, fLogicalParent);
+ variables[i] = new JDIArrayEntryVariable(getJavaDebugTarget(),
+ getArrayReference(), index, fLogicalParent);
index++;
}
return variables;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getInitialOffset()
*/
public int getInitialOffset() {
return 0;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
+ @Override
public boolean hasVariables() throws DebugException {
return getLength() > 0;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaArray#setValues(int, int, org.eclipse.jdt.debug.core.IJavaValue[], int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaArray#setValues(int, int,
+ * org.eclipse.jdt.debug.core.IJavaValue[], int)
*/
- public void setValues(int offset, int length, IJavaValue[] values, int startOffset) throws DebugException {
+ public void setValues(int offset, int length, IJavaValue[] values,
+ int startOffset) throws DebugException {
try {
- List list = new ArrayList(values.length);
- for (int i = 0; i < values.length; i++) {
- list.add(((JDIValue)values[i]).getUnderlyingValue());
+ List<Value> list = new ArrayList<Value>(values.length);
+ for (IJavaValue value : values) {
+ list.add(((JDIValue) value).getUnderlyingValue());
}
getArrayReference().setValues(offset, list, startOffset, length);
} catch (IndexOutOfBoundsException e) {
throw e;
} catch (InvalidTypeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array,
+ e.toString()), e);
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIArrayValue_exception_while_setting_value_in_array,
+ e.toString()), e);
}
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaArray#setValues(org.eclipse.jdt.debug.core.IJavaValue[])
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaArray#setValues(org.eclipse.jdt.debug
+ * .core.IJavaValue[])
*/
public void setValues(IJavaValue[] values) throws DebugException {
int length = Math.min(values.length, getSize());
@@ -235,4 +292,3 @@ public class JDIArrayValue extends JDIObjectValue implements IJavaArray, IIndexe
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassObjectValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassObjectValue.java
index 91edb68b0..7a70de943 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassObjectValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassObjectValue.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import org.eclipse.jdt.debug.core.IJavaClassObject;
import org.eclipse.jdt.debug.core.IJavaType;
@@ -22,28 +21,29 @@ import com.sun.jdi.ClassObjectReference;
*
* @see IJavaClassObject
*/
-public class JDIClassObjectValue extends JDIObjectValue implements IJavaClassObject {
+public class JDIClassObjectValue extends JDIObjectValue implements
+ IJavaClassObject {
/**
* Constructs a reference to a class object.
*/
- public JDIClassObjectValue(JDIDebugTarget target, ClassObjectReference object) {
+ public JDIClassObjectValue(JDIDebugTarget target,
+ ClassObjectReference object) {
super(target, object);
}
-
/**
* @see IJavaClassObject#getInstanceType()
*/
public IJavaType getInstanceType() {
- return JDIType.createType((JDIDebugTarget)getDebugTarget(),getUnderlyingClassObject().reflectedType());
+ return JDIType.createType((JDIDebugTarget) getDebugTarget(),
+ getUnderlyingClassObject().reflectedType());
}
/**
* Returns the underlying class object
*/
protected ClassObjectReference getUnderlyingClassObject() {
- return (ClassObjectReference)getUnderlyingValue();
+ return (ClassObjectReference) getUnderlyingValue();
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassType.java
index 2cf3f4a5a..dd715d82e 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,8 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.debug.core.DebugException;
@@ -24,6 +21,7 @@ import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.core.IJavaValue;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ClassType;
import com.sun.jdi.InterfaceType;
import com.sun.jdi.Method;
@@ -34,160 +32,212 @@ import com.sun.jdi.Value;
* The class of an object in a debug target.
*/
public class JDIClassType extends JDIReferenceType implements IJavaClassType {
-
+
/**
- * Cosntructs a new class type on the given target referencing
- * the specified class type.
+ * Constructs a new class type on the given target referencing the specified
+ * class type.
*/
public JDIClassType(JDIDebugTarget target, ClassType type) {
super(target, type);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaClassType#newInstance(java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaClassType#newInstance(java.lang.String,
+ * org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread)
*/
- public IJavaObject newInstance(String signature, IJavaValue[] args, IJavaThread thread) throws DebugException {
+ public IJavaObject newInstance(String signature, IJavaValue[] args,
+ IJavaThread thread) throws DebugException {
if (getUnderlyingType() instanceof ClassType) {
- ClassType clazz = (ClassType)getUnderlyingType();
- JDIThread javaThread = (JDIThread)thread;
- List arguments = convertArguments(args);
- Method method = null;
+ ClassType clazz = (ClassType) getUnderlyingType();
+ JDIThread javaThread = (JDIThread) thread;
+ List<Value> arguments = convertArguments(args);
+ Method method = null;
try {
- List methods = clazz.methodsByName("<init>", signature); //$NON-NLS-1$
+ List<Method> methods = clazz.methodsByName("<init>", signature); //$NON-NLS-1$
if (methods.isEmpty()) {
- requestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_Type_does_not_implement_cosntructor, new String[]{signature}), null);
+ requestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_Type_does_not_implement_cosntructor,
+ signature), null);
} else {
- method = (Method)methods.get(0);
+ method = methods.get(0);
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_performing_method_lookup_for_constructor, new String[] {e.toString(), signature}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_performing_method_lookup_for_constructor,
+ e.toString(), signature), e);
}
- ObjectReference result = javaThread.newInstance(clazz, method, arguments);
- return (IJavaObject)JDIValue.createValue(getJavaDebugTarget(), result);
+ ObjectReference result = javaThread.newInstance(clazz, method,
+ arguments);
+ return (IJavaObject) JDIValue.createValue(getJavaDebugTarget(),
+ result);
}
- requestFailed(JDIDebugModelMessages.JDIClassType_Type_is_not_a_class_type, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIClassType_Type_is_not_a_class_type,
+ null);
// execution will not fall through to here,
// as #requestFailed will throw an exception
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaClassType#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaClassType#sendMessage(java.lang.String,
+ * java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread)
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread) throws DebugException {
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread) throws DebugException {
if (getUnderlyingType() instanceof ClassType) {
- ClassType clazz = (ClassType)getUnderlyingType();
- JDIThread javaThread = (JDIThread)thread;
- List arguments = convertArguments(args);
- Method method = null;
+ ClassType clazz = (ClassType) getUnderlyingType();
+ JDIThread javaThread = (JDIThread) thread;
+ List<Value> arguments = convertArguments(args);
+ Method method = null;
try {
- List methods = clazz.methodsByName(selector, signature);
+ List<Method> methods = clazz.methodsByName(selector, signature);
if (methods.isEmpty()) {
- requestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_Type_does_not_implement_selector, new String[] {selector, signature}), null);
+ requestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_Type_does_not_implement_selector,
+ selector, signature), null);
} else {
- method = (Method)methods.get(0);
+ method = methods.get(0);
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_performing_method_lookup_for_selector, new String[] {e.toString(), selector, signature}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_performing_method_lookup_for_selector,
+ e.toString(), selector, signature), e);
}
- Value result = javaThread.invokeMethod(clazz, null, method, arguments, false);
+ Value result = javaThread.invokeMethod(clazz, null, method,
+ arguments, false);
return JDIValue.createValue(getJavaDebugTarget(), result);
}
- requestFailed(JDIDebugModelMessages.JDIClassType_Type_is_not_a_class_type, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIClassType_Type_is_not_a_class_type,
+ null);
// execution will not fall through to here,
// as #requestFailed will throw an exception
return null;
}
-
+
/**
- * Utility method to convert argument array to an
- * argument list.
+ * Utility method to convert argument array to an argument list.
*
- * @param args array of arguments, as <code>IJavaValue</code>s,
- * possibly <code>null</code> or empty
+ * @param args
+ * array of arguments, as <code>IJavaValue</code>s, possibly
+ * <code>null</code> or empty
* @return a list of underlying <code>Value</code>s
*/
- protected List convertArguments(IJavaValue[] args) {
- List arguments = null;
+ protected List<Value> convertArguments(IJavaValue[] args) {
+ List<Value> arguments = null;
if (args == null) {
arguments = Collections.EMPTY_LIST;
} else {
- arguments= new ArrayList(args.length);
- for (int i = 0; i < args.length; i++) {
- arguments.add(((JDIValue)args[i]).getUnderlyingValue());
+ arguments = new ArrayList<Value>(args.length);
+ for (IJavaValue arg : args) {
+ arguments.add(((JDIValue) arg).getUnderlyingValue());
}
}
- return arguments;
+ return arguments;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaClassType#getSuperclass()
*/
public IJavaClassType getSuperclass() throws DebugException {
try {
- ClassType superclazz = ((ClassType)getUnderlyingType()).superclass();
+ ClassType superclazz = ((ClassType) getUnderlyingType())
+ .superclass();
if (superclazz != null) {
- return (IJavaClassType)JDIType.createType(getJavaDebugTarget(), superclazz);
+ return (IJavaClassType) JDIType.createType(
+ getJavaDebugTarget(), superclazz);
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass,
+ e.toString()), e);
}
// it is possible to return null
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaClassType#getAllInterfaces()
*/
public IJavaInterfaceType[] getAllInterfaces() throws DebugException {
try {
- List interfaceList = ((ClassType)getUnderlyingType()).allInterfaces();
- List javaInterfaceTypeList = new ArrayList(interfaceList.size());
- Iterator iterator = interfaceList.iterator();
- while (iterator.hasNext()) {
- InterfaceType interfaceType = (InterfaceType) iterator.next();
+ List<InterfaceType> interfaceList = ((ClassType) getUnderlyingType())
+ .allInterfaces();
+ List<JDIType> javaInterfaceTypeList = new ArrayList<JDIType>(interfaceList.size());
+ for(InterfaceType interfaceType : interfaceList) {
if (interfaceType != null) {
- javaInterfaceTypeList.add(JDIType.createType(getJavaDebugTarget(), interfaceType));
- }
+ javaInterfaceTypeList.add(JDIType.createType(
+ getJavaDebugTarget(), interfaceType));
+ }
}
- IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList.size()];
- javaInterfaceTypeArray = (IJavaInterfaceType[]) javaInterfaceTypeList.toArray(javaInterfaceTypeArray);
+ IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList
+ .size()];
+ javaInterfaceTypeArray = javaInterfaceTypeList
+ .toArray(javaInterfaceTypeArray);
return javaInterfaceTypeArray;
} catch (RuntimeException re) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass, new String[] {re.toString()}), re);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass,
+ re.toString()), re);
}
return new IJavaInterfaceType[0];
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaClassType#getInterfaces()
*/
public IJavaInterfaceType[] getInterfaces() throws DebugException {
try {
- List interfaceList = ((ClassType)getUnderlyingType()).interfaces();
- List javaInterfaceTypeList = new ArrayList(interfaceList.size());
- Iterator iterator = interfaceList.iterator();
- while (iterator.hasNext()) {
- InterfaceType interfaceType = (InterfaceType) iterator.next();
+ List<InterfaceType> interfaceList = ((ClassType) getUnderlyingType()).interfaces();
+ List<JDIType> javaInterfaceTypeList = new ArrayList<JDIType>(interfaceList.size());
+ for(InterfaceType interfaceType : interfaceList) {
if (interfaceType != null) {
- javaInterfaceTypeList.add(JDIType.createType(getJavaDebugTarget(), interfaceType));
- }
+ javaInterfaceTypeList.add(JDIType.createType(
+ getJavaDebugTarget(), interfaceType));
+ }
}
- IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList.size()];
- javaInterfaceTypeArray = (IJavaInterfaceType[]) javaInterfaceTypeList.toArray(javaInterfaceTypeArray);
+ IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList
+ .size()];
+ javaInterfaceTypeArray = javaInterfaceTypeList
+ .toArray(javaInterfaceTypeArray);
return javaInterfaceTypeArray;
} catch (RuntimeException re) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass, new String[] {re.toString()}), re);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass,
+ re.toString()), re);
}
return new IJavaInterfaceType[0];
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaClassType#isEnum()
*/
public boolean isEnum() {
- return ((ClassType)getReferenceType()).isEnum();
+ return ((ClassType) getReferenceType()).isEnum();
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugElement.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugElement.java
index 0a5c5c5ad..1e207f6e8 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugElement.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugElement.java
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -34,36 +34,39 @@ import com.sun.jdi.event.EventSet;
import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.EventRequestManager;
-public abstract class JDIDebugElement extends DebugElement implements IDisconnect {
-
+public abstract class JDIDebugElement extends DebugElement implements
+ IDisconnect {
+
/**
- * Creates a JDI debug element associated with the
- * specified debug target.
+ * Creates a JDI debug element associated with the specified debug target.
*
- * @param target The associated debug target
+ * @param target
+ * The associated debug target
*/
public JDIDebugElement(JDIDebugTarget target) {
- super(target);
+ super(target);
}
/**
* Convenience method to log errors
*/
protected void logError(Exception e) {
- if (!((JDIDebugTarget)getDebugTarget()).isAvailable()) {
+ if (!((JDIDebugTarget) getDebugTarget()).isAvailable()) {
// Don't log VMDisconnectedExceptions that occur
// when the VM is unavailable.
- if (e instanceof VMDisconnectedException ||
- (e instanceof CoreException && ((CoreException)e).getStatus().getException() instanceof VMDisconnectedException)) {
+ if (e instanceof VMDisconnectedException
+ || (e instanceof CoreException && ((CoreException) e)
+ .getStatus().getException() instanceof VMDisconnectedException)) {
return;
}
}
JDIDebugPlugin.log(e);
}
-
+
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == IDebugElement.class) {
return this;
@@ -82,7 +85,7 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
}
return super.getAdapter(adapter);
}
-
+
/**
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
@@ -91,66 +94,86 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
}
/**
- * Queues a debug event with the event dispatcher to be fired
- * as an event set when all event processing is complete.
+ * Queues a debug event with the event dispatcher to be fired as an event
+ * set when all event processing is complete.
*
- * @param event the event to queue
- * @param set the event set the event is associated with
+ * @param event
+ * the event to queue
+ * @param set
+ * the event set the event is associated with
*/
public void queueEvent(DebugEvent event, EventSet set) {
- EventDispatcher dispatcher = ((JDIDebugTarget)getDebugTarget()).getEventDispatcher();
+ EventDispatcher dispatcher = ((JDIDebugTarget) getDebugTarget())
+ .getEventDispatcher();
if (dispatcher != null) {
dispatcher.queue(event, set);
}
}
/**
- * Fires a debug event marking the SUSPEND of this element with
- * the associated detail.
+ * Fires a debug event marking the SUSPEND of this element with the
+ * associated detail.
*
- * @param detail The int detail of the event
+ * @param detail
+ * The int detail of the event
* @see org.eclipse.debug.core.DebugEvent
*/
+ @Override
public void fireSuspendEvent(int detail) {
- getJavaDebugTarget().incrementSuspendCount(detail);
+ getJavaDebugTarget().incrementSuspendCount(detail);
super.fireSuspendEvent(detail);
}
-
+
/**
- * Queues a debug event marking the SUSPEND of this element with
- * the associated detail.
+ * Queues a debug event marking the SUSPEND of this element with the
+ * associated detail.
*
- * @param detail The int detail of the event
- * @param set the event set the event is associated with
+ * @param detail
+ * The int detail of the event
+ * @param set
+ * the event set the event is associated with
* @see org.eclipse.debug.core.DebugEvent
*/
public void queueSuspendEvent(int detail, EventSet set) {
- getJavaDebugTarget().incrementSuspendCount(detail);
+ getJavaDebugTarget().incrementSuspendCount(detail);
queueEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail), set);
}
-
+
/**
- * Throws a new debug exception with a status code of <code>REQUEST_FAILED</code>.
+ * Throws a new debug exception with a status code of
+ * <code>REQUEST_FAILED</code>.
*
- * @param message Failure message
- * @param e Exception that has occurred (<code>can be null</code>)
- * @throws DebugException The exception with a status code of <code>REQUEST_FAILED</code>
+ * @param message
+ * Failure message
+ * @param e
+ * Exception that has occurred (<code>can be null</code>)
+ * @throws DebugException
+ * The exception with a status code of
+ * <code>REQUEST_FAILED</code>
*/
- public void requestFailed(String message, Exception e) throws DebugException {
+ public void requestFailed(String message, Exception e)
+ throws DebugException {
requestFailed(message, e, DebugException.REQUEST_FAILED);
}
-
+
/**
- * Throws a new debug exception with a status code of <code>TARGET_REQUEST_FAILED</code>
- * with the given underlying exception. If the underlying exception is not a JDI
- * exception, the original exception is thrown.
+ * Throws a new debug exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code> with the given underlying exception.
+ * If the underlying exception is not a JDI exception, the original
+ * exception is thrown.
*
- * @param message Failure message
- * @param e underlying exception that has occurred
- * @throws DebugException The exception with a status code of <code>TARGET_REQUEST_FAILED</code>
+ * @param message
+ * Failure message
+ * @param e
+ * underlying exception that has occurred
+ * @throws DebugException
+ * The exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code>
*/
- public void targetRequestFailed(String message, RuntimeException e) throws DebugException {
- if (e == null || e.getClass().getName().startsWith("com.sun.jdi") || e instanceof TimeoutException) { //$NON-NLS-1$
+ public void targetRequestFailed(String message, RuntimeException e)
+ throws DebugException {
+ if (e == null
+ || e.getClass().getName().startsWith("com.sun.jdi") || e instanceof TimeoutException) { //$NON-NLS-1$
requestFailed(message, e, DebugException.TARGET_REQUEST_FAILED);
} else {
throw e;
@@ -160,66 +183,88 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
/**
* Throws a new debug exception with the given status code.
*
- * @param message Failure message
- * @param e Exception that has occurred (<code>can be null</code>)
- * @param code status code
- * @throws DebugException a new exception with given status code
+ * @param message
+ * Failure message
+ * @param e
+ * Exception that has occurred (<code>can be null</code>)
+ * @param code
+ * status code
+ * @throws DebugException
+ * a new exception with given status code
*/
- public void requestFailed(String message, Throwable e, int code) throws DebugException {
+ public void requestFailed(String message, Throwable e, int code)
+ throws DebugException {
throwDebugException(message, code, e);
}
-
+
/**
- * Throws a new debug exception with a status code of <code>TARGET_REQUEST_FAILED</code>.
+ * Throws a new debug exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code>.
*
- * @param message Failure message
- * @param e Throwable that has occurred
- * @throws DebugException The exception with a status code of <code>TARGET_REQUEST_FAILED</code>
+ * @param message
+ * Failure message
+ * @param e
+ * Throwable that has occurred
+ * @throws DebugException
+ * The exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code>
*/
- public void targetRequestFailed(String message, Throwable e) throws DebugException {
+ public void targetRequestFailed(String message, Throwable e)
+ throws DebugException {
throwDebugException(message, DebugException.TARGET_REQUEST_FAILED, e);
}
-
+
/**
- * Throws a new debug exception with a status code of <code>TARGET_REQUEST_FAILED</code>
- * with the given underlying exception. The underlying exception is an exception thrown
- * by a JDI request.
+ * Throws a new debug exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code> with the given underlying exception.
+ * The underlying exception is an exception thrown by a JDI request.
*
- * @param message Failure message
- * @param e throwable exception that has occurred
- * @throws DebugException the exception with a status code of <code>TARGET_REQUEST_FAILED</code>
+ * @param message
+ * Failure message
+ * @param e
+ * throwable exception that has occurred
+ * @throws DebugException
+ * the exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code>
*/
- public void jdiRequestFailed(String message, Throwable e) throws DebugException {
+ public void jdiRequestFailed(String message, Throwable e)
+ throws DebugException {
throwDebugException(message, DebugException.TARGET_REQUEST_FAILED, e);
- }
-
+ }
+
/**
- * Throws a new debug exception with a status code of <code>NOT_SUPPORTED</code>.
+ * Throws a new debug exception with a status code of
+ * <code>NOT_SUPPORTED</code>.
*
- * @param message Failure message
- * @throws DebugException The exception with a status code of <code>NOT_SUPPORTED</code>.
+ * @param message
+ * Failure message
+ * @throws DebugException
+ * The exception with a status code of
+ * <code>NOT_SUPPORTED</code>.
*/
public void notSupported(String message) throws DebugException {
throwDebugException(message, DebugException.NOT_SUPPORTED, null);
}
-
+
/**
- * Throws a debug exception with the given message, error code, and underlying
- * exception.
+ * Throws a debug exception with the given message, error code, and
+ * underlying exception.
*/
- protected void throwDebugException(String message, int code, Throwable exception) throws DebugException {
- if(exception instanceof VMDisconnectedException) {
+ protected void throwDebugException(String message, int code,
+ Throwable exception) throws DebugException {
+ if (exception instanceof VMDisconnectedException) {
disconnected();
}
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- code, message, exception));
+ throw new DebugException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(), code, message, exception));
}
-
+
/**
- * Logs the given exception if it is a JDI exception, otherwise throws the
+ * Logs the given exception if it is a JDI exception, otherwise throws the
* runtime exception.
*
- * @param e The internal runtime exception
+ * @param e
+ * The internal runtime exception
*/
public void internalError(RuntimeException e) {
if (e.getClass().getName().startsWith("com.sun.jdi") || e instanceof TimeoutException) { //$NON-NLS-1$
@@ -228,16 +273,18 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
throw e;
}
}
-
+
/**
- * Logs a debug exception with the given message,
- * with a status code of <code>INTERNAL_ERROR</code>.
+ * Logs a debug exception with the given message, with a status code of
+ * <code>INTERNAL_ERROR</code>.
*
- * @param message The internal error message
+ * @param message
+ * The internal error message
*/
protected void internalError(String message) {
- logError(new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- DebugException.INTERNAL_ERROR, message, null)));
+ logError(new DebugException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(),
+ DebugException.INTERNAL_ERROR, message, null)));
}
/**
@@ -246,17 +293,16 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
* @return the unknown String
*/
protected String getUnknownMessage() {
- return JDIDebugModelMessages.JDIDebugElement_unknown;
+ return JDIDebugModelMessages.JDIDebugElement_unknown;
}
-
+
/**
- * Returns this elements debug target as its implementation
- * class.
+ * Returns this elements debug target as its implementation class.
*
* @return Java debug target
*/
public JDIDebugTarget getJavaDebugTarget() {
- return (JDIDebugTarget)getDebugTarget();
+ return (JDIDebugTarget) getDebugTarget();
}
/**
@@ -266,9 +312,9 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
* @return target VM or <code>null</code> if none
*/
protected VirtualMachine getVM() {
- return ((JDIDebugTarget)getDebugTarget()).getVM();
+ return ((JDIDebugTarget) getDebugTarget()).getVM();
}
-
+
/**
* Returns the underlying VM's event request manager, or <code>null</code>
* if none (disconnected/terminated)
@@ -282,38 +328,46 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
}
return vm.eventRequestManager();
}
-
+
/**
- * Adds the given listener to this target's event dispatcher's
- * table of listeners for the specified event request. The listener
- * will be notified each time the event occurs.
+ * Adds the given listener to this target's event dispatcher's table of
+ * listeners for the specified event request. The listener will be notified
+ * each time the event occurs.
*
- * @param listener the listener to register
- * @param request the event request
+ * @param listener
+ * the listener to register
+ * @param request
+ * the event request
*/
- public void addJDIEventListener(IJDIEventListener listener, EventRequest request) {
- EventDispatcher dispatcher = ((JDIDebugTarget)getDebugTarget()).getEventDispatcher();
+ public void addJDIEventListener(IJDIEventListener listener,
+ EventRequest request) {
+ EventDispatcher dispatcher = ((JDIDebugTarget) getDebugTarget())
+ .getEventDispatcher();
if (dispatcher != null) {
dispatcher.addJDIEventListener(listener, request);
}
}
-
+
/**
- * Removes the given listener from this target's event dispatcher's
- * table of listeners for the specifed event request. The listener
- * will no longer be notified when the event occurs. Listeners
- * are responsible for deleting the event request if desired.
+ * Removes the given listener from this target's event dispatcher's table of
+ * listeners for the specifed event request. The listener will no longer be
+ * notified when the event occurs. Listeners are responsible for deleting
+ * the event request if desired.
*
- * @param listener the listener to remove
- * @param request the event request
+ * @param listener
+ * the listener to remove
+ * @param request
+ * the event request
*/
- public void removeJDIEventListener(IJDIEventListener listener, EventRequest request) {
- EventDispatcher dispatcher = ((JDIDebugTarget)getDebugTarget()).getEventDispatcher();
+ public void removeJDIEventListener(IJDIEventListener listener,
+ EventRequest request) {
+ EventDispatcher dispatcher = ((JDIDebugTarget) getDebugTarget())
+ .getEventDispatcher();
if (dispatcher != null) {
dispatcher.removeJDIEventListener(listener, request);
}
}
-
+
/**
* The VM has disconnected. Notify the target.
*/
@@ -322,7 +376,7 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
getJavaDebugTarget().disconnected();
}
}
-
+
/**
* @see IJavaDebugTarget#setRequestTimeout(int)
*/
@@ -330,11 +384,12 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
if (supportsRequestTimeout()) {
VirtualMachine vm = getVM();
if (vm != null) {
- ((org.eclipse.jdi.VirtualMachine)vm).setRequestTimeout(timeout);
+ ((org.eclipse.jdi.VirtualMachine) vm)
+ .setRequestTimeout(timeout);
}
}
}
-
+
/**
* @see IJavaDebugTarget#getRequestTimeout()
*/
@@ -342,18 +397,21 @@ public abstract class JDIDebugElement extends DebugElement implements IDisconnec
if (supportsRequestTimeout()) {
VirtualMachine vm = getVM();
if (vm != null) {
- return ((org.eclipse.jdi.VirtualMachine)vm).getRequestTimeout();
+ return ((org.eclipse.jdi.VirtualMachine) vm)
+ .getRequestTimeout();
}
}
return -1;
- }
+ }
+
/**
* @see IJavaDebugTarget#supportsRequestTimeout()
*/
public boolean supportsRequestTimeout() {
- return getJavaDebugTarget().isAvailable() && getVM() instanceof org.eclipse.jdi.VirtualMachine;
+ return getJavaDebugTarget().isAvailable()
+ && getVM() instanceof org.eclipse.jdi.VirtualMachine;
}
-
+
/**
* @see org.eclipse.debug.core.model.IDisconnect#canDisconnect()
*/
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java
index 76b049ef2..e949deeae 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java
@@ -57,8 +57,8 @@ public class JDIDebugModelMessages extends NLS {
public static String JDIDebugTarget_Unable_to_create_class_prepare_request___VM_disconnected__2;
public static String JDIDebugTarget_Unable_to_create_class_prepare_request__3;
public static String JDIDebugTarget_Unable_to_retrieve_types___VM_disconnected__4;
- public static String JDIDebugTarget_0;
-
+ public static String JDIDebugTarget_0;
+
public static String JDIFieldVariable_exception_modifying_value;
public static String JDIFieldVariable_exception_retrieving_field_name;
public static String JDIFieldVariable_exception_retrieving_field_signature;
@@ -199,7 +199,7 @@ public class JDIDebugModelMessages extends NLS {
public static String JDIReferenceType_2;
public static String JDIReferenceType_3;
public static String JDIReferenceType_0;
- public static String JDIReferenceType_1;
+ public static String JDIReferenceType_1;
public static String JDIStackFrame_25;
static {
@@ -209,7 +209,7 @@ public class JDIDebugModelMessages extends NLS {
public static String JDIStackFrame_0;
- public static String JDIFieldVariable_0;
+ public static String JDIFieldVariable_0;
public static String JDIReferenceType_4;
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
index d6aea6ff3..a6e9e6d4b 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@@ -22,12 +21,14 @@ import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugEvent;
@@ -75,7 +76,6 @@ import com.sun.jdi.ObjectCollectedException;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.ThreadGroupReference;
import com.sun.jdi.ThreadReference;
-import com.sun.jdi.Type;
import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.Value;
import com.sun.jdi.VirtualMachine;
@@ -94,20 +94,21 @@ import com.sun.jdi.request.EventRequestManager;
* Debug target for JDI debug model.
*/
-public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget, ILaunchListener, IBreakpointManagerListener, IDebugEventSetListener {
-
+public class JDIDebugTarget extends JDIDebugElement implements
+ IJavaDebugTarget, ILaunchListener, IBreakpointManagerListener,
+ IDebugEventSetListener {
+
/**
- * Threads contained in this debug target. When a thread
- * starts it is added to the list. When a thread ends it
- * is removed from the list.
+ * Threads contained in this debug target. When a thread starts it is added
+ * to the list. When a thread ends it is removed from the list.
*/
- private ArrayList fThreads;
-
+ private ArrayList<JDIThread> fThreads;
+
/**
* List of thread groups in this target.
*/
- private ArrayList fGroups;
-
+ private ArrayList<JDIThreadGroup> fGroups;
+
/**
* Associated system process, or <code>null</code> if not available.
*/
@@ -117,16 +118,16 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
*/
private VirtualMachine fVirtualMachine;
/**
- * Whether terminate is supported. Not all targets
- * support terminate. For example, a VM that was attached
- * to remotely may not allow the user to terminate it.
+ * Whether terminate is supported. Not all targets support terminate. For
+ * example, a VM that was attached to remotely may not allow the user to
+ * terminate it.
*/
private boolean fSupportsTerminate;
/**
* Whether terminated
*/
private boolean fTerminated;
-
+
/**
* Whether in the process of terminating
*/
@@ -144,103 +145,105 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
*/
private boolean fSupportsDisableGC = false;
/**
- * Collection of breakpoints added to this target. Values are of type <code>IJavaBreakpoint</code>.
+ * Collection of breakpoints added to this target. Values are of type
+ * <code>IJavaBreakpoint</code>.
*/
- private List fBreakpoints;
-
+ private List<IBreakpoint> fBreakpoints;
+
/**
- * Collection of types that have attempted HCR, but failed.
- * The types are stored by their fully qualified names.
+ * Collection of types that have attempted HCR, but failed. The types are
+ * stored by their fully qualified names.
*/
- private Set fOutOfSynchTypes;
+ private Set<String> fOutOfSynchTypes;
/**
* Whether or not this target has performed a hot code replace.
*/
private boolean fHasHCROccurred;
-
+
/**
- * The name of this target - set by the client on creation, or retrieved from the
- * underlying VM.
+ * The name of this target - set by the client on creation, or retrieved
+ * from the underlying VM.
*/
private String fName;
/**
- * The event dispatcher for this debug target, which runs in its
- * own thread.
+ * The event dispatcher for this debug target, which runs in its own thread.
*/
- private EventDispatcher fEventDispatcher= null;
-
+ private EventDispatcher fEventDispatcher = null;
+
/**
* The thread start event handler
*/
- private ThreadStartHandler fThreadStartHandler= null;
-
+ private ThreadStartHandler fThreadStartHandler = null;
+
/**
* Whether this VM is suspended.
*/
private boolean fSuspended = true;
-
+
/**
* Whether the VM should be resumed on startup
*/
- private boolean fResumeOnStartup = false;
-
+ private boolean fResumeOnStartup = false;
+
/**
* The launch this target is contained in
*/
- private ILaunch fLaunch;
-
+ private ILaunch fLaunch;
+
/**
* Count of the number of suspend events in this target
*/
private int fSuspendCount = 0;
-
+
/**
- * Evaluation engine cache by Java project. Engines
- * are disposed when this target terminates.
+ * Evaluation engine cache by Java project. Engines are disposed when this
+ * target terminates.
*/
- private HashMap fEngines;
-
+ private HashMap<IJavaProject, IAstEvaluationEngine> fEngines;
+
/**
- * List of step filters - each string is a pattern/fully qualified
- * name of a type to filter.
+ * List of step filters - each string is a pattern/fully qualified name of a
+ * type to filter.
*/
private String[] fStepFilters = null;
-
+
/**
* Step filter state mask.
*/
private int fStepFilterMask = 0;
-
+
/**
* Step filter bit mask - indicates if step filters are enabled.
*/
private static final int STEP_FILTERS_ENABLED = 0x001;
-
+
/**
* Step filter bit mask - indicates if synthetic methods are filtered.
- */
+ */
private static final int FILTER_SYNTHETICS = 0x002;
-
+
/**
* Step filter bit mask - indicates if static initializers are filtered.
- */
+ */
private static final int FILTER_STATIC_INITIALIZERS = 0x004;
-
+
/**
* Step filter bit mask - indicates if constructors are filtered.
- */
+ */
private static final int FILTER_CONSTRUCTORS = 0x008;
-
+
/**
* When a step lands in a filtered location, this indicates whether stepping
- * should proceed "through" to an un-filtered location or step return.
+ * should proceed "through" to an unfiltered location or step return.
+ *
* @since 3.3
*/
private static final int STEP_THRU_FILTERS = 0x010;
-
+
/**
* Step filter bit mask - indicates if simple getters are filtered.
+ *
* @since 3.7
*/
private static final int FILTER_GETTERS = 0x020;
@@ -248,7 +251,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
/**
* Step filter bit mask - indicates if simple setters are filtered.
*
- * @since 3.7
+ * @since 3.7
*/
private static final int FILTER_SETTERS = 0x040;
@@ -259,32 +262,39 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
/**
* Whether this debug target is currently performing a hot code replace
*/
- private boolean fIsPerformingHotCodeReplace= false;
-
+ private boolean fIsPerformingHotCodeReplace = false;
+
/**
* Target specific HCR listeners
+ *
* @since 3.6
*/
private ListenerList fHCRListeners = new ListenerList();
-
+
/**
* Creates a new JDI debug target for the given virtual machine.
*
- * @param jvm the underlying VM
- * @param name the name to use for this VM, or <code>null</code>
- * if the name should be retrieved from the underlying VM
- * @param supportsTerminate whether the terminate action
- * is supported by this debug target
- * @param supportsDisconnect whether the disconnect action is
- * supported by this debug target
- * @param process the system process associated with the
- * underlying VM, or <code>null</code> if no system process
- * is available (for example, a remote VM)
- * @param resume whether the VM should be resumed on startup.
- * Has no effect if the VM is already resumed/running when
- * the connection is made.
- */
- public JDIDebugTarget(ILaunch launch, VirtualMachine jvm, String name, boolean supportTerminate, boolean supportDisconnect, IProcess process, boolean resume) {
+ * @param jvm
+ * the underlying VM
+ * @param name
+ * the name to use for this VM, or <code>null</code> if the name
+ * should be retrieved from the underlying VM
+ * @param supportsTerminate
+ * whether the terminate action is supported by this debug target
+ * @param supportsDisconnect
+ * whether the disconnect action is supported by this debug
+ * target
+ * @param process
+ * the system process associated with the underlying VM, or
+ * <code>null</code> if no system process is available (for
+ * example, a remote VM)
+ * @param resume
+ * whether the VM should be resumed on startup. Has no effect if
+ * the VM is already resumed/running when the connection is made.
+ */
+ public JDIDebugTarget(ILaunch launch, VirtualMachine jvm, String name,
+ boolean supportTerminate, boolean supportDisconnect,
+ IProcess process, boolean resume) {
super(null);
setLaunch(launch);
setResumeOnStartup(resume);
@@ -297,94 +307,96 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
setTerminating(false);
setDisconnected(false);
setName(name);
- setBreakpoints(new ArrayList(5));
- setThreadList(new ArrayList(5));
- fGroups = new ArrayList(5);
- setOutOfSynchTypes(new ArrayList(0));
+ setBreakpoints(new ArrayList<IBreakpoint>(5));
+ setThreadList(new ArrayList<JDIThread>(5));
+ fGroups = new ArrayList<JDIThreadGroup>(5);
+ setOutOfSynchTypes(new ArrayList<String>(0));
setHCROccurred(false);
initialize();
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointManagerListener(this);
+ DebugPlugin.getDefault().getBreakpointManager()
+ .addBreakpointManagerListener(this);
}
/**
- * Returns the event dispatcher for this debug target.
- * There is one event dispatcher per debug target.
+ * Returns the event dispatcher for this debug target. There is one event
+ * dispatcher per debug target.
*
* @return event dispatcher
*/
public EventDispatcher getEventDispatcher() {
return fEventDispatcher;
}
-
+
/**
- * Sets the event dispatcher for this debug target.
- * Set once at initialization.
+ * Sets the event dispatcher for this debug target. Set once at
+ * initialization.
*
- * @param dispatcher event dispatcher
+ * @param dispatcher
+ * event dispatcher
* @see #initialize()
*/
private void setEventDispatcher(EventDispatcher dispatcher) {
fEventDispatcher = dispatcher;
}
-
+
/**
- * Returns an iterator over the collection of threads. The
- * returned iterator is made on a copy of the thread list
- * so that it is thread safe. This method should always be
- * used instead of getThreadList().iterator()
+ * Returns an iterator over the collection of threads. The returned iterator
+ * is made on a copy of the thread list so that it is thread safe. This
+ * method should always be used instead of getThreadList().iterator()
+ *
* @return an iterator over the collection of threads
*/
- private Iterator getThreadIterator() {
- List threadList;
+ private Iterator<JDIThread> getThreadIterator() {
+ List<JDIThread> threadList;
synchronized (fThreads) {
- threadList= (List) fThreads.clone();
+ threadList = (List<JDIThread>) fThreads.clone();
}
return threadList.iterator();
}
-
+
/**
- * Sets the list of threads contained in this debug target.
- * Set to an empty collection on creation. Threads are
- * added and removed as they start and end. On termination
- * this collection is set to the immutable singleton empty list.
+ * Sets the list of threads contained in this debug target. Set to an empty
+ * collection on creation. Threads are added and removed as they start and
+ * end. On termination this collection is set to the immutable singleton
+ * empty list.
*
- * @param threads empty list
+ * @param threads
+ * empty list
*/
- private void setThreadList(ArrayList threads) {
+ private void setThreadList(ArrayList<JDIThread> threads) {
fThreads = threads;
}
-
+
/**
- * Returns the collection of breakpoints installed in this
- * debug target.
+ * Returns the collection of breakpoints installed in this debug target.
*
- * @return list of installed breakpoints - instances of
- * <code>IJavaBreakpoint</code>
+ * @return list of installed breakpoints - instances of
+ * <code>IJavaBreakpoint</code>
*/
- public List getBreakpoints() {
+ public List<IBreakpoint> getBreakpoints() {
return fBreakpoints;
}
-
+
/**
- * Sets the list of breakpoints installed in this debug
- * target. Set to an empty list on creation.
+ * Sets the list of breakpoints installed in this debug target. Set to an
+ * empty list on creation.
*
- * @param breakpoints empty list
+ * @param breakpoints
+ * empty list
*/
- private void setBreakpoints(List breakpoints) {
+ private void setBreakpoints(List<IBreakpoint> breakpoints) {
fBreakpoints = breakpoints;
}
-
+
/**
- * Notifies this target that the underlying VM has started.
- * This is the first event received from the VM.
- * The VM is resumed. This event is not generated when
- * an attach is made to a VM that is already running
- * (has already started up). The VM is resumed as specified
- * on creation.
+ * Notifies this target that the underlying VM has started. This is the
+ * first event received from the VM. The VM is resumed. This event is not
+ * generated when an attach is made to a VM that is already running (has
+ * already started up). The VM is resumed as specified on creation.
*
- * @param event VM start event
+ * @param event
+ * VM start event
*/
public void handleVMStart(VMStartEvent event) {
if (isResumeOnStartup()) {
@@ -396,62 +408,71 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
}
// If any threads have resumed since thread collection was initialized,
- // update their status (avoid concurrent modification - use #getThreads())
+ // update their status (avoid concurrent modification - use
+ // #getThreads())
IThread[] threads = getThreads();
- for (int i = 0; i < threads.length; i++) {
- JDIThread thread = (JDIThread)threads[i];
+ for (IThread thread2 : threads) {
+ JDIThread thread = (JDIThread) thread2;
if (thread.isSuspended()) {
try {
- boolean suspended = thread.getUnderlyingThread().isSuspended();
+ boolean suspended = thread.getUnderlyingThread()
+ .isSuspended();
if (!suspended) {
thread.setRunning(true);
thread.fireResumeEvent(DebugEvent.CLIENT_REQUEST);
}
} catch (VMDisconnectedException e) {
- } catch (ObjectCollectedException e){
+ } catch (ObjectCollectedException e) {
} catch (RuntimeException e) {
logError(e);
- }
+ }
}
}
-
+
}
-
+
/**
- * Initialize event requests and state from the underlying VM.
- * This method is synchronized to ensure that we do not start
- * to process an events from the target until our state is
- * initialized.
+ * Initialize event requests and state from the underlying VM. This method
+ * is synchronized to ensure that we do not start to process an events from
+ * the target until our state is initialized.
*/
protected synchronized void initialize() {
setEventDispatcher(new EventDispatcher(this));
- setRequestTimeout(JDIDebugModel.getPreferences().getInt(JDIDebugModel.PREF_REQUEST_TIMEOUT));
+ setRequestTimeout(Platform.getPreferencesService().getInt(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugModel.PREF_REQUEST_TIMEOUT,
+ JDIDebugModel.DEF_REQUEST_TIMEOUT,
+ null));
initializeRequests();
initializeState();
initializeBreakpoints();
getLaunch().addDebugTarget(this);
- DebugPlugin plugin = DebugPlugin.getDefault();
+ DebugPlugin plugin = DebugPlugin.getDefault();
plugin.addDebugEventListener(this);
fireCreationEvent();
- // begin handling/dispatching events after the creation event is handled by all listeners
+ // begin handling/dispatching events after the creation event is handled
+ // by all listeners
plugin.asyncExec(new Runnable() {
public void run() {
EventDispatcher dispatcher = getEventDispatcher();
- if (dispatcher != null) {
- Thread t= new Thread(dispatcher, JDIDebugModel.getPluginIdentifier() + JDIDebugModelMessages.JDIDebugTarget_JDI_Event_Dispatcher);
- t.setDaemon(true);
- t.start();
- }
+ if (dispatcher != null) {
+ Thread t = new Thread(
+ dispatcher,
+ JDIDebugModel.getPluginIdentifier()
+ + JDIDebugModelMessages.JDIDebugTarget_JDI_Event_Dispatcher);
+ t.setDaemon(true);
+ t.start();
+ }
}
});
}
-
+
/**
- * Adds all of the pre-existing threads to this debug target.
+ * Adds all of the pre-existing threads to this debug target.
*/
protected void initializeState() {
- List threads= null;
+ List<ThreadReference> threads = null;
VirtualMachine vm = getVM();
if (vm != null) {
try {
@@ -461,59 +482,60 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
internalError(e);
}
try {
- threads= vm.allThreads();
+ threads = vm.allThreads();
} catch (RuntimeException e) {
internalError(e);
}
if (threads != null) {
- Iterator initialThreads= threads.iterator();
+ Iterator<ThreadReference> initialThreads = threads.iterator();
while (initialThreads.hasNext()) {
- createThread((ThreadReference) initialThreads.next());
+ createThread(initialThreads.next());
}
- }
+ }
}
-
+
if (isResumeOnStartup()) {
setSuspended(false);
}
}
-
+
/**
- * Registers event handlers for thread creation,
- * thread termination.
+ * Registers event handlers for thread creation, thread termination.
*/
protected void initializeRequests() {
setThreadStartHandler(new ThreadStartHandler());
- new ThreadDeathHandler();
+ new ThreadDeathHandler();
}
/**
- * Installs all Java breakpoints that currently exist in
- * the breakpoint manager
+ * Installs all Java breakpoints that currently exist in the breakpoint
+ * manager
*/
protected void initializeBreakpoints() {
- IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
+ IBreakpointManager manager = DebugPlugin.getDefault()
+ .getBreakpointManager();
manager.addBreakpointListener(this);
- IBreakpoint[] bps = manager.getBreakpoints(JDIDebugModel.getPluginIdentifier());
- for (int i = 0; i < bps.length; i++) {
- if (bps[i] instanceof IJavaBreakpoint) {
- breakpointAdded(bps[i]);
+ IBreakpoint[] bps = manager.getBreakpoints(JDIDebugModel
+ .getPluginIdentifier());
+ for (IBreakpoint bp : bps) {
+ if (bp instanceof IJavaBreakpoint) {
+ breakpointAdded(bp);
}
}
}
-
+
/**
- * Creates, adds and returns a thread for the given
- * underlying thread reference. A creation event
- * is fired for the thread.
- * Returns <code>null</code> if during the creation of the thread this target
- * is set to the disconnected state.
+ * Creates, adds and returns a thread for the given underlying thread
+ * reference. A creation event is fired for the thread. Returns
+ * <code>null</code> if during the creation of the thread this target is set
+ * to the disconnected state.
*
- * @param thread underlying thread
+ * @param thread
+ * underlying thread
* @return model thread
*/
protected JDIThread createThread(ThreadReference thread) {
- JDIThread jdiThread= newThread(thread);
+ JDIThread jdiThread = newThread(thread);
if (jdiThread == null) {
return null;
}
@@ -526,12 +548,13 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
jdiThread.fireCreationEvent();
return jdiThread;
}
-
+
/**
* Factory method for creating new threads. Creates and returns a new thread
* object for the underlying thread reference, or <code>null</code> if none
*
- * @param reference thread reference
+ * @param reference
+ * thread reference
* @return JDI model thread
*/
protected JDIThread newThread(ThreadReference reference) {
@@ -543,34 +566,35 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return null;
}
-
+
/**
* @see IDebugTarget#getThreads()
*/
public IThread[] getThreads() {
synchronized (fThreads) {
- return (IThread[])fThreads.toArray(new IThread[0]);
+ return fThreads.toArray(new IThread[0]);
}
}
-
+
/**
* @see ISuspendResume#canResume()
*/
public boolean canResume() {
- return (isSuspended() || canResumeThreads())
- && isAvailable() && !isPerformingHotCodeReplace();
+ return (isSuspended() || canResumeThreads()) && isAvailable()
+ && !isPerformingHotCodeReplace();
}
/**
* Returns whether this target has any threads which can be resumed.
+ *
* @return true if any thread can be resumed, false otherwise
* @since 3.2
*/
private boolean canResumeThreads() {
- Iterator it = getThreadIterator();
- while(it.hasNext()){
- IThread thread = (IThread)it.next();
- if(thread.canResume())
+ Iterator<JDIThread> it = getThreadIterator();
+ while (it.hasNext()) {
+ IThread thread = it.next();
+ if (thread.canResume())
return true;
}
return false;
@@ -582,9 +606,9 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
public boolean canSuspend() {
if (!isSuspended() && isAvailable()) {
// allow suspend when one or more threads are currently running
- IThread[] threads= getThreads();
- for (int i= 0, numThreads= threads.length; i < numThreads; i++) {
- if (((JDIThread)threads[i]).canSuspend()) {
+ IThread[] threads = getThreads();
+ for (IThread thread : threads) {
+ if (((JDIThread) thread).canSuspend()) {
return true;
}
}
@@ -603,10 +627,11 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
/**
* @see IDisconnect#canDisconnect()
*/
+ @Override
public boolean canDisconnect() {
return supportsDisconnect() && !isDisconnected();
}
-
+
/**
* Returns whether this debug target supports disconnecting.
*
@@ -615,18 +640,18 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
protected boolean supportsDisconnect() {
return fSupportsDisconnect;
}
-
+
/**
- * Sets whether this debug target supports disconnection.
- * Set on creation.
+ * Sets whether this debug target supports disconnection. Set on creation.
*
- * @param supported <code>true</code> if this target supports
- * disconnection, otherwise <code>false</code>
+ * @param supported
+ * <code>true</code> if this target supports disconnection,
+ * otherwise <code>false</code>
*/
private void setSupportsDisconnect(boolean supported) {
fSupportsDisconnect = supported;
}
-
+
/**
* Returns whether this debug target supports termination.
*
@@ -635,30 +660,32 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
protected boolean supportsTerminate() {
return fSupportsTerminate;
}
-
+
/**
- * Sets whether this debug target supports termination.
- * Set on creation.
+ * Sets whether this debug target supports termination. Set on creation.
*
- * @param supported <code>true</code> if this target supports
- * termination, otherwise <code>false</code>
+ * @param supported
+ * <code>true</code> if this target supports termination,
+ * otherwise <code>false</code>
*/
private void setSupportsTerminate(boolean supported) {
fSupportsTerminate = supported;
}
-
+
/**
* @see IJavaDebugTarget#supportsHotCodeReplace()
*/
public boolean supportsHotCodeReplace() {
return supportsJ9HotCodeReplace() || supportsJDKHotCodeReplace();
}
-
+
/**
* @see IJavaDebugTarget#supportsInstanceBreakpoints()
*/
public boolean supportsInstanceBreakpoints() {
- if (isAvailable() && JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] {1,4})) {
+ if (isAvailable()
+ && JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] { 1,
+ 4 })) {
VirtualMachine vm = getVM();
if (vm != null) {
return vm.canUseInstanceFilters();
@@ -666,9 +693,10 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return false;
}
-
+
/**
- * Returns whether this debug target supports hot code replace for the J9 VM.
+ * Returns whether this debug target supports hot code replace for the J9
+ * VM.
*
* @return whether this debug target supports J9 hot code replace
*/
@@ -676,22 +704,26 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
VirtualMachine vm = getVM();
if (isAvailable() && vm instanceof org.eclipse.jdi.hcr.VirtualMachine) {
try {
- return ((org.eclipse.jdi.hcr.VirtualMachine)vm).canReloadClasses();
+ return ((org.eclipse.jdi.hcr.VirtualMachine) vm)
+ .canReloadClasses();
} catch (UnsupportedOperationException e) {
- // This is not an error condition - UnsupportedOperationException is thrown when a VM does
+ // This is not an error condition -
+ // UnsupportedOperationException is thrown when a VM does
// not support HCR
}
}
return false;
}
-
+
/**
* Returns whether this debug target supports hot code replace for JDK VMs.
*
* @return whether this debug target supports JDK hot code replace
*/
public boolean supportsJDKHotCodeReplace() {
- if (isAvailable() && JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] {1,4})) {
+ if (isAvailable()
+ && JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] { 1,
+ 4 })) {
VirtualMachine vm = getVM();
if (vm != null) {
return vm.canRedefineClasses();
@@ -699,14 +731,16 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return false;
}
-
+
/**
* Returns whether this debug target supports popping stack frames.
*
* @return whether this debug target supports popping stack frames.
*/
public boolean canPopFrames() {
- if (isAvailable() && JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] {1,4})) {
+ if (isAvailable()
+ && JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] { 1,
+ 4 })) {
VirtualMachine vm = getVM();
if (vm != null) {
return vm.canPopFrames();
@@ -718,6 +752,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
/**
* @see IDisconnect#disconnect()
*/
+ @Override
public void disconnect() throws DebugException {
if (!isAvailable()) {
@@ -726,7 +761,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
if (!canDisconnect()) {
- notSupported(JDIDebugModelMessages.JDIDebugTarget_does_not_support_disconnect);
+ notSupported(JDIDebugModelMessages.JDIDebugTarget_does_not_support_disconnect);
}
try {
@@ -740,11 +775,14 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
// normal disconnect handling
disconnected();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIDebugTarget_exception_disconnecting, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIDebugTarget_exception_disconnecting,
+ e.toString()), e);
}
}
-
+
/**
* Allows for ThreadStartHandler to do clean up/disposal.
*/
@@ -756,57 +794,56 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
/**
- * Returns the underlying virtual machine associated with this
- * debug target, or <code>null</code> if none (disconnected/terminated)
+ * Returns the underlying virtual machine associated with this debug target,
+ * or <code>null</code> if none (disconnected/terminated)
*
* @return the underlying VM or <code>null</code>
*/
+ @Override
public VirtualMachine getVM() {
return fVirtualMachine;
}
-
+
/**
- * Sets the underlying VM associated with this debug
- * target. Set on creation.
+ * Sets the underlying VM associated with this debug target. Set on
+ * creation.
*
- * @param vm underlying VM
+ * @param vm
+ * underlying VM
*/
private void setVM(VirtualMachine vm) {
fVirtualMachine = vm;
}
-
+
/**
- * Sets whether this debug target has performed a hot
- * code replace.
+ * Sets whether this debug target has performed a hot code replace.
*/
public void setHCROccurred(boolean occurred) {
- fHasHCROccurred= occurred;
+ fHasHCROccurred = occurred;
}
-
- public void removeOutOfSynchTypes(List qualifiedNames) {
+
+ public void removeOutOfSynchTypes(List<String> qualifiedNames) {
fOutOfSynchTypes.removeAll(qualifiedNames);
}
-
+
/**
- * Sets the list of out of synch types
- * to the given list.
+ * Sets the list of out of synch types to the given list.
*/
- private void setOutOfSynchTypes(List qualifiedNames) {
- fOutOfSynchTypes= new HashSet();
+ private void setOutOfSynchTypes(List<String> qualifiedNames) {
+ fOutOfSynchTypes = new HashSet<String>();
fOutOfSynchTypes.addAll(qualifiedNames);
}
-
+
/**
- * The given types have failed to be reloaded by HCR.
- * Add them to the list of out of synch types.
+ * The given types have failed to be reloaded by HCR. Add them to the list
+ * of out of synch types.
*/
- public void addOutOfSynchTypes(List qualifiedNames) {
+ public void addOutOfSynchTypes(List<String> qualifiedNames) {
fOutOfSynchTypes.addAll(qualifiedNames);
}
-
+
/**
- * Returns whether the given type is out of synch in this
- * target.
+ * Returns whether the given type is out of synch in this target.
*/
public boolean isOutOfSynch(String qualifiedName) {
if (fOutOfSynchTypes == null || fOutOfSynchTypes.isEmpty()) {
@@ -814,35 +851,35 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return fOutOfSynchTypes.contains(qualifiedName);
}
-
+
/**
* @see IJavaDebugTarget#isOutOfSynch()
*/
public boolean isOutOfSynch() throws DebugException {
- Iterator threads= getThreadIterator();
+ Iterator<JDIThread> threads = getThreadIterator();
while (threads.hasNext()) {
- JDIThread thread= (JDIThread)threads.next();
+ JDIThread thread = threads.next();
if (thread.isOutOfSynch()) {
return true;
}
}
return false;
- }
-
+ }
+
/**
* @see IJavaDebugTarget#mayBeOutOfSynch()
*/
public boolean mayBeOutOfSynch() {
- Iterator threads= getThreadIterator();
+ Iterator<JDIThread> threads = getThreadIterator();
while (threads.hasNext()) {
- JDIThread thread= (JDIThread)threads.next();
+ JDIThread thread = threads.next();
if (thread.mayBeOutOfSynch()) {
return true;
}
}
return false;
}
-
+
/**
* Returns whether a hot code replace attempt has failed.
*
@@ -851,30 +888,31 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
public boolean hasHCRFailed() {
return fOutOfSynchTypes != null && !fOutOfSynchTypes.isEmpty();
}
-
+
/**
- * Returns whether this debug target has performed
- * a hot code replace
+ * Returns whether this debug target has performed a hot code replace
*/
public boolean hasHCROccurred() {
return fHasHCROccurred;
}
-
+
/**
* Reinstall all breakpoints installed in the given resources
+ * @param resources
+ * @param classNames
*/
- public void reinstallBreakpointsIn(List resources, List classNames) {
- List breakpoints= getBreakpoints();
- IJavaBreakpoint[] copy= new IJavaBreakpoint[breakpoints.size()];
+ public void reinstallBreakpointsIn(List<IResource> resources, List<String> classNames) {
+ List<IBreakpoint> breakpoints = getBreakpoints();
+ IJavaBreakpoint[] copy = new IJavaBreakpoint[breakpoints.size()];
breakpoints.toArray(copy);
- IJavaBreakpoint breakpoint= null;
- String installedType= null;
-
- for (int i= 0; i < copy.length; i++) {
- breakpoint= copy[i];
+ IJavaBreakpoint breakpoint = null;
+ String installedType = null;
+
+ for (IJavaBreakpoint element : copy) {
+ breakpoint = element;
if (breakpoint instanceof JavaLineBreakpoint) {
try {
- installedType= breakpoint.getTypeName();
+ installedType = breakpoint.getTypeName();
if (classNames.contains(installedType)) {
breakpointRemoved(breakpoint, null);
breakpointAdded(breakpoint);
@@ -884,20 +922,21 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
continue;
}
}
- }
+ }
}
/**
- * Finds and returns the JDI thread for the associated thread reference,
- * or <code>null</code> if not found.
+ * Finds and returns the JDI thread for the associated thread reference, or
+ * <code>null</code> if not found.
*
- * @param the underlying thread reference
+ * @param the
+ * underlying thread reference
* @return the associated model thread
*/
public JDIThread findThread(ThreadReference tr) {
- Iterator iter= getThreadIterator();
+ Iterator<JDIThread> iter = getThreadIterator();
while (iter.hasNext()) {
- JDIThread thread = (JDIThread) iter.next();
+ JDIThread thread = iter.next();
if (thread.getUnderlyingThread().equals(tr))
return thread;
}
@@ -913,54 +952,57 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return fName;
}
-
+
/**
- * Sets the name of this debug target. Set on creation,
- * and if set to <code>null</code> the name will be
- * retrieved lazily from the underlying VM.
+ * Sets the name of this debug target. Set on creation, and if set to
+ * <code>null</code> the name will be retrieved lazily from the underlying
+ * VM.
*
- * @param name the name of this VM or <code>null</code>
- * if the name should be retrieved from the underlying VM
+ * @param name
+ * the name of this VM or <code>null</code> if the name should be
+ * retrieved from the underlying VM
*/
protected void setName(String name) {
fName = name;
}
-
+
/**
- * Sets the process associated with this debug target,
- * possibly <code>null</code>. Set on creation.
+ * Sets the process associated with this debug target, possibly
+ * <code>null</code>. Set on creation.
*
- * @param process the system process associated with the
- * underlying VM, or <code>null</code> if no process is
- * associated with this debug target (for example, a remote
- * VM).
+ * @param process
+ * the system process associated with the underlying VM, or
+ * <code>null</code> if no process is associated with this debug
+ * target (for example, a remote VM).
*/
protected void setProcess(IProcess process) {
fProcess = process;
}
-
+
/**
* @see IDebugTarget#getProcess()
*/
public IProcess getProcess() {
return fProcess;
}
-
+
/**
- * Notification the underlying VM has died. Updates
- * the state of this target to be terminated.
+ * Notification the underlying VM has died. Updates the state of this target
+ * to be terminated.
*
- * @param event VM death event
+ * @param event
+ * VM death event
*/
public void handleVMDeath(VMDeathEvent event) {
terminated();
}
/**
- * Notification the underlying VM has disconnected.
- * Updates the state of this target to be terminated.
+ * Notification the underlying VM has disconnected. Updates the state of
+ * this target to be terminated.
*
- * @param event disconnect event
+ * @param event
+ * disconnect event
*/
public void handleVMDisconnect(VMDisconnectEvent event) {
if (isTerminating()) {
@@ -969,26 +1011,26 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
disconnected();
}
}
-
+
/**
* @see ISuspendResume#isSuspended()
*/
public boolean isSuspended() {
return fSuspended;
}
-
+
/**
* Sets whether this VM is suspended.
*
- * @param suspended whether this VM is suspended
+ * @param suspended
+ * whether this VM is suspended
*/
private void setSuspended(boolean suspended) {
fSuspended = suspended;
}
-
+
/**
- * Returns whether this target is available to
- * handle VM requests
+ * Returns whether this target is available to handle VM requests
*/
public boolean isAvailable() {
return !(isTerminated() || isTerminating() || isDisconnected());
@@ -1004,117 +1046,137 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
/**
* Sets whether this debug target is terminated
*
- * @param terminated <code>true</code> if this debug
- * target is terminated, otherwise <code>false</code>
+ * @param terminated
+ * <code>true</code> if this debug target is terminated,
+ * otherwise <code>false</code>
*/
protected void setTerminated(boolean terminated) {
fTerminated = terminated;
}
-
+
/**
* Sets whether this debug target is disconnected
*
- * @param disconnected <code>true</code> if this debug
- * target is disconnected, otherwise <code>false</code>
+ * @param disconnected
+ * <code>true</code> if this debug target is disconnected,
+ * otherwise <code>false</code>
*/
protected void setDisconnected(boolean disconnected) {
- fDisconnected= disconnected;
+ fDisconnected = disconnected;
}
-
+
/**
* @see IDisconnect#isDisconnected()
*/
+ @Override
public boolean isDisconnected() {
return fDisconnected;
}
-
+
/**
- * Creates, enables and returns a class prepare request for the
- * specified class name in this target.
+ * Creates, enables and returns a class prepare request for the specified
+ * class name in this target.
*
- * @param classPattern regular expression specifying the pattern of
- * class names that will cause the event request to fire. Regular
- * expressions may begin with a '*', end with a '*', or be an exact
- * match.
- * @exception CoreException if unable to create the request
- */
- public ClassPrepareRequest createClassPrepareRequest(String classPattern) throws CoreException {
+ * @param classPattern
+ * regular expression specifying the pattern of class names that
+ * will cause the event request to fire. Regular expressions may
+ * begin with a '*', end with a '*', or be an exact match.
+ * @exception CoreException
+ * if unable to create the request
+ */
+ public ClassPrepareRequest createClassPrepareRequest(String classPattern)
+ throws CoreException {
return createClassPrepareRequest(classPattern, null);
}
-
- /**
- * Creates, enables and returns a class prepare request for the
- * specified class name in this target. Can specify a class exclusion filter
- * as well.
- * This is a utility method used by event requesters that need to
- * create class prepare requests.
- *
- * @param classPattern regular expression specifying the pattern of
- * class names that will cause the event request to fire. Regular
- * expressions may begin with a '*', end with a '*', or be an exact
- * match.
- * @param classExclusionPattern regular expression specifying the pattern of
- * class names that will not cause the event request to fire. Regular
- * expressions may begin with a '*', end with a '*', or be an exact
- * match. May be <code>null</code>.
- * @exception CoreException if unable to create the request
- */
- public ClassPrepareRequest createClassPrepareRequest(String classPattern, String classExclusionPattern) throws CoreException {
- return createClassPrepareRequest(classPattern, classExclusionPattern, true);
- }
-
- /**
- * Creates, enables and returns a class prepare request for the
- * specified class name in this target. Can specify a class exclusion filter
- * as well.
- * This is a utility method used by event requesters that need to
- * create class prepare requests.
- *
- * @param classPattern regular expression specifying the pattern of
- * class names that will cause the event request to fire. Regular
- * expressions may begin with a '*', end with a '*', or be an exact
- * match.
- * @param classExclusionPattern regular expression specifying the pattern of
- * class names that will not cause the event request to fire. Regular
- * expressions may begin with a '*', end with a '*', or be an exact
- * match. May be <code>null</code>.
- * @param enabled whether to enable the event request
- * @exception CoreException if unable to create the request
+
+ /**
+ * Creates, enables and returns a class prepare request for the specified
+ * class name in this target. Can specify a class exclusion filter as well.
+ * This is a utility method used by event requesters that need to create
+ * class prepare requests.
+ *
+ * @param classPattern
+ * regular expression specifying the pattern of class names that
+ * will cause the event request to fire. Regular expressions may
+ * begin with a '*', end with a '*', or be an exact match.
+ * @param classExclusionPattern
+ * regular expression specifying the pattern of class names that
+ * will not cause the event request to fire. Regular expressions
+ * may begin with a '*', end with a '*', or be an exact match.
+ * May be <code>null</code>.
+ * @exception CoreException
+ * if unable to create the request
+ */
+ public ClassPrepareRequest createClassPrepareRequest(String classPattern,
+ String classExclusionPattern) throws CoreException {
+ return createClassPrepareRequest(classPattern, classExclusionPattern,
+ true);
+ }
+
+ /**
+ * Creates, enables and returns a class prepare request for the specified
+ * class name in this target. Can specify a class exclusion filter as well.
+ * This is a utility method used by event requesters that need to create
+ * class prepare requests.
+ *
+ * @param classPattern
+ * regular expression specifying the pattern of class names that
+ * will cause the event request to fire. Regular expressions may
+ * begin with a '*', end with a '*', or be an exact match.
+ * @param classExclusionPattern
+ * regular expression specifying the pattern of class names that
+ * will not cause the event request to fire. Regular expressions
+ * may begin with a '*', end with a '*', or be an exact match.
+ * May be <code>null</code>.
+ * @param enabled
+ * whether to enable the event request
+ * @exception CoreException
+ * if unable to create the request
* @since 3.3
*/
- public ClassPrepareRequest createClassPrepareRequest(String classPattern, String classExclusionPattern, boolean enabled) throws CoreException {
- return createClassPrepareRequest(classPattern, classExclusionPattern, enabled, null);
- }
-
- /**
- * Creates, enables and returns a class prepare request for the
- * specified class name in this target. Can specify a class exclusion filter
- * as well.
- * This is a utility method used by event requesters that need to
- * create class prepare requests.
- *
- * @param classPattern regular expression specifying the pattern of
- * class names that will cause the event request to fire. Regular
- * expressions may begin with a '*', end with a '*', or be an exact
- * match. May be <code>null</code> if sourceName is specified
- * @param classExclusionPattern regular expression specifying the pattern of
- * class names that will not cause the event request to fire. Regular
- * expressions may begin with a '*', end with a '*', or be an exact
- * match. May be <code>null</code>.
- * @param enabled whether to enable the event request
- * @param sourceName source name pattern to match or <code>null</code> if classPattern
- * is specified
- * @exception CoreException if unable to create the request
+ public ClassPrepareRequest createClassPrepareRequest(String classPattern,
+ String classExclusionPattern, boolean enabled) throws CoreException {
+ return createClassPrepareRequest(classPattern, classExclusionPattern,
+ enabled, null);
+ }
+
+ /**
+ * Creates, enables and returns a class prepare request for the specified
+ * class name in this target. Can specify a class exclusion filter as well.
+ * This is a utility method used by event requesters that need to create
+ * class prepare requests.
+ *
+ * @param classPattern
+ * regular expression specifying the pattern of class names that
+ * will cause the event request to fire. Regular expressions may
+ * begin with a '*', end with a '*', or be an exact match. May be
+ * <code>null</code> if sourceName is specified
+ * @param classExclusionPattern
+ * regular expression specifying the pattern of class names that
+ * will not cause the event request to fire. Regular expressions
+ * may begin with a '*', end with a '*', or be an exact match.
+ * May be <code>null</code>.
+ * @param enabled
+ * whether to enable the event request
+ * @param sourceName
+ * source name pattern to match or <code>null</code> if
+ * classPattern is specified
+ * @exception CoreException
+ * if unable to create the request
* @since 3.3
*/
- public ClassPrepareRequest createClassPrepareRequest(String classPattern, String classExclusionPattern, boolean enabled, String sourceName) throws CoreException {
- EventRequestManager manager= getEventRequestManager();
+ public ClassPrepareRequest createClassPrepareRequest(String classPattern,
+ String classExclusionPattern, boolean enabled, String sourceName)
+ throws CoreException {
+ EventRequestManager manager = getEventRequestManager();
if (!isAvailable() || manager == null) {
- requestFailed(JDIDebugModelMessages.JDIDebugTarget_Unable_to_create_class_prepare_request___VM_disconnected__2, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIDebugTarget_Unable_to_create_class_prepare_request___VM_disconnected__2,
+ null);
}
- ClassPrepareRequest req= null;
+ ClassPrepareRequest req = null;
try {
- req= manager.createClassPrepareRequest();
+ req = manager.createClassPrepareRequest();
if (classPattern != null) {
req.addClassFilter(classPattern);
}
@@ -1129,7 +1191,9 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
req.enable();
}
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIDebugTarget_Unable_to_create_class_prepare_request__3, e);
+ targetRequestFailed(
+ JDIDebugModelMessages.JDIDebugTarget_Unable_to_create_class_prepare_request__3,
+ e);
// execution will not reach here
return null;
}
@@ -1140,33 +1204,33 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
* @see ISuspendResume#resume()
*/
public void resume() throws DebugException {
- // if a client calls resume, then we should resume on a VMStart event in case
- // it has not yet been received, and the target was created with the "resume"
- // flag as "false". See bug 32372.
+ // if a client calls resume, then we should resume on a VMStart event in
+ // case
+ // it has not yet been received, and the target was created with the
+ // "resume"
+ // flag as "false". See bug 32372.
setResumeOnStartup(true);
- resume(true);
+ resume(true);
}
-
+
/**
* @see ISuspendResume#resume()
*
- * Updates the state of this debug target to resumed,
- * but does not fire notification of the resumption.
+ * Updates the state of this debug target to resumed, but does not fire
+ * notification of the resumption.
*/
public void resumeQuiet() throws DebugException {
resume(false);
}
-
+
/**
* @see ISuspendResume#resume()
*
- * Updates the state of this debug target, but only fires
- * notification to listeners if <code>fireNotification</code>
- * is <code>true</code>.
+ * Updates the state of this debug target, but only fires notification
+ * to listeners if <code>fireNotification</code> is <code>true</code>.
*/
protected void resume(boolean fireNotification) throws DebugException {
- if ((!isSuspended() && !canResumeThreads())
- || !isAvailable()) {
+ if ((!isSuspended() && !canResumeThreads()) || !isAvailable()) {
return;
}
try {
@@ -1185,10 +1249,12 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
} catch (RuntimeException e) {
setSuspended(true);
fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIDebugTarget_exception_resume, new String[] {e.toString()}), e);
- }
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIDebugTarget_exception_resume,
+ e.toString()), e);
+ }
}
-
+
/**
* @see org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(IBreakpoint)
*/
@@ -1197,13 +1263,12 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
/**
- * Notification a breakpoint has been added to the
- * breakpoint manager. If the breakpoint is a Java
- * breakpoint and this target is not terminated,
+ * Notification a breakpoint has been added to the breakpoint manager. If
+ * the breakpoint is a Java breakpoint and this target is not terminated,
* the breakpoint is installed.
*
- * @param breakpoint the breakpoint added to
- * the breakpoint manager
+ * @param breakpoint
+ * the breakpoint added to the breakpoint manager
*/
public void breakpointAdded(IBreakpoint breakpoint) {
if (!isAvailable()) {
@@ -1211,14 +1276,16 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
if (supportsBreakpoint(breakpoint)) {
try {
- JavaBreakpoint javaBreakpoint= (JavaBreakpoint) breakpoint;
+ JavaBreakpoint javaBreakpoint = (JavaBreakpoint) breakpoint;
if (!getBreakpoints().contains(breakpoint)) {
if (!javaBreakpoint.shouldSkipBreakpoint()) {
- // If the breakpoint should be skipped, don't add the breakpoint
- // request to the VM. Just add the breakpoint to the collection so
+ // If the breakpoint should be skipped, don't add the
+ // breakpoint
+ // request to the VM. Just add the breakpoint to the
+ // collection so
// we have it if the manager is later enabled.
javaBreakpoint.addToTarget(this);
- }
+ }
getBreakpoints().add(breakpoint);
}
} catch (CoreException e) {
@@ -1228,36 +1295,37 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
/**
- * Notification that one or more attributes of the
- * given breakpoint has changed. If the breakpoint
- * is a Java breakpoint, the associated event request
- * in the underlying VM is updated to reflect the
- * new state of the breakpoint.
+ * Notification that one or more attributes of the given breakpoint has
+ * changed. If the breakpoint is a Java breakpoint, the associated event
+ * request in the underlying VM is updated to reflect the new state of the
+ * breakpoint.
*
- * @param breakpoint the breakpoint that has changed
+ * @param breakpoint
+ * the breakpoint that has changed
*/
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
}
-
+
/**
- * Notification that the given breakpoint has been removed
- * from the breakpoint manager. If this target is not terminated,
- * the breakpoint is removed from the underlying VM.
+ * Notification that the given breakpoint has been removed from the
+ * breakpoint manager. If this target is not terminated, the breakpoint is
+ * removed from the underlying VM.
*
- * @param breakpoint the breakpoint has been removed from
- * the breakpoint manager.
+ * @param breakpoint
+ * the breakpoint has been removed from the breakpoint manager.
*/
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
if (!isAvailable()) {
return;
- }
+ }
if (supportsBreakpoint(breakpoint)) {
try {
- ((JavaBreakpoint)breakpoint).removeFromTarget(this);
+ ((JavaBreakpoint) breakpoint).removeFromTarget(this);
getBreakpoints().remove(breakpoint);
- Iterator threads = getThreadIterator();
+ Iterator<JDIThread> threads = getThreadIterator();
while (threads.hasNext()) {
- ((JDIThread)threads.next()).removeCurrentBreakpoint(breakpoint);
+ threads.next()
+ .removeCurrentBreakpoint(breakpoint);
}
} catch (CoreException e) {
logError(e);
@@ -1285,31 +1353,34 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
setSuspended(false);
resumeThreads();
fireResumeEvent(DebugEvent.CLIENT_REQUEST);
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIDebugTarget_exception_suspend, new String[] {e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIDebugTarget_exception_suspend,
+ e.toString()), e);
}
-
+
}
-
+
/**
- * Prepares threads to suspend (terminates evaluations, waits for invocations, etc.).
+ * Prepares threads to suspend (terminates evaluations, waits for
+ * invocations, etc.).
*
- * @exception DebugException if a thread times out
+ * @exception DebugException
+ * if a thread times out
*/
protected void prepareThreadsForClientSuspend() throws DebugException {
- Iterator threads = getThreadIterator();
+ Iterator<JDIThread> threads = getThreadIterator();
while (threads.hasNext()) {
- ((JDIThread)threads.next()).prepareForClientSuspend();
+ threads.next().prepareForClientSuspend();
}
}
-
-
+
/**
* Notifies threads that they have been suspended
*/
protected void suspendThreads() {
- Iterator threads = getThreadIterator();
+ Iterator<JDIThread> threads = getThreadIterator();
while (threads.hasNext()) {
- ((JDIThread)threads.next()).suspendedByVM();
+ threads.next().suspendedByVM();
}
}
@@ -1317,49 +1388,49 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
* Notifies threads that they have been resumed
*/
protected void resumeThreads() throws DebugException {
- Iterator threads = getThreadIterator();
+ Iterator<JDIThread> threads = getThreadIterator();
while (threads.hasNext()) {
- ((JDIThread)threads.next()).resumedByVM();
+ threads.next().resumedByVM();
}
}
-
+
/**
- * Notifies this VM to update its state in preparation
- * for a suspend.
+ * Notifies this VM to update its state in preparation for a suspend.
*
- * @param breakpoint the breakpoint that caused the
- * suspension
+ * @param breakpoint
+ * the breakpoint that caused the suspension
*/
public void prepareToSuspendByBreakpoint(JavaBreakpoint breakpoint) {
setSuspended(true);
suspendThreads();
}
-
+
/**
- * Notifies this VM it has been suspended by the
- * given breakpoint
+ * Notifies this VM it has been suspended by the given breakpoint
*
- * @param breakpoint the breakpoint that caused the
- * suspension
+ * @param breakpoint
+ * the breakpoint that caused the suspension
*/
- protected void suspendedByBreakpoint(JavaBreakpoint breakpoint, boolean queueEvent, EventSet set) {
+ protected void suspendedByBreakpoint(JavaBreakpoint breakpoint,
+ boolean queueEvent, EventSet set) {
if (queueEvent) {
queueSuspendEvent(DebugEvent.BREAKPOINT, set);
} else {
fireSuspendEvent(DebugEvent.BREAKPOINT);
}
- }
-
+ }
+
/**
* Notifies this VM suspension has been cancelled
*
- * @param breakpoint the breakpoint that caused the
- * suspension
+ * @param breakpoint
+ * the breakpoint that caused the suspension
*/
- protected void cancelSuspendByBreakpoint(JavaBreakpoint breakpoint) throws DebugException {
+ protected void cancelSuspendByBreakpoint(JavaBreakpoint breakpoint)
+ throws DebugException {
setSuspended(false);
resumeThreads();
- }
+ }
/**
* @see ITerminate#terminate()
@@ -1369,7 +1440,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
return;
}
if (!supportsTerminate()) {
- notSupported(JDIDebugModelMessages.JDIDebugTarget_does_not_support_termination);
+ notSupported(JDIDebugModelMessages.JDIDebugTarget_does_not_support_termination);
}
try {
setTerminating(true);
@@ -1378,12 +1449,12 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
if (vm != null) {
vm.exit(1);
}
- IProcess process= getProcess();
+ IProcess process = getProcess();
if (process != null) {
process.terminate();
}
} catch (VMDisconnectedException e) {
- // if the VM disconnects while exiting, perform
+ // if the VM disconnects while exiting, perform
// normal termination processing
terminated();
} catch (TimeoutException exception) {
@@ -1396,13 +1467,15 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
disconnected();
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIDebugTarget_exception_terminating, new String[] {e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIDebugTarget_exception_terminating,
+ e.toString()), e);
}
}
/**
- * Updates the state of this target to be terminated,
- * if not already terminated.
+ * Updates the state of this target to be terminated, if not already
+ * terminated.
*/
protected void terminated() {
setTerminating(false);
@@ -1413,11 +1486,11 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
fireTerminateEvent();
}
}
-
+
/**
- * Updates the state of this target for disconnection
- * from the VM.
+ * Updates the state of this target for disconnection from the VM.
*/
+ @Override
protected void disconnected() {
if (!isDisconnected()) {
setDisconnected(true);
@@ -1426,15 +1499,13 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
}
- /**
- * Cleans up the internal state of this debug
- * target as a result of a session ending with a
- * VM (as a result of a disconnect or termination of
+ /**
+ * Cleans up the internal state of this debug target as a result of a
+ * session ending with a VM (as a result of a disconnect or termination of
* the VM).
* <p>
- * All threads are removed from this target.
- * This target is removed as a breakpoint listener,
- * and all breakpoints are removed from this target.
+ * All threads are removed from this target. This target is removed as a
+ * breakpoint listener, and all breakpoints are removed from this target.
* </p>
*/
protected void cleanup() {
@@ -1443,18 +1514,19 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
plugin.getBreakpointManager().removeBreakpointListener(this);
plugin.getLaunchManager().removeLaunchListener(this);
plugin.getBreakpointManager().removeBreakpointManagerListener(this);
- plugin.removeDebugEventListener(this);
+ plugin.removeDebugEventListener(this);
removeAllBreakpoints();
fOutOfSynchTypes.clear();
if (fEngines != null) {
- Iterator engines = fEngines.values().iterator();
+ Iterator<IAstEvaluationEngine> engines = fEngines.values().iterator();
while (engines.hasNext()) {
- IAstEvaluationEngine engine = (IAstEvaluationEngine)engines.next();
+ IAstEvaluationEngine engine = engines
+ .next();
engine.dispose();
}
fEngines.clear();
}
- fVirtualMachine= null;
+ fVirtualMachine = null;
setThreadStartHandler(null);
setEventDispatcher(null);
setStepFilters(new String[0]);
@@ -1462,30 +1534,30 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
/**
- * Removes all threads from this target's collection
- * of threads, firing a terminate event for each.
+ * Removes all threads from this target's collection of threads, firing a
+ * terminate event for each.
*/
protected void removeAllThreads() {
- Iterator itr= getThreadIterator();
+ Iterator<JDIThread> itr = getThreadIterator();
while (itr.hasNext()) {
- JDIThread child= (JDIThread) itr.next();
+ JDIThread child = itr.next();
child.terminated();
}
synchronized (fThreads) {
- fThreads.clear();
+ fThreads.clear();
}
}
/**
- * Removes all breakpoints from this target, such
- * that each breakpoint can update its install
- * count. This target's collection of breakpoints
- * is cleared.
+ * Removes all breakpoints from this target, such that each breakpoint can
+ * update its install count. This target's collection of breakpoints is
+ * cleared.
*/
protected void removeAllBreakpoints() {
- Iterator breakpoints= ((ArrayList)((ArrayList)getBreakpoints()).clone()).iterator();
+ Iterator<IBreakpoint> breakpoints = ((ArrayList<IBreakpoint>) ((ArrayList<IBreakpoint>) getBreakpoints())
+ .clone()).iterator();
while (breakpoints.hasNext()) {
- JavaBreakpoint breakpoint= (JavaBreakpoint) breakpoints.next();
+ JavaBreakpoint breakpoint = (JavaBreakpoint) breakpoints.next();
try {
breakpoint.removeFromTarget(this);
} catch (CoreException e) {
@@ -1494,15 +1566,16 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
getBreakpoints().clear();
}
-
+
/**
- * Adds all the breakpoints in this target's collection
- * to this debug target.
+ * Adds all the breakpoints in this target's collection to this debug
+ * target.
*/
protected void reinstallAllBreakpoints() {
- Iterator breakpoints= ((ArrayList)((ArrayList)getBreakpoints()).clone()).iterator();
+ Iterator<IBreakpoint> breakpoints = ((ArrayList<IBreakpoint>) ((ArrayList<IBreakpoint>) getBreakpoints())
+ .clone()).iterator();
while (breakpoints.hasNext()) {
- JavaBreakpoint breakpoint= (JavaBreakpoint) breakpoints.next();
+ JavaBreakpoint breakpoint = (JavaBreakpoint) breakpoints.next();
try {
breakpoint.addToTarget(this);
} catch (CoreException e) {
@@ -1512,12 +1585,11 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
/**
- * Returns VirtualMachine.classesByName(String),
- * logging any JDI exceptions.
- *
+ * Returns VirtualMachine.classesByName(String), logging any JDI exceptions.
+ *
* @see com.sun.jdi.VirtualMachine
*/
- public List jdiClassesByName(String className) {
+ public List<ReferenceType> jdiClassesByName(String className) {
VirtualMachine vm = getVM();
if (vm != null) {
try {
@@ -1539,8 +1611,8 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
*/
public IJavaVariable findVariable(String varName) throws DebugException {
IThread[] threads = getThreads();
- for (int i = 0; i < threads.length; i++) {
- IJavaThread thread = (IJavaThread)threads[i];
+ for (IThread thread2 : threads) {
+ IJavaThread thread = (IJavaThread) thread2;
IJavaVariable var = thread.findVariable(varName);
if (var != null) {
return var;
@@ -1548,24 +1620,25 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return null;
}
-
+
/**
* @see IAdaptable#getAdapter(Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == IJavaDebugTarget.class) {
return this;
}
return super.getAdapter(adapter);
}
-
+
/**
- * The JDIDebugPlugin is shutting down.
- * Shutdown the event dispatcher and do local
- * cleanup.
+ * The JDIDebugPlugin is shutting down. Shutdown the event dispatcher and do
+ * local cleanup.
*/
public void shutdown() {
- EventDispatcher dispatcher = ((JDIDebugTarget)getDebugTarget()).getEventDispatcher();
+ EventDispatcher dispatcher = ((JDIDebugTarget) getDebugTarget())
+ .getEventDispatcher();
if (dispatcher != null) {
dispatcher.shutdown();
}
@@ -1580,37 +1653,42 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
cleanup();
}
-
+
/**
* Returns the CRC-32 of the entire class file contents associated with
- * given type, on the target VM, or <code>null</code> if the type is
- * not loaded, or a CRC for the type is not known.
+ * given type, on the target VM, or <code>null</code> if the type is not
+ * loaded, or a CRC for the type is not known.
*
- * @param typeName fully qualified name of the type for which a
- * CRC is required. For example, "com.example.Example".
+ * @param typeName
+ * fully qualified name of the type for which a CRC is required.
+ * For example, "com.example.Example".
* @return 32 bit CRC, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected Integer getCRC(String typeName) throws DebugException {
if (getVM() instanceof org.eclipse.jdi.hcr.VirtualMachine) {
- List classes = jdiClassesByName(typeName);
+ List<ReferenceType> classes = jdiClassesByName(typeName);
if (!classes.isEmpty()) {
- ReferenceType type = (ReferenceType)classes.get(0);
+ ReferenceType type = classes.get(0);
if (type instanceof org.eclipse.jdi.hcr.ReferenceType) {
try {
- org.eclipse.jdi.hcr.ReferenceType rt = (org.eclipse.jdi.hcr.ReferenceType)type;
+ org.eclipse.jdi.hcr.ReferenceType rt = (org.eclipse.jdi.hcr.ReferenceType) type;
if (rt.isVersionKnown()) {
return new Integer(rt.getClassFileVersion());
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIDebugTarget_exception_retrieving_version_information, new String[] {e.toString(), type.name()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIDebugTarget_exception_retrieving_version_information,
+ e.toString(), type.name()), e);
// execution will never reach this line, as
- // #targetRequestFailed will throw an exception
+ // #targetRequestFailed will throw an exception
return null;
}
}
@@ -1627,64 +1705,70 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
// get java.lang.Class
VirtualMachine vm = getVM();
if (vm == null) {
- requestFailed(JDIDebugModelMessages.JDIDebugTarget_Unable_to_retrieve_types___VM_disconnected__4, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIDebugTarget_Unable_to_retrieve_types___VM_disconnected__4,
+ null);
}
- List classes = vm.classesByName(name);
+ List<ReferenceType> classes = vm.classesByName(name);
if (classes.size() == 0) {
switch (name.charAt(0)) {
- case 'b':
- if (name.equals("boolean")) { //$NON-NLS-1$
- return new IJavaType[] {newValue(true).getJavaType()};
- } else if (name.equals("byte")) { //$NON-NLS-1$
- return new IJavaType[] {newValue((byte)1).getJavaType()};
- }
- break;
- case 'i':
- if (name.equals("int")) { //$NON-NLS-1$
- return new IJavaType[] {newValue(1).getJavaType()};
- }
- break;
- case 'l':
- if (name.equals("long")) { //$NON-NLS-1$
- return new IJavaType[] {newValue(1l).getJavaType()};
- }
- break;
- case 'c':
- if (name.equals("char")) { //$NON-NLS-1$
- return new IJavaType[] {newValue(' ').getJavaType()};
- }
- break;
- case 's':
- if (name.equals("short")) { //$NON-NLS-1$
- return new IJavaType[] {newValue((short)1).getJavaType()};
- }
- break;
- case 'f':
- if (name.equals("float")) { //$NON-NLS-1$
- return new IJavaType[] {newValue(1f).getJavaType()};
- }
- break;
- case 'd':
- if (name.equals("double")) { //$NON-NLS-1$
- return new IJavaType[] {newValue(1d).getJavaType()};
- }
- break;
+ case 'b':
+ if (name.equals("boolean")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue(true).getJavaType() };
+ } else if (name.equals("byte")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue((byte) 1)
+ .getJavaType() };
+ }
+ break;
+ case 'i':
+ if (name.equals("int")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue(1).getJavaType() };
+ }
+ break;
+ case 'l':
+ if (name.equals("long")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue(1l).getJavaType() };
+ }
+ break;
+ case 'c':
+ if (name.equals("char")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue(' ').getJavaType() };
+ }
+ break;
+ case 's':
+ if (name.equals("short")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue((short) 1)
+ .getJavaType() };
+ }
+ break;
+ case 'f':
+ if (name.equals("float")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue(1f).getJavaType() };
+ }
+ break;
+ case 'd':
+ if (name.equals("double")) { //$NON-NLS-1$
+ return new IJavaType[] { newValue(1d).getJavaType() };
+ }
+ break;
}
return null;
}
IJavaType[] types = new IJavaType[classes.size()];
for (int i = 0; i < types.length; i++) {
- types[i] = JDIType.createType(this, (Type)classes.get(i));
+ types[i] = JDIType.createType(this, classes.get(i));
}
return types;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format("{0} occurred while retrieving class for name {1}", new String[]{e.toString(), name}), e); //$NON-NLS-1$
+ targetRequestFailed(
+ MessageFormat
+ .format("{0} occurred while retrieving class for name {1}", e.toString(), name), e); //$NON-NLS-1$
// execution will not reach this line, as
// #targetRequestFailed will throw an exception
return null;
}
}
-
+
/**
* @see IJavaDebugTarget#newValue(boolean)
*/
@@ -1696,7 +1780,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return null;
}
-
+
/**
* @see IJavaDebugTarget#newValue(byte)
*/
@@ -1726,87 +1810,87 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
*/
public IJavaValue newValue(double value) {
VirtualMachine vm = getVM();
- if (vm != null) {
+ if (vm != null) {
Value v = vm.mirrorOf(value);
return JDIValue.createValue(this, v);
}
return null;
}
-
+
/**
* @see IJavaDebugTarget#newValue(float)
*/
public IJavaValue newValue(float value) {
VirtualMachine vm = getVM();
- if (vm != null) {
+ if (vm != null) {
Value v = vm.mirrorOf(value);
return JDIValue.createValue(this, v);
}
return null;
}
-
+
/**
* @see IJavaDebugTarget#newValue(int)
*/
public IJavaValue newValue(int value) {
VirtualMachine vm = getVM();
- if (vm != null) {
+ if (vm != null) {
Value v = vm.mirrorOf(value);
return JDIValue.createValue(this, v);
}
return null;
}
-
+
/**
* @see IJavaDebugTarget#newValue(long)
*/
public IJavaValue newValue(long value) {
VirtualMachine vm = getVM();
- if (vm != null) {
+ if (vm != null) {
Value v = vm.mirrorOf(value);
return JDIValue.createValue(this, v);
}
return null;
- }
-
+ }
+
/**
* @see IJavaDebugTarget#newValue(short)
*/
public IJavaValue newValue(short value) {
VirtualMachine vm = getVM();
- if (vm != null) {
+ if (vm != null) {
Value v = vm.mirrorOf(value);
return JDIValue.createValue(this, v);
}
return null;
}
-
+
/**
* @see IJavaDebugTarget#newValue(String)
*/
public IJavaValue newValue(String value) {
VirtualMachine vm = getVM();
- if (vm != null) {
+ if (vm != null) {
Value v = vm.mirrorOf(value);
return JDIValue.createValue(this, v);
}
return null;
}
-
+
/**
* @see IJavaDebugTarget#nullValue()
*/
public IJavaValue nullValue() {
return JDIValue.createValue(this, null);
}
-
+
/**
* @see IJavaDebugTarget#voidValue()
*/
public IJavaValue voidValue() {
return new JDIVoidValue(this);
}
-
+
protected boolean isTerminating() {
return fTerminating;
}
@@ -1814,28 +1898,27 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
protected void setTerminating(boolean terminating) {
fTerminating = terminating;
}
-
+
/**
- * An event handler for thread start events. When a thread
- * starts in the target VM, a model thread is created.
+ * An event handler for thread start events. When a thread starts in the
+ * target VM, a model thread is created.
*/
class ThreadStartHandler implements IJDIEventListener {
-
+
protected EventRequest fRequest;
-
+
protected ThreadStartHandler() {
createRequest();
- }
-
+ }
+
/**
- * Creates and registers a request to handle all thread start
- * events
+ * Creates and registers a request to handle all thread start events
*/
protected void createRequest() {
EventRequestManager manager = getEventRequestManager();
- if (manager != null) {
+ if (manager != null) {
try {
- EventRequest req= manager.createThreadStartRequest();
+ EventRequest req = manager.createThreadStartRequest();
req.setSuspendPolicy(EventRequest.SUSPEND_NONE);
req.enable();
addJDIEventListener(this, req);
@@ -1847,19 +1930,21 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
/**
- * Creates a model thread for the underlying JDI thread
- * and adds it to the collection of threads for this
- * debug target. As a side effect of creating the thread,
- * a create event is fired for the model thread.
- * The event is ignored if the underlying thread is already
- * marked as collected.
+ * Creates a model thread for the underlying JDI thread and adds it to
+ * the collection of threads for this debug target. As a side effect of
+ * creating the thread, a create event is fired for the model thread.
+ * The event is ignored if the underlying thread is already marked as
+ * collected.
*
- * @param event a thread start event
- * @param target the target in which the thread started
+ * @param event
+ * a thread start event
+ * @param target
+ * the target in which the thread started
* @return <code>true</code> - the thread should be resumed
*/
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
- ThreadReference thread= ((ThreadStartEvent)event).thread();
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet) {
+ ThreadReference thread = ((ThreadStartEvent) event).thread();
try {
if (thread.isCollected()) {
return false;
@@ -1871,7 +1956,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
} catch (TimeoutException e) {
// continue - attempt to create the thread
}
- JDIThread jdiThread= findThread(thread);
+ JDIThread jdiThread = findThread(thread);
if (jdiThread == null) {
jdiThread = createThread(thread);
if (jdiThread == null) {
@@ -1883,16 +1968,22 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return !jdiThread.isSuspended();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete
+ * (com.sun.jdi.event.Event,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
*/
- public void eventSetComplete(Event event, JDIDebugTarget target, boolean suspend, EventSet eventSet) {
+ public void eventSetComplete(Event event, JDIDebugTarget target,
+ boolean suspend, EventSet eventSet) {
// do nothing
}
-
+
/**
- * De-registers this event listener.
+ * unregisters this event listener.
*/
protected void deleteRequest() {
if (getRequest() != null) {
@@ -1900,7 +1991,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
setRequest(null);
}
}
-
+
protected EventRequest getRequest() {
return fRequest;
}
@@ -1908,50 +1999,51 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
protected void setRequest(EventRequest request) {
fRequest = request;
}
-}
-
+ }
+
/**
- * An event handler for thread death events. When a thread
- * dies in the target VM, its associated model thread is
- * removed from the debug target.
+ * An event handler for thread death events. When a thread dies in the
+ * target VM, its associated model thread is removed from the debug target.
*/
class ThreadDeathHandler implements IJDIEventListener {
-
+
protected ThreadDeathHandler() {
createRequest();
}
-
+
/**
- * Creates and registers a request to listen to thread
- * death events.
+ * Creates and registers a request to listen to thread death events.
*/
protected void createRequest() {
EventRequestManager manager = getEventRequestManager();
if (manager != null) {
try {
- EventRequest req= manager.createThreadDeathRequest();
+ EventRequest req = manager.createThreadDeathRequest();
req.setSuspendPolicy(EventRequest.SUSPEND_NONE);
req.enable();
- addJDIEventListener(this, req);
+ addJDIEventListener(this, req);
} catch (RuntimeException e) {
logError(e);
- }
+ }
}
}
-
+
/**
* Locates the model thread associated with the underlying JDI thread
- * that has terminated, and removes it from the collection of
- * threads belonging to this debug target. A terminate event is
- * fired for the model thread.
- *
- * @param event a thread death event
- * @param target the target in which the thread died
+ * that has terminated, and removes it from the collection of threads
+ * belonging to this debug target. A terminate event is fired for the
+ * model thread.
+ *
+ * @param event
+ * a thread death event
+ * @param target
+ * the target in which the thread died
* @return <code>true</code> - the thread should be resumed
*/
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
- ThreadReference ref= ((ThreadDeathEvent)event).thread();
- JDIThread thread= findThread(ref);
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet) {
+ ThreadReference ref = ((ThreadDeathEvent) event).thread();
+ JDIThread thread = findThread(ref);
if (thread == null) {
// wait for any thread start event sets to complete processing
// see bug 272494
@@ -1960,8 +2052,8 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
} catch (OperationCanceledException e) {
} catch (InterruptedException e) {
}
- thread = target.findThread(ref);
- }
+ thread = target.findThread(ref);
+ }
if (thread != null) {
synchronized (fThreads) {
fThreads.remove(thread);
@@ -1970,16 +2062,22 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return true;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete
+ * (com.sun.jdi.event.Event,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
*/
- public void eventSetComplete(Event event, JDIDebugTarget target, boolean suspend, EventSet eventSet) {
+ public void eventSetComplete(Event event, JDIDebugTarget target,
+ boolean suspend, EventSet eventSet) {
// do nothing
}
-
+
}
-
+
class CleanUpJob extends Job {
/**
@@ -1990,9 +2088,14 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
setSystem(true);
}
- /* (non-Javadoc)
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime
+ * .IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (isAvailable()) {
if (fEventDispatcher != null) {
@@ -2003,23 +2106,28 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
return Status.OK_STATUS;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
+ @Override
public boolean shouldRun() {
return isAvailable();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.internal.jobs.InternalJob#shouldSchedule()
*/
+ @Override
public boolean shouldSchedule() {
return isAvailable();
}
-
-
+
}
-
+
protected ThreadStartHandler getThreadStartHandler() {
return fThreadStartHandler;
}
@@ -2027,7 +2135,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
protected void setThreadStartHandler(ThreadStartHandler threadStartHandler) {
fThreadStartHandler = threadStartHandler;
}
-
+
/**
* Java debug targets do not support storage retrieval.
*
@@ -2041,11 +2149,11 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
* @see IMemoryBlockRetrieval#getMemoryBlock(long, long)
*/
public IMemoryBlock getMemoryBlock(long startAddress, long length)
- throws DebugException {
- notSupported(JDIDebugModelMessages.JDIDebugTarget_does_not_support_storage_retrieval);
- // this line will not be executed as #notSupported(String)
- // will throw an exception
- return null;
+ throws DebugException {
+ notSupported(JDIDebugModelMessages.JDIDebugTarget_does_not_support_storage_retrieval);
+ // this line will not be executed as #notSupported(String)
+ // will throw an exception
+ return null;
}
/**
@@ -2056,7 +2164,8 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
return;
}
if (launch.equals(getLaunch())) {
- // This target has been de-registered, but it hasn't successfully terminated.
+ // This target has been unregistered, but it hasn't successfully
+ // terminated.
// Update internal state to reflect that it is disconnected
disconnected();
}
@@ -2067,24 +2176,24 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
*/
public void launchAdded(ILaunch launch) {
}
-
+
/**
* @see ILaunchListener#launchChanged(ILaunch)
*/
public void launchChanged(ILaunch launch) {
- }
+ }
/**
- * Sets whether the VM should be resumed on startup.
- * Has no effect if the VM is already running when
- * this target is created.
+ * Sets whether the VM should be resumed on startup. Has no effect if the VM
+ * is already running when this target is created.
*
- * @param resume whether the VM should be resumed on startup
+ * @param resume
+ * whether the VM should be resumed on startup
*/
private synchronized void setResumeOnStartup(boolean resume) {
fResumeOnStartup = resume;
}
-
+
/**
* Returns whether this VM should be resumed on startup.
*
@@ -2093,7 +2202,7 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
protected synchronized boolean isResumeOnStartup() {
return fResumeOnStartup;
}
-
+
/**
* @see IJavaDebugTarget#getStepFilters()
*/
@@ -2121,18 +2230,20 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
public boolean isFilterSynthetics() {
return (fStepFilterMask & FILTER_SYNTHETICS) > 0;
}
-
- /* (non-Javadoc)
- * Was added in 3.3, made API in 3.5
+
+ /*
+ * (non-Javadoc) Was added in 3.3, made API in 3.5
+ *
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#isStepThruFilters()
*/
public boolean isStepThruFilters() {
return (fStepFilterMask & STEP_THRU_FILTERS) > 0;
- }
+ }
/**
* @see IJavaDebugTarget#isStepFiltersEnabled()
*/
+ @Override
public boolean isStepFiltersEnabled() {
return (fStepFilterMask & STEP_FILTERS_ENABLED) > 0;
}
@@ -2144,7 +2255,8 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
if (filter) {
fStepFilterMask = fStepFilterMask | FILTER_CONSTRUCTORS;
} else {
- fStepFilterMask = fStepFilterMask & (FILTER_CONSTRUCTORS ^ XOR_MASK);
+ fStepFilterMask = fStepFilterMask
+ & (FILTER_CONSTRUCTORS ^ XOR_MASK);
}
}
@@ -2155,8 +2267,9 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
if (filter) {
fStepFilterMask = fStepFilterMask | FILTER_STATIC_INITIALIZERS;
} else {
- fStepFilterMask = fStepFilterMask & (FILTER_STATIC_INITIALIZERS ^ XOR_MASK);
- }
+ fStepFilterMask = fStepFilterMask
+ & (FILTER_STATIC_INITIALIZERS ^ XOR_MASK);
+ }
}
/**
@@ -2167,20 +2280,22 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
fStepFilterMask = fStepFilterMask | FILTER_SYNTHETICS;
} else {
fStepFilterMask = fStepFilterMask & (FILTER_SYNTHETICS ^ XOR_MASK);
- }
+ }
}
-
- /* (non-Javadoc)
- * Was added in 3.3, made API in 3.5
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#setStepThruFilters(boolean)
+
+ /*
+ * (non-Javadoc) Was added in 3.3, made API in 3.5
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaDebugTarget#setStepThruFilters(boolean)
*/
public void setStepThruFilters(boolean thru) {
if (thru) {
fStepFilterMask = fStepFilterMask | STEP_THRU_FILTERS;
} else {
fStepFilterMask = fStepFilterMask & (STEP_THRU_FILTERS ^ XOR_MASK);
- }
- }
+ }
+ }
public boolean isFilterGetters() {
return (fStepFilterMask & FILTER_GETTERS) > 0;
@@ -2191,9 +2306,9 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
fStepFilterMask = fStepFilterMask | FILTER_GETTERS;
} else {
fStepFilterMask = fStepFilterMask & (FILTER_GETTERS ^ XOR_MASK);
- }
+ }
}
-
+
public boolean isFilterSetters() {
return (fStepFilterMask & FILTER_SETTERS) > 0;
}
@@ -2203,9 +2318,9 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
fStepFilterMask = fStepFilterMask | FILTER_SETTERS;
} else {
fStepFilterMask = fStepFilterMask & (FILTER_SETTERS ^ XOR_MASK);
- }
+ }
}
-
+
/**
* @see IJavaDebugTarget#setStepFilters(String[])
*/
@@ -2220,8 +2335,9 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
if (enabled) {
fStepFilterMask = fStepFilterMask | STEP_FILTERS_ENABLED;
} else {
- fStepFilterMask = fStepFilterMask & (STEP_FILTERS_ENABLED ^ XOR_MASK);
- }
+ fStepFilterMask = fStepFilterMask
+ & (STEP_FILTERS_ENABLED ^ XOR_MASK);
+ }
}
/**
@@ -2230,10 +2346,11 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
public boolean hasThreads() {
return fThreads.size() > 0;
}
-
+
/**
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
+ @Override
public ILaunch getLaunch() {
return fLaunch;
}
@@ -2241,55 +2358,57 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
/**
* Sets the launch this target is contained in
*
- * @param launch the launch this target is contained in
+ * @param launch
+ * the launch this target is contained in
*/
private void setLaunch(ILaunch launch) {
fLaunch = launch;
}
-
+
/**
- * Returns the number of suspend events that have occurred in this
- * target.
+ * Returns the number of suspend events that have occurred in this target.
*
- * @return the number of suspend events that have occurred in this
- * target
+ * @return the number of suspend events that have occurred in this target
*/
protected int getSuspendCount() {
return fSuspendCount;
- }
-
+ }
+
/**
- * Increments the suspend counter for this target based on the reason
- * for the suspend event. The suspend count is not updated for
- * implicit evaluations.
+ * Increments the suspend counter for this target based on the reason for
+ * the suspend event. The suspend count is not updated for implicit
+ * evaluations.
*
- * @param eventDetail the reason for the suspend event
+ * @param eventDetail
+ * the reason for the suspend event
*/
protected void incrementSuspendCount(int eventDetail) {
- if (eventDetail != DebugEvent.EVALUATION_IMPLICIT) {
- fSuspendCount++;
- }
+ if (eventDetail != DebugEvent.EVALUATION_IMPLICIT) {
+ fSuspendCount++;
+ }
}
-
+
/**
- * Returns an evaluation engine for the given project, creating
- * one if necessary.
+ * Returns an evaluation engine for the given project, creating one if
+ * necessary.
*
- * @param project java project
+ * @param project
+ * java project
* @return evaluation engine
*/
public IAstEvaluationEngine getEvaluationEngine(IJavaProject project) {
if (fEngines == null) {
- fEngines = new HashMap(2);
+ fEngines = new HashMap<IJavaProject, IAstEvaluationEngine>(2);
}
- IAstEvaluationEngine engine = (IAstEvaluationEngine)fEngines.get(project);
+ IAstEvaluationEngine engine = fEngines
+ .get(project);
if (engine == null) {
engine = EvaluationManager.newAstEvaluationEngine(project, this);
fEngines.put(project, engine);
}
return engine;
}
-
+
/**
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsMonitorInformation()
*/
@@ -2299,28 +2418,32 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
VirtualMachine vm = getVM();
if (vm != null) {
- return vm.canGetCurrentContendedMonitor() && vm.canGetMonitorInfo() && vm.canGetOwnedMonitorInfo();
+ return vm.canGetCurrentContendedMonitor() && vm.canGetMonitorInfo()
+ && vm.canGetOwnedMonitorInfo();
}
return false;
}
-
+
/**
* Sets whether or not this debug target is currently performing a hot code
* replace.
*/
public void setIsPerformingHotCodeReplace(boolean isPerformingHotCodeReplace) {
- fIsPerformingHotCodeReplace= isPerformingHotCodeReplace;
+ fIsPerformingHotCodeReplace = isPerformingHotCodeReplace;
}
-
+
/**
* @see IJavaDebugTarget#isPerformingHotCodeReplace()
*/
public boolean isPerformingHotCodeReplace() {
return fIsPerformingHotCodeReplace;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsAccessWatchpoints()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsAccessWatchpoints()
*/
public boolean supportsAccessWatchpoints() {
VirtualMachine vm = getVM();
@@ -2330,8 +2453,12 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsModificationWatchpoints()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsModificationWatchpoints
+ * ()
*/
public boolean supportsModificationWatchpoints() {
VirtualMachine vm = getVM();
@@ -2347,19 +2474,21 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
public void setDefaultStratum(String stratum) {
VirtualMachine vm = getVM();
if (vm != null) {
- vm.setDefaultStratum(stratum);
+ vm.setDefaultStratum(stratum);
}
}
-
+
public String getDefaultStratum() {
VirtualMachine vm = getVM();
if (vm != null) {
- return vm.getDefaultStratum();
+ return vm.getDefaultStratum();
}
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IStepFilters#supportsStepFilters()
*/
public boolean supportsStepFilters() {
@@ -2374,9 +2503,10 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
if (!isAvailable()) {
return;
}
- Iterator breakpoints= ((ArrayList)((ArrayList)getBreakpoints()).clone()).iterator();
+ Iterator<IBreakpoint> breakpoints = ((ArrayList<IBreakpoint>) ((ArrayList<IBreakpoint>) getBreakpoints())
+ .clone()).iterator();
while (breakpoints.hasNext()) {
- JavaBreakpoint breakpoint= (JavaBreakpoint) breakpoints.next();
+ JavaBreakpoint breakpoint = (JavaBreakpoint) breakpoints.next();
try {
if (enabled) {
breakpoint.addToTarget(this);
@@ -2389,67 +2519,79 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- if (events.length == 1) {
- DebugEvent event = events[0];
- if (event.getSource().equals(getProcess()) && event.getKind() == DebugEvent.TERMINATE) {
- // schedule a job to clean up the target in case we never get a terminate/disconnect
- // event from the VM
- int timeout = getRequestTimeout();
- if (timeout < 0) {
- timeout = 3000;
- }
- new CleanUpJob().schedule(timeout);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
- */
- public IDebugTarget getDebugTarget() {
- return this;
- }
-
- /**
- * Adds the given thread group to the list of known thread groups. Also adds any parent thread groups
- * that have not already been added to the list.
- *
- * @param group thread group to add
- */
- void addThreadGroup(ThreadGroupReference group) {
- ThreadGroupReference currentGroup = group;
- while(currentGroup != null){
- synchronized (fGroups) {
- if (findThreadGroup(currentGroup) == null) {
- JDIThreadGroup modelGroup = new JDIThreadGroup(this, currentGroup);
- fGroups.add(modelGroup);
- currentGroup = currentGroup.parent();
- // TODO: create event?
- } else {
- currentGroup = null;
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse
+ * .debug.core.DebugEvent[])
+ */
+ public void handleDebugEvents(DebugEvent[] events) {
+ if (events.length == 1) {
+ DebugEvent event = events[0];
+ if (event.getSource().equals(getProcess())
+ && event.getKind() == DebugEvent.TERMINATE) {
+ // schedule a job to clean up the target in case we never get a
+ // terminate/disconnect
+ // event from the VM
+ int timeout = getRequestTimeout();
+ if (timeout < 0) {
+ timeout = 3000;
+ }
+ new CleanUpJob().schedule(timeout);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
+ */
+ @Override
+ public IDebugTarget getDebugTarget() {
+ return this;
+ }
+
+ /**
+ * Adds the given thread group to the list of known thread groups. Also adds
+ * any parent thread groups that have not already been added to the list.
+ *
+ * @param group
+ * thread group to add
+ */
+ void addThreadGroup(ThreadGroupReference group) {
+ ThreadGroupReference currentGroup = group;
+ while (currentGroup != null) {
+ synchronized (fGroups) {
+ if (findThreadGroup(currentGroup) == null) {
+ JDIThreadGroup modelGroup = new JDIThreadGroup(this,
+ currentGroup);
+ fGroups.add(modelGroup);
+ currentGroup = currentGroup.parent();
+ } else {
+ currentGroup = null;
+ }
+ }
+ }
+ }
+
+ JDIThreadGroup findThreadGroup(ThreadGroupReference group) {
+ synchronized (fGroups) {
+ Iterator<JDIThreadGroup> groups = fGroups.iterator();
+ while (groups.hasNext()) {
+ JDIThreadGroup modelGroup = groups.next();
+ if (modelGroup.getUnderlyingThreadGroup().equals(group)) {
+ return modelGroup;
+ }
}
- }
- }
-
- JDIThreadGroup findThreadGroup(ThreadGroupReference group) {
- synchronized (fGroups) {
- Iterator groups = fGroups.iterator();
- while (groups.hasNext()) {
- JDIThreadGroup modelGroup = (JDIThreadGroup) groups.next();
- if (modelGroup.getUnderlyingThreadGroup().equals(group)) {
- return modelGroup;
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#getThreadGroups()
*/
public IJavaThreadGroup[] getRootThreadGroups() throws DebugException {
@@ -2458,17 +2600,15 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
if (vm == null) {
return new IJavaThreadGroup[0];
}
- List groups = vm.topLevelThreadGroups();
- List modelGroups = new ArrayList(groups.size());
- Iterator iterator = groups.iterator();
- while (iterator.hasNext()) {
- ThreadGroupReference ref = (ThreadGroupReference) iterator.next();
+ List<ThreadGroupReference> groups = vm.topLevelThreadGroups();
+ List<JDIThreadGroup> modelGroups = new ArrayList<JDIThreadGroup>(groups.size());
+ for(ThreadGroupReference ref : groups) {
JDIThreadGroup group = findThreadGroup(ref);
if (group != null) {
modelGroups.add(group);
}
}
- return (IJavaThreadGroup[]) modelGroups.toArray(new IJavaThreadGroup[modelGroups.size()]);
+ return modelGroups.toArray(new IJavaThreadGroup[modelGroups.size()]);
} catch (VMDisconnectedException e) {
// if the VM has disconnected, there are no thread groups
return new IJavaThreadGroup[0];
@@ -2478,17 +2618,23 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#getAllThreadGroups()
*/
public IJavaThreadGroup[] getAllThreadGroups() throws DebugException {
synchronized (fGroups) {
- return (IJavaThreadGroup[]) fGroups.toArray(new IJavaThreadGroup[fGroups.size()]);
+ return fGroups
+ .toArray(new IJavaThreadGroup[fGroups.size()]);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsInstanceRetrieval()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsInstanceRetrieval()
*/
public boolean supportsInstanceRetrieval() {
VirtualMachine vm = getVM();
@@ -2497,91 +2643,112 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
return false;
}
-
+
/**
- * Sends a JDWP command to the back end and returns the JDWP reply packet as bytes.
- * This method creates an appropriate command header and packet id, before sending
- * to the back end.
+ * Sends a JDWP command to the back end and returns the JDWP reply packet as
+ * bytes. This method creates an appropriate command header and packet id,
+ * before sending to the back end.
*
- * @param commandSet command set identifier as defined by JDWP
- * @param commandId command identifier as defined by JDWP
- * @param data any bytes required for the command that follow the command header
- * or <code>null</code> for commands that have no data
+ * @param commandSet
+ * command set identifier as defined by JDWP
+ * @param commandId
+ * command identifier as defined by JDWP
+ * @param data
+ * any bytes required for the command that follow the command
+ * header or <code>null</code> for commands that have no data
* @return raw reply packet as bytes defined by JDWP
- * @exception IOException if an error occurs sending the packet or receiving the reply
+ * @exception IOException
+ * if an error occurs sending the packet or receiving the
+ * reply
* @since 3.3
*/
- public byte[] sendJDWPCommand(byte commandSet, byte commandId, byte[] data) throws IOException {
+ public byte[] sendJDWPCommand(byte commandSet, byte commandId, byte[] data)
+ throws IOException {
int command = (256 * commandSet) + commandId;
- JdwpReplyPacket reply = ((VirtualMachineImpl)getVM()).requestVM(command, data);
+ JdwpReplyPacket reply = ((VirtualMachineImpl) getVM()).requestVM(
+ command, data);
return reply.getPacketAsBytes();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsForceReturn()
*/
public boolean supportsForceReturn() {
VirtualMachine machine = getVM();
- if(machine == null) {
+ if (machine == null) {
return false;
}
return machine.canForceEarlyReturn();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#supportsSelectiveGarbageCollection()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#
+ * supportsSelectiveGarbageCollection()
*/
public boolean supportsSelectiveGarbageCollection() {
return fSupportsDisableGC;
}
-
+
/**
- * Sets whether this target supports selectively disabling/enabling garbage collection
- * of specific objects.
+ * Sets whether this target supports selectively disabling/enabling garbage
+ * collection of specific objects.
*
- * @param enableGC whether this target supports selective GC
+ * @param enableGC
+ * whether this target supports selective GC
*/
void setSupportsSelectiveGarbageCollection(boolean enableGC) {
fSupportsDisableGC = enableGC;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#getVMName()
*/
public String getVMName() throws DebugException {
VirtualMachine vm = getVM();
if (vm == null) {
- requestFailed(JDIDebugModelMessages.JDIDebugTarget_2, new VMDisconnectedException());
+ requestFailed(JDIDebugModelMessages.JDIDebugTarget_2,
+ new VMDisconnectedException());
}
try {
return vm.name();
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIDebugTarget_2, e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ targetRequestFailed(JDIDebugModelMessages.JDIDebugTarget_2, e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return null;
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#getVersion()
*/
public String getVersion() throws DebugException {
VirtualMachine vm = getVM();
if (vm == null) {
- requestFailed(JDIDebugModelMessages.JDIDebugTarget_4, new VMDisconnectedException());
+ requestFailed(JDIDebugModelMessages.JDIDebugTarget_4,
+ new VMDisconnectedException());
}
try {
return vm.version();
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIDebugTarget_4, e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ targetRequestFailed(JDIDebugModelMessages.JDIDebugTarget_4, e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return null;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaDebugTarget#refreshState()
*/
public void refreshState() throws DebugException {
@@ -2590,28 +2757,31 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
}
boolean prevSuspend = isSuspended();
int running = 0;
- List toSuspend = new ArrayList();
- List toResume = new ArrayList();
- List toRefresh = new ArrayList();
- Iterator iterator = getThreadIterator();
+ List<JDIThread> toSuspend = new ArrayList<JDIThread>();
+ List<JDIThread> toResume = new ArrayList<JDIThread>();
+ List<JDIThread> toRefresh = new ArrayList<JDIThread>();
+ Iterator<JDIThread> iterator = getThreadIterator();
while (iterator.hasNext()) {
- JDIThread thread = (JDIThread) iterator.next();
- boolean modelSuspended = thread.isSuspended();
+ JDIThread thread = iterator.next();
+ boolean modelSuspended = thread.isSuspended();
ThreadReference reference = thread.getUnderlyingThread();
try {
boolean realSuspended = reference.isSuspended();
if (realSuspended) {
if (modelSuspended) {
- // Even if the model is suspended, it might be in a different location so refresh
+ // Even if the model is suspended, it might be in a
+ // different location so refresh
toRefresh.add(thread);
} else {
- // The thread is actually suspended, refresh frames and fire suspend event.
+ // The thread is actually suspended, refresh frames and
+ // fire suspend event.
toSuspend.add(thread);
}
} else {
running++;
if (modelSuspended) {
- // thread is actually running, model is suspended, resume model
+ // thread is actually running, model is suspended,
+ // resume model
toResume.add(thread);
}
// else both are running - OK
@@ -2620,7 +2790,8 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
requestFailed(e.getMessage(), e);
}
}
- // if the entire target changed state/fire events at target level, else fire thread events
+ // if the entire target changed state/fire events at target level, else
+ // fire thread events
boolean targetLevelEvent = false;
if (prevSuspend) {
if (running > 0) {
@@ -2636,17 +2807,17 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
if (targetLevelEvent) {
iterator = toSuspend.iterator();
while (iterator.hasNext()) {
- JDIThread thread = (JDIThread) iterator.next();
+ JDIThread thread = iterator.next();
thread.suspendedByVM();
}
iterator = toResume.iterator();
while (iterator.hasNext()) {
- JDIThread thread = (JDIThread) iterator.next();
+ JDIThread thread = iterator.next();
thread.resumedByVM();
}
iterator = toRefresh.iterator();
while (iterator.hasNext()) {
- JDIThread thread = (JDIThread) iterator.next();
+ JDIThread thread = iterator.next();
thread.preserveStackFrames();
}
if (running == 0) {
@@ -2663,31 +2834,35 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
} else {
iterator = toSuspend.iterator();
while (iterator.hasNext()) {
- JDIThread thread = (JDIThread) iterator.next();
+ JDIThread thread = iterator.next();
thread.preserveStackFrames();
thread.setRunning(false);
thread.fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
}
iterator = toResume.iterator();
while (iterator.hasNext()) {
- JDIThread thread = (JDIThread) iterator.next();
+ JDIThread thread = iterator.next();
thread.setRunning(true);
thread.fireResumeEvent(DebugEvent.CLIENT_REQUEST);
}
iterator = toRefresh.iterator();
while (iterator.hasNext()) {
- JDIThread thread = (JDIThread) iterator.next();
+ JDIThread thread = iterator.next();
thread.preserveStackFrames();
thread.fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
}
}
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#sendCommand(byte, byte, byte[])
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#sendCommand(byte, byte,
+ * byte[])
*/
- public byte[] sendCommand(byte commandSet, byte commandId, byte[] data) throws DebugException {
+ public byte[] sendCommand(byte commandSet, byte commandId, byte[] data)
+ throws DebugException {
try {
return sendJDWPCommand(commandSet, commandId, data);
} catch (IOException e) {
@@ -2696,20 +2871,29 @@ public class JDIDebugTarget extends JDIDebugElement implements IJavaDebugTarget,
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#addHotCodeReplaceListener(org.eclipse.jdt.debug.core.IJavaHotCodeReplaceListener)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaDebugTarget#addHotCodeReplaceListener
+ * (org.eclipse.jdt.debug.core.IJavaHotCodeReplaceListener)
*/
public void addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
fHCRListeners.add(listener);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaDebugTarget#removeHotCodeReplaceListener(org.eclipse.jdt.debug.core.IJavaHotCodeReplaceListener)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaDebugTarget#removeHotCodeReplaceListener
+ * (org.eclipse.jdt.debug.core.IJavaHotCodeReplaceListener)
*/
- public void removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener) {
+ public void removeHotCodeReplaceListener(
+ IJavaHotCodeReplaceListener listener) {
fHCRListeners.remove(listener);
}
-
+
/**
* Returns an array of current hot code replace listeners.
*
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIFieldVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIFieldVariable.java
index e9c32b0d6..781126b70 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIFieldVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIFieldVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,16 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdt.debug.core.IJavaFieldVariable;
+import org.eclipse.jdt.debug.core.IJavaModifiers;
import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaReferenceType;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.IJavaValue;
+import org.eclipse.jdt.debug.core.IJavaVariable;
import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ClassNotLoadedException;
@@ -33,14 +35,14 @@ import com.sun.jdi.Value;
/**
* A field member.
*/
-public class JDIFieldVariable extends JDIModificationVariable implements IJavaFieldVariable {
+public class JDIFieldVariable extends JDIModificationVariable implements
+ IJavaFieldVariable {
/**
* The underlying field
*/
private Field fField;
/**
- * The object containing the field,
- * or <code>null</code> for a static field.
+ * The object containing the field, or <code>null</code> for a static field.
*/
private ObjectReference fObject;
/**
@@ -54,46 +56,50 @@ public class JDIFieldVariable extends JDIModificationVariable implements IJavaFi
* structure's children remain more stable in the variables view.
*
* This is <code>null</code> when not created for a logical structure.
- */
+ */
private IJavaValue fLogicalParent;
-
+
/**
* Constructs a field for the given field.
*/
- public JDIFieldVariable(JDIDebugTarget target, Field field, ObjectReference objectRef, IJavaValue logicalParent) {
+ public JDIFieldVariable(JDIDebugTarget target, Field field,
+ ObjectReference objectRef, IJavaValue logicalParent) {
super(target);
- fField= field;
+ fField = field;
if (!field.isStatic()) {
- fObject= objectRef;
+ fObject = objectRef;
}
- fType= (ReferenceType)objectRef.type();
+ fType = (ReferenceType) objectRef.type();
fLogicalParent = logicalParent;
}
/**
- * Constructs a field wrappering the given field.
+ * Constructs a field to wrap the given field.
*/
- public JDIFieldVariable(JDIDebugTarget target, Field field, ReferenceType refType) {
+ public JDIFieldVariable(JDIDebugTarget target, Field field,
+ ReferenceType refType) {
super(target);
- fField= field;
- fType= refType;
+ fField = field;
+ fType = refType;
}
/**
* Returns this variable's current <code>Value</code>.
*/
+ @Override
protected Value retrieveValue() {
if (getField().isStatic()) {
return (getField().declaringType().getValue(getField()));
}
- return getObjectReference().getValue(getField());
+ return getObjectReference().getValue(getField());
}
-
+
/**
* @see IJavaFieldVariable#getDeclaringType()
*/
public IJavaType getDeclaringType() {
- return JDIType.createType((JDIDebugTarget)getDebugTarget(), fField.declaringType());
+ return JDIType.createType((JDIDebugTarget) getDebugTarget(),
+ fField.declaringType());
}
/**
@@ -103,94 +109,115 @@ public class JDIFieldVariable extends JDIModificationVariable implements IJavaFi
try {
return getField().name();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_retrieving_field_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_retrieving_field_name,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
return null;
}
}
+ @Override
protected void setJDIValue(Value value) throws DebugException {
try {
- if (isStatic()) {
+ if (isStatic()) {
ReferenceType declaringType = getField().declaringType();
- if (declaringType instanceof InterfaceType) {
- requestFailed(JDIDebugModelMessages.JDIFieldVariable_0, null);
- }
- ((ClassType)declaringType).setValue(getField(), value);
+ if (declaringType instanceof InterfaceType) {
+ requestFailed(JDIDebugModelMessages.JDIFieldVariable_0,
+ null);
+ }
+ ((ClassType) declaringType).setValue(getField(), value);
} else {
getObjectReference().setValue(getField(), value);
}
fireChangeEvent(DebugEvent.CONTENT);
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_modifying_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_modifying_value,
+ e.toString()), e);
} catch (InvalidTypeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_modifying_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_modifying_value,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_modifying_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_modifying_value,
+ e.toString()), e);
}
}
-
+
/**
* @see IJavaVariable#isVolatile()
*/
public boolean isVolatile() {
return getField().isVolatile();
}
-
+
/**
* @see IJavaVariable#isTransient()
*/
public boolean isTransient() {
return getField().isTransient();
}
-
+
/**
* @see IJavaModifiers#isSynthetic()
*/
+ @Override
public boolean isSynthetic() {
return getField().isSynthetic();
}
-
+
/**
* @see IJavaModifiers#isPublic()
*/
+ @Override
public boolean isPublic() {
return getField().isPublic();
}
-
+
/**
* @see IJavaModifiers#isPrivate()
*/
+ @Override
public boolean isPrivate() {
return getField().isPrivate();
}
-
+
/**
* @see IJavaModifiers#isProtected()
*/
+ @Override
public boolean isProtected() {
return getField().isProtected();
}
-
+
/**
* @see IJavaModifiers#isPackagePrivate()
*/
+ @Override
public boolean isPackagePrivate() {
return getField().isPackagePrivate();
}
-
+
/**
* @see IJavaModifiers#isStatic()
*/
+ @Override
public boolean isStatic() {
return getField().isStatic();
}
-
+
/**
* @see IJavaModifiers#isFinal()
*/
+ @Override
public boolean isFinal() {
return getField().isFinal();
}
@@ -199,17 +226,18 @@ public class JDIFieldVariable extends JDIModificationVariable implements IJavaFi
* @see IVariable#getReferenceTypeName()
*/
public String getReferenceTypeName() throws DebugException {
- String genericSignature= getField().genericSignature();
+ String genericSignature = getField().genericSignature();
if (genericSignature != null) {
return JDIReferenceType.getTypeName(genericSignature);
}
- Type underlyingType= getUnderlyingType();
+ Type underlyingType = getUnderlyingType();
if (underlyingType instanceof ReferenceType) {
- return JDIReferenceType.getGenericName((ReferenceType)underlyingType);
+ return JDIReferenceType
+ .getGenericName((ReferenceType) underlyingType);
}
return getField().typeName();
}
-
+
/**
* @see IJavaVariable#getSignature()
*/
@@ -217,81 +245,100 @@ public class JDIFieldVariable extends JDIModificationVariable implements IJavaFi
try {
return getField().signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_retrieving_field_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_retrieving_field_signature,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
return null;
- }
+ }
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
try {
- String genericSignature= fField.genericSignature();
+ String genericSignature = fField.genericSignature();
if (genericSignature != null) {
return genericSignature;
}
return fField.signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_retrieving_field_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_retrieving_field_signature,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
return null;
- }
+ }
}
-
+
public Field getField() {
return fField;
}
-
+
public ObjectReference getObjectReference() {
return fObject;
}
-
+
public ReferenceType getReferenceType() {
return fType;
}
-
+
+ @Override
public boolean supportsValueModification() {
- if (getField().declaringType()instanceof InterfaceType) {
+ if (getField().declaringType() instanceof InterfaceType) {
return false;
}
return super.supportsValueModification();
}
-
+
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getField().toString();
}
-
+
/**
* @see JDIVariable#getUnderlyingType()
*/
+ @Override
protected Type getUnderlyingType() throws DebugException {
try {
return getField().type();
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_while_retrieving_type_of_field, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_while_retrieving_type_of_field,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIFieldVariable_exception_while_retrieving_type_of_field, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIFieldVariable_exception_while_retrieving_type_of_field,
+ e.toString()), e);
}
- // this line will not be exceucted as an exception
+ // this line will not be executed as an exception
// will be throw in type retrieval fails
return null;
- }
-
+ }
+
/**
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object o) {
if (o instanceof JDIFieldVariable) {
- JDIFieldVariable f = (JDIFieldVariable)o;
+ JDIFieldVariable f = (JDIFieldVariable) o;
if (fLogicalParent != null) {
- return fLogicalParent.equals(f.fLogicalParent) && f.fField.equals(fField);
+ return fLogicalParent.equals(f.fLogicalParent)
+ && f.fField.equals(fField);
}
if (fObject != null) {
return fObject.equals(f.fObject) && f.fField.equals(fField);
@@ -304,6 +351,7 @@ public class JDIFieldVariable extends JDIModificationVariable implements IJavaFi
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
if (fLogicalParent != null) {
return fLogicalParent.hashCode() + fField.hashCode();
@@ -314,20 +362,23 @@ public class JDIFieldVariable extends JDIModificationVariable implements IJavaFi
return fField.hashCode();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaFieldVariable#getObject()
*/
public IJavaObject getReceiver() {
- ObjectReference objectReference= getObjectReference();
+ ObjectReference objectReference = getObjectReference();
if (objectReference == null) {
return null;
}
- return (IJavaObject)JDIValue.createValue(getJavaDebugTarget(), objectReference);
+ return (IJavaObject) JDIValue.createValue(getJavaDebugTarget(),
+ objectReference);
}
-
+
public IJavaReferenceType getReceivingType() {
- return (IJavaReferenceType)JDIType.createType(getJavaDebugTarget(), getReferenceType());
+ return (IJavaReferenceType) JDIType.createType(getJavaDebugTarget(),
+ getReferenceType());
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIInterfaceType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIInterfaceType.java
index 74ef82e14..5b151c7fa 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIInterfaceType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIInterfaceType.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -20,90 +18,118 @@ import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaClassType;
import org.eclipse.jdt.debug.core.IJavaInterfaceType;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ClassType;
import com.sun.jdi.InterfaceType;
/**
* The interface of an object in a debug target.
*/
-public class JDIInterfaceType extends JDIReferenceType implements IJavaInterfaceType {
-
+public class JDIInterfaceType extends JDIReferenceType implements
+ IJavaInterfaceType {
+
/**
- * Cosntructs a new interface type on the given target referencing
- * the specified interface type.
+ * Constructs a new interface type on the given target referencing the
+ * specified interface type.
*/
public JDIInterfaceType(JDIDebugTarget target, InterfaceType type) {
super(target, type);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaInterfaceType#getImplementors()
*/
public IJavaClassType[] getImplementors() throws DebugException {
try {
- List implementorList = ((InterfaceType)getUnderlyingType()).implementors();
- List javaClassTypeList = new ArrayList(implementorList.size());
- Iterator iterator = implementorList.iterator();
+ List<ClassType> implementorList = ((InterfaceType) getUnderlyingType())
+ .implementors();
+ List<JDIType> javaClassTypeList = new ArrayList<JDIType>(implementorList.size());
+ Iterator<ClassType> iterator = implementorList.iterator();
while (iterator.hasNext()) {
- ClassType classType = (ClassType) iterator.next();
+ ClassType classType = iterator.next();
if (classType != null) {
- javaClassTypeList.add(JDIType.createType(getJavaDebugTarget(), classType));
- }
+ javaClassTypeList.add(JDIType.createType(
+ getJavaDebugTarget(), classType));
+ }
}
- IJavaClassType[] javaClassTypeArray = new IJavaClassType[javaClassTypeList.size()];
- javaClassTypeArray = (IJavaClassType[]) javaClassTypeList.toArray(javaClassTypeArray);
+ IJavaClassType[] javaClassTypeArray = new IJavaClassType[javaClassTypeList
+ .size()];
+ javaClassTypeArray = javaClassTypeList
+ .toArray(javaClassTypeArray);
return javaClassTypeArray;
} catch (RuntimeException re) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass, new String[] {re.toString()}), re);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass,
+ re.toString()), re);
}
return new IJavaClassType[0];
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaInterfaceType#getSubInterfaces()
*/
public IJavaInterfaceType[] getSubInterfaces() throws DebugException {
try {
- List subList = ((InterfaceType)getUnderlyingType()).subinterfaces();
- List javaInterfaceTypeList = new ArrayList(subList.size());
- Iterator iterator = subList.iterator();
+ List<InterfaceType> subList = ((InterfaceType) getUnderlyingType())
+ .subinterfaces();
+ List<JDIType> javaInterfaceTypeList = new ArrayList<JDIType>(subList.size());
+ Iterator<InterfaceType> iterator = subList.iterator();
while (iterator.hasNext()) {
- InterfaceType interfaceType = (InterfaceType) iterator.next();
+ InterfaceType interfaceType = iterator.next();
if (interfaceType != null) {
- javaInterfaceTypeList.add(JDIType.createType(getJavaDebugTarget(), interfaceType));
- }
+ javaInterfaceTypeList.add(JDIType.createType(
+ getJavaDebugTarget(), interfaceType));
+ }
}
- IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList.size()];
- javaInterfaceTypeArray = (IJavaInterfaceType[]) javaInterfaceTypeList.toArray(javaInterfaceTypeArray);
+ IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList
+ .size()];
+ javaInterfaceTypeArray = javaInterfaceTypeList
+ .toArray(javaInterfaceTypeArray);
return javaInterfaceTypeArray;
} catch (RuntimeException re) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass, new String[] {re.toString()}), re);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass,
+ re.toString()), re);
}
return new IJavaInterfaceType[0];
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaInterfaceType#getSuperInterfaces()
*/
public IJavaInterfaceType[] getSuperInterfaces() throws DebugException {
try {
- List superList = ((InterfaceType)getUnderlyingType()).superinterfaces();
- List javaInterfaceTypeList = new ArrayList(superList.size());
- Iterator iterator = superList.iterator();
+ List<InterfaceType> superList = ((InterfaceType) getUnderlyingType())
+ .superinterfaces();
+ List<JDIType> javaInterfaceTypeList = new ArrayList<JDIType>(superList.size());
+ Iterator<InterfaceType> iterator = superList.iterator();
while (iterator.hasNext()) {
- InterfaceType interfaceType = (InterfaceType) iterator.next();
+ InterfaceType interfaceType = iterator.next();
if (interfaceType != null) {
- javaInterfaceTypeList.add(JDIType.createType(getJavaDebugTarget(), interfaceType));
- }
+ javaInterfaceTypeList.add(JDIType.createType(
+ getJavaDebugTarget(), interfaceType));
+ }
}
- IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList.size()];
- javaInterfaceTypeArray = (IJavaInterfaceType[]) javaInterfaceTypeList.toArray(javaInterfaceTypeArray);
+ IJavaInterfaceType[] javaInterfaceTypeArray = new IJavaInterfaceType[javaInterfaceTypeList
+ .size()];
+ javaInterfaceTypeArray = javaInterfaceTypeList
+ .toArray(javaInterfaceTypeArray);
return javaInterfaceTypeArray;
} catch (RuntimeException re) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass, new String[] {re.toString()}), re);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_superclass,
+ re.toString()), re);
}
return new IJavaInterfaceType[0];
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDILocalVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDILocalVariable.java
index 33a23c136..2ab006789 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDILocalVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDILocalVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.jdt.debug.core.IJavaVariable;
import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ClassNotLoadedException;
@@ -23,8 +24,7 @@ import com.sun.jdi.Type;
import com.sun.jdi.Value;
/**
- * A <code>JDILocalVariable</code> represents a local variable in a stack
- * frame.
+ * A <code>JDILocalVariable</code> represents a local variable in a stack frame.
*/
public class JDILocalVariable extends JDIModificationVariable {
@@ -32,29 +32,30 @@ public class JDILocalVariable extends JDIModificationVariable {
* The underlying local variable
*/
private LocalVariable fLocal;
-
+
/**
* The stack frame the local is contained in
*/
private JDIStackFrame fStackFrame;
-
+
/**
- * Constructs a local variable for the given local
- * in a stack frame.
+ * Constructs a local variable for the given local in a stack frame.
*/
public JDILocalVariable(JDIStackFrame frame, LocalVariable local) {
- super((JDIDebugTarget)frame.getDebugTarget());
- fStackFrame= frame;
- fLocal= local;
+ super((JDIDebugTarget) frame.getDebugTarget());
+ fStackFrame = frame;
+ fLocal = local;
}
/**
* Returns this variable's current Value.
*/
+ @Override
protected Value retrieveValue() throws DebugException {
synchronized (fStackFrame.getThread()) {
if (getStackFrame().isSuspended()) {
- return getStackFrame().getUnderlyingStackFrame().getValue(fLocal);
+ return getStackFrame().getUnderlyingStackFrame().getValue(
+ fLocal);
}
}
// bug 6518
@@ -68,44 +69,59 @@ public class JDILocalVariable extends JDIModificationVariable {
try {
return getLocal().name();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_name,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
- return null;
+ return null;
}
}
/**
* @see JDIModificationVariable#setValue(Value)
*/
+ @Override
protected void setJDIValue(Value value) throws DebugException {
try {
synchronized (getStackFrame().getThread()) {
- getStackFrame().getUnderlyingStackFrame().setValue(getLocal(), value);
+ getStackFrame().getUnderlyingStackFrame().setValue(getLocal(),
+ value);
}
fireChangeEvent(DebugEvent.CONTENT);
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_modifying_local_variable_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_modifying_local_variable_value,
+ e.toString()), e);
} catch (InvalidTypeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_modifying_local_variable_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_modifying_local_variable_value,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_modifying_local_variable_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_modifying_local_variable_value,
+ e.toString()), e);
}
}
-
+
/**
* @see IVariable#getReferenceTypeName()
*/
public String getReferenceTypeName() throws DebugException {
try {
- String genericSignature= getLocal().genericSignature();
+ String genericSignature = getLocal().genericSignature();
if (genericSignature != null) {
return JDIReferenceType.getTypeName(genericSignature);
}
try {
- Type underlyingType= getUnderlyingType();
+ Type underlyingType = getUnderlyingType();
if (underlyingType instanceof ReferenceType) {
- return JDIReferenceType.getGenericName((ReferenceType) underlyingType);
+ return JDIReferenceType
+ .getGenericName((ReferenceType) underlyingType);
}
} catch (DebugException e) {
if (!(e.getStatus().getException() instanceof ClassNotLoadedException)) {
@@ -114,13 +130,16 @@ public class JDILocalVariable extends JDIModificationVariable {
}
return getLocal().typeName();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_type_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_type_name,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
return null;
}
}
-
+
/**
* @see IJavaVariable#getSignature()
*/
@@ -128,43 +147,51 @@ public class JDILocalVariable extends JDIModificationVariable {
try {
return getLocal().signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_type_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_type_signature,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
- return null;
+ return null;
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
try {
- String genericSignature= fLocal.genericSignature();
+ String genericSignature = fLocal.genericSignature();
if (genericSignature != null) {
return genericSignature;
}
return fLocal.signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_type_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_retrieving_local_variable_type_signature,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
- return null;
+ return null;
}
}
-
- /**
- * Updates this local's underlying variable. Called by enclosing stack
- * frame when doing an incremental update.
+
+ /**
+ * Updates this local's underlying variable. Called by enclosing stack frame
+ * when doing an incremental update.
*/
protected void setLocal(LocalVariable local) {
fLocal = local;
}
-
+
protected LocalVariable getLocal() {
return fLocal;
}
-
+
protected JDIStackFrame getStackFrame() {
return fStackFrame;
}
@@ -172,6 +199,7 @@ public class JDILocalVariable extends JDIModificationVariable {
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getLocal().toString();
}
@@ -179,23 +207,31 @@ public class JDILocalVariable extends JDIModificationVariable {
/**
* @see JDIVariable#getUnderlyingType()
*/
+ @Override
protected Type getUnderlyingType() throws DebugException {
try {
return getLocal().type();
} catch (ClassNotLoadedException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_while_retrieving_type_of_local_variable, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_while_retrieving_type_of_local_variable,
+ e.toString()), e);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDILocalVariable_exception_while_retrieving_type_of_local_variable, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDILocalVariable_exception_while_retrieving_type_of_local_variable,
+ e.toString()), e);
}
// this line will not be executed as an exception
// will be throw in type retrieval fails
return null;
}
-
+
/**
*
* @see org.eclipse.jdt.debug.core.IJavaVariable#isLocal()
*/
+ @Override
public boolean isLocal() {
return true;
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIMethod.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIMethod.java
index 4ae56594a..e3284918c 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIMethod.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIMethod.java
@@ -15,80 +15,77 @@ import com.sun.jdi.Method;
/**
* Class for analysing Java methods while debugging.
+ *
* @author jmoeller2
- *
+ *
*/
public abstract class JDIMethod {
// Known Java byte codes, from the JVM spec
- private static final int ALOAD_0 = 0x2a;
-
- private static final int ILOAD_1 = 0x1b;
- private static final int LLOAD_1 = 0x1f;
- private static final int FLOAD_1 = 0x23;
- private static final int DLOAD_1 = 0x27;
- private static final int ALOAD_1 = 0x2b;
-
- private static final int IRETURN = 0xac;
- private static final int LRETURN = 0xad;
- private static final int FRETURN = 0xae;
- private static final int DRETURN = 0xaf;
- private static final int ARETURN = 0xb0;
-
- private static final int GETFIELD = 0xb4;
- private static final int PUTFIELD = 0xb5;
-
- private static final int RETURN = 0xb1;
-
+ private static final int ALOAD_0 = 0x2a;
+
+ private static final int ILOAD_1 = 0x1b;
+ private static final int LLOAD_1 = 0x1f;
+ private static final int FLOAD_1 = 0x23;
+ private static final int DLOAD_1 = 0x27;
+ private static final int ALOAD_1 = 0x2b;
+
+ private static final int IRETURN = 0xac;
+ private static final int LRETURN = 0xad;
+ private static final int FRETURN = 0xae;
+ private static final int DRETURN = 0xaf;
+ private static final int ARETURN = 0xb0;
+
+ private static final int GETFIELD = 0xb4;
+ private static final int PUTFIELD = 0xb5;
+
+ private static final int RETURN = 0xb1;
+
/**
- * Determines if the opcode passes in is one of the value return instructions.
+ * Determines if the opcode passes in is one of the value return
+ * instructions.
*
- * @param opCode opCode to check
+ * @param opCode
+ * opCode to check
* @return If <code>opCode</code> is one of 'areturn', 'ireturn', etc.
*/
public static final boolean isXReturn(byte opCode) {
- return (opCode & 0xFF) == IRETURN ||
- (opCode & 0xFF) == LRETURN ||
- (opCode & 0xFF) == FRETURN ||
- (opCode & 0xFF) == DRETURN ||
- (opCode & 0xFF) == ARETURN;
+ return (opCode & 0xFF) == IRETURN || (opCode & 0xFF) == LRETURN
+ || (opCode & 0xFF) == FRETURN || (opCode & 0xFF) == DRETURN
+ || (opCode & 0xFF) == ARETURN;
}
-
+
/**
* Determines if the opcode passes in is one of the 'loado_1' instruxtions.
*
- * @param opCode opCode to check
+ * @param opCode
+ * opCode to check
* @return If <code>opCode</code> is one of 'aload_1', 'iload_1', etc.
*/
public static final boolean isXLoad1(byte opCode) {
- return (opCode & 0xFF) == ILOAD_1 ||
- (opCode & 0xFF) == LLOAD_1 ||
- (opCode & 0xFF) == FLOAD_1 ||
- (opCode & 0xFF) == DLOAD_1 ||
- (opCode & 0xFF) == ALOAD_1;
+ return (opCode & 0xFF) == ILOAD_1 || (opCode & 0xFF) == LLOAD_1
+ || (opCode & 0xFF) == FLOAD_1 || (opCode & 0xFF) == DLOAD_1
+ || (opCode & 0xFF) == ALOAD_1;
}
-
+
/**
* Determines if the method in question is a simple getter, JavaBean style.
*
* Simple getters have byte code which look like this, and they start with
* "get" or "is":
*
- * 0 aload_0
- * 1 getfield
- * 4 Xreturn
- *
- * @param method Method to check
+ * 0 aload_0 1 getfield 4 Xreturn
+ *
+ * @param method
+ * Method to check
* @return true if the method is a simple getter
*/
public static boolean isGetterMethod(Method method) {
- if (! (method.name().startsWith("get") || method.name().startsWith("is"))) return false; //$NON-NLS-1$ //$NON-NLS-2$
-
+ if (!(method.name().startsWith("get") || method.name().startsWith("is")))return false; //$NON-NLS-1$ //$NON-NLS-2$
+
byte[] bytecodes = method.bytecodes();
- return bytecodes.length == 5
- && (bytecodes[0] & 0xFF) == ALOAD_0
- && (bytecodes[1] & 0xFF) == GETFIELD
- && isXReturn(bytecodes[4]);
+ return bytecodes.length == 5 && (bytecodes[0] & 0xFF) == ALOAD_0
+ && (bytecodes[1] & 0xFF) == GETFIELD && isXReturn(bytecodes[4]);
}
/**
@@ -97,12 +94,10 @@ public abstract class JDIMethod {
* Simple setters have byte code which look like this, and they start with
* "set":
*
- * 0 aload_0
- * 1 Xload_1
- * 2 putfield
- * 5 return
- *
- * @param method Method to check
+ * 0 aload_0 1 Xload_1 2 putfield 5 return
+ *
+ * @param method
+ * Method to check
* @return true if the method is a simple setter
*/
public static boolean isSetterMethod(Method method) {
@@ -110,10 +105,8 @@ public abstract class JDIMethod {
return false;
byte[] bytecodes = method.bytecodes();
- return bytecodes.length == 6
- && (bytecodes[0] & 0xFF) == ALOAD_0
- && isXLoad1(bytecodes[1])
- && (bytecodes[2] & 0xFF) == PUTFIELD
- && (bytecodes[5] & 0xFF) == RETURN;
+ return bytecodes.length == 6 && (bytecodes[0] & 0xFF) == ALOAD_0
+ && isXLoad1(bytecodes[1]) && (bytecodes[2] & 0xFF) == PUTFIELD
+ && (bytecodes[5] & 0xFF) == RETURN;
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIModificationVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIModificationVariable.java
index 7f184a2f3..6bd5c9335 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIModificationVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIModificationVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-import java.util.ArrayList;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.jdi.internal.ValueImpl;
@@ -21,186 +19,207 @@ import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.Value;
import com.sun.jdi.VirtualMachine;
-
+
/**
* Common functionality for variables that support value modification
*/
public abstract class JDIModificationVariable extends JDIVariable {
-
- private final static ArrayList fgValidSignatures = new ArrayList (9);
- static {
- fgValidSignatures.add("B"); // byte //$NON-NLS-1$
- fgValidSignatures.add("C"); // char //$NON-NLS-1$
- fgValidSignatures.add("D"); // double //$NON-NLS-1$
- fgValidSignatures.add("F"); // float //$NON-NLS-1$
- fgValidSignatures.add("I"); // int //$NON-NLS-1$
- fgValidSignatures.add("J"); // long //$NON-NLS-1$
- fgValidSignatures.add("S"); // short //$NON-NLS-1$
- fgValidSignatures.add("Z"); // boolean //$NON-NLS-1$
- fgValidSignatures.add(jdiStringSignature); // String
- }
public JDIModificationVariable(JDIDebugTarget target) {
super(target);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#supportsValueModification
+ * ()
*/
+ @Override
public boolean supportsValueModification() {
return true;
}
-
+
/**
* Returns a value generated by the vm from the given expression
- * @param expression the expression to produce a value from
+ *
+ * @param expression
+ * the expression to produce a value from
* @return generated value, <code>null</code> is a valid value
- * @throws DebugException if there is a problem generating the value
+ * @throws DebugException
+ * if there is a problem generating the value
*/
protected Value generateVMValue(String expression) throws DebugException {
- VirtualMachine vm= getVM();
+ VirtualMachine vm = getVM();
if (vm == null) {
- requestFailed(JDIDebugModelMessages.JDIModificationVariable_Unable_to_generate_value___VM_disconnected__1, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIModificationVariable_Unable_to_generate_value___VM_disconnected__1,
+ null);
}
-
- String signature= getJavaType().getSignature();
- Value vmValue= null;
+ String signature = getJavaType().getSignature();
+ Value vmValue = null;
try {
switch (signature.charAt(0)) {
- case 'Z' :
- String flse= Boolean.FALSE.toString();
- String tre= Boolean.TRUE.toString();
- if (expression.equals(tre) || expression.equals(flse)) {
- boolean booleanValue= Boolean.valueOf(expression).booleanValue();
- vmValue= vm.mirrorOf(booleanValue);
- }
- break;
- case 'B' :
- byte byteValue= Byte.valueOf(expression).byteValue();
- vmValue= vm.mirrorOf(byteValue);
- break;
- case 'C' :
- if (expression.length() == 1) {
- char charValue= expression.charAt(0);
- vmValue= vm.mirrorOf(charValue);
- } else if (expression.length() == 2) {
- char charValue;
- if (!(expression.charAt(0) == '\\')) {
- return null;
- }
- switch (expression.charAt(1)) {
- case 'b':
- charValue= '\b';
- break;
- case 'f':
- charValue= '\f';
- break;
- case 'n':
- charValue= '\n';
- break;
- case 'r':
- charValue= '\r';
- break;
- case 't':
- charValue= '\t';
- break;
- case '\'':
- charValue= '\'';
- break;
- case '\"':
- charValue= '\"';
- break;
- case '\\':
- charValue= '\\';
- break;
- default :
- return null;
- }
- vmValue= vm.mirrorOf(charValue);
+ case 'Z':
+ String flse = Boolean.FALSE.toString();
+ String tre = Boolean.TRUE.toString();
+ if (expression.equals(tre) || expression.equals(flse)) {
+ boolean booleanValue = Boolean.valueOf(expression)
+ .booleanValue();
+ vmValue = vm.mirrorOf(booleanValue);
+ }
+ break;
+ case 'B':
+ byte byteValue = Byte.valueOf(expression).byteValue();
+ vmValue = vm.mirrorOf(byteValue);
+ break;
+ case 'C':
+ if (expression.length() == 1) {
+ char charValue = expression.charAt(0);
+ vmValue = vm.mirrorOf(charValue);
+ } else if (expression.length() == 2) {
+ char charValue;
+ if (!(expression.charAt(0) == '\\')) {
+ return null;
}
- break;
- case 'S' :
- short shortValue= Short.valueOf(expression).shortValue();
- vmValue= vm.mirrorOf(shortValue);
- break;
- case 'I' :
- int intValue= Integer.valueOf(expression).intValue();
- vmValue= vm.mirrorOf(intValue);
- break;
- case 'J' :
- long longValue= Long.valueOf(expression).longValue();
- vmValue= vm.mirrorOf(longValue);
- break;
- case 'F' :
- float floatValue= Float.valueOf(expression).floatValue();
- vmValue= vm.mirrorOf(floatValue);
- break;
- case 'D' :
- double doubleValue= Double.valueOf(expression).doubleValue();
- vmValue= vm.mirrorOf(doubleValue);
- break;
- case 'L' :
- if (expression.equals("null")) { //$NON-NLS-1$
- vmValue = null;
- } else if (expression.equals("\"null\"")) { //$NON-NLS-1$
- vmValue = vm.mirrorOf("null"); //$NON-NLS-1$
- } else {
- vmValue= vm.mirrorOf(expression);
+ switch (expression.charAt(1)) {
+ case 'b':
+ charValue = '\b';
+ break;
+ case 'f':
+ charValue = '\f';
+ break;
+ case 'n':
+ charValue = '\n';
+ break;
+ case 'r':
+ charValue = '\r';
+ break;
+ case 't':
+ charValue = '\t';
+ break;
+ case '\'':
+ charValue = '\'';
+ break;
+ case '\"':
+ charValue = '\"';
+ break;
+ case '\\':
+ charValue = '\\';
+ break;
+ default:
+ return null;
}
- break;
+ vmValue = vm.mirrorOf(charValue);
+ }
+ break;
+ case 'S':
+ short shortValue = Short.valueOf(expression).shortValue();
+ vmValue = vm.mirrorOf(shortValue);
+ break;
+ case 'I':
+ int intValue = Integer.valueOf(expression).intValue();
+ vmValue = vm.mirrorOf(intValue);
+ break;
+ case 'J':
+ long longValue = Long.valueOf(expression).longValue();
+ vmValue = vm.mirrorOf(longValue);
+ break;
+ case 'F':
+ float floatValue = Float.valueOf(expression).floatValue();
+ vmValue = vm.mirrorOf(floatValue);
+ break;
+ case 'D':
+ double doubleValue = Double.valueOf(expression).doubleValue();
+ vmValue = vm.mirrorOf(doubleValue);
+ break;
+ case 'L':
+ if (expression.equals("null")) { //$NON-NLS-1$
+ vmValue = null;
+ } else if (expression.equals("\"null\"")) { //$NON-NLS-1$
+ vmValue = vm.mirrorOf("null"); //$NON-NLS-1$
+ } else {
+ vmValue = vm.mirrorOf(expression);
+ }
+ break;
}
} catch (NumberFormatException nfe) {
- requestFailed(MessageFormat.format(JDIDebugModelMessages.JDIModificationVariable_0,new String[]{getJavaType().toString()}),nfe);
+ requestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIModificationVariable_0,
+ getJavaType().toString()), nfe);
}
return vmValue;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang
+ * .String)
*/
+ @Override
public boolean verifyValue(String expression) throws DebugException {
Value vmValue = generateVMValue(expression);
IValue value = JDIValue.createValue(getJavaDebugTarget(), vmValue);
return verifyValue(value);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse
+ * .debug.core.model.IValue)
*/
+ @Override
public boolean verifyValue(IValue value) throws DebugException {
- if (value instanceof JDIValue && value.getDebugTarget().equals(getDebugTarget())) {
- JDIValue jv = (JDIValue)value;
+ if (value instanceof JDIValue
+ && value.getDebugTarget().equals(getDebugTarget())) {
+ JDIValue jv = (JDIValue) value;
try {
- ValueImpl.checkValue(jv.getUnderlyingValue(), getUnderlyingType(), (VirtualMachineImpl)getVM());
+ ValueImpl.checkValue(jv.getUnderlyingValue(),
+ getUnderlyingType(), (VirtualMachineImpl) getVM());
return true;
} catch (InvalidTypeException e) {
}
}
return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String
+ * )
*/
+ @Override
public final void setValue(String expression) throws DebugException {
- Value value= generateVMValue(expression);
+ Value value = generateVMValue(expression);
setJDIValue(value);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIVariable#setValue(org.eclipse.debug.core.model.IValue)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIVariable#setValue(org.eclipse
+ * .debug.core.model.IValue)
*/
+ @Override
public final void setValue(IValue v) throws DebugException {
if (v instanceof JDIValue) {
- JDIValue value = (JDIValue)v;
+ JDIValue value = (JDIValue) v;
setJDIValue(value.getUnderlyingValue());
}
- }
+ }
/**
* Set this variable's value to the given value
*/
protected abstract void setJDIValue(Value value) throws DebugException;
-
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDINullValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDINullValue.java
index 70178e95b..8e064ff3a 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDINullValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDINullValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,17 +10,18 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import java.util.Collections;
import java.util.List;
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IValue;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.debug.core.IJavaFieldVariable;
import org.eclipse.jdt.debug.core.IJavaObject;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.IJavaValue;
+import org.eclipse.jdt.debug.core.IJavaVariable;
import com.ibm.icu.text.MessageFormat;
@@ -28,10 +29,10 @@ import com.ibm.icu.text.MessageFormat;
* Represents a value of "null"
*/
public class JDINullValue extends JDIObjectValue {
-
-
+
/**
* Constructor
+ *
* @param target
*/
public JDINullValue(JDIDebugTarget target) {
@@ -41,20 +42,23 @@ public class JDINullValue extends JDIObjectValue {
/**
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getVariablesList()
*/
- protected List getVariablesList() {
+ @Override
+ protected List<IJavaVariable> getVariablesList() {
return Collections.EMPTY_LIST;
}
-
+
/**
* @see IValue#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() {
return "null"; //$NON-NLS-1$
}
-
+
/**
* @see IValue#getValueString()
*/
+ @Override
public String getValueString() {
return "null"; //$NON-NLS-1$
}
@@ -62,6 +66,7 @@ public class JDINullValue extends JDIObjectValue {
/**
* @see IJavaValue#getSignature()
*/
+ @Override
public String getSignature() {
return null;
}
@@ -69,20 +74,23 @@ public class JDINullValue extends JDIObjectValue {
/**
* @see IJavaValue#getArrayLength()
*/
+ @Override
public int getArrayLength() {
return -1;
}
-
+
/**
* @see IJavaValue#getJavaType()
*/
+ @Override
public IJavaType getJavaType() {
return null;
}
-
+
/**
* @see Object#equals(Object)
*/
+ @Override
public boolean equals(Object obj) {
return obj instanceof JDINullValue;
}
@@ -90,6 +98,7 @@ public class JDINullValue extends JDIObjectValue {
/**
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
return getClass().hashCode();
}
@@ -97,101 +106,137 @@ public class JDINullValue extends JDIObjectValue {
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return "null"; //$NON-NLS-1$
}
/**
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getField(java.lang.String, boolean)
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getField(java.lang.String,
+ * boolean)
*/
+ @Override
public IJavaFieldVariable getField(String name, boolean superField) {
return null;
}
-
+
/**
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getField(java.lang.String, java.lang.String)
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getField(java.lang.String,
+ * java.lang.String)
*/
+ @Override
public IJavaFieldVariable getField(String name, String typeSignature) {
return null;
}
-
+
/**
* @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getWaitingThreads()
*/
+ @Override
public IJavaThread[] getWaitingThreads() {
return null;
}
-
+
/**
* @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getOwningThread()
*/
+ @Override
public IJavaThread getOwningThread() {
return null;
}
-
+
/**
* @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getReferringObjects(long)
*/
- public IJavaObject[] getReferringObjects(long max) {
+ @Override
+ public IJavaObject[] getReferringObjects(long max) {
return new IJavaObject[0];
}
-
+
/**
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, boolean)
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#sendMessage(java.lang.String,
+ * java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread, boolean)
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, boolean superSend) throws DebugException{
+ @Override
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, boolean superSend)
+ throws DebugException {
return npe(selector, signature);
}
-
+
/**
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#sendMessage(java.lang.String,
+ * java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, String typeSignature) throws DebugException{
+ @Override
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, String typeSignature)
+ throws DebugException {
return npe(selector, signature);
}
-
+
/**
* Creates an artificial NPE for display to the user as an error message
+ *
* @param selector
* @param signature
* @return
* @throws DebugException
*/
- private IJavaValue npe(String selector, String signature) throws DebugException {
+ private IJavaValue npe(String selector, String signature)
+ throws DebugException {
StringBuffer buffer = new StringBuffer();
buffer.append(selector);
String[] parameterTypes = Signature.getParameterTypes(signature);
buffer.append('(');
for (int i = 0; i < parameterTypes.length; i++) {
- buffer.append(Signature.getSignatureSimpleName(parameterTypes[i].replace('/', '.')));
- if (i+1 < parameterTypes.length) {
+ buffer.append(Signature.getSignatureSimpleName(parameterTypes[i]
+ .replace('/', '.')));
+ if (i + 1 < parameterTypes.length) {
buffer.append(", "); //$NON-NLS-1$
}
- }
+ }
buffer.append(')');
- requestFailed(MessageFormat.format(JDIDebugModelMessages.JDINullValue_0, new String[]{buffer.toString()}), null);
+ requestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDINullValue_0,
+ buffer.toString()), null);
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#disableCollection()
- */
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#disableCollection
+ * ()
+ */
+ @Override
public void disableCollection() throws DebugException {
// Do nothing for null values
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#enableCollection()
- */
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#enableCollection
+ * ()
+ */
+ @Override
public void enableCollection() throws DebugException {
// Do nothing for null values
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#isNull()
*/
+ @Override
public boolean isNull() {
return true;
}
-
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIObjectValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIObjectValue.java
index 12c310a37..b7353a232 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIObjectValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIObjectValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -34,18 +34,17 @@ import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.Value;
/**
- * Implementation of a value referencing an object on the
- * target VM.
+ * Implementation of a value referencing an object on the target VM.
*/
public class JDIObjectValue extends JDIValue implements IJavaObject {
-
+
private IJavaObject[] fCachedReferences;
private int fSuspendCount;
private long fPreviousMax;
-
+
/**
- * Constructs a new target object on the given target with
- * the specified object reference.
+ * Constructs a new target object on the given target with the specified
+ * object reference.
*/
public JDIObjectValue(JDIDebugTarget target, ObjectReference object) {
super(target, object);
@@ -53,301 +52,390 @@ public class JDIObjectValue extends JDIValue implements IJavaObject {
fCachedReferences = null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String,
+ * java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread, boolean)
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, boolean superSend) throws DebugException {
- JDIThread javaThread = (JDIThread)thread;
- List arguments = null;
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, boolean superSend)
+ throws DebugException {
+ JDIThread javaThread = (JDIThread) thread;
+ List<Value> arguments = null;
if (args == null) {
arguments = Collections.EMPTY_LIST;
} else {
- arguments= new ArrayList(args.length);
- for (int i = 0; i < args.length; i++) {
- arguments.add(((JDIValue)args[i]).getUnderlyingValue());
+ arguments = new ArrayList<Value>(args.length);
+ for (IJavaValue arg : args) {
+ arguments.add(((JDIValue) arg).getUnderlyingValue());
}
}
ObjectReference object = getUnderlyingObject();
Method method = null;
- ReferenceType refType = getUnderlyingReferenceType();
+ ReferenceType refType = getUnderlyingReferenceType();
try {
if (superSend) {
// begin lookup in superclass
- refType = ((ClassType)refType).superclass();
+ refType = ((ClassType) refType).superclass();
}
method = concreteMethodByName(refType, selector, signature);
if (method == null) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_11, new String[] {selector, signature}), null);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_11, selector, signature), null);
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_exception_while_performing_method_lookup_for_selector, new String[] {e.toString(), selector, signature}), e);
+ targetRequestFailed(
+ MessageFormat
+ .format(JDIDebugModelMessages.JDIObjectValue_exception_while_performing_method_lookup_for_selector,
+ e.toString(), selector, signature),
+ e);
}
- Value result = javaThread.invokeMethod(null, object, method, arguments, superSend);
- return JDIValue.createValue((JDIDebugTarget)getDebugTarget(), result);
+ Value result = javaThread.invokeMethod(null, object, method, arguments,
+ superSend);
+ return JDIValue.createValue((JDIDebugTarget) getDebugTarget(), result);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String,
+ * java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[],
+ * org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
*/
- public IJavaValue sendMessage(String selector, String signature, IJavaValue[] args, IJavaThread thread, String typeSignature) throws DebugException {
- JDIThread javaThread = (JDIThread)thread;
- List arguments = null;
+ public IJavaValue sendMessage(String selector, String signature,
+ IJavaValue[] args, IJavaThread thread, String typeSignature)
+ throws DebugException {
+ JDIThread javaThread = (JDIThread) thread;
+ List<Value> arguments = null;
if (args == null) {
arguments = Collections.EMPTY_LIST;
} else {
- arguments= new ArrayList(args.length);
- for (int i = 0; i < args.length; i++) {
- arguments.add(((JDIValue)args[i]).getUnderlyingValue());
+ arguments = new ArrayList<Value>(args.length);
+ for (IJavaValue arg : args) {
+ arguments.add(((JDIValue) arg).getUnderlyingValue());
}
}
ObjectReference object = getUnderlyingObject();
Method method = null;
- ReferenceType refType = getUnderlyingReferenceType();
+ ReferenceType refType = getUnderlyingReferenceType();
try {
- while (typeSignature != null && !refType.signature().equals(typeSignature)) {
+ while (typeSignature != null
+ && !refType.signature().equals(typeSignature)) {
// lookup correct type through the hierarchy
- refType = ((ClassType)refType).superclass();
+ refType = ((ClassType) refType).superclass();
if (refType == null) {
- targetRequestFailed(JDIDebugModelMessages.JDIObjectValueMethod_declaring_type_not_found_1, null);
+ targetRequestFailed(
+ JDIDebugModelMessages.JDIObjectValueMethod_declaring_type_not_found_1,
+ null);
}
}
- method= concreteMethodByName(refType, selector, signature);
+ method = concreteMethodByName(refType, selector, signature);
if (method == null) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_11, new String[] {selector, signature}), null);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_11, selector, signature), null);
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_exception_while_performing_method_lookup_for_selector, new String[] {e.toString(), selector, signature}), e);
+ targetRequestFailed(
+ MessageFormat
+ .format(JDIDebugModelMessages.JDIObjectValue_exception_while_performing_method_lookup_for_selector,
+ e.toString(), selector, signature),
+ e);
}
- Value result = javaThread.invokeMethod(null, object, method, arguments, true);
- return JDIValue.createValue((JDIDebugTarget)getDebugTarget(), result);
+ Value result = javaThread.invokeMethod(null, object, method, arguments,
+ true);
+ return JDIValue.createValue((JDIDebugTarget) getDebugTarget(), result);
}
- private Method concreteMethodByName(ReferenceType refType, String selector, String signature) throws DebugException {
+ private Method concreteMethodByName(ReferenceType refType, String selector,
+ String signature) throws DebugException {
if (refType instanceof ClassType) {
- return ((ClassType)refType).concreteMethodByName(selector, signature);
+ return ((ClassType) refType).concreteMethodByName(selector,
+ signature);
}
if (refType instanceof ArrayType) {
- // the jdi spec specifies that all methods on methods return an empty list for array types.
+ // the jdi spec specifies that all methods on methods return an
+ // empty list for array types.
// use a trick to get the right method from java.lang.Object
- return ((ClassType)refType.classObject().referenceType()).superclass().concreteMethodByName(selector, signature);
+ return ((ClassType) refType.classObject().referenceType())
+ .superclass().concreteMethodByName(selector, signature);
}
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_method_lookup_failed_for_selector____0____with_signature____1___1, new String[] {selector, signature}), null);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_method_lookup_failed_for_selector____0____with_signature____1___1,
+ selector, signature), null);
// it is not possible to return null
return null;
}
-
+
/**
* Returns this object's the underlying object reference
*
* @return underlying object reference
*/
public ObjectReference getUnderlyingObject() {
- return (ObjectReference)getUnderlyingValue();
+ return (ObjectReference) getUnderlyingValue();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String,
+ * boolean)
*/
- public IJavaFieldVariable getField(String name, boolean superField) throws DebugException {
+ public IJavaFieldVariable getField(String name, boolean superField)
+ throws DebugException {
ReferenceType ref = getUnderlyingReferenceType();
try {
if (superField) {
// begin lookup in superclass
- ref = ((ClassType)ref).superclass();
+ ref = ((ClassType) ref).superclass();
}
Field field = ref.fieldByName(name);
if (field != null) {
- return new JDIFieldVariable((JDIDebugTarget)getDebugTarget(), field, getUnderlyingObject(), fLogicalParent);
+ return new JDIFieldVariable((JDIDebugTarget) getDebugTarget(),
+ field, getUnderlyingObject(), fLogicalParent);
}
- Field enclosingThis= null;
- Iterator fields= ref.fields().iterator();
+ Field enclosingThis = null;
+ Iterator<Field> fields = ref.fields().iterator();
while (fields.hasNext()) {
- Field fieldTmp = (Field)fields.next();
+ Field fieldTmp = fields.next();
if (fieldTmp.name().startsWith("this$")) { //$NON-NLS-1$
- enclosingThis= fieldTmp;
+ enclosingThis = fieldTmp;
break;
}
}
-
- if (enclosingThis != null)
- return ((JDIObjectValue)(new JDIFieldVariable((JDIDebugTarget)getDebugTarget(), enclosingThis, getUnderlyingObject(), fLogicalParent)).getValue()).getField(name, false);
+
+ if (enclosingThis != null)
+ return ((JDIObjectValue) (new JDIFieldVariable(
+ (JDIDebugTarget) getDebugTarget(), enclosingThis,
+ getUnderlyingObject(), fLogicalParent)).getValue())
+ .getField(name, false);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field,
+ e.toString()), e);
}
// it is possible to return null
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String,
+ * java.lang.String)
*/
- public IJavaFieldVariable getField(String name, String declaringTypeSignature) throws DebugException {
- ReferenceType ref= getUnderlyingReferenceType();
+ public IJavaFieldVariable getField(String name,
+ String declaringTypeSignature) throws DebugException {
+ ReferenceType ref = getUnderlyingReferenceType();
try {
- Field field= null;
- Field fieldTmp= null;
- Iterator fields= ref.allFields().iterator();
+ Field field = null;
+ Field fieldTmp = null;
+ Iterator<Field> fields = ref.allFields().iterator();
while (fields.hasNext()) {
- fieldTmp = (Field)fields.next();
- if (name.equals(fieldTmp.name()) && declaringTypeSignature.equals(fieldTmp.declaringType().signature())) {
- field= fieldTmp;
+ fieldTmp = fields.next();
+ if (name.equals(fieldTmp.name())
+ && declaringTypeSignature.equals(fieldTmp
+ .declaringType().signature())) {
+ field = fieldTmp;
break;
}
}
if (field != null) {
- return new JDIFieldVariable((JDIDebugTarget)getDebugTarget(), field, getUnderlyingObject(), fLogicalParent);
+ return new JDIFieldVariable((JDIDebugTarget) getDebugTarget(),
+ field, getUnderlyingObject(), fLogicalParent);
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field,
+ e.toString()), e);
}
// it is possible to return null
return null;
}
-
+
/**
- * Returns a variable representing the field in this object
- * with the given name, or <code>null</code> if there is no
- * field with the given name, or the name is ambiguous.
+ * Returns a variable representing the field in this object with the given
+ * name, or <code>null</code> if there is no field with the given name, or
+ * the name is ambiguous.
*
- * @param name field name
- * @param superClassLevel the level of the desired field in the
- * hierarchy. Level 0 returns the field from the current type, level 1 from the
- * super type, etc.
+ * @param name
+ * field name
+ * @param superClassLevel
+ * the level of the desired field in the hierarchy. Level 0
+ * returns the field from the current type, level 1 from the
+ * super type, etc.
* @return the variable representing the field, or <code>null</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
*/
- public IJavaFieldVariable getField(String name, int superClassLevel) throws DebugException {
- ReferenceType ref= getUnderlyingReferenceType();
+ public IJavaFieldVariable getField(String name, int superClassLevel)
+ throws DebugException {
+ ReferenceType ref = getUnderlyingReferenceType();
try {
- for (int i= 0 ; i < superClassLevel; i++) {
- ref= ((ClassType)ref).superclass();
+ for (int i = 0; i < superClassLevel; i++) {
+ ref = ((ClassType) ref).superclass();
}
Field field = ref.fieldByName(name);
if (field != null) {
- return new JDIFieldVariable((JDIDebugTarget)getDebugTarget(), field, getUnderlyingObject(), fLogicalParent);
+ return new JDIFieldVariable((JDIDebugTarget) getDebugTarget(),
+ field, getUnderlyingObject(), fLogicalParent);
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field,
+ e.toString()), e);
}
// it is possible to return null
return null;
}
-
+
/**
* Returns the underlying reference type for this object.
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
*/
protected ReferenceType getUnderlyingReferenceType() throws DebugException {
try {
return getUnderlyingObject().referenceType();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_exception_retrieving_reference_type, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_exception_retrieving_reference_type,
+ e.toString()), e);
}
// execution will not reach this line, as an exception will
// be thrown.
return null;
-
+
}
/**
- * Return the enclosing object of this object at the specified level.
- * Level 0 returns the object, level 1 returns the enclosing object, etc.
+ * Return the enclosing object of this object at the specified level. Level
+ * 0 returns the object, level 1 returns the enclosing object, etc.
*/
- public IJavaObject getEnclosingObject(int enclosingLevel) throws DebugException {
- JDIObjectValue res= this;
- for (int i= 0; i < enclosingLevel; i ++) {
- ReferenceType ref= res.getUnderlyingReferenceType();
+ public IJavaObject getEnclosingObject(int enclosingLevel)
+ throws DebugException {
+ JDIObjectValue res = this;
+ for (int i = 0; i < enclosingLevel; i++) {
+ ReferenceType ref = res.getUnderlyingReferenceType();
try {
- Field enclosingThis= null, fieldTmp= null;
- Iterator fields= ref.fields().iterator();
+ Field enclosingThis = null, fieldTmp = null;
+ Iterator<Field> fields = ref.fields().iterator();
while (fields.hasNext()) {
- fieldTmp = (Field)fields.next();
+ fieldTmp = fields.next();
if (fieldTmp.name().startsWith("this$")) { //$NON-NLS-1$
- enclosingThis= fieldTmp;
+ enclosingThis = fieldTmp;
}
}
if (enclosingThis != null) {
- JDIDebugTarget debugTarget = (JDIDebugTarget)getDebugTarget();
- JDIFieldVariable fieldVariable = new JDIFieldVariable(debugTarget, enclosingThis, res.getUnderlyingObject(), fLogicalParent);
- res = (JDIObjectValue)fieldVariable.getValue();
+ JDIDebugTarget debugTarget = (JDIDebugTarget) getDebugTarget();
+ JDIFieldVariable fieldVariable = new JDIFieldVariable(
+ debugTarget, enclosingThis,
+ res.getUnderlyingObject(), fLogicalParent);
+ res = (JDIObjectValue) fieldVariable.getValue();
} else {
- // it is possible to return null
- return null;
+ // it is possible to return null
+ return null;
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_exception_retrieving_field,
+ e.toString()), e);
}
}
return res;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getWaitingThreads()
*/
public IJavaThread[] getWaitingThreads() throws DebugException {
- List waiting = new ArrayList();
+ List<JDIThread> waiting = new ArrayList<JDIThread>();
try {
- List threads= getUnderlyingObject().waitingThreads();
- JDIDebugTarget debugTarget= (JDIDebugTarget)getDebugTarget();
- for (Iterator iter= threads.iterator(); iter.hasNext();) {
- JDIThread jdiThread = debugTarget.findThread((ThreadReference) iter.next());
+ List<ThreadReference> threads = getUnderlyingObject().waitingThreads();
+ JDIDebugTarget debugTarget = (JDIDebugTarget) getDebugTarget();
+ for (Iterator<ThreadReference> iter = threads.iterator(); iter.hasNext();) {
+ JDIThread jdiThread = debugTarget.findThread(iter.next());
if (jdiThread != null) {
waiting.add(jdiThread);
}
}
} catch (IncompatibleThreadStateException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_0, e);
+ targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_0, e);
} catch (VMDisconnectedException e) {
// Ignore
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_0, e);
+ targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_0, e);
}
- return (IJavaThread[]) waiting.toArray(new IJavaThread[waiting.size()]);
+ return waiting.toArray(new IJavaThread[waiting.size()]);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getOwningThread()
*/
public IJavaThread getOwningThread() throws DebugException {
- IJavaThread owningThread= null;
+ IJavaThread owningThread = null;
try {
- ThreadReference thread= getUnderlyingObject().owningThread();
- JDIDebugTarget debugTarget= (JDIDebugTarget)getDebugTarget();
+ ThreadReference thread = getUnderlyingObject().owningThread();
+ JDIDebugTarget debugTarget = (JDIDebugTarget) getDebugTarget();
if (thread != null) {
- owningThread= debugTarget.findThread(thread);
+ owningThread = debugTarget.findThread(thread);
}
} catch (IncompatibleThreadStateException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_1, e);
+ targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_1, e);
} catch (VMDisconnectedException e) {
- return null;
- } catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_1, e);
- }
+ return null;
+ } catch (RuntimeException e) {
+ targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_1, e);
+ }
return owningThread;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getReferenceTypeName()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIValue#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
try {
- return JDIReferenceType.getGenericName(getUnderlyingReferenceType());
+ return JDIReferenceType
+ .getGenericName(getUnderlyingReferenceType());
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_reference_type_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_reference_type_name,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
- return null;
+ // #targetRequestFailed will thrown an exception
+ return null;
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getUniqueId()
*/
public long getUniqueId() throws DebugException {
@@ -359,57 +447,76 @@ public class JDIObjectValue extends JDIValue implements IJavaObject {
return -1L;
}
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_unique_id, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_unique_id,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
- return 0;
+ // #targetRequestFailed will thrown an exception
+ return 0;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#getReferringObjects(long)
*/
public IJavaObject[] getReferringObjects(long max) throws DebugException {
- // The cached references should be reloaded if the suspend count has changed, or the maximum entries has changed
- if (fCachedReferences == null || fSuspendCount < ((JDIDebugTarget)getDebugTarget()).getSuspendCount() || fPreviousMax != max){
+ // The cached references should be reloaded if the suspend count has
+ // changed, or the maximum entries has changed
+ if (fCachedReferences == null
+ || fSuspendCount < ((JDIDebugTarget) getDebugTarget())
+ .getSuspendCount() || fPreviousMax != max) {
reloadReferringObjects(max);
fPreviousMax = max;
- fSuspendCount = ((JDIDebugTarget)getDebugTarget()).getSuspendCount();
+ fSuspendCount = ((JDIDebugTarget) getDebugTarget())
+ .getSuspendCount();
}
return fCachedReferences;
}
-
+
/**
- * Returns true if references to this object have been calculated and cached. This
- * method will return true even if the cached references are stale.
- * @return true is references to this object have been calculated and cached, false otherwise
+ * Returns true if references to this object have been calculated and
+ * cached. This method will return true even if the cached references are
+ * stale.
+ *
+ * @return true is references to this object have been calculated and
+ * cached, false otherwise
*/
- public boolean isReferencesLoaded(){
+ public boolean isReferencesLoaded() {
return fCachedReferences != null;
}
-
+
/**
- * Gets the list of objects that reference this object from the vm, overwriting the
- * cached list (if one exists).
+ * Gets the list of objects that reference this object from the vm,
+ * overwriting the cached list (if one exists).
*
- * @param max The maximum number of entries to return
- * @throws DebugException if the vm cannot return a list of referring objects
+ * @param max
+ * The maximum number of entries to return
+ * @throws DebugException
+ * if the vm cannot return a list of referring objects
*/
- protected void reloadReferringObjects(long max) throws DebugException{
- try{
- List list = getUnderlyingObject().referringObjects(max);
+ protected void reloadReferringObjects(long max) throws DebugException {
+ try {
+ List<Value> list = getUnderlyingObject().referringObjects(max);
IJavaObject[] references = new IJavaObject[list.size()];
for (int i = 0; i < references.length; i++) {
- references[i] = (IJavaObject) JDIValue.createValue(getJavaDebugTarget(), (Value) list.get(i));
+ references[i] = (IJavaObject) JDIValue.createValue(
+ getJavaDebugTarget(), list.get(i));
}
fCachedReferences = references;
} catch (RuntimeException e) {
fCachedReferences = null;
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIObjectValue_12,new String[]{e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIObjectValue_12,
+ e.toString()), e);
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#disableCollection()
*/
public void disableCollection() throws DebugException {
@@ -417,14 +524,19 @@ public class JDIObjectValue extends JDIValue implements IJavaObject {
try {
getUnderlyingObject().disableCollection();
} catch (UnsupportedOperationException e) {
- // The VM does not support enable/disable GC - update target capabilities and ignore (bug 246577)
- getJavaDebugTarget().setSupportsSelectiveGarbageCollection(false);
+ // The VM does not support enable/disable GC - update target
+ // capabilities and ignore (bug 246577)
+ getJavaDebugTarget().setSupportsSelectiveGarbageCollection(
+ false);
} catch (RuntimeException e) {
targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_13, e);
}
}
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaObject#enableCollection()
*/
public void enableCollection() throws DebugException {
@@ -435,5 +547,5 @@ public class JDIObjectValue extends JDIValue implements IJavaObject {
targetRequestFailed(JDIDebugModelMessages.JDIObjectValue_14, e);
}
}
- }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPlaceholderValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPlaceholderValue.java
index f3f2c98d1..2707e889e 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPlaceholderValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPlaceholderValue.java
@@ -11,50 +11,56 @@
package org.eclipse.jdt.internal.debug.core.model;
/**
- * This class is used to create a variable/value that displays a warning message to the user.
- * Currently used to inform users that references are not available for the current VM.
- * It extends <code>JDINullValue</code> so that most actions will ignore it, but returns the
- * message instead of "null" for it's value.
+ * This class is used to create a variable/value that displays a warning message
+ * to the user. Currently used to inform users that references are not available
+ * for the current VM. It extends <code>JDINullValue</code> so that most actions
+ * will ignore it, but returns the message instead of "null" for it's value.
*
* @since 3.3
*/
public class JDIPlaceholderValue extends JDINullValue {
private String fMessage;
-
+
/**
* Constructor, passes the debug target to the super class.
- * @param target debug target this value belongs to
+ *
+ * @param target
+ * debug target this value belongs to
*/
public JDIPlaceholderValue(JDIDebugTarget target, String message) {
super(target);
fMessage = message;
}
-
+
/**
* @return the message supplied in the constructor
* @see org.eclipse.jdt.internal.debug.core.model.JDINullValue#getValueString()
*/
+ @Override
public String getValueString() {
return fMessage;
}
-
+
/**
* @return the message supplied in the constructor
* @see org.eclipse.jdt.internal.debug.core.model.JDINullValue#toString()
*/
+ @Override
public String toString() {
return fMessage;
}
-
+
/**
- * Returns signature for a java string object so that the string message passed in
- * the constructor is displayed in the detail pane.
+ * Returns signature for a java string object so that the string message
+ * passed in the constructor is displayed in the detail pane.
+ *
* @return signature for a java string object
* @see org.eclipse.jdt.internal.debug.core.model.JDINullValue#getSignature()
*/
+ @Override
public String getSignature() {
return "Ljava/lang/String;"; //$NON-NLS-1$
}
-
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPrimitiveValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPrimitiveValue.java
index 97b5e6105..1cc14dde0 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPrimitiveValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIPrimitiveValue.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import com.sun.jdi.PrimitiveValue;
@@ -24,20 +23,22 @@ public class JDIPrimitiveValue extends JDIValue implements IJavaPrimitiveValue {
/**
* Constructs a new primitive value.
*
- * @param target the Java debug target
- * @param value the underlying JDI primitive value
+ * @param target
+ * the Java debug target
+ * @param value
+ * the underlying JDI primitive value
*/
public JDIPrimitiveValue(JDIDebugTarget target, Value value) {
super(target, value);
}
-
+
/**
* Returns this value's underlying primtive value
*
* @return underlying primtive value
*/
protected PrimitiveValue getUnderlyingPrimitiveValue() {
- return (PrimitiveValue)getUnderlyingValue();
+ return (PrimitiveValue) getUnderlyingValue();
}
/*
@@ -97,4 +98,3 @@ public class JDIPrimitiveValue extends JDIValue implements IJavaPrimitiveValue {
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListEntryVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListEntryVariable.java
index 26c30e8ee..b71f96ae6 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListEntryVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListEntryVariable.java
@@ -14,21 +14,24 @@ import org.eclipse.jdt.debug.core.IJavaValue;
import org.eclipse.jdt.internal.debug.core.logicalstructures.JDIPlaceholderVariable;
/**
- * This variable is created as the child of <code>JDIReferenceListValue</code>. It represents
- * one reference to a root object stored in the parent value.
+ * This variable is created as the child of <code>JDIReferenceListValue</code>.
+ * It represents one reference to a root object stored in the parent value.
*
* @see JDIReferenceListValue
* @since 3.3
*/
-public class JDIReferenceListEntryVariable extends JDIPlaceholderVariable{
-
+public class JDIReferenceListEntryVariable extends JDIPlaceholderVariable {
+
/**
* Constructor.
- * @param name The name that this variable should use as its label
- * @param reference The value that this variable contains
+ *
+ * @param name
+ * The name that this variable should use as its label
+ * @param reference
+ * The value that this variable contains
*/
public JDIReferenceListEntryVariable(String name, IJavaValue reference) {
- super (name,reference);
+ super(name, reference);
}
-
+
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListValue.java
index a53946bae..79f64be54 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,54 +24,66 @@ import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ObjectReference;
/**
- * A JDI Value representing a set of references to the root object specified
- * in the constructor. Used to add a list of all references to an object to
- * various views including the variables view. The value should belong to
- * a <code>JDIReferenceListVariable</code>. The children of this value will
- * be <code>JDIReferenceListEntryVariable</code>, each representing one reference
+ * A JDI Value representing a set of references to the root object specified in
+ * the constructor. Used to add a list of all references to an object to various
+ * views including the variables view. The value should belong to a
+ * <code>JDIReferenceListVariable</code>. The children of this value will be
+ * <code>JDIReferenceListEntryVariable</code>, each representing one reference
* to the root object.
*
* @see JDIReferenceListVariable
* @see JDIReferenceListEntryVariable
* @since 3.3
*/
-public class JDIReferenceListValue extends JDIObjectValue implements IIndexedValue {
+public class JDIReferenceListValue extends JDIObjectValue implements
+ IIndexedValue {
private IJavaObject fRoot;
private boolean fIsMoreThanPreference;
private IJavaType fType = null;
-
+
/**
* Constructor, initializes this value with its debug target and root object
- * @param target The debug target associated with this value
- * @param root The root object that the elements in the array refer to.
+ *
+ * @param target
+ * The debug target associated with this value
+ * @param root
+ * The root object that the elements in the array refer to.
*/
public JDIReferenceListValue(IJavaObject root) {
- super((JDIDebugTarget)root.getDebugTarget(), ((JDIObjectValue)root).getUnderlyingObject());
+ super((JDIDebugTarget) root.getDebugTarget(), ((JDIObjectValue) root)
+ .getUnderlyingObject());
fRoot = root;
try {
- IJavaType[] javaTypes = ((JDIDebugTarget)root.getDebugTarget()).getJavaTypes("java.lang.Object[]"); //$NON-NLS-1$
+ IJavaType[] javaTypes = ((JDIDebugTarget) root.getDebugTarget())
+ .getJavaTypes("java.lang.Object[]"); //$NON-NLS-1$
if (javaTypes.length > 0) {
fType = javaTypes[0];
}
- } catch (DebugException e) {}
+ } catch (DebugException e) {
+ }
}
-
+
/**
* @return all references to the root object as an array of IJavaObjects
*/
- protected synchronized IJavaObject[] getReferences(){
- try{
- int max = HeapWalkingManager.getDefault().getAllReferencesMaxCount();
+ protected synchronized IJavaObject[] getReferences() {
+ try {
+ int max = HeapWalkingManager.getDefault()
+ .getAllReferencesMaxCount();
IJavaObject[] referringObjects = null;
fIsMoreThanPreference = false;
- if (max == 0){
+ if (max == 0) {
referringObjects = fRoot.getReferringObjects(max);
} else {
- referringObjects = fRoot.getReferringObjects(max+1);
- if (referringObjects.length > max){
+ referringObjects = fRoot.getReferringObjects(max + 1);
+ if (referringObjects.length > max) {
fIsMoreThanPreference = true;
- referringObjects[max] = new JDIPlaceholderValue((JDIDebugTarget)fRoot.getDebugTarget(),MessageFormat.format(JDIDebugModelMessages.JDIReferenceListValue_9,new String[]{Integer.toString(max)}));
+ referringObjects[max] = new JDIPlaceholderValue(
+ (JDIDebugTarget) fRoot.getDebugTarget(),
+ MessageFormat
+ .format(JDIDebugModelMessages.JDIReferenceListValue_9,
+ Integer.toString(max)));
}
}
return referringObjects;
@@ -80,130 +92,180 @@ public class JDIReferenceListValue extends JDIObjectValue implements IIndexedVal
return new IJavaObject[0];
}
}
-
+
/**
- * @return whether the references to the root object have been loaded from the vm yet.
+ * @return whether the references to the root object have been loaded from
+ * the vm yet.
*/
- protected synchronized boolean referencesLoaded(){
- if (fRoot instanceof JDIObjectValue){
- return ((JDIObjectValue)fRoot).isReferencesLoaded();
+ protected synchronized boolean referencesLoaded() {
+ if (fRoot instanceof JDIObjectValue) {
+ return ((JDIObjectValue) fRoot).isReferencesLoaded();
}
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getVariables()
*/
+ @Override
public IVariable[] getVariables() throws DebugException {
IJavaObject[] elements = getReferences();
IVariable[] vars = new JDIPlaceholderVariable[elements.length];
int length = elements.length;
- if(fIsMoreThanPreference){
+ if (fIsMoreThanPreference) {
length--;
- vars[length] = new JDIPlaceholderVariable(JDIDebugModelMessages.JDIReferenceListValue_11, elements[length]);
+ vars[length] = new JDIPlaceholderVariable(
+ JDIDebugModelMessages.JDIReferenceListValue_11,
+ elements[length]);
}
-
+
for (int i = 0; i < length; i++) {
- vars[i] = new JDIReferenceListEntryVariable(MessageFormat.format(JDIDebugModelMessages.JDIReferenceListValue_0, new String[]{Integer.toString(i)}),elements[i]);
+ vars[i] = new JDIReferenceListEntryVariable(MessageFormat.format(
+ JDIDebugModelMessages.JDIReferenceListValue_0,
+ Integer.toString(i)), elements[i]);
}
return vars;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getUnderlyingObject()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getUnderlyingObject
+ * ()
*/
+ @Override
public ObjectReference getUnderlyingObject() {
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#hasVariables()
*/
+ @Override
public boolean hasVariables() throws DebugException {
- if (referencesLoaded()){
+ if (referencesLoaded()) {
return getReferences().length > 0;
}
return true;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#isAllocated()
*/
+ @Override
public boolean isAllocated() throws DebugException {
return fRoot.isAllocated();
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getJavaType()
*/
+ @Override
public IJavaType getJavaType() throws DebugException {
return fType;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getSignature()
*/
+ @Override
public String getSignature() throws DebugException {
return "[Ljava/lang/Object;"; //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getReferenceTypeName()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIObjectValue#getReferenceTypeName
+ * ()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
return "java.lang.Object[]"; //$NON-NLS-1$
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#getValueString()
*/
+ @Override
public String getValueString() throws DebugException {
return ""; //$NON-NLS-1$
}
-
+
/**
- * Returns a string representation of this value intended to be displayed
- * in the detail pane of views. Lists the references on separate lines.
+ * Returns a string representation of this value intended to be displayed in
+ * the detail pane of views. Lists the references on separate lines.
*
- * @return a string representation of this value to display in the detail pane
+ * @return a string representation of this value to display in the detail
+ * pane
*/
- public String getDetailString(){
+ public String getDetailString() {
StringBuffer buf = new StringBuffer();
Object[] elements = getReferences();
- if (elements.length == 0){
+ if (elements.length == 0) {
buf.append(JDIDebugModelMessages.JDIReferenceListValue_2);
- }
- else{
+ } else {
String length = null;
- if (fIsMoreThanPreference){
- length = MessageFormat.format(JDIDebugModelMessages.JDIReferenceListValue_15,new String[]{Integer.toString(elements.length-1)});
+ if (fIsMoreThanPreference) {
+ length = MessageFormat.format(
+ JDIDebugModelMessages.JDIReferenceListValue_15,
+ Integer.toString(elements.length - 1));
} else {
length = Integer.toString(elements.length);
}
- if (elements.length == 1){
- buf.append(MessageFormat.format(JDIDebugModelMessages.JDIReferenceListValue_3,new String[]{length}));
+ if (elements.length == 1) {
+ buf.append(MessageFormat.format(
+ JDIDebugModelMessages.JDIReferenceListValue_3,
+ length));
} else {
- buf.append(MessageFormat.format(JDIDebugModelMessages.JDIReferenceListValue_4,new String[]{length}));
+ buf.append(MessageFormat.format(
+ JDIDebugModelMessages.JDIReferenceListValue_4,
+ length));
}
- for (int i = 0; i < elements.length; i++) {
- buf.append(elements[i] + "\n"); //$NON-NLS-1$
+ for (Object element : elements) {
+ buf.append(element + "\n"); //$NON-NLS-1$
}
}
return buf.toString();
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#toString()
*/
+ @Override
public String toString() {
- return MessageFormat.format(JDIDebugModelMessages.JDIReferenceListValue_6,new String[]{getUnderlyingValue().toString()});
+ return MessageFormat.format(
+ JDIDebugModelMessages.JDIReferenceListValue_6,
+ getUnderlyingValue().toString());
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIValue#equals(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIValue#equals(java.lang.Object
+ * )
*/
+ @Override
public boolean equals(Object o) {
- // Two JDIReferenceListValues are equal if they both have the same root object.
+ // Two JDIReferenceListValues are equal if they both have the same root
+ // object.
if (o instanceof JDIReferenceListValue) {
JDIReferenceListValue ref = (JDIReferenceListValue) o;
return ref.fRoot.equals(fRoot);
@@ -211,28 +273,37 @@ public class JDIReferenceListValue extends JDIObjectValue implements IIndexedVal
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.internal.debug.core.model.JDIValue#hashCode()
*/
+ @Override
public int hashCode() {
return getClass().hashCode() + fRoot.hashCode();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getInitialOffset()
*/
public int getInitialOffset() {
return 0;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getSize()
*/
public int getSize() throws DebugException {
return getVariables().length;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getVariable(int)
*/
public IVariable getVariable(int offset) throws DebugException {
@@ -240,22 +311,27 @@ public class JDIReferenceListValue extends JDIObjectValue implements IIndexedVal
if (offset < variables.length) {
return variables[offset];
} else {
- requestFailed(JDIDebugModelMessages.JDIReferenceListValue_7, new IndexOutOfBoundsException());
+ requestFailed(JDIDebugModelMessages.JDIReferenceListValue_7,
+ new IndexOutOfBoundsException());
return null;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IIndexedValue#getVariables(int, int)
*/
- public IVariable[] getVariables(int offset, int length) throws DebugException {
+ public IVariable[] getVariables(int offset, int length)
+ throws DebugException {
IVariable[] variables = getVariables();
if (offset < variables.length && (offset + length) <= variables.length) {
IJavaVariable[] vars = new IJavaVariable[length];
System.arraycopy(variables, offset, vars, 0, length);
return vars;
} else {
- requestFailed(JDIDebugModelMessages.JDIReferenceListValue_8, new IndexOutOfBoundsException());
+ requestFailed(JDIDebugModelMessages.JDIReferenceListValue_8,
+ new IndexOutOfBoundsException());
return null;
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListVariable.java
index ce9d48b72..45a78298f 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceListVariable.java
@@ -11,40 +11,47 @@
package org.eclipse.jdt.internal.debug.core.model;
import org.eclipse.jdt.debug.core.IJavaObject;
-
import org.eclipse.jdt.internal.debug.core.logicalstructures.JDIPlaceholderVariable;
/**
- * A variable that stores a list of references. Used to display reference information collected from
- * the vm using the 'all references' utility in Java 6.0. This variable uses a
- * <code>JDIReferenceListValue</code> as its value. Its children will be
- * <code>JDIReferenceListEntryVariable</code>.
+ * A variable that stores a list of references. Used to display reference
+ * information collected from the vm using the 'all references' utility in Java
+ * 6.0. This variable uses a <code>JDIReferenceListValue</code> as its value.
+ * Its children will be <code>JDIReferenceListEntryVariable</code>.
*
* @since 3.3
* @see JDIReferenceListValue
* @see JDIReferenceListEntryVariable
*/
-public class JDIReferenceListVariable extends JDIPlaceholderVariable{
-
+public class JDIReferenceListVariable extends JDIPlaceholderVariable {
+
/**
- * Creates a new variable that stores a list of references, all referring to the java object specified
- * by the parameter root.
+ * Creates a new variable that stores a list of references, all referring to
+ * the java object specified by the parameter root.
*
- * @param name The name this variable should use
- * @param root The root java object that references will be collected for
+ * @param name
+ * The name this variable should use
+ * @param root
+ * The root java object that references will be collected for
*/
public JDIReferenceListVariable(String name, IJavaObject root) {
- super (name,new JDIReferenceListValue(root));
+ super(name, new JDIReferenceListValue(root));
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.logicalstructures.JDIPlaceholderVariable#equals(java.lang.Object)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.logicalstructures.JDIPlaceholderVariable
+ * #equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
// Two JDIReferenceListVariables are equal if their values are equal
- if (obj instanceof JDIReferenceListVariable){
- JDIReferenceListVariable var = (JDIReferenceListVariable)obj;
- if (getValue() instanceof JDIPlaceholderValue || var.getValue() instanceof JDIPlaceholderValue){
+ if (obj instanceof JDIReferenceListVariable) {
+ JDIReferenceListVariable var = (JDIReferenceListVariable) obj;
+ if (getValue() instanceof JDIPlaceholderValue
+ || var.getValue() instanceof JDIPlaceholderValue) {
// A placeholder value is only equal to the same instance
return this == obj;
}
@@ -52,10 +59,15 @@ public class JDIReferenceListVariable extends JDIPlaceholderVariable{
}
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.logicalstructures.JDIPlaceholderVariable#hashCode()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.logicalstructures.JDIPlaceholderVariable
+ * #hashCode()
*/
+ @Override
public int hashCode() {
return getValue().hashCode();
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceType.java
index ecdbae17d..b954ed29f 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIReferenceType.java
@@ -27,37 +27,43 @@ import com.sun.jdi.ArrayType;
import com.sun.jdi.ClassLoaderReference;
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.Field;
+import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.Type;
-import com.sun.jdi.Value;
import com.sun.jdi.VirtualMachine;
/**
* References a class, interface, or array type.
*/
-public abstract class JDIReferenceType extends JDIType implements IJavaReferenceType {
-
+public abstract class JDIReferenceType extends JDIType implements
+ IJavaReferenceType {
+
// field names declared in this type
private String[] fDeclaredFields = null;
- // field names declared in this type, super types, implemented interfaces and super-interfaces
+ // field names declared in this type, super types, implemented interfaces
+ // and super-interfaces
private String[] fAllFields = null;
/**
* Constructs a new reference type in the given target.
*
- * @param target associated VM
- * @param type reference type
+ * @param target
+ * associated VM
+ * @param type
+ * reference type
*/
public JDIReferenceType(JDIDebugTarget target, Type type) {
super(target, type);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getAvailableStrata()
*/
public String[] getAvailableStrata() {
- List strata = getReferenceType().availableStrata();
- return (String[])strata.toArray(new String[strata.size()]);
+ List<String> strata = getReferenceType().availableStrata();
+ return strata.toArray(new String[strata.size()]);
}
/**
@@ -66,114 +72,140 @@ public abstract class JDIReferenceType extends JDIType implements IJavaReference
* @return the underlying reference type
*/
protected ReferenceType getReferenceType() {
- return (ReferenceType)getUnderlyingType();
+ return (ReferenceType) getUnderlyingType();
}
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getDefaultStratum()
*/
public String getDefaultStratum() throws DebugException {
- try {
- return getReferenceType().defaultStratum();
- } catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_1, e);
- }
- // execution will not reach here
- return null;
+ try {
+ return getReferenceType().defaultStratum();
+ } catch (RuntimeException e) {
+ targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_1, e);
+ }
+ // execution will not reach here
+ return null;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaReferenceType#getField(java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaReferenceType#getField(java.lang.String)
*/
public IJavaFieldVariable getField(String name) throws DebugException {
try {
- ReferenceType type = (ReferenceType)getUnderlyingType();
+ ReferenceType type = (ReferenceType) getUnderlyingType();
Field field = type.fieldByName(name);
if (field != null && field.isStatic()) {
return new JDIFieldVariable(getJavaDebugTarget(), field, type);
- }
+ }
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_field, new String[] {e.toString(), name}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_field,
+ e.toString(), name), e);
}
- // it is possible to return null
+ // it is possible to return null
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getClassObject()
*/
public IJavaClassObject getClassObject() throws DebugException {
try {
- ReferenceType type= (ReferenceType)getUnderlyingType();
- return (IJavaClassObject)JDIValue.createValue(getJavaDebugTarget(), type.classObject());
+ ReferenceType type = (ReferenceType) getUnderlyingType();
+ return (IJavaClassObject) JDIValue.createValue(
+ getJavaDebugTarget(), type.classObject());
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIClassType_exception_while_retrieving_class_object, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIClassType_exception_while_retrieving_class_object,
+ e.toString()), e);
}
// execution will not fall through to here,
// as #requestFailed will throw an exception
return null;
- }
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getAllFieldNames()
*/
public String[] getAllFieldNames() throws DebugException {
if (fAllFields == null) {
try {
- List fields = ((ReferenceType)getUnderlyingType()).allFields();
+ List<Field> fields = ((ReferenceType) getUnderlyingType()).allFields();
fAllFields = new String[fields.size()];
- Iterator iterator = fields.iterator();
+ Iterator<Field> iterator = fields.iterator();
int i = 0;
while (iterator.hasNext()) {
- Field field = (Field)iterator.next();
+ Field field = iterator.next();
fAllFields[i] = field.name();
i++;
}
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_2, e);
- }
- }
+ targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_2, e);
+ }
+ }
return fAllFields;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaReferenceType#getDeclaredFieldNames()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaReferenceType#getDeclaredFieldNames()
*/
public String[] getDeclaredFieldNames() throws DebugException {
if (fDeclaredFields == null) {
try {
- List fields = ((ReferenceType)getUnderlyingType()).fields();
+ List<Field> fields = ((ReferenceType) getUnderlyingType()).fields();
fDeclaredFields = new String[fields.size()];
- Iterator iterator = fields.iterator();
+ Iterator<Field> iterator = fields.iterator();
int i = 0;
while (iterator.hasNext()) {
- Field field = (Field)iterator.next();
+ Field field = iterator.next();
fDeclaredFields[i] = field.name();
i++;
}
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_3, e);
- }
+ targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_3, e);
+ }
}
return fDeclaredFields;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaReferenceType#getSourcePaths(java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaReferenceType#getSourcePaths(java.lang
+ * .String)
*/
public String[] getSourcePaths(String stratum) throws DebugException {
try {
- List sourcePaths= getReferenceType().sourcePaths(stratum);
- return (String[]) sourcePaths.toArray(new String[sourcePaths.size()]);
+ List<String> sourcePaths = getReferenceType().sourcePaths(stratum);
+ return sourcePaths
+ .toArray(new String[sourcePaths.size()]);
} catch (AbsentInformationException e) {
} catch (RuntimeException e) {
- requestFailed(JDIDebugModelMessages.JDIReferenceType_4, e, DebugException.TARGET_REQUEST_FAILED);
+ requestFailed(JDIDebugModelMessages.JDIReferenceType_4, e,
+ DebugException.TARGET_REQUEST_FAILED);
}
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getSourceName()
*/
public String getSourceName() throws DebugException {
@@ -181,49 +213,61 @@ public abstract class JDIReferenceType extends JDIType implements IJavaReference
return getReferenceType().sourceName();
} catch (AbsentInformationException e) {
} catch (RuntimeException e) {
- requestFailed(JDIDebugModelMessages.JDIReferenceType_4, e, DebugException.TARGET_REQUEST_FAILED);
+ requestFailed(JDIDebugModelMessages.JDIReferenceType_4, e,
+ DebugException.TARGET_REQUEST_FAILED);
}
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaReferenceType#getSourceNames(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaReferenceType#getSourceNames(java.lang
+ * .String)
*/
public String[] getSourceNames(String stratum) throws DebugException {
try {
- List sourceNames= getReferenceType().sourceNames(stratum);
- return (String[]) sourceNames.toArray(new String[sourceNames.size()]);
+ List<String> sourceNames = getReferenceType().sourceNames(stratum);
+ return sourceNames
+ .toArray(new String[sourceNames.size()]);
} catch (AbsentInformationException e) {
} catch (RuntimeException e) {
- requestFailed(JDIDebugModelMessages.JDIReferenceType_4, e, DebugException.TARGET_REQUEST_FAILED);
+ requestFailed(JDIDebugModelMessages.JDIReferenceType_4, e,
+ DebugException.TARGET_REQUEST_FAILED);
}
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaReferenceType#getClassLoaderObject()
- */
- public IJavaObject getClassLoaderObject() throws DebugException {
- try {
- ReferenceType type= (ReferenceType)getUnderlyingType();
- ClassLoaderReference classLoader = type.classLoader();
- if (classLoader != null) {
- return (IJavaObject)JDIValue.createValue(getJavaDebugTarget(), classLoader);
- }
- } catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIReferenceType_0, new String[] {e.toString()}), e);
- }
- return null;
- }
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.debug.core.IJavaReferenceType#getClassLoaderObject()
+ */
+ public IJavaObject getClassLoaderObject() throws DebugException {
+ try {
+ ReferenceType type = (ReferenceType) getUnderlyingType();
+ ClassLoaderReference classLoader = type.classLoader();
+ if (classLoader != null) {
+ return (IJavaObject) JDIValue.createValue(getJavaDebugTarget(),
+ classLoader);
+ }
+ } catch (RuntimeException e) {
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIReferenceType_0,
+ e.toString()), e);
+ }
+ return null;
+ }
- static public String getGenericName(ReferenceType type) throws DebugException {
+ static public String getGenericName(ReferenceType type)
+ throws DebugException {
if (type instanceof ArrayType) {
try {
Type componentType;
- componentType= ((ArrayType)type).componentType();
+ componentType = ((ArrayType) type).componentType();
if (componentType instanceof ReferenceType) {
- return getGenericName((ReferenceType)componentType) + "[]"; //$NON-NLS-1$
+ return getGenericName((ReferenceType) componentType) + "[]"; //$NON-NLS-1$
}
return type.name();
} catch (ClassNotLoadedException e) {
@@ -231,72 +275,85 @@ public abstract class JDIReferenceType extends JDIType implements IJavaReference
// just try to create one with the information
}
}
- String signature= type.signature();
- StringBuffer res= new StringBuffer(getTypeName(signature));
- String genericSignature= type.genericSignature();
+ String signature = type.signature();
+ StringBuffer res = new StringBuffer(getTypeName(signature));
+ String genericSignature = type.genericSignature();
if (genericSignature != null) {
- String[] typeParameters= Signature.getTypeParameters(genericSignature);
+ String[] typeParameters = Signature
+ .getTypeParameters(genericSignature);
if (typeParameters.length > 0) {
- res.append('<').append(Signature.getTypeVariable(typeParameters[0]));
- for (int i= 1; i < typeParameters.length; i++) {
- res.append(',').append(Signature.getTypeVariable(typeParameters[i]));
+ res.append('<').append(
+ Signature.getTypeVariable(typeParameters[0]));
+ for (int i = 1; i < typeParameters.length; i++) {
+ res.append(',').append(
+ Signature.getTypeVariable(typeParameters[i]));
}
res.append('>');
}
}
return res.toString();
}
-
+
/**
- * Return the name from the given signature.
- * Keep the '$' characters.
- * @param genericTypeSignature the signature to derive the type name from
+ * Return the name from the given signature. Keep the '$' characters.
+ *
+ * @param genericTypeSignature
+ * the signature to derive the type name from
* @return the type name
*/
public static String getTypeName(String genericTypeSignature) {
- int arrayDimension= 0;
+ int arrayDimension = 0;
while (genericTypeSignature.charAt(arrayDimension) == '[') {
arrayDimension++;
}
- int parameterStart= genericTypeSignature.indexOf('<');
- StringBuffer name= new StringBuffer();
+ int parameterStart = genericTypeSignature.indexOf('<');
+ StringBuffer name = new StringBuffer();
if (parameterStart < 0) {
- name.append(genericTypeSignature.substring(arrayDimension + 1, genericTypeSignature.length() - 1).replace('/', '.'));
+ name.append(genericTypeSignature.substring(arrayDimension + 1,
+ genericTypeSignature.length() - 1).replace('/', '.'));
} else {
- if(parameterStart != 0) {
- name.append(genericTypeSignature.substring(arrayDimension + 1, parameterStart).replace('/', '.'));
+ if (parameterStart != 0) {
+ name.append(genericTypeSignature.substring(arrayDimension + 1,
+ parameterStart).replace('/', '.'));
}
try {
- String sig = Signature.toString(genericTypeSignature).substring(Math.max(parameterStart - 1, 0) - arrayDimension);
+ String sig = Signature.toString(genericTypeSignature)
+ .substring(
+ Math.max(parameterStart - 1, 0)
+ - arrayDimension);
name.append(sig.replace('/', '.'));
- }
- catch(IllegalArgumentException iae) {
- //do nothing
+ } catch (IllegalArgumentException iae) {
+ // do nothing
name.append(genericTypeSignature);
}
}
- for (int i= 0; i < arrayDimension; i++) {
+ for (int i = 0; i < arrayDimension; i++) {
name.append("[]"); //$NON-NLS-1$
}
return name.toString();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
return getReferenceType().genericSignature();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getInstances(long)
*/
public IJavaObject[] getInstances(long max) throws DebugException {
try {
- List list = getReferenceType().instances(max);
+ List<ObjectReference> list = getReferenceType().instances(max);
IJavaObject[] instances = new IJavaObject[list.size()];
for (int i = 0; i < instances.length; i++) {
- instances[i] = (IJavaObject) JDIValue.createValue(getJavaDebugTarget(), (Value) list.get(i));
+ instances[i] = (IJavaObject) JDIValue.createValue(
+ getJavaDebugTarget(), list.get(i));
}
return instances;
} catch (RuntimeException e) {
@@ -305,20 +362,25 @@ public abstract class JDIReferenceType extends JDIType implements IJavaReference
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaReferenceType#getInstanceCount()
*/
public long getInstanceCount() throws DebugException {
JDIDebugTarget target = getJavaDebugTarget();
if (target.supportsInstanceRetrieval()) {
- ArrayList list = new ArrayList(2);
- list.add(getUnderlyingType());
- VirtualMachine vm = getVM();
- try {
- long[] counts = vm.instanceCounts(list);
- return counts[0];
- } catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_5, e);
+ Type type = getUnderlyingType();
+ if(type instanceof ReferenceType) {
+ ArrayList<ReferenceType> list = new ArrayList<ReferenceType>(2);
+ list.add((ReferenceType) type);
+ VirtualMachine vm = getVM();
+ try {
+ long[] counts = vm.instanceCounts(list);
+ return counts[0];
+ } catch (RuntimeException e) {
+ targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_5, e);
+ }
}
}
return -1;
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
index e3daea02d..8d774b8a1 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,19 +10,22 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IRegisterGroup;
import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.debug.core.model.IStep;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.debug.core.model.ITerminate;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdi.internal.ValueImpl;
@@ -62,12 +65,11 @@ import com.sun.jdi.VirtualMachine;
public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
/**
- * This frame's depth in the call stack (0 == bottom of stack).
- * A new frame is indicated by -2.
- * An invalid frame is indicated by -1.
+ * This frame's depth in the call stack (0 == bottom of stack). A new frame
+ * is indicated by -2. An invalid frame is indicated by -1.
*/
private int fDepth = -2;
-
+
/**
* Underlying JDI stack frame.
*/
@@ -80,35 +82,35 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
/**
* Visible variables.
*/
- private List fVariables;
+ private List<IJavaVariable> fVariables;
/**
- * The underlying Object associated with this stack frame.
- * Cached lazily on first access.
+ * The underlying Object associated with this stack frame. Cached lazily on
+ * first access.
*/
private ObjectReference fThisObject;
/**
- * The name of the type of the object that received the method call associated
- * with this stack frame. Cached lazily on first access.
+ * The name of the type of the object that received the method call
+ * associated with this stack frame. Cached lazily on first access.
*/
private String fReceivingTypeName;
/**
* Whether the variables need refreshing
*/
- private boolean fRefreshVariables= true;
+ private boolean fRefreshVariables = true;
/**
- * Whether this stack frame has been marked as out of synch. If set
- * to <code>true</code> this stack frame will stop dynamically
- * calculating its out of synch state.
+ * Whether this stack frame has been marked as out of synch. If set to
+ * <code>true</code> this stack frame will stop dynamically calculating its
+ * out of synch state.
*/
- private boolean fIsOutOfSynch= false;
-
+ private boolean fIsOutOfSynch = false;
+
/**
* Whether local variable information was available
*/
private boolean fLocalsAvailable = true;
-
+
/**
* Location of this stack frame
*/
@@ -117,26 +119,31 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
/**
* Creates a new stack frame in the given thread.
*
- * @param thread The parent JDI thread
- * @param frame underlying frame
- * @param depth depth on the stack (0 is bottom)
+ * @param thread
+ * The parent JDI thread
+ * @param frame
+ * underlying frame
+ * @param depth
+ * depth on the stack (0 is bottom)
*/
public JDIStackFrame(JDIThread thread, StackFrame frame, int depth) {
- super((JDIDebugTarget)thread.getDebugTarget());
+ super((JDIDebugTarget) thread.getDebugTarget());
setThread(thread);
bind(frame, depth);
}
-
+
/**
- * Binds this frame to the given underlying frame
- * on the target VM or returns a new frame representing the
- * given frame. A frame can only be re-bound to an underlying frame
- * if it refers to the same depth on the stack in the same method.
+ * Binds this frame to the given underlying frame on the target VM or
+ * returns a new frame representing the given frame. A frame can only be
+ * re-bound to an underlying frame if it refers to the same depth on the
+ * stack in the same method.
*
- * @param frame underlying frame, or <code>null</code>
- * @param depth depth in the call stack, or -1 to indicate the
- * frame should become invalid
- * @param return a frame to refer to the given frame or <code>null</code>
+ * @param frame
+ * underlying frame, or <code>null</code>
+ * @param depth
+ * depth in the call stack, or -1 to indicate the frame should
+ * become invalid
+ * @param return a frame to refer to the given frame or <code>null</code>
*/
protected JDIStackFrame bind(StackFrame frame, int depth) {
synchronized (fThread) {
@@ -156,8 +163,10 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
Method method = location.method();
if (method.equals(fLocation.method())) {
try {
- if (method.declaringType().defaultStratum().equals("Java") || //$NON-NLS-1$
- equals(getSourceName(location), getSourceName(fLocation))) {
+ if (method.declaringType().defaultStratum()
+ .equals("Java") || //$NON-NLS-1$
+ equals(getSourceName(location),
+ getSourceName(fLocation))) {
// TODO: what about receiving type being the same?
fStackFrame = frame;
fLocation = location;
@@ -175,7 +184,7 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
}
}
-
+
/**
* @see IStackFrame#getThread()
*/
@@ -202,7 +211,8 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
*/
public boolean canStepInto() {
try {
- return exists() && isTopStackFrame() && !isObsolete() && getThread().canStepInto();
+ return exists() && isTopStackFrame() && !isObsolete()
+ && getThread().canStepInto();
} catch (DebugException e) {
logError(e);
return false;
@@ -224,14 +234,14 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (!exists() || isObsolete() || !getThread().canStepReturn()) {
return false;
}
- List frames = ((JDIThread)getThread()).computeStackFrames();
+ List<IJavaStackFrame> frames = ((JDIThread) getThread()).computeStackFrames();
if (frames != null && !frames.isEmpty()) {
boolean bottomFrame = this.equals(frames.get(frames.size() - 1));
- boolean aboveObsoleteFrame= false;
+ boolean aboveObsoleteFrame = false;
if (!bottomFrame) {
- int index= frames.indexOf(this);
- if (index < frames.size() -1 && ((JDIStackFrame)frames.get(index + 1)).isObsolete()) {
- aboveObsoleteFrame= true;
+ int index = frames.indexOf(this);
+ if (index < frames.size() - 1 && ((JDIStackFrame) frames.get(index + 1)).isObsolete()) {
+ aboveObsoleteFrame = true;
}
}
return !bottomFrame && !aboveObsoleteFrame;
@@ -256,49 +266,59 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
* @see IStackFrame#getVariables()
*/
public IVariable[] getVariables() throws DebugException {
- List list = getVariables0();
- return (IVariable[])list.toArray(new IVariable[list.size()]);
+ List<IJavaVariable> list = getVariables0();
+ return list.toArray(new IVariable[list.size()]);
}
-
- protected List getVariables0() throws DebugException {
+
+ protected List<IJavaVariable> getVariables0() throws DebugException {
synchronized (fThread) {
if (fVariables == null) {
-
- // throw exception if native method, so variable view will update
+
+ // throw exception if native method, so variable view will
+ // update
// with information message
if (isNative()) {
- requestFailed(JDIDebugModelMessages.JDIStackFrame_Variable_information_unavailable_for_native_methods, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIStackFrame_Variable_information_unavailable_for_native_methods,
+ null);
}
-
- Method method= getUnderlyingMethod();
- fVariables= new ArrayList();
- // #isStatic() does not claim to throw any exceptions - so it is not try/catch coded
+
+ Method method = getUnderlyingMethod();
+ fVariables = new ArrayList<IJavaVariable>();
+ // #isStatic() does not claim to throw any exceptions - so it is
+ // not try/catch coded
if (method.isStatic()) {
// add statics
- List allFields= null;
+ List<Field> allFields = null;
ReferenceType declaringType = method.declaringType();
try {
- allFields= declaringType.allFields();
+ allFields = declaringType.allFields();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_fields,new String[] {e.toString()}), e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_fields,
+ e.toString()), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return Collections.EMPTY_LIST;
}
if (allFields != null) {
- Iterator fields= allFields.iterator();
+ Iterator<Field> fields = allFields.iterator();
while (fields.hasNext()) {
- Field field= (Field) fields.next();
+ Field field = fields.next();
if (field.isStatic()) {
- fVariables.add(new JDIFieldVariable((JDIDebugTarget)getDebugTarget(), field, declaringType));
+ fVariables.add(new JDIFieldVariable(
+ (JDIDebugTarget) getDebugTarget(),
+ field, declaringType));
}
}
- Collections.sort(fVariables, new Comparator() {
- public int compare(Object a, Object b) {
- JDIFieldVariable v1= (JDIFieldVariable)a;
- JDIFieldVariable v2= (JDIFieldVariable)b;
+ Collections.sort(fVariables, new Comparator<IJavaVariable>() {
+ public int compare(IJavaVariable a, IJavaVariable b) {
+ JDIFieldVariable v1 = (JDIFieldVariable) a;
+ JDIFieldVariable v2 = (JDIFieldVariable) b;
try {
- return v1.getName().compareToIgnoreCase(v2.getName());
+ return v1.getName().compareToIgnoreCase(
+ v2.getName());
} catch (DebugException de) {
logError(de);
return -1;
@@ -308,15 +328,16 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
}
} else {
// add "this"
- ObjectReference t= getUnderlyingThisObject();
+ ObjectReference t = getUnderlyingThisObject();
if (t != null) {
- fVariables.add(new JDIThisVariable((JDIDebugTarget)getDebugTarget(), t));
+ fVariables.add(new JDIThisVariable(
+ (JDIDebugTarget) getDebugTarget(), t));
}
}
// add locals
- Iterator variables= getUnderlyingVisibleVariables().iterator();
+ Iterator<LocalVariable> variables = getUnderlyingVisibleVariables().iterator();
while (variables.hasNext()) {
- LocalVariable var= (LocalVariable) variables.next();
+ LocalVariable var = variables.next();
fVariables.add(new JDILocalVariable(this, var));
}
} else if (fRefreshVariables) {
@@ -333,29 +354,34 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
public String getName() throws DebugException {
return getMethodName();
}
-
+
/**
* @see IJavaStackFrame#getArgumentTypeNames()
*/
- public List getArgumentTypeNames() throws DebugException {
+ public List<String> getArgumentTypeNames() throws DebugException {
try {
- Method underlyingMethod= getUnderlyingMethod();
- String genericSignature= underlyingMethod.genericSignature();
+ Method underlyingMethod = getUnderlyingMethod();
+ String genericSignature = underlyingMethod.genericSignature();
if (genericSignature == null) {
// no generic signature
return underlyingMethod.argumentTypeNames();
}
// generic signature
- String[] parameterTypes= Signature.getParameterTypes(genericSignature);
- List argumentTypeNames= new ArrayList();
- for (int i= 0; i < parameterTypes.length; i++) {
- argumentTypeNames.add(Signature.toString(parameterTypes[i]).replace('/', '.'));
+ String[] parameterTypes = Signature
+ .getParameterTypes(genericSignature);
+ List<String> argumentTypeNames = new ArrayList<String>();
+ for (String parameterType : parameterTypes) {
+ argumentTypeNames.add(Signature.toString(parameterType)
+ .replace('/', '.'));
}
return argumentTypeNames;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_argument_type_names, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_argument_type_names,
+ e.toString()), e);
// execution will never reach this line, as
- // #targetRequestFailed will throw an exception
+ // #targetRequestFailed will throw an exception
return null;
}
}
@@ -369,7 +395,10 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return fLocation.lineNumber();
} catch (RuntimeException e) {
if (getThread().isSuspended()) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_line_number, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_line_number,
+ e.toString()), e);
}
}
}
@@ -417,7 +446,7 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (isTopStackFrame()) {
getThread().stepOver();
} else {
- ((JDIThread)getThread()).stepToFrame(this);
+ ((JDIThread) getThread()).stepToFrame(this);
}
}
@@ -431,11 +460,11 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (isTopStackFrame()) {
getThread().stepReturn();
} else {
- List frames = ((JDIThread)getThread()).computeStackFrames();
+ List<IJavaStackFrame> frames = ((JDIThread) getThread()).computeStackFrames();
int index = frames.indexOf(this);
if (index >= 0 && index < frames.size() - 1) {
- IStackFrame nextFrame = (IStackFrame)frames.get(index + 1);
- ((JDIThread)getThread()).stepToFrame(nextFrame);
+ IStackFrame nextFrame = frames.get(index + 1);
+ ((JDIThread) getThread()).stepToFrame(nextFrame);
}
}
}
@@ -457,61 +486,70 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return;
}
- Method method= getUnderlyingMethod();
- int index= 0;
+ Method method = getUnderlyingMethod();
+ int index = 0;
if (!method.isStatic()) {
// update "this"
ObjectReference thisObject;
- thisObject= getUnderlyingThisObject();
- JDIThisVariable oldThisObject= null;
- if (!fVariables.isEmpty() && fVariables.get(0) instanceof JDIThisVariable) {
- oldThisObject= (JDIThisVariable) fVariables.get(0);
+ thisObject = getUnderlyingThisObject();
+ JDIThisVariable oldThisObject = null;
+ if (!fVariables.isEmpty()
+ && fVariables.get(0) instanceof JDIThisVariable) {
+ oldThisObject = (JDIThisVariable) fVariables.get(0);
}
if (thisObject == null && oldThisObject != null) {
// removal of 'this'
fVariables.remove(0);
- index= 0;
+ index = 0;
} else {
if (oldThisObject == null && thisObject != null) {
// creation of 'this'
- oldThisObject= new JDIThisVariable((JDIDebugTarget)getDebugTarget(),thisObject);
+ oldThisObject = new JDIThisVariable(
+ (JDIDebugTarget) getDebugTarget(), thisObject);
fVariables.add(0, oldThisObject);
- index= 1;
+ index = 1;
} else {
if (oldThisObject != null) {
- // 'this' still exists, replace with new 'this' if a different receiver
+ // 'this' still exists, replace with new 'this' if a
+ // different receiver
if (!oldThisObject.retrieveValue().equals(thisObject)) {
fVariables.remove(0);
- fVariables.add(0, new JDIThisVariable((JDIDebugTarget)getDebugTarget(),thisObject));
+ fVariables.add(0, new JDIThisVariable(
+ (JDIDebugTarget) getDebugTarget(),
+ thisObject));
}
- index= 1;
+ index = 1;
}
}
}
}
- List locals= null;
+ List<LocalVariable> locals = null;
try {
- locals= getUnderlyingStackFrame().visibleVariables();
+ locals = getUnderlyingStackFrame().visibleVariables();
} catch (AbsentInformationException e) {
- locals= Collections.EMPTY_LIST;
+ locals = Collections.EMPTY_LIST;
} catch (NativeMethodException e) {
- locals= Collections.EMPTY_LIST;
+ locals = Collections.EMPTY_LIST;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_visible_variables,new String[] {e.toString()}), e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_visible_variables,
+ e.toString()), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return;
}
- int localIndex= -1;
+ int localIndex = -1;
while (index < fVariables.size()) {
- Object var= fVariables.get(index);
+ Object var = fVariables.get(index);
if (var instanceof JDILocalVariable) {
- JDILocalVariable local= (JDILocalVariable) fVariables.get(index);
- localIndex= locals.indexOf(local.getLocal());
+ JDILocalVariable local = (JDILocalVariable) fVariables
+ .get(index);
+ localIndex = locals.indexOf(local.getLocal());
if (localIndex >= 0) {
// update variable with new underling JDI LocalVariable
- local.setLocal((LocalVariable) locals.get(localIndex));
+ local.setLocal(locals.get(localIndex));
locals.remove(localIndex);
index++;
} else {
@@ -519,65 +557,67 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
fVariables.remove(index);
}
} else {
- //field variable of a static frame
+ // field variable of a static frame
index++;
}
}
// add any new locals
- Iterator newOnes= locals.iterator();
+ Iterator<LocalVariable> newOnes = locals.iterator();
while (newOnes.hasNext()) {
- JDILocalVariable local= new JDILocalVariable(this, (LocalVariable) newOnes.next());
+ JDILocalVariable local = new JDILocalVariable(this, newOnes.next());
fVariables.add(local);
}
}
-
- /**
- * @see org.eclipse.debug.core.model.IDropToFrame#canDropToFrame()
- */
- public boolean canDropToFrame() {
- return supportsDropToFrame();
- }
+
+ /**
+ * @see org.eclipse.debug.core.model.IDropToFrame#canDropToFrame()
+ */
+ public boolean canDropToFrame() {
+ return supportsDropToFrame();
+ }
/**
* @see IJavaStackFrame#supportsDropToFrame()
*/
public boolean supportsDropToFrame() {
- JDIThread thread= (JDIThread) getThread();
- JDIDebugTarget target= (JDIDebugTarget)thread.getDebugTarget();
+ JDIThread thread = (JDIThread) getThread();
+ JDIDebugTarget target = (JDIDebugTarget) thread.getDebugTarget();
try {
- if (!target.isAvailable() || !thread.isSuspended() || thread.isTerminated() ||
- thread.isInvokingMethod()) {
+ if (!target.isAvailable() || !thread.isSuspended()
+ || thread.isTerminated() || thread.isInvokingMethod()) {
return false;
- }
- boolean j9Support= false;
- boolean jdkSupport= target.canPopFrames();
+ }
+ boolean j9Support = false;
+ boolean jdkSupport = target.canPopFrames();
VirtualMachine vm = getVM();
if (vm == null) {
return false;
}
try {
- j9Support= (thread.getUnderlyingThread() instanceof org.eclipse.jdi.hcr.ThreadReference) &&
- ((org.eclipse.jdi.hcr.VirtualMachine)vm).canDoReturn();
+ j9Support = (thread.getUnderlyingThread() instanceof org.eclipse.jdi.hcr.ThreadReference)
+ && ((org.eclipse.jdi.hcr.VirtualMachine) vm)
+ .canDoReturn();
} catch (UnsupportedOperationException uoe) {
- j9Support= false;
+ j9Support = false;
}
-
+
if (jdkSupport || j9Support) {
// Also ensure that this frame and no frames above this
// frame are native. Unable to pop native stack frames.
- List frames= thread.computeStackFrames();
+ List<IJavaStackFrame> frames = thread.computeStackFrames();
if (jdkSupport) {
// JDK 1.4 VMs are currently unable to pop the bottom
// stack frame.
- if ((frames.size() > 0) && frames.get(frames.size() - 1) == this) {
+ if ((frames.size() > 0)
+ && frames.get(frames.size() - 1) == this) {
return false;
}
}
int index = 0;
- JDIStackFrame frame= null;
+ JDIStackFrame frame = null;
while (index < frames.size()) {
- frame= (JDIStackFrame) frames.get(index);
+ frame = (JDIStackFrame) frames.get(index);
index++;
if (frame.isNative()) {
return false;
@@ -586,7 +626,9 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (jdkSupport) {
// JDK 1.4 VMs are currently unable to pop the
// frame directly above a native frame
- if (index < frames.size() && ((JDIStackFrame)frames.get(index)).isNative()) {
+ if (index < frames.size()
+ && ((JDIStackFrame) frames.get(index))
+ .isNative()) {
return false;
}
}
@@ -596,7 +638,8 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
}
return false;
} catch (DebugException e) {
- if (e.getStatus().getException() instanceof IncompatibleThreadStateException || e.getStatus().getCode() == IJavaThread.ERR_THREAD_NOT_SUSPENDED) {
+ if (e.getStatus().getException() instanceof IncompatibleThreadStateException
+ || e.getStatus().getCode() == IJavaThread.ERR_THREAD_NOT_SUSPENDED) {
// if the thread has since resumed, drop is not supported
return false;
}
@@ -618,7 +661,7 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (supportsDropToFrame()) {
((JDIThread) getThread()).dropToFrame(this);
} else {
- notSupported(JDIDebugModelMessages.JDIStackFrame_Drop_to_frame_not_supported);
+ notSupported(JDIDebugModelMessages.JDIStackFrame_Drop_to_frame_not_supported);
}
}
@@ -626,7 +669,7 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (supportsDropToFrame()) {
((JDIThread) getThread()).popFrame(this);
} else {
- notSupported(JDIDebugModelMessages.JDIStackFrame_pop_frame_not_supported);
+ notSupported(JDIDebugModelMessages.JDIStackFrame_pop_frame_not_supported);
}
}
@@ -638,22 +681,22 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return null;
}
IVariable[] variables = getVariables();
- IJavaVariable thisVariable= null;
- for (int i = 0; i < variables.length; i++) {
- IJavaVariable var = (IJavaVariable) variables[i];
+ IJavaVariable thisVariable = null;
+ for (IVariable variable : variables) {
+ IJavaVariable var = (IJavaVariable) variable;
if (var.getName().equals(varName)) {
return var;
}
if (var instanceof JDIThisVariable) {
// save for later - check for instance and static variables
- thisVariable= var;
+ thisVariable = var;
}
}
if (thisVariable != null) {
IVariable[] thisChildren = thisVariable.getValue().getVariables();
- for (int i = 0; i < thisChildren.length; i++) {
- IJavaVariable var= (IJavaVariable) thisChildren[i];
+ for (IVariable element : thisChildren) {
+ IJavaVariable var = (IJavaVariable) element;
if (var.getName().equals(varName)) {
return var;
}
@@ -665,31 +708,33 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
}
/**
- * Retrieves visible variables in this stack frame
- * handling any exceptions. Returns an empty list if there are no
- * variables.
+ * Retrieves visible variables in this stack frame handling any exceptions.
+ * Returns an empty list if there are no variables.
*
* @see JDIDebugElement#targetRequestFailed(String, RuntimeException)
*/
- protected List getUnderlyingVisibleVariables() throws DebugException {
+ protected List<LocalVariable> getUnderlyingVisibleVariables() throws DebugException {
synchronized (fThread) {
- List variables= Collections.EMPTY_LIST;
+ List<LocalVariable> variables = Collections.EMPTY_LIST;
try {
- variables= getUnderlyingStackFrame().visibleVariables();
+ variables = getUnderlyingStackFrame().visibleVariables();
} catch (AbsentInformationException e) {
setLocalsAvailable(false);
} catch (NativeMethodException e) {
setLocalsAvailable(false);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_visible_variables_2,new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_visible_variables_2,
+ e.toString()), e);
}
return variables;
}
}
/**
- * Retrieves 'this' from the underlying stack frame.
- * Returns <code>null</code> for static stack frames.
+ * Retrieves 'this' from the underlying stack frame. Returns
+ * <code>null</code> for static stack frames.
*
* @see JDIDebugElement#targetRequestFailed(String, RuntimeException)
*/
@@ -699,26 +744,30 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
try {
fThisObject = getUnderlyingStackFrame().thisObject();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_this,new String[] {e.toString()}), e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_this,
+ e.toString()), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return null;
}
}
return fThisObject;
}
}
-
+
/**
* @see IAdaptable#getAdapter(Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == IJavaStackFrame.class || adapter == IJavaModifiers.class) {
return this;
}
return super.getAdapter(adapter);
}
-
+
/**
* @see IJavaStackFrame#getSignature()
*/
@@ -726,13 +775,16 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
try {
return getUnderlyingMethod().signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_method_signature, new String[] {e.toString()}), e);
- // execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_method_signature,
+ e.toString()), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will throw an exception
return null;
}
}
-
+
/**
* @see IJavaStackFrame#getDeclaringTypeName()
*/
@@ -740,18 +792,22 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
synchronized (fThread) {
try {
if (isObsolete()) {
- return JDIDebugModelMessages.JDIStackFrame__unknown_declaring_type__1;
+ return JDIDebugModelMessages.JDIStackFrame__unknown_declaring_type__1;
}
- return JDIReferenceType.getGenericName(getUnderlyingMethod().declaringType());
+ return JDIReferenceType.getGenericName(getUnderlyingMethod()
+ .declaringType());
} catch (RuntimeException e) {
if (getThread().isSuspended()) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_declaring_type, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_declaring_type,
+ e.toString()), e);
}
- return JDIDebugModelMessages.JDIStackFrame__unknown_declaring_type__1;
+ return JDIDebugModelMessages.JDIStackFrame__unknown_declaring_type__1;
}
}
}
-
+
/**
* @see IJavaStackFrame#getReceivingTypeName()
*/
@@ -759,128 +815,135 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (fStackFrame == null || fReceivingTypeName == null) {
try {
if (isObsolete()) {
- fReceivingTypeName=JDIDebugModelMessages.JDIStackFrame__unknown_receiving_type__2;
+ fReceivingTypeName = JDIDebugModelMessages.JDIStackFrame__unknown_receiving_type__2;
} else {
ObjectReference thisObject = getUnderlyingThisObject();
if (thisObject == null) {
fReceivingTypeName = getDeclaringTypeName();
} else {
- fReceivingTypeName = JDIReferenceType.getGenericName(thisObject.referenceType());
+ fReceivingTypeName = JDIReferenceType
+ .getGenericName(thisObject.referenceType());
}
}
} catch (RuntimeException e) {
if (getThread().isSuspended()) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_receiving_type, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_receiving_type,
+ e.toString()), e);
}
- return JDIDebugModelMessages.JDIStackFrame__unknown_receiving_type__2;
+ return JDIDebugModelMessages.JDIStackFrame__unknown_receiving_type__2;
}
}
return fReceivingTypeName;
}
-
+
/**
* @see IJavaStackFrame#getMethodName()
*/
public String getMethodName() throws DebugException {
try {
- return getUnderlyingMethod().name();
+ return getUnderlyingMethod().name();
} catch (RuntimeException e) {
if (getThread().isSuspended()) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_method_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_method_name,
+ e.toString()), e);
}
- return JDIDebugModelMessages.JDIStackFrame__unknown_method__1;
+ return JDIDebugModelMessages.JDIStackFrame__unknown_method__1;
}
}
-
+
/**
* @see IJavaStackFrame#isNative()
*/
public boolean isNative() throws DebugException {
return getUnderlyingMethod().isNative();
}
-
+
/**
* @see IJavaStackFrame#isConstructor()
*/
public boolean isConstructor() throws DebugException {
return getUnderlyingMethod().isConstructor();
}
-
+
/**
* @see IJavaStackFrame#isStaticInitializer()
*/
public boolean isStaticInitializer() throws DebugException {
return getUnderlyingMethod().isStaticInitializer();
}
-
+
/**
* @see IJavaModifiers#isFinal()
*/
public boolean isFinal() throws DebugException {
return getUnderlyingMethod().isFinal();
}
-
+
/**
* @see IJavaStackFrame#isSynchronized()
*/
public boolean isSynchronized() throws DebugException {
return getUnderlyingMethod().isSynchronized();
}
-
+
/**
* @see IJavaModifiers#isSynthetic()
*/
public boolean isSynthetic() throws DebugException {
return getUnderlyingMethod().isSynthetic();
}
-
+
/**
* @see IJavaModifiers#isPublic()
*/
public boolean isPublic() throws DebugException {
return getUnderlyingMethod().isPublic();
}
-
+
/**
* @see IJavaModifiers#isPrivate()
*/
public boolean isPrivate() throws DebugException {
return getUnderlyingMethod().isPrivate();
}
-
+
/**
* @see IJavaModifiers#isProtected()
*/
public boolean isProtected() throws DebugException {
return getUnderlyingMethod().isProtected();
}
-
+
/**
* @see IJavaModifiers#isPackagePrivate()
*/
public boolean isPackagePrivate() throws DebugException {
return getUnderlyingMethod().isPackagePrivate();
}
-
+
/**
* @see IJavaModifiers#isStatic()
*/
public boolean isStatic() throws DebugException {
return getUnderlyingMethod().isStatic();
}
-
+
/**
* @see IJavaStackFrame#getSourceName()
*/
public String getSourceName() throws DebugException {
synchronized (fThread) {
- return getSourceName(fLocation);
+ return getSourceName(fLocation);
}
}
-
+
/**
- * Returns the source from the default stratum of the given location
- * or <code>null</code> if not available (missing attribute).
+ * Returns the source from the default stratum of the given location or
+ * <code>null</code> if not available (missing attribute).
*/
private String getSourceName(Location location) throws DebugException {
try {
@@ -890,11 +953,14 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
} catch (NativeMethodException e) {
return null;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_name,
+ e.toString()), e);
}
return null;
- }
-
+ }
+
private boolean equals(Object o1, Object o2) {
if (o1 == null) {
return o2 == null;
@@ -902,21 +968,21 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return o1.equals(o2);
}
}
-
+
protected boolean isTopStackFrame() throws DebugException {
IStackFrame tos = getThread().getTopStackFrame();
return tos != null && tos.equals(this);
}
-
+
/**
- * Sets this stack frame to be out of synch.
- * Note that passing <code>true</code> to this method
- * marks this stack frame as out of synch permanently (statically).
+ * Sets this stack frame to be out of synch. Note that passing
+ * <code>true</code> to this method marks this stack frame as out of synch
+ * permanently (statically).
*/
public void setOutOfSynch(boolean outOfSynch) {
- fIsOutOfSynch= outOfSynch;
+ fIsOutOfSynch = outOfSynch;
}
-
+
/**
* @see IJavaStackFrame#isOutOfSynch()
*/
@@ -927,19 +993,22 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
// if this frame's thread is not suspended, the out-of-synch info cannot
// change until it suspends again
if (getThread().isSuspended()) {
- JDIDebugTarget target= (JDIDebugTarget)getDebugTarget();
- if (target.hasHCROccurred() && target.isOutOfSynch(getUnderlyingMethod().declaringType().name())) {
+ JDIDebugTarget target = (JDIDebugTarget) getDebugTarget();
+ if (target.hasHCROccurred()
+ && target.isOutOfSynch(getUnderlyingMethod()
+ .declaringType().name())) {
return true;
}
}
return false;
}
-
+
/**
* @see IJavaStackFrame#isObsolete()
*/
public boolean isObsolete() {
- if (!JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] {1,4}) || !((JDIDebugTarget)getDebugTarget()).hasHCROccurred()) {
+ if (!JDIDebugPlugin.isJdiVersionGreaterThanOrEqual(new int[] { 1, 4 })
+ || !((JDIDebugTarget) getDebugTarget()).hasHCROccurred()) {
// If no hot code replace has occurred, this frame
// cannot be obsolete.
return false;
@@ -953,18 +1022,19 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return false;
}
}
-
+
protected boolean exists() {
synchronized (fThread) {
return fDepth != -1;
}
}
-
+
/**
* @see ITerminate#canTerminate()
*/
public boolean canTerminate() {
- return exists() && getThread().canTerminate() || getDebugTarget().canTerminate();
+ return exists() && getThread().canTerminate()
+ || getDebugTarget().canTerminate();
}
/**
@@ -984,41 +1054,51 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
getDebugTarget().terminate();
}
}
-
+
/**
* Returns this stack frame's underlying JDI frame.
*
- * @exception DebugException if this stack frame does
- * not currently have an underlying frame (is in an
- * interim state where this frame's thread has been
- * resumed, and is not yet suspended).
+ * @exception DebugException
+ * if this stack frame does not currently have an underlying
+ * frame (is in an interim state where this frame's thread
+ * has been resumed, and is not yet suspended).
*/
protected StackFrame getUnderlyingStackFrame() throws DebugException {
synchronized (fThread) {
if (fStackFrame == null) {
if (fDepth == -1) {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IJavaStackFrame.ERR_INVALID_STACK_FRAME, JDIDebugModelMessages.JDIStackFrame_25, null));
+ throw new DebugException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IJavaStackFrame.ERR_INVALID_STACK_FRAME,
+ JDIDebugModelMessages.JDIStackFrame_25, null));
}
if (fThread.isSuspended()) {
// re-index stack frames - See Bug 47198
fThread.computeStackFrames();
if (fDepth == -1) {
// If depth is -1, then this is an invalid frame
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IJavaStackFrame.ERR_INVALID_STACK_FRAME, JDIDebugModelMessages.JDIStackFrame_25, null));
+ throw new DebugException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IJavaStackFrame.ERR_INVALID_STACK_FRAME,
+ JDIDebugModelMessages.JDIStackFrame_25, null));
}
} else {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IJavaThread.ERR_THREAD_NOT_SUSPENDED, JDIDebugModelMessages.JDIStackFrame_25, null));
+ throw new DebugException(new Status(IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ IJavaThread.ERR_THREAD_NOT_SUSPENDED,
+ JDIDebugModelMessages.JDIStackFrame_25, null));
}
}
return fStackFrame;
}
}
-
+
/**
- * Sets the underlying JDI StackFrame. Called by a thread
- * when incrementally updating after a step has completed.
+ * Sets the underlying JDI StackFrame. Called by a thread when incrementally
+ * updating after a step has completed.
*
- * @param frame The underlying stack frame
+ * @param frame
+ * The underlying stack frame
*/
protected void setUnderlyingStackFrame(StackFrame frame) {
synchronized (fThread) {
@@ -1028,23 +1108,23 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
}
}
}
-
+
protected void setThread(JDIThread thread) {
fThread = thread;
}
- protected void setVariables(List variables) {
+ protected void setVariables(List<IJavaVariable> variables) {
fVariables = variables;
}
-
+
/**
* @see IJavaStackFrame#getLocalVariables()
*/
public IJavaVariable[] getLocalVariables() throws DebugException {
- List list = getUnderlyingVisibleVariables();
+ List<LocalVariable> list = getUnderlyingVisibleVariables();
IJavaVariable[] locals = new IJavaVariable[list.size()];
for (int i = 0; i < list.size(); i++) {
- locals[i] = new JDILocalVariable(this, (LocalVariable)list.get(i));
+ locals[i] = new JDILocalVariable(this, list.get(i));
}
return locals;
}
@@ -1057,7 +1137,8 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (!isStatic()) {
ObjectReference thisObject = getUnderlyingThisObject();
if (thisObject != null) {
- receiver = (IJavaObject)JDIValue.createValue((JDIDebugTarget)getDebugTarget(), thisObject);
+ receiver = (IJavaObject) JDIValue.createValue(
+ (JDIDebugTarget) getDebugTarget(), thisObject);
}
}
return receiver;
@@ -1080,28 +1161,38 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
try {
Type type = method.declaringType();
if (type instanceof ClassType) {
- return (IJavaClassType)JDIType.createType((JDIDebugTarget)getDebugTarget(), type);
+ return (IJavaClassType) JDIType.createType(
+ (JDIDebugTarget) getDebugTarget(), type);
}
targetRequestFailed(JDIDebugModelMessages.JDIStackFrame_0, null);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retreiving_declaring_type, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retreiving_declaring_type,
+ e.toString()), e);
}
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaStackFrame#getReferenceType()
*/
public IJavaReferenceType getReferenceType() throws DebugException {
Method method = getUnderlyingMethod();
try {
Type type = method.declaringType();
- return (IJavaReferenceType)JDIType.createType((JDIDebugTarget)getDebugTarget(), type);
+ return (IJavaReferenceType) JDIType.createType(
+ (JDIDebugTarget) getDebugTarget(), type);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retreiving_declaring_type, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retreiving_declaring_type,
+ e.toString()), e);
}
return null;
- }
+ }
/**
* Expression level stepping not supported.
@@ -1122,36 +1213,36 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
}
/**
- * Clears the cached data of this stack frame.
- * The underlying stack frame has changed in such a way
- * that the cached data may not be valid.
+ * Clears the cached data of this stack frame. The underlying stack frame
+ * has changed in such a way that the cached data may not be valid.
*/
private void clearCachedData() {
- fThisObject= null;
- fReceivingTypeName= null;
+ fThisObject = null;
+ fReceivingTypeName = null;
}
-
+
/**
* @see IJavaStackFrame#wereLocalsAvailable()
*/
public boolean wereLocalsAvailable() {
return fLocalsAvailable;
}
-
+
/**
- * Sets whether locals were available. If the setting is
- * not the same as the current value, a change event is
- * fired such that a UI client can update.
+ * Sets whether locals were available. If the setting is not the same as the
+ * current value, a change event is fired such that a UI client can update.
*
- * @param available whether local variable information is
- * available for this stack frame.
+ * @param available
+ * whether local variable information is available for this stack
+ * frame.
*/
private void setLocalsAvailable(boolean available) {
if (available != fLocalsAvailable) {
fLocalsAvailable = available;
fireChangeEvent(DebugEvent.STATE);
}
- }
+ }
+
/**
* @see IStackFrame#hasRegisterGroups()
*/
@@ -1181,7 +1272,7 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
* @see org.eclipse.debug.core.model.IFilteredStep#stepWithFilters()
*/
public void stepWithFilters() throws DebugException {
- ((IJavaThread)getThread()).stepWithFilters();
+ ((IJavaThread) getThread()).stepWithFilters();
}
/**
@@ -1193,12 +1284,15 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return fLocation.sourcePath(stratum);
} catch (AbsentInformationException e) {
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_path, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_path,
+ e.toString()), e);
}
}
return null;
}
-
+
/**
* @see org.eclipse.jdt.debug.core.IJavaStackFrame#getSourcePath()
*/
@@ -1208,14 +1302,19 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return fLocation.sourcePath();
} catch (AbsentInformationException e) {
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_path, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_path,
+ e.toString()), e);
}
}
return null;
- }
+ }
/*
- * @see org.eclipse.jdt.debug.core.IJavaStackFrame#getLineNumber(java.lang.String)
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaStackFrame#getLineNumber(java.lang.String
+ * )
*/
public int getLineNumber(String stratum) throws DebugException {
synchronized (fThread) {
@@ -1223,7 +1322,10 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return fLocation.lineNumber(stratum);
} catch (RuntimeException e) {
if (getThread().isSuspended()) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_line_number, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_line_number,
+ e.toString()), e);
}
}
}
@@ -1231,7 +1333,9 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
}
/*
- * @see org.eclipse.jdt.debug.core.IJavaStackFrame#getSourceName(java.lang.String)
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaStackFrame#getSourceName(java.lang.String
+ * )
*/
public String getSourceName(String stratum) throws DebugException {
synchronized (fThread) {
@@ -1240,20 +1344,27 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
} catch (AbsentInformationException e) {
} catch (NativeMethodException e) {
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_name,
+ e.toString()), e);
}
}
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaStackFrame#isVarargs()
*/
public boolean isVarArgs() throws DebugException {
return getUnderlyingMethod().isVarArgs();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaStackFrame#canForceReturn()
*/
public boolean canForceReturn() {
@@ -1263,10 +1374,11 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
if (isTopStackFrame()) {
return true;
} else {
- List frames= fThread.computeStackFrames();
+ List<IJavaStackFrame> frames = fThread.computeStackFrames();
int index = frames.indexOf(this);
if (index > 0) {
- JDIStackFrame prev = (JDIStackFrame) frames.get(index - 1);
+ JDIStackFrame prev = (JDIStackFrame) frames
+ .get(index - 1);
return prev.canDropToFrame();
}
}
@@ -1277,8 +1389,12 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaStackFrame#forceReturn(org.eclipse.jdt.debug.core.IJavaValue)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaStackFrame#forceReturn(org.eclipse.jdt
+ * .debug.core.IJavaValue)
*/
public void forceReturn(IJavaValue value) throws DebugException {
if (isTopStackFrame()) {
@@ -1287,13 +1403,15 @@ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame {
// first check assignment compatible
Method method = getUnderlyingMethod();
try {
- ValueImpl.checkValue(((JDIValue)value).getUnderlyingValue(), method.returnType(), (VirtualMachineImpl) method.virtualMachine());
+ ValueImpl.checkValue(((JDIValue) value).getUnderlyingValue(),
+ method.returnType(),
+ (VirtualMachineImpl) method.virtualMachine());
} catch (InvalidTypeException e) {
targetRequestFailed(JDIDebugModelMessages.JDIStackFrame_26, e);
} catch (ClassNotLoadedException e) {
targetRequestFailed(JDIDebugModelMessages.JDIThread_48, e);
}
- List frames= fThread.computeStackFrames();
+ List<IJavaStackFrame> frames = fThread.computeStackFrames();
int index = frames.indexOf(this);
if (index > 0) {
JDIStackFrame prev = (JDIStackFrame) frames.get(index - 1);
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThisVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThisVariable.java
index a81a6b00f..03e96fb7d 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThisVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThisVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,38 +10,38 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.jdt.debug.core.IJavaVariable;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.Type;
import com.sun.jdi.Value;
-
/**
* Represents the receiver in a stack frame.
*/
public class JDIThisVariable extends JDIVariable {
/**
- * The wrappered object
+ * The wrapped object
*/
private ObjectReference fObject;
-
+
/**
* Constructs a variable representing 'this' in a stack frame.
*/
public JDIThisVariable(JDIDebugTarget target, ObjectReference object) {
super(target);
- fObject= object;
+ fObject = object;
}
/**
* Returns this variable's current Value.
*/
+ @Override
protected Value retrieveValue() {
return fObject;
}
@@ -52,7 +52,7 @@ public class JDIThisVariable extends JDIVariable {
public String getName() {
return "this"; //$NON-NLS-1$
}
-
+
/**
* @see IJavaVariable#getSignature()
*/
@@ -60,14 +60,19 @@ public class JDIThisVariable extends JDIVariable {
try {
return retrieveValue().type().signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThisVariableexception_retrieving_type_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThisVariableexception_retrieving_type_signature,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
- return null;
+ return null;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaVariable#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
@@ -81,51 +86,64 @@ public class JDIThisVariable extends JDIVariable {
try {
return getValue().getReferenceTypeName();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThisVariableexception_retrieving_reference_type_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThisVariableexception_retrieving_reference_type_name,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
- return null;
+ return null;
}
}
-
+
/**
* @see JDIVariable#getUnderlyingType()
*/
+ @Override
protected Type getUnderlyingType() throws DebugException {
try {
return retrieveValue().type();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThisVariable_exception_while_retrieving_type_this, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThisVariable_exception_while_retrieving_type_this,
+ e.toString()), e);
}
- // this line will not be exceucted as an exception
+ // this line will not be executed as an exception
// will be throw in type retrieval fails
return null;
- }
-
+ }
+
/**
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isPrivate()
*/
+ @Override
public boolean isPrivate() throws DebugException {
try {
- return ((ReferenceType)getUnderlyingType()).isPrivate();
+ return ((ReferenceType) getUnderlyingType()).isPrivate();
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIThisVariable_Exception_occurred_while_retrieving_modifiers__1, e);
+ targetRequestFailed(
+ JDIDebugModelMessages.JDIThisVariable_Exception_occurred_while_retrieving_modifiers__1,
+ e);
}
- // this line will not be exceucted as an exception
- // will be throw
+ // this line will not be executed as an exception
+ // will be throw
return false;
}
/**
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isProtected()
*/
+ @Override
public boolean isProtected() throws DebugException {
try {
- return ((ReferenceType)getUnderlyingType()).isProtected();
+ return ((ReferenceType) getUnderlyingType()).isProtected();
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIThisVariable_Exception_occurred_while_retrieving_modifiers__1, e);
- }
- // this line will not be exceucted as an exception
+ targetRequestFailed(
+ JDIDebugModelMessages.JDIThisVariable_Exception_occurred_while_retrieving_modifiers__1,
+ e);
+ }
+ // this line will not be executed as an exception
// will be throw
return false;
}
@@ -133,23 +151,27 @@ public class JDIThisVariable extends JDIVariable {
/**
* @see org.eclipse.jdt.debug.core.IJavaModifiers#isPublic()
*/
+ @Override
public boolean isPublic() throws DebugException {
try {
- return ((ReferenceType)getUnderlyingType()).isPublic();
+ return ((ReferenceType) getUnderlyingType()).isPublic();
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIThisVariable_Exception_occurred_while_retrieving_modifiers__1, e);
- }
- // this line will not be exceucted as an exception
- // will be throw
+ targetRequestFailed(
+ JDIDebugModelMessages.JDIThisVariable_Exception_occurred_while_retrieving_modifiers__1,
+ e);
+ }
+ // this line will not be executed as an exception
+ // will be throw
return false;
}
/**
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object o) {
if (o instanceof JDIThisVariable) {
- return ((JDIThisVariable)o).fObject.equals(fObject);
+ return ((JDIThisVariable) o).fObject.equals(fObject);
}
return false;
}
@@ -157,6 +179,7 @@ public class JDIThisVariable extends JDIVariable {
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return fObject.hashCode();
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
index 34663f0bb..6b3a48727 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
@@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -24,6 +23,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
@@ -81,36 +81,36 @@ import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.StepRequest;
-/**
- * Model thread implementation for an underlying
- * thread on a VM.
+/**
+ * Model thread implementation for an underlying thread on a VM.
*/
public class JDIThread extends JDIDebugElement implements IJavaThread {
-
+
/**
- * Constant for the name of the default Java stratum
+ * Constant for the name of the default Java stratum
*/
private static final String JAVA_STRATUM_CONSTANT = "Java"; //$NON-NLS-1$
-
+
/**
* Constant for the name of the main thread group.
*/
private static final String MAIN_THREAD_GROUP = "main"; //$NON-NLS-1$
-
+
/**
* @since 3.5
*/
public static final int RESUME_QUIET = 500;
-
+
/**
* @since 3.5
*/
public static final int SUSPEND_QUIET = 501;
-
+
/**
- * Status code indicating that a request to suspend this thread has timed out
+ * Status code indicating that a request to suspend this thread has timed
+ * out
*/
- public static final int SUSPEND_TIMEOUT= 161;
+ public static final int SUSPEND_TIMEOUT = 161;
/**
* Underlying thread.
*/
@@ -122,7 +122,7 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
/**
* Collection of stack frames
*/
- private List fStackFrames;
+ private List<IJavaStackFrame> fStackFrames;
/**
* Underlying thread group, cached on first access.
*/
@@ -132,16 +132,15 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
*/
private String fThreadGroupName;
/**
- * Whether children need to be refreshed. Set to
- * <code>true</code> when stack frames are re-used
- * on the next suspend.
+ * Whether children need to be refreshed. Set to <code>true</code> when
+ * stack frames are re-used on the next suspend.
*/
private boolean fRefreshChildren = true;
/**
- * Currently pending step handler, <code>null</code>
- * when not performing a step.
+ * Currently pending step handler, <code>null</code> when not performing a
+ * step.
*/
- private StepHandler fStepHandler= null;
+ private StepHandler fStepHandler = null;
/**
* Whether running.
*/
@@ -155,74 +154,73 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
* Whether this thread is a system thread.
*/
private boolean fIsSystemThread;
-
+
/**
* Whether this thread is a daemon thread
+ *
* @since 3.3
*/
private boolean fIsDaemon = false;
-
+
/**
- * The collection of breakpoints that caused the last suspend, or
- * an empty collection if the thread is not suspended or was not
- * suspended by any breakpoint(s).
+ * The collection of breakpoints that caused the last suspend, or an empty
+ * collection if the thread is not suspended or was not suspended by any
+ * breakpoint(s).
*/
- private List fCurrentBreakpoints = new ArrayList(2);
+ private List<IBreakpoint> fCurrentBreakpoints = new ArrayList<IBreakpoint>(2);
/**
- * Non-null when this thread is executing an evaluation runnable.
- * An evaluation may involve a series of method invocations.
+ * Non-null when this thread is executing an evaluation runnable. An
+ * evaluation may involve a series of method invocations.
*/
private IEvaluationRunnable fEvaluationRunnable = null;
-
+
/**
- * Whether this thread was manually suspended during an
- * evaluation.
+ * Whether this thread was manually suspended during an evaluation.
*/
private boolean fEvaluationInterrupted = false;
-
+
/**
- * <code>true</code> when there has been a request to suspend
- * this thread via {@link #suspend()}. Remains <code>true</code> until
- * there is a request to resume this thread via {@link #resume()}.
+ * <code>true</code> when there has been a request to suspend this thread
+ * via {@link #suspend()}. Remains <code>true</code> until there is a
+ * request to resume this thread via {@link #resume()}.
*/
private boolean fClientSuspendRequest = false;
-
+
/**
- * Whether this thread is currently invoking a method.
- * Nested method invocations cannot be performed.
+ * Whether this thread is currently invoking a method. Nested method
+ * invocations cannot be performed.
*/
private boolean fIsInvokingMethod = false;
-
+
/**
* Lock used to wait for method invocations to complete.
*/
private Object fInvocationLock = new Object();
-
+
/**
* Lock used to wait for evaluations to complete.
*/
private Object fEvaluationLock = new Object();
-
+
/**
- * Whether or not this thread is currently honoring
- * breakpoints. This flag allows breakpoints to be
- * disabled during evaluations.
+ * Whether or not this thread is currently honoring breakpoints. This flag
+ * allows breakpoints to be disabled during evaluations.
*/
- private boolean fHonorBreakpoints= true;
-
+ private boolean fHonorBreakpoints = true;
+
/**
- * Whether a suspend vote is currently in progress. While voting
- * this thread does not allow other breakpoints to be hit.
+ * Whether a suspend vote is currently in progress. While voting this thread
+ * does not allow other breakpoints to be hit.
*
* @since 3.5
*/
private boolean fSuspendVoteInProgress = false;
-
+
/**
- * The kind of step that was originally requested. Zero or
- * more 'secondary steps' may be performed programmatically after
- * the original user-requested step, and this field tracks the
- * type (step into, over, return) of the original step.
+ * The kind of step that was originally requested. Zero or more 'secondary
+ * steps' may be performed programmatically after the original
+ * user-requested step, and this field tracks the type (step into, over,
+ * return) of the original step.
*/
private int fOriginalStepKind;
/**
@@ -230,72 +228,79 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
*/
private Location fOriginalStepLocation;
/**
- * The total stack depth at the time an original (user-requested) step
- * is initiated. This is used along with the original step Location
- * to determine if a step into comes back to the starting location and
- * needs to be 'nudged' forward. Checking the stack depth eliminates
- * undesired 'nudging' in recursive methods.
+ * The total stack depth at the time an original (user-requested) step is
+ * initiated. This is used along with the original step Location to
+ * determine if a step into comes back to the starting location and needs to
+ * be 'nudged' forward. Checking the stack depth eliminates undesired
+ * 'nudging' in recursive methods.
*/
private int fOriginalStepStackDepth;
-
+
/**
* Whether or not this thread is currently suspending (user-requested).
*/
- private boolean fIsSuspending= false;
+ private boolean fIsSuspending = false;
private ThreadJob fAsyncJob;
-
+
private ThreadJob fRunningAsyncJob;
-
+
/**
- * Creates a new thread on the underlying thread reference
- * in the given debug target.
+ * Creates a new thread on the underlying thread reference in the given
+ * debug target.
*
- * @param target the debug target in which this thread is contained
- * @param thread the underlying thread on the VM
- * @exception ObjectCollectedException if the underlying thread has been
- * garbage collected and cannot be properly initialized
- */
- public JDIThread(JDIDebugTarget target, ThreadReference thread) throws ObjectCollectedException {
+ * @param target
+ * the debug target in which this thread is contained
+ * @param thread
+ * the underlying thread on the VM
+ * @exception ObjectCollectedException
+ * if the underlying thread has been garbage collected and
+ * cannot be properly initialized
+ */
+ public JDIThread(JDIDebugTarget target, ThreadReference thread)
+ throws ObjectCollectedException {
super(target);
setUnderlyingThread(thread);
initialize();
}
/**
- * Thread initialization:<ul>
+ * Thread initialization:
+ * <ul>
* <li>Determines if this thread is a system thread</li>
* <li>Sets terminated state to <code>false</code></li>
- * <li>Determines suspended state from underlying thread</li>
+ * <li>Determines suspended state from underlying thread</li>
* <li>Sets this threads stack frames to an empty collection</li>
* </ul>
- * @exception ObjectCollectedException if the thread has been garbage
- * collected and cannot be initialized
+ *
+ * @exception ObjectCollectedException
+ * if the thread has been garbage collected and cannot be
+ * initialized
*/
protected void initialize() throws ObjectCollectedException {
- fStackFrames= new ArrayList();
+ fStackFrames = new ArrayList<IJavaStackFrame>();
// system thread
try {
determineIfSystemThread();
} catch (DebugException e) {
- Throwable underlyingException= e.getStatus().getException();
+ Throwable underlyingException = e.getStatus().getException();
if (underlyingException instanceof VMDisconnectedException) {
// Threads may be created by the VM at shutdown
// as finalizers. The VM may be disconnected by
// the time we hear about the thread creation.
disconnected();
return;
- }
+ }
if (underlyingException instanceof ObjectCollectedException) {
- throw (ObjectCollectedException)underlyingException;
- }
+ throw (ObjectCollectedException) underlyingException;
+ }
logError(e);
}
-
+
try {
determineIfDaemonThread();
} catch (DebugException e) {
- Throwable underlyingException= e.getStatus().getException();
+ Throwable underlyingException = e.getStatus().getException();
if (underlyingException instanceof VMDisconnectedException) {
// Threads may be created by the VM at shutdown
// as finalizers. The VM may be disconnected by
@@ -305,7 +310,7 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
logError(e);
}
-
+
try {
ThreadGroupReference group = getUnderlyingThreadGroup();
// might already be terminated
@@ -327,21 +332,23 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
} catch (VMDisconnectedException e) {
disconnected();
return;
- } catch (ObjectCollectedException e){
+ } catch (ObjectCollectedException e) {
throw e;
} catch (RuntimeException e) {
logError(e);
- }
-
+ }
+
try {
- // This may be a transient suspend state (for example, a thread is handling a
- // class prepare event quietly). The class prepare event handler will notify
+ // This may be a transient suspend state (for example, a thread is
+ // handling a
+ // class prepare event quietly). The class prepare event handler
+ // will notify
// this thread when it resumes
setRunning(!fThread.isSuspended());
} catch (VMDisconnectedException e) {
disconnected();
return;
- } catch (ObjectCollectedException e){
+ } catch (ObjectCollectedException e) {
throw e;
} catch (RuntimeException e) {
logError(e);
@@ -349,67 +356,90 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
/**
- * Adds the given breakpoint to the list of breakpoints
- * this thread is suspended at
- * @param bp the breakpoint to add to the listing
+ * Adds the given breakpoint to the list of breakpoints this thread is
+ * suspended at
+ *
+ * @param bp
+ * the breakpoint to add to the listing
*/
protected void addCurrentBreakpoint(IBreakpoint bp) {
fCurrentBreakpoints.add(bp);
}
-
+
/**
- * Removes the given breakpoint from the list of breakpoints
- * this thread is suspended at (called when a breakpoint is
- * deleted, in case we are suspended at that breakpoint)
- * @param bp the breakpoint to remove from the listing
+ * Removes the given breakpoint from the list of breakpoints this thread is
+ * suspended at (called when a breakpoint is deleted, in case we are
+ * suspended at that breakpoint)
+ *
+ * @param bp
+ * the breakpoint to remove from the listing
*/
protected void removeCurrentBreakpoint(IBreakpoint bp) {
fCurrentBreakpoints.remove(bp);
- }
-
- /* (non-Javadoc)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IThread#getBreakpoints()
*/
public synchronized IBreakpoint[] getBreakpoints() {
- return (IBreakpoint[])fCurrentBreakpoints.toArray(new IBreakpoint[fCurrentBreakpoints.size()]);
+ return fCurrentBreakpoints
+ .toArray(new IBreakpoint[fCurrentBreakpoints.size()]);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ISuspendResume#canResume()
*/
public boolean canResume() {
- return isSuspended() && (!isPerformingEvaluation() || isInvokingMethod()) && !isSuspendVoteInProgress();
+ return isSuspended()
+ && (!isPerformingEvaluation() || isInvokingMethod())
+ && !isSuspendVoteInProgress();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
*/
public boolean canSuspend() {
- return !isSuspended() || (isPerformingEvaluation() && !isInvokingMethod()) || isSuspendVoteInProgress();
+ return !isSuspended()
+ || (isPerformingEvaluation() && !isInvokingMethod())
+ || isSuspendVoteInProgress();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
*/
public boolean canTerminate() {
return getDebugTarget().canTerminate();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IStep#canStepInto()
*/
public boolean canStepInto() {
return canStep();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IStep#canStepOver()
*/
public boolean canStepOver() {
return canStep();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IStep#canStepReturn()
*/
public boolean canStepReturn() {
@@ -417,20 +447,17 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
/**
- * Returns whether this thread is in a valid state to
- * step.
+ * Returns whether this thread is in a valid state to step.
*
- * @return whether this thread is in a valid state to
- * step
+ * @return whether this thread is in a valid state to step
*/
protected boolean canStep() {
try {
return isSuspended()
- && (!isPerformingEvaluation() || isInvokingMethod())
- && !isSuspendVoteInProgress()
- && !isStepping()
- && getTopStackFrame() != null
- && !getJavaDebugTarget().isPerformingHotCodeReplace();
+ && (!isPerformingEvaluation() || isInvokingMethod())
+ && !isSuspendVoteInProgress() && !isStepping()
+ && getTopStackFrame() != null
+ && !getJavaDebugTarget().isPerformingHotCodeReplace();
} catch (DebugException e) {
return false;
}
@@ -439,42 +466,47 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
/**
* Determines and sets whether this thread represents a system thread.
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected void determineIfSystemThread() throws DebugException {
- fIsSystemThread= false;
- ThreadGroupReference tgr= getUnderlyingThreadGroup();
+ fIsSystemThread = false;
+ ThreadGroupReference tgr = getUnderlyingThreadGroup();
fIsSystemThread = tgr != null;
while (tgr != null) {
- String tgn= null;
+ String tgn = null;
try {
- tgn= tgr.name();
- tgr= tgr.parent();
+ tgn = tgr.name();
+ tgr = tgr.parent();
} catch (UnsupportedOperationException e) {
fIsSystemThread = false;
break;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_determining_if_system_thread, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_determining_if_system_thread,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ // #targetRequestFailed will throw an exception
return;
}
if (tgn != null && tgn.equals(MAIN_THREAD_GROUP)) {
- fIsSystemThread= false;
+ fIsSystemThread = false;
break;
}
}
}
-
+
/**
* Determines whether this is a daemon thread.
*
- * @throws DebugException on failure
+ * @throws DebugException
+ * on failure
*/
protected void determineIfDaemonThread() throws DebugException {
fIsDaemon = false;
@@ -488,16 +520,18 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
if (field.signature().equals(Signature.SIG_BOOLEAN)) {
Value value = getUnderlyingThread().getValue(field);
if (value instanceof BooleanValue) {
- fIsDaemon = ((BooleanValue)value).booleanValue();
+ fIsDaemon = ((BooleanValue) value).booleanValue();
}
}
}
- }
- catch(ObjectCollectedException oce) {/*do nothing thread does not exist*/}
- catch (RuntimeException e) {
+ } catch (ObjectCollectedException oce) {/*
+ * do nothing thread does not
+ * exist
+ */
+ } catch (RuntimeException e) {
targetRequestFailed(JDIDebugModelMessages.JDIThread_47, e);
}
- }
+ }
/**
* NOTE: this method returns a copy of this thread's stack frames.
@@ -505,49 +539,59 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
* @see IThread#getStackFrames()
*/
public synchronized IStackFrame[] getStackFrames() throws DebugException {
- List list = computeStackFrames();
- return (IStackFrame[])list.toArray(new IStackFrame[list.size()]);
+ List<IJavaStackFrame> list = computeStackFrames();
+ return list.toArray(new IStackFrame[list.size()]);
}
-
+
/**
* @see #computeStackFrames()
*
- * @param refreshChildren whether or not this method should request new stack
- * frames from the VM
+ * @param refreshChildren
+ * whether or not this method should request new stack frames
+ * from the VM
* @return the list of stackframes
- * @throws DebugException if an exception occurs retrieving frames
- */
- protected synchronized List computeStackFrames(boolean refreshChildren) throws DebugException {
+ * @throws DebugException
+ * if an exception occurs retrieving frames
+ */
+ protected synchronized List<IJavaStackFrame> computeStackFrames(boolean refreshChildren)
+ throws DebugException {
if (isSuspended()) {
if (isTerminated()) {
fStackFrames.clear();
} else if (refreshChildren) {
- List frames = getUnderlyingFrames();
+ List<StackFrame> frames = getUnderlyingFrames();
int oldSize = fStackFrames.size();
int newSize = frames.size();
- int discard = oldSize - newSize; // number of old frames to discard, if any
+ int discard = oldSize - newSize; // number of old frames to
+ // discard, if any
for (int i = 0; i < discard; i++) {
- JDIStackFrame invalid = (JDIStackFrame) fStackFrames.remove(0);
+ JDIStackFrame invalid = (JDIStackFrame) fStackFrames
+ .remove(0);
invalid.bind(null, -1);
}
- int newFrames = newSize - oldSize; // number of frames to create, if any
+ int newFrames = newSize - oldSize; // number of frames to
+ // create, if any
int depth = oldSize;
for (int i = newFrames - 1; i >= 0; i--) {
- fStackFrames.add(0, new JDIStackFrame(this, (StackFrame) frames.get(i), depth));
+ fStackFrames.add(0, new JDIStackFrame(this,
+ frames.get(i), depth));
depth++;
}
- int numToRebind = Math.min(newSize, oldSize); // number of frames to attempt to re-bind
+ int numToRebind = Math.min(newSize, oldSize); // number of
+ // frames to
+ // attempt to
+ // re-bind
int offset = newSize - 1;
for (depth = 0; depth < numToRebind; depth++) {
- JDIStackFrame oldFrame = (JDIStackFrame) fStackFrames.get(offset);
- StackFrame frame = (StackFrame) frames.get(offset);
+ JDIStackFrame oldFrame = (JDIStackFrame) fStackFrames
+ .get(offset);
+ StackFrame frame = frames.get(offset);
JDIStackFrame newFrame = oldFrame.bind(frame, depth);
if (newFrame != oldFrame) {
fStackFrames.set(offset, newFrame);
}
offset--;
}
-
}
fRefreshChildren = false;
@@ -556,69 +600,81 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
return fStackFrames;
}
-
+
/**
- * Returns this thread's current stack frames as a list, computing
- * them if required. Returns an empty collection if this thread is
- * not currently suspended, or this thread is terminated. This
- * method should be used internally to get the current stack frames,
- * instead of calling <code>#getStackFrames()</code>, which makes a
- * copy of the current list.
+ * Returns this thread's current stack frames as a list, computing them if
+ * required. Returns an empty collection if this thread is not currently
+ * suspended, or this thread is terminated. This method should be used
+ * internally to get the current stack frames, instead of calling
+ * <code>#getStackFrames()</code>, which makes a copy of the current list.
* <p>
- * Before a thread is resumed a call must be made to one of:<ul>
+ * Before a thread is resumed a call must be made to one of:
+ * <ul>
* <li><code>preserveStackFrames()</code></li>
* <li><code>disposeStackFrames()</code></li>
* </ul>
- * If stack frames are disposed before a thread is resumed, stack frames
- * are completely re-computed on the next call to this method. If stack
- * frames are to be preserved, this method will attempt to re-use any stack
- * frame objects which represent the same stack frame as on the previous
- * suspend. Stack frames are cached until a subsequent call to preserve
- * or dispose stack frames.
+ * If stack frames are disposed before a thread is resumed, stack frames are
+ * completely re-computed on the next call to this method. If stack frames
+ * are to be preserved, this method will attempt to re-use any stack frame
+ * objects which represent the same stack frame as on the previous suspend.
+ * Stack frames are cached until a subsequent call to preserve or dispose
+ * stack frames.
* </p>
*
* @return list of <code>IJavaStackFrame</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
- public synchronized List computeStackFrames() throws DebugException {
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
+ */
+ public synchronized List<IJavaStackFrame> computeStackFrames() throws DebugException {
return computeStackFrames(fRefreshChildren);
}
-
+
/**
- * This method differs from computeStackFrames() in that it
- * always requests new stack frames from the VM. As this is
- * an expensive operation, this method should only be used
- * by clients who know for certain that the stack frames
- * on the VM have changed.
+ * This method differs from computeStackFrames() in that it always requests
+ * new stack frames from the VM. As this is an expensive operation, this
+ * method should only be used by clients who know for certain that the stack
+ * frames on the VM have changed.
*
* @see JDIThread#computeStackFrames()
- * @return the listing of stackframes or an empty list, never <code>null</code>
- * @throws DebugException if an exception occurs retrieving the stackframes
+ * @return the listing of stackframes or an empty list, never
+ * <code>null</code>
+ * @throws DebugException
+ * if an exception occurs retrieving the stackframes
*/
- public List computeNewStackFrames() throws DebugException {
+ public List<IJavaStackFrame> computeNewStackFrames() throws DebugException {
return computeStackFrames(true);
}
- private List getUnderlyingFrames() throws DebugException {
+ private List<StackFrame> getUnderlyingFrames() throws DebugException {
if (!isSuspended()) {
// Checking isSuspended here eliminates a race condition in resume
// between the time stack frames are preserved and the time the
// underlying thread is actually resumed.
- requestFailed(JDIDebugModelMessages.JDIThread_Unable_to_retrieve_stack_frame___thread_not_suspended__1, null, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Unable_to_retrieve_stack_frame___thread_not_suspended__1,
+ null, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
}
try {
return fThread.frames();
} catch (IncompatibleThreadStateException e) {
- requestFailed(JDIDebugModelMessages.JDIThread_Unable_to_retrieve_stack_frame___thread_not_suspended__1, e, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Unable_to_retrieve_stack_frame___thread_not_suspended__1,
+ e, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_stack_frames_2, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_stack_frames_2,
+ e.toString()), e);
} catch (InternalError e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_stack_frames_2, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_stack_frames_2,
+ e.toString()), e);
}
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
@@ -626,55 +682,75 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
/**
- * Returns the number of frames on the stack from the
- * underlying thread.
+ * Returns the number of frames on the stack from the underlying thread.
*
* @return number of frames on the stack
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This thread is not suspended</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This thread is not suspended</li>
+ * </ul>
*/
protected int getUnderlyingFrameCount() throws DebugException {
try {
return fThread.frameCount();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_frame_count, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_frame_count,
+ e.toString()), e);
} catch (IncompatibleThreadStateException e) {
- requestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_frame_count, new String[] {e.toString()}), e, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
+ requestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_frame_count,
+ e.toString()), e,
+ IJavaThread.ERR_THREAD_NOT_SUSPENDED);
}
// execution will not reach here - try block will either
// return or exception will be thrown
return -1;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaThread#runEvaluation(org.eclipse.jdt.debug.core.IEvaluationRunnable, org.eclipse.core.runtime.IProgressMonitor, int, boolean)
- */
- public void runEvaluation(IEvaluationRunnable evaluation, IProgressMonitor monitor, int evaluationDetail, boolean hitBreakpoints) throws DebugException {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaThread#runEvaluation(org.eclipse.jdt.
+ * debug.core.IEvaluationRunnable,
+ * org.eclipse.core.runtime.IProgressMonitor, int, boolean)
+ */
+ public void runEvaluation(IEvaluationRunnable evaluation,
+ IProgressMonitor monitor, int evaluationDetail,
+ boolean hitBreakpoints) throws DebugException {
if (isPerformingEvaluation()) {
- requestFailed(JDIDebugModelMessages.JDIThread_Cannot_perform_nested_evaluations, null, IJavaThread.ERR_NESTED_METHOD_INVOCATION); //
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Cannot_perform_nested_evaluations,
+ null, IJavaThread.ERR_NESTED_METHOD_INVOCATION); //
}
-
+
if (!canRunEvaluation()) {
- requestFailed(JDIDebugModelMessages.JDIThread_Evaluation_failed___thread_not_suspended, null, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Evaluation_failed___thread_not_suspended,
+ null, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
}
-
+
synchronized (fEvaluationLock) {
- fEvaluationRunnable= evaluation;
- fHonorBreakpoints= hitBreakpoints;
+ fEvaluationRunnable = evaluation;
+ fHonorBreakpoints = hitBreakpoints;
}
boolean quiet = isSuspendVoteInProgress();
if (quiet) {
- // evaluations are quiet when a suspend vote is in progress (conditional breakpoints, etc.).
- fireEvent(new DebugEvent(this, DebugEvent.MODEL_SPECIFIC, RESUME_QUIET));
+ // evaluations are quiet when a suspend vote is in progress
+ // (conditional breakpoints, etc.).
+ fireEvent(new DebugEvent(this, DebugEvent.MODEL_SPECIFIC,
+ RESUME_QUIET));
} else {
fireResumeEvent(evaluationDetail);
}
- //save and restore current breakpoint information - bug 30837
+ // save and restore current breakpoint information - bug 30837
IBreakpoint[] breakpoints = getBreakpoints();
ISchedulingRule rule = null;
if (evaluationDetail == DebugEvent.EVALUATION_IMPLICIT) {
@@ -694,63 +770,73 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
Job.getJobManager().endRule(rule);
}
synchronized (fEvaluationLock) {
- fEvaluationRunnable= null;
- fHonorBreakpoints= true;
+ fEvaluationRunnable = null;
+ fHonorBreakpoints = true;
fEvaluationLock.notifyAll();
}
if (getBreakpoints().length == 0 && breakpoints.length > 0) {
- for (int i = 0; i < breakpoints.length; i++) {
- addCurrentBreakpoint(breakpoints[i]);
- }
+ for (IBreakpoint breakpoint : breakpoints) {
+ addCurrentBreakpoint(breakpoint);
+ }
}
if (quiet) {
- fireEvent(new DebugEvent(this, DebugEvent.MODEL_SPECIFIC, SUSPEND_QUIET));
+ fireEvent(new DebugEvent(this, DebugEvent.MODEL_SPECIFIC,
+ SUSPEND_QUIET));
} else {
fireSuspendEvent(evaluationDetail);
}
- if (fEvaluationInterrupted && (fAsyncJob == null || fAsyncJob.isEmpty()) && (fRunningAsyncJob == null || fRunningAsyncJob.isEmpty())) {
+ if (fEvaluationInterrupted
+ && (fAsyncJob == null || fAsyncJob.isEmpty())
+ && (fRunningAsyncJob == null || fRunningAsyncJob.isEmpty())) {
// @see bug 31585:
- // When an evaluation was interrupted & resumed, the launch view does
- // not update properly. It cannot know when it is safe to display frames
- // since it does not know about queued evaluations. Thus, when the queue
+ // When an evaluation was interrupted & resumed, the launch view
+ // does
+ // not update properly. It cannot know when it is safe to
+ // display frames
+ // since it does not know about queued evaluations. Thus, when
+ // the queue
// is empty, we fire a change event to force the view to update.
fEvaluationInterrupted = false;
fireChangeEvent(DebugEvent.CONTENT);
- }
+ }
}
}
-
+
/**
- * Returns whether this thread is in a valid state to
- * run an evaluation.
+ * Returns whether this thread is in a valid state to run an evaluation.
*
- * @return whether this thread is in a valid state to
- * run an evaluation
+ * @return whether this thread is in a valid state to run an evaluation
*/
protected boolean canRunEvaluation() {
- // NOTE similar to #canStep, except an evaluation can be run when in the middle of
+ // NOTE similar to #canStep, except an evaluation can be run when in the
+ // middle of
// a step (conditional breakpoint, breakpoint listener, etc.)
try {
return isSuspended()
- && !(isPerformingEvaluation() || isInvokingMethod())
- && getTopStackFrame() != null
- && !getJavaDebugTarget().isPerformingHotCodeReplace();
+ && !(isPerformingEvaluation() || isInvokingMethod())
+ && getTopStackFrame() != null
+ && !getJavaDebugTarget().isPerformingHotCodeReplace();
} catch (DebugException e) {
return false;
}
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaThread#queueRunnable(java.lang.Runnable)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaThread#queueRunnable(java.lang.Runnable)
*/
public void queueRunnable(Runnable evaluation) {
if (fAsyncJob == null) {
- fAsyncJob= new ThreadJob(this);
+ fAsyncJob = new ThreadJob(this);
}
fAsyncJob.addRunnable(evaluation);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#terminateEvaluation()
*/
public void terminateEvaluation() throws DebugException {
@@ -761,8 +847,10 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#canTerminateEvaluation()
*/
public boolean canTerminateEvaluation() {
@@ -772,10 +860,11 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
/**
- * Invokes a method on the target, in this thread, and returns the result. Only
- * one receiver may be specified - either a class or an object, the other must
- * be <code>null</code>. This thread is left suspended after the invocation
- * is complete, unless a call is made to <code>abortEvaluation<code> while
+ * Invokes a method on the target, in this thread, and returns the result.
+ * Only one receiver may be specified - either a class or an object, the
+ * other must be <code>null</code>. This thread is left suspended after the
+ * invocation is complete, unless a call is made to
+ * <code>abortEvaluation<code> while
* performing a method invocation. In that case, this thread is automatically
* resumed when/if this invocation (eventually) completes.
* <p>
@@ -800,34 +889,44 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
* is reset to its original value when the invocation completes.
* </p>
*
- * @param receiverClass the class in the target representing the receiver
- * of a static message send, or <code>null</code>
- * @param receiverObject the object in the target to be the receiver of
- * the message send, or <code>null</code>
- * @param method the underlying method to be invoked
- * @param args the arguments to invoke the method with (an empty list
- * if none)
- * @param invokeNonvirtual if the super-class method should be invoked
+ * @param receiverClass
+ * the class in the target representing the receiver of a static
+ * message send, or <code>null</code>
+ * @param receiverObject
+ * the object in the target to be the receiver of the message
+ * send, or <code>null</code>
+ * @param method
+ * the underlying method to be invoked
+ * @param args
+ * the arguments to invoke the method with (an empty list if
+ * none)
+ * @param invokeNonvirtual
+ * if the super-class method should be invoked
* @return the result of the method, as an underlying value
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>This thread is not suspended
- * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
- * <li>This thread is already invoking a method
- * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
- * <li>This thread is not suspended by a JDI request
- * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
- * </ul>
- */
- protected Value invokeMethod(ClassType receiverClass, ObjectReference receiverObject, Method method, List args, boolean invokeNonvirtual) throws DebugException {
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>This thread is not suspended (status code
+ * <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
+ * <li>This thread is already invoking a method (status code
+ * <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
+ * <li>This thread is not suspended by a JDI request (status
+ * code
+ * <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
+ * </ul>
+ */
+ protected Value invokeMethod(ClassType receiverClass,
+ ObjectReference receiverObject, Method method, List<? extends Value> args,
+ boolean invokeNonvirtual) throws DebugException {
if (receiverClass != null && receiverObject != null) {
- throw new IllegalArgumentException(JDIDebugModelMessages.JDIThread_can_only_specify_one_receiver_for_a_method_invocation);
+ throw new IllegalArgumentException(
+ JDIDebugModelMessages.JDIThread_can_only_specify_one_receiver_for_a_method_invocation);
}
- Value result= null;
- int timeout= getRequestTimeout();
+ Value result = null;
+ int timeout = getRequestTimeout();
try {
// this is synchronized such that any other operation that
// might be resuming this thread has a chance to complete before
@@ -835,33 +934,41 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
// See bugs 6518, 14069
synchronized (this) {
if (!isSuspended()) {
- requestFailed(JDIDebugModelMessages.JDIThread_Evaluation_failed___thread_not_suspended, null, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Evaluation_failed___thread_not_suspended,
+ null, IJavaThread.ERR_THREAD_NOT_SUSPENDED);
}
if (isInvokingMethod()) {
- requestFailed(JDIDebugModelMessages.JDIThread_Cannot_perform_nested_evaluations, null, IJavaThread.ERR_NESTED_METHOD_INVOCATION);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Cannot_perform_nested_evaluations,
+ null, IJavaThread.ERR_NESTED_METHOD_INVOCATION);
}
// set the request timeout to be infinite
setRequestTimeout(Integer.MAX_VALUE);
setRunning(true);
- setInvokingMethod(true);
+ setInvokingMethod(true);
}
preserveStackFrames();
- int flags= ClassType.INVOKE_SINGLE_THREADED;
+ int flags = ClassType.INVOKE_SINGLE_THREADED;
if (invokeNonvirtual) {
// Superclass method invocation must be performed non-virtual.
flags |= ObjectReference.INVOKE_NONVIRTUAL;
}
if (receiverClass == null) {
- result= receiverObject.invokeMethod(fThread, method, args, flags);
+ result = receiverObject.invokeMethod(fThread, method, args,
+ flags);
} else {
- result= receiverClass.invokeMethod(fThread, method, args, flags);
+ result = receiverClass.invokeMethod(fThread, method, args,
+ flags);
}
} catch (InvalidTypeException e) {
invokeFailed(e, timeout);
} catch (ClassNotLoadedException e) {
invokeFailed(e, timeout);
} catch (IncompatibleThreadStateException e) {
- invokeFailed(JDIDebugModelMessages.JDIThread_Thread_must_be_suspended_by_step_or_breakpoint_to_perform_method_invocation_1, IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE, e, timeout);
+ invokeFailed(
+ JDIDebugModelMessages.JDIThread_Thread_must_be_suspended_by_step_or_breakpoint_to_perform_method_invocation_1,
+ IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE, e, timeout);
} catch (InvocationException e) {
invokeFailed(e, timeout);
} catch (RuntimeException e) {
@@ -871,60 +978,65 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
invokeComplete(timeout);
return result;
}
-
+
/**
- * Invokes a constructor in this thread, creating a new instance of the given
- * class, and returns the result as an object reference.
- * This thread is left suspended after the invocation
- * is complete.
+ * Invokes a constructor in this thread, creating a new instance of the
+ * given class, and returns the result as an object reference. This thread
+ * is left suspended after the invocation is complete.
* <p>
- * Method invocations cannot be nested. That is, this method must
- * return before another call to this method can be made. This
- * method does not return until the invocation is complete.
- * Breakpoints can suspend a method invocation, and it is possible
- * that an invocation will not complete due to an infinite loop
- * or deadlock.
+ * Method invocations cannot be nested. That is, this method must return
+ * before another call to this method can be made. This method does not
+ * return until the invocation is complete. Breakpoints can suspend a method
+ * invocation, and it is possible that an invocation will not complete due
+ * to an infinite loop or deadlock.
* </p>
* <p>
- * Stack frames are preserved during method invocations, unless
- * a timeout occurs. Although this thread's state is updated to
- * running while performing an evaluation, no debug events are
- * fired unless this invocation is interrupted by a breakpoint,
- * or the invocation times out.
+ * Stack frames are preserved during method invocations, unless a timeout
+ * occurs. Although this thread's state is updated to running while
+ * performing an evaluation, no debug events are fired unless this
+ * invocation is interrupted by a breakpoint, or the invocation times out.
* </p>
* <p>
- * When performing an invocation, the communication timeout with
- * the target VM is set to infinite, as the invocation may not
- * complete in a timely fashion, if at all. The timeout value
- * is reset to its original value when the invocation completes.
+ * When performing an invocation, the communication timeout with the target
+ * VM is set to infinite, as the invocation may not complete in a timely
+ * fashion, if at all. The timeout value is reset to its original value when
+ * the invocation completes.
* </p>
*
- * @param receiverClass the class in the target representing the receiver
- * of the 'new' message send
- * @param constructor the underlying constructor to be invoked
- * @param args the arguments to invoke the constructor with (an empty list
- * if none)
+ * @param receiverClass
+ * the class in the target representing the receiver of the 'new'
+ * message send
+ * @param constructor
+ * the underlying constructor to be invoked
+ * @param args
+ * the arguments to invoke the constructor with (an empty list if
+ * none)
* @return a new object reference
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
- protected ObjectReference newInstance(ClassType receiverClass, Method constructor, List args) throws DebugException {
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
+ */
+ protected ObjectReference newInstance(ClassType receiverClass,
+ Method constructor, List<? extends Value> args) throws DebugException {
if (isInvokingMethod()) {
- requestFailed(JDIDebugModelMessages.JDIThread_Cannot_perform_nested_evaluations_2, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Cannot_perform_nested_evaluations_2,
+ null);
}
- ObjectReference result= null;
- int timeout= getRequestTimeout();
+ ObjectReference result = null;
+ int timeout = getRequestTimeout();
try {
// set the request timeout to be infinite
setRequestTimeout(Integer.MAX_VALUE);
setRunning(true);
setInvokingMethod(true);
preserveStackFrames();
- result= receiverClass.newInstance(fThread, constructor, args, ClassType.INVOKE_SINGLE_THREADED);
+ result = receiverClass.newInstance(fThread, constructor, args,
+ ClassType.INVOKE_SINGLE_THREADED);
} catch (InvalidTypeException e) {
invokeFailed(e, timeout);
} catch (ClassNotLoadedException e) {
@@ -940,60 +1052,75 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
invokeComplete(timeout);
return result;
}
-
+
/**
- * Called when an invocation fails. Performs cleanup
- * and throws an exception.
+ * Called when an invocation fails. Performs cleanup and throws an
+ * exception.
*
- * @param e the exception that caused the failure
- * @param restoreTimeout the communication timeout value,
- * in milliseconds, that should be reset
+ * @param e
+ * the exception that caused the failure
+ * @param restoreTimeout
+ * the communication timeout value, in milliseconds, that should
+ * be reset
* @see #invokeComplete(int)
- * @exception DebugException Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
- protected void invokeFailed(Throwable e, int restoreTimeout) throws DebugException {
- invokeFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_invoking_method, new String[] {e.toString()}), DebugException.TARGET_REQUEST_FAILED, e, restoreTimeout);
+ protected void invokeFailed(Throwable e, int restoreTimeout)
+ throws DebugException {
+ invokeFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_invoking_method,
+ e.toString()),
+ DebugException.TARGET_REQUEST_FAILED, e, restoreTimeout);
}
-
+
/**
- * Called when an invocation fails. Performs cleanup
- * and throws an exception.
+ * Called when an invocation fails. Performs cleanup and throws an
+ * exception.
*
- * @param message error message
- * @param code status code
- * @param e the exception that caused the failure
- * @param restoreTimeout the communication timeout value,
- * in milliseconds, that should be reset
+ * @param message
+ * error message
+ * @param code
+ * status code
+ * @param e
+ * the exception that caused the failure
+ * @param restoreTimeout
+ * the communication timeout value, in milliseconds, that should
+ * be reset
* @see #invokeComplete(int)
- * @exception DebugException Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
- protected void invokeFailed(String message, int code, Throwable e, int restoreTimeout) throws DebugException {
+ * @exception DebugException
+ * Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
+ */
+ protected void invokeFailed(String message, int code, Throwable e,
+ int restoreTimeout) throws DebugException {
invokeComplete(restoreTimeout);
requestFailed(message, e, code);
- }
-
+ }
+
/**
- * Called when a method invocation has returned, successfully
- * or not. This method performs cleanup:<ul>
+ * Called when a method invocation has returned, successfully or not. This
+ * method performs cleanup:
+ * <ul>
* <li>Resets the state of this thread to suspended</li>
* <li>Restores the communication timeout value</li>
* <li>Computes the new set of stack frames for this thread</code>
* </ul>
*
- * @param restoreTimeout the communication timeout value,
- * in milliseconds, that should be reset
+ * @param restoreTimeout
+ * the communication timeout value, in milliseconds, that should
+ * be reset
* @see #invokeMethod(ClassType, ObjectReference, Method, List, boolean)
- * @see #newInstance(ClassType, Method, List)
+ * @see #newInstance(ClassType, Method, List)
*/
protected synchronized void invokeComplete(int restoreTimeout) {
setInvokingMethod(false);
@@ -1006,88 +1133,109 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
logError(e);
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IThread#getName()
*/
public String getName() throws DebugException {
try {
fPreviousName = fThread.name();
} catch (RuntimeException e) {
- // Don't bother reporting the exception when retrieving the name (bug 30785 & bug 33276)
+ // Don't bother reporting the exception when retrieving the name
+ // (bug 30785 & bug 33276)
if (e instanceof ObjectCollectedException) {
if (fPreviousName == null) {
- fPreviousName= JDIDebugModelMessages.JDIThread_garbage_collected_1;
+ fPreviousName = JDIDebugModelMessages.JDIThread_garbage_collected_1;
}
} else if (e instanceof VMDisconnectedException) {
if (fPreviousName == null) {
- fPreviousName= JDIDebugModelMessages.JDIThread_42;
+ fPreviousName = JDIDebugModelMessages.JDIThread_42;
}
} else {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_thread_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_thread_name,
+ e.toString()), e);
}
}
return fPreviousName;
}
/**
- * Returns the priority from the underlying {@link ReferenceType}, failing that the backing {@link Value}
- * for the underlying {@link ThreadReference} is consulted
+ * Returns the priority from the underlying {@link ReferenceType}, failing
+ * that the backing {@link Value} for the underlying {@link ThreadReference}
+ * is consulted
*
- * @return the priority from the backing {@link ReferenceType} or {@link Value}
- * @throws DebugException if an exception occurs retrieving the priority
+ * @return the priority from the backing {@link ReferenceType} or
+ * {@link Value}
+ * @throws DebugException
+ * if an exception occurs retrieving the priority
* @see IThread#getPriority
*/
public int getPriority() throws DebugException {
// to get the priority, we must get the value from the "priority" field
- Field p= null;
+ Field p = null;
try {
- p= fThread.referenceType().fieldByName("priority"); //$NON-NLS-1$
+ p = fThread.referenceType().fieldByName("priority"); //$NON-NLS-1$
if (p == null) {
- requestFailed(JDIDebugModelMessages.JDIThread_no_priority_field, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_no_priority_field, null);
}
- Value v= fThread.getValue(p);
+ Value v = fThread.getValue(p);
if (v instanceof IntegerValue) {
- return ((IntegerValue)v).value();
+ return ((IntegerValue) v).value();
}
- requestFailed(JDIDebugModelMessages.JDIThread_priority_not_an_integer, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_priority_not_an_integer,
+ null);
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_thread_priority, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_thread_priority,
+ e.toString()), e);
}
// execution will not fall through to this line, as
// #targetRequestFailed or #requestFailed will throw
- // an exception
+ // an exception
return -1;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IThread#getTopStackFrame()
*/
public synchronized IStackFrame getTopStackFrame() throws DebugException {
- List c= computeStackFrames();
+ List<IJavaStackFrame> c = computeStackFrames();
if (c.isEmpty()) {
return null;
}
- return (IStackFrame) c.get(0);
+ return c.get(0);
}
/**
- * A breakpoint has suspended execution of this thread.
- * Aborts any step currently in process and notifies listeners
- * of the breakpoint to allow a vote to determine if the thread
- * should suspend.
+ * A breakpoint has suspended execution of this thread. Aborts any step
+ * currently in process and notifies listeners of the breakpoint to allow a
+ * vote to determine if the thread should suspend.
*
- * @param breakpoint the breakpoint that caused the suspend
- * @param suspendVote current vote before listeners are notified (for example, if a step request
- * happens at the same location as a breakpoint, the step may have voted to suspend
- * already - this allows a conditional breakpoint to avoid evaluation)
+ * @param breakpoint
+ * the breakpoint that caused the suspend
+ * @param suspendVote
+ * current vote before listeners are notified (for example, if a
+ * step request happens at the same location as a breakpoint, the
+ * step may have voted to suspend already - this allows a
+ * conditional breakpoint to avoid evaluation)
* @return whether this thread suspended
*/
- public boolean handleSuspendForBreakpoint(JavaBreakpoint breakpoint, boolean suspendVote) {
+ public boolean handleSuspendForBreakpoint(JavaBreakpoint breakpoint,
+ boolean suspendVote) {
int policy = IJavaBreakpoint.SUSPEND_THREAD;
synchronized (this) {
if (fClientSuspendRequest) {
- // a request to suspend has overridden the breakpoint request - suspend and
+ // a request to suspend has overridden the breakpoint request -
+ // suspend and
// ignore the breakpoint
return true;
}
@@ -1100,23 +1248,27 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
setRunning(true);
return false;
}
-
+
// update state to suspended but don't actually
// suspend unless a registered listener agrees
if (policy == IJavaBreakpoint.SUSPEND_VM) {
- ((JDIDebugTarget)getDebugTarget()).prepareToSuspendByBreakpoint(breakpoint);
+ ((JDIDebugTarget) getDebugTarget())
+ .prepareToSuspendByBreakpoint(breakpoint);
} else {
setRunning(false);
}
}
-
+
// Evaluate breakpoint condition (if any). The condition is evaluated
- // regardless of the current suspend vote status, since breakpoint listeners
- // should only be notified when a condition is true (i.e. when the breakpoint
+ // regardless of the current suspend vote status, since breakpoint
+ // listeners
+ // should only be notified when a condition is true (i.e. when the
+ // breakpoint
// is really hit).
if (breakpoint instanceof JavaLineBreakpoint) {
JavaLineBreakpoint lbp = (JavaLineBreakpoint) breakpoint;
- // evaluate condition unless we're in an evaluation already (bug 284022)
+ // evaluate condition unless we're in an evaluation already (bug
+ // 284022)
if (lbp.hasCondition() && !isPerformingEvaluation()) {
ConditionalBreakpointHandler handler = new ConditionalBreakpointHandler();
int vote = handler.breakpointHit(this, breakpoint);
@@ -1128,7 +1280,8 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
}
if (handler.hasErrors()) {
- // there were errors, suspend and do not notify listeners of hit since
+ // there were errors, suspend and do not notify listeners of
+ // hit since
// they were already notified of compilation/runtime errors
synchronized (this) {
fSuspendVoteInProgress = false;
@@ -1137,41 +1290,49 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
}
}
-
+
// poll listeners without holding lock on thread
boolean suspend = true;
try {
- suspend = JDIDebugPlugin.getDefault().fireBreakpointHit(this, breakpoint);
+ suspend = JDIDebugPlugin.getDefault().fireBreakpointHit(this,
+ breakpoint);
} finally {
synchronized (this) {
fSuspendVoteInProgress = false;
if (fClientSuspendRequest) {
- // if a client has requested a suspend, then override the vote to suspend
+ // if a client has requested a suspend, then override the
+ // vote to suspend
suspend = true;
}
}
}
return suspend;
}
-
+
/**
* Called after an event set with a breakpoint is done being processed.
* Updates thread state based on the result of handling the event set.
* Aborts any step in progress and fires a suspend event is suspending.
*
- * @param breakpoint the breakpoint that was hit
- * @param suspend whether to suspend
- * @param queue whether to queue events or fire immediately
- * @param set event set handling is associated with
- */
- public void completeBreakpointHandling(JavaBreakpoint breakpoint, boolean suspend, boolean queue, EventSet set) {
+ * @param breakpoint
+ * the breakpoint that was hit
+ * @param suspend
+ * whether to suspend
+ * @param queue
+ * whether to queue events or fire immediately
+ * @param set
+ * event set handling is associated with
+ */
+ public void completeBreakpointHandling(JavaBreakpoint breakpoint,
+ boolean suspend, boolean queue, EventSet set) {
synchronized (this) {
- try {
+ try {
int policy = breakpoint.getSuspendPolicy();
// suspend or resume
if (suspend) {
if (policy == IJavaBreakpoint.SUSPEND_VM) {
- ((JDIDebugTarget)getDebugTarget()).suspendedByBreakpoint(breakpoint, false, set);
+ ((JDIDebugTarget) getDebugTarget())
+ .suspendedByBreakpoint(breakpoint, false, set);
}
abortStep();
if (queue) {
@@ -1181,66 +1342,80 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
} else {
if (policy == IJavaBreakpoint.SUSPEND_VM) {
- ((JDIDebugTarget)getDebugTarget()).cancelSuspendByBreakpoint(breakpoint);
+ ((JDIDebugTarget) getDebugTarget())
+ .cancelSuspendByBreakpoint(breakpoint);
} else {
setRunning(true);
- // dispose cached stack frames so we re-retrieve on the next breakpoint
+ // dispose cached stack frames so we re-retrieve on the
+ // next breakpoint
preserveStackFrames();
- }
+ }
}
} catch (CoreException e) {
logError(e);
setRunning(true);
- }
+ }
}
-
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.IStep#isStepping()
*/
public boolean isStepping() {
return getPendingStepHandler() != null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
*/
public boolean isSuspended() {
return !fRunning && !fTerminated;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#isSystemThread()
*/
public boolean isSystemThread() {
return fIsSystemThread;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#isDaemon()
*/
public boolean isDaemon() throws DebugException {
return fIsDaemon;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#getThreadGroupName()
*/
public String getThreadGroupName() throws DebugException {
if (fThreadGroupName == null) {
- ThreadGroupReference tgr= getUnderlyingThreadGroup();
-
+ ThreadGroupReference tgr = getUnderlyingThreadGroup();
+
// bug# 20370
if (tgr == null) {
return null;
}
-
+
try {
fThreadGroupName = tgr.name();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_thread_group_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_thread_group_name,
+ e.toString()), e);
// execution will not reach this line, as
// #targetRequestFailed will thrown an exception
return null;
@@ -1249,52 +1424,60 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
return fThreadGroupName;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ITerminate#isTerminated()
*/
public boolean isTerminated() {
return fTerminated;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#isOutOfSynch()
*/
public synchronized boolean isOutOfSynch() throws DebugException {
- if (isSuspended() && ((JDIDebugTarget)getDebugTarget()).hasHCRFailed()) {
- List frames= computeStackFrames();
- Iterator iter= frames.iterator();
- while (iter.hasNext()) {
- if (((JDIStackFrame) iter.next()).isOutOfSynch()) {
+ if (isSuspended() && ((JDIDebugTarget) getDebugTarget()).hasHCRFailed()) {
+ List<IJavaStackFrame> frames = computeStackFrames();
+ for(IJavaStackFrame frame : frames) {
+ if(((JDIStackFrame)frame).isOutOfSynch()) {
return true;
}
}
return false;
}
- // If the thread is not suspended, there's no way to
+ // If the thread is not suspended, there's no way to
// say for certain that it is running out of synch code
return false;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#mayBeOutOfSynch()
*/
public boolean mayBeOutOfSynch() {
if (!isSuspended()) {
- return ((JDIDebugTarget)getDebugTarget()).hasHCRFailed();
+ return ((JDIDebugTarget) getDebugTarget()).hasHCRFailed();
}
return false;
- }
-
+ }
+
/**
* Sets whether this thread is terminated
*
- * @param terminated whether this thread is terminated
+ * @param terminated
+ * whether this thread is terminated
*/
protected void setTerminated(boolean terminated) {
- fTerminated= terminated;
+ fTerminated = terminated;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ISuspendResume#resume()
*/
public synchronized void resume() throws DebugException {
@@ -1305,18 +1488,20 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
resumeThread(true);
}
}
-
+
/**
*
- * Updates the state of this thread, but only fires
- * notification to listeners if <code>fireNotification</code>
- * is <code>true</code>.
+ * Updates the state of this thread, but only fires notification to
+ * listeners if <code>fireNotification</code> is <code>true</code>.
*
* @see ISuspendResume#resume()
- * @param fireNotification if a resume event should be fired
- * @throws DebugException if an exception occurs trying to resume the thread
+ * @param fireNotification
+ * if a resume event should be fired
+ * @throws DebugException
+ * if an exception occurs trying to resume the thread
*/
- private synchronized void resumeThread(boolean fireNotification) throws DebugException {
+ private synchronized void resumeThread(boolean fireNotification)
+ throws DebugException {
if (!isSuspended() || (isPerformingEvaluation() && !isInvokingMethod())) {
return;
}
@@ -1332,46 +1517,45 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
} catch (RuntimeException e) {
setRunning(false);
fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_resuming, new String[] {e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_resuming,
+ e.toString()), e);
}
}
-
+
/**
- * Sets whether this thread is currently executing.
- * When set to <code>true</code>, this thread's current
- * breakpoints are cleared.
+ * Sets whether this thread is currently executing. When set to
+ * <code>true</code>, this thread's current breakpoints are cleared.
*
- * @param running whether this thread is executing
+ * @param running
+ * whether this thread is executing
*/
protected void setRunning(boolean running) {
fRunning = running;
if (running) {
fCurrentBreakpoints.clear();
- }
+ }
}
/**
- * Preserves stack frames to be used on the next suspend event.
- * Iterates through all current stack frames, setting their
- * state as invalid. This method should be called before this thread
- * is resumed, when stack frames are to be re-used when it later
- * suspends.
+ * Preserves stack frames to be used on the next suspend event. Iterates
+ * through all current stack frames, setting their state as invalid. This
+ * method should be called before this thread is resumed, when stack frames
+ * are to be re-used when it later suspends.
*
* @see #computeStackFrames()
*/
protected synchronized void preserveStackFrames() {
fRefreshChildren = true;
- Iterator frames = fStackFrames.iterator();
- while (frames.hasNext()) {
- ((JDIStackFrame)frames.next()).setUnderlyingStackFrame(null);
+ for(IJavaStackFrame frame : fStackFrames) {
+ ((JDIStackFrame)frame).setUnderlyingStackFrame(null);
}
}
/**
- * Disposes stack frames, to be completely re-computed on
- * the next suspend event. This method should be called before
- * this thread is resumed when stack frames are not to be re-used
- * on the next suspend.
+ * Disposes stack frames, to be completely re-computed on the next suspend
+ * event. This method should be called before this thread is resumed when
+ * stack frames are not to be re-used on the next suspend.
*
* @see #computeStackFrames()
*/
@@ -1379,10 +1563,10 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
fStackFrames.clear();
fRefreshChildren = true;
}
-
+
/**
- * This method is synchronized, such that the step request
- * begins before a background evaluation can be performed.
+ * This method is synchronized, such that the step request begins before a
+ * background evaluation can be performed.
*
* @see IStep#stepInto()
*/
@@ -1396,9 +1580,9 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
handler.step();
}
- /**
- * This method is synchronized, such that the step request
- * begins before a background evaluation can be performed.
+ /**
+ * This method is synchronized, such that the step request begins before a
+ * background evaluation can be performed.
*
* @see IStep#stepOver()
*/
@@ -1413,8 +1597,8 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
/**
- * This method is synchronized, such that the step request
- * begins before a background evaluation can be performed.
+ * This method is synchronized, such that the step request begins before a
+ * background evaluation can be performed.
*
* @see IStep#stepReturn()
*/
@@ -1427,45 +1611,51 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
StepHandler handler = new StepReturnHandler();
handler.step();
}
-
+
protected void setOriginalStepKind(int stepKind) {
fOriginalStepKind = stepKind;
}
-
+
protected int getOriginalStepKind() {
return fOriginalStepKind;
}
-
+
protected void setOriginalStepLocation(Location location) {
fOriginalStepLocation = location;
}
-
+
protected Location getOriginalStepLocation() {
return fOriginalStepLocation;
}
-
+
protected void setOriginalStepStackDepth(int depth) {
fOriginalStepStackDepth = depth;
}
-
+
protected int getOriginalStepStackDepth() {
return fOriginalStepStackDepth;
}
-
- /**
- * In cases where a user-requested step into encounters nothing but filtered code
- * (static initializers, synthetic methods, etc.), the default JDI behavior is to
- * put the instruction pointer back where it was before the step into. This requires
- * a second step to move forward. Since this is confusing to the user, we do an
- * extra step into in such situations. This method determines when such an extra
- * step into is necessary. It compares the current Location to the original
- * Location when the user step into was initiated. It also makes sure the stack depth
- * now is the same as when the step was initiated.
- * @param location the location to consider
- * @return <code>true</code> if we should do an extra step, <code>false</code> otherwise
- * @throws DebugException if an exception occurs
- */
- protected boolean shouldDoExtraStepInto(Location location) throws DebugException {
+
+ /**
+ * In cases where a user-requested step into encounters nothing but filtered
+ * code (static initializers, synthetic methods, etc.), the default JDI
+ * behavior is to put the instruction pointer back where it was before the
+ * step into. This requires a second step to move forward. Since this is
+ * confusing to the user, we do an extra step into in such situations. This
+ * method determines when such an extra step into is necessary. It compares
+ * the current Location to the original Location when the user step into was
+ * initiated. It also makes sure the stack depth now is the same as when the
+ * step was initiated.
+ *
+ * @param location
+ * the location to consider
+ * @return <code>true</code> if we should do an extra step,
+ * <code>false</code> otherwise
+ * @throws DebugException
+ * if an exception occurs
+ */
+ protected boolean shouldDoExtraStepInto(Location location)
+ throws DebugException {
if (getOriginalStepKind() != StepRequest.STEP_INTO) {
return false;
}
@@ -1475,28 +1665,33 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
Location origLocation = getOriginalStepLocation();
if (origLocation == null) {
return false;
- }
- // We cannot simply check if the two Locations are equal using the equals()
- // method, since this checks the code index within the method. Even if the
- // code indices are different, the line numbers may be the same, in which case
+ }
+ // We cannot simply check if the two Locations are equal using the
+ // equals()
+ // method, since this checks the code index within the method. Even if
+ // the
+ // code indices are different, the line numbers may be the same, in
+ // which case
// we need to do the extra step into.
Method origMethod = origLocation.method();
Method currMethod = location.method();
if (!origMethod.equals(currMethod)) {
return false;
- }
+ }
if (origLocation.lineNumber() != location.lineNumber()) {
return false;
- }
+ }
return true;
}
-
+
/**
* Determines if a user did a step into and stepped through filtered code.
- * In this case, do a step return if the user has requested not to
- * step thru to an unfiltered location.
+ * In this case, do a step return if the user has requested not to step thru
+ * to an unfiltered location.
+ *
* @return <code>true</code> if we should do a step return
- * @throws DebugException if an exception occurs
+ * @throws DebugException
+ * if an exception occurs
*/
protected boolean shouldDoStepReturn() throws DebugException {
if (getOriginalStepKind() == StepRequest.STEP_INTO) {
@@ -1505,15 +1700,17 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
}
return false;
- }
-
- /* (non-Javadoc)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.core.model.ISuspendResume#suspend()
*/
public void suspend() throws DebugException {
// prepare for the suspend request
prepareForClientSuspend();
-
+
synchronized (this) {
try {
// Abort any pending step request
@@ -1522,25 +1719,28 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
} catch (RuntimeException e) {
fClientSuspendRequest = false;
setRunning(true);
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_suspending, new String[] {e.toString()}), e);
- }
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_suspending,
+ e.toString()), e);
+ }
}
}
-
+
/**
- * Prepares to suspend this thread as requested by a client. Terminates any current
- * evaluation (to stop after next instruction). Waits for any method invocations
- * to complete.
+ * Prepares to suspend this thread as requested by a client. Terminates any
+ * current evaluation (to stop after next instruction). Waits for any method
+ * invocations to complete.
*
- * @throws DebugException if thread does not suspend before timeout
+ * @throws DebugException
+ * if thread does not suspend before timeout
*/
protected void prepareForClientSuspend() throws DebugException {
// note that a suspend request has started
synchronized (this) {
- // this will abort notification to pending breakpoint listeners
+ // this will abort notification to pending breakpoint listeners
fClientSuspendRequest = true;
}
-
+
synchronized (fEvaluationLock) {
// terminate active evaluation, if any
if (fEvaluationRunnable != null) {
@@ -1549,7 +1749,11 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
((ITerminate) fEvaluationRunnable).terminate();
}
// wait for termination to complete
- int timeout = JDIDebugModel.getPreferences().getInt(JDIDebugModel.PREF_REQUEST_TIMEOUT);
+ int timeout = Platform.getPreferencesService().getInt(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugModel.PREF_REQUEST_TIMEOUT,
+ JDIDebugModel.DEF_REQUEST_TIMEOUT,
+ null);
try {
fEvaluationLock.wait(timeout);
} catch (InterruptedException e) {
@@ -1558,13 +1762,18 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
fClientSuspendRequest = false;
targetRequestFailed(JDIDebugModelMessages.JDIThread_1, null);
}
- }
+ }
}
-
- // first wait for any method invocation in progress to complete its method invocation
+
+ // first wait for any method invocation in progress to complete its
+ // method invocation
synchronized (fInvocationLock) {
if (isInvokingMethod()) {
- int timeout = JDIDebugModel.getPreferences().getInt(JDIDebugModel.PREF_REQUEST_TIMEOUT);
+ int timeout = Platform.getPreferencesService().getInt(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugModel.PREF_REQUEST_TIMEOUT,
+ JDIDebugModel.DEF_REQUEST_TIMEOUT,
+ null);
try {
fInvocationLock.wait(timeout);
} catch (InterruptedException e) {
@@ -1575,9 +1784,9 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
targetRequestFailed(JDIDebugModelMessages.JDIThread_1, null);
}
}
- }
+ }
}
-
+
/**
* Suspends the underlying thread asynchronously and fires notification when
* the underlying thread is suspended.
@@ -1590,27 +1799,37 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
return;
}
- fIsSuspending= true;
- Thread thread= new Thread(new Runnable() {
+ fIsSuspending = true;
+ Thread thread = new Thread(new Runnable() {
public void run() {
try {
fThread.suspend();
- int timeout= JDIDebugModel.getPreferences().getInt(JDIDebugModel.PREF_REQUEST_TIMEOUT);
- long stop= System.currentTimeMillis() + timeout;
- boolean suspended= isUnderlyingThreadSuspended();
+ int timeout = Platform.getPreferencesService().getInt(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugModel.PREF_REQUEST_TIMEOUT,
+ JDIDebugModel.DEF_REQUEST_TIMEOUT,
+ null);
+ long stop = System.currentTimeMillis() + timeout;
+ boolean suspended = isUnderlyingThreadSuspended();
while (System.currentTimeMillis() < stop && !suspended) {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
}
- suspended= isUnderlyingThreadSuspended();
+ suspended = isUnderlyingThreadSuspended();
if (suspended) {
break;
}
}
if (!suspended) {
- IStatus status= new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), SUSPEND_TIMEOUT, MessageFormat.format(JDIDebugModelMessages.JDIThread_suspend_timeout, new String[] {new Integer(timeout).toString()}), null);
- IStatusHandler handler= DebugPlugin.getDefault().getStatusHandler(status);
+ IStatus status = new Status(
+ IStatus.ERROR,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ SUSPEND_TIMEOUT,
+ MessageFormat.format(JDIDebugModelMessages.JDIThread_suspend_timeout, new Integer(timeout).toString()),
+ null);
+ IStatusHandler handler = DebugPlugin.getDefault()
+ .getStatusHandler(status);
if (handler != null) {
try {
handler.handleStatus(status, JDIThread.this);
@@ -1622,30 +1841,30 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
} catch (RuntimeException exception) {
} finally {
- fIsSuspending= false;
+ fIsSuspending = false;
}
}
});
thread.setDaemon(true);
thread.start();
}
-
+
public boolean isUnderlyingThreadSuspended() {
return fThread.isSuspended();
}
/**
- * Notifies this thread that it has been suspended due
- * to a VM suspend.
- */
+ * Notifies this thread that it has been suspended due to a VM suspend.
+ */
protected synchronized void suspendedByVM() {
setRunning(false);
}
/**
- * Notifies this thread that is about to be resumed due
- * to a VM resume.
- * @throws DebugException if an exception occurs
+ * Notifies this thread that is about to be resumed due to a VM resume.
+ *
+ * @throws DebugException
+ * if an exception occurs
*/
protected synchronized void resumedByVM() throws DebugException {
fClientSuspendRequest = false;
@@ -1655,7 +1874,7 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
// To ensure that all threads will fully resume when the VM
// is resumed, make sure the suspend count of each thread
// is no greater than 1. @see Bugs 23328 and 27622
- ThreadReference thread= fThread;
+ ThreadReference thread = fThread;
try {
while (thread.suspendCount() > 1) {
thread.resume();
@@ -1663,10 +1882,12 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
} catch (ObjectCollectedException e) {
} catch (VMDisconnectedException e) {
disconnected();
- }catch (RuntimeException e) {
+ } catch (RuntimeException e) {
setRunning(false);
fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_resuming, new String[] {e.toString()}), e); //
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_resuming,
+ e.toString()), e); //
}
}
@@ -1680,17 +1901,20 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
/**
* Drops to the given stack frame
- * @param frame the stack frame to try dropping to
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @param frame
+ * the stack frame to try dropping to
+ *
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected void dropToFrame(IStackFrame frame) throws DebugException {
- JDIDebugTarget target= (JDIDebugTarget) getDebugTarget();
+ JDIDebugTarget target = (JDIDebugTarget) getDebugTarget();
if (target.canPopFrames()) {
// JDK 1.4 support
try {
@@ -1698,77 +1922,90 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
popFrame(frame);
stepInto();
} catch (RuntimeException exception) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_dropping_to_frame, new String[] {exception.toString()}),exception);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_dropping_to_frame,
+ exception.toString()),
+ exception);
}
} else {
// J9 support
// This block is synchronized, such that the step request
- // begins before a background evaluation can be performed.
+ // begins before a background evaluation can be performed.
synchronized (this) {
StepHandler handler = new DropToFrameHandler(frame);
handler.step();
}
}
}
-
+
protected void popFrame(IStackFrame frame) throws DebugException {
- JDIDebugTarget target= (JDIDebugTarget)getDebugTarget();
+ JDIDebugTarget target = (JDIDebugTarget) getDebugTarget();
if (target.canPopFrames()) {
// JDK 1.4 support
try {
// Pop the frame and all frames above it
- StackFrame jdiFrame= null;
- int desiredSize= fStackFrames.size() - fStackFrames.indexOf(frame) - 1;
- int lastSize= fStackFrames.size() + 1; // Set up to pass the first test
- int size= fStackFrames.size();
+ StackFrame jdiFrame = null;
+ int desiredSize = fStackFrames.size()
+ - fStackFrames.indexOf(frame) - 1;
+ int lastSize = fStackFrames.size() + 1; // Set up to pass the
+ // first test
+ int size = fStackFrames.size();
while (size < lastSize && size > desiredSize) {
// Keep popping frames until the stack stops getting smaller
// or popFrame is gone.
// see Bug 8054
- jdiFrame = ((JDIStackFrame) frame).getUnderlyingStackFrame();
+ jdiFrame = ((JDIStackFrame) frame)
+ .getUnderlyingStackFrame();
preserveStackFrames();
fThread.popFrames(jdiFrame);
- lastSize= size;
- size= computeStackFrames().size();
+ lastSize = size;
+ size = computeStackFrames().size();
}
} catch (IncompatibleThreadStateException exception) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_popping, new String[] {exception.toString()}),exception);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_popping,
+ exception.toString()), exception);
} catch (InvalidStackFrameException exception) {
// InvalidStackFrameException can be thrown when all but the
// deepest frame were popped. Fire a changed notification
// in case this has occurred.
fireChangeEvent(DebugEvent.CONTENT);
- targetRequestFailed(exception.toString(),exception);
+ targetRequestFailed(exception.toString(), exception);
} catch (RuntimeException exception) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_popping, new String[] {exception.toString()}),exception);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_popping,
+ exception.toString()), exception);
}
}
}
-
+
/**
- * Steps until the specified stack frame is the top frame. Provides
- * ability to step over/return in the non-top stack frame.
- * This method is synchronized, such that the step request
- * begins before a background evaluation can be performed.
+ * Steps until the specified stack frame is the top frame. Provides ability
+ * to step over/return in the non-top stack frame. This method is
+ * synchronized, such that the step request begins before a background
+ * evaluation can be performed.
*
- * @param frame the stack frame to try and step to
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @param frame
+ * the stack frame to try and step to
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected void stepToFrame(IStackFrame frame) throws DebugException {
synchronized (this) {
if (!canStepReturn()) {
return;
- }
+ }
}
StepHandler handler = new StepToFrameHandler(frame);
handler.step();
}
-
+
/**
* Aborts the current step, if any.
*/
@@ -1779,22 +2016,26 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaThread#findVariable(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaThread#findVariable(java.lang.String)
*/
public IJavaVariable findVariable(String varName) throws DebugException {
if (isSuspended()) {
try {
- IStackFrame[] stackFrames= getStackFrames();
- for (int i = 0; i < stackFrames.length; i++) {
- IJavaStackFrame sf= (IJavaStackFrame)stackFrames[i];
- IJavaVariable var= sf.findVariable(varName);
+ IStackFrame[] stackFrames = getStackFrames();
+ for (IStackFrame stackFrame : stackFrames) {
+ IJavaStackFrame sf = (IJavaStackFrame) stackFrame;
+ IJavaVariable var = sf.findVariable(varName);
if (var != null) {
return var;
}
}
} catch (DebugException e) {
- // if the thread has since resumed, return null (no need to report error)
+ // if the thread has since resumed, return null (no need to
+ // report error)
if (e.getStatus().getCode() != IJavaThread.ERR_THREAD_NOT_SUSPENDED) {
throw e;
}
@@ -1802,58 +2043,63 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
return null;
}
-
+
/**
- * Notification this thread has terminated - update state
- * and fire a terminate event.
+ * Notification this thread has terminated - update state and fire a
+ * terminate event.
*/
protected void terminated() {
setTerminated(true);
- setRunning(false);
+ setRunning(false);
fireTerminateEvent();
}
-
- /**
- * Returns this thread on the underlying VM which this
- * model thread is a proxy to.
+
+ /**
+ * Returns this thread on the underlying VM which this model thread is a
+ * proxy to.
*
* @return underlying thread
*/
public ThreadReference getUnderlyingThread() {
return fThread;
}
-
+
/**
- * Sets the underlying thread that this model object
- * is a proxy to.
+ * Sets the underlying thread that this model object is a proxy to.
*
- * @param thread underlying thread on target VM
+ * @param thread
+ * underlying thread on target VM
*/
protected void setUnderlyingThread(ThreadReference thread) {
fThread = thread;
}
-
- /**
+
+ /**
* Returns this thread's underlying thread group.
*
* @return thread group
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>Retrieving the underlying thread group is not supported
- * on the underlying VM</li>
- * </ul>
- */
- protected ThreadGroupReference getUnderlyingThreadGroup() throws DebugException {
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>Retrieving the underlying thread group is not
+ * supported on the underlying VM</li>
+ * </ul>
+ */
+ protected ThreadGroupReference getUnderlyingThreadGroup()
+ throws DebugException {
if (fThreadGroup == null) {
try {
fThreadGroup = fThread.threadGroup();
} catch (UnsupportedOperationException e) {
- requestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_thread_group, new String[] {e.toString()}), e);
+ requestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_thread_group,
+ e.toString()), e);
// execution will not reach this line, as
- // #requestFailed will throw an exception
+ // #requestFailed will throw an exception
return null;
} catch (VMDisconnectedException e) {
// ignore disconnect
@@ -1862,40 +2108,46 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
// ignore object collected
return null;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_retrieving_thread_group, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_retrieving_thread_group,
+ e.toString()), e);
// execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ // #targetRequestFailed will throw an exception
return null;
}
}
return fThreadGroup;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#isPerformingEvaluation()
*/
public boolean isPerformingEvaluation() {
return fEvaluationRunnable != null;
}
-
+
/**
- * Returns whether this thread is currently performing
- * a method invocation
+ * Returns whether this thread is currently performing a method invocation
+ *
* @return if the thread is currently invoking a method
*/
public boolean isInvokingMethod() {
return fIsInvokingMethod;
}
-
+
/**
- * Returns whether this thread is currently ignoring
- * breakpoints.
+ * Returns whether this thread is currently ignoring breakpoints.
+ *
* @return if the thread is currently ignoring breakpoints
*/
public boolean isIgnoringBreakpoints() {
- return !fHonorBreakpoints || fSuspendVoteInProgress || hasClientRequestedSuspend();
+ return !fHonorBreakpoints || fSuspendVoteInProgress
+ || hasClientRequestedSuspend();
}
-
+
/**
* Returns whether a client has requested the target/thread to suspend.
*
@@ -1904,45 +2156,43 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
public boolean hasClientRequestedSuspend() {
return fClientSuspendRequest;
}
-
+
/**
- * Sets whether this thread is currently invoking a method. Notifies
- * any threads waiting for the method invocation lock
+ * Sets whether this thread is currently invoking a method. Notifies any
+ * threads waiting for the method invocation lock
*
- * @param invoking whether this thread is currently
- * invoking a method
+ * @param invoking
+ * whether this thread is currently invoking a method
*/
protected void setInvokingMethod(boolean invoking) {
synchronized (fInvocationLock) {
- fIsInvokingMethod= invoking;
+ fIsInvokingMethod = invoking;
if (!invoking) {
fInvocationLock.notifyAll();
}
}
}
-
+
/**
- * Sets the step handler currently handling a step
- * request.
+ * Sets the step handler currently handling a step request.
*
- * @param handler the current step handler, or <code>null</code>
- * if none
+ * @param handler
+ * the current step handler, or <code>null</code> if none
*/
protected void setPendingStepHandler(StepHandler handler) {
fStepHandler = handler;
}
-
+
/**
- * Returns the step handler currently handling a step
- * request, or <code>null</code> if none.
+ * Returns the step handler currently handling a step request, or
+ * <code>null</code> if none.
*
* @return step handler, or <code>null</code> if none
*/
protected StepHandler getPendingStepHandler() {
return fStepHandler;
}
-
-
+
/**
* Helper class to perform stepping an a thread.
*/
@@ -1951,34 +2201,34 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
* Request for stepping in the underlying VM
*/
private StepRequest fStepRequest;
-
+
/**
- * Initiates a step in the underlying VM by creating a step
- * request of the appropriate kind (over, into, return),
- * and resuming this thread. When a step is initiated it
- * is registered with its thread as a pending step. A pending
- * step could be cancelled if a breakpoint suspends execution
- * during the step.
+ * Initiates a step in the underlying VM by creating a step request of
+ * the appropriate kind (over, into, return), and resuming this thread.
+ * When a step is initiated it is registered with its thread as a
+ * pending step. A pending step could be cancelled if a breakpoint
+ * suspends execution during the step.
* <p>
- * This thread's state is set to running and stepping, and
- * stack frames are invalidated (but preserved to be re-used
- * when the step completes). A resume event with a step detail
- * is fired for this thread.
+ * This thread's state is set to running and stepping, and stack frames
+ * are invalidated (but preserved to be re-used when the step
+ * completes). A resume event with a step detail is fired for this
+ * thread.
* </p>
* Note this method does nothing if this thread has no stack frames.
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected void step() throws DebugException {
ISchedulingRule rule = getThreadRule();
try {
Job.getJobManager().beginRule(rule, null);
- JDIStackFrame top = (JDIStackFrame)getTopStackFrame();
+ JDIStackFrame top = (JDIStackFrame) getTopStackFrame();
if (top == null) {
return;
}
@@ -1997,18 +2247,19 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
Job.getJobManager().endRule(rule);
}
}
-
+
/**
- * Resumes the underlying thread to initiate the step.
- * By default the thread is resumed. Step handlers that
- * require other actions can override this method.
+ * Resumes the underlying thread to initiate the step. By default the
+ * thread is resumed. Step handlers that require other actions can
+ * override this method.
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected void invokeThread() throws DebugException {
try {
@@ -2019,107 +2270,122 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
} catch (RuntimeException e) {
stepEnd(null);
fireSuspendEvent(DebugEvent.STEP_END);
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_stepping, new String[] {e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_stepping,
+ e.toString()), e);
}
}
-
+
/**
- * Creates and returns a step request specific to this step
- * handler. Subclasses must override <code>getStepKind()</code>
- * to return the kind of step it implements.
+ * Creates and returns a step request specific to this step handler.
+ * Subclasses must override <code>getStepKind()</code> to return the
+ * kind of step it implements.
*
* @return step request
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected StepRequest createStepRequest() throws DebugException {
return createStepRequest(getStepKind());
}
-
+
/**
* Creates and returns a step request of the specified kind.
*
- * @param kind of <code>StepRequest.STEP_INTO</code>,
- * <code>StepRequest.STEP_OVER</code>, <code>StepRequest.STEP_OUT</code>
+ * @param kind
+ * of <code>StepRequest.STEP_INTO</code>,
+ * <code>StepRequest.STEP_OVER</code>,
+ * <code>StepRequest.STEP_OUT</code>
* @return step request
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected StepRequest createStepRequest(int kind) throws DebugException {
EventRequestManager manager = getEventRequestManager();
if (manager == null) {
- requestFailed(JDIDebugModelMessages.JDIThread_Unable_to_create_step_request___VM_disconnected__1, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Unable_to_create_step_request___VM_disconnected__1,
+ null);
}
try {
- StepRequest request = manager.createStepRequest(fThread, StepRequest.STEP_LINE, kind);
+ StepRequest request = manager.createStepRequest(fThread,
+ StepRequest.STEP_LINE, kind);
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
request.addCountFilter(1);
attachFiltersToStepRequest(request);
request.enable();
return request;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_creating_step_request, new String[] {e.toString()}), e);
- }
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_creating_step_request,
+ e.toString()), e);
+ }
// this line will never be executed, as the try block
- // will either return, or the catch block will throw
+ // will either return, or the catch block will throw
// an exception
return null;
-
+
}
-
+
/**
* Returns the kind of step this handler implements.
*
* @return one of <code>StepRequest.STEP_INTO</code>,
- * <code>StepRequest.STEP_OVER</code>, <code>StepRequest.STEP_OUT</code>
+ * <code>StepRequest.STEP_OVER</code>,
+ * <code>StepRequest.STEP_OUT</code>
*/
protected abstract int getStepKind();
-
+
/**
* Returns the detail for this step event.
*
* @return one of <code>DebugEvent.STEP_INTO</code>,
- * <code>DebugEvent.STEP_OVER</code>, <code>DebugEvent.STEP_RETURN</code>
+ * <code>DebugEvent.STEP_OVER</code>,
+ * <code>DebugEvent.STEP_RETURN</code>
*/
- protected abstract int getStepDetail();
-
+ protected abstract int getStepDetail();
+
/**
- * Sets the step request created by this handler in
- * the underlying VM. Set to <code>null<code> when
+ * Sets the step request created by this handler in the underlying VM.
+ * Set to <code>null<code> when
* this handler deletes its request.
*
- * @param request step request
+ * @param request
+ * step request
*/
protected void setStepRequest(StepRequest request) {
- fStepRequest = request;
+ fStepRequest = request;
}
-
+
/**
- * Returns the step request created by this handler in
- * the underlying VM.
+ * Returns the step request created by this handler in the underlying
+ * VM.
*
* @return step request
*/
protected StepRequest getStepRequest() {
return fStepRequest;
}
-
+
/**
- * Deletes this handler's step request from the underlying VM
- * and removes this handler as an event listener.
+ * Deletes this handler's step request from the underlying VM and
+ * removes this handler as an event listener.
*/
protected void deleteStepRequest() {
try {
StepRequest req = getStepRequest();
- if(req != null) {
+ if (req != null) {
removeJDIEventListener(this, req);
EventRequestManager manager = getEventRequestManager();
if (manager != null) {
@@ -2128,71 +2394,75 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
} catch (RuntimeException e) {
logError(e);
- }
- finally {
+ } finally {
setStepRequest(null);
}
}
-
+
/**
- * If step filters are currently switched on and the current location is not a filtered
- * location, set all active filters on the step request.
- * @param request the request to augment
+ * If step filters are currently switched on and the current location is
+ * not a filtered location, set all active filters on the step request.
+ *
+ * @param request
+ * the request to augment
*/
protected void attachFiltersToStepRequest(StepRequest request) {
-
+
if (applyStepFilters() && isStepFiltersEnabled()) {
- Location currentLocation= getOriginalStepLocation();
- if (currentLocation == null || !JAVA_STRATUM_CONSTANT.equals(currentLocation.declaringType().defaultStratum())) {
+ Location currentLocation = getOriginalStepLocation();
+ if (currentLocation == null
+ || !JAVA_STRATUM_CONSTANT.equals(currentLocation
+ .declaringType().defaultStratum())) {
return;
}
-// Removed the fix for bug 5587, to address bug 41510
-// //check if the user has already stopped in a filtered location
-// //is so do not filter @see bug 5587
-// ReferenceType type= currentLocation.declaringType();
-// String typeName= type.name();
+ // Removed the fix for bug 5587, to address bug 41510
+ // //check if the user has already stopped in a filtered
+ // location
+ // //is so do not filter @see bug 5587
+ // ReferenceType type= currentLocation.declaringType();
+ // String typeName= type.name();
String[] activeFilters = getJavaDebugTarget().getStepFilters();
-// for (int i = 0; i < activeFilters.length; i++) {
-// StringMatcher matcher = new StringMatcher(activeFilters[i], false, false);
-// if (matcher.match(typeName)) {
-// return;
-// }
-// }
+ // for (int i = 0; i < activeFilters.length; i++) {
+ // StringMatcher matcher = new StringMatcher(activeFilters[i],
+ // false, false);
+ // if (matcher.match(typeName)) {
+ // return;
+ // }
+ // }
if (activeFilters != null) {
- for (int i = 0; i < activeFilters.length; i++) {
- request.addClassExclusionFilter(activeFilters[i]);
- }
+ for (String activeFilter : activeFilters) {
+ request.addClassExclusionFilter(activeFilter);
+ }
}
}
}
-
+
/**
- * Returns whether this step handler should use step
- * filters when creating its step request. By default,
- * step filters can be used by any step request.
- * Subclasses must override if/when required.
+ * Returns whether this step handler should use step filters when
+ * creating its step request. By default, step filters can be used by
+ * any step request. Subclasses must override if/when required.
*
- * @return whether this step handler should use step
- * filters when creating its step request
+ * @return whether this step handler should use step filters when
+ * creating its step request
*/
protected boolean applyStepFilters() {
return true;
}
-
+
/**
- * Notification the step request has completed.
- * If the current location matches one of the user-specified
- * step filter criteria (e.g., synthetic methods, static initializers),
- * then continue stepping.
+ * Notification the step request has completed. If the current location
+ * matches one of the user-specified step filter criteria (e.g.,
+ * synthetic methods, static initializers), then continue stepping.
*
- * @see IJDIEventListener#handleEvent(Event, JDIDebugTarget, boolean, EventSet)
+ * @see IJDIEventListener#handleEvent(Event, JDIDebugTarget, boolean,
+ * EventSet)
*/
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet) {
try {
StepEvent stepEvent = (StepEvent) event;
Location currentLocation = stepEvent.location();
-
if (!target.isStepThruFilters()) {
if (shouldDoStepReturn()) {
deleteStepRequest();
@@ -2200,15 +2470,17 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
return true;
}
}
- // if the ending step location is filtered and we did not start from
+ // if the ending step location is filtered and we did not start
+ // from
// a filtered location, or if we're back where
// we started on a step into, do another step of the same kind
- if (locationShouldBeFiltered(currentLocation) || shouldDoExtraStepInto(currentLocation)) {
+ if (locationShouldBeFiltered(currentLocation)
+ || shouldDoExtraStepInto(currentLocation)) {
setRunning(true);
deleteStepRequest();
- createSecondaryStepRequest();
- return true;
- // otherwise, we're done stepping
+ createSecondaryStepRequest();
+ return true;
+ // otherwise, we're done stepping
}
stepEnd(eventSet);
return false;
@@ -2218,72 +2490,93 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
return false;
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete(com.sun.jdi.event.Event, org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.IJDIEventListener#eventSetComplete
+ * (com.sun.jdi.event.Event,
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, boolean)
*/
- public void eventSetComplete(Event event, JDIDebugTarget target, boolean suspend, EventSet eventSet) {
+ public void eventSetComplete(Event event, JDIDebugTarget target,
+ boolean suspend, EventSet eventSet) {
// do nothing
}
/**
- * Returns <code>true</code> if the StepEvent's Location is a Method that the
- * user has indicated (via the step filter preferences) should be
- * filtered and the step was not initiated from a filtered location.
+ * Returns <code>true</code> if the StepEvent's Location is a Method
+ * that the user has indicated (via the step filter preferences) should
+ * be filtered and the step was not initiated from a filtered location.
* Returns <code>false</code> otherwise.
- * @param location the location to check
+ *
+ * @param location
+ * the location to check
* @return if the given {@link Location} should be filtered
- * @throws DebugException if an exception occurs
+ * @throws DebugException
+ * if an exception occurs
*/
- protected boolean locationShouldBeFiltered(Location location) throws DebugException {
+ protected boolean locationShouldBeFiltered(Location location)
+ throws DebugException {
if (applyStepFilters()) {
- Location origLocation= getOriginalStepLocation();
+ Location origLocation = getOriginalStepLocation();
if (origLocation != null) {
- return !locationIsFiltered(origLocation.method()) && locationIsFiltered(location.method());
+ return !locationIsFiltered(origLocation.method())
+ && locationIsFiltered(location.method());
}
}
return false;
}
+
/**
- * Returns <code>true</code> if the StepEvent's Location is a Method that the
- * user has indicated (via the step filter preferences) should be
- * filtered. Returns <code>false</code> otherwise.
- * @param method the {@link Method} location to check
- * @return <code>true</code> if the {@link Method} {@link Location} should be filtered, <code>false</code> otherwise
+ * Returns <code>true</code> if the StepEvent's Location is a Method
+ * that the user has indicated (via the step filter preferences) should
+ * be filtered. Returns <code>false</code> otherwise.
+ *
+ * @param method
+ * the {@link Method} location to check
+ * @return <code>true</code> if the {@link Method} {@link Location}
+ * should be filtered, <code>false</code> otherwise
*/
protected boolean locationIsFiltered(Method method) {
if (isStepFiltersEnabled()) {
- boolean filterStatics = getJavaDebugTarget().isFilterStaticInitializers();
- boolean filterSynthetics = getJavaDebugTarget().isFilterSynthetics();
- boolean filterConstructors = getJavaDebugTarget().isFilterConstructors();
+ boolean filterStatics = getJavaDebugTarget()
+ .isFilterStaticInitializers();
+ boolean filterSynthetics = getJavaDebugTarget()
+ .isFilterSynthetics();
+ boolean filterConstructors = getJavaDebugTarget()
+ .isFilterConstructors();
boolean filterSetters = getJavaDebugTarget().isFilterSetters();
boolean filterGetters = getJavaDebugTarget().isFilterGetters();
- if (!(filterStatics || filterSynthetics || filterConstructors || filterGetters || filterSetters)) {
+ if (!(filterStatics || filterSynthetics || filterConstructors
+ || filterGetters || filterSetters)) {
return false;
- }
-
- if ((filterStatics && method.isStaticInitializer()) ||
- (filterSynthetics && method.isSynthetic()) ||
- (filterConstructors && method.isConstructor()) ||
- (filterGetters && JDIMethod.isGetterMethod(method)) ||
- (filterSetters && JDIMethod.isSetterMethod(method))) {
- return true;
+ }
+
+ if ((filterStatics && method.isStaticInitializer())
+ || (filterSynthetics && method.isSynthetic())
+ || (filterConstructors && method.isConstructor())
+ || (filterGetters && JDIMethod.isGetterMethod(method))
+ || (filterSetters && JDIMethod.isSetterMethod(method))) {
+ return true;
}
}
-
+
return false;
}
/**
- * Cleans up when a step completes.<ul>
+ * Cleans up when a step completes.
+ * <ul>
* <li>Thread state is set to suspended.</li>
* <li>Stepping state is set to false</li>
* <li>Stack frames and variables are incrementally updated</li>
- * <li>The step request is deleted and removed as
- * and event listener</li>
+ * <li>The step request is deleted and removed as and event listener</li>
* <li>A suspend event is fired</li>
* </ul>
- * @param set the remaining {@link EventSet} to queue
+ *
+ * @param set
+ * the remaining {@link EventSet} to queue
*/
protected void stepEnd(EventSet set) {
setRunning(false);
@@ -2293,54 +2586,57 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
queueSuspendEvent(DebugEvent.STEP_END, set);
}
}
-
+
/**
* Creates another step request in the underlying thread of the
- * appropriate kind (over, into, return). This thread will
- * be resumed by the event dispatcher as this event handler
- * will vote to resume suspended threads. When a step is
- * initiated it is registered with its thread as a pending
- * step. A pending step could be cancelled if a breakpoint
- * suspends execution during the step.
+ * appropriate kind (over, into, return). This thread will be resumed by
+ * the event dispatcher as this event handler will vote to resume
+ * suspended threads. When a step is initiated it is registered with its
+ * thread as a pending step. A pending step could be cancelled if a
+ * breakpoint suspends execution during the step.
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected void createSecondaryStepRequest() throws DebugException {
- createSecondaryStepRequest(getStepKind());
+ createSecondaryStepRequest(getStepKind());
}
-
+
/**
* Creates another step request in the underlying thread of the
- * specified kind (over, into, return). This thread will
- * be resumed by the event dispatcher as this event handler
- * will vote to resume suspended threads. When a step is
- * initiated it is registered with its thread as a pending
- * step. A pending step could be cancelled if a breakpoint
- * suspends execution during the step.
+ * specified kind (over, into, return). This thread will be resumed by
+ * the event dispatcher as this event handler will vote to resume
+ * suspended threads. When a step is initiated it is registered with its
+ * thread as a pending step. A pending step could be cancelled if a
+ * breakpoint suspends execution during the step.
*
- * @param kind of <code>StepRequest.STEP_INTO</code>,
- * <code>StepRequest.STEP_OVER</code>, <code>StepRequest.STEP_OUT</code>
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @param kind
+ * of <code>StepRequest.STEP_INTO</code>,
+ * <code>StepRequest.STEP_OVER</code>,
+ * <code>StepRequest.STEP_OUT</code>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
- protected void createSecondaryStepRequest(int kind) throws DebugException {
+ protected void createSecondaryStepRequest(int kind)
+ throws DebugException {
setStepRequest(createStepRequest(kind));
setPendingStepHandler(this);
- addJDIEventListener(this, getStepRequest());
- }
-
+ addJDIEventListener(this, getStepRequest());
+ }
+
/**
- * Aborts this step request if active. The step event
- * request is deleted from the underlying VM.
+ * Aborts this step request if active. The step event request is deleted
+ * from the underlying VM.
*/
protected void abort() {
if (getStepRequest() != null) {
@@ -2348,140 +2644,172 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
setPendingStepHandler(null);
}
}
-}
-
+ }
+
/**
* Handler for step over requests.
*/
class StepOverHandler extends StepHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#getStepKind()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#
+ * getStepKind()
*/
+ @Override
protected int getStepKind() {
return StepRequest.STEP_OVER;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#getStepDetail()
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#
+ * getStepDetail()
*/
+ @Override
protected int getStepDetail() {
return DebugEvent.STEP_OVER;
- }
+ }
}
-
+
/**
* Handler for step into requests.
*/
class StepIntoHandler extends StepHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#getStepKind()
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#
+ * getStepKind()
*/
+ @Override
protected int getStepKind() {
return StepRequest.STEP_INTO;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#getStepDetail()
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#
+ * getStepDetail()
*/
+ @Override
protected int getStepDetail() {
return DebugEvent.STEP_INTO;
}
-
+
}
-
+
/**
* Handler for step return requests.
*/
class StepReturnHandler extends StepHandler {
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#locationShouldBeFiltered(com.sun.jdi.Location)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#
+ * locationShouldBeFiltered(com.sun.jdi.Location)
*/
- protected boolean locationShouldBeFiltered(Location location) throws DebugException {
- // if still at the same depth, do another step return (see bug 38744)
+ @Override
+ protected boolean locationShouldBeFiltered(Location location)
+ throws DebugException {
+ // if still at the same depth, do another step return (see bug
+ // 38744)
if (getOriginalStepStackDepth() == getUnderlyingFrameCount()) {
return true;
}
return super.locationShouldBeFiltered(location);
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#getStepKind()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#
+ * getStepKind()
*/
+ @Override
protected int getStepKind() {
return StepRequest.STEP_OUT;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#getStepDetail()
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler#
+ * getStepDetail()
*/
+ @Override
protected int getStepDetail() {
return DebugEvent.STEP_RETURN;
- }
+ }
}
-
+
/**
- * Handler for stepping to a specific stack frame
- * (stepping in the non-top stack frame). Step returns
- * are performed until a specified stack frame is reached
- * or the thread is suspended (explicitly, or by a
- * breakpoint).
+ * Handler for stepping to a specific stack frame (stepping in the non-top
+ * stack frame). Step returns are performed until a specified stack frame is
+ * reached or the thread is suspended (explicitly, or by a breakpoint).
*/
class StepToFrameHandler extends StepReturnHandler {
-
+
/**
* The number of frames that should be left on the stack
*/
private int fRemainingFrames;
-
+
/**
- * Constructs a step handler to step until the specified
- * stack frame is reached.
+ * Constructs a step handler to step until the specified stack frame is
+ * reached.
*
- * @param frame the stack frame to step to
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @param frame
+ * the stack frame to step to
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected StepToFrameHandler(IStackFrame frame) throws DebugException {
- List frames = computeStackFrames();
+ List<IJavaStackFrame> frames = computeStackFrames();
setRemainingFrames(frames.size() - frames.indexOf(frame));
}
-
+
/**
- * Sets the number of frames that should be
- * remaining on the stack when done.
+ * Sets the number of frames that should be remaining on the stack when
+ * done.
*
- * @param num number of remaining frames
+ * @param num
+ * number of remaining frames
*/
protected void setRemainingFrames(int num) {
fRemainingFrames = num;
}
-
+
/**
- * Returns number of frames that should be
- * remaining on the stack when done
+ * Returns number of frames that should be remaining on the stack when
+ * done
*
* @return number of frames that should be left
*/
protected int getRemainingFrames() {
return fRemainingFrames;
}
-
+
/**
- * Notification the step request has completed.
- * If in the desired frame, complete the step
- * request normally. If not in the desired frame,
- * another step request is created and this thread
- * is resumed.
+ * Notification the step request has completed. If in the desired frame,
+ * complete the step request normally. If not in the desired frame,
+ * another step request is created and this thread is resumed.
*
- * @see IJDIEventListener#handleEvent(Event, JDIDebugTarget, boolean, EventSet)
+ * @see IJDIEventListener#handleEvent(Event, JDIDebugTarget, boolean,
+ * EventSet)
*/
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
+ @Override
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet) {
try {
int numFrames = getUnderlyingFrameCount();
// top of stack should not be null
@@ -2499,46 +2827,47 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
stepEnd(eventSet);
return false;
}
- }
+ }
}
-
+
/**
* Handles dropping to a specified frame.
*/
class DropToFrameHandler extends StepReturnHandler {
-
+
/**
- * The number of frames to drop off the
- * stack.
+ * The number of frames to drop off the stack.
*/
private int fFramesToDrop;
-
+
/**
- * Constructs a handler to drop to the specified
- * stack frame.
+ * Constructs a handler to drop to the specified stack frame.
*
- * @param frame the stack frame to drop to
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
- */
+ * @param frame
+ * the stack frame to drop to
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
+ */
protected DropToFrameHandler(IStackFrame frame) throws DebugException {
- List frames = computeStackFrames();
+ List<IJavaStackFrame> frames = computeStackFrames();
setFramesToDrop(frames.indexOf(frame));
}
-
+
/**
* Sets the number of frames to pop off the stack.
*
- * @param num number of frames to pop
+ * @param num
+ * number of frames to pop
*/
protected void setFramesToDrop(int num) {
fFramesToDrop = num;
}
-
+
/**
* Returns the number of frames to pop off the stack.
*
@@ -2546,40 +2875,48 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
*/
protected int getFramesToDrop() {
return fFramesToDrop;
- }
-
+ }
+
/**
- * To drop a frame or re-enter, the underlying thread is instructed
- * to do a return. When the frame count is less than zero, the
- * step being performed is a "step return", so a regular invocation
- * is performed.
- * @throws DebugException if an exception occurs
+ * To drop a frame or re-enter, the underlying thread is instructed to
+ * do a return. When the frame count is less than zero, the step being
+ * performed is a "step return", so a regular invocation is performed.
+ *
+ * @throws DebugException
+ * if an exception occurs
*/
+ @Override
protected void invokeThread() throws DebugException {
if (getFramesToDrop() < 0) {
super.invokeThread();
} else {
try {
- org.eclipse.jdi.hcr.ThreadReference hcrThread= (org.eclipse.jdi.hcr.ThreadReference) fThread;
+ org.eclipse.jdi.hcr.ThreadReference hcrThread = (org.eclipse.jdi.hcr.ThreadReference) fThread;
hcrThread.doReturn(null, true);
} catch (RuntimeException e) {
stepEnd(null);
fireSuspendEvent(DebugEvent.STEP_END);
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_while_popping_stack_frame, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_while_popping_stack_frame,
+ e.toString()), e);
}
}
}
-
+
/**
- * Notification that the pop has completed. If there are
- * more frames to pop, keep going, otherwise re-enter the
- * top frame. Returns false, as this handler will resume this
- * thread with a special invocation (<code>doReturn</code>).
+ * Notification that the pop has completed. If there are more frames to
+ * pop, keep going, otherwise re-enter the top frame. Returns false, as
+ * this handler will resume this thread with a special invocation (
+ * <code>doReturn</code>).
*
- * @see IJDIEventListener#handleEvent(Event, JDIDebugTarget, boolean, EventSet)
+ * @see IJDIEventListener#handleEvent(Event, JDIDebugTarget, boolean,
+ * EventSet)
* @see #invokeThread()
- */
- public boolean handleEvent(Event event, JDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
+ */
+ @Override
+ public boolean handleEvent(Event event, JDIDebugTarget target,
+ boolean suspendVote, EventSet eventSet) {
// pop is complete, update number of frames to drop
setFramesToDrop(getFramesToDrop() - 1);
try {
@@ -2595,75 +2932,86 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
return false;
}
-
+
/**
- * Pops a secondary frame off the stack, does a re-enter,
- * or a step-into.
+ * Pops a secondary frame off the stack, does a re-enter, or a
+ * step-into.
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
protected void doSecondaryStep() throws DebugException {
setStepRequest(createStepRequest());
setPendingStepHandler(this);
addJDIEventListener(this, getStepRequest());
invokeThread();
- }
+ }
/**
- * Creates and returns a step request. If there
- * are no more frames to drop, a re-enter request
- * is made. If the re-enter is complete, a step-into
- * request is created.
+ * Creates and returns a step request. If there are no more frames to
+ * drop, a re-enter request is made. If the re-enter is complete, a
+ * step-into request is created.
*
* @return step request
- * @exception DebugException if this method fails. Reasons include:
- * <ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * </ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * </ul>
*/
+ @Override
protected StepRequest createStepRequest() throws DebugException {
EventRequestManager manager = getEventRequestManager();
if (manager == null) {
- requestFailed(JDIDebugModelMessages.JDIThread_Unable_to_create_step_request___VM_disconnected__2, null);
+ requestFailed(
+ JDIDebugModelMessages.JDIThread_Unable_to_create_step_request___VM_disconnected__2,
+ null);
}
int num = getFramesToDrop();
if (num > 0) {
return super.createStepRequest();
} else if (num == 0) {
try {
- StepRequest request = ((org.eclipse.jdi.hcr.EventRequestManager) manager).createReenterStepRequest(fThread);
+ StepRequest request = ((org.eclipse.jdi.hcr.EventRequestManager) manager)
+ .createReenterStepRequest(fThread);
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
request.addCountFilter(1);
request.enable();
return request;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_creating_step_request, new String[] {e.toString()}), e);
- }
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_creating_step_request,
+ e.toString()), e);
+ }
} else if (num == -1) {
try {
- StepRequest request = manager.createStepRequest(fThread, StepRequest.STEP_LINE, StepRequest.STEP_INTO);
+ StepRequest request = manager.createStepRequest(fThread,
+ StepRequest.STEP_LINE, StepRequest.STEP_INTO);
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
request.addCountFilter(1);
request.enable();
return request;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_creating_step_request, new String[] {e.toString()}), e);
- }
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_creating_step_request,
+ e.toString()), e);
+ }
}
// this line will never be executed, as the try block
- // will either return, or the catch block with throw
+ // will either return, or the catch block with throw
// an exception
return null;
}
}
-
/**
* @see IThread#hasStackFrames()
@@ -2671,52 +3019,53 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
public boolean hasStackFrames() throws DebugException {
return isSuspended();
}
-
+
/**
* @see IAdaptable#getAdapter(Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == IJavaThread.class) {
return this;
- }
+ }
if (adapter == IJavaStackFrame.class) {
try {
return getTopStackFrame();
} catch (DebugException e) {
// do nothing if not able to get frame
- }
+ }
}
return super.getAdapter(adapter);
- }
-
+ }
+
/**
* @see org.eclipse.jdt.debug.core.IJavaThread#hasOwnedMonitors()
*/
public boolean hasOwnedMonitors() throws DebugException {
return isSuspended() && getOwnedMonitors().length > 0;
}
-
-
+
/**
* @see org.eclipse.jdt.debug.core.IJavaThread#getOwnedMonitors()
*/
public IJavaObject[] getOwnedMonitors() throws DebugException {
try {
- JDIDebugTarget target= (JDIDebugTarget)getDebugTarget();
- List ownedMonitors= fThread.ownedMonitors();
- IJavaObject[] javaOwnedMonitors= new IJavaObject[ownedMonitors.size()];
- Iterator itr= ownedMonitors.iterator();
- int i= 0;
+ JDIDebugTarget target = (JDIDebugTarget) getDebugTarget();
+ List<ObjectReference> ownedMonitors = fThread.ownedMonitors();
+ IJavaObject[] javaOwnedMonitors = new IJavaObject[ownedMonitors
+ .size()];
+ Iterator<ObjectReference> itr = ownedMonitors.iterator();
+ int i = 0;
while (itr.hasNext()) {
- ObjectReference element = (ObjectReference) itr.next();
- javaOwnedMonitors[i]= new JDIObjectValue(target, element);
+ ObjectReference element = itr.next();
+ javaOwnedMonitors[i] = new JDIObjectValue(target, element);
i++;
}
return javaOwnedMonitors;
} catch (IncompatibleThreadStateException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIThread_43, e);
+ targetRequestFailed(JDIDebugModelMessages.JDIThread_43, e);
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIThread_44, e);
+ targetRequestFailed(JDIDebugModelMessages.JDIThread_44, e);
}
return null;
}
@@ -2726,18 +3075,20 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
*/
public IJavaObject getContendedMonitor() throws DebugException {
try {
- ObjectReference monitor= fThread.currentContendedMonitor();
+ ObjectReference monitor = fThread.currentContendedMonitor();
if (monitor != null) {
- return new JDIObjectValue((JDIDebugTarget)getDebugTarget(), monitor);
+ return new JDIObjectValue((JDIDebugTarget) getDebugTarget(),
+ monitor);
}
} catch (IncompatibleThreadStateException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIThread_45, e);
+ targetRequestFailed(JDIDebugModelMessages.JDIThread_45, e);
} catch (RuntimeException e) {
- targetRequestFailed(JDIDebugModelMessages.JDIThread_46, e);
+ targetRequestFailed(JDIDebugModelMessages.JDIThread_46, e);
}
-
+
return null;
}
+
/**
* @see org.eclipse.debug.core.model.IFilteredStep#canStepWithFilters()
*/
@@ -2758,89 +3109,106 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
stepInto();
}
-
+
/**
* Class which managed the queue of runnable associated with this thread.
*/
static class ThreadJob extends Job {
-
- private Vector fRunnables;
-
+
+ private Vector<Runnable> fRunnables;
+
private JDIThread fJDIThread;
-
+
public ThreadJob(JDIThread thread) {
- super(JDIDebugModelMessages.JDIThread_39);
- fJDIThread= thread;
- fRunnables= new Vector(5);
+ super(JDIDebugModelMessages.JDIThread_39);
+ fJDIThread = thread;
+ fRunnables = new Vector<Runnable>(5);
setSystem(true);
}
-
+
public void addRunnable(Runnable runnable) {
- synchronized (fRunnables) {
- fRunnables.add(runnable);
- }
+ synchronized (fRunnables) {
+ fRunnables.add(runnable);
+ }
schedule();
}
-
+
public boolean isEmpty() {
return fRunnables.isEmpty();
}
/*
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IStatus run(IProgressMonitor monitor) {
- fJDIThread.fRunningAsyncJob= this;
- Object[] runnables;
- synchronized (fRunnables) {
- runnables= fRunnables.toArray();
- fRunnables.clear();
- }
-
- MultiStatus failed = null;
- monitor.beginTask(this.getName(), runnables.length);
- int i = 0;
- while (i < runnables.length && !fJDIThread.isTerminated() && !monitor.isCanceled()) {
- try {
- ((Runnable) runnables[i]).run();
- } catch (Exception e) {
- if (failed == null) {
- failed = new MultiStatus(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, JDIDebugModelMessages.JDIThread_0, null);
- }
- failed.add(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), JDIDebugPlugin.ERROR, JDIDebugModelMessages.JDIThread_0, e));
- }
- i++;
- monitor.worked(1);
- }
- fJDIThread.fRunningAsyncJob= null;
- monitor.done();
- if (failed == null) {
- return Status.OK_STATUS;
- }
- return failed;
- }
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
+ * IProgressMonitor)
+ */
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ fJDIThread.fRunningAsyncJob = this;
+ Object[] runnables;
+ synchronized (fRunnables) {
+ runnables = fRunnables.toArray();
+ fRunnables.clear();
+ }
+
+ MultiStatus failed = null;
+ monitor.beginTask(this.getName(), runnables.length);
+ int i = 0;
+ while (i < runnables.length && !fJDIThread.isTerminated()
+ && !monitor.isCanceled()) {
+ try {
+ ((Runnable) runnables[i]).run();
+ } catch (Exception e) {
+ if (failed == null) {
+ failed = new MultiStatus(
+ JDIDebugPlugin.getUniqueIdentifier(),
+ JDIDebugPlugin.ERROR,
+ JDIDebugModelMessages.JDIThread_0, null);
+ }
+ failed.add(new Status(IStatus.ERROR, JDIDebugPlugin
+ .getUniqueIdentifier(), JDIDebugPlugin.ERROR,
+ JDIDebugModelMessages.JDIThread_0, e));
+ }
+ i++;
+ monitor.worked(1);
+ }
+ fJDIThread.fRunningAsyncJob = null;
+ monitor.done();
+ if (failed == null) {
+ return Status.OK_STATUS;
+ }
+ return failed;
+ }
/*
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
+ @Override
public boolean shouldRun() {
return !fJDIThread.isTerminated() && !fRunnables.isEmpty();
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.debug.core.IJavaThread#stop(org.eclipse.jdt.debug.core.IJavaObject)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.debug.core.IJavaThread#stop(org.eclipse.jdt.debug.core
+ * .IJavaObject)
*/
public void stop(IJavaObject exception) throws DebugException {
try {
- fThread.stop(((JDIObjectValue)exception).getUnderlyingObject());
+ fThread.stop(((JDIObjectValue) exception).getUnderlyingObject());
} catch (InvalidTypeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIThread_exception_stoping_thread, new String[] {e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIThread_exception_stoping_thread,
+ e.toString()), e);
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#getThreadGroup()
*/
public IJavaThreadGroup getThreadGroup() throws DebugException {
@@ -2851,7 +3219,9 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#getFrameCount()
*/
public int getFrameCount() throws DebugException {
@@ -2863,7 +3233,7 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
return;
}
try {
- fThread.forceEarlyReturn(((JDIValue)value).getUnderlyingValue());
+ fThread.forceEarlyReturn(((JDIValue) value).getUnderlyingValue());
stepReturn();
} catch (VMDisconnectedException e) {
disconnected();
@@ -2879,31 +3249,39 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
targetRequestFailed(JDIDebugModelMessages.JDIThread_48, e);
}
}
-
-
+
/**
- * Implementation of a scheduling rule for this thread, which defines how it should behave
- * when a request for content job tries to run while the thread is evaluating
- *
- * @since 3.3.0
+ * Implementation of a scheduling rule for this thread, which defines how it
+ * should behave when a request for content job tries to run while the
+ * thread is evaluating
+ *
+ * @since 3.3.0
*/
class SerialPerObjectRule implements ISchedulingRule {
-
- private Object fObject = null;
-
- public SerialPerObjectRule(Object lock) {
- fObject = lock;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
+
+ private Object fObject = null;
+
+ public SerialPerObjectRule(Object lock) {
+ fObject = lock;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse
+ * .core.runtime.jobs.ISchedulingRule)
*/
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse
+ * .core.runtime.jobs.ISchedulingRule)
*/
public boolean isConflicting(ISchedulingRule rule) {
if (rule instanceof SerialPerObjectRule) {
@@ -2912,12 +3290,14 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
return false;
}
-
- }
-
+
+ }
+
/**
- * returns the scheduling rule for getting content while evaluations are running
- * @return the <code>ISchedulingRule</code> for this thread
+ * returns the scheduling rule for getting content while evaluations are
+ * running
+ *
+ * @return the <code>ISchedulingRule</code> for this thread
*
* @since 3.3.0
*/
@@ -2926,8 +3306,8 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
}
/**
- * A class prepare has resumed this thread - if the thread was suspended at startup
- * then fix up the state to running and fire an event to update UI.
+ * A class prepare has resumed this thread - if the thread was suspended at
+ * startup then fix up the state to running and fire an event to update UI.
*/
public synchronized void resumedFromClassPrepare() {
if (isSuspended()) {
@@ -2935,7 +3315,7 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
fireResumeEvent(DebugEvent.CLIENT_REQUEST);
}
}
-
+
/**
* Returns whether a suspend vote is currently in progress.
*
@@ -2945,11 +3325,14 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
return fSuspendVoteInProgress;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThread#getThreadObject()
*/
public IJavaObject getThreadObject() throws DebugException {
- return (IJavaObject) JDIValue.createValue(getJavaDebugTarget(), fThread);
+ return (IJavaObject) JDIValue
+ .createValue(getJavaDebugTarget(), fThread);
}
-
+
} \ No newline at end of file
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThreadGroup.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThreadGroup.java
index 119b5d381..2336b2a4f 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThreadGroup.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThreadGroup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,41 +25,47 @@ import com.sun.jdi.VMDisconnectedException;
/**
* @since 3.2
- *
+ *
*/
-public class JDIThreadGroup extends JDIDebugElement implements IJavaThreadGroup, ITerminate {
-
+public class JDIThreadGroup extends JDIDebugElement implements
+ IJavaThreadGroup, ITerminate {
+
private ThreadGroupReference fGroup = null;
private String fName = null;
/**
* Constructs a new thread group in the given target based on the underlying
* thread group reference.
- *
- * @param target debug target
- * @param group thread group reference
+ *
+ * @param target
+ * debug target
+ * @param group
+ * thread group reference
*/
public JDIThreadGroup(JDIDebugTarget target, ThreadGroupReference group) {
super(target);
fGroup = group;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThreadGroup#getThreads()
*/
public synchronized IJavaThread[] getThreads() throws DebugException {
try {
- List threads = fGroup.threads();
- List modelThreads = new ArrayList(threads.size());
- Iterator iterator = threads.iterator();
+ List<ThreadReference> threads = fGroup.threads();
+ List<JDIThread> modelThreads = new ArrayList<JDIThread>(threads.size());
+ Iterator<ThreadReference> iterator = threads.iterator();
while (iterator.hasNext()) {
- ThreadReference ref = (ThreadReference) iterator.next();
+ ThreadReference ref = iterator.next();
JDIThread thread = getJavaDebugTarget().findThread(ref);
if (thread != null) {
modelThreads.add(thread);
}
}
- return (IJavaThread[]) modelThreads.toArray(new IJavaThread[modelThreads.size()]);
+ return modelThreads
+ .toArray(new IJavaThread[modelThreads.size()]);
} catch (VMDisconnectedException e) {
// terminated/disconnected, return empty collection
return new IJavaThread[0];
@@ -69,7 +75,9 @@ public class JDIThreadGroup extends JDIDebugElement implements IJavaThreadGroup,
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThreadGroup#getThreadGroup()
*/
public IJavaThreadGroup getThreadGroup() throws DebugException {
@@ -84,22 +92,27 @@ public class JDIThreadGroup extends JDIDebugElement implements IJavaThreadGroup,
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThreadGroup#getThreadGroups()
*/
public IJavaThreadGroup[] getThreadGroups() throws DebugException {
try {
- List groups = fGroup.threadGroups();
- List modelGroups = new ArrayList(groups.size());
- Iterator iterator = groups.iterator();
+ List<ThreadGroupReference> groups = fGroup.threadGroups();
+ List<JDIThreadGroup> modelGroups = new ArrayList<JDIThreadGroup>(groups.size());
+ Iterator<ThreadGroupReference> iterator = groups.iterator();
while (iterator.hasNext()) {
- ThreadGroupReference ref = (ThreadGroupReference) iterator.next();
- JDIThreadGroup group = getJavaDebugTarget().findThreadGroup(ref);
+ ThreadGroupReference ref = iterator
+ .next();
+ JDIThreadGroup group = getJavaDebugTarget()
+ .findThreadGroup(ref);
if (group != null) {
modelGroups.add(group);
}
}
- return (IJavaThreadGroup[]) modelGroups.toArray(new IJavaThreadGroup[modelGroups.size()]);
+ return modelGroups
+ .toArray(new IJavaThreadGroup[modelGroups.size()]);
} catch (VMDisconnectedException e) {
return new IJavaThreadGroup[0];
} catch (RuntimeException e) {
@@ -108,7 +121,9 @@ public class JDIThreadGroup extends JDIDebugElement implements IJavaThreadGroup,
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThreadGroup#getName()
*/
public synchronized String getName() throws DebugException {
@@ -121,17 +136,19 @@ public class JDIThreadGroup extends JDIDebugElement implements IJavaThreadGroup,
}
return fName;
}
-
+
ThreadGroupReference getUnderlyingThreadGroup() {
return fGroup;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThreadGroup#hasThreadGroups()
*/
public boolean hasThreadGroups() throws DebugException {
try {
- List groups = fGroup.threadGroups();
+ List<ThreadGroupReference> groups = fGroup.threadGroups();
return groups.size() > 0;
} catch (RuntimeException e) {
targetRequestFailed(JDIDebugModelMessages.JDIThreadGroup_4, e);
@@ -139,12 +156,14 @@ public class JDIThreadGroup extends JDIDebugElement implements IJavaThreadGroup,
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaThreadGroup#hasThreads()
*/
public boolean hasThreads() throws DebugException {
try {
- List threads = fGroup.threads();
+ List<ThreadReference> threads = fGroup.threads();
return threads.size() > 0;
} catch (RuntimeException e) {
targetRequestFailed(JDIDebugModelMessages.JDIThreadGroup_5, e);
@@ -156,7 +175,7 @@ public class JDIThreadGroup extends JDIDebugElement implements IJavaThreadGroup,
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
*/
public boolean canTerminate() {
- //the group can terminate if the target can terminate
+ // the group can terminate if the target can terminate
return getDebugTarget().canTerminate();
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIType.java
index 5d1b154f3..3978adc8e 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIType.java
@@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
@@ -20,6 +17,7 @@ import org.eclipse.jdi.TimeoutException;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.JDIDebugModel;
+import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.ArrayType;
import com.sun.jdi.ClassType;
import com.sun.jdi.InterfaceType;
@@ -29,79 +27,96 @@ import com.sun.jdi.Type;
* A type of an object or primitive data type in a debug target.
*/
public class JDIType extends JDIDebugElement implements IJavaType {
-
+
/**
* Underlying type on target VM
*/
private Type fType;
-
+
/**
- * Constructs a new type based on the specified underlying
- * type, in the given debug target
+ * Constructs a new type based on the specified underlying type, in the
+ * given debug target
*
- * @param target the debug target this type originated from
- * @param type underlying type on the target VM
+ * @param target
+ * the debug target this type originated from
+ * @param type
+ * underlying type on the target VM
*/
protected JDIType(JDIDebugTarget target, Type type) {
super(target);
setUnderlyingType(type);
}
-
- /**
- * Throws a new debug exception with the given status code.
- *
- * @param message Failure message
- * @param e Exception that has occurred (<code>can be null</code>)
- * @param code status code
- * @throws DebugException a new exception with given status code
- */
- public void requestFailed(String message, Throwable e, int code) throws DebugException {
- throwDebugException(message, code, e);
- }
-
- /**
- * Throws a debug exception with the given message, error code, and underlying
- * exception.
- */
- protected void throwDebugException(String message, int code, Throwable exception) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(),
- code, message, exception));
- }
-
- /**
- * Throws a new debug exception with a status code of <code>TARGET_REQUEST_FAILED</code>
- * with the given underlying exception. If the underlying exception is not a JDI
- * exception, the original exception is thrown.
- *
- * @param message Failure message
- * @param e underlying exception that has occurred
- * @throws DebugException The exception with a status code of <code>TARGET_REQUEST_FAILED</code>
- */
- public void targetRequestFailed(String message, RuntimeException e) throws DebugException {
- if (e == null || e.getClass().getName().startsWith("com.sun.jdi") || e instanceof TimeoutException) { //$NON-NLS-1$
- requestFailed(message, e, DebugException.TARGET_REQUEST_FAILED);
- } else {
- throw e;
- }
- }
/**
- * Creates the appropriate kind of type, based on the specialized
- * type.
+ * Throws a new debug exception with the given status code.
+ *
+ * @param message
+ * Failure message
+ * @param e
+ * Exception that has occurred (<code>can be null</code>)
+ * @param code
+ * status code
+ * @throws DebugException
+ * a new exception with given status code
+ */
+ @Override
+ public void requestFailed(String message, Throwable e, int code)
+ throws DebugException {
+ throwDebugException(message, code, e);
+ }
+
+ /**
+ * Throws a debug exception with the given message, error code, and
+ * underlying exception.
+ */
+ @Override
+ protected void throwDebugException(String message, int code,
+ Throwable exception) throws DebugException {
+ throw new DebugException(new Status(IStatus.ERROR,
+ JDIDebugModel.getPluginIdentifier(), code, message, exception));
+ }
+
+ /**
+ * Throws a new debug exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code> with the given underlying exception.
+ * If the underlying exception is not a JDI exception, the original
+ * exception is thrown.
+ *
+ * @param message
+ * Failure message
+ * @param e
+ * underlying exception that has occurred
+ * @throws DebugException
+ * The exception with a status code of
+ * <code>TARGET_REQUEST_FAILED</code>
+ */
+ @Override
+ public void targetRequestFailed(String message, RuntimeException e)
+ throws DebugException {
+ if (e == null
+ || e.getClass().getName().startsWith("com.sun.jdi") || e instanceof TimeoutException) { //$NON-NLS-1$
+ requestFailed(message, e, DebugException.TARGET_REQUEST_FAILED);
+ } else {
+ throw e;
+ }
+ }
+
+ /**
+ * Creates the appropriate kind of type, based on the specialized type.
*/
public static JDIType createType(JDIDebugTarget target, Type type) {
if (type instanceof ArrayType) {
- return new JDIArrayType(target, (ArrayType)type);
+ return new JDIArrayType(target, (ArrayType) type);
}
if (type instanceof ClassType) {
- return new JDIClassType(target, (ClassType)type);
+ return new JDIClassType(target, (ClassType) type);
}
if (type instanceof InterfaceType) {
- return new JDIInterfaceType(target, (InterfaceType)type);
- }
+ return new JDIInterfaceType(target, (InterfaceType) type);
+ }
return new JDIType(target, type);
}
-
+
/**
* @see IJavaType#getSignature()
*/
@@ -109,7 +124,10 @@ public class JDIType extends JDIDebugElement implements IJavaType {
try {
return getUnderlyingType().signature();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIType_exception_while_retrieving_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIType_exception_while_retrieving_signature,
+ e.toString()), e);
// execution will not reach this line as
// #targetRequestFailed will throw an exception
return null;
@@ -128,19 +146,21 @@ public class JDIType extends JDIDebugElement implements IJavaType {
/**
* Sets the underlying type on the VM.
*
- * @param type the underlying type on the VM
+ * @param type
+ * the underlying type on the VM
*/
protected void setUnderlyingType(Type type) {
fType = type;
}
-
+
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getUnderlyingType().toString();
}
-
+
/**
* @see IJavaType#getName()
*/
@@ -148,23 +168,29 @@ public class JDIType extends JDIDebugElement implements IJavaType {
try {
return getUnderlyingType().name();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIType_exception_while_retrieving_type_name, new String[]{e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIType_exception_while_retrieving_type_name,
+ e.toString()), e);
}
// execution will not fall through as an exception
// will be thrown by the catch block
return null;
}
-
+
/**
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
- return object instanceof JDIType && fType.equals(((JDIType)object).fType);
+ return object instanceof JDIType
+ && fType.equals(((JDIType) object).fType);
}
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return fType.hashCode();
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIValue.java
index 21ba8dd9d..d26c53959 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@ import java.util.Iterator;
import java.util.List;
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.IJavaValue;
@@ -41,15 +42,15 @@ import com.sun.jdi.Value;
* @see IJavaValue
*/
public class JDIValue extends JDIDebugElement implements IJavaValue {
-
+
private Value fValue;
- private List fVariables;
-
+ private List<IJavaVariable> fVariables;
+
/**
* A flag indicating if this value is still allocated (valid)
*/
private boolean fAllocated = true;
-
+
/**
* When created for a logical structure we hold onto the original
* non-logical value for purposes of equality. This way a logical
@@ -58,113 +59,133 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
* This is <code>null</code> when not created for a logical structure.
*/
protected IJavaValue fLogicalParent;
-
+
/**
* Constructor
- * @param target debug target that this value belongs to
- * @param value the underlying value this value represents
+ *
+ * @param target
+ * debug target that this value belongs to
+ * @param value
+ * the underlying value this value represents
*/
public JDIValue(JDIDebugTarget target, Value value) {
super(target);
fValue = value;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.debug.core.model.JDIDebugElement#getAdapter(java.lang.Class)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jdt.internal.debug.core.model.JDIDebugElement#getAdapter(
+ * java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == IJavaValue.class) {
return this;
- }
+ }
return super.getAdapter(adapter);
}
-
+
/**
- * Creates the appropriate kind of value - i.e. a primitive
- * value, object, class object, array, or <code>null</code>.
+ * Creates the appropriate kind of value - i.e. a primitive value, object,
+ * class object, array, or <code>null</code>.
*/
public static JDIValue createValue(JDIDebugTarget target, Value value) {
if (value == null) {
return new JDINullValue(target);
}
if (value instanceof ArrayReference) {
- return new JDIArrayValue(target, (ArrayReference)value);
+ return new JDIArrayValue(target, (ArrayReference) value);
}
if (value instanceof ClassObjectReference) {
- return new JDIClassObjectValue(target,(ClassObjectReference)value);
+ return new JDIClassObjectValue(target, (ClassObjectReference) value);
}
if (value instanceof ObjectReference) {
- return new JDIObjectValue(target, (ObjectReference)value);
+ return new JDIObjectValue(target, (ObjectReference) value);
}
if (value instanceof PrimitiveValue) {
return new JDIPrimitiveValue(target, value);
}
return new JDIValue(target, value);
}
-
+
/**
* @see IValue#getValueString()
*/
public String getValueString() throws DebugException {
if (fValue == null) {
- return JDIDebugModelMessages.JDIValue_null_4;
+ return JDIDebugModelMessages.JDIValue_null_4;
}
if (fValue instanceof StringReference) {
try {
return ((StringReference) fValue).value();
} catch (ObjectCollectedException e) {
- return JDIDebugModelMessages.JDIValue_deallocated;
+ return JDIDebugModelMessages.JDIValue_deallocated;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_value, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_value,
+ new Object[] { e.toString() }), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
return null;
}
}
if (fValue instanceof ObjectReference) {
- StringBuffer name= new StringBuffer();
+ StringBuffer name = new StringBuffer();
if (fValue instanceof ClassObjectReference) {
- name.append('(');
- name.append(((ClassObjectReference)fValue).reflectedType());
- name.append(')');
+ name.append('(');
+ name.append(((ClassObjectReference) fValue).reflectedType());
+ name.append(')');
}
long id = 0;
try {
- id = ((ObjectReference)fValue).uniqueID();
+ id = ((ObjectReference) fValue).uniqueID();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_unique_id, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_unique_id,
+ new Object[] { e.toString() }), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
return null;
}
name.append(" "); //$NON-NLS-1$
- name.append(MessageFormat.format(JDIDebugModelMessages.JDIValue_id_8, new String[]{String.valueOf(id)}));
+ name.append(MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_id_8,
+ new Object[] { String.valueOf(id) }));
return name.toString();
}
// see bug 43285
return String.valueOf(fValue);
}
-
+
/**
* @see IValue#getReferenceTypeName()
*/
public String getReferenceTypeName() throws DebugException {
try {
if (fValue == null) {
- return JDIDebugModelMessages.JDIValue_null_4;
+ return JDIDebugModelMessages.JDIValue_null_4;
}
return getUnderlyingType().name();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_reference_type_name, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_reference_type_name,
+ new Object[] { e.toString() }), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
- return null;
+ // #targetRequestFailed will thrown an exception
+ return null;
}
}
/**
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
if (fValue == null) {
return getClass().hashCode();
@@ -175,12 +196,13 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
/**
* @see Object#equals(Object)
*/
+ @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o instanceof JDIValue) {
- Value other = ((JDIValue)o).getUnderlyingValue();
+ Value other = ((JDIValue) o).getUnderlyingValue();
if (fValue == null) {
return false;
}
@@ -188,85 +210,92 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
return false;
}
return fValue.equals(other);
- }
+ }
return false;
- }
+ }
/**
* @see IValue#getVariables()
*/
public IVariable[] getVariables() throws DebugException {
- List list = getVariablesList();
- return (IVariable[])list.toArray(new IVariable[list.size()]);
+ List<IJavaVariable> list = getVariablesList();
+ return list.toArray(new IVariable[list.size()]);
}
-
+
/**
- * Returns a list of variables that are children of this value. The result is cached.
+ * Returns a list of variables that are children of this value. The result
+ * is cached.
*
* @return list of variable children
- * @throws DebugException
+ * @throws DebugException
*/
- protected synchronized List getVariablesList() throws DebugException {
+ protected synchronized List<IJavaVariable> getVariablesList() throws DebugException {
if (fVariables != null) {
return fVariables;
- } else
- if (fValue instanceof ObjectReference) {
- ObjectReference object= (ObjectReference) fValue;
- fVariables= new ArrayList();
- if (isArray()) {
- try {
- int length= getArrayLength();
- for (int i = 0; i < length; i++) {
- fVariables.add(new JDIArrayEntryVariable(getJavaDebugTarget(), getArrayReference(), i, fLogicalParent));
- }
- } catch (DebugException e) {
- if (e.getCause() instanceof ObjectCollectedException) {
- return Collections.EMPTY_LIST;
- }
- throw e;
+ } else if (fValue instanceof ObjectReference) {
+ ObjectReference object = (ObjectReference) fValue;
+ fVariables = new ArrayList<IJavaVariable>();
+ if (isArray()) {
+ try {
+ int length = getArrayLength();
+ for (int i = 0; i < length; i++) {
+ fVariables.add(new JDIArrayEntryVariable(
+ getJavaDebugTarget(), getArrayReference(), i,
+ fLogicalParent));
}
- } else {
- List fields= null;
- try {
- ReferenceType refType= object.referenceType();
- fields= refType.allFields();
- } catch (ObjectCollectedException e) {
+ } catch (DebugException e) {
+ if (e.getCause() instanceof ObjectCollectedException) {
return Collections.EMPTY_LIST;
- } catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_fields, new String[] {e.toString()}), e);
- // execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
- return null;
- }
- Iterator list= fields.iterator();
- while (list.hasNext()) {
- Field field= (Field) list.next();
- fVariables.add(new JDIFieldVariable((JDIDebugTarget)getDebugTarget(), field, object, fLogicalParent));
}
- Collections.sort(fVariables, new Comparator() {
- public int compare(Object a, Object b) {
- return sortChildren(a, b);
- }
- });
+ throw e;
}
-
- return fVariables;
} else {
- return Collections.EMPTY_LIST;
+ List<Field> fields = null;
+ try {
+ ReferenceType refType = object.referenceType();
+ fields = refType.allFields();
+ } catch (ObjectCollectedException e) {
+ return Collections.EMPTY_LIST;
+ } catch (RuntimeException e) {
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_fields,
+ new Object[] { e.toString() }), e);
+ // execution will not reach this line, as
+ // #targetRequestFailed will thrown an exception
+ return null;
+ }
+ Iterator<Field> list = fields.iterator();
+ while (list.hasNext()) {
+ Field field = list.next();
+ fVariables.add(new JDIFieldVariable(
+ (JDIDebugTarget) getDebugTarget(), field, object,
+ fLogicalParent));
+ }
+ Collections.sort(fVariables, new Comparator<IJavaVariable>() {
+ public int compare(IJavaVariable a, IJavaVariable b) {
+ return sortChildren(a, b);
+ }
+ });
}
+
+ return fVariables;
+ } else {
+ return Collections.EMPTY_LIST;
+ }
}
-
+
/**
- * Group statics and instance variables,
- * sort alphabetically within each group.
+ * Group statics and instance variables, sort alphabetically within each
+ * group.
*/
protected int sortChildren(Object a, Object b) {
- IJavaVariable v1= (IJavaVariable)a;
- IJavaVariable v2= (IJavaVariable)b;
-
+ IJavaVariable v1 = (IJavaVariable) a;
+ IJavaVariable v2 = (IJavaVariable) b;
+
try {
- boolean v1isStatic= v1.isStatic();
- boolean v2isStatic= v2.isStatic();
+ boolean v1isStatic = v1.isStatic();
+ boolean v2isStatic = v2.isStatic();
if (v1isStatic && !v2isStatic) {
return -1;
}
@@ -286,13 +315,13 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
protected boolean isArray() {
return fValue instanceof ArrayReference;
}
-
+
/**
* Returns this value as an array reference, or <code>null</code>
*/
protected ArrayReference getArrayReference() {
if (isArray()) {
- return (ArrayReference)fValue;
+ return (ArrayReference) fValue;
}
return null;
}
@@ -304,23 +333,26 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
if (fAllocated) {
if (fValue instanceof ObjectReference) {
try {
- fAllocated = !((ObjectReference)fValue).isCollected();
+ fAllocated = !((ObjectReference) fValue).isCollected();
} catch (VMDisconnectedException e) {
// if the VM disconnects, this value is not allocated
fAllocated = false;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_is_collected, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_is_collected,
+ new Object[] { e.toString() }), e);
// execution will fall through, as
- // #targetRequestFailed will thrown an exception
+ // #targetRequestFailed will thrown an exception
}
} else {
- JDIDebugTarget dt = (JDIDebugTarget)getDebugTarget();
+ JDIDebugTarget dt = (JDIDebugTarget) getDebugTarget();
fAllocated = dt.isAvailable();
}
}
return fAllocated;
}
-
+
/**
* @see IJavaValue#getSignature()
*/
@@ -331,34 +363,42 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
}
return null;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_type_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_type_signature,
+ new Object[] { e.toString() }), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
- return null;
+ // #targetRequestFailed will thrown an exception
+ return null;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#getGenericSignature()
*/
public String getGenericSignature() throws DebugException {
try {
if (fValue != null) {
- Type type= fValue.type();
+ Type type = fValue.type();
if (type instanceof ReferenceType) {
- return ((ReferenceType)type).genericSignature();
+ return ((ReferenceType) type).genericSignature();
}
return null;
}
return null;
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_type_signature, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_type_signature,
+ new Object[] { e.toString() }), e);
// execution will not reach this line, as
- // #targetRequestFailed will thrown an exception
- return null;
+ // #targetRequestFailed will thrown an exception
+ return null;
}
}
-
+
/**
* @see IJavaValue#getArrayLength()
*/
@@ -367,52 +407,62 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
try {
return getArrayReference().length();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_length_of_array, new String[] {e.toString()}), e);
+ targetRequestFailed(
+ MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_length_of_array,
+ new Object[] { e.toString() }), e);
}
}
return -1;
}
-
+
/**
* Returns this value's underlying JDI value
*/
protected Value getUnderlyingValue() {
return fValue;
}
-
+
/**
* @see IJavaValue#getJavaType()
*/
public IJavaType getJavaType() throws DebugException {
- return JDIType.createType((JDIDebugTarget)getDebugTarget(), getUnderlyingType());
+ return JDIType.createType((JDIDebugTarget) getDebugTarget(),
+ getUnderlyingType());
}
-
+
/**
* Returns this value's underlying type.
*
* @return type
- * @exception DebugException if this method fails. Reasons include:<ul>
- * <li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
*/
protected Type getUnderlyingType() throws DebugException {
try {
return getUnderlyingValue().type();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIValue_exception_retrieving_type, new String[] {e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIValue_exception_retrieving_type,
+ new Object[] { e.toString() }), e);
// execution will not fall through to here,
- // as #requestFailed will throw an exception
+ // as #requestFailed will throw an exception
return null;
}
- }
+ }
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getUnderlyingValue().toString();
}
+
/**
* @see IValue#hasVariables()
*/
@@ -421,26 +471,30 @@ public class JDIValue extends JDIDebugElement implements IJavaValue {
}
/**
- * Sets the value that is the original non-logical value that this
- * child value was computed for.
+ * Sets the value that is the original non-logical value that this child
+ * value was computed for.
*
- * @param logicalParent parent value
+ * @param logicalParent
+ * parent value
*/
public void setLogicalParent(IJavaValue logicalParent) {
fLogicalParent = logicalParent;
}
/**
- * Returns the value that is the original non-logical value that this
- * child value was computed for or <code>null</code> if none
+ * Returns the value that is the original non-logical value that this child
+ * value was computed for or <code>null</code> if none
*
- * @param logicalParent parent value or <code>null</code>
+ * @param logicalParent
+ * parent value or <code>null</code>
*/
public IJavaValue getLogicalParent() {
return fLogicalParent;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jdt.debug.core.IJavaValue#isNull()
*/
public boolean isNull() {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVariable.java
index 1902e99c5..6ccaf3173 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,11 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
+import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.core.model.IValueModification;
+import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdt.debug.core.IJavaModifiers;
import org.eclipse.jdt.debug.core.IJavaType;
import org.eclipse.jdt.debug.core.IJavaVariable;
@@ -21,83 +23,88 @@ import com.ibm.icu.text.MessageFormat;
import com.sun.jdi.Type;
import com.sun.jdi.Value;
-public abstract class JDIVariable extends JDIDebugElement implements IJavaVariable {
-
+public abstract class JDIVariable extends JDIDebugElement implements
+ IJavaVariable {
+
/**
* Cache of current value - see #getValue().
*/
private JDIValue fValue;
-
+
/**
- * Counter corresponding to this variable's debug target
- * suspend count indicating the last time this value
- * changed. This variable's value has changed on the
- * last suspend event if this counter is equal to the
- * debug target's suspend count.
+ * Counter corresponding to this variable's debug target suspend count
+ * indicating the last time this value changed. This variable's value has
+ * changed on the last suspend event if this counter is equal to the debug
+ * target's suspend count.
*/
private int fLastChangeIndex = -1;
-
- protected final static String jdiStringSignature= "Ljava/lang/String;"; //$NON-NLS-1$
-
+
+ protected final static String jdiStringSignature = "Ljava/lang/String;"; //$NON-NLS-1$
+
public JDIVariable(JDIDebugTarget target) {
super(target);
}
-
+
/**
* @see PlatformObject#getAdapter(Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == IJavaVariable.class || adapter == IJavaModifiers.class) {
return this;
- }
+ }
return super.getAdapter(adapter);
}
/**
- * Returns this variable's current underlying jdi value.
- * Subclasses must implement #retrieveValue() and do not
- * need to guard against JDI exceptions, as this method
- * handles them.
- *
- * @exception DebugException if unable to access the value
+ * Returns this variable's current underlying jdi value. Subclasses must
+ * implement #retrieveValue() and do not need to guard against JDI
+ * exceptions, as this method handles them.
+ *
+ * @exception DebugException
+ * if unable to access the value
*/
protected final Value getCurrentValue() throws DebugException {
try {
return retrieveValue();
} catch (RuntimeException e) {
- targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIVariable_exception_retrieving, new String[] {e.toString()}), e);
+ targetRequestFailed(MessageFormat.format(
+ JDIDebugModelMessages.JDIVariable_exception_retrieving,
+ new Object[] { e.toString() }), e);
// execution will not reach this line, as
- // #targetRequestFailed will throw an exception
+ // #targetRequestFailed will throw an exception
return null;
}
}
-
+
/**
* Returns this variable's underlying jdi value
*/
protected abstract Value retrieveValue() throws DebugException;
-
+
/**
- * Returns the current value of this variable. The value
- * is cached, but on each access we see if the value has changed
- * and update if required.
- *
+ * Returns the current value of this variable. The value is cached, but on
+ * each access we see if the value has changed and update if required.
+ *
* @see IVariable#getValue()
*/
public IValue getValue() throws DebugException {
Value currentValue = getCurrentValue();
if (fValue == null) {
- fValue = JDIValue.createValue((JDIDebugTarget)getDebugTarget(), currentValue);
+ fValue = JDIValue.createValue((JDIDebugTarget) getDebugTarget(),
+ currentValue);
} else {
Value previousValue = fValue.getUnderlyingValue();
if (currentValue == previousValue) {
return fValue;
}
if (previousValue == null || currentValue == null) {
- fValue = JDIValue.createValue((JDIDebugTarget)getDebugTarget(), currentValue);
+ fValue = JDIValue.createValue(
+ (JDIDebugTarget) getDebugTarget(), currentValue);
setChangeCount(getJavaDebugTarget().getSuspendCount());
} else if (!previousValue.equals(currentValue)) {
- fValue = JDIValue.createValue((JDIDebugTarget)getDebugTarget(), currentValue);
+ fValue = JDIValue.createValue(
+ (JDIDebugTarget) getDebugTarget(), currentValue);
setChangeCount(getJavaDebugTarget().getSuspendCount());
}
}
@@ -115,15 +122,15 @@ public abstract class JDIVariable extends JDIDebugElement implements IJavaVariab
* @see IValueModification#setValue(String)
*/
public void setValue(String expression) throws DebugException {
- notSupported(JDIDebugModelMessages.JDIVariable_does_not_support_value_modification);
+ notSupported(JDIDebugModelMessages.JDIVariable_does_not_support_value_modification);
}
-
+
/**
* @see IValueModification#setValue(IValue)
*/
public void setValue(IValue value) throws DebugException {
- notSupported(JDIDebugModelMessages.JDIVariable_does_not_support_value_modification);
- }
+ notSupported(JDIDebugModelMessages.JDIVariable_does_not_support_value_modification);
+ }
/**
* @see IValueModification#verifyValue(String)
@@ -131,63 +138,63 @@ public abstract class JDIVariable extends JDIDebugElement implements IJavaVariab
public boolean verifyValue(String expression) throws DebugException {
return false;
}
-
+
/**
* @see IValueModification#verifyValue(IValue)
*/
public boolean verifyValue(IValue value) throws DebugException {
return false;
- }
-
+ }
+
/**
* @see IJavaModifiers#isSynthetic()
*/
public boolean isSynthetic() {
return false;
}
-
+
/**
* @see IJavaModifiers#isPublic()
*/
public boolean isPublic() throws DebugException {
return false;
}
-
+
/**
* @see IJavaModifiers#isPrivate()
*/
public boolean isPrivate() throws DebugException {
return false;
}
-
+
/**
* @see IJavaModifiers#isProtected()
*/
public boolean isProtected() throws DebugException {
return false;
}
-
+
/**
* @see IJavaModifiers#isPackagePrivate()
*/
public boolean isPackagePrivate() {
return false;
}
-
+
/**
* @see IJavaModifiers#isStatic()
*/
public boolean isStatic() {
return false;
}
-
+
/**
* @see IJavaModifiers#isFinal()
*/
public boolean isFinal() {
return false;
}
-
+
/**
* @see org.eclipse.jdt.debug.core.IJavaVariable#isLocal()
*/
@@ -199,51 +206,57 @@ public abstract class JDIVariable extends JDIDebugElement implements IJavaVariab
* @see IJavaVariable#getJavaType()
*/
public IJavaType getJavaType() throws DebugException {
- return JDIType.createType((JDIDebugTarget)getDebugTarget(), getUnderlyingType());
+ return JDIType.createType((JDIDebugTarget) getDebugTarget(),
+ getUnderlyingType());
}
-
+
/**
* Returns the underlying type of this variable
*
* @return the underlying type of this variable
*
- * @exception DebugException if this method fails. Reasons include:
- * <ul><li>Failure communicating with the VM. The DebugException's
- * status code contains the underlying exception responsible for
- * the failure.</li>
- * <li>The type associated with this variable is not yet loaded</li></ul>
+ * @exception DebugException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure communicating with the VM. The
+ * DebugException's status code contains the underlying
+ * exception responsible for the failure.</li>
+ * <li>The type associated with this variable is not yet
+ * loaded</li>
+ * </ul>
*/
protected abstract Type getUnderlyingType() throws DebugException;
-
+
/**
* Returns the last known value for this variable
*/
protected Value getLastKnownValue() {
if (fValue == null) {
return null;
- }
+ }
return fValue.getUnderlyingValue();
}
-
+
/**
* Sets this variable's change counter to the specified value
*
- * @param count new value
+ * @param count
+ * new value
*/
protected void setChangeCount(int count) {
fLastChangeIndex = count;
}
-
+
/**
- * Returns this variable's change counter. This corresponds to the
- * last time this variable changed.
+ * Returns this variable's change counter. This corresponds to the last time
+ * this variable changed.
*
* @return this variable's change counter
*/
protected int getChangeCount() {
return fLastChangeIndex;
}
-
+
/**
* @see IVariable#hasValueChanged()
*/
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidType.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidType.java
index ef410d668..b6df36b37 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidType.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidType.java
@@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
+import org.eclipse.jdt.debug.core.IJavaType;
+
/**
- * Void type. Since it is not possible to retrieve the
- * void type from the target VM on demand, there is a
- * special implementation for the void type.
+ * Void type. Since it is not possible to retrieve the void type from the target
+ * VM on demand, there is a special implementation for the void type.
*/
public class JDIVoidType extends JDIType {
@@ -29,29 +29,35 @@ public class JDIVoidType extends JDIType {
/**
* @see IJavaType#getName()
*/
+ @Override
public String getName() {
return "void"; //$NON-NLS-1$
}
-
+
/**
* @see IJavaType#getSignature()
*/
+ @Override
public String getSignature() {
return "V"; //$NON-NLS-1$
}
+
/**
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object object) {
- return object instanceof JDIVoidType && getDebugTarget().equals(((JDIVoidType)object).getDebugTarget());
+ return object instanceof JDIVoidType
+ && getDebugTarget().equals(
+ ((JDIVoidType) object).getDebugTarget());
}
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return super.hashCode();
}
}
-
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidValue.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidValue.java
index f18368e9e..843e81f06 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidValue.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIVoidValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,36 +10,41 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
import java.util.Collections;
import java.util.List;
+import org.eclipse.debug.core.model.IValue;
import org.eclipse.jdt.debug.core.IJavaType;
+import org.eclipse.jdt.debug.core.IJavaValue;
+import org.eclipse.jdt.debug.core.IJavaVariable;
/**
* Represents a value of "void"
*/
public class JDIVoidValue extends JDIValue {
-
-
+
public JDIVoidValue(JDIDebugTarget target) {
- super(target, target.getVM()!=null?target.getVM().mirrorOfVoid():null);
+ super(target, target.getVM() != null ? target.getVM().mirrorOfVoid()
+ : null);
}
- protected List getVariablesList() {
+ @Override
+ protected List<IJavaVariable> getVariablesList() {
return Collections.EMPTY_LIST;
}
-
+
/**
* @see IValue#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() {
return "void"; //$NON-NLS-1$
}
-
+
/**
* @see IValue#getValueString()
*/
+ @Override
public String getValueString() {
return "null"; //$NON-NLS-1$
}
@@ -47,6 +52,7 @@ public class JDIVoidValue extends JDIValue {
/**
* @see IJavaValue#getSignature()
*/
+ @Override
public String getSignature() {
return "V"; //$NON-NLS-1$
}
@@ -54,19 +60,23 @@ public class JDIVoidValue extends JDIValue {
/**
* @see IJavaValue#getArrayLength()
*/
+ @Override
public int getArrayLength() {
return -1;
}
-
+
/**
* @see IJavaValue#getJavaType()
*/
+ @Override
public IJavaType getJavaType() {
- return new JDIVoidType((JDIDebugTarget)getDebugTarget());
+ return new JDIVoidType((JDIDebugTarget) getDebugTarget());
}
+
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return "void"; //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/Timer.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/Timer.java
index 1aad4dcd7..90bb88ae3 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/Timer.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/Timer.java
@@ -10,41 +10,39 @@
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.model;
-
/**
- * A timer notifies listeners when a specific amount
- * of time has passed.
+ * A timer notifies listeners when a specific amount of time has passed.
*
* @see ITimeoutListener
*/
public class Timer {
-
+
/**
* Listener to notify of a timeout
*/
private ITimeoutListener fListener;
-
+
/**
* Timeout value, in milliseconds
*/
private int fTimeout;
-
+
/**
* Whether this timer's thread is alive
*/
private boolean fAlive = true;
-
+
/**
- * Whether this timer has been started and
- * has not yet timed out or been stopped.
+ * Whether this timer has been started and has not yet timed out or been
+ * stopped.
*/
private boolean fStarted = false;
-
+
/**
* The single thread used for each request.
*/
private Thread fThread;
-
+
/**
* Constructs a new timer
*/
@@ -58,7 +56,7 @@ public class Timer {
Thread.sleep(getTimeout());
} catch (InterruptedException e) {
interrupted = true;
- }
+ }
if (!interrupted) {
if (getListener() != null) {
setStarted(false);
@@ -76,29 +74,30 @@ public class Timer {
}
/**
- * Starts this timer, and notifies the given listener when
- * the time has passed. A call to <code>stop</code>, before the
- * time expires, will cancel the the timer and timeout callback.
- * This method can only be called if this timer is idle (i.e.
- * <code>isStarted() == false<code>).
+ * Starts this timer, and notifies the given listener when the time has
+ * passed. A call to <code>stop</code>, before the time expires, will cancel
+ * the the timer and timeout callback. This method can only be called if
+ * this timer is idle (i.e. <code>isStarted() == false<code>).
*
- * @param listener The timer listener
- * @param ms The number of milliseconds to wait before
- * notifying the listener
+ * @param listener
+ * The timer listener
+ * @param ms
+ * The number of milliseconds to wait before notifying the
+ * listener
*/
public void start(ITimeoutListener listener, int ms) {
if (isStarted()) {
- throw new IllegalStateException(JDIDebugModelMessages.Timer_Timer_cannot_be_started_more_than_once_1);
+ throw new IllegalStateException(
+ JDIDebugModelMessages.Timer_Timer_cannot_be_started_more_than_once_1);
}
setListener(listener);
setTimeout(ms);
setStarted(true);
getThread().interrupt();
}
-
+
/**
- * Stops this timer, cancelling any pending timeout
- * notification.
+ * Stops this timer, cancelling any pending timeout notification.
*/
public void stop() {
if (isAlive()) {
@@ -107,7 +106,7 @@ public class Timer {
getThread().interrupt();
}
}
-
+
/**
* Disposes this timer
*/
@@ -118,7 +117,7 @@ public class Timer {
setThread(null);
}
}
-
+
/**
* Returns whether this timer's thread is alive
*
@@ -129,12 +128,11 @@ public class Timer {
}
/**
- * Sets whether this timer's thread is alive. When
- * set to <code>false</code> this timer's thread
- * will exit on its next iteration.
+ * Sets whether this timer's thread is alive. When set to <code>false</code>
+ * this timer's thread will exit on its next iteration.
*
- * @param alive whether this timer's thread should
- * be alive
+ * @param alive
+ * whether this timer's thread should be alive
* @see #dispose()
*/
private void setAlive(boolean alive) {
@@ -151,32 +149,33 @@ public class Timer {
}
/**
- * Sets the listener to be notified if this
- * timer times out.
+ * Sets the listener to be notified if this timer times out.
*
- * @param listener timeout listener
+ * @param listener
+ * timeout listener
*/
private void setListener(ITimeoutListener listener) {
fListener = listener;
}
/**
- * Returns whether this timer has been started,
- * and has not yet timed out, or been stopped.
+ * Returns whether this timer has been started, and has not yet timed out,
+ * or been stopped.
*
- * @return whether this timer has been started,
- * and has not yet timed out, or been stopped
+ * @return whether this timer has been started, and has not yet timed out,
+ * or been stopped
*/
public boolean isStarted() {
return fStarted;
}
/**
- * Sets whether this timer has been started,
- * and has not yet timed out, or been stopped.
+ * Sets whether this timer has been started, and has not yet timed out, or
+ * been stopped.
*
- * @param started whether this timer has been started,
- * and has not yet timed out, or been stopped
+ * @param started
+ * whether this timer has been started, and has not yet timed
+ * out, or been stopped
*/
private void setStarted(boolean started) {
fStarted = started;
@@ -192,18 +191,18 @@ public class Timer {
}
/**
- * Sets this timer's thread used to perform
- * timeout processing
+ * Sets this timer's thread used to perform timeout processing
*
- * @param thread thread that waits for a timeout
+ * @param thread
+ * thread that waits for a timeout
*/
private void setThread(Thread thread) {
fThread = thread;
}
/**
- * Returns the amount of time, in milliseconds, that
- * this timer is/was waiting for.
+ * Returns the amount of time, in milliseconds, that this timer is/was
+ * waiting for.
*
* @return timeout value, in milliseconds
*/
@@ -212,10 +211,11 @@ public class Timer {
}
/**
- * Sets the amount of time, in milliseconds, that this
- * timer will wait for before timing out.
+ * Sets the amount of time, in milliseconds, that this timer will wait for
+ * before timing out.
*
- * @param timeout value, in milliseconds
+ * @param timeout
+ * value, in milliseconds
*/
private void setTimeout(int timeout) {
fTimeout = timeout;
diff --git a/org.eclipse.jdt.launching.macosx/.classpath b/org.eclipse.jdt.launching.macosx/.classpath
index 9bc13f0d8..112107ef7 100644
--- a/org.eclipse.jdt.launching.macosx/.classpath
+++ b/org.eclipse.jdt.launching.macosx/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="macosx"/>
<classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.core.prefs
index 865b860af..a926bd737 100644
--- a/org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Thu Jan 20 17:11:20 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,17 +6,22 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -26,11 +30,12 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
@@ -63,21 +68,30 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -99,7 +113,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
diff --git a/org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..bf9e9379a
--- /dev/null
+++ b/org.eclipse.jdt.launching.macosx/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
diff --git a/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF b/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF
index 4078a560f..4e8ad7a9a 100644
--- a/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.launching.macosx/META-INF/MANIFEST.MF
@@ -13,5 +13,5 @@ Require-Bundle: org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)",
org.eclipse.jdt.launching;bundle-version="[3.5.0,4.0.0)"
Eclipse-LazyStart: true
Eclipse-PlatformFilter: (osgi.os=macosx)
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java
index fa3c775dd..c99f59b98 100644
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java
+++ b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXDebugVMRunner.java
@@ -22,14 +22,17 @@ public class MacOSXDebugVMRunner extends StandardVMDebugger {
super(vmInstance);
}
+ @Override
protected Process exec(String[] cmdLine, File workingDirectory) throws CoreException {
return super.exec(MacOSXLaunchingPlugin.wrap(getClass(), cmdLine), workingDirectory);
}
+ @Override
protected Process exec(String[] cmdLine, File workingDirectory, String[] envp) throws CoreException {
return super.exec(MacOSXLaunchingPlugin.wrap(getClass(), cmdLine), workingDirectory, envp);
}
+ @Override
protected String renderCommandLine(String[] commandLine) {
return super.renderCommandLine(MacOSXLaunchingPlugin.wrap(getClass(), commandLine));
}
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java
index 62e9959d5..2d34bf5e0 100644
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java
+++ b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstall.java
@@ -24,6 +24,7 @@ public class MacOSXVMInstall extends AbstractVMInstall {
super(type, id);
}
+ @Override
public IVMRunner getVMRunner(String mode) {
if (ILaunchManager.RUN_MODE.equals(mode))
return new MacOSXVMRunner(this);
@@ -34,7 +35,8 @@ public class MacOSXVMInstall extends AbstractVMInstall {
return null;
}
- public String getJavaVersion() {
+ @Override
+ public String getJavaVersion() {
File installLocation= getInstallLocation();
if (installLocation != null) {
File executable= StandardVMType.findJavaExecutable(installLocation);
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java
index a7f8066ca..fdde02a41 100644
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java
+++ b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java
@@ -70,10 +70,12 @@ public class MacOSXVMInstallType extends StandardVMType {
/** The doc for 1.4.1 is kept in a sub directory of the above. */
private static final String JAVADOC_SUBDIR= "/doc/api"; //$NON-NLS-1$
+ @Override
public String getName() {
return MacOSXLaunchingPlugin.getString("MacOSXVMType.name"); //$NON-NLS-1$
}
+ @Override
public IVMInstall doCreateVMInstall(String id) {
return new MacOSXVMInstall(this, id);
}
@@ -81,6 +83,7 @@ public class MacOSXVMInstallType extends StandardVMType {
/*
* @see IVMInstallType#detectInstallLocation()
*/
+ @Override
public File detectInstallLocation() {
try {
// find all installed VMs
@@ -217,6 +220,7 @@ public class MacOSXVMInstallType extends StandardVMType {
* @param installLocation
* @return LibraryInfo
*/
+ @Override
protected LibraryInfo getDefaultLibraryInfo(File installLocation) {
File classes = new File(installLocation, "../Classes"); //$NON-NLS-1$
@@ -243,6 +247,7 @@ public class MacOSXVMInstallType extends StandardVMType {
return new LibraryInfo("???", libs, dirs, endDirs); //$NON-NLS-1$
}
+ @Override
protected IPath getDefaultSystemLibrarySource(File libLocation) {
File parent= libLocation.getParentFile();
while (parent != null) {
@@ -266,6 +271,7 @@ public class MacOSXVMInstallType extends StandardVMType {
/**
* @see org.eclipse.jdt.launching.IVMInstallType#validateInstallLocation(java.io.File)
*/
+ @Override
public IStatus validateInstallLocation(File javaHome) {
String id= MacOSXLaunchingPlugin.getUniqueIdentifier();
File java= new File(javaHome, "bin"+File.separator+"java"); //$NON-NLS-2$ //$NON-NLS-1$
@@ -277,6 +283,7 @@ public class MacOSXVMInstallType extends StandardVMType {
/**
* @see org.eclipse.jdt.launching.AbstractVMInstallType#getDefaultJavadocLocation(java.io.File)
*/
+ @Override
public URL getDefaultJavadocLocation(File installLocation) {
// try in local filesystem
@@ -314,6 +321,7 @@ public class MacOSXVMInstallType extends StandardVMType {
/*
* Overridden to make it visible.
*/
+ @Override
protected String getVMVersion(File javaHome, File javaExecutable) {
return super.getVMVersion(javaHome, javaExecutable);
}
diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java
index e6c2d9bb0..6a2ef2d34 100644
--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java
+++ b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMRunner.java
@@ -22,14 +22,17 @@ public class MacOSXVMRunner extends StandardVMRunner {
super(vmInstance);
}
+ @Override
protected Process exec(String[] cmdLine, File workingDirectory) throws CoreException {
return super.exec(MacOSXLaunchingPlugin.wrap(getClass(), cmdLine), workingDirectory);
}
+ @Override
protected Process exec(String[] cmdLine, File workingDirectory, String[] envp) throws CoreException {
return super.exec(MacOSXLaunchingPlugin.wrap(getClass(), cmdLine), workingDirectory, envp);
}
+ @Override
protected String renderCommandLine(String[] commandLine) {
return super.renderCommandLine(MacOSXLaunchingPlugin.wrap(getClass(), commandLine));
}
diff --git a/org.eclipse.jdt.launching.ui.macosx/.classpath b/org.eclipse.jdt.launching.ui.macosx/.classpath
index 2fbb7a23e..64c5e31b7 100644
--- a/org.eclipse.jdt.launching.ui.macosx/.classpath
+++ b/org.eclipse.jdt.launching.ui.macosx/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.core.prefs
index 7a90c7530..a926bd737 100644
--- a/org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.core.prefs
@@ -1,107 +1,121 @@
-#Thu Jan 20 17:11:20 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=error
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
-org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
-org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..bf9e9379a
--- /dev/null
+++ b/org.eclipse.jdt.launching.ui.macosx/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
diff --git a/org.eclipse.jdt.launching.ui.macosx/META-INF/MANIFEST.MF b/org.eclipse.jdt.launching.ui.macosx/META-INF/MANIFEST.MF
index 45c73254a..71f1bd992 100644
--- a/org.eclipse.jdt.launching.ui.macosx/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.launching.ui.macosx/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.launching.ui.macosx;singleton:=true
Bundle-Version: 1.0.100.qualifier
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
Eclipse-PlatformFilter: (osgi.os=macosx)
Require-Bundle: org.eclipse.jdt.launching;bundle-version="[3.5.0,4.0.0)",
diff --git a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardBasePage.java b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardBasePage.java
index 87c128925..92f07d930 100644
--- a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardBasePage.java
+++ b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardBasePage.java
@@ -54,6 +54,7 @@ public abstract class BundleWizardBasePage extends DialogPage implements IWizard
/* (non-Javadoc)
* Method declared in WizardPage
*/
+ @Override
public void setVisible(boolean visible) {
if (visible)
enterPage();
@@ -70,7 +71,8 @@ public abstract class BundleWizardBasePage extends DialogPage implements IWizard
//System.out.println("leavePage: " + getName());
}
- public Image getImage() {
+ @Override
+ public Image getImage() {
Image result = super.getImage();
if (result == null && fWizard != null)
@@ -178,6 +180,7 @@ public abstract class BundleWizardBasePage extends DialogPage implements IWizard
void hookButton(final Button b, final String key) {
b.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fBundleDescription.setValue(key, new Boolean(b.getSelection()));
checkIfPageComplete();
diff --git a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage1.java b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage1.java
index 9b22f39ec..f655f0ce1 100644
--- a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage1.java
+++ b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage1.java
@@ -56,6 +56,7 @@ public class BundleWizardPage1 extends BundleWizardBasePage {
super("page1", bd); //$NON-NLS-1$
}
+ @Override
public void createContents(Composite c) {
final Shell shell= c.getShell();
@@ -67,6 +68,7 @@ public class BundleWizardPage1 extends BundleWizardBasePage {
fillCombo(fLaunchConfigs);
fLaunchConfigs.addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
int ix= fLaunchConfigs.getSelectionIndex();
if (ix > 0 && ix < fConfigurations.length) {
@@ -85,6 +87,7 @@ public class BundleWizardPage1 extends BundleWizardBasePage {
fMainClass= createText(c7a, MAINCLASS, 1);
Button b1= createButton(c7a, SWT.NONE, Util.getString("page1.mainClass.chooseButton.label")); //$NON-NLS-1$
b1.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
MessageBox mb= new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);
mb.setMessage(Util.getString("page1.mainClass.dialog.message")); //$NON-NLS-1$
@@ -107,6 +110,7 @@ public class BundleWizardPage1 extends BundleWizardBasePage {
final Button browse= createButton(c3a, SWT.NONE, Util.getString("page1.appFolder.browseButton.label")); //$NON-NLS-1$
browse.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dd= new DirectoryDialog(browse.getShell(), SWT.SAVE);
dd.setMessage(Util.getString("page1.appFolder.browseDialog.message")); //$NON-NLS-1$
@@ -138,6 +142,7 @@ public class BundleWizardPage1 extends BundleWizardBasePage {
fIconFileName= createText(c7, ICONFILE, 1);
final Button b= createButton(c7, SWT.NONE, Util.getString("page1.appIcon.chooseButton.label")); //$NON-NLS-1$
b.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
FileDialog fd= new FileDialog(b.getShell(), SWT.OPEN);
fd.setText(Util.getString("page1.appIcon.chooseDialog.title")); //$NON-NLS-1$
@@ -150,6 +155,7 @@ public class BundleWizardPage1 extends BundleWizardBasePage {
}
+ @Override
void enterPage() {
super.enterPage();
initCombo(fLaunchConfigs);
@@ -194,6 +200,7 @@ public class BundleWizardPage1 extends BundleWizardBasePage {
return lc1.getName().compareTo(lc2.getName());
}
+ @Override
public boolean equals(Object obj) {
return false;
}
diff --git a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage2.java b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage2.java
index e4b3bcf3e..5c7703720 100644
--- a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage2.java
+++ b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage2.java
@@ -29,6 +29,7 @@ public class BundleWizardPage2 extends BundleWizardBasePage {
super("page2", bd); //$NON-NLS-1$
}
+ @Override
public void createContents(Composite parent) {
Composite c= createComposite(parent, 2);
@@ -46,6 +47,7 @@ public class BundleWizardPage2 extends BundleWizardBasePage {
Composite c1= createComposite(g1, 3);
final Button addButton1= createButton(c1, SWT.NONE, Util.getString("page2.addFile.button.label")); //$NON-NLS-1$
addButton1.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
FileDialog fd= new FileDialog(addButton1.getShell(), SWT.OPEN);
fd.setText(Util.getString("page2.chooseFileDialog.title")); //$NON-NLS-1$
@@ -59,6 +61,7 @@ public class BundleWizardPage2 extends BundleWizardBasePage {
});
final Button addButton2= createButton(c1, SWT.NONE, Util.getString("page2.addFolder.button.label")); //$NON-NLS-1$
addButton2.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog fd= new DirectoryDialog(addButton2.getShell(), SWT.OPEN);
fd.setText(Util.getString("page2.chooseFolder.dialog.title")); //$NON-NLS-1$
@@ -73,11 +76,13 @@ public class BundleWizardPage2 extends BundleWizardBasePage {
final Button removeButton= createButton(c1, SWT.NONE, Util.getString("page2.remove.button.label")); //$NON-NLS-1$
removeButton.setEnabled(false);
removeButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
remove(table, onClasspath, removeButton);
}
});
table.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
removeButton.setEnabled(table.getSelectionCount() > 0);
}
diff --git a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage3.java b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage3.java
index 3d6bd789f..7f77c5add 100644
--- a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage3.java
+++ b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/BundleWizardPage3.java
@@ -33,6 +33,7 @@ public class BundleWizardPage3 extends BundleWizardBasePage {
super("page3", bd); //$NON-NLS-1$
}
+ @Override
public void createContents(Composite c) {
Composite c1= createComposite(c, 4);
@@ -51,6 +52,7 @@ public class BundleWizardPage3 extends BundleWizardBasePage {
fProperties.setHeaderVisible(true);
fProperties.setLinesVisible(true);
fProperties.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
//
}
diff --git a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/MacBundleWizard.java b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/MacBundleWizard.java
index 2211d993e..5953048ad 100644
--- a/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/MacBundleWizard.java
+++ b/org.eclipse.jdt.launching.ui.macosx/src/org/eclipse/jdt/internal/ui/macbundler/MacBundleWizard.java
@@ -48,6 +48,7 @@ public class MacBundleWizard extends Wizard implements IExportWizard, BundleAttr
* (non-Javadoc)
* Method declared on IWizard.
*/
+ @Override
public void addPages() {
super.addPages();
addPage(new BundleWizardPage1(fBundleDescription));
@@ -58,6 +59,7 @@ public class MacBundleWizard extends Wizard implements IExportWizard, BundleAttr
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
try {
BundleBuilder bb= new BundleBuilder();
diff --git a/org.eclipse.jdt.launching/.classpath b/org.eclipse.jdt.launching/.classpath
index 08cb99ed0..b3dd0220e 100644
--- a/org.eclipse.jdt.launching/.classpath
+++ b/org.eclipse.jdt.launching/.classpath
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="launching"/>
<classpathentry kind="src" output="support_bin" path="support"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.jdt.launching/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.launching/.settings/org.eclipse.jdt.core.prefs
index 865b860af..a926bd737 100644
--- a/org.eclipse.jdt.launching/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.launching/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Thu Jan 20 17:11:20 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,17 +6,22 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -26,11 +30,12 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
@@ -63,21 +68,30 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -99,7 +113,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING
diff --git a/org.eclipse.jdt.launching/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.launching/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..bf9e9379a
--- /dev/null
+++ b/org.eclipse.jdt.launching/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,54 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
+cleanup_settings_version=2
+eclipse.preferences.version=1
diff --git a/org.eclipse.jdt.launching/META-INF/MANIFEST.MF b/org.eclipse.jdt.launching/META-INF/MANIFEST.MF
index e9510d500..07aa0b292 100644
--- a/org.eclipse.jdt.launching/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.launching/META-INF/MANIFEST.MF
@@ -22,4 +22,4 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
Bundle-ActivationPolicy: lazy
Import-Package: com.ibm.icu.text
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CompositeId.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CompositeId.java
index e3e0f3167..c60de09cc 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CompositeId.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CompositeId.java
@@ -36,6 +36,7 @@ public class CompositeId {
return new CompositeId(result);
}
+ @Override
public String toString() {
StringBuffer buf= new StringBuffer();
for (int i= 0; i < fParts.length; i++) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DefaultProjectClasspathEntry.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DefaultProjectClasspathEntry.java
index 3248fb748..e118af70e 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DefaultProjectClasspathEntry.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DefaultProjectClasspathEntry.java
@@ -64,6 +64,7 @@ public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.launching.AbstractRuntimeClasspathEntry#buildMemento(org.w3c.dom.Document, org.w3c.dom.Element)
*/
+ @Override
protected void buildMemento(Document document, Element memento) throws CoreException {
memento.setAttribute("project", getJavaProject().getElementName()); //$NON-NLS-1$
memento.setAttribute("exportedEntriesOnly", Boolean.toString(fExportedEntriesOnly)); //$NON-NLS-1$
@@ -106,6 +107,7 @@ public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IRuntimeClasspathEntry#getLocation()
*/
+ @Override
public String getLocation() {
return getProject().getLocation().toOSString();
}
@@ -113,6 +115,7 @@ public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IRuntimeClasspathEntry#getPath()
*/
+ @Override
public IPath getPath() {
return getProject().getFullPath();
}
@@ -120,6 +123,7 @@ public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IRuntimeClasspathEntry#getResource()
*/
+ @Override
public IResource getResource() {
return getProject();
}
@@ -311,6 +315,7 @@ public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IRuntimeClasspathEntry2#isComposite()
*/
+ @Override
public boolean isComposite() {
return true;
}
@@ -326,6 +331,7 @@ public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof DefaultProjectClasspathEntry) {
DefaultProjectClasspathEntry entry = (DefaultProjectClasspathEntry) obj;
@@ -337,6 +343,7 @@ public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getJavaProject().hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
index 06aef5d2e..9d65baa0d 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
@@ -51,6 +51,7 @@ public class EECompilationParticipant extends CompilationParticipant {
/* (non-Javadoc)
* @see org.eclipse.jdt.core.compiler.CompilationParticipant#isActive(org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public boolean isActive(IJavaProject project) {
return true;
}
@@ -58,6 +59,7 @@ public class EECompilationParticipant extends CompilationParticipant {
/* (non-Javadoc)
* @see org.eclipse.jdt.core.compiler.CompilationParticipant#cleanStarting(org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public void cleanStarting(IJavaProject project) {
super.cleanStarting(project);
fCleaned.add(project);
@@ -66,6 +68,7 @@ public class EECompilationParticipant extends CompilationParticipant {
/* (non-Javadoc)
* @see org.eclipse.jdt.core.compiler.CompilationParticipant#buildFinished(org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public void buildFinished(IJavaProject project) {
super.buildFinished(project);
if (fCleaned.remove(project)) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMInstall.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMInstall.java
index 73f6ab459..8e4ae042d 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMInstall.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMInstall.java
@@ -59,6 +59,7 @@ public class EEVMInstall extends StandardVM {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.launching.StandardVM#getJavaVersion()
*/
+ @Override
public String getJavaVersion() {
return getAttribute(ATTR_JAVA_VERSION);
}
@@ -66,6 +67,7 @@ public class EEVMInstall extends StandardVM {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.launching.StandardVM#getJavaExecutable()
*/
+ @Override
File getJavaExecutable() {
String exe = getAttribute(ATTR_JAVA_EXE);
if (exe != null) {
@@ -77,6 +79,7 @@ public class EEVMInstall extends StandardVM {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.launching.StandardVM#getDebugArgs()
*/
+ @Override
public String getDebugArgs() {
return getAttribute(ATTR_DEBUG_ARGS);
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java
index 447f70f27..f9e8c4dee 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java
@@ -114,6 +114,7 @@ public class EEVMType extends AbstractVMInstallType {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.AbstractVMInstallType#doCreateVMInstall(java.lang.String)
*/
+ @Override
protected IVMInstall doCreateVMInstall(String id) {
return new EEVMInstall(this, id);
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainer.java
index 247c56f1f..a64bc8a63 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainer.java
@@ -95,6 +95,7 @@ public class JREContainer implements IClasspathContainer {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof RuleKey) {
RuleKey key = (RuleKey) obj;
@@ -106,6 +107,7 @@ public class JREContainer implements IClasspathContainer {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return fEnvironmentId.hashCode() + fInstall.hashCode();
}
@@ -141,6 +143,7 @@ public class JREContainer implements IClasspathContainer {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
IAccessRule[][] rules = null;
if(obj instanceof RuleEntry) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java
index 8c7498955..195a25101 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java
@@ -45,6 +45,7 @@ public class JREContainerInitializer extends ClasspathContainerInitializer {
/**
* @see ClasspathContainerInitializer#initialize(IPath, IJavaProject)
*/
+ @Override
public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
if (JREContainer.DEBUG_JRE_CONTAINER) {
System.out.println("<JRE_CONTAINER> initialize()"); //$NON-NLS-1$
@@ -267,6 +268,7 @@ public class JREContainerInitializer extends ClasspathContainerInitializer {
*
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#canUpdateClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project) {
if (containerPath != null && containerPath.segmentCount() > 0) {
if (JavaRuntime.JRE_CONTAINER.equals(containerPath.segment(0))) {
@@ -282,6 +284,7 @@ public class JREContainerInitializer extends ClasspathContainerInitializer {
/* (non-Javadoc)
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getAccessRulesStatus(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public IStatus getAccessRulesStatus(IPath containerPath, IJavaProject project) {
return READ_ONLY;
}
@@ -289,6 +292,7 @@ public class JREContainerInitializer extends ClasspathContainerInitializer {
/* (non-Javadoc)
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getSourceAttachmentStatus(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public IStatus getSourceAttachmentStatus(IPath containerPath, IJavaProject project) {
return Status.OK_STATUS;
}
@@ -296,6 +300,7 @@ public class JREContainerInitializer extends ClasspathContainerInitializer {
/* (non-Javadoc)
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getAttributeStatus(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, java.lang.String)
*/
+ @Override
public IStatus getAttributeStatus(IPath containerPath, IJavaProject project, String attributeKey) {
if (attributeKey.equals(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME)) {
return Status.OK_STATUS;
@@ -309,6 +314,7 @@ public class JREContainerInitializer extends ClasspathContainerInitializer {
/**
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathContainer)
*/
+ @Override
public void requestClasspathContainerUpdate(IPath containerPath, IJavaProject project, IClasspathContainer containerSuggestion) throws CoreException {
IVMInstall vm = resolveVM(containerPath);
if (vm == null) {
@@ -367,6 +373,7 @@ public class JREContainerInitializer extends ClasspathContainerInitializer {
/**
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
+ @Override
public String getDescription(IPath containerPath, IJavaProject project) {
String tag = getExecutionEnvironmentId(containerPath);
if (tag == null && containerPath.segmentCount() > 2) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREPreferenceModifyListener.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREPreferenceModifyListener.java
index 63d7a85ee..c2bfabddf 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREPreferenceModifyListener.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREPreferenceModifyListener.java
@@ -121,6 +121,7 @@ public class JREPreferenceModifyListener extends PreferenceModifyListener {
}
+ @Override
public IEclipsePreferences preApply(IEclipsePreferences node) {
try {
// force VMs to be initialized before we import the new VMs
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaAppletLaunchConfigurationDelegate.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaAppletLaunchConfigurationDelegate.java
index 7e9c564c3..6034d1824 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaAppletLaunchConfigurationDelegate.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaAppletLaunchConfigurationDelegate.java
@@ -56,6 +56,7 @@ public class JavaAppletLaunchConfigurationDelegate extends JavaLaunchDelegate im
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public synchronized void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
try {
fLaunch = launch;
@@ -163,6 +164,7 @@ public class JavaAppletLaunchConfigurationDelegate extends JavaLaunchDelegate im
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
@@ -290,6 +292,7 @@ public class JavaAppletLaunchConfigurationDelegate extends JavaLaunchDelegate im
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
File workingDir = verifyWorkingDirectory(configuration);
// Construct the HTML file and set its name as a program argument
@@ -309,6 +312,7 @@ public class JavaAppletLaunchConfigurationDelegate extends JavaLaunchDelegate im
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getVMArguments(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public String getVMArguments(ILaunchConfiguration configuration) throws CoreException {
StringBuffer arguments = new StringBuffer(super.getVMArguments(configuration));
File workingDir = verifyWorkingDirectory(configuration);
@@ -321,6 +325,7 @@ public class JavaAppletLaunchConfigurationDelegate extends JavaLaunchDelegate im
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getMainTypeName(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public String getMainTypeName(ILaunchConfiguration configuration) throws CoreException {
return configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_APPLETVIEWER_CLASS, IJavaLaunchConfigurationConstants.DEFAULT_APPLETVIEWER_CLASS);
}
@@ -339,6 +344,7 @@ public class JavaAppletLaunchConfigurationDelegate extends JavaLaunchDelegate im
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getDefaultWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
protected File getDefaultWorkingDirectory(ILaunchConfiguration configuration) throws CoreException {
// default working dir for applets is the project's output directory
String outputDir = JavaRuntime.getProjectOutputDirectory(configuration);
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaClasspathVariablesInitializer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaClasspathVariablesInitializer.java
index 35bad8b43..cb4d1a7e8 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaClasspathVariablesInitializer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaClasspathVariablesInitializer.java
@@ -35,6 +35,7 @@ public class JavaClasspathVariablesInitializer extends ClasspathVariableInitiali
/**
* @see ClasspathVariableInitializer#initialize(String)
*/
+ @Override
public void initialize(String variable) {
IVMInstall vmInstall= JavaRuntime.getDefaultVMInstall();
if (vmInstall != null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaSourceLookupDirector.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaSourceLookupDirector.java
index 6d2d6f839..1ff245d15 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaSourceLookupDirector.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaSourceLookupDirector.java
@@ -45,6 +45,7 @@ public class JavaSourceLookupDirector extends AbstractSourceLookupDirector {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType)
*/
+ @Override
public boolean supportsSourceContainerType(ISourceContainerType type) {
return !fFilteredTypes.contains(type.getId());
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPlugin.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPlugin.java
index f24ec1539..10d4bf580 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPlugin.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPlugin.java
@@ -361,6 +361,7 @@ public class LaunchingPlugin extends Plugin implements IEclipsePreferences.IPref
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
fChanges.doit(monitor);
@@ -489,6 +490,7 @@ public class LaunchingPlugin extends Plugin implements IEclipsePreferences.IPref
*
* @see Plugin#stop(BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
try {
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
@@ -508,6 +510,7 @@ public class LaunchingPlugin extends Plugin implements IEclipsePreferences.IPref
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.jdt.launching/debug")); //$NON-NLS-1$//$NON-NLS-2$
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPreferenceInitializer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPreferenceInitializer.java
index a6fff7f70..032e2920d 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPreferenceInitializer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingPreferenceInitializer.java
@@ -28,6 +28,7 @@ public class LaunchingPreferenceInitializer extends AbstractPreferenceInitialize
/* (non-Javadoc)
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
IEclipsePreferences dnode = DefaultScope.INSTANCE.getNode(LaunchingPlugin.ID_PLUGIN);
if(dnode == null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacInstalledJREs.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacInstalledJREs.java
index 4ba5b40d0..a75790932 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacInstalledJREs.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/MacInstalledJREs.java
@@ -88,6 +88,7 @@ public class MacInstalledJREs {
return fVersion;
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof JREDescriptor) {
JREDescriptor jre = (JREDescriptor) obj;
@@ -96,6 +97,7 @@ public class MacInstalledJREs {
return false;
}
+ @Override
public int hashCode() {
return fHome.hashCode() + fName.hashCode() + fVersion.hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/RuntimeClasspathEntry.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/RuntimeClasspathEntry.java
index b7cc0836e..284896485 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/RuntimeClasspathEntry.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/RuntimeClasspathEntry.java
@@ -483,6 +483,7 @@ public class RuntimeClasspathEntry implements IRuntimeClasspathEntry {
/**
* @see Object#equals(Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof IRuntimeClasspathEntry) {
IRuntimeClasspathEntry r = (IRuntimeClasspathEntry)obj;
@@ -524,6 +525,7 @@ public class RuntimeClasspathEntry implements IRuntimeClasspathEntry {
/**
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
if (getType() == CONTAINER) {
return getPath().segment(0).hashCode() + getType();
@@ -607,6 +609,7 @@ public class RuntimeClasspathEntry implements IRuntimeClasspathEntry {
return string == null || string.length() == 0;
}
+ @Override
public String toString() {
if (fClasspathEntry != null) {
return fClasspathEntry.toString();
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java
index bc22498df..ef9d2d825 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java
@@ -98,9 +98,11 @@ public class SocketListenConnectorProcess implements IProcess {
fWaitForConnectionJob = new WaitForConnectionJob(this,connector,arguments);
fWaitForConnectionJob.setPriority(Job.SHORT);
fWaitForConnectionJob.addJobChangeListener(new JobChangeAdapter(){
+ @Override
public void running(IJobChangeEvent event) {
fireReadyToAcceptEvent();
}
+ @Override
public void done(IJobChangeEvent event) {
if (event.getResult().equals(Status.CANCEL_STATUS)){
try{
@@ -247,6 +249,7 @@ public class SocketListenConnectorProcess implements IProcess {
fArguments = arguments;
}
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try{
// The following code sets a timeout (not officially supported in Sun's spec).
@@ -302,6 +305,7 @@ public class SocketListenConnectorProcess implements IProcess {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#canceling()
*/
+ @Override
protected void canceling() {
stopListening();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVM.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVM.java
index 72bc811ba..6943e2fb3 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVM.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVM.java
@@ -28,6 +28,7 @@ public class Standard11xVM extends StandardVM {
/**
* @see org.eclipse.jdt.launching.IVMInstall#getVMRunner(String)
*/
+ @Override
public IVMRunner getVMRunner(String mode) {
if (ILaunchManager.RUN_MODE.equals(mode)) {
return new Standard11xVMRunner(this);
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMRunner.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMRunner.java
index ce13beb36..932ae5986 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMRunner.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMRunner.java
@@ -39,6 +39,7 @@ public class Standard11xVMRunner extends StandardVMRunner {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IVMRunner#run(org.eclipse.jdt.launching.VMRunnerConfiguration, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
if (monitor == null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMType.java
index 2f405c4f5..30b128616 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/Standard11xVMType.java
@@ -27,6 +27,7 @@ public class Standard11xVMType extends StandardVMType {
/**
* @see org.eclipse.jdt.internal.launching.StandardVMType#getDefaultSystemLibrary(java.io.File)
*/
+ @Override
protected IPath getDefaultSystemLibrary(File installLocation) {
return new Path(installLocation.getPath()).append("lib").append("classes.zip"); //$NON-NLS-2$ //$NON-NLS-1$
}
@@ -34,6 +35,7 @@ public class Standard11xVMType extends StandardVMType {
/**
* @see org.eclipse.jdt.launching.AbstractVMInstallType#doCreateVMInstall(java.lang.String)
*/
+ @Override
protected IVMInstall doCreateVMInstall(String id) {
return new Standard11xVM(this, id);
}
@@ -41,6 +43,7 @@ public class Standard11xVMType extends StandardVMType {
/**
* @see org.eclipse.jdt.internal.launching.StandardVMType#getDefaultSystemLibrarySource(java.io.File)
*/
+ @Override
protected IPath getDefaultSystemLibrarySource(File libLocation) {
setDefaultRootPath(""); //$NON-NLS-1$
return Path.EMPTY;
@@ -49,6 +52,7 @@ public class Standard11xVMType extends StandardVMType {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IVMInstallType#getName()
*/
+ @Override
public String getName() {
return LaunchingMessages.Standard11xVMType_Standard_1_1_x_VM_1;
}
@@ -58,6 +62,7 @@ public class Standard11xVMType extends StandardVMType {
*
* @see StandardVMType#getDefaultExtensionDirectory(File)
*/
+ @Override
protected File getDefaultExtensionDirectory(File installLocation) {
return null;
}
@@ -65,6 +70,7 @@ public class Standard11xVMType extends StandardVMType {
/**
* @see org.eclipse.jdt.internal.launching.StandardVMType#getDefaultEndorsedDirectory(java.io.File)
*/
+ @Override
protected File getDefaultEndorsedDirectory(File installLocation) {
return null;
}
@@ -72,6 +78,7 @@ public class Standard11xVMType extends StandardVMType {
/**
* @see org.eclipse.jdt.launching.IVMInstallType#getDefaultLibraryLocations(java.io.File)
*/
+ @Override
public LibraryLocation[] getDefaultLibraryLocations(File installLocation) {
IPath libPath = getDefaultSystemLibrary(installLocation);
File lib = libPath.toFile();
@@ -85,6 +92,7 @@ public class Standard11xVMType extends StandardVMType {
* Return <code>true</code> if the appropriate system libraries can be found for the
* specified java executable, <code>false</code> otherwise.
*/
+ @Override
protected boolean canDetectDefaultSystemLibraries(File javaHome, File javaExecutable) {
LibraryLocation[] locations = getDefaultLibraryLocations(javaHome);
String version = getVMVersion(javaHome, javaExecutable);
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVM.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVM.java
index 535c4e886..c7b670729 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVM.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVM.java
@@ -33,6 +33,7 @@ public class StandardVM extends AbstractVMInstall {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IVMInstall#getVMRunner(java.lang.String)
*/
+ @Override
public IVMRunner getVMRunner(String mode) {
if (ILaunchManager.RUN_MODE.equals(mode)) {
return new StandardVMRunner(this);
@@ -45,7 +46,8 @@ public class StandardVM extends AbstractVMInstall {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IVMInstall#getJavaVersion()
*/
- public String getJavaVersion() {
+ @Override
+ public String getJavaVersion() {
StandardVMType installType = (StandardVMType) getVMInstallType();
File installLocation = getInstallLocation();
if (installLocation != null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java
index ec5d6ca09..624c7d53e 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java
@@ -142,6 +142,7 @@ public class StandardVMDebugger extends StandardVMRunner {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IVMRunner#run(org.eclipse.jdt.launching.VMRunnerConfiguration, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
if (monitor == null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java
index 1ede69a3b..953f1d4df 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java
@@ -148,6 +148,7 @@ public class StandardVMRunner extends AbstractVMRunner {
/**
* @see VMRunner#getPluginIdentifier()
*/
+ @Override
protected String getPluginIdentifier() {
return LaunchingPlugin.getUniqueIdentifier();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
index 4cbf0460a..a43fde2d8 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
@@ -122,6 +122,7 @@ public class StandardVMType extends AbstractVMInstallType {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.AbstractVMInstallType#doCreateVMInstall(java.lang.String)
*/
+ @Override
protected IVMInstall doCreateVMInstall(String id) {
return new StandardVM(this, id);
}
@@ -634,6 +635,7 @@ public class StandardVMType extends AbstractVMInstallType {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IVMInstallType#disposeVMInstall(java.lang.String)
*/
+ @Override
public void disposeVMInstall(String id) {
IVMInstall vm = findVMInstall(id);
if (vm != null) {
@@ -648,6 +650,7 @@ public class StandardVMType extends AbstractVMInstallType {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.AbstractVMInstallType#getDefaultJavadocLocation(java.io.File)
*/
+ @Override
public URL getDefaultJavadocLocation(File installLocation) {
File javaExecutable = findJavaExecutable(installLocation);
if (javaExecutable != null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/VariableClasspathEntry.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/VariableClasspathEntry.java
index 16a8c026b..ab3a2f46b 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/VariableClasspathEntry.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/VariableClasspathEntry.java
@@ -41,6 +41,7 @@ public class VariableClasspathEntry extends AbstractRuntimeClasspathEntry {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.launching.AbstractRuntimeClasspathEntry#buildMemento(org.w3c.dom.Document, org.w3c.dom.Element)
*/
+ @Override
protected void buildMemento(Document document, Element memento) throws CoreException {
memento.setAttribute("variableString", variableString); //$NON-NLS-1$
memento.setAttribute("path", Integer.toString(getClasspathProperty())); //$NON-NLS-1$
@@ -104,6 +105,7 @@ public class VariableClasspathEntry extends AbstractRuntimeClasspathEntry {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
if (variableString != null) {
return variableString.hashCode();
@@ -114,6 +116,7 @@ public class VariableClasspathEntry extends AbstractRuntimeClasspathEntry {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof VariableClasspathEntry) {
VariableClasspathEntry other= (VariableClasspathEntry)obj;
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/AccessRuleParticipant.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/AccessRuleParticipant.java
index 495fb32c3..add7245e5 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/AccessRuleParticipant.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/AccessRuleParticipant.java
@@ -94,6 +94,7 @@ class AccessRuleParticipant implements IAccessRuleParticipant {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof AccessRuleParticipant) {
AccessRuleParticipant participant = (AccessRuleParticipant) obj;
@@ -105,6 +106,7 @@ class AccessRuleParticipant implements IAccessRuleParticipant {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getDelegateClassName().hashCode();
}
@@ -112,6 +114,7 @@ class AccessRuleParticipant implements IAccessRuleParticipant {
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getDelegateClassName();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java
index c1213124b..30b23fb7e 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java
@@ -877,6 +877,7 @@ public abstract class AbstractJavaLaunchConfigurationDelegate
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getBuildOrder(org.eclipse.debug.core.ILaunchConfiguration,
* java.lang.String)
*/
+ @Override
protected IProject[] getBuildOrder(ILaunchConfiguration configuration,
String mode) throws CoreException {
return fOrderedProjects;
@@ -887,6 +888,7 @@ public abstract class AbstractJavaLaunchConfigurationDelegate
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getProjectsForProblemSearch(org.eclipse.debug.core.ILaunchConfiguration,
* java.lang.String)
*/
+ @Override
protected IProject[] getProjectsForProblemSearch(
ILaunchConfiguration configuration, String mode)
throws CoreException {
@@ -896,6 +898,7 @@ public abstract class AbstractJavaLaunchConfigurationDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#isLaunchProblem(org.eclipse.core.resources.IMarker)
*/
+ @Override
protected boolean isLaunchProblem(IMarker problemMarker) throws CoreException {
return super.isLaunchProblem(problemMarker) && problemMarker.getType().equals(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER);
}
@@ -905,6 +908,7 @@ public abstract class AbstractJavaLaunchConfigurationDelegate
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration,
* java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public boolean preLaunchCheck(ILaunchConfiguration configuration,
String mode, IProgressMonitor monitor) throws CoreException {
// build project list
@@ -924,7 +928,8 @@ public abstract class AbstractJavaLaunchConfigurationDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getBreakpoints(org.eclipse.debug.core.ILaunchConfiguration)
*/
- protected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration) {
+ @Override
+ protected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration) {
IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
if (!breakpointManager.isEnabled()) {
// no need to check breakpoints individually.
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstall.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstall.java
index f6c4c54e8..95ab5975f 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstall.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstall.java
@@ -239,6 +239,7 @@ public abstract class AbstractVMInstall implements IVMInstall, IVMInstall2, IVMI
* @see java.lang.Object#equals(java.lang.Object)
* @since 2.1
*/
+ @Override
public boolean equals(Object object) {
if (object instanceof IVMInstall) {
IVMInstall vm = (IVMInstall)object;
@@ -252,6 +253,7 @@ public abstract class AbstractVMInstall implements IVMInstall, IVMInstall2, IVMI
* @see java.lang.Object#hashCode()
* @since 2.1
*/
+ @Override
public int hashCode() {
return getVMInstallType().hashCode() + getId().hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IJavaLaunchConfigurationConstants.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IJavaLaunchConfigurationConstants.java
index 3674faad3..c0c45130e 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IJavaLaunchConfigurationConstants.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IJavaLaunchConfigurationConstants.java
@@ -132,6 +132,7 @@ public interface IJavaLaunchConfigurationConstants {
*
* @deprecated use <code>ATTR_JRE_CONTAINER_PATH</code>
*/
+ @Deprecated
public static final String ATTR_VM_INSTALL_NAME = LaunchingPlugin.getUniqueIdentifier() + ".VM_INSTALL_NAME"; //$NON-NLS-1$
/**
@@ -143,6 +144,7 @@ public interface IJavaLaunchConfigurationConstants {
*
* @deprecated use <code>ATTR_JRE_CONTAINER_PATH</code>
*/
+ @Deprecated
public static final String ATTR_VM_INSTALL_TYPE = LaunchingPlugin.getUniqueIdentifier() + ".VM_INSTALL_TYPE_ID"; //$NON-NLS-1$
/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IRuntimeContainerComparator.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IRuntimeContainerComparator.java
index e6a7d28a3..9c5366f86 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IRuntimeContainerComparator.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IRuntimeContainerComparator.java
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.IPath;
* used to determine equality before using the support defined in
* <code>ClasspathContainerInitializer</code>.
*/
+@Deprecated
public interface IRuntimeContainerComparator {
/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IVMInstall.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IVMInstall.java
index 29c723d66..b66e57b47 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IVMInstall.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IVMInstall.java
@@ -152,6 +152,7 @@ public interface IVMInstall {
* @deprecated if possible, clients should use setVMArgs(String) on
* {@link IVMInstall2} when possible
*/
+ @Deprecated
public void setVMArguments(String[] vmArgs);
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
index 9a2c15731..24aa511c3 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
@@ -254,6 +254,7 @@ public final class JavaRuntime {
*
* @deprecated - use <code>IProcess.ATTR_CMDLINE</code>
*/
+ @Deprecated
public final static String ATTR_CMDLINE= LaunchingPlugin.getUniqueIdentifier() + ".launcher.cmdLine"; //$NON-NLS-1$
/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/LibraryLocation.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/LibraryLocation.java
index 67377c534..170aa5f90 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/LibraryLocation.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/LibraryLocation.java
@@ -114,6 +114,7 @@ public final class LibraryLocation {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof LibraryLocation) {
LibraryLocation lib = (LibraryLocation)obj;
@@ -128,6 +129,7 @@ public final class LibraryLocation {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getSystemLibraryPath().hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/SocketUtil.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/SocketUtil.java
index 46f2976f8..5123122a9 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/SocketUtil.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/SocketUtil.java
@@ -37,6 +37,7 @@ public class SocketUtil {
* method can return a port that is already in use since the implementation does
* not bind to the given port to ensure that it is free.
*/
+ @Deprecated
public static int findUnusedLocalPort(String host, int searchFrom, int searchTo) {
for (int i= 0; i < 10; i++) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/StandardSourcePathProvider.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/StandardSourcePathProvider.java
index 24ee946b5..21176e56a 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/StandardSourcePathProvider.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/StandardSourcePathProvider.java
@@ -39,6 +39,7 @@ public class StandardSourcePathProvider extends StandardClasspathProvider {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IRuntimeClasspathProvider#computeUnresolvedClasspath(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_SOURCE_PATH, true);
IRuntimeClasspathEntry[] entries = null;
@@ -56,6 +57,7 @@ public class StandardSourcePathProvider extends StandardClasspathProvider {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IRuntimeClasspathProvider#resolveClasspath(org.eclipse.jdt.launching.IRuntimeClasspathEntry[], org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public IRuntimeClasspathEntry[] resolveClasspath(IRuntimeClasspathEntry[] entries, ILaunchConfiguration configuration) throws CoreException {
List all = new UniqueList(entries.length);
for (int i = 0; i < entries.length; i++) {
@@ -157,54 +159,64 @@ public class StandardSourcePathProvider extends StandardClasspathProvider {
set = new HashSet(length);
}
- public void add(int index, Object element) {
+ @Override
+ public void add(int index, Object element) {
if (set.add(element))
super.add(index, element);
}
- public boolean add(Object o) {
+ @Override
+ public boolean add(Object o) {
if (set.add(o))
return super.add(o);
return false;
}
- public boolean addAll(Collection c) {
+ @Override
+ public boolean addAll(Collection c) {
if (set.addAll(c))
return super.addAll(c);
return false;
}
- public boolean addAll(int index, Collection c) {
+ @Override
+ public boolean addAll(int index, Collection c) {
if (set.addAll(c))
return super.addAll(index, c);
return false;
}
- public void clear() {
+ @Override
+ public void clear() {
set.clear();
super.clear();
}
- public boolean contains(Object elem) {
+ @Override
+ public boolean contains(Object elem) {
return set.contains(elem);
}
- public void ensureCapacity(int minCapacity) {
+ @Override
+ public void ensureCapacity(int minCapacity) {
super.ensureCapacity(minCapacity);
}
- public Object remove(int index) {
+ @Override
+ public Object remove(int index) {
Object object = super.remove(index);
set.remove(object);
return object;
}
- protected void removeRange(int fromIndex, int toIndex) {
+ @Override
+ protected void removeRange(int fromIndex, int toIndex) {
for (int index = fromIndex; index<=toIndex; index++)
remove(index);
}
- public Object set(int index, Object element) {
+ @Override
+ public Object set(int index, Object element) {
set.remove(element);
if (set.add(element))
return super.set(index, element);
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/VMStandin.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/VMStandin.java
index 148181c0e..69b226c8e 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/VMStandin.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/VMStandin.java
@@ -157,7 +157,8 @@ public class VMStandin extends AbstractVMInstall {
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.IVMInstall#getJavaVersion()
*/
- public String getJavaVersion() {
+ @Override
+ public String getJavaVersion() {
return fJavaVersion;
}
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ArchiveSourceLocation.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ArchiveSourceLocation.java
index 1809d04fc..77751cdd2 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ArchiveSourceLocation.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ArchiveSourceLocation.java
@@ -60,6 +60,7 @@ import com.ibm.icu.text.MessageFormat;
* and <code>org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer</code>.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class ArchiveSourceLocation extends PlatformObject implements IJavaSourceLocation {
/**
@@ -293,6 +294,7 @@ public class ArchiveSourceLocation extends PlatformObject implements IJavaSource
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
return object instanceof ArchiveSourceLocation &&
getName().equals(((ArchiveSourceLocation)object).getName());
@@ -301,6 +303,7 @@ public class ArchiveSourceLocation extends PlatformObject implements IJavaSource
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getName().hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java
index 550e2dba5..48600d5f7 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java
@@ -54,6 +54,7 @@ import com.ibm.icu.text.MessageFormat;
* <code>org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer</code>.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class DirectorySourceLocation extends PlatformObject implements IJavaSourceLocation {
/**
@@ -135,6 +136,7 @@ public class DirectorySourceLocation extends PlatformObject implements IJavaSour
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
return object instanceof DirectorySourceLocation &&
getDirectory().equals(((DirectorySourceLocation)object).getDirectory());
@@ -143,6 +145,7 @@ public class DirectorySourceLocation extends PlatformObject implements IJavaSour
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getDirectory().hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/IJavaSourceLocation.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/IJavaSourceLocation.java
index aad8fdf06..f0f9d35f3 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/IJavaSourceLocation.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/IJavaSourceLocation.java
@@ -34,6 +34,7 @@ import org.eclipse.core.runtime.IAdaptable;
* has been replaced by
* <code>org.eclipse.debug.core.sourcelookup.ISourceContainer</code>.
*/
+@Deprecated
public interface IJavaSourceLocation extends IAdaptable {
/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaProjectSourceLocation.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaProjectSourceLocation.java
index 2ef4a3d52..14df1275e 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaProjectSourceLocation.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaProjectSourceLocation.java
@@ -58,6 +58,7 @@ import org.xml.sax.helpers.DefaultHandler;
* <code>org.eclipse.jdt.launching.sourcelookup.containers.JavaProjectSourceContainer</code>.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class JavaProjectSourceLocation extends PlatformObject implements IJavaSourceLocation {
/**
@@ -141,6 +142,7 @@ public class JavaProjectSourceLocation extends PlatformObject implements IJavaSo
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
return object instanceof JavaProjectSourceLocation &&
getJavaProject().equals(((JavaProjectSourceLocation)object).getJavaProject());
@@ -149,6 +151,7 @@ public class JavaProjectSourceLocation extends PlatformObject implements IJavaSo
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getJavaProject().hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaSourceLocator.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaSourceLocator.java
index 3bbd22dc3..224246bbd 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaSourceLocator.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaSourceLocator.java
@@ -93,6 +93,7 @@ import com.ibm.icu.text.MessageFormat;
* <code>sourceLocatorId</code> attribute on a launch configuration type extension.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class JavaSourceLocator implements IPersistableSourceLocator {
/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/LocalFileStorage.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/LocalFileStorage.java
index 589aa611b..ed967901c 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/LocalFileStorage.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/LocalFileStorage.java
@@ -26,6 +26,7 @@ import java.io.File;
* <code>org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage</code>
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class LocalFileStorage extends org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage {
/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/PackageFragmentRootSourceLocation.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/PackageFragmentRootSourceLocation.java
index ee5b20d7f..47e4fe3a3 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/PackageFragmentRootSourceLocation.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/PackageFragmentRootSourceLocation.java
@@ -57,6 +57,7 @@ import org.xml.sax.helpers.DefaultHandler;
* <code>org.eclipse.jdt.launching.sourcelookup.containers.PackageFragmentRootSourceContainer</code>.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class PackageFragmentRootSourceLocation extends PlatformObject implements IJavaSourceLocation {
/**
@@ -206,6 +207,7 @@ public class PackageFragmentRootSourceLocation extends PlatformObject implements
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
if (object instanceof PackageFragmentRootSourceLocation) {
PackageFragmentRootSourceLocation root = (PackageFragmentRootSourceLocation)object;
@@ -220,6 +222,7 @@ public class PackageFragmentRootSourceLocation extends PlatformObject implements
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
if (getPackageFragmentRoot() == null) {
return getClass().hashCode();
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ZipEntryStorage.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ZipEntryStorage.java
index c75845845..e4b6ad5ae 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ZipEntryStorage.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ZipEntryStorage.java
@@ -27,6 +27,7 @@ import java.util.zip.ZipFile;
* <code>org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage</code>.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class ZipEntryStorage extends org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage {
/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathContainerSourceContainer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathContainerSourceContainer.java
index 8921ac2fe..09c54b3d6 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathContainerSourceContainer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathContainerSourceContainer.java
@@ -79,6 +79,7 @@ public class ClasspathContainerSourceContainer extends CompositeSourceContainer
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
IRuntimeClasspathEntry entry = JavaRuntime.newRuntimeContainerClasspathEntry(getPath(), IRuntimeClasspathEntry.USER_CLASSES);
IRuntimeClasspathEntry[] entries = JavaRuntime.resolveSourceLookupPath(new IRuntimeClasspathEntry[]{entry}, getDirector().getLaunchConfiguration());
@@ -97,6 +98,7 @@ public class ClasspathContainerSourceContainer extends CompositeSourceContainer
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof ClasspathContainerSourceContainer) {
return getPath().equals(((ClasspathContainerSourceContainer)obj).getPath());
@@ -106,6 +108,7 @@ public class ClasspathContainerSourceContainer extends CompositeSourceContainer
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getPath().hashCode();
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathVariableSourceContainer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathVariableSourceContainer.java
index 404f848ff..a977d0469 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathVariableSourceContainer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/ClasspathVariableSourceContainer.java
@@ -52,6 +52,7 @@ public class ClasspathVariableSourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
IPath path = JavaCore.getClasspathVariable(fVariable.segment(0));
if (path == null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaProjectSourceContainer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaProjectSourceContainer.java
index 0b11228db..f4018c10d 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaProjectSourceContainer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaProjectSourceContainer.java
@@ -101,6 +101,7 @@ public class JavaProjectSourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
List containers = new ArrayList();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@@ -129,6 +130,7 @@ public class JavaProjectSourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof JavaProjectSourceContainer) {
return getJavaProject().equals(((JavaProjectSourceContainer)obj).getJavaProject());
@@ -138,12 +140,14 @@ public class JavaProjectSourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getJavaProject().hashCode();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String)
*/
+ @Override
public Object[] findSourceElements(String name) throws CoreException {
// force container initialization
getSourceContainers();
@@ -174,6 +178,7 @@ public class JavaProjectSourceContainer extends CompositeSourceContainer {
// look elsewhere if not a java like file
return findSourceElements(name, fOthers);
}
+ @Override
public void dispose() {
fSourceFolders = null;
fOthers = null;
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaSourceLookupParticipant.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaSourceLookupParticipant.java
index d146812ea..8e52098ec 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaSourceLookupParticipant.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/JavaSourceLookupParticipant.java
@@ -63,6 +63,7 @@ public class JavaSourceLookupParticipant extends AbstractSourceLookupParticipant
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant#dispose()
*/
+ @Override
public void dispose() {
Iterator iterator = fDelegateContainers.values().iterator();
while (iterator.hasNext()) {
@@ -77,6 +78,7 @@ public class JavaSourceLookupParticipant extends AbstractSourceLookupParticipant
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.AbstractSourceLookupParticipant#getDelegateContainer(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer)
*/
+ @Override
protected ISourceContainer getDelegateContainer(ISourceContainer container) {
ISourceContainer delegate = (ISourceContainer) fDelegateContainers.get(container);
if (delegate == null) {
@@ -87,6 +89,7 @@ public class JavaSourceLookupParticipant extends AbstractSourceLookupParticipant
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant#init(org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public void init(ISourceLookupDirector director) {
super.init(director);
fDelegateContainers = new HashMap();
@@ -94,6 +97,7 @@ public class JavaSourceLookupParticipant extends AbstractSourceLookupParticipant
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant#sourceContainersChanged(org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public void sourceContainersChanged(ISourceLookupDirector director) {
// use package fragment roots in place of local archives, where they exist
fDelegateContainers.clear();
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/PackageFragmentRootSourceContainer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/PackageFragmentRootSourceContainer.java
index c1a9b1c8f..e34253b79 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/PackageFragmentRootSourceContainer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/containers/PackageFragmentRootSourceContainer.java
@@ -110,6 +110,7 @@ public class PackageFragmentRootSourceContainer extends AbstractSourceContainer
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return obj instanceof PackageFragmentRootSourceContainer &&
((PackageFragmentRootSourceContainer)obj).getPackageFragmentRoot().equals(getPackageFragmentRoot());
@@ -127,6 +128,7 @@ public class PackageFragmentRootSourceContainer extends AbstractSourceContainer
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return fRoot.hashCode();
}

Back to the top