auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createFullTextResource() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { String requestBody = getJsonStringInput(DESCRIBING_WEB_RESOURCE); Annotation storedAnno = createDescribing(requestBody); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.DESCRIBING.name().toLowerCase())); assertTrue(storedAnno.getTarget().getSource() != null); assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.TEXT.name()); }

Target:
public void createFullTextResource() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { String requestBody = getJsonStringInput(DESCRIBING_WEB_RESOURCE); ResponseEntity<String> response = getApiClient().createAnnotation( getApiKey(), WebAnnotationFields.PROVIDER_WEBANNO, null, true, requestBody, TEST_USER_TOKEN, null ); assertNotNull(response.getBody()); assertEquals(response.getStatusCode(), HttpStatus.CREATED); Annotation storedAnno = getApiClient().parseResponseBody(response); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.DESCRIBING.name().toLowerCase())); assertTrue(storedAnno.getTarget().getSource() != null); assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.TEXT.name()); }
Source:
public static void setup() { CliClientFactory.getClient(); dsOps = new DataSourcesOperations(client); dsNameValid = dsOps.createDataSource(VALID_URL); dsNameInvalid = dsOps.createDataSource(INVALID_URL); xaDsNameInvalid = dsOps.createXADataSource(INVALID_URL); xaDsNameValid = dsOps.createXADataSource(VALID_URL); client.reload(); }

Target:
public static void setup() { client = CliClientFactory.getClient(); dsOps = new DataSourcesOperations(client); dsNameValid = dsOps.createDataSource(VALID_URL); dsNameInvalid = dsOps.createDataSource(INVALID_URL); xaDsNameInvalid = dsOps.createXADataSource(INVALID_URL); xaDsNameValid = dsOps.createXADataSource(VALID_URL); client.reload(); }
Source:
public long getTime(String hostname) { try { NTPUDPClient timeClient = new NTPUDPClient(); timeClient.setDefaultTimeout(NTP_TIMEOUT); InetAddress inetAddress = InetAddress.getByName(hostname); TimeInfo timeInfo = timeClient.getTime(inetAddress); logger.debug("{} Got time update from: : {}", getThing().getUID().toString(), hostname, SDF.format(new Date(timeInfo.getReturnTime()))); updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE); return timeInfo.getReturnTime(); } catch (UnknownHostException uhe) { String msg = getThing().getUID().toString() + " the given hostname '" + hostname + "' of the timeserver is unknown -> returning current sytem time instead."; logger.info(msg); updateStatus(ThingStatus.ONLINE, ThingStatusDetail.COMMUNICATION_ERROR, msg); } catch (IOException ioe) { String msg = getThing().getUID().toString() + " couldn't establish network connection [host '" + hostname + "'] -> returning current sytem time instead."; logger.info(msg); updateStatus(ThingStatus.ONLINE, ThingStatusDetail.COMMUNICATION_ERROR, msg); } return System.currentTimeMillis(); }

Target:
public long getTime(String hostname) { try { NTPUDPClient timeClient = new NTPUDPClient(); timeClient.setDefaultTimeout(NTP_TIMEOUT); InetAddress inetAddress = InetAddress.getByName(hostname); TimeInfo timeInfo = timeClient.getTime(inetAddress); logger.debug("{} Got time update from: : {}", getThing().getUID().toString(), hostname, SDF.format(new Date(timeInfo.getReturnTime()))); updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE); return timeInfo.getReturnTime(); } catch (UnknownHostException uhe) { String msg = getThing().getUID().toString() + " the given hostname '" + hostname + "' of the timeserver is unknown -> returning current sytem time instead."; logger.debug(msg); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, msg); } catch (IOException ioe) { String msg = getThing().getUID().toString() + " couldn't establish network connection [host '" + hostname + "'] -> returning current sytem time instead."; logger.debug(msg); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, msg); } return System.currentTimeMillis(); }
Source:
protected String gtk_rgba_to_css_string (GdkRGBA rgba) { String color = "rgba(" + (int)(rgba.red * 255) + "," + (int)(rgba.green * 255) + "," + (int)(rgba.blue * 255) + "," + (int)(rgba.alpha * 255) + ")"; return color; }

Target:
String gtk_rgba_to_css_string (GdkRGBA rgba) { String color = "rgba(" + (int)(rgba.red * 255) + "," + (int)(rgba.green * 255) + "," + (int)(rgba.blue * 255) + "," + (int)(rgba.alpha * 255) + ")"; return color; }
Source:
public void provision(KubernetesEnvironment kubernetesEnvironment) throws InfrastructureException { for (ChePluginEndpoint endpoint : endpoints) {; if (Boolean.parseBoolean(endpoint.getAttributes().getOrDefault("discoverable", "true"))) { String serviceName = endpoint.getName(); Service service = createService(serviceName, podName, endpoint.getTargetPort()); Map<String, Service> services = kubernetesEnvironment.getServices(); if (!services.containsKey(serviceName)) { services.put(serviceName, service); } else { throw new InfrastructureException( format( "Applying of sidecar tooling failed. Kubernetes service with name '%s' already exists in the workspace environment.", serviceName)); } } } }

Target:
public void provision(KubernetesEnvironment kubernetesEnvironment) throws InfrastructureException { for (ChePluginEndpoint endpoint : endpoints) { if (!isDiscoverable(endpoint)) { continue; } String serviceName = endpoint.getName(); Service service = createService(serviceName, podName, endpoint.getTargetPort()); Map<String, Service> services = kubernetesEnvironment.getServices(); if (!services.containsKey(serviceName)) { services.put(serviceName, service); } else { throw new InfrastructureException( format( "Applying of sidecar tooling failed. Kubernetes service with name '%s' already exists in the workspace environment.", serviceName)); } } }
Source:
private Optional<String> getEncoding(InputStream in) throws IOException { InputStream inputStream = Objects.requireNonNull(in); if (!inputStream.markSupported()) { inputStream = new BufferedInputStream(inputStream); } CharsetDetector detector = new CharsetDetector(); detector.setText(inputStream); CharsetMatch charsetMatch = detector.detect(); return charsetMatch == null ? Optional.empty() : Optional.of(charsetMatch.getName()); }

Target:
private Optional<String> getEncoding(InputStream in) throws IOException { InputStream inputStream = in; if (!inputStream.markSupported()) { inputStream = new BufferedInputStream(inputStream); } CharsetDetector detector = new CharsetDetector(); detector.setText(inputStream); CharsetMatch charsetMatch = detector.detect(); return Optional.ofNullable(charsetMatch).map(CharsetMatch::getName); }
Source:
public void serialize(SliceOutput out) { super.serialize(out); for (int i = 0; i < super.getBucketCount(); ++i) { out.appendLong(breakdowns.get(i).size()); breakdowns.get(i).entrySet() .forEach(e -> { out.appendDouble(e.getKey()); out.appendLong(e.getValue()); }); } }

Target:
public void serialize(SliceOutput out) { super.serialize(out); for (int i = 0; i < super.getBucketCount(); ++i) { out.appendLong(breakdowns[i].getSize()); System.out.println("ser " + i + ": " + breakdowns[i].getSize()); Streams.stream(breakdowns[i].iterator()) .forEach(e -> { System.out.println("ser " + e.weight + "; " + e.count); out.appendDouble(e.weight); out.appendLong(e.count); }); } }
Source:
private String loadMapping(final Settings settings, final String key, final String keyDefault) { String mapping = settings.get(key); if(mapping != null && new File(mapping).exists()) { logger.info("Trying to load Kibana mapping for from plugin: {}", key, mapping); try { InputStream stream = new FileInputStream(mapping.toString()); return IOUtils.toString(stream); }catch(Exception e) { logger.error("Unable to load the Kibana mapping specified by {}: {}", key, mapping); } } logger.info("Loading default Kibana mapping for from plugin: {}", key, keyDefault); try { final ClassLoader classLoader = getClass().getClassLoader(); return IOUtils.toString(classLoader.getResourceAsStream(keyDefault)); }catch(Exception e) { logger.error("Unable to load the Kibana mapping specified by {}: {}", key, keyDefault); } return null; }

Target:
private String loadMapping(final Settings settings, final String key, final String keyDefault) { String mapping = settings.get(key); if(mapping != null && new File(mapping).exists()) { logger.info("Trying to load Kibana mapping for from plugin: {}", key, mapping); try { InputStream stream = new FileInputStream(mapping.toString()); return IOUtils.toString(stream); }catch(Exception e) { logger.error("Unable to load the Kibana mapping specified by {}: {}", key, e, mapping); } } logger.info("Loading default Kibana mapping for from plugin: {}", key, keyDefault); try { final ClassLoader classLoader = getClass().getClassLoader(); return IOUtils.toString(classLoader.getResourceAsStream(keyDefault)); }catch(Exception e) { logger.error("Unable to load the Kibana mapping specified by {}: {}", key, e, keyDefault); } return null; }
Source:
private void addRowDefinedValueTable(Table definedValueTable, final Node child) { TableItem item = new TableItem(definedValueTable, SWT.NONE); item.setData(Messages.NodeKey, child); final String initialName = child.getAttributes().getNamedItem(TmfXmlStrings.NAME).getNodeValue(); item.setText(0, initialName); item.setText(1, child.getAttributes().getNamedItem(TmfXmlStrings.VALUE).getNodeValue()); final Node colorNode = child.getAttributes().getNamedItem(TmfXmlStrings.COLOR); if (colorNode != null) { String stringColor = colorNode.getNodeValue(); final RGB oldRGB = new RGB(XmlManagerUtils.hexaToRed(stringColor), XmlManagerUtils.hexaToGreen(stringColor), XmlManagerUtils.hexaToBlue(stringColor)); item.setBackground(2, new Color(fproperties.getDisplay(), oldRGB)); } definedValueTable.layout(true, true); }

Target:
private void addRowDefinedValueTable(Table definedValueTable, final Node child) { TableItem item = new TableItem(definedValueTable, SWT.NONE); item.setData(Messages.NodeKey, child); final String initialName = child.getAttributes().getNamedItem(TmfXmlStrings.NAME).getNodeValue(); item.setText(0, initialName); item.setText(1, child.getAttributes().getNamedItem(TmfXmlStrings.VALUE).getNodeValue()); final Node colorNode = child.getAttributes().getNamedItem(TmfXmlStrings.COLOR); if (colorNode != null) { String stringColor = colorNode.getNodeValue(); int[] colorComponents = XmlAnalysisManagerUtils.hexaColorToInt(stringColor); if(colorComponents != null) { final RGB oldRGB = new RGB(colorComponents[0], colorComponents[1], colorComponents[2]); item.setBackground(2, colorManager.createColor(oldRGB)); } } definedValueTable.layout(true, true); }
Source:
private long unique(File... dirs) throws Exception { ArrayList<String> args = new ArrayList<>(Arrays.asList("-D", "mapred.job.tracker=local", "-D", "fs.default.name=file:/ for (File dir : dirs) { args.add(dir.toURI().toString()); } int ret = ToolRunner.run(new Unique(), args.toArray(new String[args.size()])); Assert.assertEquals(0, ret); return Unique.getNumUnique(); }

Target:
private int unique(File... dirs) throws Exception { ArrayList<String> args = new ArrayList<>(Arrays.asList("-D", "mapred.job.tracker=local", "-D", "fs.defaultFS=file:/ for (File dir : dirs) { args.add(dir.toURI().toString()); } int ret = ToolRunner.run(new Unique(), args.toArray(new String[args.size()])); Assert.assertEquals(0, ret); return Unique.getNumUnique(); }
Source:
public ArrayOfDoublesSketchTTestPostAggregator( @JsonProperty("name") final String name, @JsonProperty("fields") List<PostAggregator> fields ) { super(name, fields); if (fields.size() != 2) { throw new IAE("Illegal number of fields[%s], must be 2", fields.size()); } }

Target:
public ArrayOfDoublesSketchTTestPostAggregator( @JsonProperty("name") final String name, @JsonProperty("fields") List<PostAggregator> fields ) { super(name, fields); if (fields.size() != 2) { throw new IAE("Illegal number of fields[%d], must be 2", fields.size()); } }
Source:
public String getActualCpuTopology() { if (StringHelper.isNullOrEmpty(actualCpuTopology) || actualCpuTopology.equals("-1")) { return "N/A"; } else { return actualCpuTopology; } }

Target:
public String getActualCpuTopology() { if (StringHelper.isNullOrEmpty(actualCpuTopology) || actualCpuTopology.equals("-1")) { return ConstantsManager.getInstance().getConstants().notAvailableLabel(); } else { return actualCpuTopology; } }
Source:
private void checkZipContainsExactlyOneMainFile(Set<String> extensions) throws ActionParamsException { long mainFileExtensions = extensions.stream() .filter(FeatureCollectionParsers::hasByFileExt) .limit(2) .count(); if (mainFileExtensions == 0) { throw new ActionParamsException("Couldn't find valid file for import in zip file", UserLayerHandlerHelper.createErrorJSON("no_main_file")); } else if (mainFileExtensions == 2) { Set <String> mainExtensions = extensions.stream() .filter(FeatureCollectionParsers::hasByFileExt) .collect(Collectors.toCollection(HashSet::new)); throw new ActionParamsException("Found too many valid files for import in zip file", UserLayerHandlerHelper.createErrorJSON("multiple_main", "extensions", mainExtensions)); } }

Target:
private void checkZipContainsExactlyOneMainFile(Set<String> extensions) throws UserLayerException { long mainFileExtensions = extensions.stream() .filter(FeatureCollectionParsers::hasByFileExt) .limit(2) .count(); if (mainFileExtensions == 0) { throw new UserLayerException("Couldn't find valid file for import in zip file", UserLayerException.ErrorType.NO_FILE); } else if (mainFileExtensions == 2) { throw new UserLayerException("Found too many valid files for import in zip file", UserLayerException.ErrorType.MULTI_MAIN); } }
Source:
public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException{ Connection conn = connect(); Long matchingInstances = 0L; PreparedStatement preparedStatement = null; ResultSet resultSet = null; String sql = "SELECT count(*) FROM %s WHERE value=? AND reference_set_id=?"; String fileTableName = EamDbUtil.correlationTypeToReferenceTableName(getCorrelationTypeById(correlationTypeID)); try { preparedStatement = conn.prepareStatement(String.format(sql, fileTableName)); preparedStatement.setString(1, value); preparedStatement.setInt(2, referenceSetID); resultSet = preparedStatement.executeQuery(); resultSet.next(); matchingInstances = resultSet.getLong(1); } catch (SQLException ex) { throw new EamDbException("Error determining if file is in reference set.", ex); } finally { EamDbUtil.closePreparedStatement(preparedStatement); EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeConnection(conn); } return 0 < matchingInstances; }

Target:
public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException{ Connection conn = connect(); Long matchingInstances = 0L; PreparedStatement preparedStatement = null; ResultSet resultSet = null; String sql = "SELECT count(*) FROM %s WHERE value=? AND reference_set_id=?"; String fileTableName = EamDbUtil.correlationTypeToReferenceTableName(getCorrelationTypeById(correlationTypeID)); try { preparedStatement = conn.prepareStatement(String.format(sql, fileTableName)); preparedStatement.setString(1, value); preparedStatement.setInt(2, referenceSetID); resultSet = preparedStatement.executeQuery(); resultSet.next(); matchingInstances = resultSet.getLong(1); } catch (SQLException ex) { throw new EamDbException("Error determining if value (" + value + ") is in reference set " + referenceSetID, ex); } finally { EamDbUtil.closePreparedStatement(preparedStatement); EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeConnection(conn); } return 0 < matchingInstances; }
Source:
public void testGetJobTasksIdsPaginated() throws Throwable { int nbTasks = 50; String jobIdStr = "1"; JobState job = newMockedJob(jobIdStr, nbTasks); when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job); List<String> res = restInterface.getJobTasksIdsPaginated(sessionId, jobIdStr, 0, nbTasks); assertEquals("Number of tasks is incorrect", nbTasks, res.size()); for (int i = 0; i < nbTasks; i++) { assertEquals("Task readable name is incorrect", generateReadableName(jobIdStr, i, nbTasks), res.get(i)); } }

Target:
public void testGetJobTasksIdsPaginated() throws Throwable { int nbTasks = 50; String jobIdStr = "1"; JobState job = newMockedJob(jobIdStr, nbTasks); when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job); TaskIdsPage page = restInterface.getTasksNamesPaginated(sessionId, jobIdStr, 0, nbTasks); assertTasks(nbTasks, jobIdStr, page); }
Source:
public ClientStats getClientStats() { Map<String, Long> totalConnectionsPerHost = openChannels.stream().map(Channel::remoteAddress).filter(Objects::nonNull).filter(a -> a.getClass() == InetSocketAddress.class) .map(a -> (InetSocketAddress) a).map(InetSocketAddress::getHostString).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Map<String, Long> idleConnectionsPerHost = channelPool.getIdleChannelCountPerHost(); Map<String, HostStats> statsPerHost = totalConnectionsPerHost.entrySet().stream().collect(Collectors.toMap(Entry::getKey, entry -> { final long totalConnectionCount = entry.getValue(); final long idleConnectionCount = idleConnectionsPerHost.getOrDefault(entry.getKey(), 0L); final long activeConnectionCount = totalConnectionCount - idleConnectionCount; return new HostStats(activeConnectionCount, idleConnectionCount); })); return new ClientStats(statsPerHost); }

Target:
public ClientStats getClientStats() { Map<String, Long> totalConnectionsPerHost = openChannels.stream().map(Channel::remoteAddress).filter(a -> a instanceof InetSocketAddress) .map(a -> (InetSocketAddress) a).map(InetSocketAddress::getHostString).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Map<String, Long> idleConnectionsPerHost = channelPool.getIdleChannelCountPerHost(); Map<String, HostStats> statsPerHost = totalConnectionsPerHost.entrySet().stream().collect(Collectors.toMap(Entry::getKey, entry -> { final long totalConnectionCount = entry.getValue(); final long idleConnectionCount = idleConnectionsPerHost.getOrDefault(entry.getKey(), 0L); final long activeConnectionCount = totalConnectionCount - idleConnectionCount; return new HostStats(activeConnectionCount, idleConnectionCount); })); return new ClientStats(statsPerHost); }
Source:
private boolean pmwDtosCouldConvertCustomAttributesToPmwJavaClassAttributes(PaymentWorksVendor stgNewVendorRequestDetailToProcess) { if (stgNewVendorRequestDetailToProcess.isCustomFieldConversionErrors()) { return false; } else{ return true; } }

Target:
private boolean pmwDtosCouldConvertCustomAttributesToPmwJavaClassAttributes(PaymentWorksVendor stgNewVendorRequestDetailToProcess) { return !stgNewVendorRequestDetailToProcess.isCustomFieldConversionErrors(); }
Source:
static void rotateProc(long gesture, double angle, double angle_delta, long user_data) { if (OS.gtk_gesture_is_recognized(gesture)) { double delta = OS.gtk_gesture_rotate_get_angle_delta(gesture)*100; Control control = getControl(user_data); control.sendGestureEvent(0,SWT.GESTURE_ROTATE,0,0,delta); } }

Target:
static void rotateProc(long gesture, double angle, double angle_delta, long user_data) { if (OS.gtk_gesture_is_recognized(gesture)) { double delta = -(OS.gtk_gesture_rotate_get_angle_delta(gesture)*100); Control control = getControl(user_data); control.sendGestureEvent(0,SWT.GESTURE_ROTATE,0,0,delta); } }
Source:
public String getConsumerName() { return consumerName; }

Target:
public Optional<String> getConsumerName() { return Optional.ofNullable(consumerName); }
Source:
public Builder addFieldsFromPOJO(final Object pojo) { Class<? extends Object> clazz = pojo.getClass(); for (Field field : clazz.getDeclaredFields()) { Column column = field.getAnnotation(Column.class); if (column == null) { continue; } String fieldName = column.name(); if (isPublic(field)) { addFieldByAttribute(pojo, field, column, fieldName); } else { addFieldByMethod(pojo, clazz, field, column, fieldName); } } if (this.fields.isEmpty()) { throw new BuilderException("Class " + pojo.getClass().getName() + " has no @" + Column.class.getSimpleName() + " annotation"); } return this; }

Target:
public Builder addFieldsFromPOJO(final Object pojo) { Class<? extends Object> clazz = pojo.getClass(); for (Field field : clazz.getDeclaredFields()) { Column column = field.getAnnotation(Column.class); if (column == null) { continue; } field.setAccessible(true); String fieldName = column.name(); addFieldByAttribute(pojo, field, column, fieldName); } if (this.fields.isEmpty()) { throw new BuilderException("Class " + pojo.getClass().getName() + " has no @" + Column.class.getSimpleName() + " annotation"); } return this; }
Source:
public TransactionParser getParser(KXmlParser parser) { String namespace = parser.getNamespace(); String name = parser.getName(); if (LedgerXmlParsers.STOCK_XML_NAMESPACE.equals(namespace)) { if (stockParser == null) { throw new RuntimeException("Couldn't process Stock transaction without initialization!"); } req(); return stockParser.getParser(parser); } else if ("case".equalsIgnoreCase(name)) { if (caseParser == null) { throw new RuntimeException("Couldn't receive Case transaction without initialization!"); } req(); return caseParser.getParser(parser); } else if ("registration".equalsIgnoreCase(name)) { if (userParser == null) { throw new RuntimeException("Couldn't receive User transaction without initialization!"); } req(); return userParser.getParser(parser); } else if ("fixture".equalsIgnoreCase(name)) { req(); return fixtureParser.getParser(parser); } else if ("sync".equalsIgnoreCase(name) && "<LINK_0>".equals(namespace)) { return new TransactionParser<String>(parser) { public void commit(String parsed) throws IOException public String parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { this.checkNode("sync"); this.nextTag("restore_id"); String syncToken = parser.nextText(); if (syncToken == null) { throw new InvalidStructureException("Sync block must contain restore_id with valid ID inside!", parser); } sandbox.setSyncToken(syncToken); return syncToken; } }; } return null; }

Target:
public TransactionParser getParser(KXmlParser parser) { String namespace = parser.getNamespace(); String name = parser.getName(); if (LedgerXmlParsers.STOCK_XML_NAMESPACE.equals(namespace)) { if (stockParser == null) { throw new RuntimeException("Couldn't process Stock transaction without initialization!"); } req(); return stockParser.getParser(parser); } else if ("case".equalsIgnoreCase(name)) { if (caseParser == null) { throw new RuntimeException("Couldn't receive Case transaction without initialization!"); } req(); return caseParser.getParser(parser); } else if ("registration".equalsIgnoreCase(name)) { if (userParser == null) { throw new RuntimeException("Couldn't receive User transaction without initialization!"); } req(); return userParser.getParser(parser); } else if ("fixture".equalsIgnoreCase(name)) { req(); return fixtureParser.getParser(parser); } else if ("sync".equalsIgnoreCase(name) && "<LINK_0>".equals(namespace)) { return new TransactionParser<String>(parser) { @Override public void commit(String parsed) throws IOException @Override public String parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { this.checkNode("sync"); this.nextTag("restore_id"); String syncToken = parser.nextText(); if (syncToken == null) { throw new InvalidStructureException("Sync block must contain restore_id with valid ID inside!", parser); } sandbox.setSyncToken(syncToken); return syncToken; } }; } return null; }
Source:
public RenderPipelineTask generateTask() { if (task == null) { if (isTheDefaultInstance()) { frameBuffersManager = dynamicFBOsManager; } task = new SetViewportSizeOfTask(fboName); frameBuffersManager.subscribe(this); update(); } return task; }

Target:
public RenderPipelineTask generateTask() { if (task == null) { if (isTheDefaultInstance()) { frameBuffersManager = displayResolutionDependentFBOs; } task = new SetViewportSizeOfTask(fboName); frameBuffersManager.subscribe(this); update(); } return task; }
Source:
public DeclType typeCheck(TypeContext ctx, TypeContext thisCtx) { TypeContext methodCtx = thisCtx; for (FormalArg arg : formalArgs) { methodCtx = methodCtx.extend(arg.getName(), arg.getType()); } for (String freeVar : this.getFreeVariables()) { ValueType t = (new Variable(freeVar)).typeCheck(methodCtx); if (t instanceof StructuralType) { this.resourceFlag = ((StructuralType) t).isResource(); } else if (t instanceof NominalType) { this.resourceFlag = t.getStructuralType(ctx).isResource(); } } ValueType bodyType = body.typeCheck(methodCtx); if (!bodyType.isSubtypeOf(getType(), methodCtx)) { ToolError.reportError(ErrorMessage.NOT_SUBTYPE, this, "method body's type", "declared type");; } return new DefDeclType(getName(), type, formalArgs); }

Target:
public DeclType typeCheck(TypeContext ctx, TypeContext thisCtx) { TypeContext methodCtx = thisCtx; for (FormalArg arg : formalArgs) { methodCtx = methodCtx.extend(arg.getName(), arg.getType()); } if (!this.containsResource()) { for (String freeVar : this.getFreeVariables()) { ValueType t = (new Variable(freeVar)).typeCheck(methodCtx); if (t != null && t.isResource(methodCtx)) { this.setHasResource(true); break; } } } ValueType bodyType = body.typeCheck(methodCtx); if (!bodyType.isSubtypeOf(getType(), methodCtx)) { ToolError.reportError(ErrorMessage.NOT_SUBTYPE, this, "method body's type", "declared type");; } return new DefDeclType(getName(), type, formalArgs); }
Source:
public Iterable<Result> execute(Query query) throws Exception { JMXConnection jmxConnection = null; try { jmxConnection = pool.borrowObject(this); ImmutableList.Builder<Result> results = ImmutableList.builder(); if(query.getQueryType() == Query.QueryType.POLL) { MBeanServerConnection connection = jmxConnection.getMBeanServerConnection(); for (ObjectName queryName : query.queryNames(connection)) { results.addAll(query.fetchResults(connection, queryName)); } } else { if(!query.isNotificationListenerRegistered(jmxConnection)) { query.subscribeToNotifications(jmxConnection); } results.addAll(query.processNotifications(jmxConnection)); } return results.build(); } catch (Exception e) { if (jmxConnection != null) { pool.invalidateObject(this, jmxConnection); jmxConnection = null; } throw e; } finally { if (jmxConnection != null) { pool.returnObject(this, jmxConnection); } } }

Target:
public Iterable<Result> execute(Query query) throws Exception { JMXConnection jmxConnection = null; try { jmxConnection = pool.borrowObject(this); ImmutableList.Builder<Result> results = ImmutableList.builder(); MBeanServerConnection connection = jmxConnection.getMBeanServerConnection(); for (ObjectName queryName : query.queryNames(connection)) { results.addAll(query.fetchResults(connection, queryName)); } return results.build(); } catch (Exception e) { if (jmxConnection != null) { pool.invalidateObject(this, jmxConnection); jmxConnection = null; } throw e; } finally { if (jmxConnection != null) { pool.returnObject(this, jmxConnection); } } }
Source:
private static void copy(JarFile jar, JarEntry from, File to) throws IOException { InputStream is = jar.getInputStream(from); FileOutputStream os = new FileOutputStream(to); IOUtils.copy(is, os); os.close(); is.close(); }

Target:
private static void copy(JarFile jar, JarEntry from, File to) throws IOException { try (InputStream is = jar.getInputStream(from); FileOutputStream os = new FileOutputStream(to)) { IOUtils.copy(is, os); } }
Source:
public void getWhenMultipleIssuersThenUsesIssuerClaimToDifferentiate() throws Exception { this.spring.register(WebServerConfig.class, MultipleIssuersConfig.class, BasicController.class).autowire(); MockWebServer server = this.spring.getContext().getBean(MockWebServer.class); String metadata = "{\n" + " \"issuer\": \"%s\", \n" + " \"jwks_uri\": \"%s/.well-known/jwks.json\" \n" + "}"; String jwkSet = jwkSet(); String issuerOne = server.url("/issuerOne").toString(); String issuerTwo = server.url("/issuerTwo").toString(); String issuerThree = server.url("/issuerThree").toString(); String jwtOne = jwtFromIssuer(issuerOne); String jwtTwo = jwtFromIssuer(issuerTwo); String jwtThree = jwtFromIssuer(issuerThree); mockWebServer(String.format(metadata, issuerOne, issuerOne)); mockWebServer(jwkSet); this.mvc.perform(get("/authenticated") .with(bearerToken(jwtOne))) .andExpect(status().isOk()) .andExpect(content().string("test-subject")); mockWebServer(String.format(metadata, issuerTwo, issuerTwo)); mockWebServer(jwkSet); this.mvc.perform(get("/authenticated") .with(bearerToken(jwtTwo))) .andExpect(status().isOk()) .andExpect(content().string("test-subject")); mockWebServer(String.format(metadata, issuerThree, issuerThree)); mockWebServer(jwkSet); this.mvc.perform(get("/authenticated") .with(bearerToken(jwtThree))) .andExpect(status().isUnauthorized()); }

Target:
public void getWhenMultipleIssuersThenUsesIssuerClaimToDifferentiate() throws Exception { this.spring.register(WebServerConfig.class, MultipleIssuersConfig.class, BasicController.class).autowire(); MockWebServer server = this.spring.getContext().getBean(MockWebServer.class); String metadata = "{\n" + " \"issuer\": \"%s\", \n" + " \"jwks_uri\": \"%s/.well-known/jwks.json\" \n" + "}"; String jwkSet = jwkSet(); String issuerOne = server.url("/issuerOne").toString(); String issuerTwo = server.url("/issuerTwo").toString(); String issuerThree = server.url("/issuerThree").toString(); String jwtOne = jwtFromIssuer(issuerOne); String jwtTwo = jwtFromIssuer(issuerTwo); String jwtThree = jwtFromIssuer(issuerThree); mockWebServer(String.format(metadata, issuerOne, issuerOne)); mockWebServer(jwkSet); this.mvc.perform(get("/authenticated") .with(bearerToken(jwtOne))) .andExpect(status().isOk()) .andExpect(content().string("test-subject")); mockWebServer(String.format(metadata, issuerTwo, issuerTwo)); mockWebServer(jwkSet); this.mvc.perform(get("/authenticated") .with(bearerToken(jwtTwo))) .andExpect(status().isOk()) .andExpect(content().string("test-subject")); mockWebServer(String.format(metadata, issuerThree, issuerThree)); mockWebServer(jwkSet); this.mvc.perform(get("/authenticated") .with(bearerToken(jwtThree))) .andExpect(status().isUnauthorized()) .andExpect(invalidTokenHeader("Invalid issuer")); }
Source:
public T read(Object id, Class<T> objectType) { List<T> queryList = null; T foundRecord = null; try { session = getSessionFactory().openSession(); tx = session.beginTransaction(); LOG.info("Reading Record..."); Criteria aCriteria = session.createCriteria(objectType); aCriteria.add(Expression.eq("id", id)); queryList = aCriteria.list(); if (queryList != null && !queryList.isEmpty()) { foundRecord = queryList.get(0); } } catch (HibernateException | NullPointerException e) { LOG.error("Exception during read occured due to : {}", e.getMessage(), e); } finally { if (session != null) { try { session.flush(); session.close(); } catch (HibernateException e) { LOG.error("Exception while closing the session after a read: {}", e.getMessage(), e); } } } LOG.debug("GenericDaoJpaImpl.read() - End"); return foundRecord; }

Target:
public T read(Object id, Class<T> objectType) { List<T> queryList = null; T foundRecord = null; try { session = getSessionFactory().openSession(); tx = session.beginTransaction(); LOG.info("Reading Record..."); Criteria aCriteria = session.createCriteria(objectType); aCriteria.add(Expression.eq("id", id)); queryList = aCriteria.list(); if (CollectionUtils.isNotEmpty(queryList)) { foundRecord = queryList.get(0); } } catch (HibernateException | NullPointerException e) { LOG.error("Exception during read occured due to : {}", e.getMessage(), e); } finally { if (session != null) { try { session.flush(); session.close(); } catch (HibernateException e) { LOG.error("Exception while closing the session after a read: {}", e.getMessage(), e); } } } LOG.debug("GenericDaoJpaImpl.read() - End"); return foundRecord; }
Source:
protected R updateReservedRecordInternal(K key, V value, R reservedRecord, long reservationId) { if (reservedRecord.getReservationId() != reservationId) { return reservedRecord; } updateRecordValue(reservedRecord, value); if (value == null) { reservedRecord.setCachedAsNull(true); } reservedRecord.setReservationId(READ_PERMITTED); nearCacheStats.incrementOwnedEntryMemoryCost(getTotalStorageMemoryCost(key, reservedRecord)); nearCacheStats.incrementOwnedEntryCount(); return reservedRecord; }

Target:
protected R updateReservedRecordInternal(K key, V value, R reservedRecord, long reservationId) { if (reservedRecord.getReservationId() != reservationId) { return reservedRecord; } boolean update = reservedRecord.getValue() != null || reservedRecord.isCachedAsNull(); if (update) { nearCacheStats.incrementOwnedEntryMemoryCost(-getTotalStorageMemoryCost(key, reservedRecord)); } updateRecordValue(reservedRecord, value); if (value == null) { reservedRecord.setCachedAsNull(true); } reservedRecord.setReservationId(READ_PERMITTED); nearCacheStats.incrementOwnedEntryMemoryCost(getTotalStorageMemoryCost(key, reservedRecord)); if (!update) { nearCacheStats.incrementOwnedEntryCount(); } return reservedRecord; }
Source:
public TmfXmlReadOnlyStateValue(TmfXmlReadOnlyModelFactory modelFactory, Element node, IXmlStateSystemContainer container, String eventField) { super(modelFactory, node, container, NonNullUtils.checkNotNull(Collections.EMPTY_LIST), eventField); }

Target:
public TmfXmlReadOnlyStateValue(TmfXmlReadOnlyModelFactory modelFactory, Element node, IXmlStateSystemContainer container, String eventField) { super(modelFactory, node, container, checkNotNull(Collections.EMPTY_LIST), eventField); }
Source:
private void doCreateProject() { final String projectName = project.getText().trim(); final String parentName = sugestParent.getText().trim(); if ("".equals(projectName)) { project.setFocus(true); return; } enableForm(false); Util.PROJECT_SVC.createNewProject(projectName, parentName, emptyCommit.getValue(), permissionsOnly.getValue(), new GerritCallback<VoidResult>() { @Override public void onSuccess(VoidResult result) { History.newItem(Dispatcher.toProjectAdmin(new Project.NameKey( projectName), ProjectScreen.INFO)); } @Override public void onFailure(Throwable caught) { new ErrorDialog(caught.getMessage()) { @Override public void setText(final String t) { } }.center(); enableForm(true); } }); }

Target:
private void doCreateProject() { final String projectName = project.getText().trim(); final String parentName = sugestParent.getText().trim(); if ("".equals(projectName)) { project.setFocus(true); return; } enableForm(false); Util.PROJECT_SVC.createNewProject(projectName, parentName, emptyCommit.getValue(), permissionsOnly.getValue(), new GerritCallback<VoidResult>() { @Override public void onSuccess(VoidResult result) { History.newItem(Dispatcher.toProjectAdmin(new Project.NameKey( projectName), ProjectScreen.INFO)); } @Override public void onFailure(Throwable caught) { new ErrorDialog(caught.getMessage()).center(); enableForm(true); } }); }
Source:
public void setRemoteDirectory(String remoteDirectory) { this.remoteDirectoryExpression = new LiteralExpression(remoteDirectory); evalueRemoteDirectory(); }

Target:
public void setRemoteDirectory(String remoteDirectory) { this.remoteDirectoryExpression = new LiteralExpression(remoteDirectory); evaluateRemoteDirectory(); }
Source:
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { try { Timber.i("Downgrading database from version %d to %d", oldVersion, newVersion); upgradeToVersion5(db); Timber.i("Downgrading database from version %d to %d completed with success.", oldVersion, newVersion); isDatabaseBeingMigrated = false; } catch (SQLException e) { isDatabaseBeingMigrated = false; throw e; } }

Target:
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { try { Timber.i("Downgrading database from version %d to %d", oldVersion, newVersion); String temporaryTableName = INSTANCES_TABLE_NAME + "_tmp"; createInstancesTableV5(db, temporaryTableName); upgradeToVersion6(db, temporaryTableName); dropObsoleteColumns(db, CURRENT_VERSION_COLUMN_NAMES, temporaryTableName); Timber.i("Downgrading database from version %d to %d completed with success.", oldVersion, newVersion); isDatabaseBeingMigrated = false; } catch (SQLException e) { isDatabaseBeingMigrated = false; throw e; } }
Source:
public SetPath(Optional<NodeLocation> location, PathSpecification pathSpecification) { super(location); this.pathSpecification = requireNonNull(pathSpecification, "path is null"); }

Target:
private SetPath(Optional<NodeLocation> location, PathSpecification pathSpecification) { super(location); this.pathSpecification = requireNonNull(pathSpecification, "path is null"); }
Source:
public List<String> getHighlights() { return highlights; }

Target:
public List<Highlight> getHighlights() { return Collections.unmodifiableList(highlights); }
Source:
public boolean handleResponse(EventDispatcher eventDispatcher, SatelMessage response) { if (super.handleResponse(eventDispatcher, response)) { eventDispatcher.dispatchEvent(new NewStatesEvent(response.getPayload())); return true; } else { return true; } }

Target:
public boolean handleResponse(EventDispatcher eventDispatcher, SatelMessage response) { if (super.handleResponse(eventDispatcher, response)) { eventDispatcher.dispatchEvent(new NewStatesEvent(response.getPayload())); return true; } else { return false; } }
Source:
public void init() throws Exception { FilterConfig cfg = mock(FilterConfig.class); when(cfg.getInitParameter(MetricsFilter.PATH_COMPONENT_PARAM)).thenReturn("4"); f.init(cfg); assertEquals(f.getPathComponents(), 4); HttpServletRequest req = mock(HttpServletRequest.class); when(req.getRequestURI()).thenReturn("/foo/bar/baz/bang/zilch/zip/nada"); when(req.getMethod()).thenReturn(HttpMethods.GET); HttpServletResponse res = mock(HttpServletResponse.class); FilterChain c = mock(FilterChain.class); f.doFilter(req, res, c); verify(c).doFilter(req, res); final Double sampleValue = CollectorRegistry.defaultRegistry.getSampleValue(MetricsFilter.FILTER_NAME + "_count", new String[]{"path", "verb"}, new String[]{"/foo/bar/baz/bang", HttpMethods.GET}); assertNotNull(sampleValue); assertEquals(sampleValue, 1, 0.0001); }

Target:
public void init() throws Exception { FilterConfig cfg = mock(FilterConfig.class); when(cfg.getInitParameter(anyString())).thenReturn(null); String metricName = "foo"; when(cfg.getInitParameter(MetricsFilter.METRIC_NAME_PARAM)).thenReturn(metricName); when(cfg.getInitParameter(MetricsFilter.PATH_COMPONENT_PARAM)).thenReturn("4"); f.init(cfg); assertEquals(f.pathComponents, 4); HttpServletRequest req = mock(HttpServletRequest.class); when(req.getRequestURI()).thenReturn("/foo/bar/baz/bang/zilch/zip/nada"); when(req.getMethod()).thenReturn(HttpMethods.GET); HttpServletResponse res = mock(HttpServletResponse.class); FilterChain c = mock(FilterChain.class); f.doFilter(req, res, c); verify(c).doFilter(req, res); final Double sampleValue = CollectorRegistry.defaultRegistry.getSampleValue(metricName + "_count", new String[]{"path", "method"}, new String[]{"/foo/bar/baz/bang", HttpMethods.GET}); assertNotNull(sampleValue); assertEquals(1, sampleValue, 0.0001); }
Source:
protected ToStringHelper string() { ToStringHelper toString = Objects.toStringHelper("").omitNullValues(); toString.add("keyName", keyName); if (securityGroupNames.size() > 0) toString.add("securityGroupNames", securityGroupNames); if (metadata.size() > 0) toString.add("metadata", metadata); if (personality.size() > 0) toString.add("personality", personality); if (adminPass != null) toString.add("adminPassPresent", true); if (diskConfig != null) toString.add("diskConfig", diskConfig); toString.add("userData", userData == null ? null : new String(userData)); if (!networks.isEmpty()) toString.add("networks", networks); if (availabilityZone != null) toString.add("availability_zone", availabilityZone); return toString; }

Target:
protected ToStringHelper string() { ToStringHelper toString = Objects.toStringHelper("").omitNullValues(); toString.add("keyName", keyName); if (securityGroupNames.size() > 0) toString.add("securityGroupNames", securityGroupNames); if (metadata.size() > 0) toString.add("metadata", metadata); if (personality.size() > 0) toString.add("personality", personality); if (adminPass != null) toString.add("adminPassPresent", true); if (diskConfig != null) toString.add("diskConfig", diskConfig); toString.add("userData", userData == null ? null : new String(userData)); if (!networks.isEmpty()) toString.add("networks", networks); toString.add("availability_zone", availabilityZone == null ? null : availabilityZone); return toString; }
Source:
public void run() throws Exception { response = true; MultiMapContainer container = getOrCreateContainerWithoutAccess(); for (Map.Entry<Data, Collection<MultiMapRecord>> entry : backupEntries.entrySet()) { Data key = entry.getKey(); Collection<MultiMapRecord> value = entry.getValue(); if (value.isEmpty()) { container.remove(key, false); } else { MultiMapValue containerValue = container.getOrCreateMultiMapValue(key); Collection<MultiMapRecord> collection = containerValue.getCollection(false); container.decrementSize(collection.size()); collection.clear(); if (!collection.addAll(value)) { response = false; } else { container.incrementSize(value.size()); } } } }

Target:
public void run() throws Exception { response = true; MultiMapContainer container = getOrCreateContainerWithoutAccess(); for (Map.Entry<Data, Collection<MultiMapRecord>> entry : backupEntries.entrySet()) { Data key = entry.getKey(); Collection<MultiMapRecord> value = entry.getValue(); if (value.isEmpty()) { container.remove(key, false); } else { response = container.setValue(key, value); } } }
Source:
public boolean createOrUpdateAndStartSupervisor(SupervisorSpec spec) { Preconditions.checkState(started, "SupervisorManager not started"); Preconditions.checkNotNull(spec, "spec"); Preconditions.checkNotNull(spec.getId(), "spec.getStream()"); Preconditions.checkNotNull(spec.getDataSources(), "spec.getDatasources()"); synchronized (lock) { Preconditions.checkState(started, "SupervisorManager not started"); possiblyStopAndRemoveSupervisorInternal(spec.getId(), false); return createAndStartSupervisorInternal(spec, true); } }

Target:
public boolean createOrUpdateAndStartSupervisor(SupervisorSpec spec) { Preconditions.checkState(started, "SupervisorManager not started"); Preconditions.checkNotNull(spec, "spec"); Preconditions.checkNotNull(spec.getId(), "spec.getId()"); Preconditions.checkNotNull(spec.getDataSources(), "spec.getDatasources()"); synchronized (lock) { Preconditions.checkState(started, "SupervisorManager not started"); possiblyStopAndRemoveSupervisorInternal(spec.getId(), false); return createAndStartSupervisorInternal(spec, true); } }
Source:
private void expand(ClickEvent event, final int numRows) { Cell cell = table.getCellForEvent(event); int row = cell.getRowIndex(); if(!(getRowItem(row) instanceof SkippedLine)) { return; } SkippedLine line = (SkippedLine) getRowItem(row); int loopTo = numRows; if(numRows == 0) { loopTo = line.getSize(); } else if(numRows < 0) { loopTo = -numRows; } int offset = 0; if(numRows < 0) { offset = 1; } for(int i = 0 + offset; i < loopTo + offset; i++) { insertRow(row + i); int lineA = line.getStartA() + i; int lineB = line.getStartB() + i; if(numRows < 0) { lineA = line.getStartA() + line.getSize() + numRows + i - offset; lineB = line.getStartB() + line.getSize() + numRows + i - offset; } setHtml(row + i, 1, "<a href=\"javascript:void(0)\">" + (lineA + 1) + "</a>"); setHtml(row + i, 2, a.getSafeHtmlLine(lineA).asString()); setHtml(row + i, 3, "<a href=\"javascript:void(0)\">" + (lineB + 1) + "</a>"); setHtml(row + i, 4, b.getSafeHtmlLine(lineB).asString()); setRowItem(row + i, new PatchLine(CONTEXT, lineA, lineB)); } if (numRows > 0) { line.incrementStart(numRows); createSkipLine(row + loopTo, line); } else if (numRows < 0) { line.reduceSize(-numRows); createSkipLine(row, line); } else { removeRow(row + loopTo); } }

Target:
private void expand(ClickEvent event, final int numRows) { Cell cell = table.getCellForEvent(event); int row = cell.getRowIndex(); if (!(getRowItem(row) instanceof SkippedLine)) { return; } SkippedLine line = (SkippedLine) getRowItem(row); int loopTo = numRows; if (numRows == 0) { loopTo = line.getSize(); } else if (numRows < 0) { loopTo = -numRows; } int offset = 0; if (numRows < 0) { offset = 1; } for (int i = 0 + offset; i < loopTo + offset; i++) { insertRow(row + i); int lineA = line.getStartA() + i; int lineB = line.getStartB() + i; if (numRows < 0) { lineA = line.getStartA() + line.getSize() + numRows + i - offset; lineB = line.getStartB() + line.getSize() + numRows + i - offset; } setHtml(row + i, 1, "<a href=\"javascript:void(0)\">" + (lineA + 1) + "</a>"); addStyle(row + i, 1, Gerrit.RESOURCES.css().lineNumber()); setHtml(row + i, 2, a.getSafeHtmlLine(lineA).asString()); addStyle(row + i, 2, Gerrit.RESOURCES.css().fileLine()); addStyle(row + i, 2, Gerrit.RESOURCES.css().fileLineCONTEXT()); setHtml(row + i, 3, "<a href=\"javascript:void(0)\">" + (lineB + 1) + "</a>"); addStyle(row + i, 3, Gerrit.RESOURCES.css().lineNumber()); setHtml(row + i, 4, b.getSafeHtmlLine(lineB).asString()); addStyle(row + i, 4, Gerrit.RESOURCES.css().fileLine()); addStyle(row + i, 4, Gerrit.RESOURCES.css().fileLineCONTEXT()); setRowItem(row + i, new PatchLine(CONTEXT, lineA, lineB)); } if (numRows > 0) { line.incrementStart(numRows); createSkipLine(row + loopTo, line); } else if (numRows < 0) { line.reduceSize(-numRows); createSkipLine(row, line); } else { removeRow(row + loopTo); } }
Source:
private static IVMInstall[] sortVMs(IVMInstall[] installs) { List<IVMInstall2> all = new ArrayList<IVMInstall2>(); for (int i = 0; i < installs.length; i++) { if( installs[i] instanceof IVMInstall2 ) { all.add((IVMInstall2) installs[i]); } } Collections.sort(all, new Comparator<IVMInstall2>() { public int compare(IVMInstall2 o1, IVMInstall2 o2) { String arg0vers = o1.getJavaVersion(); String arg1vers = o2.getJavaVersion(); return compareJavaVersions(arg0vers, arg1vers); } }); return (IVMInstall[]) all.toArray(new IVMInstall[all.size()]); }

Target:
private static List<IVMInstall2> sortVMs(IVMInstall[] installs) { List<IVMInstall2> all = new ArrayList<IVMInstall2>(); for (int i = 0; i < installs.length; i++) { if( installs[i] instanceof IVMInstall2 ) { String version = ((IVMInstall2)installs[i]).getJavaVersion(); if( version != null ) { try { getMajorMinor(version); all.add((IVMInstall2) installs[i]); } catch( IllegalArgumentException iae) { } } } } Collections.sort(all, new Comparator<IVMInstall2>() { public int compare(IVMInstall2 o1, IVMInstall2 o2) { String arg0vers = o1.getJavaVersion(); String arg1vers = o2.getJavaVersion(); return compareJavaVersions(arg0vers, arg1vers); } }); return all; }
Source:
public String toJson() throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); return mapper.writeValueAsString(this); }

Target:
public String toJson() throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); mapper.configure(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS, false); return mapper.writeValueAsString(this); }
Source:
public void informsHasNextValue() { final List<String> VALID_LIST = Arrays.asList( "Accept: text/plain", "Accept-Charset: utf-8", "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", "Cache-Control: no-cache", "From: user@example.com"); MatcherAssert.assertThat(new VerboseIterable<String>( VALID_LIST, "Empty Error Message") .iterator().hasNext(), equalTo(true)); }

Target:
public final void informsHasNextValue() { MatcherAssert.assertThat( new VerboseIterable<String>( Arrays.asList( "User-Agent: LII-Cello/1.0 libwww/2.5", "accept-extension = \";\"", "Accept: text/*;", "Accept-Encoding: gzip;q=1.0" ), "This error should not be thrown" ).iterator().hasNext(), Matchers.equalTo(true) ); }
Source:
public SlackUtil slackUtil() { SlackUtil slackUtil = Mockito.mock(SlackUtil.class); return slackUtil; }

Target:
public SlackUtil slackUtil() { return Mockito.mock(SlackUtil.class); }