Questions tagged [eclipse-jdt]

Use this tag for questions about the Eclipse JDT (Java Development Toolkit) project which provides the plug-ins that implement a Java IDE supporting the development of any Java application, including Eclipse plug-ins.

The JDT project provides the tool plug-ins that implement a Java IDE supporting the development of any Java application, including Eclipse plug-ins.
It adds a Java project nature and Java perspective to the Eclipse Workbench as well as a number of views, editors, wizards, builders, and code merging and refactoring tools. The JDT project allows Eclipse to be a development environment for itself.

852 questions
17
votes
2 answers

How to customize hashCode() and equals() generated by Eclipse?

It is recommended and sometimes necessary, classes that represent values (value classes) to override hashCode(), equals() [and optionally toString()] methods. The values that these methods return depend on all or subset of the member variables of…
Op De Cirkel
  • 28,647
  • 6
  • 40
  • 53
17
votes
2 answers

An internal error occurred during: "AppXray Indexing..."

I installed Oracle WebLogic Tools for Eclipse Luna and now I get the error in the title at startup. I've attached the Eclipse log below. java.lang.NullPointerException at…
user994165
  • 9,146
  • 30
  • 98
  • 165
17
votes
3 answers

How to add a code snippet to method body with JDT/AST

I'm trying to generate Java source code with JDT/AST. I now have MethodDeclaration and want to add a code snippet (from another source) to the method body. The code snippet can contain any Java code, even syntactically invalid code. I just can't…
Morrandir
  • 595
  • 1
  • 4
  • 19
16
votes
1 answer

How to specifically suppress "Comparing identical expressions" in Eclipse-Helios JDT

I tried annotating the enclosing method with @SuppressWarnings("compareIdentical") but this does not work (worse yet, the annotation results in its own Unsupported @SuppressWarnings("compareIdentical") warning!) I know that I can always use …
kjo
  • 33,683
  • 52
  • 148
  • 265
16
votes
7 answers

In Java, can "void" be considered a primitive type?

I've noticed eclipse JDT uses void as a primitive type. Can this be considered correct?
John Assymptoth
  • 8,227
  • 12
  • 49
  • 68
15
votes
2 answers

Why does the equals() implementation generated by Eclipse check for null before type checking (instanceof)?

I regularly used Eclipse's code generation tools (Source / Generate hashCode() and equals()...) to create the equals() implementation for simple POJO classes. If I choose to "Use instanceof to compare types" this produces an equals() implementation…
Attila Csipak
  • 927
  • 2
  • 14
  • 34
15
votes
3 answers

How do I get rid of "Current text selection cannot be opened in an editor" in Eclipse?

Sometimes, I get this message in the status bar when I press F3 on a Type in a Java editor: Current text selection cannot be opened in an editor When I copy the selection into the clipboard and use Ctrl+Shift+T to open the "Open Type" dialog, I…
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
15
votes
2 answers

How can I add an Eclipse Quick Fix for a custom Java marker?

I'd like to report custom problems for Java files to the Problems View of Eclipse and provide Quick Fixes for them. The standard way to do is to use the extension point org.eclipse.core.resources.markers to declare a custom marker and add markers by…
reprogrammer
  • 14,298
  • 16
  • 57
  • 93
14
votes
1 answer

Eclipse Helios ignores breakpoints

Eclipse is driving me nuts right now. It's probably something trivial but I just don't get it. Whenever I like to add a breakpoint, the regular icons are crossed out in the editor and breakpoints view. As you might have guessed, this isn't strictly…
sfussenegger
  • 35,575
  • 15
  • 95
  • 119
14
votes
5 answers

Eclipse find references for method

I wanted to find all the callers of the the method "get" for the following class: package com.zzz.zzz.zzz.services; public final class EMF { private static final EntityManagerFactory emfInstance = …
Blessed Geek
  • 21,058
  • 23
  • 106
  • 176
13
votes
3 answers

How to get "active editor" in Eclipse plugin?

In my Eclipse plugin, I need to know when the editor that is visible on the screen has changed. I am currently getting the active editor as follows: PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() This works…
Alan Spark
  • 8,152
  • 8
  • 56
  • 91
13
votes
1 answer

How to add custom SuppressWarnings token in Eclipse

I'm writing a PMD plug-in for Eclipse which lets users suppress PMD warnings by adding annotations like @SuppressWarnings("PMD.ReturnEmptyArrayRatherThanNull"). Since Eclipse doesn't know that PMD.ReturnEmptyArrayRatherThanNull is a valid token, it…
13
votes
2 answers

Tell Eclipse to auto-complete only method name?

Let's say I'm editing a line... obj.fooBar(x, y, z); I want to change the method name to fooSomethingElse, but keep most of the arguments. If I delete all or part of the name, and then use content assist, it completes the method name, but starts a…
Rob N
  • 15,024
  • 17
  • 92
  • 165
12
votes
4 answers

Use the eclipse compiler in a maven component

I am working on a fairly big Maven project, and develop in Java with Eclipse. To save compilation time, I would like Maven and Eclipse to share the same target, which I managed to do. However when I compile with Maven, Eclipse lacks some stuff that…
Djizeus
  • 4,161
  • 1
  • 24
  • 42
12
votes
2 answers

Eclipse 2019 black background

After install of 2019-12 version of Eclipse I can't set black background while using Dark theme and Default set of colors. If I change color in General -> Editors -> Text Editors -> Appearance color options -> Background color - I see line numbers…
Павел
  • 677
  • 6
  • 21
1
2
3
56 57