Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix "The value of the parameter is not used" #379

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void testWatchPoint() throws Exception {
//create Breakpoint to test
createWatchpoint("a.b.c.Movee", "anInt", true, true);
//refactor
Refactoring ref = setupRefactor("Movee","anInt","src","a.b.c","Movee.java");
Refactoring ref = setupRefactor("Movee", "src", "a.b.c", "Movee.java");
performRefactor(ref);
//test breakpoints
IBreakpoint[] breakPoints = getBreakpointManager().getBreakpoints();
Expand All @@ -52,7 +52,7 @@ public void testWatchPoint() throws Exception {

/////////////////////////////////////////

private Refactoring setupRefactor(String parentClassName, String className, String root, String targetPackageName, String cuName) throws Exception {
private Refactoring setupRefactor(String parentClassName, String root, String targetPackageName, String cuName) throws Exception {

IJavaProject javaProject = get14Project();
IType parentClas= getCompilationUnit(javaProject, root, targetPackageName, cuName).getType(parentClassName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void testSimpleArrayValueText() throws Exception {
try {
String sig = Signature.createTypeSignature("org.test.MyClass", false);
TestIJavaType type = new TestIJavaType("barfoo", sig);
TestIJavaArrayValue value = new TestIJavaArrayValue(type, "org.test.MyArrayClass[]", null, "org.test.MyClass", "My Array", 3);
TestIJavaArrayValue value = new TestIJavaArrayValue(type, "org.test.MyArrayClass[]", null, "org.test.MyClass", "My Array");
value.setValues(new IJavaValue[] {
new TestIJavaValue(type, "I", null, "org.test.MyArrayClass", "Array Value 1")
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ public class TestIJavaArrayValue extends TestIJavaObjectValue implements IJavaAr
int size = 0;
IJavaValue[] values;

/**
* Constructor
*/
public TestIJavaArrayValue(IJavaType type, String sig, String gsig, String rtname, String vstring, int size) {
TestIJavaArrayValue(IJavaType type, String sig, String gsig, String rtname, String vstring) {
super(type, sig, gsig, rtname, vstring);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
* Determines how to display java elements, including labels, images and editors.
* @see IDebugModelPresentation
*/
@SuppressWarnings("deprecation")

Check warning on line 118 in org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java

View check run for this annotation

Jenkins - Eclipse JDT / Eclipse ECJ

Unnecessary Code

LOW: At least one of the problems in category 'deprecation' is not analysed due to a compiler option being ignored
public class JDIModelPresentation extends LabelProvider implements IDebugModelPresentationExtension, IColorProvider {

/**
Expand Down Expand Up @@ -704,10 +704,10 @@

try {
if (item instanceof JDIReferenceListVariable) {
return getReferencesImage(item);
return getReferencesImage();
}
if (item instanceof JDIReferenceListEntryVariable){
return getReferenceImage(item);
return getReferenceImage();
}
if (item instanceof IJavaVariable) {
return getVariableImage((IAdaptable) item);
Expand Down Expand Up @@ -938,7 +938,7 @@
*
* @return image associated with reference variables
*/
protected Image getReferencesImage(Object element){
private Image getReferencesImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_ELCL_ALL_REFERENCES);
}

Expand All @@ -948,7 +948,7 @@
*
* @return image associated with reference variables
*/
protected Image getReferenceImage(Object element){
private Image getReferenceImage() {
return JavaDebugImages.get(JavaDebugImages.IMG_OBJS_REFERENCE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ public IProgressMonitor getProgressMonitor() {
@Override
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
if (runnable instanceof ISchedulingRuleProvider) {
run(fork, cancelable, runnable, ((ISchedulingRuleProvider)runnable).getSchedulingRule());
run(runnable, ((ISchedulingRuleProvider) runnable).getSchedulingRule());
} else {
run(fork, cancelable, runnable, ResourcesPlugin.getWorkspace().getRoot());
run(runnable, ResourcesPlugin.getWorkspace().getRoot());
}
}

/**
* Runs a new {@link WorkspaceModifyDelegatingOperation}
*/
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable, ISchedulingRule schedulingRule) throws InvocationTargetException, InterruptedException {
private void run(IRunnableWithProgress runnable, ISchedulingRule schedulingRule) throws InvocationTargetException, InterruptedException {
WorkspaceModifyDelegatingOperation operation= new WorkspaceModifyDelegatingOperation(runnable, schedulingRule);
operation.run(getProgressMonitor());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PropertyPage;

public class JavaBreakpointAdvancedPage extends PropertyPage {
public abstract class JavaBreakpointAdvancedPage extends PropertyPage {

ThreadFilterEditor fThreadFilterEditor;
InstanceFilterEditor fInstanceFilterEditor;
Expand Down Expand Up @@ -82,9 +82,7 @@ public void createInstanceFilterEditor(Composite parent) {
/**
* Allow subclasses to create type-specific editors.
*/
protected void createTypeSpecificEditors(Composite parent) {
// Do nothing.
}
abstract void createTypeSpecificEditors(Composite parent);

protected void createThreadFilterEditor(Composite parent) {
fThreadFilterEditor = new ThreadFilterEditor(parent, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ public static EventImpl read(MirrorImpl target, DataInputStream dataInStream)
result = ThreadStartEventImpl.read(target, requestID, dataInStream);
break;
case VMDeathEventImpl.EVENT_KIND:
result = VMDeathEventImpl.read(target, requestID, dataInStream);
result = VMDeathEventImpl.read(target, requestID);
break;
case VMDisconnectEventImpl.EVENT_KIND:
result = VMDisconnectEventImpl
.read(target, requestID, dataInStream);
result = VMDisconnectEventImpl.read(target, requestID);
break;
case VMStartEventImpl.EVENT_KIND:
result = VMStartEventImpl.read(target, requestID, dataInStream);
Expand All @@ -190,8 +189,9 @@ public static EventImpl read(MirrorImpl target, DataInputStream dataInStream)
}

// Find and store original request.
if (!requestID.isNull())
if (!requestID.isNull()) {
result.fRequest = target.virtualMachineImpl().eventRequestManagerImpl().findRequest(result);
}

return result;
}
Expand All @@ -209,16 +209,18 @@ public EventRequest request() {
* Retrieves constant mappings.
*/
public static void getConstantMaps() {
if (fEventKindMap != null)
if (fEventKindMap != null) {
return;
}

java.lang.reflect.Field[] fields = EventImpl.class.getDeclaredFields();
fEventKindMap = new HashMap<>();
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)
|| (field.getModifiers() & java.lang.reflect.Modifier.FINAL) == 0) {
continue;
}

try {
String name = field.getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;

import java.io.DataInputStream;

import org.eclipse.jdi.internal.MirrorImpl;
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.request.RequestID;
Expand All @@ -40,8 +38,7 @@ public VMDeathEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
* Creates, reads and returns new EventImpl, of which requestID has
* already been read.
*/
public static VMDeathEventImpl read(MirrorImpl target, RequestID requestID,
DataInputStream dataInStream) {
static VMDeathEventImpl read(MirrorImpl target, RequestID requestID) {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
VMDeathEventImpl event = new VMDeathEventImpl(vmImpl, requestID);
return event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.jdi.internal.event;

import java.io.DataInputStream;

import org.eclipse.jdi.internal.MirrorImpl;
import org.eclipse.jdi.internal.VirtualMachineImpl;
import org.eclipse.jdi.internal.request.RequestID;
Expand Down Expand Up @@ -42,8 +40,7 @@ public VMDisconnectEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
* already been read.
* @return the new event
*/
public static VMDisconnectEventImpl read(MirrorImpl target,
RequestID requestID, DataInputStream dataInStream) {
static VMDisconnectEventImpl read(MirrorImpl target, RequestID requestID) {
VirtualMachineImpl vmImpl = target.virtualMachineImpl();
VMDisconnectEventImpl event = new VMDisconnectEventImpl(vmImpl,
requestID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ private void redefineTypesJDK(JDIDebugTarget target, List<IResource> resources,
JDIDebugHCRMessages.JavaHotCodeReplaceManager_hcr_failed,
exception);
}
target.reinstallBreakpointsIn(resources, qualifiedNames);
target.reinstallBreakpointsIn(qualifiedNames);
} else {
target.notSupported(JDIDebugHCRMessages.JavaHotCodeReplaceManager_does_not_support_hcr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ public boolean hasHCROccurred() {
/**
* Reinstall all breakpoints installed in the given resources
*/
public void reinstallBreakpointsIn(List<IResource> resources, List<String> classNames) {
public void reinstallBreakpointsIn(List<String> classNames) {
List<IBreakpoint> breakpoints = getBreakpoints();
IJavaBreakpoint[] copy = new IJavaBreakpoint[breakpoints.size()];
breakpoints.toArray(copy);
Expand Down
Loading