auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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(); keywordRegistry.setKeywordList(ImmutableList.of("Data Source=Data Source")); landingPage.setKeywordRegistry(keywordRegistry); }

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:
public void init() { if (serverConfigurationService.getBoolean("ses.autosetup", false)) { log.info ("SES AutoSetup running"); Scheduler scheduler = schedulerManager.getScheduler(); String[] startups = serverConfigurationService.getStrings("ses.startup"); for (int i = 0; i < startups.length; i++) { 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); } } } }

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:
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, RegistrationManager.instantiateRegistrationManager(bkConf).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; }

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:
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_PAGINATOR_ROWS, Config.getIntProperty(DOTCMS_PAGINATOR_ROWS, 10), DOTCMS_PAGINATOR_LINKS, Config.getIntProperty(DOTCMS_PAGINATOR_LINKS, 5) ); }

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:
public static void main(String[] args) throws Exception { System.loadLibrary(args[0]); if (!checkAppImageLoaded()) { System.out.println("AppImage not loaded."); } 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; }

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:
public int hashCode() { HashCode.Builder builder = HashCode.builder(); for (FormField field : getDataForm().getFields()) { builder.append(field.getValues()); } for (Item item : getDataForm().getItems()) { builder.append(item); } for (Element element : getDataForm().getExtensionElements()) { builder.append(element); } return builder.build(); }

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:
private List<Map<String, List<String>>> executeVarQuery(Map<String, Object> vars, String varName) throws LDAPException { List<Map<String, List<String>>> ret = new ArrayList<>(); List<String> queryVars = new ArrayList<>(); for (String var : vars.keySet()) { if (var.startsWith(varName)) { queryVars.add(var); } } if (queryVars.size() > 0) { try { ExecutorService executor = Executors.newFixedThreadPool(queryVars.size()); List<Future<List<Map<String, List<String>>>>> list = new ArrayList<>(); for (String var : queryVars) { log.debug("Resolving query var '{}'", var); Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { Callable<List<Map<String, List<String>>>> searchExecute = framework.new SearchExecute(instance, 0); Future<List<Map<String, List<String>>>> submit = executor.submit(searchExecute); list.add(submit); } } for (Future<List<Map<String, List<String>>>> future : list) { try { ret.addAll(future.get()); } catch (InterruptedException | ExecutionException e) { log.error("Failed to execute search: {}", e.getMessage()); log.debug("Exception", e); } } executor.shutdown(); } finally { for (String var : queryVars) { Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { vars.remove(var); try { framework.searchClose(instance); } catch (Exception e) { log.error("Cannot close search of var '{}'", var); log.debug("Cannot close search of var '{}', search: {}", var, instance); log.debug("Exception", e); } } } } } return ret; }

Target:
private List<Map<String, List<String>>> executeVarQuery(Map<String, Object> vars, String varName) throws LDAPException { List<Map<String, List<String>>> ret = new ArrayList<>(); List<String> queryVars = new ArrayList<>(); for (String var : vars.keySet()) { if (var.startsWith(varName)) { queryVars.add(var); } } if (queryVars.size() > 0) { try { ExecutorService executor = Executors.newFixedThreadPool(queryVars.size()); List<Future<List<Map<String, List<String>>>>> list = new ArrayList<>(); for (String var : queryVars) { log.debug("Resolving query var '{}'", var); Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { Callable<List<Map<String, List<String>>>> searchExecute = framework.new SearchExecute(instance, 0); Future<List<Map<String, List<String>>>> submit = executor.submit(searchExecute); list.add(submit); } } for (Future<List<Map<String, List<String>>>> future : list) { try { ret.addAll(future.get()); } catch (InterruptedException | ExecutionException e) { log.error("Failed to execute search: {}", e.getMessage()); log.debug("Exception", e); throw new RuntimeException(e); } } executor.shutdown(); } finally { for (String var : queryVars) { Framework.SearchInstance instance = (Framework.SearchInstance) vars.get(var); if (instance != null) { vars.remove(var); try { framework.searchClose(instance); } catch (Exception e) { log.error("Cannot close search of var '{}'", var); log.debug("Cannot close search of var '{}', search: {}", var, instance); log.debug("Exception", e); } } } } } return ret; }
Source:
private boolean syncStateSystem(long time, StateSystemEntry stateSystemEntry) { 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; }

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:
public Topology getTopology(Map<String, String> options) { return Topology.builder() .addComputation(SetLegalHoldComputation::new, Arrays.asList(INPUT_1 + ":" + ACTION_NAME, OUTPUT_1 + ":" + STATUS_STREAM)) .build(); }

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:
public String[] getForbiddenPlmns(int subId, int appType) { mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE, "Requires READ_PRIVILEGED_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; }

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:
public void deleteExperiment(String experimentAccession) { int deletedRecordsCount = jdbcTemplate.update(DELETE_EXPERIMENT, experimentAccession); checkState(deletedRecordsCount == 1 , "Experiment not found for accession " + experimentAccession); }

Target:
public void deleteExperiment(String experimentAccession) { int deletedRecordsCount = jdbcTemplate.update(DELETE_EXPERIMENT, experimentAccession); checkExperimentFound( deletedRecordsCount == 1, experimentAccession ); }
Source:
public List<@Nullable String> getList() { return fList; }

Target:
public List<@Nullable String> getList() { return ImmutableList.copyOf(fList); }
Source:
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()); } catch (IllegalArgumentException e) { return ExprEval.of(null); } } @Override public void visit(final Visitor visitor) { arg.visit(visitor); visitor.visit(this); } } return new TimestampParseExpr(); }

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:
@Override public void onNegativeClicked(@NonNull String instanceTag) { Fragment fragment = getMySiteFragment(); if (fragment != null) { getMySiteFragment().onNegativeClicked(instanceTag); } }

Target:
public void onNegativeClicked(@NonNull String instanceTag) { MySiteFragment fragment = getMySiteFragment(); if (fragment != null) { fragment.onNegativeClicked(instanceTag); } }
Source:
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)); } 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); } }

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:
public <T> T jsonToEntity(String jsonString, Class<T> type, ObjectMapper objectMapper) { try { T entity = objectMapper.readValue(jsonString, type); return entity; } catch (JsonParseException e) { log.error("Error parsing jsonString to " + type + ". jsonString = " + jsonString, e); } 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); }

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:
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(); this.packageNames = new HashMap<>(); }

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:
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), }; Assert.assertEquals(runPicardCommandLine(args), 1); }

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:
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() ? clientDmnType.isCollection() : isCollection; } 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); }

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:
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(int i = 0; i < players.size(); i++) { 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()); } }

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:
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; if (first) { 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; }

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:
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>(); } return context.getMappingEngine().createDestination(context); }

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>(); }
Source:
public List<IWorker<ITestNGMethod>> createWorkers(Arguments arguments) { List<IWorker<ITestNGMethod>> result = Lists.newArrayList(); ListMultiMap<Object, ITestNGMethod> lmm = Maps.newSortedListMultiMap(); for (ITestNGMethod m : arguments.getMethods()) { lmm.put(m.getInstance(), m); } for (Map.Entry<Object, List<ITestNGMethod>> es : lmm.entrySet()) { List<IMethodInstance> methodInstances = MethodHelper.methodsToMethodInstances(es.getValue()); IMethodInstance[] mArray = methodInstances.toArray(new IMethodInstance[methodInstances.size()]); TestMethodWorker tmw = new TestMethodWorker(arguments.getInvoker(), mArray, arguments.getTestContext().getCurrentXmlTest().getSuite(), arguments.getTestContext().getCurrentXmlTest().getAllParameters(), arguments.getConfigMethods(), arguments.getClassMethodMap(), arguments.getTestContext(), arguments.getListeners()); result.add(tmw); } return result; }

Target:
public List<IWorker<ITestNGMethod>> createWorkers(Arguments arguments) { ListMultiMap<Object, ITestNGMethod> lmm = Maps.newSortedListMultiMap(); for (ITestNGMethod m : arguments.getMethods()) { lmm.put(m.getInstance(), m); } List<IWorker<ITestNGMethod>> result = Lists.newArrayList(); for (Map.Entry<Object, List<ITestNGMethod>> es : lmm.entrySet()) { List<IMethodInstance> methodInstances = MethodHelper.methodsToMethodInstances(es.getValue()); TestMethodWorker tmw = new TestMethodWorker(arguments.getInvoker(), methodInstances, arguments.getTestContext().getCurrentXmlTest().getSuite(), arguments.getTestContext().getCurrentXmlTest().getAllParameters(), arguments.getConfigMethods(), arguments.getClassMethodMap(), arguments.getTestContext(), arguments.getListeners()); result.add(tmw); } return result; }
Source:
protected void runTask() { try { SpreadsheetEntry spreadsheet = Iterables.getOnlyElement(spreadsheetFetcher.getSpreadsheetByTitle(spreadsheetTitle)); WorksheetEntry worksheet = Iterables.getOnlyElement(spreadsheetFetcher.getWorksheetsFromSpreadsheet(spreadsheet)); ListFeed data = spreadsheetFetcher.getDataFromWorksheet(worksheet); BloombergDataProcessor<UpdateProgress> processor = processor(); for (ListEntry row : data.getEntries()) { CustomElementCollection customElements = row.getCustomElements(); if (customElements.getValue(BloombergSpreadsheetColumn.SOURCE.getValue()).equals(BLOOMBERG.title())) { processor.process(customElements); } } reportStatus(processor.getResult().toString()); } catch (Exception e) { reportStatus(e.getMessage()); throw Throwables.propagate(e); } }

Target:
protected void runTask() { try { ListFeed data = fetchData(); BloombergDataProcessor<UpdateProgress> processor = processor(); for (ListEntry row : data.getEntries()) { isBloomberg(processor, row.getCustomElements()); } reportStatus(processor.getResult().toString()); } catch (Exception e) { reportStatus(e.getMessage()); throw Throwables.propagate(e); } }
Source:
public MapInputRowParser( @JsonProperty("timestampSpec") TimestampSpec timestampSpec, @JsonProperty("dimensions") List<String> dimensions, @JsonProperty("dimensionExclusions") List<String> dimensionExclusions ) { this.timestampSpec = timestampSpec; if (dimensions != null) { this.dimensions = Collections.unmodifiableList(Lists.newArrayList(dimensions)); } this.dimensionExclusions = Sets.newHashSet(); if (dimensionExclusions != null) { for (String dimensionExclusion : dimensionExclusions) { this.dimensionExclusions.add(dimensionExclusion.toLowerCase()); } } this.dimensionExclusions.add(timestampSpec.getTimestampColumn().toLowerCase()); }

Target:
public MapInputRowParser( @JsonProperty("timestampSpec") TimestampSpec timestampSpec, @JsonProperty("dimensions") List<String> dimensions, @JsonProperty("dimensionExclusions") List<String> dimensionExclusions ) { this.timestampSpec = timestampSpec; if (dimensions != null) { this.dimensions = ImmutableList.copyOf(dimensions); } this.dimensionExclusions = Sets.newHashSet(); if (dimensionExclusions != null) { for (String dimensionExclusion : dimensionExclusions) { this.dimensionExclusions.add(dimensionExclusion.toLowerCase()); } } this.dimensionExclusions.add(timestampSpec.getTimestampColumn().toLowerCase()); }
Source:
public ThermostatStateMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType+" Payload Len -> "+this.payload.length); if (this.payload.length == THERMOSTAT_STATE_SHORT_PAYLOAD_LEN || this.payload.length == THERMOSTAT_STATE_MEAS_PAYLOAD_LEN || this.payload.length == THERMOSTAT_STATE_TIME_PAYLOAD_LEN ) { ctrlMode = ThermostatControlMode.values()[(this.payload[0]&0x3)]; dstActive = extractBitFromByte(this.payload[0], 3);; lanGateway = extractBitFromByte(this.payload[0], 4); lockedForManualSetPoint = extractBitFromByte(this.payload[0], 5); rfError = extractBitFromByte(this.payload[0], 6); batteryLow = extractBitFromByte(this.payload[0], 7); valvePos = this.payload[1]; desiredTemperature = (this.payload[2] & 0x7f) / 2.0; if (this.payload.length == THERMOSTAT_STATE_MEAS_PAYLOAD_LEN) { if (ctrlMode != ThermostatControlMode.TEMPORARY) { int mTemp = (this.payload[3]&0x1); mTemp <<= 8; mTemp |= (((int)this.payload[4])&0xff); measuredTemperature = mTemp/10.0; if (measuredTemperature < 4.5) measuredTemperature = null; } } else if (this.payload.length == THERMOSTAT_STATE_TIME_PAYLOAD_LEN) { } } else logger.error("Got "+this.msgType+" message with incorrect length!"); }

Target:
public ThermostatStateMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType + " Payload Len -> " + this.payload.length); if (this.payload.length == THERMOSTAT_STATE_SHORT_PAYLOAD_LEN || this.payload.length == THERMOSTAT_STATE_MEAS_PAYLOAD_LEN || this.payload.length == THERMOSTAT_STATE_TIME_PAYLOAD_LEN) { ctrlMode = ThermostatControlMode.values()[(this.payload[0] & 0x3)]; dstActive = extractBitFromByte(this.payload[0], 3); ; lanGateway = extractBitFromByte(this.payload[0], 4); lockedForManualSetPoint = extractBitFromByte(this.payload[0], 5); rfError = extractBitFromByte(this.payload[0], 6); batteryLow = extractBitFromByte(this.payload[0], 7); valvePos = this.payload[1]; desiredTemperature = (this.payload[2] & 0x7f) / 2.0; if (this.payload.length == THERMOSTAT_STATE_MEAS_PAYLOAD_LEN) { if (ctrlMode != ThermostatControlMode.TEMPORARY) { int mTemp = (this.payload[3] & 0x1); mTemp <<= 8; mTemp |= (((int) this.payload[4]) & 0xff); measuredTemperature = mTemp / 10.0; if (measuredTemperature < 4.5) measuredTemperature = null; } } else if (this.payload.length == THERMOSTAT_STATE_TIME_PAYLOAD_LEN) { } } else { logger.error("Got " + this.msgType + " message with incorrect length!"); } }
Source:
public DatasetService(RestTemplate restTemplate, DataStoreService dataStoreService) { super(restTemplate); this.dataStoreService = notNull(dataStoreService, ""); }

Target:
public DatasetService(RestTemplate restTemplate, DataStoreService dataStoreService) { super(restTemplate); this.dataStoreService = notNull(dataStoreService, "dataStoreService"); }
Source:
public EventResult onPositionUpdate(PositionUpdateEvent event, EntityRef entity) { if (entity.hasComponent(Position.class)) { Position position = entity.getComponent(Position.class).get(); position.position = event.getPosition(); entity.setComponent(position); } return EventResult.CONTINUE; }

Target:
public EventResult onPositionUpdate(PositionUpdateEvent event, EntityRef entity) { if (entity.hasComponent(Position.class)) { Position positionComponent = entity.getComponent(Position.class).get(); positionComponent.position = event.getPosition(); entity.setComponent(positionComponent); } return EventResult.CONTINUE; }
Source:
private Response reload(BaragonRequest request, boolean delayReload) throws Exception { if (!delayReload) { configHelper.reloadConfigs(); } mostRecentRequestId.set(request.getLoadBalancerRequestId()); return Response.ok().build(); }

Target:
private Response reload(BaragonRequest request, boolean delayReload) throws Exception { if (!delayReload) { configHelper.checkAndReload(); } mostRecentRequestId.set(request.getLoadBalancerRequestId()); return Response.ok().build(); }
Source:
public Doc() { meta = new Meta(); file = new File(); path = new Path(); external = new HashMap<>(); }

Target:
public Doc() { meta = new Meta(); file = new File(); path = new Path(); external = null; }
Source:
protected void createAdditionalWidgets(FormEntryContext context) { createDoseUnitsWidget(context); createRouteWidget(context); createCareSettingWidget(context); }

Target:
protected void createAdditionalWidgets(FormEntryContext context) { createDosingTypeWidget(context); createDoseUnitsWidget(context); createQuantityWidget(context); createQuantityUnitsWidget(context); createDurationWidget(context); createDurationUnitsWidget(context); createRouteWidget(context); careSettingWidget = createCareSettingWidget(context, false); }
Source:
public void visitToken(DetailAST ast) { if (ast.findFirstToken(TokenTypes.ELIST).getChildCount() == 0) { log(ast, MSG_CTOR); } }

Target:
public void visitToken(DetailAST ast) { if (ast.getFirstChild().getType() == TokenTypes.LPAREN && ast.findFirstToken(TokenTypes.ELIST).getChildCount() == 0) { log(ast, MSG_CTOR); } }
Source:
protected void composeLine(final AllelicCount record, final DataLine dataLine) { switch (verbosity) { case BASIC: composeLineBasic(record, dataLine); break; case INTERMEDIATE: composeLineIntermediate(record, dataLine); break; case FULL: composeLineFull(record, dataLine); break; default: throw new UserException.BadInput("The AllelicCount verbosity is invalid."); } }

Target:
protected void composeLine(final AllelicCount record, final DataLine dataLine) { switch (verbosity) { case BASIC: composeLineBasic(record, dataLine); break; case INTERMEDIATE: composeLineIntermediate(record, dataLine); break; case FULL: composeLineFull(record, dataLine); break; } }
Source:
public void readFields(DataInput in) throws IOException { reset(); super.readFields(in); readId = in.readLong(); if ((validMessageFlag & VALID_MESSAGE.PATH_LIST_AND_EDGETYPE_LIST) > 0){ pathList.readFields(in); edgeTypeList.readFields(in); } if ((validMessageFlag & VALID_MESSAGE.TARGET_VERTEX_ID) > 0) targetVertexId.readFields(in); if ((validMessageFlag & VALID_MESSAGE.SRC_AND_DEST_READ_HEAD_ORIENTATION) > 0){ srcReadHeadOrientation = READHEAD_ORIENTATION.fromByte(in.readByte()); destReadHeadOrientation = READHEAD_ORIENTATION.fromByte(in.readByte()); } if ((validMessageFlag & VALID_MESSAGE.TOTAL_BFS_LENGTH) > 0) totalBFSLength = in.readInt(); if ((validMessageFlag & VALID_MESSAGE.SCAFFOLDING_MAP) > 0) scaffoldingMap.readFields(in); }

Target:
public void readFields(DataInput in) throws IOException { reset(); super.readFields(in); if ((validMessageFlag & BFS_MESSAGE_FIELDS.READ_ID) > 0) readId = in.readLong(); if ((validMessageFlag & BFS_MESSAGE_FIELDS.PATH_LIST_AND_EDGETYPE_LIST) > 0) { pathList.readFields(in); edgeTypeList.readFields(in); } if ((validMessageFlag & BFS_MESSAGE_FIELDS.TARGET_VERTEX_ID) > 0) targetVertexId.readFields(in); if ((validMessageFlag & BFS_MESSAGE_FIELDS.SRC_AND_DEST_READ_HEAD_ORIENTATION) > 0) { srcReadHeadOrientation = READHEAD_ORIENTATION.fromByte(in.readByte()); destReadHeadOrientation = READHEAD_ORIENTATION.fromByte(in.readByte()); } if ((validMessageFlag & BFS_MESSAGE_FIELDS.TOTAL_BFS_LENGTH) > 0) totalBFSLength = in.readInt(); if ((validMessageFlag & BFS_MESSAGE_FIELDS.SCAFFOLDING_MAP) > 0) scaffoldingMap.readFields(in); }
Source:
public void sendErrorEmail(ExecutableFlow flow, String... extraReasons) { EmailMessage message = new EmailMessage(mailHost, mailUser, mailPassword); message.setFromAddress(mailSender); message.setTLS(tls); message.setAuth(usesAuth); ExecutionOptions option = flow.getExecutionOptions(); MailCreator mailCreator = DefaultMailCreator.getCreator(option.getMailCreator()); logger.debug("ExecutorMailer using mail creator:" + mailCreator.getClass().getCanonicalName()); boolean mailCreated = mailCreator.createErrorEmail(flow, message, azkabanName, scheme, clientHostname, clientPortNumber, extraReasons); if (mailCreated && !testMode) { try { message.sendEmail(); } catch (MessagingException e) { logger.error("Email message send failed", e); } } }

Target:
public void sendErrorEmail(ExecutableFlow flow, String... extraReasons) { EmailMessage message = new EmailMessage(mailHost, mailUser, mailPassword); message.setFromAddress(mailSender); message.setTLS(tls); message.setAuth(super.hasMailAuth()); ExecutionOptions option = flow.getExecutionOptions(); MailCreator mailCreator = DefaultMailCreator.getCreator(option.getMailCreator()); logger.debug("ExecutorMailer using mail creator:" + mailCreator.getClass().getCanonicalName()); boolean mailCreated = mailCreator.createErrorEmail(flow, message, azkabanName, scheme, clientHostname, clientPortNumber, extraReasons); if (mailCreated && !testMode) { try { message.sendEmail(); } catch (MessagingException e) { logger.error("Email message send failed", e); } } }