Skip to content

Instantly share code, notes, and snippets.

View fbricon's full-sized avatar
🖖

Fred Bricon fbricon

🖖
View GitHub Profile
@fbricon
fbricon / formatter.xml
Created May 7, 2018 05:19
Java formatting : brace position on new line
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="myProfile" version="13">
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>

It's been "almost" a year since our last article for the Eclipse newsletter, and a lot has happened in the jdt.ls project since. In this article, we'll cover some of the highlights of the past releases and the impact the project had on the Java ecosystem.

Improvements all over the place!

Over the past year, jdt.ls received a fair share of bug fixes and some notable improvements, including, among other things:

  • smaller distribution size,
  • faster start times,
  • improved diagnostics performance,
  • new Java 9 and 10 support,
  • improvements to the "organize imports" refactoring (with favorite imports, imports order, execute on save),
java.lang.NoClassDefFoundError: org/eclipse/datatools/connectivity/IProfileListener
at org.eclipse.jpt.jpa.db.internal.plugin.JptJpaDbPlugin.buildConnectionProfileFactory(JptJpaDbPlugin.java:90)
at org.eclipse.jpt.jpa.db.internal.plugin.JptJpaDbPlugin.getConnectionProfileFactory_(JptJpaDbPlugin.java:83)
at org.eclipse.jpt.jpa.db.internal.plugin.JptJpaDbPlugin.getConnectionProfileFactory(JptJpaDbPlugin.java:73)
at org.eclipse.jpt.jpa.db.internal.WorkspaceAdapterFactory.getConnectionProfileFactory(WorkspaceAdapterFactory.java:49)
at org.eclipse.jpt.jpa.db.internal.WorkspaceAdapterFactory.getAdapter(WorkspaceAdapterFactory.java:43)
at org.eclipse.jpt.jpa.db.internal.WorkspaceAdapterFactory.getAdapter(WorkspaceAdapterFactory.java:36)
at org.eclipse.core.internal.adapter.AdapterFactoryProxy.getAdapter(AdapterFactoryProxy.java:83)
at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:295)
at org.eclipse.core.runtime.PlatformObject.getAdapter(PlatformObject.java:68)
[Trace - 15:31:15] Received response 'textDocument/codeAction - (114)' in 217ms.
Result: [
{
"title": "Import 'InputStream' (java.io)",
"command": "java.apply.workspaceEdit",
"arguments": [
{
"changes": {
"file:///Users/fbricon/Dev/demos/spring-petclinic/src/main/java/org/springframework/samples/petclinic/model/A.java": [
{
[INFO] Compiling 17 source files to /Users/fbricon/Dev/projects/che/wsagent/che-core-api-languageserver-shared/target/classes
error: error reading /Users/fbricon/.m2/clean-repo/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.2.0/org.eclipse.lsp4j.jsonrpc-0.2.0.jar; error in opening zip file
An exception has occurred in the compiler ((version info not available)). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.util.zip.ZipError: zip END header not found
at com.sun.nio.zipfs.ZipFileSystem.zerror(ZipFileSystem.java:1605)
at com.sun.nio.zipfs.ZipFileSystem.findEND(ZipFileSystem.java:1021)
at com.sun.nio.zipfs.ZipFileSystem.initCEN(ZipFileSystem.java:1030)
at com.sun.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:130)
at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:1
@fbricon
fbricon / DefaultClasspathManagerDelegate.java
Last active November 22, 2017 14:37
Alternate way of setting test classpath attributes. Replaces all changes in BuildPathManager.java, see https://git.eclipse.org/r/#/c/111091/
/*******************************************************************************
* Copyright (c) 2008-2017 Sonatype, Inc.
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
@fbricon
fbricon / org.eclipse.jdt.core.prefs
Created June 21, 2017 05:55
formatter settings under .settings/org.eclipse.jdt.core.prefs
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
<wb-module deploy-name="utility-project-name">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
@fbricon
fbricon / lifecycle-mapping-metadata.xml
Created September 8, 2016 17:27
lifecycle-mapping-metadata.xml for che projects in Eclipse
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.google.code.sortpom</groupId>
<artifactId>maven-sortpom-plugin</artifactId>
<versionRange>[2.3.0,)</versionRange>
<goals>
<goal>verify</goal>
This file has been truncated, but you can view the full file.
curl http://localhost:6060/debug/pprof/goroutine?debug=2
goroutine 7863 [running]:
runtime/pprof.writeGoroutineStacks(0x7fc894588510, 0xc20c33d5e0, 0x0, 0x0)
/usr/lib/golang/src/runtime/pprof/pprof.go:511 +0x8d
runtime/pprof.writeGoroutine(0x7fc894588510, 0xc20c33d5e0, 0x2, 0x0, 0x0)
/usr/lib/golang/src/runtime/pprof/pprof.go:500 +0x4f
runtime/pprof.(*Profile).WriteTo(0x4eca7e0, 0x7fc894588510, 0xc20c33d5e0, 0x2, 0x0, 0x0)
/usr/lib/golang/src/runtime/pprof/pprof.go:229 +0xd5
net/http/pprof.handler.ServeHTTP(0xc20f1bad91, 0x9, 0x7fc8945884d8, 0xc20c33d5e0, 0xc20fe60d00)