GithubHelp home page GithubHelp logo

eclipse.jdt's People

Contributors

akurtakov avatar beckerwdf avatar carstenartur avatar deepika-u avatar dmegert avatar eclipse-releng-bot avatar ecljpseb0t avatar hanneswell avatar ifedorenko avatar iloveeclipse avatar jarthana avatar jjohnstn avatar jukzi avatar kitlo avatar ktatavarthi avatar laeubi avatar mbooth101 avatar merks avatar mickaelistria avatar mkeller avatar mohananrahul avatar mpalat avatar niraj-modi avatar noopur2507 avatar paulweb515 avatar rgrunber avatar sravanlakkimsetti avatar stephan-herrmann avatar subyssurendran666 avatar vogella avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eclipse.jdt's Issues

Launching test causes ResourceException: Marker id not found

We are developing a plugin for Eclipse which launches JUnit tests from LaunchConfigurations, and sometimes see errors with stack traces like:

[ERROR] org.eclipse.core.internal.resources.ResourceException: Marker id 26981 not found.
at com.parasoft.xtest.testassist.eclipse.internal.actions.EclipseJUnitLauncher$1.run(EclipseJUnitLauncher.java:167)com.parasoft.xtest.testassist.api.launching.LaunchConfigurationException: org.eclipse.core.internal.resources.ResourceException: Marker id 141280 not found.
        at com.parasoft.xtest.testassist.eclipse.internal.view.launching.EclipseLaunchConfiguration.launch(EclipseLaunchConfiguration.java:55) ~[?:?]
        at com.parasoft.xtest.testassist.eclipse.internal.actions.EclipseJUnitLauncher$1.performLaunch(EclipseJUnitLauncher.java:188) ~[?:?]
        at com.parasoft.xtest.testassist.eclipse.internal.actions.EclipseJUnitLauncher$1.run(EclipseJUnitLauncher.java:156) ~[?:?]
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) ~[?:?]
Caused by: org.eclipse.core.internal.resources.ResourceException: Marker id 26981 not found.
        at org.eclipse.core.internal.resources.Marker.checkInfo(Marker.java:83) ~[?:?]
        at org.eclipse.core.internal.resources.Marker.getAttribute(Marker.java:128) ~[?:?]
        at org.eclipse.debug.core.model.LaunchConfigurationDelegate.isLaunchProblem(LaunchConfigurationDelegate.java:383) ~[?:?]
        at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.isLaunchProblem(AbstractJavaLaunchConfigurationDelegate.java:1004) ~[?:?]
        at org.eclipse.debug.core.model.LaunchConfigurationDelegate.existsProblems(LaunchConfigurationDelegate.java:364) ~[?:?]
        at org.eclipse.debug.core.model.LaunchConfigurationDelegate.finalLaunchCheck(LaunchConfigurationDelegate.java:167) ~[?:?]
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:788) ~[?:?]
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:716) ~[?:?]
        at com.parasoft.xtest.testassist.eclipse.internal.view.launching.EclipseLaunchConfiguration.launch(EclipseLaunchConfiguration.java:53) ~[?:?]

From what we can tell, there is an invalid Marker which causes the launch to fail. This only happens occasionally, and is difficult to reproduce. It makes sense to me that JDT launching should either clean up invalid markers internally, or ignore markers which are obsolete.

Eclipse IDE for Java Developers fails to update

Error message when trying to update Eclipse:

Cannot complete the install because some dependencies are not satisfiable
  Software being installed: M2E - SLF4J over Logback Logging 2.0.0.20220717-0848 (org.eclipse.m2e.logback.feature.feature.group 2.0.0.20220717-0848)
  Software currently installed: JustJ OpenJDK Hotspot JRE Complete 15.0.1.v20201027-0507 (org.eclipse.justj.openjdk.hotspot.jre.full.feature.group 15.0.1.v20201027-0507)
  Cannot satisfy dependency:
    From: JustJ OpenJDK Hotspot JRE Complete 15.0.1.v20201027-0507 (org.eclipse.justj.openjdk.hotspot.jre.full 15.0.1.v20201027-0507)
    To: org.eclipse.equinox.p2.iu; a.jre.javase 0.0.0
  Cannot satisfy dependency:
    From: JustJ OpenJDK Hotspot JRE Complete 15.0.1.v20201027-0507 (org.eclipse.justj.openjdk.hotspot.jre.full.feature.group 15.0.1.v20201027-0507)
    To: org.eclipse.equinox.p2.iu; org.eclipse.justj.openjdk.hotspot.jre.full [15.0.1.v20201027-0507,15.0.1.v20201027-0507]
  Cannot satisfy dependency:
    From: M2E Logback Configuration 2.0.0.20220705-1221 (org.eclipse.m2e.logback.configuration 2.0.0.20220705-1221)
    To: osgi.ee; (&(osgi.ee=JavaSE)(version=17))
  Cannot satisfy dependency:
    From: M2E - SLF4J over Logback Logging 2.0.0.20220717-0848 (org.eclipse.m2e.logback.feature.feature.group 2.0.0.20220717-0848)
    To: org.eclipse.equinox.p2.iu; org.eclipse.m2e.logback.configuration [2.0.0.20220705-1221,2.0.0.20220705-1221]

Debug info:

Eclipse IDE for Java Developers (includes Incubating components)
Version: 2022-06 (4.24.0)
Build id: 20220609-1112
OS: Windows 10, v.10.0, x86_64 / win32
Java vendor: Oracle Corporation
Java runtime version: 15.0.1+9-18
Java version: 15.0.1

JDT crashes when opening Help -> Eclipse Marketplace

JDT on Ubuntu 22.04 LTS crashes when opening Help -> Eclipse Marketplace. This also happens with the JEE version.
I looked for GTK errors in Bugzilla, but couldn't find this one.

The main error messages (see appended eclCrash.log) are:
Gtk-CRITICAL **: 18:15:57.794: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
Gdk-CRITICAL **: 18:18:32.607: gdk_window_create_gl_context: assertion 'GDK_IS_WINDOW (window)' failed

lsb_release.log
hs_err_pid6635.log
eclCrash.log

False positive potential null pointer access warning, inside a statement controlled by boolean expression that guarantees a non-null

final Object obj = ...
final boolean test = obj != null;
if (test) {
    obj.getClass();
}

This gives a potential null pointer access warning on obj.getClass();, but it cannot be null.

I think this happens just because of the code prior to it including a null check somewhere. But in this case, the compiler should be able to figure out that the statement is conditioned by a boolean that already specifically claims that the object is not null.

Workaround; it works fine if the boolean declaration is moved into the condition as a literal expression like if (obj != null)
But the simplicity of above code should be recoverable in the first place.

[20] Infrastructure changes

Prepare Y build
Prepare P Build
Install Java 20 JDT JIPP
Update Tycho Java 20 execution environment
Create JavaSE-x-systempackages.profile for Java 20
Investigate API tools with new Java version (20) and current ASM
testLimitModulesTest might fail with Java 20

Format fails when method called "when" is present

The following Java code will not format properly:

public class JunkClass {
    Object myObj;

    void foo() {
        when(myObj);
        foo(myObj);
        foo(myObj);
    }

    void foo( Object stuff ) {}
    void when( Object methodCall ) {}
}

We have the formatter configured to insert spaces after the open parenthesis, and before the close parenthesis of method invocations. Selecting all the code and formatting it, the "when(myObj)" and subsequent function invocations are not formatted.

However, changing the order of invocation to:

    void foo() {
        foo(myObj);
        when(myObj);
        foo(myObj);
    }

will result in the code being formatted properly.

We found, too, that if you change the "when" method name to "whenx", then the formatting is correct.

We stumbled across this while investigating why a JUnit test class wouldn't format with Mockito "when" statements within it.

What is also interesting is that the formatting failure seems to be method specific. If you add a "foo2" method such that you have one formatted the "good" way and one the "bad" way (ordering of the method calls), one method will successfully format, and the other will not.

Very strange, and very unexpected.

I am running eclipse on a Linux Ubuntu 22.04 install:

os.arch=amd64
os.name=Linux
os.version=5.15.0-71-generic
osgi.arch=x86_64

with a very recent version of the eclipse JDT (just updated today):

Version: 3.19.0.v20230302-0300
Build id: I20230302-0300

We also verified this behavior with:

Version: 3.18.1400.v20221123-1800
Build id: I20221123-1800

We are configured to use jdk 11.

dr_j

ignoreUnnamedModuleForSplitPackage=enabled does not work

Using 2023-03 version,
setting org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage=enabled in .settings/org.eclipse.jdt.core.prefs does not work.

I mean Eclipse IDE still reports

The package javax.xml.transform.stream is accessible from more than one module: , java.xml
issues with at least org.w3c.dom, org.xml.sax, javax.xml.

Actually I never got it working with previous Eclipse versions too. If that can help I use Win7, but I guess it's unrelated.

What could I miss?

SWT cocoa NSImage error

I have found no Eclipse SWT repository so I decide to public my issue here. Please guide me to the right place if I'm wrong.

I have a Java project when I use pure SWT and Jface (no PDE). I work with the project under MacOS and Ubuntu, synchronizing it via Git. I have no error under Linux while running my project. But it occures under MacOS Catalina in 2 places related to TabFolder:

folder = new TabFolder(grCosmogram, SWT.BORDER); folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Tab[] tabs = initTabs(); for (Tab tab : tabs) { TabItem item = new TabItem(folder, SWT.CLOSE); item.setText(tab.name); item.setControl(tab.control); } folder.pack(); //error occures

ToolBar toolbar = dirView.getToolbar(folder, window); folder.setTopRight(toolbar, SWT.RIGHT); folder.setSelection(tabcnt); //error occures

The TabFolder error:

java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.internal.cocoa.NSImage.size()" because "this.image.handle" is null at org.eclipse.swt.widgets.Button.cellSizeForBounds(Button.java:153) at org.eclipse.swt.widgets.Display.windowProc(Display.java:6580) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend_stret(Native Method) at org.eclipse.swt.internal.cocoa.NSCell.cellSize(NSCell.java:37) at org.eclipse.swt.widgets.Button.computeSize(Button.java:224) at org.eclipse.swt.layout.GridData.computeSize(GridData.java:493) at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:225) at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:168) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:232) at org.eclipse.swt.widgets.TabFolder.minimumSize(TabFolder.java:447) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:238) at org.eclipse.swt.widgets.TabFolder.computeSize(TabFolder.java:143) at org.eclipse.swt.widgets.Control.pack(Control.java:2799) at org.eclipse.swt.widgets.Control.pack(Control.java:2773)

The CTabFolder error:

java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.internal.cocoa.NSImage.size()" because "this.image.handle" is null at org.eclipse.swt.widgets.Button.cellSizeForBounds(Button.java:153) at org.eclipse.swt.widgets.Display.windowProc(Display.java:6580) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend_stret(Native Method) at org.eclipse.swt.internal.cocoa.NSCell.cellSize(NSCell.java:37) at org.eclipse.swt.widgets.Button.computeSize(Button.java:224) at org.eclipse.swt.layout.GridData.computeSize(GridData.java:493) at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:225) at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:168) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:232) at org.eclipse.swt.widgets.TabFolder.minimumSize(TabFolder.java:447) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:238) at org.eclipse.swt.widgets.TabFolder.computeSize(TabFolder.java:143) at org.eclipse.swt.layout.GridData.computeSize(GridData.java:493) at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:225) at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:168) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:232) at org.eclipse.swt.custom.SashFormLayout.computeSize(SashFormLayout.java:50) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:232) at org.eclipse.swt.layout.GridData.computeSize(GridData.java:493) at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:225) at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1308) at org.eclipse.swt.widgets.Composite.resized(Composite.java:1030) at org.eclipse.swt.widgets.Group.resized(Group.java:231) at org.eclipse.swt.widgets.Control.setFrameSize(Control.java:3989) at org.eclipse.swt.widgets.Display.windowProc(Display.java:6308) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSView.setFrame(NSView.java:252) at org.eclipse.swt.widgets.Control.setBounds(Control.java:3711) at org.eclipse.swt.widgets.Control.setBounds(Control.java:3752) at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3237)

How to fix it? I use the latest [Standard Widget Toolkit For Mac OS X (Cocoa) 3.124.0

Снимок экрана 2023-08-31 в 21 33 36

ArrayIndexOutOfBoundsException at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType

Hi, sorry if this is not the correct place to raise the issue.

I have a multi-project gradle and in one of the sub-projects, if I have to disable the Java Builder or else I just get errors... I removed the .log file, restarted eclipse, got errors like these in the logs log.txt:

!ENTRY org.eclipse.jdt.core.manipulation 4 0 2024-05-09 11:46:26.482
!MESSAGE Error in JDT Core during AST creation
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:1841)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.initializeUsesNullTypeAnnotation(LookupEnvironment.java:1677)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.usesNullTypeAnnotations(LookupEnvironment.java:1650)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.usesNullTypeAnnotations(LookupEnvironment.java:1645)
        at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.scanFieldForNullAnnotation(BinaryTypeBinding.java:2067)
        at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:652)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:1071)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:1052)
        at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:316)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:289)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:1855)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:1824)
        at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitScope.getDefaultImports(GroovyCompilationUnitScope.java:95)
        at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkAndSetImports(CompilationUnitScope.java:275)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment$CompleteTypeBindingsSteps.perform(LookupEnvironment.java:174)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:552)
        at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:904)
        at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:402)
        at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1286)
        at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:828)
        at org.eclipse.jdt.core.dom.ASTParser.internalCreateASTCached(ASTParser.java:1242)
        at org.eclipse.jdt.core.dom.ASTParser.lambda$0(ASTParser.java:1120)
        at org.eclipse.jdt.internal.core.JavaModelManager.cacheZipFiles(JavaModelManager.java:5835)
        at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1120)
        at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:868)
        at org.eclipse.jdt.core.manipulation.CoreASTProvider$1.run(CoreASTProvider.java:294)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
        at org.eclipse.jdt.core.manipulation.CoreASTProvider.createAST(CoreASTProvider.java:286)
        at org.eclipse.jdt.core.manipulation.CoreASTProvider.getAST(CoreASTProvider.java:199)
        at org.eclipse.jdt.core.manipulation.SharedASTProviderCore.getAST(SharedASTProviderCore.java:138)
        at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:167)
        at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$1.lambda$0(SelectionListenerWithASTManager.java:149)
        at org.eclipse.jdt.internal.core.JavaModelManager.cacheZipFiles(JavaModelManager.java:5835)
        at org.eclipse.jdt.internal.core.JavaModelManager.callReadOnly(JavaModelManager.java:5824)
        at org.eclipse.jdt.core.JavaCore.callReadOnly(JavaCore.java:6126)
        at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$1.run(SelectionListenerWithASTManager.java:149)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Of course, by disabling it, I get another set of issues :(

Can't seem to reproduce on other projects nor understand why this particular project causes an issue (it's one of the simplest in the multi-project)...

Install new software feature loop indefinitely in site search

The problem occurs on version 4.28.0.

To reproduce:

  • Open the "Available software" window via the "Help/Install New Software ..." menu.
  • Select "--All Available Sites--" from the "Work With:" combobox or any other line, the behavior remains the same.

The animation for waiting shows that the search is in progress without ever ending (no list of results or a message indicating a problem during the search).
I tested on version 4.28.0 which I have been using for several weeks then on the same downloaded today and the problem remains the same.
On Eclipse version 4.26.0 there is no such problem.

I'm on macOS version 12.6.7 and the JRE is version 19.0.2.

[formatting][java] method with parameter annotation incorrectly formatted.

Dear developers,

I have the following formatting settings
image

When I format the following code that uses junit-pioneer's Cartesian product:

    @CartesianTest
    void test(@Values(booleans = {true, false}) boolean identical, @Values(ints = {2, 3, 4}) int low,
            @Values(ints =
            {4, 5}) int high) {
        fail("todo");
    }

nothing changes.

Yet since a wrap has occurred in my method declaration, I expected

    @CartesianTest
    void test(@Values(booleans = {true, false}) boolean identical, @Values(ints = {2, 3, 4}) int low,
            @Values(ints =
            {4, 5}) int high)
    {
        fail("todo");
    }

My expectations are confirmed by checkstyle:
image

Can you confirm that this is indeed a bug.
If so, could you please fix it?

Thanks in advance for your answers!

Update Oomph setup to make "rebase" default choice

See discussion on eclipse-egit/egit#2.

People contributing via Oomph'ed installations should get branch.autoSetupRebase=always git preference set for all JDT repositories they clone.

The .git/config file should have these lines:

[branch]
	autoSetupRebase = always

Note, if [branch] section is already there, the autoSetupRebase = always line should be "appended" after the last line in the section.

Migrate JDT wiki pages

See: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/681

Essentially we'll try the automatic process: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/681#note_414703

Export the pages you want to convert from https://wiki.eclipse.org/Special:Export, save the file to /tmp/wikiexport (or somewhere else, but adjust below accordingly) then

docker run -it --rm -v /tmp/wikiexport:/wikiexport --entrypoint /bin/bash php:8
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
apt-get update && apt-get install -y git vim pandoc
git clone https://github.com/outofcontrol/mediawiki-to-gfm.git
cd mediawiki-to-gfm
composer update --no-dev
./convert.php --filename=/wikiexport/Eclipsepedia-.xml --output=/wikiexport/markdown/

Aiming to convert everything under: https://wiki.eclipse.org/Category:JDT

There is also the question of whether we can link the old wiki pages to the new ones, assuming the old wiki pages will be archived.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.