auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected RemoteOperationResult run(WebdavClient client) { PropFindMethod propfind = null; RemoteOperationResult result = null; try { propfind = new PropFindMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemotePath), DavConstants.PROPFIND_ALL_PROP, DavConstants.DEPTH_0); int status; status = client.executeMethod(propfind, SYNC_READ_TIMEOUT, SYNC_CONNECTION_TIMEOUT); boolean isMultiStatus = status == HttpStatus.SC_MULTI_STATUS; if (isMultiStatus) { MultiStatus resp = propfind.getResponseBodyAsMultiStatus(); result = new RemoteOperationResult(true, status, propfind.getResponseHeaders()); <START> if (result.isSuccess()) { <END> WebdavEntry we = new WebdavEntry(resp.getResponses()[0], client.getBaseUri().getPath()); RemoteFile remoteFile = FileUtils.fillOCFile(we); ArrayList<RemoteFile> files = new ArrayList<RemoteFile>(); files.add(remoteFile); result.setData(files); } } else { client.exhaustResponse(propfind.getResponseBodyAsStream()); result = new RemoteOperationResult(false, status, propfind.getResponseHeaders()); } } catch (Exception e) { result = new RemoteOperationResult(e); e.printStackTrace(); Log.e(TAG, "Synchronizing file " + mRemotePath + ": " + result.getLogMessage(), result.getException()); } finally { if (propfind != null) propfind.releaseConnection(); } return result; }</code><technical_language>This line is unnecessary. contructor of 'result' is stating is a success in parameter</technical_language>

Target:
protected RemoteOperationResult run(WebdavClient client) { PropFindMethod propfind = null; RemoteOperationResult result = null; try { propfind = new PropFindMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemotePath), DavConstants.PROPFIND_ALL_PROP, DavConstants.DEPTH_0); int status; status = client.executeMethod(propfind, SYNC_READ_TIMEOUT, SYNC_CONNECTION_TIMEOUT); boolean isMultiStatus = status == HttpStatus.SC_MULTI_STATUS; if (isMultiStatus) { MultiStatus resp = propfind.getResponseBodyAsMultiStatus(); WebdavEntry we = new WebdavEntry(resp.getResponses()[0], client.getBaseUri().getPath()); RemoteFile remoteFile = new RemoteFile(we); ArrayList<RemoteFile> files = new ArrayList<RemoteFile>(); files.add(remoteFile); result = new RemoteOperationResult(true, status, propfind.getResponseHeaders()); result.setData(files); } else { client.exhaustResponse(propfind.getResponseBodyAsStream()); result = new RemoteOperationResult(false, status, propfind.getResponseHeaders()); } } catch (Exception e) { result = new RemoteOperationResult(e); e.printStackTrace(); Log.e(TAG, "Synchronizing file " + mRemotePath + ": " + result.getLogMessage(), result.getException()); } finally { if (propfind != null) propfind.releaseConnection(); } return result; }
Source:
<code>public static File unzip( Class<?> testClass, String resource, File targetDirectory ) throws IOException { InputStream source = testClass.getResourceAsStream( resource ); if ( source == null ) { throw new FileNotFoundException( "Could not find resource '" + resource + "' to unzip" ); } try { <START> try ( ZipInputStream zipStream = new ZipInputStream( source ) ) <END> { ZipEntry entry; byte[] scratch = new byte[8096]; while ( (entry = zipStream.getNextEntry()) != null ) { if ( entry.isDirectory() ) { new File( targetDirectory, entry.getName() ).mkdirs(); } else { try ( OutputStream file = new BufferedOutputStream( new FileOutputStream( new File( targetDirectory, entry.getName() ) ) ) ) { long toCopy = entry.getSize(); while ( toCopy > 0 ) { int read = zipStream.read( scratch ); file.write( scratch, 0, read ); toCopy -= read; } } } zipStream.closeEntry(); } } } finally { source.close(); } return targetDirectory; }</code><technical_language>Double try</technical_language>

Target:
public static File unzip( Class<?> testClass, String resource, File targetDirectory ) throws IOException { InputStream source = testClass.getResourceAsStream( resource ); if ( source == null ) { throw new FileNotFoundException( "Could not find resource '" + resource + "' to unzip" ); } try ( ZipInputStream zipStream = new ZipInputStream( source ) ) { ZipEntry entry; byte[] scratch = new byte[8096]; while ( (entry = zipStream.getNextEntry()) != null ) { if ( entry.isDirectory() ) { new File( targetDirectory, entry.getName() ).mkdirs(); } else { try ( OutputStream file = new BufferedOutputStream( new FileOutputStream( new File( targetDirectory, entry.getName() ) ) ) ) { long toCopy = entry.getSize(); while ( toCopy > 0 ) { int read = zipStream.read( scratch ); file.write( scratch, 0, read ); toCopy -= read; } } } zipStream.closeEntry(); } } finally { source.close(); } return targetDirectory; }
Source:
<code>private void providers_SelectedItemChanged() { Provider provider = (Provider) getProviders().getSelectedItem(); if (provider != null ) { AsyncQuery getHostsQuery = new AsyncQuery(); <START> getHostsQuery.setModel(this); <END> getHostsQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { ArrayList<VDS> hosts = (ArrayList<VDS>) result; ListModel hostNameListModel = getExternalHostName(); hosts.add(0, null); hostNameListModel.setItems(hosts); hostNameListModel.setIsChangable(true); } }; AsyncDataProvider.GetExternalProviderHostList(getHostsQuery, provider.getId(), true); } else { getExternalHostName().setItems(null); getExternalHostName().setIsChangable(false); } }</code><technical_language>redundant</technical_language>

Target:
private void providers_SelectedItemChanged() { Provider provider = (Provider) getProviders().getSelectedItem(); if (provider != null ) { AsyncQuery getHostsQuery = new AsyncQuery(); getHostsQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { ArrayList<VDS> hosts = (ArrayList<VDS>) result; ListModel hostNameListModel = getExternalHostName(); hosts.add(0, null); hostNameListModel.setItems(hosts); hostNameListModel.setIsChangable(true); } }; AsyncDataProvider.GetExternalProviderHostList(getHostsQuery, provider.getId(), true); } else { getExternalHostName().setItems(null); getExternalHostName().setIsChangable(false); } }
Source:
<code><START> public ContextMenu getContextMenu() { <END> return chatUserContextMenuRoot; }</code><technical_language>this method exist if is getRoot()? I before, explain</technical_language>

Target:
ContextMenu getContextMenu() { return chatUserContextMenuRoot; }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); app = (WikipediaApp) getActivity().getApplicationContext(); model = new PageViewModel(); if (Prefs.isExperimentalPageLoadEnabled()) { pageLoadStrategy = new HtmlPageLoadStrategy(); } else { pageLoadStrategy = new JsonPageLoadStrategy(); } <START> dailyEventTask = new DailyEventTask(getActivity()); <END> }</code><technical_language>advantage of this vs. adding RecurringTasksExecutor is this instance variable</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); app = (WikipediaApp) getActivity().getApplicationContext(); model = new PageViewModel(); if (Prefs.isExperimentalPageLoadEnabled()) { pageLoadStrategy = new HtmlPageLoadStrategy(); } else { pageLoadStrategy = new JsonPageLoadStrategy(); } }
Source:
<code>public static File mkdirs(File dir) { if (dir.isDirectory()) return dir; boolean success = dir.mkdirs(); if (!success) { if (dir.isDirectory()) return dir; throw Exceptions.propagate(new IOException("Failed to create directory " + dir + (dir.isFile() ? "(is file)" : ""))); <START> } <END> return dir; }</code><technical_language>eliminate duplication attempting dir.mkdirs(): dir.mkdirs(); // care if this succeeds fails if (dir.isDirectory()) return dir; throw ..</technical_language>

Target:
public static File mkdirs(File dir) { dir.mkdirs(); if (dir.isDirectory()) { return dir; } throw Exceptions.propagate(new IOException("Failed to create directory " + dir + (dir.isFile() ? "(is file)" : ""))); }
Source:
<code>public static void remoteFileDownload(ILaunchConfiguration config, ILaunch launch, String localExePath, String remoteExePath, IProgressMonitor monitor) throws CoreException { boolean skipDownload = config .getAttribute( IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false); if (skipDownload) return; monitor.beginTask(Messages.RemoteRunLaunchDelegate_2, 100); try { IRemoteConnection conn = getCurrentConnection(config); IRemoteFileService fs = conn.getService(IRemoteFileService.class); IFileStore remoteFile = fs.getResource(remoteExePath); IFileSystem localfs = EFS.getLocalFileSystem(); IFileStore localFile = localfs.getStore(new Path(localExePath)); if (!localFile.fetchInfo().exists()) { return; } localFile.copy(remoteFile, EFS.OVERWRITE, monitor); IFileInfo remoteFileInfo = remoteFile.fetchInfo(); remoteFileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_EXECUTE, true); remoteFileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, true); remoteFileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, true); <START> remoteFile.putInfo(remoteFileInfo, EFS.SET_ATTRIBUTES, null); <END> } catch (CoreException e) { abort(Messages.RemoteRunLaunchDelegate_6, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } finally { monitor.done(); } }</code><technical_language>thanks for details</technical_language>

Target:
public static void remoteFileDownload(ILaunchConfiguration config, ILaunch launch, String localExePath, String remoteExePath, IProgressMonitor monitor) throws CoreException { boolean skipDownload = config .getAttribute( IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false); if (skipDownload) { return; } SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.RemoteRunLaunchDelegate_2, 100); try { IRemoteConnection conn = getCurrentConnection(config); IRemoteFileService fs = conn.getService(IRemoteFileService.class); IFileStore remoteFile = fs.getResource(remoteExePath); IFileSystem localfs = EFS.getLocalFileSystem(); IFileStore localFile = localfs.getStore(new Path(localExePath)); if (!localFile.fetchInfo().exists()) { return; } localFile.copy(remoteFile, EFS.OVERWRITE, subMonitor.split(95)); IFileInfo remoteFileInfo = remoteFile.fetchInfo(); remoteFileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_EXECUTE, true); remoteFileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, true); remoteFileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, true); remoteFile.putInfo(remoteFileInfo, EFS.SET_ATTRIBUTES, subMonitor.split(5)); } catch (CoreException e) { abort(Messages.RemoteRunLaunchDelegate_6, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } finally { monitor.done(); } }
Source:
<code>private ContentRange(long from, long to) { this.from = from; <START> this.to = to; <END> }</code><technical_language>some kind of validation, e.g., non-negative, to</technical_language>

Target:
private ContentRange(long from, long to) { checkArgument(from < to, "\"from\" should be lower than \"to\""); checkArgument(from >= 0 && to > 0, "\"from\" cannot be negative and \"to\" has to be positive"); this.from = from; this.to = to; }
Source:
<code>private KafkaConsumer<byte[], byte[]> getKafkaConsumer() { final Map<String, Object> consumerConfigs = KafkaConsumerConfigs.getConsumerProperties(); final Properties props = new Properties(); <START> props.putAll(consumerConfigs); <END> addConsumerPropertiesFromConfig(props, sortingMapper, consumerProperties); ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return new KafkaConsumer<>(props, new ByteArrayDeserializer(), new ByteArrayDeserializer()); } finally { Thread.currentThread().setContextClassLoader(currCtxCl); } }</code><technical_language>This called KafkaRecordSupplier.addConsumerPropertiesFromConfig</technical_language>

Target:
private KafkaConsumer<byte[], byte[]> getKafkaConsumer() { final Map<String, Object> consumerConfigs = KafkaConsumerConfigs.getConsumerProperties(); final Properties props = new Properties(); addConsumerPropertiesFromConfig(props, sortingMapper, consumerProperties); props.putAll(consumerConfigs); ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return new KafkaConsumer<>(props, new ByteArrayDeserializer(), new ByteArrayDeserializer()); } finally { Thread.currentThread().setContextClassLoader(currCtxCl); } }
Source:
<code>private static String make(final String previous, final CharSequence name, final CharSequence value, final CharSequence... attrs) { final StringBuilder text = new StringBuilder(); if (!previous.isEmpty()) { text.append(String.format("%s,", previous)); } <START> text.append( <END> String.format("%s=%s", name, value) ); for (final CharSequence attr : attrs) { text.append(';').append(attr); } return text.toString(); }</code><technical_language>@Bertram25 pass String.format statement this line reaching line length limit</technical_language>

Target:
private static String make(final String previous, final CharSequence name, final CharSequence value, final CharSequence... attrs) throws IOException { final StringBuilder text = new StringBuilder(); if (!previous.isEmpty()) { text.append(String.format("%s,", previous)); } text.append(String.format("%s=%s", name, value)); for (final CharSequence attr : attrs) { text.append(';').append(attr); } return text.toString(); }
Source:
<code>public InputVDir getInputVDir(@Nonnull VPath path) throws NotFileOrDirectoryException, NoSuchFileException { File file = new File(dir, path.getPathAsString(File.separatorChar)); if (!file.exists()) { throw new NoSuchFileException(new FileLocation(file)); } if (!file.isFile()) { throw new NotFileOrDirectoryException(new FileLocation(file)); } return new InputOutputZipVDir(file, zipFile, new <START> ZipEntry(path.getPathAsString('/'))); <END> }</code><technical_language>a constant</technical_language>

Target:
public InputVDir getInputVDir(@Nonnull VPath path) throws NotFileOrDirectoryException, NoSuchFileException { File file = new File(dir, path.getPathAsString(File.separatorChar)); if (!file.exists()) { throw new NoSuchFileException(new FileLocation(file)); } if (!file.isFile()) { throw new NotFileOrDirectoryException(new FileLocation(file)); } return new InputOutputZipVDir(file, zipFile, new ZipEntry(path.getPathAsString(ZIP_ENTRY_SEPARATOR))); }
Source:
<code>public PostIngestConsumer(CatalogEndpoint endpoint, Processor processor) { super(endpoint, processor); this.endpoint = endpoint; <START> Integer threadPoolSize = <END> Integer.parseInt( System.getProperty( "org.codice.ddf.system.threadPoolSize", String.valueOf(THREAD_POOL_DEFAULT_SIZE))); blockingQueue = new LinkedBlockingQueue<>(); threadExecutor = new ThreadPoolExecutor( THREAD_POOL_DEFAULT_SIZE, threadPoolSize, TimeUnit.MINUTES.toMillis(30), TimeUnit.MILLISECONDS, blockingQueue, StandardThreadFactoryBuilder.newThreadFactory("postIngestConsumerThread")); }</code><technical_language>if parseInt throws a NumberFormatException</technical_language>

Target:
public PostIngestConsumer(CatalogEndpoint endpoint, Processor processor) { super(endpoint, processor); this.endpoint = endpoint; Integer threadPoolSize; try { threadPoolSize = Integer.parseInt( System.getProperty( "org.codice.ddf.system.threadPoolSize", String.valueOf(THREAD_POOL_DEFAULT_SIZE))); } catch (NumberFormatException nfe) { threadPoolSize = THREAD_POOL_DEFAULT_SIZE; } threadExecutor = new ThreadPoolExecutor( THREAD_POOL_DEFAULT_SIZE, threadPoolSize, TimeUnit.MINUTES.toMillis(30), TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), StandardThreadFactoryBuilder.newThreadFactory("postIngestConsumerThread")); }
Source:
<code>protected void beforeExecute(Thread t, Runnable r) { try { JobDetail jobDetails = exposeJobDetails(r); Optional.ofNullable(jobDetails).ifPresent(this::bootstrapCronJobContext); } catch (Exception e) { <START> LOGGER.error("Before execute failed for [{}]", r, e); <END> } }</code><technical_language>Cosmetic: Please, change this lowercase: suggestion logger.error("Before execute failed for [{}]", r, e);</technical_language>

Target:
protected void beforeExecute(Thread t, Runnable r) { try { JobDetail jobDetails = exposeJobDetails(r); Optional.ofNullable(jobDetails).ifPresent(this::bootstrapCronJobContext); } catch (Exception e) { logger.error("Before execute failed for [{}]", r, e); } }
Source:
<code>public void testListProjectsOnExternalStorage() throws IOException { File backpackFolder = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "backpack"); assertTrue(backpackFolder.mkdirs()); <START> File tempFolder = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, Constants.TMP_DIR_NAME); <END> assertTrue(tempFolder.mkdirs()); File projectFolder1 = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "projectFolder1"); assertTrue(projectFolder1.mkdirs()); assertTrue(new File(projectFolder1, Constants.CODE_XML_FILE_NAME).createNewFile()); File projectFolder2 = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "projectFolder2"); assertTrue(projectFolder2.mkdirs()); assertTrue(new File(projectFolder2, Constants.CODE_XML_FILE_NAME).createNewFile()); File someFolder = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "someFolder"); assertTrue(someFolder.mkdirs()); List<File> projectFiles = ListProjectFilesTask .task(tmpFolder); assertThat(projectFiles, hasItem(projectFolder1)); assertThat(projectFiles, hasItem(projectFolder2)); assertThat(projectFiles, not(hasItem(backpackFolder))); assertThat(projectFiles, not(hasItem(tempFolder))); assertThat(projectFiles, not(hasItem(someFolder))); }</code><technical_language>nice if change static imports for constants. >"So static import? [..] In other words, require frequent access static members >from classes. [..] " [Oracle doc](<LINK_0> besides, if want move constants (e.g. FlavoredConstants) occurrence is changed correctly</technical_language>

Target:
public void testListProjectsOnExternalStorage() throws IOException { File backpackFolder = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "backpack"); assertTrue(backpackFolder.mkdirs()); File tempFolder = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, TMP_DIR_NAME); assertTrue(tempFolder.mkdirs()); File projectFolder1 = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "projectFolder1"); assertTrue(projectFolder1.mkdirs()); assertTrue(new File(projectFolder1, CODE_XML_FILE_NAME).createNewFile()); File projectFolder2 = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "projectFolder2"); assertTrue(projectFolder2.mkdirs()); assertTrue(new File(projectFolder2, CODE_XML_FILE_NAME).createNewFile()); File someFolder = new File(EXTERNAL_STORAGE_ROOT_DIRECTORY, "someFolder"); assertTrue(someFolder.mkdirs()); List<File> projectFiles = ListProjectFilesTask .task(tmpFolder); assertThat(projectFiles, hasItem(projectFolder1)); assertThat(projectFiles, hasItem(projectFolder2)); assertThat(projectFiles, not(hasItem(backpackFolder))); assertThat(projectFiles, not(hasItem(tempFolder))); assertThat(projectFiles, not(hasItem(someFolder))); }
Source:
<code>public static <R, F> R loadAndInvokeFactory(final Class<F> factoryInterface, final FactoryInvoker<F, R> factoryInvoker, final Supplier<F> defaultProvider) { final ServiceLoader<F> factories = ServiceLoader.load(factoryInterface); final List<R> instantiatedResources = new ArrayList<>(); final List<Exception> errorsDuringInitialization = new ArrayList<>(); for (F factory : factories) { try { R resource = factoryInvoker.invoke(factory); instantiatedResources.add(resource); LOG.info("Instantiated {}.", resource.getClass().getSimpleName()); } catch (Exception e) { LOG.debug("Factory could not instantiate instance.", factory.getClass().getSimpleName(), e); errorsDuringInitialization.add(e); } } if (instantiatedResources.size() == 1) { return instantiatedResources.get(0); } if (instantiatedResources.isEmpty()) { try { return factoryInvoker.invoke(defaultProvider.get()); } catch (Exception e) { <START> final RuntimeException exception = new RuntimeException("Could not instantiate instance."); <END> errorsDuringInitialization.forEach(exception::addSuppressed); throw exception; } } throw new RuntimeException("Multiple instances were created: " + instantiatedResources); }</code><technical_language>Thanks a lot! I confirm error reporting is now!-</technical_language>

Target:
public static <R, F> R loadAndInvokeFactory(final Class<F> factoryInterface, final FactoryInvoker<F, R> factoryInvoker, final Supplier<F> defaultProvider) { final ServiceLoader<F> factories = ServiceLoader.load(factoryInterface); final List<R> instantiatedResources = new ArrayList<>(); final List<Exception> errorsDuringInitialization = new ArrayList<>(); for (F factory : factories) { try { R resource = factoryInvoker.invoke(factory); instantiatedResources.add(resource); LOG.info("Instantiated {}.", resource.getClass().getSimpleName()); } catch (Exception e) { LOG.debug("Factory could not instantiate instance.", factory.getClass().getSimpleName(), e); errorsDuringInitialization.add(e); } } if (instantiatedResources.size() == 1) { return instantiatedResources.get(0); } if (instantiatedResources.isEmpty()) { try { return factoryInvoker.invoke(defaultProvider.get()); } catch (Exception e) { final RuntimeException exception = new RuntimeException("Could not instantiate any instance."); final RuntimeException defaultException = new RuntimeException("Could not instantiate default instance.", e); exception.addSuppressed(defaultException); errorsDuringInitialization.forEach(exception::addSuppressed); throw exception; } } throw new RuntimeException("Multiple instances were created: " + instantiatedResources); }
Source:
<code>public static void registerEnchantment(String name, Enchantment enchantment) { <START> if(ENCHANTMENTS.containsKey(name) || ALIASENCHANTMENTS.containsKey(name)) return; <END> ENCHANTMENTS.put(name, enchantment); }</code><technical_language>suggestion if (ENCHANTMENTS.containsKey(name) || ALIASENCHANTMENTS.containsKey(name)) { return; }</technical_language>

Target:
public static void registerEnchantment(String name, Enchantment enchantment) { if (ENCHANTMENTS.containsKey(name) || ALIASENCHANTMENTS.containsKey(name)) { return; } ENCHANTMENTS.put(name, enchantment); }
Source:
<code>private JSONObject getFilteredStatsForRollup(Rollup rollup, Set<MetricStat> filterStats) { final JSONObject filteredObject = new JSONObject(); for (MetricStat stat : filterStats) { try { Object filteredValue = stat.convertRollupToObject(rollup); if (filteredValue instanceof Map && stat == MetricStat.PERCENTILE) { for (Map.Entry entry : ((Map<?,?>)filteredValue).entrySet()) { BluefloodTimerRollup.Percentile pct = (BluefloodTimerRollup.Percentile)entry.getValue(); filteredObject.put(String.format("pct_%s", entry.getKey().toString()), pct.getMean()); } } else { filteredObject.put(stat.toString(), filteredValue); } } catch (UnsupportedOperationException ex) { <START> log.warn(ex.getMessage()); <END> } } return filteredObject; }</code><technical_language>log this DEBUG? Do care if ask for unsupported metrics? user error, right? Also, capture 4XX in repose access logs</technical_language>

Target:
private JSONObject getFilteredStatsForRollup(Rollup rollup, Set<MetricStat> filterStats) { final JSONObject filteredObject = new JSONObject(); for (MetricStat stat : filterStats) { try { Object filteredValue = stat.convertRollupToObject(rollup); if (filteredValue instanceof Map && stat == MetricStat.PERCENTILE) { for (Map.Entry entry : ((Map<?,?>)filteredValue).entrySet()) { BluefloodTimerRollup.Percentile pct = (BluefloodTimerRollup.Percentile)entry.getValue(); filteredObject.put(String.format("pct_%s", entry.getKey().toString()), pct.getMean()); } } else { filteredObject.put(stat.toString(), filteredValue); } } catch (UnsupportedOperationException ex) { log.debug(ex.toString()); } } return filteredObject; }
Source:
<code><START> private Polyline createBorder() { <END> PointCollection points = new PointCollection(SpatialReferences.getWebMercator()); points.add(new Point(-9981328.687124, 6111053.281447)); points.add(new Point(-9946518.044066, 6102350.620682)); points.add(new Point(-9872545.427566, 6152390.920079)); points.add(new Point(-9838822.617103, 6157830.083057)); points.add(new Point(-9446115.050097, 5927209.572793)); points.add(new Point(-9430885.393759, 5876081.440801)); points.add(new Point(-9415655.737420, 5860851.784463)); return new Polyline(points); }</code><technical_language>this method static</technical_language>

Target:
private static Polyline createBorder() { PointCollection points = new PointCollection(SpatialReferences.getWebMercator()); points.add(new Point(-9981328.687124, 6111053.281447)); points.add(new Point(-9946518.044066, 6102350.620682)); points.add(new Point(-9872545.427566, 6152390.920079)); points.add(new Point(-9838822.617103, 6157830.083057)); points.add(new Point(-9446115.050097, 5927209.572793)); points.add(new Point(-9430885.393759, 5876081.440801)); points.add(new Point(-9415655.737420, 5860851.784463)); return new Polyline(points); }
Source:
<code>public Community[] getSubcommunities() throws SQLException { List<Community> subcommunities = new ArrayList<Community>(); TableRowIterator tri = null; try { String query = "SELECT c.* FROM community2community c2c, community c " + "LEFT JOIN metadatavalue m on (m.resource_id = c.community_id and m.resource_type_id = ? and m.metadata_field_id = ?) " + "WHERE c2c.child_comm_id=c.community_id " + "AND c2c.parent_comm_id= ? "; <START> if("oracle".equals(ConfigurationManager.getProperty("db.name"))){ <END> query += " ORDER BY cast(m.text_value as varchar2(128))"; }else{ query += " ORDER BY m.text_value"; } tri = DatabaseManager.query( ourContext, query, Constants.COMMUNITY, MetadataField.findByElement(ourContext, MetadataSchema.find(ourContext, MetadataSchema.DC_SCHEMA).getSchemaID(), "title", null).getFieldID(), getID() ); } catch (SQLException e) { log.error("Find all Sub Communities - ",e); throw e; } try { while (tri.hasNext()) { TableRow row = tri.next(); Community fromCache = (Community) ourContext.fromCache( Community.class, row.getIntColumn("community_id")); if (fromCache != null) { subcommunities.add(fromCache); } else { subcommunities.add(new Community(ourContext, row)); } } } finally { if (tri != null) { tri.close(); } } Community[] communityArray = new Community[subcommunities.size()]; communityArray = (Community[]) subcommunities.toArray(communityArray); return communityArray; }</code><technical_language>DatabaseManager.isOracle()</technical_language>

Target:
public Community[] getSubcommunities() throws SQLException { List<Community> subcommunities = new ArrayList<Community>(); TableRowIterator tri = null; try { String query = "SELECT c.* FROM community2community c2c, community c " + "LEFT JOIN metadatavalue m on (m.resource_id = c.community_id and m.resource_type_id = ? and m.metadata_field_id = ?) " + "WHERE c2c.child_comm_id=c.community_id " + "AND c2c.parent_comm_id= ? "; if(DatabaseManager.isOracle()){ query += " ORDER BY cast(m.text_value as varchar2(128))"; }else{ query += " ORDER BY m.text_value"; } tri = DatabaseManager.query( ourContext, query, Constants.COMMUNITY, MetadataField.findByElement(ourContext, MetadataSchema.find(ourContext, MetadataSchema.DC_SCHEMA).getSchemaID(), "title", null).getFieldID(), getID() ); } catch (SQLException e) { log.error("Find all Sub Communities - ",e); throw e; } try { while (tri.hasNext()) { TableRow row = tri.next(); Community fromCache = (Community) ourContext.fromCache( Community.class, row.getIntColumn("community_id")); if (fromCache != null) { subcommunities.add(fromCache); } else { subcommunities.add(new Community(ourContext, row)); } } } finally { if (tri != null) { tri.close(); } } Community[] communityArray = new Community[subcommunities.size()]; communityArray = (Community[]) subcommunities.toArray(communityArray); return communityArray; }
Source:
<code>public Cohort addMembershipToCohort(Cohort cohort, CohortMembership cohortMembership) throws APIException { if (!cohort.contains(cohortMembership)) { <START> ValidateUtil.validate(cohortMembership); <END> cohort.addMembership(cohortMembership); Context.getCohortService().saveCohort(cohort); } return cohort; }</code><technical_language>validation handled in CohortValidator, if exist need add</technical_language>

Target:
public Cohort addMembershipToCohort(Cohort cohort, CohortMembership cohortMembership) throws APIException { cohort.addMembership(cohortMembership); Context.getCohortService().saveCohort(cohort); return cohort; }
Source:
<code>public void processMessage(final ProtocolRequestMessage message) throws FunctionalException { try { final Device device = this.domainHelperService.findDevice(message.getDeviceIdentification()); final ProtocolInfo protocolInfo; if (device.getGatewayDevice() == null) { protocolInfo = device.getProtocolInfo(); } else { protocolInfo = device.getGatewayDevice().getProtocolInfo(); } if (protocolInfo == null || !this.protocolRequestService.isSupported(protocolInfo)) { final String msg = "Protocol unknown for device [" + device.getDeviceIdentification() + "]"; LOGGER.error(msg); throw new FunctionalException(FunctionalExceptionType.PROTOCOL_UNKNOWN_FOR_DEVICE, <START> ComponentType.OSGP_CORE); <END> } LOGGER.info("Device is using protocol with version [{}]", protocolInfo.getProtocol(), protocolInfo.getProtocolVersion()); final Organisation organisation = this.domainHelperService.findOrganisation(message .getOrganisationIdentification()); this.domainHelperService.isAllowed(organisation, device, Enum.valueOf(DeviceFunction.class, message.getMessageType())); this.protocolRequestService.send(message, protocolInfo); } catch (final FunctionalException e) { this.domainResponseMessageSender.send(message, e); throw e; } }</code><technical_language>need for variable msg I think. I good information ProtocolInfo in logging</technical_language>

Target:
public void processMessage(final ProtocolRequestMessage message) throws FunctionalException { try { final Device device = this.domainHelperService.findDevice(message.getDeviceIdentification()); final ProtocolInfo protocolInfo; if (device.getGatewayDevice() == null) { protocolInfo = device.getProtocolInfo(); } else { protocolInfo = device.getGatewayDevice().getProtocolInfo(); } if (protocolInfo == null || !this.protocolRequestService.isSupported(protocolInfo)) { if (protocolInfo == null) { LOGGER.error("Protocol unknown for device [{}]", device.getDeviceIdentification()); } else { LOGGER.error("Protocol with version unknown for device [{}], needs to be reloaded.", protocolInfo.getProtocol(), protocolInfo.getProtocolVersion(), device.getDeviceIdentification()); } throw new FunctionalException(FunctionalExceptionType.PROTOCOL_UNKNOWN_FOR_DEVICE, ComponentType.OSGP_CORE); } LOGGER.info("Device is using protocol with version [{}]", protocolInfo.getProtocol(), protocolInfo.getProtocolVersion()); final Organisation organisation = this.domainHelperService.findOrganisation(message .getOrganisationIdentification()); this.domainHelperService.isAllowed(organisation, device, Enum.valueOf(DeviceFunction.class, message.getMessageType())); this.protocolRequestService.send(message, protocolInfo); } catch (final FunctionalException e) { this.domainResponseMessageSender.send(message, e); throw e; } }
Source:
<code>private TransactionTable getTransactionTable(TransactionMode transactionMode) { switch (transactionMode) { case NON_XA: return syncTransactionTable; case NON_DURABLE_XA: return xaTransactionTable; case FULL_XA: default: <START> throw new IllegalArgumentException("XA isn't supported yet!"); <END> } }</code><technical_language>Update exception message</technical_language>

Target:
private TransactionTable getTransactionTable(TransactionMode transactionMode) { switch (transactionMode) { case NON_XA: return syncTransactionTable; case NON_DURABLE_XA: return xaTransactionTable; case FULL_XA: default: throw new IllegalArgumentException("FULL_XA isn't supported yet!"); } }
Source:
<code>public void correctlyKeepsOldWarrantCitations(){ <START> Court COURT = new Court(); <END> COURT.citation_expires_after_days = 3; Citation CITATION = new Citation(); CITATION.id = 3; CITATION.court_id = new HashableEntity<Court>(Court.class,4L); Violation VIOLATION = new Violation(); VIOLATION.warrant_status = true; List<Violation> VIOLATIONS = Lists.newArrayList(VIOLATION); CITATION.violations = VIOLATIONS; String courtDateString = "09/10/2016 14:33"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm"); CITATION.court_dateTime = LocalDateTime.parse(courtDateString, formatter); List<Citation> CITATIONS = Lists.newArrayList(CITATION); when(courtManagerMock.getCourtById(CITATION.court_id.getValue())).thenReturn(COURT); assertThat(citationFilter.RemoveCitationsWithExpiredDates(CITATIONS).size(), is(1)); }</code><technical_language>is some disagreement tabs spaces in this file. get formatted consistent other</technical_language>

Target:
public void correctlyKeepsOldWarrantCitations(){ Court COURT = new Court(); COURT.citation_expires_after_days = 3; Citation CITATION = new Citation(); CITATION.id = 3; CITATION.court_id = new HashableEntity<Court>(Court.class,4L); Violation VIOLATION = new Violation(); VIOLATION.warrant_status = true; List<Violation> VIOLATIONS = Lists.newArrayList(VIOLATION); CITATION.violations = VIOLATIONS; String courtDateString = "09/10/2016 14:33"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm"); CITATION.court_dateTime = LocalDateTime.parse(courtDateString, formatter); List<Citation> CITATIONS = Lists.newArrayList(CITATION); when(courtManagerMock.getCourtById(CITATION.court_id.getValue())).thenReturn(COURT); assertThat(citationFilter.Filter(CITATIONS).size(), is(1)); }
Source:
<code>protected ImmutableValue<List<Text>> constructImmutableValue(List<Text> value) { <START> return new ImmutableSpongeValue<List<Text>>(Keys.ITEM_LORE, value); <END> }</code><technical_language>Return ImmutableSpongeListValue<Text> ImmutableSpongeValue</technical_language>

Target:
protected ImmutableValue<List<Text>> constructImmutableValue(List<Text> value) { return new ImmutableSpongeListValue<Text>(Keys.ITEM_LORE, ImmutableList.copyOf(value)); }
Source:
<code>public Expression visitLeave(JsonSingleKeySearchParseNode node, List<Expression> children) throws SQLException { <START> ParseNode rhsNode = node.getChildren().get(1); <END> Expression lhs = children.get(0); if (rhsNode instanceof BindParseNode) { context.getBindManager().addParamMetaData((BindParseNode)rhsNode, lhs); } if(!(PJson.INSTANCE.isComparableTo(children.get(0).getDataType()))){ throw TypeMismatchException.newException(children.get(0).getDataType(), children.get(1).getDataType()); } if(!(PVarchar.INSTANCE.isComparableTo(children.get(1).getDataType()))){ throw TypeMismatchException.newException(children.get(0).getDataType(), children.get(1).getDataType()); } Expression expression = new JsonSingleKeySearchExpression(children); return wrapGroupByExpression(expression); }</code><technical_language>Do need check if lhsNode is instanceof BindParseNode</technical_language>

Target:
public Expression visitLeave(JsonSingleKeySearchParseNode node, List<Expression> children) throws SQLException { if(!(PJson.INSTANCE.isComparableTo(children.get(0).getDataType()))){ throw TypeMismatchException.newException(children.get(0).getDataType(), children.get(1).getDataType()); } if(!(PVarchar.INSTANCE.isComparableTo(children.get(1).getDataType()))){ throw TypeMismatchException.newException(children.get(0).getDataType(), children.get(1).getDataType()); } Expression expression = new JsonSingleKeySearchExpression(children); return wrapGroupByExpression(expression); }
Source:
<code>public boolean applyDomainAttributes(Attributes attributes) throws NamingException { boolean retVal = false; Attribute attribute = attributes.get(RootDSEQueryInfo.DEFAULT_NAMING_CONTEXT_RESULT_ATTRIBUTE); if (attribute != null) { domainDN = (String) attribute.get(); ldapProviderType = LdapProviderType.activeDirectory; retVal = true; } else { Attribute namingContextAttribute = attributes.get(RootDSEQueryInfo.NAMING_CONTEXTS_RESULT_ATTRIBUTE); Attribute vendorNameAttribute = attributes.get(RootDSEQueryInfo.PROVIDER_TYPE_PROPERTY); if (namingContextAttribute != null) { domainDN = getDefaultNamingContextFromNamingContexts(namingContextAttribute); String vendorName = (String) vendorNameAttribute.get(0); <START> if (vendorName.equals(RootDSEQueryInfo.IPA_VENDOR_NAME)) { <END> ldapProviderType = LdapProviderType.ipa; } else if (vendorName.equals(RootDSEQueryInfo.RHDS_VENDOR_NAME)) { ldapProviderType = LdapProviderType.rhds; } retVal = true; } } return retVal; }</code><technical_language>This code is repetitive. Appears in previous file in patch (the if... part). Please of code reuse</technical_language>

Target:
public boolean applyDomainAttributes(Attributes attributes) throws NamingException { boolean retVal = false; Attribute attribute = attributes.get(RootDSEQueryInfo.DEFAULT_NAMING_CONTEXT_RESULT_ATTRIBUTE); if (attribute != null) { domainDN = (String) attribute.get(); ldapProviderType = LdapProviderType.activeDirectory; retVal = true; } else { Attribute namingContextAttribute = attributes.get(RootDSEQueryInfo.NAMING_CONTEXTS_RESULT_ATTRIBUTE); Attribute vendorNameAttribute = attributes.get(RootDSEQueryInfo.PROVIDER_TYPE_PROPERTY); if (namingContextAttribute != null) { domainDN = getDefaultNamingContextFromNamingContexts(namingContextAttribute); String vendorName = (String) vendorNameAttribute.get(0); if (vendorName.equals(LdapVendorNameEnum.IPAVendorName.getName())) { ldapProviderType = LdapProviderType.ipa; } else if (vendorName.equals(LdapVendorNameEnum.RHDSVendorName.getName())) { ldapProviderType = LdapProviderType.rhds; } retVal = true; } } return retVal; }
Source:
<code>public boolean deleteImage(String id) { try { AsyncCreateResponse deleteJob = client.getTemplateClient().deleteTemplate(id); boolean deleteComplete = jobComplete.apply(deleteJob.getJobId()); } catch (Exception e) { return false; } <START> return true; <END> }</code><technical_language>Move try block</technical_language>

Target:
public boolean deleteImage(String id) { try { AsyncCreateResponse deleteJob = client.getTemplateClient().deleteTemplate(id); jobComplete.apply(deleteJob.getJobId()); return true; } catch (Exception e) { return false; } }
Source:
<code>private void fetchStockMedia(@Nullable String searchQuery, int page) { if (mIsFetching || !NetworkUtils.checkConnection(this)) { return; } <START> if (TextUtils.isEmpty(searchQuery)) { <END> mAdapter.clear(); return; } if (page == 1) { mAdapter.clear(); } showProgress(true); mIsFetching = true; showEmptyView(false); mSearchQuery = searchQuery; AppLog.d(AppLog.T.MEDIA, "Fetching stock media page " + page); StockMediaStore.FetchStockMediaListPayload payload = new StockMediaStore.FetchStockMediaListPayload(searchQuery, page); mDispatcher.dispatch(StockMediaActionBuilder.newFetchStockMediaAction(payload)); }</code><technical_language>I guess need call showEmptyView(false) in here. I love type of necessary observer pattern. ViewModel</technical_language>

Target:
private void fetchStockMedia(@Nullable String searchQuery, int page) { if ((mIsFetching && page != 1) || !NetworkUtils.checkConnection(this)) { return; } mSearchQuery = searchQuery; if (mSearchQuery == null || mSearchQuery.length() < MIN_SEARCH_QUERY_SIZE) { mIsFetching = false; showProgress(false); mAdapter.clear(); showEmptyView(true); return; } if (page == 1) { mAdapter.clear(); } showProgress(true); mIsFetching = true; showEmptyView(false); AppLog.d(AppLog.T.MEDIA, "Fetching stock media page " + page); StockMediaStore.FetchStockMediaListPayload payload = new StockMediaStore.FetchStockMediaListPayload(searchQuery, page); mDispatcher.dispatch(StockMediaActionBuilder.newFetchStockMediaAction(payload)); }
Source:
<code>protected Integer asEntity(String provided) { if (nullString == null || nullString.equals(provided)) { return null; } return provided == null ? null : <START> Integer.parseInt(provided); <END> }</code><technical_language>This fail NumberFormatException. Is handled somewhere</technical_language>

Target:
protected Integer asEntity(String provided) { if (nullString == null || nullString.equals(provided)) { return null; } try { return provided == null ? null : Integer.parseInt(provided); } catch (NumberFormatException e) { throw new IllegalArgumentException(e); } }
Source:
<code><START> public boolean hasColumn(ColumnName name) { <END> boolean result = storageFields.containsKey(name); return result; }</code><technical_language>this method final</technical_language>

Target:
public final boolean hasColumn(ColumnName name) { boolean result = storageFields.containsKey(name); return result; }
Source:
<code>public void startScanner(final ContainerSpecKey containerSpecKey, long interval) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new RuntimeException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } org.kie.server.controller.api.model.spec.ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE); if (containerConfig == null) { containerConfig = new RuleConfig(); containerSpec.getConfigs().put(Capability.RULE, containerConfig); } <START> ((RuleConfig) containerConfig).setPollInterval(interval); <END> ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STARTED); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.startScanner(serverTemplate, containerSpec, interval); notificationService.notify(serverTemplate, containerSpec, containers); }</code><technical_language>is safe? containerConfigs is RuleConfig</technical_language>

Target:
public void startScanner(final ContainerSpecKey containerSpecKey, long interval) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new RuntimeException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE); if (containerConfig == null) { containerConfig = new RuleConfig(); containerSpec.getConfigs().put(Capability.RULE, containerConfig); } ((RuleConfig) containerConfig).setPollInterval(interval); ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STARTED); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.startScanner(serverTemplate, containerSpec, interval); notificationService.notify(serverTemplate, containerSpec, containers); }
Source:
<code>protected void waitForResponse(Game game) { <START> if(!recordingMacro && pullResponseFromQueue(game)) return; <END> response.clear(); logger.debug("Waiting response from player: " + getId()); game.resumeTimer(getTurnControlledBy()); synchronized (response) { try { response.wait(); logger.debug("Got response from player: " + getId()); } catch (InterruptedException ex) { logger.error("Response error for player " + getName() + " gameId: " + game.getId(), ex); } finally { game.pauseTimer(getTurnControlledBy()); } } if (recordingMacro && !macroTriggeredSelectionFlag) { logger.debug("Adding an action " + response); actionQueueSaved.add(new PlayerResponse(response)); } }</code><technical_language>a fan of conditions execution line. Condition a new line indented - hard code flow especially return inline here</technical_language>

Target:
protected void waitForResponse(Game game) { if (isExecutingMacro()) { pullResponseFromQueue(game); return; } response.clear(); logger.debug("Waiting response from player: " + getId()); game.resumeTimer(getTurnControlledBy()); synchronized (response) { try { response.wait(); logger.debug("Got response from player: " + getId()); } catch (InterruptedException ex) { logger.error("Response error for player " + getName() + " gameId: " + game.getId(), ex); } finally { game.pauseTimer(getTurnControlledBy()); } } if (recordingMacro && !macroTriggeredSelectionFlag) { logger.debug("Adding an action " + response); actionQueueSaved.add(new PlayerResponse(response)); } }
Source:
<code>public JType generate(JCodeModel codeModel, String className, String packageName, String json) throws IOException { JPackage jpackage = codeModel._package(packageName); ObjectMapper mapper = new ObjectMapper(); JsonNode schemaNode = null; <START> switch (ruleFactory.getGenerationConfig().getSourceType()) { <END> case JSON: JsonNode jsonNode = mapper.readTree(json); schemaNode = schemaGenerator.schemaFromExample(jsonNode); break; default: schemaNode = mapper.readTree(json); break; } return ruleFactory.getSchemaRule().apply(className, schemaNode, jpackage, new Schema(null, schemaNode, schemaNode)); }</code><technical_language>For this simple case, I if/else neater</technical_language>

Target:
public JType generate(JCodeModel codeModel, String className, String packageName, String json) throws IOException { JPackage jpackage = codeModel._package(packageName); ObjectMapper mapper = new ObjectMapper(); JsonNode schemaNode = null; if (ruleFactory.getGenerationConfig().getSourceType() == SourceType.JSON) { JsonNode jsonNode = mapper.readTree(json); schemaNode = schemaGenerator.schemaFromExample(jsonNode); } else { schemaNode = mapper.readTree(json); } return ruleFactory.getSchemaRule().apply(className, schemaNode, jpackage, new Schema(null, schemaNode, schemaNode)); }
Source:
<code>public void postProcessData(Process process, Map<URI, Object> dataMap, GroovyObject groovyObject){ for (Field field : groovyObject.getClass().getDeclaredFields()) { if (field.getAnnotation(OutputAttribute.class) != null) { field.setAccessible(true); DescriptionTypeAttribute annot = field.getAnnotation(DescriptionTypeAttribute.class); URI uri; <START> if(annot != null && !annot.identifier().equals("")) { <END> uri = URI.create(annot.identifier()); } else{ uri = URI.create(process.getIdentifier() + ":output:" + field.getName()); } try { dataMap.put(uri, field.get(groovyObject)); } catch (IllegalAccessException e) { dataMap.put(uri, null); LoggerFactory.getLogger(ProcessingManager.class).error(e.getMessage()); } } } ProcessingData prossData; for(Input input : process.getInput()){ if((prossData = getProcessingData(input.getDataDescription().getClass())) != null) { prossData.postProcessing(input, dataMap, toolBox); } } for(Output output : process.getOutput()){ if((prossData = getProcessingData(output.getDataDescription().getClass())) != null) { prossData.postProcessing(output, dataMap, toolBox); } } }</code><technical_language>for clarity, String.isEmpty()</technical_language>

Target:
public void postProcessData(Process process, Map<URI, Object> dataMap, GroovyObject groovyObject){ for (Field field : groovyObject.getClass().getDeclaredFields()) { if (field.getAnnotation(OutputAttribute.class) != null) { field.setAccessible(true); DescriptionTypeAttribute annot = field.getAnnotation(DescriptionTypeAttribute.class); URI uri; if(annot != null && !annot.identifier().isEmpty()) { uri = URI.create(annot.identifier()); } else{ uri = URI.create(process.getIdentifier() + ":output:" + field.getName()); } try { dataMap.put(uri, field.get(groovyObject)); } catch (IllegalAccessException e) { dataMap.put(uri, null); LoggerFactory.getLogger(ProcessingManager.class).error(e.getMessage()); } } } ProcessingData prossData; for(Input input : process.getInput()){ if((prossData = getProcessingData(input.getDataDescription().getClass())) != null) { prossData.postProcessing(input, dataMap, toolBox); } } for(Output output : process.getOutput()){ if((prossData = getProcessingData(output.getDataDescription().getClass())) != null) { prossData.postProcessing(output, dataMap, toolBox); } } }