Source:
<code>public void log(UiFreezeEvent event) { long lastTimestamp = event.getStartTimestamp(); String startTime = dateFormat.format(new Date(lastTimestamp)); String pattern = event.isStillRunning() ? Messages.DefaultUiFreezeEventLogger_ui_delay_header_running_2 : Messages.DefaultUiFreezeEventLogger_ui_delay_header_non_running_2; String header = NLS.bind(pattern, String.format("%.2f", event.getTotalDuration() / 1000.0), startTime); MultiStatus loggedEvent = new MultiStatus(PreferenceConstants.PLUGIN_ID, IStatus.WARNING, header, null); for (int i = 0; i < event.getSampleCount(); i++) { StackSample sample = event.getStackTraceSamples()[i]; double deltaInSeconds = (sample.getTimestamp() - lastTimestamp) / 1000.0; MultiStatus traceStatus = null; ThreadInfo[] threads = sample.getStackTraces(); for (int j = 0; j < threads.length; j++) { <START> if (threads[j].getThreadName().equals("main")) { END> Exception stackTrace = new Exception( Messages.DefaultUiFreezeEventLogger_stack_trace_header); stackTrace.setStackTrace(threads[j].getStackTrace()); String traceText = NLS.bind( Messages.DefaultUiFreezeEventLogger_sample_header_2, dateFormat.format(sample.getTimestamp()), String.format("%.3f", deltaInSeconds)); traceStatus = new MultiStatus(PreferenceConstants.PLUGIN_ID, IStatus.INFO, String.format("%s\n%s", traceText, createThreadMessage(threads[j])), stackTrace); loggedEvent.add(traceStatus); for (int k = 0; k < j; k++) { traceStatus.add(createThreadStatus(threads[k])); } } else if (traceStatus != null) { traceStatus.add(createThreadStatus(threads[j])); } } lastTimestamp = sample.getTimestamp(); } if (loggedEvent.getChildren().length > 0) { MonitoringPlugin.getDefault().getLog().log(loggedEvent); } }</code><technical_language>Extract a variable for threads[j]</technical_language>

Target:
public void log(UiFreezeEvent event) { long lastTimestamp = event.getStartTimestamp(); String startTime = dateFormat.format(new Date(lastTimestamp)); String pattern = event.isStillRunning() ? Messages.DefaultUiFreezeEventLogger_ui_delay_header_running_2 : Messages.DefaultUiFreezeEventLogger_ui_delay_header_non_running_2; String header = NLS.bind(pattern, String.format("%.2f", event.getTotalDuration() / 1000.0), startTime); MultiStatus loggedEvent = new MultiStatus(PreferenceConstants.PLUGIN_ID, IStatus.WARNING, header, null); for (int i = 0; i < event.getSampleCount(); i++) { StackSample sample = event.getStackTraceSamples()[i]; double deltaInSeconds = (sample.getTimestamp() - lastTimestamp) / 1000.0; MultiStatus traceStatus = null; ThreadInfo[] threads = sample.getStackTraces(); for (int j = 0; j < threads.length; j++) { if (threads[j].getThreadName().equals("main")) { Exception stackTrace = new Exception( Messages.DefaultUiFreezeEventLogger_stack_trace_header); stackTrace.setStackTrace(threads[j].getStackTrace()); String traceText = NLS.bind( Messages.DefaultUiFreezeEventLogger_sample_header_2, dateFormat.format(sample.getTimestamp()), String.format("%.3f", deltaInSeconds)); traceStatus = new MultiStatus(PreferenceConstants.PLUGIN_ID, IStatus.INFO, String.format("%s\n%s", traceText, createThreadMessage(threads[j])), stackTrace); loggedEvent.add(traceStatus); for (int k = 0; k < j; k++) { traceStatus.add(createThreadStatus(threads[k])); } } else if (traceStatus != null) { traceStatus.add(createThreadStatus(threads[j])); } } lastTimestamp = sample.getTimestamp(); } MonitoringPlugin.getDefault().getLog().log(loggedEvent); }