auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void execute(String[] args, Console console) { int numberOfArguments = args.length; if (numberOfArguments < 1) { <START> return; <END> } String subCommand = args[0]; switch (subCommand) { case SUBCMD_LIST: listFirmwares(console, args); break; case SUBCMD_STATUS: listFirmwareStatus(console, args); break; case SUBCMD_UPDATE: updateFirmware(console, args); break; default: console.println( String.format("Unkown firmware sub command '%s'. Only the sub commands %s are supported.", subCommand, ALL_SUBCMDS)); break; } }</code><technical_language>IMHO do _something_ here. is obvious default action, printing some then</technical_language>

Target:
public void execute(String[] args, Console console) { int numberOfArguments = args.length; if (numberOfArguments < 1) { console.println("No firmare subcommand given."); printUsage(console); return; } String subCommand = args[0]; switch (subCommand) { case SUBCMD_LIST: listFirmwares(console, args); break; case SUBCMD_STATUS: listFirmwareStatus(console, args); break; case SUBCMD_UPDATE: updateFirmware(console, args); break; default: console.println(String.format("Unkown firmware sub command '%s'.", subCommand)); printUsage(console); break; } }
Source:
<code>public static <T> T execute(ClientContext context, ClientExecReturn<T,MasterClientService.Client> exec) throws AccumuloException, AccumuloSecurityException, ThriftTableOperationException { MasterClientService.Client client = null; while (true) { try { client = getConnectionWithRetry(context); return exec.execute(client); } catch (TTransportException tte) { log.debug("MasterClient request failed, retrying ... ", tte); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } catch (ThriftSecurityException e) { throw new AccumuloSecurityException(e.user, e.code, e); } catch (AccumuloException | ThriftTableOperationException e) { throw e; <START> } catch (ThriftNotActiveServiceException e) { <END> log.debug("Contacted a Master which is no longer active, retrying"); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } catch (Exception e) { throw new AccumuloException(e); } finally { if (client != null) close(client); } } }</code><technical_language>intent avoid leaking RPC types. want throw Thrift exception type of this method now? I prefer didn't. I RPC code confined</technical_language>

Target:
public static <T> T execute(ClientContext context, ClientExecReturn<T,MasterClientService.Client> exec) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { MasterClientService.Client client = null; while (true) { try { client = getConnectionWithRetry(context); return exec.execute(client); } catch (TTransportException tte) { log.debug("MasterClient request failed, retrying ... ", tte); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } catch (ThriftSecurityException e) { throw new AccumuloSecurityException(e.user, e.code, e); } catch (AccumuloException e) { throw e; } catch (ThriftTableOperationException e) { switch (e.getType()) { case NAMESPACE_NOTFOUND: throw new TableNotFoundException(e.getTableName(), new NamespaceNotFoundException(e)); case NOTFOUND: throw new TableNotFoundException(e); default: throw new AccumuloException(e); } } catch (ThriftNotActiveServiceException e) { log.debug("Contacted a Master which is no longer active, retrying"); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } catch (Exception e) { throw new AccumuloException(e); } finally { if (client != null) close(client); } } }
Source:
<code>protected String getLogParameters() { HttpUrl.Builder httpUrlBuilder = new HttpUrl.Builder(); <START> StringBuilder sb = new StringBuilder(); <END> httpUrlBuilder.addPathSegment("log"); httpUrlBuilder.addQueryParameter("pretty", String.valueOf(withPrettyOutput)); sb.append("log?pretty=").append(withPrettyOutput); if (containerId != null && !containerId.isEmpty()) { sb.append("&container=").append(containerId); httpUrlBuilder.addQueryParameter("container", containerId); } if (withTerminatedStatus) { sb.append("&previous=true"); httpUrlBuilder.addQueryParameter("previous", String.valueOf(Boolean.TRUE)); } if (sinceSeconds != null) { sb.append("&sinceSeconds=").append(sinceSeconds); httpUrlBuilder.addQueryParameter("sinceSeconds", String.valueOf(sinceSeconds)); } else if (sinceTimestamp != null) { sb.append("&sinceTime=").append(sinceTimestamp); httpUrlBuilder.addQueryParameter("sinceTime", sinceTimestamp); } if (withTailingLines != null) { sb.append("&tailLines=").append(withTailingLines); httpUrlBuilder.addQueryParameter("tailLines", String.valueOf(withTailingLines)); } if (limitBytes != null) { sb.append("&limitBytes=").append(limitBytes); httpUrlBuilder.addQueryParameter("limitBytes", String.valueOf(limitBytes)); } if (withTimestamps) { sb.append("&timestamps=true"); httpUrlBuilder.addQueryParameter("timestamps", String.valueOf(Boolean.TRUE)); } return httpUrlBuilder.build().toString(); }</code><technical_language>this</technical_language>

Target:
protected String getLogParameters() { StringBuilder sb = new StringBuilder(); sb.append("log?pretty=").append(withPrettyOutput); if (containerId != null && !containerId.isEmpty()) { sb.append("&container=").append(containerId); } if (withTerminatedStatus) { sb.append("&previous=true"); } if (sinceSeconds != null) { sb.append("&sinceSeconds=").append(sinceSeconds); } else if (sinceTimestamp != null) { sb.append("&sinceTime=").append(sinceTimestamp); } if (withTailingLines != null) { sb.append("&tailLines=").append(withTailingLines); } if (limitBytes != null) { sb.append("&limitBytes=").append(limitBytes); } if (withTimestamps) { sb.append("&timestamps=true"); } return sb.toString(); }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) { Uri imageUri = data.getData(); Timber.d(imageUri.toString()); UCrop.of(imageUri,Uri.fromFile(new File(getCacheDir(), imageUri.getUserInfo()+".png"))).start(this); } if (resultCode == RESULT_OK && requestCode == UCrop.REQUEST_CROP) { final Uri resultUri = UCrop.getOutput(data); InputStream imageStream = null; try { imageStream = getContentResolver().openInputStream(resultUri); } catch (FileNotFoundException e) { e.printStackTrace(); } Bitmap selectedImage = BitmapFactory.decodeStream(imageStream); encodedImage = encodeImage(selectedImage); StrategyRegistry.getInstance().getHttpStrategy().getPicassoWithCache() .load(resultUri) .transform(new CircleTransform()) .into(avatar); } else if (resultCode == UCrop.RESULT_ERROR) { final Throwable cropError = UCrop.getError(data); <START> Timber.d(cropError, "EditProfileActivity UCrop Error %s"); <END> } }</code><technical_language>Fix this. This reverse</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) { Uri imageUri = data.getData(); Timber.d(imageUri.toString()); UCrop.of(imageUri,Uri.fromFile(new File(getCacheDir(), imageUri.getUserInfo()+".png"))).start(this); } if (resultCode == RESULT_OK && requestCode == UCrop.REQUEST_CROP) { final Uri resultUri = UCrop.getOutput(data); InputStream imageStream = null; try { imageStream = getContentResolver().openInputStream(resultUri); } catch (FileNotFoundException e) { e.printStackTrace(); } Bitmap selectedImage = BitmapFactory.decodeStream(imageStream); encodedImage = encodeImage(selectedImage); StrategyRegistry.getInstance().getHttpStrategy().getPicassoWithCache() .load(resultUri) .transform(new CircleTransform()) .into(avatar); } else if (resultCode == UCrop.RESULT_ERROR) { final Throwable cropError = UCrop.getError(data); Timber.d("EditProfileActivity UCrop Error %s", cropError); } }
Source:
<code>private JobExecution<Report.Result> toInternalModel(final ReportExecution beanModel) { final ReportExecution.State state = beanModel.getState(); switch (state) { case STARTED: return new JobExecution.Started.Builder<Report.Result>() .setJobId(beanModel.getReport().getUuid()) .setScheduled(beanModel.getScheduled()) .setStartedAt(beanModel.getStartedAt()) .build(); case FAILURE: <START> @Nullable final Throwable throwable = beanModel.getError() == null ? null : beanModel.getError().getThrowable(); <END> return new JobExecution.Failure.Builder<Report.Result>() .setJobId(beanModel.getReport().getUuid()) .setScheduled(beanModel.getScheduled()) .setStartedAt(beanModel.getStartedAt()) .setCompletedAt(beanModel.getCompletedAt()) .setError(throwable) .build(); case SUCCESS: return new JobExecution.Success.Builder<Report.Result>() .setJobId(beanModel.getReport().getUuid()) .setScheduled(beanModel.getScheduled()) .setCompletedAt(beanModel.getCompletedAt()) .setStartedAt(beanModel.getStartedAt()) .setResult(beanModel.getResult()) .build(); default: throw new AssertionError("unexpected state: " + state); } }</code><technical_language>error is required (when transitioning failure), optional. I miss something</technical_language>

Target:
private JobExecution<Report.Result> toInternalModel(final ReportExecution beanModel) { final ReportExecution.State state = beanModel.getState(); switch (state) { case STARTED: return new JobExecution.Started.Builder<Report.Result>() .setJobId(beanModel.getReport().getUuid()) .setScheduled(beanModel.getScheduled()) .setStartedAt(beanModel.getStartedAt()) .build(); case FAILURE: @Nullable final Throwable throwable = beanModel.getError() == null ? null : new Throwable(beanModel.getError()); return new JobExecution.Failure.Builder<Report.Result>() .setJobId(beanModel.getReport().getUuid()) .setScheduled(beanModel.getScheduled()) .setStartedAt(beanModel.getStartedAt()) .setCompletedAt(beanModel.getCompletedAt()) .setError(throwable) .build(); case SUCCESS: return new JobExecution.Success.Builder<Report.Result>() .setJobId(beanModel.getReport().getUuid()) .setScheduled(beanModel.getScheduled()) .setCompletedAt(beanModel.getCompletedAt()) .setStartedAt(beanModel.getStartedAt()) .setResult(beanModel.getResult()) .build(); default: throw new AssertionError("unexpected state: " + state); } }
Source:
<code>public List<Location> getFilteredLocations(final Set<Integer> types, final List<Integer> locationIds, final String programUUID) { final List<Location> locations; try { final Criteria criteria = this.getSession().createCriteria(Location.class); if (types != null && !types.isEmpty()) { criteria.add(Restrictions.in(LocationDAO.LTYPE, types)); } if (locationIds != null && !locationIds.isEmpty()) { criteria.add(Restrictions.in(LocationDAO.LOCID, locationIds)); } criteria.add( Restrictions.or(Restrictions.eq(LocationDAO.UNIQUE_ID, programUUID), Restrictions.isNull(LocationDAO.UNIQUE_ID))); criteria.addOrder(Order.asc(LocationDAO.LNAME)); locations = criteria.list(); } catch (final HibernateException e) { <START> throw new MiddlewareQueryException( <END> this.getLogExceptionMessage("getFilteredLocations", "types,locationIds,programUUID", "", e.getMessage(), LocationDAO.CLASS_NAME_LOCATION), e); } return locations; }</code><technical_language>@cuenyad please log error LocationDAO.LOG.error(e.getMessage(), e);</technical_language>

Target:
public List<Location> getFilteredLocations(final Set<Integer> types, final List<Integer> locationIds, final String programUUID) { final List<Location> locations; try { final Criteria criteria = this.getSession().createCriteria(Location.class); if (types != null && !types.isEmpty()) { criteria.add(Restrictions.in(LocationDAO.LTYPE, types)); } if (locationIds != null && !locationIds.isEmpty()) { criteria.add(Restrictions.in(LocationDAO.LOCID, locationIds)); } criteria.add( Restrictions.or(Restrictions.eq(LocationDAO.UNIQUE_ID, programUUID), Restrictions.isNull(LocationDAO.UNIQUE_ID))); criteria.addOrder(Order.asc(LocationDAO.LNAME)); locations = criteria.list(); } catch (final HibernateException e) { LocationDAO.LOG.error(e.getMessage(), e); throw new MiddlewareQueryException( this.getLogExceptionMessage("getFilteredLocations", "types,locationIds,programUUID", "", e.getMessage(), LocationDAO.CLASS_NAME_LOCATION), e); } return locations; }
Source:
<code>public void testReplicationStatusSink() throws Exception { try (Admin hbaseAdmin = UTIL2.getConnection().getAdmin()) { ServerName server = UTIL2.getHBaseCluster().getRegionServer(0).getServerName(); ReplicationLoadSink loadSink = getLatestSinkMetric(hbaseAdmin, server); assertEquals(loadSink.getTimestampStarted(), loadSink.getTimestampsOfLastAppliedOp()); insertRowsOnSource(); <START> Thread.sleep(10000); <END> loadSink = getLatestSinkMetric(hbaseAdmin, server); assertTrue(loadSink.getTimestampsOfLastAppliedOp()>loadSink.getTimestampStarted()); } }</code><technical_language>10s more enough time, Waiter.wait() / HBASE_TESTING_UTILITY.waitFor() predicate check if loadSink.getTimestampsOfLastAppliedOp()>loadSink.getTimestampStarted()</technical_language>

Target:
public void testReplicationStatusSink() throws Exception { try (Admin hbaseAdmin = UTIL2.getConnection().getAdmin()) { ServerName server = UTIL2.getHBaseCluster().getRegionServer(0).getServerName(); ReplicationLoadSink loadSink = getLatestSinkMetric(hbaseAdmin, server); assertEquals(loadSink.getTimestampStarted(), loadSink.getTimestampsOfLastAppliedOp()); insertRowsOnSource(); long wait = Waiter.waitFor(UTIL2.getConfiguration(), 10000, new Waiter.Predicate<Exception>() { @Override public boolean evaluate() throws Exception { ReplicationLoadSink loadSink = getLatestSinkMetric(hbaseAdmin, server); return loadSink.getTimestampsOfLastAppliedOp()>loadSink.getTimestampStarted(); } }); assertTrue(wait>=0); } }
Source:
<code>public static void setupLandingPage() throws IOException { BrandingPlugin brandingPlugin = mock(BrandingPlugin.class); when(brandingPlugin.getBase64FavIcon()).thenReturn(""); when(brandingPlugin.getBase64ProductImage()) .thenReturn(Base64.getEncoder().encodeToString(fakeImg.getBytes())); landingPage = new LandingPage(); BrandingRegistry branding = mock(BrandingRegistryImpl.class); when(branding.getProductName()).thenReturn(productName); when(branding.getProductVersion()).thenReturn(version); when(branding.getBrandingPlugins()).thenReturn(Collections.singletonList(brandingPlugin)); when(branding.getAttributeFromBranding(any())).thenCallRealMethod(); landingPage.setBranding(branding); String firstDateLeadingZeroes = "05/07/20 stuff happened"; String secondDateNoLeadingZeroes = "4/3/20 old stuff happened"; String noDate = "something happened"; List<String> unsorted = Arrays.asList(secondDateNoLeadingZeroes, noDate, firstDateLeadingZeroes); sorted = Arrays.asList(firstDateLeadingZeroes, secondDateNoLeadingZeroes, noDate); landingPage.setAnnouncements(unsorted); keywordRegistry = new KeywordRegistryImpl(); <START> keywordRegistry.setKeywordList(ImmutableList.of("Data Source=Data Source")); <END> landingPage.setKeywordRegistry(keywordRegistry); }</code><technical_language>Do a test verifies replacement? set test "Data Source=Sources" verify works</technical_language>

Target:
public static void setupLandingPage() throws IOException { BrandingPlugin brandingPlugin = mock(BrandingPlugin.class); when(brandingPlugin.getBase64FavIcon()).thenReturn(""); when(brandingPlugin.getBase64ProductImage()) .thenReturn(Base64.getEncoder().encodeToString(fakeImg.getBytes())); landingPage = new LandingPage(); BrandingRegistry branding = mock(BrandingRegistryImpl.class); when(branding.getProductName()).thenReturn(productName); when(branding.getProductVersion()).thenReturn(version); when(branding.getBrandingPlugins()).thenReturn(Collections.singletonList(brandingPlugin)); when(branding.getAttributeFromBranding(any())).thenCallRealMethod(); landingPage.setBranding(branding); String firstDateLeadingZeroes = "05/07/20 stuff happened"; String secondDateNoLeadingZeroes = "4/3/20 old stuff happened"; String noDate = "something happened"; List<String> unsorted = Arrays.asList(secondDateNoLeadingZeroes, noDate, firstDateLeadingZeroes); sorted = Arrays.asList(firstDateLeadingZeroes, secondDateNoLeadingZeroes, noDate); landingPage.setAnnouncements(unsorted); resourceBundleLocator = mock(ResourceBundleLocator.class); }
Source:
<code>public void init() { if (serverConfigurationService.getBoolean("ses.autosetup", false)) { log.info ("SES AutoSetup running"); Scheduler scheduler = schedulerManager.getScheduler(); String[] startups = serverConfigurationService.getStrings("ses.startup"); <START> for (int i = 0; i < startups.length; i++) { <END> String startup = startups[i]; try { String jobBean = serverConfigurationService.getString("ses.import."+startup+".jobbean"); SpringJobBeanWrapper job = (SpringJobBeanWrapper)applicationContext.getBean(jobBean); JobDataMap jobData = new JobDataMap(); jobData.put(JobBeanWrapper.SPRING_BEAN_NAME, job.getBeanId()); jobData.put(JobBeanWrapper.JOB_TYPE, job.getJobType()); JobDataMap triggerData = new JobDataMap(); String param; param = serverConfigurationService.getString("ses.import."+startup+".uri"); if (null != param) { triggerData.put("xcri.oxcap.populator.uri", param); } param = serverConfigurationService.getString("ses.import."+startup+".user"); if (null != param) { triggerData.put("xcri.oxcap.populator.username", param); } param = serverConfigurationService.getString("ses.import."+startup+".password"); if (null != param) { triggerData.put("xcri.oxcap.populator.password", param); } param = serverConfigurationService.getString("ses.import."+startup+".name"); if (null != param) { triggerData.put("xcri.oxcap.populator.name", param); } JobDetail jobDetail = new JobDetail(job.getJobType(), null, job.getJobClass()); jobDetail.setJobDataMap(jobData); scheduler.addJob(jobDetail, true); scheduler.triggerJobWithVolatileTrigger(job.getJobType(), null, triggerData); log.info("Triggered job: "+ job.getJobType()); } catch (SchedulerException se) { log.warn("Failed to run job: "+ startup, se); } } } }</code><technical_language>this replaced a foreach</technical_language>

Target:
public void init() { if (serverConfigurationService.getBoolean("ses.autosetup", false)) { log.info ("SES AutoSetup running"); Scheduler scheduler = schedulerManager.getScheduler(); for (SpringJobBeanWrapper job: jobs) { try { JobDataMap jobData = new JobDataMap(); jobData.put(JobBeanWrapper.SPRING_BEAN_NAME, job.getBeanId()); jobData.put(JobBeanWrapper.JOB_TYPE, job.getJobType()); JobDetail jobDetail = new JobDetail(job.getJobType(), null, job.getJobClass()); jobDetail.setJobDataMap(jobData); scheduler.addJob(jobDetail, true); scheduler.triggerJobWithVolatileTrigger(job.getJobType(), null); log.info("Triggered job: "+ job.getJobType()); } catch (SchedulerException se) { log.warn("Failed to run job: "+ job, se); } } } }
Source:
<code>int runCmd(CommandLine cmdLine) throws Exception { boolean disable = cmdLine.hasOption("d"); boolean enable = cmdLine.hasOption("e"); if (enable && disable) { LOG.error("Only one of -enable and -disable can be specified"); printUsage(); return 1; } try (LedgerManagerFactory mFactory = LedgerManagerFactory.newLedgerManagerFactory( bkConf, <START> RegistrationManager.instantiateRegistrationManager(bkConf).getLayoutManager())) { <END> LedgerUnderreplicationManager underreplicationManager = mFactory.newLedgerUnderreplicationManager(); if (!enable && !disable) { boolean enabled = underreplicationManager.isLedgerReplicationEnabled(); System.out.println("Autorecovery is " + (enabled ? "enabled." : "disabled.")); } else if (enable) { if (underreplicationManager.isLedgerReplicationEnabled()) { LOG.warn("Autorecovery already enabled. Doing nothing"); } else { LOG.info("Enabling autorecovery"); underreplicationManager.enableLedgerReplication(); } } else { if (!underreplicationManager.isLedgerReplicationEnabled()) { LOG.warn("Autorecovery already disabled. Doing nothing"); } else { LOG.info("Disabling autorecovery"); underreplicationManager.disableLedgerReplication(); } } } return 0; }</code><technical_language>RegistrationManager released. need do: try (RegistrationManager rm = ...) { try (LedgerManagerFactory ...) { } }</technical_language>

Target:
int runCmd(CommandLine cmdLine) throws Exception { boolean disable = cmdLine.hasOption("d"); boolean enable = cmdLine.hasOption("e"); if (enable && disable) { LOG.error("Only one of -enable and -disable can be specified"); printUsage(); return 1; } try (RegistrationManager rm = RegistrationManager.instantiateRegistrationManager(bkConf)){ try (LedgerManagerFactory mFactory = LedgerManagerFactory.newLedgerManagerFactory( bkConf, rm.getLayoutManager())) { LedgerUnderreplicationManager underreplicationManager = mFactory.newLedgerUnderreplicationManager(); if (!enable && !disable) { boolean enabled = underreplicationManager.isLedgerReplicationEnabled(); System.out.println("Autorecovery is " + (enabled ? "enabled." : "disabled.")); } else if (enable) { if (underreplicationManager.isLedgerReplicationEnabled()) { LOG.warn("Autorecovery already enabled. Doing nothing"); } else { LOG.info("Enabling autorecovery"); underreplicationManager.enableLedgerReplication(); } } else { if (!underreplicationManager.isLedgerReplicationEnabled()) { LOG.warn("Autorecovery already disabled. Doing nothing"); } else { LOG.info("Disabling autorecovery"); underreplicationManager.disableLedgerReplication(); } } } } return 0; }
Source:
<code>public Map<String, Object> getConfigProperties(final HttpServletRequest request, final Locale locale) throws LanguageException { return map( DOTCMS_WEBSOCKET_PROTOCOL, Config.getAsString(DOTCMS_WEBSOCKET_PROTOCOL, () -> getWebSocketProtocol(request)), DOTCMS_WEBSOCKET_BASEURL, Config.getAsString(DOTCMS_WEBSOCKET_BASEURL, () -> getHostname(request)), DOTCMS_WEBSOCKET_ENDPOINTS, map(WEBSOCKET_SYSTEMEVENTS_ENDPOINT, Config.getStringProperty(WEBSOCKET_SYSTEMEVENTS_ENDPOINT, SystemEventsWebSocketEndPoint.API_WS_V1_SYSTEM_EVENTS)), EDIT_CONTENT_STRUCTURES_PER_COLUMN, Config.getIntProperty(EDIT_CONTENT_STRUCTURES_PER_COLUMN, 15), DOTCMS_WEBSOCKET_TIME_TO_WAIT_TO_RECONNECT, Config.getIntProperty(DOTCMS_WEBSOCKET_TIME_TO_WAIT_TO_RECONNECT, 1000), DEFAULT_REST_PAGE_COUNT, Config.getIntProperty(DEFAULT_REST_PAGE_COUNT, 20), DOTCMS_DISABLE_WEBSOCKET_PROTOCOL, Boolean.valueOf( Config.getBooleanProperty(DOTCMS_DISABLE_WEBSOCKET_PROTOCOL, false) ), I18N_MESSAGES_MAP, mapEntries( message("notifications_title", locale), message("notifications_dismiss", locale), message("notifications_dismissall", locale), this.getRelativeTimeEntry(locale) ), <START> DOTCMS_PAGINATOR_ROWS, <END> Config.getIntProperty(DOTCMS_PAGINATOR_ROWS, 10), DOTCMS_PAGINATOR_LINKS, Config.getIntProperty(DOTCMS_PAGINATOR_LINKS, 5) ); }</code><technical_language>In properties, I replace word "PAGINATOR" "PAGINATION"</technical_language>

Target:
public Map<String, Object> getConfigProperties(final HttpServletRequest request, final Locale locale) throws LanguageException { return map( DOTCMS_WEBSOCKET_PROTOCOL, Config.getAsString(DOTCMS_WEBSOCKET_PROTOCOL, () -> getWebSocketProtocol(request)), DOTCMS_WEBSOCKET_BASEURL, Config.getAsString(DOTCMS_WEBSOCKET_BASEURL, () -> getHostname(request)), DOTCMS_WEBSOCKET_ENDPOINTS, map(WEBSOCKET_SYSTEMEVENTS_ENDPOINT, Config.getStringProperty(WEBSOCKET_SYSTEMEVENTS_ENDPOINT, SystemEventsWebSocketEndPoint.API_WS_V1_SYSTEM_EVENTS)), EDIT_CONTENT_STRUCTURES_PER_COLUMN, Config.getIntProperty(EDIT_CONTENT_STRUCTURES_PER_COLUMN, 15), DOTCMS_WEBSOCKET_TIME_TO_WAIT_TO_RECONNECT, Config.getIntProperty(DOTCMS_WEBSOCKET_TIME_TO_WAIT_TO_RECONNECT, 1000), DEFAULT_REST_PAGE_COUNT, Config.getIntProperty(DEFAULT_REST_PAGE_COUNT, 20), DOTCMS_DISABLE_WEBSOCKET_PROTOCOL, Boolean.valueOf( Config.getBooleanProperty(DOTCMS_DISABLE_WEBSOCKET_PROTOCOL, false) ), I18N_MESSAGES_MAP, mapEntries( message("notifications_title", locale), message("notifications_dismiss", locale), message("notifications_dismissall", locale), this.getRelativeTimeEntry(locale) ), DOTCMS_PAGINATION_ROWS, Config.getIntProperty(DOTCMS_PAGINATION_ROWS, 10), DOTCMS_PAGINATION_LINKS, Config.getIntProperty(DOTCMS_PAGINATION_LINKS, 5) ); }
Source:
<code>public static void main(String[] args) throws Exception { System.loadLibrary(args[0]); if (!checkAppImageLoaded()) { <START> System.out.println("AppImage not loaded."); <END> } ShouldNotInit(Day.class); ShouldNotInit(ClInit.class); ClInit c = new ClInit(); int aa = c.a; System.out.println("X: " + c.getX()); System.out.println("Y: " + c.getY()); System.out.println("str: " + c.str); System.out.println("ooo: " + c.ooo); System.out.println("Z: " + c.getZ()); System.out.println("A: " + c.getA()); System.out.println("AA: " + aa); if (c.a != 101) { System.out.println("a != 101"); } return; }</code><technical_language>this work if app image is loaded? test fail</technical_language>

Target:
public static void main(String[] args) throws Exception { System.loadLibrary(args[0]); if (!checkAppImageLoaded()) { System.out.println("AppImage not loaded."); } expectNotPreInit(Day.class); expectNotPreInit(ClInit.class); ClInit c = new ClInit(); int aa = c.a; System.out.println("X: " + c.getX()); System.out.println("Y: " + c.getY()); System.out.println("str: " + c.str); System.out.println("ooo: " + c.ooo); System.out.println("Z: " + c.getZ()); System.out.println("A: " + c.getA()); System.out.println("AA: " + aa); if (c.a != 101) { System.out.println("a != 101"); } return; }
Source:
<code>public int hashCode() { HashCode.Builder builder = HashCode.builder(); for (FormField field : getDataForm().getFields()) { <START> builder.append(field.getValues()); <END> } for (Item item : getDataForm().getItems()) { builder.append(item); } for (Element element : getDataForm().getExtensionElements()) { builder.append(element); } return builder.build(); }</code><technical_language>This getValues() is wrong, do compare field. want extend HashCode.Builder append(Collection<? extends Object> objects), akin append(Object[] array), that</technical_language>

Target:
public int hashCode() { HashCode.Builder builder = HashCode.builder(); builder.append(getDataForm().getFields()); builder.append(getDataForm().getItems()); builder.append(getDataForm().getExtensionElements()); return builder.build(); }
Source:
<code><START> private boolean syncStateSystem(long time, StateSystemEntry stateSystemEntry) { <END> try { List<@NonNull ITmfStateInterval> full = stateSystemEntry.fSs.queryFullState(time); for (ITmfStateInterval interval : full) { if (interval.getStartTime() == time) { TimeGraphEntry entry = getEntry(stateSystemEntry, interval.getAttribute()); Display.getDefault().asyncExec(() -> { getTimeGraphViewer().setSelection(entry, true); getTimeGraphViewer().getTimeGraphControl().fireSelectionChanged(); }); return true; } } } catch (StateSystemDisposedException e) { } return false; }</code><technical_language>if (time < ss.getStart || time > ss.getEnd) return;</technical_language>

Target:
private boolean syncStateSystem(long time, StateSystemEntry stateSystemEntry) { ITmfStateSystem ss = stateSystemEntry.fSs; if (time < ss.getStartTime() || ss.getCurrentEndTime() < time) { return false; } try { List<@NonNull ITmfStateInterval> full = ss.queryFullState(time); for (ITmfStateInterval interval : full) { if (interval.getStartTime() == time) { TimeGraphEntry entry = getEntry(stateSystemEntry, interval.getAttribute()); Display.getDefault().asyncExec(() -> { getTimeGraphViewer().setSelection(entry, true); getTimeGraphViewer().getTimeGraphControl().fireSelectionChanged(); }); return true; } } } catch (StateSystemDisposedException e) { } return false; }
Source:
<code>public Topology getTopology(Map<String, String> options) { return Topology.builder() .addComputation(SetLegalHoldComputation::new, <START> Arrays.asList(INPUT_1 + ":" + ACTION_NAME, OUTPUT_1 + ":" + STATUS_STREAM)) <END> .build(); }</code><technical_language>replaced of List.of</technical_language>

Target:
public Topology getTopology(Map<String, String> options) { return Topology.builder() .addComputation(SetLegalHoldComputation::new, List.of(INPUT_1 + ":" + ACTION_NAME, OUTPUT_1 + ":" + STATUS_STREAM)) .build(); }
Source:
<code>public String[] getForbiddenPlmns(int subId, int appType) { mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE, "Requires <START> READ_PRIVILEGED_PHONE_STATE"); <END> if (appType != TelephonyManager.APPTYPE_USIM && appType != TelephonyManager.APPTYPE_SIM) { loge("getForbiddenPlmnList(): App Type must be USIM or SIM"); return null; } Object response = sendRequest( CMD_GET_FORBIDDEN_PLMNS, new Integer(appType), subId); if (response instanceof String[]) { return (String[]) response; } return null; }</code><technical_language>READ_PHONE_STATE</technical_language>

Target:
public String[] getForbiddenPlmns(int subId, int appType) { mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE, "Requires READ_PHONE_STATE"); if (appType != TelephonyManager.APPTYPE_USIM && appType != TelephonyManager.APPTYPE_SIM) { loge("getForbiddenPlmnList(): App Type must be USIM or SIM"); return null; } Object response = sendRequest( CMD_GET_FORBIDDEN_PLMNS, new Integer(appType), subId); if (response instanceof String[]) { return (String[]) response; } return null; }
Source:
<code>public void deleteExperiment(String experimentAccession) { int deletedRecordsCount = jdbcTemplate.update(DELETE_EXPERIMENT, experimentAccession); <START> checkState(deletedRecordsCount == 1 , "Experiment not found for accession " + experimentAccession); <END> }</code><technical_language>I favour checkArgument: exception semantics, IllegalStateException sense here</technical_language>

Target:
public void deleteExperiment(String experimentAccession) { int deletedRecordsCount = jdbcTemplate.update(DELETE_EXPERIMENT, experimentAccession); checkExperimentFound( deletedRecordsCount == 1, experimentAccession ); }
Source:
<code>public List<@Nullable String> getList() { <START> return fList; <END> }</code><technical_language>do expose list</technical_language>

Target:
public List<@Nullable String> getList() { return ImmutableList.copyOf(fList); }
Source:
<code>public Expr apply(final List<Expr> args) { if (args.size() < 1 || args.size() > 3) { throw new IAE("'%s' must have 1 to 3 arguments", name()); } final Expr arg = args.get(0); final String formatString = args.size() > 1 ? (String) args.get(1).getLiteralValue() : null; final DateTimeZone timeZone = args.size() > 2 ? DateTimeZone.forID((String) args.get(2).getLiteralValue()) : DateTimeZone.UTC; final DateTimeFormatter formatter = formatString == null ? ISODateTimeFormat.dateTimeParser() : DateTimeFormat.forPattern(formatString).withZone(timeZone); class TimestampParseExpr implements Expr { @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { try { return ExprEval.of(formatter.parseDateTime(arg.eval(bindings).asString()).getMillis()); } <START> catch (IllegalArgumentException e) { <END> return ExprEval.of(null); } } @Override public void visit(final Visitor visitor) { arg.visit(visitor); visitor.visit(this); } } return new TimestampParseExpr(); }</code><technical_language>similar handling in macros above</technical_language>

Target:
public Expr apply(final List<Expr> args) { if (args.size() < 1 || args.size() > 3) { throw new IAE("Function[%s] must have 1 to 3 arguments", name()); } final Expr arg = args.get(0); final String formatString = args.size() > 1 ? (String) args.get(1).getLiteralValue() : null; final DateTimeZone timeZone; if (args.size() > 2 && args.get(2).getLiteralValue() != null) { timeZone = DateTimeZone.forID((String) args.get(2).getLiteralValue()); } else { timeZone = DateTimeZone.UTC; } final DateTimeFormatter formatter = formatString == null ? ISODateTimeFormat.dateTimeParser() : DateTimeFormat.forPattern(formatString).withZone(timeZone); class TimestampParseExpr implements Expr { @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { try { return ExprEval.of(formatter.parseDateTime(arg.eval(bindings).asString()).getMillis()); } catch (IllegalArgumentException e) { return ExprEval.of(null); } } @Override public void visit(final Visitor visitor) { arg.visit(visitor); visitor.visit(this); } } return new TimestampParseExpr(); }
Source:
<code>@Override public void onNegativeClicked(@NonNull String instanceTag) { Fragment fragment = getMySiteFragment(); if (fragment != null) { <START> getMySiteFragment().onNegativeClicked(instanceTag); <END> } }</code><technical_language>is another case fragment.onPositiveClicked(instanceTag); instead</technical_language>

Target:
public void onNegativeClicked(@NonNull String instanceTag) { MySiteFragment fragment = getMySiteFragment(); if (fragment != null) { fragment.onNegativeClicked(instanceTag); } }
Source:
<code>public File exportCertificates( @Context HttpServletResponse response, @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @QueryParam("serials") String serials) { Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); if (consumer == null) { throw new NotFoundException(i18n.tr("Unit with ID ''{0}'' could not be found.", consumerUuid)); } <START> checkForGuestMigration(consumer); <END> Set<Long> serialSet = this.extractSerials(serials); if (serialSet.isEmpty()) { serialSet = null; } File archive; try { archive = manifestManager.generateEntitlementArchive(consumer, serialSet); response.addHeader("Content-Disposition", "attachment; filename=" + archive.getName()); return archive; } catch (ExportCreationException e) { throw new IseException( i18n.tr("Unable to create entitlement certificate archive"), e); } }</code><technical_language>verifyAndLookupConsumer throw exception if is found. null check is required</technical_language>

Target:
public File exportCertificates( @Context HttpServletResponse response, @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @QueryParam("serials") String serials) { Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); checkForGuestMigration(consumer); Set<Long> serialSet = this.extractSerials(serials); if (serialSet.isEmpty()) { serialSet = null; } File archive; try { archive = manifestManager.generateEntitlementArchive(consumer, serialSet); response.addHeader("Content-Disposition", "attachment; filename=" + archive.getName()); return archive; } catch (ExportCreationException e) { throw new IseException( i18n.tr("Unable to create entitlement certificate archive"), e); } }
Source:
<code>public <T> T jsonToEntity(String jsonString, Class<T> type, ObjectMapper objectMapper) { try { T entity = objectMapper.readValue(jsonString, type); return entity; } catch (JsonParseException e) { <START> log.error("Error parsing jsonString to " + type + ". jsonString = " + jsonString, e); <END> } catch (JsonMappingException e) { log.error("Error mapping jsonString to " + type + ". jsonString = " + jsonString, e); } catch (IOException e) { log.error("IOException. Error parsing jsonString to " + type + ". jsonString = " + jsonString, e); } throw new RestMappingException("Error parsing jsonString to " + type + ". jsonString = " + jsonString); }</code><technical_language>change this try { return objectMapper.readValue(jsonString, type); } catch(JsonParseException | JsonMappingException | IOException e) { throw new RestMappingException("Error maping jsonString " + type + ". jsonString = " + jsonString, e); } pass exception RestMappingException constructor get information kind of exception occurred</technical_language>

Target:
public <T> T jsonToEntity(String jsonString, Class<T> type, ObjectMapper objectMapper) { try { return objectMapper.readValue(jsonString, type); } catch(JsonParseException e) { throw new RestMappingException("Error mapping jsonString to " + type + ". jsonString = " + jsonString, e); } catch(JsonMappingException e) { throw new RestMappingException("Error mapping jsonString to " + type + ". jsonString = " + jsonString, e); } catch(IOException e) { throw new RestMappingException("Error mapping jsonString to " + type + ". jsonString = " + jsonString, e); } }
Source:
<code>public PythonScanner(SensorContext context, PythonChecks checks, FileLinesContextFactory fileLinesContextFactory, NoSonarFilter noSonarFilter, List<InputFile> inputFiles) { this.context = context; this.checks = checks; this.fileLinesContextFactory = fileLinesContextFactory; this.noSonarFilter = noSonarFilter; this.cpdAnalyzer = new PythonCpdAnalyzer(context); this.inputFiles = inputFiles; this.parser = PythonParser.create(); <START> this.packageNames = new HashMap<>(); <END> }</code><technical_language>assigning this in field declaration</technical_language>

Target:
public PythonScanner(SensorContext context, PythonChecks checks, FileLinesContextFactory fileLinesContextFactory, NoSonarFilter noSonarFilter, List<InputFile> inputFiles) { this.context = context; this.checks = checks; this.fileLinesContextFactory = fileLinesContextFactory; this.noSonarFilter = noSonarFilter; this.cpdAnalyzer = new PythonCpdAnalyzer(context); this.inputFiles = inputFiles; this.parser = PythonParser.create(); }
Source:
<code>public void testBadArgumentCombinations(final FilterSamReads.Filter filter, final String fileArgument) throws IOException { <START> final File dummyFile = File.createTempFile(TEST_DIR.getAbsolutePath(),"dummy"); <END> dummyFile.deleteOnExit(); try (final FileWriter writer = new FileWriter(dummyFile)) { writer.write("\n"); } catch (IOException e) { e.printStackTrace(); } final File temp = File.createTempFile("FilterSamReads.output.", ".sam"); temp.deleteOnExit(); final String[] args = new String[]{ "INPUT=testdata/picard/sam/aligned.sam", String.format("OUTPUT=%s", temp.getAbsolutePath()), String.format("FILTER=%s", filter.toString()), String.format("%s=%s", fileArgument, dummyFile), }; Assert.assertEquals(runPicardCommandLine(args), 1); }</code><technical_language>space comma</technical_language>

Target:
public void testBadArgumentCombinations(final FilterSamReads.Filter filter, final String fileArgument) throws IOException { final File dummyFile = File.createTempFile(TEST_DIR.getAbsolutePath(), "dummy"); dummyFile.deleteOnExit(); try (final FileWriter writer = new FileWriter(dummyFile)) { writer.write("\n"); } catch (IOException e) { e.printStackTrace(); } final File temp = File.createTempFile("FilterSamReads.output.", ".sam"); temp.deleteOnExit(); final String[] args = new String[]{ "INPUT=testdata/picard/sam/aligned.sam", String.format("OUTPUT=%s", temp.getAbsolutePath()), String.format("FILTER=%s", filter.toString()), String.format("%s=%s", fileArgument, dummyFile.getAbsoluteFile()), }; Assert.assertEquals(runPicardCommandLine(args), 1); }
Source:
<code>public ClientDMNType getDMNType(final JSITItemDefinition itemDefinition, final String namespace, final Map<String, ClientDMNType> dmnTypesMap) { final Map<String, ClientDMNType> fields = new HashMap<>(); boolean isCollection = itemDefinition.getIsCollection(); if (itemDefinition.getTypeRef() != null) { final ClientDMNType clientDmnType = dmnTypesMap.get(itemDefinition.getTypeRef()); if (clientDmnType != null) { if (clientDmnType.isComposite()) { fields.putAll(clientDmnType.getFields()); } <START> isCollection = clientDmnType.isCollection() ? clientDmnType.isCollection() : isCollection; <END> } else { throw new IllegalStateException( "Item: " + itemDefinition.getName() + " refers to typeRef: " + itemDefinition.getTypeRef() + " which can't be found."); } } List<JSITItemDefinition> jsitItemDefinitions = itemDefinition.getItemComponent(); if (jsitItemDefinitions != null && !jsitItemDefinitions.isEmpty()) { for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); final String typeRef = jsitItemDefinition.getTypeRef(); if (!dmnTypesMap.containsKey(typeRef)) { ClientDMNType nestedClientDMNType = getDMNType(jsitItemDefinition, namespace, dmnTypesMap); dmnTypesMap.put(typeRef, nestedClientDMNType); } fields.put(jsitItemDefinition.getName(), dmnTypesMap.get(typeRef)); } } return new ClientDMNType(namespace, itemDefinition.getName(), itemDefinition.getId(), isCollection, !fields.isEmpty(), fields, null); }</code><technical_language>simplify clientDmnType.isCollection() || isCollection</technical_language>

Target:
public ClientDMNType getDMNType(final JSITItemDefinition itemDefinition, final String namespace, final Map<String, ClientDMNType> dmnTypesMap) { final Map<String, ClientDMNType> fields = new HashMap<>(); boolean isCollection = itemDefinition.getIsCollection(); if (itemDefinition.getTypeRef() != null) { final ClientDMNType clientDmnType = dmnTypesMap.get(itemDefinition.getTypeRef()); if (clientDmnType != null) { if (clientDmnType.isComposite()) { fields.putAll(clientDmnType.getFields()); } isCollection = clientDmnType.isCollection() || isCollection; } else { throw new IllegalStateException( "Item: " + itemDefinition.getName() + " refers to typeRef: " + itemDefinition.getTypeRef() + " which can't be found. The item can be missing or required items sort is wrong"); } } List<JSITItemDefinition> jsitItemDefinitions = itemDefinition.getItemComponent(); if (jsitItemDefinitions != null && !jsitItemDefinitions.isEmpty()) { for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); final String typeRef = jsitItemDefinition.getTypeRef(); if (!dmnTypesMap.containsKey(typeRef)) { ClientDMNType nestedClientDMNType = getDMNType(jsitItemDefinition, namespace, dmnTypesMap); dmnTypesMap.put(typeRef, nestedClientDMNType); } fields.put(jsitItemDefinition.getName(), dmnTypesMap.get(typeRef)); } } return new ClientDMNType(namespace, itemDefinition.getName(), itemDefinition.getId(), isCollection, !fields.isEmpty(), fields, null); }
Source:
<code>private void powerCollide(PowerUp power, Shape collidee) { if (collidee instanceof Floor) { power.setFalling(false); power.setY(collidee.getY() - power.getHeight()); } if (collidee instanceof Player) { ArrayList<Player> players = Model.getPlayers(); Player player = null; <START> for(int i = 0; i < players.size(); i++) { <END> if(collidee.equals(players.get(i))) { player = (Player) collidee; } } if(!(power instanceof LifePowerUp && player.getLives() == 5 && power instanceof TimePowerUp)){ power.activate(); } if(power instanceof TimePowerUp) { TimePowerUp timePower = (TimePowerUp) power; timePower.activateShort(); } Model.deleteShortPower(power); System.out.println(Model.getShortPower()); } }</code><technical_language>Je zou hier ook met een foreach kunnen werken: for(Player otherplayer: players) { if(collidee.equals(otherplayer)) { player = (Player) collidee; } }</technical_language>

Target:
private void powerCollide(PowerUp power, Shape collidee) { if (collidee instanceof Floor) { power.setFalling(false); power.setY(collidee.getY() - power.getHeight()); } if (collidee instanceof Player) { ArrayList<Player> players = Model.getPlayers(); Player player = null; for(Player otherPlayer: players) { if(collidee.equals(otherPlayer)) { player = (Player) collidee; } } if(!(power instanceof LifePowerUp && player.getLives() == 5) && !(power instanceof TimePowerUp)){ power.activate(); } if(power instanceof TimePowerUp) { TimePowerUp timePower = (TimePowerUp) power; timePower.activateShort(); } Model.deleteShortPower(power); System.out.println(Model.getShortPower()); } }
Source:
<code>public final IContentProvider acquireProvider( Context c, String auth, int userId, boolean stable) { final ProviderKey key = new ProviderKey(auth, userId); final IContentProvider provider = acquireExistingProvider(c, key, stable); if (provider != null) { return provider; } AcquiringProviderRecord r; boolean first = false; synchronized (mAcquiringProviderMap) { r = mAcquiringProviderMap.get(key); if (r == null) { r = new AcquiringProviderRecord(); mAcquiringProviderMap.put(key, r); first = true; } else { r.requests++; } } IActivityManager.ContentProviderHolder holder = null; <START> if (first) { <END> try { holder = ActivityManagerNative.getDefault().getContentProvider( getApplicationThread(), auth, userId, stable); } catch (RemoteException ex) { } finally { synchronized (r) { r.holder = holder; r.acquiring = false; r.notifyAll(); } synchronized (mAcquiringProviderMap) { if (--r.requests == 0) { mAcquiringProviderMap.remove(key); } } } } else { synchronized (r) { while (r.acquiring) { try { r.wait(); } catch (InterruptedException e) { } } holder = r.holder; } synchronized (mAcquiringProviderMap) { if (--r.requests == 0) { mAcquiringProviderMap.remove(key); } } } if (holder == null) { Slog.e(TAG, "Failed to find provider info for " + auth); return null; } holder = installProvider(c, holder, holder.info, true , holder.noReleaseNeeded, stable); return holder.provider; }</code><technical_language>reduce duplicated part. try { if (first) { ... } else { ... } } finally { synchronized (mAcquiringProviderMap) { ... } }</technical_language>

Target:
public final IContentProvider acquireProvider( Context c, String auth, int userId, boolean stable) { final ProviderKey key = new ProviderKey(auth, userId); final IContentProvider provider = acquireExistingProvider(c, key, stable); if (provider != null) { return provider; } AcquiringProviderRecord r; boolean first = false; synchronized (mAcquiringProviderMap) { r = mAcquiringProviderMap.get(key); if (r == null) { r = new AcquiringProviderRecord(); mAcquiringProviderMap.put(key, r); first = true; } else { r.requests++; } } IActivityManager.ContentProviderHolder holder = null; try { if (first) { holder = ActivityManagerNative.getDefault().getContentProvider( getApplicationThread(), auth, userId, stable); } else { synchronized (r) { while (r.acquiring) { try { r.wait(); } catch (InterruptedException e) { } } holder = r.holder; } } } catch (RemoteException ex) { } catch (RuntimeException e) { synchronized (r) { r.runtimeException = e; } } finally { if (first) { synchronized (r) { r.holder = holder; r.acquiring = false; r.notifyAll(); } } synchronized (mAcquiringProviderMap) { if (--r.requests == 0) { mAcquiringProviderMap.remove(key); } } if (r.runtimeException != null) { throw r.runtimeException; } } if (holder == null) { Slog.e(TAG, "Failed to find provider info for " + auth); return null; } holder = installProvider(c, holder, holder.info, true , holder.noReleaseNeeded, stable); return holder.provider; }
Source:
<code>protected Map<Object, Object> createDestination( MappingContext<Map<?, ?>, Map<Object, Object>> context) { if (context.getDestinationType().isInterface()) { if (SortedMap.class.isAssignableFrom(context.getDestinationType())) { return new TreeMap<Object, Object>(); } return new HashMap<Object, Object>(); } <START> return context.getMappingEngine().createDestination(context); <END> }</code><technical_language>do think: java if (!context.getDestinationType().isInterface()) return context.getMappingEngine().createDestination(context); if (SortedMap.class.isAssignableFrom(context.getDestinationType())) return new TreeMap<Object, Object>(); return new HashMap<Object, Object>(); reduce deeply nested if statement. prefer curly braces if is statement in if/else coding stye</technical_language>

Target:
protected Map<Object, Object> createDestination( MappingContext<Map<?, ?>, Map<Object, Object>> context) { if (!context.getDestinationType().isInterface()) return context.getMappingEngine().createDestination(context); if (SortedMap.class.isAssignableFrom(context.getDestinationType())) return new TreeMap<Object, Object>(); return new HashMap<Object, Object>(); }