auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) { try { CommandLine cl = parseCommandLine(args); Jpg2Dcm jpg2Dcm = new Jpg2Dcm(); jpg2Dcm.keys = configureKeys(jpg2Dcm, cl); LOG.info("added keys for coercion: \n" + jpg2Dcm.keys.toString()); jpg2Dcm.metadataFile = cl.getOptionValue("f"); if (cl.getArgs().length < 2) throw new MissingArgumentException("Either input pixel data file or output binary file is missing. See example in jpg2dcm help."); jpg2Dcm.pixelDataFile = new File(cl.getArgs()[0]); Extension ext = getExt(jpg2Dcm.pixelDataFile.getName()); jpg2Dcm.noAPPn = Boolean.valueOf(cl.getOptionValue("na")); Attributes metadata = getMetadata(jpg2Dcm, ext); @SuppressWarnings("rawtypes") File dcmFile = new File(cl.getArgs()[1]); long start = System.currentTimeMillis(); jpg2Dcm.convert(metadata, jpg2Dcm, dcmFile); long fin = System.currentTimeMillis(); LOG.info("Encapsulated " + jpg2Dcm.pixelDataFile + " to " + dcmFile.getPath() + " in " + (fin - start) + "ms."); } catch (Exception e) { LOG.error("Error: \n", e); e.printStackTrace(); } }

Target:
public static void main(String[] args) { try { CommandLine cl = parseCommandLine(args); Jpg2Dcm jpg2Dcm = new Jpg2Dcm(); jpg2Dcm.keys = configureKeys(jpg2Dcm, cl); LOG.info("added keys for coercion: \n" + jpg2Dcm.keys.toString()); jpg2Dcm.metadataFile = cl.getOptionValue("f"); if (cl.getArgs().length < 2) throw new MissingArgumentException("Either input pixel data file or output binary file is missing. See example in jpg2dcm help."); jpg2Dcm.pixelDataFile = new File(cl.getArgs()[0]); Extension ext = getExt(jpg2Dcm.pixelDataFile.getName()); jpg2Dcm.noAPPn = Boolean.valueOf(cl.getOptionValue("na")); Attributes metadata = getMetadata(jpg2Dcm, ext); @SuppressWarnings("rawtypes") File dcmFile = new File(cl.getArgs()[1]); long start = System.currentTimeMillis(); jpg2Dcm.convert(metadata, jpg2Dcm, dcmFile); long fin = System.currentTimeMillis(); LOG.info("Encapsulated " + jpg2Dcm.pixelDataFile + " to " + dcmFile.getPath() + " in " + (fin - start) + "ms."); } catch (ParseException e) { System.err.println("jpg2dcm: " + e.getMessage()); System.err.println(rb.getString("try")); System.exit(2); } catch (Exception e) { LOG.error("Error: \n", e); e.printStackTrace(); System.exit(2); } }
Source:
private FastForwardMode getFastForwardMode() { Config config = repo.getConfig(); Merge ffMode = config.getEnum(Merge.values(), ConfigConstants.CONFIG_PULL_SECTION, null, ConfigConstants.CONFIG_KEY_FF, null); if (ffMode == null) { ffMode = config.getEnum(Merge.values(), ConfigConstants.CONFIG_MERGE_SECTION, null, ConfigConstants.CONFIG_KEY_FF, null); } return ffMode != null ? FastForwardMode.valueOf(ffMode) : null; }

Target:
private FastForwardMode getFastForwardMode() { Config config = repo.getConfig(); Merge ffMode = config.getEnum(Merge.values(), ConfigConstants.CONFIG_PULL_SECTION, null, ConfigConstants.CONFIG_KEY_FF, null); return ffMode != null ? FastForwardMode.valueOf(ffMode) : null; }
Source:
static ChecksumType.Type toBlobChecksumType(final String checksumType) { if (Guard.isStringNullOrEmpty(checksumType)) { return ChecksumType.Type.NONE; } switch (checksumType) { case "CRC_32": return ChecksumType.Type.CRC_32; case "CRC_32C": return ChecksumType.Type.CRC_32C; case "MD5": return ChecksumType.Type.MD5; case "SHA_256": return ChecksumType.Type.SHA_256; case "SHA_512": return ChecksumType.Type.SHA_512; case "": return ChecksumType.Type.NONE; default: throw new IllegalArgumentException(String.format("Unknown value for header '%s': '%s'", BLOB_CHECKSUM_TYPE_HEADER, checksumType)); } }

Target:
static ChecksumType.Type toBlobChecksumType(final String checksumType) { if (Guard.isStringNullOrEmpty(checksumType)) { return ChecksumType.Type.NONE; } return ChecksumType.Type.valueOf(checksumType); }
Source:
public void actionPerformed(ActionEvent event) { try { getOAuthClientFacade().requestAccessToken(target); } catch (InvalidOAuthParametersException e) { UISupport.showErrorMessage("Invalid OAuth 2 parameters: " + e.getMessage()); } catch (Exception e) { SoapUI.logError(e, "Error retrieving OAuth 2 access token"); UISupport.showErrorMessage("Could not retrieve access token. Check the SoapUI log for details"); } }

Target:
public void actionPerformed(ActionEvent event) { try { getOAuthClientFacade().requestAccessToken(target); } catch (InvalidOAuthParametersException e) { UISupport.showErrorMessage(messages.get("GetOAuthAccessTokenAction.Error.InvalidParameters", e.getMessage())); } catch (Exception e) { SoapUI.logError(e, messages.get("GetOAuthAccessTokenAction.Error.RetrievingFailLog")); UISupport.showErrorMessage(messages.get("GetOAuthAccessTokenAction.Error.RetrievingFailMessage")); } }
Source:
private DataSource loadDataSource(String dataSourceName) { DataSourceProvider dataSourceProvider = serviceLoaderInstance.get().onlyOne(DataSourceProvider.class); if(dataSourceProvider != null) { return dataSourceProvider.lookupDataSource(dataSourceName); } return serviceLoaderInstance.get().onlyOne(DefaultDataSourceProvider.class).lookupDataSource(dataSourceName); }

Target:
private DataSource loadDataSource(String dataSourceName) { DataSourceProvider dataSourceProvider = serviceLoaderInstance.get() .onlyOne(DataSourceProvider.class, JndiDataSourceProvider.class); return dataSourceProvider.lookupDataSource(dataSourceName); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createStreetsVector()); mMapView.setMap(map); mShapefileFeatureTable = new ShapefileFeatureTable( getExternalFilesDir(null) + getString(R.string.shapefile_path)); mShapefileFeatureTable.loadAsync(); mShapefileFeatureTable.addDoneLoadingListener(() -> { if (mShapefileFeatureTable.getLoadStatus() == LoadStatus.LOADED) { FeatureLayer shapefileFeatureLayer = new FeatureLayer(mShapefileFeatureTable); mMapView.getMap().getOperationalLayers().add(shapefileFeatureLayer); mMapView.setViewpointAsync(new Viewpoint(shapefileFeatureLayer.getFullExtent())); } else { String error = "Shapefile feature table failed to load: " + mShapefileFeatureTable.getLoadError().toString(); Toast.makeText(MainActivity.this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createStreetsVector()); mMapView.setMap(map); ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable( getExternalFilesDir(null) + getString(R.string.shapefile_path)); FeatureLayer shapefileFeatureLayer = new FeatureLayer(shapefileFeatureTable); mMapView.getMap().getOperationalLayers().add(shapefileFeatureLayer); shapefileFeatureTable.addDoneLoadingListener(() -> { if (shapefileFeatureTable.getLoadStatus() == LoadStatus.LOADED) { mMapView.setViewpointAsync(new Viewpoint(shapefileFeatureLayer.getFullExtent())); } else { String error = "Shapefile feature table failed to load: " + shapefileFeatureTable.getLoadError().toString(); Toast.makeText(MainActivity.this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }
Source:
public void rebaseEdit() throws Exception { assertEquals(RefUpdate.Result.NEW, modifier.createEdit( change, ps)); assertEquals(RefUpdate.Result.FORCED, modifier.modifyFile( editUtil.byChange(change).get(), FILE_NAME, CONTENT_NEW)); ChangeEdit edit = editUtil.byChange(change).get(); PatchSet current = getCurrentPatchSet(changeId); assertEquals(current.getPatchSetId() - 1, edit.getBasePatchSet().getPatchSetId()); Date beforeRebase = edit.getEditCommit().getCommitterIdent().getWhen(); Thread.sleep(1000L); modifier.rebaseEdit(edit, current); edit = editUtil.byChange(change).get(); assertArrayEquals(CONTENT_NEW, toBytes(fileUtil.getContent(edit.getChange().getProject(), edit.getRevision().get(), FILE_NAME))); assertArrayEquals(CONTENT_NEW2, toBytes(fileUtil.getContent(edit.getChange().getProject(), edit.getRevision().get(), FILE_NAME2))); assertEquals(current.getPatchSetId(), edit.getBasePatchSet().getPatchSetId()); Date afterRebase = edit.getEditCommit().getCommitterIdent().getWhen(); assertFalse(beforeRebase.equals(afterRebase)); }

Target:
public void rebaseEdit() throws Exception { assertEquals(RefUpdate.Result.NEW, modifier.createEdit( change, ps)); assertEquals(RefUpdate.Result.FORCED, modifier.modifyFile( editUtil.byChange(change).get(), FILE_NAME, CONTENT_NEW)); ChangeEdit edit = editUtil.byChange(change).get(); PatchSet current = getCurrentPatchSet(changeId); assertEquals(current.getPatchSetId() - 1, edit.getBasePatchSet().getPatchSetId()); Date beforeRebase = edit.getEditCommit().getCommitterIdent().getWhen(); modifier.rebaseEdit(edit, current); edit = editUtil.byChange(change).get(); assertArrayEquals(CONTENT_NEW, toBytes(fileUtil.getContent(edit.getChange().getProject(), edit.getRevision().get(), FILE_NAME))); assertArrayEquals(CONTENT_NEW2, toBytes(fileUtil.getContent(edit.getChange().getProject(), edit.getRevision().get(), FILE_NAME2))); assertEquals(current.getPatchSetId(), edit.getBasePatchSet().getPatchSetId()); Date afterRebase = edit.getEditCommit().getCommitterIdent().getWhen(); assertFalse(beforeRebase.equals(afterRebase)); }
Source:
private void logAuditMessages(List<GlusterBrickEntity> bricks) { GlusterAuditLogUtil logUtil = GlusterAuditLogUtil.getInstance(); for (final GlusterBrickEntity brick : bricks) { logUtil.logAuditMessage(null, null, null, AuditLogType.GLUSTER_VOLUME_BRICK_ADDED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getBrickDirectory()); put(GlusterConstants.SERVERE_NAME, brick.getServerName()); put(GlusterConstants.VOLUME_NAME, getGlusterVolumeName()); } }); } }

Target:
private void logAuditMessages(List<GlusterBrickEntity> bricks) { GlusterAuditLogUtil logUtil = GlusterAuditLogUtil.getInstance(); for (final GlusterBrickEntity brick : bricks) { logUtil.logAuditMessage(null, null, null, AuditLogType.GLUSTER_VOLUME_BRICK_ADDED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getBrickDirectory()); put(GlusterConstants.SERVER_NAME, brick.getServerName()); put(GlusterConstants.VOLUME_NAME, getGlusterVolumeName()); } }); } }
Source:
public LogCommand log() { return (new LogCommand(this)); }

Target:
public LogCommand log() { return new LogCommand(this); }
Source:
public void findByUndefinedSchema() throws Exception { context.turnOffAuthorisationSystem(); getClient().perform(get("/api/core/metadatafields/search/bySchema") .param("schema", "undefined")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", is(0))); }

Target:
public void findByUndefinedSchema() throws Exception { getClient().perform(get("/api/core/metadatafields/search/bySchema") .param("schema", "undefined")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", is(0))); }
Source:
public void run(int count, int warmupCount) throws Exception { List<Tuple<String, double[]>> benchmarksResults = new ArrayList<Tuple<String, double[]>>(benchmarkableList.size()); for (Benchmarkable benchmark : benchmarkableList) { double[] durations = new double[count]; for (int i = 0; i < count + warmupCount; i++) { if (i >= warmupCount) { System.gc(); } long currentTimeNanos = System.nanoTime(); benchmark.run(); if (i >= warmupCount) { durations[i - warmupCount] = (System.nanoTime() - currentTimeNanos) / 1000000.0; } } benchmarksResults.add(new Tuple<String, double[]>(benchmark.label, durations)); } for (Tuple<String, double[]> benchmarkResult : benchmarksResults) { printStat(benchmarkResult.first, benchmarkResult.second); } }

Target:
public void run(int count, int warmupCount) throws Exception { List<Tuple<String, double[]>> benchmarksResults = new ArrayList<Tuple<String, double[]>>(benchmarkableList.size()); for (Benchmarkable benchmark : benchmarkableList) { benchmarksResults.add(new Tuple<String, double[]>(benchmark.label, new double[count])); } for (int i = 0; i < count + warmupCount; i++) { for (int bi = 0; bi < benchmarkableList.size(); bi++) { Benchmarkable benchmark = benchmarkableList.get(bi); long currentTimeNanos = System.nanoTime(); benchmark.run(); if (i >= warmupCount) { benchmarksResults.get(bi).second[i - warmupCount] = (System.nanoTime() - currentTimeNanos) / 1000000.0; } } } for (Tuple<String, double[]> benchmarkResult : benchmarksResults) { printStat(benchmarkResult.first, benchmarkResult.second); } }
Source:
private Collection<CommandImpl> resolve(ChePlugin chePlugin) { List<CheContainer> containers = chePlugin.getContainers(); String pluginRef = chePlugin.getId() + ":" + chePlugin.getVersion(); Collection<CommandImpl> pluginsCommands = pluginRefToCommand.removeAll(pluginRef); if (pluginsCommands.isEmpty()) { return emptyList(); } if (containers.isEmpty()) { k8sEnvironment .getWarnings() .add( new WarningImpl( 44012, format( "There are configured commands for plugin '%s' that doesn't have any containers", pluginRef))); return emptyList(); } if (containers.size() > 1) { k8sEnvironment .getWarnings() .add( new WarningImpl( 44013, format( "There are configured commands for plugin '%s' that has multiply containers. Commands will be configured to be run in first container", pluginRef))); } return pluginsCommands; }

Target:
private Collection<CommandImpl> resolve(ChePlugin chePlugin) { List<CheContainer> containers = chePlugin.getContainers(); String pluginRef = chePlugin.getId() + ":" + chePlugin.getVersion(); Collection<CommandImpl> pluginsCommands = pluginRefToCommand.removeAll(pluginRef); if (pluginsCommands.isEmpty()) { return emptyList(); } if (containers.isEmpty()) { k8sEnvironment .getWarnings() .add( new WarningImpl( Warnings.COMMAND_IS_CONFIGURED_IN_PLUGIN_WITHOUT_CONTAINERS_WARNING_CODE, format( Warnings .COMMAND_IS_CONFIGURED_IN_PLUGIN_WITHOUT_CONTAINERS_WARNING_MESSAGE_FMT, pluginRef))); return emptyList(); } if (containers.size() > 1) { k8sEnvironment .getWarnings() .add( new WarningImpl( Warnings.COMMAND_IS_CONFIGURED_IN_PLUGIN_WITH_MULTIPLY_CONTAINERS_WARNING_CODE, format( Warnings .COMMAND_IS_CONFIGURED_IN_PLUGIN_WITH_MULTIPLY_CONTAINERS_WARNING_MESSAGE_FMT, pluginRef))); } return pluginsCommands; }
Source:
public PsiElement setName(@NotNull String name) throws IncorrectOperationException { checkSetName(name); final PsiElement oldName = getNameIdentifier(); assert oldName != null; PsiElement newName = GLSLPsiElementFactory.createLeafElement(getProject(), name); getNode().replaceChild(oldName.getNode(), newName.getNode()); return null; }

Target:
public PsiElement setName(@NotNull String name) throws IncorrectOperationException { checkSetName(name); final PsiElement oldName = getNameIdentifier(); assert oldName != null; PsiElement newName = GLSLPsiElementFactory.createLeafElement(getProject(), name); getNode().replaceChild(oldName.getNode(), newName.getNode()); return this; }
Source:
public void testUnaryFunctionsParsingUnsuccessful() throws Exception { for (String function : unaryFunctions) { testFunctionParsingUnsuccessful(function, failingUnaryFunctionExpressions); } }

Target:
public void testUnaryFunctionsParsingUnsuccessful() { for (String function : unaryFunctions) { testFunctionParsingUnsuccessful(function, failingUnaryFunctionExpressions); } }
Source:
void destroyDOMElementResources() { for (GridColumn<?> column : model.getColumns()) { if (column.getColumnRenderer() instanceof HasDOMElementResources) { ((HasDOMElementResources) column.getColumnRenderer()).destroyResources(); } } }

Target:
private void destroyDOMElementResources() { for (GridColumn<?> column : model.getColumns()) { if (column.getColumnRenderer() instanceof HasDOMElementResources) { ((HasDOMElementResources) column.getColumnRenderer()).destroyResources(); } } }
Source:
public void testPrepareStepExecutionTableWithoutExitDescription() { final JobExecution jobExecution = new JobExecution(1L, null, "hello"); jobExecution.getJobConfigurationName(); final StepExecution stepExecution = new StepExecution("coolStep", jobExecution, 333L); final Date startTime = new DateTime(2014, 05, 01, 15, 0).toDate(); final Date endTime = new DateTime(2014, 05, 01, 15, 1).toDate(); final Date lastUpdated = new DateTime(2014, 05, 05, 1, 0).toDate(); stepExecution.setStartTime(startTime); stepExecution.setEndTime(endTime); stepExecution.setLastUpdated(lastUpdated); stepExecution.setStatus(BatchStatus.COMPLETED); stepExecution.setExitStatus(ExitStatus.COMPLETED); final StepExecutionInfoResource stepExecutionInfoResource = new StepExecutionInfoResource(444L, stepExecution); final Table table = JobCommandsUtils.prepareStepExecutionTable(stepExecutionInfoResource); assertEquals("Exit Description", table.getRows().get(18).getValue(1)); assertEquals("N/A", table.getRows().get(18).getValue(2)); }

Target:
public void testPrepareStepExecutionTableWithoutExitDescription() { final JobExecution jobExecution = new JobExecution(1L, null, "hello"); jobExecution.getJobConfigurationName(); final StepExecution stepExecution = new StepExecution("coolStep", jobExecution, 333L); final Date startTime = new DateTime(2014, 05, 01, 15, 0).toDate(); final Date endTime = new DateTime(2014, 05, 01, 15, 1).toDate(); final Date lastUpdated = new DateTime(2014, 05, 05, 1, 0).toDate(); stepExecution.setStartTime(startTime); stepExecution.setEndTime(endTime); stepExecution.setLastUpdated(lastUpdated); stepExecution.setStatus(BatchStatus.COMPLETED); stepExecution.setExitStatus(ExitStatus.COMPLETED); final StepExecutionInfoResource stepExecutionInfoResource = new StepExecutionInfoResource(444L, stepExecution); final Table table = JobCommandsUtils.prepareStepExecutionTable(stepExecutionInfoResource); assertEquals("Exit Description", table.getRows().get(17).getValue(1)); assertEquals("N/A", table.getRows().get(17).getValue(2)); }
Source:
public String toString() { String lower = this.lowerBound.getValue().map(Object::toString).map(it -> { if (this.lowerBound.isInclusive()) { return "[".concat(it); } return "(".concat(it); }).orElse("unbounded"); String upper = this.upperBound.getValue().map(Object::toString).map(it -> { if (this.upperBound.isInclusive()) { return it.concat("]"); } return it.concat(")"); }).orElse("unbounded"); return String.format("%s-%s", lower, upper); }

Target:
public String toString() { return String.format("%s-%s", lowerBound.toPrefixString(), upperBound.toSuffixString()); }
Source:
protected Runnable getSessionTask() { return new Runnable() { @Override public void run() { sessions.pulse(); } }; }

Target:
protected Runnable getSessionTask() { return sesionTask; }
Source:
private Optional<Response> checkProducerSequence( final HttpServletRequest req, final String responseContentType, final ObjectMapper responseMapper ) { final String producerId = req.getHeader("X-Firehose-Producer-Id"); if (producerId == null) { return Optional.empty(); } final String sequenceValue = req.getHeader("X-Firehose-Producer-Seq"); if (sequenceValue == null) { return Optional.of( Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", "Producer sequence value is missing")) .build() ); } Long producerSequence = producerSequences.computeIfAbsent(producerId, key -> Long.MIN_VALUE); try { Long newSequence = Long.parseLong(sequenceValue); if (newSequence <= producerSequence) { return Optional.of( Response.ok( responseMapper.writeValueAsString( ImmutableMap.of("eventCount", 0, "skipped", true) ), responseContentType ).build() ); } producerSequences.put(producerId, newSequence); } catch (JsonProcessingException ex) { throw Throwables.propagate(ex); } catch (NumberFormatException ex) { return Optional.of( Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", "Producer sequence must be a number")) .build() ); } return Optional.empty(); }

Target:
private Optional<Response> checkProducerSequence( final HttpServletRequest req, final String responseContentType, final ObjectMapper responseMapper ) { final String producerId = req.getHeader("X-Firehose-Producer-Id"); if (producerId == null) { return Optional.empty(); } final String sequenceValue = req.getHeader("X-Firehose-Producer-Seq"); if (sequenceValue == null) { return Optional.of( Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", "Producer sequence value is missing")) .build() ); } Long producerSequence = producerSequences.computeIfAbsent(producerId, key -> Long.MIN_VALUE); if (producerSequences.size() >= MAX_FIREHOSE_PRODUCERS) { return Optional.of( Response.status(Response.Status.FORBIDDEN) .entity( ImmutableMap.<String, Object>of( "error", "Too many individual producer IDs for this firehose. Max is " + MAX_FIREHOSE_PRODUCERS ) ) .build() ); } try { Long newSequence = Long.parseLong(sequenceValue); if (newSequence <= producerSequence) { return Optional.of( Response.ok( responseMapper.writeValueAsString( ImmutableMap.of("eventCount", 0, "skipped", true) ), responseContentType ).build() ); } producerSequences.put(producerId, newSequence); } catch (JsonProcessingException ex) { throw Throwables.propagate(ex); } catch (NumberFormatException ex) { return Optional.of( Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", "Producer sequence must be a number")) .build() ); } return Optional.empty(); }
Source:
protected void mapAndProcess(Object eventObject, InputEventHandler inputEventHandler) throws InterruptedException { synchronized (this) { Object convertedEvent; convertedEvent = convertToEvent(eventObject); if (convertedEvent != null) { if (convertedEvent instanceof Event[]) { inputEventHandler.sendEvents((Event[]) convertedEvent); } else { inputEventHandler.sendEvent((Event) convertedEvent); } } } }

Target:
protected void mapAndProcess(Object eventObject, InputEventHandler inputEventHandler) throws InterruptedException { Object convertedEvent; convertedEvent = convertToEvent(eventObject); if (convertedEvent != null) { if (convertedEvent instanceof Event[]) { inputEventHandler.sendEvents((Event[]) convertedEvent); } else { inputEventHandler.sendEvent((Event) convertedEvent); } } }
Source:
private static List<Rule> getRules(VElement renderable) { final HashMap<Class<? extends Rule>, Rule> rules = new HashMap<Class<? extends Rule>, Rule>(); for (final VAttachment attachment : renderable.getAttachments()) { if (Rule.class.isInstance(attachment)) { final Rule rule = (Rule) attachment; if (!rules.containsKey(rule.getClass())) { rules.put(rule.getClass(), rule); } } } return new ArrayList<Rule>(rules.values()); }

Target:
private static Collection<Rule> getRules(VElement renderable) { final Map<Class<? extends Rule>, Rule> rules = new HashMap<Class<? extends Rule>, Rule>(); for (final VAttachment attachment : renderable.getAttachments()) { if (Rule.class.isInstance(attachment)) { final Rule rule = (Rule) attachment; if (!rules.containsKey(rule.getClass())) { rules.put(rule.getClass(), rule); } } } return rules.values(); }
Source:
private Map<String, String> extractMetadata(File src) { Reader reader = null; InputStream in = null; BufferedReader buf = null; StringBuffer log = null; Process proc = null; Map<String, String> metadata = new HashMap<String, String>(); try { List<String> cmd = new ArrayList<>(); cmd.add( command ); if (src.length() > MAX_FILESIZE) { cmd.add( "-api" ); cmd.add( "largefilesupport=1" ); } cmd.add( src.getAbsolutePath()); log = new StringBuffer(); ProcessBuilder pb = new ProcessBuilder(cmd); pb.redirectErrorStream(true); proc = pb.start(); in = proc.getInputStream(); reader = new InputStreamReader(in); buf = new BufferedReader(reader); for ( String line = null; (line=buf.readLine()) != null; ) { String[] pair = line.split("\\:", 2); String v = ""; if (pair.length == 2) v = StringUtils.isBlank(pair[1]) ? "" : pair[1].trim(); addMetadata(metadata, pair[0].trim(), v); } int status = proc.waitFor(); if ( status != 0 ) { in = proc.getErrorStream(); reader = new InputStreamReader(in); buf = new BufferedReader(reader); for ( String line = null; (line=buf.readLine()) != null; ) log.append( line + "\n" ); addMetadata(metadata, ERROR, log.toString()); } } catch ( Exception ex ) { ex.printStackTrace(); addMetadata(metadata, ERROR, ex.getMessage()); } finally { DAMSClient.close(in); DAMSClient.close(reader); DAMSClient.close(buf); if(proc != null) { proc.destroy(); proc = null; } } return metadata; }

Target:
private Map<String, String> extractMetadata(File src) { Reader reader = null; InputStream in = null; BufferedReader buf = null; StringBuffer log = null; Process proc = null; Map<String, String> metadata = new HashMap<String, String>(); try { List<String> cmd = new ArrayList<>(); cmd.add( command ); cmd.add( "-api" ); cmd.add( "largefilesupport=1" ); cmd.add( src.getAbsolutePath()); log = new StringBuffer(); ProcessBuilder pb = new ProcessBuilder(cmd); pb.redirectErrorStream(true); proc = pb.start(); in = proc.getInputStream(); reader = new InputStreamReader(in); buf = new BufferedReader(reader); for ( String line = null; (line=buf.readLine()) != null; ) { String[] pair = line.split("\\:", 2); String v = ""; if (pair.length == 2) v = StringUtils.isBlank(pair[1]) ? "" : pair[1].trim(); addMetadata(metadata, pair[0].trim(), v); } int status = proc.waitFor(); if ( status != 0 ) { in = proc.getErrorStream(); reader = new InputStreamReader(in); buf = new BufferedReader(reader); for ( String line = null; (line=buf.readLine()) != null; ) log.append( line + "\n" ); addMetadata(metadata, ERROR, log.toString()); } } catch ( Exception ex ) { ex.printStackTrace(); addMetadata(metadata, ERROR, ex.getMessage()); } finally { DAMSClient.close(in); DAMSClient.close(reader); DAMSClient.close(buf); if(proc != null) { proc.destroy(); proc = null; } } return metadata; }
Source:
public void scaleForErrorMarginDoesNotReduceAlreadySmallTimeouts() { assertThat(BlockingTimeouts.scaleForErrorMargin(FIVE, TEST_ERROR_MARGIN)) .isGreaterThan(0) .isEqualTo(FIVE); }

Target:
public void scaleForErrorMarginDoesNotReduceAlreadySmallTimeouts() { assertThat(BlockingTimeouts.scaleForErrorMargin(FIVE, TEST_ERROR_MARGIN)) .isEqualTo(FIVE); }
Source:
public void prepare(String name) { String testDir = CommonsTestingUtil.tmpDirectory(name); Util.recursiveFileRemove(testDir); rootDir = new File(testDir); confDir = new File(rootDir, Server.DEFAULT_SERVER_CONFIG); if (!confDir.mkdirs()) { throw new RuntimeException("Failed to create server configuration directory " + confDir); } URL configurationFileURL; if (DEFAULT_INFINISPAN_CONFIG_FILES.contains(configuration.configurationFile())) { configurationFileURL = getClass().getClassLoader().getResource(configuration.configurationFile()); } else if (new File(configuration.configurationFile()).isAbsolute()) { configurationFileURL = Exceptions.unchecked(() -> new File(configuration.configurationFile()).toURI().toURL()); } else { configurationFileURL = getClass().getClassLoader().getResource(configuration.configurationFile()); } if (configurationFileURL == null) { throw new RuntimeException("Cannot find test configuration file: " + configuration.configurationFile()); } try { if (DEFAULT_INFINISPAN_CONFIG_FILES.contains(configuration.configurationFile())) { InputStream resourceAsStream = getClass().getClassLoader() .getResourceAsStream(configuration.configurationFile()); Path target = Paths.get(confDir.getAbsolutePath(), configuration.configurationFile()); Files.copy(resourceAsStream, target); } else { Path configurationFilePath = Paths.get(configurationFileURL.toURI()); Util.recursiveDirectoryCopy(configurationFilePath.getParent(), confDir.toPath()); } } catch (Exception e) { throw new RuntimeException(e); } createUserFile("default"); createKeyStores(); }

Target:
public void prepare(String name) { String testDir = CommonsTestingUtil.tmpDirectory(name); Util.recursiveFileRemove(testDir); rootDir = new File(testDir); confDir = new File(rootDir, Server.DEFAULT_SERVER_CONFIG); if (!confDir.mkdirs()) { throw new RuntimeException("Failed to create server configuration directory " + confDir); } if(!configuration.isDefaultFile()) { copyProvidedServerConfigurationFile(); } createUserFile("default"); createKeyStores(); }
Source:
public static Geopoint createGeopoint(final String latDir, final String latDeg, final String latDegFrac, final String lonDir, final String lonDeg, final String lonDegFrac) { double lat = Double.parseDouble(latDeg + "." + addZeros(Integer.parseInt(latDegFrac), 5)); double lon = Double.parseDouble(lonDeg + "." + addZeros(Integer.parseInt(lonDegFrac), 5)); lat *= "S".equalsIgnoreCase(latDir) ? -1 : 1; lon *= "W".equalsIgnoreCase(lonDir) ? -1 : 1; return new Geopoint(lat, lon); }

Target:
public static Geopoint createGeopoint(final String latDir, final String latDeg, final String latDegFrac, final String lonDir, final String lonDeg, final String lonDegFrac) { double lat = 0.0d; double lon = 0.0d; try { lat = Double.parseDouble(latDeg + "." + addZeros(Integer.parseInt(latDegFrac), 5)); lon = Double.parseDouble(lonDeg + "." + addZeros(Integer.parseInt(lonDegFrac), 5)); } catch (NumberFormatException e) { } lat *= "S".equalsIgnoreCase(latDir) ? -1 : 1; lon *= "W".equalsIgnoreCase(lonDir) ? -1 : 1; return new Geopoint(lat, lon); }
Source:
private void setMeasurementDataAsOutOfSync( final Map<Integer, List<Integer>> targetsByInput, final Set<Phenotype> inputPhenotypes) { if (!targetsByInput.isEmpty()) { final Set<Integer> observationUnitIdOutOfSync = new HashSet<>(); final Set<Integer> targetVariableIdOutOfSync = new HashSet<>(); for (final Phenotype phenotype : inputPhenotypes) { if (phenotype.isChanged()) { observationUnitIdOutOfSync.add(phenotype.getExperiment().getNdExperimentId()); final List<Integer> targetsOutOfSync = targetsByInput.get(phenotype.getObservableId()); if (targetsOutOfSync != null) { targetVariableIdOutOfSync.addAll(targetsOutOfSync); } } } this.updatePhenotypesStatus(targetVariableIdOutOfSync, observationUnitIdOutOfSync); } }

Target:
private void setMeasurementDataAsOutOfSync( final Map<Integer, List<Integer>> targetsByInput, final Set<Phenotype> inputPhenotypes) { if (!targetsByInput.isEmpty()) { final Set<Integer> observationUnitIdOutOfSync = new HashSet<>(); final Set<Integer> targetVariableIdOutOfSync = new HashSet<>(); for (final Phenotype phenotype : inputPhenotypes) { if (phenotype.isChanged()) { observationUnitIdOutOfSync.add(phenotype.getExperiment().getNdExperimentId()); final List<Integer> targetsOutOfSync = targetsByInput.get(phenotype.getObservableId()); if (targetsOutOfSync != null) { targetVariableIdOutOfSync.addAll(targetsOutOfSync); } } } this.updateOutOfSyncPhenotypes(targetVariableIdOutOfSync, observationUnitIdOutOfSync); } }
Source:
public void testMultipleAcceptEncodingHeaders() { FullHttpRequest request = newRequest(); request.headers().set(HttpHeaderNames.ACCEPT_ENCODING, "unknown") .add(HttpHeaderNames.ACCEPT_ENCODING, "gzip") .add(HttpHeaderNames.ACCEPT_ENCODING, "deflate"); EmbeddedChannel ch = new EmbeddedChannel(new HttpContentCompressor()); ch.writeInbound(request); FullHttpResponse res = new DefaultFullHttpResponse( HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer("Gzip Win", CharsetUtil.US_ASCII)); ch.writeOutbound(res); assertEncodedResponse(ch); HttpContent c = ch.readOutbound(); assertThat(ByteBufUtil.hexDump(c.content()), is("1f8b080000000000000072afca2c5008cfcc03000000ffff")); c.release(); c = ch.readOutbound(); assertThat(ByteBufUtil.hexDump(c.content()), is("03001f2ebf0f08000000")); c.release(); LastHttpContent last = ch.readOutbound(); assertThat(last.content().readableBytes(), is(0)); last.release(); assertThat(ch.readOutbound(), is(nullValue())); assertTrue(ch.finishAndReleaseAll()); }

Target:
public void testMultipleAcceptEncodingHeaders() { FullHttpRequest request = newRequest(); request.headers().set(HttpHeaderNames.ACCEPT_ENCODING, "unknown; q=1.0") .add(HttpHeaderNames.ACCEPT_ENCODING, "gzip; q=0.5") .add(HttpHeaderNames.ACCEPT_ENCODING, "deflate; q=0"); EmbeddedChannel ch = new EmbeddedChannel(new HttpContentCompressor()); assertTrue(ch.writeInbound(request)); FullHttpResponse res = new DefaultFullHttpResponse( HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer("Gzip Win", CharsetUtil.US_ASCII)); assertTrue(ch.writeOutbound(res)); assertEncodedResponse(ch); HttpContent c = ch.readOutbound(); assertThat(ByteBufUtil.hexDump(c.content()), is("1f8b080000000000000072afca2c5008cfcc03000000ffff")); c.release(); c = ch.readOutbound(); assertThat(ByteBufUtil.hexDump(c.content()), is("03001f2ebf0f08000000")); c.release(); LastHttpContent last = ch.readOutbound(); assertThat(last.content().readableBytes(), is(0)); last.release(); assertThat(ch.readOutbound(), is(nullValue())); assertTrue(ch.finishAndReleaseAll()); }
Source:
public Optional<ItemType> getRepairItemType() { switch (name) { case "diamond": return Optional.of(ItemTypes.DIAMOND); case "gold": return Optional.of(ItemTypes.GOLD_INGOT); case "leather": return Optional.of(ItemTypes.LEATHER); case "iron": return Optional.of(ItemTypes.IRON_INGOT); default: return Optional.empty(); } }

Target:
public Optional<ItemType> getRepairItemType() { if (this.repairItemType == null) { this.repairItemType = Optional.ofNullable((ItemType) shadow$getRepairItem()); } return this.repairItemType; }
Source:
private void restoreMetaData(final String objectName, final Metadata metadata) { final String osName = System.getProperty("os.name"); final MetaDataRestore metaDataRestore = new MetaDataRestoreFactory().getOSSpecificMetadataRestore(metadata, objectName, osName,metaDataRestoreListener); metaDataRestore.restoreOSName(); metaDataRestore.restoreUserAndOwner(); metaDataRestore.restoreFileTimes(); metaDataRestore.restorePermissions(); if (metaDataRestore instanceof WindowsMetaDataRestore) { ((WindowsMetaDataRestore) metaDataRestore).restoreFlags(); } }

Target:
private void restoreMetaData(final String objectName, final Metadata metadata) { final String osName = System.getProperty("os.name"); final MetadataRestore metadataRestore = new MetadataRestoreFactory().getOSSpecificMetadataRestore(metadata, objectName, osName, metadataRestoreListener); metadataRestore.restoreOSName(); metadataRestore.restoreUserAndOwner(); metadataRestore.restoreFileTimes(); metadataRestore.restorePermissions(); }
Source:
public void meshProxy_exactlyOneUri() throws Exception { ServiceConfiguration invalidServiceConfig = ServiceConfiguration.builder() .uris(ImmutableList.of("uri1", "uri2")) .security(SslConfiguration.of(Paths.get("src/test/resources/trustStore.jks"))) .proxy(ProxyConfiguration.mesh("localhost:1234")) .maxNumRetries(0) .build(); assertThatThrownBy(() -> ClientConfigurations.of(invalidServiceConfig)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("If meshProxy is configured then uris must contain exactly 1 URI"); }

Target:
public void meshProxy_exactlyOneUri() throws Exception { assertThatThrownBy(() -> ClientConfigurations.of(meshProxyServiceConfig(ImmutableList.of("uri1", "uri2"), 0))) .isInstanceOf(IllegalArgumentException.class) .hasMessage("If meshProxy is configured then uris must contain exactly 1 URI"); }
Source:
public void rebuildDB() { Set<Long> staleDataSources = getStaleDataSourceIds(); if (!staleDataSources.isEmpty()) { staleDataSources.forEach((id) -> { queueDBTask(new CopyAnalyzedFiles(id, instance, db, sleuthKitCase)); }); } }

Target:
public void rebuildDB() { getStaleDataSourceIds().forEach((dataSourceObjId) -> { queueDBTask(new CopyAnalyzedFiles(dataSourceObjId, instance, db, sleuthKitCase)); }); }
Source:
void testRemoveFields(boolean addToAvailable, boolean definitionHasFields) { if (definitionHasFields) { when(formDefinition.getFields()).thenReturn(new ArrayList<>(employeeFields)); content.setDefinition(formDefinition); } int prevAvailableSize = formEditorHelper.getAvailableFields().size(); FieldDefinition removedField = formEditorHelper.removeField(nameField.getId(), addToAvailable); assertEquals("It should " + (addToAvailable ? " " : "not ") + "add the field to the available fields", formEditorHelper.getAvailableFields().size(), prevAvailableSize + (addToAvailable && definitionHasFields ? 1 : 0)); assertFalse("Removed field should " + (definitionHasFields ? "not " : " ") + "be null", (removedField == null) == definitionHasFields); }

Target:
private void testRemoveFields(boolean addToAvailable, boolean definitionHasFields) { if (definitionHasFields) { when(formDefinition.getFields()).thenReturn(new ArrayList<>(employeeFields)); content.setDefinition(formDefinition); } int prevAvailableSize = formEditorHelper.getAvailableFields().size(); FieldDefinition removedField = formEditorHelper.removeField(nameField.getId(), addToAvailable); assertEquals("It should " + (addToAvailable ? " " : "not ") + "add the field to the available fields", formEditorHelper.getAvailableFields().size(), prevAvailableSize + (addToAvailable && definitionHasFields ? 1 : 0)); assertFalse("Removed field should " + (definitionHasFields ? "not " : " ") + "be null", (removedField == null) == definitionHasFields); }
Source:
public Opt<Identity> enter(final Request req) throws IOException { final Iterator<String> headers = new RqHeaders.Base(req) .header(this.header).iterator(); Opt<Identity> user = new Opt.Empty<>(); String head = ""; while (headers.hasNext()) { final String nexthead = headers.next(); final UncheckedText trimmed = new UncheckedText( new Trimmed(new TextOf(nexthead)) ); if (trimmed.asString().startsWith("Bearer")) { head = nexthead; break; } } final String dot = "\\."; if (!head.isEmpty()) { final String jwt = new UncheckedText( new Trimmed(new TextOf(head.split(" ", 2)[1])) ).asString(); final String[] parts = jwt.split(dot); final byte[] jwtheader = parts[0].getBytes( Charset.defaultCharset() ); final byte[] jwtpayload = parts[1].getBytes( Charset.defaultCharset() ); final byte[] jwtsign = parts[2].getBytes(Charset.defaultCharset()); final ByteBuffer tocheck = ByteBuffer.allocate( jwtheader.length + jwtpayload.length + 1 ); tocheck.put(jwtheader).put(".".getBytes(Charset.defaultCharset())) .put(jwtpayload); final byte[] checked = this.signature.sign(tocheck.array()); if (Arrays.equals(jwtsign, checked)) { try (JsonReader rdr = Json.createReader( new StringReader( new String( Base64.getDecoder().decode(jwtpayload), Charset.defaultCharset() ) ) )) { user = new Opt.Single<>( new Identity.Simple( rdr.readObject().getString(Token.Jwt.SUBJECT) ) ); } } } return user; }

Target:
public Opt<Identity> enter(final Request req) throws IOException { Opt<Identity> user = new Opt.Empty<>(); final UncheckedText head = new Unchecked<>( new FirstOf<>( text -> new Trimmed(text).asString().startsWith("Bearer"), new Mapped<>( UncheckedText::new, new RqHeaders.Base(req).header(this.header) ), new Constant<>(new UncheckedText("")) ) ).value(); if (new Unchecked<>(new Not(new IsBlank(head))).value()) { final String jwt = new UncheckedText( new Trimmed(new TextOf(head.asString().split(" ", 2)[1])) ).asString(); final String[] parts = jwt.split("\\."); final byte[] jwtheader = parts[0].getBytes( Charset.defaultCharset() ); final byte[] jwtpayload = parts[1].getBytes( Charset.defaultCharset() ); final byte[] jwtsign = parts[2].getBytes(Charset.defaultCharset()); final ByteBuffer tocheck = ByteBuffer.allocate( jwtheader.length + jwtpayload.length + 1 ); tocheck.put(jwtheader).put(".".getBytes(Charset.defaultCharset())) .put(jwtpayload); final byte[] checked = this.signature.sign(tocheck.array()); if (Arrays.equals(jwtsign, checked)) { try (JsonReader rdr = Json.createReader( new StringReader( new String( Base64.getDecoder().decode(jwtpayload), Charset.defaultCharset() ) ) )) { user = new Opt.Single<>( new Identity.Simple( rdr.readObject().getString(Token.Jwt.SUBJECT) ) ); } } } return user; }
Source:
public static QName valueOf(final String qNameAsString) { if (qNameAsString == null) { throw new IllegalArgumentException( "cannot create QName from \"null\" or \"\" String"); } if (qNameAsString.length() == 0) { return new javax.xml.namespace.QName(XMLConstants.NULL_NS_URI, qNameAsString, XMLConstants.DEFAULT_NS_PREFIX); } if (qNameAsString.charAt(0) != '{') { return new javax.xml.namespace.QName(XMLConstants.NULL_NS_URI, qNameAsString, XMLConstants.DEFAULT_NS_PREFIX); } if (qNameAsString.startsWith("{" + XMLConstants.NULL_NS_URI + "}")) { throw new IllegalArgumentException( "Namespace URI .equals(XMLConstants.NULL_NS_URI), " + ".equals(\"" + XMLConstants.NULL_NS_URI + "\"), " + "only the local part, " + "\"" + qNameAsString.substring(2 + XMLConstants.NULL_NS_URI.length()) + "\", " + "should be provided."); } int endOfNamespaceURI = qNameAsString.indexOf('}'); if (endOfNamespaceURI == -1) { throw new IllegalArgumentException( "cannot create QName from \"" + qNameAsString + "\", missing closing \"}\""); } return new javax.xml.namespace.QName(qNameAsString.substring(1, endOfNamespaceURI), qNameAsString.substring(endOfNamespaceURI + 1), XMLConstants.DEFAULT_NS_PREFIX); }

Target:
public static QName valueOf(final String qNameAsString) { if (Objects.isNull(qNameAsString)) { throw new IllegalArgumentException("cannot create QName from \"null\""); } if (qNameAsString.length() == 0) { return new javax.xml.namespace.QName(XMLConstants.NULL_NS_URI, qNameAsString, XMLConstants.DEFAULT_NS_PREFIX); } if (qNameAsString.charAt(0) != '{') { return new javax.xml.namespace.QName(XMLConstants.NULL_NS_URI, qNameAsString, XMLConstants.DEFAULT_NS_PREFIX); } if (qNameAsString.startsWith("{" + XMLConstants.NULL_NS_URI + "}")) { throw new IllegalArgumentException("Namespace URI .equals(XMLConstants.NULL_NS_URI), " + ".equals(\"" + XMLConstants.NULL_NS_URI + "\"), " + "only the local part, " + "\"" + qNameAsString.substring(2 + XMLConstants.NULL_NS_URI.length()) + "\", " + "should be provided."); } final int endOfNamespaceURI = qNameAsString.indexOf('}'); if (endOfNamespaceURI == -1) { throw new IllegalArgumentException("cannot create QName from \"" + qNameAsString + "\", missing closing \"}\""); } return new javax.xml.namespace.QName(qNameAsString.substring(1, endOfNamespaceURI), qNameAsString.substring(endOfNamespaceURI + 1), XMLConstants.DEFAULT_NS_PREFIX); }
Source:
public static Ds3ClientHelpers.Job getLoadJob(final Ds3Client client, final String bucketName, final String resourceBaseName) throws IOException, SignatureException, XmlProcessingException, URISyntaxException { final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); final List<Ds3Object> objects = new ArrayList<>(); for(final String book : BOOKS) { final Path objFile = ResourceUtils.loadFileResource(resourceBaseName + book); final Ds3Object obj = new Ds3Object(book, Files.size(objFile)); objects.add(obj); } return helpers .startWriteJob(bucketName, objects); }

Target:
public static Ds3ClientHelpers.Job getLoadJob(final Ds3Client client, final String bucketName, final String resourceBaseName) throws IOException, SignatureException, XmlProcessingException, URISyntaxException { final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); final List<Ds3Object> objects = new ArrayList<>(); for(final String book : BOOKS) { final Path objPath = ResourceUtils.loadFileResource(resourceBaseName + book); final Ds3Object obj = new Ds3Object(book, Files.size(objPath)); objects.add(obj); } return helpers .startWriteJob(bucketName, objects); }
Source:
public String toString() { return "SampleTissueDto [bioBankId=" + bioBankId + ", cellularity=" + cellularity + ", createdById=" + createdById + ", createdByUrl=" + createdByUrl + ", creationDate=" + creationDate + ", id=" + id + ", labUrl=" + labUrl + ", instituteTissueName=" + instituteTissueName + ", lastUpdated=" + lastUpdated + ", updatedById=" + updatedById + ", updatedByUrl=" + updatedByUrl + ", url=" + url + "]"; }

Target:
public String toString() { return "SampleTissueDto [bioBankId=" + bioBankId + ", cellularity=" + cellularity + ", createdById=" + createdById + ", createdByUrl=" + createdByUrl + ", creationDate=" + creationDate + ", id=" + id + ", instituteTissueName=" + instituteTissueName + ", lastUpdated=" + lastUpdated + ", updatedById=" + updatedById + ", updatedByUrl=" + updatedByUrl + ", url=" + url + "]"; }
Source:
public boolean writeOutbound(Object... msgs) { ensureOpen(); if (msgs.length == 0) { return isNotEmpty(outboundMessages); } RecyclableArrayList futures = RecyclableArrayList.newInstance(msgs.length); try { for (Object m: msgs) { if (m == null) { break; } futures.add(write(m)); } flushOutbound0(); for (Object o : futures) { ChannelFuture future = (ChannelFuture) o; if (future.isDone()) { recordException(future); } else { future.addListener(recordExceptionListener); } } checkException(); return isNotEmpty(outboundMessages); } finally { futures.recycle(); } }

Target:
public boolean writeOutbound(Object... msgs) { ensureOpen(); if (msgs.length == 0) { return isNotEmpty(outboundMessages); } RecyclableArrayList futures = RecyclableArrayList.newInstance(msgs.length); try { for (Object m: msgs) { if (m == null) { break; } futures.add(write(m)); } flushOutbound0(); int size = futures.size(); for (int i = 0; i < size; i++) { ChannelFuture future = (ChannelFuture) futures.get(i); if (future.isDone()) { recordException(future); } else { future.addListener(recordExceptionListener); } } checkException(); return isNotEmpty(outboundMessages); } finally { futures.recycle(); } }
Source:
public RuleChain around(TestRule enclosedRule) { if (enclosedRule == null) { throw new IllegalArgumentException("The enclosed rule should not be null"); } List<TestRule> rulesOfNewChain = new ArrayList<TestRule>(); rulesOfNewChain.add(enclosedRule); rulesOfNewChain.addAll(rulesStartingWithInnerMost); return new RuleChain(rulesOfNewChain); }

Target:
public RuleChain around(TestRule enclosedRule) { if (enclosedRule == null) { throw new NullPointerException("The enclosed rule must not be null"); } List<TestRule> rulesOfNewChain = new ArrayList<TestRule>(); rulesOfNewChain.add(enclosedRule); rulesOfNewChain.addAll(rulesStartingWithInnerMost); return new RuleChain(rulesOfNewChain); }
Source:
protected Object getOutputValueForAccessor(String field, Object input) { if (field != null && (field.equals("Result") || field.equals("Standalone")) && input == null) { return false; } return input; }

Target:
protected Object getOutputValueForAccessor(String field, Object input) { return input; }
Source:
public void testRemoveSite(String opHost, String redirectUrl) throws Exception { final DevelopersApi api = Tester.api(); RegisterSiteResponseData response = RegisterSiteTest.registerSite(api, opHost, redirectUrl); String oxdId = response.getOxdId(); RemoveSiteParams params = new RemoveSiteParams(); params.setOxdId(oxdId); ApiResponse<UpdateSiteResponse> apiResponse = api.removeSiteWithHttpInfo(Tester.getAuthorization(), params); assertTrue(apiResponse.getStatusCode() == 200); assertNotNull(apiResponse); assertNotNull(apiResponse.getData()); UpdateSiteResponse removeSiteResponse = apiResponse.getData(); final UpdateSiteResponseData responseData = removeSiteResponse.getData(); assertNotNull(responseData); assertTrue(StringUtils.isNotEmpty(responseData.getOxdId())); }

Target:
public void testRemoveSite(String opHost, String redirectUrl) throws Exception { final DevelopersApi api = Tester.api(); RegisterSiteResponseData response = RegisterSiteTest.registerSite(api, opHost, redirectUrl); String oxdId = response.getOxdId(); RemoveSiteParams params = new RemoveSiteParams(); params.setOxdId(oxdId); RemoveSiteResponse removeSiteResp = api.removeSite(Tester.getAuthorization(), params); assertNotNull(removeSiteResp); final RemoveSiteResponseData responseData = removeSiteResp.getData(); assertNotNull(responseData); assertTrue(StringUtils.isNotEmpty(responseData.getOxdId())); }
Source:
public FindDialog(Window parent, boolean modal) throws HeadlessException { super(parent, modal); initialize(parent.toString()); }

Target:
public FindDialog(Window parent, boolean modal) throws HeadlessException { super(parent, modal); initialize(); }