auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.TRY_STMT, ctx -> { TryStatement tryStatement = (TryStatement) ctx.syntaxNode(); Set<String> handledInterrupts = new HashSet<>(); boolean isSystemExitHandled = false; for (ExceptClause exceptClause : tryStatement.exceptClauses()) { Expression exceptionExpr = exceptClause.exception(); if (handlePossibleBareException(ctx, exceptClause, isSystemExitHandled)) { break; } Expression exceptionInstance = exceptClause.exceptionInstance(); Symbol exceptionInstanceSymbol = findExceptionInstanceSymbol(exceptionInstance); List<Expression> caughtExceptions = TreeUtils.flattenTuples(exceptionExpr).collect(Collectors.toList()); for (Expression caughtException : caughtExceptions) { isSystemExitHandled |= handleCaughtException(ctx, caughtException, exceptionInstanceSymbol, exceptClause.body(), isSystemExitHandled); } } }); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.TRY_STMT, ctx -> { TryStatement tryStatement = (TryStatement) ctx.syntaxNode(); boolean isSystemExitHandled = false; for (ExceptClause exceptClause : tryStatement.exceptClauses()) { Expression exceptionExpr = exceptClause.exception(); if (exceptionExpr == null) { handlePossibleBareException(ctx, exceptClause, isSystemExitHandled); break; } Expression exceptionInstance = exceptClause.exceptionInstance(); Symbol exceptionInstanceSymbol = findExceptionInstanceSymbol(exceptionInstance); List<Expression> caughtExceptions = TreeUtils.flattenTuples(exceptionExpr).collect(Collectors.toList()); for (Expression caughtException : caughtExceptions) { isSystemExitHandled |= handleCaughtException(ctx, caughtException, exceptionInstanceSymbol, exceptClause.body(), isSystemExitHandled); } } }); }
Source:
public void sendAuthMeBungeecordMessage(MessageType type, String playerName) { if (isEnabled) { if (!plugin.isEnabled()) { ConsoleLogger.debug("Tried to send a " + type + " bungeecord message but the plugin was disabled!"); return; } if (type.isBroadcast()) { sendBungeecordMessage("Forward", "ALL", "AuthMe", type.getId(), playerName.toLowerCase()); } else { sendBungeecordMessage("AuthMe", type.getId(), playerName.toLowerCase()); } } }

Target:
public void sendAuthMeBungeecordMessage(MessageType type, String playerName) { if (isEnabled) { if (!plugin.isEnabled()) { ConsoleLogger.debug("Tried to send a " + type + " bungeecord message but the plugin was disabled!"); return; } if(type.isRequiresCaching() && !dataSource.isCached()) { return; } if (type.isBroadcast()) { sendBungeecordMessage("Forward", "ALL", "AuthMe", type.getId(), playerName.toLowerCase()); } else { sendBungeecordMessage("AuthMe", type.getId(), playerName.toLowerCase()); } } }
Source:
public void testGaussian() throws Exception { for (final double mu : Arrays.asList(0, 1)) { for (final double lambda : Arrays.asList(0.1, 1.0)) { final double theoreticalMean = mu; final double theoreticalVariance = 1/lambda; final double standardDeviationOfMean = Math.sqrt(theoreticalVariance / NUM_SAMPLES); final GibbsSampler<DoubleState, EmptyData> sampler = gaussianGibbsSampler(mu, lambda); sampler.runMCMC(); List<Double> samples = sampler.getSamples(DoubleState.PARAMETER_NAME, Double.class, NUM_BURN_IN_STEPS); final double sampleMean = samples.stream().mapToDouble(x -> x).average().getAsDouble(); Assert.assertEquals(sampleMean, theoreticalMean, 10*standardDeviationOfMean); } } }

Target:
public void testGaussian() { for (final double theoreticalMean : Arrays.asList(0)) { for (final double precision : Arrays.asList(1.0)) { final double variance = 1/precision; final double standardDeviationOfMean = Math.sqrt(variance / NUM_SAMPLES); final Function<Double, Double> logPDF = x -> -(precision/2)*(x-theoreticalMean)*(x-theoreticalMean); final AdaptiveMetropolisSampler sampler = new AdaptiveMetropolisSampler(INITIAL_GAUSSIAN_GUESS, INITIAL_STEP_SIZE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY); final List<Double> samples = sampler.sample(logPDF, NUM_SAMPLES, NUM_BURN_IN_STEPS); final double sampleMean = samples.stream().mapToDouble(x -> x).average().getAsDouble(); final double sampleMeanSquare = samples.stream().mapToDouble(x -> x*x).average().getAsDouble(); final double sampleVariance = (sampleMeanSquare - sampleMean * sampleMean)*NUM_SAMPLES/(NUM_SAMPLES-1); Assert.assertEquals(sampleMean, theoreticalMean, 6 * standardDeviationOfMean); Assert.assertEquals(sampleVariance, variance, variance/10); } } }
Source:
private List<StorageDevice> filterStorageDevices(List<StorageDevice> storageDevices) { List<StorageDevice> filteredStorageDevices = new ArrayList<StorageDevice>(); List<String> mountPointsToFilterOutList = getMountPointsFilter(); List<String> fsTypesToFilterOutList = getFsTypesFilter(); for (StorageDevice device : storageDevices) { if ((device.getMountPoint() != null && mountPointsToFilterOutList.contains(device.getMountPoint())) || (device.getFsType() != null && fsTypesToFilterOutList.contains(device.getFsType()))) { continue; } if (device.getCanCreateBrick() || device.getMountPoint() != null || device.getFsType() != null) { filteredStorageDevices.add(device); } } return filteredStorageDevices; }

Target:
private List<StorageDevice> filterStorageDevices(List<StorageDevice> storageDevices) { List<StorageDevice> filteredStorageDevices = new ArrayList<>(); List<String> mountPointsToFilterOutList = getMountPointsFilter(); List<String> fsTypesToFilterOutList = getFsTypesFilter(); for (StorageDevice device : storageDevices) { if ((device.getMountPoint() != null && mountPointsToFilterOutList.contains(device.getMountPoint())) || (device.getFsType() != null && fsTypesToFilterOutList.contains(device.getFsType()))) { continue; } if (device.getCanCreateBrick() || device.getMountPoint() != null || device.getFsType() != null) { filteredStorageDevices.add(device); } } return filteredStorageDevices; }
Source:
private static String toCrontab(String interval) { long millis = toIntervalMillis(interval); if (millis <= TimeUnit2.MINUTES.toMillis(5)) { return "* * * * *"; } if (millis <= TimeUnit2.MINUTES.toMillis(30)) { return "H/12 * * * *"; } if (millis <= TimeUnit2.HOURS.toMillis(1)) { return "H/4 * * * *"; } if (millis <= TimeUnit2.HOURS.toMillis(8)) { return "H/2 * * * *"; } if (millis <= TimeUnit2.DAYS.toMillis(1)) { return "H H/6 * * *"; } if (millis <= TimeUnit2.DAYS.toMillis(2)) { return "H H/2 * * *"; } return "H H * * *"; }

Target:
private static String toCrontab(String interval) { long millis = toIntervalMillis(interval); if (millis <= TimeUnit2.MINUTES.toMillis(5)) { return "* * * * *"; } if (millis <= TimeUnit2.MINUTES.toMillis(30)) { return "H/5 * * * *"; } if (millis <= TimeUnit2.HOURS.toMillis(1)) { return "H/15 * * * *"; } if (millis <= TimeUnit2.HOURS.toMillis(8)) { return "H/30 * * * *"; } if (millis <= TimeUnit2.DAYS.toMillis(1)) { return "H H/4 * * *"; } if (millis <= TimeUnit2.DAYS.toMillis(2)) { return "H H/12 * * *"; } return "H H * * *"; }
Source:
public void attachesBinaryToRelease() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final String tag = "v1.0"; final File dir = this.temp.newFolder(); final String target = "target"; final String name = "name-${tag}.jar"; final File bin = FileUtils.getFile( dir.getAbsolutePath(), "repo", target, name.replace("${tag}", tag) ); Files.createParentDirs(bin); final byte[] content = RandomUtils.nextBytes(Tv.HUNDRED); Files.write(content, bin); final Talk talk = ReleaseBinariesTest.talk(issue, tag, dir); new CommentsTag(repo.github()).execute(talk); new ReleaseBinaries( repo.github(), new Profile.Fixed( new XMLDocument( StringUtils.join( "<p><entry key='release'><entry key='artifacts'>", String.format("%s/%s", target, name), "</entry></entry></p>" ) ) ) ).execute(talk); MatcherAssert.assertThat( IOUtils.toByteArray( new Releases.Smart(repo.releases()).find(tag) .assets().get(0).raw() ), Matchers.equalTo(content) ); }

Target:
public void attachesBinaryToRelease() throws Exception { final Repo repo = new MkGithub().randomRepo(); final String tag = "v1.0"; final File dir = this.temp.newFolder(); final String target = "target"; final String name = "name-${tag}.jar"; final File bin = FileUtils.getFile( dir.getAbsolutePath(), "repo", target, name.replace("${tag}", tag) ); Files.createParentDirs(bin); final byte[] content = RandomUtils.nextBytes(Tv.HUNDRED); Files.write(content, bin); final Talk talk = ReleaseBinariesTest .talk(repo.issues().create("", ""), tag, dir); new CommentsTag(repo.github()).execute(talk); new ReleaseBinaries( repo.github(), new Profile.Fixed( new XMLDocument( StringUtils.join( "<p><entry key='release'><entry key='artifacts'>", String.format("%s/%s", target, name), "</entry></entry></p>" ) ) ) ).execute(talk); MatcherAssert.assertThat( IOUtils.toByteArray( new Releases.Smart(repo.releases()).find(tag) .assets().get(0).raw() ), Matchers.equalTo(content) ); }
Source:
private void assertXMLEquals(String expected, String actual) { if (expected == null || expected.trim().isEmpty()) { assertEquals(XML_INTRO, actual); } else { assertEquals(XML_INTRO_OPEN + expected + XML_INTRO_CLOSE, actual); } }

Target:
private void assertXMLEquals(String expected, String actual) { if (expected.isEmpty()) { assertEquals(XML_INTRO, actual); } else { assertEquals(XML_INTRO_OPEN + expected + XML_INTRO_CLOSE, actual); } }
Source:
@Override public void request(@NonNull Context context, @NonNull WikiSite wiki, int age, @NonNull FeedClient.Callback cb) { if (CARDS == null) { CARDS = getCards(context); } if (CARDS.size() > 0) { Card card = CARDS.remove(0); cb.success(Collections.singletonList(card)); } else { cb.finish(); } }

Target:
@Override public void request(@NonNull Context context, @NonNull WikiSite wiki, int age, @NonNull FeedClient.Callback cb) { List<Card> cards = getCards(context); cb.success(age < cards.size() ? Collections.singletonList(cards.get(age)) : Collections.emptyList()); }
Source:
private void setCurrentSite(final HttpServletRequest req, final String userID) throws DotDataException, DotSecurityException { final HttpSession session = req.getSession(); final User user = APILocator.getUserAPI().loadUserById(userID); final String currentSiteID = (String) session.getAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID); Host currentSite = null; try { currentSite = APILocator.getHostAPI().find(currentSiteID, user, false); } catch (DotSecurityException e) { final List<Host> sites = APILocator.getHostAPI().findAll(user, false); currentSite = sites.size() > 0 ? sites.get(0) : APILocator.getHostAPI().findDefaultHost(user, false); } session.setAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID, currentSite.getIdentifier()); }

Target:
private void setCurrentSite(final HttpServletRequest req, final String userID) throws DotDataException, DotSecurityException { final HttpSession session = req.getSession(); final User user = APILocator.getUserAPI().loadUserById(userID); final String currentSiteID = (String) session.getAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID); Host currentSite = null; try { currentSite = APILocator.getHostAPI().find(currentSiteID, user, false); } catch (DotSecurityException e) { final List<Host> sites = APILocator.getHostAPI().findAll(user, 1,0,null, false); if (sites.isEmpty()) { throw new DotRuntimeException(String.format("The user %s don't have any site", userID)); } currentSite = sites.get(0); } session.setAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID, currentSite.getIdentifier()); }
Source:
public static void showDialogDeletePermanently(final Activity activity, final Note note) { new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.Dialog)) .setTitle(R.string.delete_dialog_title) .setMessage(R.string.delete_dialog_message) .setNegativeButton(R.string.no, null) .setPositiveButton( R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { if (note != null) { note.delete(); if (activity instanceof NotesActivity) { ((NotesActivity) activity).showDetailPlaceholder(); } else if (activity instanceof NoteEditorActivity) { ((NoteEditorActivity) activity).finish(); } } else { showDialogErrorDelete(activity); } } } ) .show(); }

Target:
public static void showDialogDeletePermanently(final Activity activity, final Note note) { new AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.Dialog)) .setTitle(R.string.delete_dialog_title) .setMessage(R.string.delete_dialog_message) .setNegativeButton(R.string.cancel, null) .setPositiveButton( R.string.delete, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { if (note != null) { note.delete(); if (activity instanceof NotesActivity) { ((NotesActivity) activity).showDetailPlaceholder(); } else if (activity instanceof NoteEditorActivity) { ((NoteEditorActivity) activity).finish(); } } else { showDialogErrorDelete(activity); } } } ) .show(); }
Source:
public void changeUserPasswordUsingActivationKey(String activationKey, String newPassword) throws APIException { User user = getUserByActivationKey(activationKey); if (user == null) { throw new APIException("activation.key.not.correct", (Object[]) null); } updatePassword(user, newPassword); }

Target:
public void changeUserPasswordUsingActivationKey(String activationKey, String newPassword) { User user = getUserByActivationKey(activationKey); if (user == null) { throw new InvalidActivationKeyException("activation.key.not.correct"); } updatePassword(user, newPassword); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CoordinatorEvent that = (CoordinatorEvent) o; return _eventType == that._eventType && _eventMetadata.equals(that._eventMetadata); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CoordinatorEvent that = (CoordinatorEvent) o; return _eventType == that._eventType && Objects.equals(_eventMetadata, that._eventMetadata); }
Source:
public void populateFields(String pubId, ForeignPK fromPK, ForeignPK toPK) { UpdatableProcessInstance currentProcessInstance = (UpdatableProcessInstance) getProcessInstance(); try { PublicationTemplateManager.getInstance().addDynamicPublicationTemplate(targetId + ":" + xmlFormName, xmlFormName + ".xml"); PublicationTemplateImpl pubTemplate = (PublicationTemplateImpl) PublicationTemplateManager.getInstance().getPublicationTemplate(targetId + ":" + xmlFormName); DataRecord record = pubTemplate.getRecordSet().getEmptyRecord(); record.setId(pubId); for (String fieldName : record.getFieldNames()) { Object fieldValue = null; try { Field fieldOfFolder = currentProcessInstance.getField(fieldName); FieldTemplate fieldTemplate = pubTemplate.getRecordTemplate().getFieldTemplate(fieldName); fieldValue = fieldOfFolder.getObjectValue(); if (fieldOfFolder instanceof FileField) { fieldValue = copyFormFile(fromPK, toPK, ((FileField) fieldOfFolder).getAttachmentId()); } else if ("wysiwyg".equals(fieldTemplate.getDisplayerName())) { WysiwygFCKFieldDisplayer displayer = new WysiwygFCKFieldDisplayer(); fieldValue = displayer.duplicateContent(fieldTemplate, fromPK, toPK, I18NHelper.defaultLanguage); } } catch (WorkflowException e) { } record.getField(fieldName).setObjectValue(fieldValue); } pubTemplate.getRecordSet().save(record); } catch (PublicationTemplateException | FormException e) { SilverLogger.getLogger(this).error(e.getMessage(), e); } }

Target:
private void populateFields(String pubId, ForeignPK fromPK, ForeignPK toPK) { UpdatableProcessInstance currentProcessInstance = (UpdatableProcessInstance) getProcessInstance(); try { PublicationTemplateManager.getInstance().addDynamicPublicationTemplate(targetId + ":" + xmlFormName, xmlFormName + ".xml"); PublicationTemplateImpl pubTemplate = (PublicationTemplateImpl) PublicationTemplateManager.getInstance().getPublicationTemplate(targetId + ":" + xmlFormName); DataRecord record = pubTemplate.getRecordSet().getEmptyRecord(); record.setId(pubId); for (String fieldName : record.getFieldNames()) { Object fieldValue = null; try { Field fieldOfFolder = currentProcessInstance.getField(fieldName); FieldTemplate fieldTemplate = pubTemplate.getRecordTemplate().getFieldTemplate(fieldName); fieldValue = fieldOfFolder.getObjectValue(); if (fieldOfFolder instanceof FileField) { fieldValue = copyFormFile(fromPK, toPK, ((FileField) fieldOfFolder).getAttachmentId()); } else if ("wysiwyg".equals(fieldTemplate.getDisplayerName())) { WysiwygFCKFieldDisplayer displayer = new WysiwygFCKFieldDisplayer(); fieldValue = displayer.duplicateContent(fieldTemplate, fromPK, toPK, I18NHelper.defaultLanguage); } } catch (WorkflowException e) { SilverLogger.getLogger(this).error("Error when populating field : "+fieldName, e); } record.getField(fieldName).setObjectValue(fieldValue); } pubTemplate.getRecordSet().save(record); } catch (PublicationTemplateException | FormException e) { SilverLogger.getLogger(this).error(e.getMessage(), e); } }
Source:
protected Table[] doAllTables() throws SQLException { String query = "select rtrim(" + tableNameField + ") from " + systemSchema + ".TABLES where " + tableTypeField + "='" + tableType + "' and " + tableSchemaField + " = ?"; return findTables(query, name); }

Target:
protected Table[] doAllTables() throws SQLException { String query = "SELECT RTRIM(" + tableNameField + ") FROM " + tablesTable + " WHERE " + tableTypeField + "='" + tableValue + "' AND " + tableSchemaField + " = ? AND " + systemTable + " <> '" + yesValue + "'"; return findTables(query, name); }
Source:
private CompletableFuture<List<GetResult<V>>> multiget(List<String> keys, boolean withCas) { final int size = keys.size(); if (size == 0) { return CompletableFuture.completedFuture(Collections.<GetResult<V>>emptyList()); } final List<List<String>> keyPartition = Lists.partition(keys, MemcacheEncoder.MAX_MULTIGET_SIZE); final List<CompletableFuture<List<GetResult<byte[]>>>> futuresList = keyPartition.stream() .map(part -> rawMemcacheClient.send(MultigetRequest.create(part, charset, withCas))) .collect(Collectors.toList()); final CompletableFuture<List<GetResult<byte[]>>> futures = futuresList.toArray(new CompletableFuture[keyPartition.size()]); final CompletableFuture<List<GetResult<byte[]>>> future = CompletableFuture .allOf(futures) .thenApply(__ -> Arrays.stream(futures) .map(CompletableFuture::join) .flatMap(List::stream) .collect(Collectors.toList())); metrics.measureMultigetFuture(future); return transformerUtil.decodeList(future); }

Target:
private CompletionStage<List<GetResult<V>>> multiget(List<String> keys, boolean withCas) { final int size = keys.size(); if (size == 0) { return CompletableFuture.completedFuture(Collections.<GetResult<V>>emptyList()); } final List<List<String>> keyPartition = Lists.partition(keys, MemcacheEncoder.MAX_MULTIGET_SIZE); final List<CompletionStage<List<GetResult<byte[]>>>> futuresList = keyPartition.stream() .map(part -> rawMemcacheClient.send(MultigetRequest.create(part, charset, withCas))) .collect(Collectors.toList()); final CompletableFuture<List<GetResult<byte[]>>> futures = futuresList.toArray(new CompletableFuture[keyPartition.size()]); final CompletableFuture<List<GetResult<byte[]>>> future = CompletableFuture .allOf(futures) .thenApply(__ -> Arrays.stream(futures) .map(CompletableFuture::join) .flatMap(List::stream) .collect(Collectors.toList())); metrics.measureMultigetFuture(future); return transformerUtil.decodeList(future); }
Source:
public void doFilter(final ServletRequest request, final ServletResponse response) throws IOException, ServletException { final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); final ServletRequest oldReq = servletRequestContext.getOriginalRequest(); final ServletResponse oldResp = servletRequestContext.getOriginalResponse(); try { if(!allowNonStandardWrappers) { if(oldReq != request) { if(!(request instanceof ServletRequestWrapper)) { throw UndertowServletMessages.MESSAGES.requestWasNotOriginalOrWrapper(request); } } if(oldResp != response) { if(!(response instanceof ServletResponseWrapper)) { throw UndertowServletMessages.MESSAGES.responseWasNotOriginalOrWrapper(response); } } } servletRequestContext.setServletRequest(request); servletRequestContext.setServletResponse(response); int index = location++; if (index >= filters.size()) { next.handleRequest(exchange); } else { filters.get(index).doFilter(request, response, this); } } catch (IOException e) { throw e; } catch (ServletException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } finally { location--; if(!request.isAsyncStarted()) { servletRequestContext.setServletRequest(oldReq); servletRequestContext.setServletResponse(oldResp); } } }

Target:
public void doFilter(final ServletRequest request, final ServletResponse response) throws IOException, ServletException { final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); final ServletRequest oldReq = servletRequestContext.getServletRequest(); final ServletResponse oldResp = servletRequestContext.getServletResponse(); try { if(!allowNonStandardWrappers) { if(oldReq != request) { if(!(request instanceof ServletRequestWrapper)) { throw UndertowServletMessages.MESSAGES.requestWasNotOriginalOrWrapper(request); } } if(oldResp != response) { if(!(response instanceof ServletResponseWrapper)) { throw UndertowServletMessages.MESSAGES.responseWasNotOriginalOrWrapper(response); } } } servletRequestContext.setServletRequest(request); servletRequestContext.setServletResponse(response); int index = location++; if (index >= filters.size()) { next.handleRequest(exchange); } else { filters.get(index).doFilter(request, response, this); } } catch (IOException e) { throw e; } catch (ServletException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } finally { location--; } }
Source:
public byte[] getCacheKey() { if (dimensions != null) { byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); final byte[][] dimensionsBytes = new byte[dimensions.length][]; int dimensionsBytesSize = 0; if (dimensions != null) { for (int i = 0; i < dimensions.length; i++) { dimensionsBytes[i] = StringUtils.toUtf8(dimensions[i]); dimensionsBytesSize += dimensionsBytes[i].length + 1; } } ByteBuffer filterCacheKey = ByteBuffer.allocate(2 + extractionFnBytes.length + dimensionsBytesSize) .put(DimFilterUtils.SELECTOR_CACHE_ID) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR); for (byte[] bytes : dimensionsBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); } byte[] dimensionBytes = StringUtils.toUtf8(dimension); byte[] valueBytes = (value == null) ? new byte[]{} : StringUtils.toUtf8(value); byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); return ByteBuffer.allocate(3 + dimensionBytes.length + valueBytes.length + extractionFnBytes.length) .put(DimFilterUtils.SELECTOR_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(valueBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .array(); }

Target:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); byte[] valueBytes = (value == null) ? new byte[]{} : StringUtils.toUtf8(value); byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); return ByteBuffer.allocate(3 + dimensionBytes.length + valueBytes.length + extractionFnBytes.length) .put(DimFilterUtils.SELECTOR_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(valueBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .array(); }
Source:
protected void initProcessor(StreamProcessorDescriptor descriptor) { if (processors.containsKey(descriptor.getId())) { getLog().error("Processor already initialized: " + descriptor.getId()); return; } getLog().info("Init Stream processor: " + descriptor.getId() + " with manager: " + descriptor.config); LogManager manager = getLogManager(descriptor.config); try { Topology topology = descriptor.klass.getDeclaredConstructor().newInstance().getTopology(descriptor.options); StreamProcessor streamProcessor = new LogStreamProcessor(manager); Settings settings = getSettings(descriptor); if (getLog().isDebugEnabled()) { getLog().debug( "Starting computation topology: " + descriptor.getId() + "\n" + topology.toPlantuml(settings)); } streamProcessor.init(topology, settings); processors.put(descriptor.getId(), streamProcessor); } catch (ReflectiveOperationException e) { throw new StreamRuntimeException("Can not create topology for processor: " + descriptor.getId(), e); } }

Target:
protected void initProcessor(StreamProcessorDescriptor descriptor) { if (processors.containsKey(descriptor.getId())) { getLog().error("Processor already initialized: " + descriptor.getId()); return; } getLog().info("Init Stream processor: " + descriptor.getId() + " with manager: " + descriptor.config); LogManager manager = getLogManager(descriptor.config); Topology topology; try { topology = descriptor.klass.getDeclaredConstructor().newInstance().getTopology(descriptor.options); } catch (ReflectiveOperationException e) { throw new StreamRuntimeException("Can not create topology for processor: " + descriptor.getId(), e); } StreamProcessor streamProcessor = new LogStreamProcessor(manager); Settings settings = getSettings(descriptor); if (getLog().isDebugEnabled()) { getLog().debug( "Starting computation topology: " + descriptor.getId() + "\n" + topology.toPlantuml(settings)); } streamProcessor.init(topology, settings); processors.put(descriptor.getId(), streamProcessor); }
Source:
public String choose(VolumeChooserEnvironment env, String[] options) throws AccumuloException { if (!env.hasTableId() && !env.hasScope()) { log.warn("No table id or scope, so it's not possible to determine preferred volumes. Using all volumes."); return super.choose(env, options); } ServerConfigurationFactory localConf = loadConf(); List<String> volumes; if (env.hasTableId()) { volumes = getPreferredVolumesForTable(env, localConf, options); } else { volumes = getPreferredVolumesForNonTable(env, localConf, options); } String choice = super.choose(env, volumes.toArray(EMPTY_STRING_ARRAY)); if (log.isTraceEnabled()) { log.trace("Choice = " + choice); } return choice; }

Target:
public String choose(VolumeChooserEnvironment env, String[] options) throws VolumeChooserException { log.trace("{}.choose", getClass().getSimpleName()); String choice = super.choose(env, getPreferredVolumes(env, options)); log.trace("Choice = {}", choice); return choice; }
Source:
private void logStorageDeviceMessage(AuditLogType logType, VDS vds, final StorageDevice device) { logUtil.logAuditMessage(vds.getVdsGroupId(), null, vds, logType, new HashMap<String, String>() { { put("storageDevice", device.getName()); } }); }

Target:
private void logStorageDeviceMessage(AuditLogType logType, VDS vds, final StorageDevice device) { logUtil.logAuditMessage(vds.getVdsGroupId(), null, vds, logType, Collections.singletonMap("storageDevice", device.getName())); }
Source:
public HostNetworkProviderModel() { getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity()); getUseClusterDefaultNetworkProvider().getEntityChangedEvent().addListener((ev, sender, args) -> getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity())); getUseClusterDefaultNetworkProvider().getEntityChangedEvent().addListener( (ev, sender, args) -> selectDefaultProvider()); getNetworkProviders().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { Provider<OpenstackNetworkProviderProperties> provider = getNetworkProviders().getSelectedItem(); getNetworkProviderType().setIsAvailable(provider != null); getNetworkProviderType().setSelectedItem(provider == null ? null : provider.getType()); boolean isNeutron = getNetworkProviderType().getSelectedItem() == ProviderType.OPENSTACK_NETWORK; getNeutronAgentModel().init(isNeutron && provider != null ? provider : new Provider<>()); getNeutronAgentModel().setIsAvailable(isNeutron); }); getNetworkProviderType().setIsChangeable(false); getNetworkProviderType().setIsAvailable(false); getNeutronAgentModel().setIsAvailable(false); initNetworkProvidersList(); }

Target:
public HostNetworkProviderModel() { getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity()); getUseClusterDefaultNetworkProvider().getEntityChangedEvent().addListener((ev, sender, args) -> { getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity()); selectDefaultProvider(); }); getNetworkProviders().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { Provider<OpenstackNetworkProviderProperties> provider = getNetworkProviders().getSelectedItem(); getNetworkProviderType().setIsAvailable(provider != null); getNetworkProviderType().setSelectedItem(provider == null ? null : provider.getType()); boolean isNeutron = getNetworkProviderType().getSelectedItem() == ProviderType.OPENSTACK_NETWORK; getNeutronAgentModel().init(isNeutron && provider != null ? provider : new Provider<>()); getNeutronAgentModel().setIsAvailable(isNeutron); }); getNetworkProviderType().setIsChangeable(false); getNetworkProviderType().setIsAvailable(false); getNeutronAgentModel().setIsAvailable(false); initNetworkProvidersList(); }
Source:
public void testStartKeepaliveWLAN() throws Exception { testConnectEvent(); waitForMs(200); DataServiceManager mockDsm = mock(DataServiceManager.class); replaceInstance(DataConnection.class, "mDataServiceManager", mDc, mockDsm); doReturn(TransportType.WLAN).when(mockDsm).getTransportType(); final int sessionHandle = 0xF00; final int slotId = 3; final int interval = 10; KeepalivePacketData kd = KeepalivePacketData.nattKeepalivePacket( NetworkUtils.numericToInetAddress("1.2.3.4"), 1234, NetworkUtils.numericToInetAddress("8.8.8.8"), 4500); mDc.obtainMessage( DataConnection.EVENT_KEEPALIVE_START_REQUEST, slotId, interval, kd).sendToTarget(); waitForMs(100); try { verify(mSimulatedCommandsVerifier, times(0)) .startNattKeepalive(anyInt(), eq(kd), eq(interval * 1000), any(Message.class)); } finally { restoreInstance(DataConnection.class, "mDataServiceManager", mDc); } }

Target:
public void testStartKeepaliveWLAN() throws Exception { testConnectEvent(); waitForMs(200); DataServiceManager mockDsm = mock(DataServiceManager.class); doReturn(TransportType.WLAN).when(mockDsm).getTransportType(); replaceInstance(DataConnection.class, "mDataServiceManager", mDc, mockDsm); final int sessionHandle = 0xF00; final int slotId = 3; final int interval = 10; KeepalivePacketData kd = KeepalivePacketData.nattKeepalivePacket( NetworkUtils.numericToInetAddress("1.2.3.4"), 1234, NetworkUtils.numericToInetAddress("8.8.8.8"), 4500); mDc.obtainMessage( DataConnection.EVENT_KEEPALIVE_START_REQUEST, slotId, interval, kd).sendToTarget(); waitForMs(100); verify(mSimulatedCommandsVerifier, times(0)) .startNattKeepalive(anyInt(), eq(kd), eq(interval * 1000), any(Message.class)); }
Source:
private Product applyProvidedProductChanges(Product entity, ProductDTO update, Owner owner) { if (update.getProvidedProducts() != null) { if (update.getProvidedProducts().isEmpty()) { entity.setProvidedProducts(Collections.emptySet()); } else { Set<Product> products = new HashSet<>(); for (ProductDTO providedProductDTO : update.getProvidedProducts()) { if (providedProductDTO != null) { Product newProd = this.ownerProductCurator.getProductById(owner, providedProductDTO.getId()); if (newProd == null) { log.debug("Provided product not found {}", providedProductDTO.getId()); } products.add(newProd); } } entity.setProvidedProducts(products); } } return entity; }

Target:
private Product applyProvidedProductChanges(Product entity, ProductDTO update, Owner owner) { if (update.getProvidedProducts() != null && !update.getProvidedProducts().isEmpty()) { entity.getProvidedProducts().clear(); for (ProductDTO providedProductDTO : update.getProvidedProducts()) { if (providedProductDTO != null && providedProductDTO.getId() != null) { Product newProd = this.ownerProductCurator.getProductById(owner, providedProductDTO.getId()); if (newProd != null) { entity.addProvidedProduct(newProd); } } } } return entity; }
Source:
private boolean isDebugViewActive(DebugContextEvent event) { if (isDisposed()) { return false; } IWorkbenchPage activePage = fWindow.getActivePage(); if (activePage != null) { IWorkbenchPart part = event.getDebugContextProvider().getPart(); if (part != null) { return activePage.findView(part.getSite().getId()) != null; } return activePage.findView(IDebugUIConstants.ID_DEBUG_VIEW) != null; } return false; }

Target:
private boolean isDebugViewActive(DebugContextEvent event) { if (isDisposed()) { return false; } IWorkbenchPage activePage = fWindow.getActivePage(); if (activePage != null) { IViewPart debugView = null; IWorkbenchPart part = event.getDebugContextProvider().getPart(); if (part != null) { debugView = activePage.findView(part.getSite().getId()); } if (debugView == null) { debugView = activePage.findView(IDebugUIConstants.ID_DEBUG_VIEW); } return debugView != null; } return false; }
Source:
public BaseTestClass() { prism = new PrismHelper(MERLIN_PROPERTIES, PRISM_PREFIX); servers = getServers(); serverFS = new ArrayList<FileSystem>(); serverOC = new ArrayList<OozieClient>(); for (ColoHelper server : servers) { try { serverFS.add(server.getClusterHelper().getHadoopFS()); } catch (IOException e) { e.printStackTrace(); System.exit(0); } serverOC.add(server.getClusterHelper().getOozieClient()); try { HadoopUtil.createDir(baseHDFSDir, serverFS.get(serverFS.size() - 1)); } catch (IOException e) { e.printStackTrace(); System.exit(0); } } }

Target:
public BaseTestClass() { prism = new PrismHelper(MERLIN_PROPERTIES, PRISM_PREFIX); servers = getServers(); serverFS = new ArrayList<FileSystem>(); serverOC = new ArrayList<OozieClient>(); for (ColoHelper server : servers) { try { serverFS.add(server.getClusterHelper().getHadoopFS()); serverOC.add(server.getClusterHelper().getOozieClient()); HadoopUtil.createDir(baseHDFSDir, serverFS.get(serverFS.size ()-1)); } catch (IOException e) { e.printStackTrace(); System.exit(1); } } }
Source:
public boolean hideDisplayNameInVanish() { return config.getBoolean("hide-displayname-in-vanish", true); }

Target:
public boolean hideDisplayNameInVanish() { return config.getBoolean("hide-displayname-in-vanish", false); }
Source:
public void tableCellSelected(String columnId, int rowIndex) { DataSet ds = processesTable.getDataSetHandler().getLastDataSet(); String deploymentId = ds.getValueAt(rowIndex, COLUMN_PROCESS_EXTERNAL_ID).toString(); Long processInstanceId = Double.valueOf(ds.getValueAt(rowIndex, COLUMN_PROCESS_INSTANCE_ID).toString()).longValue(); String processDefId = ds.getValueAt(rowIndex, COLUMN_PROCESS_ID).toString(); String processDefName = ds.getValueAt(rowIndex, COLUMN_PROCESS_NAME).toString(); Integer processInstanceStatus = Double.valueOf(ds.getValueAt(rowIndex, COLUMN_PROCESS_STATUS).toString()).intValue(); specManagementService.call((ServerTemplate serverTemplate) -> { if (serverTemplate.getContainerSpec(deploymentId).getStatus().equals(KieContainerStatus.STARTED)) { openProcessDetailsScreen(); setupDetailBreadcrumb(i18n.processDashboardName(), i18n.ProcessInstanceBreadcrumb(processInstanceId), PROCESS_INSTANCE_DETAILS_SCREEN); instanceSelectionEvent.fire(new ProcessInstanceSelectionEvent( deploymentId, processInstanceId, processDefId, processDefName, processInstanceStatus, true, serverTemplateSelectorMenuBuilder.getSelectedServerTemplate())); } else { displayWarningNotification(i18n.processDetailsNotAvailable()); tableRedraw(); } }).getServerTemplate(serverTemplateSelectorMenuBuilder.getSelectedServerTemplate()); }

Target:
public void tableCellSelected(String columnId, int rowIndex) { DataSet ds = processesTable.getDataSetHandler().getLastDataSet(); String deploymentId = ds.getValueAt(rowIndex, COLUMN_PROCESS_EXTERNAL_ID).toString(); Long processInstanceId = Double.valueOf(ds.getValueAt(rowIndex, COLUMN_PROCESS_INSTANCE_ID).toString()).longValue(); String processDefId = ds.getValueAt(rowIndex, COLUMN_PROCESS_ID).toString(); String processDefName = ds.getValueAt(rowIndex, COLUMN_PROCESS_NAME).toString(); Integer processInstanceStatus = Double.valueOf(ds.getValueAt(rowIndex, COLUMN_PROCESS_STATUS).toString()).intValue(); specManagementService.call((ServerTemplate serverTemplate) -> { if (serverTemplate != null && serverTemplate.getContainerSpec(deploymentId) != null && serverTemplate.getContainerSpec(deploymentId).getStatus().equals(KieContainerStatus.STARTED)) { openProcessDetailsScreen(); setupDetailBreadcrumb(i18n.processDashboardName(), i18n.ProcessInstanceBreadcrumb(processInstanceId), PROCESS_INSTANCE_DETAILS_SCREEN); instanceSelectionEvent.fire(new ProcessInstanceSelectionEvent( deploymentId, processInstanceId, processDefId, processDefName, processInstanceStatus, true, serverTemplateSelectorMenuBuilder.getSelectedServerTemplate())); } else { displayNotification(i18n.processDetailsNotAvailableContainerNotStarted(deploymentId)); tableRedraw(); } }).getServerTemplate(serverTemplateSelectorMenuBuilder.getSelectedServerTemplate()); }
Source:
private void initKBases(final String currentKSession) { final ArrayList<String> kbaseNames = new ArrayList<>(); if (kmodule.getKBases().isEmpty()) { addMockKBaseModel(DEFAULT_KIE_BASE, DEFAULT_KIE_SESSION); kbaseNames.add(DEFAULT_KIE_BASE); } else { for (KBaseModel kBase : kmodule.getKBases().values()) { kbaseNames.add(kBase.getName()); } } Collections.sort(kbaseNames, new Comparator<String>() { @Override public int compare(final String first, final String other) { return first.compareToIgnoreCase(other); } }); if (isNotNullOrEmpty(currentKSession) && !kmoduleContainsCurrentKSession(currentKSession)) { addMockKBaseModel(NON_EXISTING_KBASE, currentKSession); kbaseNames.add(NON_EXISTING_KBASE); view.showWarningSelectedKSessionDoesNotExist(); } view.addKBases(kbaseNames.toArray(new String[kbaseNames.size()])); }

Target:
private void initKBases(final String currentKSession) { final ArrayList<String> kbaseNames = new ArrayList<>(); if (kmodule.getKBases().isEmpty()) { addMockKBaseModel(DEFAULT_KIE_BASE, DEFAULT_KIE_SESSION); kbaseNames.add(DEFAULT_KIE_BASE); } else { for (KBaseModel kBase : kmodule.getKBases().values()) { kbaseNames.add(kBase.getName()); } } Collections.sort(kbaseNames, (first, other) -> first.compareToIgnoreCase(other)); if (isNotNullOrEmpty(currentKSession) && !kmoduleContainsCurrentKSession(currentKSession)) { addMockKBaseModel(NON_EXISTING_KBASE, currentKSession); kbaseNames.add(NON_EXISTING_KBASE); view.showWarningSelectedKSessionDoesNotExist(); } view.addKBases(kbaseNames.toArray(new String[kbaseNames.size()])); }
Source:
private final void fillMenu(final MenuManager manager) { manager.removeAll(); final List<IPerspectiveDescriptor> persps = getPerspectiveItems(); Collections.sort(persps, comparator); final List<IAction> actions = new ArrayList<>(persps.size()); for (IPerspectiveDescriptor descriptor : persps) { final IAction action = getAction(descriptor.getId()); if (action != null) { if (WorkbenchActivityHelper.filterItem(action)) { continue; } actions.add(action); } } for (IAction iAction : actions) { manager.add(iAction); } if (PrefUtil.getAPIPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_OTHER_IN_PERSPECTIVE_MENU)) { if (actions.size() > 0) { manager.add(new Separator()); } manager.add(openOtherAction); } }

Target:
private final void fillMenu(final MenuManager manager) { manager.removeAll(); final List<IPerspectiveDescriptor> persps = getPerspectiveItems(); Collections.sort(persps, comparator); final List<IAction> actions = new ArrayList<>(persps.size()); for (IPerspectiveDescriptor descriptor : persps) { final IAction action = getAction(descriptor.getId()); if (action != null) { if (WorkbenchActivityHelper.filterItem(action)) { continue; } actions.add(action); } } for (IAction action : actions) { manager.add(action); } if (PrefUtil.getAPIPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_OTHER_IN_PERSPECTIVE_MENU)) { if (actions.size() > 0) { manager.add(new Separator()); } manager.add(openOtherAction); } }
Source:
private static String cssStyleTheme() { if (K9.getK9MessageViewTheme() == K9.Theme.DARK) { return "<style type=\"text/css\">" + "* { background: black ! important; color: #F3F3F3 !important }" + ":link, :link * { color: #CCFF33 !important }" + ":visited, :visited * { color: #551A8B !important }</style> "; } return ""; }

Target:
private static String cssStyleTheme() { if (K9.getK9MessageViewTheme() == K9.Theme.DARK) { return "<style type=\"text/css\">" + "* { background: black ! important; color: #F3F3F3 !important }" + ":link, :link * { color: #CCFF33 !important }" + ":visited, :visited * { color: #551A8B !important }</style> "; } else { return ""; } }
Source:
public Token<OzoneTokenIdentifier> getDelegationToken(Text renewer) throws IOException { Token<OzoneTokenIdentifier> token = ozoneManagerClient.getDelegationToken(renewer); if (token != null) { Text dtService = getOMProxyProvider().getProxy().getDelegationTokenService(); token.setService(dtService); LOG.info("Created " + token.toString()); } else { LOG.info("Cannot get ozone delegation token from " + renewer); } return token; }

Target:
public Token<OzoneTokenIdentifier> getDelegationToken(Text renewer) throws IOException { Token<OzoneTokenIdentifier> token = ozoneManagerClient.getDelegationToken(renewer); if (token != null) { Text dtService = getOMProxyProvider().getProxy().getDelegationTokenService(); token.setService(dtService); LOG.debug("Created token {}", token); } else { LOG.debug("Cannot get ozone delegation token from {}", renewer); } return token; }
Source:
public List<AtlasObjectId> getItemsToExport(AtlasReplInfo atlasReplInfo, String srcAtlasServerName) { List<AtlasObjectId> atlasObjectIds = new ArrayList<>(); final String qualifiedName = getQualifiedName(srcAtlasServerName, atlasReplInfo.getSrcDB()); atlasObjectIds.add(new AtlasObjectId(ATLAS_TYPE_HIVE_DB, ATTRIBUTE_QUALIFIED_NAME, qualifiedName)); return atlasObjectIds; }

Target:
private List<AtlasObjectId> getItemsToExport(AtlasReplInfo atlasReplInfo, String srcAtlasServerName) { List<AtlasObjectId> atlasObjectIds = new ArrayList<>(); final String qualifiedName = getQualifiedName(srcAtlasServerName, atlasReplInfo.getSrcDB()); atlasObjectIds.add(new AtlasObjectId(ATLAS_TYPE_HIVE_DB, ATTRIBUTE_QUALIFIED_NAME, qualifiedName)); return atlasObjectIds; }
Source:
public Object getItem(int position) { if (position < 0 || position >= getCount()) return ""; return mFilterValues[position]; }

Target:
public Object getItem(int position) { return mFilterValues[position]; }
Source:
public boolean run() throws InterruptedException, TransformerException, ParserConfigurationException, IOException { boolean ret = true; List<TestCase> successfulTests; if (OS.current().isPosix) { successfulTests = runPosixOnlySteps(tests); } else { successfulTests = tests; } ret &= successfulTests.size() == tests.size(); if (!skips.contains(KTestStep.KOMPILE)) { List<TestCase> testsIn = successfulTests; successfulTests = runKompileSteps(filterSkips(testsIn, KTestStep.KOMPILE)); ret &= successfulTests.size() == testsIn.size(); } if (!skips.contains(KTestStep.PDF)) ret &= runPDFSteps(filterSkips(successfulTests, KTestStep.PDF)); if (!skips.contains(KTestStep.KRUN)) ret &= runKRunSteps(filterSkips(successfulTests, KTestStep.KRUN)); String colorCode = ColorUtil.RgbToAnsi(ret ? "green" : "red", colorSetting, Color.BLACK); String msg = ret ? "SUCCESS" : "FAIL (see details above)"; System.out.format("%n%s%s%s%n", colorCode, msg, ColorUtil.ANSI_NORMAL); printTimeInfo(); if (reportGen != null) reportGen.save(); return ret; }

Target:
public boolean run() throws InterruptedException, TransformerException, ParserConfigurationException, IOException { boolean ret = true; List<TestCase> successfulTests; if (OS.current().isPosix) { successfulTests = runPosixOnlySteps(tests); } else { successfulTests = tests; } ret &= successfulTests.size() == tests.size(); if (!skips.contains(KTestStep.KOMPILE)) { List<TestCase> testsIn = successfulTests; successfulTests = runKompileSteps(filterSkips(testsIn, KTestStep.KOMPILE)); ret &= successfulTests.size() == testsIn.size(); } if (!skips.contains(KTestStep.PDF)) ret &= runPDFSteps(filterSkips(successfulTests, KTestStep.PDF)); if (!skips.contains(KTestStep.KRUN)) ret &= runKRunSteps(filterSkips(successfulTests, KTestStep.KRUN)); String colorCode = ColorUtil.RgbToAnsi(ret ? Color.GREEN : Color.RED, colorSetting, Color.BLACK); String msg = ret ? "SUCCESS" : "FAIL (see details above)"; System.out.format("%n%s%s%s%n", colorCode, msg, ColorUtil.ANSI_NORMAL); printTimeInfo(); if (reportGen != null) reportGen.save(); return ret; }
Source:
public String name() { try { return new JdkRequest(UriBuilder.fromUri(this.home).build()) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/rule/name/text()") .get(0); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public String name() { try { return new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/rule/name/text()") .get(0); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
public <T2> Tuple2<T1, T2> concat(Tuple1<T2> tuple) { return Tuple.of(_1, tuple._1); }

Target:
public <T2> Tuple2<T1, T2> concat(Tuple1<T2> tuple) { Objects.requireNonNull(tuple, "tuple is null"); return Tuple.of(_1, tuple._1); }
Source:
public static void setUpBeforeClass() throws Exception { project = ResourcesPlugin.getWorkspace().getRoot().getProject("test"); project.create(new NullProgressMonitor()); project.open(new NullProgressMonitor()); file = project.getFile("foo.txt"); file.create(new ByteArrayInputStream("'test'".getBytes()), true, new NullProgressMonitor()); }

Target:
public static void setUpBeforeClass() throws Exception { GenericEditorTestUtils.setUpBeforeClass(); }