Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 424261

Summary: line wrapping wraps too much (not "where necessary") in parameter list + function call
Product: [Eclipse Project] JDT Reporter: Palmer Eldritch <the.ubik>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
formatter profile none

Description Palmer Eldritch CLA 2013-12-17 13:19:52 EST
Created attachment 238411 [details]
formatter profile

Reproducer:

class MainActivity {

	{
		{
			{
				AlarmManager am = null;
				Object monitor_class_newInstance___getBaseInterval__ = null;
				am.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
					AlarmManager.elapsedRealtime()
						+ AlarmManager.elapsedRealtime(),
					monitor_class_newInstance___getBaseInterval__, null);
			}
		}
	}

	static class AlarmManager {

		static final String ELAPSED_REALTIME_WAKEUP = null;

		static int elapsedRealtime() {
			return 0;
		}

		void setInexactRepeating(String s, int i, Object o, Object o2) {}
	}
}

Hit ctrl+shift+f - the first argument of setInexactRepeating() goes to next line.


				am.setInexactRepeating(
					AlarmManager.ELAPSED_REALTIME_WAKEUP,

No combination of options will make it stay in place (been trying all day)

Another maybe related failure is this :


 				SharedPreferences prefs = ctxt.getSharedPreferences(
 					WakefulIntentService.NAME, 0);
-				prefs.edit()
-						.putLong(WakefulIntentService.LAST_ALARM,
-							System.currentTimeMillis()).commit();
+				prefs
+					.edit()
+					.putLong(WakefulIntentService.LAST_ALARM,
+						System.currentTimeMillis()).commit();
 				listener.sendWakefulWork(ctxt);

where the + part is after I format. I would ideally want in this case:

				prefs.edit().putLong(WakefulIntentService.LAST_ALARM,
							System.currentTimeMillis()).commit();

Please let me know if I should fill another bug for this one

Both break my formatting style - I try to wrap "where necessary". Examples like this are not rare

I attach my formatting preferences
Comment 1 Eclipse Genie CLA 2020-04-08 10:01:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.